diff --git a/iopsys-common/iopsys-fit-image.mk b/iopsys-common/iopsys-fit-image.mk index 55a76d3a78ea444be1e58103f27fdb25af6e0bc5..dbe2259a6a3fec618ff3d16151b930f0770e702b 100644 --- a/iopsys-common/iopsys-fit-image.mk +++ b/iopsys-common/iopsys-fit-image.mk @@ -22,7 +22,8 @@ endef # $(N) fit component name # $(N+1) fit component file define iopsys-fit-upgrade-image - CREATION_DATE="$(subst _, ,$(BUILD_DATE))" \ + IGNORE_MISSING_BOOTLOADER_VERSION="1" \ + CREATION_DATE="$(subst _, ,$(BUILD_DATE))" \ MODEL="$(DEVICE_MODEL)" \ IOPSYS_VERSION="$(IOPSYS_BUILD_VERSION)" \ $(TOPDIR)/feeds/targets/iopsys-common/mkits-iopsys-upgrade-image.sh \ diff --git a/iopsys-common/iopsys-upgrade-bundle.mk b/iopsys-common/iopsys-upgrade-bundle.mk index b0be341fbdb8435c8b8ec8d11e8fd8198f28f5c7..e7028df5a5d2a1675f132942129488b873bfe6e1 100644 --- a/iopsys-common/iopsys-upgrade-bundle.mk +++ b/iopsys-common/iopsys-upgrade-bundle.mk @@ -11,6 +11,8 @@ encrypt_file = @echo Encrypting upgrade bundle; \ endif define iopsys-prepare-upgrade-bundle + @echo + @echo Generating upgrade bundle for $(DEVICE_NAME) cd "$(CURDIR)/upgrade-bundle" && tar --format=posix --owner 0 --group 0 -cvf "$(KDIR)/upgrade-bundle.tar" * gzip -vf "$(KDIR)/upgrade-bundle.tar" diff --git a/iopsys-econet/Makefile b/iopsys-econet/Makefile index 703ef96e127e1369d2a83a245a38361735cdecf5..7214a8010afbeed8994de9309047f11078edc906 100644 --- a/iopsys-econet/Makefile +++ b/iopsys-econet/Makefile @@ -1,9 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-only # # Copyright (C) 2008-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# + include $(TOPDIR)/rules.mk ARCH:=arm @@ -15,6 +13,14 @@ FEATURES:=squashfs usb ubifs KERNEL_PATCHVER:=5.4 KERNEL_TESTING_PATCHVER:=5.4 +# Workaround for build fail. Enable all packages beside ipt-offload +DEVICE_TYPE := basic +DEFAULT_PACKAGES += dnsmasq firewall ip6tables iptables odhcp6c ppp ppp-mod-pppoe + +define Target/Description + Build IOPSYS firmware images for Econet MT751x2x based boards. +endef + include $(INCLUDE_DIR)/target.mk include $(PLATFORM_SUBDIR)/*.mak include $(PLATFORM_DIR)/rule.mak @@ -22,8 +28,6 @@ include $(PLATFORM_DIR)/dir.mak include $(PLATFORM_DIR)/openwrt_specify.mk include $(PLATFORM_DIR)/econet_feed_paths.mk -define Target/Description - Build IOPSYS firmware images for Econet MT751x2x based boards. -endef +DEFAULT_PACKAGES += kmod-leds-gpio kmod-gpio-button-hotplug $(eval $(call BuildTarget)) diff --git a/iopsys-econet/config/config b/iopsys-econet/config/config index 8824b16a7eb9b6ed0ebfddb4546c3f91542b9817..2fb5262f3cfc30894b649b28c508911973516e46 100644 --- a/iopsys-econet/config/config +++ b/iopsys-econet/config/config @@ -47,6 +47,8 @@ CONFIG_PACKAGE_xpon_bsp=y CONFIG_TARGET_MULTI_PROFILE=y CONFIG_TARGET_PER_DEVICE_ROOTFS=y CONFIG_TARGET_ROOTFS_SQUASHFS=y +# CONFIG_TARGET_ROOTFS_JFFS2_NAND is not set +# CONFIG_TARGET_ROOTFS_UBIFS is not set CONFIG_BUSYBOX_CONFIG_VCONFIG=y CONFIG_PACKAGE_sysstat=y @@ -83,9 +85,11 @@ CONFIG_DRIVER_11AX_SUPPORT=y # Look for an included upgrade bundle in the FIT CONFIG_PACKAGE_fdtextract=y +CONFIG_TARGET_UPGRADE_BUNDLE=y # disable peripheral manager # CONFIG_PACKAGE_peripheral_manager is not set -# Other +# Other (Fix compilation issues) # CONFIG_PACKAGE_kmod-ipt-offload is not set # CONFIG_PACKAGE_kmod-nf-flow is not set +# CONFIG_PACKAGE_libustream-wolfssl is not set diff --git a/iopsys-econet/dts/en7562.dts b/iopsys-econet/dts/en7562.dts new file mode 100755 index 0000000000000000000000000000000000000000..3db3332712d2031691233c5fb655b002063ebf3a --- /dev/null +++ b/iopsys-econet/dts/en7562.dts @@ -0,0 +1,486 @@ + + +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> + +/dts-v1/; + +/ { + compatible = "econet,en7523"; + interrupt-parent = <&gic>; + #address-cells = <1>; + #size-cells = <1>; + + chosen { + bootargs = "root=/dev/mtdblock3 ro console=ttyS0,115200n8 earlycon init=/sbin/init"; + stdout-path = &uart1; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + atf-reserved-memory@80000000 { + compatible = "econet,en7523-atf-reserved-memory"; + no-map; + reg = <0x80000000 0x40000>; + }; + + npu_reserved: npu_binary@84000000 { + no-map; + reg = <0x84000000 0x100000>; + }; + + }; + + psci { + compatible = "arm,psci-0.2"; + method = "smc"; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu-map { + cluster0 { + core0 { + cpu = <&cpu0>; + }; + core1 { + cpu = <&cpu1>; + }; + }; + }; + + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53"; + reg = <0x0>; + enable-method = "psci"; + clock-frequency = <80000000>; + next-level-cache = <&L2_0>; + }; + + cpu1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a53"; + reg = <0x1>; + enable-method = "psci"; + clock-frequency = <80000000>; + next-level-cache = <&L2_0>; + }; + + L2_0: l2-cache0 { + compatible = "cache"; + }; + }; + + gic: interrupt-controller@09000000 { + compatible = "arm,gic-v3"; + interrupt-controller; + #interrupt-cells = <3>; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x09000000 0x20000>, + <0x09080000 0x80000>; + interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_LOW>; + + its: gic-its@09020000 { + compatible = "arm,gic-v3-its"; + msi-controller; + #msi-cell = <1>; + reg = <0x090200000 0x20000>; + }; + }; + + + timer { + compatible = "arm,armv8-timer"; + interrupt-parent = <&gic>; + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; + clock-frequency = <25000000>; + }; + + pmu { + //compatible = "arm,armv8-pmuv3"; + compatible = "arm,cortex-a15-pmu"; + interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH>; + }; + + npu@1e800000 { + compatible = "econet,ecnt-npu"; + reg = <0x1e800000 0x60000>, //NPU 384K SRAM + <0x1e900000 0x313000>; //NPU 16K SRAM, Registers + memory-region = <&npu_reserved>; + interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>, // 102+16 tr done + <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, // 105+16 hadap irq0 + <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>; //mbox2host irq + }; + + apb_timer1: apb_timer1@1fbf0100 { + compatible = "econet,ecnt-timer"; + reg = <0x1fbf0100 0x40>; + interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x40000000>; + }; + + rbus@1fa00000 { + compatible = "econet,ecnt-rbus"; + reg = <0x1fa00000 0x1000>; //RBus Core + }; + + sram@1fa40000 { + compatible = "econet,ecnt-sram"; + reg = <0x1fa40000 0x8000>, //GDMP SRAM + <0x08000000 0x40000>, //L2C SRAM (only for CPU internal access) + <0x1EFC0000 0x40000>, //L2C SRAM (only for CPU/NPU/GDMA/SPI/Crypto/WOE external access via pbus) + <0x1E880000 0x40000>, //L2C SRAM (only for CPU/NPU/HSDMA/PCIE external access via npu_rbus) + <0x1fbe3000 0x200>; //I2C_SLAVE SRAM + }; + + scu@1fb00000 { + compatible = "econet,ecnt-scu"; + reg = <0x1fb00000 0x960>, //NP SCU + <0x1fa20000 0x360>, //CHIP SCU + <0x1fa2FF30 0x10>; //Rbus clk ctl for FPGA + interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>; + }; + + pcie@0x1fa91000 { + compatible = "ecnt,pcie-en7523"; + device_type = "pci"; + reg = <0x1fa91000 0x1000>, + <0x1fa92000 0x1000>, + <0x1fa90000 0x1000>, /* pcie top*/ + <0x1a100000 0x1000>, /* switch lane */ + <0x1a148000 0x1000>, /* 4, rc0 phy base, for change xtal setting */ + <0x1a14a000 0x1000>; /* 5, rc1 phy base, for change xtal setting */ + interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, //23+16 + <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>; //24+16 + bus-range = <0x00 0xff>; + #address-cells = <3>; + #size-cells = <2>; + /* change xtal for 40M, default is 25M */ + /* change-xtal; */ + /* disable io coherent for RC and EP default. */ + /*dma-coherent;*/ + ranges = <0x82000000 0 0x20000000 0x20000000 0 0x10000000>; + + pcie0: pcie@0,0 { + device_type = "pci"; + reg = <0x0000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc0 1>, + <0 0 0 2 &pcie_intc0 2>, + <0 0 0 3 &pcie_intc0 3>, + <0 0 0 4 &pcie_intc0 4>; + pcie-port = <0>; + num-lanes = <1>; + status = "okay"; + pcie_intc0: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + + pcie1: pcie@1,0 { + device_type = "pci"; + reg = <0x0800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc1 1>, + <0 0 0 2 &pcie_intc1 2>, + <0 0 0 3 &pcie_intc1 3>, + <0 0 0 4 &pcie_intc1 4>; + pcie-port = <1>; + num-lanes = <1>; + status = "okay"; + pcie_intc1: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + }; + + wdma{ + compatible = "en751221,wdma"; + reg = <0x1fa06000 0x400 >, + <0x1fa06400 0x400 >; + interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>; + }; + + wed{ + compatible = "en751221,wed"; + wed_num = <2>; + pci_slot_map = <0>, <1>; + reg = <0x1fa02000 0xb00 >, + <0x1fa03000 0xb00 >; + interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>; + }; + + wed2{ + compatible = "en751221,wed2"; + wed_num = <2>; + pci_slot_map = <0>, <1>; + reg = <0x1fa02000 0xb00 >, + <0x1fa03000 0xb00 >; + interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>; + }; + + wed_test{ + compatible = "en751221,wed_test"; + wed_num = <2>; + reg = <0x1fa02b00 0x100 >, + <0x1fa03b00 0x100 >; + }; + + + + i2c@1fbf8000 { + compatible = "econet,ecnt-i2c"; + reg = <0x1fbf8000 0x65>; + }; + + gdump@1fbf9000 { + compatible = "econet,ecnt-gdump"; + reg = <0x1fbf9000 0x84>; + }; + + crypto_k@1fb70000 { + compatible = "econet,ecnt-crypto_k"; + reg = <0x1fb70000 0x804>; + interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>; + }; + + trng@1faa1000 { + compatible = "econet,ecnt-trng"; + reg = <0x1faa1000 0xc04>; + interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; + }; + + gdma@1fb30000 { + compatible = "econet,ecnt-gdma"; + reg = <0x1fb30000 0x2b0>; + }; + + xsi@1fa60000 { + compatible = "econet,ecnt-xsi"; + reg = <0x1fa60000 0x300>, //hsgmii ae + <0x1fa70000 0x300>, //hsgmii pcie0 + <0x1fa71000 0x300>, //hsgmii pcie1 + <0x1fa80000 0x300>; //hsgmii usb + }; + + i2c_slave@1fbe3300 { + compatible = "econet,ecnt-i2c_slave"; + reg = <0x1fbe3300 0x10>; + dev0_addr = <0x60>; + dev1_addr = <0x62>; + interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; + }; + + uart1: serial@1fbf0000 { + compatible = "econet,ecnt-uart1"; + reg = <0x1fbf0000 0x30>; + interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>; + //status = "disabled"; + }; + uart2: serial@1fbf0300 { + compatible = "econet,ecnt-uart2"; + reg = <0x1fbf0300 0x30>; + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; + //status = "disabled"; + }; + gpio@1fbf0200 { + compatible = "econet,ecnt-gpio"; + reg = <0x1fbf0200 0x80>; + }; + + spi_ctrl: spi_controller@1fa10000 { + compatible = "econet,ecnt-spi_ctrl"; + reg = <0x1fa10000 0x140>, //SPI Controller Base + <0x00000000 0x1000>; //SPI Controller auto read interrupt test + interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>; + }; + + spi_spi2nfi: spi_spi2nfi@1fa11000 { + compatible = "econet,ecnt-spi2nfi"; + reg = <0x1fa11000 0x160>; //NFI2SPI + }; + + spi_ecc: spi_ecc@1fa12000 { + compatible = "econet,ecnt-spi_ecc"; + reg = <0x1fa12000 0x150>; //NFI ECC + }; + + frame_engine: frame_engine@1fb50000 { + compatible = "econet,ecnt-frame_engine"; + reg = <0x1fb50000 0x2600>, //FE + PPE + <0x1fb54000 0x4000>, //QDMA + <0x1fb58000 0x8000>; //SWITCH + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>, // QDMA LAN INT1 21+16 + <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>, // QDMA LAN INT2 39+16 + <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>, // QDMA LAN INT3 40+16 + <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>, // QDMA LAN INT4 41+16 + <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>, // QDMA WAN INT1 22+16 + <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>, // QDMA WAN INT2 42+16 + <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>, // QDMA WAN INT3 43+16 + <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>, // QDMA WAN INT4 44+16 + <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>, // FE ERROR INTR 33+16 + <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; // PDMA INTR 48+16 + }; + + spi_nor_flash: snor { + compatible = "econet,ecnt-snor"; + spi-controller = <&spi_ctrl>; + }; + + nand_flash: nand@1fa10000 { + compatible = "econet,ecnt-nand"; + spi-controller = <&spi_ctrl>; + spi2nfi = <&spi_spi2nfi>; + spi-ecc = <&spi_ecc>; + }; + + hsdma: dma-controller@1fa01800 { + compatible = "econet,en7523-hsdma"; + reg = <0x1fa01800 0x300>; + interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>; + #dma-cells = <1>; + dma-channels = <2>; + dma-requests = <2>; + }; + + cpu_top@1efb0000 { + compatible = "econet,ecnt-cpu_top"; + reg = <0x1efbc800 0x10>; //CTRL + }; + + xpon_mac: xpon@1fb64000 { + compatible = "econet,ecnt-xpon"; + reg = <0x1fb64000 0x3e8>, + <0x1fb66000 0x23c>; + interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>, // XPON MAC INT 26+16 + <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;// DYINGGASP INT 18+16 + }; + + xhci_hcd: xhci@1fab0000 { + compatible = "econet,ecnt-xhci"; + reg = <0x1fab0000 0x3e00>, //MAC base address + <0x1fab3e00 0x100>; //IPPC base address + interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; + }; + + pon_phy: pon_phy@1faf0000 { + compatible = "econet,ecnt-pon_phy"; + reg = <0x1faf0000 0x800>, // PON_PHY_ASIC_RG range + <0x1fa2ff24 0x4>, // PON_PHY_FPGA_RG_TX_OFF + <0x1faf3000 0xfff>, // PON_PHY_ASIC_RG range2 + <0x1faf4000 0xfff>; // PON_PHY_ASIC_RG range3 + interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>; // XPON_PHY_INTR 27+16 + }; + + pcm@bfbd0000 { + compatible = "econet,ecnt-pcm"; + reg = <0x1fbd0000 0x4fff>; + interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>; + }; + + i2s@1fbe2200 { + compatible = "econet,ecnt-i2s"; + reg = <0x1fbe2200 0xfc>, + <0x1fbe2e00 0x114>; + interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>; + }; + + pcie_phy: pcie_phy@1fa93700 { + compatible = "econet,en7523-pcie_phy"; + reg = <0x1fa93700 0x568>, //PC0 RG range + <0x1fa95700 0x568>; //PC1 RG range + }; + pon_hsgmii: pon_hsgmii@1fa65000 { + compatible = "econet,ecnt-pon_hsgmii"; + reg = <0x1fa65100 0x4a0>, //PCS mode1 range + <0x1fa65a00 0x1ac>, //PCS mode2 range + <0x1fa65e00 0x64>, //AN range + <0x1fa66000 0xdc>; //rate adaption range + interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>; // pon_hsgmii INT 50+16 + }; + sgmii_p0: sgmii_p0@1fa72000 { + compatible = "econet,ecnt-sgmii"; + reg = <0x1fa72100 0x4a0>, //PCS mode1 range + <0x1fa72a00 0x160>, //PCS mode2 range + <0x1fa72000 0x64>, //AN range + <0x1fa72600 0xdc>, //rate adaption range + <0x1fa72c00 0x3b0>; //phya + interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>; // pc0_hsgmii INT 135+16 + int_name = "sgmii_pcie0"; + int_id = <0>; + }; + sgmii_p1: sgmii_p1@1fa77000 { + compatible = "econet,ecnt-sgmii"; + reg = <0x1fa77100 0x4a0>, //PCS mode1 range + <0x1fa77a00 0x160>, //PCS mode2 range + <0x1fa77000 0x64>, //AN range + <0x1fa77600 0xdc>, //rate adaption range + <0x1fa77c00 0x3b0>; //phya + interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>; // pc1_hsgmii INT 136+16 + int_name = "sgmii_pcie1"; + int_id = <1>; + }; + sgmii_u0: sgmii_u0@1fa81000 { + compatible = "econet,ecnt-sgmii"; + reg = <0x1fa81100 0x4a0>, //PCS mode1 range + <0x1fa81a00 0x160>, //PCS mode2 range + <0x1fa81000 0x64>, //AN range + <0x1fa81600 0xdc>, //rate adaption range + <0x1fa81c00 0x3b0>; //phya + interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>; // usb_hsgmii INT 137+16 + int_name = "sgmii_usb0"; + int_id = <2>; + }; + + usb_phy@1fad0000 { + compatible = "econet,ecnt-usb_phy"; + reg = <0x1fad0000 0x1fff>; + }; + + thermal_phy: thermal_phy@1efbd000 { + compatible = "econet,ecnt-thermal_phy"; + reg = <0x1efbd000 0x0fff>; //ptp_thermal_ctrl + }; + + +}; diff --git a/iopsys-econet/en7562/boot-initramfs.its b/iopsys-econet/en7562/boot-initramfs.its index 7d56b45510a09d2a01b784a004ea1480cc1a3342..cd269d72d806c9b82bc0446493d72f57ac354090 100644 --- a/iopsys-econet/en7562/boot-initramfs.its +++ b/iopsys-econet/en7562/boot-initramfs.its @@ -12,7 +12,7 @@ images { fdt@1 { description = "IOPSYS Flattened Device Tree blob"; - data = /incbin/("ecnt.dtb"); + data = /incbin/("image-en7562.dtb"); type = "flat_dt"; arch = "arm"; compression = "none"; diff --git a/iopsys-econet/en7562/boot-kernel.its b/iopsys-econet/en7562/boot-kernel.its index 93a74dce4563da91897bc6ea12f3aab3b6e0a04c..c5291cca08c966a6965810f61956cb0e80370051 100644 --- a/iopsys-econet/en7562/boot-kernel.its +++ b/iopsys-econet/en7562/boot-kernel.its @@ -7,14 +7,14 @@ images { fdt@1 { description = "IOPSYS Flattened Device Tree blob"; - data = /incbin/("ecnt.dtb"); + data = /incbin/("image-en7562.dtb"); type = "flat_dt"; arch = "arm"; compression = "none"; }; kernel@1 { description = "IOPSYS kernel"; - data = /incbin/("linux.7z"); + data = /incbin/("linux.lzma"); type = "kernel"; arch = "arm"; os = "linux"; diff --git a/iopsys-econet/en7562/boot.its b/iopsys-econet/en7562/boot.its deleted file mode 100755 index c03717563b4b2c5a46a22f550e1fd56d888b31f8..0000000000000000000000000000000000000000 --- a/iopsys-econet/en7562/boot.its +++ /dev/null @@ -1,53 +0,0 @@ -/dts-v1/; - -/ { - description = "IOPSYSWRT FIT upgrade image"; - #address-cells = <1>; - - id = "IOPSYS"; - created = ""; - model = "EN7562"; - iopsys_version = ""; - - images { - bootloader { - description = "bootloader"; - data = /incbin/("iopboot.bin"); - compression = "none"; - hash@1 { - algo = "sha256"; - }; - }; - boot { - description = "boot"; - data = /incbin/("ubilinux"); - compression = "lzma"; - hash@1 { - algo = "sha256"; - }; - }; - rootfs { - description = "rootfs"; - data = /incbin/("root.ubifs"); - compression = "none"; - hash@1 { - algo = "sha256"; - }; - }; - squashfs { - description = "squashfs"; - data = /incbin/("root.squashfs"); - compression = "none"; - hash@1 { - algo = "sha256"; - }; - }; - upgrade_bundle { - description = "upgrade_bundle"; - data = /incbin/("upgrade-bundle.tar.gz"); - hash@1 { - algo = "sha256"; - }; - }; - }; -}; diff --git a/iopsys-econet/en7562/target.mk b/iopsys-econet/en7562/target.mk index 40ae5f4e7c5547a80fd937f4b2579dd9897ec461..682fdb35f945403d4a605b1cab67f2af710f376f 100755 --- a/iopsys-econet/en7562/target.mk +++ b/iopsys-econet/en7562/target.mk @@ -2,13 +2,13 @@ # Copyright (C) 2009 OpenWrt.org # -ARCH:=arm SUBTARGET:=en7562 BOARDNAME:=en7562 based boards CPU_TYPE:=cortex-a7 -FEATURES:=squashfs nand ramdisk ubifs jffs2_nand +FEATURES+=squashfs nand ramdisk ubifs jffs2_nand +KERNELNAME:=vmlinux -KERNEL_PATCHVER:=5.4 +IMAGES_DIR:=../../.. define Target/Description Build firmware images for Econet en7562 ARM based boards. diff --git a/iopsys-econet/image/Makefile b/iopsys-econet/image/Makefile index 3f43757d6c54cf2cdd039f0a1e5c9d529c1a109f..835a0f8a1ded729627d347ea40ff47d04efa6923 100755 --- a/iopsys-econet/image/Makefile +++ b/iopsys-econet/image/Makefile @@ -1,143 +1,28 @@ +# SPDX-License-Identifier: GPL-2.0-only # # Copyright (C) 2008-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -# Required to trigger jffs2_nand image. Must be defined before image.mk include -NAND_BLOCKSIZE = 2048-128k include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -VMLINUX:=$(IMG_PREFIX)-vmlinux -UIMAGE:=$(IMG_PREFIX)-uImage -FILESYSTEMS := ubifs -BUILD_DATE := $(shell date '+%y%m%d_%H%M') -IOPSYS_VERSION_SUFFIX := $(subst ",,-X-$(CONFIG_TARGET_CUSTOMER)-$(CONFIG_TARGET_VERSION)-$(BUILD_DATE)) -BUILD_DIR_ROOT:=$(BUILD_DIR)/root-$(shell echo $(CONFIG_TARGET_BOARD) | sed s/\"//g) - +loadaddr-y := 0x80088000 -#root@iopsys:~# ubiattach -p /dev/mtd3 -#[ 74.583502] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes -#[ 74.590349] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 -# -e/-p LogicalEraseBlock (LEB) size -# -m minimum input/output unit size -# -c (--max-leb-cnt) 220Mb / 126976 ~> 1730 -# -s (sub-page size) 2048 -UBIFS_OPTS := -m 2048 -e 126976 -c 1730 --space-fixup -UBINIZE_OPTS := -m 2048 -p 131072 -s 2048 +KERNEL_LOADADDR := $(loadaddr-y) -define kernel_entry --a 0x80088000 -e 0x80088000 -endef - -define CompressLzma - echo "\r\n\r\n Win847: CompressLzma $(1) $(2) \r\n\r\n" - $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(2) -endef +KERNEL_DTB = kernel-bin | append-dtb | lzma -define MkImage - echo "\r\n\r\n Win847: MkImage $(1) $(2) $(3) $(4) \r\n\r\n" - $(eval imagename=$(if $(4),$(4),ARM OpenWrt Linux-$(LINUX_VERSION))) - -mkimage -A arm -O linux -T kernel -C lzma $(call kernel_entry)\ - -n "$(imagename)" \ - -d $(2) $(3) +define Device/Default + PROFILES = Default + KERNEL := $(KERNEL_DTB) | uImage lzma + SOC := $(DEFAULT_SOC) + DEVICE_DTS_DIR := ../dts + DEVICE_DTS = $$(SOC)_$(1) + IMAGES := sysupgrade.bin + COMPILE := + sysupgrade_bin := append-kernel | append-rootfs | pad-rootfs + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size endef -# -# Generic Targets -# -define Image/BuildKernel - echo "\r\n\r\n BuildKernel UIMAGE=$(UIMAGE)\r\n\r\n" - cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(VMLINUX).elf - cp $(KDIR)/vmlinux $(BIN_DIR)/$(VMLINUX).bin - $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma) - $(call MkImage,lzma,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma) - cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(UIMAGE).bin -ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) - cp $(KDIR)/vmlinux-initramfs.elf $(BIN_DIR)/$(VMLINUX)-initramfs.elf - cp $(KDIR)/vmlinux-initramfs $(BIN_DIR)/$(VMLINUX)-initramfs.bin - $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma) - $(call MkImage,lzma,$(KDIR)/vmlinux-initramfs.bin.lzma,$(KDIR)/uImage-initramfs.lzma) - cp $(KDIR)/uImage-initramfs.lzma $(BIN_DIR)/$(UIMAGE)-initramfs.bin -endif - $(call Image/Build/Initramfs) -endef - -define Image/Prepare - mkdir -p $(BUILD_DIR_ROOT)/etc/board-db/version - echo EN7562$(IOPSYS_VERSION_SUFFIX) > $(BUILD_DIR_ROOT)/etc/board-db/version/iop_version - echo $(CONFIG_TARGET_CUSTOMER)> $(BUILD_DIR_ROOT)/etc/board-db/version/iop_customer -endef - -define Image/Build - echo "\r\n\r\n Image Build $(1) PROFILE=$(PROFILE) KDIR=$(KDIR) PLATFORM_DIR=$(PLATFORM_DIR)\r\n\r\n" - - $(eval size_k=`stat -c%s "$(KDIR)/vmlinux.bin.lzma"`) - - #Copy common components - cp $(KDIR)/vmlinux.bin.lzma $(BIN_DIR)/vmlinux.bin.lzma - cp -a $(KDIR)/linux-$(LINUX_VERSION)/arch/arm/boot/dts/en7523.dtb $(PLATFORM_DIR)/$(SUBTARGET)/ecnt.dtb - cp -a $(KDIR)/linux-$(LINUX_VERSION)/arch/arm/boot/dts/en7523.dtb $(BIN_DIR)/ecnt.dtb - cp $(KDIR)/vmlinux.bin.lzma $(PLATFORM_DIR)/$(SUBTARGET)/linux.7z - cp $(KDIR)/root.ubifs $(PLATFORM_DIR)/$(SUBTARGET) - cp $(KDIR)/root.ubifs $(BIN_DIR) - cp $(KDIR)/root.ubifs ./ - cp $(KDIR)/root.squashfs $(BIN_DIR) - cp $(KDIR)/root.squashfs $(PLATFORM_DIR)/$(SUBTARGET) -ifneq ($(CONFIG_PACKAGE_tcboot),) - #Copy compiled bootloader - cp $(KDIR)/tcboot/src/tcboot.bin $(BIN_DIR)/iopboot.bin -else - #Copy precompiled bootloader - cp $(TOPDIR)/feeds/econet/dl/iopboot.bin $(BIN_DIR) -endif - cp $(BIN_DIR)/iopboot.bin $(PLATFORM_DIR)/$(SUBTARGET) - - $(call Image/Build/GenerateUpgradeBundle) - $(call Image/Build/GenerateKernelFIT) - $(call Image/Build/GenerateInitramfsFIT) - $(call Image/Build/GenerateUbifsFIT) - - #Cleanup temporary files - rm -f $(PLATFORM_DIR)/$(SUBTARGET)/linux.7z $(PLATFORM_DIR)/$(SUBTARGET)/ecnt.dtb $(PLATFORM_DIR)/$(SUBTARGET)/root.ubifs ./root.ubifs $(PLATFORM_DIR)/$(SUBTARGET)/root.squashfs $(PLATFORM_DIR)/$(SUBTARGET)/ubilinux $(PLATFORM_DIR)/$(SUBTARGET)/upgrade-bundle.tar.gz $(PLATFORM_DIR)/$(SUBTARGET)/iopboot.bin -endef - -# -# IOPSYS Econet Subtargets -# -define Image/Build/GenerateKernelFIT - $(STAGING_DIR_HOST)/bin/mkimage -f $(PLATFORM_DIR)/$(SUBTARGET)/boot-kernel.its $(BIN_DIR)/ubilinux - cp $(BIN_DIR)/ubilinux $(PLATFORM_DIR)/$(SUBTARGET)/ -endef - -define Image/Build/GenerateInitramfsFIT - cp $(KDIR)/vmlinux-initramfs.bin.lzma $(PLATFORM_DIR)/$(SUBTARGET)/linux-initramfs.7z - $(STAGING_DIR_HOST)/bin/mkimage -f $(PLATFORM_DIR)/$(SUBTARGET)/boot-initramfs.its $(BIN_DIR)/EN7562$(IOPSYS_VERSION_SUFFIX)-initramfs.itb - ln -sf $(BIN_DIR)/EN7562$(IOPSYS_VERSION_SUFFIX)-initramfs.itb $(BIN_DIR)/last-initramfs.itb - rm -f $(PLATFORM_DIR)/$(SUBTARGET)/linux-initramfs.7z -endef - -define Image/Build/GenerateUbifsFIT - $(STAGING_DIR_HOST)/bin/mkimage -E -f $(PLATFORM_DIR)/$(SUBTARGET)/boot.its $(BIN_DIR)/EN7562$(IOPSYS_VERSION_SUFFIX).itb - ln -sf $(BIN_DIR)/EN7562$(IOPSYS_VERSION_SUFFIX).itb $(BIN_DIR)/last.itb - ubinize $(UBINIZE_OPTS) -o $(BIN_DIR)/ubi_root.bin ubinize.cfg -endef - -define Image/Build/GenerateUpgradeBundle - # Create upgrade bundle. - cd "$(CURDIR)/upgrade-bundle" && tar --format=posix \ - --owner 0 --group 0 -cvf "$(KDIR)/upgrade-bundle.tar" * - cd "$(BUILD_DIR_ROOT)" && tar --format=posix \ - --owner 0 --group 0 -rvf "$(KDIR)/upgrade-bundle.tar" - gzip -vf "$(KDIR)/upgrade-bundle.tar" - cp $(KDIR)/upgrade-bundle.tar.gz $(PLATFORM_DIR)/$(SUBTARGET)/ -endef - -define Image/Build/ubifs - $(call Image/mkfs/ubifs) -endef +include $(SUBTARGET).mk $(eval $(call BuildImage)) diff --git a/iopsys-econet/image/en7562.mk b/iopsys-econet/image/en7562.mk index 0a041d3012c65c5a4fd83d73a4f25d6184768965..9637efb31aa4c028760a4fd53a9cbfcafdc6c552 100644 --- a/iopsys-econet/image/en7562.mk +++ b/iopsys-econet/image/en7562.mk @@ -1,6 +1,66 @@ -KERNEL_LOADADDR := 0x80088000 +# +# EN75XX Profiles +# + +include ../../iopsys-common/iopsys-fit-image.mk +include ../../iopsys-common/iopsys-upgrade-bundle.mk + +DEFAULT_SOC := en7562 + +KERNEL_DTB = kernel-bin | append-dtb | lzma + +define Build/iopsys-fit-upgrade-image + #Copy common components + cp -a $(KDIR)/image-en7562.dtb $(PLATFORM_DIR)/$(SUBTARGET)/ + @echo + @echo Generating FIT image with upgrade bundle for $(DEVICE_NAME) + #$(call iopsys-prepare-upgrade-bundle) + $(call Image/Build/GenerateKernelFIT) + $(call Image/Build/GenerateUpgradeBundle) + $(call iopsys-fit-upgrade-image,$@,upgrade_bundle,$(KDIR)/upgrade-bundle.tar.gz,bootloader,$(TOPDIR)/feeds/econet/dl/iopboot.bin,boot,$(BIN_DIR)/kernel.itb,squashfs,$(IMAGE_ROOTFS)) + + #Cleanup temporary files + rm $(PLATFORM_DIR)/$(SUBTARGET)/image-en7562.dtb $(PLATFORM_DIR)/$(SUBTARGET)/linux.lzma +endef + +define Image/Build/GenerateKernelFIT + @echo GenerateKernelFIT + $(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux -lc1 -lp2 -pb2 $(PLATFORM_DIR)/$(SUBTARGET)/linux.lzma + $(STAGING_DIR_HOST)/bin/mkimage -f $(PLATFORM_DIR)/$(SUBTARGET)/boot-kernel.its $(BIN_DIR)/kernel.itb +endef + +define Image/Build/GenerateUpgradeBundle + # Create upgrade bundle. + cd "$(CURDIR)/upgrade-bundle" && tar --format=posix \ + --owner 0 --group 0 -cvf "$(KDIR)/upgrade-bundle.tar" * + cd "$(BUILD_DIR_ROOT)" && tar --format=posix \ + --owner 0 --group 0 -rvf "$(KDIR)/upgrade-bundle.tar" + gzip -vf "$(KDIR)/upgrade-bundle.tar" +endef + +# arg (1): target rootfs +define Image/Prepare/en7562-rootfs-prepare + @echo Preparing rootfs for $(DEVICE_NAME) + $(call iopsys-install-release-info,$(1)) +endef define Device/en7562 + $(Device/iopsys-common) + DEVICE_VENDOR := IOPSYS + DEVICE_MODEL := RODIMUS + DEVICE_DTS := en7562 + KERNEL := $(KERNEL_DTB) | uImage lzma + KERNEL_INSTALL := + IMAGES := .itb + IMAGE/.itb := iopsys-fit-upgrade-image +# UBIFS_OPTS :=-m 2048 -e 126976 -c 4096 +# UBINIZE_OPTS := -m 2048 -p 131072 -s 2048 + ROOTFS_PREPARE := en7562-rootfs-prepare + DEVICE_PACKAGES := \ + kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware \ + kmod-usb3 kmod-usb-ledtrig-usbport fdtextract + # uboot-envtools are disabled. Precompiled envtools are delivered due to Econet Uboot incompatibility. endef TARGET_DEVICES += en7562 +