[OpenWrt-Devel] [PATCH 1/3] ipq806x: Add ADM support

Jonas Gorski jogo at openwrt.org
Fri Aug 7 09:38:34 EDT 2015


Hi,

On Fri, Aug 7, 2015 at 4:28 AM, Mathieu Olivari <mathieu at codeaurora.org> wrote:
> These are cherry-picked & backported from LKML:
> *https://lkml.org/lkml/2015/3/17/19
>
> They are enabled on both 3.18 and 4.1 kernel. Patches 150 to 154 are
> applying changes merged since 3.18; they enable mechanisms used by the
> ADM driver.
>
> ADM engine is used by the NAND controller, so it is necessary to
> bring-up NAND flash support.
>
> Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
> ---

(snip)

> diff --git a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
> new file mode 100644
> index 0000000..64b0022
> --- /dev/null
> +++ b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
> @@ -0,0 +1,54 @@
> +From 1fb18acab2d71e7e4efd9c10492edb1baf84dcc0 Mon Sep 17 00:00:00 2001
> +From: Andy Gross <agross at codeaurora.org>
> +Date: Wed, 20 May 2015 15:41:07 +0530
> +Subject: [PATCH] ARM: DT: ipq8064: Add ADM device node
> +
> +This patch adds support for the ADM DMA on the IPQ8064 SOC
> +
> +Signed-off-by: Andy Gross <agross at codeaurora.org>
> +---
> + arch/arm/boot/dts/qcom-ipq8064-ap148.dts |  4 ++++
> + arch/arm/boot/dts/qcom-ipq8064.dtsi      | 21 +++++++++++++++++++++
> + 2 files changed, 25 insertions(+)
> +
> +--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
> ++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
> +@@ -90,6 +90,10 @@
> +
> +                               cs-gpios = <&qcom_pinmux 20 0>;
> +
> ++                              dmas = <&adm_dma 6>,
> ++                                      <&adm_dma 5>;
> ++                              dma-names = "rx", "tx";
> ++

This breaks spi flash access, and accesses to mtd partitions produce
oopses and hang the system. Removing the dma-properties "fixes" it
again. Interestingly the errors are different on 3.18 and 4.1. Also I
wonder if these were really intended to be added to ap148.dts instead
of ipq8064 dtsi - and if so, if the dma-controller should have been
set to "ok" in the .dts as well.


Jonas


