blob: 611d140c8695a35b9768221bd125ac76a7e393cc [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/arm/mach-versatile/versatile_pb.c
3 *
4 * Copyright (C) 2004 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
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; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#include <linux/init.h>
23#include <linux/device.h>
Russell Kinga62c80e2006-01-07 13:52:45 +000024#include <linux/amba/bus.h>
Russell Kingbbeddc42009-07-05 22:43:01 +010025#include <linux/amba/pl061.h>
Linus Walleij6ef297f2009-09-22 14:29:36 +010026#include <linux/amba/mmci.h>
Russell Kingfced80c2008-09-06 12:10:45 +010027#include <linux/io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
Russell Kinga09e64f2008-08-05 16:14:15 +010029#include <mach/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070030#include <asm/irq.h>
31#include <asm/mach-types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
33#include <asm/mach/arch.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
35#include "core.h"
36
37#if 1
38#define IRQ_MMCI1A IRQ_VICSOURCE23
39#else
40#define IRQ_MMCI1A IRQ_SIC_MMCI1A
41#endif
42
Linus Walleij6ef297f2009-09-22 14:29:36 +010043static struct mmci_platform_data mmc1_plat_data = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
45 .status = mmc_status,
Russell King7fb2bbf2009-07-09 15:15:12 +010046 .gpio_wp = -1,
47 .gpio_cd = -1,
Linus Torvalds1da177e2005-04-16 15:20:36 -070048};
49
Russell Kingbbeddc42009-07-05 22:43:01 +010050static struct pl061_platform_data gpio2_plat_data = {
51 .gpio_base = 16,
52 .irq_base = IRQ_GPIO2_START,
53};
54
55static struct pl061_platform_data gpio3_plat_data = {
56 .gpio_base = 24,
57 .irq_base = IRQ_GPIO3_START,
58};
59
Russell King0dada612011-12-18 11:40:46 +000060#define UART3_IRQ { IRQ_SIC_UART3 }
61#define SCI1_IRQ { IRQ_SIC_SCI3 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070062#define MMCI1_IRQ { IRQ_MMCI1A, IRQ_SIC_MMCI1B }
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
64/*
65 * These devices are connected via the core APB bridge
66 */
Russell King0dada612011-12-18 11:40:46 +000067#define GPIO2_IRQ { IRQ_GPIOINT2 }
68#define GPIO3_IRQ { IRQ_GPIOINT3 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070069
70/*
71 * These devices are connected via the DMA APB bridge
72 */
73
74/* FPGA Primecells */
Russell King8f5088b2011-12-18 12:21:09 +000075APB_DEVICE(uart3, "fpga:09", UART3, NULL);
76APB_DEVICE(sci1, "fpga:0a", SCI1, NULL);
77APB_DEVICE(mmc1, "fpga:0b", MMCI1, &mmc1_plat_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -070078
79/* DevChip Primecells */
Russell King8f5088b2011-12-18 12:21:09 +000080APB_DEVICE(gpio2, "dev:e6", GPIO2, &gpio2_plat_data);
81APB_DEVICE(gpio3, "dev:e7", GPIO3, &gpio3_plat_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -070082
83static struct amba_device *amba_devs[] __initdata = {
84 &uart3_device,
85 &gpio2_device,
86 &gpio3_device,
87 &sci1_device,
88 &mmc1_device,
89};
90
Russell King4e4e5202006-11-30 22:42:20 +000091static void __init versatile_pb_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070092{
93 int i;
94
Russell King4e4e5202006-11-30 22:42:20 +000095 versatile_init();
96
97 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
98 struct amba_device *d = amba_devs[i];
99 amba_device_register(d, &iomem_resource);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101}
102
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100104 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
Nicolas Pitre171fa8a2011-07-05 22:38:18 -0400105 .atag_offset = 0x100,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100106 .map_io = versatile_map_io,
Russell Kingad3bb192011-01-11 12:55:38 +0000107 .init_early = versatile_init_early,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100108 .init_irq = versatile_init_irq,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700109 .init_time = versatile_timer_init,
Russell King4e4e5202006-11-30 22:42:20 +0000110 .init_machine = versatile_pb_init,
Russell Kingb56a7c62011-11-03 11:43:08 +0000111 .restart = versatile_restart,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112MACHINE_END