2 * linux/arch/arm/mach-sa1100/adsbitsy.c
6 * Pieces specific to the ADS Bitsy
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/init.h>
14 #include <linux/sched.h>
15 #include <linux/interrupt.h>
16 #include <linux/ptrace.h>
17 #include <linux/serial_core.h>
19 #include <asm/hardware.h>
20 #include <asm/setup.h>
23 #include <asm/mach/irq.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
26 #include <asm/mach/serial_sa1100.h>
28 #include <asm/arch/irq.h>
33 static int __init adsbitsy_init(void)
37 if (!machine_is_adsbitsy())
41 * Ensure that the memory bus request/grant signals are setup,
42 * and the grant is held in its inactive state
56 ret = sa1111_probe(ADSBITSY_SA1111_BASE);
61 * We found it. Wake the chip up.
66 * The SDRAM configuration of the SA1110 and the SA1111 must
67 * match. This is very important to ensure that SA1111 accesses
68 * don't corrupt the SDRAM. Note that this ungates the SA1111's
69 * MBGNT signal, so we must have called sa1110_mb_disable()
72 sa1111_configure_smc(1,
73 FExtr(MDCNFG, MDCNFG_SA1110_DRAC0),
74 FExtr(MDCNFG, MDCNFG_SA1110_TDL0));
77 * Enable PWM control for LCD
79 SKPCR |= SKPCR_PWMCLKEN;
82 SKPWM1 = 0x01; // Backlight
86 * We only need to turn on DCLK whenever we want to use the
87 * DMA. It can otherwise be held firmly in the off position.
89 SKPCR |= SKPCR_DCLKEN;
92 * Enable the SA1110 memory bus request and grant signals.
96 set_GPIO_IRQ_edge(GPIO_GPIO0, GPIO_RISING_EDGE);
97 sa1111_init_irq(IRQ_GPIO0);
102 __initcall(adsbitsy_init);
104 static void __init adsbitsy_init_irq(void)
106 /* First the standard SA1100 IRQs */
112 * Initialization fixup
116 fixup_adsbitsy(struct machine_desc *desc, struct param_struct *params,
117 char **cmdline, struct meminfo *mi)
119 SET_BANK( 0, 0xc0000000, 32*1024*1024 );
122 ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
123 setup_ramdisk( 1, 0, 0, 8192 );
124 setup_initrd( __phys_to_virt(0xc0800000), 4*1024*1024 );
127 static struct map_desc adsbitsy_io_desc[] __initdata = {
128 /* virtual physical length domain r w c b */
129 { 0xe8000000, 0x08000000, 0x01000000, DOMAIN_IO, 0, 1, 0, 0 }, /* Flash bank 1 */
130 { 0xf4000000, 0x18000000, 0x00800000, DOMAIN_IO, 0, 1, 0, 0 }, /* SA1111 */
134 static int adsbitsy_uart_open(struct uart_port *port, struct uart_info *info)
136 if (port->mapbase == _Ser1UTCR0) {
137 Ser1SDCR0 |= SDCR0_UART;
138 #error Fixme // Set RTS High (should be done in the set_mctrl fn)
140 } else if (port->mapbase == _Ser2UTCR0) {
141 Ser2UTCR4 = Ser2HSCR0 = 0;
142 #error Fixme // Set RTS High (should be done in the set_mctrl fn)
144 } else if (port->mapbase == _Ser2UTCR0) {
145 #error Fixme // Set RTS High (should be done in the set_mctrl fn)
151 static struct sa1100_port_fns adsbitsy_port_fns __initdata = {
152 open: adsbitsy_uart_open,
155 static void __init adsbitsy_map_io(void)
158 iotable_init(adsbitsy_io_desc);
160 sa1100_register_uart_fns(&adsbitsy_port_fns);
161 sa1100_register_uart(0, 3);
162 sa1100_register_uart(1, 1);
163 sa1100_register_uart(2, 2);
164 GPDR |= GPIO_GPIO15 | GPIO_GPIO17 | GPIO_GPIO19;
165 GPDR &= ~(GPIO_GPIO14 | GPIO_GPIO16 | GPIO_GPIO18);
168 MACHINE_START(ADSBITSY, "ADS Bitsy")
169 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
170 FIXUP(fixup_adsbitsy)
171 MAPIO(adsbitsy_map_io)
172 INITIRQ(adsbitsy_init_irq)