Skip to content

Commit bbbfb91

Browse files
committed
Merge branch 'for-linus/samsung-2635' of git://git.fluff.org/bjdooks/linux
* 'for-linus/samsung-2635' of git://git.fluff.org/bjdooks/linux: DMAENGINE: correct PL080 register header file ARM: SAMSUNG: Fix on build warning about dependency in Kconfig ARM: SMDK6410: Make virtual screen twice depth of real ARM: S3C64XX: Update consistent DMA size to 8MiB ARM: S3C64XX: Add audio support to SmartQ ARM: S3C64XX: Framebuffer fix for SmartQ5 ARM: S3C64XX: Set wifi and iNAND as permanently connected SD devices on SmartQ boards ARM: S3C64XX: Move SmartQ LCD control platform definition to shared file ARM: mach-real6410: add sdhc device support ARM: mach-real6410: add dm9000 ethernet support for mach-real6410 ARM: S3C64XX: Support for Real6410 Fix up trivial conflicts in arch/arm/mach-s3c64xx/mach-smartq5.c ("remove pixclock" vs "Framebuffer fix for SmartQ5")
2 parents d0a0c28 + a739260 commit bbbfb91

11 files changed

Lines changed: 213 additions & 65 deletions

File tree

‎arch/arm/include/asm/hardware/pl080.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
/* Per channel configuration registers */
4545

46-
#define PL008_Cx_STRIDE (0x20)
46+
#define PL080_Cx_STRIDE (0x20)
4747
#define PL080_Cx_BASE(x) ((0x100 + (x * 0x20)))
4848
#define PL080_Cx_SRC_ADDR(x) ((0x100 + (x * 0x20)))
4949
#define PL080_Cx_DST_ADDR(x) ((0x104 + (x * 0x20)))
@@ -68,6 +68,8 @@
6868
#define PL080_CONTROL_TC_IRQ_EN (1 << 31)
6969
#define PL080_CONTROL_PROT_MASK (0x7 << 28)
7070
#define PL080_CONTROL_PROT_SHIFT (28)
71+
#define PL080_CONTROL_PROT_CACHE (1 << 30)
72+
#define PL080_CONTROL_PROT_BUFF (1 << 29)
7173
#define PL080_CONTROL_PROT_SYS (1 << 28)
7274
#define PL080_CONTROL_DST_INCR (1 << 27)
7375
#define PL080_CONTROL_SRC_INCR (1 << 26)

‎arch/arm/mach-s3c64xx/Kconfig‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ config MACH_ANW6410
9898
help
9999
Machine support for the A&W6410
100100

101+
config MACH_REAL6410
102+
bool "REAL6410"
103+
select CPU_S3C6410
104+
select S3C_DEV_HSMMC
105+
select S3C_DEV_HSMMC1
106+
select S3C64XX_SETUP_SDHCI
107+
help
108+
Machine support for the CoreWind REAL6410
109+
101110
config MACH_SMDK6410
102111
bool "SMDK6410"
103112
select CPU_S3C6410

‎arch/arm/mach-s3c64xx/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ obj-$(CONFIG_PM) += irq-pm.o
5252
obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o
5353
obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o
5454
obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o
55+
obj-$(CONFIG_MACH_REAL6410) += mach-real6410.o
5556
obj-$(CONFIG_MACH_NCP) += mach-ncp.o
5657
obj-$(CONFIG_MACH_HMT) += mach-hmt.o
5758
obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o

‎arch/arm/mach-s3c64xx/dma.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
697697
chptr->number = chno;
698698
chptr->dmac = dmac;
699699
chptr->regs = regptr;
700-
regptr += PL008_Cx_STRIDE;
700+
regptr += PL080_Cx_STRIDE;
701701
}
702702

703703
/* for the moment, permanently enable the controller */

‎arch/arm/mach-s3c64xx/include/mach/memory.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515

1616
#define PHYS_OFFSET UL(0x50000000)
1717

