diff --git a/AllWinner-Pine64-bits.patch b/AllWinner-PinePhone.patch similarity index 80% rename from AllWinner-Pine64-bits.patch rename to AllWinner-PinePhone.patch index 8ce13e7..cc13eac 100644 --- a/AllWinner-Pine64-bits.patch +++ b/AllWinner-PinePhone.patch @@ -1302,34 +1302,38 @@ Date: Thu, 9 Jul 2020 12:44:55 +0100 Subject: [PATCH 7/8] arm64: dts: allwinner: Add initial support for Pine64 PinePhone -At the moment PinePhone comes in two slightly incompatible variants: +At the moment PinePhone comes in three slightly incompatible variants: - 1.0: Early Developer Batch - 1.1: Braveheart Batch +- 1.2: Initial Production version This syncs the Pinephone DTs from Linux 5.8-rc1. Signed-off-by: Peter Robinson --- - arch/arm/dts/Makefile | 2 + + arch/arm/dts/Makefile | 3 + arch/arm/dts/sun50i-a64-pinephone-1.0.dts | 11 + arch/arm/dts/sun50i-a64-pinephone-1.1.dts | 11 + + arch/arm/dts/sun50i-a64-pinephone-1.2.dts | 40 +++++++++++++++++++++++ arch/arm/dts/sun50i-a64-pinephone.dtsi | 379 ++++++++++++++++++++++ - 4 files changed, 403 insertions(+) + 5 files changed, 403 insertions(+) create mode 100644 arch/arm/dts/sun50i-a64-pinephone-1.0.dts create mode 100644 arch/arm/dts/sun50i-a64-pinephone-1.1.dts + create mode 100644 arch/arm/dts/sun50i-a64-pinephone-1.2.dts create mode 100644 arch/arm/dts/sun50i-a64-pinephone.dtsi diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile -index cee10f533f..efaadeecf3 100644 +index f8f529435b..193f5c6138 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -597,6 +597,8 @@ dtb-$(CONFIG_MACH_SUN50I) += \ +@@ -608,6 +608,9 @@ dtb-$(CONFIG_MACH_SUN50I) += \ sun50i-a64-pine64-plus.dtb \ sun50i-a64-pine64.dtb \ sun50i-a64-pinebook.dtb \ + sun50i-a64-pinephone-1.0.dtb \ + sun50i-a64-pinephone-1.1.dtb \ ++ sun50i-a64-pinephone-1.2.dtb \ sun50i-a64-sopine-baseboard.dtb \ sun50i-a64-teres-i.dtb dtb-$(CONFIG_MACH_SUN9I) += \ @@ -1367,6 +1371,52 @@ index 0000000000..06a775c416 + model = "Pine64 PinePhone Braveheart (1.1)"; + compatible = "pine64,pinephone-1.1", "allwinner,sun50i-a64"; +}; +diff --git a/arch/arm/dts/sun50i-a64-pinephone-1.2.dts b/arch/arm/dts/sun50i-a64-pinephone-1.2.dts +new file mode 100644 +index 0000000000..a9f5b670c9 +--- /dev/null ++++ b/arch/arm/dts/sun50i-a64-pinephone-1.2.dts +@@ -0,0 +1,40 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++// Copyright (C) 2020 Ondrej Jirman ++ ++/dts-v1/; ++ ++#include "sun50i-a64-pinephone.dtsi" ++ ++/ { ++ model = "Pine64 PinePhone (1.2)"; ++ compatible = "pine64,pinephone-1.2", "allwinner,sun50i-a64"; ++}; ++ ++&backlight { ++ power-supply = <®_ldo_io0>; ++ /* ++ * PWM backlight circuit on this PinePhone revision was changed since 1.0, ++ * and the lowest PWM duty cycle that doesn't lead to backlight being off ++ * is around 10%. Duty cycle for the lowest brightness level also varries ++ * quite a bit between individual boards, so the lowest value here was ++ * chosen as a safe default. ++ */ ++ brightness-levels = < ++ 5000 5248 5506 5858 6345 ++ 6987 7805 8823 10062 11543 ++ 13287 15317 17654 20319 23336 ++ 26724 30505 34702 39335 44427 ++ 50000 ++ >; ++ num-interpolated-steps = <50>; ++ default-brightness-level = <500>; ++}; ++ ++&lis3mdl { ++ /* ++ * Board revision 1.2 fixed routing of the interrupt to DRDY pin, ++ * enable interrupts. ++ */ ++ interrupt-parent = <&pio>; ++ interrupts = <1 1 IRQ_TYPE_EDGE_RISING>; /* PB1 */ ++}; diff --git a/arch/arm/dts/sun50i-a64-pinephone.dtsi b/arch/arm/dts/sun50i-a64-pinephone.dtsi new file mode 100644 index 0000000000..cefda145c3 @@ -1796,7 +1846,7 @@ new file mode 100644 index 0000000000..d5750aa954 --- /dev/null +++ b/configs/pinephone_defconfig -@@ -0,0 +1,38 @@ +@@ -0,0 +1,39 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_SPL=y @@ -1811,8 +1861,9 @@ index 0000000000..d5750aa954 +# CONFIG_SPL_SPI_SUNXI is not set +# CONFIG_SPL_DOS_PARTITION is not set +# CONFIG_SPL_EFI_PARTITION is not set -+CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinephone-1.1" -+CONFIG_OF_LIST="sun50i-a64-pinephone-1.1 sun50i-a64-pinephone-1.0" ++CONFIG_PINEPHONE_DT_SELECTION=y ++CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinephone-1.2" ++CONFIG_OF_LIST=" sun50i-a64-pinephone-1.2 sun50i-a64-pinephone-1.1 sun50i-a64-pinephone-1.0" +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_FIXED=y @@ -1837,541 +1888,3 @@ index 0000000000..d5750aa954 +# CONFIG_DM_SPI_FLASH is not set -- 2.26.2 -From 163b30d9cd1c0cf77107e0330567bbda063410da Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Tue, 14 Apr 2020 09:51:44 +0100 -Subject: [PATCH 8/9] Initial PineTab dts from linux 5.7-rc1 - -Signed-off-by: Peter Robinson ---- - arch/arm/dts/Makefile | 1 + - arch/arm/dts/sun50i-a64-pinetab.dts | 460 ++++++++++++++++++++++++++++ - 2 files changed, 461 insertions(+) - create mode 100644 arch/arm/dts/sun50i-a64-pinetab.dts - -diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile -index fb7516ee83..50c1d48e84 100644 ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -575,6 +575,7 @@ dtb-$(CONFIG_MACH_SUN50I) += \ - sun50i-a64-pinebook.dtb \ - sun50i-a64-pinephone-1.0.dtb \ - sun50i-a64-pinephone-1.1.dtb \ -+ sun50i-a64-pinetab.dtb \ - sun50i-a64-sopine-baseboard.dtb \ - sun50i-a64-teres-i.dtb - dtb-$(CONFIG_MACH_SUN9I) += \ -diff --git a/arch/arm/dts/sun50i-a64-pinetab.dts b/arch/arm/dts/sun50i-a64-pinetab.dts -new file mode 100644 -index 0000000000..316e8a4439 ---- /dev/null -+++ b/arch/arm/dts/sun50i-a64-pinetab.dts -@@ -0,0 +1,460 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (C) 2019 Icenowy Zheng -+ * -+ */ -+ -+/dts-v1/; -+ -+#include "sun50i-a64.dtsi" -+#include "sun50i-a64-cpu-opp.dtsi" -+ -+#include -+#include -+#include -+ -+/ { -+ model = "PineTab"; -+ compatible = "pine64,pinetab", "allwinner,sun50i-a64"; -+ -+ aliases { -+ serial0 = &uart0; -+ ethernet0 = &rtl8723cs; -+ }; -+ -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 16 18 20 22 24 26 29 32 35 38 42 46 51 56 62 68 75 83 91 100>; -+ default-brightness-level = <15>; -+ enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */ -+ power-supply = <&vdd_bl>; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ i2c-csi { -+ compatible = "i2c-gpio"; -+ sda-gpios = <&pio 4 13 GPIO_ACTIVE_HIGH>; /* PE13 */ -+ scl-gpios = <&pio 4 12 GPIO_ACTIVE_HIGH>; /* PE12 */ -+ i2c-gpio,delay-us = <5>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ /* Rear camera */ -+ ov5640: camera@3c { -+ compatible = "ovti,ov5640"; -+ reg = <0x3c>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&csi_mclk_pin>; -+ clocks = <&ccu CLK_CSI_MCLK>; -+ clock-names = "xclk"; -+ -+ AVDD-supply = <®_dldo3>; -+ DOVDD-supply = <®_aldo1>; -+ DVDD-supply = <®_eldo3>; -+ reset-gpios = <&pio 4 14 GPIO_ACTIVE_LOW>; /* PE14 */ -+ powerdown-gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; /* PE15 */ -+ -+ port { -+ ov5640_ep: endpoint { -+ remote-endpoint = <&csi_ep>; -+ bus-width = <8>; -+ hsync-active = <1>; /* Active high */ -+ vsync-active = <0>; /* Active low */ -+ data-active = <1>; /* Active high */ -+ pclk-sample = <1>; /* Rising */ -+ }; -+ }; -+ }; -+ }; -+ -+ speaker_amp: audio-amplifier { -+ compatible = "simple-audio-amplifier"; -+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ -+ sound-name-prefix = "Speaker Amp"; -+ }; -+ -+ vdd_bl: regulator@0 { -+ compatible = "regulator-fixed"; -+ regulator-name = "bl-3v3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ -+ enable-active-high; -+ }; -+ -+ wifi_pwrseq: wifi_pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ -+ post-power-on-delay-ms = <200>; -+ }; -+}; -+ -+&codec { -+ status = "okay"; -+}; -+ -+&codec_analog { -+ hpvcc-supply = <®_eldo1>; -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ -+&cpu1 { -+ cpu-supply = <®_dcdc2>; -+}; -+ -+&cpu2 { -+ cpu-supply = <®_dcdc2>; -+}; -+ -+&cpu3 { -+ cpu-supply = <®_dcdc2>; -+}; -+ -+&csi { -+ status = "okay"; -+ -+ port { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ csi_ep: endpoint { -+ remote-endpoint = <&ov5640_ep>; -+ bus-width = <8>; -+ hsync-active = <1>; /* Active high */ -+ vsync-active = <0>; /* Active low */ -+ data-active = <1>; /* Active high */ -+ pclk-sample = <1>; /* Rising */ -+ }; -+ }; -+}; -+ -+&dai { -+ status = "okay"; -+}; -+ -+&de { -+ status = "okay"; -+}; -+ -+&dphy { -+ status = "okay"; -+}; -+ -+&dsi { -+ vcc-dsi-supply = <®_dldo1>; -+ status = "okay"; -+ -+ panel@0 { -+ compatible = "feixin,k101-im2ba02"; -+ reg = <0>; -+ avdd-supply = <®_dc1sw>; -+ dvdd-supply = <®_dc1sw>; -+ cvdd-supply = <®_ldo_io1>; -+ reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ -+ backlight = <&backlight>; -+ }; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&i2c0 { -+ status = "okay"; -+ -+ touchscreen@5d { -+ compatible = "goodix,gt9271"; -+ reg = <0x5d>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */ -+ irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ reset-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */ -+ AVDD28-supply = <®_ldo_io1>; -+ }; -+}; -+ -+&i2c0_pins { -+ bias-pull-up; -+}; -+ -+&i2c1 { -+ status = "okay"; -+ -+ /* TODO: add Bochs BMA223 accelerometer here */ -+}; -+ -+&lradc { -+ vref-supply = <®_aldo3>; -+ status = "okay"; -+ -+ button-200 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <200000>; -+ }; -+ -+ button-400 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <400000>; -+ }; -+}; -+ -+&mixer1 { -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins>; -+ vmmc-supply = <®_dcdc1>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; -+ disable-wp; -+ bus-width = <4>; -+ status = "okay"; -+}; -+ -+&mmc1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc1_pins>; -+ vmmc-supply = <®_dldo4>; -+ vqmmc-supply = <®_eldo1>; -+ mmc-pwrseq = <&wifi_pwrseq>; -+ bus-width = <4>; -+ non-removable; -+ status = "okay"; -+ -+ rtl8723cs: wifi@1 { -+ reg = <1>; -+ }; -+}; -+ -+&mmc2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc2_pins>; -+ vmmc-supply = <®_dcdc1>; -+ vqmmc-supply = <®_dcdc1>; -+ bus-width = <8>; -+ non-removable; -+ cap-mmc-hw-reset; -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&pwm { -+ status = "okay"; -+}; -+ -+&r_rsb { -+ status = "okay"; -+ -+ axp803: pmic@3a3 { -+ compatible = "x-powers,axp803"; -+ reg = <0x3a3>; -+ interrupt-parent = <&r_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ x-powers,drive-vbus-en; -+ }; -+}; -+ -+#include "axp803.dtsi" -+ -+&ac_power_supply { -+ status = "okay"; -+}; -+ -+&battery_power_supply { -+ status = "okay"; -+}; -+ -+®_aldo1 { -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ regulator-name = "dovdd-csi"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pl"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dc1sw { -+ regulator-name = "vcc-lcd"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-3v3"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1300000>; -+ regulator-name = "vdd-cpux"; -+}; -+ -+/* DCDC3 is polyphased with DCDC2 */ -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1200000>; -+ regulator-max-microvolt = <1200000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dcdc6 { -+ regulator-always-on; -+ regulator-min-microvolt = <1100000>; -+ regulator-max-microvolt = <1100000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-hdmi-dsi-sensor"; -+}; -+ -+®_dldo3 { -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ regulator-name = "avdd-csi"; -+}; -+ -+®_dldo4 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+®_drivevbus { -+ regulator-name = "usb0-vbus"; -+ status = "okay"; -+}; -+ -+®_eldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "cpvdd"; -+}; -+ -+®_eldo2 { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "vcca-1v8"; -+}; -+ -+®_eldo3 { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "dvdd-1v8-csi"; -+}; -+ -+®_fldo1 { -+ regulator-min-microvolt = <1200000>; -+ regulator-max-microvolt = <1200000>; -+ regulator-name = "vcc-1v2-hsic"; -+}; -+ -+®_fldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1100000>; -+ regulator-max-microvolt = <1100000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_ldo_io0 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-usb"; -+ status = "okay"; -+}; -+ -+®_ldo_io1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-enable-ramp-delay = <3500000>; -+ regulator-name = "vcc-touchscreen"; -+ status = "okay"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ -+&sound { -+ status = "okay"; -+ simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>; -+ simple-audio-card,widgets = "Microphone", "Internal Microphone Left", -+ "Microphone", "Internal Microphone Right", -+ "Headphone", "Headphone Jack", -+ "Speaker", "Internal Speaker"; -+ simple-audio-card,routing = -+ "Left DAC", "AIF1 Slot 0 Left", -+ "Right DAC", "AIF1 Slot 0 Right", -+ "Speaker Amp INL", "LINEOUT", -+ "Speaker Amp INR", "LINEOUT", -+ "Internal Speaker", "Speaker Amp OUTL", -+ "Internal Speaker", "Speaker Amp OUTR", -+ "Headphone Jack", "HP", -+ "AIF1 Slot 0 Left ADC", "Left ADC", -+ "AIF1 Slot 0 Right ADC", "Right ADC", -+ "Internal Microphone Left", "MBIAS", -+ "MIC1", "Internal Microphone Left", -+ "Internal Microphone Right", "HBIAS", -+ "MIC2", "Internal Microphone Right"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pb_pins>; -+ status = "okay"; -+}; -+ -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_drivevbus>; -+ usb1_vbus-supply = <®_ldo_io0>; -+ status = "okay"; -+}; --- -2.26.0 - -From 6bf15552c2b6becb48ce7732120e0ddb2078cb1a Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Tue, 14 Apr 2020 09:53:07 +0100 -Subject: [PATCH 9/9] initial pinetab support - -Signed-off-by: Peter Robinson ---- - configs/pinetab_defconfig | 26 ++++++++++++++++++++++++++ - 1 file changed, 26 insertions(+) - create mode 100644 configs/pinetab_defconfig - -diff --git a/configs/pinetab_defconfig b/configs/pinetab_defconfig -new file mode 100644 -index 0000000000..5b9620f3e5 ---- /dev/null -+++ b/configs/pinetab_defconfig -@@ -0,0 +1,26 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_SUNXI=y -+CONFIG_SPL=y -+CONFIG_MACH_SUN50I=y -+CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y -+CONFIG_DRAM_CLK=552 -+CONFIG_DRAM_ZQ=3881949 -+CONFIG_MMC_SUNXI_SLOT_EXTRA=2 -+CONFIG_R_I2C_ENABLE=y -+CONFIG_SPL_SPI_SUNXI=y -+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set -+CONFIG_USE_PREBOOT=y -+# CONFIG_SPL_DOS_PARTITION is not set -+# CONFIG_SPL_EFI_PARTITION is not set -+CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinetab" -+CONFIG_OF_LIST="sun50i-a64-pinetab" -+CONFIG_SYS_RELOC_GD_ENV_ADDR=y -+CONFIG_DM_REGULATOR=y -+CONFIG_DM_REGULATOR_FIXED=y -+CONFIG_DM_PWM=y -+CONFIG_PWM_SUNXI=y -+CONFIG_LED=y -+CONFIG_LED_GPIO=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_OHCI_HCD=y -+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y --- -2.26.0 diff --git a/AllWinner-PineTab.patch b/AllWinner-PineTab.patch new file mode 100644 index 0000000..ce569e7 --- /dev/null +++ b/AllWinner-PineTab.patch @@ -0,0 +1,538 @@ +From 9b10863bc8b14ca5463a95dd2c77555cfc68f326 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 9 Sep 2020 10:59:31 +0100 +Subject: [PATCH] Initial PineTab dts from linux 5.7-rc1 + +Signed-off-by: Peter Robinson +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun50i-a64-pinetab.dts | 460 ++++++++++++++++++++++++++++ + 2 files changed, 461 insertions(+) + create mode 100644 arch/arm/dts/sun50i-a64-pinetab.dts + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index 193f5c6138..57ef94450a 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -611,6 +611,7 @@ dtb-$(CONFIG_MACH_SUN50I) += \ + sun50i-a64-pinephone-1.0.dtb \ + sun50i-a64-pinephone-1.1.dtb \ + sun50i-a64-pinephone-1.2.dtb \ ++ sun50i-a64-pinetab.dtb \ + sun50i-a64-sopine-baseboard.dtb \ + sun50i-a64-teres-i.dtb + dtb-$(CONFIG_MACH_SUN9I) += \ +diff --git a/arch/arm/dts/sun50i-a64-pinetab.dts b/arch/arm/dts/sun50i-a64-pinetab.dts +new file mode 100644 +index 0000000000..316e8a4439 +--- /dev/null ++++ b/arch/arm/dts/sun50i-a64-pinetab.dts +@@ -0,0 +1,460 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2019 Icenowy Zheng ++ * ++ */ ++ ++/dts-v1/; ++ ++#include "sun50i-a64.dtsi" ++#include "sun50i-a64-cpu-opp.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ model = "PineTab"; ++ compatible = "pine64,pinetab", "allwinner,sun50i-a64"; ++ ++ aliases { ++ serial0 = &uart0; ++ ethernet0 = &rtl8723cs; ++ }; ++ ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; ++ brightness-levels = <0 16 18 20 22 24 26 29 32 35 38 42 46 51 56 62 68 75 83 91 100>; ++ default-brightness-level = <15>; ++ enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */ ++ power-supply = <&vdd_bl>; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ i2c-csi { ++ compatible = "i2c-gpio"; ++ sda-gpios = <&pio 4 13 GPIO_ACTIVE_HIGH>; /* PE13 */ ++ scl-gpios = <&pio 4 12 GPIO_ACTIVE_HIGH>; /* PE12 */ ++ i2c-gpio,delay-us = <5>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ /* Rear camera */ ++ ov5640: camera@3c { ++ compatible = "ovti,ov5640"; ++ reg = <0x3c>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&csi_mclk_pin>; ++ clocks = <&ccu CLK_CSI_MCLK>; ++ clock-names = "xclk"; ++ ++ AVDD-supply = <®_dldo3>; ++ DOVDD-supply = <®_aldo1>; ++ DVDD-supply = <®_eldo3>; ++ reset-gpios = <&pio 4 14 GPIO_ACTIVE_LOW>; /* PE14 */ ++ powerdown-gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; /* PE15 */ ++ ++ port { ++ ov5640_ep: endpoint { ++ remote-endpoint = <&csi_ep>; ++ bus-width = <8>; ++ hsync-active = <1>; /* Active high */ ++ vsync-active = <0>; /* Active low */ ++ data-active = <1>; /* Active high */ ++ pclk-sample = <1>; /* Rising */ ++ }; ++ }; ++ }; ++ }; ++ ++ speaker_amp: audio-amplifier { ++ compatible = "simple-audio-amplifier"; ++ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ ++ sound-name-prefix = "Speaker Amp"; ++ }; ++ ++ vdd_bl: regulator@0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "bl-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ ++ enable-active-high; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ ++ post-power-on-delay-ms = <200>; ++ }; ++}; ++ ++&codec { ++ status = "okay"; ++}; ++ ++&codec_analog { ++ hpvcc-supply = <®_eldo1>; ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ ++&cpu1 { ++ cpu-supply = <®_dcdc2>; ++}; ++ ++&cpu2 { ++ cpu-supply = <®_dcdc2>; ++}; ++ ++&cpu3 { ++ cpu-supply = <®_dcdc2>; ++}; ++ ++&csi { ++ status = "okay"; ++ ++ port { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ csi_ep: endpoint { ++ remote-endpoint = <&ov5640_ep>; ++ bus-width = <8>; ++ hsync-active = <1>; /* Active high */ ++ vsync-active = <0>; /* Active low */ ++ data-active = <1>; /* Active high */ ++ pclk-sample = <1>; /* Rising */ ++ }; ++ }; ++}; ++ ++&dai { ++ status = "okay"; ++}; ++ ++&de { ++ status = "okay"; ++}; ++ ++&dphy { ++ status = "okay"; ++}; ++ ++&dsi { ++ vcc-dsi-supply = <®_dldo1>; ++ status = "okay"; ++ ++ panel@0 { ++ compatible = "feixin,k101-im2ba02"; ++ reg = <0>; ++ avdd-supply = <®_dc1sw>; ++ dvdd-supply = <®_dc1sw>; ++ cvdd-supply = <®_ldo_io1>; ++ reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ ++ backlight = <&backlight>; ++ }; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ touchscreen@5d { ++ compatible = "goodix,gt9271"; ++ reg = <0x5d>; ++ interrupt-parent = <&pio>; ++ interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */ ++ irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ reset-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */ ++ AVDD28-supply = <®_ldo_io1>; ++ }; ++}; ++ ++&i2c0_pins { ++ bias-pull-up; ++}; ++ ++&i2c1 { ++ status = "okay"; ++ ++ /* TODO: add Bochs BMA223 accelerometer here */ ++}; ++ ++&lradc { ++ vref-supply = <®_aldo3>; ++ status = "okay"; ++ ++ button-200 { ++ label = "Volume Up"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <200000>; ++ }; ++ ++ button-400 { ++ label = "Volume Down"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <400000>; ++ }; ++}; ++ ++&mixer1 { ++ status = "okay"; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins>; ++ vmmc-supply = <®_dcdc1>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; ++ disable-wp; ++ bus-width = <4>; ++ status = "okay"; ++}; ++ ++&mmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc1_pins>; ++ vmmc-supply = <®_dldo4>; ++ vqmmc-supply = <®_eldo1>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ rtl8723cs: wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&mmc2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc2_pins>; ++ vmmc-supply = <®_dcdc1>; ++ vqmmc-supply = <®_dcdc1>; ++ bus-width = <8>; ++ non-removable; ++ cap-mmc-hw-reset; ++ status = "okay"; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&pwm { ++ status = "okay"; ++}; ++ ++&r_rsb { ++ status = "okay"; ++ ++ axp803: pmic@3a3 { ++ compatible = "x-powers,axp803"; ++ reg = <0x3a3>; ++ interrupt-parent = <&r_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ x-powers,drive-vbus-en; ++ }; ++}; ++ ++#include "axp803.dtsi" ++ ++&ac_power_supply { ++ status = "okay"; ++}; ++ ++&battery_power_supply { ++ status = "okay"; ++}; ++ ++®_aldo1 { ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ regulator-name = "dovdd-csi"; ++}; ++ ++®_aldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-pl"; ++}; ++ ++®_aldo3 { ++ regulator-always-on; ++ regulator-min-microvolt = <2700000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-pll-avcc"; ++}; ++ ++®_dc1sw { ++ regulator-name = "vcc-lcd"; ++}; ++ ++®_dcdc1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-3v3"; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1300000>; ++ regulator-name = "vdd-cpux"; ++}; ++ ++/* DCDC3 is polyphased with DCDC2 */ ++ ++®_dcdc5 { ++ regulator-always-on; ++ regulator-min-microvolt = <1200000>; ++ regulator-max-microvolt = <1200000>; ++ regulator-name = "vcc-dram"; ++}; ++ ++®_dcdc6 { ++ regulator-always-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1100000>; ++ regulator-name = "vdd-sys"; ++}; ++ ++®_dldo1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-hdmi-dsi-sensor"; ++}; ++ ++®_dldo3 { ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ regulator-name = "avdd-csi"; ++}; ++ ++®_dldo4 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-wifi"; ++}; ++ ++®_drivevbus { ++ regulator-name = "usb0-vbus"; ++ status = "okay"; ++}; ++ ++®_eldo1 { ++ regulator-always-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "cpvdd"; ++}; ++ ++®_eldo2 { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcca-1v8"; ++}; ++ ++®_eldo3 { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "dvdd-1v8-csi"; ++}; ++ ++®_fldo1 { ++ regulator-min-microvolt = <1200000>; ++ regulator-max-microvolt = <1200000>; ++ regulator-name = "vcc-1v2-hsic"; ++}; ++ ++®_fldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1100000>; ++ regulator-name = "vdd-cpus"; ++}; ++ ++®_ldo_io0 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-usb"; ++ status = "okay"; ++}; ++ ++®_ldo_io1 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-enable-ramp-delay = <3500000>; ++ regulator-name = "vcc-touchscreen"; ++ status = "okay"; ++}; ++ ++®_rtc_ldo { ++ regulator-name = "vcc-rtc"; ++}; ++ ++&sound { ++ status = "okay"; ++ simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>; ++ simple-audio-card,widgets = "Microphone", "Internal Microphone Left", ++ "Microphone", "Internal Microphone Right", ++ "Headphone", "Headphone Jack", ++ "Speaker", "Internal Speaker"; ++ simple-audio-card,routing = ++ "Left DAC", "AIF1 Slot 0 Left", ++ "Right DAC", "AIF1 Slot 0 Right", ++ "Speaker Amp INL", "LINEOUT", ++ "Speaker Amp INR", "LINEOUT", ++ "Internal Speaker", "Speaker Amp OUTL", ++ "Internal Speaker", "Speaker Amp OUTR", ++ "Headphone Jack", "HP", ++ "AIF1 Slot 0 Left ADC", "Left ADC", ++ "AIF1 Slot 0 Right ADC", "Right ADC", ++ "Internal Microphone Left", "MBIAS", ++ "MIC1", "Internal Microphone Left", ++ "Internal Microphone Right", "HBIAS", ++ "MIC2", "Internal Microphone Right"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pb_pins>; ++ status = "okay"; ++}; ++ ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ ++&usb_power_supply { ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */ ++ usb0_vbus_power-supply = <&usb_power_supply>; ++ usb0_vbus-supply = <®_drivevbus>; ++ usb1_vbus-supply = <®_ldo_io0>; ++ status = "okay"; ++}; +-- +2.26.2 + +From 6bf15552c2b6becb48ce7732120e0ddb2078cb1a Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Tue, 14 Apr 2020 09:53:07 +0100 +Subject: [PATCH 9/9] initial pinetab support + +Signed-off-by: Peter Robinson +--- + configs/pinetab_defconfig | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + create mode 100644 configs/pinetab_defconfig + +diff --git a/configs/pinetab_defconfig b/configs/pinetab_defconfig +new file mode 100644 +index 0000000000..5b9620f3e5 +--- /dev/null ++++ b/configs/pinetab_defconfig +@@ -0,0 +1,26 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_SPL=y ++CONFIG_MACH_SUN50I=y ++CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y ++CONFIG_DRAM_CLK=552 ++CONFIG_DRAM_ZQ=3881949 ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++CONFIG_R_I2C_ENABLE=y ++CONFIG_SPL_SPI_SUNXI=y ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_USE_PREBOOT=y ++# CONFIG_SPL_DOS_PARTITION is not set ++# CONFIG_SPL_EFI_PARTITION is not set ++CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinetab" ++CONFIG_OF_LIST="sun50i-a64-pinetab" ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_PWM=y ++CONFIG_PWM_SUNXI=y ++CONFIG_LED=y ++CONFIG_LED_GPIO=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_OHCI_HCD=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y +-- +2.26.0 diff --git a/PinePhone-automatic-device-tree-selection.patch b/PinePhone-automatic-device-tree-selection.patch new file mode 100644 index 0000000..ac2bac4 --- /dev/null +++ b/PinePhone-automatic-device-tree-selection.patch @@ -0,0 +1,1114 @@ +From patchwork Thu Sep 3 05:07:09 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Samuel Holland +X-Patchwork-Id: 1356315 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; + spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de + (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; + envelope-from=u-boot-bounces@lists.denx.de; receiver=) +Authentication-Results: ozlabs.org; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 + header.s=fm3 header.b=buHTSW+5; + dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.a=rsa-sha256 header.s=fm3 header.b=soUNU+zi; + dkim-atps=neutral +Received: from phobos.denx.de (phobos.denx.de + [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) + (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) + key-exchange X25519 server-signature RSA-PSS (4096 bits)) + (No client certificate requested) + by ozlabs.org (Postfix) with ESMTPS id 4Bhpk04dbHz9sTR + for ; Thu, 3 Sep 2020 15:08:40 +1000 (AEST) +Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) + by phobos.denx.de (Postfix) with ESMTP id B8046822FB; + Thu, 3 Sep 2020 07:07:34 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de +Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org + header.b="buHTSW+5"; dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.b="soUNU+zi"; dkim-atps=neutral +Received: by phobos.denx.de (Postfix, from userid 109) + id 5B11B822E1; Thu, 3 Sep 2020 07:07:27 +0200 (CEST) +X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de +X-Spam-Level: +X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, + DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, + SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no + version=3.4.2 +Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com + [66.111.4.26]) + (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by phobos.denx.de (Postfix) with ESMTPS id AF853822D8 + for ; Thu, 3 Sep 2020 07:07:19 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=samuel@sholland.org +Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) + by mailout.nyi.internal (Postfix) with ESMTP id 6D2045C0190; + Thu, 3 Sep 2020 01:07:18 -0400 (EDT) +Received: from mailfrontend2 ([10.202.2.163]) + by compute3.internal (MEProxy); Thu, 03 Sep 2020 01:07:18 -0400 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= + from:to:cc:subject:date:message-id:in-reply-to:references + :mime-version:content-transfer-encoding; s=fm3; bh=U4jA0nvRK7Czr + dgeNIS5gDY5tElSJ2feLLbT7NYhO6s=; b=buHTSW+5/tt6GjGA2vOU6Ivto0Cdk + fngE70LZVaDreoNlTLgMANhhiJzWyBYb3mjmMUR2EHBJeYNdzuOYpRL/hBztVsqa + B+hq24fQr6OsXlroOC+9DIkrBtgkfEXrmaHqyO9jP0/BBHQUHBAjJr6RkItNOJqs + tL5255/XbQw05IUwTN+fwQs+x1qtv9dPXiYVdELfBIhuTKSyQJaKqBLEO3mPFxRz + PIISy3OQi1lzdrJdmurLcp6DfbzqB9nJfuD0CtslCI1Bu09KsMgr7sn/mxITx0Vy + qyWz9p5t9Vr2A3xct652aED771i3Ra6UK+UYoSayMMMyCG4g+rb0DzJhQ== +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= + messagingengine.com; h=cc:content-transfer-encoding:date:from + :in-reply-to:message-id:mime-version:references:subject:to + :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= + fm3; bh=U4jA0nvRK7CzrdgeNIS5gDY5tElSJ2feLLbT7NYhO6s=; b=soUNU+zi + uXuVOTwtphqr7B11oSRvrTR5EMY1G0DCfVWT5s+K/e9h3V/TodXW0tbddWCX1Qhf + 2EbJfg61h8/UFqtAFCwuDtcIaxiykHsoFtLgyvzZrBQIoWF9LF/YDvRSmyDr1lyV + hY8s0GIVyKaAXjkwwoUEaknhWhGHrbVOeWZTWUnB9W1++iN+4uXoWlMohB72yOlk + 3TZ7XBSJLe2Nd4NxPuirhOfuGpWFLHiTQ/cSUcvZW+8DPmy+hZL/KNYEgY4NjN0I + uAZwnZNHCO2j+82cPGETrg4u4iziby3clWWhVNK04wJCiBfVWlkQgL5VP4ORJUzp + E1csDeRCXdGAgw== +X-ME-Sender: + +X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudegtddgleduucetufdoteggodetrfdotf + fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen + uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne + cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv + lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf + frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv + gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih + iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn + ugdrohhrgh +X-ME-Proxy: + + + +Received: from titanium.stl.sholland.net + (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) + by mail.messagingengine.com (Postfix) with ESMTPA id B6856306005E; + Thu, 3 Sep 2020 01:07:17 -0400 (EDT) +From: Samuel Holland +To: Jagan Teki , Maxime Ripard +Cc: Andre Przywara , + Peter Robinson , u-boot@lists.denx.de, + Samuel Holland +Subject: [PATCH 1/8] sunxi: board: Use a more descriptive variable name +Date: Thu, 3 Sep 2020 00:07:09 -0500 +Message-Id: <20200903050716.48488-2-samuel@sholland.org> +X-Mailer: git-send-email 2.26.2 +In-Reply-To: <20200903050716.48488-1-samuel@sholland.org> +References: <20200903050716.48488-1-samuel@sholland.org> +MIME-Version: 1.0 +X-BeenThere: u-boot@lists.denx.de +X-Mailman-Version: 2.1.34 +Precedence: list +List-Id: U-Boot discussion +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Errors-To: u-boot-bounces@lists.denx.de +Sender: "U-Boot" +X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de +X-Virus-Status: Clean + +The variable "cmp_str" always leaves me wondering if it is the DT name +of the current board (yes) or DT name in the FIT config entry (no). + +In preparation for expanding the functionality here, rename it to +something that obviously means "this is the DT name we are looking for". + +Signed-off-by: Samuel Holland +--- + board/sunxi/board.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/board/sunxi/board.c b/board/sunxi/board.c +index 71e2b758a3e..674e6816d2d 100644 +--- a/board/sunxi/board.c ++++ b/board/sunxi/board.c +@@ -892,14 +892,14 @@ int ft_board_setup(void *blob, struct bd_info *bd) + int board_fit_config_name_match(const char *name) + { + struct boot_file_head *spl = get_spl_header(SPL_DT_HEADER_VERSION); +- const char *cmp_str = (const char *)spl; ++ const char *best_dt_name = (const char *)spl; + + /* Check if there is a DT name stored in the SPL header and use that. */ + if (spl != INVALID_SPL_HEADER && spl->dt_name_offset) { +- cmp_str += spl->dt_name_offset; ++ best_dt_name += spl->dt_name_offset; + } else { + #ifdef CONFIG_DEFAULT_DEVICE_TREE +- cmp_str = CONFIG_DEFAULT_DEVICE_TREE; ++ best_dt_name = CONFIG_DEFAULT_DEVICE_TREE; + #else + return 0; + #endif +@@ -907,15 +907,15 @@ int board_fit_config_name_match(const char *name) + + #ifdef CONFIG_PINE64_DT_SELECTION + /* Differentiate the two Pine64 board DTs by their DRAM size. */ +- if (strstr(name, "-pine64") && strstr(cmp_str, "-pine64")) { ++ if (strstr(name, "-pine64") && strstr(best_dt_name, "-pine64")) { + if ((gd->ram_size > 512 * 1024 * 1024)) + return !strstr(name, "plus"); + else + return !!strstr(name, "plus"); + } else { +- return strcmp(name, cmp_str); ++ return strcmp(name, best_dt_name); + } + #endif +- return strcmp(name, cmp_str); ++ return strcmp(name, best_dt_name); + } + #endif + +From patchwork Thu Sep 3 05:07:10 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Samuel Holland +X-Patchwork-Id: 1356309 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; + spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de + (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; + envelope-from=u-boot-bounces@lists.denx.de; receiver=) +Authentication-Results: ozlabs.org; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 + header.s=fm3 header.b=Sj8OLfL4; + dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.a=rsa-sha256 header.s=fm3 header.b=gP0Xb3h8; + dkim-atps=neutral +Received: from phobos.denx.de (phobos.denx.de + [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) + (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) + key-exchange X25519 server-signature RSA-PSS (4096 bits)) + (No client certificate requested) + by ozlabs.org (Postfix) with ESMTPS id 4Bhphf6BH6z9sTR + for ; Thu, 3 Sep 2020 15:07:30 +1000 (AEST) +Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) + by phobos.denx.de (Postfix) with ESMTP id A8413822E3; + Thu, 3 Sep 2020 07:07:25 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de +Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org + header.b="Sj8OLfL4"; dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.b="gP0Xb3h8"; dkim-atps=neutral +Received: by phobos.denx.de (Postfix, from userid 109) + id 7B2D9822E8; Thu, 3 Sep 2020 07:07:23 +0200 (CEST) +X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de +X-Spam-Level: +X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, + DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, + SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no + version=3.4.2 +Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com + [66.111.4.26]) + (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by phobos.denx.de (Postfix) with ESMTPS id 88299822CA + for ; Thu, 3 Sep 2020 07:07:19 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=samuel@sholland.org +Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) + by mailout.nyi.internal (Postfix) with ESMTP id 76A985C0185; + Thu, 3 Sep 2020 01:07:18 -0400 (EDT) +Received: from mailfrontend2 ([10.202.2.163]) + by compute3.internal (MEProxy); Thu, 03 Sep 2020 01:07:18 -0400 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= + from:to:cc:subject:date:message-id:in-reply-to:references + :mime-version:content-transfer-encoding; s=fm3; bh=PQN64SHY0DFbJ + Xj9YPEcwJKL0bbybvo9/xMWQLiHCkU=; b=Sj8OLfL4WM4t/eW8xPA7XiaXE7bRC + 9oDd5605MwRja78aJ+GwV1TuxapJm7IlVNnlBETATblOjQenK4B7tAuxyPitzu+K + yJP+d0AYfgltsx888/hHtABBhsY20/7onFV1xxF/nB6fWwM6UTYfzsg2QQ2QYHmb + R5QGX38IUdDGZPR/U3bd2roatbUMK+xMqPZku3+3xxbSlLdWpeXp3YBmNCZFrkef + DjNUZE0kZWZIXIEk25bliOi1Yol1RZQZBq4As373rtZSvdXJbPKxU6C5c2TH6OgZ + ZcjNRU6zogMnOHhe/nklaCLzZQPx8Wz5Nse8PYJuRlDGk5tu5tOcONmog== +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= + messagingengine.com; h=cc:content-transfer-encoding:date:from + :in-reply-to:message-id:mime-version:references:subject:to + :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= + fm3; bh=PQN64SHY0DFbJXj9YPEcwJKL0bbybvo9/xMWQLiHCkU=; b=gP0Xb3h8 + lzo0knlriZlcpqJf2dY4yeWblYiYIsakrHO3GUDeZ7G9RYeSSWZ89RjUPZIHn4tw + mTk7vKxHbWz88EaQ+iPXaHsygzVk6RGrnU+7eGtJzZmUmKAm19hTi1uqkP/nXGyY + yyL1IKzw3pieBI1wHq1JPBo+AqTyAsrhrjgdalM+f9/0WwcdAWLTWYUXdR65xW1W + oFUPZ3bjJWrhFb1KFwEiJKdkK9tpivNCGKLe9fvnTLEelYQVoKMAE5G0xVdJhIqY + mQAq41sXJ3LRSeQWUb4Nd00bQsDTsroKLXDYc1P2K57wRGNIalbkkWZmbadPn2VW + 5jUVvdCWPvDEZQ== +X-ME-Sender: + +X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudegtddgleduucetufdoteggodetrfdotf + fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen + uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne + cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv + lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf + frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv + gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih + iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn + ugdrohhrgh +X-ME-Proxy: + + + +Received: from titanium.stl.sholland.net + (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) + by mail.messagingengine.com (Postfix) with ESMTPA id 0C6DA306005B; + Thu, 3 Sep 2020 01:07:18 -0400 (EDT) +From: Samuel Holland +To: Jagan Teki , Maxime Ripard +Cc: Andre Przywara , + Peter Robinson , u-boot@lists.denx.de, + Samuel Holland +Subject: [PATCH 2/8] sunxi: board: Add a helper to get the SPL DT name +Date: Thu, 3 Sep 2020 00:07:10 -0500 +Message-Id: <20200903050716.48488-3-samuel@sholland.org> +X-Mailer: git-send-email 2.26.2 +In-Reply-To: <20200903050716.48488-1-samuel@sholland.org> +References: <20200903050716.48488-1-samuel@sholland.org> +MIME-Version: 1.0 +X-BeenThere: u-boot@lists.denx.de +X-Mailman-Version: 2.1.34 +Precedence: list +List-Id: U-Boot discussion +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Errors-To: u-boot-bounces@lists.denx.de +Sender: "U-Boot" +X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de +X-Virus-Status: Clean + +This moves the validity checking and typecasts all to one place away +from the string comparison logic, and it detangles the compile-time +and runtime control flow. + +The new helper will also be used by U-Boot proper in a future commit. + +Signed-off-by: Samuel Holland +--- + board/sunxi/board.c | 26 +++++++++++++++++--------- + 1 file changed, 17 insertions(+), 9 deletions(-) + +diff --git a/board/sunxi/board.c b/board/sunxi/board.c +index 674e6816d2d..5c9b811f27a 100644 +--- a/board/sunxi/board.c ++++ b/board/sunxi/board.c +@@ -319,6 +319,17 @@ static struct boot_file_head * get_spl_header(uint8_t req_version) + return spl; + } + ++static const char *get_spl_dt_name(void) ++{ ++ struct boot_file_head *spl = get_spl_header(SPL_DT_HEADER_VERSION); ++ ++ /* Check if there is a DT name stored in the SPL header. */ ++ if (spl != INVALID_SPL_HEADER && spl->dt_name_offset) ++ return (char *)spl + spl->dt_name_offset; ++ ++ return NULL; ++} ++ + int dram_init(void) + { + struct boot_file_head *spl = get_spl_header(SPL_DRAM_HEADER_VERSION); +@@ -891,20 +902,17 @@ int ft_board_setup(void *blob, struct bd_info *bd) + #ifdef CONFIG_SPL_LOAD_FIT + int board_fit_config_name_match(const char *name) + { +- struct boot_file_head *spl = get_spl_header(SPL_DT_HEADER_VERSION); +- const char *best_dt_name = (const char *)spl; ++ const char *best_dt_name = get_spl_dt_name(); + +- /* Check if there is a DT name stored in the SPL header and use that. */ +- if (spl != INVALID_SPL_HEADER && spl->dt_name_offset) { +- best_dt_name += spl->dt_name_offset; +- } else { + #ifdef CONFIG_DEFAULT_DEVICE_TREE ++ if (best_dt_name == NULL) + best_dt_name = CONFIG_DEFAULT_DEVICE_TREE; +-#else +- return 0; + #endif +- }; + ++ if (best_dt_name == NULL) { ++ /* No DT name was provided, so accept the first config. */ ++ return 0; ++ } + #ifdef CONFIG_PINE64_DT_SELECTION + /* Differentiate the two Pine64 board DTs by their DRAM size. */ + if (strstr(name, "-pine64") && strstr(best_dt_name, "-pine64")) { + +From patchwork Thu Sep 3 05:07:11 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Samuel Holland +X-Patchwork-Id: 1356311 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; + spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de + (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; + envelope-from=u-boot-bounces@lists.denx.de; receiver=) +Authentication-Results: ozlabs.org; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 + header.s=fm3 header.b=YljKqDaX; + dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.a=rsa-sha256 header.s=fm3 header.b=KFsvPFSQ; + dkim-atps=neutral +Received: from phobos.denx.de (phobos.denx.de + [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) + (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) + key-exchange X25519 server-signature RSA-PSS (4096 bits)) + (No client certificate requested) + by ozlabs.org (Postfix) with ESMTPS id 4Bhpj50Q5mz9sTR + for ; Thu, 3 Sep 2020 15:07:52 +1000 (AEST) +Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) + by phobos.denx.de (Postfix) with ESMTP id 921A1822EA; + Thu, 3 Sep 2020 07:07:28 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de +Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org + header.b="YljKqDaX"; dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.b="KFsvPFSQ"; dkim-atps=neutral +Received: by phobos.denx.de (Postfix, from userid 109) + id 29DBC822EA; Thu, 3 Sep 2020 07:07:26 +0200 (CEST) +X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de +X-Spam-Level: +X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, + DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, + SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no + version=3.4.2 +Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com + [66.111.4.26]) + (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by phobos.denx.de (Postfix) with ESMTPS id AA176822D5 + for ; Thu, 3 Sep 2020 07:07:19 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=samuel@sholland.org +Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) + by mailout.nyi.internal (Postfix) with ESMTP id C1C965C01A4; + Thu, 3 Sep 2020 01:07:18 -0400 (EDT) +Received: from mailfrontend2 ([10.202.2.163]) + by compute3.internal (MEProxy); Thu, 03 Sep 2020 01:07:18 -0400 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= + from:to:cc:subject:date:message-id:in-reply-to:references + :mime-version:content-transfer-encoding; s=fm3; bh=Qd9EKlOeDxNxU + GjePDGIEyZE9Rx9hOCoFpYSpjLblzg=; b=YljKqDaXzM+KcF2P5M1Qm4ZqIN47C + vZyob9mNeC9Ih6xzht0zmIiswyR4o06F6F75APKEHOLdF98lM16tFq5lm2c0K2C/ + FLv20iU82lyakGbT5y0fX9BUw2B1l6InAM81fN1aIyj6vKXDINvzr0Njek5zd82e + EBZJnaT7r4LgQ3tDupNPvYm+nq18jIibpUUERREvoNh6ktNeYOJbWPpuyRpW06+o + zKpzwXrrMFjcTuczM3DCSk0LchI0IGfF9STJXcWYrkwILpOIIZIn7Pcxbxg3LuPP + EF8OLTHGhbp2yvtbSVxuSyV5XrLKaiMTJNs8Z8T/AVWTfuAfwA146icVg== +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= + messagingengine.com; h=cc:content-transfer-encoding:date:from + :in-reply-to:message-id:mime-version:references:subject:to + :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= + fm3; bh=Qd9EKlOeDxNxUGjePDGIEyZE9Rx9hOCoFpYSpjLblzg=; b=KFsvPFSQ + oz3tuB0IgFDRGBPs9pm02ZFiQW6XW9io0ha6PFYr7sl2irhSUuA89cAncxDeQ99n + /SKVx+jefi15iu+rEUTEdZwFzb8FbfQ6faNIyvJ1RL4m+eH9ifIF0yuc62Qe9Pt2 + Y0+6e1tDB3SyFRABn0Vib5DrnmbMSYeSJZug7TRAxINnW/qdG6pq1ycNPbhvYy7V + L0yBLcV7gP/gwEF5OtEWV2X22kqKFir6fKCsAVDK2KUTmM3ezGifn8h6u7n8ksWC + +4UbNfjcBKfNLHFEEIb7CdNdtixI4oo/XIsA8eDHULQ0v7cF7bZ1KAR+jBSW4Bf9 + CRQNy2hCu5K+Rg== +X-ME-Sender: + +X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudegtddgleduucetufdoteggodetrfdotf + fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen + uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne + cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv + lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf + frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv + gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih + iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn + ugdrohhrgh +X-ME-Proxy: + + + +Received: from titanium.stl.sholland.net + (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) + by mail.messagingengine.com (Postfix) with ESMTPA id 56CF53060062; + Thu, 3 Sep 2020 01:07:18 -0400 (EDT) +From: Samuel Holland +To: Jagan Teki , Maxime Ripard +Cc: Andre Przywara , + Peter Robinson , u-boot@lists.denx.de, + Samuel Holland +Subject: [PATCH 3/8] sunxi: board: Simplify Pine A64 DT selection logic +Date: Thu, 3 Sep 2020 00:07:11 -0500 +Message-Id: <20200903050716.48488-4-samuel@sholland.org> +X-Mailer: git-send-email 2.26.2 +In-Reply-To: <20200903050716.48488-1-samuel@sholland.org> +References: <20200903050716.48488-1-samuel@sholland.org> +MIME-Version: 1.0 +X-BeenThere: u-boot@lists.denx.de +X-Mailman-Version: 2.1.34 +Precedence: list +List-Id: U-Boot discussion +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Errors-To: u-boot-bounces@lists.denx.de +Sender: "U-Boot" +X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de +X-Virus-Status: Clean + +Instead of using an entirely separate matching algorithm, simply update +the name of the DT we want to match. Enabling this logic does not depend +on the FIT config name, only on the initial guess of the board name. + +Importantly, the initial guess must be "sun50i-a64-pine64-plus", because +otherwise the logic would trigger when "sun50i-a64-pine64-lts" was +written to the SPL header. + +Signed-off-by: Samuel Holland +--- + board/sunxi/board.c | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +diff --git a/board/sunxi/board.c b/board/sunxi/board.c +index 5c9b811f27a..fb0d5bf4743 100644 +--- a/board/sunxi/board.c ++++ b/board/sunxi/board.c +@@ -914,14 +914,10 @@ int board_fit_config_name_match(const char *name) + return 0; + } + #ifdef CONFIG_PINE64_DT_SELECTION +-/* Differentiate the two Pine64 board DTs by their DRAM size. */ +- if (strstr(name, "-pine64") && strstr(best_dt_name, "-pine64")) { +- if ((gd->ram_size > 512 * 1024 * 1024)) +- return !strstr(name, "plus"); +- else +- return !!strstr(name, "plus"); +- } else { +- return strcmp(name, best_dt_name); ++ else if (strstr(best_dt_name, "-pine64-plus")) { ++ /* Differentiate the Pine A64 boards by their DRAM size. */ ++ if ((gd->ram_size == 512 * 1024 * 1024)) ++ best_dt_name = "sun50i-a64-pine64"; + } + #endif + return strcmp(name, best_dt_name); + +From patchwork Thu Sep 3 05:07:12 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Samuel Holland +X-Patchwork-Id: 1356310 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; + spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de + (client-ip=85.214.62.61; helo=phobos.denx.de; + envelope-from=u-boot-bounces@lists.denx.de; receiver=) +Authentication-Results: ozlabs.org; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 + header.s=fm3 header.b=WQvh0tb6; + dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.a=rsa-sha256 header.s=fm3 header.b=Va8mMuMz; + dkim-atps=neutral +Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) + (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) + key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest + SHA256) (No client certificate requested) + by ozlabs.org (Postfix) with ESMTPS id 4Bhphw0Nkzz9sTR + for ; Thu, 3 Sep 2020 15:07:43 +1000 (AEST) +Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) + by phobos.denx.de (Postfix) with ESMTP id 19AFA822DF; + Thu, 3 Sep 2020 07:07:27 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de +Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org + header.b="WQvh0tb6"; dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.b="Va8mMuMz"; dkim-atps=neutral +Received: by phobos.denx.de (Postfix, from userid 109) + id 3129B822E3; Thu, 3 Sep 2020 07:07:24 +0200 (CEST) +X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de +X-Spam-Level: +X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, + DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, + SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no + version=3.4.2 +Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com + [66.111.4.26]) + (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by phobos.denx.de (Postfix) with ESMTPS id D694E822E1 + for ; Thu, 3 Sep 2020 07:07:19 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=samuel@sholland.org +Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) + by mailout.nyi.internal (Postfix) with ESMTP id 1C9B95C0116; + Thu, 3 Sep 2020 01:07:19 -0400 (EDT) +Received: from mailfrontend2 ([10.202.2.163]) + by compute3.internal (MEProxy); Thu, 03 Sep 2020 01:07:19 -0400 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= + from:to:cc:subject:date:message-id:in-reply-to:references + :mime-version:content-transfer-encoding; s=fm3; bh=CNkIsGtVD92kV + ynV0NXjTV4vykOq+sdspxFol5f0iNM=; b=WQvh0tb6tyqtZYusFC0NyOcSeWaQm + ikcA+euqToY6scf0d256r+20fb4HnTosS+vXbhpF5vlo1hBhc2RW2/e+dR3a3AKH + qb8j3UwBWhpnwwZMS8HqUob5Cfq1BxHU1+/2tjRXvlMxDxNd/HvUoRlLBhfK57OA + Ln6MfWcRmxHlq5Js5MGAD9hRdzkPrnDX4x/NdRttkUaH/WMSGNEO0TnKW88PYXsE + 8u0eiuJQWWLED8nBAxf89vvVUf7o+It6gx5i+r5Bjl/BE5Ykj4O4kpMX2MeiB+Zh + KjYjivDQw8wmG4CrFKPCq4Bd/RoSQd9zHYBp6QuYpvY80vw+jLX7oVwMw== +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= + messagingengine.com; h=cc:content-transfer-encoding:date:from + :in-reply-to:message-id:mime-version:references:subject:to + :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= + fm3; bh=CNkIsGtVD92kVynV0NXjTV4vykOq+sdspxFol5f0iNM=; b=Va8mMuMz + othxHX11xn91XUTb1pYRnk4BO4zhPNKy7f+RU+S4/3DaYnmV9zl4x03LblsUWZRs + bnICHr20DS5YKUcqT9ag5zm1ocAxwJQGTc/SnTpWkZsJXR8unpsmm89jDyV+w5dM + p3YUeZ3AhxjEFHJXhqUnnOIXSLXGzYsnWA+szWf0dHI7tpZJqaV5O4X8xTk2X5cp + 2siDwjLGLi7PUtB/vcNZmOOZQbROGonW6mu2iNurHnrBUk4gOOmQhmeiEkjJb9lk + +MfMZsLXllNr8/o7323d6iP90v1scxaBASDC+q2zzEmUVAmU/Y/fyH0B6frHJy3O + QTcFTnYy45X3Zw== +X-ME-Sender: + +X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudegtddgleduucetufdoteggodetrfdotf + fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen + uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne + cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv + lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf + frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv + gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih + iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn + ugdrohhrgh +X-ME-Proxy: + + + +Received: from titanium.stl.sholland.net + (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) + by mail.messagingengine.com (Postfix) with ESMTPA id A21AB306005B; + Thu, 3 Sep 2020 01:07:18 -0400 (EDT) +From: Samuel Holland +To: Jagan Teki , Maxime Ripard +Cc: Andre Przywara , + Peter Robinson , u-boot@lists.denx.de, + Samuel Holland +Subject: [PATCH 4/8] sunxi: board: Add PinePhone DT selection logic +Date: Thu, 3 Sep 2020 00:07:12 -0500 +Message-Id: <20200903050716.48488-5-samuel@sholland.org> +X-Mailer: git-send-email 2.26.2 +In-Reply-To: <20200903050716.48488-1-samuel@sholland.org> +References: <20200903050716.48488-1-samuel@sholland.org> +MIME-Version: 1.0 +X-BeenThere: u-boot@lists.denx.de +X-Mailman-Version: 2.1.34 +Precedence: list +List-Id: U-Boot discussion +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Errors-To: u-boot-bounces@lists.denx.de +Sender: "U-Boot" +X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de +X-Virus-Status: Clean + +There are two different publicly-released revisions of the PinePhone +hardware, versions 1.1 and 1.2; and they need different device trees. +Since some GPIO pins were rerouted, we can use that to distinguish +between them. + +Signed-off-by: Samuel Holland +--- + arch/arm/mach-sunxi/Kconfig | 7 +++++++ + board/sunxi/board.c | 21 +++++++++++++++++++++ + 2 files changed, 28 insertions(+) + +diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig +index be0822bfb7d..8421f3b6854 100644 +--- a/arch/arm/mach-sunxi/Kconfig ++++ b/arch/arm/mach-sunxi/Kconfig +@@ -1010,4 +1010,11 @@ config PINE64_DT_SELECTION + option, the device tree selection code specific to Pine64 which + utilizes the DRAM size will be enabled. + ++config PINEPHONE_DT_SELECTION ++ bool "Enable PinePhone device tree selection code" ++ depends on MACH_SUN50I ++ help ++ Enable this option to automatically select the device tree for the ++ correct PinePhone hardware revision during boot. ++ + endif +diff --git a/board/sunxi/board.c b/board/sunxi/board.c +index fb0d5bf4743..3d64ed18664 100644 +--- a/board/sunxi/board.c ++++ b/board/sunxi/board.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -920,6 +921,26 @@ int board_fit_config_name_match(const char *name) + best_dt_name = "sun50i-a64-pine64"; + } + #endif ++#ifdef CONFIG_PINEPHONE_DT_SELECTION ++ else if (strstr(best_dt_name, "-pinephone")) { ++ /* Differentiate the PinePhone revisions by GPIO inputs. */ ++ prcm_apb0_enable(PRCM_APB0_GATE_PIO); ++ sunxi_gpio_set_pull(SUNXI_GPL(6), SUNXI_GPIO_PULL_UP); ++ sunxi_gpio_set_cfgpin(SUNXI_GPL(6), SUNXI_GPIO_INPUT); ++ udelay(100); ++ ++ /* PL6 is pulled low by the modem on v1.2. */ ++ if (gpio_get_value(SUNXI_GPL(6)) == 0) ++ best_dt_name = "sun50i-a64-pinephone-1.2"; ++ else ++ best_dt_name = "sun50i-a64-pinephone-1.1"; ++ ++ sunxi_gpio_set_cfgpin(SUNXI_GPL(6), SUNXI_GPIO_DISABLE); ++ sunxi_gpio_set_pull(SUNXI_GPL(6), SUNXI_GPIO_PULL_DISABLE); ++ prcm_apb0_disable(PRCM_APB0_GATE_PIO); ++ } ++#endif ++ + return strcmp(name, best_dt_name); + } + #endif + +From patchwork Thu Sep 3 05:07:13 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Samuel Holland +X-Patchwork-Id: 1356314 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; + spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de + (client-ip=85.214.62.61; helo=phobos.denx.de; + envelope-from=u-boot-bounces@lists.denx.de; receiver=) +Authentication-Results: ozlabs.org; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 + header.s=fm3 header.b=fyCJtExp; + dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.a=rsa-sha256 header.s=fm3 header.b=B5Js1Nb8; + dkim-atps=neutral +Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) + (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) + key-exchange X25519 server-signature RSA-PSS (4096 bits)) + (No client certificate requested) + by ozlabs.org (Postfix) with ESMTPS id 4Bhpjn2MLBz9sTR + for ; Thu, 3 Sep 2020 15:08:29 +1000 (AEST) +Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) + by phobos.denx.de (Postfix) with ESMTP id 774738230A; + Thu, 3 Sep 2020 07:07:33 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de +Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org + header.b="fyCJtExp"; dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.b="B5Js1Nb8"; dkim-atps=neutral +Received: by phobos.denx.de (Postfix, from userid 109) + id 43189822ED; Thu, 3 Sep 2020 07:07:27 +0200 (CEST) +X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de +X-Spam-Level: +X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, + DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, + SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no + version=3.4.2 +Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com + [66.111.4.26]) + (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by phobos.denx.de (Postfix) with ESMTPS id 2BF26822D9 + for ; Thu, 3 Sep 2020 07:07:21 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=samuel@sholland.org +Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) + by mailout.nyi.internal (Postfix) with ESMTP id 672025C018A; + Thu, 3 Sep 2020 01:07:19 -0400 (EDT) +Received: from mailfrontend2 ([10.202.2.163]) + by compute3.internal (MEProxy); Thu, 03 Sep 2020 01:07:19 -0400 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= + from:to:cc:subject:date:message-id:in-reply-to:references + :mime-version:content-transfer-encoding; s=fm3; bh=azt3bcG2gyjJM + Z+euNV8r3HcVvCpV+eSxdiwdmzQYjE=; b=fyCJtExpAf8Pds8sXBs5pz5z9Werb + vqBSzut0Ck+pcCvap7NpVy7HIRtLqRZZ5TVdGQrBdCyjMYPaBcpnxw/mfUNJKoX9 + WjOBrSnHpTrRp42ZQmJhQhQwBcX/s0j54ruprCfSqKSDuTOBG1N1JvKxI/PpfY6r + SsSEbwLKYq1RtK4noXm6JikphM9ME5i5XlR5n4XPsXPdM3UhM9DZXrkVwtWp+NyK + 4Xz63Is8oAxwJZAmqv049v/YeMe/Rsf9FY93zxcnQyZVoOHuW1s17AsX7jF8wDRy + xqvpvT8c3cJYXaFLGLrY+nmcGoKIjQSszLh9y5NwbGmjlEElJCcUUJW1A== +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= + messagingengine.com; h=cc:content-transfer-encoding:date:from + :in-reply-to:message-id:mime-version:references:subject:to + :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= + fm3; bh=azt3bcG2gyjJMZ+euNV8r3HcVvCpV+eSxdiwdmzQYjE=; b=B5Js1Nb8 + 5VzNH4aOuAW1FHK3OmKXRhz2sqhORkqO2K1N+kVfuPWZeATNjSIGEHwqkBJeJDNc + i+/y18eeCQg5sWkt3YCGaFv//m+LNamP1DRTkwLglswewvGqj0zfgN4MjMJvBWt3 + 0bbdP8+D9o1geSld8IyI3lyRZgu7QN+3vJs4xxyTQL6xTOg6VizhNwm6nwSSl2u8 + O6WzLWqrShbb6PD7Lqy5FrJ+BiqwRR+QrRp1JI86QDXssPJh1CtMiF2LnrkmwPxB + DSp3hr1nqudSNopltfwdUyNu3GdkGbMCE8Iv+4KIZpD8oRH12hS19aRtIqosAuXm + 1Ljrqzx4Vp/yNA== +X-ME-Sender: + +X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudegtddgleduucetufdoteggodetrfdotf + fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen + uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne + cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv + lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf + frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv + gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih + iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn + ugdrohhrgh +X-ME-Proxy: + + + +Received: from titanium.stl.sholland.net + (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) + by mail.messagingengine.com (Postfix) with ESMTPA id EE48F306005E; + Thu, 3 Sep 2020 01:07:18 -0400 (EDT) +From: Samuel Holland +To: Jagan Teki , Maxime Ripard +Cc: Andre Przywara , + Peter Robinson , u-boot@lists.denx.de, + Samuel Holland +Subject: [PATCH 5/8] sunxi: board: Save the chosen DT name in the SPL header +Date: Thu, 3 Sep 2020 00:07:13 -0500 +Message-Id: <20200903050716.48488-6-samuel@sholland.org> +X-Mailer: git-send-email 2.26.2 +In-Reply-To: <20200903050716.48488-1-samuel@sholland.org> +References: <20200903050716.48488-1-samuel@sholland.org> +MIME-Version: 1.0 +X-BeenThere: u-boot@lists.denx.de +X-Mailman-Version: 2.1.34 +Precedence: list +List-Id: U-Boot discussion +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Errors-To: u-boot-bounces@lists.denx.de +Sender: "U-Boot" +X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de +X-Virus-Status: Clean + +This overwrites the name loaded from the SPL image. It will be different +if there was previously no name provided, or if a more accurate name was +determined by the board variant selection logic. This means that the DT +name in the SPL header now always matches the DT appended to U-Boot. + +Signed-off-by: Samuel Holland +--- + board/sunxi/board.c | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/board/sunxi/board.c b/board/sunxi/board.c +index 3d64ed18664..eaa40a1ea96 100644 +--- a/board/sunxi/board.c ++++ b/board/sunxi/board.c +@@ -331,6 +331,21 @@ static const char *get_spl_dt_name(void) + return NULL; + } + ++static void set_spl_dt_name(const char *name) ++{ ++ struct boot_file_head *spl = get_spl_header(SPL_ENV_HEADER_VERSION); ++ ++ if (spl == INVALID_SPL_HEADER) ++ return; ++ ++ /* Promote the header version for U-Boot proper, if needed. */ ++ if (spl->spl_signature[3] < SPL_DT_HEADER_VERSION) ++ spl->spl_signature[3] = SPL_DT_HEADER_VERSION; ++ ++ strcpy((char *)&spl->string_pool, name); ++ spl->dt_name_offset = offsetof(struct boot_file_head, string_pool); ++} ++ + int dram_init(void) + { + struct boot_file_head *spl = get_spl_header(SPL_DRAM_HEADER_VERSION); +@@ -904,6 +919,7 @@ int ft_board_setup(void *blob, struct bd_info *bd) + int board_fit_config_name_match(const char *name) + { + const char *best_dt_name = get_spl_dt_name(); ++ int ret; + + #ifdef CONFIG_DEFAULT_DEVICE_TREE + if (best_dt_name == NULL) +@@ -941,6 +957,15 @@ int board_fit_config_name_match(const char *name) + } + #endif + +- return strcmp(name, best_dt_name); ++ ret = strcmp(name, best_dt_name); ++ ++ /* ++ * If one of the FIT configurations matches the most accurate DT name, ++ * update the SPL header to provide that DT name to U-Boot proper. ++ */ ++ if (ret == 0) ++ set_spl_dt_name(best_dt_name); ++ ++ return ret; + } + #endif + +From patchwork Thu Sep 3 05:07:14 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Samuel Holland +X-Patchwork-Id: 1356313 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; + spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de + (client-ip=85.214.62.61; helo=phobos.denx.de; + envelope-from=u-boot-bounces@lists.denx.de; receiver=) +Authentication-Results: ozlabs.org; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 + header.s=fm3 header.b=Ps0W2fd7; + dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.a=rsa-sha256 header.s=fm3 header.b=irLh9odg; + dkim-atps=neutral +Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) + (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) + key-exchange X25519 server-signature RSA-PSS (4096 bits)) + (No client certificate requested) + by ozlabs.org (Postfix) with ESMTPS id 4BhpjY18DVz9sTR + for ; Thu, 3 Sep 2020 15:08:17 +1000 (AEST) +Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) + by phobos.denx.de (Postfix) with ESMTP id 1375E82300; + Thu, 3 Sep 2020 07:07:32 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de +Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; + unprotected) header.d=sholland.org header.i=@sholland.org + header.b="Ps0W2fd7"; dkim=pass (2048-bit key; + unprotected) header.d=messagingengine.com header.i=@messagingengine.com + header.b="irLh9odg"; dkim-atps=neutral +Received: by phobos.denx.de (Postfix, from userid 109) + id E9DCE822E1; Thu, 3 Sep 2020 07:07:26 +0200 (CEST) +X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de +X-Spam-Level: +X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, + DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, + SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no + version=3.4.2 +Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com + [66.111.4.26]) + (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by phobos.denx.de (Postfix) with ESMTPS id 2CC5D822DF + for ; Thu, 3 Sep 2020 07:07:21 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=none (p=none dis=none) header.from=sholland.org +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=samuel@sholland.org +Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) + by mailout.nyi.internal (Postfix) with ESMTP id AAA455C0197; + Thu, 3 Sep 2020 01:07:19 -0400 (EDT) +Received: from mailfrontend2 ([10.202.2.163]) + by compute3.internal (MEProxy); Thu, 03 Sep 2020 01:07:19 -0400 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= + from:to:cc:subject:date:message-id:in-reply-to:references + :mime-version:content-transfer-encoding; s=fm3; bh=YJZBYh6lhnaT4 + or+KKTYoX0BgbruFrnszv2AxRFjCUg=; b=Ps0W2fd7vmO9tBRewK6ov5Y2vWsh9 + oAAVK6vPK0hEzUkkeBIkhSenj5xlmR2HCeP5LxQU+Vgty5CzLJnc48U8lCQwGRFR + ZZ6tAiD9/vOtdVCbU2dRH7WK3uoAEi4AB688do5c3H3KhS8ZN6N7vsakr50TbczK + beuX76xciz0QEuRhJUFbnK9EYpV8/CDS1OFv6P+kA6OSIb71gm9FeFgdHHpmdQ/U + 7sE6vbkMYhL7pFMzeBCYWSfUWF6NK3gfJApDaxFqR1KBlszLuGbIXLVYWImA3WV8 + sFDNZWGk2swSOB1ivq+Xvb2WTlPidjY0OrROgggZcyDHPRFEoZaS1ezAA== +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= + messagingengine.com; h=cc:content-transfer-encoding:date:from + :in-reply-to:message-id:mime-version:references:subject:to + :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= + fm3; bh=YJZBYh6lhnaT4or+KKTYoX0BgbruFrnszv2AxRFjCUg=; b=irLh9odg + 4mUJO3vUBGyeYD/WBs8BrulYezzsNoTAJp4uGEv0b9KyxbofUjok4+liYvAT/QZa + ED/iKo1bqgGmEwNPLoM0YORd0pXRd5jyv9W53Z96qzGsNOe0iGkJtSlOMXF3Lrfl + aIpGPRSMoRkqztR6oWBAEHeCm3NCFY4LDzzCoPFQqdcWmiDl+Wi3YfpApRGHdL3v + 4XVOruQFZlZUHZPp42VOzgbJyz+uWB3Z/RN2y0P7Lof1CrYtsWNftV4LuXDQ70VZ + P9TlSWjk75qTa1dqHdj/cvbi5WFBqa4FJKgCCV1OgCCEAc1ZGLhPBVDjt4W7FHJh + hNPlKS0liPCmGQ== +X-ME-Sender: + +X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudegtddgleduucetufdoteggodetrfdotf + fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen + uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne + cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv + lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf + frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv + gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih + iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn + ugdrohhrgh +X-ME-Proxy: + + + +Received: from titanium.stl.sholland.net + (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) + by mail.messagingengine.com (Postfix) with ESMTPA id 4678A306005B; + Thu, 3 Sep 2020 01:07:19 -0400 (EDT) +From: Samuel Holland +To: Jagan Teki , Maxime Ripard +Cc: Andre Przywara , + Peter Robinson , u-boot@lists.denx.de, + Samuel Holland +Subject: [PATCH 6/8] sunxi: board: Set fdtfile to match the DT chosen by SPL +Date: Thu, 3 Sep 2020 00:07:14 -0500 +Message-Id: <20200903050716.48488-7-samuel@sholland.org> +X-Mailer: git-send-email 2.26.2 +In-Reply-To: <20200903050716.48488-1-samuel@sholland.org> +References: <20200903050716.48488-1-samuel@sholland.org> +MIME-Version: 1.0 +X-BeenThere: u-boot@lists.denx.de +X-Mailman-Version: 2.1.34 +Precedence: list +List-Id: U-Boot discussion +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Errors-To: u-boot-bounces@lists.denx.de +Sender: "U-Boot" +X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de +X-Virus-Status: Clean + +Previously, fdtfile was always the value in CONFIG_DEFAULT_DEVICE_TREE. +This meant that, regardless of the DT chosen by SPL (either by changing +the header in the image or by the selection code at runtime), Linux +always used the default DT. + +By using the name from the SPL header (which, because of the previous +commit, always matches the DT used by U-Boot proper), Linux also sees +the same board as U-Boot/SPL, even if the boot script later loads a DT +from disk. + +Signed-off-by: Samuel Holland +--- + board/sunxi/board.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/board/sunxi/board.c b/board/sunxi/board.c +index eaa40a1ea96..5457b28e135 100644 +--- a/board/sunxi/board.c ++++ b/board/sunxi/board.c +@@ -870,6 +870,7 @@ static void setup_environment(const void *fdt) + + int misc_init_r(void) + { ++ const char *spl_dt_name; + uint boot; + + env_set("fel_booted", NULL); +@@ -888,6 +889,16 @@ int misc_init_r(void) + env_set("mmc_bootdev", "1"); + } + ++ /* Set fdtfile to match the FIT configuration chosen in SPL. */ ++ spl_dt_name = get_spl_dt_name(); ++ if (spl_dt_name) { ++ char *prefix = IS_ENABLED(CONFIG_ARM64) ? "allwinner/" : ""; ++ char str[64]; ++ ++ snprintf(str, sizeof(str), "%s%s.dtb", prefix, spl_dt_name); ++ env_set("fdtfile", str); ++ } ++ + setup_environment(gd->fdt_blob); + + #ifdef CONFIG_USB_ETHER + diff --git a/sources b/sources index a197564..9cdc2e2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (u-boot-2020.10-rc2.tar.bz2) = 9364a555e34830359c5cfffa87cc3d192ff15b23bf8bda054778e02ab4b37ede09a1a37757eb2121787de924fc563880dd4417bf53cd80d3649acb55d05994e8 +SHA512 (u-boot-2020.10-rc4.tar.bz2) = ba944bf9cbd8285de6fd4c2e67c2411eda6c504e87720854b36fbcd290927dabb25deee28302e8b81a982f41d29d4ddf908d4891c4f5b2bda4324a0191eb701d diff --git a/uboot-tools.spec b/uboot-tools.spec index 493acfd..c119c66 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -1,8 +1,8 @@ -%global candidate rc2 +%global candidate rc4 Name: uboot-tools Version: 2020.10 -Release: 0.3%{?candidate:.%{candidate}}%{?dist} +Release: 0.4%{?candidate:.%{candidate}}%{?dist} Summary: U-Boot utilities License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+ URL: http://www.denx.de/wiki/U-Boot @@ -27,10 +27,12 @@ Patch5: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch Patch6: arm-tegra-define-fdtfile-option-for-distro-boot.patch Patch7: arm-add-BOOTENV_EFI_SET_FDTFILE_FALLBACK-for-tegra186-be.patch # AllWinner improvements -Patch8: AllWinner-Pine64-bits.patch +Patch8: PinePhone-automatic-device-tree-selection.patch +Patch9: AllWinner-PinePhone.patch +Patch10: AllWinner-PineTab.patch # Rockchips improvements -Patch9: arm-rk3399-enable-rng-on-rock960-and-firefly3399.patch -Patch10: rockchip-Rock960-Fix-up-USB-support.patch +Patch11: arm-rk3399-enable-rng-on-rock960-and-firefly3399.patch +Patch12: rockchip-Rock960-Fix-up-USB-support.patch BuildRequires: bc BuildRequires: dtc @@ -244,6 +246,9 @@ cp -p board/warp7/README builds/docs/README.warp7 %endif %changelog +* Wed Sep 09 2020 Peter Robinson - 2020.10-0.4.rc4 +- Update to 2020.10 RC4 + * Wed Aug 19 2020 Peter Robinson - 2020.10-0.3.rc2 - Enable a number of new Rockchip devices