1
2
3
4
5
6
7
8
9#include <common.h>
10#include <cpu_func.h>
11#include <init.h>
12#include <asm/arch/cpu.h>
13#include <asm/arch/armada100.h>
14
15#define UARTCLK14745KHZ (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1))
16#define SET_MRVL_ID (1<<8)
17#define L2C_RAM_SEL (1<<4)
18
19int arch_cpu_init(void)
20{
21 u32 val;
22 struct armd1cpu_registers *cpuregs =
23 (struct armd1cpu_registers *) ARMD1_CPU_BASE;
24
25 struct armd1apb1_registers *apb1clkres =
26 (struct armd1apb1_registers *) ARMD1_APBC1_BASE;
27
28 struct armd1mpmu_registers *mpmu =
29 (struct armd1mpmu_registers *) ARMD1_MPMU_BASE;
30
31
32 val = readl(&cpuregs->cpu_conf);
33 val = val | SET_MRVL_ID;
34 writel(val, &cpuregs->cpu_conf);
35
36
37 writel(0xFFFFFFFF, &mpmu->acgr);
38
39
40 writel(APBC_APBCLK | APBC_FNCLK, &apb1clkres->aib);
41
42
43 val = readl(&cpuregs->cpu_conf);
44 val = val & ~(L2C_RAM_SEL);
45 writel(val, &cpuregs->cpu_conf);
46
47
48 writel(APBC_APBCLK, &apb1clkres->gpio);
49
50#ifdef CONFIG_I2C_MV
51
52 writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi0);
53 writel(APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi0);
54
55
56 writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi1);
57 writel(APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi1);
58#endif
59
60
61
62
63
64#if (CONFIG_SYS_NS16550_COM1 == ARMD1_UART3_BASE)
65 writel(UARTCLK14745KHZ, &apb1clkres->uart3);
66#elif (CONFIG_SYS_NS16550_COM1 == ARMD1_UART2_BASE)
67 writel(UARTCLK14745KHZ, &apb1clkres->uart2);
68#else
69 writel(UARTCLK14745KHZ, &apb1clkres->uart1);
70#endif
71 icache_enable();
72
73 return 0;
74}
75
76#if defined(CONFIG_DISPLAY_CPUINFO)
77int print_cpuinfo(void)
78{
79 u32 id;
80 struct armd1cpu_registers *cpuregs =
81 (struct armd1cpu_registers *) ARMD1_CPU_BASE;
82
83 id = readl(&cpuregs->chip_id);
84 printf("SoC: Armada 88AP%X-%X\n", (id & 0xFFF), (id >> 0x10));
85 return 0;
86}
87#endif
88
89#ifdef CONFIG_I2C_MV
90void i2c_clk_enable(void)
91{
92}
93#endif
94