2 * linux/arch/arm/mach-sa1100/simpad.c
6 #include <linux/config.h>
7 #include <linux/module.h>
8 #include <linux/init.h>
9 #include <linux/kernel.h>
10 #include <linux/tty.h>
11 #include <linux/proc_fs.h>
12 #include <linux/string.h>
14 #include <asm/hardware.h>
15 #include <asm/setup.h>
17 #include <asm/mach/arch.h>
18 #include <asm/mach/map.h>
19 #include <asm/mach/serial_sa1100.h>
20 #include <linux/serial_core.h>
31 void set_cs3_bit(int value)
34 *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow;
37 void clear_cs3_bit(int value)
40 *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow;
44 fixup_simpad(struct machine_desc *desc, struct param_struct *params,
45 char **cmdline, struct meminfo *mi)
47 #ifdef CONFIG_SA1100_SIMPAD_DRAM_64MB /* DRAM */
48 SET_BANK( 0, 0xc0000000, 64*1024*1024 );
50 SET_BANK( 0, 0xc0000000, 32*1024*1024 );
53 ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
54 setup_ramdisk( 1, 0, 0, 8192 );
55 setup_initrd( __phys_to_virt(0xc0800000), 4*1024*1024 );
59 static struct map_desc simpad_io_desc[] __initdata = {
60 /* virtual physical length domain r w c b */
61 { 0xe8000000, 0x00000000, 0x02000000, DOMAIN_IO, 0, 1, 0, 0 },
62 { 0xf2800000, 0x4b800000, 0x00800000, DOMAIN_IO, 0, 1, 0, 0 }, /* MQ200 */
63 { 0xf1000000, 0x18000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* Paules CS3, write only */
68 static void simpad_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
70 if (port->mapbase == (u_int)&Ser1UTCR0) {
72 clear_cs3_bit(RS232_ON);
74 set_cs3_bit(RS232_ON);
78 static struct sa1100_port_fns simpad_port_fns __initdata = {
82 static void __init simpad_map_io(void)
85 iotable_init(simpad_io_desc);
89 cs3_shadow = (EN1 | EN0 | LED2_ON | DISPLAY_ON | RS232_ON |
90 ENABLE_5V | RESET_SIMCARD);
91 *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow;
93 //It is only possible to register 3 UART in serial_sa1100.c
94 sa1100_register_uart(0, 3);
95 sa1100_register_uart(1, 1);
97 set_GPIO_IRQ_edge(GPIO_UCB1300_IRQ, GPIO_RISING_EDGE);
100 #ifdef CONFIG_PROC_FS
102 static char* name[]={
121 static int proc_cs3_read(char *page, char **start, off_t off,
122 int count, int *eof, void *data)
127 p += sprintf(p, "Chipselect3 : %x\n", cs3_shadow);
128 for (i = 0; i <= 15; i++) {
129 if(cs3_shadow & (1<<i)) {
130 p += sprintf(p, "%s\t: TRUE \n",name[i]);
132 p += sprintf(p, "%s\t: FALSE \n",name[i]);
134 len = (p - page) - off;
138 *eof = (len <= count) ? 1 : 0;
145 static struct proc_dir_entry *proc_cs3;
147 static int __init cs3_init(void)
149 proc_cs3 = create_proc_entry("cs3", 0, 0);
151 proc_cs3->read_proc = proc_cs3_read;
155 static int __exit cs3_exit(void)
158 remove_proc_entry( "cs3", 0);
161 __initcall(cs3_init);
163 #endif // CONFIG_PROC_FS
165 MACHINE_START(SIMPAD, "Simpad")
166 MAINTAINER("Juergen Messerer")
167 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
170 INITIRQ(sa1100_init_irq)