From a54b2925a6be70ecd51cccc0464e0b67c58f9b46 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Wed, 6 Jan 2021 18:02:57 +0100 Subject: sunxi: Add support for Tanix TX6 This commit adds support for Tanix TX6 TV box, based on H6. It's low end H6 board, with 3 GiB of RAM, eMMC, fast ethernet, USB, IR and other peripherals. DT file is taken from Linux 5.11-rc1 release. Signed-off-by: Jernej Skrabec Reviewed-by: Andre Przywara Signed-off-by: Andre Przywara --- board/sunxi/MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'board') diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 735801a..7a73a0b 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -494,6 +494,12 @@ S: Maintained F: configs/Sunchip_CX-A99_defconfig W: https://linux-sunxi.org/Sunchip_CX-A99 +TANIX TX6 BOARD +M: Jernej Skrabec +S: Maintained +F: configs/tanix_tx6_defconfig +W: https://linux-sunxi.org/Tanix_TX6 + TBS A711 BOARD M: Maxime Ripard S: Maintained -- cgit v1.1 From c81877a919d2ae214650b4f10b862dd62f0284a7 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Fri, 1 Oct 2021 19:29:00 +0100 Subject: sunxi: Add support for Orange Pi 3 dts file is taken from Linux 5.11-rc1 tag. The Bluetooth controller of this device ships with a default address, use the new CONFIG_FIXUP_BDADDR option to fix it up. Signed-off-by: Andre Heider Acked-by: Maxime Ripard [Updated OrangePi 3 DT, rebase and config update] Signed-off-by: Jernej Skrabec Reviewed-by: Andre Przywara Signed-off-by: Andre Przywara --- board/sunxi/MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'board') diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 7a73a0b..46db701 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -385,6 +385,11 @@ M: Icenowy Zheng S: Maintained F: configs/teres_i_defconfig +ORANGEPI 3 BOARD +M: Andre Heider +S: Maintained +F: configs/orangepi_3_defconfig + ORANGEPI LITE2 BOARD M: Jagan Teki S: Maintained -- cgit v1.1 From e9ad1b8dc5c7bae5213309af7c49907bac5def73 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Mon, 18 Jan 2021 23:23:59 +0000 Subject: sunxi: Properly check for SATAPWR and MACPWR The #ifdef CONFIG_xxxPWR conditionals were not working as expected, as string Kconfig symbols are always "defined" from the preprocessor's perspective. This lead to unnecessary calls to the GPIO routines, but also always added a half a second delay to wait for a SATA disk to power up. Many thanks to Peter for pointing this out! Fix this by properly comparing the Kconfig symbols against the empty string. strcmp() would be nicer for this, but GCC does not optimise this away, probably due to our standalone compiler switches. Reported-by: Peter Robinson Signed-off-by: Andre Przywara Tested-by: Samuel Holland # Orange Pi WinPlus Tested-by: Peter Robinson Reviewed-by: Jernej Skrabec --- board/sunxi/board.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'board') diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 4f05895..a0b5778 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -265,18 +265,28 @@ int board_init(void) if (ret) return ret; -#ifdef CONFIG_SATAPWR - satapwr_pin = sunxi_name_to_gpio(CONFIG_SATAPWR); - gpio_request(satapwr_pin, "satapwr"); - gpio_direction_output(satapwr_pin, 1); - /* Give attached sata device time to power-up to avoid link timeouts */ - mdelay(500); -#endif -#ifdef CONFIG_MACPWR - macpwr_pin = sunxi_name_to_gpio(CONFIG_MACPWR); - gpio_request(macpwr_pin, "macpwr"); - gpio_direction_output(macpwr_pin, 1); -#endif + /* strcmp() would look better, but doesn't get optimised away. */ + if (CONFIG_SATAPWR[0]) { + satapwr_pin = sunxi_name_to_gpio(CONFIG_SATAPWR); + if (satapwr_pin >= 0) { + gpio_request(satapwr_pin, "satapwr"); + gpio_direction_output(satapwr_pin, 1); + + /* + * Give the attached SATA device time to power-up + * to avoid link timeouts + */ + mdelay(500); + } + } + + if (CONFIG_MACPWR[0]) { + macpwr_pin = sunxi_name_to_gpio(CONFIG_MACPWR); + if (macpwr_pin >= 0) { + gpio_request(macpwr_pin, "macpwr"); + gpio_direction_output(macpwr_pin, 1); + } + } #ifdef CONFIG_DM_I2C /* -- cgit v1.1 From fbd37d8d28450a29180a9df1e7546c7f0cb60a38 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Mon, 11 Jan 2021 21:11:33 +0100 Subject: sunxi: Add support for AXP305 PMIC This PMIC can be found on H616 boards and it's very similar to AXP805 and AXP806. Signed-off-by: Jernej Skrabec Reviewed-by: Andre Przywara Reviewed-by: Jaehoon Chung Signed-off-by: Andre Przywara --- board/sunxi/board.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'board') diff --git a/board/sunxi/board.c b/board/sunxi/board.c index a0b5778..841a9ec 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -645,16 +645,18 @@ void sunxi_board_init(void) #endif #if defined CONFIG_AXP152_POWER || defined CONFIG_AXP209_POWER || \ - defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || \ - defined CONFIG_AXP818_POWER + defined CONFIG_AXP221_POWER || defined CONFIG_AXP305_POWER || \ + defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER power_failed = axp_init(); #if defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || \ defined CONFIG_AXP818_POWER power_failed |= axp_set_dcdc1(CONFIG_AXP_DCDC1_VOLT); #endif +#if !defined(CONFIG_AXP305_POWER) power_failed |= axp_set_dcdc2(CONFIG_AXP_DCDC2_VOLT); power_failed |= axp_set_dcdc3(CONFIG_AXP_DCDC3_VOLT); +#endif #if !defined(CONFIG_AXP209_POWER) && !defined(CONFIG_AXP818_POWER) power_failed |= axp_set_dcdc4(CONFIG_AXP_DCDC4_VOLT); #endif @@ -667,8 +669,10 @@ void sunxi_board_init(void) defined CONFIG_AXP818_POWER power_failed |= axp_set_aldo1(CONFIG_AXP_ALDO1_VOLT); #endif +#if !defined(CONFIG_AXP305_POWER) power_failed |= axp_set_aldo2(CONFIG_AXP_ALDO2_VOLT); -#if !defined(CONFIG_AXP152_POWER) +#endif +#if !defined(CONFIG_AXP152_POWER) && !defined(CONFIG_AXP305_POWER) power_failed |= axp_set_aldo3(CONFIG_AXP_ALDO3_VOLT); #endif #ifdef CONFIG_AXP209_POWER -- cgit v1.1 From d0b07c15c2aed8954c98320c65d68ccb14fb5c9d Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Mon, 11 Jan 2021 21:11:42 +0100 Subject: sunxi: add support for R_I2C on H616 This port is needed for communication with PMIC. SPL uses it to set DRAM voltage on H616 boards. Reviewed-by: Samuel Holland Signed-off-by: Jernej Skrabec Reviewed-by: Andre Przywara Signed-off-by: Andre Przywara --- board/sunxi/board.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'board') diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 841a9ec..e42b61e 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -197,6 +197,10 @@ void i2c_init_board(void) clock_twi_onoff(5, 1); sunxi_gpio_set_cfgpin(SUNXI_GPL(8), SUN50I_GPL_R_TWI); sunxi_gpio_set_cfgpin(SUNXI_GPL(9), SUN50I_GPL_R_TWI); +#elif CONFIG_MACH_SUN50I_H616 + clock_twi_onoff(5, 1); + sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN50I_H616_GPL_R_TWI); + sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUN50I_H616_GPL_R_TWI); #else clock_twi_onoff(5, 1); sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN8I_H3_GPL_R_TWI); -- cgit v1.1 From 38be6b838780e8ad0ee80e716752c8843cd87e05 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Mon, 11 Jan 2021 21:11:53 +0100 Subject: sunxi: Add support for OrangePi Zero2 OrangePi Zero2 is SBC based on Allwinner H616 with 1 GiB of RAM, SD card support, gigabit ethernet, micro HDMI, WIFI, Bluetooth and 1 USB 2.0 port. It also has two GPIO headers which allows further peripherals to be used. The devicetree file is taken from v3 of the OrangePi Zero2 Linux submission [1], which it's not yet merged. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2021-January/632084.html Signed-off-by: Jernej Skrabec Reviewed-by: Andre Przywara Signed-off-by: Andre Przywara --- board/sunxi/MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'board') diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 46db701..76eba2a 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -425,6 +425,11 @@ M: Diego Rondini S: Maintained F: configs/orangepi_zero_plus2_h3_defconfig +ORANGEPI ZERO 2 BOARD +M: Jernej Skrabec +S: Maintained +F: configs/orangepi_zero2_defconfig + ORANGEPI PC 2 BOARD M: Andre Przywara S: Maintained -- cgit v1.1