blob: bec488e5d23c39705a259482caa13737ad951984 [file] [log] [blame]
Joonyoung Shim2e57da42010-05-19 23:15:32 +09001/* linux/arch/arm/mach-s5pv210/mach-goni.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
Marek Szyprowski3965fde2010-07-14 19:38:18 +090015#include <linux/fb.h>
Joonyoung Shim2e57da42010-05-19 23:15:32 +090016
17#include <asm/mach/arch.h>
18#include <asm/mach/map.h>
19#include <asm/setup.h>
20#include <asm/mach-types.h>
21
22#include <mach/map.h>
23#include <mach/regs-clock.h>
Marek Szyprowski3965fde2010-07-14 19:38:18 +090024#include <mach/regs-fb.h>
Joonyoung Shim2e57da42010-05-19 23:15:32 +090025
26#include <plat/regs-serial.h>
27#include <plat/s5pv210.h>
28#include <plat/devs.h>
29#include <plat/cpu.h>
Marek Szyprowski3965fde2010-07-14 19:38:18 +090030#include <plat/fb.h>
Joonyoung Shim2e57da42010-05-19 23:15:32 +090031
32/* Following are default values for UCON, ULCON and UFCON UART registers */
33#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
34 S3C2410_UCON_RXILEVEL | \
35 S3C2410_UCON_TXIRQMODE | \
36 S3C2410_UCON_RXIRQMODE | \
37 S3C2410_UCON_RXFIFO_TOI | \
38 S3C2443_UCON_RXERR_IRQEN)
39
40#define S5PV210_ULCON_DEFAULT S3C2410_LCON_CS8
41
Joonyoung Shimbbf7b352010-06-24 19:28:55 +090042#define S5PV210_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE
Joonyoung Shim2e57da42010-05-19 23:15:32 +090043
44static struct s3c2410_uartcfg goni_uartcfgs[] __initdata = {
45 [0] = {
46 .hwport = 0,
47 .flags = 0,
48 .ucon = S5PV210_UCON_DEFAULT,
49 .ulcon = S5PV210_ULCON_DEFAULT,
Joonyoung Shimbbf7b352010-06-24 19:28:55 +090050 .ufcon = S5PV210_UFCON_DEFAULT |
51 S5PV210_UFCON_TXTRIG256 | S5PV210_UFCON_RXTRIG256,
Joonyoung Shim2e57da42010-05-19 23:15:32 +090052 },
53 [1] = {
54 .hwport = 1,
55 .flags = 0,
56 .ucon = S5PV210_UCON_DEFAULT,
57 .ulcon = S5PV210_ULCON_DEFAULT,
Joonyoung Shimbbf7b352010-06-24 19:28:55 +090058 .ufcon = S5PV210_UFCON_DEFAULT |
59 S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64,
Joonyoung Shim2e57da42010-05-19 23:15:32 +090060 },
61 [2] = {
62 .hwport = 2,
63 .flags = 0,
64 .ucon = S5PV210_UCON_DEFAULT,
65 .ulcon = S5PV210_ULCON_DEFAULT,
Joonyoung Shimbbf7b352010-06-24 19:28:55 +090066 .ufcon = S5PV210_UFCON_DEFAULT |
67 S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
Joonyoung Shim2e57da42010-05-19 23:15:32 +090068 },
69 [3] = {
70 .hwport = 3,
71 .flags = 0,
72 .ucon = S5PV210_UCON_DEFAULT,
73 .ulcon = S5PV210_ULCON_DEFAULT,
Joonyoung Shimbbf7b352010-06-24 19:28:55 +090074 .ufcon = S5PV210_UFCON_DEFAULT |
75 S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
Joonyoung Shim2e57da42010-05-19 23:15:32 +090076 },
77};
78
Marek Szyprowski3965fde2010-07-14 19:38:18 +090079/* Frame Buffer */
80static struct s3c_fb_pd_win goni_fb_win0 = {
81 .win_mode = {
82 .pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*55),
83 .left_margin = 16,
84 .right_margin = 16,
85 .upper_margin = 3,
86 .lower_margin = 28,
87 .hsync_len = 2,
88 .vsync_len = 2,
89 .xres = 480,
90 .yres = 800,
91 .refresh = 55,
92 },
93 .max_bpp = 32,
94 .default_bpp = 16,
95};
96
97static struct s3c_fb_platdata goni_lcd_pdata __initdata = {
98 .win[0] = &goni_fb_win0,
99 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
100 VIDCON0_CLKSEL_LCD,
101 .vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN
102 | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
103 .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
104};
105
Joonyoung Shim2e57da42010-05-19 23:15:32 +0900106static struct platform_device *goni_devices[] __initdata = {
Marek Szyprowski3965fde2010-07-14 19:38:18 +0900107 &s3c_device_fb,
Joonyoung Shim4cefa362010-06-30 20:36:01 +0900108 &s5pc110_device_onenand,
Joonyoung Shim2e57da42010-05-19 23:15:32 +0900109};
110
111static void __init goni_map_io(void)
112{
113 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
114 s3c24xx_init_clocks(24000000);
115 s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs));
116}
117
118static void __init goni_machine_init(void)
119{
Marek Szyprowski3965fde2010-07-14 19:38:18 +0900120 /* FB */
121 s3c_fb_set_platdata(&goni_lcd_pdata);
122
Joonyoung Shim2e57da42010-05-19 23:15:32 +0900123 platform_add_devices(goni_devices, ARRAY_SIZE(goni_devices));
124}
125
126MACHINE_START(GONI, "GONI")
127 /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */
128 .phys_io = S3C_PA_UART & 0xfff00000,
129 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
130 .boot_params = S5P_PA_SDRAM + 0x100,
131 .init_irq = s5pv210_init_irq,
132 .map_io = goni_map_io,
133 .init_machine = goni_machine_init,
134 .timer = &s3c24xx_timer,
135MACHINE_END