From 6a4dcb4719130fc843de46e837f297a2088edad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Fri, 19 Feb 2021 11:06:23 +0100 Subject: [PATCH 01/16] cypress-firmware: fix PKG_SOURCE_URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Download link has been moved. Signed-off-by: Álvaro Fernández Rojas (cherry-picked from commit 7febba3e50) --- package/firmware/cypress-firmware/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/firmware/cypress-firmware/Makefile b/package/firmware/cypress-firmware/Makefile index d881384006..d4ace8509a 100644 --- a/package/firmware/cypress-firmware/Makefile +++ b/package/firmware/cypress-firmware/Makefile @@ -15,7 +15,7 @@ PKG_RELEASE:=3 PKG_SOURCE_UNZIP:=cypress-firmware-$(PKG_VERSION).tar.gz PKG_SOURCE:=cypress-fmac-$(PKG_VERSION).zip -PKG_SOURCE_URL:=https://community.cypress.com/servlet/JiveServlet/download/19375-1-53475/ +PKG_SOURCE_URL:=https://community.cypress.com/gfawx74859/attachments/gfawx74859/resourcelibrary/1016/1/ PKG_HASH:=b12b0570f462c2f3c26dde98b10235a845a7109037def1e7e51af728bcc1a958 PKG_MAINTAINER:=Álvaro Fernández Rojas From c74df745fd66b9de7c2d36b79860160e737a5292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Fri, 19 Feb 2021 12:25:38 +0100 Subject: [PATCH 02/16] bcm63xx: update ethernet kernel panics fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use new patch from Sieng Piaw Liew. Signed-off-by: Sieng Piaw Liew Signed-off-by: Álvaro Fernández Rojas (cherry-picked from commit 31a06f8fcc) --- .../047-bcm63xx_enet-fix-kernel-panic.patch | 50 +++++++++++++------ ...402_bcm63xx_enet_vlan_incoming_fixed.patch | 2 +- ...-move-phy_-dis-connect-into-probe-re.patch | 18 +++---- ...enable-rgmii-clock-on-external-ports.patch | 2 +- .../423-bcm63xx_enet_add_b53_support.patch | 12 ++--- ...4-bcm63xx_enet_no_request_mem_region.patch | 2 +- .../428-bcm63xx_enet-rgmii-ctrl-fix.patch | 2 +- 7 files changed, 54 insertions(+), 34 deletions(-) diff --git a/target/linux/bcm63xx/patches-5.4/047-bcm63xx_enet-fix-kernel-panic.patch b/target/linux/bcm63xx/patches-5.4/047-bcm63xx_enet-fix-kernel-panic.patch index 466a64cae1..4a1feb3a10 100644 --- a/target/linux/bcm63xx/patches-5.4/047-bcm63xx_enet-fix-kernel-panic.patch +++ b/target/linux/bcm63xx/patches-5.4/047-bcm63xx_enet-fix-kernel-panic.patch @@ -1,15 +1,23 @@ +From ca6be00ca1d3a2f5b8794894e2dae175e63768f5 Mon Sep 17 00:00:00 2001 +From: Sieng Piaw Liew +Date: Tue, 16 Feb 2021 16:23:08 +0800 +Subject: [PATCH] bcm63xx_enet: Fix sporadic kernel panic + +In ndo_stop functions, netdev_completed_queue() is called during forced +tx reclaim, after netdev_reset_queue(). This may trigger kernel panic if +there is any tx skb left. + +This patch moves netdev_reset_queue() to after tx reclaim, so BQL can +complete successfully then reset. + +Signed-off-by: Sieng Piaw Liew +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -1105,6 +1105,8 @@ static int bcm_enet_open(struct net_devi - else - bcm_enet_adjust_link(dev); - -+ netdev_reset_queue(dev); -+ - netif_start_queue(dev); - return 0; - -@@ -1193,7 +1195,6 @@ static int bcm_enet_stop(struct net_devi +@@ -1193,7 +1193,6 @@ static int bcm_enet_stop(struct net_devi kdev = &priv->pdev->dev; netif_stop_queue(dev); @@ -17,13 +25,15 @@ napi_disable(&priv->napi); if (priv->has_phy) phy_stop(dev->phydev); -@@ -2267,6 +2268,7 @@ static int bcm_enetsw_open(struct net_de - enet_dmac_writel(priv, ENETDMAC_IR_PKTDONE_MASK, - ENETDMAC_IRMASK, priv->tx_chan); +@@ -1232,6 +1231,9 @@ static int bcm_enet_stop(struct net_devi + if (priv->has_phy) + phy_disconnect(dev->phydev); ++ /* reset BQL after forced tx reclaim to not kernel panic */ + netdev_reset_queue(dev); - netif_carrier_on(dev); - netif_start_queue(dev); ++ + return 0; + } @@ -2348,7 +2350,6 @@ static int bcm_enetsw_stop(struct net_de @@ -33,3 +43,13 @@ napi_disable(&priv->napi); del_timer_sync(&priv->rx_timeout); +@@ -2376,6 +2377,9 @@ static int bcm_enetsw_stop(struct net_de + free_irq(priv->irq_tx, dev); + free_irq(priv->irq_rx, dev); + ++ /* reset BQL after forced tx reclaim to not kernel panic */ ++ netdev_reset_queue(dev); ++ + return 0; + } + diff --git a/target/linux/bcm63xx/patches-5.4/402_bcm63xx_enet_vlan_incoming_fixed.patch b/target/linux/bcm63xx/patches-5.4/402_bcm63xx_enet_vlan_incoming_fixed.patch index bd0c4cfc3f..2425e221a2 100644 --- a/target/linux/bcm63xx/patches-5.4/402_bcm63xx_enet_vlan_incoming_fixed.patch +++ b/target/linux/bcm63xx/patches-5.4/402_bcm63xx_enet_vlan_incoming_fixed.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -1630,7 +1630,7 @@ static int bcm_enet_change_mtu(struct ne +@@ -1631,7 +1631,7 @@ static int bcm_enet_change_mtu(struct ne return -EBUSY; /* add ethernet header + vlan tag size */ diff --git a/target/linux/bcm63xx/patches-5.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch b/target/linux/bcm63xx/patches-5.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch index a389f642ad..c9392c216c 100644 --- a/target/linux/bcm63xx/patches-5.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch +++ b/target/linux/bcm63xx/patches-5.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch @@ -79,7 +79,7 @@ Signed-off-by: Jonas Gorski else bcm_enet_adjust_link(dev); -@@ -1133,10 +1110,6 @@ out_freeirq_rx: +@@ -1131,10 +1108,6 @@ out_freeirq_rx: out_freeirq: free_irq(dev->irq, dev); @@ -90,7 +90,7 @@ Signed-off-by: Jonas Gorski return ret; } -@@ -1229,10 +1202,6 @@ static int bcm_enet_stop(struct net_devi +@@ -1227,10 +1200,6 @@ static int bcm_enet_stop(struct net_devi free_irq(priv->irq_rx, dev); free_irq(dev->irq, dev); @@ -98,10 +98,10 @@ Signed-off-by: Jonas Gorski - if (priv->has_phy) - phy_disconnect(dev->phydev); - - return 0; - } + /* reset BQL after forced tx reclaim to not kernel panic */ + netdev_reset_queue(dev); -@@ -1801,14 +1770,47 @@ static int bcm_enet_probe(struct platfor +@@ -1802,14 +1771,47 @@ static int bcm_enet_probe(struct platfor /* do minimal hardware init to be able to probe mii bus */ bcm_enet_hw_preinit(priv); @@ -150,7 +150,7 @@ Signed-off-by: Jonas Gorski } bus = priv->mii_bus; -@@ -1832,6 +1834,26 @@ static int bcm_enet_probe(struct platfor +@@ -1833,6 +1835,26 @@ static int bcm_enet_probe(struct platfor dev_err(&pdev->dev, "unable to register mdio bus\n"); goto out_free_mdio; } @@ -177,7 +177,7 @@ Signed-off-by: Jonas Gorski } else { /* run platform code to initialize PHY device */ -@@ -1839,45 +1861,16 @@ static int bcm_enet_probe(struct platfor +@@ -1840,45 +1862,16 @@ static int bcm_enet_probe(struct platfor pd->mii_config(dev, 1, bcm_enet_mdio_read_mii, bcm_enet_mdio_write_mii)) { dev_err(&pdev->dev, "unable to configure mdio bus\n"); @@ -227,7 +227,7 @@ Signed-off-by: Jonas Gorski if (priv->mii_bus) mdiobus_unregister(priv->mii_bus); -@@ -1885,6 +1878,9 @@ out_free_mdio: +@@ -1886,6 +1879,9 @@ out_free_mdio: if (priv->mii_bus) mdiobus_free(priv->mii_bus); @@ -237,7 +237,7 @@ Signed-off-by: Jonas Gorski out_uninit_hw: /* turn off mdc clock */ enet_writel(priv, 0, ENET_MIISC_REG); -@@ -1915,6 +1911,7 @@ static int bcm_enet_remove(struct platfo +@@ -1916,6 +1912,7 @@ static int bcm_enet_remove(struct platfo enet_writel(priv, 0, ENET_MIISC_REG); if (priv->has_phy) { diff --git a/target/linux/bcm63xx/patches-5.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch b/target/linux/bcm63xx/patches-5.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch index 772e40b2b5..86940ae14d 100644 --- a/target/linux/bcm63xx/patches-5.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch +++ b/target/linux/bcm63xx/patches-5.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch @@ -32,7 +32,7 @@ Subject: [PATCH 54/81] bcm63xx_enet: enable rgmii clock on external ports #define ENETSW_MDIOC_EXT_MASK (1 << 16) --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2184,6 +2184,18 @@ static int bcm_enetsw_open(struct net_de +@@ -2185,6 +2185,18 @@ static int bcm_enetsw_open(struct net_de priv->sw_port_link[i] = 0; } diff --git a/target/linux/bcm63xx/patches-5.4/423-bcm63xx_enet_add_b53_support.patch b/target/linux/bcm63xx/patches-5.4/423-bcm63xx_enet_add_b53_support.patch index 961f34ce78..36b8579ca6 100644 --- a/target/linux/bcm63xx/patches-5.4/423-bcm63xx_enet_add_b53_support.patch +++ b/target/linux/bcm63xx/patches-5.4/423-bcm63xx_enet_add_b53_support.patch @@ -20,7 +20,7 @@ #include #include "bcm63xx_enet.h" -@@ -1931,7 +1932,8 @@ static int bcm_enet_remove(struct platfo +@@ -1932,7 +1933,8 @@ static int bcm_enet_remove(struct platfo return 0; } @@ -30,7 +30,7 @@ .probe = bcm_enet_probe, .remove = bcm_enet_remove, .driver = { -@@ -1940,6 +1942,42 @@ struct platform_driver bcm63xx_enet_driv +@@ -1941,6 +1943,42 @@ struct platform_driver bcm63xx_enet_driv }, }; @@ -73,7 +73,7 @@ /* * switch mii access callbacks */ -@@ -2196,29 +2234,6 @@ static int bcm_enetsw_open(struct net_de +@@ -2197,29 +2235,6 @@ static int bcm_enetsw_open(struct net_de enetsw_writeb(priv, rgmii_ctrl, ENETSW_RGMII_CTRL_REG(i)); } @@ -103,7 +103,7 @@ /* initialize flow control buffer allocation */ enet_dma_writel(priv, ENETDMA_BUFALLOC_FORCE_MASK | 0, ENETDMA_BUFALLOC_REG(priv->rx_chan)); -@@ -2652,6 +2667,9 @@ static int bcm_enetsw_probe(struct platf +@@ -2655,6 +2670,9 @@ static int bcm_enetsw_probe(struct platf struct bcm63xx_enetsw_platform_data *pd; struct resource *res_mem; int ret, irq_rx, irq_tx; @@ -113,7 +113,7 @@ if (!bcm_enet_shared_base[0]) return -EPROBE_DEFER; -@@ -2732,6 +2750,43 @@ static int bcm_enetsw_probe(struct platf +@@ -2735,6 +2753,43 @@ static int bcm_enetsw_probe(struct platf priv->pdev = pdev; priv->net_dev = dev; @@ -157,7 +157,7 @@ return 0; out_disable_clk: -@@ -2753,6 +2808,9 @@ static int bcm_enetsw_remove(struct plat +@@ -2756,6 +2811,9 @@ static int bcm_enetsw_remove(struct plat priv = netdev_priv(dev); unregister_netdev(dev); diff --git a/target/linux/bcm63xx/patches-5.4/424-bcm63xx_enet_no_request_mem_region.patch b/target/linux/bcm63xx/patches-5.4/424-bcm63xx_enet_no_request_mem_region.patch index 6c002a7b5f..e87731a1c5 100644 --- a/target/linux/bcm63xx/patches-5.4/424-bcm63xx_enet_no_request_mem_region.patch +++ b/target/linux/bcm63xx/patches-5.4/424-bcm63xx_enet_no_request_mem_region.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2711,9 +2711,9 @@ static int bcm_enetsw_probe(struct platf +@@ -2714,9 +2714,9 @@ static int bcm_enetsw_probe(struct platf if (ret) goto out; diff --git a/target/linux/bcm63xx/patches-5.4/428-bcm63xx_enet-rgmii-ctrl-fix.patch b/target/linux/bcm63xx/patches-5.4/428-bcm63xx_enet-rgmii-ctrl-fix.patch index 52740b9a5b..4c5e43cb0e 100644 --- a/target/linux/bcm63xx/patches-5.4/428-bcm63xx_enet-rgmii-ctrl-fix.patch +++ b/target/linux/bcm63xx/patches-5.4/428-bcm63xx_enet-rgmii-ctrl-fix.patch @@ -12,7 +12,7 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2231,6 +2231,10 @@ static int bcm_enetsw_open(struct net_de +@@ -2232,6 +2232,10 @@ static int bcm_enetsw_open(struct net_de rgmii_ctrl = enetsw_readb(priv, ENETSW_RGMII_CTRL_REG(i)); rgmii_ctrl |= ENETSW_RGMII_CTRL_GMII_CLK_EN; From 425c4c89b0ba724738e8c57c2d3e8dfb770f5746 Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Fri, 19 Feb 2021 00:53:26 +0100 Subject: [PATCH 03/16] ramips: remove factory image for TP-Link Archer C20 v1 Similarly to the Archer C2 v1, the Archer C20 v1 will brick when one tries to flash an OpenWrt factory image through the TP-Link web UI. The wiki page contains an explicit warning about this [1]. Disable the factory image altogether since it serves no purpose. [1] https://openwrt.org/toh/tp-link/tp-link_archer_c20_v1#installation Signed-off-by: Stijn Segers (cherry picked from commit 0265cba40ad4f2b8ff4473ada123c35b53ffd97a) --- target/linux/ramips/image/mt7620.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 7f649aff88..f8905ad2b7 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -981,6 +981,7 @@ define Device/tplink_archer-c20-v1 TPLINK_HWID := 0xc2000001 TPLINK_HWREV := 0x44 TPLINK_HWREVADD := 0x1 + IMAGES := sysupgrade.bin DEVICE_MODEL := Archer C20 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci \ From a7c0c9bb7ec3de79a11e7bf7facf8369235e74a5 Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Thu, 18 Feb 2021 20:52:53 +0100 Subject: [PATCH 04/16] ramips: mt7621: add TP-Link EAP235-Wall support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The TP-Link EAP235-Wall is a wall-mounted, PoE-powered AC1200 access point with four gigabit ethernet ports. When connecting to the device's serial port, it is strongly advised to use an isolated UART adapter. This prevents linking different power domains created by the PoE power supply, which may damage your devices. The device's U-Boot supports saving modified environments with `saveenv`. However, there is no u-boot-env partition, and saving modifications will cause the partition table to be overwritten. This is not an issue for running OpenWrt, but will prevent the vendor FW from functioning properly. Device specifications: * SoC: MT7621DAT * RAM: 128MiB * Flash: 16MiB SPI-NOR * Wireless 2.4GHz (MT7603EN): b/g/n, 2x2 * Wireless 5GHz (MT7613BEN): a/n/ac, 2x2 * Ethernet: 4× GbE * Back side: ETH0, PoE PD port * Bottom side: ETH1, ETH2, ETH3 * Single white device LED * LED button, reset button (available for failsafe) * PoE pass-through on port ETH3 (enabled with GPIO) Datasheet of the flash chip specifies a maximum frequency of 33MHz, but that didn't work. 20MHz gives no errors with reading (flash dump) or writing (sysupgrade). Device mac addresses: Stock firmware uses the same MAC address for ethernet (on device label) and 2.4GHz wireless. The 5GHz wireless address is incremented by one. This address is stored in the 'info' ('default-mac') partition at an offset of 8 bytes. From OEM ifconfig: eth a4:2b:b0:...:88 ra0 a4:2b:b0:...:88 rai0 a4:2b:b0:...:89 Flashing instructions: * Enable SSH in the web interface, and SSH into the target device * run `cliclientd stopcs`, this should return "success" * upload the factory image via the web interface Debricking: U-boot can be interrupted during boot, serial console is 57600 baud, 8n1 This allows installing a sysupgrade image, or fixing the device in another way. * Access serial header from the side of the board, close to ETH3, pin-out is (1:TX, 2:RX, 3:GND, 4:3.3V), with pin 1 closest to ETH3. * Interrupt bootloader by holding '4' during boot, which drops the bootloader into its shell * Change default 'serverip' and 'ipaddr' variables (optional) * Download initramfs with `tftpboot`, and boot image with `bootm` # tftpboot 84000000 openwrt-initramfs.bin # bootm Revert to stock: Using the tplink-safeloader utility from the firmware-utils package, TP-Link's firmware image can be converted to an OpenWrt-compatible sysupgrade image: $ ./staging_dir/host/bin/tplink-safeloader -B EAP235-WALL-V1 \ -z EAP235-WALLv1_XXX_up_signed.bin -o eap235-sysupgrade.bin This can then be flashed using the OpenWrt sysupgrade interface. The image will appear to be incompatible and must be force flashed, without keeping the current configuration. Known issues: - DFS support is incomplete (known issue with MT7613) - MT7613 radio may stop responding when idling, reboot required. This was an issue with the ddc75ff704 version of mt76, but appears to have improved/disappeared with bc3963764d. Error notice example: [ 7099.554067] mt7615e 0000:02:00.0: Message 73 (seq 1) timeout Hardware was kindly provided for porting by Stijn Segers. Tested-by: Stijn Segers Signed-off-by: Sander Vanheule (cherry picked from commit 1e75909a35a2b361cdfdfcf18a26ad61271b174e) --- .../dts/mt7621_tplink_eap235-wall-v1.dts | 180 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 13 ++ .../mt7621/base-files/etc/board.d/02_network | 3 + tools/firmware-utils/src/tplink-safeloader.c | 29 +++ 4 files changed, 225 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts diff --git a/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts new file mode 100644 index 0000000000..17308eb605 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts @@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "tplink,eap235-wall-v1", "mediatek,mt7621-soc"; + model = "TP-Link EAP235-Wall v1"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + leds { + compatible = "gpio-leds"; + + led_status: status { + label = "white:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + led { + label = "led"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + poe_passthrough { + gpio-export,name = "poe-passthrough"; + gpio-export,output = <0>; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x00000 0x80000>; + read-only; + }; + + partition@80000 { + label = "partition-table"; + reg = <0x80000 0x10000>; + read-only; + }; + + info: partition@90000 { + label = "product-info"; + reg = <0x90000 0x10000>; + read-only; + }; + + partition@a0000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x0a0000 0xd20000>; + }; + + partition@dc0000 { + label = "user-config"; + reg = <0xdc0000 0x030000>; + read-only; + }; + + /* 0xdf0000 - 0xf30000 unused */ + + partition@f30000 { + label = "mutil-log"; + reg = <0xf30000 0x080000>; + read-only; + }; + + partition@fb0000 { + label = "oops"; + reg = <0xfb0000 0x040000>; + read-only; + }; + + radio: partition@ff0000 { + label = "radio"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "uart2", "uart3"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x0>; + mtd-mac-address = <&info 0x8>; + }; +}; + +&pcie1 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + mtd-mac-address = <&info 0x8>; + mtd-mac-address-increment = <1>; + }; +}; + +&gmac0 { + mtd-mac-address = <&info 0x8>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan0"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 203ca1b908..a4edf0a6df 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1114,6 +1114,19 @@ define Device/totolink_x5000r endef TARGET_DEVICES += totolink_x5000r +define Device/tplink_eap235-wall-v1 + $(Device/dsa-migration) + $(Device/tplink-safeloader) + DEVICE_MODEL := EAP235-Wall + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap + TPLINK_BOARD_ID := EAP235-WALL-V1 + IMAGE_SIZE := 13440k + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory | \ + pad-extra 128 +endef +TARGET_DEVICES += tplink_eap235-wall-v1 + define Device/tplink_re350-v1 $(Device/dsa-migration) $(Device/tplink-safeloader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 46cb65ffbe..89e679be7c 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -55,6 +55,9 @@ ramips_setup_interfaces() mikrotik,routerboard-760igs) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan sfp" ;; + tplink,eap235-wall-v1) + ucidef_set_interface_lan "lan0 lan1 lan2 lan3" + ;; ubnt,edgerouter-x) ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4" "eth0" ;; diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index b9dfad51a6..da73e1bf30 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -1447,6 +1447,35 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system" }, + /** Firmware layout for the EAP235-Wall v1 */ + { + .id = "EAP235-WALL-V1", + .support_list = + "SupportList:\r\n" + "EAP235-Wall(TP-Link|UN|AC1200-D):1.0\r\n", + .part_trail = PART_TRAIL_NONE, + .soft_ver = NULL, + .soft_ver_compat_level = 1, + + .partitions = { + {"fs-uboot", 0x00000, 0x80000}, + {"partition-table", 0x80000, 0x02000}, + {"default-mac", 0x90000, 0x01000}, + {"support-list", 0x91000, 0x00100}, + {"product-info", 0x91100, 0x00400}, + {"soft-version", 0x92000, 0x00100}, + {"firmware", 0xa0000, 0xd20000}, + {"user-config", 0xdc0000, 0x30000}, + {"mutil-log", 0xf30000, 0x80000}, + {"oops", 0xfb0000, 0x40000}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system" + }, + /** Firmware layout for the EAP245 v1 */ { .id = "EAP245-V1", From 800a568df51c64fab42ed0622b5b7f3d5e46844a Mon Sep 17 00:00:00 2001 From: Seo Suchan Date: Thu, 18 Feb 2021 00:06:55 +0900 Subject: [PATCH 05/16] ramips: use lzma-loader for Wevo devices As kernel size increased it start to fail to load squishfs image, using lzma-loader fixed it. wevo_11acnas is almost same device as w2914ns-v2 except ram size, so I expect same thing would've happen in that device too. Signed-off-by: Seo Suchan Reviewed-by: Sungbo Eo (cherry picked from commit ca6954e2dc3faa32eec54b93bda996c874409675) --- target/linux/ramips/image/mt7621.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index a4edf0a6df..396b112b76 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1254,6 +1254,7 @@ TARGET_DEVICES += wavlink_wl-wn531a6 define Device/wevo_11acnas $(Device/dsa-migration) + $(Device/uimage-lzma-loader) IMAGE_SIZE := 16064k UIMAGE_NAME := 11AC-NAS-Router(0.0.0) DEVICE_VENDOR := WeVO @@ -1266,6 +1267,7 @@ TARGET_DEVICES += wevo_11acnas define Device/wevo_w2914ns-v2 $(Device/dsa-migration) + $(Device/uimage-lzma-loader) IMAGE_SIZE := 16064k UIMAGE_NAME := W2914NS-V2(0.0.0) DEVICE_VENDOR := WeVO From 9f8bf18c7ff798db28fa0ca2e7607bf2589f10c7 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 12 Feb 2021 16:37:29 +0100 Subject: [PATCH 06/16] layerscape: move rework-sdcard-images out of fsl-sdboot Upcoming devices will not need the migration setup, so let's move it out of the common definition. Signed-off-by: Adrian Schmutzler (cherry picked from commit a9075d42d7990af230a08bdbb03c14ae2bf27318) --- target/linux/layerscape/image/armv7.mk | 3 ++- target/linux/layerscape/image/armv8_64b.mk | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk index 4ab2cec224..da9484764c 100644 --- a/target/linux/layerscape/image/armv7.mk +++ b/target/linux/layerscape/image/armv7.mk @@ -21,7 +21,6 @@ define Device/Default endef define Device/fsl-sdboot - $(Device/rework-sdcard-images) KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb IMAGES := sdcard.img.gz sysupgrade.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata @@ -45,6 +44,7 @@ endef TARGET_DEVICES += fsl_ls1021a-twr define Device/fsl_ls1021a-twr-sdboot + $(Device/rework-sdcard-images) $(Device/fsl-sdboot) DEVICE_VENDOR := NXP DEVICE_MODEL := TWR-LS1021A @@ -61,6 +61,7 @@ endef TARGET_DEVICES += fsl_ls1021a-twr-sdboot define Device/fsl_ls1021a-iot-sdboot + $(Device/rework-sdcard-images) $(Device/fsl-sdboot) DEVICE_VENDOR := NXP DEVICE_MODEL := LS1021A-IoT diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index 75d6885c6d..958faa270e 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -20,7 +20,6 @@ define Device/Default endef define Device/fsl-sdboot - $(Device/rework-sdcard-images) KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb IMAGES := sdcard.img.gz sysupgrade.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata @@ -76,6 +75,7 @@ endef TARGET_DEVICES += fsl_ls1012a-rdb define Device/fsl_ls1012a-frwy-sdboot + $(Device/rework-sdcard-images) $(Device/fsl-sdboot) DEVICE_VENDOR := NXP DEVICE_MODEL := FRWY-LS1012A @@ -126,6 +126,7 @@ endef TARGET_DEVICES += fsl_ls1043a-rdb define Device/fsl_ls1043a-rdb-sdboot + $(Device/rework-sdcard-images) $(Device/fsl-sdboot) DEVICE_VENDOR := NXP DEVICE_MODEL := LS1043A-RDB @@ -176,6 +177,7 @@ endef TARGET_DEVICES += fsl_ls1046a-rdb define Device/fsl_ls1046a-rdb-sdboot + $(Device/rework-sdcard-images) $(Device/fsl-sdboot) DEVICE_VENDOR := NXP DEVICE_MODEL := LS1046A-RDB @@ -228,6 +230,7 @@ endef TARGET_DEVICES += fsl_ls1088a-rdb define Device/fsl_ls1088a-rdb-sdboot + $(Device/rework-sdcard-images) $(Device/fsl-sdboot) DEVICE_VENDOR := NXP DEVICE_MODEL := LS1088A-RDB From 7f933db1086fb0470ba8db7916202ec711102b82 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 3 Aug 2020 12:52:22 +0800 Subject: [PATCH 07/16] layerscape: add FRWY-LS1046A board support The LS1046A Freeway board (FRWY) is a high-performance computing, evaluation, and development platform that supports the QorIQ LS1046A architecture processor capable of support more than 32,000 CoreMark performance. The FRWY-LS1046A board supports the QorIQ LS1046A processor, onboard DDR4 memory, multiple Gigabit Ethernet, USB3.0 and M2_Type_E interfaces for Wi-Fi. The FRWY-LS1046A-TP includes the Coral Tensor Flow Processing Unit that offloads AI/ML inferencing from the CPU to provide significant boost for AI/ML applications. The FRWY-LS1046A-TP includes one M.2 TPU module and more modules can easily be added including USB versions of the module to scale the AI/ML performance. Signed-off-by: Yangbo Lu [rebase, use AUTORELEASE, fix sorting, add dtb to firmware part] Signed-off-by: Adrian Schmutzler (cherry picked from commit 2c2d77bd3bd4691c5f8f1760b9ef16f96f345255) --- package/boot/tfa-layerscape/Makefile | 18 +++++++- package/boot/uboot-layerscape/Makefile | 14 ++++++- .../files/fsl_ls1046a-frwy-sdboot-uEnv.txt | 8 ++++ .../files/fsl_ls1046a-frwy-uEnv.txt | 8 ++++ package/firmware/layerscape/ls-rcw/Makefile | 6 ++- .../base-files/lib/upgrade/platform.sh | 5 +++ target/linux/layerscape/image/armv8_64b.mk | 41 +++++++++++++++++++ 7 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-sdboot-uEnv.txt create mode 100644 package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-uEnv.txt diff --git a/package/boot/tfa-layerscape/Makefile b/package/boot/tfa-layerscape/Makefile index bf3f132c08..c0efd3ad9e 100644 --- a/package/boot/tfa-layerscape/Makefile +++ b/package/boot/tfa-layerscape/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tfa-layerscape PKG_VERSION:=LSDK-20.04-update-290520 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/atf @@ -74,6 +74,20 @@ define Package/tfa-ls1043a-rdb-sdboot BOOT_MODE:=sd endef +define Package/tfa-ls1046a-frwy + $(Package/tfa-generic) + TITLE:=NXP LS1046AFRWY Trusted Firmware + PLAT:=ls1046afrwy + BOOT_MODE:=qspi +endef + +define Package/tfa-ls1046a-frwy-sdboot + $(Package/tfa-generic) + TITLE:=NXP LS1046AFRWY SD Boot Trusted Firmware + PLAT:=ls1046afrwy + BOOT_MODE:=sd +endef + define Package/tfa-ls1046a-rdb $(Package/tfa-generic) TITLE:=NXP LS1046ARDB Trusted Firmware @@ -134,6 +148,8 @@ TFAS := \ ls1012a-frwy-sdboot \ ls1043a-rdb \ ls1043a-rdb-sdboot \ + ls1046a-frwy \ + ls1046a-frwy-sdboot \ ls1046a-rdb \ ls1046a-rdb-sdboot \ ls1088a-rdb \ diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile index ec1b45d70f..98b129f0ff 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-layerscape PKG_VERSION:=LSDK-20.04-update-290520 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot @@ -55,6 +55,16 @@ define U-Boot/fsl_ls1043a-rdb-sdboot UBOOT_CONFIG:=ls1043ardb_tfa endef +define U-Boot/fsl_ls1046a-frwy + NAME:=NXP LS1046AFRWY + UBOOT_CONFIG:=ls1046afrwy_tfa +endef + +define U-Boot/fsl_ls1046a-frwy-sdboot + NAME:=NXP LS1046AFRWY SD Card Boot + UBOOT_CONFIG:=ls1046afrwy_tfa +endef + define U-Boot/fsl_ls1046a-rdb NAME:=NXP LS1046ARDB UBOOT_CONFIG:=ls1046ardb_tfa @@ -109,6 +119,8 @@ UBOOT_TARGETS := \ fsl_ls1012a-frwy-sdboot \ fsl_ls1043a-rdb \ fsl_ls1043a-rdb-sdboot \ + fsl_ls1046a-frwy \ + fsl_ls1046a-frwy-sdboot \ fsl_ls1046a-rdb \ fsl_ls1046a-rdb-sdboot \ fsl_ls1088a-rdb \ diff --git a/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-sdboot-uEnv.txt new file mode 100644 index 0000000000..ed16dde984 --- /dev/null +++ b/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-sdboot-uEnv.txt @@ -0,0 +1,8 @@ +fdtaddr=0x8f000000 +loadaddr=0x81000000 +bootm_size=0x10000000 +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 diff --git a/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-uEnv.txt new file mode 100644 index 0000000000..9daba4aedb --- /dev/null +++ b/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-uEnv.txt @@ -0,0 +1,8 @@ +fdtaddr=0x8f000000 +loadaddr=0x81000000 +bootm_size=0x10000000 +hwconfig=fsl_ddr:bank_intlv=auto +qspi_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=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),49m@0xf00000(firmware) +bootcmd=echo starting openwrt ...;run qspi_boot +bootdelay=3 diff --git a/package/firmware/layerscape/ls-rcw/Makefile b/package/firmware/layerscape/ls-rcw/Makefile index 6245e89633..421ef19e7b 100644 --- a/package/firmware/layerscape/ls-rcw/Makefile +++ b/package/firmware/layerscape/ls-rcw/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-rcw PKG_VERSION:=LSDK-20.04-update-290520 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/rcw @@ -31,6 +31,8 @@ BOARDS := \ ls1012a-frwy-sdboot \ ls1043a-rdb \ ls1043a-rdb-sdboot \ + ls1046a-frwy \ + ls1046a-frwy-sdboot \ ls1046a-rdb \ ls1046a-rdb-sdboot \ ls1088a-rdb \ @@ -43,6 +45,8 @@ RCW_ls1012a-frdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin RCW_ls1012a-frwy-sdboot :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.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 +RCW_ls1046a-frwy-sdboot :=ls1046afrwy/NN_NNQNNPNP_3040_0506/rcw_1600_sdboot.bin RCW_ls1046a-rdb :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin 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 diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh index a8d83de7ea..f9b1e57a43 100644 --- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh +++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh @@ -72,6 +72,7 @@ platform_copy_config() { fsl,ls1021a-iot-sdboot | \ fsl,ls1021a-twr-sdboot | \ fsl,ls1043a-rdb-sdboot | \ + fsl,ls1046a-frwy-sdboot | \ fsl,ls1046a-rdb-sdboot | \ fsl,ls1088a-rdb-sdboot) platform_copy_config_sdboot @@ -95,6 +96,8 @@ platform_check_image() { fsl,ls1021a-twr-sdboot | \ fsl,ls1043a-rdb | \ fsl,ls1043a-rdb-sdboot | \ + fsl,ls1046a-frwy | \ + fsl,ls1046a-frwy-sdboot | \ fsl,ls1046a-rdb | \ fsl,ls1046a-rdb-sdboot | \ fsl,ls1088a-rdb | \ @@ -125,6 +128,7 @@ platform_do_upgrade() { fsl,ls1012a-rdb | \ fsl,ls1021a-twr | \ fsl,ls1043a-rdb | \ + fsl,ls1046a-frwy | \ fsl,ls1046a-rdb | \ fsl,ls1088a-rdb | \ fsl,ls2088a-rdb) @@ -135,6 +139,7 @@ platform_do_upgrade() { fsl,ls1021a-iot-sdboot | \ fsl,ls1021a-twr-sdboot | \ fsl,ls1043a-rdb-sdboot | \ + fsl,ls1046a-frwy-sdboot | \ fsl,ls1046a-rdb-sdboot | \ fsl,ls1088a-rdb-sdboot) platform_do_upgrade_sdboot "$1" diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index 958faa270e..c037061aa2 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -151,6 +151,47 @@ define Device/fsl_ls1043a-rdb-sdboot endef TARGET_DEVICES += fsl_ls1043a-rdb-sdboot +define Device/fsl_ls1046a-frwy + DEVICE_VENDOR := NXP + DEVICE_MODEL := FRWY-LS1046A + DEVICE_VARIANT := Default + DEVICE_PACKAGES += \ + layerscape-fman \ + tfa-ls1046a-frwy + DEVICE_DTS := freescale/fsl-ls1046a-frwy-sdk + 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 9M | \ + ls-append fsl_ls1046a-rdb-fman.bin | 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_ls1046a-frwy + +define Device/fsl_ls1046a-frwy-sdboot + $(Device/fsl-sdboot) + DEVICE_VENDOR := NXP + DEVICE_MODEL := FRWY-LS1046A + DEVICE_VARIANT := SD Card Boot + DEVICE_PACKAGES += \ + layerscape-fman \ + tfa-ls1046a-frwy-sdboot + DEVICE_DTS := freescale/fsl-ls1046a-frwy-sdk + 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 9M | \ + ls-append fsl_ls1046a-rdb-fman.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_ls1046a-frwy-sdboot + define Device/fsl_ls1046a-rdb $(Device/fix-sysupgrade) DEVICE_VENDOR := NXP From 727279333022ad2154e92f38c0b07547587e8239 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 3 Aug 2020 11:59:55 +0800 Subject: [PATCH 08/16] layerscape: add ddr-phy package Add ddr-phy package for layerscape. Currently only LX2160ARDB requires the package. Signed-off-by: Yangbo Lu [use AUTORELEASE] Signed-off-by: Adrian Schmutzler (cherry picked from commit f59d7aab2a374d27abfdc50348d855db5560db8f) --- .../firmware/layerscape/ls-ddr-phy/Makefile | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 package/firmware/layerscape/ls-ddr-phy/Makefile diff --git a/package/firmware/layerscape/ls-ddr-phy/Makefile b/package/firmware/layerscape/ls-ddr-phy/Makefile new file mode 100644 index 0000000000..ea2ec311b8 --- /dev/null +++ b/package/firmware/layerscape/ls-ddr-phy/Makefile @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright 2020 NXP +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ls-ddr-phy +PKG_VERSION:=LSDK-20.04-update-290520 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/NXP/ddr-phy-binary.git +PKG_SOURCE_VERSION:=fbc036b88acb6c06ffed02c898cbae9856ec75ba +PKG_MIRROR_HASH:=84e2bdea99384211971bb23ba9ed18b5839628ff2aa0738d2978bbdf841638cb +PKG_BUILD_DEPENDS:=tfa-layerscape/host + +PKG_LICENSE:=EULA +PKG_LICENSE_FILES:=NXP-Binary-EULA.txt + +include $(INCLUDE_DIR)/package.mk + +define Package/layerscape-ddr-phy + SECTION:=firmware + CATEGORY:=Firmware + TITLE:=NXP Layerscape DDR PHY firmware + DEPENDS:=@TARGET_layerscape +endef + +define Build/Compile + cd $(PKG_BUILD_DIR)/lx2160a/ && \ + tfa-fiptool create \ + --ddr-immem-udimm-1d ddr4_pmu_train_imem.bin \ + --ddr-immem-udimm-2d ddr4_2d_pmu_train_imem.bin \ + --ddr-dmmem-udimm-1d ddr4_pmu_train_dmem.bin \ + --ddr-dmmem-udimm-2d ddr4_2d_pmu_train_dmem.bin \ + --ddr-immem-rdimm-1d ddr4_rdimm_pmu_train_imem.bin \ + --ddr-immem-rdimm-2d ddr4_rdimm2d_pmu_train_imem.bin \ + --ddr-dmmem-rdimm-1d ddr4_rdimm_pmu_train_dmem.bin \ + --ddr-dmmem-rdimm-2d ddr4_rdimm2d_pmu_train_dmem.bin \ + fip_ddr_all.bin +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/lx2160a/fip_ddr_all.bin \ + $(STAGING_DIR_IMAGE)/fsl_lx2160a-rdb-fip_ddr_all.bin +endef + +$(eval $(call BuildPackage,layerscape-ddr-phy)) From 2e1ad2473eb02e8e86efa9aa91e138fa759b074e Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Thu, 30 Jul 2020 13:12:43 +0800 Subject: [PATCH 09/16] 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 [use AUTORELEASE, add dtb to firmware part] Signed-off-by: Adrian Schmutzler (cherry picked from commit 80dcd14abeed8cd808b92bb307964dbaeb252144) --- 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 ++ .../base-files/lib/upgrade/platform.sh | 13 +++-- target/linux/layerscape/image/armv8_64b.mk | 52 +++++++++++++++++++ 9 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-sdboot-uEnv.txt create mode 100644 package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-uEnv.txt 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@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 From ef47bc424c421652c6a3948ac9c652cef60195f0 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Tue, 27 Oct 2020 16:26:11 +0800 Subject: [PATCH 10/16] layerscape: add new devices in README and clean up Support new devices LS1046AFRWY and LX2160ARDB in README. Clean up README, and add missing LS1021ATWR deploy guide. Signed-off-by: Yangbo Lu [adjust set of devices added, update commit message/title] Signed-off-by: Adrian Schmutzler (cherry picked from commit a31842e7fd15c14796a9f764defda395b3c854df) --- target/linux/layerscape/README | 103 ++++++++++++++++++++++----------- 1 file changed, 70 insertions(+), 33 deletions(-) diff --git a/target/linux/layerscape/README b/target/linux/layerscape/README index 4bade4a9c0..a8d1846468 100644 --- a/target/linux/layerscape/README +++ b/target/linux/layerscape/README @@ -1,15 +1,27 @@ Layerscape Quick Start -1. Layerscape target support +This is a quick start guide for Layerscape specific usage, like introducing +how to configure, build, and deploy OpenWrt to Layerscape boards, so that +users can bring up the board without difficulty. + + +1. Target support ---------------------------- * ARMv8 64-bit - LS1012ARDB LS1012AFRWY LS1043ARDB LS1046ARDB LS1088ARDB LS2088ARDB - (SD card boot support on LS1043ARDB/LS1046ARDB/LS1088ARDB) + LS1012ARDB (QSPI NOR boot) + LS1012AFRDM (QSPI NOR boot) + LS1012AFRWY (QSPI NOR boot) + LS1043ARDB (NOR boot | SD card boot) + LS1046ARDB (QSPI NOR boot | SD card boot) + LS1046AFRWY (QSPI NOR boot | SD card boot) + LS1088ARDB (QSPI NOR boot | SD card boot) + LS2088ARDB (NOR boot) + LX2160ARDB Rev2.0 (FlexSPI NOR boot | SD card boot) * ARMv7 - LS1021ATWR LS1021AIOT - (SD card boot support on LS1021ATWR/LS1021AIOT) + LS1021ATWR (NOR boot | SD card boot) + LS1021AIOT (SD card boot) 2. Build @@ -24,7 +36,7 @@ $ ./scripts/feeds install -a Subtarget: (Select subtarget) Target Profile: (Select device, or "Multiple devices") Target Devices: (Select devices. Available when Target Profile is "Multiple devices") - Target Images: (Disable "GZip images" if don't want to unzip manually to use the images.) + Target Images: (Disable "GZip images" if you don't want to unzip manually to use the images.) Note: The first time make menuconfig would create a .config file which would include all dependencies for selected target. After that, make @@ -37,16 +49,16 @@ $ ./scripts/feeds install -a * make (or make -j) * Final firmware/image - Path: bin/targets/layerscape// + Path: bin/targets/layerscape// Firmware for flash: openwrt-layerscape----firmware.bin - Image for SD card: openwrt-layerscape----sdcard.img.gz - Sysupgrade images: openwrt-layerscape----sysupgrade.bin + Image for SD card: openwrt-layerscape----sdcard.img.gz + Sysupgrade images: openwrt-layerscape----sysupgrade.bin -3. Program NOR/QSPI flash or SD card ------------------------------------- -The firmware.bin or sdcard.img (after extract from gz) is an all-in-one image including all -things for OpenWrt staring up. (except LS1012AFRWY. Refer to 3.3.) +3. Deploy +--------- +The firmware.bin or sdcard.img is an all-in-one image including all things +for OpenWrt staring up except LS1012AFRWY (Refer to 3.3). If you want to install all things into flash, please use firmware.bin. If you want to install all things into SD card, please use sdcard.img. @@ -72,17 +84,7 @@ from SD card. (sdcard.img images are gz-iped to save space. Please extract them 3.2 Program firmware.bin to flash --------------------------------- -* LS1012FRDM (QSPI flash) - Board have only one nor flash bank. Those commands will replace stock - bootloader and firmware. Please refer point 4 for MAC recovery. - - => tftp a0000000 -firmware.bin - => sf probe 0:0 - => sf erase 0 +$filesize - => sf write a0000000 0 $filesize - => reset - -* LS1012ARDB (QSPI flash) +* LS1012ARDB Start up from bank1, and program firmware to bank2 with below commands. Switch to bank2 to start up OpenWrt. @@ -93,7 +95,7 @@ from SD card. (sdcard.img images are gz-iped to save space. Please extract them => sf write a0000000 0 $filesize => reset -* LS1043ARDB (NOR flash) +* LS1043ARDB Start up from bank0, and program firmware to bank4 with below commands. Switch to bank4 to start up OpenWrt. @@ -103,7 +105,7 @@ from SD card. (sdcard.img images are gz-iped to save space. Please extract them => cp.b a0000000 64000000 $filesize => cpld reset altbank -* LS1046ARDB (QSPI flash) +* LS1046ARDB Start up from bank1, and program firmware to bank2 with below commands. Switch to bank2 to start up OpenWrt. @@ -113,7 +115,27 @@ from SD card. (sdcard.img images are gz-iped to save space. Please extract them => sf write a0000000 0 $filesize => cpld reset altbank -* LS1088ARDB (QSPI flash) +* LS2088ARDB + Start up from bank0, and program firmware to bank4 with below commands. + Switch to bank4 to start up OpenWrt. + + => tftp a0000000 -firmware.bin + => protect off all + => erase 584000000 +$filesize + => cp.b a0000000 584000000 $filesize + => qix altbank + +* LS1012FRDM/LS1046AFRWY + 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 + +* LS1088ARDB/LX2160ARDB Rev2.0 Start up from bank0, and program firmware to bank1 with below commands. Switch to bank1 to start up OpenWrt. @@ -127,15 +149,15 @@ from SD card. (sdcard.img images are gz-iped to save space. Please extract them bank1 instead of 'qix altbank'. => i2c mw 66 50 20;i2c mw 66 10 20;i2c mw 66 10 21 -* LS2088ARDB (NOR flash) +* LS1021ATWR Start up from bank0, and program firmware to bank4 with below commands. Switch to bank4 to start up OpenWrt. => tftp a0000000 -firmware.bin => protect off all - => erase 584000000 +$filesize - => cp.b a0000000 584000000 $filesize - => qix altbank + => erase 64000000 +$filesize + => cp.b a0000000 64000000 $filesize + => boot_bank 1 3.3 Program LS1012AFRWY ----------------------- @@ -159,7 +181,7 @@ from SD card. (sdcard.img images are gz-iped to save space. Please extract them 4. Known issues and limitation ------------------------------ -* u-boot may fail to read MAC addresses from EEPROM on some boards and there +* U-boot may fail to read MAC addresses from EEPROM on some boards and there won't be MAC addresses set in environment. This may cause kernel fails to probe these network interfaces. The workaround is to set MAC addresses manually, for example, @@ -168,8 +190,23 @@ from SD card. (sdcard.img images are gz-iped to save space. Please extract them => setenv eth1addr 00:04:9F:04:65:4c => saveenv +* In case users want to refer Layerscape SDK doc for network configuration, + like TSN (Time-Sensitive Networking) on LS1028A, the OpenWrt LAN/WAN router + setting should be removed before that. + + # ubus call network.interface.lan remove + # ubus call network.interface.wan remove + # ubus call network.interface.wan6 remove + + And firewall may be needed to stop. + + # /etc/init.d/firewall stop + 5. Other references ------------------- -- NXP LSDK site: https://lsdk.github.io/ +- NXP LSDK source: https://lsdk.github.io/ + +- NXP LSDK site: https://www.nxp.com/design/software/embedded-software/linux-software-and-development-tools/layerscape-software-development-kit:LAYERSCAPE-SDK + - OpenWrt documentation: https://openwrt.org/docs/start From 7a0cd1ede436b351b76183c9c4f06714833fcc65 Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Fri, 19 Feb 2021 23:11:09 +0100 Subject: [PATCH 11/16] ramips: overwrite reset gpio properties in EX6150 DTS The Netgear EX6150 can, just like the D-Link DIR-860L rev B1, fail to initialise both radios in some cases. Add the reset GPIOs explicitly so the PCI-E devices get re-initialised properly. See also FS #3632. Error shows up in dmesg as follows: [ 1.560764] mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK) Tested-by: Kurt Roeckx Signed-off-by: Stijn Segers [removed period from commit title] Signed-off-by: David Bauer (cherry picked from commit af1b6799c6ec9af7a30d63a5ddfed20f443b991c) --- target/linux/ramips/dts/mt7621_netgear_ex6150.dts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts index 2bf858b226..0da8f6b30c 100644 --- a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts +++ b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts @@ -206,6 +206,9 @@ &pcie { status = "okay"; + + reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>, + <&gpio 8 GPIO_ACTIVE_LOW>; }; &pcie0 { From 60823c67cb301b81b827ed91614ac5a66e8f3118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= Date: Wed, 17 Feb 2021 15:58:16 +0100 Subject: [PATCH 12/16] hostapd: backport ignoring 4addr mode enabling error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a backport of the upstream commit 58bbbb598144 ("nl80211: Ignore 4addr mode enabling error if it was already enabled") which fixes same issue as in the current fix contained in '130-wpa_supplicant-multi_ap_roam.patch', but in a different way: nl80211_set_4addr_mode() could fail when trying to enable 4addr mode on an interface that is in a bridge and has 4addr mode already enabled. This operation would not have been necessary in the first place and this failure results in disconnecting, e.g., when roaming from one backhaul BSS to another BSS with Multi AP. Avoid this issue by ignoring the nl80211 command failure in the case where 4addr mode is being enabled while it has already been enabled. Signed-off-by: Raphaël Mélotte [bump PKG_RELEASE, more verbose commit description] Signed-off-by: Petr Štetiar (cherry picked from commit fb860b4e418c28a0f388f215e5acce103dcee1bf) --- package/network/services/hostapd/Makefile | 2 +- ...020-ignore-4addr-mode-enabling-error.patch | 78 +++++++++++++++++++ .../130-wpa_supplicant-multi_ap_roam.patch | 37 --------- 3 files changed, 79 insertions(+), 38 deletions(-) create mode 100644 package/network/services/hostapd/patches/020-ignore-4addr-mode-enabling-error.patch delete mode 100644 package/network/services/hostapd/patches/130-wpa_supplicant-multi_ap_roam.patch diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 62f74923f0..bd2a7c96ad 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=31 +PKG_RELEASE:=32 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/patches/020-ignore-4addr-mode-enabling-error.patch b/package/network/services/hostapd/patches/020-ignore-4addr-mode-enabling-error.patch new file mode 100644 index 0000000000..3431ac0949 --- /dev/null +++ b/package/network/services/hostapd/patches/020-ignore-4addr-mode-enabling-error.patch @@ -0,0 +1,78 @@ +From c7cca9b08f3e1e49c4a4a59ec66c47d91448e6ae Mon Sep 17 00:00:00 2001 +From: Jouni Malinen +Date: Sat, 13 Feb 2021 23:59:28 +0200 +Subject: [PATCH] nl80211: Ignore 4addr mode enabling error if it was already + enabled + +nl80211_set_4addr_mode() could fail when trying to enable 4addr mode on +an interface that is in a bridge and has 4addr mode already enabled. +This operation would not have been necessary in the first place and this +failure results in disconnecting, e.g., when roaming from one backhaul +BSS to another BSS with Multi AP. + +Avoid this issue by ignoring the nl80211 command failure in the case +where 4addr mode is being enabled while it has already been enabled. + +Signed-off-by: Jouni Malinen +--- + src/drivers/driver_nl80211.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c +index 72189da24..011a15e68 100644 +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -617,6 +617,7 @@ struct wiphy_idx_data { + int wiphy_idx; + enum nl80211_iftype nlmode; + u8 *macaddr; ++ u8 use_4addr; + }; + + +@@ -639,6 +640,9 @@ static int netdev_info_handler(struct nl_msg *msg, void *arg) + os_memcpy(info->macaddr, nla_data(tb[NL80211_ATTR_MAC]), + ETH_ALEN); + ++ if (tb[NL80211_ATTR_4ADDR]) ++ info->use_4addr = nla_get_u8(tb[NL80211_ATTR_4ADDR]); ++ + return NL_SKIP; + } + +@@ -691,6 +695,20 @@ static int nl80211_get_macaddr(struct i802_bss *bss) + } + + ++static int nl80211_get_4addr(struct i802_bss *bss) ++{ ++ struct nl_msg *msg; ++ struct wiphy_idx_data data = { ++ .use_4addr = 0, ++ }; ++ ++ if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE)) || ++ send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data)) ++ return -1; ++ return data.use_4addr; ++} ++ ++ + static int nl80211_register_beacons(struct wpa_driver_nl80211_data *drv, + struct nl80211_wiphy_data *w) + { +@@ -11482,6 +11500,11 @@ static int nl80211_set_4addr_mode(void *priv, const char *bridge_ifname, + + ret = send_and_recv_msgs(drv, msg, NULL, NULL); + msg = NULL; ++ if (ret && val && nl80211_get_4addr(bss) == 1) { ++ wpa_printf(MSG_DEBUG, ++ "nl80211: 4addr mode was already enabled"); ++ ret = 0; ++ } + if (!ret) { + if (bridge_ifname[0] && val && + i802_check_bridge(drv, bss, bridge_ifname, bss->ifname) < 0) +-- +2.29.2 + diff --git a/package/network/services/hostapd/patches/130-wpa_supplicant-multi_ap_roam.patch b/package/network/services/hostapd/patches/130-wpa_supplicant-multi_ap_roam.patch deleted file mode 100644 index fd3017af92..0000000000 --- a/package/network/services/hostapd/patches/130-wpa_supplicant-multi_ap_roam.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 8a4893dd06eb236460db4937f3c54e246739ad28 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= -Date: Wed, 3 Feb 2021 14:23:17 +0100 -Subject: [PATCH] wpa_supplicant: multi_ap: only enable 4addr mode if not - already enabled -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If 4addr mode is already enabled, the call to enable it a second time -may fail. If this happens when roaming, it leads to deauthentication. - -Signed-off-by: Raphaël Mélotte ---- - wpa_supplicant/events.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - ---- a/wpa_supplicant/events.c -+++ b/wpa_supplicant/events.c -@@ -2589,11 +2589,13 @@ static void multi_ap_set_4addr_mode(stru - goto fail; - } - -- if (wpa_drv_set_4addr_mode(wpa_s, 1) < 0) { -- wpa_printf(MSG_ERROR, "Failed to set 4addr mode"); -- goto fail; -+ if (wpa_s->enabled_4addr_mode == 0) { -+ if (wpa_drv_set_4addr_mode(wpa_s, 1) < 0) { -+ wpa_printf(MSG_ERROR, "Failed to set 4addr mode"); -+ goto fail; -+ } -+ wpa_s->enabled_4addr_mode = 1; - } -- wpa_s->enabled_4addr_mode = 1; - return; - - fail: From 5808c8c6ba73fe39113e5fe65924098f50fd4d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sat, 20 Feb 2021 15:56:19 +0100 Subject: [PATCH 13/16] openwrt-keyring: add OpenWrt 21.02 GPG/usign keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 49283916005d usign: add 21.02 release build pubkey bc4d80f064f2 gpg: add OpenWrt 21.02 signing key Signed-off-by: Petr Štetiar (cherry picked from commit 1bf6d70e60fdb45d81a8f10b90904cef38c73f70) --- package/system/openwrt-keyring/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/openwrt-keyring/Makefile b/package/system/openwrt-keyring/Makefile index 7779e0c5a4..6f3aa65622 100644 --- a/package/system/openwrt-keyring/Makefile +++ b/package/system/openwrt-keyring/Makefile @@ -7,9 +7,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/keyring.git -PKG_SOURCE_DATE:=2019-07-25 -PKG_SOURCE_VERSION:=8080ef341b4180e40c4ae8ab63511ac6496f0ad1 -PKG_MIRROR_HASH:=000882364b953691bf02f7ac41462badb68f452f0317cdfd51cfd617c9b1e364 +PKG_SOURCE_DATE:=2021-02-20 +PKG_SOURCE_VERSION:=49283916005d7868923d34ab34f14188cf74812d +PKG_MIRROR_HASH:=7b58592bb49e4b37c8e80904c8f457ce3f0f2e6b1d2c473ccfe9204a8b7be831 PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0 From 906c87814dbf5e3d7f26bdeae198f01a3c189e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 20 Feb 2021 18:59:25 +0100 Subject: [PATCH 14/16] generic: add bcm2835-rng quality patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch allows devices without a high resolution timer to boot up faster. It should speed up boots for bcm2708 and bcm63xx. Signed-off-by: Álvaro Fernández Rojas (cherry-picked from commit 7747b3fa36) --- ...40-hwrng-bcm2835-set-quality-to-1000.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 target/linux/generic/pending-5.4/840-hwrng-bcm2835-set-quality-to-1000.patch diff --git a/target/linux/generic/pending-5.4/840-hwrng-bcm2835-set-quality-to-1000.patch b/target/linux/generic/pending-5.4/840-hwrng-bcm2835-set-quality-to-1000.patch new file mode 100644 index 0000000000..247c6d8364 --- /dev/null +++ b/target/linux/generic/pending-5.4/840-hwrng-bcm2835-set-quality-to-1000.patch @@ -0,0 +1,26 @@ +From d6988cf1d16faac56899918bb2b1be8d85155e3f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Sat, 20 Feb 2021 18:36:38 +0100 +Subject: [PATCH] hwrng: bcm2835: set quality to 1000 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows devices without a high precission timer to reduce boot from >100s +to <30s. + +Signed-off-by: Álvaro Fernández Rojas +--- + drivers/char/hw_random/bcm2835-rng.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/char/hw_random/bcm2835-rng.c ++++ b/drivers/char/hw_random/bcm2835-rng.c +@@ -167,6 +167,7 @@ static int bcm2835_rng_probe(struct plat + priv->rng.init = bcm2835_rng_init; + priv->rng.read = bcm2835_rng_read; + priv->rng.cleanup = bcm2835_rng_cleanup; ++ priv->rng.quality = 1000; + + if (dev_of_node(dev)) { + rng_id = of_match_node(bcm2835_rng_of_match, np); From b7c5924f1f4c2c9c8030aac14b9b86cd69044894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 20 Feb 2021 19:53:50 +0100 Subject: [PATCH 15/16] bcm27xx: enable bcm2711 HW RNG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also add a patch setting its quality, which should make it usable by khwrngd. Signed-off-by: Álvaro Fernández Rojas (cherry-picked from commit 670526efa3) --- target/linux/bcm27xx/bcm2709/config-5.4 | 1 + target/linux/bcm27xx/bcm2711/config-5.4 | 1 + .../960-hwrng-iproc-set-quality-to-1000.patch | 25 +++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 target/linux/bcm27xx/patches-5.4/960-hwrng-iproc-set-quality-to-1000.patch diff --git a/target/linux/bcm27xx/bcm2709/config-5.4 b/target/linux/bcm27xx/bcm2709/config-5.4 index 98ac433752..a4f6b3c0b4 100644 --- a/target/linux/bcm27xx/bcm2709/config-5.4 +++ b/target/linux/bcm27xx/bcm2709/config-5.4 @@ -246,6 +246,7 @@ CONFIG_HOTPLUG_CPU=y CONFIG_HW_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_BCM2835=y +CONFIG_HW_RANDOM_IPROC_RNG200=y CONFIG_HZ=100 CONFIG_HZ_100=y CONFIG_HZ_FIXED=0 diff --git a/target/linux/bcm27xx/bcm2711/config-5.4 b/target/linux/bcm27xx/bcm2711/config-5.4 index 2ba8bfba3d..df6237f51e 100644 --- a/target/linux/bcm27xx/bcm2711/config-5.4 +++ b/target/linux/bcm27xx/bcm2711/config-5.4 @@ -258,6 +258,7 @@ CONFIG_HOTPLUG_CPU=y CONFIG_HW_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_BCM2835=y +CONFIG_HW_RANDOM_IPROC_RNG200=y CONFIG_HZ=250 CONFIG_HZ_250=y CONFIG_I2C=y diff --git a/target/linux/bcm27xx/patches-5.4/960-hwrng-iproc-set-quality-to-1000.patch b/target/linux/bcm27xx/patches-5.4/960-hwrng-iproc-set-quality-to-1000.patch new file mode 100644 index 0000000000..0ceec49d7b --- /dev/null +++ b/target/linux/bcm27xx/patches-5.4/960-hwrng-iproc-set-quality-to-1000.patch @@ -0,0 +1,25 @@ +From d3e5e7f3a4e6f61e8c380b9a610212267ee72dbd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Sat, 20 Feb 2021 19:24:50 +0100 +Subject: [PATCH] hwrng: iproc: set quality to 1000 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows khwrngd to make use of iproc-rng200. + +Signed-off-by: Álvaro Fernández Rojas +--- + drivers/char/hw_random/iproc-rng200.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/char/hw_random/iproc-rng200.c ++++ b/drivers/char/hw_random/iproc-rng200.c +@@ -270,6 +270,7 @@ static int iproc_rng200_probe(struct pla + + priv->rng.name = pdev->name; + priv->rng.cleanup = iproc_rng200_cleanup; ++ priv->rng.quality = 1000; + + if (of_device_is_compatible(dev->of_node, "brcm,bcm2711-rng200")) { + priv->rng.init = bcm2711_rng200_init; From 8cb50639c771274f21b880474c0b2e0fe202b42f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 20 Feb 2021 19:55:14 +0100 Subject: [PATCH 16/16] bcm27xx: remove urngd package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that khwrngd is working on all subtargets we can remove urgnd. Signed-off-by: Álvaro Fernández Rojas (cherry-picked from commit 9dc84018ee) --- target/linux/bcm27xx/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/bcm27xx/Makefile b/target/linux/bcm27xx/Makefile index 9329976b8d..d8a6aedf18 100644 --- a/target/linux/bcm27xx/Makefile +++ b/target/linux/bcm27xx/Makefile @@ -19,6 +19,8 @@ define Target/Description endef include $(INCLUDE_DIR)/target.mk + +DEFAULT_PACKAGES := $(filter-out urngd,$(DEFAULT_PACKAGES)) DEFAULT_PACKAGES += \ bcm27xx-gpu-fw \ kmod-usb-hid \