Blame view

arch/arm/mach-s3c2412/mach-vstms.c 3.45 KB
a21765a70   Ben Dooks   [ARM] 4157/2: S3C...
1
  /* linux/arch/arm/mach-s3c2412/mach-vstms.c
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
   *
   * (C) 2006 Thomas Gleixner <tglx@linutronix.de>
   *
   * Derived from mach-smdk2413.c - (C) 2006 Simtec Electronics
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
  
  #include <linux/kernel.h>
  #include <linux/types.h>
  #include <linux/interrupt.h>
  #include <linux/list.h>
  #include <linux/timer.h>
  #include <linux/init.h>
b6d1f542e   Ben Dooks   [ARM] 4049/1: S3C...
18
  #include <linux/serial_core.h>
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
19
  #include <linux/platform_device.h>
fced80c73   Russell King   [ARM] Convert asm...
20
  #include <linux/io.h>
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
21
22
23
24
25
26
27
28
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/nand.h>
  #include <linux/mtd/nand_ecc.h>
  #include <linux/mtd/partitions.h>
  
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  #include <asm/mach/irq.h>
a09e64fbc   Russell King   [ARM] Move includ...
29
  #include <mach/hardware.h>
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
30
  #include <asm/setup.h>
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
31
32
  #include <asm/irq.h>
  #include <asm/mach-types.h>
a2b7ba9ca   Ben Dooks   [ARM] S3C24XX: Mo...
33
  #include <plat/regs-serial.h>
a09e64fbc   Russell King   [ARM] Move includ...
34
35
  #include <mach/regs-gpio.h>
  #include <mach/regs-lcd.h>
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
36

a09e64fbc   Russell King   [ARM] Move includ...
37
38
  #include <mach/idle.h>
  #include <mach/fb.h>
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
39

3e1b776c2   Ben Dooks   [ARM] S3C: Make i...
40
  #include <plat/iic.h>
7926b5a32   Ben Dooks   [ARM] S3C: Move n...
41
  #include <plat/nand.h>
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
42

a2b7ba9ca   Ben Dooks   [ARM] S3C24XX: Mo...
43
  #include <plat/s3c2410.h>
d5120ae72   Ben Dooks   [ARM] S3C24XX: Ad...
44
45
  #include <plat/s3c2412.h>
  #include <plat/clock.h>
a2b7ba9ca   Ben Dooks   [ARM] S3C24XX: Mo...
46
47
  #include <plat/devs.h>
  #include <plat/cpu.h>
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  
  
  static struct map_desc vstms_iodesc[] __initdata = {
  };
  
  static struct s3c2410_uartcfg vstms_uartcfgs[] __initdata = {
  	[0] = {
  		.hwport	     = 0,
  		.flags	     = 0,
  		.ucon	     = 0x3c5,
  		.ulcon	     = 0x03,
  		.ufcon	     = 0x51,
  	},
  	[1] = {
  		.hwport	     = 1,
  		.flags	     = 0,
  		.ucon	     = 0x3c5,
  		.ulcon	     = 0x03,
  		.ufcon	     = 0x51,
  	},
  	[2] = {
  		.hwport	     = 2,
  		.flags	     = 0,
  		.ucon	     = 0x3c5,
  		.ulcon	     = 0x03,
  		.ufcon	     = 0x51,
  	}
  };
2a3a18045   Ben Dooks   ARM: S3C: Add NAN...
76
  static struct mtd_partition __initdata vstms_nand_part[] = {
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
  	[0] = {
  		.name	= "Boot Agent",
  		.size	= 0x7C000,
  		.offset	= 0,
  	},
  	[1] = {
  		.name	= "UBoot Config",
  		.offset = 0x7C000,
  		.size	= 0x4000,
  	},
  	[2] = {
  		.name	= "Kernel",
  		.offset = 0x80000,
  		.size	= 0x200000,
  	},
  	[3] = {
  		.name	= "RFS",
  		.offset	= 0x280000,
  		.size	= 0x3d80000,
  	},
  };
2a3a18045   Ben Dooks   ARM: S3C: Add NAN...
98
  static struct s3c2410_nand_set __initdata vstms_nand_sets[] = {
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
99
100
101
102
103
104
105
106
107
108
109
  	[0] = {
  		.name		= "NAND",
  		.nr_chips	= 1,
  		.nr_partitions	= ARRAY_SIZE(vstms_nand_part),
  		.partitions	= vstms_nand_part,
  	},
  };
  
  /* choose a set of timings which should suit most 512Mbit
   * chips and beyond.
  */
2a3a18045   Ben Dooks   ARM: S3C: Add NAN...
110
  static struct s3c2410_platform_nand __initdata vstms_nand_info = {
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
111
112
113
114
115
116
117
118
  	.tacls		= 20,
  	.twrph0		= 60,
  	.twrph1		= 20,
  	.nr_sets	= ARRAY_SIZE(vstms_nand_sets),
  	.sets		= vstms_nand_sets,
  };
  
  static struct platform_device *vstms_devices[] __initdata = {
b813248c6   Ben Dooks   ARM: S3C: Rename ...
119
  	&s3c_device_ohci,
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
120
  	&s3c_device_wdt,
3e1b776c2   Ben Dooks   [ARM] S3C: Make i...
121
  	&s3c_device_i2c0,
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
122
123
124
125
  	&s3c_device_iis,
  	&s3c_device_rtc,
  	&s3c_device_nand,
  };
0744a3ee3   Russell King   ARM: platform fix...
126
127
  static void __init vstms_fixup(struct tag *tags, char **cmdline,
  			       struct meminfo *mi)
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
128
129
130
131
132
  {
  	if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
  		mi->nr_banks=1;
  		mi->bank[0].start = 0x30000000;
  		mi->bank[0].size = SZ_64M;
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
133
134
135
136
137
  	}
  }
  
  static void __init vstms_map_io(void)
  {
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
138
139
140
  	s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
  	s3c24xx_init_clocks(12000000);
  	s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
57e5171c9   Ben Dooks   [ARM] 4325/1: S3C...
141
142
143
144
  }
  
  static void __init vstms_init(void)
  {
3e1b776c2   Ben Dooks   [ARM] S3C: Make i...
145
  	s3c_i2c0_set_platdata(NULL);
2a3a18045   Ben Dooks   ARM: S3C: Add NAN...
146
  	s3c_nand_set_platdata(&vstms_nand_info);
57e5171c9   Ben Dooks   [ARM] 4325/1: S3C...
147
  	platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices));
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
148
149
150
  }
  
  MACHINE_START(VSTMS, "VSTMS")
69d50710c   Nicolas Pitre   ARM: mach-s3c24*:...
151
  	.atag_offset	= 0x100,
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
152
153
154
  
  	.fixup		= vstms_fixup,
  	.init_irq	= s3c24xx_init_irq,
57e5171c9   Ben Dooks   [ARM] 4325/1: S3C...
155
  	.init_machine	= vstms_init,
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
156
157
  	.map_io		= vstms_map_io,
  	.timer		= &s3c24xx_timer,
575389759   Heiko Stuebner   ARM: 7254/1: rest...
158
  	.restart	= s3c2412_restart,
b6c440a98   Ben Dooks   [ARM] 3840/1: S3C...
159
  MACHINE_END