[PATCH v2] wireguard-tools: allow generating private_key

2021-09-14 Thread Leonardo Mörlein
When the uci configuration is created automatically during a very early
stage, where no entropy daemon is set up, generating the key directly is
not an option. Therefore we allow to set the private_key to "generate"
and generate the private key directly before the interface is taken up.

Signed-off-by: Leonardo Mörlein 
---

v2: Changes since v1:
- The (recently introduced) uci flag "-t" is used to avoid interference
  with potentially existing uncommited user changes. This addresses
  Jo-Philipp Wich's concerns about v1 of the patch.
- The functionality has been moved to a function, so it can be included
  from other files.

References:
- v1 of the patch: 
https://patchwork.ozlabs.org/project/openwrt/patch/20210108012435.175345-1...@irrelefant.net/
- uci "-t": 
https://git.openwrt.org/?p=project/uci.git;a=commit;h=4b3db1179747b6a6779029407984bacef851325c

 .../network/utils/wireguard-tools/Makefile|  2 +-
 .../utils/wireguard-tools/files/wireguard.sh  | 19 +++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/package/network/utils/wireguard-tools/Makefile 
b/package/network/utils/wireguard-tools/Makefile
index 5f8da147c1..bcf360329c 100644
--- a/package/network/utils/wireguard-tools/Makefile
+++ b/package/network/utils/wireguard-tools/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/kernel.mk
 PKG_NAME:=wireguard-tools
 
 PKG_VERSION:=1.0.20210223
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=wireguard-tools-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-tools/snapshot/
diff --git a/package/network/utils/wireguard-tools/files/wireguard.sh 
b/package/network/utils/wireguard-tools/files/wireguard.sh
index 63261aea71..845f9eb902 100644
--- a/package/network/utils/wireguard-tools/files/wireguard.sh
+++ b/package/network/utils/wireguard-tools/files/wireguard.sh
@@ -95,6 +95,23 @@ proto_wireguard_setup_peer() {
fi
 }
 
