Lennert Buytenhek | c471307 | 2006-03-28 21:18:54 +0100 | [diff] [blame] | 1 | /* |
| 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 | |
| 13 | #include <linux/config.h> |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/spinlock.h> |
| 17 | #include <linux/sched.h> |
| 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/serial.h> |
| 20 | #include <linux/tty.h> |
| 21 | #include <linux/bitops.h> |
| 22 | #include <linux/ioport.h> |
| 23 | #include <linux/serial.h> |
| 24 | #include <linux/serial_8250.h> |
| 25 | #include <linux/serial_core.h> |
| 26 | #include <linux/device.h> |
| 27 | #include <linux/mm.h> |
| 28 | #include <linux/pci.h> |
| 29 | #include <linux/mtd/physmap.h> |
| 30 | |
| 31 | #include <asm/types.h> |
| 32 | #include <asm/setup.h> |
| 33 | #include <asm/memory.h> |
| 34 | #include <asm/hardware.h> |
| 35 | #include <asm/mach-types.h> |
| 36 | #include <asm/irq.h> |
| 37 | #include <asm/system.h> |
| 38 | #include <asm/tlbflush.h> |
| 39 | #include <asm/pgtable.h> |
| 40 | |
| 41 | #include <asm/mach/map.h> |
| 42 | #include <asm/mach/irq.h> |
| 43 | #include <asm/mach/arch.h> |
| 44 | #include <asm/mach/irq.h> |
| 45 | #include <asm/mach/pci.h> |
| 46 | |
Lennert Buytenhek | 532bda5 | 2006-04-01 18:33:35 +0100 | [diff] [blame] | 47 | static int __init espresso_pci_init(void) |
| 48 | { |
| 49 | if (machine_is_espresso()) |
| 50 | ixp23xx_pci_slave_init(); |
| 51 | |
| 52 | return 0; |
| 53 | }; |
| 54 | subsys_initcall(espresso_pci_init); |
| 55 | |
Lennert Buytenhek | 84b61f6 | 2006-06-22 10:30:52 +0100 | [diff] [blame] | 56 | static struct physmap_flash_data espresso_flash_data = { |
| 57 | .width = 2, |
| 58 | }; |
| 59 | |
| 60 | static struct resource espresso_flash_resource = { |
| 61 | .start = 0x90000000, |
Lennert Buytenhek | 562ca1e | 2006-06-27 22:56:17 +0100 | [diff] [blame^] | 62 | .end = 0x91ffffff, |
Lennert Buytenhek | 84b61f6 | 2006-06-22 10:30:52 +0100 | [diff] [blame] | 63 | .flags = IORESOURCE_MEM, |
| 64 | }; |
| 65 | |
| 66 | static struct platform_device espresso_flash = { |
| 67 | .name = "physmap-flash", |
| 68 | .id = 0, |
| 69 | .dev = { |
| 70 | .platform_data = &espresso_flash_data, |
| 71 | }, |
| 72 | .num_resources = 1, |
| 73 | .resource = &espresso_flash_resource, |
| 74 | }; |
| 75 | |
Lennert Buytenhek | c471307 | 2006-03-28 21:18:54 +0100 | [diff] [blame] | 76 | static void __init espresso_init(void) |
| 77 | { |
Lennert Buytenhek | 84b61f6 | 2006-06-22 10:30:52 +0100 | [diff] [blame] | 78 | platform_device_register(&espresso_flash); |
Lennert Buytenhek | c471307 | 2006-03-28 21:18:54 +0100 | [diff] [blame] | 79 | |
| 80 | /* |
| 81 | * Mark flash as writeable. |
| 82 | */ |
| 83 | IXP23XX_EXP_CS0[0] |= IXP23XX_FLASH_WRITABLE; |
| 84 | IXP23XX_EXP_CS0[1] |= IXP23XX_FLASH_WRITABLE; |
| 85 | |
| 86 | ixp23xx_sys_init(); |
| 87 | } |
| 88 | |
| 89 | MACHINE_START(ESPRESSO, "IP Fabrics Double Espresso") |
| 90 | /* Maintainer: Lennert Buytenhek */ |
| 91 | .phys_io = IXP23XX_PERIPHERAL_PHYS, |
| 92 | .io_pg_offst = ((IXP23XX_PERIPHERAL_VIRT >> 18)) & 0xfffc, |
| 93 | .map_io = ixp23xx_map_io, |
| 94 | .init_irq = ixp23xx_init_irq, |
| 95 | .timer = &ixp23xx_timer, |
| 96 | .boot_params = 0x00000100, |
| 97 | .init_machine = espresso_init, |
| 98 | MACHINE_END |