Due to limited pins i want to connect a FPGA (with internal peripherals) to the nand bus (8bit) and select with cs1.
The idea is, to use the raw-flash interface or an simple driver which can read and write some data in a low level manner througt the nand-bus to and from the FPGA (Command, Address, Status, Data)
I have configured in the dts the gpio1_30 for cs1, and a second (dummy) flash device:
nandflash_pins: pinmux_nandflash {
pinctrl-single,pins = <
......
0x7c (PIN_OUTPUT | MUX_MODE0) /* gpmc_csn0.gpmc_csn0 */
0x80 (PIN_OUTPUT | MUX_MODE0) /* gpmc_csn1.gpmc_cs1 */
........
&gpmc {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&nandflash_pins>;
ranges = <0 0 0x08000000 0x1000000 /* CS0: NAND */
1 0 0x09000000 0x1000000>; /* CS1: NAND */
nandflash: nand@0,0 {
reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
nand-bus-width = <8>;
ti,nand-ecc-opt = "bch8";
gpmc,device-nand = "true";
gpmc,device-width = <1>;
............
};
nandx: nand@1,0 {
reg = <1 0 4>; /* CS1, offset 0, IO size 4 */
nand-bus-width = <8>;
ti,nand-ecc-opt = "bch8";
gpmc,device-nand = "true";
gpmc,device-width = <1>;
.......
};
If there is no 2. device on the bus, I expect an error (dmesg) that the device will not found, but there an a lot of errors:
"kobject try to init an initialized object, something is seriouly wrong"
and than backtrace data.
Linux works normal.
My questions:
Is it possible to use the nand-flash bus for low level communication to a FPGA (with appropriate logic)?
Which functions should be implemented in the FPGA that the a low level nand-driver accept the FPGA as a NAND-Flash?
What is wrong with the device tree?
Thank you for help