2 * linux/arch/arm/mach-sa1100/yopy.c
4 #include <linux/module.h>
5 #include <linux/init.h>
6 #include <linux/kernel.h>
9 #include <asm/hardware.h>
10 #include <asm/setup.h>
12 #include <asm/mach/arch.h>
13 #include <asm/mach/map.h>
14 #include <asm/mach/serial_sa1100.h>
19 static spinlock_t egpio_lock = SPIN_LOCK_UNLOCKED;
21 static unsigned long yopy_egpio =
22 GPIO_MASK(GPIO_CF_RESET) |
23 GPIO_MASK(GPIO_CLKDIV_CLR1) | GPIO_MASK(GPIO_CLKDIV_CLR2) |
24 GPIO_MASK(GPIO_SPEAKER_MUTE) | GPIO_MASK(GPIO_AUDIO_OPAMP_POWER);
26 int yopy_gpio_test(unsigned int gpio)
28 return ((yopy_egpio & (1 << gpio)) != 0);
31 void yopy_gpio_set(unsigned int gpio, int level)
33 unsigned long flags, mask;
37 spin_lock_irqsave(&egpio_lock, flags);
43 YOPY_EGPIO = yopy_egpio;
45 spin_unlock_irqrestore(&egpio_lock, flags);
48 EXPORT_SYMBOL(yopy_gpio_test);
49 EXPORT_SYMBOL(yopy_gpio_set);
51 static int __init yopy_hw_init(void)
53 if (machine_is_yopy()) {
54 YOPY_EGPIO = yopy_egpio;
61 YOPY_EGPIO = yopy_egpio;
67 __initcall(yopy_hw_init);
70 static struct map_desc yopy_io_desc[] __initdata = {
71 /* virtual physical length domain r w c b */
72 { 0xe8000000, 0x00000000, 0x04000000, DOMAIN_IO, 0, 1, 0, 0 }, /* Flash 0 */
73 { 0xec000000, 0x08000000, 0x04000000, DOMAIN_IO, 0, 1, 0, 0 }, /* Flash 1 */
74 { 0xf0000000, 0x48000000, 0x00300000, DOMAIN_IO, 0, 1, 0, 0 }, /* LCD */
75 { 0xf1000000, 0x10000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* EGPIO */
79 static void __init yopy_map_io(void)
82 iotable_init(yopy_io_desc);
84 sa1100_register_uart(0, 3);
86 set_GPIO_IRQ_edge(GPIO_UCB1200_IRQ, GPIO_RISING_EDGE);
90 MACHINE_START(YOPY, "Yopy")
91 MAINTAINER("G.Mate, Inc.")
92 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
93 BOOT_PARAMS(0xc0000100)
95 INITIRQ(sa1100_init_irq)