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/mach-types.h>
11 #include <asm/setup.h>
13 #include <asm/mach/arch.h>
14 #include <asm/mach/map.h>
15 #include <asm/mach/serial_sa1100.h>
20 static spinlock_t egpio_lock = SPIN_LOCK_UNLOCKED;
22 static unsigned long yopy_egpio =
23 GPIO_MASK(GPIO_CF_RESET) |
24 GPIO_MASK(GPIO_CLKDIV_CLR1) | GPIO_MASK(GPIO_CLKDIV_CLR2) |
25 GPIO_MASK(GPIO_SPEAKER_MUTE) | GPIO_MASK(GPIO_AUDIO_OPAMP_POWER);
27 int yopy_gpio_test(unsigned int gpio)
29 return ((yopy_egpio & (1 << gpio)) != 0);
32 void yopy_gpio_set(unsigned int gpio, int level)
34 unsigned long flags, mask;
38 spin_lock_irqsave(&egpio_lock, flags);
44 YOPY_EGPIO = yopy_egpio;
46 spin_unlock_irqrestore(&egpio_lock, flags);
49 EXPORT_SYMBOL(yopy_gpio_test);
50 EXPORT_SYMBOL(yopy_gpio_set);
52 static int __init yopy_hw_init(void)
54 if (machine_is_yopy()) {
55 YOPY_EGPIO = yopy_egpio;
62 YOPY_EGPIO = yopy_egpio;
68 arch_initcall(yopy_hw_init);
71 static struct map_desc yopy_io_desc[] __initdata = {
72 /* virtual physical length type */
73 { 0xf0000000, 0x48000000, 0x00300000, MT_DEVICE }, /* LCD */
74 { 0xf1000000, 0x10000000, 0x00100000, MT_DEVICE } /* EGPIO */
77 static void __init yopy_map_io(void)
80 iotable_init(yopy_io_desc, ARRAY_SIZE(yopy_io_desc));
82 sa1100_register_uart(0, 3);
84 set_GPIO_IRQ_edge(GPIO_UCB1200_IRQ, GPIO_RISING_EDGE);
88 MACHINE_START(YOPY, "Yopy")
89 MAINTAINER("G.Mate, Inc.")
90 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
91 BOOT_PARAMS(0xc0000100)
93 INITIRQ(sa1100_init_irq)
94 INITTIME(sa1100_init_time)