我有一个使用 s25hs512t 和 imx6ul 的定制板。目前我正在使用支持 Spansion S25HS 系列的 u-boot 2021.10-rc3。
我的dtsi有
&qspi {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_qspi>;
status = "okay";
flash: s25hs512t@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spansion,s25hs512t", "jedec,spi-nor";
spi-max-frequency = <40000000>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <4>;
reg = <0>;
spi-mode = <0>;
m25p,fast-read;
status = "okay";
partition@uboot {
label = "uboot";
reg = <0x00000000 0x00100000>;
};
partition@uboot-env {
label = "uboot-env";
reg = <0x00100000 0x00040000>;
};
partition@kernel-dtb {
label = "kernel-dtb";
reg = <0x00140000 0x00040000>;
};
partition@kernel {
label = "kernel";
reg = <0x00180000 0x00800000>;
};
partition@root {
label = "root";
reg = <0x00980000 0x03640000>;
};
};
};
u-boot 检测正常
=> sf probe
drivers/core/uclass.c:325-uclass_find_device_by_seq() 0
drivers/core/uclass.c:333-uclass_find_device_by_seq() - 0 'spi@21e0000'
drivers/core/uclass.c:336-uclass_find_device_by_seq() - found
drivers/spi/spi-uclass.c:282-spi_find_chip_select() fsl_qspi spi@21e0000: spi_find_chip_select: plat=9ef2af60, cs=0
drivers/core/uclass.c:325-uclass_find_device_by_seq() 0
drivers/core/uclass.c:333-uclass_find_device_by_seq() - 0 'spi@21e0000'
drivers/core/uclass.c:336-uclass_find_device_by_seq() - found
drivers/spi/spi-uclass.c:282-spi_find_chip_select() fsl_qspi spi@21e0000: spi_find_chip_select: plat=9ef2af60, cs=0
drivers/core/uclass.c:325-uclass_find_device_by_seq() 0
drivers/core/uclass.c:333-uclass_find_device_by_seq() - 0 'iomuxc@20e0000'
drivers/core/uclass.c:336-uclass_find_device_by_seq() - found
drivers/pinctrl/pinctrl-uclass.c:300-pinctrl_select_state_simple() jedec_spi_nor m25p80@0: set_state_simple op missing
drivers/spi/fsl_qspi.c:464-fsl_qspi_prepare_lut() fsl_qspi spi@21e0000: CMD[9f] lutval[0:1c00049f 1:0 2:0 3:0]
drivers/spi/fsl_qspi.c:464-fsl_qspi_prepare_lut() fsl_qspi spi@21e0000: CMD[5a] lutval[0:818045a 1:1c000c08 2:0 3:0]
drivers/spi/fsl_qspi.c:464-fsl_qspi_prepare_lut() fsl_qspi spi@21e0000: CMD[5a] lutval[0:818045a 1:1c000c08 2:0 3:0]
drivers/spi/fsl_qspi.c:464-fsl_qspi_prepare_lut() fsl_qspi spi@21e0000: CMD[5a] lutval[0:818045a 1:1c000c08 2:0 3:0]
drivers/spi/fsl_qspi.c:464-fsl_qspi_prepare_lut() fsl_qspi spi@21e0000: CMD[b7] lutval[0:4b7 1:0 2:0 3:0]
drivers/spi/fsl_qspi.c:464-fsl_qspi_prepare_lut() fsl_qspi spi@21e0000: CMD[65] lutval[0:8200465 1:1c00 2:0 3:0]
drivers/mtd/spi/spi-nor-core.c:2531- spi_nor_parse_sfdp() jedec_spi_nor m25p80@0: non-uniform erase sector maps are not supported yet.
drivers/spi/fsl_qspi.c:464-fsl_qspi_prepare_lut() fsl_qspi spi@21e0000: CMD[65] lutval[0:8200465 1:1c00 2:0 3:0]
drivers/spi/fsl_qspi.c:464-fsl_qspi_prepare_lut() fsl_qspi spi@21e0000: CMD[65] lutval[0:8200465 1:1c00 2:0 3:0]
SF: Detected s25hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
drivers/mtd/mtdcore.c:494- add_mtd_device() mtd: Giving out device 0 to s25hs512t <=== That works
drivers/spi/spi-uclass.c:431- spi_get_bus_and_cs() spi_get_bus_and_cs: bus=9ef2ae80, slave=9ef2d248
设置 mtdparts 工作正常
=> env set mtdparts 's25hs512t:1024k(uboot),256k(uboot-env),256k(kernel-dtb),6656k(kernel),-(root)'
=> mtd list
drivers/mtd/mtdcore.c:494- add_mtd_device() mtd: Giving out device 1 to uboot
drivers/mtd/mtdcore.c:494- add_mtd_device() mtd: Giving out device 2 to uboot-env
drivers/mtd/mtdcore.c:494- add_mtd_device() mtd: Giving out device 3 to kernel-dtb
drivers/mtd/mtdcore.c:494- add_mtd_device() mtd: Giving out device 4 to kernel
drivers/mtd/mtdcore.c:494- add_mtd_device() mtd: Giving out device 5 to root
List of MTD devices:
* s25hs512t
- device: m25p80@0
- parent: spi@21e0000
- driver: jedec_spi_nor
- path: /soc/aips-bus@2100000/spi@21e0000/m25p80@0
- type: NOR flash
- block size: 0x40000 bytes
- min I/O: 0x1 bytes
- 0x000000000000-0x000004000000 : "s25hs512t"
- 0x000000000000-0x000000100000 : "uboot"
- 0x000000100000-0x000000140000 : "uboot-env"
- 0x000000140000-0x000000180000 : "kernel-dtb"
- 0x000000180000-0x000000800000 : "kernel"
- 0x000000800000-0x000004000000 : “root"
问题是在设置 mtdids 时
=> setenv mtdids 'nor0=s25hs512t'
=> mtdparts
Device nor0 not found!
问题
- 我在设置 mtdids 时做错了什么?什么应该是正确的
- 要设置的正确 dfu_alt_info 是什么。我试过但没有奏效的是
env set dfu_alt_info 'mtd nor0=uboot part 1;uboot-env part 2;kernel-dtb part 3;kernel part 4;root partubi 5;'