]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux/openslug-kernel-2.6.9/nslu2-setup.c
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux / openslug-kernel-2.6.9 / nslu2-setup.c
1 /*
2  * arch/arm/mach-ixp4xx/nslu2-setup.c
3  *
4  * NSLU2 board-setup
5  *
6  * based ixdp425-setup.c:
7  *      Copyright (C) 2003-2004 MontaVista Software, Inc.
8  *
9  * Author: Mark Rakes <mrakes at mac.com>
10  * Maintainers: http://www.nslu2-linux.org/
11  *
12  * Fixed missing init_time in MACHINE_START kas11 10/22/04
13  * Changed to conform to new style __init ixdp425 kas11 10/22/04 
14  */
15
16 #include <linux/init.h>
17 #include <linux/device.h>
18 #include <linux/serial.h>
19 #include <linux/tty.h>
20 #include <linux/serial_core.h>
21
22 #include <asm/types.h>
23 #include <asm/setup.h>
24 #include <asm/memory.h>
25 #include <asm/hardware.h>
26 #include <asm/mach-types.h>
27 #include <asm/irq.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/flash.h>
30
31 #ifdef  __ARMEB__
32 #define REG_OFFSET      3
33 #else
34 #define REG_OFFSET      0
35 #endif
36
37 /*
38  * NSLU2 uses only one serial port
39  */
40 static struct uart_port nslu2_serial_ports[] = {
41         {
42                 .membase        = (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET),
43                 .mapbase        = (IXP4XX_UART1_BASE_PHYS),
44                 .irq            = IRQ_IXP4XX_UART1,
45                 .flags          = UPF_SKIP_TEST,
46                 .iotype         = UPIO_MEM,
47                 .regshift       = 2,
48                 .uartclk        = IXP4XX_UART_XTAL,
49                 .line           = 0,
50                 .type           = PORT_XSCALE,
51                 .fifosize       = 32
52         }
53 #if 0
54         , {
55                 .membase        = (char*)(IXP4XX_UART2_BASE_VIRT + REG_OFFSET),
56                 .mapbase        = (IXP4XX_UART2_BASE_PHYS),
57                 .irq            = IRQ_IXP4XX_UART2,
58                 .flags          = UPF_SKIP_TEST,
59                 .iotype         = UPIO_MEM,
60                 .regshift       = 2,
61                 .uartclk        = IXP4XX_UART_XTAL,
62                 .line           = 1,
63                 .type           = PORT_XSCALE,
64                 .fifosize       = 32
65         }
66 #endif
67 };
68
69 void __init nslu2_map_io(void)
70 {
71         early_serial_setup(&nslu2_serial_ports[0]);
72 #if 0
73         early_serial_setup(&nslu2_serial_ports[1]);
74 #endif
75         ixp4xx_map_io();
76 }
77
78 static struct flash_platform_data nslu2_flash_data = {
79         .map_name       = "cfi_probe",
80         .width          = 2,
81 };
82
83 static struct resource nslu2_flash_resource = {
84         .start          = NSLU2_FLASH_BASE,
85         .end            = NSLU2_FLASH_BASE + NSLU2_FLASH_SIZE,
86         .flags          = IORESOURCE_MEM,
87 };
88
89 static struct platform_device nslu2_flash = {
90         .name           = "IXP4XX-Flash",
91         .id             = 0,
92         .dev            = {
93                 .platform_data = &nslu2_flash_data,
94         },
95         .num_resources  = 1,
96         .resource       = &nslu2_flash_resource,
97 };
98
99 static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
100         .sda_pin        = NSLU2_SDA_PIN,
101         .scl_pin        = NSLU2_SCL_PIN,
102 };
103
104 static struct platform_device nslu2_i2c_controller = {
105         .name           = "IXP4XX-I2C",
106         .id             = 0,
107         .dev            = {
108                 .platform_data = &nslu2_i2c_gpio_pins,
109         },
110         .num_resources  = 0
111 };
112
113 static struct platform_device *nslu2_devices[] __initdata = {
114         &nslu2_i2c_controller,
115         &nslu2_flash
116 };
117
118 static void __init nslu2_init(void)
119 {
120         platform_add_devices(&nslu2_devices, ARRAY_SIZE(nslu2_devices));
121 }
122
123 MACHINE_START(NSLU2, "Linksys NSLU2")
124         MAINTAINER("www.nslu2-linux.org")
125         BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
126                 IXP4XX_PERIPHERAL_BASE_VIRT)
127         MAPIO(nslu2_map_io)
128         INITIRQ(ixp4xx_init_irq)        //FIXME: all irq are off here
129         INITTIME(ixp4xx_init_time)      //this was missing in 2.6.7 code ...soft reboot needed?
130         BOOT_PARAMS(0x0100)
131         INIT_MACHINE(nslu2_init)
132 MACHINE_END