diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-05-20 05:55:32 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-20 05:55:32 -0400 |
commit | ea5a4e209ddca984bbb5803b30d5e013e631f9ac (patch) | |
tree | a7f2cdb121fc44cfd7c382207104f867f93736c9 /arch/arm | |
parent | fac3d3555568de1755025a9609daf492dd548a59 (diff) | |
parent | eff4c74da7944ba30feb47b51d1e9e940e6682ff (diff) |
ARM: Merge for-2635-4/s5pv210-boards
Merge branch 'for-2635-4/s5pv210-boards' into for-2635-4/partial1
Conflicts:
arch/arm/mach-s5pv210/include/mach/map.h
Diffstat (limited to 'arch/arm')
22 files changed, 773 insertions, 8 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 5649733bf815..88f81ce2f888 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig | |||
@@ -17,10 +17,50 @@ config CPU_S5PV210 | |||
17 | help | 17 | help |
18 | Enable S5PV210 CPU support | 18 | Enable S5PV210 CPU support |
19 | 19 | ||
20 | choice | 20 | config S5PV210_SETUP_I2C1 |
21 | prompt "Select machine type" | 21 | bool |
22 | depends on ARCH_S5PV210 | 22 | help |
23 | default MACH_SMDKV210 | 23 | Common setup code for i2c bus 1. |
24 | |||
25 | config S5PV210_SETUP_I2C2 | ||
26 | bool | ||
27 | help | ||
28 | Common setup code for i2c bus 2. | ||
29 | |||
30 | config S5PV210_SETUP_FB_24BPP | ||
31 | bool | ||
32 | help | ||
33 | Common setup code for S5PV210 with an 24bpp RGB display helper. | ||
34 | |||
35 | config S5PV210_SETUP_SDHCI | ||
36 | bool | ||
37 | select S5PV210_SETUP_SDHCI_GPIO | ||
38 | help | ||
39 | Internal helper functions for S5PV210 based SDHCI systems | ||
40 | |||
41 | config S5PV210_SETUP_SDHCI_GPIO | ||
42 | bool | ||
43 | help | ||
44 | Common setup code for SDHCI gpio. | ||
45 | |||
46 | # machine support | ||
47 | |||
48 | config MACH_AQUILA | ||
49 | bool "Samsung Aquila" | ||
50 | select CPU_S5PV210 | ||
51 | select ARCH_SPARSEMEM_ENABLE | ||
52 | select S5PV210_SETUP_FB_24BPP | ||
53 | select S3C_DEV_FB | ||
54 | help | ||
55 | Machine support for the Samsung Aquila target based on S5PC110 SoC | ||
56 | |||
57 | config MACH_GONI | ||
58 | bool "GONI" | ||
59 | select CPU_S5PV210 | ||
60 | select ARCH_SPARSEMEM_ENABLE | ||
61 | help | ||
62 | Machine support for Samsung GONI board | ||
63 | S5PC110(MCP) is one of package option of S5PV210 | ||
24 | 64 | ||
25 | config MACH_SMDKV210 | 65 | config MACH_SMDKV210 |
26 | bool "SMDKV210" | 66 | bool "SMDKV210" |
@@ -39,6 +79,4 @@ config MACH_SMDKC110 | |||
39 | Machine support for Samsung SMDKC110 | 79 | Machine support for Samsung SMDKC110 |
40 | S5PC110(MCP) is one of package option of S5PV210 | 80 | S5PC110(MCP) is one of package option of S5PV210 |
41 | 81 | ||
42 | endchoice | ||
43 | |||
44 | endif | 82 | endif |
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index 99827813d293..6c0cba8dfafa 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile | |||
@@ -17,9 +17,16 @@ obj-$(CONFIG_CPU_S5PV210) += setup-i2c0.o | |||
17 | 17 | ||
18 | # machine support | 18 | # machine support |
19 | 19 | ||
20 | obj-$(CONFIG_MACH_AQUILA) += mach-aquila.o | ||
20 | obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o | 21 | obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o |
21 | obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o | 22 | obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o |
23 | obj-$(CONFIG_MACH_GONI) += mach-goni.o | ||
22 | 24 | ||
23 | # device support | 25 | # device support |
24 | 26 | ||
25 | obj-y += dev-audio.o | 27 | obj-y += dev-audio.o |
28 | obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o | ||
29 | obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o | ||
30 | obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o | ||
31 | obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o | ||
32 | obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o | ||
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c index 359bdc8f3b66..76084d85fd21 100644 --- a/arch/arm/mach-s5pv210/cpu.c +++ b/arch/arm/mach-s5pv210/cpu.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <plat/devs.h> | 32 | #include <plat/devs.h> |
33 | #include <plat/clock.h> | 33 | #include <plat/clock.h> |
34 | #include <plat/s5pv210.h> | 34 | #include <plat/s5pv210.h> |
35 | #include <plat/iic-core.h> | ||
36 | #include <plat/sdhci.h> | ||
35 | 37 | ||
36 | /* Initial IO mappings */ | 38 | /* Initial IO mappings */ |
37 | 39 | ||
@@ -77,6 +79,16 @@ void __init s5pv210_map_io(void) | |||
77 | s3c_device_adc.name = "s3c64xx-adc"; | 79 | s3c_device_adc.name = "s3c64xx-adc"; |
78 | 80 | ||
79 | iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc)); | 81 | iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc)); |
82 | |||
83 | /* initialise device information early */ | ||
84 | s5pv210_default_sdhci0(); | ||
85 | s5pv210_default_sdhci1(); | ||
86 | s5pv210_default_sdhci2(); | ||
87 | |||
88 | /* the i2c devices are directly compatible with s3c2440 */ | ||
89 | s3c_i2c0_setname("s3c2440-i2c"); | ||
90 | s3c_i2c1_setname("s3c2440-i2c"); | ||
91 | s3c_i2c2_setname("s3c2440-i2c"); | ||
80 | } | 92 | } |
81 | 93 | ||
82 | void __init s5pv210_init_clocks(int xtal) | 94 | void __init s5pv210_init_clocks(int xtal) |
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h index 3a9e42e7734b..92fc6c7fc064 100644 --- a/arch/arm/mach-s5pv210/include/mach/irqs.h +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h | |||
@@ -134,4 +134,9 @@ | |||
134 | #define EINT_GPIO_2(x) S5PV210_GPH2(x) | 134 | #define EINT_GPIO_2(x) S5PV210_GPH2(x) |
135 | #define EINT_GPIO_3(x) S5PV210_GPH3(x) | 135 | #define EINT_GPIO_3(x) S5PV210_GPH3(x) |
136 | 136 | ||
137 | /* Compatibility */ | ||
138 | #define IRQ_LCD_FIFO IRQ_LCD0 | ||
139 | #define IRQ_LCD_VSYNC IRQ_LCD1 | ||
140 | #define IRQ_LCD_SYSTEM IRQ_LCD2 | ||
141 | |||
137 | #endif /* ASM_ARCH_IRQS_H */ | 142 | #endif /* ASM_ARCH_IRQS_H */ |
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h index e85957083055..fb5d05e91e44 100644 --- a/arch/arm/mach-s5pv210/include/mach/map.h +++ b/arch/arm/mach-s5pv210/include/mach/map.h | |||
@@ -26,6 +26,8 @@ | |||
26 | #define S5P_PA_GPIO S5PV210_PA_GPIO | 26 | #define S5P_PA_GPIO S5PV210_PA_GPIO |
27 | 27 | ||
28 | #define S5PV210_PA_IIC0 (0xE1800000) | 28 | #define S5PV210_PA_IIC0 (0xE1800000) |
29 | #define S5PV210_PA_IIC1 (0xFAB00000) | ||
30 | #define S5PV210_PA_IIC2 (0xE1A00000) | ||
29 | 31 | ||
30 | #define S5PV210_PA_TIMER (0xE2500000) | 32 | #define S5PV210_PA_TIMER (0xE2500000) |
31 | #define S5P_PA_TIMER S5PV210_PA_TIMER | 33 | #define S5P_PA_TIMER S5PV210_PA_TIMER |
@@ -47,6 +49,10 @@ | |||
47 | #define S5PV210_PA_PDMA0 0xE0900000 | 49 | #define S5PV210_PA_PDMA0 0xE0900000 |
48 | #define S5PV210_PA_PDMA1 0xE0A00000 | 50 | #define S5PV210_PA_PDMA1 0xE0A00000 |
49 | 51 | ||
52 | #define S5PV210_PA_FB (0xF8000000) | ||
53 | |||
54 | #define S5PV210_PA_HSMMC(x) (0xEB000000 + ((x) * 0x100000)) | ||
55 | |||
50 | #define S5PV210_PA_VIC0 (0xF2000000) | 56 | #define S5PV210_PA_VIC0 (0xF2000000) |
51 | #define S5P_PA_VIC0 S5PV210_PA_VIC0 | 57 | #define S5P_PA_VIC0 S5PV210_PA_VIC0 |
52 | 58 | ||
@@ -79,7 +85,14 @@ | |||
79 | 85 | ||
80 | /* compatibiltiy defines. */ | 86 | /* compatibiltiy defines. */ |
81 | #define S3C_PA_UART S5PV210_PA_UART | 87 | #define S3C_PA_UART S5PV210_PA_UART |
88 | #define S3C_PA_HSMMC0 S5PV210_PA_HSMMC(0) | ||
89 | #define S3C_PA_HSMMC1 S5PV210_PA_HSMMC(1) | ||
90 | #define S3C_PA_HSMMC2 S5PV210_PA_HSMMC(2) | ||
82 | #define S3C_PA_IIC S5PV210_PA_IIC0 | 91 | #define S3C_PA_IIC S5PV210_PA_IIC0 |
92 | #define S3C_PA_IIC1 S5PV210_PA_IIC1 | ||
93 | #define S3C_PA_IIC2 S5PV210_PA_IIC2 | ||
94 | #define S3C_PA_FB S5PV210_PA_FB | ||
95 | |||
83 | #define SAMSUNG_PA_ADC S5PV210_PA_ADC | 96 | #define SAMSUNG_PA_ADC S5PV210_PA_ADC |
84 | 97 | ||
85 | #endif /* __ASM_ARCH_MAP_H */ | 98 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h b/arch/arm/mach-s5pv210/include/mach/regs-clock.h index e56e0e4673ed..2a25ab40c863 100644 --- a/arch/arm/mach-s5pv210/include/mach/regs-clock.h +++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h | |||
@@ -126,6 +126,7 @@ | |||
126 | 126 | ||
127 | #define S5P_RST_STAT S5P_CLKREG(0xA000) | 127 | #define S5P_RST_STAT S5P_CLKREG(0xA000) |
128 | #define S5P_OSC_CON S5P_CLKREG(0x8000) | 128 | #define S5P_OSC_CON S5P_CLKREG(0x8000) |
129 | #define S5P_MDNIE_SEL S5P_CLKREG(0x7008) | ||
129 | #define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200) | 130 | #define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200) |
130 | #define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204) | 131 | #define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204) |
131 | #define S5P_MIPI_CONTROL S5P_CLKREG(0xE814) | 132 | #define S5P_MIPI_CONTROL S5P_CLKREG(0xE814) |
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c new file mode 100644 index 000000000000..10bc76ec4025 --- /dev/null +++ b/arch/arm/mach-s5pv210/mach-aquila.c | |||
@@ -0,0 +1,149 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/mach-aquila.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> | ||
15 | #include <linux/fb.h> | ||
16 | |||
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> | ||
24 | #include <mach/regs-fb.h> | ||
25 | |||
26 | #include <plat/regs-serial.h> | ||
27 | #include <plat/s5pv210.h> | ||
28 | #include <plat/devs.h> | ||
29 | #include <plat/cpu.h> | ||
30 | #include <plat/fb.h> | ||
31 | |||
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 | |||
42 | #define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ | ||
43 | S5PV210_UFCON_TXTRIG4 | \ | ||
44 | S5PV210_UFCON_RXTRIG4) | ||
45 | |||
46 | static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = { | ||
47 | [0] = { | ||
48 | .hwport = 0, | ||
49 | .flags = 0, | ||
50 | .ucon = S5PV210_UCON_DEFAULT, | ||
51 | .ulcon = S5PV210_ULCON_DEFAULT, | ||
52 | .ufcon = S5PV210_UFCON_DEFAULT, | ||
53 | }, | ||
54 | [1] = { | ||
55 | .hwport = 1, | ||
56 | .flags = 0, | ||
57 | .ucon = S5PV210_UCON_DEFAULT, | ||
58 | .ulcon = S5PV210_ULCON_DEFAULT, | ||
59 | .ufcon = S5PV210_UFCON_DEFAULT, | ||
60 | }, | ||
61 | [2] = { | ||
62 | .hwport = 2, | ||
63 | .flags = 0, | ||
64 | .ucon = S5PV210_UCON_DEFAULT, | ||
65 | .ulcon = S5PV210_ULCON_DEFAULT, | ||
66 | .ufcon = S5PV210_UFCON_DEFAULT, | ||
67 | }, | ||
68 | [3] = { | ||
69 | .hwport = 3, | ||
70 | .flags = 0, | ||
71 | .ucon = S5PV210_UCON_DEFAULT, | ||
72 | .ulcon = S5PV210_ULCON_DEFAULT, | ||
73 | .ufcon = S5PV210_UFCON_DEFAULT, | ||
74 | }, | ||
75 | }; | ||
76 | |||
77 | /* Frame Buffer */ | ||
78 | static struct s3c_fb_pd_win aquila_fb_win0 = { | ||
79 | .win_mode = { | ||
80 | .pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*60), | ||
81 | .left_margin = 16, | ||
82 | .right_margin = 16, | ||
83 | .upper_margin = 3, | ||
84 | .lower_margin = 28, | ||
85 | .hsync_len = 2, | ||
86 | .vsync_len = 2, | ||
87 | .xres = 480, | ||
88 | .yres = 800, | ||
89 | }, | ||
90 | .max_bpp = 32, | ||
91 | .default_bpp = 16, | ||
92 | }; | ||
93 | |||
94 | static struct s3c_fb_pd_win aquila_fb_win1 = { | ||
95 | .win_mode = { | ||
96 | .pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*60), | ||
97 | .left_margin = 16, | ||
98 | .right_margin = 16, | ||
99 | .upper_margin = 3, | ||
100 | .lower_margin = 28, | ||
101 | .hsync_len = 2, | ||
102 | .vsync_len = 2, | ||
103 | .xres = 480, | ||
104 | .yres = 800, | ||
105 | }, | ||
106 | .max_bpp = 32, | ||
107 | .default_bpp = 16, | ||
108 | }; | ||
109 | |||
110 | static struct s3c_fb_platdata aquila_lcd_pdata __initdata = { | ||
111 | .win[0] = &aquila_fb_win0, | ||
112 | .win[1] = &aquila_fb_win1, | ||
113 | .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, | ||
114 | .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC | | ||
115 | VIDCON1_INV_VCLK | VIDCON1_INV_VDEN, | ||
116 | .setup_gpio = s5pv210_fb_gpio_setup_24bpp, | ||
117 | }; | ||
118 | |||
119 | static struct platform_device *aquila_devices[] __initdata = { | ||
120 | &s3c_device_fb, | ||
121 | }; | ||
122 | |||
123 | static void __init aquila_map_io(void) | ||
124 | { | ||
125 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | ||
126 | s3c24xx_init_clocks(24000000); | ||
127 | s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); | ||
128 | } | ||
129 | |||
130 | static void __init aquila_machine_init(void) | ||
131 | { | ||
132 | /* FB */ | ||
133 | s3c_fb_set_platdata(&aquila_lcd_pdata); | ||
134 | |||
135 | platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices)); | ||
136 | } | ||
137 | |||
138 | MACHINE_START(AQUILA, "Aquila") | ||
139 | /* Maintainers: | ||
140 | Marek Szyprowski <m.szyprowski@samsung.com> | ||
141 | Kyungmin Park <kyungmin.park@samsung.com> */ | ||
142 | .phys_io = S3C_PA_UART & 0xfff00000, | ||
143 | .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc, | ||
144 | .boot_params = S5P_PA_SDRAM + 0x100, | ||
145 | .init_irq = s5pv210_init_irq, | ||
146 | .map_io = aquila_map_io, | ||
147 | .init_machine = aquila_machine_init, | ||
148 | .timer = &s3c24xx_timer, | ||
149 | MACHINE_END | ||
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c new file mode 100644 index 000000000000..4863b13824e4 --- /dev/null +++ b/arch/arm/mach-s5pv210/mach-goni.c | |||
@@ -0,0 +1,98 @@ | |||
1 | /* 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> | ||
15 | |||
16 | #include <asm/mach/arch.h> | ||
17 | #include <asm/mach/map.h> | ||
18 | #include <asm/setup.h> | ||
19 | #include <asm/mach-types.h> | ||
20 | |||
21 | #include <mach/map.h> | ||
22 | #include <mach/regs-clock.h> | ||
23 | |||
24 | #include <plat/regs-serial.h> | ||
25 | #include <plat/s5pv210.h> | ||
26 | #include <plat/devs.h> | ||
27 | #include <plat/cpu.h> | ||
28 | |||
29 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | ||
30 | #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | ||
31 | S3C2410_UCON_RXILEVEL | \ | ||
32 | S3C2410_UCON_TXIRQMODE | \ | ||
33 | S3C2410_UCON_RXIRQMODE | \ | ||
34 | S3C2410_UCON_RXFIFO_TOI | \ | ||
35 | S3C2443_UCON_RXERR_IRQEN) | ||
36 | |||
37 | #define S5PV210_ULCON_DEFAULT S3C2410_LCON_CS8 | ||
38 | |||
39 | #define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ | ||
40 | S5PV210_UFCON_TXTRIG4 | \ | ||
41 | S5PV210_UFCON_RXTRIG4) | ||
42 | |||
43 | static struct s3c2410_uartcfg goni_uartcfgs[] __initdata = { | ||
44 | [0] = { | ||
45 | .hwport = 0, | ||
46 | .flags = 0, | ||
47 | .ucon = S5PV210_UCON_DEFAULT, | ||
48 | .ulcon = S5PV210_ULCON_DEFAULT, | ||
49 | .ufcon = S5PV210_UFCON_DEFAULT, | ||
50 | }, | ||
51 | [1] = { | ||
52 | .hwport = 1, | ||
53 | .flags = 0, | ||
54 | .ucon = S5PV210_UCON_DEFAULT, | ||
55 | .ulcon = S5PV210_ULCON_DEFAULT, | ||
56 | .ufcon = S5PV210_UFCON_DEFAULT, | ||
57 | }, | ||
58 | [2] = { | ||
59 | .hwport = 2, | ||
60 | .flags = 0, | ||
61 | .ucon = S5PV210_UCON_DEFAULT, | ||
62 | .ulcon = S5PV210_ULCON_DEFAULT, | ||
63 | .ufcon = S5PV210_UFCON_DEFAULT, | ||
64 | }, | ||
65 | [3] = { | ||
66 | .hwport = 3, | ||
67 | .flags = 0, | ||
68 | .ucon = S5PV210_UCON_DEFAULT, | ||
69 | .ulcon = S5PV210_ULCON_DEFAULT, | ||
70 | .ufcon = S5PV210_UFCON_DEFAULT, | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | static struct platform_device *goni_devices[] __initdata = { | ||
75 | }; | ||
76 | |||
77 | static void __init goni_map_io(void) | ||
78 | { | ||
79 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | ||
80 | s3c24xx_init_clocks(24000000); | ||
81 | s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs)); | ||
82 | } | ||
83 | |||
84 | static void __init goni_machine_init(void) | ||
85 | { | ||
86 | platform_add_devices(goni_devices, ARRAY_SIZE(goni_devices)); | ||
87 | } | ||
88 | |||
89 | MACHINE_START(GONI, "GONI") | ||
90 | /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */ | ||
91 | .phys_io = S3C_PA_UART & 0xfff00000, | ||
92 | .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc, | ||
93 | .boot_params = S5P_PA_SDRAM + 0x100, | ||
94 | .init_irq = s5pv210_init_irq, | ||
95 | .map_io = goni_map_io, | ||
96 | .init_machine = goni_machine_init, | ||
97 | .timer = &s3c24xx_timer, | ||
98 | MACHINE_END | ||
diff --git a/arch/arm/mach-s5pv210/setup-fb-24bpp.c b/arch/arm/mach-s5pv210/setup-fb-24bpp.c new file mode 100644 index 000000000000..a50cbac8720d --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-fb-24bpp.c | |||
@@ -0,0 +1,62 @@ | |||
1 | /* linux/arch/arm/plat-s5pv210/setup-fb-24bpp.c | ||
2 | * | ||
3 | * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * Base s5pv210 setup information for 24bpp LCD framebuffer | ||
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 | #include <linux/kernel.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/fb.h> | ||
16 | |||
17 | #include <mach/regs-fb.h> | ||
18 | #include <mach/gpio.h> | ||
19 | #include <mach/map.h> | ||
20 | #include <plat/fb.h> | ||
21 | #include <mach/regs-clock.h> | ||
22 | #include <plat/gpio-cfg.h> | ||
23 | |||
24 | void s5pv210_fb_gpio_setup_24bpp(void) | ||
25 | { | ||
26 | unsigned int gpio = 0; | ||
27 | |||
28 | for (gpio = S5PV210_GPF0(0); gpio <= S5PV210_GPF0(7); gpio++) { | ||
29 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
30 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
31 | s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); | ||
32 | } | ||
33 | |||
34 | for (gpio = S5PV210_GPF1(0); gpio <= S5PV210_GPF1(7); gpio++) { | ||
35 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
36 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
37 | s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); | ||
38 | } | ||
39 | |||
40 | for (gpio = S5PV210_GPF2(0); gpio <= S5PV210_GPF2(7); gpio++) { | ||
41 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
42 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
43 | s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); | ||
44 | } | ||
45 | |||
46 | for (gpio = S5PV210_GPF3(0); gpio <= S5PV210_GPF3(3); gpio++) { | ||
47 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
48 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
49 | s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); | ||
50 | } | ||
51 | |||
52 | /* Set DISPLAY_CONTROL register for Display path selection. | ||
53 | * | ||
54 | * ouput | RGB | I80 | ITU | ||
55 | * ----------------------------------- | ||
56 | * 00 | MIE | FIMD | FIMD | ||
57 | * 01 | MDNIE | MDNIE | FIMD | ||
58 | * 10 | FIMD | FIMD | FIMD | ||
59 | * 11 | FIMD | FIMD | FIMD | ||
60 | */ | ||
61 | writel(0x2, S5P_MDNIE_SEL); | ||
62 | } | ||
diff --git a/arch/arm/mach-s5pv210/setup-i2c0.c b/arch/arm/mach-s5pv210/setup-i2c0.c index 9ec6845840e5..c718253c70b8 100644 --- a/arch/arm/mach-s5pv210/setup-i2c0.c +++ b/arch/arm/mach-s5pv210/setup-i2c0.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/setup-i2c0.c | 1 | /* linux/arch/arm/mach-s5pv210/setup-i2c0.c |
2 | * | 2 | * |
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | 3 | * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. |
4 | * http://www.samsung.com/ | 4 | * http://www.samsung.com/ |
5 | * | 5 | * |
6 | * I2C0 GPIO configuration. | 6 | * I2C0 GPIO configuration. |
@@ -17,9 +17,14 @@ | |||
17 | 17 | ||
18 | struct platform_device; /* don't need the contents */ | 18 | struct platform_device; /* don't need the contents */ |
19 | 19 | ||
20 | #include <mach/gpio.h> | ||
20 | #include <plat/iic.h> | 21 | #include <plat/iic.h> |
22 | #include <plat/gpio-cfg.h> | ||
21 | 23 | ||
22 | void s3c_i2c0_cfg_gpio(struct platform_device *dev) | 24 | void s3c_i2c0_cfg_gpio(struct platform_device *dev) |
23 | { | 25 | { |
24 | /* Will be populated later */ | 26 | s3c_gpio_cfgpin(S5PV210_GPD1(0), S3C_GPIO_SFN(2)); |
27 | s3c_gpio_setpull(S5PV210_GPD1(0), S3C_GPIO_PULL_UP); | ||
28 | s3c_gpio_cfgpin(S5PV210_GPD1(1), S3C_GPIO_SFN(2)); | ||
29 | s3c_gpio_setpull(S5PV210_GPD1(1), S3C_GPIO_PULL_UP); | ||
25 | } | 30 | } |
diff --git a/arch/arm/mach-s5pv210/setup-i2c1.c b/arch/arm/mach-s5pv210/setup-i2c1.c new file mode 100644 index 000000000000..45e0e6ed2ed0 --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-i2c1.c | |||
@@ -0,0 +1,30 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/setup-i2c1.c | ||
2 | * | ||
3 | * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * I2C1 GPIO configuration. | ||
7 | * | ||
8 | * Based on plat-s3c64xx/setup-i2c1.c | ||
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 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/types.h> | ||
17 | |||
18 | struct platform_device; /* don't need the contents */ | ||
19 | |||
20 | #include <mach/gpio.h> | ||
21 | #include <plat/iic.h> | ||
22 | #include <plat/gpio-cfg.h> | ||
23 | |||
24 | void s3c_i2c1_cfg_gpio(struct platform_device *dev) | ||
25 | { | ||
26 | s3c_gpio_cfgpin(S5PV210_GPD1(2), S3C_GPIO_SFN(2)); | ||
27 | s3c_gpio_setpull(S5PV210_GPD1(2), S3C_GPIO_PULL_UP); | ||
28 | s3c_gpio_cfgpin(S5PV210_GPD1(3), S3C_GPIO_SFN(2)); | ||
29 | s3c_gpio_setpull(S5PV210_GPD1(3), S3C_GPIO_PULL_UP); | ||
30 | } | ||
diff --git a/arch/arm/mach-s5pv210/setup-i2c2.c b/arch/arm/mach-s5pv210/setup-i2c2.c new file mode 100644 index 000000000000..b11b4bff69ac --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-i2c2.c | |||
@@ -0,0 +1,30 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/setup-i2c2.c | ||
2 | * | ||
3 | * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * I2C2 GPIO configuration. | ||
7 | * | ||
8 | * Based on plat-s3c64xx/setup-i2c0.c | ||
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 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/types.h> | ||
17 | |||
18 | struct platform_device; /* don't need the contents */ | ||
19 | |||
20 | #include <mach/gpio.h> | ||
21 | #include <plat/iic.h> | ||
22 | #include <plat/gpio-cfg.h> | ||
23 | |||
24 | void s3c_i2c2_cfg_gpio(struct platform_device *dev) | ||
25 | { | ||
26 | s3c_gpio_cfgpin(S5PV210_GPD1(4), S3C_GPIO_SFN(2)); | ||
27 | s3c_gpio_setpull(S5PV210_GPD1(4), S3C_GPIO_PULL_UP); | ||
28 | s3c_gpio_cfgpin(S5PV210_GPD1(5), S3C_GPIO_SFN(2)); | ||
29 | s3c_gpio_setpull(S5PV210_GPD1(5), S3C_GPIO_PULL_UP); | ||
30 | } | ||
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c new file mode 100644 index 000000000000..fe7d86dad14c --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /* linux/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c | ||
2 | * | ||
3 | * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5PV210 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC) | ||
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 | #include <linux/kernel.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/io.h> | ||
18 | #include <linux/mmc/host.h> | ||
19 | #include <linux/mmc/card.h> | ||
20 | |||
21 | #include <mach/gpio.h> | ||
22 | #include <plat/gpio-cfg.h> | ||
23 | #include <plat/regs-sdhci.h> | ||
24 | |||
25 | void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | ||
26 | { | ||
27 | unsigned int gpio; | ||
28 | |||
29 | /* Set all the necessary GPG0/GPG1 pins to special-function 2 */ | ||
30 | for (gpio = S5PV210_GPG0(0); gpio < S5PV210_GPG0(2); gpio++) { | ||
31 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
32 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
33 | } | ||
34 | switch (width) { | ||
35 | case 8: | ||
36 | /* GPG1[3:6] special-funtion 3 */ | ||
37 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) { | ||
38 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); | ||
39 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
40 | } | ||
41 | case 4: | ||
42 | /* GPG0[3:6] special-funtion 2 */ | ||
43 | for (gpio = S5PV210_GPG0(3); gpio <= S5PV210_GPG0(6); gpio++) { | ||
44 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
45 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
46 | } | ||
47 | default: | ||
48 | break; | ||
49 | } | ||
50 | |||
51 | s3c_gpio_setpull(S5PV210_GPG0(2), S3C_GPIO_PULL_UP); | ||
52 | s3c_gpio_cfgpin(S5PV210_GPG0(2), S3C_GPIO_SFN(2)); | ||
53 | } | ||
54 | |||
55 | void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | ||
56 | { | ||
57 | unsigned int gpio; | ||
58 | |||
59 | /* Set all the necessary GPG1[0:1] pins to special-function 2 */ | ||
60 | for (gpio = S5PV210_GPG1(0); gpio < S5PV210_GPG1(2); gpio++) { | ||
61 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
62 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
63 | } | ||
64 | |||
65 | /* Data pin GPG1[3:6] to special-function 2 */ | ||
66 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) { | ||
67 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
68 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
69 | } | ||
70 | |||
71 | s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP); | ||
72 | s3c_gpio_cfgpin(S5PV210_GPG1(2), S3C_GPIO_SFN(2)); | ||
73 | } | ||
74 | |||
75 | void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | ||
76 | { | ||
77 | unsigned int gpio; | ||
78 | |||
79 | /* Set all the necessary GPG2[0:1] pins to special-function 2 */ | ||
80 | for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) { | ||
81 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
82 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
83 | } | ||
84 | |||
85 | switch (width) { | ||
86 | case 8: | ||
87 | /* Data pin GPG3[3:6] to special-function 3 */ | ||
88 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) { | ||
89 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); | ||
90 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
91 | } | ||
92 | case 4: | ||
93 | /* Data pin GPG2[3:6] to special-function 2 */ | ||
94 | for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) { | ||
95 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
96 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
97 | } | ||
98 | default: | ||
99 | break; | ||
100 | } | ||
101 | |||
102 | s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_UP); | ||
103 | s3c_gpio_cfgpin(S5PV210_GPG2(2), S3C_GPIO_SFN(2)); | ||
104 | } | ||
diff --git a/arch/arm/mach-s5pv210/setup-sdhci.c b/arch/arm/mach-s5pv210/setup-sdhci.c new file mode 100644 index 000000000000..51815ec60c2a --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-sdhci.c | |||
@@ -0,0 +1,63 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/setup-sdhci.c | ||
2 | * | ||
3 | * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5PV210 - Helper functions for settign up SDHCI device(s) (HSMMC) | ||
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 | #include <linux/kernel.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/io.h> | ||
18 | |||
19 | #include <linux/mmc/card.h> | ||
20 | #include <linux/mmc/host.h> | ||
21 | |||
22 | #include <plat/regs-sdhci.h> | ||
23 | #include <plat/sdhci.h> | ||
24 | |||
25 | /* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ | ||
26 | |||
27 | char *s5pv210_hsmmc_clksrcs[4] = { | ||
28 | [0] = "hsmmc", /* HCLK */ | ||
29 | [1] = "hsmmc", /* HCLK */ | ||
30 | [2] = "sclk_mmc", /* mmc_bus */ | ||
31 | /*[4] = reserved */ | ||
32 | }; | ||
33 | |||
34 | void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev, | ||
35 | void __iomem *r, | ||
36 | struct mmc_ios *ios, | ||
37 | struct mmc_card *card) | ||
38 | { | ||
39 | u32 ctrl2, ctrl3; | ||
40 | |||
41 | /* don't need to alter anything acording to card-type */ | ||
42 | |||
43 | writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4); | ||
44 | |||
45 | ctrl2 = readl(r + S3C_SDHCI_CONTROL2); | ||
46 | ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK; | ||
47 | ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR | | ||
48 | S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK | | ||
49 | S3C_SDHCI_CTRL2_ENFBCLKRX | | ||
50 | S3C_SDHCI_CTRL2_DFCNT_NONE | | ||
51 | S3C_SDHCI_CTRL2_ENCLKOUTHOLD); | ||
52 | |||
53 | if (ios->clock < 25 * 1000000) | ||
54 | ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 | | ||
55 | S3C_SDHCI_CTRL3_FCSEL2 | | ||
56 | S3C_SDHCI_CTRL3_FCSEL1 | | ||
57 | S3C_SDHCI_CTRL3_FCSEL0); | ||
58 | else | ||
59 | ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0); | ||
60 | |||
61 | writel(ctrl2, r + S3C_SDHCI_CONTROL2); | ||
62 | writel(ctrl3, r + S3C_SDHCI_CONTROL3); | ||
63 | } | ||
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 1077ebebfb03..b787d576d4b3 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig | |||
@@ -170,6 +170,11 @@ config S3C_DEV_I2C1 | |||
170 | help | 170 | help |
171 | Compile in platform device definitions for I2C channel 1 | 171 | Compile in platform device definitions for I2C channel 1 |
172 | 172 | ||
173 | config S3C_DEV_I2C2 | ||
174 | bool | ||
175 | help | ||
176 | Compile in platform device definitions for I2C channel 2 | ||
177 | |||
173 | config S3C_DEV_FB | 178 | config S3C_DEV_FB |
174 | bool | 179 | bool |
175 | help | 180 | help |
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index 48288499a3b9..606ec8424c80 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile | |||
@@ -36,6 +36,7 @@ obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o | |||
36 | obj-$(CONFIG_S3C_DEV_HWMON) += dev-hwmon.o | 36 | obj-$(CONFIG_S3C_DEV_HWMON) += dev-hwmon.o |
37 | obj-y += dev-i2c0.o | 37 | obj-y += dev-i2c0.o |
38 | obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o | 38 | obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o |
39 | obj-$(CONFIG_S3C_DEV_I2C2) += dev-i2c2.o | ||
39 | obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o | 40 | obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o |
40 | obj-y += dev-uart.o | 41 | obj-y += dev-uart.o |
41 | obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o | 42 | obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o |
diff --git a/arch/arm/plat-samsung/dev-i2c2.c b/arch/arm/plat-samsung/dev-i2c2.c new file mode 100644 index 000000000000..07036dee09e7 --- /dev/null +++ b/arch/arm/plat-samsung/dev-i2c2.c | |||
@@ -0,0 +1,70 @@ | |||
1 | /* linux/arch/arm/plat-s3c/dev-i2c2.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S3C series device definition for i2c device 2 | ||
7 | * | ||
8 | * Based on plat-samsung/dev-i2c0.c | ||
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 | |||
15 | #include <linux/gfp.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/string.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #include <mach/irqs.h> | ||
21 | #include <mach/map.h> | ||
22 | |||
23 | #include <plat/regs-iic.h> | ||
24 | #include <plat/iic.h> | ||
25 | #include <plat/devs.h> | ||
26 | #include <plat/cpu.h> | ||
27 | |||
28 | static struct resource s3c_i2c_resource[] = { | ||
29 | [0] = { | ||
30 | .start = S3C_PA_IIC2, | ||
31 | .end = S3C_PA_IIC2 + SZ_4K - 1, | ||
32 | .flags = IORESOURCE_MEM, | ||
33 | }, | ||
34 | [1] = { | ||
35 | .start = IRQ_CAN0, | ||
36 | .end = IRQ_CAN0, | ||
37 | .flags = IORESOURCE_IRQ, | ||
38 | }, | ||
39 | }; | ||
40 | |||
41 | struct platform_device s3c_device_i2c2 = { | ||
42 | .name = "s3c2410-i2c", | ||
43 | .id = 2, | ||
44 | .num_resources = ARRAY_SIZE(s3c_i2c_resource), | ||
45 | .resource = s3c_i2c_resource, | ||
46 | }; | ||
47 | |||
48 | static struct s3c2410_platform_i2c default_i2c_data2 __initdata = { | ||
49 | .flags = 0, | ||
50 | .bus_num = 2, | ||
51 | .slave_addr = 0x10, | ||
52 | .frequency = 100*1000, | ||
53 | .sda_delay = 100, | ||
54 | }; | ||
55 | |||
56 | void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd) | ||
57 | { | ||
58 | struct s3c2410_platform_i2c *npd; | ||
59 | |||
60 | if (!pd) | ||
61 | pd = &default_i2c_data2; | ||
62 | |||
63 | npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL); | ||
64 | if (!npd) | ||
65 | printk(KERN_ERR "%s: no memory for platform data\n", __func__); | ||
66 | else if (!npd->cfg_gpio) | ||
67 | npd->cfg_gpio = s3c_i2c2_cfg_gpio; | ||
68 | |||
69 | s3c_device_i2c2.dev.platform_data = npd; | ||
70 | } | ||
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index ef69e56b2885..78d24202f4e4 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -45,6 +45,7 @@ extern struct platform_device s3c_device_lcd; | |||
45 | extern struct platform_device s3c_device_wdt; | 45 | extern struct platform_device s3c_device_wdt; |
46 | extern struct platform_device s3c_device_i2c0; | 46 | extern struct platform_device s3c_device_i2c0; |
47 | extern struct platform_device s3c_device_i2c1; | 47 | extern struct platform_device s3c_device_i2c1; |
48 | extern struct platform_device s3c_device_i2c2; | ||
48 | extern struct platform_device s3c_device_rtc; | 49 | extern struct platform_device s3c_device_rtc; |
49 | extern struct platform_device s3c_device_adc; | 50 | extern struct platform_device s3c_device_adc; |
50 | extern struct platform_device s3c_device_sdi; | 51 | extern struct platform_device s3c_device_sdi; |
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h index 1f85649d8c18..27d3b497b55b 100644 --- a/arch/arm/plat-samsung/include/plat/fb.h +++ b/arch/arm/plat-samsung/include/plat/fb.h | |||
@@ -84,4 +84,11 @@ extern void s3c64xx_fb_gpio_setup_24bpp(void); | |||
84 | */ | 84 | */ |
85 | extern void s5pc100_fb_gpio_setup_24bpp(void); | 85 | extern void s5pc100_fb_gpio_setup_24bpp(void); |
86 | 86 | ||
87 | /** | ||
88 | * s5pv210_fb_gpio_setup_24bpp() - S5PV210/S5PC110 setup function for 24bpp LCD | ||
89 | * | ||
90 | * Initialise the GPIO for an 24bpp LCD display on the RGB interface. | ||
91 | */ | ||
92 | extern void s5pv210_fb_gpio_setup_24bpp(void); | ||
93 | |||
87 | #endif /* __PLAT_S3C_FB_H */ | 94 | #endif /* __PLAT_S3C_FB_H */ |
diff --git a/arch/arm/plat-samsung/include/plat/iic-core.h b/arch/arm/plat-samsung/include/plat/iic-core.h index 36397ca20962..f182669b8e8e 100644 --- a/arch/arm/plat-samsung/include/plat/iic-core.h +++ b/arch/arm/plat-samsung/include/plat/iic-core.h | |||
@@ -32,4 +32,11 @@ static inline void s3c_i2c1_setname(char *name) | |||
32 | #endif | 32 | #endif |
33 | } | 33 | } |
34 | 34 | ||
35 | static inline void s3c_i2c2_setname(char *name) | ||
36 | { | ||
37 | #ifdef CONFIG_S3C_DEV_I2C2 | ||
38 | s3c_device_i2c2.name = name; | ||
39 | #endif | ||
40 | } | ||
41 | |||
35 | #endif /* __ASM_ARCH_IIC_H */ | 42 | #endif /* __ASM_ARCH_IIC_H */ |
diff --git a/arch/arm/plat-samsung/include/plat/iic.h b/arch/arm/plat-samsung/include/plat/iic.h index 3083df00dee6..133308bf595d 100644 --- a/arch/arm/plat-samsung/include/plat/iic.h +++ b/arch/arm/plat-samsung/include/plat/iic.h | |||
@@ -54,9 +54,11 @@ struct s3c2410_platform_i2c { | |||
54 | */ | 54 | */ |
55 | extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c); | 55 | extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c); |
56 | extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c); | 56 | extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c); |
57 | extern void s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *i2c); | ||
57 | 58 | ||
58 | /* defined by architecture to configure gpio */ | 59 | /* defined by architecture to configure gpio */ |
59 | extern void s3c_i2c0_cfg_gpio(struct platform_device *dev); | 60 | extern void s3c_i2c0_cfg_gpio(struct platform_device *dev); |
60 | extern void s3c_i2c1_cfg_gpio(struct platform_device *dev); | 61 | extern void s3c_i2c1_cfg_gpio(struct platform_device *dev); |
62 | extern void s3c_i2c2_cfg_gpio(struct platform_device *dev); | ||
61 | 63 | ||
62 | #endif /* __ASM_ARCH_IIC_H */ | 64 | #endif /* __ASM_ARCH_IIC_H */ |
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h index 7d07cd7aa4f2..13f9fb20900a 100644 --- a/arch/arm/plat-samsung/include/plat/sdhci.h +++ b/arch/arm/plat-samsung/include/plat/sdhci.h | |||
@@ -75,6 +75,9 @@ extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w); | |||
75 | extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w); | 75 | extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
76 | extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w); | 76 | extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
77 | extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w); | 77 | extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
78 | extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w); | ||
79 | extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w); | ||
80 | extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w); | ||
78 | 81 | ||
79 | /* S3C6400 SDHCI setup */ | 82 | /* S3C6400 SDHCI setup */ |
80 | 83 | ||
@@ -218,4 +221,56 @@ static inline void s5pc100_default_sdhci1(void) { } | |||
218 | static inline void s5pc100_default_sdhci2(void) { } | 221 | static inline void s5pc100_default_sdhci2(void) { } |
219 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ | 222 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ |
220 | 223 | ||
224 | |||
225 | /* S5PC110 SDHCI setup */ | ||
226 | #ifdef CONFIG_S5PV210_SETUP_SDHCI | ||
227 | extern char *s5pv210_hsmmc_clksrcs[4]; | ||
228 | |||
229 | extern void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev, | ||
230 | void __iomem *r, | ||
231 | struct mmc_ios *ios, | ||
232 | struct mmc_card *card); | ||
233 | |||
234 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
235 | static inline void s5pv210_default_sdhci0(void) | ||
236 | { | ||
237 | s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs; | ||
238 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio; | ||
239 | s3c_hsmmc0_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; | ||
240 | } | ||
241 | #else | ||
242 | static inline void s5pc100_default_sdhci0(void) { } | ||
243 | #endif /* CONFIG_S3C_DEV_HSMMC */ | ||
244 | |||
245 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
246 | static inline void s5pv210_default_sdhci1(void) | ||
247 | { | ||
248 | s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs; | ||
249 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio; | ||
250 | s3c_hsmmc1_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; | ||
251 | } | ||
252 | #else | ||
253 | static inline void s5pv210_default_sdhci1(void) { } | ||
254 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
255 | |||
256 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
257 | static inline void s5pv210_default_sdhci2(void) | ||
258 | { | ||
259 | s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs; | ||
260 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio; | ||
261 | s3c_hsmmc2_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; | ||
262 | } | ||
263 | #else | ||
264 | static inline void s5pv210_default_sdhci2(void) { } | ||
265 | #endif /* CONFIG_S3C_DEV_HSMMC2 */ | ||
266 | |||
267 | #else | ||
268 | static inline void s5pv210_default_sdhci0(void) { } | ||
269 | static inline void s5pv210_default_sdhci1(void) { } | ||
270 | static inline void s5pv210_default_sdhci2(void) { } | ||
271 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ | ||
272 | |||
273 | |||
274 | |||
275 | |||
221 | #endif /* __PLAT_S3C_SDHCI_H */ | 276 | #endif /* __PLAT_S3C_SDHCI_H */ |