最近使用am3354的GPMC与FPGA做高速通信(16位地址,16位数据),使用的是linux 4.4的代码,但是设备树中不清楚如何添加GPMC的设备树
在代码中找到了NAND的设备树,但是不清楚接下来的如何编写。
我在GPMC中添加了reg = <2 0 0xFFFF>表示FPGA在CS2上,但是这个在启动时有问题:如下
&gpmc {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&nandflash_pins_s0 &gpmc_fpga_pins>;
ranges = <0 0 0x08000000 0x1000000 /* CS0: 16MB for NAND */
2 0 0x0A000000 0x1000000 /* CS2: 16MB for FPGA */
>;
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-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>;
};
};
fpga@2,2 {
reg = <2 0 0xFFFF>;
};
};
[ 1.899813] ————[ cut here ]————
[ 1.905774] WARNING: CPU: 0 PID: 44 at drivers/memory/omap-gpmc.c:1994 gpmc_p
robe_generic_child+0x474/0x7d0()
[ 1.917975] enable GPMC debug to configure .dts timings for CS2
[ 1.926157] Modules linked in:
[ 1.930342] CPU: 0 PID: 44 Comm: kworker/u2:2 Not tainted 4.4.41-gf9f6f0db2d
#19
[ 1.939989] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 1.948301] Workqueue: deferwq deferred_probe_work_func
[ 1.954691] Backtrace:
[ 1.958283] [<c0013514>] (dump_backtrace) from [<c0013710>] (show_stack+0x18/
0x1c)
[ 1.968064] r7:c0589d88 r6:000007ca r5:00000009 r4:00000000
[ 1.976016] [<c00136f8>] (show_stack) from [<c02a8924>] (dump_stack+0x24/0x28
)
[ 1.985480] [<c02a8900>] (dump_stack) from [<c0031df8>] (warn_slowpath_common
+0x88/0xb4)
[ 1.995871] [<c0031d70>] (warn_slowpath_common) from [<c0031e5c>] (warn_slowp
ath_fmt+0x38/0x40)
[ 2.006865] r8:00000000 r7:00000000 r6:c0a33b7c r5:dc116600 r4:c090ec30
[ 2.015889] [<c0031e28>] (warn_slowpath_fmt) from [<c0589d88>] (gpmc_probe_ge
neric_child+0x474/0x7d0)
[ 2.027407] r3:00000002 r2:c090ec30
[ 2.032142] r4:dcb5dbc4
[ 2.035810] [<c0589914>] (gpmc_probe_generic_child) from [<c058a568>] (gpmc_p
robe+0x484/0x5a8)
[ 2.046693] r10:dc116600 r9:c09efd28 r8:dc488a94 r7:c090ef98 r6:dc488a10 r5:
dcb5dbc4
[ 2.056871] r4:00000000
[ 2.060532] [<c058a0e4>] (gpmc_probe) from [<c03e54c4>] (platform_drv_probe+0
x58/0xb8)
[ 2.070708] r10:dc475a00 r9:00000000 r8:00000001 r7:fffffdfb r6:c09efd40 r5:
ffffffed
[ 2.080926] r4:dc116610
[ 2.084564] [<c03e546c>] (platform_drv_probe) from [<c03e39d8>] (driver_probe
_device+0x200/0x2ec)
[ 2.095716] r7:c09efd40 r6:00000000 r5:dc116610 r4:c0a319a0
[ 2.103641] [<c03e37d8>] (driver_probe_device) from [<c03e3be8>] (__device_at
tach_driver+0x8c/0xb4)
[ 2.114946] r9:00000000 r8:dc002800 r7:00000001 r6:dc116610 r5:dc49be70 r4:c
09efd40
[ 2.125059] [<c03e3b5c>] (__device_attach_driver) from [<c03e1bb8>] (bus_for_
each_drv+0x68/0x9c)
[ 2.136130] r7:00000001 r6:c03e3b5c r5:dc49be70 r4:00000000
[ 2.144089] [<c03e1b50>] (bus_for_each_drv) from [<c03e3730>] (__device_attac
h+0xb8/0x11c)
[ 2.154622] r6:c09d9fd8 r5:dc116644 r4:dc116610
[ 2.160449] [<c03e3678>] (__device_attach) from [<c03e3c5c>] (device_initial_
probe+0x14/0x18)
[ 2.171217] r7:c09d9e20 r6:c09d9fd8 r5:dc116610 r4:dc116610
[ 2.179176] [<c03e3c48>] (device_initial_probe) from [<c03e2c4c>] (bus_probe_
device+0x8c/0x94)
[ 2.190064] [<c03e2bc0>] (bus_probe_device) from [<c03e3090>] (deferred_probe
_work_func+0x6c/0x98)
[ 2.201315] r7:c09d9e20 r6:c09d9e14 r5:c09d9e14 r4:dc116610
[ 2.209329] [<c03e3024>] (deferred_probe_work_func) from [<c0047ae0>] (proces
s_one_work+0x1f0/0x428)
[ 2.220782] r7:dc484500 r6:00000000 r5:dc475a00 r4:c09d9e38
[ 2.228837] [<c00478f0>] (process_one_work) from [<c00488e4>] (worker_thread+
0x7c/0x648)
[ 2.239291] r10:dc475a00 r9:dc002800 r8:dc002810 r7:ffffe000 r6:00000088 r5:
dc475a18
[ 2.249544] r4:dc002800
[ 2.253247] [<c0048868>] (worker_thread) from [<c004dad4>] (kthread+0xdc/0xf4
)
[ 2.262823] r10:00000000 r9:00000000 r8:00000000 r7:c0048868 r6:dc475a00 r5:
dc4792c0
[ 2.273086] r4:00000000
[ 2.276810] [<c004d9f8>] (kthread) from [<c000faf8>] (ret_from_fork+0x14/0x3c
)
[ 2.286327] r7:00000000 r6:00000000 r5:c004d9f8 r4:dc4792c0
[ 2.294321] —[ end trace 96f82ffdb1a11c36 ]—
Jian Zhou:
看你在另外的帖子上发了代码,这个问题应该解决了吧?
user5245423:
回复 Jian Zhou:
这个问题是怎么解决的您能发下解决的方法吗
user5907560:
回复 Jian Zhou:
请问带问题有解决方案么,我用的4.1的内核,也遇到了同样的问题
user5907560:
回复 Jian Zhou:
请问带问题有解决方案么,我用的4.1的内核,也遇到了同样的问题
user5907560:
回复 Jian Zhou:
请问带问题有解决方案么,我用的4.1的内核,也遇到了同样的问题
yongqing wang:
回复 user5907560:
参考一下这个看看:blog.csdn.net/…/81094704