uboot阶段可以正常的对nand进行擦除和读写,如下图
启动kernel之后,在kernel阶段却会出现no nand device,如下图
下图是我的设备树引脚配置和gpmc相关的nand配置
gpmc_pins: pinmux_gpmc_pins { pinctrl-single,pins = < 0x0 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */ 0x4 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad1.gpmc_ad1 */ 0x8 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad2.gpmc_ad2 */ 0xc (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad3.gpmc_ad3 */ 0x10 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad4.gpmc_ad4 */ 0x14 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad5.gpmc_ad5 */ 0x18 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */ 0x1c (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */ 0x20 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad8.gpmc_ad8 */ 0x24 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad9.gpmc_ad9 */ 0x28 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad10.gpmc_ad10 */ 0x2c (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad11.gpmc_ad11 */ 0x30 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad12.gpmc_ad12 */ 0x34 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad13.gpmc_ad13 */ 0x38 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad14.gpmc_ad14 */ 0x3c (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad15.gpmc_ad15 */ 0x70 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */ 0x74 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wpn.gpmc_wpn */ 0x7c (PIN_OUTPUT | MUX_MODE0) /* gpmc_csn0.gpmc_csn0 NAND */ //0x80 (PIN_OUTPUT | MUX_MODE0) /* gpmc_csn1.gpmc_csn1 Ext_IF */ //0x84 (PIN_OUTPUT | MUX_MODE0) /* gpmc_csn2.gpmc_csn2 Ext_IF */ //0x8c (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_clk.gpmc_wait1 */ 0x90 (PIN_OUTPUT | MUX_MODE0) /* gpmc_advn_ale.gpmc_advn_ale */ 0x94 (PIN_OUTPUT | MUX_MODE0) /* gpmc_oen_ren.gpmc_oen_ren */ 0x98 (PIN_OUTPUT | MUX_MODE0) /* gpmc_wen.gpmc_wen */ 0x9c (PIN_OUTPUT | MUX_MODE0) /* gpmc_be0n_cle.gpmc_be0n_cle */ 0xa0 (PIN_OUTPUT | MUX_MODE1) /* lcd_data0.gpmc_a0 */ 0xa4 (PIN_OUTPUT | MUX_MODE1) /* lcd_data1.gpmc_a1 */ 0xa8 (PIN_OUTPUT | MUX_MODE1) /* lcd_data2.gpmc_a2 */ 0xac (PIN_OUTPUT | MUX_MODE1) /* lcd_data3.gpmc_a3 */ 0xb0 (PIN_OUTPUT | MUX_MODE1) /* lcd_data4.gpmc_a4 */ 0xb4 (PIN_OUTPUT | MUX_MODE1) /* lcd_data5.gpmc_a5 */ 0xb8 (PIN_OUTPUT | MUX_MODE1) /* lcd_data6.gpmc_a6 */ 0xbc (PIN_OUTPUT | MUX_MODE1) /* lcd_data7.gpmc_a7 */ 0xc0 (PIN_OUTPUT | MUX_MODE1) /* lcd_data8.gpmc_a12 */ 0xc4 (PIN_OUTPUT | MUX_MODE1) /* lcd_data9.gpmc_a13 */ 0xc8 (PIN_OUTPUT | MUX_MODE1) /* lcd_data10.gpmc_a14 */ 0xcc (PIN_OUTPUT | MUX_MODE1) /* lcd_data11.gpmc_a15 */ 0xd0 (PIN_OUTPUT | MUX_MODE1) /* lcd_data12.gpmc_a16 */ 0xd4 (PIN_OUTPUT | MUX_MODE1) /* lcd_data13.gpmc_a17 */ 0xd8 (PIN_OUTPUT | MUX_MODE1) /* lcd_data14.gpmc_a18 */ 0xdc (PIN_OUTPUT | MUX_MODE1) /* lcd_data15.gpmc_a19 */ 0xe0 (PIN_OUTPUT | MUX_MODE1) /* lcd_vsync.gpmc_a8 */ 0xe4 (PIN_OUTPUT | MUX_MODE1) /* lcd_hsync.gpmc_a9 */ 0xe8 (PIN_OUTPUT | MUX_MODE1) /* lcd_pclk.gpmc_a10 */ 0xec (PIN_OUTPUT | MUX_MODE1) /* lcd_ac_bias_en.gpmc_a11 */ >; };
&gpmc { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&gpmc_pins>; ranges = <0 0 0x08000000 0x1000000 /* CS0: 16MB for NAND *///1 0 0x10000000 0x1000000 /* CS1: 16MB for EXT-IF1 */// 2 0 0x11000000 0x1000000 /* CS2: 16MB for EXT-IF2 */ >; nand@0,0 { compatible = "ti,omap2-nand"; reg = <0 0 4>; /* CS0, offset 0, IO size 4 */ interrupt-parent = <&gpmc>; interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */<1 IRQ_TYPE_NONE>; /* termcount */ rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */ ti,nand-xfer-type = "prefetch-dma"; ti,nand-ecc-opt = "bch8"; ti,elm-id = <&elm>; nand-bus-width = <8>; gpmc,device-width = <1>; gpmc,sync-clk-ps = <0>; gpmc,cs-on-ns = <0>; gpmc,cs-rd-off-ns = <44>; gpmc,cs-wr-off-ns = <44>; gpmc,adv-on-ns = <6>; gpmc,adv-rd-off-ns = <34>; gpmc,adv-wr-off-ns = <44>; gpmc,we-on-ns = <0>; gpmc,we-off-ns = <40>; gpmc,oe-on-ns = <0>; gpmc,oe-off-ns = <54>; gpmc,access-ns = <64>; gpmc,rd-cycle-ns = <82>; gpmc,wr-cycle-ns = <82>; gpmc,bus-turnaround-ns = <0>; gpmc,cycle2cycle-delay-ns = <0>; gpmc,clk-activation-ns = <0>; gpmc,wr-access-ns = <40>; gpmc,wr-data-mux-bus-ns = <0>; /* MTD partition table */ /* All SPL-* partitions are sized to minimal length* which can be independently programmable. For* NAND flash this is equal to size of erase-block */ #address-cells = <1>; #size-cells = <1>; partition@0 { label = "NAND.SPL"; reg = <0x00000000 0x000020000>; }; partition@1 { label = "NAND.SPL.backup1"; reg = <0x00020000 0x00020000>; }; partition@2 { label = "NAND.SPL.backup2"; reg = <0x00040000 0x00020000>; }; partition@3 { label = "NAND.SPL.backup3"; reg = <0x00060000 0x00020000>; }; partition@4 { label = "NAND.u-boot-spl-os"; reg = <0x00080000 0x00040000>; }; partition@5 { label = "NAND.u-boot"; reg = <0x000C0000 0x00100000>; }; partition@6 { label = "NAND.u-boot-env"; reg = <0x001C0000 0x00020000>; }; partition@7 { label = "NAND.u-boot-env.backup1"; reg = <0x001E0000 0x00020000>; }; partition@8 { label = "NAND.kernel"; reg = <0x00200000 0x00800000>; }; partition@9 { label = "NAND.file-system"; reg = <0x00A00000 0x0F600000>; }; };
user6163268:
我从tftp启动内核,发现问题并不是nand,我把错误信息贴出来,这里已经把nand相关的节点都注释掉了
[1.481483] omap-gpmc 50000000.gpmc: GPMC revision 6.0 [1.481499] gpmc_mem_in[1.481510] gpiochip_find_base: found new base at 510 [1.481695] gpiochip_add: registered GPIOs 510 to 511 on device: omap-gpmc [1.508916] tps65910 0-002d: No interrupt support, no core IRQ [1.531206] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz [1.539780] omap_hsmmc 48060000.mmc: GPIO lookup for consumer cd [1.539790] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup [1.539804] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@48060000[0]' [1.539811] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@48060000[0]' [1.539817] omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup [1.539825] omap_hsmmc 48060000.mmc: lookup for GPIO cd failed [1.539835] omap_hsmmc 48060000.mmc: GPIO lookup for consumer wp [1.539841] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup [1.539847] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@48060000[0]' [1.539853] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@48060000[0]' [1.539859] omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup [1.539865] omap_hsmmc 48060000.mmc: lookup for GPIO wp failed [1.548892] vmmc: supplied by vbat [1.588956] vdd_mpu: supplied by vbat [1.590397] Unable to handle kernel NULL pointer dereference at virtual address 00000003 [1.590405] pgd = c0004000 [1.590413] [00000003] *pgd=00000000 [1.590425] Internal error: Oops: 5 [#1] PREEMPT ARM [1.590434] Modules linked in: [1.590447] CPU: 0 PID: 1 Comm: swapper Not tainted 4.1.18-rt17-g4415f52 #3 [1.590450] Hardware name: Generic AM33XX (Flattened Device Tree) [1.590455] task: cf04c000 ti: cf046000 task.ti: cf046000 [1.590475] PC is at drm_gem_object_lookup+0x2c/0xc4 [1.590479] LR is at drm_gem_object_lookup+0x20/0xc4 [1.590485] pc : [<c03a2800>]lr : [<c03a27f4>]psr: 20000113 [1.590485] sp : cf047ce8ip : 00000000fp : cf047d04 [1.590489] r10: 00000000r9 : c03cee94r8 : c03cee94 [1.590493] r7 : c03cee94r6 : cf402654r5 : cf402608r4 : e1a0c00d [1.590496] r3 : 00000003r2 : cf04c000r1 : 00000000r0 : cf402654 [1.590503] Flags: nzCvIRQs onFIQs onMode SVC_32ISA ARMSegment kernel [1.590508] Control: 10c5387dTable: 80004019DAC: 00000015 [1.590511] Process swapper (pid: 1, stack limit = 0xcf046210) [1.590516] Stack: (0xcf047ce8 to 0xcf048000) [1.590525] 7ce0:e24cb004 e92dd800 00000000 c03cee94 cf047d54 cf047d08 [1.590531] 7d00: c039e604 c03a27e0 00000001 cf402608 00000001 cf02e280 c062b5ec c005da30 [1.590539] 7d20: cf079600 00000000 cf047d5c cf402608 cf02e280 c067ef20 00000000 cf02c800 [1.590546] 7d40: c07d3e40 00000000 cf047d64 cf047d58 c03ceea4 c039e5a0 cf047db4 cf047d68 [1.590553] 7d60: c02ba8a8 c03ceea0 cf047dc4 cf047d78 c03dc584 c00ec344 cf047d84 00000000 [1.590559] 7d80: cf047db4 00000000 00000000 cf402608 cf402600 00000000 00000000 cf02c800 [1.590566] 7da0: 00000000 00000000 cf047dc4 cf047db8 c02bad58 c02ba840 cf047e04 cf047dc8 [1.590573] 7dc0: c03d4d60 c02bad50 3a303121 00003835 00000000 00a0003a cf047e04 00000000 [1.590580] 7de0: cf402600 cf402608 c08dc0ec 00000000 00a0003a 00000000 cf047e2c cf047e08 [1.590587] 7e00: c03d50b0 c03d49b8 00000000 c08dc0f8 c0921180 c0921c4c c08ee000 c089c418 [1.590594] 7e20: cf047e5c cf047e30 c03d5154 c03d5014 00000000 c07b34b8 cf047e68 c08dc0dc [1.590601] 7e40: cf047e5c cf047e68 c062d6fc c08dc0ec cf047e8c cf047e60 c038cdf8 c03d5138 [1.590608] 7e60: 00000000 c07b34b8 c07fa49c c03d8004 cf047e8c 00000000 c0921c4c c08a202c [1.590616] 7e80: cf047ecc cf047e90 c088cd78 c038cd44 c08ee000 c08a813c cf047ec0 cf047ea8 [1.590623] 7ea0: c02c2ec0 c02c2e34 c08ae8a0 c088cce4 c08ae8a0 cf403dc0 c08ee000 c089c418 [1.590630] 7ec0: cf047f4c cf047ed0 c0009684 c088ccf0 cf047efc cf047ee0 cf047f04 cf047ee8 [1.590637] 7ee0: c0866600 c02bd7d4 c0863528 cffff517 cffff514 c0652158 cf047f4c cf047f08 [1.590644] 7f00: c004deec c08665f4 c005d2b4 00000007 00000007 cffff51b c07a2da4 00000000 [1.590651] 7f20: c006054c 00000007 c089c414 c08ee000 c08a813c c08ee000 c089c418 c08665e8 [1.590658] 7f40: cf047f94 cf047f50 c0866e08 c0009608 00000007 00000007 c08665e8 00000000 [1.590665] 7f60: 00000000 000000a3 00000000 00000000 c0625d64 00000000 00000000 00000000 [1.590672] 7f80: 00000000 00000000 cf047fac cf047f98 c0625d74 c0866d18 00000000 c0625d64 [1.590678] 7fa0: 00000000 cf047fb0 c000f8a8 c0625d70 00000000 00000000 00000000 00000000 [1.590685] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [1.590691] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [1.590695] Backtrace:[1.590711] [<c03a27d4>] (drm_gem_object_lookup) from [<c039e604>] (drm_fb_cma_create+0x70/0x24c) [1.590720]r7:c03cee94 r6:00000000 r5:e92dd800 r4:e24cb004 [1.590737] [<c039e594>] (drm_fb_cma_create) from [<c03ceea4>] (tilcdc_fb_create+0x10/0x14) [1.590747]r10:00000000 r9:c07d3e40 r8:cf02c800 r7:00000000 r6:c067ef20 r5:cf02e280 [1.590750]r4:cf402608 [1.590763] [<c03cee94>] (tilcdc_fb_create) from [<c02ba8a8>] (kobject_uevent_env+0x74/0x510) [1.590769] [<c02ba834>] (kobject_uevent_env) from [<c02bad58>] (kobject_uevent+0x14/0x18) [1.590779]r10:00000000 r9:00000000 r8:cf02c800 r7:00000000 r6:00000000 r5:cf402600 [1.590782]r4:cf402608 [1.590793] [<c02bad44>] (kobject_uevent) from [<c03d4d60>] (device_add+0x3b4/0x568) [1.590800] [<c03d49ac>] (device_add) from [<c03d50b0>] (device_create_groups_vargs+0xa8/0xc4) [1.590810]r10:00000000 r9:00a0003a r8:00000000 r7:c08dc0ec r6:cf402608 r5:cf402600 [1.590813]r4:00000000 [1.590821] [<c03d5008>] (device_create_groups_vargs) from [<c03d5154>] (device_create_with_groups+0x28/0x30) [1.590830]r9:c089c418 r8:c08ee000 r7:c0921c4c r6:c0921180 r5:c08dc0f8 r4:00000000 [1.590854] [<c03d512c>] (device_create_with_groups) from [<c038cdf8>] (misc_register+0xc0/0x134) [1.590857]r4:c08dc0ec [1.590869] [<c038cd38>] (misc_register) from [<c088cd78>] (ubi_init+0x94/0x2a8) [1.590875]r6:c08a202c r5:c0921c4c r4:00000000 [1.590886] [<c088cce4>] (ubi_init) from [<c0009684>] (do_one_initcall+0x88/0x1e0) [1.590896]r9:c089c418 r8:c08ee000 r7:cf403dc0 r6:c08ae8a0 r5:c088cce4 r4:c08ae8a0 [1.590906] [<c00095fc>] (do_one_initcall) from [<c0866e08>] (kernel_init_freeable+0xfc/0x1c0) [1.590916]r10:c08665e8 r9:c089c418 r8:c08ee000 r7:c08a813c r6:c08ee000 r5:c089c414 [1.590919]r4:00000007 [1.590935] [<c0866d0c>] (kernel_init_freeable) from [<c0625d74>] (kernel_init+0x10/0xf4) [1.590944]r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0625d64 [1.590947]r4:00000000 [1.590961] [<c0625d64>] (kernel_init) from [<c000f8a8>] (ret_from_fork+0x14/0x2c) [1.590966]r5:c0625d64 r4:00000000 [1.590974] Code: eb0a2b5a e5953020 e3530000 0a000003 (e5932000)[1.590986] ---[ end trace 0000000000000002 ]--- [1.591058] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b [1.591058][2.392839] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b [2.392839][2.393038] Unable to handle kernel paging request at virtual address e3a03029 [2.393042] pgd = c0004000 [2.393046] [e3a03029] *pgd=00000000 [2.393051] Internal error: Oops: 5 [#2] PREEMPT ARM [2.393056] Modules linked in: [2.393067] CPU: 0 PID: 7 Comm: rcu_preempt Tainted: GD4.1.18-rt17-g4415f52 #3 [2.393070] Hardware name: Generic AM33XX (Flattened Device Tree) [2.393073] task: cf04e100 ti: cf06c000 task.ti: cf06c000 [2.393095] PC is at __note_gp_changes+0x88/0xd0 [2.393100] LR is at __note_gp_changes+0xa8/0xd0 [2.393105] pc : [<c006ebfc>]lr : [<c006ec1c>]psr: 00000193 [2.393105] sp : cf06df20ip : 00000001fp : cf06df34 [2.393108] r10: cf06c000r9 : c08ac134r8 : c08eb519 [2.393112] r7 : c08b954cr6 : c08b9bd0r5 : c08b9490r4 : c08b997c [2.393115] r3 : 00000000r2 : e3a03001r1 : 00000001r0 : 00000000 [2.393120] Flags: nzcvIRQs offFIQs onMode SVC_32ISA ARMSegment kernel [2.393124] Control: 10c5387dTable: 80004019DAC: 00000015 [2.393127] Process rcu_preempt (pid: 7, stack limit = 0xcf06c210) [2.393131] Stack: (0xcf06df20 to 0xcf06e000) [2.393139] df20: c08b9490 c08b9490 cf06df64 cf06df38 c006f494 c006eb80 00000000 c08b954c [2.393146] df40: 0006df64 cf04e100 cf06df48 cf06df48 c08b9490 c006efd4 cf06dfac cf06df68 [2.393153] df60: c004e774 c006efe0 00000000 00000000 00000000 c08b9490 00000000 cf06df7c [2.393160] df80: cf06df7c 00000000 cf06df88 cf06df88 cf02c040 c004e6a8 00000000 00000000 [2.393167] dfa0: 00000000 cf06dfb0 c000f8a8 c004e6b4 00000000 00000000 00000000 00000000 [2.393174] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [2.393180] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [2.393183] Backtrace:[2.393197] [<c006eb74>] (__note_gp_changes) from [<c006f494>] (rcu_gp_kthread+0x4c0/0xac8) [2.393203]r5:c08b9490 r4:c08b9490 [2.393214] [<c006efd4>] (rcu_gp_kthread) from [<c004e774>] (kthread+0xcc/0xe4) [2.393217]r7:c006efd4 [2.393227] [<c004e6a8>] (kthread) from [<c000f8a8>] (ret_from_fork+0x14/0x2c) [2.393233]r7:00000000 r6:00000000 r5:c004e6a8 r4:cf02c040 [2.393239] Code: 13a01001 01a01003 e5843018 e5c4100d (e5922028)i01 01a01003 e5843018 e5c4100d (e5922028)[2.662195] ---[ end trace 0000000000000003 ]--- [2.662202] note: rcu_preempt[7] exited with preempt_count 1 [2.683966]remoteproc0: Falling back to user helper
Shine:
回复 user6163268:
设备树里有定义rtc吗?有的话,请把rtc remove掉试试。
user6163268:
回复 Shine:
rtc我注释掉了,还是没有什么改善
每次错误的指针都是定位在PC is at __note_gp_changes+0x88/0xd0
Shine:
回复 user6163268:
请问您的问题解决了没?没有的话,我去问问e2e。