1/* 2 * linux/arch/arm/mach-sa1100/pleb.c 3 */ 4 5#include <linux/init.h> 6#include <linux/kernel.h> 7#include <linux/tty.h> 8#include <linux/ioport.h> 9#include <linux/platform_device.h> 10#include <linux/irq.h> 11 12#include <linux/mtd/partitions.h> 13 14#include <asm/hardware.h> 15#include <asm/io.h> 16#include <asm/setup.h> 17#include <asm/mach-types.h> 18 19#include <asm/mach/arch.h> 20#include <asm/mach/map.h> 21#include <asm/mach/flash.h> 22#include <asm/mach/serial_sa1100.h> 23#include <asm/arch/irqs.h> 24 25#include "generic.h" 26 27 28/* 29 * Ethernet IRQ mappings 30 */ 31 32#define PLEB_ETH0_P (0x20000300) /* Ethernet 0 in PCMCIA0 IO */ 33#define PLEB_ETH0_V (0xf6000300) 34 35#define GPIO_ETH0_IRQ GPIO_GPIO(21) 36#define GPIO_ETH0_EN GPIO_GPIO(26) 37 38#define IRQ_GPIO_ETH0_IRQ IRQ_GPIO21 39 40static struct resource smc91x_resources[] = { 41 [0] = { 42 .start = PLEB_ETH0_P, 43 .end = PLEB_ETH0_P | 0x03ffffff, 44 .flags = IORESOURCE_MEM, 45 }, 46}; 47 48 49static struct platform_device smc91x_device = { 50 .name = "smc91x", 51 .id = 0, 52 .num_resources = ARRAY_SIZE(smc91x_resources), 53 .resource = smc91x_resources, 54}; 55 56static struct platform_device *devices[] __initdata = { 57 &smc91x_device, 58}; 59 60 61/* 62 * Pleb's memory map 63 * has flash memory (typically 4 or 8 meg) selected by 64 * the two SA1100 lowest chip select outputs. 65 */ 66static struct resource pleb_flash_resources[] = { 67 [0] = { 68 .start = SA1100_CS0_PHYS, 69 .end = SA1100_CS0_PHYS + SZ_8M - 1, 70 .flags = IORESOURCE_MEM, 71 }, 72 [1] = { 73 .start = SA1100_CS1_PHYS, 74 .end = SA1100_CS1_PHYS + SZ_8M - 1, 75 .flags = IORESOURCE_MEM, 76 } 77}; 78 79 80static struct mtd_partition pleb_partitions[] = { 81 { 82 .name = "blob", 83 .offset = 0, 84 .size = 0x00020000, 85 }, { 86 .name = "kernel", 87 .offset = MTDPART_OFS_APPEND, 88 .size = 0x000e0000, 89 }, { 90 .name = "rootfs", 91 .offset = MTDPART_OFS_APPEND, 92 .size = 0x00300000, 93 } 94}; 95 96 97static struct flash_platform_data pleb_flash_data = { 98 .map_name = "cfi_probe", 99 .parts = pleb_partitions, 100 .nr_parts = ARRAY_SIZE(pleb_partitions), 101}; 102 103 104static void __init pleb_init(void) 105{ 106 sa11x0_set_flash_data(&pleb_flash_data, pleb_flash_resources, 107 ARRAY_SIZE(pleb_flash_resources)); 108 109 110 platform_add_devices(devices, ARRAY_SIZE(devices)); 111} 112 113 114static void __init pleb_map_io(void) 115{ 116 sa1100_map_io(); 117 118 sa1100_register_uart(0, 3); 119 sa1100_register_uart(1, 1); 120 121 GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD); 122 GPDR |= GPIO_UART_TXD; 123 GPDR &= ~GPIO_UART_RXD; 124 PPAR |= PPAR_UPR; 125 126 /* 127 * Fix expansion memory timing for network card 128 */ 129 MECR = ((2<<10) | (2<<5) | (2<<0)); 130 131 /* 132 * Enable the SMC ethernet controller 133 */ 134 GPDR |= GPIO_ETH0_EN; /* set to output */ 135 GPCR = GPIO_ETH0_EN; /* clear MCLK (enable smc) */ 136 137 GPDR &= ~GPIO_ETH0_IRQ; 138 139 set_irq_type(GPIO_ETH0_IRQ, IRQT_FALLING); 140} 141 142MACHINE_START(PLEB, "PLEB") 143 .phys_io = 0x80000000, 144 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, 145 .map_io = pleb_map_io, 146 .init_irq = sa1100_init_irq, 147 .timer = &sa1100_timer, 148 .init_machine = pleb_init, 149MACHINE_END 150