Krzysztof Kozlowski | 84b2170 | 2017-12-25 20:54:32 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // |
| 3 | // Copyright (c) 2003-2008 Simtec Electronics |
| 4 | // Ben Dooks <ben@simtec.co.uk> |
| 5 | // |
| 6 | // Machine support for Thorcom VR1000 board. Designed for Thorcom by |
| 7 | // Simtec Electronics, http://www.simtec.co.uk/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
| 9 | #include <linux/kernel.h> |
| 10 | #include <linux/types.h> |
| 11 | #include <linux/interrupt.h> |
| 12 | #include <linux/list.h> |
| 13 | #include <linux/timer.h> |
| 14 | #include <linux/init.h> |
Ben Dooks | ec976d6 | 2009-05-13 22:52:24 +0100 | [diff] [blame] | 15 | #include <linux/gpio.h> |
Linus Walleij | f7f611f | 2020-07-08 09:11:49 +0200 | [diff] [blame] | 16 | #include <linux/gpio/machine.h> |
Ben Dooks | d97a666 | 2005-06-23 21:56:47 +0100 | [diff] [blame] | 17 | #include <linux/dm9000.h> |
Ben Dooks | 60d6698 | 2008-07-03 11:24:42 +0100 | [diff] [blame] | 18 | #include <linux/i2c.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
| 20 | #include <linux/serial.h> |
| 21 | #include <linux/tty.h> |
| 22 | #include <linux/serial_8250.h> |
| 23 | #include <linux/serial_reg.h> |
Tushar Behera | 334a1c7 | 2014-02-14 10:32:45 +0900 | [diff] [blame] | 24 | #include <linux/serial_s3c.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 25 | #include <linux/io.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
| 27 | #include <asm/mach/arch.h> |
| 28 | #include <asm/mach/map.h> |
| 29 | #include <asm/mach/irq.h> |
| 30 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #include <asm/irq.h> |
| 32 | #include <asm/mach-types.h> |
| 33 | |
Arnd Bergmann | 436d42c | 2012-08-24 15:22:12 +0200 | [diff] [blame] | 34 | #include <linux/platform_data/leds-s3c24xx.h> |
Arnd Bergmann | 436d42c | 2012-08-24 15:22:12 +0200 | [diff] [blame] | 35 | #include <linux/platform_data/i2c-s3c2410.h> |
| 36 | #include <linux/platform_data/asoc-s3c24xx_simtec.h> |
Ben Dooks | 9d529c6 | 2008-07-03 11:24:39 +0100 | [diff] [blame] | 37 | |
Arnd Bergmann | c6ff132 | 2019-09-02 18:37:30 +0200 | [diff] [blame] | 38 | #include "regs-gpio.h" |
| 39 | #include "gpio-samsung.h" |
| 40 | #include "gpio-cfg.h" |
Kukjin Kim | db8304e | 2013-01-02 10:47:40 -0800 | [diff] [blame] | 41 | |
Arnd Bergmann | c6ff132 | 2019-09-02 18:37:30 +0200 | [diff] [blame] | 42 | #include "cpu.h" |
| 43 | #include "devs.h" |
Kukjin Kim | db8304e | 2013-01-02 10:47:40 -0800 | [diff] [blame] | 44 | |
Kukjin Kim | bbd7e5e | 2013-01-01 19:56:20 -0800 | [diff] [blame] | 45 | #include "bast.h" |
Arnd Bergmann | 71b9114 | 2019-09-02 17:47:55 +0200 | [diff] [blame] | 46 | #include "s3c24xx.h" |
Kukjin Kim | bbd7e5e | 2013-01-01 19:56:20 -0800 | [diff] [blame] | 47 | #include "simtec.h" |
Kukjin Kim | db8304e | 2013-01-02 10:47:40 -0800 | [diff] [blame] | 48 | #include "vr1000.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | |
| 50 | /* macros for virtual address mods for the io space entries */ |
| 51 | #define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5) |
| 52 | #define VA_C4(item) ((unsigned long)(item) + BAST_VAM_CS4) |
| 53 | #define VA_C3(item) ((unsigned long)(item) + BAST_VAM_CS3) |
| 54 | #define VA_C2(item) ((unsigned long)(item) + BAST_VAM_CS2) |
| 55 | |
| 56 | /* macros to modify the physical addresses for io space */ |
| 57 | |
Ben Dooks | df1ec6d | 2005-11-08 19:15:30 +0000 | [diff] [blame] | 58 | #define PA_CS2(item) (__phys_to_pfn((item) + S3C2410_CS2)) |
| 59 | #define PA_CS3(item) (__phys_to_pfn((item) + S3C2410_CS3)) |
| 60 | #define PA_CS4(item) (__phys_to_pfn((item) + S3C2410_CS4)) |
| 61 | #define PA_CS5(item) (__phys_to_pfn((item) + S3C2410_CS5)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | |
| 63 | static struct map_desc vr1000_iodesc[] __initdata = { |
| 64 | /* ISA IO areas */ |
Ben Dooks | df1ec6d | 2005-11-08 19:15:30 +0000 | [diff] [blame] | 65 | { |
| 66 | .virtual = (u32)S3C24XX_VA_ISA_BYTE, |
| 67 | .pfn = PA_CS2(BAST_PA_ISAIO), |
| 68 | .length = SZ_16M, |
| 69 | .type = MT_DEVICE, |
Ben Dooks | df1ec6d | 2005-11-08 19:15:30 +0000 | [diff] [blame] | 70 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | |
Ben Dooks | df1ec6d | 2005-11-08 19:15:30 +0000 | [diff] [blame] | 72 | /* CPLD control registers, and external interrupt controls */ |
| 73 | { |
| 74 | .virtual = (u32)VR1000_VA_CTRL1, |
| 75 | .pfn = __phys_to_pfn(VR1000_PA_CTRL1), |
| 76 | .length = SZ_1M, |
| 77 | .type = MT_DEVICE, |
| 78 | }, { |
| 79 | .virtual = (u32)VR1000_VA_CTRL2, |
| 80 | .pfn = __phys_to_pfn(VR1000_PA_CTRL2), |
| 81 | .length = SZ_1M, |
| 82 | .type = MT_DEVICE, |
| 83 | }, { |
| 84 | .virtual = (u32)VR1000_VA_CTRL3, |
| 85 | .pfn = __phys_to_pfn(VR1000_PA_CTRL3), |
| 86 | .length = SZ_1M, |
| 87 | .type = MT_DEVICE, |
| 88 | }, { |
| 89 | .virtual = (u32)VR1000_VA_CTRL4, |
| 90 | .pfn = __phys_to_pfn(VR1000_PA_CTRL4), |
| 91 | .length = SZ_1M, |
| 92 | .type = MT_DEVICE, |
| 93 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK |
| 97 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB |
| 98 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE |
| 99 | |
Ben Dooks | 66a9b49 | 2006-06-18 23:04:05 +0100 | [diff] [blame] | 100 | static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | [0] = { |
| 102 | .hwport = 0, |
| 103 | .flags = 0, |
| 104 | .ucon = UCON, |
| 105 | .ulcon = ULCON, |
| 106 | .ufcon = UFCON, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | }, |
| 108 | [1] = { |
| 109 | .hwport = 1, |
| 110 | .flags = 0, |
| 111 | .ucon = UCON, |
| 112 | .ulcon = ULCON, |
| 113 | .ufcon = UFCON, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | }, |
| 115 | /* port 2 is not actually used */ |
| 116 | [2] = { |
| 117 | .hwport = 2, |
| 118 | .flags = 0, |
| 119 | .ucon = UCON, |
| 120 | .ulcon = ULCON, |
| 121 | .ufcon = UFCON, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | } |
| 123 | }; |
| 124 | |
| 125 | /* definitions for the vr1000 extra 16550 serial ports */ |
| 126 | |
| 127 | #define VR1000_BAUDBASE (3692307) |
| 128 | |
| 129 | #define VR1000_SERIAL_MAPBASE(x) (VR1000_PA_SERIAL + 0x80 + ((x) << 5)) |
| 130 | |
| 131 | static struct plat_serial8250_port serial_platform_data[] = { |
| 132 | [0] = { |
| 133 | .mapbase = VR1000_SERIAL_MAPBASE(0), |
Kukjin Kim | db8304e | 2013-01-02 10:47:40 -0800 | [diff] [blame] | 134 | .irq = VR1000_IRQ_SERIAL + 0, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, |
| 136 | .iotype = UPIO_MEM, |
| 137 | .regshift = 0, |
| 138 | .uartclk = VR1000_BAUDBASE, |
| 139 | }, |
| 140 | [1] = { |
| 141 | .mapbase = VR1000_SERIAL_MAPBASE(1), |
Kukjin Kim | db8304e | 2013-01-02 10:47:40 -0800 | [diff] [blame] | 142 | .irq = VR1000_IRQ_SERIAL + 1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, |
| 144 | .iotype = UPIO_MEM, |
| 145 | .regshift = 0, |
| 146 | .uartclk = VR1000_BAUDBASE, |
| 147 | }, |
| 148 | [2] = { |
| 149 | .mapbase = VR1000_SERIAL_MAPBASE(2), |
Kukjin Kim | db8304e | 2013-01-02 10:47:40 -0800 | [diff] [blame] | 150 | .irq = VR1000_IRQ_SERIAL + 2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, |
| 152 | .iotype = UPIO_MEM, |
| 153 | .regshift = 0, |
| 154 | .uartclk = VR1000_BAUDBASE, |
| 155 | }, |
| 156 | [3] = { |
| 157 | .mapbase = VR1000_SERIAL_MAPBASE(3), |
Kukjin Kim | db8304e | 2013-01-02 10:47:40 -0800 | [diff] [blame] | 158 | .irq = VR1000_IRQ_SERIAL + 3, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 159 | .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, |
| 160 | .iotype = UPIO_MEM, |
| 161 | .regshift = 0, |
| 162 | .uartclk = VR1000_BAUDBASE, |
| 163 | }, |
| 164 | { }, |
| 165 | }; |
| 166 | |
| 167 | static struct platform_device serial_device = { |
| 168 | .name = "serial8250", |
Russell King | 6df29de | 2005-09-08 16:04:41 +0100 | [diff] [blame] | 169 | .id = PLAT8250_DEV_PLATFORM, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | .dev = { |
| 171 | .platform_data = serial_platform_data, |
| 172 | }, |
| 173 | }; |
| 174 | |
Ben Dooks | d97a666 | 2005-06-23 21:56:47 +0100 | [diff] [blame] | 175 | /* DM9000 ethernet devices */ |
| 176 | |
| 177 | static struct resource vr1000_dm9k0_resource[] = { |
Tushar Behera | 940e46a | 2012-05-12 16:12:25 +0900 | [diff] [blame] | 178 | [0] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000, 4), |
| 179 | [1] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000 + 0x40, 0x40), |
Kukjin Kim | db8304e | 2013-01-02 10:47:40 -0800 | [diff] [blame] | 180 | [2] = DEFINE_RES_NAMED(VR1000_IRQ_DM9000A, 1, NULL, IORESOURCE_IRQ \ |
Tushar Behera | 940e46a | 2012-05-12 16:12:25 +0900 | [diff] [blame] | 181 | | IORESOURCE_IRQ_HIGHLEVEL), |
Ben Dooks | d97a666 | 2005-06-23 21:56:47 +0100 | [diff] [blame] | 182 | }; |
| 183 | |
| 184 | static struct resource vr1000_dm9k1_resource[] = { |
Tushar Behera | 940e46a | 2012-05-12 16:12:25 +0900 | [diff] [blame] | 185 | [0] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000 + 0x80, 4), |
| 186 | [1] = DEFINE_RES_MEM(S3C2410_CS5 + VR1000_PA_DM9000 + 0xC0, 0x40), |
Kukjin Kim | db8304e | 2013-01-02 10:47:40 -0800 | [diff] [blame] | 187 | [2] = DEFINE_RES_NAMED(VR1000_IRQ_DM9000N, 1, NULL, IORESOURCE_IRQ \ |
Tushar Behera | 940e46a | 2012-05-12 16:12:25 +0900 | [diff] [blame] | 188 | | IORESOURCE_IRQ_HIGHLEVEL), |
Ben Dooks | d97a666 | 2005-06-23 21:56:47 +0100 | [diff] [blame] | 189 | }; |
| 190 | |
| 191 | /* for the moment we limit ourselves to 16bit IO until some |
| 192 | * better IO routines can be written and tested |
| 193 | */ |
| 194 | |
Ben Dooks | 9f693d7 | 2005-10-12 19:58:07 +0100 | [diff] [blame] | 195 | static struct dm9000_plat_data vr1000_dm9k_platdata = { |
Ben Dooks | d97a666 | 2005-06-23 21:56:47 +0100 | [diff] [blame] | 196 | .flags = DM9000_PLATF_16BITONLY, |
| 197 | }; |
| 198 | |
| 199 | static struct platform_device vr1000_dm9k0 = { |
| 200 | .name = "dm9000", |
| 201 | .id = 0, |
| 202 | .num_resources = ARRAY_SIZE(vr1000_dm9k0_resource), |
| 203 | .resource = vr1000_dm9k0_resource, |
| 204 | .dev = { |
| 205 | .platform_data = &vr1000_dm9k_platdata, |
| 206 | } |
| 207 | }; |
| 208 | |
| 209 | static struct platform_device vr1000_dm9k1 = { |
| 210 | .name = "dm9000", |
| 211 | .id = 1, |
| 212 | .num_resources = ARRAY_SIZE(vr1000_dm9k1_resource), |
| 213 | .resource = vr1000_dm9k1_resource, |
| 214 | .dev = { |
| 215 | .platform_data = &vr1000_dm9k_platdata, |
| 216 | } |
| 217 | }; |
| 218 | |
Ben Dooks | b2eba6b | 2006-12-07 20:28:23 +0100 | [diff] [blame] | 219 | /* LEDS */ |
| 220 | |
Linus Walleij | f7f611f | 2020-07-08 09:11:49 +0200 | [diff] [blame] | 221 | static struct gpiod_lookup_table vr1000_led1_gpio_table = { |
| 222 | .dev_id = "s3c24xx_led.1", |
| 223 | .table = { |
| 224 | GPIO_LOOKUP("GPB", 0, NULL, GPIO_ACTIVE_HIGH), |
| 225 | { }, |
| 226 | }, |
| 227 | }; |
| 228 | |
| 229 | static struct gpiod_lookup_table vr1000_led2_gpio_table = { |
| 230 | .dev_id = "s3c24xx_led.2", |
| 231 | .table = { |
| 232 | GPIO_LOOKUP("GPB", 1, NULL, GPIO_ACTIVE_HIGH), |
| 233 | { }, |
| 234 | }, |
| 235 | }; |
| 236 | |
| 237 | static struct gpiod_lookup_table vr1000_led3_gpio_table = { |
| 238 | .dev_id = "s3c24xx_led.3", |
| 239 | .table = { |
| 240 | GPIO_LOOKUP("GPB", 2, NULL, GPIO_ACTIVE_HIGH), |
| 241 | { }, |
| 242 | }, |
| 243 | }; |
| 244 | |
Ben Dooks | b2eba6b | 2006-12-07 20:28:23 +0100 | [diff] [blame] | 245 | static struct s3c24xx_led_platdata vr1000_led1_pdata = { |
| 246 | .name = "led1", |
Ben Dooks | b2eba6b | 2006-12-07 20:28:23 +0100 | [diff] [blame] | 247 | .def_trigger = "", |
| 248 | }; |
| 249 | |
| 250 | static struct s3c24xx_led_platdata vr1000_led2_pdata = { |
| 251 | .name = "led2", |
Ben Dooks | b2eba6b | 2006-12-07 20:28:23 +0100 | [diff] [blame] | 252 | .def_trigger = "", |
| 253 | }; |
| 254 | |
| 255 | static struct s3c24xx_led_platdata vr1000_led3_pdata = { |
| 256 | .name = "led3", |
Ben Dooks | b2eba6b | 2006-12-07 20:28:23 +0100 | [diff] [blame] | 257 | .def_trigger = "", |
| 258 | }; |
| 259 | |
| 260 | static struct platform_device vr1000_led1 = { |
| 261 | .name = "s3c24xx_led", |
| 262 | .id = 1, |
| 263 | .dev = { |
| 264 | .platform_data = &vr1000_led1_pdata, |
| 265 | }, |
| 266 | }; |
| 267 | |
| 268 | static struct platform_device vr1000_led2 = { |
| 269 | .name = "s3c24xx_led", |
| 270 | .id = 2, |
| 271 | .dev = { |
| 272 | .platform_data = &vr1000_led2_pdata, |
| 273 | }, |
| 274 | }; |
| 275 | |
| 276 | static struct platform_device vr1000_led3 = { |
| 277 | .name = "s3c24xx_led", |
Ben Dooks | abac08d7 | 2006-12-19 19:10:13 +0100 | [diff] [blame] | 278 | .id = 3, |
Ben Dooks | b2eba6b | 2006-12-07 20:28:23 +0100 | [diff] [blame] | 279 | .dev = { |
| 280 | .platform_data = &vr1000_led3_pdata, |
| 281 | }, |
| 282 | }; |
| 283 | |
Ben Dooks | 60d6698 | 2008-07-03 11:24:42 +0100 | [diff] [blame] | 284 | /* I2C devices. */ |
| 285 | |
| 286 | static struct i2c_board_info vr1000_i2c_devs[] __initdata = { |
| 287 | { |
| 288 | I2C_BOARD_INFO("tlv320aic23", 0x1a), |
| 289 | }, { |
Ben Dooks | 9c3871c | 2008-07-03 11:24:44 +0100 | [diff] [blame] | 290 | I2C_BOARD_INFO("tmp101", 0x48), |
| 291 | }, { |
Ben Dooks | 60d6698 | 2008-07-03 11:24:42 +0100 | [diff] [blame] | 292 | I2C_BOARD_INFO("m41st87", 0x68), |
| 293 | }, |
| 294 | }; |
| 295 | |
Ben Dooks | d97a666 | 2005-06-23 21:56:47 +0100 | [diff] [blame] | 296 | /* devices for this board */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 297 | |
| 298 | static struct platform_device *vr1000_devices[] __initdata = { |
Heiko Stuebner | 51cb128 | 2014-05-09 05:48:57 +0900 | [diff] [blame] | 299 | &s3c2410_device_dclk, |
Ben Dooks | b813248 | 2009-11-23 00:13:39 +0000 | [diff] [blame] | 300 | &s3c_device_ohci, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | &s3c_device_lcd, |
| 302 | &s3c_device_wdt, |
Ben Dooks | 3e1b776 | 2008-10-31 16:14:40 +0000 | [diff] [blame] | 303 | &s3c_device_i2c0, |
Ben Dooks | d97a666 | 2005-06-23 21:56:47 +0100 | [diff] [blame] | 304 | &s3c_device_adc, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | &serial_device, |
Ben Dooks | d97a666 | 2005-06-23 21:56:47 +0100 | [diff] [blame] | 306 | &vr1000_dm9k0, |
Ben Dooks | b2eba6b | 2006-12-07 20:28:23 +0100 | [diff] [blame] | 307 | &vr1000_dm9k1, |
| 308 | &vr1000_led1, |
| 309 | &vr1000_led2, |
| 310 | &vr1000_led3, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 | }; |
| 312 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 | static void vr1000_power_off(void) |
| 314 | { |
Ben Dooks | 7614e1d | 2010-05-04 12:53:11 +0900 | [diff] [blame] | 315 | gpio_direction_output(S3C2410_GPB(9), 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | } |
| 317 | |
Ben Dooks | 5fe10ab | 2005-09-20 17:24:33 +0100 | [diff] [blame] | 318 | static void __init vr1000_map_io(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 320 | pm_power_off = vr1000_power_off; |
| 321 | |
| 322 | s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 323 | s3c24xx_init_uarts(vr1000_uartcfgs, ARRAY_SIZE(vr1000_uartcfgs)); |
Krzysztof Kozlowski | a1342f6 | 2020-08-20 22:42:03 +0200 | [diff] [blame] | 324 | s3c24xx_set_timer_source(S3C24XX_PWM3, S3C24XX_PWM4); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 325 | } |
| 326 | |
Heiko Stuebner | 07ee5e7 | 2014-05-09 05:49:29 +0900 | [diff] [blame] | 327 | static void __init vr1000_init_time(void) |
| 328 | { |
| 329 | s3c2410_init_clocks(12000000); |
Krzysztof Kozlowski | a1342f6 | 2020-08-20 22:42:03 +0200 | [diff] [blame] | 330 | s3c24xx_timer_init(); |
Heiko Stuebner | 07ee5e7 | 2014-05-09 05:49:29 +0900 | [diff] [blame] | 331 | } |
| 332 | |
Ben Dooks | 57e5171 | 2007-04-20 11:19:16 +0100 | [diff] [blame] | 333 | static void __init vr1000_init(void) |
| 334 | { |
Ben Dooks | 3e1b776 | 2008-10-31 16:14:40 +0000 | [diff] [blame] | 335 | s3c_i2c0_set_platdata(NULL); |
Linus Walleij | f7f611f | 2020-07-08 09:11:49 +0200 | [diff] [blame] | 336 | |
| 337 | /* Disable pull-up on LED lines and register GPIO lookups */ |
| 338 | s3c_gpio_setpull(S3C2410_GPB(0), S3C_GPIO_PULL_NONE); |
| 339 | s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_NONE); |
| 340 | s3c_gpio_setpull(S3C2410_GPB(2), S3C_GPIO_PULL_NONE); |
| 341 | gpiod_add_lookup_table(&vr1000_led1_gpio_table); |
| 342 | gpiod_add_lookup_table(&vr1000_led2_gpio_table); |
| 343 | gpiod_add_lookup_table(&vr1000_led3_gpio_table); |
| 344 | |
Ben Dooks | 57e5171 | 2007-04-20 11:19:16 +0100 | [diff] [blame] | 345 | platform_add_devices(vr1000_devices, ARRAY_SIZE(vr1000_devices)); |
Ben Dooks | 9d529c6 | 2008-07-03 11:24:39 +0100 | [diff] [blame] | 346 | |
Ben Dooks | 60d6698 | 2008-07-03 11:24:42 +0100 | [diff] [blame] | 347 | i2c_register_board_info(0, vr1000_i2c_devs, |
| 348 | ARRAY_SIZE(vr1000_i2c_devs)); |
| 349 | |
Ben Dooks | 9d529c6 | 2008-07-03 11:24:39 +0100 | [diff] [blame] | 350 | nor_simtec_init(); |
Ben Dooks | 4d3a346 | 2009-11-13 22:34:20 +0000 | [diff] [blame] | 351 | simtec_audio_add(NULL, true, NULL); |
Ben Dooks | 7614e1d | 2010-05-04 12:53:11 +0900 | [diff] [blame] | 352 | |
| 353 | WARN_ON(gpio_request(S3C2410_GPB(9), "power off")); |
Ben Dooks | 57e5171 | 2007-04-20 11:19:16 +0100 | [diff] [blame] | 354 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 355 | |
| 356 | MACHINE_START(VR1000, "Thorcom-VR1000") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 357 | /* Maintainer: Ben Dooks <ben@simtec.co.uk> */ |
Nicolas Pitre | 69d5071 | 2011-07-05 22:38:17 -0400 | [diff] [blame] | 358 | .atag_offset = 0x100, |
Arnd Bergmann | c78a41f | 2022-04-02 15:28:18 +0200 | [diff] [blame] | 359 | .nr_irqs = NR_IRQS_S3C2410, |
Ben Dooks | 6904b24 | 2005-06-29 11:09:15 +0100 | [diff] [blame] | 360 | .map_io = vr1000_map_io, |
Ben Dooks | 57e5171 | 2007-04-20 11:19:16 +0100 | [diff] [blame] | 361 | .init_machine = vr1000_init, |
Heiko Stuebner | f182aa1 | 2013-03-07 12:38:19 +0900 | [diff] [blame] | 362 | .init_irq = s3c2410_init_irq, |
Heiko Stuebner | 07ee5e7 | 2014-05-09 05:49:29 +0900 | [diff] [blame] | 363 | .init_time = vr1000_init_time, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 364 | MACHINE_END |