18+
#define CONSISTENT_DMA_SIZE SZ_8M
19+
1820
#endif
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
/* linux/arch/arm/mach-s3c64xx/mach-real6410.c
2+
*
3+
* Copyright 2010 Darius Augulis <augulis.darius@gmail.com>
4+
* Copyright 2008 Openmoko, Inc.
5+
* Copyright 2008 Simtec Electronics
6+
* Ben Dooks <ben@simtec.co.uk>
7+
* http://armlinux.simtec.co.uk/
8+
*
9+
* This program is free software; you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License version 2 as
11+
* published by the Free Software Foundation.
12+
*
13+
*/
14+
15+
#include <linux/kernel.h>
16+
#include <linux/types.h>
17+
#include <linux/interrupt.h>
18+
#include <linux/list.h>
19+
#include <linux/init.h>
20+
#include <linux/dm9000.h>
21+
#include <linux/serial_core.h>
22+
#include <linux/platform_device.h>
23+
#include <asm/mach-types.h>
24+
#include <asm/mach/arch.h>
25+
#include <asm/mach/map.h>
26+
#include <mach/map.h>
27+
#include <mach/s3c6410.h>
28+
#include <mach/regs-srom.h>
29+
#include <plat/cpu.h>
30+
#include <plat/devs.h>
31+
#include <plat/regs-serial.h>
32+
33+
#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
34+
#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
35+
#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
36+
37+
static struct s3c2410_uartcfg real6410_uartcfgs[] __initdata = {
38+
[0] = {
39+
.hwport = 0,
40+
.flags = 0,
41+
.ucon = UCON,
42+
.ulcon = ULCON,
43+
.ufcon = UFCON,
44+
},
45+
[1] = {
46+
.hwport = 1,
47+
.flags = 0,
48+
.ucon = UCON,
49+
.ulcon = ULCON,
50+
.ufcon = UFCON,
51+
},
52+
[2] = {
53+
.hwport = 2,
54+
.flags = 0,
55+
.ucon = UCON,
56+
.ulcon = ULCON,
57+
.ufcon = UFCON,
58+
},
59+
[3] = {
60+
.hwport = 3,
61+
.flags = 0,
62+
.ucon = UCON,
63+
.ulcon = ULCON,
64+
.ufcon = UFCON,
65+
},
66+
};
67+
68+
/* DM9000AEP 10/100 ethernet controller */
69+
70+
static struct resource real6410_dm9k_resource[] = {
71+
[0] = {
72+
.start = S3C64XX_PA_XM0CSN1,
73+
.end = S3C64XX_PA_XM0CSN1 + 1,
74+
.flags = IORESOURCE_MEM
75+
},
76+
[1] = {
77+
.start = S3C64XX_PA_XM0CSN1 + 4,
78+
.end = S3C64XX_PA_XM0CSN1 + 5,
79+
.flags = IORESOURCE_MEM
80+
},
81+
[2] = {
82+
.start = S3C_EINT(7),
83+
.end = S3C_EINT(7),
84+
.flags = IORESOURCE_IRQ,
85+
}
86+
};
87+
88+
static struct dm9000_plat_data real6410_dm9k_pdata = {
89+
.flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),
90+
};
91+
92+
static struct platform_device real6410_device_eth = {
93+
.name = "dm9000",
94+
.id = -1,
95+
.num_resources = ARRAY_SIZE(real6410_dm9k_resource),
96+
.resource = real6410_dm9k_resource,
97+
.dev = {
98+
.platform_data = &real6410_dm9k_pdata,
99+
},
100+
};
101+
102+
static struct platform_device *real6410_devices[] __initdata = {
103+
&real6410_device_eth,
104+
&s3c_device_hsmmc0,
105+
&s3c_device_hsmmc1,
106+
};
107+
108+
static void __init real6410_map_io(void)
109+
{
110+
s3c64xx_init_io(NULL, 0);
111+
s3c24xx_init_clocks(12000000);
112+
s3c24xx_init_uarts(real6410_uartcfgs, ARRAY_SIZE(real6410_uartcfgs));
113+
}
114+
115+
static void __init real6410_machine_init(void)
116+
{
117+
u32 cs1;
118+
119+
/* configure nCS1 width to 16 bits */
120+
121+
cs1 = __raw_readl(S3C64XX_SROM_BW) &
122+
~(S3C64XX_SROM_BW__CS_MASK << S3C64XX_SROM_BW__NCS1__SHIFT);
123+
cs1 |= ((1 << S3C64XX_SROM_BW__DATAWIDTH__SHIFT) |
124+
(1 << S3C64XX_SROM_BW__WAITENABLE__SHIFT) |
125+
(1 << S3C64XX_SROM_BW__BYTEENABLE__SHIFT)) <<
126+
S3C64XX_SROM_BW__NCS1__SHIFT;
127+
__raw_writel(cs1, S3C64XX_SROM_BW);
128+
129+
/* set timing for nCS1 suitable for ethernet chip */
130+
131+
__raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) |
132+
(6 << S3C64XX_SROM_BCX__TACP__SHIFT) |
133+
(4 << S3C64XX_SROM_BCX__TCAH__SHIFT) |
134+
(1 << S3C64XX_SROM_BCX__TCOH__SHIFT) |
135+
(13 << S3C64XX_SROM_BCX__TACC__SHIFT) |
136+
(4 << S3C64XX_SROM_BCX__TCOS__SHIFT) |
137+
(0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1);
138+
139+
platform_add_devices(real6410_devices, ARRAY_SIZE(real6410_devices));
140+
}
141+
142+
MACHINE_START(REAL6410, "REAL6410")
143+
/* Maintainer: Darius Augulis <augulis.darius@gmail.com> */
144+
.phys_io = S3C_PA_UART & 0xfff00000,
145+
.io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
146+
.boot_params = S3C64XX_PA_SDRAM + 0x100,
147+
148+
.init_irq = s3c6410_init_irq,
149+
.map_io = real6410_map_io,
150+
.init_machine = real6410_machine_init,
151+
.timer = &s3c24xx_timer,
152+
MACHINE_END

‎arch/arm/mach-s3c64xx/mach-smartq.c‎

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/platform_device.h>
1717
#include <linux/pwm_backlight.h>
1818
#include <linux/serial_core.h>
19+
#include <linux/spi/spi_gpio.h>
1920
#include <linux/usb/gpio_vbus.h>
2021

2122
#include <asm/mach-types.h>
@@ -166,7 +167,7 @@ static struct s3c2410_ts_mach_info smartq_touchscreen_pdata __initdata = {
166167

167168
static struct s3c_sdhci_platdata smartq_internal_hsmmc_pdata = {
168169
.max_width = 4,
169-
/*.broken_card_detection = true,*/
170+
.cd_type = S3C_SDHCI_CD_PERMANENT,
170171
};
171172

172173
static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = {
@@ -184,6 +185,33 @@ static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = {
184185
},
185186
};
186187

188+
static int __init smartq_lcd_setup_gpio(void)
189+
{
190+
int ret;
191+
192+
ret = gpio_request(S3C64XX_GPM(3), "LCD power");
193+
if (ret < 0)
194+
return ret;
195+
196+
/* turn power off */
197+
gpio_direction_output(S3C64XX_GPM(3), 0);
198+
199+
return 0;
200+
}
201+
202+
/* GPM0 -> CS */
203+
static struct spi_gpio_platform_data smartq_lcd_control = {
204+
.sck = S3C64XX_GPM(1),
205+
.mosi = S3C64XX_GPM(2),
206+
.miso = S3C64XX_GPM(2),
207+
};
208+
209+
static struct platform_device smartq_lcd_control_device = {
210+
.name = "spi-gpio",
211+
.id = 1,
212+
.dev.platform_data = &smartq_lcd_control,
213+
};
214+
187215
static void smartq_lcd_power_set(struct plat_lcd_data *pd, unsigned int power)
188216
{
189217
gpio_direction_output(S3C64XX_GPM(3), power);
@@ -199,6 +227,9 @@ static struct platform_device smartq_lcd_power_device = {
199227
.dev.platform_data = &smartq_lcd_power_data,
200228
};
201229

230+
static struct i2c_board_info smartq_i2c_devs[] __initdata = {
231+
{ I2C_BOARD_INFO("wm8987", 0x1a), },
232+
};
202233

203234
static struct platform_device *smartq_devices[] __initdata = {
204235
&s3c_device_hsmmc1, /* Init iNAND first, ... */
@@ -213,7 +244,9 @@ static struct platform_device *smartq_devices[] __initdata = {
213244
&s3c_device_timer[1],
214245
&s3c_device_ts,
215246
&s3c_device_usb_hsotg,
247+
&s3c64xx_device_iis0,
216248
&smartq_backlight_device,
249+
&smartq_lcd_control_device,
217250
&smartq_lcd_power_device,
218251
&smartq_usb_otg_vbus_dev,
219252
};
@@ -252,7 +285,6 @@ static int __init smartq_power_off_init(void)
252285
/* leave power on */
253286
gpio_direction_output(S3C64XX_GPK(15), 0);
254287

255-
256288
pm_power_off = smartq_power_off;
257289

258290
return ret;
@@ -354,6 +386,10 @@ void __init smartq_machine_init(void)
354386
s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata);
355387
s3c24xx_ts_set_platdata(&smartq_touchscreen_pdata);
356388

389+
i2c_register_board_info(0, smartq_i2c_devs,
390+
ARRAY_SIZE(smartq_i2c_devs));
391+
392+
WARN_ON(smartq_lcd_setup_gpio());
357393
WARN_ON(smartq_power_off_init());
358394
WARN_ON(smartq_usb_host_init());
359395
WARN_ON(smartq_usb_otg_init());

‎arch/arm/mach-s3c64xx/mach-smartq5.c‎

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/fb.h>
1313
#include <linux/gpio.h>
1414
#include <linux/gpio_keys.h>
15-
#include <linux/i2c-gpio.h>
1615
#include <linux/init.h>
1716
#include <linux/input.h>
1817
#include <linux/leds.h>
@@ -33,31 +32,6 @@
3332

3433
#include "mach-smartq.h"
3534

36-
static void __init smartq5_lcd_setup_gpio(void)
37-
{
38-
gpio_request(S3C64XX_GPM(0), "LCD SCEN pin");
39-
gpio_request(S3C64XX_GPM(1), "LCD SCL pin");
40-
gpio_request(S3C64XX_GPM(2), "LCD SDA pin");
41-
gpio_request(S3C64XX_GPM(3), "LCD power");
42-
43-
/* turn power off */
44-
gpio_direction_output(S3C64XX_GPM(0), 1);
45-
gpio_direction_input(S3C64XX_GPM(1));
46-
gpio_direction_input(S3C64XX_GPM(2));
47-
gpio_direction_output(S3C64XX_GPM(3), 0);
48-
}
49-
50-
static struct i2c_gpio_platform_data smartq5_lcd_control = {
51-
.sda_pin = S3C64XX_GPM(2),
52-
.scl_pin = S3C64XX_GPM(1),
53-
};
54-
55-
static struct platform_device smartq5_lcd_control_device = {
56-
.name = "i2c-gpio",
57-
.id = 1,
58-
.dev.platform_data = &smartq5_lcd_control,
59-
};
60-
6135
static struct gpio_led smartq5_leds[] __initdata = {
6236
{
6337
.name = "smartq5:green",
@@ -134,10 +108,10 @@ static struct platform_device smartq5_buttons_device = {
134108

135109
static struct s3c_fb_pd_win smartq5_fb_win0 = {
136110
.win_mode = {
137-
.left_margin = 40,
138-
.right_margin = 216,
139-
.upper_margin = 10,
140-
.lower_margin = 35,
111+
.left_margin = 216,
112+
.right_margin = 40,
113+
.upper_margin = 35,
114+
.lower_margin = 10,
141115
.hsync_len = 1,
142116
.vsync_len = 1,
143117
.xres = 800,
@@ -159,15 +133,13 @@ static struct s3c_fb_platdata smartq5_lcd_pdata __initdata = {
159133
static struct platform_device *smartq5_devices[] __initdata = {
160134
&smartq5_leds_device,
161135
&smartq5_buttons_device,
162-
&smartq5_lcd_control_device,
163136
};
164137

165138
static void __init smartq5_machine_init(void)
166139
{
167140
s3c_fb_set_platdata(&smartq5_lcd_pdata);
168141

169142
smartq_machine_init();
170-
smartq5_lcd_setup_gpio();
171143

172144
platform_add_devices(smartq5_devices, ARRAY_SIZE(smartq5_devices));
173145
}

0 commit comments

Comments
 (0)