1
2
3
4
5
6
7
8
9
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/io.h>
15
16#include "hardware.h"
17
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20
21#include "soc.h"
22
23
24
25
26
27
28
29
30
31static unsigned int __init micro9_detect_bootwidth(void)
32{
33 u32 v;
34
35
36 v = __raw_readl(EP93XX_SYSCON_SYSCFG);
37 if (v & EP93XX_SYSCON_SYSCFG_LCSN7)
38 return 4;
39 else
40 return 2;
41}
42
43static void __init micro9_register_flash(void)
44{
45 unsigned int width;
46
47 if (machine_is_micro9())
48 width = 4;
49 else if (machine_is_micro9m() || machine_is_micro9s())
50 width = micro9_detect_bootwidth();
51 else
52 width = 0;
53
54 if (width)
55 ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M);
56}
57
58
59
60
61
62static struct ep93xx_eth_data __initdata micro9_eth_data = {
63 .phy_id = 0x1f,
64};
65
66
67static void __init micro9_init_machine(void)
68{
69 ep93xx_init_devices();
70 ep93xx_register_eth(µ9_eth_data, 1);
71 micro9_register_flash();
72}
73
74
75#ifdef CONFIG_MACH_MICRO9H
76MACHINE_START(MICRO9, "Contec Micro9-High")
77
78 .atag_offset = 0x100,
79 .map_io = ep93xx_map_io,
80 .init_irq = ep93xx_init_irq,
81 .init_time = ep93xx_timer_init,
82 .init_machine = micro9_init_machine,
83 .init_late = ep93xx_init_late,
84 .restart = ep93xx_restart,
85MACHINE_END
86#endif
87
88#ifdef CONFIG_MACH_MICRO9M
89MACHINE_START(MICRO9M, "Contec Micro9-Mid")
90
91 .atag_offset = 0x100,
92 .map_io = ep93xx_map_io,
93 .init_irq = ep93xx_init_irq,
94 .init_time = ep93xx_timer_init,
95 .init_machine = micro9_init_machine,
96 .init_late = ep93xx_init_late,
97 .restart = ep93xx_restart,
98MACHINE_END
99#endif
100
101#ifdef CONFIG_MACH_MICRO9L
102MACHINE_START(MICRO9L, "Contec Micro9-Lite")
103
104 .atag_offset = 0x100,
105 .map_io = ep93xx_map_io,
106 .init_irq = ep93xx_init_irq,
107 .init_time = ep93xx_timer_init,
108 .init_machine = micro9_init_machine,
109 .init_late = ep93xx_init_late,
110 .restart = ep93xx_restart,
111MACHINE_END
112#endif
113
114#ifdef CONFIG_MACH_MICRO9S
115MACHINE_START(MICRO9S, "Contec Micro9-Slim")
116
117 .atag_offset = 0x100,
118 .map_io = ep93xx_map_io,
119 .init_irq = ep93xx_init_irq,
120 .init_time = ep93xx_timer_init,
121 .init_machine = micro9_init_machine,
122 .init_late = ep93xx_init_late,
123 .restart = ep93xx_restart,
124MACHINE_END
125#endif
126