~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-sa1100/adsbitsy.c

Version: ~ [ linux-5.9 ] ~ [ linux-5.8.14 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.70 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.150 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.200 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.238 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.238 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * linux/arch/arm/mach-sa1100/adsbitsy.c
  3  *
  4  * Author: Woojung Huh
  5  *
  6  * Pieces specific to the ADS Bitsy
  7  *
  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.
 11  */
 12 #include <linux/kernel.h>
 13 #include <linux/init.h>
 14 #include <linux/ptrace.h>
 15 #include <linux/ioport.h>
 16 #include <linux/serial_core.h>
 17 
 18 #include <asm/hardware.h>
 19 #include <asm/mach-types.h>
 20 #include <asm/setup.h>
 21 #include <asm/irq.h>
 22 
 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>
 27 
 28 #include "generic.h"
 29 
 30 static struct resource sa1111_resources[] = {
 31         [0] = {
 32                 .start          = 0x18000000,
 33                 .end            = 0x18001fff,
 34                 .flags          = IORESOURCE_MEM,
 35         },
 36         [1] = {
 37                 .start          = IRQ_GPIO0,
 38                 .end            = IRQ_GPIO0,
 39                 .flags          = IORESOURCE_IRQ,
 40         },
 41 };
 42 
 43 static u64 sa1111_dmamask = 0xffffffffUL;
 44 
 45 static struct platform_device sa1111_device = {
 46         .name           = "sa1111",
 47         .id             = 0,
 48         .dev            = {
 49                 .dma_mask = &sa1111_dmamask,
 50         },
 51         .num_resources  = ARRAY_SIZE(sa1111_resources),
 52         .resource       = sa1111_resources,
 53 };
 54 
 55 static struct platform_device *devices[] __initdata = {
 56         &sa1111_device,
 57 };
 58 
 59 static int __init adsbitsy_init(void)
 60 {
 61         int ret;
 62 
 63         if (!machine_is_adsbitsy())
 64                 return -ENODEV;
 65 
 66         /*
 67          * Ensure that the memory bus request/grant signals are setup,
 68          * and the grant is held in its inactive state
 69          */
 70         sa1110_mb_disable();
 71 
 72         /*
 73          * Reset SA1111
 74          */
 75         GPCR |= GPIO_GPIO26;
 76         udelay(1000);
 77         GPSR |= GPIO_GPIO26;
 78 
 79         /*
 80          * Probe for SA1111.
 81          */
 82         ret = platform_add_devices(devices, ARRAY_SIZE(devices));
 83         if (ret < 0)
 84                 return ret;
 85 
 86         /*
 87          * Enable PWM control for LCD
 88          */
 89         sa1111_enable_device(SKPCR_PWMCLKEN);
 90         SKPWM0 = 0x7F;                          // VEE
 91         SKPEN0 = 1;
 92         SKPWM1 = 0x01;                          // Backlight
 93         SKPEN1 = 1;
 94 
 95         return 0;
 96 }
 97 
 98 arch_initcall(adsbitsy_init);
 99 
100 static void __init adsbitsy_init_irq(void)
101 {
102         /* First the standard SA1100 IRQs */
103         sa1100_init_irq();
104 }
105 
106 static struct map_desc adsbitsy_io_desc[] __initdata = {
107  /* virtual     physical    length      type */
108   { 0xf4000000, 0x18000000, 0x00800000, MT_DEVICE }  /* SA1111 */
109 };
110 
111 static int adsbitsy_uart_open(struct uart_port *port, struct uart_info *info)
112 {
113         if (port->mapbase == _Ser1UTCR0) {
114                 Ser1SDCR0 |= SDCR0_UART;
115 #error Fixme    // Set RTS High (should be done in the set_mctrl fn)
116                 GPCR = GPIO_GPIO15;
117         } else if (port->mapbase == _Ser2UTCR0) {
118                 Ser2UTCR4 = Ser2HSCR0 = 0;
119 #error Fixme    // Set RTS High (should be done in the set_mctrl fn)
120                 GPCR = GPIO_GPIO17;
121         } else if (port->mapbase == _Ser2UTCR0) {
122 #error Fixme    // Set RTS High (should be done in the set_mctrl fn)
123                 GPCR = GPIO_GPIO19;
124         }
125         return 0;
126 }
127 
128 static struct sa1100_port_fns adsbitsy_port_fns __initdata = {
129         .open   = adsbitsy_uart_open,
130 };
131 
132 static void __init adsbitsy_map_io(void)
133 {
134         sa1100_map_io();
135         iotable_init(adsbitsy_io_desc, ARRAY_SIZE(adsbitsy_io_desc));
136 
137         sa1100_register_uart_fns(&adsbitsy_port_fns);
138         sa1100_register_uart(0, 3);
139         sa1100_register_uart(1, 1);
140         sa1100_register_uart(2, 2);
141         GPDR |= GPIO_GPIO15 | GPIO_GPIO17 | GPIO_GPIO19;
142         GPDR &= ~(GPIO_GPIO14 | GPIO_GPIO16 | GPIO_GPIO18);
143 }
144 
145 MACHINE_START(ADSBITSY, "ADS Bitsy")
146         BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
147         MAPIO(adsbitsy_map_io)
148         INITIRQ(adsbitsy_init_irq)
149 MACHINE_END
150 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp