tree-wide: fix 'lenght' typo in comments and code
[deliverable/linux.git] / arch / arm / mach-ep93xx / micro9.c
CommitLineData
d941caa2
MG
1/*
2 * linux/arch/arm/mach-ep93xx/micro9.c
3 *
4 * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH
94150095
HF
5 * Manfred Gruber <m.gruber@tirol.com>
6 * Copyright (C) 2009 Contec Steuerungstechnik & Automation GmbH
7 * Hubert Feurstein <hubert.feurstein@contec.at>
d941caa2
MG
8 *
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.
12 */
13
d941caa2 14#include <linux/kernel.h>
583ddafe 15#include <linux/init.h>
d941caa2 16#include <linux/platform_device.h>
d941caa2 17#include <linux/mtd/physmap.h>
d525753b 18#include <linux/io.h>
d941caa2 19
a09e64fb 20#include <mach/hardware.h>
d941caa2 21
d941caa2 22#include <asm/mach-types.h>
583ddafe
HS
23#include <asm/mach/arch.h>
24
d941caa2 25
14636005
HF
26/*************************************************************************
27 * Micro9 NOR Flash
28 *
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
7232344d 32 * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1
14636005
HF
33 *************************************************************************/
34static struct physmap_flash_data micro9_flash_data;
d941caa2 35
14636005 36static struct resource micro9_flash_resource = {
e48f3fa3
HS
37 .start = EP93XX_CS1_PHYS_BASE,
38 .end = EP93XX_CS1_PHYS_BASE + SZ_64M - 1,
39 .flags = IORESOURCE_MEM,
d941caa2
MG
40};
41
14636005 42static struct platform_device micro9_flash = {
e48f3fa3
HS
43 .name = "physmap-flash",
44 .id = 0,
45 .dev = {
14636005 46 .platform_data = &micro9_flash_data,
e48f3fa3
HS
47 },
48 .num_resources = 1,
14636005 49 .resource = &micro9_flash_resource,
d941caa2
MG
50};
51
14636005
HF
52static void __init __micro9_register_flash(unsigned int width)
53{
54 micro9_flash_data.width = width;
55
56 platform_device_register(&micro9_flash);
57}
58
59static unsigned int __init micro9_detect_bootwidth(void)
d941caa2 60{
14636005
HF
61 u32 v;
62
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 */
67 else
68 return 2; /* 16-bit */
d941caa2
MG
69}
70
14636005
HF
71static void __init micro9_register_flash(void)
72{
73 if (machine_is_micro9())
74 __micro9_register_flash(4);
7232344d 75 else if (machine_is_micro9m() || machine_is_micro9s())
14636005
HF
76 __micro9_register_flash(micro9_detect_bootwidth());
77}
78
79
80/*************************************************************************
81 * Micro9 Ethernet
82 *************************************************************************/
83static struct ep93xx_eth_data micro9_eth_data = {
84 .phy_id = 0x1f,
85};
86
87
88static void __init micro9_init_machine(void)
d941caa2 89{
e48f3fa3 90 ep93xx_init_devices();
14636005
HF
91 ep93xx_register_eth(&micro9_eth_data, 1);
92 micro9_register_flash();
d941caa2
MG
93}
94
14636005
HF
95
96#ifdef CONFIG_MACH_MICRO9H
97MACHINE_START(MICRO9, "Contec Micro9-High")
94150095 98 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e48f3fa3
HS
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,
14636005 105 .init_machine = micro9_init_machine,
d941caa2
MG
106MACHINE_END
107#endif
108
d941caa2 109#ifdef CONFIG_MACH_MICRO9M
14636005 110MACHINE_START(MICRO9M, "Contec Micro9-Mid")
94150095 111 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e48f3fa3
HS
112 .phys_io = EP93XX_APB_PHYS_BASE,
113 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
14636005 114 .boot_params = EP93XX_SDCE3_PHYS_BASE_ASYNC + 0x100,
e48f3fa3
HS
115 .map_io = ep93xx_map_io,
116 .init_irq = ep93xx_init_irq,
117 .timer = &ep93xx_timer,
14636005 118 .init_machine = micro9_init_machine,
d941caa2
MG
119MACHINE_END
120#endif
121
d941caa2 122#ifdef CONFIG_MACH_MICRO9L
14636005 123MACHINE_START(MICRO9L, "Contec Micro9-Lite")
94150095 124 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e48f3fa3
HS
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,
14636005 131 .init_machine = micro9_init_machine,
d941caa2
MG
132MACHINE_END
133#endif
7232344d
HF
134
135#ifdef CONFIG_MACH_MICRO9S
136MACHINE_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,
145MACHINE_END
146#endif
This page took 0.264288 seconds and 5 git commands to generate.