From e6e505b93cb3fd264227c65ae1bfc9e4681555d8 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 29 Mar 2016 17:29:06 +0200 Subject: sunxi: Move cpu independent code to mach directory Some of the code in arch/arm/cpu/armv7/sunxi is actually armv7 specific, while most of it is just generic code that could as well be used on an AArch64 SoC. Move all files that are not really tied to armv7 into a new mach-sunxi directory. Signed-off-by: Alexander Graf Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- arch/arm/cpu/armv7/sunxi/clock.c | 65 ---------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 arch/arm/cpu/armv7/sunxi/clock.c (limited to 'arch/arm/cpu/armv7/sunxi/clock.c') diff --git a/arch/arm/cpu/armv7/sunxi/clock.c b/arch/arm/cpu/armv7/sunxi/clock.c deleted file mode 100644 index 0b8fc94711..0000000000 --- a/arch/arm/cpu/armv7/sunxi/clock.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * (C) Copyright 2007-2012 - * Allwinner Technology Co., Ltd. - * Tom Cubie - * - * (C) Copyright 2013 Luke Kenneth Casson Leighton - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include -#include -#include -#include - -__weak void clock_init_sec(void) -{ -} - -int clock_init(void) -{ -#ifdef CONFIG_SPL_BUILD - clock_init_safe(); -#endif - clock_init_uart(); - clock_init_sec(); - - return 0; -} - -/* These functions are shared between various SoCs so put them here. */ -#if defined CONFIG_SUNXI_GEN_SUN6I && !defined CONFIG_MACH_SUN9I -int clock_twi_onoff(int port, int state) -{ - struct sunxi_ccm_reg *const ccm = - (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; - - if (port == 5) { - if (state) - prcm_apb0_enable( - PRCM_APB0_GATE_PIO | PRCM_APB0_GATE_I2C); - else - prcm_apb0_disable( - PRCM_APB0_GATE_PIO | PRCM_APB0_GATE_I2C); - return 0; - } - - /* set the apb clock gate and reset for twi */ - if (state) { - setbits_le32(&ccm->apb2_gate, - CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT + port)); - setbits_le32(&ccm->apb2_reset_cfg, - 1 << (APB2_RESET_TWI_SHIFT + port)); - } else { - clrbits_le32(&ccm->apb2_reset_cfg, - 1 << (APB2_RESET_TWI_SHIFT + port)); - clrbits_le32(&ccm->apb2_gate, - CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT + port)); - } - - return 0; -} -#endif -- cgit