Imre Kaloz | 46918bd | 2007-06-02 15:44:08 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-ixp4xx/gateway7001-setup.c |
| 3 | * |
| 4 | * Board setup for the Gateway 7001 board |
| 5 | * |
| 6 | * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org> |
| 7 | * |
| 8 | * based on coyote-setup.c: |
| 9 | * Copyright (C) 2003-2005 MontaVista Software, Inc. |
| 10 | * |
| 11 | * Author: Imre Kaloz <Kaloz@openwrt.org> |
| 12 | */ |
| 13 | |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/device.h> |
| 17 | #include <linux/serial.h> |
| 18 | #include <linux/tty.h> |
| 19 | #include <linux/serial_8250.h> |
Imre Kaloz | 46918bd | 2007-06-02 15:44:08 +0100 | [diff] [blame] | 20 | |
| 21 | #include <asm/types.h> |
| 22 | #include <asm/setup.h> |
| 23 | #include <asm/memory.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 24 | #include <mach/hardware.h> |
Imre Kaloz | 46918bd | 2007-06-02 15:44:08 +0100 | [diff] [blame] | 25 | #include <asm/irq.h> |
| 26 | #include <asm/mach-types.h> |
| 27 | #include <asm/mach/arch.h> |
| 28 | #include <asm/mach/flash.h> |
| 29 | |
| 30 | static struct flash_platform_data gateway7001_flash_data = { |
| 31 | .map_name = "cfi_probe", |
| 32 | .width = 2, |
| 33 | }; |
| 34 | |
| 35 | static struct resource gateway7001_flash_resource = { |
| 36 | .flags = IORESOURCE_MEM, |
| 37 | }; |
| 38 | |
| 39 | static struct platform_device gateway7001_flash = { |
| 40 | .name = "IXP4XX-Flash", |
| 41 | .id = 0, |
| 42 | .dev = { |
| 43 | .platform_data = &gateway7001_flash_data, |
| 44 | }, |
| 45 | .num_resources = 1, |
| 46 | .resource = &gateway7001_flash_resource, |
| 47 | }; |
| 48 | |
| 49 | static struct resource gateway7001_uart_resource = { |
| 50 | .start = IXP4XX_UART2_BASE_PHYS, |
| 51 | .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, |
| 52 | .flags = IORESOURCE_MEM, |
| 53 | }; |
| 54 | |
| 55 | static struct plat_serial8250_port gateway7001_uart_data[] = { |
| 56 | { |
| 57 | .mapbase = IXP4XX_UART2_BASE_PHYS, |
| 58 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, |
| 59 | .irq = IRQ_IXP4XX_UART2, |
| 60 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
| 61 | .iotype = UPIO_MEM, |
| 62 | .regshift = 2, |
| 63 | .uartclk = IXP4XX_UART_XTAL, |
| 64 | }, |
| 65 | { }, |
| 66 | }; |
| 67 | |
| 68 | static struct platform_device gateway7001_uart = { |
| 69 | .name = "serial8250", |
| 70 | .id = PLAT8250_DEV_PLATFORM, |
| 71 | .dev = { |
| 72 | .platform_data = gateway7001_uart_data, |
| 73 | }, |
| 74 | .num_resources = 1, |
| 75 | .resource = &gateway7001_uart_resource, |
| 76 | }; |
| 77 | |
| 78 | static struct platform_device *gateway7001_devices[] __initdata = { |
| 79 | &gateway7001_flash, |
| 80 | &gateway7001_uart |
| 81 | }; |
| 82 | |
| 83 | static void __init gateway7001_init(void) |
| 84 | { |
| 85 | ixp4xx_sys_init(); |
| 86 | |
| 87 | gateway7001_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); |
| 88 | gateway7001_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; |
| 89 | |
| 90 | *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; |
| 91 | *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; |
| 92 | |
| 93 | platform_add_devices(gateway7001_devices, ARRAY_SIZE(gateway7001_devices)); |
| 94 | } |
| 95 | |
| 96 | #ifdef CONFIG_MACH_GATEWAY7001 |
| 97 | MACHINE_START(GATEWAY7001, "Gateway 7001 AP") |
| 98 | /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */ |
Imre Kaloz | 46918bd | 2007-06-02 15:44:08 +0100 | [diff] [blame] | 99 | .map_io = ixp4xx_map_io, |
Rob Herring | f449588 | 2012-03-06 15:01:53 -0600 | [diff] [blame] | 100 | .init_early = ixp4xx_init_early, |
Imre Kaloz | 46918bd | 2007-06-02 15:44:08 +0100 | [diff] [blame] | 101 | .init_irq = ixp4xx_init_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 102 | .init_time = ixp4xx_timer_init, |
Nicolas Pitre | e022c72 | 2011-07-05 22:38:13 -0400 | [diff] [blame] | 103 | .atag_offset = 0x100, |
Imre Kaloz | 46918bd | 2007-06-02 15:44:08 +0100 | [diff] [blame] | 104 | .init_machine = gateway7001_init, |
Nicolas Pitre | 7553ee7 | 2011-07-05 22:28:09 -0400 | [diff] [blame] | 105 | #if defined(CONFIG_PCI) |
| 106 | .dma_zone_size = SZ_64M, |
| 107 | #endif |
Russell King | d1b860f | 2011-11-05 12:10:55 +0000 | [diff] [blame] | 108 | .restart = ixp4xx_restart, |
Imre Kaloz | 46918bd | 2007-06-02 15:44:08 +0100 | [diff] [blame] | 109 | MACHINE_END |
| 110 | #endif |