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