1.新增对设备的支持
linux系统中,修改linux-5.xx/driver/mtd/nand/spi/winbond.c 第95行 加入如下代码:
SPINAND_INFO("GD51FGQ", 0x9F,
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
NAND_ECCREQ(1, 512),
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
&write_cache_variants,
&update_cache_variants),
0,
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)),
2.使能设备树 nand设备 board/widora/mangopi/r3/devicetree/linux/devicetree.dts
spi-nor@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "winbond,w25q128", "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
status = "disabled"; //这里是新增的
......
spi-nand@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <50000000>;
status = "okay"; //默认是disabled,
.....
执行: rebuild-kernel.sh 即可
离线
理论上是不需要改源码的,只需要编辑dts即可,如果确认需要修改内核源码,请继续跟进我的回复。
最近编辑记录 aodzip (2020-10-24 16:14:36)
离线