blob: 722ef46b630ac12bbb40eb495baef8dfae10b208 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* linux/arch/arm/mach-s3c2410/mach-smdk2440.c
2 *
3 * Copyright (c) 2004,2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://www.fluff.org/ben/smdk2440/
7 *
8 * Thanks to Dimity Andric and TomTom for the loan of an SMDK2440.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * Modifications:
15 * 01-Nov-2004 BJD Initial version
16 * 12-Nov-2004 BJD Updated for release
17 * 04-Jan-2005 BJD Fixes for pre-release
18 * 22-Feb-2005 BJD Updated for 2.6.11-rc5 relesa
19 * 10-Mar-2005 LCVR Replaced S3C2410_VA by S3C24XX_VA
20 * 14-Mar-2005 BJD void __iomem fixes
Ben Dooks5fe10ab2005-09-20 17:24:33 +010021 * 20-Sep-2005 BJD Added static to non-exported items
Linus Torvalds1da177e2005-04-16 15:20:36 -070022*/
23
24#include <linux/kernel.h>
25#include <linux/types.h>
26#include <linux/interrupt.h>
27#include <linux/list.h>
28#include <linux/timer.h>
29#include <linux/init.h>
30
31#include <asm/mach/arch.h>
32#include <asm/mach/map.h>
33#include <asm/mach/irq.h>
34
35#include <asm/hardware.h>
36#include <asm/hardware/iomd.h>
37#include <asm/io.h>
38#include <asm/irq.h>
39#include <asm/mach-types.h>
40
41//#include <asm/debug-ll.h>
42#include <asm/arch/regs-serial.h>
43#include <asm/arch/regs-gpio.h>
44#include <asm/arch/idle.h>
45
46#include "s3c2410.h"
47#include "s3c2440.h"
48#include "clock.h"
49#include "devs.h"
50#include "cpu.h"
51#include "pm.h"
52
53static struct map_desc smdk2440_iodesc[] __initdata = {
54 /* ISA IO Space map (memory space selected by A24) */
55
56 { (u32)S3C24XX_VA_ISA_WORD, S3C2410_CS2, SZ_16M, MT_DEVICE },
57 { (u32)S3C24XX_VA_ISA_BYTE, S3C2410_CS2, SZ_16M, MT_DEVICE },
58};
59
60#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
61#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
62#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
63
64static struct s3c2410_uartcfg smdk2440_uartcfgs[] = {
65 [0] = {
66 .hwport = 0,
67 .flags = 0,
68 .ucon = 0x3c5,
69 .ulcon = 0x03,
70 .ufcon = 0x51,
71 },
72 [1] = {
73 .hwport = 1,
74 .flags = 0,
75 .ucon = 0x3c5,
76 .ulcon = 0x03,
77 .ufcon = 0x51,
78 },
79 /* IR port */
80 [2] = {
81 .hwport = 2,
82 .flags = 0,
83 .ucon = 0x3c5,
84 .ulcon = 0x43,
85 .ufcon = 0x51,
86 }
87};
88
89static struct platform_device *smdk2440_devices[] __initdata = {
90 &s3c_device_usb,
91 &s3c_device_lcd,
92 &s3c_device_wdt,
93 &s3c_device_i2c,
94 &s3c_device_iis,
95};
96
97static struct s3c24xx_board smdk2440_board __initdata = {
98 .devices = smdk2440_devices,
99 .devices_count = ARRAY_SIZE(smdk2440_devices)
100};
101
Ben Dooks5fe10ab2005-09-20 17:24:33 +0100102static void __init smdk2440_map_io(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103{
104 s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
105 s3c24xx_init_clocks(16934400);
106 s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
107 s3c24xx_set_board(&smdk2440_board);
108}
109
Ben Dooks5fe10ab2005-09-20 17:24:33 +0100110static void __init smdk2440_machine_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111{
112 /* Configure the LEDs (even if we have no LED support)*/
113
114 s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP);
115 s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
116 s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP);
117 s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP);
118
119 s3c2410_gpio_setpin(S3C2410_GPF4, 0);
120 s3c2410_gpio_setpin(S3C2410_GPF5, 0);
121 s3c2410_gpio_setpin(S3C2410_GPF6, 0);
122 s3c2410_gpio_setpin(S3C2410_GPF7, 0);
123
124 s3c2410_pm_init();
125}
126
127MACHINE_START(S3C2440, "SMDK2440")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100128 /* Maintainer: Ben Dooks <ben@fluff.org> */
129 .phys_ram = S3C2410_SDRAM_PA,
130 .phys_io = S3C2410_PA_UART,
131 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
132 .boot_params = S3C2410_SDRAM_PA + 0x100,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133
134 .init_irq = s3c24xx_init_irq,
135 .map_io = smdk2440_map_io,
136 .init_machine = smdk2440_machine_init,
137 .timer = &s3c24xx_timer,
138MACHINE_END