1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#include <linux/kernel.h>
16#include <linux/platform_device.h>
17#include <linux/types.h>
18#include <linux/sched.h>
19#include <linux/interrupt.h>
20#include <linux/init.h>
21#include <linux/errno.h>
22#include <linux/spinlock.h>
23#include <linux/module.h>
24
25#include <linux/proc_fs.h>
26#include <linux/sysctl.h>
27
28#include <asm/irq.h>
29#include <asm/setup.h>
30#include <asm/mach-types.h>
31#include <asm/mach/time.h>
32
33#include <asm/mach/arch.h>
34#include <mach/dma.h>
35#include <mach/hardware.h>
36#include <mach/csp/mm_io.h>
37#include <mach/csp/chipcHw_def.h>
38#include <mach/csp/chipcHw_inline.h>
39
40#include <cfg_global.h>
41
42#include "core.h"
43
44HW_DECLARE_SPINLOCK(arch)
45HW_DECLARE_SPINLOCK(gpio)
46#if defined(CONFIG_DEBUG_SPINLOCK)
47 EXPORT_SYMBOL(bcmring_gpio_reg_lock);
48#endif
49
50
51#define BCM_SYSCTL_REBOOT_WARM 1
52#define CTL_BCM_REBOOT 112
53
54
55int bcmring_arch_warm_reboot;
56
57static struct ctl_table_header *bcmring_sysctl_header;
58
59static struct ctl_table bcmring_sysctl_warm_reboot[] = {
60 {
61 .ctl_name = BCM_SYSCTL_REBOOT_WARM,
62 .procname = "warm",
63 .data = &bcmring_arch_warm_reboot,
64 .maxlen = sizeof(int),
65 .mode = 0644,
66 .proc_handler = &proc_dointvec},
67 {}
68};
69
70static struct ctl_table bcmring_sysctl_reboot[] = {
71 {
72 .ctl_name = CTL_BCM_REBOOT,
73 .procname = "reboot",
74 .mode = 0555,
75 .child = bcmring_sysctl_warm_reboot},
76 {}
77};
78
79static struct platform_device nand_device = {
80 .name = "bcm-nand",
81 .id = -1,
82};
83
84static struct platform_device *devices[] __initdata = {
85 &nand_device,
86};
87
88
89
90
91
92
93
94
95
96
97static void __init bcmring_init_machine(void)
98{
99
100 bcmring_sysctl_header = register_sysctl_table(bcmring_sysctl_reboot);
101
102
103 chipcHw_enableSpreadSpectrum();
104
105 platform_add_devices(devices, ARRAY_SIZE(devices));
106
107 bcmring_amba_init();
108
109 dma_init();
110}
111
112
113
114
115
116
117
118
119static void __init bcmring_fixup(struct machine_desc *desc,
120 struct tag *t, char **cmdline, struct meminfo *mi) {
121#ifdef CONFIG_BLK_DEV_INITRD
122 printk(KERN_NOTICE "bcmring_fixup\n");
123 t->hdr.tag = ATAG_CORE;
124 t->hdr.size = tag_size(tag_core);
125 t->u.core.flags = 0;
126 t->u.core.pagesize = PAGE_SIZE;
127 t->u.core.rootdev = 31 << 8 | 0;
128 t = tag_next(t);
129
130 t->hdr.tag = ATAG_MEM;
131 t->hdr.size = tag_size(tag_mem32);
132 t->u.mem.start = CFG_GLOBAL_RAM_BASE;
133 t->u.mem.size = CFG_GLOBAL_RAM_SIZE;
134
135 t = tag_next(t);
136
137 t->hdr.tag = ATAG_NONE;
138 t->hdr.size = 0;
139#endif
140}
141
142
143
144
145
146
147
148MACHINE_START(BCMRING, "BCMRING")
149
150 .phys_io = MM_IO_START,
151 .io_pg_offst = (MM_IO_BASE >> 18) & 0xfffc,
152 .fixup = bcmring_fixup,
153 .map_io = bcmring_map_io,
154 .init_irq = bcmring_init_irq,
155 .timer = &bcmring_timer,
156 .init_machine = bcmring_init_machine
157MACHINE_END
158