summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorKlaus Goger <klaus.goger@theobroma-systems.com>2016-09-12 10:47:09 +0200
committerKlaus Goger <klaus.goger@theobroma-systems.com>2016-09-18 20:22:03 +0200
commit4a47429be7548de690e18ded7e4399798054d83d (patch)
treeacf61a047321ea1de7edcb8e42beaa0ed3f3bc0c /board
parent5f17348aa8898bfc4051d58ad64450a7d0b2f319 (diff)
sun9i: armadillo: set CLKB_OUT and reset USB hubs
set CLKB_OUT to 12MHz output and reset the onboard USB, HSIC hub and GL830 USB to SATA bridge.
Diffstat (limited to 'board')
-rw-r--r--board/sunxi/board.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 52792bd364..bc90032866 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -598,6 +598,8 @@ int misc_init_r(void)
unsigned int sid[4];
uint8_t mac_addr[6];
int ret;
+ struct sunxi_ccm_reg *const ccm =
+ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
#if !defined(CONFIG_SPL_BUILD)
setenv("fel_booted", NULL);
@@ -636,6 +638,23 @@ int misc_init_r(void)
if (ret)
return ret;
#endif
+
+#ifdef CONFIG_SUNXI_ARMADILLO
+ sunxi_gpio_set_cfgpin(SUNXI_GPA(11), SUN9I_GPA_CLKOUT);
+ setbits_le32(&ccm->clk_output_b, CLK_OUTPUT_ENABLE |
+ CLK_OUTPUT_SRC_OSC24M | CLK_OUTPUT_DIV_N_RATIO(2));
+
+ gpio_request(SUNXI_GPA(6), "USB HSIC HUB Reset");
+ sunxi_gpio_set_cfgpin(SUNXI_GPA(6), SUNXI_GPIO_OUTPUT);
+ gpio_request(SUNXI_GPE(15), "USB HUB Reset");
+ sunxi_gpio_set_cfgpin(SUNXI_GPE(15), SUNXI_GPIO_OUTPUT);
+ gpio_request(SUNXI_GPG(0), "GL830 Reset");
+ sunxi_gpio_set_cfgpin(SUNXI_GPE(15), SUNXI_GPIO_OUTPUT);
+ gpio_direction_output(SUNXI_GPA(6),1);
+ gpio_direction_output(SUNXI_GPE(15),1);
+ gpio_direction_output(SUNXI_GPG(0),1);
+#endif
+
sunxi_musb_board_init();
return 0;