From 9adb15b80bf1dc6b30a584e76efc876dfd029a13 Mon Sep 17 00:00:00 2001 From: Thomas Abraham Date: Tue, 8 Sep 2009 14:26:00 +0900 Subject: [PATCH 1/8] ARM: S3C6410: use correct divider_shift in setrate_clksrc() In s3c64xx_setrate_clksrc() we used sclk->shift, but actually need to use sclk->divider_shift to correctly calculate the value for the divider register. Signed-off-by: Thomas Abraham [ben-linux@fluff.org: Minor re-indentation of description] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/s3c6400-clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c index febac1950d8e..c972d2f8c271 100644 --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c @@ -302,8 +302,8 @@ static int s3c64xx_setrate_clksrc(struct clk *clk, unsigned long rate) return -EINVAL; val = __raw_readl(reg); - val &= ~(0xf << sclk->shift); - val |= (div - 1) << sclk->shift; + val &= ~(0xf << sclk->divider_shift); + val |= (div - 1) << sclk->divider_shift; __raw_writel(val, reg); return 0; From 6d025ac2fcf9d736ee399efddae74a3362dfa7da Mon Sep 17 00:00:00 2001 From: Thomas Abraham Date: Tue, 8 Sep 2009 14:30:48 +0900 Subject: [PATCH 2/8] ARM: S3C6410: update clk->parent when setting clock source This ensures the clock hierarchy data structures are updated when we change the clock source in the actual hardware registers. Signed-off-by: Thomas Abraham [ben-linux@fluff.org: Minor re-indentation of subject] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/s3c6400-clock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c index c972d2f8c271..54eef9326c21 100644 --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c @@ -328,6 +328,8 @@ static int s3c64xx_setparent_clksrc(struct clk *clk, struct clk *parent) clksrc |= src_nr << sclk->shift; __raw_writel(clksrc, S3C_CLK_SRC); + + clk->parent = parent; return 0; } From 5e49bc4d9e982bbfdaf7d6cf8bd96e43bd9f7db6 Mon Sep 17 00:00:00 2001 From: Thomas Abraham Date: Tue, 8 Sep 2009 14:35:29 +0900 Subject: [PATCH 3/8] ARM: S3C64XX: Fix divider value calculation in s3c64xx_roundrate_clksrc In s3c64xx_roundrate_clksrc function, the calculation is wrong. This patch fixes this calculation. Signed-off-by: Thomas Abraham Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/s3c6400-clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c index 54eef9326c21..9745852261e0 100644 --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c @@ -345,7 +345,7 @@ static unsigned long s3c64xx_roundrate_clksrc(struct clk *clk, if (rate > parent_rate) rate = parent_rate; else { - div = rate / parent_rate; + div = parent_rate / rate; if (div == 0) div = 1; From 23c94b47be85207a8a9e0ac3ac89b16edf6356f0 Mon Sep 17 00:00:00 2001 From: Jassi Date: Tue, 15 Sep 2009 19:01:18 +0900 Subject: [PATCH 4/8] ARM: S3C64XX: DMA: struct s3c64xx_dma_buff lli fix. Correct the lli structure in struct s3c64xx_dma_buff which should have been 'struct pl080s_lli' (samsung specific) instead of the generic version 'struct pl080_lli' Signed-Off-by: Jassi [ben-linux@fluff.org: Edited description and subject fields] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/include/plat/dma-plat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/plat-s3c64xx/include/plat/dma-plat.h b/arch/arm/plat-s3c64xx/include/plat/dma-plat.h index 0c30dd986725..8f76a1e474d6 100644 --- a/arch/arm/plat-s3c64xx/include/plat/dma-plat.h +++ b/arch/arm/plat-s3c64xx/include/plat/dma-plat.h @@ -26,7 +26,7 @@ struct s3c64xx_dma_buff { struct s3c64xx_dma_buff *next; void *pw; - struct pl080_lli *lli; + struct pl080s_lli *lli; dma_addr_t lli_dma; }; From 3ea61e49223c499c705b80ea385cb4df9c08da21 Mon Sep 17 00:00:00 2001 From: Jassi Date: Tue, 15 Sep 2009 19:01:19 +0900 Subject: [PATCH 5/8] ARM: S3C64XX: DMA: 'size' argument of dma_pool_create Provide actual minimum(struct pl080s_lli) size of block to dma_pool_create call, instead of hardcoded 32 bytes. Signed-Off-by: Jassi Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/plat-s3c64xx/dma.c index 67aa93dbb69e..b26d2a242d9e 100644 --- a/arch/arm/plat-s3c64xx/dma.c +++ b/arch/arm/plat-s3c64xx/dma.c @@ -697,7 +697,7 @@ static int __init s3c64xx_dma_init(void) printk(KERN_INFO "%s: Registering DMA channels\n", __func__); - dma_pool = dma_pool_create("DMA-LLI", NULL, 32, 16, 0); + dma_pool = dma_pool_create("DMA-LLI", NULL, sizeof(struct pl080s_lli), 16, 0); if (!dma_pool) { printk(KERN_ERR "%s: failed to create pool\n", __func__); return -ENOMEM; From b93011e72c1476b08ff62977ecf648080ba38c1a Mon Sep 17 00:00:00 2001 From: Jassi Date: Tue, 15 Sep 2009 19:01:20 +0900 Subject: [PATCH 6/8] ARM: S3C64XX: DMA: Debugged alloc's with GFP_KERNEL flag in Intr context. s3c2410_dma_enqueue makes call to kzalloc and dma_pool_alloc with GFP_KERNEL flag set, this can be an issue for drivers, like I2S, which call s3c2410_dma_enqueue from dma-bufferdone callback. Change the flag GFP_KERNEL to GFP_ATOMIC to avoid any problems. Signed-Off-by: Jassi [ben-linux@fluff.org: Minor description edit and re-wrap] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/plat-s3c64xx/dma.c index b26d2a242d9e..266a10745a85 100644 --- a/arch/arm/plat-s3c64xx/dma.c +++ b/arch/arm/plat-s3c64xx/dma.c @@ -345,13 +345,13 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id, if (!chan) return -EINVAL; - buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_KERNEL); + buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_ATOMIC); if (!buff) { printk(KERN_ERR "%s: no memory for buffer\n", __func__); return -ENOMEM; } - lli = dma_pool_alloc(dma_pool, GFP_KERNEL, &buff->lli_dma); + lli = dma_pool_alloc(dma_pool, GFP_ATOMIC, &buff->lli_dma); if (!lli) { printk(KERN_ERR "%s: no memory for lli\n", __func__); ret = -ENOMEM; From ebdb5ab81c6b9fda130975d50fd6f43cb15c4ce6 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 6 Jul 2009 14:57:48 +0100 Subject: [PATCH 7/8] ARM: S3C64XX: Provide for board-specific IRQs Set up some IRQ space to allocation to off-SoC interrupt controllers. Default this to 16 IRQs. If individual boards require more than this then they will need to modify this file so allocating a small number helps reduce the number of modifications required. Signed-off-by: Mark Brown Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/include/plat/irqs.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/plat-s3c64xx/include/plat/irqs.h b/arch/arm/plat-s3c64xx/include/plat/irqs.h index 743a70094d04..7956fd3bb194 100644 --- a/arch/arm/plat-s3c64xx/include/plat/irqs.h +++ b/arch/arm/plat-s3c64xx/include/plat/irqs.h @@ -194,9 +194,17 @@ #define IRQ_EINT_GROUP(group, no) (IRQ_EINT_GROUP##group##_BASE + (no)) +/* Define a group of interrupts for board-specific use (eg, for MFD + * interrupt controllers). */ +#define IRQ_BOARD_START (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1) + +#define IRQ_BOARD_NR 16 + +#define IRQ_BOARD_END (IRQ_BOARD_START + IRQ_BOARD_NR) + /* Set the default NR_IRQS */ -#define NR_IRQS (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1) +#define NR_IRQS (IRQ_BOARD_END + 1) #endif /* __ASM_PLAT_S3C64XX_IRQS_H */ From d23b3517400e4638e76e8c8667c100721c6f03fe Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 17 Sep 2009 00:01:54 +0100 Subject: [PATCH 8/8] ARM: S3C: Add missing selection of S3C_DEV_NAND in machine Kconfigs. A number of machines that need s3c_device_nand present do not select this in their Kconfig entries. Add the necessary selection of the configuration S3C_DEV_NAND so that we avoid the following error: arch/arm/mach-s3c2410/built-in.o: In function `bast_map_io': arch/arm/mach-s3c2410/mach-bast.c:634: undefined reference to `s3c_device_nand' arch/arm/mach-s3c2412/built-in.o: In function `s3c2412_init_uarts': arch/arm/mach-s3c2412/s3c2412.c:109: undefined reference to `s3c_device_nand' arch/arm/mach-s3c2412/built-in.o: In function `jive_machine_init': arch/arm/mach-s3c2412/mach-jive.c:673: undefined reference to `s3c_device_nand' Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2410/Kconfig | 5 +++++ arch/arm/mach-s3c2412/Kconfig | 3 +++ arch/arm/mach-s3c2440/Kconfig | 6 ++++++ arch/arm/mach-s3c6400/Kconfig | 1 + arch/arm/mach-s3c6410/Kconfig | 1 + 5 files changed, 16 insertions(+) diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig index d8c023d4df30..3d4e9da3fa52 100644 --- a/arch/arm/mach-s3c2410/Kconfig +++ b/arch/arm/mach-s3c2410/Kconfig @@ -77,6 +77,7 @@ config ARCH_H1940 select CPU_S3C2410 select PM_H1940 if PM select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using the HP IPAQ H1940 @@ -89,6 +90,7 @@ config MACH_N30 bool "Acer N30 family" select CPU_S3C2410 select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you want suppt for the Acer N30, Acer N35, Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs. @@ -103,6 +105,7 @@ config ARCH_BAST select S3C24XX_DCLK select ISA select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using the Simtec Electronics EB2410ITX development board (also known as BAST) @@ -111,6 +114,7 @@ config MACH_OTOM bool "NexVision OTOM Board" select CPU_S3C2410 select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using the Nex Vision OTOM board @@ -154,6 +158,7 @@ config MACH_QT2410 bool "QT2410" select CPU_S3C2410 select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using the Armzone QT2410 diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig index 35c1bde89cf2..c2bdc4635d12 100644 --- a/arch/arm/mach-s3c2412/Kconfig +++ b/arch/arm/mach-s3c2412/Kconfig @@ -48,6 +48,7 @@ config MACH_JIVE bool "Logitech Jive" select CPU_S3C2412 select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using the Logitech Jive. @@ -61,6 +62,7 @@ config MACH_SMDK2413 select MACH_S3C2413 select MACH_SMDK select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using an SMDK2413 @@ -84,6 +86,7 @@ config MACH_VSTMS bool "VMSTMS" select CPU_S3C2412 select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using an VSTMS board diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig index 8ae1b288f7fa..d7bba919a77e 100644 --- a/arch/arm/mach-s3c2440/Kconfig +++ b/arch/arm/mach-s3c2440/Kconfig @@ -48,6 +48,7 @@ config MACH_OSIRIS select S3C2440_XTAL_12000000 select S3C2410_IOTIMING if S3C2440_CPUFREQ select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using the Simtec IM2440D20 module, also known as the Osiris. @@ -57,6 +58,7 @@ config MACH_RX3715 select CPU_S3C2440 select S3C2440_XTAL_16934400 select PM_H1940 if PM + select S3C_DEV_NAND help Say Y here if you are using the HP iPAQ rx3715. @@ -66,6 +68,7 @@ config ARCH_S3C2440 select S3C2440_XTAL_16934400 select MACH_SMDK select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using the SMDK2440. @@ -74,6 +77,7 @@ config MACH_NEXCODER_2440 select CPU_S3C2440 select S3C2440_XTAL_12000000 select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board @@ -88,6 +92,7 @@ config MACH_AT2440EVB bool "Avantech AT2440EVB development board" select CPU_S3C2440 select S3C_DEV_USB_HOST + select S3C_DEV_NAND help Say Y here if you are using the AT2440EVB development board @@ -97,6 +102,7 @@ config MACH_MINI2440 select EEPROM_AT24 select LEDS_TRIGGER_BACKLIGHT select SND_S3C24XX_SOC_S3C24XX_UDA134X + select S3C_DEV_NAND help Say Y here to select support for the MINI2440. Is a 10cm x 10cm board available via various sources. It can come with a 3.5" or 7" touch LCD. diff --git a/arch/arm/mach-s3c6400/Kconfig b/arch/arm/mach-s3c6400/Kconfig index f5af212066c3..770b72067e3d 100644 --- a/arch/arm/mach-s3c6400/Kconfig +++ b/arch/arm/mach-s3c6400/Kconfig @@ -26,6 +26,7 @@ config MACH_SMDK6400 bool "SMDK6400" select CPU_S3C6400 select S3C_DEV_HSMMC + select S3C_DEV_NAND select S3C6400_SETUP_SDHCI help Machine support for the Samsung SMDK6400 diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index f9d0f09f9761..53fc3ff657f7 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig @@ -102,6 +102,7 @@ config MACH_HMT bool "Airgoo HMT" select CPU_S3C6410 select S3C_DEV_FB + select S3C_DEV_NAND select S3C_DEV_USB_HOST select S3C64XX_SETUP_FB_24BPP select HAVE_PWM