board: rockchip: Add Radxa ZERO 3W/3E
Subsystems (3)
cover board: rockchip: Add Radxa ZERO 3W/3E
This series add support for the RK3566 based Radxa ZERO 3W/3E boards.
rk_board_late_init() and board_fit_config_name_match() has been implemented to set fdtfile env var and load correct FIT config based on what board is detected at runtime.
Features tested on a ZERO 3W 8GB v1.11:
- SD-card boot
- eMMC boot
- USB gadget
- USB host
Features tested on a ZERO 3E 4GB v1.2:
- SD-card boot
- Ethernet
- USB gadget
- USB host
This series depends on the following patch for a clean apply:
- board: rockchip: add Radxa ROCK 3 Model C [1]
[1] https://patchwork.ozlabs.org/patch/1963177/
FUKAUMI Naoki (1):
arm64: dts: rockchip: fix mmc aliases for Radxa ZERO 3E/3W
Jonas Karlman (3):
arm64: dts: rockchip: Add Radxa ZERO 3W/3E
dm: adc: Add SPL_ADC Kconfig symbol for use of ADC in SPL
board: rockchip: Add Radxa ZERO 3W/3E
Trevor Woerner (1):
arm64: dts: rockchip: add gpio-line-names to radxa-zero-3
arch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsi | 11 + arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsi | 11 + arch/arm/mach-rockchip/rk3568/Kconfig | 6 + board/radxa/zero3-rk3566/Kconfig | 12 + board/radxa/zero3-rk3566/MAINTAINERS | 6 + board/radxa/zero3-rk3566/Makefile | 3 + board/radxa/zero3-rk3566/zero3-rk3566.c | 59 ++ configs/radxa-zero-3-rk3566_defconfig | 85 +++ doc/board/rockchip/rockchip.rst | 1 + drivers/Makefile | 2 +- drivers/adc/Kconfig | 4 + .../arm64/rockchip/rk3566-radxa-zero-3.dtsi | 531 ++++++++++++++++++ .../arm64/rockchip/rk3566-radxa-zero-3e.dts | 52 ++ .../arm64/rockchip/rk3566-radxa-zero-3w.dts | 92 +++ 14 files changed, 874 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsi create mode 100644 arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsi create mode 100644 board/radxa/zero3-rk3566/Kconfig create mode 100644 board/radxa/zero3-rk3566/MAINTAINERS create mode 100644 board/radxa/zero3-rk3566/Makefile create mode 100644 board/radxa/zero3-rk3566/zero3-rk3566.c create mode 100644 configs/radxa-zero-3-rk3566_defconfig create mode 100644 dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3.dtsi create mode 100644 dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3e.dts create mode 100644 dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3w.dts
Signature · 1 line
2.45.2
PATCH 1/5 arm64: dts: rockchip: Add Radxa ZERO 3W/3E
The Radxa ZERO 3W/3E is an ultra-small, high-performance single board computer based on the Rockchip RK3566, with a compact form factor and rich interfaces.
The ZERO 3W and ZERO 3E are basically the same size and model, but differ only in storage and network interfaces.
- eMMC (3W)
- SD-card (both)
- Ethernet (3E)
- WiFi/BT (3W)
Add initial support for eMMC, SD-card, Ethernet, HDMI and USB.
[ upstream commit: 1a5c8d307c83c808a32686ed51afb4bac2092d39 ]
(cherry picked from commit 1476c5882f8a47b6f0f895c6424dacf6334487ae)
--- .../arm64/rockchip/rk3566-radxa-zero-3.dtsi | 463 ++++++++++++++++++ .../arm64/rockchip/rk3566-radxa-zero-3e.dts | 51 ++ .../arm64/rockchip/rk3566-radxa-zero-3w.dts | 91 ++++ 3 files changed, 605 insertions(+) create mode 100644 dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3.dtsi create mode 100644 dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3e.dts create mode 100644 dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3w.dts
dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3.dtsi new file +463 -0
@@ -0,0 +1,463 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/leds/common.h> +#include <dt-bindings/soc/rockchip,vop2.h> +#include "rk3566.dtsi" + +/ { + aliases { + mmc0 = &sdmmc0; + }; + + chosen { + stdout-path = "serial2:1500000n8"; + }; + + hdmi-con { + compatible = "hdmi-connector"; + type = "d"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&user_led2>; + + led-green { + color = <LED_COLOR_ID_GREEN>; + default-state = "on"; + function = LED_FUNCTION_HEARTBEAT; + gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + }; + }; + + vcc_1v8: regulator-1v8-vcc { + compatible = "regulator-fixed"; + regulator-name = "vcc_1v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vcc_1v8_p>; + }; + + vcca_1v8: regulator-1v8-vcca { + compatible = "regulator-fixed"; + regulator-name = "vcca_1v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vcc_1v8_p>; + }; + + vcca1v8_image: regulator-1v8-vcca-image { + compatible = "regulator-fixed"; + regulator-name = "vcca1v8_image"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vcc_1v8_p>; + }; + + vcc_3v3: regulator-3v3-vcc { + compatible = "regulator-fixed"; + regulator-name = "vcc_3v3"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc3v3_sys>; + }; + + vcc_sys: regulator-5v0-vcc-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; +}; + +&combphy1 { + status = "okay"; +}; + +&cpu0 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu1 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu2 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu3 { + cpu-supply = <&vdd_cpu>; +}; + +&gpu { + mali-supply = <&vdd_gpu_npu>; + status = "okay"; +}; + +&hdmi { + avdd-0v9-supply = <&vdda_0v9>; + avdd-1v8-supply = <&vcca1v8_image>; + status = "okay"; +}; + +&hdmi_in { + hdmi_in_vp0: endpoint { + remote-endpoint = <&vp0_out_hdmi>; + }; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&hdmi_sound { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + + rk817: pmic@20 { + compatible = "rockchip,rk817"; + reg = <0x20>; + #clock-cells = <1>; + clock-output-names = "rk817-clkout1", "rk817-clkout2"; + interrupt-parent = <&gpio0>; + interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc_sys>; + vcc2-supply = <&vcc_sys>; + vcc3-supply = <&vcc_sys>; + vcc4-supply = <&vcc_sys>; + vcc5-supply = <&vcc_sys>; + vcc6-supply = <&vcc_sys>; + vcc7-supply = <&vcc_sys>; + vcc8-supply = <&vcc_sys>; + vcc9-supply = <&vcc5v_midu>; + + regulators { + vdd_logic: DCDC_REG1 { + regulator-name = "vdd_logic"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vdd_gpu_npu: DCDC_REG2 { + regulator-name = "vdd_gpu_npu"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vcc3v3_sys: DCDC_REG4 { + regulator-name = "vcc3v3_sys"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcca1v8_pmu: LDO_REG1 { + regulator-name = "vcca1v8_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vdda_0v9: LDO_REG2 { + regulator-name = "vdda_0v9"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdda0v9_pmu: LDO_REG3 { + regulator-name = "vdda0v9_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vccio_acodec: LDO_REG4 { + regulator-name = "vccio_acodec"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vccio_sd: LDO_REG5 { + regulator-name = "vccio_sd"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_pmu: LDO_REG6 { + regulator-name = "vcc3v3_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcc_1v8_p: LDO_REG7 { + regulator-name = "vcc_1v8_p"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc1v8_dvp: LDO_REG8 { + regulator-name = "vcc1v8_dvp"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc2v8_dvp: LDO_REG9 { + regulator-name = "vcc2v8_dvp"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc5v_midu: BOOST { + regulator-name = "vcc5v_midu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vbus: OTG_SWITCH { + regulator-name = "vbus"; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + }; + }; + + vdd_cpu: regulator@40 { + compatible = "rockchip,rk8600"; + reg = <0x40>; + fcs,suspend-voltage-selector = <1>; + regulator-name = "vdd_cpu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1390000>; + regulator-ramp-delay = <2300>; + vin-supply = <&vcc_sys>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; +}; + +&i2s0_8ch { + status = "okay"; +}; + +&pinctrl { + leds { + user_led2: user-led2 { + rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + pmic { + pmic_int_l: pmic-int-l { + rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; +}; + +&pmu_io_domains { + pmuio1-supply = <&vcc3v3_pmu>; + pmuio2-supply = <&vcca1v8_pmu>; + vccio1-supply = <&vccio_acodec>; + vccio2-supply = <&vcc_1v8>; + vccio3-supply = <&vccio_sd>; + vccio4-supply = <&vcc_1v8>; + vccio5-supply = <&vcc_3v3>; + vccio6-supply = <&vcc_3v3>; + vccio7-supply = <&vcc_3v3>; + status = "okay"; +}; + +&saradc { + vref-supply = <&vcca_1v8>; + status = "okay"; +}; + +&sdmmc0 { + bus-width = <4>; + cap-sd-highspeed; + disable-wp; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; + vmmc-supply = <&vcc3v3_sys>; + vqmmc-supply = <&vccio_sd>; + status = "okay"; +}; + +&tsadc { + rockchip,hw-tshut-mode = <1>; + rockchip,hw-tshut-polarity = <0>; + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&usb_host0_xhci { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usb_host1_xhci { + status = "okay"; +}; + +&usb2phy0 { + status = "okay"; +}; + +&usb2phy0_host { + status = "okay"; +}; + +&usb2phy0_otg { + status = "okay"; +}; + +&vop { + assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; + assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; + status = "okay"; +}; + +&vop_mmu { + status = "okay"; +}; + +&vp0 { + vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { + reg = <ROCKCHIP_VOP2_EP_HDMI0>; + remote-endpoint = <&hdmi_in_vp0>; + }; +};
dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3e.dts new file +51 -0
51 lines not on this page · raw message
dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3w.dts new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
2.45.2
PATCH 2/5 arm64: dts: rockchip: fix mmc aliases for Radxa ZERO 3E/3W
In reply to Jonas KarlmanFrom: FUKAUMI Naoki <[email protected]>
align with other Radxa products.
- mmc0 is eMMC
- mmc1 is microSD
for ZERO 3E, there is no eMMC, but aliases should start at 0, so mmc0 is microSD as exception.
Changes in v3:
- fix syntax error in rk3566-radxa-zero-3e.dts
Changes in v2:
- microSD is mmc0 instead of mmc1 for ZERO 3E
[ upstream commit: 060c1950037e4c54ca4d8186a8f46269e35db901 ]
(cherry picked from commit 8324bc7493e4088013c62bc41f49d6d181575493)
--- dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3.dtsi | 4 ---- dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3e.dts | 1 + dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3w.dts | 3 ++- 3 files changed, 3 insertions(+), 5 deletions(-)
dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3.dtsi +0 -4
@@ -6,10 +6,6 @@ #include "rk3566.dtsi" / { - aliases { - mmc0 = &sdmmc0; - }; - chosen { stdout-path = "serial2:1500000n8"; };
dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3e.dts +1 -0
@@ -10,6 +10,7 @@ aliases { ethernet0 = &gmac1; + mmc0 = &sdmmc0; }; };
dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3w.dts +2 -1
@@ -9,7 +9,8 @@ compatible = "radxa,zero-3w", "rockchip,rk3566"; aliases { - mmc1 = &sdhci; + mmc0 = &sdhci; + mmc1 = &sdmmc0; mmc2 = &sdmmc1; };
Signature · 1 line
2.45.2
PATCH 3/5 arm64: dts: rockchip: add gpio-line-names to radxa-zero-3
In reply to Jonas KarlmanFrom: Trevor Woerner <[email protected]>
Add names to the pins of the general-purpose expansion header as given in the Radxa documentation[1] following the conventions in the kernel[2] to make it easier for users to correlate pins with functions when using utilities such as 'gpioinfo'.
[1] https://docs.radxa.com/en/zero/zero3/hardware-design/hardware-interface
[2] https://www.kernel.org/doc/Documentation/devicetree/bindings/gpio/gpio.txt
[ upstream commit: f7c742cbe664ebdedc075945e75443683d1175f7 ]
(cherry picked from commit 8b26cf42ba0c74a9c86cebe591a9195f75151d97)
--- .../arm64/rockchip/rk3566-radxa-zero-3.dtsi | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+)
dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3.dtsi +72 -0
@@ -105,6 +105,78 @@ cpu-supply = <&vdd_cpu>; }; +&gpio0 { + gpio-line-names = + /* GPIO0_A0 - A7 */ + "", "", "", "", "", "", "", "", + /* GPIO0_B0 - B7 */ + "", "", "", "", "", "", "", "", + /* GPIO0_C0 - C7 */ + "", "", "", "", "", "", "", "", + /* GPIO0_D0 - D7 */ + "pin-10 [GPIO0_D0]", "pin-08 [GPIO0_D1]", "", + "", "", "", "", ""; +}; + +&gpio1 { + gpio-line-names = + /* GPIO1_A0 - A7 */ + "pin-03 [GPIO1_A0]", "pin-05 [GPIO1_A1]", "", + "", "pin-37 [GPIO1_A4]", "", + "", "", + /* GPIO1_B0 - B7 */ + "", "", "", "", "", "", "", "", + /* GPIO1_C0 - C7 */ + "", "", "", "", "", "", "", "", + /* GPIO1_D0 - D7 */ + "", "", "", "", "", "", "", ""; +}; + +&gpio2 { + gpio-line-names = + /* GPIO2_A0 - A7 */ + "", "", "", "", "", "", "", "", + /* GPIO2_B0 - B7 */ + "", "", "", "", "", "", "", "", + /* GPIO2_C0 - C7 */ + "", "", "", "", "", "", "", "", + /* GPIO2_D0 - D7 */ + "", "", "", "", "", "", "", ""; +}; + +&gpio3 { + gpio-line-names = + /* GPIO3_A0 - A7 */ + "", "pin-11 [GPIO3_A1]", "pin-13 [GPIO3_A2]", + "pin-12 [GPIO3_A3]", "pin-35 [GPIO3_A4]", "pin-40 [GPIO3_A5]", + "pin-38 [GPIO3_A6]", "pin-36 [GPIO3_A7]", + /* GPIO3_B0 - B7 */ + "pin-15 [GPIO3_B0]", "pin-16 [GPIO3_B1]", "pin-18 [GPIO3_B2]", + "pin-29 [GPIO3_B3]", "pin-31 [GPIO3_B4]", "", + "", "", + /* GPIO3_C0 - C7 */ + "", "pin-22 [GPIO3_C1]", "pin-32 [GPIO3_C2]", + "pin-33 [GPIO3_C3]", "pin-07 [GPIO3_C4]", "", + "", "", + /* GPIO3_D0 - D7 */ + "", "", "", "", "", "", "", ""; +}; + +&gpio4 { + gpio-line-names = + /* GPIO4_A0 - A7 */ + "", "", "", "", "", "", "", "", + /* GPIO4_B0 - B7 */ + "", "", "pin-27 [GPIO4_B2]", + "pin-28 [GPIO4_B3]", "", "", "", "", + /* GPIO4_C0 - C7 */ + "", "", "pin-23 [GPIO4_C2]", + "pin-19 [GPIO4_C3]", "", "pin-21 [GPIO4_C5]", + "pin-24 [GPIO4_C6]", "", + /* GPIO4_D0 - D7 */ + "", "", "", "", "", "", "", ""; +}; + &gpu { mali-supply = <&vdd_gpu_npu>; status = "okay";
Signature · 1 line
2.45.2
PATCH 4/5 dm: adc: Add SPL_ADC Kconfig symbol for use of ADC in SPL
In reply to Jonas KarlmanWhat model of Radxa ZERO 3W/3E boards can be identified using ADC at runtime, add a Kconfig symbol to allow use of ADC in SPL.
This will be used to identify board model in SPL to allow loading correct FIT configuration and FDT for U-Boot proper at SPL phase.
--- drivers/Makefile | 2 +- drivers/adc/Kconfig | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/Makefile +1 -1
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ +obj-$(CONFIG_$(SPL_TPL_)ADC) += adc/ obj-$(CONFIG_$(SPL_TPL_)BIOSEMU) += bios_emulator/ obj-$(CONFIG_$(SPL_TPL_)BLK) += block/ obj-$(CONFIG_$(SPL_TPL_)BOOTCOUNT_LIMIT) += bootcount/
@@ -81,7 +82,6 @@ endif ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) -obj-y += adc/ obj-y += ata/ obj-$(CONFIG_DM_DEMO) += demo/ obj-y += block/
drivers/adc/Kconfig +4 -0
@@ -11,6 +11,10 @@ config ADC - support supply's phandle with auto-enable - supply polarity setting in fdt +config SPL_ADC + bool "Enable ADC drivers using Driver Model in SPL" + depends on ADC + config ADC_EXYNOS bool "Enable Exynos 54xx ADC driver" depends on ADC
Signature · 1 line
2.45.2
Re: [PATCH 4/5] dm: adc: Add SPL_ADC Kconfig symbol for use of ADC in SPL
Re: [PATCH 4/5] dm: adc: Add SPL_ADC Kconfig symbol for use of ADC in SPL
Hi Quentin,
Quoted 51 lines · Quentin Schulz
Hi Jonas,
Quoted 36 lines · Jonas Karlman
What model of Radxa ZERO 3W/3E boards can be identified using ADC at runtime, add a
Kconfigsymbol to allow use of ADC in SPL.This will be used to identify board model in SPL to allow loading correct FIT configuration and FDT for U-Boot proper at SPL phase.
Signed-off-by Jonas Karlman <[email protected]>--- drivers/Makefile | 2 +- drivers/adc/Kconfig | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)drivers/Makefile +1
-1@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ +obj-$(CONFIG_$(SPL_TPL_)ADC) += adc/ obj-$(CONFIG_$(SPL_TPL_)BIOSEMU) += bios_emulator/ obj-$(CONFIG_$(SPL_TPL_)BLK) += block/ obj-$(CONFIG_$(SPL_TPL_)BOOTCOUNT_LIMIT) += bootcount/@@ -81,7 +82,6 @@ endif ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) -obj-y += adc/ obj-y += ata/ obj-$(CONFIG_DM_DEMO) += demo/ obj-y += block/drivers/adc/Kconfig +0
-0drivers/adc/Kconfig config ADC · line 17
Quoted 7 lines
drivers/adc/Kconfig +4
-0@@ -11,6 +11,10 @@ config ADC - support supply's phandle with auto-enable - supply polarity setting in fdt +config SPL_ADC + bool "Enable ADC drivers using Driver Model in SPL" + depends on ADC +This is just because you didn't modify the
drivers/adc/Makefileto have obj-$(CONFIG_$(SPL_TPL_)ADC) += adc-uclass.o
I assume? It's a bit odd to require a "proper" symbol for an SPL symbol.
Quoted 2 lines
Additionally, since you use $(SPL_TPL_) maybe add that TPL symbol too in the
Kconfig?
Agree, this could have been done differently, I added the depends on ADC a few minutes before I send the series to ensure next user of ADC in SPL does not miss it.
The use of $(SPL_TPL_) was to follow rest of the Makefile, and there are plenty of other places where this is used and a symbol is missing. Also this helps when next user would like to use ADC in TPL, only the Kconfig symbol needs to be added.
Quoted 6 lines
Finally, I think it'd be best to have symbols for SPL and TPL for the drivers as well and update the
Makefileto use $(SPL_TPL_) for those as well. I don't see this as being a big issue for ADC specifically right now but it's been a pain for me for a few other subsystems (power, pmic, i2c, spi, IIRC). This isn't a blocker though I believe.
Yeah, lots of drivers/subsections could use an update to have more consistency.
For this series I only wanted to include bare minimum change to make it possible to use adc_channel_single_shot() in SPL to figure out what FIT config to use.
Full Makefile and Kconfig cleanup should probably be done in a separate series.
Quoted 4 lines
On a side note, I'm wondering if we're not missing a depends on DM for
CONFIG_ADCby any chance? c.f. the config option title: "Enable ADC drivers using Driver Model"
Probably, guessing no target is using ADC without DM at the moment.
Regards,
Jonas
Quoted 3 lines
Cheers,
Quentin
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 4/5] dm: adc: Add SPL_ADC Kconfig symbol for use of ADC in SPL
Hi Quentin,
Quoted 60 lines · Quentin Schulz
Hi Jonas,
Quoted 57 lines · Jonas Karlman
Hi Quentin,
Quoted 53 lines · Quentin Schulz
Hi Jonas,
Quoted 36 lines · Jonas Karlman
What model of Radxa ZERO 3W/3E boards can be identified using ADC at runtime, add a
Kconfigsymbol to allow use of ADC in SPL.This will be used to identify board model in SPL to allow loading correct FIT configuration and FDT for U-Boot proper at SPL phase.
Signed-off-by Jonas Karlman <[email protected]>--- drivers/Makefile | 2 +- drivers/adc/Kconfig | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)drivers/Makefile +1
-1@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ +obj-$(CONFIG_$(SPL_TPL_)ADC) += adc/ obj-$(CONFIG_$(SPL_TPL_)BIOSEMU) += bios_emulator/ obj-$(CONFIG_$(SPL_TPL_)BLK) += block/ obj-$(CONFIG_$(SPL_TPL_)BOOTCOUNT_LIMIT) += bootcount/@@ -81,7 +82,6 @@ endif ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) -obj-y += adc/ obj-y += ata/ obj-$(CONFIG_DM_DEMO) += demo/ obj-y += block/drivers/adc/Kconfig +0
-0drivers/adc/Kconfig config ADC · line 17
Quoted 7 lines
drivers/adc/Kconfig +4
-0@@ -11,6 +11,10 @@ config ADC - support supply's phandle with auto-enable - supply polarity setting in fdt +config SPL_ADC + bool "Enable ADC drivers using Driver Model in SPL" + depends on ADC +This is just because you didn't modify the
drivers/adc/Makefileto have obj-$(CONFIG_$(SPL_TPL_)ADC) += adc-uclass.o
I assume? It's a bit odd to require a "proper" symbol for an SPL symbol.Additionally, since you use $(SPL_TPL_) maybe add that TPL symbol too in the
Kconfig?
Quoted 8 lines
Quoted 4 lines
Agree, this could have been done differently, I added the depends on ADC a few minutes before I send the series to ensure next user of ADC in SPL does not miss it.
I would rather not depend on a hack if we can avoid it. I believe:
obj-$(CONFIG_$(SPL_TPL_)ADC) += adc-uclass.o
should be enough of a change here?
I thinks so to, will change to that in a v2.
Quoted 5 lines
I'm actually wondering if we can't simply have obj-y += adc-uclass.o
? considering that thisMakefileis only included if $(CONFIG_$(SPL_TPL_)ADC)?
Should be possible, but it is probably better to be explicit in case the condition in drivers/Makefile ever changes in the future.
Regards,
Jonas
Quoted 3 lines
Cheers,
Quentin
PATCH 5/5 board: rockchip: Add Radxa ZERO 3W/3E
In reply to Jonas KarlmanThe Radxa ZERO 3W/3E is an ultra-small, high-performance single board computer based on the Rockchip RK3566, with a compact form factor and rich interfaces.
Implement rk_board_late_init() to set correct fdtfile env var and board_fit_config_name_match() to load correct FIT config based on what board is detected at runtime so a single board target can be used for both board models.
Features tested on a ZERO 3W 8GB v1.11:
- SD-card boot
- eMMC boot
- USB gadget
- USB host
Features tested on a ZERO 3E 4GB v1.2:
- SD-card boot
- Ethernet
- USB gadget
- USB host
--- arch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsi | 11 +++ arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsi | 11 +++ arch/arm/mach-rockchip/rk3568/Kconfig | 6 ++ board/radxa/zero3-rk3566/Kconfig | 12 +++ board/radxa/zero3-rk3566/MAINTAINERS | 6 ++ board/radxa/zero3-rk3566/Makefile | 3 + board/radxa/zero3-rk3566/zero3-rk3566.c | 59 +++++++++++++ configs/radxa-zero-3-rk3566_defconfig | 85 +++++++++++++++++++ doc/board/rockchip/rockchip.rst | 1 + 9 files changed, 194 insertions(+) create mode 100644 arch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsi create mode 100644 arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsi create mode 100644 board/radxa/zero3-rk3566/Kconfig create mode 100644 board/radxa/zero3-rk3566/MAINTAINERS create mode 100644 board/radxa/zero3-rk3566/Makefile create mode 100644 board/radxa/zero3-rk3566/zero3-rk3566.c create mode 100644 configs/radxa-zero-3-rk3566_defconfig
arch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsi new file +11 -0
@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +#include "rk356x-u-boot.dtsi" + +&saradc { + bootph-pre-ram; +}; + +&vcca_1v8 { + bootph-pre-ram; +};
arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsi new file +11 -0
@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +#include "rk356x-u-boot.dtsi" + +&saradc { + bootph-pre-ram; +}; + +&vcca_1v8 { + bootph-pre-ram; +};
arch/arm/mach-rockchip/rk3568/Kconfig +6 -0
@@ -32,6 +32,11 @@ config TARGET_QUARTZ64_RK3566 help Pine64 Quartz64 single board computer with a RK3566 SoC. +config TARGET_RADXA_ZERO_3_RK3566 + bool "Radxa ZERO 3W/3E" + help + Radxa ZERO 3W/3E single board computers with a RK3566 SoC. + endchoice config ROCKCHIP_BOOT_MODE_REG
@@ -54,5 +59,6 @@ source "board/anbernic/rgxx3_rk3566/Kconfig" source "board/hardkernel/odroid_m1/Kconfig" source "board/pine64/quartz64_rk3566/Kconfig" source "board/powkiddy/x55/Kconfig" +source "board/radxa/zero3-rk3566/Kconfig" endif
board/radxa/zero3-rk3566/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_RADXA_ZERO_3_RK3566 + +config SYS_BOARD + default "zero3-rk3566" + +config SYS_VENDOR + default "radxa" + +config SYS_CONFIG_NAME + default "evb_rk3568" + +endif
board/radxa/zero3-rk3566/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +RADXA-ZERO-3-RK3566 +M: Jonas Karlman <[email protected]> +S: Maintained +F: board/radxa/zero3-rk3566 +F: configs/radxa-zero-3-rk3566_defconfig +F: arch/arm/dts/rk3566-radxa-zero-3*
board/radxa/zero3-rk3566/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += zero3-rk3566.o
board/radxa/zero3-rk3566/zero3-rk3566.c new file +59 -0
59 lines not on this page · raw message
configs/radxa-zero-3-rk3566_defconfig new file +85 -0
85 lines not on this page · raw message
doc/board/rockchip/rockchip.rst +1 -0
@@ -107,6 +107,7 @@ List of mainline supported Rockchip boards: - Powkiddy X55 (powkiddy-x55-rk3566) - Radxa CM3 IO Board (radxa-cm3-io-rk3566) - Radxa ROCK 3C (rock-3c-rk3566) + - Radxa ZERO 3W/3E (radxa-zero-3-rk3566) * rk3568 - Rockchip Evb-RK3568 (evb-rk3568)
Signature · 1 line
2.45.2
Hi,
Quoted 15 lines · Jonas Karlman
The Radxa ZERO 3W/3E is an ultra-small, high-performance single board computer based on the Rockchip RK3566, with a compact form factor and rich interfaces.
Implement
rk_board_late_init()to set correct fdtfile env var andboard_fit_config_name_match()to load correct FIT config based on what board is detected at runtime so a single board target can be used for both board models.Features tested on a ZERO 3W 8GB v1.11:
- SD-card boot
- eMMC boot
- USB gadget
- USB host
Quoted 7 lines
Features tested on a ZERO 3E 4GB v1.2:
- SD-card boot
- Ethernet
- USB gadget
- USB hostSigned-off-by Jonas Karlman <[email protected]>
for whole series,
Tested-by FUKAUMI Naoki <[email protected]>
Best regards,
--
FUKAUMI Naoki
Radxa Computer (Shenzhen) Co., Ltd.
Quoted 283 lines
--- arch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsi | 11 +++ arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsi | 11 +++ arch/arm/mach-rockchip/rk3568/Kconfig | 6 ++ board/radxa/zero3-rk3566/Kconfig | 12 +++ board/radxa/zero3-rk3566/MAINTAINERS | 6 ++ board/radxa/zero3-rk3566/Makefile | 3 + board/radxa/zero3-rk3566/zero3-rk3566.c | 59 +++++++++++++ configs/radxa-zero-3-rk3566_defconfig | 85 +++++++++++++++++++ doc/board/rockchip/rockchip.rst | 1 + 9 files changed, 194 insertions(+)create mode 100644
arch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsicreate mode 100644arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsicreate mode 100644 board/radxa/zero3-rk3566/Kconfig create mode 100644 board/radxa/zero3-rk3566/MAINTAINERS create mode 100644 board/radxa/zero3-rk3566/Makefile create mode 100644board/radxa/zero3-rk3566/zero3-rk3566.ccreate mode 100644 configs/radxa-zero-3-rk3566_defconfigarch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsi new file +11
-0@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +#include "rk356x-u-boot.dtsi" + +&saradc { + bootph-pre-ram; +}; + +&vcca_1v8 { + bootph-pre-ram; +};arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsi new file +11
-0@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +#include "rk356x-u-boot.dtsi" + +&saradc { + bootph-pre-ram; +}; + +&vcca_1v8 { + bootph-pre-ram; +};arch/arm/mach-rockchip/rk3568/Kconfig +6
-0@@ -32,6 +32,11 @@ config TARGET_QUARTZ64_RK3566 help Pine64 Quartz64 single board computer with a RK3566 SoC. +config TARGET_RADXA_ZERO_3_RK3566 + bool "Radxa ZERO 3W/3E" + help + Radxa ZERO 3W/3E single board computers with a RK3566 SoC. + endchoice config ROCKCHIP_BOOT_MODE_REG@@ -54,5 +59,6 @@ source "board/anbernic/rgxx3_rk3566/Kconfig" source "board/hardkernel/odroid_m1/Kconfig" source "board/pine64/quartz64_rk3566/Kconfig" source "board/powkiddy/x55/Kconfig" +source "board/radxa/zero3-rk3566/Kconfig" endifboard/radxa/zero3-rk3566/Kconfig new file +12
-0@@ -0,0 +1,12 @@ +if TARGET_RADXA_ZERO_3_RK3566 + +config SYS_BOARD + default "zero3-rk3566" + +config SYS_VENDOR + default "radxa" + +config SYS_CONFIG_NAME + default "evb_rk3568" + +endifboard/radxa/zero3-rk3566/MAINTAINERS new file +6
-0@@ -0,0 +1,6 @@ +RADXA-ZERO-3-RK3566 +M: Jonas Karlman <[email protected]> +S: Maintained +F: board/radxa/zero3-rk3566 +F: configs/radxa-zero-3-rk3566_defconfig +F: arch/arm/dts/rk3566-radxa-zero-3*board/radxa/zero3-rk3566/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += zero3-rk3566.oboard/radxa/zero3-rk3566/zero3-rk3566.c new file +59
-0@@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include <linux/errno.h> +#include <linux/kernel.h> +#include <adc.h> +#include <env.h> + +#define HW_ID_CHANNEL 1 + +struct board_model { +unsigned int low; +unsigned int high; +const char *fdtfile; +}; + +static const struct board_model board_models[] = { + {230 ,270 ,"rockchip/rk3566-radxa-zero-3w.dtb" }, + {400 ,450 ,"rockchip/rk3566-radxa-zero-3e.dtb" }, +}; + +static const struct board_model *get_board_model (void ) +{ +unsigned int val; +int i, ret; + + ret =adc_channel_single_shot ("saradc@fe720000" ,HW_ID_CHANNEL , &val); +if (ret) +return NULL ; + +for (i =0 ; i <ARRAY_SIZE (board_models); i++) { +unsigned int min = board_models[i].low; +unsigned int max = board_models[i].high; + +if (min <= val && val <= max) +return &board_models[i]; + } + +return NULL ; +} + +int rk_board_late_init (void ) +{ +const struct board_model *model =get_board_model (); + +if (model) +env_set ("fdtfile" , model->fdtfile); + +return 0 ; +} + +int board_fit_config_name_match (const char *name) +{ +const struct board_model *model =get_board_model (); + +if (model && !strcmp (name, model->fdtfile)) +return 0 ; + +return -EINVAL ; +}configs/radxa-zero-3-rk3566_defconfig new file +85
-0@@ -0,0 +1,85 @@ +CONFIG_ARM=y +CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_COUNTER_FREQUENCY=24000000 +CONFIG_ARCH_ROCKCHIP=y +CONFIG_SPL_GPIO=y +CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3566-radxa-zero-3w" +CONFIG_ROCKCHIP_RK3568=y +CONFIG_SPL_SERIAL=y +CONFIG_TARGET_RADXA_ZERO_3_RK3566=y +CONFIG_DEBUG_UART_BASE=0xFE660000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_SYS_LOAD_ADDR=0xc00800 +CONFIG_DEBUG_UART=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_SPL_FIT_SIGNATURE=y +CONFIG_SPL_LOAD_FIT=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-radxa-zero-3w.dtb" +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_SPL_MAX_SIZE=0x40000 +CONFIG_SPL_PAD_TO=0x7f8000 +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set +CONFIG_SPL_POWER=y +CONFIG_SPL_ATF=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_ROCKUSB=y +CONFIG_CMD_USB_MASS_STORAGE=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_PMIC=y +CONFIG_CMD_REGULATOR=y +# CONFIG_SPL_DOS_PARTITION is not set +CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_LIVE=y +CONFIG_OF_LIST="rockchip/rk3566-radxa-zero-3w rockchip/rk3566-radxa-zero-3e" +CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_SPL_REGMAP=y +CONFIG_SPL_SYSCON=y +CONFIG_SPL_ADC=y +CONFIG_SPL_CLK=y +# CONFIG_USB_FUNCTION_FASTBOOT is not set +CONFIG_ROCKCHIP_GPIO=y +CONFIG_SYS_I2C_ROCKCHIP=y +CONFIG_LED=y +CONFIG_LED_GPIO=y +CONFIG_MISC=y +CONFIG_SUPPORT_EMMC_RPMB=y +CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_SDMA=y +CONFIG_MMC_SDHCI_ROCKCHIP=y +CONFIG_PHY_REALTEK=y +CONFIG_DWC_ETH_QOS=y +CONFIG_DWC_ETH_QOS_ROCKCHIP=y +CONFIG_PHY_ROCKCHIP_INNO_USB2=y +CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y +CONFIG_SPL_PINCTRL=y +CONFIG_DM_PMIC=y +CONFIG_DM_PMIC_FAN53555=y +CONFIG_PMIC_RK8XX=y +CONFIG_SPL_DM_REGULATOR=y +CONFIG_SPL_DM_REGULATOR_FIXED=y +CONFIG_REGULATOR_RK8XX=y +CONFIG_SPL_RAM=y +CONFIG_BAUDRATE=1500000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_SYS_NS16550_MEM32=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_PSCI=y +CONFIG_USB=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_USB_FUNCTION_ROCKUSB=y +CONFIG_ERRNO_STR=ydoc/board/rockchip/rockchip.rst +1
-0@@ -107,6 +107,7 @@ List of mainline supported Rockchip boards: - Powkiddy X55 (powkiddy-x55-rk3566) - Radxa CM3 IO Board (radxa-cm3-io-rk3566) - Radxa ROCK 3C (rock-3c-rk3566) + - Radxa ZERO 3W/3E (radxa-zero-3-rk3566) * rk3568 - Rockchip Evb-RK3568 (evb-rk3568)