3.18:
root at OpenWrt:/# dd if=/dev/mtd4 of=/dev/null
[   37.896768] adm-dma-engine 18300000.dma: invalid crci value
[   37.896820] Unable to handle kernel NULL pointer dereference at
virtual address 00000002
[   37.901146] pgd = c0204000
[   37.909579] [00000002] *pgd=00000000
[   37.915469] Internal error: Oops: 817 [#1] PREEMPT SMP ARM
[   37.915638] Modules linked in: pppoe ppp_async iptable_nat pppox
ppp_generic nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT
ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark
xt_mac xt_limit xt_id xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT
xt_LOG xt_CT slhc nf_reject_ipv4 nf_nat_masquerade_ipv4 nf_nat_ftp
nf_nat nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache
nf_conntrack_ftp nf_conntrack iptable_raw iptable_mangle
iptable_filter ip_tables crc_ccitt ledtrig_usbdev ip6t_REJECT
nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_raw ip6table_mangle
ip6table_filter ip6_tables x_tables ipv6 leds_gpio xhci_plat_hcd
xhci_pci xhci_hcd dwc3 dwc3_qcom ohci_platform ohci_hcd phy_qcom_dwc3
ahci ehci_platform ehci_hcd sd_mod ahci_platform libahci_platform
libahci libata scsi_mod gpio_button_hotplug usbcore nls_base
usb_common
[   37.996970] CPU: 0 PID: 33 Comm: spi32766 Not tainted 3.18.19 #2
[   37.997238] task: dc52c000 ti: dc526000 task.ti: dc526000
[   38.003323] PC is at spi_qup_transfer_one+0x658/0xbf8
[   38.008614] LR is at adm_prep_slave_sg+0x11c/0x598
[   38.013644] pc : [<c04385bc>]    lr : [<c03cb6e4>]    psr: 60000013
[   38.013644] sp : dc527e40  ip : 00000003  fp : 00000000
[   38.018339] r10: dc527e88  r9 : 00000000  r8 : 00000000
[   38.029702] r7 : 00000200  r6 : 00000200  r5 : dc725e1c  r4 : dd57ddd8
[   38.034910] r3 : ffffffea  r2 : dd57de8c  r1 : c04376d4  r0 : ffffffea
[   38.041509] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
Segment kernel
[   38.048021] Control: 10c5787d  Table: 5e2d006a  DAC: 00000015
[   38.055222] Process spi32766 (pid: 33, stack limit = 0xdc526238)
[   38.061127] Stack: (0xdc527e40 to 0xdc528000)
[   38.067202] 7e40: 00000000 00000000 dc527e84 c04376d4 00000000
5e713600 00000000 00000000
[   38.071460] 7e60: 00000000 dd57ddec dc725c90 00000000 000014a0
00000000 01b11f84 c0b1d500
[   38.079619] 7e80: dc52c000 00000000 00000002 00000000 00000200
5e713600 dd4d2aa0 40000013
[   38.087778] 7ea0: dc526038 c02118a8 c05de384 dc725e1c dc725db0
dd57dc00 00000000 c0b326fc
[   38.095939] 7ec0: 00000000 00001f40 dd57dd94 c043652c 00000001
00000000 dc527eec dd57dd7c
[   38.104100] 7ee0: dd57dd6c dc725db0 dd57dc00 dc526038 00000000
00000001 dc526038 c0436c70
[   38.112259] 7f00: c0b1d500 c0b1d500 c0b2a208 dc526038 00000001
dd57dd6c dd57dd54 c0b7eec8
[   38.120417] 7f20: dc526000 dc526038 00000000 00000001 dc526038
c023c98c dd57dd58 c0b7eec8
[   38.128577] 7f40: 00000000 dc517680 00000000 dd57dd54 c023c8ac
00000000 00000000 00000000
[   38.136740] 7f60: 00000000 c023c8a8 17587f16 00000000 deff7575
dd57dd54 00000000 00000000
[   38.144897] 7f80: dc527f80 dc527f80 00000000 00000000 dc527f90
dc527f90 dc527fac dc517680
[   38.153057] 7fa0: c023c7bc 00000000 00000000 c0208e20 00000000
00000000 00000000 00000000
[   38.161216] 7fc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[   38.169377] 7fe0: 00000000 00000000 00000000 00000000 00000013
00000000 1f77f542 aeaef472
[   38.177548] [<c04385bc>] (spi_qup_transfer_one) from [<c043652c>]
(spi_transfer_one_message+0x74/0x1d0)
[   38.185702] [<c043652c>] (spi_transfer_one_message) from
[<c0436c70>] (spi_pump_messages+0x3d4/0x3f0)
[   38.194907] [<c0436c70>] (spi_pump_messages) from [<c023c98c>]
(kthread_worker_fn+0xe0/0x174)
[   38.204279] [<c023c98c>] (kthread_worker_fn) from [<c023c8a8>]
(kthread+0xec/0xf0)
[   38.212783] [<c023c8a8>] (kthread) from [<c0208e20>]
(ret_from_fork+0x14/0x34)
[   38.220245] Code: e3300000 1afffffa e59d100c e1a00003 (e5834018)
[   38.228498] ---[ end trace 17614169e0a75860 ]---

4.1:
root at OpenWrt:/# dd if=/dev/mtd4 of=/dev/null
[   29.476222] adm-dma-engine 18300000.dma: invalid burst value: 0
[   29.476302] Unable to handle kernel paging request at virtual
address fffffffe
[   29.481127] pgd = dc274000
[   29.488239] [fffffffe] *pgd=5fffd821, *pte=00000000, *ppte=00000000
[   29.496921] Internal error: Oops: 817 [#1] PREEMPT SMP ARM
[   29.497272] Modules linked in: pppoe ppp_async iptable_nat pppox
ppp_generic nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT
ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark
xt_mac xt_limit xt_id xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT
xt_LOG xt_CT slhc nf_reject_ipv4 nf_nat_redirect
nf_nat_masquerade_ipv4 nf_nat_ftp nf_nat nf_log_ipv4 nf_defrag_ipv6
nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack_ftp nf_conntrack
iptable_raw iptable_mangle iptable_filter ip_tables crc_ccitt
ledtrig_usbdev ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common
ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables ipv6
leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom ohci_platform
ohci_hcd ahci ehci_platform ehci_hcd sd_mod ahci_platform
libahci_platform libahci libata scsi_mod gpio_button_hotplug usbcore
nls_base usb_common
[   29.578778] CPU: 0 PID: 629 Comm: dd Not tainted 4.1.4 #2
[   29.579039] Hardware name: Qualcomm (Flattened Device Tree)
[   29.584425] task: dc70c440 ti: dc720000 task.ti: dc720000
[   29.589816] PC is at spi_qup_prep_sg+0x58/0x7c
[   29.595373] LR is at adm_prep_slave_sg+0xe4/0x598
[   29.599704] pc : [<c044a75c>]    lr : [<c03d9cd0>]    psr: a0000013
[   29.599704] sp : dc721c60  ip : 00000003  fp : dc44ba1c
[   29.604484] r10: dc44b800  r9 : 00000000  r8 : 00000001
[   29.615759] r7 : dc44ba7c  r6 : 00000021  r5 : c044a8c8  r4 : dc44ba68
[   29.620972] r3 : dc8ba304  r2 : ffffffea  r1 : c05c4110  r0 : ffffffea
[   29.627573] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   29.634078] Control: 10c5787d  Table: 5e27406a  DAC: 00000015
[   29.641282] Process dd (pid: 629, stack limit = 0xdc720210)
[   29.647011] Stack: (0xdc721c60 to 0xdc722000)
[   29.652396] 1c60: 00000021 00000000 00000000 dc721d78 dc44ba68
c044b6ec c044b410 dc721d78
[   29.656915] 1c80: dc721d48 dc44b800 dc44ba2c c0b59ea8 00000000
00001f40 dc44ba1c c04490d0
[   29.665074] 1ca0: 00000000 00000000 00000200 dc721d14 dc44b800
dc721d48 dc44ba2c dd4bde10
[   29.673234] 1cc0: dd4bde10 00000001 00000002 c0449914 00000200
00000002 00000001 00000000
[   29.681393] 1ce0: dc721cf4 dc721d48 00000000 c044a510 dc44b800
00000000 dc44ba08 dc44b9a8
[   29.689553] 1d00: dc44ba04 c0449a6c ddfc7f00 60000013 00000000
00000000 dc721d18 dc721d18
[   29.697714] 1d20: 000200da dc44bc14 dc721d48 00000000 dc4ec200
dc0bd200 00270000 dc721f80
[   29.705872] 1d40: dc4f1800 c042d140 dc721dac dc721de8 dc4ec200
00000000 c04487ac dc721d10
[   29.714034] 1d60: 00000205 00000000 ffffff8d dc721d6c dc721d6c
00000000 dc44bf18 00000000
[   29.722192] 1d80: 00000005 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[   29.730352] 1da0: 00000000 00000802 02faf080 dc721de8 dc721d48
00000000 dc0bd200 00000200
[   29.738512] 1dc0: 00000000 00000000 00000000 00000000 00000000
dc6bbf00 00000001 00000001
[   29.746672] 1de0: 00000810 02faf080 dc721d48 dc721dac dd0ff160
00270000 00000000 dc44bc14
[   29.754830] 1e00: 00000000 00000000 00000200 c0436908 00000200
dc721ea8 dc0bd200 00000000
[   29.762991] 1e20: dc721ef0 00270000 00000000 dc4f1800 00000000
c0417c70 00000200 dc721ea8
[   29.771151] 1e40: dc0bd200 00000000 00000001 00040000 00000000
00040000 00000000 dc4f1800
[   29.779311] 1e60: b6f19220 c04156dc 00000200 dc721ea8 dc0bd200
00000000 dc6bb540 00000000
[   29.787470] 1e80: dc0bd200 dc720000 00000200 c0419188 00000200
dc721ea8 dc0bd200 00060000
[   29.795631] 1ea0: dc07a790 dc6bb540 00000000 00000200 dcc18910
dd0ff110 dc585340 0000081f
[   29.803790] 1ec0: dc70c440 dc721f74 00000001 dd416000 ffffff9c
dc59d6c0 b6f19220 dc59d6c0
[   29.811950] 1ee0: dc59d6c0 00000200 b6f19220 00000000 00000000
c02c4b48 d78817d5 00000004
[   29.820109] 1f00: dd416015 b6f175a0 00000000 dd002000 dc586028
dd115088 00000000 00000020
[   29.828269] 1f20: dc0b48c8 c02d8b28 00000001 00000001 dc721f44
dd401b80 dc59d6c0 b6f19220
[   29.836429] 1f40: dc59d6c0 b6f19220 dc721f80 dc59d6c0 00000200
c02c5254 dc0b48c8 00000020
[   29.844588] 1f60: 00000001 00000000 00000000 dc59d6c0 dc59d6c0
00000200 b6f19220 c02c5aa4
[   29.852747] 1f80: 00000000 00000000 dc59d780 00000000 00000000
00000006 00000003 c0209d04
[   29.860907] 1fa0: dc720000 c0209b80 00000000 00000000 00000000
b6f19220 00000200 00000000
[   29.869067] 1fc0: 00000000 00000000 00000006 00000003 b6f19220
b6f19220 00000000 00000000
[   29.877226] 1fe0: bec65d18 bec65d04 b6ef0f14 b6ef3e8c 60000010
00000000 00000000 00000000
[   29.885401] [<c044a75c>] (spi_qup_prep_sg) from [<c044b6ec>]
(spi_qup_transfer_one+0x2dc/0x568)
[   29.893552] [<c044b6ec>] (spi_qup_transfer_one) from [<c04490d0>]
(spi_transfer_one_message+0x74/0x1f4)
[   29.902060] [<c04490d0>] (spi_transfer_one_message) from
[<c0449914>] (__spi_pump_messages+0x4c0/0x4d0)
[   29.911432] [<c0449914>] (__spi_pump_messages) from [<c0449a6c>]
(__spi_sync+0x13c/0x15c)
[   29.920810] [<c0449a6c>] (__spi_sync) from [<c042d140>]
(m25p80_read+0xec/0x114)
[   29.929146] [<c042d140>] (m25p80_read) from [<c0436908>]
(spi_nor_read+0x58/0x74)
[   29.936611] [<c0436908>] (spi_nor_read) from [<c0417c70>]
(part_read+0x48/0x80)
[   29.943985] [<c0417c70>] (part_read) from [<c04156dc>] (mtd_read+0x70/0xac)
[   29.951104] [<c04156dc>] (mtd_read) from [<c0419188>]
(mtdchar_read+0x11c/0x1d8)
[   29.958048] [<c0419188>] (mtdchar_read) from [<c02c4b48>]
(__vfs_read+0x20/0xcc)
[   29.965687] [<c02c4b48>] (__vfs_read) from [<c02c5254>] (vfs_read+0x7c/0x104)
[   29.973064] [<c02c5254>] (vfs_read) from [<c02c5aa4>] (SyS_read+0x40/0x80)
[   29.980094] [<c02c5aa4>] (SyS_read) from [<c0209b80>]
(ret_fast_syscall+0x0/0x3c)
[   29.986866] Code: e59ec060 e12fff3c e2502000 0a000005 (e5825014)
[   29.994658] ---[ end trace 689fb5b87e0515de ]---
Segmentation fault
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list