From c115f67c03e468f18431840a97279cd3bfee8ad7 Mon Sep 17 00:00:00 2001 From: Darius Augulis <augulis.darius@gmail.com> Date: Tue, 19 Oct 2010 13:52:29 +0900 Subject: ARM: S3C64XX: add frame buffer support for mach-real6410 Add support for frame buffer device for mach-real6410. Patch also adds support for feature string parsing for real6410. The feature string is kernel command line passed and currently lets select only LCD configuration. At the moment there is support for two LCD configurations - 4.3" and 7.0". Feature parser is mach-mini2440 based. Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- arch/arm/mach-s3c64xx/Kconfig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm/mach-s3c64xx/Kconfig') diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 1e4d78af7d8..3bbd4184361 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -104,6 +104,8 @@ config MACH_REAL6410 select S3C_DEV_HSMMC select S3C_DEV_HSMMC1 select S3C64XX_SETUP_SDHCI + select S3C_DEV_FB + select S3C64XX_SETUP_FB_24BPP help Machine support for the CoreWind REAL6410 -- cgit v1.2.3-70-g09d2 From 88fbadea18bd58a5a5ae2051e6bbbec7dcbacbb4 Mon Sep 17 00:00:00 2001 From: Darius Augulis <augulis.darius@gmail.com> Date: Tue, 19 Oct 2010 13:52:32 +0900 Subject: ARM: S3C64XX: add nand support for mach-real6410 Add nand device support and mtd partition table for mach-real6410 Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- arch/arm/mach-s3c64xx/Kconfig | 1 + arch/arm/mach-s3c64xx/mach-real6410.c | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) (limited to 'arch/arm/mach-s3c64xx/Kconfig') diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 3bbd4184361..e4aede13990 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -106,6 +106,7 @@ config MACH_REAL6410 select S3C64XX_SETUP_SDHCI select S3C_DEV_FB select S3C64XX_SETUP_FB_24BPP + select S3C_DEV_NAND help Machine support for the CoreWind REAL6410 diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c index bed75d22132..9fd943d76aa 100644 --- a/arch/arm/mach-s3c64xx/mach-real6410.c +++ b/arch/arm/mach-s3c64xx/mach-real6410.c @@ -19,6 +19,8 @@ #include <linux/kernel.h> #include <linux/list.h> #include <linux/dm9000.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> #include <linux/platform_device.h> #include <linux/serial_core.h> #include <linux/types.h> @@ -37,6 +39,7 @@ #include <plat/cpu.h> #include <plat/devs.h> #include <plat/fb.h> +#include <plat/nand.h> #include <plat/regs-serial.h> #include <video/platform_lcd.h> @@ -147,11 +150,47 @@ static struct s3c_fb_platdata real6410_lcd_pdata __initdata = { .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, }; +static struct mtd_partition real6410_nand_part[] = { + [0] = { + .name = "uboot", + .size = SZ_1M, + .offset = 0, + }, + [1] = { + .name = "kernel", + .size = SZ_2M, + .offset = SZ_1M, + }, + [2] = { + .name = "rootfs", + .size = MTDPART_SIZ_FULL, + .offset = SZ_1M + SZ_2M, + }, +}; + +static struct s3c2410_nand_set real6410_nand_sets[] = { + [0] = { + .name = "nand", + .nr_chips = 1, + .nr_partitions = ARRAY_SIZE(real6410_nand_part), + .partitions = real6410_nand_part, + }, +}; + +static struct s3c2410_platform_nand real6410_nand_info = { + .tacls = 25, + .twrph0 = 55, + .twrph1 = 40, + .nr_sets = ARRAY_SIZE(real6410_nand_sets), + .sets = real6410_nand_sets, +}; + static struct platform_device *real6410_devices[] __initdata = { &real6410_device_eth, &s3c_device_hsmmc0, &s3c_device_hsmmc1, &s3c_device_fb, + &s3c_device_nand, }; static void __init real6410_map_io(void) @@ -249,6 +288,7 @@ static void __init real6410_machine_init(void) real6410_lcd_pdata.win[0]->win_mode.yres); s3c_fb_set_platdata(&real6410_lcd_pdata); + s3c_nand_set_platdata(&real6410_nand_info); /* configure nCS1 width to 16 bits */ -- cgit v1.2.3-70-g09d2 From 4374c456724abf99210c9d2aa419bd6ea8cddaa6 Mon Sep 17 00:00:00 2001 From: Darius Augulis <augulis.darius@gmail.com> Date: Tue, 19 Oct 2010 13:52:34 +0900 Subject: ARM: S3C64XX: add touchscreen support for mach-real6410 Add touchscreen device support for mach-real6410 Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- arch/arm/mach-s3c64xx/Kconfig | 2 ++ arch/arm/mach-s3c64xx/mach-real6410.c | 11 +++++++++++ 2 files changed, 13 insertions(+) (limited to 'arch/arm/mach-s3c64xx/Kconfig') diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index e4aede13990..b706b80cc96 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -107,6 +107,8 @@ config MACH_REAL6410 select S3C_DEV_FB select S3C64XX_SETUP_FB_24BPP select S3C_DEV_NAND + select SAMSUNG_DEV_ADC + select SAMSUNG_DEV_TS help Machine support for the CoreWind REAL6410 diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c index 9fd943d76aa..bad6990eeb8 100644 --- a/arch/arm/mach-s3c64xx/mach-real6410.c +++ b/arch/arm/mach-s3c64xx/mach-real6410.c @@ -36,11 +36,13 @@ #include <mach/regs-srom.h> #include <mach/s3c6410.h> +#include <plat/adc.h> #include <plat/cpu.h> #include <plat/devs.h> #include <plat/fb.h> #include <plat/nand.h> #include <plat/regs-serial.h> +#include <plat/ts.h> #include <video/platform_lcd.h> @@ -191,6 +193,14 @@ static struct platform_device *real6410_devices[] __initdata = { &s3c_device_hsmmc1, &s3c_device_fb, &s3c_device_nand, + &s3c_device_adc, + &s3c_device_ts, +}; + +static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = { + .delay = 10000, + .presc = 49, + .oversampling_shift = 2, }; static void __init real6410_map_io(void) @@ -289,6 +299,7 @@ static void __init real6410_machine_init(void) s3c_fb_set_platdata(&real6410_lcd_pdata); s3c_nand_set_platdata(&real6410_nand_info); + s3c24xx_ts_set_platdata(&s3c_ts_platform); /* configure nCS1 width to 16 bits */ -- cgit v1.2.3-70-g09d2 From 10dcc7a2bde3e0acafad5492faab430c5b6d8fab Mon Sep 17 00:00:00 2001 From: Darius Augulis <augulis.darius@gmail.com> Date: Tue, 19 Oct 2010 13:52:37 +0900 Subject: ARM: S3C64XX: add USB host support for mach-real6410 Add USB host device support for mach-real6410 Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- arch/arm/mach-s3c64xx/Kconfig | 1 + arch/arm/mach-s3c64xx/mach-real6410.c | 1 + 2 files changed, 2 insertions(+) (limited to 'arch/arm/mach-s3c64xx/Kconfig') diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index b706b80cc96..c05ae12a9f9 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -109,6 +109,7 @@ config MACH_REAL6410 select S3C_DEV_NAND select SAMSUNG_DEV_ADC select SAMSUNG_DEV_TS + select S3C_DEV_USB_HOST help Machine support for the CoreWind REAL6410 diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c index bad6990eeb8..00e7d7e4a4f 100644 --- a/arch/arm/mach-s3c64xx/mach-real6410.c +++ b/arch/arm/mach-s3c64xx/mach-real6410.c @@ -195,6 +195,7 @@ static struct platform_device *real6410_devices[] __initdata = { &s3c_device_nand, &s3c_device_adc, &s3c_device_ts, + &s3c_device_ohci, }; static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = { -- cgit v1.2.3-70-g09d2 From e9debd989b33a3bbdde39e2a21ee92e11a8a360a Mon Sep 17 00:00:00 2001 From: Darius Augulis <augulis.darius@gmail.com> Date: Thu, 21 Oct 2010 07:42:29 +0900 Subject: ARM: S3C64XX: add support for mach-mini6410 Add support for mini6410 board from FriendlyARM Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- arch/arm/mach-s3c64xx/Kconfig | 10 +++ arch/arm/mach-s3c64xx/Makefile | 1 + arch/arm/mach-s3c64xx/mach-mini6410.c | 154 ++++++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 arch/arm/mach-s3c64xx/mach-mini6410.c (limited to 'arch/arm/mach-s3c64xx/Kconfig') diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index c05ae12a9f9..bbeb4cae465 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -98,6 +98,16 @@ config MACH_ANW6410 help Machine support for the A&W6410 +config MACH_MINI6410 + bool "MINI6410" + select CPU_S3C6410 + select S3C_DEV_HSMMC + select S3C_DEV_HSMMC1 + select S3C64XX_SETUP_SDHCI + select S3C_DEV_USB_HOST + help + Machine support for the FriendlyARM MINI6410 + config MACH_REAL6410 bool "REAL6410" select CPU_S3C6410 diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile index 90221a2e0c5..4657363f067 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile @@ -53,6 +53,7 @@ obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o obj-$(CONFIG_MACH_REAL6410) += mach-real6410.o +obj-$(CONFIG_MACH_MINI6410) += mach-mini6410.o obj-$(CONFIG_MACH_NCP) += mach-ncp.o obj-$(CONFIG_MACH_HMT) += mach-hmt.o obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c new file mode 100644 index 00000000000..39701256452 --- /dev/null +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c @@ -0,0 +1,154 @@ +/* linux/arch/arm/mach-s3c64xx/mach-mini6410.c + * + * Copyright 2010 Darius Augulis <augulis.darius@gmail.com> + * Copyright 2008 Openmoko, Inc. + * Copyright 2008 Simtec Electronics + * Ben Dooks <ben@simtec.co.uk> + * http://armlinux.simtec.co.uk/ + * + * 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/init.h> +#include <linux/interrupt.h> +#include <linux/gpio.h> +#include <linux/kernel.h> +#include <linux/list.h> +#include <linux/dm9000.h> +#include <linux/serial_core.h> +#include <linux/types.h> + +#include <asm/mach-types.h> +#include <asm/mach/arch.h> +#include <asm/mach/map.h> + +#include <mach/map.h> +#include <mach/regs-gpio.h> +#include <mach/regs-srom.h> +#include <mach/s3c6410.h> + +#include <plat/cpu.h> +#include <plat/devs.h> +#include <plat/regs-serial.h> + +#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) +#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) +#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) + +static struct s3c2410_uartcfg mini6410_uartcfgs[] __initdata = { + [0] = { + .hwport = 0, + .flags = 0, + .ucon = UCON, + .ulcon = ULCON, + .ufcon = UFCON, + }, + [1] = { + .hwport = 1, + .flags = 0, + .ucon = UCON, + .ulcon = ULCON, + .ufcon = UFCON, + }, + [2] = { + .hwport = 2, + .flags = 0, + .ucon = UCON, + .ulcon = ULCON, + .ufcon = UFCON, + }, + [3] = { + .hwport = 3, + .flags = 0, + .ucon = UCON, + .ulcon = ULCON, + .ufcon = UFCON, + }, +}; + +/* DM9000AEP 10/100 ethernet controller */ + +static struct resource mini6410_dm9k_resource[] = { + [0] = { + .start = S3C64XX_PA_XM0CSN1, + .end = S3C64XX_PA_XM0CSN1 + 1, + .flags = IORESOURCE_MEM + }, + [1] = { + .start = S3C64XX_PA_XM0CSN1 + 4, + .end = S3C64XX_PA_XM0CSN1 + 5, + .flags = IORESOURCE_MEM + }, + [2] = { + .start = S3C_EINT(7), + .end = S3C_EINT(7), + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL + } +}; + +static struct dm9000_plat_data mini6410_dm9k_pdata = { + .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM), +}; + +static struct platform_device mini6410_device_eth = { + .name = "dm9000", + .id = -1, + .num_resources = ARRAY_SIZE(mini6410_dm9k_resource), + .resource = mini6410_dm9k_resource, + .dev = { + .platform_data = &mini6410_dm9k_pdata, + }, +}; + +static struct platform_device *mini6410_devices[] __initdata = { + &mini6410_device_eth, + &s3c_device_hsmmc0, + &s3c_device_hsmmc1, + &s3c_device_ohci, +}; + +static void __init mini6410_map_io(void) +{ + s3c64xx_init_io(NULL, 0); + s3c24xx_init_clocks(12000000); + s3c24xx_init_uarts(mini6410_uartcfgs, ARRAY_SIZE(mini6410_uartcfgs)); +} + +static void __init mini6410_machine_init(void) +{ + u32 cs1; + + /* configure nCS1 width to 16 bits */ + + cs1 = __raw_readl(S3C64XX_SROM_BW) & + ~(S3C64XX_SROM_BW__CS_MASK << S3C64XX_SROM_BW__NCS1__SHIFT); + cs1 |= ((1 << S3C64XX_SROM_BW__DATAWIDTH__SHIFT) | + (1 << S3C64XX_SROM_BW__WAITENABLE__SHIFT) | + (1 << S3C64XX_SROM_BW__BYTEENABLE__SHIFT)) << + S3C64XX_SROM_BW__NCS1__SHIFT; + __raw_writel(cs1, S3C64XX_SROM_BW); + + /* set timing for nCS1 suitable for ethernet chip */ + + __raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) | + (6 << S3C64XX_SROM_BCX__TACP__SHIFT) | + (4 << S3C64XX_SROM_BCX__TCAH__SHIFT) | + (1 << S3C64XX_SROM_BCX__TCOH__SHIFT) | + (13 << S3C64XX_SROM_BCX__TACC__SHIFT) | + (4 << S3C64XX_SROM_BCX__TCOS__SHIFT) | + (0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1); + + platform_add_devices(mini6410_devices, ARRAY_SIZE(mini6410_devices)); +} + +MACHINE_START(MINI6410, "MINI6410") + /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */ + .boot_params = S3C64XX_PA_SDRAM + 0x100, + .init_irq = s3c6410_init_irq, + .map_io = mini6410_map_io, + .init_machine = mini6410_machine_init, + .timer = &s3c24xx_timer, +MACHINE_END -- cgit v1.2.3-70-g09d2 From 1c5d76ef3064b6a939146023b7e1577f528b29a6 Mon Sep 17 00:00:00 2001 From: Darius Augulis <augulis.darius@gmail.com> Date: Tue, 19 Oct 2010 16:04:16 +0900 Subject: ARM: S3C64XX: add nand support for mach-mini6410 Add nand device support and mtd partition table for mini6410 Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- arch/arm/mach-s3c64xx/Kconfig | 1 + arch/arm/mach-s3c64xx/mach-mini6410.c | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) (limited to 'arch/arm/mach-s3c64xx/Kconfig') diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index bbeb4cae465..3bbd2045da5 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -105,6 +105,7 @@ config MACH_MINI6410 select S3C_DEV_HSMMC1 select S3C64XX_SETUP_SDHCI select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Machine support for the FriendlyARM MINI6410 diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c index 39701256452..d079ecf2350 100644 --- a/arch/arm/mach-s3c64xx/mach-mini6410.c +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c @@ -18,6 +18,8 @@ #include <linux/kernel.h> #include <linux/list.h> #include <linux/dm9000.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> #include <linux/serial_core.h> #include <linux/types.h> @@ -32,6 +34,7 @@ #include <plat/cpu.h> #include <plat/devs.h> +#include <plat/nand.h> #include <plat/regs-serial.h> #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) @@ -103,11 +106,47 @@ static struct platform_device mini6410_device_eth = { }, }; +static struct mtd_partition mini6410_nand_part[] = { + [0] = { + .name = "uboot", + .size = SZ_1M, + .offset = 0, + }, + [1] = { + .name = "kernel", + .size = SZ_2M, + .offset = SZ_1M, + }, + [2] = { + .name = "rootfs", + .size = MTDPART_SIZ_FULL, + .offset = SZ_1M + SZ_2M, + }, +}; + +static struct s3c2410_nand_set mini6410_nand_sets[] = { + [0] = { + .name = "nand", + .nr_chips = 1, + .nr_partitions = ARRAY_SIZE(mini6410_nand_part), + .partitions = mini6410_nand_part, + }, +}; + +static struct s3c2410_platform_nand mini6410_nand_info = { + .tacls = 25, + .twrph0 = 55, + .twrph1 = 40, + .nr_sets = ARRAY_SIZE(mini6410_nand_sets), + .sets = mini6410_nand_sets, +}; + static struct platform_device *mini6410_devices[] __initdata = { &mini6410_device_eth, &s3c_device_hsmmc0, &s3c_device_hsmmc1, &s3c_device_ohci, + &s3c_device_nand, }; static void __init mini6410_map_io(void) @@ -121,6 +160,8 @@ static void __init mini6410_machine_init(void) { u32 cs1; + s3c_nand_set_platdata(&mini6410_nand_info); + /* configure nCS1 width to 16 bits */ cs1 = __raw_readl(S3C64XX_SROM_BW) & -- cgit v1.2.3-70-g09d2 From 2abca87cb691485fdff348c279e5a928e51ceb5d Mon Sep 17 00:00:00 2001 From: Darius Augulis <augulis.darius@gmail.com> Date: Tue, 19 Oct 2010 16:06:54 +0900 Subject: ARM: S3C64XX: add frame buffer support for mach-mini6410 Add support for frame buffer device for mach-mini6410. Patch also adds support for feature string parsing for mini6410. The feature string is kernel command line passed and currently lets select only LCD configuration. At the moment there is support for two LCD configurations - 4.3" and 7.0". Feature parser is mach-mini2440 based. Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- arch/arm/mach-s3c64xx/Kconfig | 2 + arch/arm/mach-s3c64xx/mach-mini6410.c | 129 ++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) (limited to 'arch/arm/mach-s3c64xx/Kconfig') diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 3bbd2045da5..b514e3a98fc 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -106,6 +106,8 @@ config MACH_MINI6410 select S3C64XX_SETUP_SDHCI select S3C_DEV_USB_HOST select S3C_DEV_NAND + select S3C_DEV_FB + select S3C64XX_SETUP_FB_24BPP help Machine support for the FriendlyARM MINI6410 diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c index d079ecf2350..441b71a9b19 100644 --- a/arch/arm/mach-s3c64xx/mach-mini6410.c +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c @@ -14,6 +14,7 @@ #include <linux/init.h> #include <linux/interrupt.h> +#include <linux/fb.h> #include <linux/gpio.h> #include <linux/kernel.h> #include <linux/list.h> @@ -28,12 +29,15 @@ #include <asm/mach/map.h> #include <mach/map.h> +#include <mach/regs-fb.h> #include <mach/regs-gpio.h> +#include <mach/regs-modem.h> #include <mach/regs-srom.h> #include <mach/s3c6410.h> #include <plat/cpu.h> #include <plat/devs.h> +#include <plat/fb.h> #include <plat/nand.h> #include <plat/regs-serial.h> @@ -141,26 +145,148 @@ static struct s3c2410_platform_nand mini6410_nand_info = { .sets = mini6410_nand_sets, }; +static struct s3c_fb_pd_win mini6410_fb_win[] = { + { + .win_mode = { /* 4.3" 480x272 */ + .left_margin = 3, + .right_margin = 2, + .upper_margin = 1, + .lower_margin = 1, + .hsync_len = 40, + .vsync_len = 1, + .xres = 480, + .yres = 272, + }, + .max_bpp = 32, + .default_bpp = 16, + }, { + .win_mode = { /* 7.0" 800x480 */ + .left_margin = 8, + .right_margin = 13, + .upper_margin = 7, + .lower_margin = 5, + .hsync_len = 3, + .vsync_len = 1, + .xres = 800, + .yres = 480, + }, + .max_bpp = 32, + .default_bpp = 16, + }, +}; + +static struct s3c_fb_platdata mini6410_lcd_pdata __initdata = { + .setup_gpio = s3c64xx_fb_gpio_setup_24bpp, + .win[0] = &mini6410_fb_win[0], + .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, + .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, +}; + static struct platform_device *mini6410_devices[] __initdata = { &mini6410_device_eth, &s3c_device_hsmmc0, &s3c_device_hsmmc1, &s3c_device_ohci, &s3c_device_nand, + &s3c_device_fb, }; static void __init mini6410_map_io(void) { + u32 tmp; + s3c64xx_init_io(NULL, 0); s3c24xx_init_clocks(12000000); s3c24xx_init_uarts(mini6410_uartcfgs, ARRAY_SIZE(mini6410_uartcfgs)); + + /* set the LCD type */ + tmp = __raw_readl(S3C64XX_SPCON); + tmp &= ~S3C64XX_SPCON_LCD_SEL_MASK; + tmp |= S3C64XX_SPCON_LCD_SEL_RGB; + __raw_writel(tmp, S3C64XX_SPCON); + + /* remove the LCD bypass */ + tmp = __raw_readl(S3C64XX_MODEM_MIFPCON); + tmp &= ~MIFPCON_LCD_BYPASS; + __raw_writel(tmp, S3C64XX_MODEM_MIFPCON); +} + +/* + * mini6410_features string + * + * 0-9 LCD configuration + * + */ +static char mini6410_features_str[12] __initdata = "0"; + +static int __init mini6410_features_setup(char *str) +{ + if (str) + strlcpy(mini6410_features_str, str, + sizeof(mini6410_features_str)); + return 1; +} + +__setup("mini6410=", mini6410_features_setup); + +#define FEATURE_SCREEN (1 << 0) + +struct mini6410_features_t { + int done; + int lcd_index; +}; + +static void mini6410_parse_features( + struct mini6410_features_t *features, + const char *features_str) +{ + const char *fp = features_str; + + features->done = 0; + features->lcd_index = 0; + + while (*fp) { + char f = *fp++; + + switch (f) { + case '0'...'9': /* tft screen */ + if (features->done & FEATURE_SCREEN) { + printk(KERN_INFO "MINI6410: '%c' ignored, " + "screen type already set\n", f); + } else { + int li = f - '0'; + if (li >= ARRAY_SIZE(mini6410_fb_win)) + printk(KERN_INFO "MINI6410: '%c' out " + "of range LCD mode\n", f); + else { + features->lcd_index = li; + } + } + features->done |= FEATURE_SCREEN; + break; + } + } } static void __init mini6410_machine_init(void) { u32 cs1; + struct mini6410_features_t features = { 0 }; + + printk(KERN_INFO "MINI6410: Option string mini6410=%s\n", + mini6410_features_str); + + /* Parse the feature string */ + mini6410_parse_features(&features, mini6410_features_str); + + mini6410_lcd_pdata.win[0] = &mini6410_fb_win[features.lcd_index]; + + printk(KERN_INFO "MINI6410: selected LCD display is %dx%d\n", + mini6410_lcd_pdata.win[0]->win_mode.xres, + mini6410_lcd_pdata.win[0]->win_mode.yres); s3c_nand_set_platdata(&mini6410_nand_info); + s3c_fb_set_platdata(&mini6410_lcd_pdata); /* configure nCS1 width to 16 bits */ @@ -182,6 +308,9 @@ static void __init mini6410_machine_init(void) (4 << S3C64XX_SROM_BCX__TCOS__SHIFT) | (0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1); + gpio_request(S3C64XX_GPF(15), "LCD power"); + gpio_request(S3C64XX_GPE(0), "LCD power"); + platform_add_devices(mini6410_devices, ARRAY_SIZE(mini6410_devices)); } -- cgit v1.2.3-70-g09d2 From fe894f97ad89951a7bdb150ad5645178b89fd6b7 Mon Sep 17 00:00:00 2001 From: Darius Augulis <augulis.darius@gmail.com> Date: Tue, 19 Oct 2010 16:10:02 +0900 Subject: ARM: S3C64XX: add touchscreen support for mach-mini6410 Add touchscreen device support for mach-mini6410 Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- arch/arm/mach-s3c64xx/Kconfig | 2 ++ arch/arm/mach-s3c64xx/mach-mini6410.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) (limited to 'arch/arm/mach-s3c64xx/Kconfig') diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index b514e3a98fc..fe1fd3007ae 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -108,6 +108,8 @@ config MACH_MINI6410 select S3C_DEV_NAND select S3C_DEV_FB select S3C64XX_SETUP_FB_24BPP + select SAMSUNG_DEV_ADC + select SAMSUNG_DEV_TS help Machine support for the FriendlyARM MINI6410 diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c index 0e3516ee108..249c6295647 100644 --- a/arch/arm/mach-s3c64xx/mach-mini6410.c +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c @@ -35,11 +35,14 @@ #include <mach/regs-srom.h> #include <mach/s3c6410.h> +#include <plat/adc.h> #include <plat/cpu.h> #include <plat/devs.h> #include <plat/fb.h> #include <plat/nand.h> #include <plat/regs-serial.h> +#include <plat/ts.h> + #include <video/platform_lcd.h> #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) @@ -202,6 +205,12 @@ static struct platform_device mini6410_lcd_powerdev = { .dev.platform_data = &mini6410_lcd_power_data, }; +static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = { + .delay = 10000, + .presc = 49, + .oversampling_shift = 2, +}; + static struct platform_device *mini6410_devices[] __initdata = { &mini6410_device_eth, &s3c_device_hsmmc0, @@ -210,6 +219,8 @@ static struct platform_device *mini6410_devices[] __initdata = { &s3c_device_nand, &s3c_device_fb, &mini6410_lcd_powerdev, + &s3c_device_adc, + &s3c_device_ts, }; static void __init mini6410_map_io(void) @@ -308,6 +319,7 @@ static void __init mini6410_machine_init(void) s3c_nand_set_platdata(&mini6410_nand_info); s3c_fb_set_platdata(&mini6410_lcd_pdata); + s3c24xx_ts_set_platdata(&s3c_ts_platform); /* configure nCS1 width to 16 bits */ -- cgit v1.2.3-70-g09d2