5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/arch/hardware.h>
27 #include <asm/arch/spr_misc.h>
29 int arch_cpu_init(void)
31 struct misc_regs *const misc_p =
32 (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
33 u32 periph1_clken, periph_clk_cfg;
35 periph1_clken = readl(&misc_p->periph1_clken);
37 #if defined(CONFIG_SPEAR3XX)
38 periph1_clken |= MISC_GPT2ENB;
39 #elif defined(CONFIG_SPEAR600)
40 periph1_clken |= MISC_GPT3ENB;
43 #if defined(CONFIG_PL011_SERIAL)
44 periph1_clken |= MISC_UART0ENB;
46 periph_clk_cfg = readl(&misc_p->periph_clk_cfg);
47 periph_clk_cfg &= ~CONFIG_SPEAR_UARTCLKMSK;
48 periph_clk_cfg |= CONFIG_SPEAR_UART48M;
49 writel(periph_clk_cfg, &misc_p->periph_clk_cfg);
51 #if defined(CONFIG_DESIGNWARE_ETH)
52 periph1_clken |= MISC_ETHENB;
54 #if defined(CONFIG_DW_UDC)
55 periph1_clken |= MISC_USBDENB;
57 #if defined(CONFIG_DW_I2C)
58 periph1_clken |= MISC_I2CENB;
60 #if defined(CONFIG_ST_SMI)
61 periph1_clken |= MISC_SMIENB;
63 #if defined(CONFIG_NAND_FSMC)
64 periph1_clken |= MISC_FSMCENB;
67 writel(periph1_clken, &misc_p->periph1_clken);
71 #ifdef CONFIG_DISPLAY_CPUINFO
72 int print_cpuinfo(void)
74 #ifdef CONFIG_SPEAR300
75 printf("CPU: SPEAr300\n");
76 #elif defined(CONFIG_SPEAR310)
77 printf("CPU: SPEAr310\n");
78 #elif defined(CONFIG_SPEAR320)
79 printf("CPU: SPEAr320\n");
80 #elif defined(CONFIG_SPEAR600)
81 printf("CPU: SPEAr600\n");
83 #error CPU not supported in spear platform