Loading...
1/*
2 * linux/arch/arm/mach-ep93xx/micro9.c
3 *
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>
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
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <mach/hardware.h>
20
21#include <asm/mach-types.h>
22#include <asm/mach/arch.h>
23
24
25/*************************************************************************
26 * Micro9 NOR Flash
27 *
28 * Micro9-High has up to 64MB of 32-bit flash on CS1
29 * Micro9-Mid has up to 64MB of either 32-bit or 16-bit flash on CS1
30 * Micro9-Lite uses a separate MTD map driver for flash support
31 * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1
32 *************************************************************************/
33static unsigned int __init micro9_detect_bootwidth(void)
34{
35 u32 v;
36
37 /* Detect the bus width of the external flash memory */
38 v = __raw_readl(EP93XX_SYSCON_SYSCFG);
39 if (v & EP93XX_SYSCON_SYSCFG_LCSN7)
40 return 4; /* 32-bit */
41 else
42 return 2; /* 16-bit */
43}
44
45static void __init micro9_register_flash(void)
46{
47 unsigned int width;
48
49 if (machine_is_micro9())
50 width = 4;
51 else if (machine_is_micro9m() || machine_is_micro9s())
52 width = micro9_detect_bootwidth();
53 else
54 width = 0;
55
56 if (width)
57 ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M);
58}
59
60
61/*************************************************************************
62 * Micro9 Ethernet
63 *************************************************************************/
64static struct ep93xx_eth_data __initdata micro9_eth_data = {
65 .phy_id = 0x1f,
66};
67
68
69static void __init micro9_init_machine(void)
70{
71 ep93xx_init_devices();
72 ep93xx_register_eth(µ9_eth_data, 1);
73 micro9_register_flash();
74}
75
76
77#ifdef CONFIG_MACH_MICRO9H
78MACHINE_START(MICRO9, "Contec Micro9-High")
79 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
80 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
81 .map_io = ep93xx_map_io,
82 .init_irq = ep93xx_init_irq,
83 .timer = &ep93xx_timer,
84 .init_machine = micro9_init_machine,
85MACHINE_END
86#endif
87
88#ifdef CONFIG_MACH_MICRO9M
89MACHINE_START(MICRO9M, "Contec Micro9-Mid")
90 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
91 .boot_params = EP93XX_SDCE3_PHYS_BASE_ASYNC + 0x100,
92 .map_io = ep93xx_map_io,
93 .init_irq = ep93xx_init_irq,
94 .timer = &ep93xx_timer,
95 .init_machine = micro9_init_machine,
96MACHINE_END
97#endif
98
99#ifdef CONFIG_MACH_MICRO9L
100MACHINE_START(MICRO9L, "Contec Micro9-Lite")
101 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
102 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
103 .map_io = ep93xx_map_io,
104 .init_irq = ep93xx_init_irq,
105 .timer = &ep93xx_timer,
106 .init_machine = micro9_init_machine,
107MACHINE_END
108#endif
109
110#ifdef CONFIG_MACH_MICRO9S
111MACHINE_START(MICRO9S, "Contec Micro9-Slim")
112 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
113 .boot_params = EP93XX_SDCE3_PHYS_BASE_ASYNC + 0x100,
114 .map_io = ep93xx_map_io,
115 .init_irq = ep93xx_init_irq,
116 .timer = &ep93xx_timer,
117 .init_machine = micro9_init_machine,
118MACHINE_END
119#endif
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-ep93xx/micro9.c
4 *
5 * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH
6 * Manfred Gruber <m.gruber@tirol.com>
7 * Copyright (C) 2009 Contec Steuerungstechnik & Automation GmbH
8 * Hubert Feurstein <hubert.feurstein@contec.at>
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 * Micro9 NOR Flash
25 *
26 * Micro9-High has up to 64MB of 32-bit flash on CS1
27 * Micro9-Mid has up to 64MB of either 32-bit or 16-bit flash on CS1
28 * Micro9-Lite uses a separate MTD map driver for flash support
29 * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1
30 *************************************************************************/
31static unsigned int __init micro9_detect_bootwidth(void)
32{
33 u32 v;
34
35 /* Detect the bus width of the external flash memory */
36 v = __raw_readl(EP93XX_SYSCON_SYSCFG);
37 if (v & EP93XX_SYSCON_SYSCFG_LCSN7)
38 return 4; /* 32-bit */
39 else
40 return 2; /* 16-bit */
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 * Micro9 Ethernet
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 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
78 .atag_offset = 0x100,
79 .nr_irqs = NR_EP93XX_IRQS,
80 .map_io = ep93xx_map_io,
81 .init_irq = ep93xx_init_irq,
82 .init_time = ep93xx_timer_init,
83 .init_machine = micro9_init_machine,
84 .restart = ep93xx_restart,
85MACHINE_END
86#endif
87
88#ifdef CONFIG_MACH_MICRO9M
89MACHINE_START(MICRO9M, "Contec Micro9-Mid")
90 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
91 .atag_offset = 0x100,
92 .nr_irqs = NR_EP93XX_IRQS,
93 .map_io = ep93xx_map_io,
94 .init_irq = ep93xx_init_irq,
95 .init_time = ep93xx_timer_init,
96 .init_machine = micro9_init_machine,
97 .restart = ep93xx_restart,
98MACHINE_END
99#endif
100
101#ifdef CONFIG_MACH_MICRO9L
102MACHINE_START(MICRO9L, "Contec Micro9-Lite")
103 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
104 .atag_offset = 0x100,
105 .nr_irqs = NR_EP93XX_IRQS,
106 .map_io = ep93xx_map_io,
107 .init_irq = ep93xx_init_irq,
108 .init_time = ep93xx_timer_init,
109 .init_machine = micro9_init_machine,
110 .restart = ep93xx_restart,
111MACHINE_END
112#endif
113
114#ifdef CONFIG_MACH_MICRO9S
115MACHINE_START(MICRO9S, "Contec Micro9-Slim")
116 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
117 .atag_offset = 0x100,
118 .nr_irqs = NR_EP93XX_IRQS,
119 .map_io = ep93xx_map_io,
120 .init_irq = ep93xx_init_irq,
121 .init_time = ep93xx_timer_init,
122 .init_machine = micro9_init_machine,
123 .restart = ep93xx_restart,
124MACHINE_END
125#endif