3 * Marvell Semiconductor <www.marvell.com>
4 * Written-by: Lei Wen <leiwen@marvell.com>
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26 #include <asm/arch/cpu.h>
27 #include <asm/arch/pantheon.h>
29 #define UARTCLK14745KHZ (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1))
30 #define SET_MRVL_ID (1<<8)
31 #define L2C_RAM_SEL (1<<4)
33 int arch_cpu_init(void)
36 struct panthcpu_registers *cpuregs =
37 (struct panthcpu_registers*) PANTHEON_CPU_BASE;
39 struct panthapb_registers *apbclkres =
40 (struct panthapb_registers*) PANTHEON_APBC_BASE;
42 struct panthmpmu_registers *mpmu =
43 (struct panthmpmu_registers*) PANTHEON_MPMU_BASE;
45 struct panthapmu_registers *apmu =
46 (struct panthapmu_registers *) PANTHEON_APMU_BASE;
48 /* set SEL_MRVL_ID bit in PANTHEON_CPU_CONF register */
49 val = readl(&cpuregs->cpu_conf);
50 val = val | SET_MRVL_ID;
51 writel(val, &cpuregs->cpu_conf);
53 /* Turn on clock gating (PMUM_CCGR) */
54 writel(0xFFFFFFFF, &mpmu->ccgr);
56 /* Turn on clock gating (PMUM_ACGR) */
57 writel(0xFFFFFFFF, &mpmu->acgr);
59 /* Turn on uart2 clock */
60 writel(UARTCLK14745KHZ, &apbclkres->uart0);
62 /* Enable GPIO clock */
63 writel(APBC_APBCLK, &apbclkres->gpio);
66 /* Enable I2C clock */
67 writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apbclkres->twsi);
68 writel(APBC_FNCLK | APBC_APBCLK, &apbclkres->twsi);
71 #ifdef CONFIG_MV_SDHCI
72 /* Enable mmc clock */
73 writel(APMU_PERI_CLK | APMU_AXI_CLK | APMU_PERI_RST | APMU_AXI_RST,
75 writel(APMU_PERI_CLK | APMU_AXI_CLK | APMU_PERI_RST | APMU_AXI_RST,
84 #if defined(CONFIG_DISPLAY_CPUINFO)
85 int print_cpuinfo(void)
88 struct panthcpu_registers *cpuregs =
89 (struct panthcpu_registers*) PANTHEON_CPU_BASE;
91 id = readl(&cpuregs->chip_id);
92 printf("SoC: PANTHEON 88AP%X-%X\n", (id & 0xFFF), (id >> 0x10));
98 void i2c_clk_enable(void)