From 12b96757e5425c9fc4c38e564d0448ecf5655acc Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sun, 30 Apr 2023 11:53:40 +0200 Subject: [PATCH 1/9] iproute2: update to 6.3.0 Release Notes: https://lore.kernel.org/netdev/20230427090253.7a92616b@hermes.local/T/ Signed-off-by: Nick Hainke --- package/network/utils/iproute2/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 2cd14fe83d..101ca67324 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=6.2.0 +PKG_VERSION:=6.3.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=4d72730200ec5b2aabaa1a2f20553c6748292f065d9a154c7d5e22559df9fd62 +PKG_HASH:=dfb2a98db96e7a653cffc6693335a1a466e29a34b6ac528be48f35e1d2766732 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 From 1108f6cb8b115608c486552f1210fea5b955ea5f Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Wed, 3 May 2023 14:34:25 +0200 Subject: [PATCH 2/9] umbim: allow forcing DHCP/DHCPv6 configuration To support the widest variety of modems, allow restoring previous behaviour of configuring the link throug means of DHCP(v6) exclusively. Change the default value of "dhcp" and "dhcpv6" UCI options to "auto", while keeping the default behaviour of "prefer out-of-band configuration", intact. Setting "dhcp" or "dhcpv6" to boolean 1 will now force using DHCP and DHCPv6, respectively. Signed-off-by: Lech Perczak --- .../utils/umbim/files/lib/netifd/proto/mbim.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh index bf07137fc4..50913e7fa0 100755 --- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh +++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh @@ -20,8 +20,8 @@ proto_mbim_init_config() { proto_config_add_string username proto_config_add_string password [ -e /proc/sys/net/ipv6 ] && proto_config_add_string ipv6 - proto_config_add_boolean dhcp - proto_config_add_boolean dhcpv6 + proto_config_add_string dhcp + proto_config_add_string dhcpv6 proto_config_add_string pdptype proto_config_add_int mtu proto_config_add_defaults @@ -199,15 +199,15 @@ _proto_mbim_setup() { proto_init_update "$ifname" 1 proto_send_update "$interface" - [ -z "$dhcp" ] && dhcp=1 - [ -z "$dhcpv6" ] && dhcpv6=1 + [ -z "$dhcp" ] && dhcp="auto" + [ -z "$dhcpv6" ] && dhcpv6="auto" [ "$iptype" != "ipv6" ] && { json_init json_add_string name "${interface}_4" json_add_string ifname "@$interface" ipv4address=$(_proto_mbim_get_field ipv4address "$mbimconfig") - if [ -n "$ipv4address" ]; then + if [ -n "$ipv4address" -a "$dhcp" != 1 ]; then json_add_string proto "static" json_add_array ipaddr @@ -222,7 +222,7 @@ _proto_mbim_setup() { json_add_string proto "dhcp" fi - [ "$peerdns" = 0 ] || { + [ "$peerdns" = 0 -a "$dhcp" != 1 ] || { json_add_array dns for server in $(_proto_mbim_get_field ipv4dnsserver "$mbimconfig"); do json_add_string "" "$server" @@ -242,7 +242,7 @@ _proto_mbim_setup() { json_add_string name "${interface}_6" json_add_string ifname "@$interface" ipv6address=$(_proto_mbim_get_field ipv6address "$mbimconfig") - if [ -n "$ipv6address" ]; then + if [ -n "$ipv6address" -a "$dhcpv6" != 1 ]; then json_add_string proto "static" json_add_array ip6addr @@ -265,7 +265,7 @@ _proto_mbim_setup() { json_add_string extendprefix 1 fi - [ "$peerdns" = 0 ] || { + [ "$peerdns" = 0 -a "$dhcpv6" != 1 ] || { json_add_array dns for server in $(_proto_mbim_get_field ipv6dnsserver "$mbimconfig"); do json_add_string "" "$server" From ecdb24814f540cb67cfa0ca64f32d76889853d15 Mon Sep 17 00:00:00 2001 From: Maximilian Weinmann Date: Fri, 4 Nov 2022 00:23:44 +0700 Subject: [PATCH 3/9] ramips: add support for SNR-CPE-ME1 SNR-CPE-ME1 is a wireless WiFi 5 router manufactured by SNR/NAG company. Specification: - SoC : MediaTek MT7621A - RAM : DDR3 256 MiB - Flash : SPI-NOR 16 MiB (GD25Q128CSIG) - WLAN : 2.4 GHz (MediaTek MT7603EN) 5 GHz (MediaTek MT7610EN) - Ethernet : 10/100/1000 Mbps x5 - Switch : MediaTek MT7530 (in SoC) - USB : 3.0 x1 - UART : through-hole on PCB - [J4] 3.3V, RX, TX, GND (57600n8) - Power : 12 VDC, 2 A Flash instruction via TFTP: 1. Boot SNR-CPE-ME1 to recovery mode (hold the reset button while power on) 2. Send firmware via TFTP client: TFTP Server address: 192.168.1.1 TFTP Client address: 192.168.1.131 3. Wait ~120 seconds to complete flashing 4. Do sysupgrade using web-interface Signed-off-by: Maximilian Weinmann --- package/boot/uboot-envtools/files/ramips | 1 + .../linux/ramips/dts/mt7621_snr-cpe-me1.dts | 212 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 12 + .../mt7621/base-files/etc/board.d/01_leds | 3 + 4 files changed, 228 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_snr-cpe-me1.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 4b7eeb8960..f981fc73ef 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -87,6 +87,7 @@ linksys,ea8100-v2|\ mts,wg430223) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" ;; +snr,snr-cpe-me1|\ snr,snr-cpe-me2-sfp|\ snr,cpe-w4n-mt) idx="$(find_mtd_index uboot-env)" diff --git a/target/linux/ramips/dts/mt7621_snr-cpe-me1.dts b/target/linux/ramips/dts/mt7621_snr-cpe-me1.dts new file mode 100644 index 0000000000..7f0dbf772d --- /dev/null +++ b/target/linux/ramips/dts/mt7621_snr-cpe-me1.dts @@ -0,0 +1,212 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "snr,snr-cpe-me1", "mediatek,mt7621-soc"; + model = "SNR-CPE-ME1"; + + aliases { + label-mac-device = &gmac1; + + led-boot = &led_usb; + led-failsafe = &led_vpn; + led-running = &led_green; + led-upgrade = &led_sys; + }; + + leds { + compatible = "gpio-leds"; + + led_usb: led-0 { // USB Activity + color = ; + function = LED_FUNCTION_USB; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; // [JTAG] JTDO + }; + + led_vpn: led-1 { // VPN Activity + color = ; + function = LED_FUNCTION_INDICATOR; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; // [JTAG] JTCLK + }; + + led_sys: led-2 { // System config + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; // [I2C] I2C_SD + panic-indicator; + }; + + led_green: led-3 { // ? LED + color = ; + function = LED_FUNCTION_HEARTBEAT; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; // [JTAG] JTMS + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset Button"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; // [JTAG] JTDI + linux,code = ; + }; + }; + + reg_usb_vbus: regulator { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 17 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { // MT7603EN + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { // MT7610EN + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { // GD25Q128CSIG + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <44000000>; // 44 MHz + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "Config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "Factory"; + reg = <0x40000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; + + partition@50000 { + compatible = "openwrt,uimage", "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + + partition@30001 { + label = "uboot-env"; + reg = <0x30000 0x1000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "jtag"; + function = "gpio"; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + }; +}; + +&xhci { + vbus-supply = <®_usb_vbus>; + vusb33-supply = <®_3p3v>; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 3e910e88f6..d33937a8d7 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2031,6 +2031,18 @@ define Device/sim_simax1800t endef TARGET_DEVICES += sim_simax1800t +define Device/snr_snr-cpe-me1 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 15040k + DEVICE_VENDOR := SNR + DEVICE_MODEL := SNR-CPE-ME1 + UIMAGE_NAME := SNR-CPE-ME1-5GHZ-MT + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x0e kmod-usb3 \ + kmod-usb-ledtrig-usbport uboot-envtools +endef +TARGET_DEVICES += snr_snr-cpe-me1 + define Device/snr_snr-cpe-me2-lite $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 726d26f077..b243acbbbf 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -163,6 +163,9 @@ oraybox,x3a) ucidef_set_led_netdev "wan" "wan link" "red:status" "wan" ucidef_set_led_netdev "lan" "lan link" "green:status" "br-lan" ;; +snr,snr-cpe-me1) + ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1" + ;; tplink,archer-a6-v3|\ tplink,archer-ax23-v1|\ tplink,archer-c6-v3|\ From ca81441769dfb10645292eb1ea44ea1b54768a28 Mon Sep 17 00:00:00 2001 From: Wojciech Dubowik Date: Tue, 19 Jul 2022 13:34:17 +0200 Subject: [PATCH 4/9] ls-rcw: Add ls1028ardb support Support RCW for NXP LS1028ARDB reference board. Signed-off-by: Wojciech Dubowik --- package/firmware/layerscape/ls-rcw/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/firmware/layerscape/ls-rcw/Makefile b/package/firmware/layerscape/ls-rcw/Makefile index d16b69be2d..1925eeafef 100644 --- a/package/firmware/layerscape/ls-rcw/Makefile +++ b/package/firmware/layerscape/ls-rcw/Makefile @@ -31,6 +31,8 @@ BOARDS := \ ls1012a-rdb \ ls1012a-frdm \ ls1012a-frwy-sdboot \ + ls1028a-rdb \ + ls1028a-rdb-sdboot \ ls1043a-rdb \ ls1043a-rdb-sdboot \ ls1046a-frwy \ @@ -47,6 +49,8 @@ BOARDS := \ RCW_ls1012a-rdb :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin RCW_ls1012a-frdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin RCW_ls1012a-frwy-sdboot :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin +RCW_ls1028a-rdb :=ls1028ardb/R_SQPP_0x85bb/rcw_1300.bin +RCW_ls1028a-rdb-sdboot :=ls1028ardb/R_SQPP_0x85bb/rcw_1500_sdboot.bin RCW_ls1043a-rdb :=ls1043ardb/RR_FQPP_1455/rcw_1600.bin RCW_ls1043a-rdb-sdboot :=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin RCW_ls1046a-frwy :=ls1046afrwy/NN_NNQNNPNP_3040_0506/rcw_1600_qspiboot.bin From 29149a9b35d52081e62a42b7d60336a58e01728e Mon Sep 17 00:00:00 2001 From: Wojciech Dubowik Date: Wed, 12 Apr 2023 14:36:11 +0200 Subject: [PATCH 5/9] uboot-layerscape: Don't fixup kaslr seed when no node There seems to be a difference in firmware calling convention between upstream and NXP kernels. On some cpus like ls1028 it will hang on firmware secure get random when using LF uboot with upstream kernel. Instead of commenting it out, don't call get radnom seed when "kaslr-seed" is not present in device tree. Signed-off-by: Wojciech Dubowik --- ...rmware-get-random-when-no-kaslr-seed.patch | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 package/boot/uboot-layerscape/patches/0003-avoid-calling-sec-firmware-get-random-when-no-kaslr-seed.patch diff --git a/package/boot/uboot-layerscape/patches/0003-avoid-calling-sec-firmware-get-random-when-no-kaslr-seed.patch b/package/boot/uboot-layerscape/patches/0003-avoid-calling-sec-firmware-get-random-when-no-kaslr-seed.patch new file mode 100644 index 0000000000..681ec90f1c --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0003-avoid-calling-sec-firmware-get-random-when-no-kaslr-seed.patch @@ -0,0 +1,33 @@ +Index: uboot-layerscape-lf-6.1.1-1.0.0/arch/arm/cpu/armv8/sec_firmware.c +=================================================================== +--- uboot-layerscape-lf-6.1.1-1.0.0.orig/arch/arm/cpu/armv8/sec_firmware.c ++++ uboot-layerscape-lf-6.1.1-1.0.0/arch/arm/cpu/armv8/sec_firmware.c +@@ -473,12 +473,6 @@ int fdt_fixup_kaslr(void *fdt) + return 0; + } + +- ret = sec_firmware_get_random(rand, 8); +- if (ret < 0) { +- printf("WARNING: No random number to set kaslr-seed\n"); +- return 0; +- } +- + err = fdt_check_header(fdt); + if (err < 0) { + printf("fdt_chosen: %s\n", fdt_strerror(err)); +@@ -490,6 +484,15 @@ int fdt_fixup_kaslr(void *fdt) + if (nodeoffset < 0) + return 0; + ++ if (fdt_find_or_add_subnode(fdt, nodeoffset, "kaslr-seed")) ++ return 0; ++ ++ ret = sec_firmware_get_random(rand, 8); ++ if (ret < 0) { ++ printf("WARNING: No random number to set kaslr-seed\n"); ++ return 0; ++ } ++ + err = fdt_setprop(fdt, nodeoffset, "kaslr-seed", rand, + sizeof(rand)); + if (err < 0) { From b812844c438fae135ba3c65374b2d187bbe070c4 Mon Sep 17 00:00:00 2001 From: Wojciech Dubowik Date: Wed, 12 Apr 2023 12:07:32 +0200 Subject: [PATCH 6/9] uboot-layerscape: Add ls1028ardb support Support uboot for NXP LS1028ARDB reference board. GIC V3 has to be disabled in the uboot config to allow booting upstream kernels. This patch can be dropped once uboot is updated to 2022.04 version to nxp-qoriq github lf-6.1.1 branch. Signed-off-by: Wojciech Dubowik --- package/boot/uboot-layerscape/Makefile | 12 ++++++++++++ .../files/fsl_ls1028a-rdb-sdboot-uEnv.txt | 10 ++++++++++ .../uboot-layerscape/files/fsl_ls1028a-rdb-uEnv.txt | 9 +++++++++ ...4-disable-gic-initialization-for-ls1028ardb.patch | 8 ++++++++ 4 files changed, 39 insertions(+) create mode 100644 package/boot/uboot-layerscape/files/fsl_ls1028a-rdb-sdboot-uEnv.txt create mode 100644 package/boot/uboot-layerscape/files/fsl_ls1028a-rdb-uEnv.txt create mode 100644 package/boot/uboot-layerscape/patches/0004-disable-gic-initialization-for-ls1028ardb.patch diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile index 53d21f59dc..f21e51c018 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -45,6 +45,16 @@ define U-Boot/fsl_ls1012a-frwy-sdboot ENV_SIZE:=0x10000 endef +define U-Boot/fsl_ls1028a-rdb + NAME:=NXP LS1028ARDB + UBOOT_CONFIG:=ls1028ardb_tfa +endef + +define U-Boot/fsl_ls1028a-rdb-sdboot + NAME:=NXP LS1028ARDB SD Card Boot + UBOOT_CONFIG:=ls1028ardb_tfa +endef + define U-Boot/fsl_ls1043a-rdb NAME:=NXP LS1043ARDB UBOOT_CONFIG:=ls1043ardb_tfa @@ -127,6 +137,8 @@ UBOOT_TARGETS := \ fsl_ls1012a-frdm \ fsl_ls1012a-rdb \ fsl_ls1012a-frwy-sdboot \ + fsl_ls1028a-rdb \ + fsl_ls1028a-rdb-sdboot \ fsl_ls1043a-rdb \ fsl_ls1043a-rdb-sdboot \ fsl_ls1046a-frwy \ diff --git a/package/boot/uboot-layerscape/files/fsl_ls1028a-rdb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1028a-rdb-sdboot-uEnv.txt new file mode 100644 index 0000000000..3c39c2263d --- /dev/null +++ b/package/boot/uboot-layerscape/files/fsl_ls1028a-rdb-sdboot-uEnv.txt @@ -0,0 +1,10 @@ +fdtaddr=0x8f000000 +loadaddr=0x81000000 +fdt_high=0x8fffffff +initrd_high=0xffffffffffffffff +hwconfig=fsl_ddr:bank_intlv=auto +sd_boot=ext4load mmc 0:1 $loadaddr fitImage;bootm $loadaddr +bootargs=root=/dev/mmcblk0p2 rw rootwait rootfstype=squashfs,f2fs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 +bootcmd=echo starting openwrt ...;run sd_boot +bootdelay=3 +fsl_bootcmd_mcinitcmd_set=y diff --git a/package/boot/uboot-layerscape/files/fsl_ls1028a-rdb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1028a-rdb-uEnv.txt new file mode 100644 index 0000000000..21d41d15b5 --- /dev/null +++ b/package/boot/uboot-layerscape/files/fsl_ls1028a-rdb-uEnv.txt @@ -0,0 +1,9 @@ +fdtaddr=0x8f000000 +loadaddr=0x81000000 +bootm_size=0x10000000 +hwconfig=fsl_ddr:bank_intlv=auto +qspi_boot=sf probe 0:0;sf read $loadaddr 1000000 1000000;bootm $loadaddr +bootargs=rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi:1m(bl2),4m(fip),1m(u-boot-env),128k(secure-boot-headers),48m@0x1000000(firmware) +bootcmd=echo starting openwrt ...;run qspi_boot +bootdelay=3 +fsl_bootcmd_mcinitcmd_set=y diff --git a/package/boot/uboot-layerscape/patches/0004-disable-gic-initialization-for-ls1028ardb.patch b/package/boot/uboot-layerscape/patches/0004-disable-gic-initialization-for-ls1028ardb.patch new file mode 100644 index 0000000000..72011ae3a9 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0004-disable-gic-initialization-for-ls1028ardb.patch @@ -0,0 +1,8 @@ +--- a/configs/ls1028ardb_tfa_defconfig ++++ b/configs/ls1028ardb_tfa_defconfig +@@ -1,5 +1,4 @@ + CONFIG_ARM=y +-CONFIG_GIC_V3_ITS=y + CONFIG_TARGET_LS1028ARDB=y + CONFIG_TFABOOT=y + CONFIG_SYS_MALLOC_F_LEN=0x6000 From 7700a6f8266cb12fbfd32456a3ae8181bc1cf347 Mon Sep 17 00:00:00 2001 From: Wojciech Dubowik Date: Tue, 19 Jul 2022 13:33:39 +0200 Subject: [PATCH 7/9] tfa-layerscape: Add ls1028ardb support Support TF-a for NXP LS1028ARDB reference board. Signed-off-by: Wojciech Dubowik --- package/boot/tfa-layerscape/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package/boot/tfa-layerscape/Makefile b/package/boot/tfa-layerscape/Makefile index 072036da2f..adcc005b83 100644 --- a/package/boot/tfa-layerscape/Makefile +++ b/package/boot/tfa-layerscape/Makefile @@ -63,6 +63,18 @@ define Trusted-Firmware-A/ls1012a-frwy-sdboot BOOT_MODE:=qspi endef +define Trusted-Firmware-A/ls1028a-rdb + TITLE:=NXP LS1028ARDB + PLAT:=ls1028ardb + BOOT_MODE:=flexspi_nor +endef + +define Trusted-Firmware-A/ls1028a-rdb-sdboot + TITLE:=NXP LS1028ARDB SD Boot + PLAT:=ls1028ardb + BOOT_MODE:=sd +endef + define Trusted-Firmware-A/ls1043a-rdb NAME:=NXP LS1043ARDB PLAT:=ls1043ardb @@ -133,6 +145,8 @@ TFA_TARGETS := \ ls1012a-frdm \ ls1012a-rdb \ ls1012a-frwy-sdboot \ + ls1028a-rdb \ + ls1028a-rdb-sdboot \ ls1043a-rdb \ ls1043a-rdb-sdboot \ ls1046a-frwy \ From 924a5aabc708d2ab84ae9c05a580db75b188534f Mon Sep 17 00:00:00 2001 From: Wojciech Dubowik Date: Tue, 19 Jul 2022 13:35:12 +0200 Subject: [PATCH 8/9] layerscape: Add ls1028ardb support Add support for NXP LS1028ARDB reference board. It's a dual core Coretex-A53 board with 4G RAM and 5 Eternet ports (4 ports are connected to MSCC Felix switch). The original layout of NXP board has been kept but firmware images are adapted to be more sysupgrade friendly. At the moment NOR and SD boots are supported. NOR flash instructions: * make sd card with sdboot image * boot * write firmware image to spi flash $ mtd write /tmp/openwrt-layerscape-armv8_64b-fsl_ls1028a-rdb- squashfs-firmware.bin /dev/mtd0 * change jumper to NOR boot and reset V3: * Added board specific network defaults for lan/wan v2: * Added INA220 curent monitor, PCF2129 RTC clock and NXP SA56004ED temperature sensor to default packages * removed compat fixups for thist board Signed-off-by: Wojciech Dubowik --- target/linux/layerscape/README | 10 ++++ .../base-files/etc/board.d/02_network | 4 ++ .../base-files/lib/preinit/79_move_config | 1 + .../base-files/lib/upgrade/platform.sh | 5 ++ target/linux/layerscape/image/armv8_64b.mk | 47 +++++++++++++++++++ 5 files changed, 67 insertions(+) diff --git a/target/linux/layerscape/README b/target/linux/layerscape/README index a8d1846468..1e3f707b4f 100644 --- a/target/linux/layerscape/README +++ b/target/linux/layerscape/README @@ -12,6 +12,7 @@ users can bring up the board without difficulty. LS1012ARDB (QSPI NOR boot) LS1012AFRDM (QSPI NOR boot) LS1012AFRWY (QSPI NOR boot) + LS1028ARDB (QSPI NOR boot | SD card boot) LS1043ARDB (NOR boot | SD card boot) LS1046ARDB (QSPI NOR boot | SD card boot) LS1046AFRWY (QSPI NOR boot | SD card boot) @@ -95,6 +96,15 @@ from SD card. (sdcard.img images are gz-iped to save space. Please extract them => sf write a0000000 0 $filesize => reset +* LS1028ARDB + Board has only one bank. Those commands will replace stock bootloader + and firmware. + => tftp a0000000 -firmware.bin + => sf probe 0:0 + => sf erase 0 +$filesize + => sf write a0000000 0 $filesize + => reset + * LS1043ARDB Start up from bank0, and program firmware to bank4 with below commands. Switch to bank4 to start up OpenWrt. diff --git a/target/linux/layerscape/base-files/etc/board.d/02_network b/target/linux/layerscape/base-files/etc/board.d/02_network index b46f0b0621..172172c12c 100644 --- a/target/linux/layerscape/base-files/etc/board.d/02_network +++ b/target/linux/layerscape/base-files/etc/board.d/02_network @@ -5,6 +5,10 @@ board_config_update case "$(board_name)" in + fsl,ls1028a-rdb|\ + fsl,ls1028a-rdb-sdboot) + ucidef_set_interfaces_lan_wan "swp0 swp1 swp2 swp3" "eth0" + ;; traverse,ls1043v) ucidef_set_interface_lan "eth0 eth1 eth2 eth3" ucidef_set_interface_wan "eth4" diff --git a/target/linux/layerscape/base-files/lib/preinit/79_move_config b/target/linux/layerscape/base-files/lib/preinit/79_move_config index 901a289b66..5519e059d9 100644 --- a/target/linux/layerscape/base-files/lib/preinit/79_move_config +++ b/target/linux/layerscape/base-files/lib/preinit/79_move_config @@ -10,6 +10,7 @@ move_config() { fsl,ls1012a-frwy-sdboot | \ fsl,ls1021a-iot-sdboot | \ fsl,ls1021a-twr-sdboot | \ + fsl,ls1028a-rdb-sdboot | \ fsl,ls1043a-rdb-sdboot | \ fsl,ls1046a-frwy-sdboot | \ fsl,ls1046a-rdb-sdboot | \ diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh index 857be5a744..e88dfdf145 100644 --- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh +++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh @@ -71,6 +71,7 @@ platform_copy_config() { fsl,ls1012a-frwy-sdboot | \ fsl,ls1021a-iot-sdboot | \ fsl,ls1021a-twr-sdboot | \ + fsl,ls1028a-rdb-sdboot | \ fsl,ls1043a-rdb-sdboot | \ fsl,ls1046a-frwy-sdboot | \ fsl,ls1046a-rdb-sdboot | \ @@ -95,6 +96,8 @@ platform_check_image() { fsl,ls1021a-iot-sdboot | \ fsl,ls1021a-twr | \ fsl,ls1021a-twr-sdboot | \ + fsl,ls1028a-rdb | \ + fsl,ls1028a-rdb-sdboot | \ fsl,ls1043a-rdb | \ fsl,ls1043a-rdb-sdboot | \ fsl,ls1046a-frwy | \ @@ -130,6 +133,7 @@ platform_do_upgrade() { fsl,ls1012a-frdm | \ fsl,ls1012a-rdb | \ fsl,ls1021a-twr | \ + fsl,ls1028a-rdb | \ fsl,ls1043a-rdb | \ fsl,ls1046a-frwy | \ fsl,ls1046a-rdb | \ @@ -142,6 +146,7 @@ platform_do_upgrade() { fsl,ls1012a-frwy-sdboot | \ fsl,ls1021a-iot-sdboot | \ fsl,ls1021a-twr-sdboot | \ + fsl,ls1028a-rdb-sdboot | \ fsl,ls1043a-rdb-sdboot | \ fsl,ls1046a-frwy-sdboot | \ fsl,ls1046a-rdb-sdboot | \ diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index 4a69f1c19e..f5a6a055fb 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -98,6 +98,53 @@ define Device/fsl_ls1012a-frwy-sdboot endef TARGET_DEVICES += fsl_ls1012a-frwy-sdboot +define Device/fsl_ls1028a-rdb + DEVICE_VENDOR := NXP + DEVICE_MODEL := LS1028A-RDB + DEVICE_VARIANT := Default + DEVICE_DTS := freescale/fsl-ls1028a-rdb + KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb + DEVICE_PACKAGES += \ + trusted-firmware-a-ls1028a-rdb \ + kmod-hwmon-ina2xx \ + kmod-hwmon-lm90 \ + kmod-rtc-pcf2127 + 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 16M | \ + append-kernel | \ + append-rootfs | pad-rootfs | check-size + IMAGE/sysupgrade.bin := \ + append-kernel | \ + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata +endef +TARGET_DEVICES += fsl_ls1028a-rdb + +define Device/fsl_ls1028a-rdb-sdboot + $(Device/fsl-sdboot) + DEVICE_VENDOR := NXP + DEVICE_MODEL := LS1028A-RDB + DEVICE_VARIANT := SD Card Boot + DEVICE_DTS := freescale/fsl-ls1028a-rdb + DEVICE_PACKAGES += \ + trusted-firmware-a-ls1028a-rdb-sdboot \ + kmod-hwmon-ina2xx \ + kmod-hwmon-lm90 \ + kmod-rtc-pcf2127 + 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 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_ls1028a-rdb-sdboot + define Device/fsl_ls1043a-rdb $(Device/fix-sysupgrade) DEVICE_VENDOR := NXP From 326eb6e482498a676c22d4daa1629ce8c273980d Mon Sep 17 00:00:00 2001 From: Wojciech Dubowik Date: Wed, 12 Apr 2023 15:22:13 +0200 Subject: [PATCH 9/9] layerscape: Add support for Felix DSA switch It's present on LS1028ARDB reference board from NXP. Signed-off-by: Wojciech Dubowik --- target/linux/layerscape/armv8_64b/config-5.15 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/linux/layerscape/armv8_64b/config-5.15 b/target/linux/layerscape/armv8_64b/config-5.15 index 73815b174d..3fe55e6118 100644 --- a/target/linux/layerscape/armv8_64b/config-5.15 +++ b/target/linux/layerscape/armv8_64b/config-5.15 @@ -495,6 +495,7 @@ CONFIG_MOUSE_PS2_TRACKPOINT=y # CONFIG_MOUSE_VSXXXAA is not set CONFIG_MPILIB=y CONFIG_MRP=y +CONFIG_MSCC_OCELOT_SWITCH_LIB=y CONFIG_MTD_CFI_ADV_OPTIONS=y # CONFIG_MTD_CFI_GEOMETRY is not set CONFIG_MTD_CFI_STAA=y @@ -527,6 +528,10 @@ CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_NET_DEVLINK=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_MSCC_FELIX=y +CONFIG_NET_DSA_TAG_OCELOT=y +CONFIG_NET_DSA_TAG_OCELOT_8021Q=y CONFIG_NET_FAILOVER=y CONFIG_NET_FLOW_LIMIT=y CONFIG_NET_NS=y