Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[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>
d525753b 17#include <linux/io.h>
d941caa2 18
a09e64fb 19#include <mach/hardware.h>
d941caa2 20
d941caa2 21#include <asm/mach-types.h>
583ddafe
HS
22#include <asm/mach/arch.h>
23
258249ec 24#include "soc.h"
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
3ad2f3fb 31 * Micro9-Lite uses a separate 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 33 *************************************************************************/
14636005 34static unsigned int __init micro9_detect_bootwidth(void)
d941caa2 35{
14636005
HF
36 u32 v;
37
38 /* Detect the bus width of the external flash memory */
39 v = __raw_readl(EP93XX_SYSCON_SYSCFG);
40 if (v & EP93XX_SYSCON_SYSCFG_LCSN7)
41 return 4; /* 32-bit */
42 else
43 return 2; /* 16-bit */
d941caa2
MG
44}
45
14636005
HF
46static void __init micro9_register_flash(void)
47{
16bcf78f
HS
48 unsigned int width;
49
14636005 50 if (machine_is_micro9())
16bcf78f 51 width = 4;
7232344d 52 else if (machine_is_micro9m() || machine_is_micro9s())
16bcf78f
HS
53 width = micro9_detect_bootwidth();
54 else
55 width = 0;
56
57 if (width)
58 ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M);
14636005
HF
59}
60
61
62/*************************************************************************
63 * Micro9 Ethernet
64 *************************************************************************/
b370e082 65static struct ep93xx_eth_data __initdata micro9_eth_data = {
14636005
HF
66 .phy_id = 0x1f,
67};
68
69
70static void __init micro9_init_machine(void)
d941caa2 71{
e48f3fa3 72 ep93xx_init_devices();
14636005
HF
73 ep93xx_register_eth(&micro9_eth_data, 1);
74 micro9_register_flash();
d941caa2
MG
75}
76
14636005
HF
77
78#ifdef CONFIG_MACH_MICRO9H
79MACHINE_START(MICRO9, "Contec Micro9-High")
94150095 80 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e562cf17 81 .atag_offset = 0x100,
e48f3fa3
HS
82 .map_io = ep93xx_map_io,
83 .init_irq = ep93xx_init_irq,
6bb27d73 84 .init_time = ep93xx_timer_init,
14636005 85 .init_machine = micro9_init_machine,
c914283f 86 .init_late = ep93xx_init_late,
3275166e 87 .restart = ep93xx_restart,
d941caa2
MG
88MACHINE_END
89#endif
90
d941caa2 91#ifdef CONFIG_MACH_MICRO9M
14636005 92MACHINE_START(MICRO9M, "Contec Micro9-Mid")
94150095 93 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e562cf17 94 .atag_offset = 0x100,
e48f3fa3
HS
95 .map_io = ep93xx_map_io,
96 .init_irq = ep93xx_init_irq,
6bb27d73 97 .init_time = ep93xx_timer_init,
14636005 98 .init_machine = micro9_init_machine,
c914283f 99 .init_late = ep93xx_init_late,
3275166e 100 .restart = ep93xx_restart,
d941caa2
MG
101MACHINE_END
102#endif
103
d941caa2 104#ifdef CONFIG_MACH_MICRO9L
14636005 105MACHINE_START(MICRO9L, "Contec Micro9-Lite")
94150095 106 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e562cf17 107 .atag_offset = 0x100,
e48f3fa3
HS
108 .map_io = ep93xx_map_io,
109 .init_irq = ep93xx_init_irq,
6bb27d73 110 .init_time = ep93xx_timer_init,
14636005 111 .init_machine = micro9_init_machine,
c914283f 112 .init_late = ep93xx_init_late,
3275166e 113 .restart = ep93xx_restart,
d941caa2
MG
114MACHINE_END
115#endif
7232344d
HF
116
117#ifdef CONFIG_MACH_MICRO9S
118MACHINE_START(MICRO9S, "Contec Micro9-Slim")
119 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e562cf17 120 .atag_offset = 0x100,
7232344d
HF
121 .map_io = ep93xx_map_io,
122 .init_irq = ep93xx_init_irq,
6bb27d73 123 .init_time = ep93xx_timer_init,
7232344d 124 .init_machine = micro9_init_machine,
c914283f 125 .init_late = ep93xx_init_late,
3275166e 126 .restart = ep93xx_restart,
7232344d
HF
127MACHINE_END
128#endif
This page took 0.467964 seconds and 5 git commands to generate.