From bc30b2b225a31f7fcf4e25014a73739641a8df71 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Tue, 24 Dec 2013 16:48:03 -0500 Subject: cpu/allwinner/a10: Refactor API for gating clocks to peripherals Rather than having to track which bit in which register should be cleared or set to gate or ungate the clock to a certain peripheral, provide a simplified enum which encodes the register and bit. This change comes with a function which decodes the enum and gates/ungates the clock. This also removes the register-dependent bitmasks for APB0 and APB1 gating registers. Change-Id: Ib3ca16e54eb37eadc3ceb88f4ccc497829ac34bc Signed-off-by: Alexandru Gagniuc Reviewed-on: http://review.coreboot.org/4571 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Stefan Reinauer --- src/mainboard/cubietech/cubieboard/bootblock.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/mainboard/cubietech') diff --git a/src/mainboard/cubietech/cubieboard/bootblock.c b/src/mainboard/cubietech/cubieboard/bootblock.c index a91391c7a0..a7a55b58b2 100644 --- a/src/mainboard/cubietech/cubieboard/bootblock.c +++ b/src/mainboard/cubietech/cubieboard/bootblock.c @@ -62,12 +62,7 @@ static void cubieboard_setup_gpios(void) static void cubieboard_enable_uart(void) { - u32 reg32; - struct a10_ccm *ccm = (void *)A1X_CCM_BASE; - /* Enable clock to UART0 */ - reg32 = read32(&ccm->apb1_gate); - reg32 |= APB1_GATE_UART(0); - write32(reg32, &ccm->apb1_gate); + a1x_periph_clock_enable(A1X_CLKEN_UART0); } void bootblock_mainboard_init(void); -- cgit v1.2.3