Hi I'm trying to support a new target and I'm having the nand device mapped before the spi_nor.
Using smem is not possible as the smem table is incorrect, it looks like the same smem is used for multiple devices and they just alter the dts to suit.
In many devices there is a dummy node and a note so you can alter partitions and i think that may be the probem ?.
spi mapping: (higher up in DTS)
&blsp1_spi1 {
pinctrl-0 = <&spi_0_pins>;
pinctrl-names = "default";
cs-gpios = <0>;
status = "okay";
/*
* Bootloader will find the NAND DT node by the compatible and
* then "fixup" it by adding the partitions from the SMEM table
* using the legacy bindings thus making it impossible for us
* to change the partition table or utilize NVMEM for calibration.
* So add a dummy partitions node that bootloader will populate
* and set it as disabled so the kernel ignores it instead of
* printing warnings due to the broken way bootloader adds the
* partitions.
*/
partitions {
status = "disabled";
};
flash@0 { /* mx25u6435f spi nor flash chip*/
#address-cells = <1>;
#size-cells = <1>;
reg = <0>;
compatible = "jedec,spi-nor";
spi-max-frequency = <50000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
SBL1@0 {
label = "SBL1";
reg = <0x00 0x50000>;
read-only;
};
};
};
};
nand mapping:
`&qpic_nand {
status = "okay";
nand@0 { /* W29N02GZ 256mb nand*/
reg = <0>;
nand-ecc-strength = <4>;
nand-ecc-step-size = <512>;
nand-bus-width = <8>;
// nand set as fixed partitions as smem seems to populate it incorrectly ?
partitions {
// compatible = "qcom,smem-part"; /* define SMEM partition table */
compatible = "fixed-partitions"; /* define fixed partition table */
#address-cells = <0x01>;
#size-cells = <0x01>;
ubi@0 {
label = "ubi";
reg = <0x00 0x010000000>;
read-only; /* set as read only for now */
};
};
};
};`
In the DTS the nor is higher up in the list so I expect it to map first and the nand map at the end of the nor flash but that is not the case.
flash layout:
root@OpenWrt:~# cat /proc/mtd
dev: size erasesize name
mtd0: 07800000 00020000 "ubi"
mtd1: 00050000 00010000 "0:SBL1"
I would like ubi below slb1, of note I have cut short the above code for posting reasons.
my dts is located here: