From 52459ebf773d6eca1dbf53ab4dbde8c81a3addf0 Mon Sep 17 00:00:00 2001 From: Vladimir Vid Date: Fri, 25 Oct 2019 17:24:38 +0200 Subject: [PATCH 1/5] packages/boot: add arm-trusted-firmware-mvebu and initial uDPU support ATF mvebu is required for building a functional bootloader for A7K/A8K and A37xx platforms. uDPU device is added as the first target. A3700 platform has a wide range of settings which can be used per device, so options are defined under the Device sections. Platform also required WTP (recovery) tools and mv-ddr package for the DDR topology configuration. 32-bit cross compiler is used for building the WTMI image. After the build, flash-image.bin can be used with the bubt command from the u-boot shell to flash the new version of u-boot. Signed-off-by: Vladimir Vid --- .../boot/arm-trusted-firmware-mvebu/Makefile | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 package/boot/arm-trusted-firmware-mvebu/Makefile diff --git a/package/boot/arm-trusted-firmware-mvebu/Makefile b/package/boot/arm-trusted-firmware-mvebu/Makefile new file mode 100644 index 0000000000..a2b34555a6 --- /dev/null +++ b/package/boot/arm-trusted-firmware-mvebu/Makefile @@ -0,0 +1,112 @@ +# +# Copyright (C) 2019 Sartura Ltd. +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=arm-trusted-firmware-mvebu +PKG_VERSION:=2.2 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE:=$(PKG_NAME)-$(PKG_RELEASE).tar.xz +PKG_SOURCE_URL:=https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git +PKG_SOURCE_DATE:=2019-10-22 +PKG_SOURCE_VERSION:=a04808c16cfc126d9fe572ae7c4b5a3d39de5796 +PKG_MIRROR_HASH:=ff93aad67227ca96db54e92288f61b4ff3abbaad291fc88ad95c29cd3dd3588c + +PKG_MAINTAINER:=Vladimir Vid + +include $(INCLUDE_DIR)/package.mk + +define Package/arm-trusted-firmware-mvebu + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:=ARM Trusted Firmware for mvebu devices +endef + +define Package/arm-trusted-firmware-mvebu/uDPU +$(call Package/arm-trusted-firmware-mvebu) + BOARDNAME:=uDPU + TITLE:=ARM Trusted Firmware for Methode uDPU + DEPENDS:=+u-boot-uDPU + UBOOT:=uDPU + CLOCKSPRESET:=CPU_1000_DDR_800 + PLAT:=a3700 +endef + +A3700_UTILS_NAME:=a3700-utils +A3700_UTILS_RELEASE:=18.12.1 +A3700_UTILS_SOURCE=$(A3700_UTILS_NAME)-$(A3700_UTILS_RELEASE).tar.bz2 + +define Download/a3700-utils + FILE:=$(A3700_UTILS_SOURCE) + PROTO:=git + URL:=https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git + VERSION:=e6bb176fb9936d9160e53ae09275000dc6440686 + MIRROR_HASH:=c3edf71cbf1fc2e5482d36e36a34c79d682d2c87fdfb909b4dc6327a171e7bd4 + SUBDIR:=$(A3700_UTILS_NAME) +endef + +MV_DDR_NAME:=mv-ddr-marvell +MV_DDR_RELEASE:=mainline +MV_DDR_SOURCE:=$(MV_DDR_NAME)-$(MV_DDR_RELEASE).tar.bz2 + +define Download/mv-ddr-marvell + FILE:=$(MV_DDR_SOURCE) + PROTO:=git + URL:=https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git + VERSION:=a881467ef0f0185e6570dd0483023fde93cbb5f5 + MIRROR_HASH:=19f34817616c583b2b5f2612705857cf2120f6c2132355217899b1403c3fd336 + SUBDIR:=$(MV_DDR_NAME) +endef + +LINARO_NAME:=gcc-linaro +LINARO_RELEASE:=6 +LINARO_VERSION:=5.0-2018.12-$(HOST_ARCH)_arm-linux-gnueabi +LINARO_SOURCE=$(LINARO_NAME)-$(LINARO_RELEASE).$(LINARO_VERSION).tar.xz + +define Download/gcc-linaro + FILE:=$(LINARO_SOURCE) + URL:=https://releases.linaro.org/components/toolchain/binaries/latest-$(LINARO_RELEASE)/arm-linux-gnueabi/ + HASH:=2d4a92d6c8b384ae404b2e02c1c412e3ec18f9b714135acf046b2b1b510e9ace +endef + +define Build/Prepare + # Download sources + $(eval $(call Download,a3700-utils)) + $(eval $(call Download,mv-ddr-marvell)) + $(eval $(call Download,gcc-linaro)) + + rm -rf $(PKG_BUILD_DIR) + $(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(PKG_SOURCE) + + mkdir -p $(STAGING_DIR_IMAGE) + $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(A3700_UTILS_SOURCE) + $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(MV_DDR_SOURCE) + $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(LINARO_SOURCE) +endef + +TARGET_CFLAGS = "" + +MAKE_VARS= \ + CROSS_COMPILE="$(TARGET_CROSS)" + +MAKE_FLAGS = \ + CROSS_CM3=$(STAGING_DIR_IMAGE)/$(LINARO_NAME)-$(LINARO_RELEASE).$(LINARO_VERSION)/bin/arm-linux-gnueabi- \ + BL33=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.bin \ + MV_DDR_PATH=$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME) \ + WTP=$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME) \ + CLOCKSPRESET=$(CLOCKSPRESET) \ + PLAT=$(PLAT) \ + all \ + fip + +define Build/InstallDev + $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/flash-image.bin $(BIN_DIR)/u-boot-$(BOARDNAME)/ +endef + +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu/uDPU)) From e7a96acf1bd505880133e136e48b09d33344e466 Mon Sep 17 00:00:00 2001 From: Vladimir Vid Date: Mon, 9 Sep 2019 18:50:26 +0200 Subject: [PATCH 2/5] uboot-mvebu: add uDPU board * add u-boot support for uDPU * add line to copy u-boot binary to STAGING_DIR_IMAGE, this can later be used as BL33 variable required for ATF build * add patch to increase max gunzip size in mvebu_armada-37xx.h which is required for booting the itb recovery images Signed-off-by: Vladimir Vid --- package/boot/uboot-mvebu/Makefile | 11 +++++++++-- ...ebu_armada-37xx.h_increase_max_gunzip_size.patch | 13 +++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index 07f2508957..d171daa717 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -29,8 +29,15 @@ define U-Boot/clearfog UBOOT_IMAGE:=u-boot-spl.kwb endef +define U-Boot/uDPU + NAME:=Methode uDPU + BUILD_DEVICES:=methode_udpu + BUILD_SUBTARGET:=cortexa53 +endef + UBOOT_TARGETS:= \ - clearfog + clearfog \ + uDPU Build/Exports:=$(Host/Exports) @@ -44,7 +51,7 @@ endef define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot-spl.kwb + $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) endef $(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch b/package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch new file mode 100644 index 0000000000..580270a70f --- /dev/null +++ b/package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch @@ -0,0 +1,13 @@ +Increase max gunzip size in mvebu_armada-37xx.h. +This is required in order to boot itb images. + +--- a/include/configs/mvebu_armada-37xx.h ++++ b/include/configs/mvebu_armada-37xx.h +@@ -12,6 +12,7 @@ + + /* additions for new ARM relocation support */ + #define CONFIG_SYS_SDRAM_BASE 0x00000000 ++#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */ + + #define CONFIG_NR_DRAM_BANKS 1 + From 317e98a5a2c6f1e2ac599ec530478669b965602c Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 18 Nov 2019 23:59:06 +0100 Subject: [PATCH 3/5] ath79: add PoE passthrough switch for Ubiquiti Nanostation (XM/XW) This adds the gpio switch to enable PoE passthrough on Ubiquiti Nanostation (XM/XW). Values are copied from the implementation in ar71xx. GPIO values checked on: - NanoStation M5 XW - NanoStation M2 XM Signed-off-by: Adrian Schmutzler --- .../ath79/generic/base-files/etc/board.d/03_gpio_switches | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches index 04206f4a58..9bce6cc51b 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches @@ -52,6 +52,12 @@ tplink,wbs210-v2) ubnt,nanostation-ac) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "3" ;; +ubnt,nanostation-m) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8" + ;; +ubnt,nanostation-m-xw) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "2" + ;; ubnt,acb-isp) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" ;; From 08d9c95417399ac8615df210f4381cca68a4b25c Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Sun, 17 Nov 2019 20:58:27 +0100 Subject: [PATCH 4/5] ar71xx: ubnt-(xm,xw): add rssileds package In order to make RSSI indicator on the device work out of box, include "rssileds" package in per-device rootfs image by default for Ubiquiti XM and XW devices, namely: - Bullet M (XM/XW) - Rocket M (XM/XW) - Nanostation M (XM/XW) - Nanostation Loco-M (XW) This moves the package addition to the individual devices in order to prevent accidental inclusions of the package when not looking at the parent node carefully enough. Signed-off-by: Lech Perczak [add bullet-m-xw, remove rocket-m-ti, extend commit message] Signed-off-by: Adrian Schmutzler --- target/linux/ar71xx/image/generic-ubnt.mk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/linux/ar71xx/image/generic-ubnt.mk b/target/linux/ar71xx/image/generic-ubnt.mk index b82ac8686f..7d78e330e3 100644 --- a/target/linux/ar71xx/image/generic-ubnt.mk +++ b/target/linux/ar71xx/image/generic-ubnt.mk @@ -56,7 +56,7 @@ endef define Device/ubnt-xm $(Device/ubnt) - DEVICE_PACKAGES += kmod-usb-ohci rssileds + DEVICE_PACKAGES += kmod-usb-ohci UBNT_TYPE := XM UBNT_CHIP := ar7240 KERNEL := kernel-bin | patch-cmdline | relocate-kernel | lzma | uImage lzma @@ -64,7 +64,6 @@ endef define Device/ubnt-xw $(Device/ubnt) - DEVICE_PACKAGES += rssileds UBNT_TYPE := XW UBNT_CHIP := ar934x UBNT_VERSION := 6.0.4 @@ -94,6 +93,7 @@ TARGET_DEVICES += ubnt-airrouter define Device/ubnt-bullet-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Bullet-M + DEVICE_PACKAGES += rssileds BOARDNAME := UBNT-BM endef TARGET_DEVICES += ubnt-bullet-m @@ -101,6 +101,7 @@ TARGET_DEVICES += ubnt-bullet-m define Device/ubnt-rocket-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Rocket-M + DEVICE_PACKAGES += rssileds BOARDNAME := UBNT-RM endef TARGET_DEVICES += ubnt-rocket-m @@ -108,6 +109,7 @@ TARGET_DEVICES += ubnt-rocket-m define Device/ubnt-nano-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Nano-M + DEVICE_PACKAGES += rssileds BOARDNAME := UBNT-NM endef TARGET_DEVICES += ubnt-nano-m @@ -176,6 +178,7 @@ TARGET_DEVICES += ubnt-unifi-outdoor define Device/ubnt-nano-m-xw $(Device/ubnt-xw) DEVICE_TITLE := Ubiquiti Nano M XW + DEVICE_PACKAGES += rssileds BOARDNAME := UBNT-NM-XW endef TARGET_DEVICES += ubnt-nano-m-xw @@ -190,6 +193,7 @@ TARGET_DEVICES += ubnt-lbe-m5 define Device/ubnt-loco-m-xw $(Device/ubnt-xw) DEVICE_TITLE := Ubiquiti Loco XW + DEVICE_PACKAGES += rssileds BOARDNAME := UBNT-LOCO-XW endef TARGET_DEVICES += ubnt-loco-m-xw @@ -197,6 +201,7 @@ TARGET_DEVICES += ubnt-loco-m-xw define Device/ubnt-bullet-m-xw $(Device/ubnt-xw) DEVICE_TITLE := Ubiquiti Bullet-M XW + DEVICE_PACKAGES += rssileds BOARDNAME := UBNT-BM-XW endef TARGET_DEVICES += ubnt-bullet-m-xw @@ -204,6 +209,7 @@ TARGET_DEVICES += ubnt-bullet-m-xw define Device/ubnt-rocket-m-xw $(Device/ubnt-xw) DEVICE_TITLE := Ubiquiti Rocket M XW + DEVICE_PACKAGES += rssileds BOARDNAME := UBNT-RM-XW endef TARGET_DEVICES += ubnt-rocket-m-xw From d3a8a62692b06b3e5fe7077a2ce641fbf09cdc19 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 17 Nov 2019 23:59:37 +0100 Subject: [PATCH 5/5] wireless-regdb: Make it build with python2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This backports a patch to build it work with python2 in addition to python3. Signed-off-by: Hauke Mehrtens Acked-by: Petr Štetiar --- ...regdb-fix-compatibility-with-python2.patch | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 package/firmware/wireless-regdb/patches/010-regdb-fix-compatibility-with-python2.patch diff --git a/package/firmware/wireless-regdb/patches/010-regdb-fix-compatibility-with-python2.patch b/package/firmware/wireless-regdb/patches/010-regdb-fix-compatibility-with-python2.patch new file mode 100644 index 0000000000..81f50f5dc0 --- /dev/null +++ b/package/firmware/wireless-regdb/patches/010-regdb-fix-compatibility-with-python2.patch @@ -0,0 +1,58 @@ +From 651e39dee8605995b736b6056c6f7dc5c5a9c948 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Thu, 22 Aug 2019 21:46:27 +0200 +Subject: [PATCH] regdb: fix compatibility with python2 + +Various changes in the commit mentioned below broke +compatibility with python2. Restore it in a way that +makes it worth with both versions. + +Fixes: f3c4969c2485 ("wireless-regdb: make scripts compatible with Python 3") +Signed-off-by: Johannes Berg +Signed-off-by: Seth Forshee +--- + db2bin.py | 2 +- + db2fw.py | 2 +- + dbparse.py | 3 +-- + 3 files changed, 3 insertions(+), 4 deletions(-) + +--- a/db2bin.py ++++ b/db2bin.py +@@ -118,7 +118,7 @@ reg_country_ptr.set() + for alpha2 in countrynames: + coll = countries[alpha2] + # struct regdb_file_reg_country +- output.write(struct.pack('>BBxBI', alpha2[0], alpha2[1], coll.dfs_region, reg_rules_collections[coll.permissions])) ++ output.write(struct.pack('>2sxBI', alpha2, coll.dfs_region, reg_rules_collections[coll.permissions])) + + + if len(sys.argv) > 3: +--- a/db2fw.py ++++ b/db2fw.py +@@ -85,7 +85,7 @@ countrynames = list(countries) + countrynames.sort() + for alpha2 in countrynames: + coll = countries[alpha2] +- output.write(struct.pack('>BB', alpha2[0], alpha2[1])) ++ output.write(struct.pack('>2s', alpha2)) + country_ptrs[alpha2] = PTR(output) + output.write(b'\x00' * 4) + +--- a/dbparse.py ++++ b/dbparse.py +@@ -1,6 +1,5 @@ + #!/usr/bin/env python + +-from builtins import bytes + from functools import total_ordering + import sys, math + from math import ceil, log +@@ -359,7 +358,7 @@ class DBParser(object): + for cname in cnames: + if len(cname) != 2: + self._warn("country '%s' not alpha2" % cname) +- cname = bytes(cname, 'ascii') ++ cname = cname.encode('ascii') + if not cname in self._countries: + self._countries[cname] = Country(dfs_region, comments=self._comments) + self._current_countries[cname] = self._countries[cname]