0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <linux/kernel.h>
0012 #include <linux/init.h>
0013 #include <linux/platform_device.h>
0014 #include <linux/io.h>
0015
0016 #include "hardware.h"
0017
0018 #include <asm/mach-types.h>
0019 #include <asm/mach/arch.h>
0020
0021 #include "soc.h"
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 static unsigned int __init micro9_detect_bootwidth(void)
0032 {
0033 u32 v;
0034
0035
0036 v = __raw_readl(EP93XX_SYSCON_SYSCFG);
0037 if (v & EP93XX_SYSCON_SYSCFG_LCSN7)
0038 return 4;
0039 else
0040 return 2;
0041 }
0042
0043 static void __init micro9_register_flash(void)
0044 {
0045 unsigned int width;
0046
0047 if (machine_is_micro9())
0048 width = 4;
0049 else if (machine_is_micro9m() || machine_is_micro9s())
0050 width = micro9_detect_bootwidth();
0051 else
0052 width = 0;
0053
0054 if (width)
0055 ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M);
0056 }
0057
0058
0059
0060
0061
0062 static struct ep93xx_eth_data __initdata micro9_eth_data = {
0063 .phy_id = 0x1f,
0064 };
0065
0066
0067 static void __init micro9_init_machine(void)
0068 {
0069 ep93xx_init_devices();
0070 ep93xx_register_eth(µ9_eth_data, 1);
0071 micro9_register_flash();
0072 }
0073
0074
0075 #ifdef CONFIG_MACH_MICRO9H
0076 MACHINE_START(MICRO9, "Contec Micro9-High")
0077
0078 .atag_offset = 0x100,
0079 .nr_irqs = NR_EP93XX_IRQS,
0080 .map_io = ep93xx_map_io,
0081 .init_irq = ep93xx_init_irq,
0082 .init_time = ep93xx_timer_init,
0083 .init_machine = micro9_init_machine,
0084 .restart = ep93xx_restart,
0085 MACHINE_END
0086 #endif
0087
0088 #ifdef CONFIG_MACH_MICRO9M
0089 MACHINE_START(MICRO9M, "Contec Micro9-Mid")
0090
0091 .atag_offset = 0x100,
0092 .nr_irqs = NR_EP93XX_IRQS,
0093 .map_io = ep93xx_map_io,
0094 .init_irq = ep93xx_init_irq,
0095 .init_time = ep93xx_timer_init,
0096 .init_machine = micro9_init_machine,
0097 .restart = ep93xx_restart,
0098 MACHINE_END
0099 #endif
0100
0101 #ifdef CONFIG_MACH_MICRO9L
0102 MACHINE_START(MICRO9L, "Contec Micro9-Lite")
0103
0104 .atag_offset = 0x100,
0105 .nr_irqs = NR_EP93XX_IRQS,
0106 .map_io = ep93xx_map_io,
0107 .init_irq = ep93xx_init_irq,
0108 .init_time = ep93xx_timer_init,
0109 .init_machine = micro9_init_machine,
0110 .restart = ep93xx_restart,
0111 MACHINE_END
0112 #endif
0113
0114 #ifdef CONFIG_MACH_MICRO9S
0115 MACHINE_START(MICRO9S, "Contec Micro9-Slim")
0116
0117 .atag_offset = 0x100,
0118 .nr_irqs = NR_EP93XX_IRQS,
0119 .map_io = ep93xx_map_io,
0120 .init_irq = ep93xx_init_irq,
0121 .init_time = ep93xx_timer_init,
0122 .init_machine = micro9_init_machine,
0123 .restart = ep93xx_restart,
0124 MACHINE_END
0125 #endif