blob: 82ebcd30465e8caf6f02c37b4aeda2929f979299 [file] [log] [blame]
viresh kumarbc4e8142010-04-01 12:30:58 +01001/*
2 * arch/arm/mach-spear3xx/spear3xx.c
3 *
4 * SPEAr3XX machines common source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/types.h>
15#include <linux/amba/pl061.h>
16#include <linux/ptrace.h>
17#include <linux/io.h>
18#include <asm/hardware/vic.h>
19#include <asm/irq.h>
20#include <asm/mach/arch.h>
21#include <mach/generic.h>
22#include <mach/spear.h>
23
24/* Add spear3xx machines common devices here */
25/* gpio device registeration */
26static struct pl061_platform_data gpio_plat_data = {
27 .gpio_base = 0,
28 .irq_base = SPEAR_GPIO_INT_BASE,
29};
30
31struct amba_device gpio_device = {
32 .dev = {
33 .init_name = "gpio",
34 .platform_data = &gpio_plat_data,
35 },
36 .res = {
37 .start = SPEAR3XX_ICM3_GPIO_BASE,
38 .end = SPEAR3XX_ICM3_GPIO_BASE + SPEAR3XX_ICM3_GPIO_SIZE - 1,
39 .flags = IORESOURCE_MEM,
40 },
41 .irq = {IRQ_BASIC_GPIO, NO_IRQ},
42};
43
44/* uart device registeration */
45struct amba_device uart_device = {
46 .dev = {
47 .init_name = "uart",
48 },
49 .res = {
50 .start = SPEAR3XX_ICM1_UART_BASE,
51 .end = SPEAR3XX_ICM1_UART_BASE + SPEAR3XX_ICM1_UART_SIZE - 1,
52 .flags = IORESOURCE_MEM,
53 },
54 .irq = {IRQ_UART, NO_IRQ},
55};
56
57/* Do spear3xx familiy common initialization part here */
58void __init spear3xx_init(void)
59{
60 /* nothing to do for now */
61}
62
63/* This will initialize vic */
64void __init spear3xx_init_irq(void)
65{
66 vic_init((void __iomem *)VA_SPEAR3XX_ML1_VIC_BASE, 0, ~0, 0);
67}
68
69/* Following will create static virtual/physical mappings */
70struct map_desc spear3xx_io_desc[] __initdata = {
71 {
72 .virtual = VA_SPEAR3XX_ICM1_UART_BASE,
73 .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE),
74 .length = SPEAR3XX_ICM1_UART_SIZE,
75 .type = MT_DEVICE
76 }, {
77 .virtual = VA_SPEAR3XX_ML1_VIC_BASE,
78 .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE),
79 .length = SPEAR3XX_ML1_VIC_SIZE,
80 .type = MT_DEVICE
81 }, {
82 .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE,
83 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE),
84 .length = SPEAR3XX_ICM3_SYS_CTRL_SIZE,
85 .type = MT_DEVICE
86 }, {
87 .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE,
88 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE),
89 .length = SPEAR3XX_ICM3_MISC_REG_SIZE,
90 .type = MT_DEVICE
91 },
92};
93
94/* This will create static memory mapping for selected devices */
95void __init spear3xx_map_io(void)
96{
97 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
98
99 /* This will initialize clock framework */
100 clk_init();
101}