From e43747c2e96b0c3449871dafe1bace2bc3e7310a Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Sat, 24 Oct 2020 18:45:41 +0200 Subject: [PATCH] ODROID N2+ fixes (#929) * Make sure to set board_rev for N2+ correctly For some reason the code to set the environment did not make it into the ODROID N2 board code. Fix the patch to correctly set board_rev for N2(+). Also remove the w400 patch as it is no longer required. * Use latest ODROID-N2+ patches Use the queued patches (and fixes) for upstream ODROID-N2+ support. This uses the clock settings from meson-g12b-a311d.dtsi running the CPUs at the following clocks: - 4xA73@2.2GHz - 2xA53@1.8GHz --- ...-dts-meson-convert-ODROID-N2-to-dtsi.patch | 35 ++++++----- ...amlogic-add-support-for-the-ODROID-N.patch | 17 +++-- ...-meson-add-support-for-the-ODROID-N2.patch | 63 +++++++------------ ...-dts-meson-add-missing-g12-rng-clock.patch | 38 +++++++++++ ...eson-odroid-n2-plus-fix-vddcpu_a-pwm.patch | 42 +++++++++++++ ...son-g12a-mark-fclk_div2-as-critical.patch} | 10 +-- ...-usb-cdc-acm-fix-cooldown-mechanism.patch} | 8 ++- ...RM-meson-isolate-loading-of-socinfo.patch} | 10 ++- ...Amlogic-w400-read-ethaddr-from-efuse.patch | 58 ----------------- ... => 0002-meson-Add-board_rev-to-env.patch} | 32 +++++----- 10 files changed, 161 insertions(+), 152 deletions(-) create mode 100644 buildroot-external/board/hardkernel/patches/linux/0004-arm64-dts-meson-add-missing-g12-rng-clock.patch create mode 100644 buildroot-external/board/hardkernel/patches/linux/0005-arm64-dts-meson-odroid-n2-plus-fix-vddcpu_a-pwm.patch rename buildroot-external/board/hardkernel/patches/linux/{0004-clk-meson-g12a-mark-fclk_div2-as-critical.patch => 0006-clk-meson-g12a-mark-fclk_div2-as-critical.patch} (74%) rename buildroot-external/board/hardkernel/patches/linux/{0001-usb-cdc-acm-fix-cooldown-mechanism.patch => 0007-usb-cdc-acm-fix-cooldown-mechanism.patch} (92%) rename buildroot-external/board/hardkernel/patches/uboot/{0002-ARM-meson-isolate-loading-of-socinfo.patch => 0001-ARM-meson-isolate-loading-of-socinfo.patch} (80%) delete mode 100644 buildroot-external/board/hardkernel/patches/uboot/0001-Amlogic-w400-read-ethaddr-from-efuse.patch rename buildroot-external/board/hardkernel/patches/uboot/{0003-meson-Add-board_rev-to-env.patch => 0002-meson-Add-board_rev-to-env.patch} (68%) diff --git a/buildroot-external/board/hardkernel/patches/linux/0001-arm64-dts-meson-convert-ODROID-N2-to-dtsi.patch b/buildroot-external/board/hardkernel/patches/linux/0001-arm64-dts-meson-convert-ODROID-N2-to-dtsi.patch index 5f2f534bc..60e770b0c 100644 --- a/buildroot-external/board/hardkernel/patches/linux/0001-arm64-dts-meson-convert-ODROID-N2-to-dtsi.patch +++ b/buildroot-external/board/hardkernel/patches/linux/0001-arm64-dts-meson-convert-ODROID-N2-to-dtsi.patch @@ -1,30 +1,32 @@ -From d35db3d5f943fea569dde8e83f15565254643385 Mon Sep 17 00:00:00 2001 -Message-Id: +From 734f52f38625ce29c964517255538b3b0b546e8d Mon Sep 17 00:00:00 2001 +Message-Id: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> From: Christian Hewitt -Date: Sun, 19 Jul 2020 14:10:32 +0000 -Subject: [PATCH 1/4] arm64: dts: meson: convert ODROID-N2 to dtsi +Date: Tue, 15 Sep 2020 17:24:30 +0200 +Subject: [PATCH 1/7] arm64: dts: meson: convert ODROID-N2 to dtsi Convert the current ODROID-N2 dts into a common dtsi in preparation for adding ODROID-N2+ support. Signed-off-by: Christian Hewitt -[rebased ontop of sound patches] -Signed-off-by: Stefan Agner +Signed-off-by: Neil Armstrong +Signed-off-by: Kevin Hilman +Acked-by: Neil Armstrong +Acked-by: Martin Blumenstingl +Link: https://lore.kernel.org/r/20200915152432.30616-2-narmstrong@baylibre.com --- - .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 619 +---------------- - .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 626 ++++++++++++++++++ - 2 files changed, 627 insertions(+), 618 deletions(-) + .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 618 +---------------- + .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 625 ++++++++++++++++++ + 2 files changed, 626 insertions(+), 617 deletions(-) create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts -index 34fffa6d859d..5fd51a87ae9b 100644 +index 34fffa6d859d..a198a91259ec 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts -@@ -6,626 +6,9 @@ - +@@ -7,625 +7,9 @@ /dts-v1/; --#include "meson-g12b-s922x.dtsi" + #include "meson-g12b-s922x.dtsi" -#include -#include -#include @@ -650,17 +652,16 @@ index 34fffa6d859d..5fd51a87ae9b 100644 }; diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi new file mode 100644 -index 000000000000..e5bc132ce7d5 +index 000000000000..6982632ae646 --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -@@ -0,0 +1,626 @@ +@@ -0,0 +1,625 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 BayLibre, SAS + * Author: Neil Armstrong + */ + -+#include "meson-g12b-s922x.dtsi" +#include +#include +#include @@ -1065,7 +1066,7 @@ index 000000000000..e5bc132ce7d5 + +&ext_mdio { + external_phy: ethernet-phy@0 { -+ /* Realtek RTL8211F (0x001cc916) */ ++ /* Realtek RTL8211F (0x001cc916) */ + reg = <0>; + max-speed = <1000>; + diff --git a/buildroot-external/board/hardkernel/patches/linux/0002-dt-bindings-arm-amlogic-add-support-for-the-ODROID-N.patch b/buildroot-external/board/hardkernel/patches/linux/0002-dt-bindings-arm-amlogic-add-support-for-the-ODROID-N.patch index 39ff63029..46e32f0cd 100644 --- a/buildroot-external/board/hardkernel/patches/linux/0002-dt-bindings-arm-amlogic-add-support-for-the-ODROID-N.patch +++ b/buildroot-external/board/hardkernel/patches/linux/0002-dt-bindings-arm-amlogic-add-support-for-the-ODROID-N.patch @@ -1,15 +1,20 @@ -From 4b9d9159ed5a79ceac5b831012b3cb44cce2516c Mon Sep 17 00:00:00 2001 -Message-Id: <4b9d9159ed5a79ceac5b831012b3cb44cce2516c.1602360581.git.stefan@agner.ch> -In-Reply-To: -References: +From 75f1e8330dac46a0bef8a360be0ae4566d9a470c Mon Sep 17 00:00:00 2001 +Message-Id: <75f1e8330dac46a0bef8a360be0ae4566d9a470c.1603528796.git.stefan@agner.ch> +In-Reply-To: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> +References: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> From: Christian Hewitt -Date: Sun, 19 Jul 2020 14:10:33 +0000 -Subject: [PATCH 2/4] dt-bindings: arm: amlogic: add support for the ODROID-N2+ +Date: Tue, 15 Sep 2020 17:24:31 +0200 +Subject: [PATCH 2/7] dt-bindings: arm: amlogic: add support for the ODROID-N2+ HardKernel ODROID-N2+ uses a revised Amlogic S922X v2 chip that supports higher cpu clock speeds than the original ODROID-N2. Signed-off-by: Christian Hewitt +Signed-off-by: Neil Armstrong +Signed-off-by: Kevin Hilman +Acked-by: Rob Herring +Acked-by: Martin Blumenstingl +Link: https://lore.kernel.org/r/20200915152432.30616-3-narmstrong@baylibre.com --- Documentation/devicetree/bindings/arm/amlogic.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/buildroot-external/board/hardkernel/patches/linux/0003-arm64-dts-meson-add-support-for-the-ODROID-N2.patch b/buildroot-external/board/hardkernel/patches/linux/0003-arm64-dts-meson-add-support-for-the-ODROID-N2.patch index 61a55fa7d..612b0d6b2 100644 --- a/buildroot-external/board/hardkernel/patches/linux/0003-arm64-dts-meson-add-support-for-the-ODROID-N2.patch +++ b/buildroot-external/board/hardkernel/patches/linux/0003-arm64-dts-meson-add-support-for-the-ODROID-N2.patch @@ -1,24 +1,27 @@ -From 81b5af6c3ce3e0f312be0897bec0b3c942e2ce97 Mon Sep 17 00:00:00 2001 -Message-Id: <81b5af6c3ce3e0f312be0897bec0b3c942e2ce97.1602360581.git.stefan@agner.ch> -In-Reply-To: -References: +From c714cb26fcb59f5201f7aac68dfd9883319881b2 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> +References: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> From: Christian Hewitt -Date: Sun, 19 Jul 2020 14:10:34 +0000 -Subject: [PATCH 3/4] arm64: dts: meson: add support for the ODROID-N2+ +Date: Tue, 15 Sep 2020 17:24:32 +0200 +Subject: [PATCH 3/7] arm64: dts: meson: add support for the ODROID-N2+ HardKernel ODROID-N2+ uses an Amlogic S922X rev. C chip capable of higher -clock speeds than the original ODROID-N2. Hardkernel supports the big cpu -cluster at 2.4GHz and the little cpu cluster at 2.0GHz. Opp points and -regulator changess are from the HardKernel Linux kernel sources. +clock speeds than the original ODROID-N2. + +The rev. C support a slighly higher VDDCPU_A & VDDCPU_B voltages and supports +the same OPPs as the Amlogic A311D SoC from the same G12B family. Suggested-by: Dongjin Kim Signed-off-by: Christian Hewitt -[Integrated Neil Armstrong's feedback from mailing list] -Signed-off-by: Stefan Agner +Signed-off-by: Neil Armstrong +Signed-off-by: Kevin Hilman +Acked-by: Martin Blumenstingl +Link: https://lore.kernel.org/r/20200915152432.30616-4-narmstrong@baylibre.com --- arch/arm64/boot/dts/amlogic/Makefile | 1 + - .../dts/amlogic/meson-g12b-odroid-n2-plus.dts | 53 +++++++++++++++++++ - 2 files changed, 54 insertions(+) + .../dts/amlogic/meson-g12b-odroid-n2-plus.dts | 31 +++++++++++++++++++ + 2 files changed, 32 insertions(+) create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2-plus.dts diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile @@ -35,10 +38,10 @@ index 4e2239ffcaa5..b0b3d6791499 100644 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nanopi-k2.dtb diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2-plus.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2-plus.dts new file mode 100644 -index 000000000000..4ebb448d233f +index 000000000000..5de2815ba99d --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2-plus.dts -@@ -0,0 +1,53 @@ +@@ -0,0 +1,31 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 BayLibre, SAS @@ -47,18 +50,20 @@ index 000000000000..4ebb448d233f + +/dts-v1/; + ++/* The Amlogic S922X Rev. C supports the same OPPs as the A311D variant */ ++#include "meson-g12b-a311d.dtsi" +#include "meson-g12b-odroid-n2.dtsi" + +/ { + compatible = "hardkernel,odroid-n2-plus", "amlogic,s922x", "amlogic,g12b"; -+ model = "Hardkernel ODROID-N2+"; ++ model = "Hardkernel ODROID-N2Plus"; +}; + +&vddcpu_a { + regulator-min-microvolt = <680000>; + regulator-max-microvolt = <1040000>; + -+ pwms = <&pwm_ab 0 1500 0>; ++ pwms = <&pwm_AO_cd 1 1500 0>; +}; + +&vddcpu_b { @@ -68,30 +73,6 @@ index 000000000000..4ebb448d233f + pwms = <&pwm_AO_cd 1 1500 0>; +}; + -+&cpu_opp_table_0 { -+ opp-1908000000 { -+ opp-hz = /bits/ 64 <1908000000>; -+ opp-microvolt = <1030000>; -+ }; -+ -+ opp-2016000000 { -+ opp-hz = /bits/ 64 <2016000000>; -+ opp-microvolt = <1040000>; -+ }; -+}; -+ -+&cpub_opp_table_1 { -+ opp-2304000000 { -+ opp-hz = /bits/ 64 <2304000000>; -+ opp-microvolt = <1030000>; -+ }; -+ -+ opp-2400000000 { -+ opp-hz = /bits/ 64 <2400000000>; -+ opp-microvolt = <1040000>; -+ }; -+}; -+ -- 2.28.0 diff --git a/buildroot-external/board/hardkernel/patches/linux/0004-arm64-dts-meson-add-missing-g12-rng-clock.patch b/buildroot-external/board/hardkernel/patches/linux/0004-arm64-dts-meson-add-missing-g12-rng-clock.patch new file mode 100644 index 000000000..37c58d4c4 --- /dev/null +++ b/buildroot-external/board/hardkernel/patches/linux/0004-arm64-dts-meson-add-missing-g12-rng-clock.patch @@ -0,0 +1,38 @@ +From f2eead311d9dd9ff7ee0846914147250d7711f98 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> +References: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> +From: Scott K Logan +Date: Fri, 25 Sep 2020 01:43:53 -0700 +Subject: [PATCH 4/7] arm64: dts: meson: add missing g12 rng clock + +This adds the missing perpheral clock for the RNG for Amlogic G12. As +stated in amlogic,meson-rng.yaml, this isn't always necessary for the +RNG to function, but is better to have in case the clock is disabled for +some reason prior to loading. + +Signed-off-by: Scott K Logan +Suggested-by: Neil Armstrong +Reviewed-by: Neil Armstrong +Signed-off-by: Kevin Hilman +Link: https://lore.kernel.org/r/520a1a8ec7a958b3d918d89563ec7e93a4100a45.camel@cottsay.net +--- + arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +index 1e83ec5b8c91..81f490e404ca 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +@@ -282,6 +282,8 @@ apb_efuse: bus@30000 { + hwrng: rng@218 { + compatible = "amlogic,meson-rng"; + reg = <0x0 0x218 0x0 0x4>; ++ clocks = <&clkc CLKID_RNG0>; ++ clock-names = "core"; + }; + }; + +-- +2.28.0 + diff --git a/buildroot-external/board/hardkernel/patches/linux/0005-arm64-dts-meson-odroid-n2-plus-fix-vddcpu_a-pwm.patch b/buildroot-external/board/hardkernel/patches/linux/0005-arm64-dts-meson-odroid-n2-plus-fix-vddcpu_a-pwm.patch new file mode 100644 index 000000000..c2aaf3e27 --- /dev/null +++ b/buildroot-external/board/hardkernel/patches/linux/0005-arm64-dts-meson-odroid-n2-plus-fix-vddcpu_a-pwm.patch @@ -0,0 +1,42 @@ +From 0a3a45efeefaf65c170df265126a07da3236e178 Mon Sep 17 00:00:00 2001 +Message-Id: <0a3a45efeefaf65c170df265126a07da3236e178.1603528796.git.stefan@agner.ch> +In-Reply-To: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> +References: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> +From: Jerome Brunet +Date: Fri, 23 Oct 2020 11:41:39 +0200 +Subject: [PATCH 5/7] arm64: dts: meson: odroid-n2 plus: fix vddcpu_a pwm + +On the odroid N2 plus, cpufreq is not available due to an error on the cpu +regulators. vddcpu a and b get the same PWM. The one provided to vddcpu A +is incorrect. Because vddcpu B PWM is busy the regulator cannot register: + +> pwm-regulator regulator-vddcpu-b: Failed to get PWM: -16 + +Like on the odroid n2, use PWM A out of GPIOE_2 for vddcpu A to fix the +problem + +Fixes: 98d24896ee11 ("arm64: dts: meson: add support for the ODROID-N2+") +Signed-off-by: Jerome Brunet +Acked-by: Neil Armstrong +Signed-off-by: Kevin Hilman +Link: https://lore.kernel.org/r/20201023094139.809379-1-jbrunet@baylibre.com +--- + arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2-plus.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2-plus.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2-plus.dts +index 5de2815ba99d..ce1198ad34e4 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2-plus.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2-plus.dts +@@ -19,7 +19,7 @@ &vddcpu_a { + regulator-min-microvolt = <680000>; + regulator-max-microvolt = <1040000>; + +- pwms = <&pwm_AO_cd 1 1500 0>; ++ pwms = <&pwm_ab 0 1500 0>; + }; + + &vddcpu_b { +-- +2.28.0 + diff --git a/buildroot-external/board/hardkernel/patches/linux/0004-clk-meson-g12a-mark-fclk_div2-as-critical.patch b/buildroot-external/board/hardkernel/patches/linux/0006-clk-meson-g12a-mark-fclk_div2-as-critical.patch similarity index 74% rename from buildroot-external/board/hardkernel/patches/linux/0004-clk-meson-g12a-mark-fclk_div2-as-critical.patch rename to buildroot-external/board/hardkernel/patches/linux/0006-clk-meson-g12a-mark-fclk_div2-as-critical.patch index dcd0d723c..9d2813920 100644 --- a/buildroot-external/board/hardkernel/patches/linux/0004-clk-meson-g12a-mark-fclk_div2-as-critical.patch +++ b/buildroot-external/board/hardkernel/patches/linux/0006-clk-meson-g12a-mark-fclk_div2-as-critical.patch @@ -1,10 +1,10 @@ -From 6a7c42785788faa862aeb7902cb2b3b08f033ca0 Mon Sep 17 00:00:00 2001 -Message-Id: <6a7c42785788faa862aeb7902cb2b3b08f033ca0.1602360581.git.stefan@agner.ch> -In-Reply-To: -References: +From 03041630d824a775b71f6008067955a51d069845 Mon Sep 17 00:00:00 2001 +Message-Id: <03041630d824a775b71f6008067955a51d069845.1603528796.git.stefan@agner.ch> +In-Reply-To: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> +References: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> From: Stefan Agner Date: Thu, 27 Aug 2020 23:29:57 +0200 -Subject: [PATCH 4/4] clk: meson: g12a: mark fclk_div2 as critical +Subject: [PATCH 6/7] clk: meson: g12a: mark fclk_div2 as critical On Amlogic Meson G12b platform, similar to fclk_div3, the fclk_div2 seems to be necessary for the system to operate correctly as well. diff --git a/buildroot-external/board/hardkernel/patches/linux/0001-usb-cdc-acm-fix-cooldown-mechanism.patch b/buildroot-external/board/hardkernel/patches/linux/0007-usb-cdc-acm-fix-cooldown-mechanism.patch similarity index 92% rename from buildroot-external/board/hardkernel/patches/linux/0001-usb-cdc-acm-fix-cooldown-mechanism.patch rename to buildroot-external/board/hardkernel/patches/linux/0007-usb-cdc-acm-fix-cooldown-mechanism.patch index af192c5c1..22a112078 100644 --- a/buildroot-external/board/hardkernel/patches/linux/0001-usb-cdc-acm-fix-cooldown-mechanism.patch +++ b/buildroot-external/board/hardkernel/patches/linux/0007-usb-cdc-acm-fix-cooldown-mechanism.patch @@ -1,8 +1,10 @@ -From f6fce2e974fe091fd233301bd7c127ca18304039 Mon Sep 17 00:00:00 2001 -Message-Id: +From 2c5d0244cbd6727f0e56bd6607b3a1b18ce27a3e Mon Sep 17 00:00:00 2001 +Message-Id: <2c5d0244cbd6727f0e56bd6607b3a1b18ce27a3e.1603528796.git.stefan@agner.ch> +In-Reply-To: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> +References: <734f52f38625ce29c964517255538b3b0b546e8d.1603528796.git.stefan@agner.ch> From: Jerome Brunet Date: Mon, 19 Oct 2020 19:07:02 +0200 -Subject: [PATCH] usb: cdc-acm: fix cooldown mechanism +Subject: [PATCH 7/7] usb: cdc-acm: fix cooldown mechanism Commit a4e7279cd1d1 ("cdc-acm: introduce a cool down") is causing regression if there is some USB error, such as -EPROTO. diff --git a/buildroot-external/board/hardkernel/patches/uboot/0002-ARM-meson-isolate-loading-of-socinfo.patch b/buildroot-external/board/hardkernel/patches/uboot/0001-ARM-meson-isolate-loading-of-socinfo.patch similarity index 80% rename from buildroot-external/board/hardkernel/patches/uboot/0002-ARM-meson-isolate-loading-of-socinfo.patch rename to buildroot-external/board/hardkernel/patches/uboot/0001-ARM-meson-isolate-loading-of-socinfo.patch index f56c44c2d..3823b8665 100644 --- a/buildroot-external/board/hardkernel/patches/uboot/0002-ARM-meson-isolate-loading-of-socinfo.patch +++ b/buildroot-external/board/hardkernel/patches/uboot/0001-ARM-meson-isolate-loading-of-socinfo.patch @@ -1,10 +1,8 @@ -From c67fb4dbb332ed38bc7fbee13079e5ea11390f4e Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: +From 698972869afda7095e31892c48051350788aa0a1 Mon Sep 17 00:00:00 2001 +Message-Id: <698972869afda7095e31892c48051350788aa0a1.1603550330.git.stefan@agner.ch> From: Stefan Agner Date: Mon, 31 Aug 2020 13:40:18 +0200 -Subject: [PATCH 2/3] ARM: meson: isolate loading of socinfo +Subject: [PATCH 1/2] ARM: meson: isolate loading of socinfo Move loading of socinfo into a separate function so the value can be reused later. @@ -59,5 +57,5 @@ index 3abb27e03b..cfcd5bbd3b 100644 socinfo_to_soc_id(socinfo), socinfo_to_package_id(socinfo), -- -2.28.0 +2.29.1 diff --git a/buildroot-external/board/hardkernel/patches/uboot/0001-Amlogic-w400-read-ethaddr-from-efuse.patch b/buildroot-external/board/hardkernel/patches/uboot/0001-Amlogic-w400-read-ethaddr-from-efuse.patch deleted file mode 100644 index b6c2252d0..000000000 --- a/buildroot-external/board/hardkernel/patches/uboot/0001-Amlogic-w400-read-ethaddr-from-efuse.patch +++ /dev/null @@ -1,58 +0,0 @@ -From f40f83d023b2e1dd82e751aee35c1f0d386b8b4f Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pascal Vizeli -Date: Sat, 1 Feb 2020 20:55:39 +0000 -Subject: [PATCH 1/3] Amlogic w400: read ethaddr from efuse - -Signed-off-by: Pascal Vizeli ---- - board/amlogic/w400/w400.c | 27 ++++++++++++++++++++++++--- - 1 file changed, 24 insertions(+), 3 deletions(-) - -diff --git a/board/amlogic/w400/w400.c b/board/amlogic/w400/w400.c -index 47a51710dc..d74aab899a 100644 ---- a/board/amlogic/w400/w400.c -+++ b/board/amlogic/w400/w400.c -@@ -6,15 +6,36 @@ - - #include - #include --#include --#include --#include -+#include - #include -+#include - #include - -+#define EFUSE_MAC_OFFSET 20 -+#define EFUSE_MAC_SIZE 12 -+ - int misc_init_r(void) - { -+ u8 mac_addr[6]; -+ char efuse_mac_addr[EFUSE_MAC_SIZE], buff[3]; -+ ssize_t len; -+ - meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0); - -+ if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { -+ len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, -+ efuse_mac_addr, EFUSE_MAC_SIZE); -+ if (len != EFUSE_MAC_SIZE) -+ return 0; -+ -+ for (int i = 0; i < 6; i++){ -+ buff[0] = efuse_mac_addr[i * 2]; -+ buff[1] = efuse_mac_addr[i * 2 + 1]; -+ mac_addr[i] = simple_strtoul(buff, NULL, 16); -+ } -+ if(is_valid_ethaddr(mac_addr)) -+ eth_env_set_enetaddr("ethaddr", mac_addr); -+ } -+ - return 0; - } --- -2.28.0 - diff --git a/buildroot-external/board/hardkernel/patches/uboot/0003-meson-Add-board_rev-to-env.patch b/buildroot-external/board/hardkernel/patches/uboot/0002-meson-Add-board_rev-to-env.patch similarity index 68% rename from buildroot-external/board/hardkernel/patches/uboot/0003-meson-Add-board_rev-to-env.patch rename to buildroot-external/board/hardkernel/patches/uboot/0002-meson-Add-board_rev-to-env.patch index 23f46d6a6..b3f7e4c2d 100644 --- a/buildroot-external/board/hardkernel/patches/uboot/0003-meson-Add-board_rev-to-env.patch +++ b/buildroot-external/board/hardkernel/patches/uboot/0002-meson-Add-board_rev-to-env.patch @@ -1,17 +1,17 @@ -From bb86524d84909ffe5d1d6ff3afe41d26396ba561 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: +From 439e2a240062c4be21ac7879b130ef590106cdd8 Mon Sep 17 00:00:00 2001 +Message-Id: <439e2a240062c4be21ac7879b130ef590106cdd8.1603550497.git.stefan@agner.ch> +In-Reply-To: <698972869afda7095e31892c48051350788aa0a1.1603550497.git.stefan@agner.ch> +References: <698972869afda7095e31892c48051350788aa0a1.1603550497.git.stefan@agner.ch> From: Pascal Vizeli Date: Tue, 4 Aug 2020 13:50:57 +0000 -Subject: [PATCH 3/3] meson: Add board_rev to env +Subject: [PATCH 2/2] meson: Add board_rev to env Signed-off-by: Pascal Vizeli Signed-off-by: Stefan Agner --- arch/arm/include/asm/arch-meson/boot.h | 4 ++++ arch/arm/mach-meson/board-info.c | 12 ++++++++++++ - board/amlogic/w400/w400.c | 5 +++++ + board/amlogic/odroid-n2/odroid-n2.c | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/arch/arm/include/asm/arch-meson/boot.h b/arch/arm/include/asm/arch-meson/boot.h @@ -54,11 +54,11 @@ index cfcd5bbd3b..3ea7eb7251 100644 + /* Write SoC info */ + return snprintf(buff, buff_len, "%x", socinfo_to_minor(socinfo)); +} -diff --git a/board/amlogic/w400/w400.c b/board/amlogic/w400/w400.c -index d74aab899a..cb2e5edf5e 100644 ---- a/board/amlogic/w400/w400.c -+++ b/board/amlogic/w400/w400.c -@@ -10,6 +10,7 @@ +diff --git a/board/amlogic/odroid-n2/odroid-n2.c b/board/amlogic/odroid-n2/odroid-n2.c +index caf7fd6810..c2a191ba6a 100644 +--- a/board/amlogic/odroid-n2/odroid-n2.c ++++ b/board/amlogic/odroid-n2/odroid-n2.c +@@ -12,6 +12,7 @@ #include #include #include @@ -66,17 +66,17 @@ index d74aab899a..cb2e5edf5e 100644 #define EFUSE_MAC_OFFSET 20 #define EFUSE_MAC_SIZE 12 -@@ -20,6 +21,10 @@ int misc_init_r(void) - char efuse_mac_addr[EFUSE_MAC_SIZE], buff[3]; +@@ -23,6 +24,10 @@ int misc_init_r(void) + char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3]; ssize_t len; -+ if (meson_get_soc_rev(buff, sizeof(buff))) { -+ env_set("board_rev", buff); ++ if (meson_get_soc_rev(tmp, sizeof(tmp)) > 0) { ++ env_set("board_rev", tmp); + } + meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0); if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { -- -2.28.0 +2.29.1