[openwrt/openwrt] layerscape: add LX2160ARDB (Rev2.0 silicon) board support

LEDE Commits lede-commits at lists.infradead.org
Fri Feb 19 14:02:54 EST 2021


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/80dcd14abeed8cd808b92bb307964dbaeb252144

commit 80dcd14abeed8cd808b92bb307964dbaeb252144
Author: Yangbo Lu <yangbo.lu at nxp.com>
AuthorDate: Thu Jul 30 13:12:43 2020 +0800

    layerscape: add LX2160ARDB (Rev2.0 silicon) board support
    
    The QorIQ LX2160A reference design board provides a comprehensive platform
    that enables design and evaluation of the LX2160A processor.
    
    - Enables network intelligence with the next generation Datapath (DPPA2)
      which provides differentiated offload and a rich set of IO, including
      10GE, 25GE, 40GE, and PCIe Gen4
    
    - Delivers unprecedented efficiency and new virtualized networks
    
    - Supports designs in 5G packet processing, network function
      virtualization, storage controller, white box switching, network
      interface cards, and mobile edge computing
    
    - Supports all three LX2 family members (16-core LX2160A; 12-core LX2120A;
      and 8-core LX2080A)
    
    Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
    [use AUTORELEASE, add dtb to firmware part]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 package/boot/tfa-layerscape/Makefile               | 18 +++++++-
 package/boot/uboot-layerscape/Makefile             | 12 +++++
 .../files/fsl_lx2160a-rdb-sdboot-uEnv.txt          |  9 ++++
 .../files/fsl_lx2160a-rdb-uEnv.txt                 |  9 ++++
 package/firmware/layerscape/ls-dpl/Makefile        |  6 ++-
 package/firmware/layerscape/ls-mc/Makefile         |  4 +-
 package/firmware/layerscape/ls-rcw/Makefile        |  4 ++
 .../layerscape/base-files/lib/upgrade/platform.sh  | 13 ++++--
 target/linux/layerscape/image/armv8_64b.mk         | 52 ++++++++++++++++++++++
 9 files changed, 120 insertions(+), 7 deletions(-)

diff --git a/package/boot/tfa-layerscape/Makefile b/package/boot/tfa-layerscape/Makefile
index c0efd3ad9e..d5a1664278 100644
--- a/package/boot/tfa-layerscape/Makefile
+++ b/package/boot/tfa-layerscape/Makefile
@@ -123,6 +123,20 @@ define Package/tfa-ls2088a-rdb
   BOOT_MODE:=nor
 endef
 
