2 * linux/arch/arm/mach-ep93xx/micro9.c
4 * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH
5 * Manfred Gruber <m.gruber@tirol.com>
6 * Copyright (C) 2009 Contec Steuerungstechnik & Automation GmbH
7 * Hubert Feurstein <hubert.feurstein@contec.at>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
17 #include <linux/mtd/physmap.h>
20 #include <mach/hardware.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
26 /*************************************************************************
29 * Micro9-High has up to 64MB of 32-bit flash on CS1
30 * Micro9-Mid has up to 64MB of either 32-bit or 16-bit flash on CS1
31 * Micro9-Lite uses a seperate MTD map driver for flash support
32 * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1
33 *************************************************************************/
34 static struct physmap_flash_data micro9_flash_data
;
36 static struct resource micro9_flash_resource
= {
37 .start
= EP93XX_CS1_PHYS_BASE
,
38 .end
= EP93XX_CS1_PHYS_BASE
+ SZ_64M
- 1,
39 .flags
= IORESOURCE_MEM
,
42 static struct platform_device micro9_flash
= {
43 .name
= "physmap-flash",
46 .platform_data
= µ9_flash_data
,
49 .resource
= µ9_flash_resource
,
52 static void __init
__micro9_register_flash(unsigned int width
)
54 micro9_flash_data
.width
= width
;
56 platform_device_register(µ9_flash
);
59 static unsigned int __init
micro9_detect_bootwidth(void)
63 /* Detect the bus width of the external flash memory */
64 v
= __raw_readl(EP93XX_SYSCON_SYSCFG
);
65 if (v
& EP93XX_SYSCON_SYSCFG_LCSN7
)
66 return 4; /* 32-bit */
68 return 2; /* 16-bit */
71 static void __init
micro9_register_flash(void)
73 if (machine_is_micro9())
74 __micro9_register_flash(4);
75 else if (machine_is_micro9m() || machine_is_micro9s())
76 __micro9_register_flash(micro9_detect_bootwidth());
80 /*************************************************************************
82 *************************************************************************/
83 static struct ep93xx_eth_data micro9_eth_data
= {
88 static void __init
micro9_init_machine(void)
90 ep93xx_init_devices();
91 ep93xx_register_eth(µ9_eth_data
, 1);
92 micro9_register_flash();
96 #ifdef CONFIG_MACH_MICRO9H
97 MACHINE_START(MICRO9
, "Contec Micro9-High")
98 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
99 .phys_io
= EP93XX_APB_PHYS_BASE
,
100 .io_pg_offst
= ((EP93XX_APB_VIRT_BASE
) >> 18) & 0xfffc,
101 .boot_params
= EP93XX_SDCE3_PHYS_BASE_SYNC
+ 0x100,
102 .map_io
= ep93xx_map_io
,
103 .init_irq
= ep93xx_init_irq
,
104 .timer
= &ep93xx_timer
,
105 .init_machine
= micro9_init_machine
,
109 #ifdef CONFIG_MACH_MICRO9M
110 MACHINE_START(MICRO9M
, "Contec Micro9-Mid")
111 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
112 .phys_io
= EP93XX_APB_PHYS_BASE
,
113 .io_pg_offst
= ((EP93XX_APB_VIRT_BASE
) >> 18) & 0xfffc,
114 .boot_params
= EP93XX_SDCE3_PHYS_BASE_ASYNC
+ 0x100,
115 .map_io
= ep93xx_map_io
,
116 .init_irq
= ep93xx_init_irq
,
117 .timer
= &ep93xx_timer
,
118 .init_machine
= micro9_init_machine
,
122 #ifdef CONFIG_MACH_MICRO9L
123 MACHINE_START(MICRO9L
, "Contec Micro9-Lite")
124 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
125 .phys_io
= EP93XX_APB_PHYS_BASE
,
126 .io_pg_offst
= ((EP93XX_APB_VIRT_BASE
) >> 18) & 0xfffc,
127 .boot_params
= EP93XX_SDCE3_PHYS_BASE_SYNC
+ 0x100,
128 .map_io
= ep93xx_map_io
,
129 .init_irq
= ep93xx_init_irq
,
130 .timer
= &ep93xx_timer
,
131 .init_machine
= micro9_init_machine
,
135 #ifdef CONFIG_MACH_MICRO9S
136 MACHINE_START(MICRO9S
, "Contec Micro9-Slim")
137 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
138 .phys_io
= EP93XX_APB_PHYS_BASE
,
139 .io_pg_offst
= ((EP93XX_APB_VIRT_BASE
) >> 18) & 0xfffc,
140 .boot_params
= EP93XX_SDCE3_PHYS_BASE_ASYNC
+ 0x100,
141 .map_io
= ep93xx_map_io
,
142 .init_irq
= ep93xx_init_irq
,
143 .timer
= &ep93xx_timer
,
144 .init_machine
= micro9_init_machine
,