我正在使用am335x,利用GPMC接口与fpga通讯,linux的SDK版本是ti-sdk-am335x-evm-05.05.00。在调试过程中,读GPMC—CONFIG7—0~6寄存器的数值,发现SDK已经配置好了基地址和大小。基地址CS0-CS6分别是:0x8000000 ,0x1000000, 0x2000000, 0x3000000, 0x4000000,0x5000000,0x6000000.大小都是16M。这应该是SDK默认的配置。我现在想按照自己的应用设置CSn映射的基地址和内存大小,但是不知道在哪里修改。是在U-boot里面还是kernel里面,谢谢。
Gary Wu:
在u-boot和Linux中都有对GPMC的配置代码,看你是否需要在u-boot中操作FPGA,如果不需要,可以仅在linux中配置。
想要找类似的代码位置,最直接简单的办法就是在google里输入如下关键字: GPMC AM335 LINUX
你可以看到如下链接
https://gitorious.org/am335x/linux-am33x/source/e0d0d4c4fb4e82e696033cbfa1f3f1cc12c1fbb6:arch/arm/mach-omap2/gpmc.c
rabbit:
回复 Gary Wu:
你好,我查了一下,没定位到GPMC片选基地址设置的代码。在uboot和Linux里面,具体在哪个位置可以设定CS0~CS7的片选基地址和大小。期待您的详解,谢谢
yang chen11:
回复 Jian Zhou:
请问,CS0分配给了Nandflash 512MB空间,那我还能使用CS3吗?我现在做GPMC的驱动时发现,无法分配空间给CS3。
Jian Zhou:
回复 yang chen11:
为什么给CS0分配那么大的地址空间,分配最小的空间就可以了。
norysn:
你好,请问这些片选基地址的设置是在哪个文件里面?
user5245423:
回复 Jian Zhou:
我只想给CS2256MB
ranges = <0 0 0x08000000 0x1000000>,/* CS0: 16MB for NAND */<2 0 0x09000000 0xFFFFFFF>;/* CS2: 256MB */
};fpga@2,0{compatible = "mtd-ram";linux,mtd-name= "intel,pf48f6000m0y1be";//#address-cells = <1>;//#size-cells = <1>;reg = <2 0 0xFFFFFFF>;您给看下我这样配置 为什么SD开开机启动的时候
Welcome to Arago 2016.05![3.251510] systemd[1]: Set hostname to <am335x-evm>.
[3.705473] Unable to handle kernel paging request at virtual address d085c07c
[3.712875] pgd = c0004000
[3.715598] [d085c07c] *pgd=8f02c811, *pte=00000000, *ppte=00000000
[3.721979] Internal error: Oops: 807 [#1] PREEMPT ARM
[3.727141] Modules linked in:
[3.730224] CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 4.4.12 #1
[3.736430] Hardware name: Generic AM33XX (Flattened Device Tree)
[3.742579] Workqueue: mtdblock6 mtd_blktrans_work
[3.747399] task: cf04f180 ti: cf0ee000 task.ti: cf0ee000
[3.752835] PC is at omap_hwcontrol+0x64/0x6c
[3.757212] LR is at omap_hwcontrol+0x5c/0x6c
[3.761590] pc : [<c041ff28>]lr : [<c041ff20>]psr: 60010013
[3.761590] sp : cf0efc98ip : cf0efc98fp : cf0efcac
[3.773120] r10: cf0efd60r9 : 00000000r8 : 00000002
[3.778368] r7 : 00000000r6 : 00000000r5 : cf1ca010r4 : 00000000
[3.784925] r3 : d085c07cr2 : 00000083r1 : 00000000r0 : cf1ca010
[3.791484] Flags: nZCvIRQs onFIQs onMode SVC_32ISA ARMSegment none
[3.798651] Control: 10c5387dTable: 8f574019DAC: 00000051
[3.804423] Process kworker/0:1 (pid: 12, stack limit = 0xcf0ee210)
[3.810719] Stack: (0xcf0efc98 to 0xcf0f0000)
[3.815098] fc80:cf1ca010 cf1ca270
[3.823321] fca0: cf0efcd4 cf0efcb0 c041ab50 c041fed0 cf1ca270 00000000 00000002 cf1ca010
[3.831544] fcc0: 00000000 cf0efd60 cf0efd54 cf0efcd8 c041a134 c041ab18 c0051acc c0051000
[3.839765] fce0: cf0efd74 00000000 cf0efd14 cf4108a4 00000080 00000000 00000000 00000000
[3.847986] fd00: 00000200 00000002 00000000 cf591000 00000200 00000000 cf02410c 00000001
[3.856207] fd20: 00000000 00000000 cf04f180 00001000 00000000 cf1ca010 cf0efd60 cf0efe54
[3.864428] fd40: 00000200 cf591000 cf0efdac cf0efd58 c041a8e0 c0419fa8 cf0efd60 200f0093
[3.872649] fd60: 00000000 00000200 00000000 00000000 00000000 00000000 cf591000 00000000
[3.880869] fd80: c09ff6e0 00000000 00000000 00001000 00000000 cf46e800 cf591000 cf0efdd0
[3.889090] fda0: cf0efdfc cf0efdb0 c040f800 c041a888 00000200 cf0efe54 cf591000 cf0efdc8
[3.897311] fdc0: 00000000 00000000 00000000 00000000 cf33bbf0 0001f000 00000000 cf591000
[3.905533] fde0: 00000000 00020000 00000000 cf46e800 cf0efe3c cf0efe00 c040d080 c040f7a8
[3.913754] fe00: 00000200 cf0efe54 cf591000 00000000 00000000 00000200 00001000 00000200
[3.921975] fe20: 00020000 cf591000 cf46e800 cf4aa700 cf0efe84 cf0efe40 c0414614 c040d000
[3.930196] fe40: 00000200 cf0efe54 cf591000 cf0efe58 c026fab0 00000000 00000000 00000008
[3.938417] fe60: 00000000 c09b1f70 cf4aa700 00000008 cf54a3a0 cf591000 cf0efeec cf0efe88
[3.946638] fe80: c0413f10 c04145dc 00000000 00000000 cf0efecc 00000008 00000009 c09b1f70
[3.954859] fea0: 00000008 00000000 cf33bbf0 00000000 cf4aa710 cf4aa740 24490000 00000000
[3.963081] fec0: cf0efeec cf0cee00 cf4aa740 c0992c5c cfd87200 00000000 cf0cee00 00000000
[3.971302] fee0: cf0eff2c cf0efef0 c0047088 c0413cac c0057e7c cf04f180 c0992c5c c0992c6c
[3.979522] ff00: 00000001 c0992c5c c0992c6c 00000001 cf0cee18 00000008 cf0cee00 c0992c5c
[3.987743] ff20: cf0eff64 cf0eff30 c00474b8 c0046f6c