硬件使用am4378,采用异步模式,数据宽度16bit,与FPGA通信,内核版本kernel 4.4.32
问题:要实现gpmc与fpga通信,基本步骤是什么。
修改dts后,还要添加驱动?
官方sdk中是否有这部分驱动,或有没有可共参考的驱动程序?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
采用Linux4.4,地址数据复用,8bit位宽,使用修改dts如下:
&gpmc {
/*
* When enabling GPMC, disable eMMC and set
* SelEMMCorNAND to output-low
*/
status = "disabled";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&nand_flash_x8_default>;
pinctrl-1 = <&nand_flash_x8_sleep>;
ranges = < 3 0 0x0a000000 0x02000000
fpga@3,0 {
reg = <3 0 0x400>;
compatible = "fpga-dpram";
bank-width = <1>; /* 8 bit mode */
gpmc,mux-add-data = <2>; /* address-data multiplexing */
gpmc,cs-on-ns = <0>;
gpmc,cs-rd-off-ns = <60>;
gpmc,cs-wr-off-ns = <60>;
gpmc,adv-on-ns = <0>;
gpmc,adv-rd-off-ns = <20>;
gpmc,adv-wr-off-ns = <20>;
gpmc,we-on-ns = <20>;
gpmc,we-off-ns = <50>;
gpmc,oe-on-ns = <20>;
gpmc,oe-off-ns = <50>;
gpmc,rd-cycle-ns = <60>;
gpmc,wr-cycle-ns = <60>;
};
};
启动后,/dev下没有设备操作符,/sys/devices/platform/44000000.ocp/50000000.gpmc下有8000000.fpga这个设备
请问,除了DTS文件外是否需要做其他地方的修改,如何操作gpmc设备?是否需要再添加其他驱动。
我看网上有一个am3359的GPMC驱动教程,貌似移植起来头文件差别比较大。
GPMC如果和FPGA使用NOR的方式连接
初始化好了之后,直接访问NOR的那块物理地址就可以了。