apm821xx: MBL: make mtd chip work
authorChristian Lamparter <chunkeey@gmail.com>
Sun, 12 Jun 2022 09:48:01 +0000 (11:48 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Sun, 19 Jun 2022 10:31:02 +0000 (12:31 +0200)
The MBL has a 512KiB Microchip SST39VF040 chip for uboot and
not much else.

Thanks to Ewald who figured out that the "jedec-probe" vs.
"jedec-flash" was the wrong binding. With this information
and the jedec-probe support enabled => the chip works.

| physmap-flash 4fff80000.nor_flash: physmap platform flash device: [mem 0x4fff80000-0x4ffffffff]
| Found: SST 39LF040
4fff80000.nor_flash: Found 1 x8 devices at 0x0 in 8-bit bank

Suggested-by: Ewald Comhaire <e.comhaire@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
package/boot/uboot-envtools/files/apm821xx
target/linux/apm821xx/Makefile
target/linux/apm821xx/dts/wd-mybooklive.dts
target/linux/apm821xx/sata/config-default

index 690fbba332100becfb6762e40542080f51502a6d..e73aaab7a0d73a4856d24ae20a39458797c8beb1 100644 (file)
@@ -19,6 +19,10 @@ netgear,wndap620|\
 netgear,wndap660)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" "4"
        ;;
+wd,mybooklive)
+       ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000" "1"
+       ubootenv_add_uci_config "/dev/mtd1" "0x1000" "0x1000" "0x1000" "1"
+       ;;
 esac
 
 config_load ubootenv
index f36274bd988250b415288bc505714d4f1fe8d1db..875ff225a90c18cd5551de6d3e56e826e633f1b0 100644 (file)
@@ -21,6 +21,6 @@ include $(INCLUDE_DIR)/target.mk
 KERNELNAME:=uImage
 
 DEFAULT_PACKAGES += \
-       kmod-leds-gpio kmod-i2c-core kmod-gpio-button-hotplug
+       kmod-leds-gpio kmod-i2c-core kmod-gpio-button-hotplug uboot-envtools
 
 $(eval $(call BuildTarget))
index 2cc4dd8b79e8b37819addf17a576083a94ac9e5f..5fcddb0cd869e9ef6db891f77262852d7c8efbdf 100644 (file)
@@ -22,7 +22,7 @@
        ebc {
                nor_flash@0,0 {
                        status = "okay";
-                       compatible = "amd,s29gl512n", "jedec-probe", "cfi-flash", "mtd-rom";
+                       compatible = "microchip,sst39vf040", "jedec-flash";
                        bank-width = <1>;
                        reg = <0x00000000 0x00000000 0x00080000>;
                        #address-cells = <1>;
                                /* Part of bootrom - Don't use it without a jump */
                                label = "free";
                                reg = <0x00000000 0x0001e000>;
+                               read-only;
                        };
 
                        partition@1e000 {
                                label = "env";
                                reg = <0x0001e000 0x00002000>;
+                               read-only;
                        };
 
                        partition@20000 {
                                label = "uboot";
                                reg = <0x00020000 0x00050000>;
+                               read-only;
                        };
                };
        };
index e8e595641db2c09846223f23edbb4eeda14a6384..563fa60478a404ab21cc6e8a2a933dd3a342a2d4 100644 (file)
@@ -35,6 +35,8 @@ CONFIG_MD_RAID0=y
 CONFIG_MD_RAID1=y
 # CONFIG_MD_RAID10 is not set
 # CONFIG_MD_RAID456 is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_JEDECPROBE=y
 CONFIG_PM=y
 CONFIG_PM_AUTOSLEEP=y
 CONFIG_PM_CLK=y