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