+define Package/tfa-lx2160a-rdb
+  $(Package/tfa-generic)
+  TITLE:=NXP LX2160ARDB Trusted Firmware
+  PLAT:=lx2160ardb
+  BOOT_MODE:=flexspi_nor
+endef
+
+define Package/tfa-lx2160a-rdb-sdboot
+  $(Package/tfa-generic)
+  TITLE:=NXP LX2160ARDB SD Boot Trusted Firmware
+  PLAT:=lx2160ardb
+  BOOT_MODE:=sd
+endef
+
 define Build/InstallDev
 	$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
 	$(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/bl2_$(BOOT_MODE).pbl \
@@ -154,7 +168,9 @@ TFAS := \
   ls1046a-rdb-sdboot \
   ls1088a-rdb \
   ls1088a-rdb-sdboot \
-  ls2088a-rdb
+  ls2088a-rdb \
+  lx2160a-rdb \
+  lx2160a-rdb-sdboot
 
 $(eval $(call HostBuild))
 $(foreach tfa,$(TFAS), \
diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile
index 98b129f0ff..f02356791d 100644
--- a/package/boot/uboot-layerscape/Makefile
+++ b/package/boot/uboot-layerscape/Makefile
@@ -90,6 +90,16 @@ define U-Boot/fsl_ls2088a-rdb
   UBOOT_CONFIG:=ls2088ardb_tfa
 endef
 
+define U-Boot/fsl_lx2160a-rdb
+  NAME:=NXP LX2160ARDB
+  UBOOT_CONFIG:=lx2160ardb_tfa
+endef
+
+define U-Boot/fsl_lx2160a-rdb-sdboot
+  NAME:=NXP LX2160ARDB SD Card Boot
+  UBOOT_CONFIG:=lx2160ardb_tfa
+endef
+
 define U-Boot/fsl_ls1021a-twr
   NAME:=NXP LS1021ATWR
   BUILD_SUBTARGET:=armv7
@@ -126,6 +136,8 @@ UBOOT_TARGETS := \
   fsl_ls1088a-rdb \
   fsl_ls1088a-rdb-sdboot \
   fsl_ls2088a-rdb \
+  fsl_lx2160a-rdb \
+  fsl_lx2160a-rdb-sdboot \
   fsl_ls1021a-twr \
   fsl_ls1021a-twr-sdboot \
   fsl_ls1021a-iot-sdboot
diff --git a/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-sdboot-uEnv.txt
new file mode 100644
index 0000000000..6b4e920c9e
--- /dev/null
+++ b/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-sdboot-uEnv.txt
@@ -0,0 +1,9 @@
+fdtaddr=0x8f000000
+loadaddr=0x81000000
+bootm_size=0x10000000
+hwconfig=fsl_ddr:bank_intlv=auto
+mc_init=mmc read 80000000 5000 1800;mmc read 80300000 7000 800;fsl_mc start mc 80000000 80300000;mmc read 80400000 6800 800;fsl_mc apply dpl 80400000
+sd_boot=ext4load mmc 0:1 ${loadaddr} fitImage;bootm ${loadaddr}
+bootargs=root=/dev/mmcblk0p2 rw rootwait rootfstype=squashfs,f2fs noinitrd earlycon=pl011,mmio32,0x21c0000 console=ttyAMA0,115200
+bootcmd=echo starting openwrt ...;run mc_init;run sd_boot
+bootdelay=3
diff --git a/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-uEnv.txt
new file mode 100644
index 0000000000..08757b4460
--- /dev/null
+++ b/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-uEnv.txt
@@ -0,0 +1,9 @@
+fdtaddr=0x8f000000
+loadaddr=0x81000000
+bootm_size=0x10000000
+hwconfig=fsl_ddr:bank_intlv=auto
+mc_init=sf probe 0:0;sf read 80000000 a00000 300000;sf read 80300000 e00000 100000;fsl_mc start mc 80000000 80300000;sf read 80400000 d00000 100000;fsl_mc apply dpl 80400000
+xspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
+bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=pl011,mmio32,0x21c0000 console=ttyAMA0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),49m at 0xf00000(firmware)
+bootcmd=echo starting openwrt ...;run mc_init;run xspi_boot
+bootdelay=3
diff --git a/package/firmware/layerscape/ls-dpl/Makefile b/package/firmware/layerscape/ls-dpl/Makefile
index d056825ac5..f577c5b7e3 100644
--- a/package/firmware/layerscape/ls-dpl/Makefile
+++ b/package/firmware/layerscape/ls-dpl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ls-dpl
 PKG_VERSION:=LSDK-20.04
-PKG_RELEASE:=2
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils
@@ -40,6 +40,10 @@ define Build/InstallDev
 		$(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-dpl.dtb
 	$(CP) $(PKG_BUILD_DIR)/config/ls2088a/RDB/dpc.0x2A_0x41.dtb \
 		$(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-dpc.dtb
+	$(CP) $(PKG_BUILD_DIR)/config/lx2160a/RDB/dpl-eth.19.dtb \
+		$(STAGING_DIR_IMAGE)/fsl_lx2160a-rdb-dpl.dtb
+	$(CP) $(PKG_BUILD_DIR)/config/lx2160a/RDB/dpc-usxgmii.dtb \
+		$(STAGING_DIR_IMAGE)/fsl_lx2160a-rdb-dpc.dtb
 endef
 
 $(eval $(call BuildPackage,layerscape-dpl))
diff --git a/package/firmware/layerscape/ls-mc/Makefile b/package/firmware/layerscape/ls-mc/Makefile
index 0da0b91533..daba35a3b9 100644
--- a/package/firmware/layerscape/ls-mc/Makefile
+++ b/package/firmware/layerscape/ls-mc/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ls-mc
 PKG_VERSION:=LSDK-20.04
-PKG_RELEASE:=2
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/NXP/qoriq-mc-binary.git
@@ -34,6 +34,8 @@ define Build/InstallDev
 		$(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-mc.itb
 	$(CP) $(PKG_BUILD_DIR)/ls2088a/mc_10.20.4_ls2088a.itb \
 		$(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-mc.itb
+	$(CP) $(PKG_BUILD_DIR)/lx2160a/mc_10.20.4_lx2160a.itb \
+		$(STAGING_DIR_IMAGE)/fsl_lx2160a-rdb-mc.itb
 endef
 
 $(eval $(call BuildPackage,layerscape-mc))
diff --git a/package/firmware/layerscape/ls-rcw/Makefile b/package/firmware/layerscape/ls-rcw/Makefile
index 421ef19e7b..f7f99a0c30 100644
--- a/package/firmware/layerscape/ls-rcw/Makefile
+++ b/package/firmware/layerscape/ls-rcw/Makefile
@@ -38,6 +38,8 @@ BOARDS := \
   ls1088a-rdb \
   ls1088a-rdb-sdboot \
   ls2088a-rdb \
+  lx2160a-rdb \
+  lx2160a-rdb-sdboot \
   ls1021a-twr
 
 RCW_ls1012a-rdb         :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin
@@ -52,6 +54,8 @@ RCW_ls1046a-rdb-sdboot  :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin
 RCW_ls1088a-rdb         :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin
 RCW_ls1088a-rdb-sdboot  :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin
 RCW_ls2088a-rdb         :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin
+RCW_lx2160a-rdb         :=lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2.bin
+RCW_lx2160a-rdb-sdboot  :=lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2.bin
 RCW_ls1021a-twr         :=ls1021atwr/SSR_PNS_30/rcw_1200.bin
 
 define Build/InstallDev
diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh
index f9b1e57a43..857be5a744 100644
--- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh
+++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh
@@ -74,7 +74,8 @@ platform_copy_config() {
 	fsl,ls1043a-rdb-sdboot | \
 	fsl,ls1046a-frwy-sdboot | \
 	fsl,ls1046a-rdb-sdboot | \
-	fsl,ls1088a-rdb-sdboot)
+	fsl,ls1088a-rdb-sdboot | \
+	fsl,lx2160a-rdb-sdboot)
 		platform_copy_config_sdboot
 		;;
 	esac
@@ -102,7 +103,9 @@ platform_check_image() {
 	fsl,ls1046a-rdb-sdboot | \
 	fsl,ls1088a-rdb | \
 	fsl,ls1088a-rdb-sdboot | \
-	fsl,ls2088a-rdb)
+	fsl,ls2088a-rdb | \
+	fsl,lx2160a-rdb | \
+	fsl,lx2160a-rdb-sdboot)
 		return 0
 		;;
 	*)
@@ -131,7 +134,8 @@ platform_do_upgrade() {
 	fsl,ls1046a-frwy | \
 	fsl,ls1046a-rdb | \
 	fsl,ls1088a-rdb | \
-	fsl,ls2088a-rdb)
+	fsl,ls2088a-rdb | \
+	fsl,lx2160a-rdb)
 		PART_NAME=firmware
 		default_do_upgrade "$1"
 		;;
@@ -141,7 +145,8 @@ platform_do_upgrade() {
 	fsl,ls1043a-rdb-sdboot | \
 	fsl,ls1046a-frwy-sdboot | \
 	fsl,ls1046a-rdb-sdboot | \
-	fsl,ls1088a-rdb-sdboot)
+	fsl,ls1088a-rdb-sdboot | \
+	fsl,lx2160a-rdb-sdboot)
 		platform_do_upgrade_sdboot "$1"
 		return 0
 		;;
diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk
index c037061aa2..89c81e5cb4 100644
--- a/target/linux/layerscape/image/armv8_64b.mk
+++ b/target/linux/layerscape/image/armv8_64b.mk
@@ -323,6 +323,58 @@ define Device/fsl_ls2088a-rdb
 endef
 TARGET_DEVICES += fsl_ls2088a-rdb
 
+define Device/fsl_lx2160a-rdb
+  DEVICE_VENDOR := NXP
+  DEVICE_MODEL := LX2160A-RDB
+  DEVICE_VARIANT := Rev2.0 silicon
+  DEVICE_PACKAGES += \
+    layerscape-mc \
+    layerscape-dpl \
+    layerscape-ddr-phy \
+    tfa-lx2160a-rdb \
+    restool
+  IMAGE/firmware.bin := \
+    ls-clean | \
+    ls-append $(1)-bl2.pbl | pad-to 1M | \
+    ls-append $(1)-fip.bin | pad-to 5M | \
+    ls-append $(1)-uboot-env.bin | pad-to 8M | \
+    ls-append $(1)-fip_ddr_all.bin | pad-to 10M | \
+    ls-append $(1)-mc.itb | pad-to 13M | \
+    ls-append $(1)-dpl.dtb | pad-to 14M | \
+    ls-append $(1)-dpc.dtb | pad-to 15M | \
+    ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
+    append-kernel | pad-to 32M | \
+    append-rootfs | pad-rootfs | check-size
+endef
+TARGET_DEVICES += fsl_lx2160a-rdb
+
+define Device/fsl_lx2160a-rdb-sdboot
+  $(Device/fsl-sdboot)
+  DEVICE_VENDOR := NXP
+  DEVICE_MODEL := LX2160A-RDB
+  DEVICE_VARIANT := Rev2.0 silicon SD Card Boot
+  DEVICE_PACKAGES += \
+    layerscape-mc \
+    layerscape-dpl \
+    layerscape-ddr-phy \
+    tfa-lx2160a-rdb-sdboot \
+    restool
+  DEVICE_DTS := freescale/fsl-lx2160a-rdb
+  IMAGE/sdcard.img.gz := \
+    ls-clean | \
+    ls-append-sdhead $(1) | pad-to 4K | \
+    ls-append $(1)-bl2.pbl | pad-to 1M | \
+    ls-append $(1)-fip.bin | pad-to 5M | \
+    ls-append $(1)-uboot-env.bin | pad-to 8M | \
+    ls-append fsl_lx2160a-rdb-fip_ddr_all.bin | pad-to 10M | \
+    ls-append fsl_lx2160a-rdb-mc.itb | pad-to 13M | \
+    ls-append fsl_lx2160a-rdb-dpl.dtb | pad-to 14M | \
+    ls-append fsl_lx2160a-rdb-dpc.dtb | pad-to 16M | \
+    ls-append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
+    append-rootfs | pad-to $(LS_SD_IMAGE_SIZE)M | gzip
+endef
+TARGET_DEVICES += fsl_lx2160a-rdb-sdboot
+
 define Device/traverse_ls1043
   DEVICE_VENDOR := Traverse
   DEVICE_MODEL := LS1043 Boards



More information about the lede-commits mailing list