Blame view
arch/arm/mach-ep93xx/micro9.c
3.46 KB
d941caa25 [ARM] 4047/1: Add... |
1 2 3 4 |
/* * linux/arch/arm/mach-ep93xx/micro9.c * * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH |
941500954 ARM: 5749/1: ep93... |
5 6 7 |
* Manfred Gruber <m.gruber@tirol.com> * Copyright (C) 2009 Contec Steuerungstechnik & Automation GmbH * Hubert Feurstein <hubert.feurstein@contec.at> |
d941caa25 [ARM] 4047/1: Add... |
8 9 10 11 12 |
* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ |
d941caa25 [ARM] 4047/1: Add... |
13 |
#include <linux/kernel.h> |
583ddafe1 [ARM] 5592/1: ep9... |
14 |
#include <linux/init.h> |
d941caa25 [ARM] 4047/1: Add... |
15 |
#include <linux/platform_device.h> |
d525753bf ARM: 5779/1: ep93... |
16 |
#include <linux/io.h> |
d941caa25 [ARM] 4047/1: Add... |
17 |
|
a09e64fbc [ARM] Move includ... |
18 |
#include <mach/hardware.h> |
d941caa25 [ARM] 4047/1: Add... |
19 |
|
9a6879bd9 ARM: ep93xx: conv... |
20 |
#include <asm/hardware/vic.h> |
d941caa25 [ARM] 4047/1: Add... |
21 |
#include <asm/mach-types.h> |
583ddafe1 [ARM] 5592/1: ep9... |
22 |
#include <asm/mach/arch.h> |
d941caa25 [ARM] 4047/1: Add... |
23 |
|
14636005f ARM: 5750/1: ep93... |
24 25 26 27 28 |
/************************************************************************* * Micro9 NOR Flash * * Micro9-High has up to 64MB of 32-bit flash on CS1 * Micro9-Mid has up to 64MB of either 32-bit or 16-bit flash on CS1 |
3ad2f3fbb tree-wide: Assort... |
29 |
* Micro9-Lite uses a separate MTD map driver for flash support |
7232344d4 ARM: 5751/1: ep93... |
30 |
* Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1 |
14636005f ARM: 5750/1: ep93... |
31 |
*************************************************************************/ |
14636005f ARM: 5750/1: ep93... |
32 |
static unsigned int __init micro9_detect_bootwidth(void) |
d941caa25 [ARM] 4047/1: Add... |
33 |
{ |
14636005f ARM: 5750/1: ep93... |
34 35 36 37 38 39 40 41 |
u32 v; /* Detect the bus width of the external flash memory */ v = __raw_readl(EP93XX_SYSCON_SYSCFG); if (v & EP93XX_SYSCON_SYSCFG_LCSN7) return 4; /* 32-bit */ else return 2; /* 16-bit */ |
d941caa25 [ARM] 4047/1: Add... |
42 |
} |
14636005f ARM: 5750/1: ep93... |
43 44 |
static void __init micro9_register_flash(void) { |
16bcf78f8 ARM: 6168/1: ep93... |
45 |
unsigned int width; |
14636005f ARM: 5750/1: ep93... |
46 |
if (machine_is_micro9()) |
16bcf78f8 ARM: 6168/1: ep93... |
47 |
width = 4; |
7232344d4 ARM: 5751/1: ep93... |
48 |
else if (machine_is_micro9m() || machine_is_micro9s()) |
16bcf78f8 ARM: 6168/1: ep93... |
49 50 51 52 53 54 |
width = micro9_detect_bootwidth(); else width = 0; if (width) ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M); |
14636005f ARM: 5750/1: ep93... |
55 56 57 58 59 60 |
} /************************************************************************* * Micro9 Ethernet *************************************************************************/ |
b370e082e ARM: 5992/1: ep93... |
61 |
static struct ep93xx_eth_data __initdata micro9_eth_data = { |
14636005f ARM: 5750/1: ep93... |
62 63 64 65 66 |
.phy_id = 0x1f, }; static void __init micro9_init_machine(void) |
d941caa25 [ARM] 4047/1: Add... |
67 |
{ |
e48f3fa37 [ARM] 5342/1: ep9... |
68 |
ep93xx_init_devices(); |
14636005f ARM: 5750/1: ep93... |
69 70 |
ep93xx_register_eth(µ9_eth_data, 1); micro9_register_flash(); |
d941caa25 [ARM] 4047/1: Add... |
71 |
} |
14636005f ARM: 5750/1: ep93... |
72 73 74 |
#ifdef CONFIG_MACH_MICRO9H MACHINE_START(MICRO9, "Contec Micro9-High") |
941500954 ARM: 5749/1: ep93... |
75 |
/* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */ |
e562cf172 ARM: mach-ep93xx:... |
76 |
.atag_offset = 0x100, |
e48f3fa37 [ARM] 5342/1: ep9... |
77 78 |
.map_io = ep93xx_map_io, .init_irq = ep93xx_init_irq, |
9a6879bd9 ARM: ep93xx: conv... |
79 |
.handle_irq = vic_handle_irq, |
e48f3fa37 [ARM] 5342/1: ep9... |
80 |
.timer = &ep93xx_timer, |
14636005f ARM: 5750/1: ep93... |
81 |
.init_machine = micro9_init_machine, |
3275166e0 ARM: restart: ep9... |
82 |
.restart = ep93xx_restart, |
d941caa25 [ARM] 4047/1: Add... |
83 84 |
MACHINE_END #endif |
d941caa25 [ARM] 4047/1: Add... |
85 |
#ifdef CONFIG_MACH_MICRO9M |
14636005f ARM: 5750/1: ep93... |
86 |
MACHINE_START(MICRO9M, "Contec Micro9-Mid") |
941500954 ARM: 5749/1: ep93... |
87 |
/* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */ |
e562cf172 ARM: mach-ep93xx:... |
88 |
.atag_offset = 0x100, |
e48f3fa37 [ARM] 5342/1: ep9... |
89 90 |
.map_io = ep93xx_map_io, .init_irq = ep93xx_init_irq, |
9a6879bd9 ARM: ep93xx: conv... |
91 |
.handle_irq = vic_handle_irq, |
e48f3fa37 [ARM] 5342/1: ep9... |
92 |
.timer = &ep93xx_timer, |
14636005f ARM: 5750/1: ep93... |
93 |
.init_machine = micro9_init_machine, |
3275166e0 ARM: restart: ep9... |
94 |
.restart = ep93xx_restart, |
d941caa25 [ARM] 4047/1: Add... |
95 96 |
MACHINE_END #endif |
d941caa25 [ARM] 4047/1: Add... |
97 |
#ifdef CONFIG_MACH_MICRO9L |
14636005f ARM: 5750/1: ep93... |
98 |
MACHINE_START(MICRO9L, "Contec Micro9-Lite") |
941500954 ARM: 5749/1: ep93... |
99 |
/* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */ |
e562cf172 ARM: mach-ep93xx:... |
100 |
.atag_offset = 0x100, |
e48f3fa37 [ARM] 5342/1: ep9... |
101 102 |
.map_io = ep93xx_map_io, .init_irq = ep93xx_init_irq, |
9a6879bd9 ARM: ep93xx: conv... |
103 |
.handle_irq = vic_handle_irq, |
e48f3fa37 [ARM] 5342/1: ep9... |
104 |
.timer = &ep93xx_timer, |
14636005f ARM: 5750/1: ep93... |
105 |
.init_machine = micro9_init_machine, |
3275166e0 ARM: restart: ep9... |
106 |
.restart = ep93xx_restart, |
d941caa25 [ARM] 4047/1: Add... |
107 108 |
MACHINE_END #endif |
7232344d4 ARM: 5751/1: ep93... |
109 110 111 112 |
#ifdef CONFIG_MACH_MICRO9S MACHINE_START(MICRO9S, "Contec Micro9-Slim") /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */ |
e562cf172 ARM: mach-ep93xx:... |
113 |
.atag_offset = 0x100, |
7232344d4 ARM: 5751/1: ep93... |
114 115 |
.map_io = ep93xx_map_io, .init_irq = ep93xx_init_irq, |
9a6879bd9 ARM: ep93xx: conv... |
116 |
.handle_irq = vic_handle_irq, |
7232344d4 ARM: 5751/1: ep93... |
117 118 |
.timer = &ep93xx_timer, .init_machine = micro9_init_machine, |
3275166e0 ARM: restart: ep9... |
119 |
.restart = ep93xx_restart, |
7232344d4 ARM: 5751/1: ep93... |
120 121 |
MACHINE_END #endif |