summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2014-10-22 16:47:47 +0800
committerHans de Goede <hdegoede@redhat.com>2014-10-24 09:35:39 +0200
commitc757a50bd12b4f4f1c44a7cc42354918e8d60cd7 (patch)
treef7041a6dc6cbb8bc45372c633bc978a54becdf68 /arch/arm/cpu/armv7/sunxi/clock_sun6i.c
parent472ed0641e73ea5c5b80f9bfa804bfe0f89eca69 (diff)
downloadtalos-obmc-uboot-c757a50bd12b4f4f1c44a7cc42354918e8d60cd7.tar.gz
talos-obmc-uboot-c757a50bd12b4f4f1c44a7cc42354918e8d60cd7.zip
ARM: sunxi: Add support for using R_UART as console
The A23 only has UART0 muxed with MMC0. Some of the boards we encountered expose R_UART as a set of pads. Add support for R_UART so we can have a console while using mmc. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'arch/arm/cpu/armv7/sunxi/clock_sun6i.c')
-rw-r--r--arch/arm/cpu/armv7/sunxi/clock_sun6i.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
index 8387b931aa..1eae9767d0 100644
--- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
@@ -13,6 +13,7 @@
#include <common.h>
#include <asm/io.h>
#include <asm/arch/clock.h>
+#include <asm/arch/prcm.h>
#include <asm/arch/sys_proto.h>
void clock_init_uart(void)
@@ -20,6 +21,7 @@ void clock_init_uart(void)
struct sunxi_ccm_reg *const ccm =
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+#if CONFIG_CONS_INDEX < 5
/* uart clock source is apb2 */
writel(APB2_CLK_SRC_OSC24M|
APB2_CLK_RATE_N_1|
@@ -35,6 +37,10 @@ void clock_init_uart(void)
setbits_le32(&ccm->apb2_reset_cfg,
1 << (APB2_RESET_UART_SHIFT +
CONFIG_CONS_INDEX - 1));
+#else
+ /* enable R_PIO and R_UART clocks, and de-assert resets */
+ prcm_apb0_enable(PRCM_APB0_GATE_PIO | PRCM_APB0_GATE_UART);
+#endif
/* Dup with clock_init_safe(), drop once sun6i SPL support lands */
writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg);
OpenPOWER on IntegriCloud