spi-topcliff-pch: Fix issue for transmitting over 4KByte
[zen-stable.git] / arch / arm / mach-ep93xx / micro9.c
blob7b98084f0c97bf14e8830a30b3dd18b10d5a3163
1 /*
2 * linux/arch/arm/mach-ep93xx/micro9.c
4 * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH
5 * Manfred Gruber <m.gruber@tirol.com>
6 * Copyright (C) 2009 Contec Steuerungstechnik & Automation GmbH
7 * Hubert Feurstein <hubert.feurstein@contec.at>
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.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
17 #include <linux/io.h>
19 #include <mach/hardware.h>
21 #include <asm/hardware/vic.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
26 /*************************************************************************
27 * Micro9 NOR Flash
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
31 * Micro9-Lite uses a separate MTD map driver for flash support
32 * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1
33 *************************************************************************/
34 static unsigned int __init micro9_detect_bootwidth(void)
36 u32 v;
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 */
46 static void __init micro9_register_flash(void)
48 unsigned int width;
50 if (machine_is_micro9())
51 width = 4;
52 else if (machine_is_micro9m() || machine_is_micro9s())
53 width = micro9_detect_bootwidth();
54 else
55 width = 0;
57 if (width)
58 ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M);
62 /*************************************************************************
63 * Micro9 Ethernet
64 *************************************************************************/
65 static struct ep93xx_eth_data __initdata micro9_eth_data = {
66 .phy_id = 0x1f,
70 static void __init micro9_init_machine(void)
72 ep93xx_init_devices();
73 ep93xx_register_eth(&micro9_eth_data, 1);
74 micro9_register_flash();
78 #ifdef CONFIG_MACH_MICRO9H
79 MACHINE_START(MICRO9, "Contec Micro9-High")
80 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
81 .atag_offset = 0x100,
82 .map_io = ep93xx_map_io,
83 .init_irq = ep93xx_init_irq,
84 .handle_irq = vic_handle_irq,
85 .timer = &ep93xx_timer,
86 .init_machine = micro9_init_machine,
87 .restart = ep93xx_restart,
88 MACHINE_END
89 #endif
91 #ifdef CONFIG_MACH_MICRO9M
92 MACHINE_START(MICRO9M, "Contec Micro9-Mid")
93 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
94 .atag_offset = 0x100,
95 .map_io = ep93xx_map_io,
96 .init_irq = ep93xx_init_irq,
97 .handle_irq = vic_handle_irq,
98 .timer = &ep93xx_timer,
99 .init_machine = micro9_init_machine,
100 .restart = ep93xx_restart,
101 MACHINE_END
102 #endif
104 #ifdef CONFIG_MACH_MICRO9L
105 MACHINE_START(MICRO9L, "Contec Micro9-Lite")
106 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
107 .atag_offset = 0x100,
108 .map_io = ep93xx_map_io,
109 .init_irq = ep93xx_init_irq,
110 .handle_irq = vic_handle_irq,
111 .timer = &ep93xx_timer,
112 .init_machine = micro9_init_machine,
113 .restart = ep93xx_restart,
114 MACHINE_END
115 #endif
117 #ifdef CONFIG_MACH_MICRO9S
118 MACHINE_START(MICRO9S, "Contec Micro9-Slim")
119 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
120 .atag_offset = 0x100,
121 .map_io = ep93xx_map_io,
122 .init_irq = ep93xx_init_irq,
123 .handle_irq = vic_handle_irq,
124 .timer = &ep93xx_timer,
125 .init_machine = micro9_init_machine,
126 .restart = ep93xx_restart,
127 MACHINE_END
128 #endif