blob: 7419451fdf00ba260beb920119e1f8e3504dbca3 [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>
24#include <linux/sysdev.h>
Russell Kinga62c80e2006-01-07 13:52:45 +000025#include <linux/amba/bus.h>
Russell Kingbbeddc42009-07-05 22:43:01 +010026#include <linux/amba/pl061.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>
34#include <asm/mach/mmc.h>
35
36#include "core.h"
37
38#if 1
39#define IRQ_MMCI1A IRQ_VICSOURCE23
40#else
41#define IRQ_MMCI1A IRQ_SIC_MMCI1A
42#endif
43
44static struct mmc_platform_data mmc1_plat_data = {
45 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
46 .status = mmc_status,
47};
48
Russell Kingbbeddc42009-07-05 22:43:01 +010049static struct pl061_platform_data gpio2_plat_data = {
50 .gpio_base = 16,
51 .irq_base = IRQ_GPIO2_START,
52};
53
54static struct pl061_platform_data gpio3_plat_data = {
55 .gpio_base = 24,
56 .irq_base = IRQ_GPIO3_START,
57};
58
Linus Torvalds1da177e2005-04-16 15:20:36 -070059#define UART3_IRQ { IRQ_SIC_UART3, NO_IRQ }
60#define UART3_DMA { 0x86, 0x87 }
61#define SCI1_IRQ { IRQ_SIC_SCI3, NO_IRQ }
62#define SCI1_DMA { 0x88, 0x89 }
63#define MMCI1_IRQ { IRQ_MMCI1A, IRQ_SIC_MMCI1B }
64#define MMCI1_DMA { 0x85, 0 }
65
66/*
67 * These devices are connected via the core APB bridge
68 */
69#define GPIO2_IRQ { IRQ_GPIOINT2, NO_IRQ }
70#define GPIO2_DMA { 0, 0 }
71#define GPIO3_IRQ { IRQ_GPIOINT3, NO_IRQ }
72#define GPIO3_DMA { 0, 0 }
73
74/*
75 * These devices are connected via the DMA APB bridge
76 */
77
78/* FPGA Primecells */
79AMBA_DEVICE(uart3, "fpga:09", UART3, NULL);
80AMBA_DEVICE(sci1, "fpga:0a", SCI1, NULL);
81AMBA_DEVICE(mmc1, "fpga:0b", MMCI1, &mmc1_plat_data);
82
83/* DevChip Primecells */
Russell Kingbbeddc42009-07-05 22:43:01 +010084AMBA_DEVICE(gpio2, "dev:e6", GPIO2, &gpio2_plat_data);
85AMBA_DEVICE(gpio3, "dev:e7", GPIO3, &gpio3_plat_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -070086
87static struct amba_device *amba_devs[] __initdata = {
88 &uart3_device,
89 &gpio2_device,
90 &gpio3_device,
91 &sci1_device,
92 &mmc1_device,
93};
94
Russell King4e4e5202006-11-30 22:42:20 +000095static void __init versatile_pb_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070096{
97 int i;
98
Russell King4e4e5202006-11-30 22:42:20 +000099 versatile_init();
100
101 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
102 struct amba_device *d = amba_devs[i];
103 amba_device_register(d, &iomem_resource);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105}
106
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100108 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
Russell Kinge9dea0c2005-07-03 17:38:58 +0100109 .phys_io = 0x101f1000,
110 .io_pg_offst = ((0xf11f1000) >> 18) & 0xfffc,
111 .boot_params = 0x00000100,
112 .map_io = versatile_map_io,
113 .init_irq = versatile_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 .timer = &versatile_timer,
Russell King4e4e5202006-11-30 22:42:20 +0000115 .init_machine = versatile_pb_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116MACHINE_END