2 * arch/arm/mach-orion5x/kurobox_pro-setup.c
4 * Maintainer: Ronen Shitrit <rshitrit@marvell.com>
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/pci.h>
15 #include <linux/irq.h>
16 #include <linux/mtd/physmap.h>
17 #include <linux/mtd/nand.h>
18 #include <linux/mv643xx_eth.h>
19 #include <linux/i2c.h>
20 #include <linux/ata_platform.h>
21 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/pci.h>
25 #include <asm/arch/orion5x.h>
26 #include <asm/plat-orion/orion_nand.h>
30 /*****************************************************************************
32 ****************************************************************************/
35 * 256K NOR flash Device bus boot chip select
38 #define KUROBOX_PRO_NOR_BOOT_BASE 0xf4000000
39 #define KUROBOX_PRO_NOR_BOOT_SIZE SZ_256K
42 * 256M NAND flash on Device bus chip select 1
45 #define KUROBOX_PRO_NAND_BASE 0xfc000000
46 #define KUROBOX_PRO_NAND_SIZE SZ_2M
48 /*****************************************************************************
49 * 256MB NAND Flash on Device bus CS0
50 ****************************************************************************/
52 static struct mtd_partition kurobox_pro_nand_parts[] = {
63 .offset = SZ_4M + SZ_64M,
64 .size = SZ_256M - (SZ_4M + SZ_64M),
68 static struct resource kurobox_pro_nand_resource = {
69 .flags = IORESOURCE_MEM,
70 .start = KUROBOX_PRO_NAND_BASE,
71 .end = KUROBOX_PRO_NAND_BASE + KUROBOX_PRO_NAND_SIZE - 1,
74 static struct orion_nand_data kurobox_pro_nand_data = {
75 .parts = kurobox_pro_nand_parts,
76 .nr_parts = ARRAY_SIZE(kurobox_pro_nand_parts),
82 static struct platform_device kurobox_pro_nand_flash = {
86 .platform_data = &kurobox_pro_nand_data,
88 .resource = &kurobox_pro_nand_resource,
92 /*****************************************************************************
93 * 256KB NOR Flash on BOOT Device
94 ****************************************************************************/
96 static struct physmap_flash_data kurobox_pro_nor_flash_data = {
100 static struct resource kurobox_pro_nor_flash_resource = {
101 .flags = IORESOURCE_MEM,
102 .start = KUROBOX_PRO_NOR_BOOT_BASE,
103 .end = KUROBOX_PRO_NOR_BOOT_BASE + KUROBOX_PRO_NOR_BOOT_SIZE - 1,
106 static struct platform_device kurobox_pro_nor_flash = {
107 .name = "physmap-flash",
110 .platform_data = &kurobox_pro_nor_flash_data,
113 .resource = &kurobox_pro_nor_flash_resource,
116 /*****************************************************************************
118 ****************************************************************************/
120 static int __init kurobox_pro_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
125 * Check for devices with hard-wired IRQs.
127 irq = orion5x_pci_map_irq(dev, slot, pin);
132 * PCI isn't used on the Kuro
134 printk(KERN_ERR "kurobox_pro_pci_map_irq failed, unknown bus\n");
139 static struct hw_pci kurobox_pro_pci __initdata = {
141 .swizzle = pci_std_swizzle,
142 .setup = orion5x_pci_sys_setup,
143 .scan = orion5x_pci_sys_scan_bus,
144 .map_irq = kurobox_pro_pci_map_irq,
147 static int __init kurobox_pro_pci_init(void)
149 if (machine_is_kurobox_pro())
150 pci_common_init(&kurobox_pro_pci);
155 subsys_initcall(kurobox_pro_pci_init);
157 /*****************************************************************************
159 ****************************************************************************/
161 static struct mv643xx_eth_platform_data kurobox_pro_eth_data = {
166 /*****************************************************************************
167 * RTC 5C372a on I2C bus
168 ****************************************************************************/
169 static struct i2c_board_info __initdata kurobox_pro_i2c_rtc = {
170 I2C_BOARD_INFO("rs5c372a", 0x32),
173 /*****************************************************************************
175 ****************************************************************************/
176 static struct mv_sata_platform_data kurobox_pro_sata_data = {
180 /*****************************************************************************
182 ****************************************************************************/
183 static struct orion5x_mpp_mode kurobox_pro_mpp_modes[] __initdata = {
186 { 2, MPP_GPIO }, /* GPIO Micon */
187 { 3, MPP_GPIO }, /* GPIO Rtc */
190 { 6, MPP_NAND }, /* NAND Flash REn */
191 { 7, MPP_NAND }, /* NAND Flash WEn */
196 { 12, MPP_SATA_LED }, /* SATA 0 presence */
197 { 13, MPP_SATA_LED }, /* SATA 1 presence */
198 { 14, MPP_SATA_LED }, /* SATA 0 active */
199 { 15, MPP_SATA_LED }, /* SATA 1 active */
207 static void __init kurobox_pro_init(void)
210 * Setup basic Orion functions. Need to be called early.
214 orion5x_mpp_conf(kurobox_pro_mpp_modes);
217 * Configure peripherals.
219 orion5x_ehci0_init();
220 orion5x_ehci1_init();
221 orion5x_eth_init(&kurobox_pro_eth_data);
223 orion5x_sata_init(&kurobox_pro_sata_data);
224 orion5x_uart0_init();
226 orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE,
227 KUROBOX_PRO_NOR_BOOT_SIZE);
228 platform_device_register(&kurobox_pro_nor_flash);
230 if (machine_is_kurobox_pro()) {
231 orion5x_setup_dev0_win(KUROBOX_PRO_NAND_BASE,
232 KUROBOX_PRO_NAND_SIZE);
233 platform_device_register(&kurobox_pro_nand_flash);
236 i2c_register_board_info(0, &kurobox_pro_i2c_rtc, 1);
239 #ifdef CONFIG_MACH_KUROBOX_PRO
240 MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
241 /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */
242 .phys_io = ORION5X_REGS_PHYS_BASE,
243 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
244 .boot_params = 0x00000100,
245 .init_machine = kurobox_pro_init,
246 .map_io = orion5x_map_io,
247 .init_irq = orion5x_init_irq,
248 .timer = &orion5x_timer,
249 .fixup = tag_fixup_mem32,
253 #ifdef CONFIG_MACH_LINKSTATION_PRO
254 MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
255 /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */
256 .phys_io = ORION5X_REGS_PHYS_BASE,
257 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
258 .boot_params = 0x00000100,
259 .init_machine = kurobox_pro_init,
260 .map_io = orion5x_map_io,
261 .init_irq = orion5x_init_irq,
262 .timer = &orion5x_timer,
263 .fixup = tag_fixup_mem32,