blob: d142d45dea124a724004eed225337eed2c481fba [file] [log] [blame]
Lennert Buytenhekc4713072006-03-28 21:18:54 +01001/*
2 * arch/arm/mach-ixp23xx/espresso.c
3 *
4 * Double Espresso-specific routines
5 *
6 * Author: Lennert Buytenhek <buytenh@wantstofly.org>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
Lennert Buytenhekc4713072006-03-28 21:18:54 +010013#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/spinlock.h>
16#include <linux/sched.h>
17#include <linux/interrupt.h>
18#include <linux/serial.h>
19#include <linux/tty.h>
20#include <linux/bitops.h>
21#include <linux/ioport.h>
Lennert Buytenhekc4713072006-03-28 21:18:54 +010022#include <linux/serial_8250.h>
23#include <linux/serial_core.h>
24#include <linux/device.h>
25#include <linux/mm.h>
26#include <linux/pci.h>
27#include <linux/mtd/physmap.h>
28
29#include <asm/types.h>
30#include <asm/setup.h>
31#include <asm/memory.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010032#include <mach/hardware.h>
Lennert Buytenhekc4713072006-03-28 21:18:54 +010033#include <asm/mach-types.h>
34#include <asm/irq.h>
Lennert Buytenhekc4713072006-03-28 21:18:54 +010035#include <asm/tlbflush.h>
36#include <asm/pgtable.h>
37
38#include <asm/mach/map.h>
39#include <asm/mach/irq.h>
40#include <asm/mach/arch.h>
Lennert Buytenhekc4713072006-03-28 21:18:54 +010041#include <asm/mach/pci.h>
42
Lennert Buytenhek532bda52006-04-01 18:33:35 +010043static int __init espresso_pci_init(void)
44{
45 if (machine_is_espresso())
46 ixp23xx_pci_slave_init();
47
48 return 0;
49};
50subsys_initcall(espresso_pci_init);
51
Lennert Buytenhek84b61f62006-06-22 10:30:52 +010052static struct physmap_flash_data espresso_flash_data = {
53 .width = 2,
54};
55
56static struct resource espresso_flash_resource = {
57 .start = 0x90000000,
Lennert Buytenhek562ca1e2006-06-27 22:56:17 +010058 .end = 0x91ffffff,
Lennert Buytenhek84b61f62006-06-22 10:30:52 +010059 .flags = IORESOURCE_MEM,
60};
61
62static struct platform_device espresso_flash = {
63 .name = "physmap-flash",
64 .id = 0,
65 .dev = {
66 .platform_data = &espresso_flash_data,
67 },
68 .num_resources = 1,
69 .resource = &espresso_flash_resource,
70};
71
Lennert Buytenhekc4713072006-03-28 21:18:54 +010072static void __init espresso_init(void)
73{
Lennert Buytenhek84b61f62006-06-22 10:30:52 +010074 platform_device_register(&espresso_flash);
Lennert Buytenhekc4713072006-03-28 21:18:54 +010075
76 /*
77 * Mark flash as writeable.
78 */
79 IXP23XX_EXP_CS0[0] |= IXP23XX_FLASH_WRITABLE;
80 IXP23XX_EXP_CS0[1] |= IXP23XX_FLASH_WRITABLE;
81
82 ixp23xx_sys_init();
83}
84
85MACHINE_START(ESPRESSO, "IP Fabrics Double Espresso")
86 /* Maintainer: Lennert Buytenhek */
Lennert Buytenhekc4713072006-03-28 21:18:54 +010087 .map_io = ixp23xx_map_io,
88 .init_irq = ixp23xx_init_irq,
89 .timer = &ixp23xx_timer,
Nicolas Pitre36f7a1e2011-07-05 22:38:13 -040090 .atag_offset = 0x100,
Lennert Buytenhekc4713072006-03-28 21:18:54 +010091 .init_machine = espresso_init,
Russell Kingb2194152011-11-05 11:35:32 +000092 .restart = ixp23xx_restart,
Lennert Buytenhekc4713072006-03-28 21:18:54 +010093MACHINE_END