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
137 static struct hw_pci kurobox_pro_pci __initdata = {
139 .swizzle = pci_std_swizzle,
140 .setup = orion5x_pci_sys_setup,
141 .scan = orion5x_pci_sys_scan_bus,
142 .map_irq = kurobox_pro_pci_map_irq,
145 static int __init kurobox_pro_pci_init(void)
147 if (machine_is_kurobox_pro())
148 pci_common_init(&kurobox_pro_pci);
153 subsys_initcall(kurobox_pro_pci_init);
155 /*****************************************************************************
157 ****************************************************************************/
159 static struct mv643xx_eth_platform_data kurobox_pro_eth_data = {
163 /*****************************************************************************
164 * RTC 5C372a on I2C bus
165 ****************************************************************************/
166 static struct i2c_board_info __initdata kurobox_pro_i2c_rtc = {
167 I2C_BOARD_INFO("rs5c372a", 0x32),
170 /*****************************************************************************
172 ****************************************************************************/
173 static struct mv_sata_platform_data kurobox_pro_sata_data = {
177 /*****************************************************************************
179 ****************************************************************************/
180 static struct orion5x_mpp_mode kurobox_pro_mpp_modes[] __initdata = {
183 { 2, MPP_GPIO }, /* GPIO Micon */
184 { 3, MPP_GPIO }, /* GPIO Rtc */
187 { 6, MPP_NAND }, /* NAND Flash REn */
188 { 7, MPP_NAND }, /* NAND Flash WEn */
193 { 12, MPP_SATA_LED }, /* SATA 0 presence */
194 { 13, MPP_SATA_LED }, /* SATA 1 presence */
195 { 14, MPP_SATA_LED }, /* SATA 0 active */
196 { 15, MPP_SATA_LED }, /* SATA 1 active */
204 static void __init kurobox_pro_init(void)
207 * Setup basic Orion functions. Need to be called early.
211 orion5x_mpp_conf(kurobox_pro_mpp_modes);
214 * Configure peripherals.
216 orion5x_ehci0_init();
217 orion5x_ehci1_init();
218 orion5x_eth_init(&kurobox_pro_eth_data);
220 orion5x_sata_init(&kurobox_pro_sata_data);
221 orion5x_uart0_init();
223 orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE,
224 KUROBOX_PRO_NOR_BOOT_SIZE);
225 platform_device_register(&kurobox_pro_nor_flash);
227 if (machine_is_kurobox_pro()) {
228 orion5x_setup_dev0_win(KUROBOX_PRO_NAND_BASE,
229 KUROBOX_PRO_NAND_SIZE);
230 platform_device_register(&kurobox_pro_nand_flash);
233 i2c_register_board_info(0, &kurobox_pro_i2c_rtc, 1);
236 #ifdef CONFIG_MACH_KUROBOX_PRO
237 MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
238 /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */
239 .phys_io = ORION5X_REGS_PHYS_BASE,
240 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
241 .boot_params = 0x00000100,
242 .init_machine = kurobox_pro_init,
243 .map_io = orion5x_map_io,
244 .init_irq = orion5x_init_irq,
245 .timer = &orion5x_timer,
246 .fixup = tag_fixup_mem32,
250 #ifdef CONFIG_MACH_LINKSTATION_PRO
251 MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
252 /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */
253 .phys_io = ORION5X_REGS_PHYS_BASE,
254 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
255 .boot_params = 0x00000100,
256 .init_machine = kurobox_pro_init,
257 .map_io = orion5x_map_io,
258 .init_irq = orion5x_init_irq,
259 .timer = &orion5x_timer,
260 .fixup = tag_fixup_mem32,