ARM: SoC: convert shmobile SMP to SMP operations
[deliverable/linux.git] / arch / arm / mach-shmobile / board-marzen.c
CommitLineData
f411fade
MD
1/*
2 * marzen board support
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/interrupt.h>
24#include <linux/irq.h>
25#include <linux/platform_device.h>
26#include <linux/delay.h>
27#include <linux/io.h>
14f691c1 28#include <linux/gpio.h>
f411fade 29#include <linux/dma-mapping.h>
b354e227
GL
30#include <linux/regulator/fixed.h>
31#include <linux/regulator/machine.h>
db5eb994 32#include <linux/smsc911x.h>
f411fade
MD
33#include <mach/hardware.h>
34#include <mach/r8a7779.h>
35#include <mach/common.h>
250a2723 36#include <mach/irqs.h>
f411fade
MD
37#include <asm/mach-types.h>
38#include <asm/mach/arch.h>
f411fade
MD
39#include <asm/hardware/gic.h>
40#include <asm/traps.h>
41
b354e227
GL
42/* Dummy supplies, where voltage doesn't matter */
43static struct regulator_consumer_supply dummy_supplies[] = {
44 REGULATOR_SUPPLY("vddvario", "smsc911x"),
45 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
46};
47
db5eb994
MD
48/* SMSC LAN89218 */
49static struct resource smsc911x_resources[] = {
50 [0] = {
51 .start = 0x18000000, /* ExCS0 */
52 .end = 0x180000ff, /* A1->A7 */
53 .flags = IORESOURCE_MEM,
54 },
55 [1] = {
56 .start = gic_spi(28), /* IRQ 1 */
57 .flags = IORESOURCE_IRQ,
58 },
59};
60
61static struct smsc911x_platform_config smsc911x_platdata = {
62 .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */
63 .phy_interface = PHY_INTERFACE_MODE_MII,
64 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
65 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
66};
67
68static struct platform_device eth_device = {
69 .name = "smsc911x",
70 .id = 0,
71 .dev = {
72 .platform_data = &smsc911x_platdata,
73 },
74 .resource = smsc911x_resources,
75 .num_resources = ARRAY_SIZE(smsc911x_resources),
76};
77
f411fade 78static struct platform_device *marzen_devices[] __initdata = {
db5eb994 79 &eth_device,
f411fade
MD
80};
81
f411fade
MD
82static void __init marzen_init(void)
83{
b354e227
GL
84 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
85
19c43fc5
MD
86 r8a7779_pinmux_init();
87
14f691c1
MD
88 /* SCIF2 (CN18: DEBUG0) */
89 gpio_request(GPIO_FN_TX2_C, NULL);
90 gpio_request(GPIO_FN_RX2_C, NULL);
91
92 /* SCIF4 (CN19: DEBUG1) */
93 gpio_request(GPIO_FN_TX4, NULL);
94 gpio_request(GPIO_FN_RX4, NULL);
95
db5eb994
MD
96 /* LAN89218 */
97 gpio_request(GPIO_FN_EX_CS0, NULL); /* nCS */
98 gpio_request(GPIO_FN_IRQ1_B, NULL); /* IRQ + PME */
99
f411fade
MD
100 r8a7779_add_standard_devices();
101 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
102}
103
f411fade 104MACHINE_START(MARZEN, "marzen")
a62580e5 105 .smp = smp_ops(r8a7779_smp_ops),
3e353b87
MD
106 .map_io = r8a7779_map_io,
107 .init_early = r8a7779_add_early_devices,
f411fade
MD
108 .nr_irqs = NR_IRQS_LEGACY,
109 .init_irq = r8a7779_init_irq,
77761b63 110 .handle_irq = gic_handle_irq,
f411fade 111 .init_machine = marzen_init,
21cc1b7e 112 .init_late = shmobile_init_late,
df27a2d8 113 .timer = &shmobile_timer,
f411fade 114MACHINE_END
This page took 0.054251 seconds and 5 git commands to generate.