ARM: mach-ep93xx: convert boot_params to atag_offset
[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
d941caa2 24
14636005
HF
25/*************************************************************************
26 * Micro9 NOR Flash
27 *
28 * Micro9-High has up to 64MB of 32-bit flash on CS1
29 * Micro9-Mid has up to 64MB of either 32-bit or 16-bit flash on CS1
3ad2f3fb 30 * Micro9-Lite uses a separate MTD map driver for flash support
7232344d 31 * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1
14636005 32 *************************************************************************/
14636005 33static unsigned int __init micro9_detect_bootwidth(void)
d941caa2 34{
14636005
HF
35 u32 v;
36
37 /* Detect the bus width of the external flash memory */
38 v = __raw_readl(EP93XX_SYSCON_SYSCFG);
39 if (v & EP93XX_SYSCON_SYSCFG_LCSN7)
40 return 4; /* 32-bit */
41 else
42 return 2; /* 16-bit */
d941caa2
MG
43}
44
14636005
HF
45static void __init micro9_register_flash(void)
46{
16bcf78f
HS
47 unsigned int width;
48
14636005 49 if (machine_is_micro9())
16bcf78f 50 width = 4;
7232344d 51 else if (machine_is_micro9m() || machine_is_micro9s())
16bcf78f
HS
52 width = micro9_detect_bootwidth();
53 else
54 width = 0;
55
56 if (width)
57 ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M);
14636005
HF
58}
59
60
61/*************************************************************************
62 * Micro9 Ethernet
63 *************************************************************************/
b370e082 64static struct ep93xx_eth_data __initdata micro9_eth_data = {
14636005
HF
65 .phy_id = 0x1f,
66};
67
68
69static void __init micro9_init_machine(void)
d941caa2 70{
e48f3fa3 71 ep93xx_init_devices();
14636005
HF
72 ep93xx_register_eth(&micro9_eth_data, 1);
73 micro9_register_flash();
d941caa2
MG
74}
75
14636005
HF
76
77#ifdef CONFIG_MACH_MICRO9H
78MACHINE_START(MICRO9, "Contec Micro9-High")
94150095 79 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e562cf17 80 .atag_offset = 0x100,
e48f3fa3
HS
81 .map_io = ep93xx_map_io,
82 .init_irq = ep93xx_init_irq,
83 .timer = &ep93xx_timer,
14636005 84 .init_machine = micro9_init_machine,
d941caa2
MG
85MACHINE_END
86#endif
87
d941caa2 88#ifdef CONFIG_MACH_MICRO9M
14636005 89MACHINE_START(MICRO9M, "Contec Micro9-Mid")
94150095 90 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e562cf17 91 .atag_offset = 0x100,
e48f3fa3
HS
92 .map_io = ep93xx_map_io,
93 .init_irq = ep93xx_init_irq,
94 .timer = &ep93xx_timer,
14636005 95 .init_machine = micro9_init_machine,
d941caa2
MG
96MACHINE_END
97#endif
98
d941caa2 99#ifdef CONFIG_MACH_MICRO9L
14636005 100MACHINE_START(MICRO9L, "Contec Micro9-Lite")
94150095 101 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e562cf17 102 .atag_offset = 0x100,
e48f3fa3
HS
103 .map_io = ep93xx_map_io,
104 .init_irq = ep93xx_init_irq,
105 .timer = &ep93xx_timer,
14636005 106 .init_machine = micro9_init_machine,
d941caa2
MG
107MACHINE_END
108#endif
7232344d
HF
109
110#ifdef CONFIG_MACH_MICRO9S
111MACHINE_START(MICRO9S, "Contec Micro9-Slim")
112 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
e562cf17 113 .atag_offset = 0x100,
7232344d
HF
114 .map_io = ep93xx_map_io,
115 .init_irq = ep93xx_init_irq,
116 .timer = &ep93xx_timer,
117 .init_machine = micro9_init_machine,
118MACHINE_END
119#endif
This page took 0.337983 seconds and 5 git commands to generate.