Linux Audio

Check our new training course

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