Blame view

arch/arm/mach-sa1100/pleb.c 3.02 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
8
  /*
   * linux/arch/arm/mach-sa1100/pleb.c
   */
  
  #include <linux/init.h>
  #include <linux/kernel.h>
  #include <linux/tty.h>
  #include <linux/ioport.h>
d052d1bef   Russell King   Create platform_d...
9
  #include <linux/platform_device.h>
119c641c9   Thomas Gleixner   [ARM] 3698/1: ARM...
10
  #include <linux/irq.h>
fced80c73   Russell King   [ARM] Convert asm...
11
  #include <linux/io.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
12
  #include <linux/mtd/partitions.h>
a09e64fbc   Russell King   [ARM] Move includ...
13
  #include <mach/hardware.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
14
15
16
17
18
19
20
  #include <asm/setup.h>
  #include <asm/mach-types.h>
  
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  #include <asm/mach/flash.h>
  #include <asm/mach/serial_sa1100.h>
a09e64fbc   Russell King   [ARM] Move includ...
21
  #include <mach/irqs.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  
  #include "generic.h"
  
  
  /*
   * Ethernet IRQ mappings
   */
  
  #define PLEB_ETH0_P		(0x20000300)	/* Ethernet 0 in PCMCIA0 IO */
  #define PLEB_ETH0_V		(0xf6000300)
  
  #define GPIO_ETH0_IRQ		GPIO_GPIO(21)
  #define GPIO_ETH0_EN		GPIO_GPIO(26)
  
  #define IRQ_GPIO_ETH0_IRQ	IRQ_GPIO21
  
  static struct resource smc91x_resources[] = {
  	[0] = {
bda030860   Kristoffer Ericson   [ARM] 5270/1: Fix...
40
41
  		.start	= PLEB_ETH0_P,
  		.end	= PLEB_ETH0_P | 0x03ffffff,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
  		.flags	= IORESOURCE_MEM,
  	},
  #if 0 /* Autoprobe instead, to get rising/falling edge characteristic right */
  	[1] = {
  		.start	= IRQ_GPIO_ETH0_IRQ,
  		.end	= IRQ_GPIO_ETH0_IRQ,
  		.flags	= IORESOURCE_IRQ,
  	},
  #endif
  };
  
  
  static struct platform_device smc91x_device = {
  	.name		= "smc91x",
  	.id		= 0,
  	.num_resources	= ARRAY_SIZE(smc91x_resources),
  	.resource	= smc91x_resources,
  };
  
  static struct platform_device *devices[] __initdata = {
  	&smc91x_device,
  };
  
  
  /*
   * Pleb's memory map
   * has flash memory (typically 4 or 8 meg) selected by
   * the two SA1100 lowest chip select outputs.
   */
  static struct resource pleb_flash_resources[] = {
  	[0] = {
  		.start = SA1100_CS0_PHYS,
  		.end   = SA1100_CS0_PHYS + SZ_8M - 1,
  		.flags = IORESOURCE_MEM,
  	},
  	[1] = {
  		.start = SA1100_CS1_PHYS,
  		.end   = SA1100_CS1_PHYS + SZ_8M - 1,
  		.flags = IORESOURCE_MEM,
  	}
  };
  
  
  static struct mtd_partition pleb_partitions[] = {
  	{
  		.name		= "blob",
bda030860   Kristoffer Ericson   [ARM] 5270/1: Fix...
88
  		.offset		= 0,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
89
90
91
  		.size		= 0x00020000,
  	}, {
  		.name		= "kernel",
bda030860   Kristoffer Ericson   [ARM] 5270/1: Fix...
92
  		.offset		= MTDPART_OFS_APPEND,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
93
94
95
  		.size		= 0x000e0000,
  	}, {
  		.name		= "rootfs",
bda030860   Kristoffer Ericson   [ARM] 5270/1: Fix...
96
  		.offset		= MTDPART_OFS_APPEND,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
97
98
99
100
101
102
103
104
105
106
107
108
109
110
  		.size		= 0x00300000,
  	}
  };
  
  
  static struct flash_platform_data pleb_flash_data = {
  	.map_name = "cfi_probe",
  	.parts = pleb_partitions,
  	.nr_parts = ARRAY_SIZE(pleb_partitions),
  };
  
  
  static void __init pleb_init(void)
  {
7a5b4e16c   Russell King   ARM: sa11x0: conv...
111
  	sa11x0_register_mtd(&pleb_flash_data, pleb_flash_resources,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
112
113
114
115
116
117
118
119
120
121
122
123
  			      ARRAY_SIZE(pleb_flash_resources));
  
  
  	platform_add_devices(devices, ARRAY_SIZE(devices));
  }
  
  
  static void __init pleb_map_io(void)
  {
  	sa1100_map_io();
  
  	sa1100_register_uart(0, 3);
93982535a   Kristoffer Ericson   [ARM] 5336/1: For...
124
  	sa1100_register_uart(1, 1);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
125

93982535a   Kristoffer Ericson   [ARM] 5336/1: For...
126
127
128
129
  	GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
  	GPDR |= GPIO_UART_TXD;
  	GPDR &= ~GPIO_UART_RXD;
  	PPAR |= PPAR_UPR;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
130
131
132
133
134
135
136
137
138
139
140
141
142
  
  	/*
  	 * Fix expansion memory timing for network card
  	 */
  	MECR = ((2<<10) | (2<<5) | (2<<0));
  
  	/*
  	 * Enable the SMC ethernet controller
  	 */
  	GPDR |= GPIO_ETH0_EN;	/* set to output */
  	GPCR  = GPIO_ETH0_EN;	/* clear MCLK (enable smc) */
  
  	GPDR &= ~GPIO_ETH0_IRQ;
6845664a6   Thomas Gleixner   arm: Cleanup the ...
143
  	irq_set_irq_type(GPIO_ETH0_IRQ, IRQ_TYPE_EDGE_FALLING);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
144
145
146
  }
  
  MACHINE_START(PLEB, "PLEB")
e9dea0c65   Russell King   [PATCH] ARM: Remo...
147
148
  	.map_io		= pleb_map_io,
  	.init_irq	= sa1100_init_irq,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
149
150
  	.timer		= &sa1100_timer,
  	.init_machine   = pleb_init,
d9ca5839f   Russell King   ARM: restart: sa1...
151
  	.restart	= sa11x0_restart,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
152
  MACHINE_END