+ensure_key_is_generated() {
+   local private_key
+   private_key="$(uci get network."$1".private_key)"
+
+   if [ "$private_key" == "generate" ]; then
+   local ucitmp
+   oldmask="$(umask)"
+   umask 077
+   ucitmp="$(mktemp -d)"
+   private_key="$("${WG}" genkey)"
+   uci -q -t "$ucitmp" set network."$1".private_key="$private_key" 
&& \
+   uci -q -t "$ucitmp" commit network
+   rm -rf "$ucitmp"
+   umask "$oldmask"
+   fi
+}
+
 proto_wireguard_setup() {
local config="$1"
local wg_dir="/tmp/wireguard"
@@ -104,6 +121,8 @@ proto_wireguard_setup() {
local listen_port
local mtu
 
+   ensure_key_is_generated "${config}"
+
config_load network
config_get private_key "${config}" "private_key"
config_get listen_port "${config}" "listen_port"
-- 
2.33.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] mac80211: Update to backports-5.10.64

2021-09-14 Thread Hauke Mehrtens
Refresh all patches.
The removed patches were integrated upstream.

Signed-off-by: Hauke Mehrtens 
---

This is based on backports-5.10.64-test1.tar.xz, If this works fine I 
will create a official backports release and update this patch.

 package/kernel/mac80211/Makefile  |  6 +-
 .../patches/ath/400-ath_move_debug_code.patch |  2 +-
 .../patches/ath/402-ath_regd_optional.patch   |  2 +-
 .../ath10k/080-ath10k_thermal_config.patch|  2 +-
 .../930-ath10k_add_tpt_led_trigger.patch  |  4 +-
 ...rolling-support-for-various-chipsets.patch |  2 +-
 ...75-ath10k-use-tpt-trigger-by-default.patch |  2 +-
 ...h10k-Try-to-get-mac-address-from-dts.patch |  7 +-
 .../ath9k/410-ath9k_allow_adhoc_and_ap.patch  |  2 +-
 ...abled-MFP-capability-unconditionally.patch |  4 +-
 .../patches/ath9k/501-ath9k_ahb_init.patch|  2 +-
 .../patches/ath9k/530-ath9k_extra_leds.patch  |  2 +-
 .../ath9k/542-ath9k_debugfs_diag.patch|  4 +-
 .../ath9k/543-ath9k_entropy_from_adc.patch|  6 +-
 .../550-ath9k-disable-bands-via-dt.patch  |  2 +-
 .../ath9k/551-ath9k_ubnt_uap_plus_hsr.patch   |  6 +-
 .../ath9k/553-ath9k_of_gpio_mask.patch|  4 +-
 ...62-brcmfmac-Disable-power-management.patch |  2 +-
 .../mac80211/patches/brcm/998-survey.patch|  8 +--
 .../602-rt2x00-introduce-rt2x00eeprom.patch   |  6 +-
 ...isabling_bands_through_platform_data.patch |  2 +-
 ...00-allow_disabling_bands_through_dts.patch |  2 +-
 .../611-rt2x00-add-AP+STA-support.patch   |  2 +-
 .../612-rt2x00-led-tpt-trigger-support.patch  |  4 +-
 ...ave-survey-for-every-channel-visited.patch |  4 +-
 .../110-mac80211_keep_keys_on_stop_ap.patch   |  2 +-
 .../mac80211/patches/subsys/210-ap_scan.patch |  2 +-
 ...ort-immediate-reconnect-request-hint.patch | 14 ++--
 ...-driver-based-disconnect-with-reconn.patch | 32 -
 ...port-to-configure-SAE-PWE-value-to-d.patch |  2 +-
 ...-get_default_func-move-default-flow-.patch |  2 +-
 ...ot-maintain-a-backlog-sorted-list-of.patch |  2 +-
 ...add-rx-decapsulation-offload-support.patch | 18 ++---
 ...le-QoS-support-for-nl80211-ctrl-port.patch |  6 +-
 ...320-mac80211_hwsim-add-6GHz-channels.patch |  4 +-
 ...211_hwsim-make-6-GHz-channels-usable.patch |  8 +--
 ...pply-flow-control-on-management-fram.patch |  2 +-
 ...set-sk_pacing_shift-for-802.3-txpath.patch |  2 +-
 ...MPDU-session-check-from-minstrel_ht-.patch | 12 ++--
 ...eee80211_tx_h_rate_ctrl-when-dequeue.patch |  8 +--
 ...te-control-support-for-encap-offload.patch |  4 +-
 ...11-minstrel_ht-fix-sample-time-check.patch |  2 +-
 ...iwlwifi-specific-workaround-that-bro.patch | 51 -
 ...rting-aggregation-sessions-on-mesh-i.patch |  2 +-
 ...introduce-aql_enable-node-in-debugfs.patch |  4 +-
 ...to-a-virtual-time-based-airtime-sche.patch | 20 +++---
 ...bling-4-address-mode-on-a-sta-vif-af.patch | 72 ---
 ...on-API-to-configure-SAR-power-limita.patch |  4 +-
 ...eck-per-vif-offload_flags-in-Tx-path.patch |  2 +-
 49 files changed, 119 insertions(+), 247 deletions(-)
 delete mode 100644 
package/kernel/mac80211/patches/subsys/378-mac80211-remove-iwlwifi-specific-workaround-that-bro.patch
 delete mode 100644 
package/kernel/mac80211/patches/subsys/383-mac80211-fix-enabling-4-address-mode-on-a-sta-vif-af.patch

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index dd39c2d06932..e8073a51cb88 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
 
-PKG_VERSION:=5.10.42-1
+PKG_VERSION:=5.10.64-test1
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.42/
-PKG_HASH:=6876520105240844fdb32d1dcdf2bfdea291a37a96f16c892fda3776ba714fcb
+PKG_SOURCE_URL:=https://hauke-m.de/files/backports-test/
+PKG_HASH:=4b2e9e5a61cd0a4d766eb9859cc96719f0746954eca20d5f402d2f50fc7eb4af
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
diff --git a/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch 
b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch
index db10c45104d7..eacc72776e0f 100644
--- a/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch
+++ b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch
@@ -14,7 +14,7 @@
  CFLAGS_trace.o := -I$(src)
 --- a/drivers/net/wireless/ath/ath.h
 +++ b/drivers/net/wireless/ath/ath.h
-@@ -316,14 +316,7 @@ void _ath_dbg(struct ath_common *common,
+@@ -317,14 +317,7 @@ void _ath_dbg(struct ath_common *common,
  #endif /* CPTCFG_ATH_DEBUG */
  
  /** Returns string describing opmode, or NULL if unknown mode. */
diff --git a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch 
b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
index 3c9180b1137c..bf87d3551a18 100644
--- a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
+++ b/package/kernel/mac80211/patches/a

[PATCH 21.02] mac80211: Update to backports-5.10.64

2021-09-14 Thread Hauke Mehrtens
Refresh all patches.
The removed patches were integrated upstream.

Signed-off-by: Hauke Mehrtens 
---

This is based on backports-5.10.64-test1.tar.xz, If this works fine I 
will create a official backports release and update this patch.

 package/kernel/mac80211/Makefile  |  6 +--
 .../patches/ath/400-ath_move_debug_code.patch |  2 +-
 .../patches/ath/542-ath9k_debugfs_diag.patch  |  4 +-
 .../ath/551-ath9k_ubnt_uap_plus_hsr.patch |  4 +-
 .../ath/930-ath10k_add_tpt_led_trigger.patch  |  4 +-
 ...75-ath10k-use-tpt-trigger-by-default.patch |  2 +-
 ...62-brcmfmac-Disable-power-management.patch |  2 +-
 .../mac80211/patches/brcm/998-survey.patch|  8 +--
 .../110-mac80211_keep_keys_on_stop_ap.patch   |  2 +-
 .../mac80211/patches/subsys/210-ap_scan.patch |  2 +-
 ...ort-immediate-reconnect-request-hint.patch | 14 ++---
 ...-driver-based-disconnect-with-reconn.patch | 32 ++--
 ...port-to-configure-SAE-PWE-value-to-d.patch |  2 +-
 ...-get_default_func-move-default-flow-.patch |  2 +-
 ...ot-maintain-a-backlog-sorted-list-of.patch |  2 +-
 ...add-rx-decapsulation-offload-support.patch | 18 +++
 ...le-QoS-support-for-nl80211-ctrl-port.patch |  6 +--
 ...pply-flow-control-on-management-fram.patch |  2 +-
 ...set-sk_pacing_shift-for-802.3-txpath.patch |  2 +-
 ...MPDU-session-check-from-minstrel_ht-.patch | 12 ++---
 ...eee80211_tx_h_rate_ctrl-when-dequeue.patch |  8 +--
 ...te-control-support-for-encap-offload.patch |  2 +-
 ...11-minstrel_ht-fix-sample-time-check.patch |  2 +-
 ...iwlwifi-specific-workaround-that-bro.patch | 51 ---
 ...rting-aggregation-sessions-on-mesh-i.patch |  2 +-
 .../500-mac80211_configure_antenna_gain.patch |  4 +-
 26 files changed, 73 insertions(+), 124 deletions(-)
 delete mode 100644 
package/kernel/mac80211/patches/subsys/378-mac80211-remove-iwlwifi-specific-workaround-that-bro.patch

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index dd9ec172ca..23711802e2 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
 
-PKG_VERSION:=5.10.42-1
+PKG_VERSION:=5.10.64-test1
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.42/
-PKG_HASH:=6876520105240844fdb32d1dcdf2bfdea291a37a96f16c892fda3776ba714fcb
+PKG_SOURCE_URL:=https://hauke-m.de/files/backports-test/
+PKG_HASH:=4b2e9e5a61cd0a4d766eb9859cc96719f0746954eca20d5f402d2f50fc7eb4af
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
diff --git a/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch 
b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch
index db10c45104..eacc72776e 100644
--- a/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch
+++ b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch
@@ -14,7 +14,7 @@
  CFLAGS_trace.o := -I$(src)
 --- a/drivers/net/wireless/ath/ath.h
 +++ b/drivers/net/wireless/ath/ath.h
-@@ -316,14 +316,7 @@ void _ath_dbg(struct ath_common *common,
+@@ -317,14 +317,7 @@ void _ath_dbg(struct ath_common *common,
  #endif /* CPTCFG_ATH_DEBUG */
  
  /** Returns string describing opmode, or NULL if unknown mode. */
diff --git a/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch 
b/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch
index f93a6fe5cd..138739cdd3 100644
--- a/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch
+++ b/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch
@@ -84,7 +84,7 @@
bool reset_power_on;
bool htc_reset_init;
  
-@@ -1076,6 +1084,7 @@ void ath9k_hw_check_nav(struct ath_hw *a
+@@ -1077,6 +1085,7 @@ void ath9k_hw_check_nav(struct ath_hw *a
  bool ath9k_hw_check_alive(struct ath_hw *ah);
  
  bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
@@ -125,7 +125,7 @@
REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, 
AR_BTCOEX_WL_LNADIV_FORCE_ON);
 --- a/drivers/net/wireless/ath/ath9k/main.c
 +++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -531,6 +531,11 @@ irqreturn_t ath_isr(int irq, void *dev)
+@@ -536,6 +536,11 @@ irqreturn_t ath_isr(int irq, void *dev)
if (test_bit(ATH_OP_HW_RESET, &common->op_flags))
return IRQ_HANDLED;
  
diff --git 
a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch 
b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
index acb9ad443c..c98222781d 100644
--- a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
+++ b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
@@ -339,7 +339,7 @@
  
  static void ath9k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop);
-@@ -652,6 +653,7 @@ void ath_reset_work(struct work_struct *
+@@ -657,6 +658,7 @@ void ath_reset_work(struct work_struct *
  static

[PATCH 19.07] wolfssl: update to 4.8.1-stable

2021-09-14 Thread Eneas U de Queiroz
From: Ivan Pavlov 

Changes from 4.7.0:
  Fix one high (OCSP verification issue) and two low vulnerabilities
  Improve compatibility layer
  Other improvements and fixes

For detailed changes refer to https://github.com/wolfSSL/wolfssl/releases

Signed-off-by: Ivan Pavlov 
(cherry picked from commit 7d92bb0509615550b98e2dc71091073c8258d564)
[Added patch to allow compilation with libtool 2.4]
Signed-off-by: Eneas U de Queiroz 
---
 package/libs/wolfssl/Makefile   |  4 ++--
 .../patches/100-disable-hardening-check.patch   |  2 +-
 .../patches/110-build-with-libtool-2.4.patch| 13 +
 3 files changed, 16 insertions(+), 3 deletions(-)
 create mode 100644 
package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch

diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile
index 57fcaa03b2..4940316f1b 100644
--- a/package/libs/wolfssl/Makefile
+++ b/package/libs/wolfssl/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wolfssl
-PKG_VERSION:=4.7.0-stable
+PKG_VERSION:=4.8.1-stable
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
-PKG_HASH:=b0e740b31d4d877d540ad50cc539a8873fc41af02bd3091c4357b403f7106e31
+PKG_HASH:=50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444
 
 PKG_FIXUP:=libtool
 PKG_INSTALL:=1
diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch 
b/package/libs/wolfssl/patches/100-disable-hardening-check.patch
index c89ff1be9d..4141e28750 100644
--- a/package/libs/wolfssl/patches/100-disable-hardening-check.patch
+++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch
@@ -1,6 +1,6 @@
 --- a/wolfssl/wolfcrypt/settings.h
 +++ b/wolfssl/wolfcrypt/settings.h
-@@ -2255,7 +2255,7 @@ extern void uITRON4_free(void *p) ;
+@@ -2274,7 +2274,7 @@ extern void uITRON4_free(void *p) ;
  #endif
  
  /* warning for not using harden build options (default with ./configure) */
diff --git a/package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch 
b/package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch
new file mode 100644
index 00..206c6dac6a
--- /dev/null
+++ b/package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch
@@ -0,0 +1,13 @@
+diff --git a/configure.ac b/configure.ac
+index 144c857e4..de7f6b45a 100644
+--- a/configure.ac
 b/configure.ac
+@@ -32,7 +32,7 @@ AC_ARG_PROGRAM
+ 
+ AC_CONFIG_HEADERS([config.h:config.in])
+ 
+-LT_PREREQ([2.4.2])
++LT_PREREQ([2.4])
+ LT_INIT([disable-static win32-dll])
+ 
+ #shared library versioning

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v3] arm-trusted-firmware-mvebu: CZ.NIC's Secure Firmware bump to v2021.09.07

2021-09-14 Thread Josef Schlehofer

On 14. 09. 21 20:21, Andre Heider wrote:
> On 14/09/2021 19:59, Hauke Mehrtens wrote:
>> On 9/14/21 10:50 AM, sean lee wrote:
>>> bump version and remove patches that have been applied
>>>
>>> 176d701 wtmi: Wait 1s after putting PHYs INTn pin low
>>> 2eeccfe wtmi: Change comment describing reset workaround
>>> e8c94a5 wtmi: Count RAM size from both CS0 and CS1
>>> 995979e wtmi: Rename macro
>>> e29eb29 wtmi: soc: Fix start_ap_workaround() for TF-A with debug
>>> 81245ed wtmi: Use constant name PLAT_MARVELL_MAILBOX_BASE
>>> 18ccb83 wtmi: Do a proper UART reset with clock change as described
>>> in spec
>>> 15ff106 avs: Validate VDD value from OTP
>>> 3f33626 fix: clock: a3700: change pwm clock for 600/600 and 1200/750
>>> preset
>>> fb5e436 wtmi: uart: fix UART baudrate divisor calculation
>>>
>>> Signed-off-by: sean lee 
>>> ---
>>>   .../boot/arm-trusted-firmware-mvebu/Makefile  |  4 +-
>>>   ...ix-UART-baudrate-divisor-calculation.patch | 66
>>> ---
>>>   ...change-pwm-clock-for-600-600-and-120.patch | 48 --
>>>   .../102-avs-Validate-VDD-value-from-OTP.patch | 52 ---
>>>   4 files changed, 2 insertions(+), 168 deletions(-)
>>>   delete mode 100644
>>> package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch
>>>
>>>   delete mode 100644
>>> package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-a3700-change-pwm-clock-for-600-600-and-120.patch
>>>
>>>   delete mode 100644
>>> package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/102-avs-Validate-VDD-value-from-OTP.patch
>>>
>>>
>>
>> Hi,
>>
>> This is a little bit unrelated.
>>
>> Is the source code of image/a3700-utils/wtptp/linux/tbb_linux
>> available   somewhere? I wanted to build mvebu/cortex53 on an aarch64
>> host system and this file is only available for x86_64 and the
>> compilation fails.
>
> Yeah, its source is bundled, and actually atf upstream recently
> switched to building it instead of using the checked in binary.
TBH, it was outdated, buggy and recent changes were not included in the
bundled library as said here
https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell/commit/f014428f4bf7feafec1dcc4c37506d847718649a
>
> Building it requires cryptocpp though, which doesn't yet exists as
> package. We don't really care about crypto since we're building just
> an untrusted firmware, so I opted to revert to using the binary
> instead. This is on top of the x86_64 binary toolchain too anyway.

This one:
https://github.com/BKPepe/openwrt/commit/42322bebc5804a99b60a5bb54200eeba0587076d
worked for me. But I didn't send it yet as I didn't do run-time testing
yet. I will do it soon.
>
> See package/boot/arm-trusted-firmware-mvebu/patches/001-imagetool.patch.
>
> If you get rid of that patch and add cryptocpp/host it should build it
> automatically and use that instead. But that still leaves the issue
> with the binary toolchain, no?
>
>>
>> Building flash image
>> /bin/sh: 1:
>> /home/ubuntu/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/a3700-utils/wtptp/linux/tbb_linux:
>> Exec format error
>> make[4]: *** [plat/marvell/armada/a3k/common/a3700_common.mk:186:
>> /home/ubuntu/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/trusted-firmware-a-espressobin-512mb/trusted-firmware-a-2.5/build/a3700/release/flash-image.bin]
>> Error 2
>>
>>
>> ubuntu@instance-20210910-2105:~/openwrt/openwrt$ file
>> /home/ubuntu/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/a3700-utils/wtptp/linux/tbb_linux
>>
>> /home/ubuntu/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/a3700-utils/wtptp/linux/tbb_linux:
>> ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically
>> linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux
>> 2.6.24, BuildID[sha1]=8169eedf6eef4b1993a65a180baee3d31660c000, with
>> debug_info, not stripped
>> ubuntu@instance-20210910-2105:~/openwrt/openwrt$ uname -a
>> Linux instance-20210910-2105 5.11.0-1017-oracle #18~20.04.1-Ubuntu
>> SMP Fri Aug 27 11:09:43 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
>> ubuntu@instance-20210910-2105:~/openwrt/openwrt$
>>
>> Hauke




OpenPGP_signature
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v3] arm-trusted-firmware-mvebu: CZ.NIC's Secure Firmware bump to v2021.09.07

2021-09-14 Thread Andre Heider

On 14/09/2021 19:59, Hauke Mehrtens wrote:

On 9/14/21 10:50 AM, sean lee wrote:

bump version and remove patches that have been applied

176d701 wtmi: Wait 1s after putting PHYs INTn pin low
2eeccfe wtmi: Change comment describing reset workaround
e8c94a5 wtmi: Count RAM size from both CS0 and CS1
995979e wtmi: Rename macro
e29eb29 wtmi: soc: Fix start_ap_workaround() for TF-A with debug
81245ed wtmi: Use constant name PLAT_MARVELL_MAILBOX_BASE
18ccb83 wtmi: Do a proper UART reset with clock change as described in 
spec

15ff106 avs: Validate VDD value from OTP
3f33626 fix: clock: a3700: change pwm clock for 600/600 and 1200/750 
preset

fb5e436 wtmi: uart: fix UART baudrate divisor calculation

Signed-off-by: sean lee 
---
  .../boot/arm-trusted-firmware-mvebu/Makefile  |  4 +-
  ...ix-UART-baudrate-divisor-calculation.patch | 66 ---
  ...change-pwm-clock-for-600-600-and-120.patch | 48 --
  .../102-avs-Validate-VDD-value-from-OTP.patch | 52 ---
  4 files changed, 2 insertions(+), 168 deletions(-)
  delete mode 100644 
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch 

  delete mode 100644 
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-a3700-change-pwm-clock-for-600-600-and-120.patch 

  delete mode 100644 
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/102-avs-Validate-VDD-value-from-OTP.patch 





Hi,

This is a little bit unrelated.

Is the source code of image/a3700-utils/wtptp/linux/tbb_linux available 
  somewhere? I wanted to build mvebu/cortex53 on an aarch64 host system 
and this file is only available for x86_64 and the compilation fails.


Yeah, its source is bundled, and actually atf upstream recently switched 
to building it instead of using the checked in binary.


Building it requires cryptocpp though, which doesn't yet exists as 
package. We don't really care about crypto since we're building just an 
untrusted firmware, so I opted to revert to using the binary instead. 
This is on top of the x86_64 binary toolchain too anyway.


See package/boot/arm-trusted-firmware-mvebu/patches/001-imagetool.patch.

If you get rid of that patch and add cryptocpp/host it should build it 
automatically and use that instead. But that still leaves the issue with 
the binary toolchain, no?




Building flash image
/bin/sh: 1: 
/home/ubuntu/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/a3700-utils/wtptp/linux/tbb_linux: 
Exec format error
make[4]: *** [plat/marvell/armada/a3k/common/a3700_common.mk:186: 
/home/ubuntu/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/trusted-firmware-a-espressobin-512mb/trusted-firmware-a-2.5/build/a3700/release/flash-image.bin] 
Error 2



ubuntu@instance-20210910-2105:~/openwrt/openwrt$ file 
/home/ubuntu/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/a3700-utils/wtptp/linux/tbb_linux 

/home/ubuntu/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/a3700-utils/wtptp/linux/tbb_linux: 
ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically 
linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, 
BuildID[sha1]=8169eedf6eef4b1993a65a180baee3d31660c000, with debug_info, 
not stripped

ubuntu@instance-20210910-2105:~/openwrt/openwrt$ uname -a
Linux instance-20210910-2105 5.11.0-1017-oracle #18~20.04.1-Ubuntu SMP 
Fri Aug 27 11:09:43 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

ubuntu@instance-20210910-2105:~/openwrt/openwrt$

Hauke



___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v3] arm-trusted-firmware-mvebu: CZ.NIC's Secure Firmware bump to v2021.09.07

2021-09-14 Thread Hauke Mehrtens

On 9/14/21 10:50 AM, sean lee wrote:

bump version and remove patches that have been applied

176d701 wtmi: Wait 1s after putting PHYs INTn pin low
2eeccfe wtmi: Change comment describing reset workaround
e8c94a5 wtmi: Count RAM size from both CS0 and CS1
995979e wtmi: Rename macro
e29eb29 wtmi: soc: Fix start_ap_workaround() for TF-A with debug
81245ed wtmi: Use constant name PLAT_MARVELL_MAILBOX_BASE
18ccb83 wtmi: Do a proper UART reset with clock change as described in spec
15ff106 avs: Validate VDD value from OTP
3f33626 fix: clock: a3700: change pwm clock for 600/600 and 1200/750 preset
fb5e436 wtmi: uart: fix UART baudrate divisor calculation

Signed-off-by: sean lee 
---
  .../boot/arm-trusted-firmware-mvebu/Makefile  |  4 +-
  ...ix-UART-baudrate-divisor-calculation.patch | 66 ---
  ...change-pwm-clock-for-600-600-and-120.patch | 48 --
  .../102-avs-Validate-VDD-value-from-OTP.patch | 52 ---
  4 files changed, 2 insertions(+), 168 deletions(-)
  delete mode 100644 
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch
  delete mode 100644 
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-a3700-change-pwm-clock-for-600-600-and-120.patch
  delete mode 100644 
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/102-avs-Validate-VDD-value-from-OTP.patch



Hi,

This is a little bit unrelated.

Is the source code of image/a3700-utils/wtptp/linux/tbb_linux available 
 somewhere? I wanted to build mvebu/cortex53 on an aarch64 host system 
and this file is only available for x86_64 and the compilation fails.


Building flash image
/bin/sh: 1: 
/home/ubuntu/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/a3700-utils/wtptp/linux/tbb_linux: 
Exec format error
make[4]: *** [plat/marvell/armada/a3k/common/a3700_common.mk:186: 
/home/ubuntu/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/trusted-firmware-a-espressobin-512mb/trusted-firmware-a-2.5/build/a3700/release/flash-image.bin] 
Error 2



ubuntu@instance-20210910-2105:~/openwrt/openwrt$ file 
/home/ubuntu/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/a3700-utils/wtptp/linux/tbb_linux
/home/ubuntu/openwrt/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/a3700-utils/wtptp/linux/tbb_linux: 
ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically 
linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, 
BuildID[sha1]=8169eedf6eef4b1993a65a180baee3d31660c000, with debug_info, 
not stripped

ubuntu@instance-20210910-2105:~/openwrt/openwrt$ uname -a
Linux instance-20210910-2105 5.11.0-1017-oracle #18~20.04.1-Ubuntu SMP 
Fri Aug 27 11:09:43 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

ubuntu@instance-20210910-2105:~/openwrt/openwrt$

Hauke

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 21.02 2/2] wolfssl: update to 4.8.1-stable

2021-09-14 Thread Eneas U de Queiroz
From: Ivan Pavlov 

Changes from 4.7.0:
  Fix one high (OCSP verification issue) and two low vulnerabilities
  Improve compatibility layer
  Other improvements and fixes

For detailed changes refer to https://github.com/wolfSSL/wolfssl/releases

Signed-off-by: Ivan Pavlov 
(cherry picked from commit 7d92bb0509615550b98e2dc71091073c8258d564)
[Added patch to allow compilation with libtool 2.4]
Signed-off-by: Eneas U de Queiroz 
---
 package/libs/wolfssl/Makefile   |  6 +++---
 ...m-change-asm-snippets-to-get-compiling.patch | 17 +
 .../patches/100-disable-hardening-check.patch   |  2 +-
 .../patches/110-build-with-libtool-2.4.patch| 13 +
 package/libs/wolfssl/patches/200-ecc-rng.patch  |  4 ++--
 5 files changed, 24 insertions(+), 18 deletions(-)
 create mode 100644 
package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch

diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile
index 030a0224f5..ba9ec44cd9 100644
--- a/package/libs/wolfssl/Makefile
+++ b/package/libs/wolfssl/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wolfssl
-PKG_VERSION:=4.7.0-stable
-PKG_RELEASE:=2
+PKG_VERSION:=4.8.1-stable
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
-PKG_HASH:=b0e740b31d4d877d540ad50cc539a8873fc41af02bd3091c4357b403f7106e31
+PKG_HASH:=50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444
 
 PKG_FIXUP:=libtool libtool-abiver
 PKG_INSTALL:=1
diff --git 
a/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch
 
b/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch
index 091b241285..763f9e8d06 100644
--- 
a/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch
+++ 
b/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch
@@ -13,8 +13,6 @@ SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD.
  wolfcrypt/src/sp_int.c |  6 +++---
  2 files changed, 23 insertions(+), 12 deletions(-)
 
-diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c
-index b7f53d073..a37e75e02 100644
 --- a/wolfcrypt/src/asm.c
 +++ b/wolfcrypt/src/asm.c
 @@ -698,33 +698,39 @@ __asm__( \
@@ -64,7 +62,7 @@ index b7f53d073..a37e75e02 100644
  
  #define SQRADDAC(i, j)\
  __asm__(  \
-@@ -733,7 +739,9 @@ __asm__(  \
+@@ -733,7 +739,9 @@ __asm__(
   "addl  %%eax,%0 \n\t"\
   "adcl  %%edx,%1 \n\t"\
   "adcl  $0,%2\n\t"\
@@ -75,7 +73,7 @@ index b7f53d073..a37e75e02 100644
  
  #define SQRADDDB  \
  __asm__(  \
-@@ -743,7 +751,10 @@ __asm__(  
\
+@@ -743,7 +751,10 @@ __asm__(
   "addl %6,%0 \n\t"\
   "adcl %7,%1 \n\t"\
   "adcl %8,%2 \n\t"\
@@ -87,11 +85,9 @@ index b7f53d073..a37e75e02 100644
  
  #elif defined(TFM_X86_64)
  /* x86-64 optimized */
-diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c
-index 6070faaa9..d26702e47 100644
 --- a/wolfcrypt/src/sp_int.c
 +++ b/wolfcrypt/src/sp_int.c
-@@ -477,7 +477,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, 
sp_int_digit lo,
+@@ -476,7 +476,7 @@ static WC_INLINE sp_int_digit sp_div_wor
  "addl %%eax, %[l] \n\t"\
  "adcl %%edx, %[h] \n\t"\
  "adcl $0   , %[o] \n\t"\
@@ -100,7 +96,7 @@ index 6070faaa9..d26702e47 100644
  : [a] "r" (va), [b] "r" (vb) \
  : "eax", "edx", "cc" \
  )
-@@ -503,7 +503,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, 
sp_int_digit lo,
+@@ -502,7 +502,7 @@ static WC_INLINE sp_int_digit sp_div_wor
  "addl %%eax, %[l] \n\t"\
  "adcl %%edx, %[h] \n\t"\
  "adcl $0   , %[o] \n\t"\
@@ -109,7 +105,7 @@ index 6070faaa9..d26702e47 100644
  : [a] "r" (va), [b] "r" (vb) \
  : "eax", "edx", "cc" \
  )
-@@ -542,7 +542,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, 
sp_int_digit lo,
+@@ -541,7 +541,7 @@ static WC_INLINE sp_int_digit sp_div_wor
  "addl %%eax, %[l] \n\t"\
  "adcl %%edx, %[h] \n\t"\
  "adcl $0   , %[o] \n\t"\
@@ -118,6 +114,3 @@ index 6070faaa9..d26702e47 100644
  : 

[PATCH 21.02 1/2] wolfssl: fix build with GCC 10 on 32 x86 targets

2021-09-14 Thread Eneas U de Queiroz
From: Stijn Tintel 

Backport upstream patch to fix build with GCC 10 on 32 x86 targets.

Signed-off-by: Stijn Tintel 
(cherry picked from commit 718a4f47806da8f68cb8f1fe2ebecf403e14ae96)
---
 ...change-asm-snippets-to-get-compiling.patch | 123 ++
 1 file changed, 123 insertions(+)
 create mode 100644 
package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch

diff --git 
a/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch
 
b/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch
new file mode 100644
index 00..091b241285
--- /dev/null
+++ 
b/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch
@@ -0,0 +1,123 @@
+From fa8f23284d4689c2a737204b337b58d966dcbd8c Mon Sep 17 00:00:00 2001
+From: Sean Parkinson 
+Date: Fri, 20 Aug 2021 10:23:38 +1000
+Subject: [PATCH] Maths x86 asm: change asm snippets to get compiling
+
+TFM:
+  Use register or memory for c0, c1, c2 in SQRADD and SQRADD2.
+SP:
+  Use register or memory for vl, vh, vo in SP_ASM_MUL_ADD,
+SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD.
+---
+ wolfcrypt/src/asm.c| 29 -
+ wolfcrypt/src/sp_int.c |  6 +++---
+ 2 files changed, 23 insertions(+), 12 deletions(-)
+
+diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c
+index b7f53d073..a37e75e02 100644
+--- a/wolfcrypt/src/asm.c
 b/wolfcrypt/src/asm.c
+@@ -698,33 +698,39 @@ __asm__( \
+ 
+ #define SQRADD(i, j)  \
+ __asm__(  \
+- "movl  %6,%%eax \n\t"\
++ "movl  %3,%%eax \n\t"\
+  "mull  %%eax\n\t"\
+  "addl  %%eax,%0 \n\t"\
+  "adcl  %%edx,%1 \n\t"\
+  "adcl  $0,%2\n\t"\
+- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) 
:"%eax","%edx","cc");
++ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \
++ : "m"(i) \
++ :"%eax","%edx","cc");
+ 
+ #define SQRADD2(i, j) \
+ __asm__(  \
+- "movl  %6,%%eax \n\t"\
+- "mull  %7   \n\t"\
++ "movl  %3,%%eax \n\t"\
++ "mull  %4   \n\t"\
+  "addl  %%eax,%0 \n\t"\
+  "adcl  %%edx,%1 \n\t"\
+  "adcl  $0,%2\n\t"\
+  "addl  %%eax,%0 \n\t"\
+  "adcl  %%edx,%1 \n\t"\
+  "adcl  $0,%2\n\t"\
+- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) 
 :"%eax","%edx", "cc");
++ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \
++ : "m"(i), "m"(j) \
++ :"%eax","%edx", "cc");
+ 
+ #define SQRADDSC(i, j)\
+-__asm__( \
++__asm__(  \
+  "movl  %3,%%eax \n\t"\
+  "mull  %4   \n\t"\
+  "movl  %%eax,%0 \n\t"\
+  "movl  %%edx,%1 \n\t"\
+  "xorl  %2,%2\n\t"\
+- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","cc");
++ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \
++ : "g"(i), "g"(j) \
++ :"%eax","%edx","cc");
+ 
+ #define SQRADDAC(i, j)\
+ __asm__(  \
+@@ -733,7 +739,9 @@ __asm__(  \
+  "addl  %%eax,%0 \n\t"\
+  "adcl  %%edx,%1 \n\t"\
+  "adcl  $0,%2\n\t"\
+- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), 
"g"(j) :"%eax","%edx","cc");
++ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \
++ : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j)   \
++ :"%eax","%edx","cc");
+ 
+ #define SQRADDDB  \
+ __asm__(  \
+@@ -743,7 +751,10 @@ __asm__(  
\
+  "addl %6,%0 \n\t"\
+  "adcl %7,%1 \n\t"   

[PATCH 21.02 0/2] wolfssl: bump to v4.8.1-stable

2021-09-14 Thread Eneas U de Queiroz
I've added a trivial patch to allow compilation with libtool 2.4,
currently used in 21.02.  I have not used a separate commit for that, to
not introduce a commit that does not build.  Let me know if I should
rather split this.

I'm cherry-picking a commit to allow compilation with gcc 10, to keep it
in sync with master.  While not the default, building with gcc 10 is an
option for 21.02.

Eneas

Ivan Pavlov (1):
  wolfssl: update to 4.8.1-stable

Stijn Tintel (1):
  wolfssl: fix build with GCC 10 on 32 x86 targets

 package/libs/wolfssl/Makefile |   6 +-
 ...change-asm-snippets-to-get-compiling.patch | 116 ++
 .../patches/100-disable-hardening-check.patch |   2 +-
 .../patches/110-build-with-libtool-2.4.patch  |  13 ++
 .../libs/wolfssl/patches/200-ecc-rng.patch|   4 +-
 5 files changed, 135 insertions(+), 6 deletions(-)
 create mode 100644 
package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch
 create mode 100644 
package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Openwrt 21 and lantiq_xrx200

2021-09-14 Thread Ivar Orskaug
Hi,
I tried to upgrade my ZyXEL P-2812HNU-F3 to OpenWrt 21.
Seems the kernel has grown somewhat from OpenWrt 19.
Kernel partition in master is only 2M, whereas the 21-image is ~2,4M.
The following patch accommodates for the bigger image:

diff --git 
a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts
b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts
index 12280241a5..01768d31d6 100644
--- 
a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts
+++ 
b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts
@@ -53,11 +53,11 @@

partition@0 {
label = "kernel";
-   reg = <0x0 0x20>;
+   reg = <0x0 0x28>;
};
partition@20 {
label = "ubi";
-   reg = <0x20 0x7e0>;
+   reg = <0x28 0x7d8>;
};
};
 };

Has anyone else managed to upgrade this device to 21 successfully?

/Ivar

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] arm-trusted-firmware-mvebu: CZ.NIC's Secure Firmware bump to v2021.09.07

2021-09-14 Thread sean lee
Thank you, Andre. I'v fixed it.

https://patchwork.ozlabs.org/project/openwrt/patch/meapr01mb3574140e649a556be964a3bec0...@meapr01mb3574.ausprd01.prod.outlook.com/

Regards,
Sean

On 2021/9/14 15:20, Andre Heider wrote:
> On 13/09/2021 10:44, sean lee wrote:
>> bump version and remove patches that have been applied
>>
>> 176d701 wtmi: Wait 1s after putting PHYs INTn pin low
>> 2eeccfe wtmi: Change comment describing reset workaround
>> e8c94a5 wtmi: Count RAM size from both CS0 and CS1
>> 995979e wtmi: Rename macro
>> e29eb29 wtmi: soc: Fix start_ap_workaround() for TF-A with debug
>> 81245ed wtmi: Use constant name PLAT_MARVELL_MAILBOX_BASE
>> 18ccb83 wtmi: Do a proper UART reset with clock change as described in spec
>> 15ff106 avs: Validate VDD value from OTP
>> 3f33626 fix: clock: a3700: change pwm clock for 600/600 and 1200/750 preset
>> fb5e436 wtmi: uart: fix UART baudrate divisor calculation
>>
>> Signed-off-by: sean lee 
> 
> Nice, but the patch seems misformatted and doesn't apply.
> 
> patchwork doesn't like it too, parts fail to parse:
> http://patchwork.ozlabs.org/project/openwrt/patch/meapr01mb3574e3f34ba95dc3e8802a9dc0...@meapr01mb3574.ausprd01.prod.outlook.com/
> 
> Cheers,
> Andre

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3] arm-trusted-firmware-mvebu: CZ.NIC's Secure Firmware bump to v2021.09.07

2021-09-14 Thread sean lee
bump version and remove patches that have been applied

176d701 wtmi: Wait 1s after putting PHYs INTn pin low
2eeccfe wtmi: Change comment describing reset workaround
e8c94a5 wtmi: Count RAM size from both CS0 and CS1
995979e wtmi: Rename macro
e29eb29 wtmi: soc: Fix start_ap_workaround() for TF-A with debug
81245ed wtmi: Use constant name PLAT_MARVELL_MAILBOX_BASE
18ccb83 wtmi: Do a proper UART reset with clock change as described in spec
15ff106 avs: Validate VDD value from OTP
3f33626 fix: clock: a3700: change pwm clock for 600/600 and 1200/750 preset
fb5e436 wtmi: uart: fix UART baudrate divisor calculation

Signed-off-by: sean lee 
---
 .../boot/arm-trusted-firmware-mvebu/Makefile  |  4 +-
 ...ix-UART-baudrate-divisor-calculation.patch | 66 ---
 ...change-pwm-clock-for-600-600-and-120.patch | 48 --
 .../102-avs-Validate-VDD-value-from-OTP.patch | 52 ---
 4 files changed, 2 insertions(+), 168 deletions(-)
 delete mode 100644 
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch
 delete mode 100644 
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-a3700-change-pwm-clock-for-600-600-and-120.patch
 delete mode 100644 
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/102-avs-Validate-VDD-value-from-OTP.patch

diff --git a/package/boot/arm-trusted-firmware-mvebu/Makefile 
b/package/boot/arm-trusted-firmware-mvebu/Makefile
index 2369a193..8836388b 100644
--- a/package/boot/arm-trusted-firmware-mvebu/Makefile
+++ b/package/boot/arm-trusted-firmware-mvebu/Makefile
@@ -149,13 +149,13 @@ define Download/mv-ddr-marvell
 endef
 
 MOX_BB_NAME:=mox-boot-builder
-MOX_BB_RELEASE:=v2021.04.09
+MOX_BB_RELEASE:=v2021.09.07
 MOX_BB_SOURCE:=$(MOX_BB_NAME)-$(MOX_BB_RELEASE).tar.bz2
 
 define Download/mox-boot-builder
   FILE:=$(MOX_BB_SOURCE)
   
URL:=https://gitlab.nic.cz/turris/mox-boot-builder/-/archive/$(MOX_BB_RELEASE)
-  HASH:=f0ed4fa25006e36a07d4256f633e3f25d6f8898dbe2e081e578251a182885520
+  HASH:=fd5fe276a3b0dee3177d61c017907a8eb23cd2169478fa78e9a3a836cfe3a4a8
 endef
 
 CM3_GCC_NAME:=gcc-arm
diff --git 
a/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch
 
b/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch
deleted file mode 100644
index 4bd66f91..
--- 
a/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From fb5e436843614f93b30aec0a2a00e5e59a133aab Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Marek=20Beh=C3=BAn?= 
-Date: Sat, 15 May 2021 17:44:24 +0200
-Subject: [PATCH] wtmi: uart: fix UART baudrate divisor calculation
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The UART code uses the xtal clock as parent for UART baudrate
-generation, but it assumes that xtal runs at 25 MHz, which isn't
-necessarily the case for all A3720 boards.
-
-Use get_ref_clk() to determine xtal clock rate.
-
-Use rounding division to compute the divisor value.
-
-Signed-off-by: Marek Behún 
-Suggested-by: Pali Rohár 

- wtmi/types.h | 5 +
- wtmi/uart.c  | 7 ---
- 2 files changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/wtmi/types.h b/wtmi/types.h
-index 7a6c6c6..ea873fc 100644
 a/wtmi/types.h
-+++ b/wtmi/types.h
-@@ -47,4 +47,9 @@ typedef u32  size_t;
- 
- #define maybe_unused __attribute__((unused))
- 
-+static inline u32 div_round_closest_u32(u32 x, u32 d)
-+{
-+  return (x + d / 2) / d;
-+}
-+
- #endif /* __TYPES_H */
-diff --git a/wtmi/uart.c b/wtmi/uart.c
-index d40633d..75864b5 100644
 a/wtmi/uart.c
-+++ b/wtmi/uart.c
-@@ -40,8 +40,6 @@
- #include "stdio.h"
- #include "debug.h"
- 
--#define UART_CLOCK_FREQ   25804800
--
- const struct uart_info uart1_info = {
-   .rx = 0xc0012000,
-   .tx = 0xc0012004,
-@@ -76,8 +74,11 @@ void uart_set_stdio(const struct uart_info *info)
- 
- void uart_reset(const struct uart_info *info, unsigned int baudrate)
- {
-+  u32 parent_rate = get_ref_clk() * 100;
-+
-   /* set baudrate */
--  writel((UART_CLOCK_FREQ / baudrate / 16), info->baud);
-+  writel(div_round_closest_u32(parent_rate, baudrate * 16), info->baud);
-+
-   /* set Programmable Oversampling Stack to 0, UART defaults to 16X 
scheme */
-   writel(0, info->possr);
- 
--- 
-2.30.2
-
diff --git 
a/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-a3700-change-pwm-clock-for-600-600-and-120.patch
 
b/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-a3700-change-pwm-clock-for-600-600-and-120.patch
deleted file mode 100644
index 6d74a053..
--- 
a/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-

[PATCH v2] arm-trusted-firmware-mvebu: CZ.NIC's Secure Firmware bump to v2021.09.07

2021-09-14 Thread sean lee
bump version and remove patches that have been applied

176d701 wtmi: Wait 1s after putting PHYs INTn pin low
2eeccfe wtmi: Change comment describing reset workaround
e8c94a5 wtmi: Count RAM size from both CS0 and CS1
995979e wtmi: Rename macro
e29eb29 wtmi: soc: Fix start_ap_workaround() for TF-A with debug
81245ed wtmi: Use constant name PLAT_MARVELL_MAILBOX_BASE
18ccb83 wtmi: Do a proper UART reset with clock change as described in spec
15ff106 avs: Validate VDD value from OTP
3f33626 fix: clock: a3700: change pwm clock for 600/600 and 1200/750 preset
fb5e436 wtmi: uart: fix UART baudrate divisor calculation

Signed-off-by: sean lee 
---
 .../boot/arm-trusted-firmware-mvebu/Makefile  |  4 +-
 ...ix-UART-baudrate-divisor-calculation.patch | 66 ---
 ...change-pwm-clock-for-600-600-and-120.patch | 48 --
 .../102-avs-Validate-VDD-value-from-OTP.patch | 52 ---
 4 files changed, 2 insertions(+), 168 deletions(-)
 delete mode 100644
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch
 delete mode 100644
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-a3700-change-pwm-clock-for-600-600-and-120.patch
 delete mode 100644
package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/102-avs-Validate-VDD-value-from-OTP.patch

diff --git a/package/boot/arm-trusted-firmware-mvebu/Makefile
b/package/boot/arm-trusted-firmware-mvebu/Makefile
index 2369a193..8836388b 100644
--- a/package/boot/arm-trusted-firmware-mvebu/Makefile
+++ b/package/boot/arm-trusted-firmware-mvebu/Makefile
@@ -149,13 +149,13 @@ define Download/mv-ddr-marvell
 endef

 MOX_BB_NAME:=mox-boot-builder
-MOX_BB_RELEASE:=v2021.04.09
+MOX_BB_RELEASE:=v2021.09.07
 MOX_BB_SOURCE:=$(MOX_BB_NAME)-$(MOX_BB_RELEASE).tar.bz2

 define Download/mox-boot-builder
   FILE:=$(MOX_BB_SOURCE)

URL:=https://gitlab.nic.cz/turris/mox-boot-builder/-/archive/$(MOX_BB_RELEASE)
-  HASH:=f0ed4fa25006e36a07d4256f633e3f25d6f8898dbe2e081e578251a182885520
+  HASH:=fd5fe276a3b0dee3177d61c017907a8eb23cd2169478fa78e9a3a836cfe3a4a8
 endef

 CM3_GCC_NAME:=gcc-arm
diff --git
a/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch
b/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch
deleted file mode 100644
index 4bd66f91..
---
a/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/100-wtmi-uart-fix-UART-baudrate-divisor-calculation.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From fb5e436843614f93b30aec0a2a00e5e59a133aab Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Marek=20Beh=C3=BAn?= 
-Date: Sat, 15 May 2021 17:44:24 +0200
-Subject: [PATCH] wtmi: uart: fix UART baudrate divisor calculation
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The UART code uses the xtal clock as parent for UART baudrate
-generation, but it assumes that xtal runs at 25 MHz, which isn't
-necessarily the case for all A3720 boards.
-
-Use get_ref_clk() to determine xtal clock rate.
-
-Use rounding division to compute the divisor value.
-
-Signed-off-by: Marek Behún 
-Suggested-by: Pali Rohár 

- wtmi/types.h | 5 +
- wtmi/uart.c  | 7 ---
- 2 files changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/wtmi/types.h b/wtmi/types.h
-index 7a6c6c6..ea873fc 100644
 a/wtmi/types.h
-+++ b/wtmi/types.h
-@@ -47,4 +47,9 @@ typedef u32  size_t;
-
- #define maybe_unused __attribute__((unused))
-
-+static inline u32 div_round_closest_u32(u32 x, u32 d)
-+{
-+  return (x + d / 2) / d;
-+}
-+
- #endif /* __TYPES_H */
-diff --git a/wtmi/uart.c b/wtmi/uart.c
-index d40633d..75864b5 100644
 a/wtmi/uart.c
-+++ b/wtmi/uart.c
-@@ -40,8 +40,6 @@
- #include "stdio.h"
- #include "debug.h"
-
--#define UART_CLOCK_FREQ   25804800
--
- const struct uart_info uart1_info = {
-   .rx = 0xc0012000,
-   .tx = 0xc0012004,
-@@ -76,8 +74,11 @@ void uart_set_stdio(const struct uart_info *info)
-
- void uart_reset(const struct uart_info *info, unsigned int baudrate)
- {
-+  u32 parent_rate = get_ref_clk() * 100;
-+
-   /* set baudrate */
--  writel((UART_CLOCK_FREQ / baudrate / 16), info->baud);
-+  writel(div_round_closest_u32(parent_rate, baudrate * 16), info->baud);
-+
-   /* set Programmable Oversampling Stack to 0, UART defaults to 16X
scheme */
-   writel(0, info->possr);
-
---
-2.30.2
-
diff --git
a/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-a3700-change-pwm-clock-for-600-600-and-120.patch
b/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-a3700-change-pwm-clock-for-600-600-and-120.patch
deleted file mode 100644
index 6d74a053..
---
a/package/boot/arm-trusted-firmware-mvebu/patches-mox-boot-builder/101-fix-clock-a3700-change-pwm-clock-fo

Re: [PATCH] arm-trusted-firmware-mvebu: CZ.NIC's Secure Firmware bump to v2021.09.07

2021-09-14 Thread Andre Heider

On 13/09/2021 10:44, sean lee wrote:

bump version and remove patches that have been applied

176d701 wtmi: Wait 1s after putting PHYs INTn pin low
2eeccfe wtmi: Change comment describing reset workaround
e8c94a5 wtmi: Count RAM size from both CS0 and CS1
995979e wtmi: Rename macro
e29eb29 wtmi: soc: Fix start_ap_workaround() for TF-A with debug
81245ed wtmi: Use constant name PLAT_MARVELL_MAILBOX_BASE
18ccb83 wtmi: Do a proper UART reset with clock change as described in spec
15ff106 avs: Validate VDD value from OTP
3f33626 fix: clock: a3700: change pwm clock for 600/600 and 1200/750 preset
fb5e436 wtmi: uart: fix UART baudrate divisor calculation

Signed-off-by: sean lee 


Nice, but the patch seems misformatted and doesn't apply.

patchwork doesn't like it too, parts fail to parse:
http://patchwork.ozlabs.org/project/openwrt/patch/meapr01mb3574e3f34ba95dc3e8802a9dc0...@meapr01mb3574.ausprd01.prod.outlook.com/

Cheers,
Andre

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel