mpc85xx: convert WS-AP3710i to simpleImage wrapper openwrt-23.05
authorDavid Bauer <mail@david-bauer.net>
Thu, 25 Apr 2024 14:53:55 +0000 (16:53 +0200)
committerDavid Bauer <mail@david-bauer.net>
Thu, 9 May 2024 15:50:26 +0000 (17:50 +0200)
Convert the Enterasys WS-AP3710i access point to use the simpleImage
wrapper.

This is necessary, as the bootlaoder does not align the DTB correctly
(and does not support altering the FDT loadaddress). Booting images with
kernels 5.15 and later can break depending on the alignment on the DTB
within the FIT image.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit eec18118d02fa5d095cb4035c42187e487d0e68c)

target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts
target/linux/mpc85xx/image/p1020.mk
target/linux/mpc85xx/p1020/target.mk
target/linux/mpc85xx/patches-5.15/106-powerpc-85xx-ws-ap3710i-support.patch
target/linux/mpc85xx/patches-5.15/107-powerpc-85xx-add-ws-ap3825i-support.patch
target/linux/mpc85xx/patches-5.15/109-powerpc-85xx-add-ws-ap3715i-support.patch
target/linux/mpc85xx/patches-5.15/110-powerpc-85xx-br200-wp-support.patch

index 5d81da4686413977606e04279e84739dab232f14..2eb6f6e21ec9bfd3473a202e73f5fbf28d5b9027 100644 (file)
@@ -9,6 +9,8 @@
        compatible = "enterasys,ws-ap3710i";
 
        aliases {
+               ethernet0 = &enet0;
+               ethernet1 = &enet2;
                led-boot = &led_power_green;
                led-failsafe = &led_power_red;
                led-running = &led_power_green;
                label-mac-device = &enet0;
        };
 
+       chosen {
+               bootargs-override = "console=ttyS0,115200";
+               stdout-path = &serial0;
+       };
+
        memory {
                device_type = "memory";
        };
@@ -74,7 +81,7 @@
                                #size-cells = <1>;
 
                                partition@0 {
-                                       compatible = "denx,fit";
+                                       compatible = "denx,uimage";
                                        reg = <0x0 0x1d80000>;
                                        label = "firmware";
                                };
                ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
                          0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
                reg = <0 0xffe09000 0 0x1000>;
+
+               /* Filled by U-Boot */
+               bus-range = <0x00 0x01>;
+               dma-ranges = <0x2000000 0x00 0xfff00000 0x00 0xffe00000
+                             0x00 0x100000 0x42000000 0x00 0x00 0x00
+                             0x00 0x00 0x10000000>;
+
                pcie@0 {
                        ranges = <0x2000000 0x0 0xa0000000
                                  0x2000000 0x0 0xa0000000
                reg = <0 0xffe0a000 0 0x1000>;
                ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
                          0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
+
+               /* Filled by U-Boot */
+               bus-range = <0x00 0x01>;
+               dma-ranges = <0x2000000 0x00 0xfff00000 0x00
+                             0xffe00000 0x00 0x100000 0x42000000
+                             0x00 0x00 0x00 0x00 0x00 0x10000000>;
+
                pcie@0 {
                        ranges = <0x2000000 0x0 0x80000000
                                  0x2000000 0x0 0x80000000
 };
 /include/ "fsl/p1020si-post.dtsi"
 
+/ {
+       cpus {
+               PowerPC,P1020@0 {
+                       bus-frequency = <399999996>;
+                       timebase-frequency = <50000000>;
+                       clock-frequency = <799999992>;
+                       d-cache-block-size = <0x20>;
+                       d-cache-size = <0x8000>;
+                       d-cache-sets = <0x80>;
+                       i-cache-block-size = <0x20>;
+                       i-cache-size = <0x8000>;
+                       i-cache-sets = <0x80>;
+                       cpu-release-addr = <0x0 0x0ffff280>;
+                       status = "okay";
+                       enable-method = "spin-table";
+               };
+
+               PowerPC,P1020@1 {
+                       bus-frequency = <399999996>;
+                       timebase-frequency = <50000000>;
+                       clock-frequency = <799999992>;
+                       d-cache-block-size = <0x20>;
+                       d-cache-size = <0x8000>;
+                       d-cache-sets = <0x80>;
+                       i-cache-block-size = <0x20>;
+                       i-cache-size = <0x8000>;
+                       i-cache-sets = <0x80>;
+                       cpu-release-addr = <0x0 0x0ffff2a0>;
+                       status = "disabled";
+                       enable-method = "spin-table";
+               };
+       };
+
+       memory {
+               reg = <0x0 0x0 0x0 0x10000000>;
+       };
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               cpu1-bootpage@ff00000 {
+                       /* Reserve upper 1 MB for second-core-bootpage */
+                       reg = <0x0 0xff00000 0x0 0x100000>;
+               };
+       };
+
+       soc@ffe00000 {
+               bus-frequency = <399999996>;
+
+               serial@4600 {
+                       clock-frequency = <399999996>;
+               };
+
+               serial@4500 {
+                       clock-frequency = <399999996>;
+               };
+
+               pic@40000 {
+                       clock-frequency = <399999996>;
+               };
+       };
+
+       localbus@ffe05000 {
+               bus-frequency = <24999999>;
+       };
+};
+
+&enet0 {
+       rx-stash-idx = <0x00>;
+       rx-stash-len = <0x60>;
+       bd-stash;
+};
+
+&enet2 {
+       rx-stash-idx = <0x00>;
+       rx-stash-len = <0x60>;
+       bd-stash;
+};
+
 /*
  * For the OpenWrt 22.03 release, since Linux 5.10.138 now uses
  * aliases to determine PCI domain numbers, drop aliases so as not to
index d3d7f93ddda4b46d7f45651923c5033cd21d68c4..6e261a6db5c12ff22a801cf480a8090c603b08a1 100644 (file)
@@ -62,7 +62,11 @@ define Device/enterasys_ws-ap3710i
   DEVICE_VENDOR := Enterasys
   DEVICE_MODEL := WS-AP3710i
   BLOCKSIZE := 128k
-  KERNEL = kernel-bin | lzma | fit lzma $(KDIR)/image-$$(DEVICE_DTS).dtb
+  KERNEL_NAME := simpleImage.ws-ap3710i
+  KERNEL_ENTRY := 0x1500000
+  KERNEL_LOADADDR := 0x1500000
+  KERNEL = kernel-bin | uImage none
+  KERNEL_INITRAMFS := kernel-bin | uImage none
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
 endef
index 8770edb9a9146f6551f84abc48a6845e94c802bd..d0d919cb1d9f0c08dab5336eaa28a079fd7bc4ac 100644 (file)
@@ -1,5 +1,5 @@
 BOARDNAME:=P1020
-KERNEL_IMAGES:=simpleImage.ws-ap3825i
+KERNEL_IMAGES:=simpleImage.ws-ap3710i simpleImage.ws-ap3825i
 
 define Target/Description
        Build firmware images for Freescale P1020 based boards.
index 124376ffd9972e3a9cd0a5dffca8a734594fbfd2..c189d695abf9d6050c729b7b345e64ab87b6df1c 100644 (file)
  obj-$(CONFIG_CORENET_GENERIC)   += corenet_generic.o
  obj-$(CONFIG_FB_FSL_DIU)      += t1042rdb_diu.o
  obj-$(CONFIG_RED_15W_REV1)    += red15w_rev1.o
+--- a/arch/powerpc/boot/Makefile
++++ b/arch/powerpc/boot/Makefile
+@@ -164,6 +164,7 @@ src-plat-$(CONFIG_PPC_POWERNV) += pserie
+ src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S
+ src-plat-$(CONFIG_MVME7100) += motload-head.S mvme7100.c
+ src-plat-$(CONFIG_TL_WDR4900_V1) += simpleboot.c fixed-head.S
++src-plat-$(CONFIG_WS_AP3710I) += simpleboot.c fixed-head.S
+ src-plat-$(CONFIG_PPC_MICROWATT) += fixed-head.S microwatt.c
+@@ -345,6 +346,7 @@ image-$(CONFIG_TQM8555)                    += cuImage.tqm
+ image-$(CONFIG_TQM8560)                       += cuImage.tqm8560
+ image-$(CONFIG_KSI8560)                       += cuImage.ksi8560
+ image-$(CONFIG_TL_WDR4900_V1)         += simpleImage.tl-wdr4900-v1
++image-$(CONFIG_WS_AP3710I)            += simpleImage.ws-ap3710i
+ # Board ports in arch/powerpc/platform/86xx/Kconfig
+ image-$(CONFIG_MVME7100)                += dtbImage.mvme7100
+--- a/arch/powerpc/boot/wrapper
++++ b/arch/powerpc/boot/wrapper
+@@ -331,6 +331,11 @@ simpleboot-tl-wdr4900-v1)
+     link_address='0x1000000'
+     binary=y
+     ;;
++simpleboot-ws-ap3710i)
++    platformo="$object/fixed-head.o $object/simpleboot.o"
++    link_address='0x1500000'
++    binary=y
++    ;;
+ simpleboot-*)
+     platformo="$object/fixed-head.o $object/simpleboot.o"
+     binary=y
index b211f3cb3022bf47d7565cfe5f9ad5ed38e21176..ddd16d369e815acedceec1df03d2ecd97ec4a562 100644 (file)
@@ -37,29 +37,23 @@ WS-AP3825i AP.
  obj-$(CONFIG_RED_15W_REV1)    += red15w_rev1.o
 --- a/arch/powerpc/boot/Makefile
 +++ b/arch/powerpc/boot/Makefile
-@@ -164,6 +164,7 @@ src-plat-$(CONFIG_PPC_POWERNV) += pserie
- src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S
- src-plat-$(CONFIG_MVME7100) += motload-head.S mvme7100.c
- src-plat-$(CONFIG_TL_WDR4900_V1) += simpleboot.c fixed-head.S
-+src-plat-$(CONFIG_WS_AP3825I) += simpleboot.c fixed-head.S
- src-plat-$(CONFIG_PPC_MICROWATT) += fixed-head.S microwatt.c
-@@ -345,6 +346,7 @@ image-$(CONFIG_TQM8555)                    += cuImage.tqm
- image-$(CONFIG_TQM8560)                       += cuImage.tqm8560
+@@ -347,6 +347,7 @@ image-$(CONFIG_TQM8560)                    += cuImage.tqm
  image-$(CONFIG_KSI8560)                       += cuImage.ksi8560
  image-$(CONFIG_TL_WDR4900_V1)         += simpleImage.tl-wdr4900-v1
+ image-$(CONFIG_WS_AP3710I)            += simpleImage.ws-ap3710i
 +image-$(CONFIG_WS_AP3825I)            += simpleImage.ws-ap3825i
  # Board ports in arch/powerpc/platform/86xx/Kconfig
  image-$(CONFIG_MVME7100)                += dtbImage.mvme7100
  
 --- a/arch/powerpc/boot/wrapper
 +++ b/arch/powerpc/boot/wrapper
-@@ -326,6 +326,7 @@ adder875-redboot)
+@@ -326,7 +326,8 @@ adder875-redboot)
      platformo="$object/fixed-head.o $object/redboot-8xx.o"
      binary=y
      ;;
-+simpleboot-ws-ap3825i|\
- simpleboot-tl-wdr4900-v1)
+-simpleboot-tl-wdr4900-v1)
++simpleboot-tl-wdr4900-v1|\
++simpleboot-ws-ap3825i)
      platformo="$object/fixed-head.o $object/simpleboot.o"
      link_address='0x1000000'
+     binary=y
index 8272d9dd2ae3aad6f8b767642063f3371469163c..ad8f4840b9897559e15bb4e842ac9d925a7def3d 100644 (file)
  obj-$(CONFIG_CORENET_GENERIC)   += corenet_generic.o
 --- a/arch/powerpc/boot/Makefile
 +++ b/arch/powerpc/boot/Makefile
-@@ -346,6 +346,7 @@ image-$(CONFIG_TQM8555)                    += cuImage.tqm
- image-$(CONFIG_TQM8560)                       += cuImage.tqm8560
+@@ -347,6 +347,7 @@ image-$(CONFIG_TQM8560)                    += cuImage.tqm
  image-$(CONFIG_KSI8560)                       += cuImage.ksi8560
  image-$(CONFIG_TL_WDR4900_V1)         += simpleImage.tl-wdr4900-v1
+ image-$(CONFIG_WS_AP3710I)            += simpleImage.ws-ap3710i
 +image-$(CONFIG_WS_AP3715I)            += simpleImage.ws-ap3715i
  image-$(CONFIG_WS_AP3825I)            += simpleImage.ws-ap3825i
  # Board ports in arch/powerpc/platform/86xx/Kconfig
  image-$(CONFIG_MVME7100)                += dtbImage.mvme7100
 --- a/arch/powerpc/boot/wrapper
 +++ b/arch/powerpc/boot/wrapper
-@@ -326,6 +326,7 @@ adder875-redboot)
-     platformo="$object/fixed-head.o $object/redboot-8xx.o"
+@@ -327,6 +327,7 @@ adder875-redboot)
      binary=y
      ;;
+ simpleboot-tl-wdr4900-v1|\
 +simpleboot-ws-ap3715i|\
- simpleboot-ws-ap3825i|\
- simpleboot-tl-wdr4900-v1)
+ simpleboot-ws-ap3825i)
      platformo="$object/fixed-head.o $object/simpleboot.o"
+     link_address='0x1000000'
index 8d510759dcfca538b18e093a842f497db69b21db..ef05df3430371e8a33d6c88b55b0d2457538edfc 100644 (file)
@@ -35,7 +35,7 @@
  src-plat-$(CONFIG_MVME7100) += motload-head.S mvme7100.c
 +src-plat-$(CONFIG_BR200_WP) += simpleboot.c fixed-head.S
  src-plat-$(CONFIG_TL_WDR4900_V1) += simpleboot.c fixed-head.S
- src-plat-$(CONFIG_WS_AP3825I) += simpleboot.c fixed-head.S
+ src-plat-$(CONFIG_WS_AP3710I) += simpleboot.c fixed-head.S
  
 @@ -345,6 +346,7 @@ image-$(CONFIG_TQM8548)                    += cuImage.tqm
  image-$(CONFIG_TQM8555)                       += cuImage.tqm8555
@@ -43,8 +43,8 @@
  image-$(CONFIG_KSI8560)                       += cuImage.ksi8560
 +image-$(CONFIG_BR200_WP)              += simpleImage.br200-wp
  image-$(CONFIG_TL_WDR4900_V1)         += simpleImage.tl-wdr4900-v1
+ image-$(CONFIG_WS_AP3710I)            += simpleImage.ws-ap3710i
  image-$(CONFIG_WS_AP3715I)            += simpleImage.ws-ap3715i
- image-$(CONFIG_WS_AP3825I)            += simpleImage.ws-ap3825i
 --- a/arch/powerpc/boot/wrapper
 +++ b/arch/powerpc/boot/wrapper
 @@ -326,6 +326,7 @@ adder875-redboot)
@@ -52,6 +52,6 @@
      binary=y
      ;;
 +simpleboot-br200-wp|\
+ simpleboot-tl-wdr4900-v1|\
+ simpleboot-ws-ap3710i|\
  simpleboot-ws-ap3715i|\
- simpleboot-ws-ap3825i|\
- simpleboot-tl-wdr4900-v1)