Update Samsung S5PC100 SoC support
Subsystems (6)
PATCH 1/1 Update Samsung S5PC100 SoC support
Hello,
This patch series updates Samsung S5PC100 SoC support. S5PC100 platform core has been extended with new clocks hierarchy implementation, gpio lib, support for external and gpio interrupts and some basics of power management (cpu idle and system reset). Also platform helpers for s3c framebuffer, i2c and hsmmc drivers has been added.
All these patches has been tested on SMDKC100 board.
This patch series has been prepared against latest ARM Kernel tree from
http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm.git/
This is a second version of this patch series. I've tried to address all the issues reported here on the mailing list.
This patch series includes:
[PATCH 01/18] ARM: MM: use 64bytes of L1 cache on plat S5PC1xx
[PATCH 02/18] ARM: S5PC1XX: registers rename
[PATCH 03/18] ARM: S5PC1XX: clock registers rename
[PATCH 04/18] ARM: S5PC1XX: clocks reimplementation
[PATCH 05/18] ARM: S5PC1XX: add GPIO L banks to register definition [PATCH 06/18] ARM: S5PC1XX: GPIO registers rename
[PATCH 07/18] ARM: S5PC1xx: add gpiolib and external/gpio interrupt support [PATCH 08/18] ARM: S5PC1XX: add cpu idle and system reset support [PATCH 09/18] ARM: S3C: Prepare s3c64xx-specific s3c-fb register definition for reuse [PATCH 10/18] ARM: S5PC1xx: add platform helpers for s3c-fb device [PATCH 11/18] SMDKC100: enable S3C FrameBuffer
[PATCH 12/18] drivers: fb: enable S3C FrameBuffer on S5PC1XX platform [PATCH 13/18] ARM: S5PC1xx: add platform helpers for i2c adapter devices [PATCH 14/18] SMDKC100: add I2C0 and I2C1 buses support
[PATCH 15/18] drivers: i2c: s3c2410-i2c also on S5PC1XX platform
[PATCH 16/18] ARM: S5PC1xx: add platform helpers for SDHCI host controllers [PATCH 17/18] SMDKC100: add SDHCI controllers 0, 1 and 2 support
[PATCH 18/18] drivers: MMC: enable SDHCI-S3C on S5PC1XX platform
PATCH 1/18 ARM: MM: use 64bytes of L1 cache on plat S5PC1xx
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Samsung S5PC1xx SoCs are Coretex8 based, so use 64 bytes of L1 cache line instead of the default 32 bytes.
--- arch/arm/mm/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mm/Kconfig +1 -1
@@ -774,5 +774,5 @@ config CACHE_XSC3L2 config ARM_L1_CACHE_SHIFT int - default 6 if ARCH_OMAP3 + default 6 if ARCH_OMAP3 || ARCH_S5PC1XX default 5
Signature · 1 line
1.6.5
PATCH 2/18 ARM: S5PC1XX: registers rename
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
S5PC110 and S5PC100 register maps differs in many places, rename all defined registers to be S5PC100 specific. PA_SYS register known from S3C64XX series has been renamed to more adequate PA_CLK. Also system map has been also updated to cover more integrated peripherals.
--- arch/arm/mach-s5pc100/include/mach/map.h | 87 +++++++++++++++++++++++++++-- arch/arm/mach-s5pc100/mach-smdkc100.c | 4 +- 2 files changed, 83 insertions(+), 8 deletions(-)
arch/arm/mach-s5pc100/include/mach/map.h +81 -6
@@ -17,6 +17,19 @@#include <plat/map-base.h> +/* +* map-base.h has already defined virtual memory address +* S3C_VA_IRQ S3C_ADDR(0x00000000) irq controller(s) +* S3C_VA_SYS S3C_ADDR(0x00100000) system control +* S3C_VA_MEM S3C_ADDR(0x00200000) system control (not used) +* S3C_VA_TIMER S3C_ADDR(0x00300000) timer block +* S3C_VA_WATCHDOG S3C_ADDR(0x00400000) watchdog +* S3C_VA_UART S3C_ADDR(0x01000000) UART +* +* S5PC100 specific virtual memory address can be defined here +* S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) GPIO +* +*/ /* Chip ID */ #define S5PC100_PA_CHIPID (0xE0000000)
@@ -24,13 +37,20 @@#define S5PC1XX_VA_CHIPID S3C_VA_SYS/* System */ -#define S5PC100_PA_SYS (0xE0100000) -#define S5PC100_PA_CLK (S5PC100_PA_SYS + 0x0) -#define S5PC100_PA_PWR (S5PC100_PA_SYS + 0x8000) +#define S5PC100_PA_CLK (0xE0100000) +#define S5PC100_PA_CLK_OTHER (0xE0200000) +#define S5PC100_PA_PWR (0xE0108000)#define S5PC1XX_PA_CLK S5PC100_PA_CLK#define S5PC1XX_PA_PWR S5PC100_PA_PWR +#define S5PC1XX_PA_CLK_OTHER S5PC100_PA_CLK_OTHER#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000)#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000) +#define S5PC1XX_VA_CLK_OTHER (S3C_VA_SYS + 0x30000) + +/* GPIO */ +#define S5PC100_PA_GPIO (0xE0300000) +#define S5PC1XX_PA_GPIO S5PC100_PA_GPIO +#define S5PC1XX_VA_GPIO S3C_ADDR(0x00500000)/* Interrupt */ #define S5PC100_PA_VIC (0xE4000000)
@@ -40,23 +60,64 @@#define S5PC1XX_PA_VIC (x) (S5PC100_PA_VIC + ((x) * S5PC100_PA_VIC_OFFSET))#define S5PC1XX_VA_VIC (x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET)) +/* DMA */ +#define S5PC100_PA_MDMA (0xE8100000) +#define S5PC100_PA_PDMA0 (0xE9000000) +#define S5PC100_PA_PDMA1 (0xE9200000) +/* Timer */ #define S5PC100_PA_TIMER (0xEA000000)#define S5PC1XX_PA_TIMER S5PC100_PA_TIMER#define S5PC1XX_VA_TIMER S3C_VA_TIMER +/* RTC */ +#define S5PC100_PA_RTC (0xEA300000) +/* UART */ #define S5PC100_PA_UART (0xEC000000)#define S5PC1XX_PA_UART S5PC100_PA_UART#define S5PC1XX_VA_UART S3C_VA_UART -/* IIC */ -#define S5PC100_PA_IIC (0xEC100000) +/* I2C */ +#define S5PC100_PA_I2C (0xEC100000) +#define S5PC100_PA_I2C1 (0xEC200000) + +/* USB HS OTG */ +#define S5PC100_PA_USB_HSOTG (0xED200000) +#define S5PC100_PA_USB_HSPHY (0xED300000) + +/* SD/MMC */ +#define S5PC100_PA_HSMMC (x) (0xED800000 + ((x) * 0x100000)) +#define S5PC100_PA_HSMMC0 S5PC100_PA_HSMMC(0) +#define S5PC100_PA_HSMMC1 S5PC100_PA_HSMMC(1) +#define S5PC100_PA_HSMMC2 S5PC100_PA_HSMMC(2) + +/* LCD */ +#define S5PC100_PA_FB (0xEE000000) + +/* Multimedia */ +#define S5PC100_PA_G2D (0xEE800000) +#define S5PC100_PA_JPEG (0xEE500000) +#define S5PC100_PA_ROTATOR (0xEE100000) +#define S5PC100_PA_G3D (0xEF000000) + +/* I2S */ +#define S5PC100_PA_I2S0 (0xF2000000) +#define S5PC100_PA_I2S1 (0xF2100000) +#define S5PC100_PA_I2S2 (0xF2200000) + +/* KEYPAD */ +#define S5PC100_PA_KEYPAD (0xF3100000) + +/* ADC & TouchScreen */ +#define S5PC100_PA_TSADC (0xF3000000)/* ETC */ #define S5PC100_PA_SDRAM (0x20000000) +#define S5PC1XX_PA_SDRAM S5PC100_PA_SDRAM/* compatibility defines. */ +#define S3C_PA_RTC S5PC100_PA_RTC#define S3C_PA_UART S5PC100_PA_UART#define S3C_PA_UART0 (S5PC100_PA_UART + 0x0)#define S3C_PA_UART1 (S5PC100_PA_UART + 0x400)
@@ -67,9 +128,23 @@#define S3C_VA_UART2 (S3C_VA_UART + 0x800)#define S3C_VA_UART3 (S3C_VA_UART + 0xC00)#define S3C_UART_OFFSET 0x400 +#define S3C_VA_UARTx (x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) +#define S3C_PA_FB S5PC100_PA_FB +#define S3C_PA_G2D S5PC100_PA_G2D +#define S3C_PA_G3D S5PC100_PA_G3D +#define S3C_PA_JPEG S5PC100_PA_JPEG +#define S3C_PA_ROTATOR S5PC100_PA_ROTATOR#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0)#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000)#define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000) -#define S3C_PA_IIC S5PC100_PA_IIC +#define S3C_PA_IIC S5PC100_PA_I2C +#define S3C_PA_IIC1 S5PC100_PA_I2C1 +#define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG +#define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY +#define S3C_PA_HSMMC0 S5PC100_PA_HSMMC0 +#define S3C_PA_HSMMC1 S5PC100_PA_HSMMC1 +#define S3C_PA_HSMMC2 S5PC100_PA_HSMMC2 +#define S3C_PA_KEYPAD S5PC100_PA_KEYPAD +#define S3C_PA_TSADC S5PC100_PA_TSADC#endif /* __ASM_ARCH_C100_MAP_H */
arch/arm/mach-s5pc100/mach-smdkc100.c +2 -2
@@ -92,9 +92,9 @@ static void __init smdkc100_machine_init(void)MACHINE_START (SMDKC100 ,"SMDKC100" )/* Maintainer: Byungho Min <[email protected]> */ - .phys_io = S5PC1XX_PA_UART & 0xfff00000, + .phys_io = S5PC100_PA_UART & 0xfff00000, .io_pg_offst = (((u32)S5PC1XX_VA_UART) >> 18) & 0xfffc, - .boot_params = S5PC100_PA_SDRAM + 0x100, + .boot_params = S5PC1XX_PA_SDRAM + 0x100, .init_irq = s5pc100_init_irq, .map_io = smdkc100_map_io,
Signature · 1 line
1.6.5
PATCH 3/18 ARM: S5PC1XX: clock registers rename
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
S5PC100 and S5PC110 clock registers differs in many places, rename all previously defined registers to be S5PC100 specific. Remove all power management registers. They will be added later to a separate file.
--- arch/arm/plat-s5pc1xx/include/plat/regs-clock.h | 212 ++++++++--------------- arch/arm/plat-s5pc1xx/s5pc100-clock.c | 44 +++--- 2 files changed, 97 insertions(+), 159 deletions(-)
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +75 -137
@@ -13,68 +13,69 @@#ifndef __PLAT_REGS_CLOCK_H#define __PLAT_REGS_CLOCK_H __FILE__ -#define S5PC1XX_CLKREG (x) (S5PC1XX_VA_CLK + (x)) - -#define S5PC1XX_APLL_LOCK S5PC1XX_CLKREG(0x00) -#define S5PC1XX_MPLL_LOCK S5PC1XX_CLKREG(0x04) -#define S5PC1XX_EPLL_LOCK S5PC1XX_CLKREG(0x08) -#define S5PC100_HPLL_LOCK S5PC1XX_CLKREG(0x0C) - -#define S5PC1XX_APLL_CON S5PC1XX_CLKREG(0x100) -#define S5PC1XX_MPLL_CON S5PC1XX_CLKREG(0x104) -#define S5PC1XX_EPLL_CON S5PC1XX_CLKREG(0x108) -#define S5PC100_HPLL_CON S5PC1XX_CLKREG(0x10C) - -#define S5PC1XX_CLK_SRC0 S5PC1XX_CLKREG(0x200) -#define S5PC1XX_CLK_SRC1 S5PC1XX_CLKREG(0x204) -#define S5PC1XX_CLK_SRC2 S5PC1XX_CLKREG(0x208) -#define S5PC1XX_CLK_SRC3 S5PC1XX_CLKREG(0x20C) - -#define S5PC1XX_CLK_DIV0 S5PC1XX_CLKREG(0x300) -#define S5PC1XX_CLK_DIV1 S5PC1XX_CLKREG(0x304) -#define S5PC1XX_CLK_DIV2 S5PC1XX_CLKREG(0x308) -#define S5PC1XX_CLK_DIV3 S5PC1XX_CLKREG(0x30C) -#define S5PC1XX_CLK_DIV4 S5PC1XX_CLKREG(0x310) - -#define S5PC100_CLK_OUT S5PC1XX_CLKREG(0x400) - -#define S5PC100_CLKGATE_D00 S5PC1XX_CLKREG(0x500) -#define S5PC100_CLKGATE_D01 S5PC1XX_CLKREG(0x504) -#define S5PC100_CLKGATE_D02 S5PC1XX_CLKREG(0x508) - -#define S5PC100_CLKGATE_D10 S5PC1XX_CLKREG(0x520) -#define S5PC100_CLKGATE_D11 S5PC1XX_CLKREG(0x524) -#define S5PC100_CLKGATE_D12 S5PC1XX_CLKREG(0x528) -#define S5PC100_CLKGATE_D13 S5PC1XX_CLKREG(0x52C) -#define S5PC100_CLKGATE_D14 S5PC1XX_CLKREG(0x530) -#define S5PC100_CLKGATE_D15 S5PC1XX_CLKREG(0x534) - -#define S5PC100_CLKGATE_D20 S5PC1XX_CLKREG(0x540) - -#define S5PC100_SCLKGATE0 S5PC1XX_CLKREG(0x560) -#define S5PC100_SCLKGATE1 S5PC1XX_CLKREG(0x564) - -#define S5PC100_OTHERS S5PC1XX_CLKREG(0x8200) - -#define S5PC1XX_EPLL_EN (1<<31) -#define S5PC1XX_EPLL_MASK 0xffffffff -#define S5PC1XX_EPLLVAL (_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s))) +#define S5PC100_CLKREG (x) (S5PC1XX_VA_CLK + (x)) +#define S5PC100_CLKREG_OTHER (x) (S5PC1XX_VA_CLK_OTHER + (x)) + +/* s5pc100 register for clock */ +#define S5PC100_APLL_LOCK S5PC100_CLKREG(0x00) +#define S5PC100_MPLL_LOCK S5PC100_CLKREG(0x04) +#define S5PC100_EPLL_LOCK S5PC100_CLKREG(0x08) +#define S5PC100_HPLL_LOCK S5PC100_CLKREG(0x0C) + +#define S5PC100_APLL_CON S5PC100_CLKREG(0x100) +#define S5PC100_MPLL_CON S5PC100_CLKREG(0x104) +#define S5PC100_EPLL_CON S5PC100_CLKREG(0x108) +#define S5PC100_HPLL_CON S5PC100_CLKREG(0x10C) + +#define S5PC100_CLKSRC0 S5PC100_CLKREG(0x200) +#define S5PC100_CLKSRC1 S5PC100_CLKREG(0x204) +#define S5PC100_CLKSRC2 S5PC100_CLKREG(0x208) +#define S5PC100_CLKSRC3 S5PC100_CLKREG(0x20C) + +#define S5PC100_CLKDIV0 S5PC100_CLKREG(0x300) +#define S5PC100_CLKDIV1 S5PC100_CLKREG(0x304) +#define S5PC100_CLKDIV2 S5PC100_CLKREG(0x308) +#define S5PC100_CLKDIV3 S5PC100_CLKREG(0x30C) +#define S5PC100_CLKDIV4 S5PC100_CLKREG(0x310) + +#define S5PC100_CLK_OUT S5PC100_CLKREG(0x400) + +#define S5PC100_CLKGATE_D00 S5PC100_CLKREG(0x500) +#define S5PC100_CLKGATE_D01 S5PC100_CLKREG(0x504) +#define S5PC100_CLKGATE_D02 S5PC100_CLKREG(0x508) + +#define S5PC100_CLKGATE_D10 S5PC100_CLKREG(0x520) +#define S5PC100_CLKGATE_D11 S5PC100_CLKREG(0x524) +#define S5PC100_CLKGATE_D12 S5PC100_CLKREG(0x528) +#define S5PC100_CLKGATE_D13 S5PC100_CLKREG(0x52C) +#define S5PC100_CLKGATE_D14 S5PC100_CLKREG(0x530) +#define S5PC100_CLKGATE_D15 S5PC100_CLKREG(0x534) + +#define S5PC100_CLKGATE_D20 S5PC100_CLKREG(0x540) + +#define S5PC100_SCLKGATE0 S5PC100_CLKREG(0x560) +#define S5PC100_SCLKGATE1 S5PC100_CLKREG(0x564) + +/* EPLL_CON */ +#define S5PC100_EPLL_EN (1<<31) +#define S5PC100_EPLL_MASK 0xffffffff +#define S5PC100_EPLLVAL (_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s)))/* CLKSRC0 */ -#define S5PC1XX_CLKSRC0_APLL_MASK (0x1<<0) -#define S5PC1XX_CLKSRC0_APLL_SHIFT (0) -#define S5PC1XX_CLKSRC0_MPLL_MASK (0x1<<4) -#define S5PC1XX_CLKSRC0_MPLL_SHIFT (4) -#define S5PC1XX_CLKSRC0_EPLL_MASK (0x1<<8) -#define S5PC1XX_CLKSRC0_EPLL_SHIFT (8) +#define S5PC100_CLKSRC0_APLL_MASK (0x1<<0) +#define S5PC100_CLKSRC0_APLL_SHIFT (0) +#define S5PC100_CLKSRC0_MPLL_MASK (0x1<<4) +#define S5PC100_CLKSRC0_MPLL_SHIFT (4) +#define S5PC100_CLKSRC0_EPLL_MASK (0x1<<8) +#define S5PC100_CLKSRC0_EPLL_SHIFT (8)#define S5PC100_CLKSRC0_HPLL_MASK (0x1<<12)#define S5PC100_CLKSRC0_HPLL_SHIFT (12)#define S5PC100_CLKSRC0_AMMUX_MASK (0x1<<16)#define S5PC100_CLKSRC0_AMMUX_SHIFT (16)#define S5PC100_CLKSRC0_HREF_MASK (0x1<<20)#define S5PC100_CLKSRC0_HREF_SHIFT (20) -#define S5PC1XX_CLKSRC0_ONENAND_MASK (0x1<<24) -#define S5PC1XX_CLKSRC0_ONENAND_SHIFT (24) +#define S5PC100_CLKSRC0_ONENAND_MASK (0x1<<24) +#define S5PC100_CLKSRC0_ONENAND_SHIFT (24)/* CLKSRC1 */
@@ -127,10 +128,9 @@#define S5PC100_CLKSRC3_SPDIF_MASK (0x3<<24)#define S5PC100_CLKSRC3_SPDIF_SHIFT (24) -/* CLKDIV0 */ -#define S5PC1XX_CLKDIV0_APLL_MASK (0x1<<0) -#define S5PC1XX_CLKDIV0_APLL_SHIFT (0) +#define S5PC100_CLKDIV0_APLL_MASK (0x1<<0) +#define S5PC100_CLKDIV0_APLL_SHIFT (0)#define S5PC100_CLKDIV0_ARM_MASK (0x7<<4)#define S5PC100_CLKDIV0_ARM_SHIFT (4)#define S5PC100_CLKDIV0_D0_MASK (0x7<<8)
@@ -141,8 +141,8 @@#define S5PC100_CLKDIV0_SECSS_SHIFT (16)/* CLKDIV1 */ -#define S5PC100_CLKDIV1_AM_MASK (0x7<<0) -#define S5PC100_CLKDIV1_AM_SHIFT (0) +#define S5PC100_CLKDIV1_APLL2_MASK (0x7<<0) +#define S5PC100_CLKDIV1_APLL2_SHIFT (0)#define S5PC100_CLKDIV1_MPLL_MASK (0x3<<4)#define S5PC100_CLKDIV1_MPLL_SHIFT (4)#define S5PC100_CLKDIV1_MPLL2_MASK (0x1<<8)
@@ -202,7 +202,6 @@#define S5PC100_CLKDIV4_AUDIO2_MASK (0xf<<20)#define S5PC100_CLKDIV4_AUDIO2_SHIFT (20) -/* HCLKD0/PCLKD0 Clock Gate 0 Registers */ #define S5PC100_CLKGATE_D00_INTC (1<<0)#define S5PC100_CLKGATE_D00_TZIC (1<<1)
@@ -295,8 +294,8 @@#define S5PC100_CLKGATE_D20_I2SD2 (1<<1)/* Special Clock Gate 0 Registers */ -#define S5PC1XX_CLKGATE_SCLK0_HPM (1<<0) -#define S5PC1XX_CLKGATE_SCLK0_PWI (1<<1) +#define S5PC100_CLKGATE_SCLK0_HPM (1<<0) +#define S5PC100_CLKGATE_SCLK0_PWI (1<<1)#define S5PC100_CLKGATE_SCLK0_ONENAND (1<<2)#define S5PC100_CLKGATE_SCLK0_UART (1<<3)#define S5PC100_CLKGATE_SCLK0_SPI0 (1<<4)
@@ -329,89 +328,28 @@#define S5PC100_CLKGATE_SCLK1_SPDIF (1<<11)#define S5PC100_CLKGATE_SCLK1_CAM (1<<12) -/* register for power management */ -#define S5PC100_PWR_CFG S5PC1XX_CLKREG(0x8000) -#define S5PC100_EINT_WAKEUP_MASK S5PC1XX_CLKREG(0x8004) -#define S5PC100_NORMAL_CFG S5PC1XX_CLKREG(0x8010) -#define S5PC100_STOP_CFG S5PC1XX_CLKREG(0x8014) -#define S5PC100_SLEEP_CFG S5PC1XX_CLKREG(0x8018) -#define S5PC100_STOP_MEM_CFG S5PC1XX_CLKREG(0x801C) -#define S5PC100_OSC_FREQ S5PC1XX_CLKREG(0x8100) -#define S5PC100_OSC_STABLE S5PC1XX_CLKREG(0x8104) -#define S5PC100_PWR_STABLE S5PC1XX_CLKREG(0x8108) -#define S5PC100_MTC_STABLE S5PC1XX_CLKREG(0x8110) -#define S5PC100_CLAMP_STABLE S5PC1XX_CLKREG(0x8114) -#define S5PC100_OTHERS S5PC1XX_CLKREG(0x8200) -#define S5PC100_RST_STAT S5PC1XX_CLKREG(0x8300) -#define S5PC100_WAKEUP_STAT S5PC1XX_CLKREG(0x8304) -#define S5PC100_BLK_PWR_STAT S5PC1XX_CLKREG(0x8308) -#define S5PC100_INFORM0 S5PC1XX_CLKREG(0x8400) -#define S5PC100_INFORM1 S5PC1XX_CLKREG(0x8404) -#define S5PC100_INFORM2 S5PC1XX_CLKREG(0x8408) -#define S5PC100_INFORM3 S5PC1XX_CLKREG(0x840C) -#define S5PC100_INFORM4 S5PC1XX_CLKREG(0x8410) -#define S5PC100_INFORM5 S5PC1XX_CLKREG(0x8414) -#define S5PC100_INFORM6 S5PC1XX_CLKREG(0x8418) -#define S5PC100_INFORM7 S5PC1XX_CLKREG(0x841C) -#define S5PC100_DCGIDX_MAP0 S5PC1XX_CLKREG(0x8500) -#define S5PC100_DCGIDX_MAP1 S5PC1XX_CLKREG(0x8504) -#define S5PC100_DCGIDX_MAP2 S5PC1XX_CLKREG(0x8508) -#define S5PC100_DCGPERF_MAP0 S5PC1XX_CLKREG(0x850C) -#define S5PC100_DCGPERF_MAP1 S5PC1XX_CLKREG(0x8510) -#define S5PC100_DVCIDX_MAP S5PC1XX_CLKREG(0x8514) -#define S5PC100_FREQ_CPU S5PC1XX_CLKREG(0x8518) -#define S5PC100_FREQ_DPM S5PC1XX_CLKREG(0x851C) -#define S5PC100_DVSEMCLK_EN S5PC1XX_CLKREG(0x8520) -#define S5PC100_APLL_CON_L8 S5PC1XX_CLKREG(0x8600) -#define S5PC100_APLL_CON_L7 S5PC1XX_CLKREG(0x8604) -#define S5PC100_APLL_CON_L6 S5PC1XX_CLKREG(0x8608) -#define S5PC100_APLL_CON_L5 S5PC1XX_CLKREG(0x860C) -#define S5PC100_APLL_CON_L4 S5PC1XX_CLKREG(0x8610) -#define S5PC100_APLL_CON_L3 S5PC1XX_CLKREG(0x8614) -#define S5PC100_APLL_CON_L2 S5PC1XX_CLKREG(0x8618) -#define S5PC100_APLL_CON_L1 S5PC1XX_CLKREG(0x861C) -#define S5PC100_IEM_CONTROL S5PC1XX_CLKREG(0x8620) -#define S5PC100_CLKDIV_IEM_L8 S5PC1XX_CLKREG(0x8700) -#define S5PC100_CLKDIV_IEM_L7 S5PC1XX_CLKREG(0x8704) -#define S5PC100_CLKDIV_IEM_L6 S5PC1XX_CLKREG(0x8708) -#define S5PC100_CLKDIV_IEM_L5 S5PC1XX_CLKREG(0x870C) -#define S5PC100_CLKDIV_IEM_L4 S5PC1XX_CLKREG(0x8710) -#define S5PC100_CLKDIV_IEM_L3 S5PC1XX_CLKREG(0x8714) -#define S5PC100_CLKDIV_IEM_L2 S5PC1XX_CLKREG(0x8718) -#define S5PC100_CLKDIV_IEM_L1 S5PC1XX_CLKREG(0x871C) -#define S5PC100_IEM_HPMCLK_DIV S5PC1XX_CLKREG(0x8724) - -#define S5PC100_SWRESET S5PC1XX_CLKREG(0x100000) -#define S5PC100_OND_SWRESET S5PC1XX_CLKREG(0x100008) -#define S5PC100_GEN_CTRL S5PC1XX_CLKREG(0x100100) -#define S5PC100_GEN_STATUS S5PC1XX_CLKREG(0x100104) -#define S5PC100_MEM_SYS_CFG S5PC1XX_CLKREG(0x100200) -#define S5PC100_CAM_MUX_SEL S5PC1XX_CLKREG(0x100300) -#define S5PC100_MIXER_OUT_SEL S5PC1XX_CLKREG(0x100304) -#define S5PC100_LPMP_MODE_SEL S5PC1XX_CLKREG(0x100308) -#define S5PC100_MIPI_PHY_CON0 S5PC1XX_CLKREG(0x100400) -#define S5PC100_MIPI_PHY_CON1 S5PC1XX_CLKREG(0x100414) -#define S5PC100_HDMI_PHY_CON0 S5PC1XX_CLKREG(0x100420) - -#define S5PC100_CFG_WFI_CLEAN (~(3<<5)) -#define S5PC100_CFG_WFI_IDLE (1<<5) -#define S5PC100_CFG_WFI_STOP (2<<5) -#define S5PC100_CFG_WFI_SLEEP (3<<5) - +#define S5PC100_SWRESET S5PC100_CLKREG_OTHER(0x000) +#define S5PC100_OND_SWRESET S5PC100_CLKREG_OTHER(0x008) +#define S5PC100_GEN_CTRL S5PC100_CLKREG_OTHER(0x100) +#define S5PC100_GEN_STATUS S5PC100_CLKREG_OTHER(0x104) +#define S5PC100_MEM_SYS_CFG S5PC100_CLKREG_OTHER(0x200) +#define S5PC100_CAM_MUX_SEL S5PC100_CLKREG_OTHER(0x300) +#define S5PC100_MIXER_OUT_SEL S5PC100_CLKREG_OTHER(0x304) +#define S5PC100_LPMP_MODE_SEL S5PC100_CLKREG_OTHER(0x308) +#define S5PC100_MIPI_PHY_CON0 S5PC100_CLKREG_OTHER(0x400) +#define S5PC100_MIPI_PHY_CON1 S5PC100_CLKREG_OTHER(0x414) +#define S5PC100_HDMI_PHY_CON0 S5PC100_CLKREG_OTHER(0x420) + +#define S5PC100_SWRESET_RESETVAL 0xc100#define S5PC100_OTHER_SYS_INT 24#define S5PC100_OTHER_STA_TYPE 23#define STA_TYPE_EXPON 0#define STA_TYPE_SFR 1 -#define S5PC100_PWR_STA_EXP_SCALE 0 -#define S5PC100_PWR_STA_CNT 4 - -#define S5PC100_PWR_STABLE_COUNT 85500 -#define S5PC100_SLEEP_CFG_OSC_EN 0/* OTHERS Resgister */ -#define S5PC100_OTHERS_USB_SIG_MASK (1 << 16) +#define S5PC100_OTHERS_USB_SIG_MASK (1 << 16)#define S5PC100_OTHERS_MIPI_DPHY_EN (1 << 28)/* MIPI D-PHY Control Register 0 */
arch/arm/plat-s5pc1xx/s5pc100-clock.c +22 -22
117 lines not on this page · raw message
Signature · 1 line
1.6.5
PATCH 4/18 ARM: S5PC1XX: clocks reimplementation
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Clocks hierarchy has been completely reimplemented to match the S5PC100 specification.
--- arch/arm/plat-s5pc1xx/Makefile | 1 + arch/arm/plat-s5pc1xx/clock.c | 728 ++++++++++++ arch/arm/plat-s5pc1xx/cpu.c | 5 + arch/arm/plat-s5pc1xx/include/plat/s5pc100.h | 5 +- arch/arm/plat-s5pc1xx/s5pc100-clock.c | 1531 +++++++++++++------------- 5 files changed, 1504 insertions(+), 766 deletions(-) create mode 100644 arch/arm/plat-s5pc1xx/clock.c
arch/arm/plat-s5pc1xx/Makefile +1 -0
@@ -14,6 +14,7 @@ obj- := obj-y += dev-uart.o obj-y += cpu.o obj-y += irq.o +obj-y += clock.o # CPU support
arch/arm/plat-s5pc1xx/clock.c new file +728 -0
728 lines not on this page · raw message
arch/arm/plat-s5pc1xx/cpu.c +5 -0
@@ -55,6 +55,11 @@ static struct cpu_table cpu_ids[] __initdata = {static struct map_desc s5pc1xx_iodesc[]__initdata = { { + .virtual = (unsigned long )S5PC1XX_VA_CLK_OTHER , + .pfn =__phys_to_pfn (S5PC1XX_PA_CLK_OTHER ), + .length =SZ_4K , + .type =MT_DEVICE , + }, { .virtual = (unsigned long )S5PC1XX_VA_CHIPID , .pfn =__phys_to_pfn (S5PC1XX_PA_CHIPID ), .length =SZ_16 ,
arch/arm/plat-s5pc1xx/include/plat/s5pc100.h +2 -3
@@ -35,10 +35,9 @@ extern struct clk clk_hpll;extern struct clk clk_hd0;extern struct clk clk_pd0;extern struct clk clk_54m; -extern struct clk clk_dout_mpll2;extern void s5pc1xx_register_clocks (void ); -extern int s5pc1xx_sclk0_ctrl (struct clk *clk,int enable); -extern int s5pc1xx_sclk1_ctrl (struct clk *clk,int enable); +extern int s5pc100_sclk0_ctrl (struct clk *clk,int enable); +extern int s5pc100_sclk1_ctrl (struct clk *clk,int enable);/* Some day, belows will be moved to plat-s5pc/include/plat/devs.h */ extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[];
arch/arm/plat-s5pc1xx/s5pc100-clock.c +768 -763
1,740 lines not on this page · raw message
Signature · 1 line
1.6.5
PATCH 5/18 ARM: S5PC1XX: add GPIO L banks to register definition
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Add GPIO L0-L4 banks to register definition.
--- arch/arm/mach-s5pc100/include/mach/gpio.h | 30 ++++++++++++++++++++++------ 1 files changed, 23 insertions(+), 7 deletions(-)
arch/arm/mach-s5pc100/include/mach/gpio.h +23 -7
@@ -47,6 +47,11 @@#define S5PC1XX_GPIO_K1_NR (6)#define S5PC1XX_GPIO_K2_NR (8)#define S5PC1XX_GPIO_K3_NR (8) +#define S5PC1XX_GPIO_L0_NR (8) +#define S5PC1XX_GPIO_L1_NR (8) +#define S5PC1XX_GPIO_L2_NR (8) +#define S5PC1XX_GPIO_L3_NR (8) +#define S5PC1XX_GPIO_L4_NR (8)#define S5PC1XX_GPIO_MP00_NR (8)#define S5PC1XX_GPIO_MP01_NR (8)#define S5PC1XX_GPIO_MP02_NR (8)
@@ -64,9 +69,9 @@ ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)enum s3c_gpio_number { -S5PC1XX_GPIO_A0_START =0 , -S5PC1XX_GPIO_A1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_A0 ), -S5PC1XX_GPIO_B_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_A1 ), +S5PC1XX_GPIO_A0_START =0 , +S5PC1XX_GPIO_A1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_A0 ), +S5PC1XX_GPIO_B_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_A1 ),S5PC1XX_GPIO_C_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_B ),S5PC1XX_GPIO_D_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_C ),S5PC1XX_GPIO_E0_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_D ),
@@ -93,11 +98,17 @@ enum s3c_gpio_number {S5PC1XX_GPIO_K1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_K0 ),S5PC1XX_GPIO_K2_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_K1 ),S5PC1XX_GPIO_K3_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_K2 ), -S5PC1XX_GPIO_MP00_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_K3 ), +S5PC1XX_GPIO_L0_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_K3 ), +S5PC1XX_GPIO_L1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_L0 ), +S5PC1XX_GPIO_L2_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_L1 ), +S5PC1XX_GPIO_L3_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_L2 ), +S5PC1XX_GPIO_L4_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_L3 ), +S5PC1XX_GPIO_MP00_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_L4 ),S5PC1XX_GPIO_MP01_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_MP00 ),S5PC1XX_GPIO_MP02_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_MP01 ),S5PC1XX_GPIO_MP03_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_MP02 ),S5PC1XX_GPIO_MP04_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_MP03 ), + S5PC1XX_GPIO_END = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP04), };/* S5PC1XX GPIO number definitions. */
@@ -130,17 +141,22 @@ enum s3c_gpio_number {#define S5PC1XX_GPK1 (_nr) (S5PC1XX_GPIO_K1_START + (_nr))#define S5PC1XX_GPK2 (_nr) (S5PC1XX_GPIO_K2_START + (_nr))#define S5PC1XX_GPK3 (_nr) (S5PC1XX_GPIO_K3_START + (_nr)) +#define S5PC1XX_GPL0 (_nr) (S5PC1XX_GPIO_L0_START + (_nr)) +#define S5PC1XX_GPL1 (_nr) (S5PC1XX_GPIO_L1_START + (_nr)) +#define S5PC1XX_GPL2 (_nr) (S5PC1XX_GPIO_L2_START + (_nr)) +#define S5PC1XX_GPL3 (_nr) (S5PC1XX_GPIO_L3_START + (_nr)) +#define S5PC1XX_GPL4 (_nr) (S5PC1XX_GPIO_L4_START + (_nr))#define S5PC1XX_MP00 (_nr) (S5PC1XX_GPIO_MP00_START + (_nr))#define S5PC1XX_MP01 (_nr) (S5PC1XX_GPIO_MP01_START + (_nr))#define S5PC1XX_MP02 (_nr) (S5PC1XX_GPIO_MP02_START + (_nr))#define S5PC1XX_MP03 (_nr) (S5PC1XX_GPIO_MP03_START + (_nr))#define S5PC1XX_MP04 (_nr) (S5PC1XX_GPIO_MP04_START + (_nr)) +#define S5PC1XX_MP05 (_nr) (S5PC1XX_GPIO_MP05_START + (_nr)) -/* the end of the S5PC1XX specific gpios */ -#define S5PC1XX_GPIO_END (S5PC1XX_MP04(S5PC1XX_GPIO_MP04_NR) + 1) +/* It used the end of the S5PC1XX gpios */ #define S3C_GPIO_END S5PC1XX_GPIO_END/* define the number of gpios we need to the one after the MP04() range */ -#define ARCH_NR_GPIOS (S5PC1XX_MP04(S5PC1XX_GPIO_MP04_NR) + 1) +#define ARCH_NR_GPIOS (S5PC1XX_GPIO_END + 1)#include <asm-generic/gpio.h>
Signature · 1 line
1.6.5
PATCH 6/18 ARM: S5PC1XX: GPIO registers rename
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
S5PC100 and S5PC110 GPIO registers differs in many places, rename all previously defined registers to be S5PC100 specific.
--- arch/arm/mach-s5pc100/include/mach/gpio.h | 244 ++++++++++++++-------------- 1 files changed, 122 insertions(+), 122 deletions(-)
arch/arm/mach-s5pc100/include/mach/gpio.h +122 -122
@@ -18,45 +18,45 @@#define gpio_to_irq __gpio_to_irq/* GPIO bank sizes */ -#define S5PC1XX_GPIO_A0_NR (8) -#define S5PC1XX_GPIO_A1_NR (5) -#define S5PC1XX_GPIO_B_NR (8) -#define S5PC1XX_GPIO_C_NR (5) -#define S5PC1XX_GPIO_D_NR (7) -#define S5PC1XX_GPIO_E0_NR (8) -#define S5PC1XX_GPIO_E1_NR (6) -#define S5PC1XX_GPIO_F0_NR (8) -#define S5PC1XX_GPIO_F1_NR (8) -#define S5PC1XX_GPIO_F2_NR (8) -#define S5PC1XX_GPIO_F3_NR (4) -#define S5PC1XX_GPIO_G0_NR (8) -#define S5PC1XX_GPIO_G1_NR (3) -#define S5PC1XX_GPIO_G2_NR (7) -#define S5PC1XX_GPIO_G3_NR (7) -#define S5PC1XX_GPIO_H0_NR (8) -#define S5PC1XX_GPIO_H1_NR (8) -#define S5PC1XX_GPIO_H2_NR (8) -#define S5PC1XX_GPIO_H3_NR (8) -#define S5PC1XX_GPIO_I_NR (8) -#define S5PC1XX_GPIO_J0_NR (8) -#define S5PC1XX_GPIO_J1_NR (5) -#define S5PC1XX_GPIO_J2_NR (8) -#define S5PC1XX_GPIO_J3_NR (8) -#define S5PC1XX_GPIO_J4_NR (4) -#define S5PC1XX_GPIO_K0_NR (8) -#define S5PC1XX_GPIO_K1_NR (6) -#define S5PC1XX_GPIO_K2_NR (8) -#define S5PC1XX_GPIO_K3_NR (8) -#define S5PC1XX_GPIO_L0_NR (8) -#define S5PC1XX_GPIO_L1_NR (8) -#define S5PC1XX_GPIO_L2_NR (8) -#define S5PC1XX_GPIO_L3_NR (8) -#define S5PC1XX_GPIO_L4_NR (8) -#define S5PC1XX_GPIO_MP00_NR (8) -#define S5PC1XX_GPIO_MP01_NR (8) -#define S5PC1XX_GPIO_MP02_NR (8) -#define S5PC1XX_GPIO_MP03_NR (8) -#define S5PC1XX_GPIO_MP04_NR (5) +#define S5PC100_GPIO_A0_NR (8) +#define S5PC100_GPIO_A1_NR (5) +#define S5PC100_GPIO_B_NR (8) +#define S5PC100_GPIO_C_NR (5) +#define S5PC100_GPIO_D_NR (7) +#define S5PC100_GPIO_E0_NR (8) +#define S5PC100_GPIO_E1_NR (6) +#define S5PC100_GPIO_F0_NR (8) +#define S5PC100_GPIO_F1_NR (8) +#define S5PC100_GPIO_F2_NR (8) +#define S5PC100_GPIO_F3_NR (4) +#define S5PC100_GPIO_G0_NR (8) +#define S5PC100_GPIO_G1_NR (3) +#define S5PC100_GPIO_G2_NR (7) +#define S5PC100_GPIO_G3_NR (7) +#define S5PC100_GPIO_H0_NR (8) +#define S5PC100_GPIO_H1_NR (8) +#define S5PC100_GPIO_H2_NR (8) +#define S5PC100_GPIO_H3_NR (8) +#define S5PC100_GPIO_I_NR (8) +#define S5PC100_GPIO_J0_NR (8) +#define S5PC100_GPIO_J1_NR (5) +#define S5PC100_GPIO_J2_NR (8) +#define S5PC100_GPIO_J3_NR (8) +#define S5PC100_GPIO_J4_NR (4) +#define S5PC100_GPIO_K0_NR (8) +#define S5PC100_GPIO_K1_NR (6) +#define S5PC100_GPIO_K2_NR (8) +#define S5PC100_GPIO_K3_NR (8) +#define S5PC100_GPIO_L0_NR (8) +#define S5PC100_GPIO_L1_NR (8) +#define S5PC100_GPIO_L2_NR (8) +#define S5PC100_GPIO_L3_NR (8) +#define S5PC100_GPIO_L4_NR (8) +#define S5PC100_GPIO_MP00_NR (8) +#define S5PC100_GPIO_MP01_NR (8) +#define S5PC100_GPIO_MP02_NR (8) +#define S5PC100_GPIO_MP03_NR (8) +#define S5PC100_GPIO_MP04_NR (5)/* GPIO bank numbes */
@@ -69,94 +69,94 @@ ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)enum s3c_gpio_number { -S5PC1XX_GPIO_A0_START =0 , -S5PC1XX_GPIO_A1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_A0 ), -S5PC1XX_GPIO_B_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_A1 ), -S5PC1XX_GPIO_C_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_B ), -S5PC1XX_GPIO_D_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_C ), -S5PC1XX_GPIO_E0_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_D ), -S5PC1XX_GPIO_E1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_E0 ), -S5PC1XX_GPIO_F0_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_E1 ), -S5PC1XX_GPIO_F1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_F0 ), -S5PC1XX_GPIO_F2_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_F1 ), -S5PC1XX_GPIO_F3_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_F2 ), -S5PC1XX_GPIO_G0_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_F3 ), -S5PC1XX_GPIO_G1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_G0 ), -S5PC1XX_GPIO_G2_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_G1 ), -S5PC1XX_GPIO_G3_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_G2 ), -S5PC1XX_GPIO_H0_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_G3 ), -S5PC1XX_GPIO_H1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_H0 ), -S5PC1XX_GPIO_H2_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_H1 ), -S5PC1XX_GPIO_H3_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_H2 ), -S5PC1XX_GPIO_I_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_H3 ), -S5PC1XX_GPIO_J0_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_I ), -S5PC1XX_GPIO_J1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_J0 ), -S5PC1XX_GPIO_J2_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_J1 ), -S5PC1XX_GPIO_J3_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_J2 ), -S5PC1XX_GPIO_J4_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_J3 ), -S5PC1XX_GPIO_K0_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_J4 ), -S5PC1XX_GPIO_K1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_K0 ), -S5PC1XX_GPIO_K2_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_K1 ), -S5PC1XX_GPIO_K3_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_K2 ), -S5PC1XX_GPIO_L0_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_K3 ), -S5PC1XX_GPIO_L1_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_L0 ), -S5PC1XX_GPIO_L2_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_L1 ), -S5PC1XX_GPIO_L3_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_L2 ), -S5PC1XX_GPIO_L4_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_L3 ), -S5PC1XX_GPIO_MP00_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_L4 ), -S5PC1XX_GPIO_MP01_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_MP00 ), -S5PC1XX_GPIO_MP02_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_MP01 ), -S5PC1XX_GPIO_MP03_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_MP02 ), -S5PC1XX_GPIO_MP04_START =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_MP03 ), -S5PC1XX_GPIO_END =S5PC1XX_GPIO_NEXT (S5PC1XX_GPIO_MP04 ), +S5PC100_GPIO_A0_START =0 , +S5PC100_GPIO_A1_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_A0 ), +S5PC100_GPIO_B_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_A1 ), +S5PC100_GPIO_C_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_B ), +S5PC100_GPIO_D_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_C ), +S5PC100_GPIO_E0_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_D ), +S5PC100_GPIO_E1_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_E0 ), +S5PC100_GPIO_F0_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_E1 ), +S5PC100_GPIO_F1_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_F0 ), +S5PC100_GPIO_F2_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_F1 ), +S5PC100_GPIO_F3_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_F2 ), +S5PC100_GPIO_G0_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_F3 ), +S5PC100_GPIO_G1_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_G0 ), +S5PC100_GPIO_G2_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_G1 ), +S5PC100_GPIO_G3_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_G2 ), +S5PC100_GPIO_H0_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_G3 ), +S5PC100_GPIO_H1_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_H0 ), +S5PC100_GPIO_H2_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_H1 ), +S5PC100_GPIO_H3_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_H2 ), +S5PC100_GPIO_I_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_H3 ), +S5PC100_GPIO_J0_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_I ), +S5PC100_GPIO_J1_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_J0 ), +S5PC100_GPIO_J2_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_J1 ), +S5PC100_GPIO_J3_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_J2 ), +S5PC100_GPIO_J4_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_J3 ), +S5PC100_GPIO_K0_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_J4 ), +S5PC100_GPIO_K1_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_K0 ), +S5PC100_GPIO_K2_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_K1 ), +S5PC100_GPIO_K3_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_K2 ), +S5PC100_GPIO_L0_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_K3 ), +S5PC100_GPIO_L1_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_L0 ), +S5PC100_GPIO_L2_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_L1 ), +S5PC100_GPIO_L3_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_L2 ), +S5PC100_GPIO_L4_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_L3 ), +S5PC100_GPIO_MP00_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_L4 ), +S5PC100_GPIO_MP01_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_MP00 ), +S5PC100_GPIO_MP02_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_MP01 ), +S5PC100_GPIO_MP03_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_MP02 ), +S5PC100_GPIO_MP04_START =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_MP03 ), +S5PC100_GPIO_END =S5PC1XX_GPIO_NEXT (S5PC100_GPIO_MP04 ), }; -/* S5PC1XX GPIO number definitions. */ -#define S5PC1XX_GPA0 (_nr) (S5PC1XX_GPIO_A0_START + (_nr)) -#define S5PC1XX_GPA1 (_nr) (S5PC1XX_GPIO_A1_START + (_nr)) -#define S5PC1XX_GPB (_nr) (S5PC1XX_GPIO_B_START + (_nr)) -#define S5PC1XX_GPC (_nr) (S5PC1XX_GPIO_C_START + (_nr)) -#define S5PC1XX_GPD (_nr) (S5PC1XX_GPIO_D_START + (_nr)) -#define S5PC1XX_GPE0 (_nr) (S5PC1XX_GPIO_E0_START + (_nr)) -#define S5PC1XX_GPE1 (_nr) (S5PC1XX_GPIO_E1_START + (_nr)) -#define S5PC1XX_GPF0 (_nr) (S5PC1XX_GPIO_F0_START + (_nr)) -#define S5PC1XX_GPF1 (_nr) (S5PC1XX_GPIO_F1_START + (_nr)) -#define S5PC1XX_GPF2 (_nr) (S5PC1XX_GPIO_F2_START + (_nr)) -#define S5PC1XX_GPF3 (_nr) (S5PC1XX_GPIO_F3_START + (_nr)) -#define S5PC1XX_GPG0 (_nr) (S5PC1XX_GPIO_G0_START + (_nr)) -#define S5PC1XX_GPG1 (_nr) (S5PC1XX_GPIO_G1_START + (_nr)) -#define S5PC1XX_GPG2 (_nr) (S5PC1XX_GPIO_G2_START + (_nr)) -#define S5PC1XX_GPG3 (_nr) (S5PC1XX_GPIO_G3_START + (_nr)) -#define S5PC1XX_GPH0 (_nr) (S5PC1XX_GPIO_H0_START + (_nr)) -#define S5PC1XX_GPH1 (_nr) (S5PC1XX_GPIO_H1_START + (_nr)) -#define S5PC1XX_GPH2 (_nr) (S5PC1XX_GPIO_H2_START + (_nr)) -#define S5PC1XX_GPH3 (_nr) (S5PC1XX_GPIO_H3_START + (_nr)) -#define S5PC1XX_GPI (_nr) (S5PC1XX_GPIO_I_START + (_nr)) -#define S5PC1XX_GPJ0 (_nr) (S5PC1XX_GPIO_J0_START + (_nr)) -#define S5PC1XX_GPJ1 (_nr) (S5PC1XX_GPIO_J1_START + (_nr)) -#define S5PC1XX_GPJ2 (_nr) (S5PC1XX_GPIO_J2_START + (_nr)) -#define S5PC1XX_GPJ3 (_nr) (S5PC1XX_GPIO_J3_START + (_nr)) -#define S5PC1XX_GPJ4 (_nr) (S5PC1XX_GPIO_J4_START + (_nr)) -#define S5PC1XX_GPK0 (_nr) (S5PC1XX_GPIO_K0_START + (_nr)) -#define S5PC1XX_GPK1 (_nr) (S5PC1XX_GPIO_K1_START + (_nr)) -#define S5PC1XX_GPK2 (_nr) (S5PC1XX_GPIO_K2_START + (_nr)) -#define S5PC1XX_GPK3 (_nr) (S5PC1XX_GPIO_K3_START + (_nr)) -#define S5PC1XX_GPL0 (_nr) (S5PC1XX_GPIO_L0_START + (_nr)) -#define S5PC1XX_GPL1 (_nr) (S5PC1XX_GPIO_L1_START + (_nr)) -#define S5PC1XX_GPL2 (_nr) (S5PC1XX_GPIO_L2_START + (_nr)) -#define S5PC1XX_GPL3 (_nr) (S5PC1XX_GPIO_L3_START + (_nr)) -#define S5PC1XX_GPL4 (_nr) (S5PC1XX_GPIO_L4_START + (_nr)) -#define S5PC1XX_MP00 (_nr) (S5PC1XX_GPIO_MP00_START + (_nr)) -#define S5PC1XX_MP01 (_nr) (S5PC1XX_GPIO_MP01_START + (_nr)) -#define S5PC1XX_MP02 (_nr) (S5PC1XX_GPIO_MP02_START + (_nr)) -#define S5PC1XX_MP03 (_nr) (S5PC1XX_GPIO_MP03_START + (_nr)) -#define S5PC1XX_MP04 (_nr) (S5PC1XX_GPIO_MP04_START + (_nr)) -#define S5PC1XX_MP05 (_nr) (S5PC1XX_GPIO_MP05_START + (_nr)) +/* S5PC100 GPIO number definitions. */ +#define S5PC100_GPA0 (_nr) (S5PC100_GPIO_A0_START + (_nr)) +#define S5PC100_GPA1 (_nr) (S5PC100_GPIO_A1_START + (_nr)) +#define S5PC100_GPB (_nr) (S5PC100_GPIO_B_START + (_nr)) +#define S5PC100_GPC (_nr) (S5PC100_GPIO_C_START + (_nr)) +#define S5PC100_GPD (_nr) (S5PC100_GPIO_D_START + (_nr)) +#define S5PC100_GPE0 (_nr) (S5PC100_GPIO_E0_START + (_nr)) +#define S5PC100_GPE1 (_nr) (S5PC100_GPIO_E1_START + (_nr)) +#define S5PC100_GPF0 (_nr) (S5PC100_GPIO_F0_START + (_nr)) +#define S5PC100_GPF1 (_nr) (S5PC100_GPIO_F1_START + (_nr)) +#define S5PC100_GPF2 (_nr) (S5PC100_GPIO_F2_START + (_nr)) +#define S5PC100_GPF3 (_nr) (S5PC100_GPIO_F3_START + (_nr)) +#define S5PC100_GPG0 (_nr) (S5PC100_GPIO_G0_START + (_nr)) +#define S5PC100_GPG1 (_nr) (S5PC100_GPIO_G1_START + (_nr)) +#define S5PC100_GPG2 (_nr) (S5PC100_GPIO_G2_START + (_nr)) +#define S5PC100_GPG3 (_nr) (S5PC100_GPIO_G3_START + (_nr)) +#define S5PC100_GPH0 (_nr) (S5PC100_GPIO_H0_START + (_nr)) +#define S5PC100_GPH1 (_nr) (S5PC100_GPIO_H1_START + (_nr)) +#define S5PC100_GPH2 (_nr) (S5PC100_GPIO_H2_START + (_nr)) +#define S5PC100_GPH3 (_nr) (S5PC100_GPIO_H3_START + (_nr)) +#define S5PC100_GPI (_nr) (S5PC100_GPIO_I_START + (_nr)) +#define S5PC100_GPJ0 (_nr) (S5PC100_GPIO_J0_START + (_nr)) +#define S5PC100_GPJ1 (_nr) (S5PC100_GPIO_J1_START + (_nr)) +#define S5PC100_GPJ2 (_nr) (S5PC100_GPIO_J2_START + (_nr)) +#define S5PC100_GPJ3 (_nr) (S5PC100_GPIO_J3_START + (_nr)) +#define S5PC100_GPJ4 (_nr) (S5PC100_GPIO_J4_START + (_nr)) +#define S5PC100_GPK0 (_nr) (S5PC100_GPIO_K0_START + (_nr)) +#define S5PC100_GPK1 (_nr) (S5PC100_GPIO_K1_START + (_nr)) +#define S5PC100_GPK2 (_nr) (S5PC100_GPIO_K2_START + (_nr)) +#define S5PC100_GPK3 (_nr) (S5PC100_GPIO_K3_START + (_nr)) +#define S5PC100_GPL0 (_nr) (S5PC100_GPIO_L0_START + (_nr)) +#define S5PC100_GPL1 (_nr) (S5PC100_GPIO_L1_START + (_nr)) +#define S5PC100_GPL2 (_nr) (S5PC100_GPIO_L2_START + (_nr)) +#define S5PC100_GPL3 (_nr) (S5PC100_GPIO_L3_START + (_nr)) +#define S5PC100_GPL4 (_nr) (S5PC100_GPIO_L4_START + (_nr)) +#define S5PC100_MP00 (_nr) (S5PC100_GPIO_MP00_START + (_nr)) +#define S5PC100_MP01 (_nr) (S5PC100_GPIO_MP01_START + (_nr)) +#define S5PC100_MP02 (_nr) (S5PC100_GPIO_MP02_START + (_nr)) +#define S5PC100_MP03 (_nr) (S5PC100_GPIO_MP03_START + (_nr)) +#define S5PC100_MP04 (_nr) (S5PC100_GPIO_MP04_START + (_nr)) +#define S5PC100_MP05 (_nr) (S5PC100_GPIO_MP05_START + (_nr))/* It used the end of the S5PC1XX gpios */ -#define S3C_GPIO_END S5PC1XX_GPIO_END +#define S3C_GPIO_END S5PC100_GPIO_END/* define the number of gpios we need to the one after the MP04() range */ -#define ARCH_NR_GPIOS (S5PC1XX_GPIO_END + 1) +#define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1)#include <asm-generic/gpio.h>
Signature · 1 line
1.6.5
PATCH 7/18 ARM: S5PC1xx: add gpiolib and external/gpio interrupt support
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Add support for gpiolib calls. This is based on the gpiolib implementation from plat-s3c64xx tree.
Add support for external interrupts for GPIO H banks.
Add support for GPIO interrupts for all banks.
--- arch/arm/plat-s3c/Kconfig | 6 + arch/arm/plat-s3c/include/plat/gpio-cfg.h | 1 + arch/arm/plat-s5pc1xx/Kconfig | 3 + arch/arm/plat-s5pc1xx/Makefile | 4 +- arch/arm/plat-s5pc1xx/cpu.c | 5 + arch/arm/plat-s5pc1xx/gpio-config.c | 60 +++ arch/arm/plat-s5pc1xx/gpiolib.c | 503 ++++++++++++++++++++ .../plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h | 32 ++ arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h | 44 ++ arch/arm/plat-s5pc1xx/include/plat/irqs.h | 15 +- arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h | 70 +++ arch/arm/plat-s5pc1xx/irq-eint.c | 281 +++++++++++ arch/arm/plat-s5pc1xx/irq-gpio.c | 266 +++++++++++ arch/arm/plat-s5pc1xx/irq.c | 2 +- 14 files changed, 1287 insertions(+), 5 deletions(-) create mode 100644 arch/arm/plat-s5pc1xx/gpio-config.c create mode 100644 arch/arm/plat-s5pc1xx/gpiolib.c create mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h create mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h create mode 100644 arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h create mode 100644 arch/arm/plat-s5pc1xx/irq-eint.c create mode 100644 arch/arm/plat-s5pc1xx/irq-gpio.c
arch/arm/plat-s3c/Kconfig +6 -0
@@ -159,6 +159,12 @@ config S3C_GPIO_CFG_S3C64XX Internal configuration to enable S3C64XX style GPIO configuration functions. +config S5P_GPIO_CFG_S5PC1XX + bool + help + Internal configuration to enable S5PC1XX style GPIO configuration + functions. + # DMA config S3C_DMA
arch/arm/plat-s3c/include/plat/gpio-cfg.h +1 -0
@@ -62,6 +62,7 @@ struct s3c_gpio_cfg {#define S3C_GPIO_INPUT (S3C_GPIO_SPECIAL(0))#define S3C_GPIO_OUTPUT (S3C_GPIO_SPECIAL(1))#define S3C_GPIO_SFN (x) (S3C_GPIO_SPECIAL(x)) +#define S3C_GPIO_IRQ (S3C_GPIO_SPECIAL(0xf))#define s3c_gpio_is_cfg_special (_cfg) \ (((_cfg) & S3C_GPIO_SPECIAL_MARK) == S3C_GPIO_SPECIAL_MARK)
arch/arm/plat-s5pc1xx/Kconfig +3 -0
@@ -15,6 +15,9 @@ config PLAT_S5PC1XX select ARCH_REQUIRE_GPIOLIB select S3C_GPIO_TRACK select S3C_GPIO_PULL_UPDOWN + select S3C_GPIO_CFG_S3C24XX + select S3C_GPIO_CFG_S3C64XX + select S5P_GPIO_CFG_S5PC1XX help Base platform code for any Samsung S5PC1XX device
arch/arm/plat-s5pc1xx/Makefile +3 -1
@@ -13,8 +13,9 @@ obj- := obj-y += dev-uart.o obj-y += cpu.o -obj-y += irq.o +obj-y += irq.o irq-gpio.o irq-eint.o obj-y += clock.o +obj-y += gpiolib.o # CPU support
@@ -23,5 +24,6 @@ obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.o # Device setup +obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o obj-$(CONFIG_S5PC100_SETUP_I2C0) += setup-i2c0.o obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
arch/arm/plat-s5pc1xx/cpu.c +5 -0
@@ -60,6 +60,11 @@ static struct map_desc s5pc1xx_iodesc[] __initdata = { .length = SZ_4K, .type = MT_DEVICE, }, { + .virtual = (unsigned long)S5PC1XX_VA_GPIO, + .pfn = __phys_to_pfn(S5PC100_PA_GPIO), + .length = SZ_4K, + .type = MT_DEVICE, + }, { .virtual = (unsigned long)S5PC1XX_VA_CHIPID, .pfn = __phys_to_pfn(S5PC1XX_PA_CHIPID), .length = SZ_16,
arch/arm/plat-s5pc1xx/gpio-config.c new file +60 -0
60 lines not on this page · raw message
arch/arm/plat-s5pc1xx/gpiolib.c new file +503 -0
503 lines not on this page · raw message
arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h new file +32 -0
@@ -0,0 +1,32 @@ +/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg.h +* +* Copyright 2009 Samsung Electronic +* +* S5PC1XX Platform - GPIO pin configuration +* +* 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. +*/ + +/* This file contains the necessary definitions to get the basic gpio +* pin configuration done such as setting a pin to input or output or +* changing the pull-{up,down} configurations. +*/ + +#ifndef __GPIO_CFG_S5PC1XX_H +#define __GPIO_CFG_S5PC1XX_H __FILE__ + +typedef unsigned int __bitwise__ s5p_gpio_drvstr_t; + +#define S5P_GPIO_DRVSTR_LV1 0x00 +#define S5P_GPIO_DRVSTR_LV2 0x01 +#define S5P_GPIO_DRVSTR_LV3 0x10 +#define S5P_GPIO_DRVSTR_LV4 0x11 + +extern s5p_gpio_drvstr_t s5p_gpio_get_drvstr (unsigned int pin,unsigned int off); + +extern int s5p_gpio_set_drvstr (unsigned int pin,unsigned int off, +s5p_gpio_drvstr_t drvstr); + +#endif /* __GPIO_CFG_S5PC1XX_H */
arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h new file +44 -0
44 lines not on this page · raw message
arch/arm/plat-s5pc1xx/include/plat/irqs.h +12 -3
@@ -171,12 +171,21 @@#define IRQ_SDMIRQ S5PC1XX_IRQ_VIC2(30)#define IRQ_SDMFIQ S5PC1XX_IRQ_VIC2(31) +/* External interrupt */ #define S3C_IRQ_EINT_BASE (IRQ_SDMFIQ + 1) -#define S3C_EINT (x) ((x) + S3C_IRQ_EINT_BASE) -#define IRQ_EINT (x) S3C_EINT(x) +#define S3C_EINT (x) (S3C_IRQ_EINT_BASE + (x - 16)) +#define IRQ_EINT (x) (x < 16 ? IRQ_EINT0 + x : S3C_EINT(x)) +#define IRQ_EINT_BIT (x) (x < IRQ_EINT16_31 ? x - IRQ_EINT0 : x - S3C_EINT(0)) -#define NR_IRQS (IRQ_EINT(31)+1) +/* GPIO interrupt */ +#define S3C_IRQ_GPIO_BASE (IRQ_EINT(31) + 1) +#define S3C_IRQ_GPIO (x) (S3C_IRQ_GPIO_BASE + (x)) + +/* +* Until MP04 Groups -> 40 (exactly 39) Groups * 8 ~= 320 GPIOs +*/ +#define NR_IRQS (S3C_IRQ_GPIO(320) + 1)#endif /* __ASM_PLAT_S5PC1XX_IRQS_H */
arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h new file +70 -0
70 lines not on this page · raw message
arch/arm/plat-s5pc1xx/irq-eint.c new file +281 -0
281 lines not on this page · raw message
arch/arm/plat-s5pc1xx/irq-gpio.c new file +266 -0
266 lines not on this page · raw message
arch/arm/plat-s5pc1xx/irq.c +1 -1
@@ -79,7 +79,7 @@ static void s3c_irq_timer_ack(unsigned int irq) {u32 reg =__raw_readl (S3C64XX_TINT_CSTAT ); - reg &=0x1f ; + reg &=0x1f ;/* mask out pending interrupts */ reg |= (1 <<5 ) << (irq -IRQ_TIMER0 );__raw_writel (reg,S3C64XX_TINT_CSTAT ); }
Signature · 1 line
1.6.5
PATCH 8/18 ARM: S5PC1XX: add cpu idle and system reset support
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Add CPU idle support by a call to SoC build-in power management core. Add system reset support by a simple write to system controll register.
--- arch/arm/mach-s5pc100/cpu.c | 22 ++++++ arch/arm/mach-s5pc100/include/mach/system.h | 13 +++- arch/arm/plat-s3c/include/plat/cpu.h | 6 ++ arch/arm/plat-s5pc1xx/include/plat/regs-power.h | 84 +++++++++++++++++++++++ 4 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 arch/arm/plat-s5pc1xx/include/plat/regs-power.h
arch/arm/mach-s5pc100/cpu.c +22 -0
@@ -22,6 +22,8 @@#include <linux/serial_core.h> #include <linux/platform_device.h> +#include <asm/proc-fns.h> +#include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/irq.h>
@@ -32,6 +34,7 @@#include <plat/cpu-freq.h> #include <plat/regs-serial.h> +#include <plat/regs-power.h> #include <plat/cpu.h> #include <plat/devs.h>
@@ -45,6 +48,23 @@static struct map_desc s5pc100_iodesc[]__initdata = { }; +static void s5pc100_idle (void ) +{ +unsigned long tmp; + + tmp =__raw_readl (S5PC100_PWR_CFG ); + tmp &= ~S5PC100_PWRCFG_CFG_DEEP_IDLE ; + tmp &= ~S5PC100_PWRCFG_CFG_WFI_MASK ; + tmp |=S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE ; +__raw_writel (tmp,S5PC100_PWR_CFG ); + + tmp =__raw_readl (S5PC100_OTHERS ); + tmp |=S5PC100_PMU_INT_DISABLE ; +__raw_writel (tmp,S5PC100_OTHERS ); + +cpu_do_idle (); +} +/* s5pc100_map_io * * register the standard cpu IO areas
@@ -93,5 +113,7 @@ int __init s5pc100_init(void) {printk (KERN_DEBUG "S5PC100: Initialising architecture\n" ); + s5pc1xx_idle = s5pc100_idle; +return sysdev_register (&s5pc100_sysdev); }
arch/arm/mach-s5pc100/include/mach/system.h +10 -3
@@ -11,14 +11,21 @@#ifndef __ASM_ARCH_SYSTEM_H#define __ASM_ARCH_SYSTEM_H __FILE__ +#include <linux/io.h> +#include <mach/map.h> +#include <plat/regs-clock.h> + +void (*s5pc1xx_idle)(void ); +static void arch_idle (void ) { -/* nothing here yet */ +if (s5pc1xx_idle) +s5pc1xx_idle (); }static void arch_reset (char mode,const char *cmd) { -/* nothing here yet */ +__raw_writel (S5PC100_SWRESET_RESETVAL ,S5PC100_SWRESET ); +return ; } -#endif /* __ASM_ARCH_IRQ_H */
arch/arm/plat-s3c/include/plat/cpu.h +6 -0
@@ -12,6 +12,9 @@/* todo - fix when rmk changes iodescs to use `void __iomem *` */ +#ifndef __SAMSUNG_PLAT_CPU_H +#define __SAMSUNG_PLAT_CPU_H +#define IODESC_ENT (x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }#ifndef MHZ
@@ -73,3 +76,6 @@ extern struct sysdev_class s3c2443_sysclass;extern struct sysdev_class s3c6410_sysclass;extern struct sysdev_class s3c64xx_sysclass; +extern void (*s5pc1xx_idle)(void ); + +#endif
arch/arm/plat-s5pc1xx/include/plat/regs-power.h new file +84 -0
84 lines not on this page · raw message
Signature · 1 line
1.6.5
PATCH 9/18 ARM: S3C: Prepare s3c64xx-specific s3c-fb register definition for reuse
From: Pawel Osciak <[email protected]>
From: Pawel Osciak <[email protected]>
S5PC1xx Samsung SOC series has very similar frame buffer hardware, so a lot of the code can be shared. Moved s3c64xx-specific s3c-fb register definitions from mach-s3c6400 to common platform directory as regs-fb-v4.h. The new v4 file will be common for S3C6400, S3C6410, S5PC100 and possibly others. Some s3c64xx series specific defines (palette handling) were left in s3c-6400/mach/regs-fb.h, because it is handled differently in S5PC1xx series.
--- arch/arm/mach-s3c6400/include/mach/regs-fb.h | 236 +------------------------- arch/arm/plat-s3c/include/plat/regs-fb-v4.h | 235 +++++++++++++++++++++++++ 2 files changed, 244 insertions(+), 227 deletions(-) create mode 100644 arch/arm/plat-s3c/include/plat/regs-fb-v4.h
arch/arm/mach-s3c6400/include/mach/regs-fb.h +9 -227
@@ -1,195 +1,30 @@ -/* arch/arm/mach-s3c6400/include/mach/regs-fb.h -* +/* * Copyright 2008 Openmoko, Inc. * Copyright 2008 Simtec Electronics -* http://armlinux.simtec.co.uk/ -* Ben Dooks <[email protected]> -* -* S3C64XX - new-style framebuffer register definitions +* Copyright 2009 Samsung Electronics Co. * -* This is the register set for the new style framebuffer interface -* found from the S3C2443 onwards and specifically the S3C64XX series -* S3C6400 and S3C6410. +* Pawel Osciak <[email protected]> +* Based on plat-s3c/include/plat/regs-fb.h by Ben Dooks <[email protected]> * -* The file contains the cpu specific items which change between whichever -* architecture is selected. See <plat/regs-fb.h> for the core definitions -* that are the same. +* Framebuffer register definitions for Samsung S3C64xx. * * 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 the core definitions here, in case we really do need to -* override them at a later date. -*/ - -#include <plat/regs-fb.h> - -#define S3C_FB_MAX_WIN (5)/* number of hardware windows available. */ -#define VIDCON1_FSTATUS_EVEN (1 << 15) - -/* Video timing controls */ -#define VIDTCON0 (0x10) -#define VIDTCON1 (0x14) -#define VIDTCON2 (0x18) - -/* Window position controls */ - -#define WINCON (_win) (0x20 + ((_win) * 4)) - -/* OSD1 and OSD4 do not have register D */ - -#define VIDOSD_A (_win) (0x40 + ((_win) * 16)) -#define VIDOSD_B (_win) (0x44 + ((_win) * 16)) -#define VIDOSD_C (_win) (0x48 + ((_win) * 16)) -#define VIDOSD_D (_win) (0x4C + ((_win) * 16)) - -/* Video buffer addresses */ - -#define VIDW_BUF_START (_buff) (0xA0 + ((_buff) * 8)) -#define VIDW_BUF_START1 (_buff) (0xA4 + ((_buff) * 8)) -#define VIDW_BUF_END (_buff) (0xD0 + ((_buff) * 8)) -#define VIDW_BUF_END1 (_buff) (0xD4 + ((_buff) * 8)) -#define VIDW_BUF_SIZE (_buff) (0x100 + ((_buff) * 4)) - -#define VIDINTCON0 (0x130) - -#define WxKEYCONy (_win, _con) ((0x140 + ((_win) * 8)) + ((_con) * 4)) - -/* WINCONx */ - -#define WINCONx_CSCWIDTH_MASK (0x3 << 26) -#define WINCONx_CSCWIDTH_SHIFT (26) -#define WINCONx_CSCWIDTH_WIDE (0x0 << 26) -#define WINCONx_CSCWIDTH_NARROW (0x3 << 26) - -#define WINCONx_ENLOCAL (1 << 22) -#define WINCONx_BUFSTATUS (1 << 21) -#define WINCONx_BUFSEL (1 << 20) -#define WINCONx_BUFAUTOEN (1 << 19) -#define WINCONx_YCbCr (1 << 13) - -#define WINCON1_LOCALSEL_CAMIF (1 << 23) - -#define WINCON2_LOCALSEL_CAMIF (1 << 23) -#define WINCON2_BLD_PIX (1 << 6) - -#define WINCON2_ALPHA_SEL (1 << 1) -#define WINCON2_BPPMODE_MASK (0xf << 2) -#define WINCON2_BPPMODE_SHIFT (2) -#define WINCON2_BPPMODE_1BPP (0x0 << 2) -#define WINCON2_BPPMODE_2BPP (0x1 << 2) -#define WINCON2_BPPMODE_4BPP (0x2 << 2) -#define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2) -#define WINCON2_BPPMODE_16BPP_565 (0x5 << 2) -#define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2) -#define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2) -#define WINCON2_BPPMODE_18BPP_666 (0x8 << 2) -#define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2) -#define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2) -#define WINCON2_BPPMODE_24BPP_888 (0xb << 2) -#define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2) -#define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2) -#define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2) - -#define WINCON3_BLD_PIX (1 << 6) - -#define WINCON3_ALPHA_SEL (1 << 1) -#define WINCON3_BPPMODE_MASK (0xf << 2) -#define WINCON3_BPPMODE_SHIFT (2) -#define WINCON3_BPPMODE_1BPP (0x0 << 2) -#define WINCON3_BPPMODE_2BPP (0x1 << 2) -#define WINCON3_BPPMODE_4BPP (0x2 << 2) -#define WINCON3_BPPMODE_16BPP_565 (0x5 << 2) -#define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2) -#define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2) -#define WINCON3_BPPMODE_18BPP_666 (0x8 << 2) -#define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2) -#define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2) -#define WINCON3_BPPMODE_24BPP_888 (0xb << 2) -#define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2) -#define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2) -#define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2) - -#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5) -#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5) -#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5) - -#define DITHMODE (0x170) -#define WINxMAP (_win) (0x180 + ((_win) * 4)) - - -#define DITHMODE_R_POS_MASK (0x3 << 5) -#define DITHMODE_R_POS_SHIFT (5) -#define DITHMODE_R_POS_8BIT (0x0 << 5) -#define DITHMODE_R_POS_6BIT (0x1 << 5) -#define DITHMODE_R_POS_5BIT (0x2 << 5) - -#define DITHMODE_G_POS_MASK (0x3 << 3) -#define DITHMODE_G_POS_SHIFT (3) -#define DITHMODE_G_POS_8BIT (0x0 << 3) -#define DITHMODE_G_POS_6BIT (0x1 << 3) -#define DITHMODE_G_POS_5BIT (0x2 << 3) - -#define DITHMODE_B_POS_MASK (0x3 << 1) -#define DITHMODE_B_POS_SHIFT (1) -#define DITHMODE_B_POS_8BIT (0x0 << 1) -#define DITHMODE_B_POS_6BIT (0x1 << 1) -#define DITHMODE_B_POS_5BIT (0x2 << 1) +#ifndef __ASM_ARCH_REGS_FB_H +#define __ASM_ARCH_REGS_FB_H __FILE__ -#define DITHMODE_DITH_EN (1 << 0) - -#define WPALCON (0x1A0) - -#define WPALCON_W4PAL_16BPP_A555 (1 << 8) -#define WPALCON_W3PAL_16BPP_A555 (1 << 7) -#define WPALCON_W2PAL_16BPP_A555 (1 << 6) +#include <plat/regs-fb-v4.h> /* Palette registers */ -#define WIN2_PAL (_entry) (0x300 + ((_entry) * 2))#define WIN3_PAL (_entry) (0x320 + ((_entry) * 2))#define WIN4_PAL (_entry) (0x340 + ((_entry) * 2))#define WIN0_PAL (_entry) (0x400 + ((_entry) * 4))#define WIN1_PAL (_entry) (0x800 + ((_entry) * 4)) -/* system specific implementation code for palette sizes, and other -* information that changes depending on which architecture is being -* compiled. -*/ - -/* return true if window _win has OSD register D */ -#define s3c_fb_has_osd_d (_win) ((_win) != 4 && (_win) != 0) - -static inline unsigned int s3c_fb_win_pal_size (unsigned int win) -{ -if (win <2 ) -return 256 ; -if (win <4 ) -return 16 ; -if (win ==4 ) -return 4 ; - -BUG ();/* shouldn't get here */ -} - -static inline int s3c_fb_validate_win_bpp (unsigned int win,unsigned int bpp) -{ -/* all windows can do 1/2 bpp */ - -if ((bpp ==25 || bpp ==19 ) && win ==0 ) -return 0 ;/* win 0 does not have 19 or 25bpp modes */ - -if (bpp ==4 && win ==4 ) -return 0 ; - -if (bpp ==8 && (win >=3 )) -return 0 ;/* win 3/4 cannot do 8bpp in any mode */ - -return 1 ; -} -static inline unsigned int s3c_fb_pal_reg (unsigned int window,int reg) {switch (window) {
@@ -203,57 +38,4 @@ static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg) BUG(); } -static inline int s3c_fb_pal_is16 (unsigned int window) -{ -return window >1 ; -} - -struct s3c_fb_palette { -struct fb_bitfield r; -struct fb_bitfield g; -struct fb_bitfield b; -struct fb_bitfield a; -}; - -static inline void s3c_fb_init_palette (unsigned int window, -struct s3c_fb_palette *palette) -{ -if (window <2 ) { -/* Windows 0/1 are 8/8/8 or A/8/8/8 */ - palette->r.offset =16 ; - palette->r.length =8 ; - palette->g.offset =8 ; - palette->g.length =8 ; - palette->b.offset =0 ; - palette->b.length =8 ; - }else { -/* currently we assume RGB 5/6/5 */ - palette->r.offset =11 ; - palette->r.length =5 ; - palette->g.offset =5 ; - palette->g.length =6 ; - palette->b.offset =0 ; - palette->b.length =5 ; - } -} - -/* Notes on per-window bpp settings -* -* Value Win0 Win1 Win2 Win3 Win 4 -* 0000 1(P) 1(P) 1(P) 1(P) 1(P) -* 0001 2(P) 2(P) 2(P) 2(P) 2(P) -* 0010 4(P) 4(P) 4(P) 4(P) -none- -* 0011 8(P) 8(P) -none- -none- -none- -* 0100 -none- 8(A232) 8(A232) -none- -none- -* 0101 16(565) 16(565) 16(565) 16(565) 16(565) -* 0110 -none- 16(A555) 16(A555) 16(A555) 16(A555) -* 0111 16(I555) 16(I565) 16(I555) 16(I555) 16(I555) -* 1000 18(666) 18(666) 18(666) 18(666) 18(666) -* 1001 -none- 18(A665) 18(A665) 18(A665) 16(A665) -* 1010 -none- 19(A666) 19(A666) 19(A666) 19(A666) -* 1011 24(888) 24(888) 24(888) 24(888) 24(888) -* 1100 -none- 24(A887) 24(A887) 24(A887) 24(A887) -* 1101 -none- 25(A888) 25(A888) 25(A888) 25(A888) -* 1110 -none- -none- -none- -none- -none- -* 1111 -none- -none- -none- -none- -none- -*/ +#endif /* __ASM_ARCH_REGS_FB_H */
arch/arm/plat-s3c/include/plat/regs-fb-v4.h new file +235 -0
235 lines not on this page · raw message
Signature · 1 line
1.6.5
PATCH 10/18 ARM: S5PC1xx: add platform helpers for s3c-fb device
From: Pawel Osciak <[email protected]>
From: Pawel Osciak <[email protected]>
Samsung S5PC100 has LCD-controller compatible with the one known from previous SoCs series. Add required platform setup and support code that it can be used with s3c-fb driver.
--- arch/arm/mach-s5pc100/include/mach/irqs.h | 5 + arch/arm/mach-s5pc100/include/mach/regs-fb.h | 139 ++++++++++++++++++++++++++ arch/arm/plat-s3c/include/plat/fb.h | 7 ++ arch/arm/plat-s5pc1xx/Kconfig | 5 + arch/arm/plat-s5pc1xx/Makefile | 1 + arch/arm/plat-s5pc1xx/setup-fb-24bpp.c | 49 +++++++++ 6 files changed, 206 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc100/include/mach/regs-fb.h create mode 100644 arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
arch/arm/mach-s5pc100/include/mach/irqs.h +5 -0
@@ -11,4 +11,9 @@#include <plat/irqs.h> +/* LCD */ +#define IRQ_LCD_FIFO IRQ_LCD0 +#define IRQ_LCD_VSYNC IRQ_LCD1 +#define IRQ_LCD_SYSTEM IRQ_LCD2 +#endif /* __ASM_ARCH_IRQ_H */
arch/arm/mach-s5pc100/include/mach/regs-fb.h new file +139 -0
139 lines not on this page · raw message
arch/arm/plat-s3c/include/plat/fb.h +7 -0
@@ -70,4 +70,11 @@ extern void s3c_fb_set_platdata(struct s3c_fb_platdata *pd);*/ extern void s3c64xx_fb_gpio_setup_24bpp (void ); +/** +* s5pc100_fb_gpio_setup_24bpp() - S5PC100 setup function for 24bpp LCD +* +* Initialise the GPIO for an 24bpp LCD display on the RGB interface. +*/ +extern void s5pc100_fb_gpio_setup_24bpp (void ); +#endif /* __PLAT_S3C_FB_H */
arch/arm/plat-s5pc1xx/Kconfig +5 -0
@@ -37,6 +37,11 @@ config CPU_S5PC100_CLOCK # platform specific device setup +config S5PC1XX_SETUP_FB_24BPP + bool + help + Common setup code for S5PC1XX with an 24bpp RGB display helper. + config S5PC100_SETUP_I2C0 bool default y
arch/arm/plat-s5pc1xx/Makefile +1 -0
@@ -25,5 +25,6 @@ obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.o # Device setup obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o +obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o obj-$(CONFIG_S5PC100_SETUP_I2C0) += setup-i2c0.o obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
arch/arm/plat-s5pc1xx/setup-fb-24bpp.c new file +49 -0
49 lines not on this page · raw message
Signature · 1 line
1.6.5
PATCH 11/18 SMDKC100: enable S3C FrameBuffer
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Add required machine definitions for s3c-fb device.
A 800x480 lcd device (simmilar to the one known from SMDK6410 boards) has been defined. The lcd controller is attached to GPIO lines and can be enabled/disabled with platform-lcd driver.
--- arch/arm/mach-s5pc100/Kconfig | 2 + arch/arm/mach-s5pc100/mach-smdkc100.c | 67 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 0 deletions(-)
arch/arm/mach-s5pc100/Kconfig +2 -0
@@ -17,6 +17,8 @@ config CPU_S5PC100 config MACH_SMDKC100 bool "SMDKC100" select CPU_S5PC100 + select S3C_DEV_FB select S5PC1XX_SETUP_I2C1 + select S5PC1XX_SETUP_FB_24BPP help Machine support for the Samsung SMDKC100
arch/arm/mach-s5pc100/mach-smdkc100.c +67 -0
98 lines not on this page · raw message
Signature · 1 line
1.6.5
PATCH 12/18 drivers: fb: enable S3C FrameBuffer on S5PC1XX platform
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Samsung S5PC100 SoC has LCD display controller compatible to the one known from S3C6410 SoCs. Enable support for s3c-fb driver also on S5PC1xx platform.
--- drivers/video/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/video/Kconfig +1 -1
@@ -1882,7 +1882,7 @@ config FB_TMIO_ACCELL config FB_S3C tristate "Samsung S3C framebuffer support" - depends on FB && ARCH_S3C64XX + depends on FB && (ARCH_S3C64XX || ARCH_S5PC1XX) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT
Signature · 1 line
1.6.5
PATCH 13/18 ARM: S5PC1xx: add platform helpers for i2c adapter devices
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Samsung S5PC100 has I2C bus controller compatible with the one known from previous SoCs series. Add required platform setup and support code that it can be used with s3c2410-i2c driver.
--- arch/arm/mach-s5pc100/cpu.c | 4 ++++ arch/arm/plat-s5pc1xx/Kconfig | 4 ++-- arch/arm/plat-s5pc1xx/Makefile | 4 ++-- arch/arm/plat-s5pc1xx/setup-i2c0.c | 7 ++++++- arch/arm/plat-s5pc1xx/setup-i2c1.c | 7 ++++++- 5 files changed, 20 insertions(+), 6 deletions(-)
arch/arm/mach-s5pc100/cpu.c +4 -0
@@ -75,6 +75,10 @@ void __init s5pc100_map_io(void)iotable_init (s5pc100_iodesc,ARRAY_SIZE (s5pc100_iodesc));/* initialise device information early */ + +/* the i2c devices are directly compatible with s3c2440 */ +s3c_i2c0_setname ("s3c2440-i2c" ); +s3c_i2c1_setname ("s3c2440-i2c" ); }void __init s5pc100_init_clocks (int xtal)
arch/arm/plat-s5pc1xx/Kconfig +2 -2
@@ -42,7 +42,7 @@ config S5PC1XX_SETUP_FB_24BPP help Common setup code for S5PC1XX with an 24bpp RGB display helper. -config S5PC100_SETUP_I2C0 +config S5PC1XX_SETUP_I2C0 bool default y help
@@ -51,7 +51,7 @@ config S5PC100_SETUP_I2C0 Note, currently since i2c0 is always compiled, this setup helper is always compiled with it. -config S5PC100_SETUP_I2C1 +config S5PC1XX_SETUP_I2C1 bool help Common setup code for i2c bus 1.
arch/arm/plat-s5pc1xx/Makefile +2 -2
@@ -26,5 +26,5 @@ obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.o obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o -obj-$(CONFIG_S5PC100_SETUP_I2C0) += setup-i2c0.o -obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o +obj-$(CONFIG_S5PC1XX_SETUP_I2C0) += setup-i2c0.o +obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o
arch/arm/plat-s5pc1xx/setup-i2c0.c +6 -1
@@ -17,9 +17,14 @@struct platform_device ;/* don't need the contents */ +#include <mach/gpio.h> #include <plat/iic.h> +#include <plat/gpio-cfg.h> void s3c_i2c0_cfg_gpio (struct platform_device *dev) { -/* Pin configuration would be needed */ +s3c_gpio_cfgpin (S5PC100_GPD (3 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC100_GPD (3 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC100_GPD (4 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC100_GPD (4 ),S3C_GPIO_PULL_UP ); }
arch/arm/plat-s5pc1xx/setup-i2c1.c +6 -1
@@ -17,9 +17,14 @@struct platform_device ;/* don't need the contents */ +#include <mach/gpio.h> #include <plat/iic.h> +#include <plat/gpio-cfg.h> void s3c_i2c1_cfg_gpio (struct platform_device *dev) { -/* Pin configuration would be needed */ +s3c_gpio_cfgpin (S5PC100_GPD (5 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC100_GPD (5 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC100_GPD (6 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC100_GPD (6 ),S3C_GPIO_PULL_UP ); }
Signature · 1 line
1.6.5
PATCH 14/18 SMDKC100: add I2C0 and I2C1 buses support
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Add required machine definitions for I2C 0 and 1 bus controllers. Currently no I2C device are defined yet.
--- arch/arm/mach-s5pc100/Kconfig | 2 ++ arch/arm/mach-s5pc100/mach-smdkc100.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 0 deletions(-)
arch/arm/mach-s5pc100/Kconfig +2 -0
@@ -18,6 +18,8 @@ config MACH_SMDKC100 bool "SMDKC100" select CPU_S5PC100 select S3C_DEV_FB + select S3C_DEV_I2C1 + select S5PC1XX_SETUP_I2C0 select S5PC1XX_SETUP_I2C1 select S5PC1XX_SETUP_FB_24BPP help
arch/arm/mach-s5pc100/mach-smdkc100.c +17 -0
@@ -42,6 +42,7 @@#include <plat/cpu.h> #include <plat/s5pc100.h> #include <plat/fb.h> +#include <plat/iic.h> #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK)#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)
@@ -78,6 +79,14 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = { }, }; +/* I2C0 */ +static struct i2c_board_info i2c_devs0[]__initdata = { +}; + +/* I2C1 */ +static struct i2c_board_info i2c_devs1[]__initdata = { +}; +/* LCD power controller */ static void smdkc100_lcd_power_set (struct plat_lcd_data *pd,unsigned int power)
@@ -135,6 +144,8 @@ static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = {static struct map_desc smdkc100_iodesc[] = {};static struct platform_device *smdkc100_devices[]__initdata = { + &s3c_device_i2c0, + &s3c_device_i2c1, &s3c_device_fb, &smdkc100_lcd_powerdev, };
@@ -148,6 +159,12 @@ static void __init smdkc100_map_io(void)static void __init smdkc100_machine_init (void ) { +/* I2C */ +s3c_i2c0_set_platdata (NULL ); +s3c_i2c1_set_platdata (NULL ); +i2c_register_board_info (0 , i2c_devs0,ARRAY_SIZE (i2c_devs0)); +i2c_register_board_info (1 , i2c_devs1,ARRAY_SIZE (i2c_devs1)); +s3c_fb_set_platdata (&smdkc100_lcd_pdata);/* LCD init */
Signature · 1 line
1.6.5
PATCH 15/18 drivers: i2c: s3c2410-i2c also on S5PC1XX platform
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Samsung S5PC100 SoC has I2C controllers directly compatible to the one known from S3C24x0 SoCs. Enable support for s3c-i2c driver also on S5PC1xx platform.
--- drivers/i2c/busses/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/Kconfig +1 -1
@@ -494,7 +494,7 @@ config I2C_PXA_SLAVE config I2C_S3C2410 tristate "S3C2410 I2C Driver" - depends on ARCH_S3C2410 || ARCH_S3C64XX + depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC1XX help Say Y here to include support for I2C controller in the Samsung S3C2410 based System-on-Chip devices.
Signature · 1 line
1.6.5
PATCH 16/18 ARM: S5PC1xx: add platform helpers for SDHCI host controllers
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Samsung S5PC100 has 3 SDHCI controllers compatible with the one known from previous SoCs series. Add required platform setup and support code that the devices can be used with sdhci-s3c driver.
--- arch/arm/mach-s5pc100/Kconfig | 6 ++ arch/arm/mach-s5pc100/Makefile | 4 ++ arch/arm/mach-s5pc100/cpu.c | 3 + arch/arm/mach-s5pc100/setup-sdhci.c | 63 ++++++++++++++++++++++ arch/arm/plat-s3c/Kconfig | 5 ++ arch/arm/plat-s3c/Makefile | 1 + arch/arm/plat-s3c/dev-hsmmc2.c | 65 ++++++++++++++++++++++ arch/arm/plat-s3c/include/plat/sdhci.h | 55 +++++++++++++++++++ arch/arm/plat-s5pc1xx/Kconfig | 6 ++ arch/arm/plat-s5pc1xx/Makefile | 1 + arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c | 86 ++++++++++++++++++++++++++++++ 11 files changed, 295 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc100/setup-sdhci.c create mode 100644 arch/arm/plat-s3c/dev-hsmmc2.c create mode 100644 arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
arch/arm/mach-s5pc100/Kconfig +6 -0
@@ -14,6 +14,12 @@ config CPU_S5PC100 help Enable S5PC100 CPU support +config S5PC100_SETUP_SDHCI + bool + select S5PC1XX_SETUP_SDHCI_GPIO + help + Internal helper functions for S5PC100 based SDHCI systems + config MACH_SMDKC100 bool "SMDKC100" select CPU_S5PC100
arch/arm/mach-s5pc100/Makefile +4 -0
@@ -13,5 +13,9 @@ obj- := obj-$(CONFIG_CPU_S5PC100) += cpu.o +# Helper and device support + +obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o + # machine support obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o
arch/arm/mach-s5pc100/cpu.c +3 -0
@@ -75,6 +75,9 @@ void __init s5pc100_map_io(void)iotable_init (s5pc100_iodesc,ARRAY_SIZE (s5pc100_iodesc));/* initialise device information early */ +s5pc100_default_sdhci0 (); +s5pc100_default_sdhci1 (); +s5pc100_default_sdhci2 ();/* the i2c devices are directly compatible with s3c2440 */ s3c_i2c0_setname ("s3c2440-i2c" );
arch/arm/mach-s5pc100/setup-sdhci.c new file +63 -0
63 lines not on this page · raw message
arch/arm/plat-s3c/Kconfig +5 -0
@@ -184,6 +184,11 @@ config S3C_DEV_HSMMC1 help Compile in platform device definitions for HSMMC channel 1 +config S3C_DEV_HSMMC2 + bool + help + Compile in platform device definitions for HSMMC channel 2 + config S3C_DEV_I2C1 bool help
arch/arm/plat-s3c/Makefile +1 -0
@@ -36,6 +36,7 @@ obj-$(CONFIG_HAVE_PWM) += pwm.o obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o +obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o obj-y += dev-i2c0.o obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
arch/arm/plat-s3c/dev-hsmmc2.c new file +65 -0
65 lines not on this page · raw message
arch/arm/plat-s3c/include/plat/sdhci.h +55 -0
76 lines not on this page · raw message
arch/arm/plat-s5pc1xx/Kconfig +6 -0
@@ -55,4 +55,10 @@ config S5PC1XX_SETUP_I2C1 bool help Common setup code for i2c bus 1. + +config S5PC1XX_SETUP_SDHCI_GPIO + bool + help + Common setup code for SDHCI gpio. + endif
arch/arm/plat-s5pc1xx/Makefile +1 -0
@@ -28,3 +28,4 @@ obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o obj-$(CONFIG_S5PC1XX_SETUP_I2C0) += setup-i2c0.o obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o +obj-$(CONFIG_S5PC1XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c new file +86 -0
86 lines not on this page · raw message
Signature · 1 line
1.6.5
PATCH 17/18 SMDKC100: add SDHCI controllers 0, 1 and 2 support
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Add required machine definitions for SDHCI controller 0, 1 and 2. SMDKC100 has 2 SDHCI/MMC ports. Port 1 is directly connected to controller 0. Port 1 can be conntected to controler 1 or 2, depending on jumper setup.
--- arch/arm/mach-s5pc100/Kconfig | 4 ++++ arch/arm/mach-s5pc100/mach-smdkc100.c | 3 +++ 2 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-s5pc100/Kconfig +4 -0
@@ -25,8 +25,12 @@ config MACH_SMDKC100 select CPU_S5PC100 select S3C_DEV_FB select S3C_DEV_I2C1 + select S3C_DEV_HSMMC + select S3C_DEV_HSMMC1 + select S3C_DEV_HSMMC2 select S5PC1XX_SETUP_I2C0 select S5PC1XX_SETUP_I2C1 select S5PC1XX_SETUP_FB_24BPP + select S5PC100_SETUP_SDHCI help Machine support for the Samsung SMDKC100
arch/arm/mach-s5pc100/mach-smdkc100.c +3 -0
@@ -147,6 +147,9 @@ static struct platform_device *smdkc100_devices[] __initdata = { &s3c_device_i2c0, &s3c_device_i2c1, &s3c_device_fb, + &s3c_device_hsmmc0, + &s3c_device_hsmmc1, + &s3c_device_hsmmc2, &smdkc100_lcd_powerdev, };
Signature · 1 line
1.6.5
PATCH 18/18 drivers: MMC: enable SDHCI-S3C on S5PC1XX platform
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Samsung S5PC100 SoC has SDHCI controller compatible to the one known from S3C64xx SoCs. Enable support for sdhci-s3c driver also on S5PC1xx platform.
--- drivers/mmc/host/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/Kconfig +1 -1
@@ -96,7 +96,7 @@ config MMC_SDHCI_PLTFM config MMC_SDHCI_S3C tristate "SDHCI support on Samsung S3C SoC" - depends on MMC_SDHCI && (PLAT_S3C24XX || PLAT_S3C64XX) + depends on MMC_SDHCI && (PLAT_S3C24XX || PLAT_S3C64XX || PLAT_S5PC1XX) help This selects the Secure Digital Host Controller Interface (SDHCI) often referrered to as the HSMMC block in some of the Samsung S3C
Signature · 1 line
1.6.5
PATCH 18/18 drivers: MMC: enable SDHCI-S3C on S5PC1XX platform
Quoted 6 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Samsung S5PC100 SoC has SDHCI controller compatible to the one known from S3C64xx SoCs. Enable support for sdhci-s3c driver also on S5PC1xx platform.
This can go to the SDHCI mainter(s) with my Acked-by line.
Begining to think we need a CONFIG_HAS_SAMSUNG_SDHCI somewhere that these archs can select.
Quoted 2 lines
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>
Quoted 25 lines
--- drivers/mmc/host/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/mmc/host/Kconfig +1
-1@@ -96,7 +96,7 @@ config MMC_SDHCI_PLTFM config MMC_SDHCI_S3C tristate "SDHCI support on Samsung S3C SoC" - depends on MMC_SDHCI && (PLAT_S3C24XX || PLAT_S3C64XX) + depends on MMC_SDHCI && (PLAT_S3C24XX || PLAT_S3C64XX || PLAT_S5PC1XX) help This selects the Secure Digital Host Controller Interface (SDHCI) often referrered to as the HSMMC block in some of the Samsung S3CSignature · 7 lines
1.6.5 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 16/18 ARM: S5PC1xx: add platform helpers for SDHCI host controllers
In reply to Marek SzyprowskiQuoted 78 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Samsung S5PC100 has 3 SDHCI controllers compatible with the one known from previous SoCs series. Add required platform setup and support code that the devices can be used with sdhci-s3c driver.
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/mach-s5pc100/Kconfig | 6 ++ arch/arm/mach-s5pc100/Makefile | 4 ++ arch/arm/mach-s5pc100/cpu.c | 3 + arch/arm/mach-s5pc100/setup-sdhci.c | 63 ++++++++++++++++++++++ arch/arm/plat-s3c/Kconfig | 5 ++ arch/arm/plat-s3c/Makefile | 1 + arch/arm/plat-s3c/dev-hsmmc2.c | 65 ++++++++++++++++++++++ arch/arm/plat-s3c/include/plat/sdhci.h | 55 +++++++++++++++++++ arch/arm/plat-s5pc1xx/Kconfig | 6 ++ arch/arm/plat-s5pc1xx/Makefile | 1 + arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c | 86 ++++++++++++++++++++++++++++++ 11 files changed, 295 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc100/setup-sdhci.c create mode 100644 arch/arm/plat-s3c/dev-hsmmc2.c create mode 100644 arch/arm/plat-s5pc1xx/setup-sdhci-gpio.carch/arm/mach-s5pc100/Kconfig +6
-0@@ -14,6 +14,12 @@ config CPU_S5PC100 help Enable S5PC100 CPU support +config S5PC100_SETUP_SDHCI + bool + select S5PC1XX_SETUP_SDHCI_GPIO + help + Internal helper functions for S5PC100 based SDHCI systems + config MACH_SMDKC100 bool "SMDKC100" select CPU_S5PC100arch/arm/mach-s5pc100/Makefile +4
-0@@ -13,5 +13,9 @@ obj- := obj-$(CONFIG_CPU_S5PC100) += cpu.o +# Helper and device support + +obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o + # machine support obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.oarch/arm/mach-s5pc100/cpu.c +3
-0@@ -75,6 +75,9 @@ void __init s5pc100_map_io(void)iotable_init (s5pc100_iodesc,ARRAY_SIZE (s5pc100_iodesc));/* initialise device information early */ +s5pc100_default_sdhci0 (); +s5pc100_default_sdhci1 (); +s5pc100_default_sdhci2 ();/* the i2c devices are directly compatible with s3c2440 */ s3c_i2c0_setname ("s3c2440-i2c" );arch/arm/mach-s5pc100/setup-sdhci.c new file +0
-0
arch/arm/mach-s5pc100/setup-sdhci.c line 10
Quoted 10 lines
arch/arm/mach-s5pc100/setup-sdhci.c new file +10
-0@@ -0,0 +1,63 @@ +/* linux/arch/arm/mach-s5pc100/setup-sdhci.c +* +* Copyright 2008 Samsung Electronics +* +* S5PC100 - Helper functions for settign up SDHCI device(s) (HSMMC) +* +* 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. +*/
Again an attribution to where the original for this came from would have been nice, however it isn't really a barrier to applying this. It can always be fixed later.
Quoted 358 lines
arch/arm/mach-s5pc100/setup-sdhci.c new file +52
-0+#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/interrupt.h> +#include <linux/platform_device.h> +#include <linux/io.h> + +#include <linux/mmc/card.h> +#include <linux/mmc/host.h> + +#include <plat/regs-sdhci.h> +#include <plat/sdhci.h> + +/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ + +char *s5pc100_hsmmc_clksrcs[4 ] = { + [0 ] ="hsmmc" , + [1 ] ="hsmmc" , +/* [2] = "mmc_bus", not yet succesfuuly used yet */ +/* [3] = "48m", - note not succesfully used yet */ +}; + + +void s5pc100_setup_sdhci0_cfg_card (struct platform_device *dev, +void __iomem *r, +struct mmc_ios *ios, +struct mmc_card *card) +{ +u32 ctrl2, ctrl3; + +/* don't need to alter anything acording to card-type */ + +writel (S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r +S3C64XX_SDHCI_CONTROL4 ); + + ctrl2 =readl (r +S3C_SDHCI_CONTROL2 ); + ctrl2 &=S3C_SDHCI_CTRL2_SELBASECLK_MASK ; + ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR | +S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK | +S3C_SDHCI_CTRL2_ENFBCLKRX | +S3C_SDHCI_CTRL2_DFCNT_NONE | +S3C_SDHCI_CTRL2_ENCLKOUTHOLD ); + +if (ios->clock <25 *1000000 ) + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 | +S3C_SDHCI_CTRL3_FCSEL2 | +S3C_SDHCI_CTRL3_FCSEL1 | +S3C_SDHCI_CTRL3_FCSEL0 ); +else + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 |S3C_SDHCI_CTRL3_FCSEL0 ); + +writel (ctrl2, r +S3C_SDHCI_CONTROL2 ); +writel (ctrl3, r +S3C_SDHCI_CONTROL3 ); +}arch/arm/plat-s3c/Kconfig +5
-0@@ -184,6 +184,11 @@ config S3C_DEV_HSMMC1 help Compile in platform device definitions for HSMMC channel 1 +config S3C_DEV_HSMMC2 + bool + help + Compile in platform device definitions for HSMMC channel 2 + config S3C_DEV_I2C1 bool helparch/arm/plat-s3c/Makefile +1
-0@@ -36,6 +36,7 @@ obj-$(CONFIG_HAVE_PWM) += pwm.o obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o +obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o obj-y += dev-i2c0.o obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o obj-$(CONFIG_S3C_DEV_FB) += dev-fb.oarch/arm/plat-s3c/dev-hsmmc2.c new file +65
-0@@ -0,0 +1,65 @@ +/* linux/arch/arm/plat-s3c/dev-hsmmc2.c +* +* Copyright (c) 2009 Samsung Electronics +* +* S3C series device definition for hsmmc device 2 +* +* 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/kernel.h> +#include <linux/platform_device.h> +#include <linux/mmc/host.h> + +#include <mach/map.h> +#include <plat/sdhci.h> +#include <plat/devs.h> + +#define S3C_SZ_HSMMC (0x1000) + +static struct resource s3c_hsmmc2_resource[] = { + [0 ] = { + .start =S3C_PA_HSMMC2 , + .end =S3C_PA_HSMMC2 +S3C_SZ_HSMMC -1 , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =IRQ_HSMMC2 , + .end =IRQ_HSMMC2 , + .flags =IORESOURCE_IRQ , + } +}; + +static u64 s3c_device_hsmmc2_dmamask =0xffffffffUL ; + +struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = { + .max_width =4 , + .host_caps = (MMC_CAP_4_BIT_DATA | +MMC_CAP_MMC_HIGHSPEED |MMC_CAP_SD_HIGHSPEED ), +}; + +struct platform_device s3c_device_hsmmc2 = { + .name ="s3c-sdhci" , + .id =2 , + .num_resources =ARRAY_SIZE (s3c_hsmmc2_resource), + .resource = s3c_hsmmc2_resource, + .dev = { + .dma_mask = &s3c_device_hsmmc2_dmamask, + .coherent_dma_mask =0xffffffffUL , + .platform_data = &s3c_hsmmc2_def_platdata, + }, +}; + +void s3c_sdhci2_set_platdata (struct s3c_sdhci_platdata *pd) +{ +struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata; + + set->max_width = pd->max_width; + +if (pd->cfg_gpio) + set->cfg_gpio = pd->cfg_gpio; +if (pd->cfg_card) + set->cfg_card = pd->cfg_card; +}arch/arm/plat-s3c/include/plat/sdhci.h +55
-0@@ -57,6 +57,7 @@ struct s3c_sdhci_platdata {*/ extern void s3c_sdhci0_set_platdata (struct s3c_sdhci_platdata *pd);extern void s3c_sdhci1_set_platdata (struct s3c_sdhci_platdata *pd); +extern void s3c_sdhci2_set_platdata (struct s3c_sdhci_platdata *pd);/* Default platform data, exported so that per-cpu initialisation can * set the correct one when there are more than one cpu type selected. @@ -64,11 +65,15 @@ extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd);extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata;extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata; +extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata;/* Helper function availablity */ extern void s3c64xx_setup_sdhci0_cfg_gpio (struct platform_device *,int w);extern void s3c64xx_setup_sdhci1_cfg_gpio (struct platform_device *,int w); +extern void s5pc100_setup_sdhci0_cfg_gpio (struct platform_device *,int w); +extern void s5pc100_setup_sdhci1_cfg_gpio (struct platform_device *,int w); +extern void s5pc100_setup_sdhci2_cfg_gpio (struct platform_device *,int w);/* S3C6400 SDHCI setup */ @@ -145,4 +150,54 @@ static inline void s3c6410_default_sdhci0(void) { }static inline void s3c6410_default_sdhci1 (void ) { }#endif /* CONFIG_S3C6410_SETUP_SDHCI */ +/* S5PC100 SDHCI setup */ + +#ifdef CONFIG_S5PC100_SETUP_SDHCI +extern char *s5pc100_hsmmc_clksrcs[4 ]; + +extern void s5pc100_setup_sdhci0_cfg_card (struct platform_device *dev, +void __iomem *r, +struct mmc_ios *ios, +struct mmc_card *card); + +#ifdef CONFIG_S3C_DEV_HSMMC +static inline void s5pc100_default_sdhci0 (void ) +{ + s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs; + s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio; + s3c_hsmmc0_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; +} +#else +static inline void s5pc100_default_sdhci0 (void ) { } +#endif /* CONFIG_S3C_DEV_HSMMC */ + +#ifdef CONFIG_S3C_DEV_HSMMC1 +static inline void s5pc100_default_sdhci1 (void ) +{ + s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs; + s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio; + s3c_hsmmc1_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; +} +#else +static inline void s5pc100_default_sdhci1 (void ) { } +#endif /* CONFIG_S3C_DEV_HSMMC1 */ + +#ifdef CONFIG_S3C_DEV_HSMMC2 +static inline void s5pc100_default_sdhci2 (void ) +{ + s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs; + s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio; + s3c_hsmmc2_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; +} +#else +static inline void s5pc100_default_sdhci2 (void ) { } +#endif /* CONFIG_S3C_DEV_HSMMC1 */ + + +#else +static inline void s5pc100_default_sdhci0 (void ) { } +static inline void s5pc100_default_sdhci1 (void ) { } +static inline void s5pc100_default_sdhci2 (void ) { } +#endif /* CONFIG_S5PC100_SETUP_SDHCI */ +#endif /* __PLAT_S3C_SDHCI_H */ arch/arm/plat-s5pc1xx/Kconfig +6
-0@@ -55,4 +55,10 @@ config S5PC1XX_SETUP_I2C1 bool help Common setup code for i2c bus 1. + +config S5PC1XX_SETUP_SDHCI_GPIO + bool + help + Common setup code for SDHCI gpio. + endifarch/arm/plat-s5pc1xx/Makefile +1
-0@@ -28,3 +28,4 @@ obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o obj-$(CONFIG_S5PC1XX_SETUP_I2C0) += setup-i2c0.o obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o +obj-$(CONFIG_S5PC1XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.oarch/arm/plat-s5pc1xx/setup-sdhci-gpio.c new file +86
-0@@ -0,0 +1,86 @@ +/* linux/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c +* +* Copyright 2009 Samsung Eletronics +* +* S5PC1XX - Helper functions for setting up SDHCI device(s) GPIO (HSMMC) +* +* 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/kernel.h> +#include <linux/types.h> +#include <linux/interrupt.h> +#include <linux/platform_device.h> +#include <linux/io.h> +#include <linux/mmc/host.h> +#include <linux/mmc/card.h> + +#include <mach/gpio.h> +#include <plat/gpio-cfg.h> +#include <plat/regs-sdhci.h> + +void s5pc100_setup_sdhci0_cfg_gpio (struct platform_device *dev,int width) +{ +unsigned int gpio; +unsigned int end; +unsigned int num; + + num = width; +/* In case of 8 width, we should decrease the 2 */ +if (width ==8 ) + num = width -2 ; + + end =S5PC100_GPG0 (2 + num); + +/* Set all the necessary GPG0/GPG1 pins to special-function 0 */ +for (gpio =S5PC100_GPG0 (0 ); gpio < end; gpio++) { +s3c_gpio_cfgpin (gpio,S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (gpio,S3C_GPIO_PULL_NONE ); + } + +if (width ==8 ) { +for (gpio =S5PC100_GPG1 (0 ); gpio <=S5PC100_GPG1 (1 ); gpio++) { +s3c_gpio_cfgpin (gpio,S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (gpio,S3C_GPIO_PULL_NONE ); + } + } + +s3c_gpio_setpull (S5PC100_GPG1 (2 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC100_GPG1 (2 ),S3C_GPIO_SFN (2 )); +} + +void s5pc100_setup_sdhci1_cfg_gpio (struct platform_device *dev,int width) +{ +unsigned int gpio; +unsigned int end; + + end =S5PC100_GPG2 (2 + width); + +/* Set all the necessary GPG2 pins to special-function 2 */ +for (gpio =S5PC100_GPG2 (0 ); gpio < end; gpio++) { +s3c_gpio_cfgpin (gpio,S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (gpio,S3C_GPIO_PULL_NONE ); + } + +s3c_gpio_setpull (S5PC100_GPG2 (6 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC100_GPG2 (6 ),S3C_GPIO_SFN (2 )); +} + +void s5pc100_setup_sdhci2_cfg_gpio (struct platform_device *dev,int width) +{ +unsigned int gpio; +unsigned int end; + + end =S5PC100_GPG3 (2 + width); + +/* Set all the necessary GPG3 pins to special-function 2 */ +for (gpio =S5PC100_GPG3 (0 ); gpio < end; gpio++) { +s3c_gpio_cfgpin (gpio,S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (gpio,S3C_GPIO_PULL_NONE ); + } + +s3c_gpio_setpull (S5PC100_GPG3 (6 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC100_GPG3 (6 ),S3C_GPIO_SFN (2 )); +}Signature · 7 lines
1.6.5 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 15/18 drivers: i2c: s3c2410-i2c also on S5PC1XX platform
In reply to Marek SzyprowskiQuoted 7 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Samsung S5PC100 SoC has I2C controllers directly compatible to the one known from S3C24x0 SoCs. Enable support for s3c-i2c driver also on S5PC1xx platform.
I'll apply this to my i2c-next tree,
Quoted 27 lines
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- drivers/i2c/busses/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/i2c/busses/Kconfig +1
-1@@ -494,7 +494,7 @@ config I2C_PXA_SLAVE config I2C_S3C2410 tristate "S3C2410 I2C Driver" - depends on ARCH_S3C2410 || ARCH_S3C64XX + depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC1XX help Say Y here to include support for I2C controller in the Samsung S3C2410 based System-on-Chip devices.Signature · 7 lines
1.6.5 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 12/18 drivers: fb: enable S3C FrameBuffer on S5PC1XX platform
In reply to Marek SzyprowskiQuoted 7 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Samsung S5PC100 SoC has LCD display controller compatible to the one known from S3C6410 SoCs. Enable support for s3c-fb driver also on S5PC1xx platform.
Pending the the resolution of the previous fb patches.
Quoted 27 lines
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- drivers/video/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/video/Kconfig +1
-1@@ -1882,7 +1882,7 @@ config FB_TMIO_ACCELL config FB_S3C tristate "Samsung S3C framebuffer support" - depends on FB && ARCH_S3C64XX + depends on FB && (ARCH_S3C64XX || ARCH_S5PC1XX) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLITSignature · 7 lines
1.6.5 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 11/18 SMDKC100: enable S3C FrameBuffer
In reply to Marek SzyprowskiQuoted 11 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Add required machine definitions for s3c-fb device.
A 800x480 lcd device (simmilar to the one known from SMDK6410 boards) has been defined. The lcd controller is attached to GPIO lines and can be enabled/disabled with platform-lcd driver.Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>
I'll see if this will apply and compile without the previous FB patches until they've been sorted out.
Quoted 131 lines
--- arch/arm/mach-s5pc100/Kconfig | 2 + arch/arm/mach-s5pc100/mach-smdkc100.c | 67 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 0 deletions(-)arch/arm/mach-s5pc100/Kconfig +2
-0@@ -17,6 +17,8 @@ config CPU_S5PC100 config MACH_SMDKC100 bool "SMDKC100" select CPU_S5PC100 + select S3C_DEV_FB select S5PC1XX_SETUP_I2C1 + select S5PC1XX_SETUP_FB_24BPP help Machine support for the Samsung SMDKC100arch/arm/mach-s5pc100/mach-smdkc100.c +67
-0@@ -27,16 +27,21 @@#include <asm/mach/map.h> #include <mach/map.h> +#include <mach/regs-fb.h> +#include <video/platform_lcd.h> #include <asm/irq.h> #include <asm/mach-types.h> #include <plat/regs-serial.h> +#include <plat/gpio-cfg.h> +#include <plat/regs-gpio.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> #include <plat/s5pc100.h> +#include <plat/fb.h> #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK)#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)@@ -73,9 +78,65 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = { }, }; +/* LCD power controller */ +static void smdkc100_lcd_power_set (struct plat_lcd_data *pd, +unsigned int power) +{ +/* backlight */ +gpio_direction_output (S5PC100_GPD (0 ), power); + +if (power) { +/* module reset */ +gpio_direction_output (S5PC100_GPH0 (6 ),1 ); +mdelay (100 ); +gpio_direction_output (S5PC100_GPH0 (6 ),0 ); +mdelay (10 ); +gpio_direction_output (S5PC100_GPH0 (6 ),1 ); +mdelay (10 ); + } +} + +static struct plat_lcd_data smdkc100_lcd_power_data = { + .set_power = smdkc100_lcd_power_set, +}; + +static struct platform_device smdkc100_lcd_powerdev = { + .name ="platform-lcd" , + .dev.parent = &s3c_device_fb.dev, + .dev.platform_data = &smdkc100_lcd_power_data, +}; + +/* Frame Buffer */ +static struct s3c_fb_pd_win smdkc100_fb_win0 = { +/* this is to ensure we use win0 */ + .win_mode = { + .refresh =70 , + .pixclock = (8 +13 +3 +800 )*(7 +5 +1 +480 ), + .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 smdkc100_lcd_pdata__initdata = { + .win[0 ] = &smdkc100_fb_win0, + .vidcon0 =VIDCON0_VIDOUT_RGB |VIDCON0_PNRMODE_RGB , + .vidcon1 =VIDCON1_INV_HSYNC |VIDCON1_INV_VSYNC , + .setup_gpio = s5pc100_fb_gpio_setup_24bpp, +}; +static struct map_desc smdkc100_iodesc[] = {};static struct platform_device *smdkc100_devices[]__initdata = { + &s3c_device_fb, + &smdkc100_lcd_powerdev, };static void __init smdkc100_map_io (void )@@ -87,6 +148,12 @@ static void __init smdkc100_map_io(void)static void __init smdkc100_machine_init (void ) { +s3c_fb_set_platdata (&smdkc100_lcd_pdata); + +/* LCD init */ +gpio_request (S5PC100_GPD (0 ),"GPD" ); +gpio_request (S5PC100_GPH0 (6 ),"GPH0" ); +smdkc100_lcd_power_set (&smdkc100_lcd_power_data,0 );platform_add_devices (smdkc100_devices,ARRAY_SIZE (smdkc100_devices)); }Signature · 7 lines
1.6.5 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 9/18 ARM: S3C: Prepare s3c64xx-specific s3c-fb register definition for reuse
In reply to Marek SzyprowskiQuoted 26 lines · Marek Szyprowski
From: Pawel Osciak <[email protected]>
From: Pawel Osciak <[email protected]>
S5PC1xx Samsung SOC series has very similar frame buffer hardware, so a lot of the code can be shared. Moved s3c64xx-specific s3c-fb register definitions from mach-s3c6400 to common platform directory as
regs-fb-v4.h. The new v4 file will be common for S3C6400, S3C6410, S5PC100 and possibly others. Some s3c64xx series specific defines (palette handling) were left ins3c-6400/mach/regs-fb.h, because it is handled differently in S5PC1xx series.Signed-off-by Pawel Osciak <[email protected]>Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/mach-s3c6400/include/mach/regs-fb.h | 236 +------------------------- arch/arm/plat-s3c/include/plat/regs-fb-v4.h | 235 +++++++++++++++++++++++++ 2 files changed, 244 insertions(+), 227 deletions(-) create mode 100644 arch/arm/plat-s3c/include/plat/regs-fb-v4.harch/arm/mach-s3c6400/include/mach/regs-fb.h +0
-0
arch/arm/mach-s3c6400/include/mach/regs-fb.h line 4
Quoted 10 lines
arch/arm/mach-s3c6400/include/mach/regs-fb.h +2
-6@@ -1,195 +1,30 @@ -/* arch/arm/mach-s3c6400/include/mach/regs-fb.h -* +/* * Copyright 2008 Openmoko, Inc. * Copyright 2008 Simtec Electronics -* http://armlinux.simtec.co.uk/ -* Ben Dooks <[email protected]> -* -* S3C64XX - new-style framebuffer register definitions +* Copyright 2009 Samsung Electronics Co.
I'm not sure what you are trying to do here, it looks like a file rename but leaving fragments of the original file?
Quoted 500 lines
arch/arm/mach-s3c6400/include/mach/regs-fb.h +7
-221-* This is the register set for the new style framebuffer interface -* found from the S3C2443 onwards and specifically the S3C64XX series -* S3C6400 and S3C6410. +* Pawel Osciak <[email protected]> +* Based on plat-s3c/include/plat/regs-fb.h by Ben Dooks <[email protected]> * -* The file contains the cpu specific items which change between whichever -* architecture is selected. See <plat/regs-fb.h> for the core definitions -* that are the same. +* Framebuffer register definitions for Samsung S3C64xx. * * 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 the core definitions here, in case we really do need to -* override them at a later date. -*/ - -#include <plat/regs-fb.h> - -#define S3C_FB_MAX_WIN (5)/* number of hardware windows available. */ -#define VIDCON1_FSTATUS_EVEN (1 << 15) - -/* Video timing controls */ -#define VIDTCON0 (0x10) -#define VIDTCON1 (0x14) -#define VIDTCON2 (0x18) - -/* Window position controls */ - -#define WINCON (_win) (0x20 + ((_win) * 4)) - -/* OSD1 and OSD4 do not have register D */ - -#define VIDOSD_A (_win) (0x40 + ((_win) * 16)) -#define VIDOSD_B (_win) (0x44 + ((_win) * 16)) -#define VIDOSD_C (_win) (0x48 + ((_win) * 16)) -#define VIDOSD_D (_win) (0x4C + ((_win) * 16)) - -/* Video buffer addresses */ - -#define VIDW_BUF_START (_buff) (0xA0 + ((_buff) * 8)) -#define VIDW_BUF_START1 (_buff) (0xA4 + ((_buff) * 8)) -#define VIDW_BUF_END (_buff) (0xD0 + ((_buff) * 8)) -#define VIDW_BUF_END1 (_buff) (0xD4 + ((_buff) * 8)) -#define VIDW_BUF_SIZE (_buff) (0x100 + ((_buff) * 4)) - -#define VIDINTCON0 (0x130) - -#define WxKEYCONy (_win, _con) ((0x140 + ((_win) * 8)) + ((_con) * 4)) - -/* WINCONx */ - -#define WINCONx_CSCWIDTH_MASK (0x3 << 26) -#define WINCONx_CSCWIDTH_SHIFT (26) -#define WINCONx_CSCWIDTH_WIDE (0x0 << 26) -#define WINCONx_CSCWIDTH_NARROW (0x3 << 26) - -#define WINCONx_ENLOCAL (1 << 22) -#define WINCONx_BUFSTATUS (1 << 21) -#define WINCONx_BUFSEL (1 << 20) -#define WINCONx_BUFAUTOEN (1 << 19) -#define WINCONx_YCbCr (1 << 13) - -#define WINCON1_LOCALSEL_CAMIF (1 << 23) - -#define WINCON2_LOCALSEL_CAMIF (1 << 23) -#define WINCON2_BLD_PIX (1 << 6) - -#define WINCON2_ALPHA_SEL (1 << 1) -#define WINCON2_BPPMODE_MASK (0xf << 2) -#define WINCON2_BPPMODE_SHIFT (2) -#define WINCON2_BPPMODE_1BPP (0x0 << 2) -#define WINCON2_BPPMODE_2BPP (0x1 << 2) -#define WINCON2_BPPMODE_4BPP (0x2 << 2) -#define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2) -#define WINCON2_BPPMODE_16BPP_565 (0x5 << 2) -#define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2) -#define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2) -#define WINCON2_BPPMODE_18BPP_666 (0x8 << 2) -#define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2) -#define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2) -#define WINCON2_BPPMODE_24BPP_888 (0xb << 2) -#define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2) -#define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2) -#define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2) - -#define WINCON3_BLD_PIX (1 << 6) - -#define WINCON3_ALPHA_SEL (1 << 1) -#define WINCON3_BPPMODE_MASK (0xf << 2) -#define WINCON3_BPPMODE_SHIFT (2) -#define WINCON3_BPPMODE_1BPP (0x0 << 2) -#define WINCON3_BPPMODE_2BPP (0x1 << 2) -#define WINCON3_BPPMODE_4BPP (0x2 << 2) -#define WINCON3_BPPMODE_16BPP_565 (0x5 << 2) -#define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2) -#define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2) -#define WINCON3_BPPMODE_18BPP_666 (0x8 << 2) -#define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2) -#define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2) -#define WINCON3_BPPMODE_24BPP_888 (0xb << 2) -#define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2) -#define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2) -#define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2) - -#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5) -#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5) -#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5) - -#define DITHMODE (0x170) -#define WINxMAP (_win) (0x180 + ((_win) * 4)) - - -#define DITHMODE_R_POS_MASK (0x3 << 5) -#define DITHMODE_R_POS_SHIFT (5) -#define DITHMODE_R_POS_8BIT (0x0 << 5) -#define DITHMODE_R_POS_6BIT (0x1 << 5) -#define DITHMODE_R_POS_5BIT (0x2 << 5) - -#define DITHMODE_G_POS_MASK (0x3 << 3) -#define DITHMODE_G_POS_SHIFT (3) -#define DITHMODE_G_POS_8BIT (0x0 << 3) -#define DITHMODE_G_POS_6BIT (0x1 << 3) -#define DITHMODE_G_POS_5BIT (0x2 << 3) - -#define DITHMODE_B_POS_MASK (0x3 << 1) -#define DITHMODE_B_POS_SHIFT (1) -#define DITHMODE_B_POS_8BIT (0x0 << 1) -#define DITHMODE_B_POS_6BIT (0x1 << 1) -#define DITHMODE_B_POS_5BIT (0x2 << 1) +#ifndef __ASM_ARCH_REGS_FB_H +#define __ASM_ARCH_REGS_FB_H __FILE__ -#define DITHMODE_DITH_EN (1 << 0) - -#define WPALCON (0x1A0) - -#define WPALCON_W4PAL_16BPP_A555 (1 << 8) -#define WPALCON_W3PAL_16BPP_A555 (1 << 7) -#define WPALCON_W2PAL_16BPP_A555 (1 << 6) +#include <plat/regs-fb-v4.h> /* Palette registers */ -#define WIN2_PAL (_entry) (0x300 + ((_entry) * 2))#define WIN3_PAL (_entry) (0x320 + ((_entry) * 2))#define WIN4_PAL (_entry) (0x340 + ((_entry) * 2))#define WIN0_PAL (_entry) (0x400 + ((_entry) * 4))#define WIN1_PAL (_entry) (0x800 + ((_entry) * 4)) -/* system specific implementation code for palette sizes, and other -* information that changes depending on which architecture is being -* compiled. -*/ - -/* return true if window _win has OSD register D */ -#define s3c_fb_has_osd_d (_win) ((_win) != 4 && (_win) != 0) - -static inline unsigned int s3c_fb_win_pal_size (unsigned int win) -{ -if (win <2 ) -return 256 ; -if (win <4 ) -return 16 ; -if (win ==4 ) -return 4 ; - -BUG ();/* shouldn't get here */ -} - -static inline int s3c_fb_validate_win_bpp (unsigned int win,unsigned int bpp) -{ -/* all windows can do 1/2 bpp */ - -if ((bpp ==25 || bpp ==19 ) && win ==0 ) -return 0 ;/* win 0 does not have 19 or 25bpp modes */ - -if (bpp ==4 && win ==4 ) -return 0 ; - -if (bpp ==8 && (win >=3 )) -return 0 ;/* win 3/4 cannot do 8bpp in any mode */ - -return 1 ; -} -static inline unsigned int s3c_fb_pal_reg (unsigned int window,int reg) {switch (window) {@@ -203,57 +38,4 @@ static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg) BUG(); } -static inline int s3c_fb_pal_is16 (unsigned int window) -{ -return window >1 ; -} - -struct s3c_fb_palette { -struct fb_bitfield r; -struct fb_bitfield g; -struct fb_bitfield b; -struct fb_bitfield a; -}; - -static inline void s3c_fb_init_palette (unsigned int window, -struct s3c_fb_palette *palette) -{ -if (window <2 ) { -/* Windows 0/1 are 8/8/8 or A/8/8/8 */ - palette->r.offset =16 ; - palette->r.length =8 ; - palette->g.offset =8 ; - palette->g.length =8 ; - palette->b.offset =0 ; - palette->b.length =8 ; - }else { -/* currently we assume RGB 5/6/5 */ - palette->r.offset =11 ; - palette->r.length =5 ; - palette->g.offset =5 ; - palette->g.length =6 ; - palette->b.offset =0 ; - palette->b.length =5 ; - } -} - -/* Notes on per-window bpp settings -* -* Value Win0 Win1 Win2 Win3 Win 4 -* 0000 1(P) 1(P) 1(P) 1(P) 1(P) -* 0001 2(P) 2(P) 2(P) 2(P) 2(P) -* 0010 4(P) 4(P) 4(P) 4(P) -none- -* 0011 8(P) 8(P) -none- -none- -none- -* 0100 -none- 8(A232) 8(A232) -none- -none- -* 0101 16(565) 16(565) 16(565) 16(565) 16(565) -* 0110 -none- 16(A555) 16(A555) 16(A555) 16(A555) -* 0111 16(I555) 16(I565) 16(I555) 16(I555) 16(I555) -* 1000 18(666) 18(666) 18(666) 18(666) 18(666) -* 1001 -none- 18(A665) 18(A665) 18(A665) 16(A665) -* 1010 -none- 19(A666) 19(A666) 19(A666) 19(A666) -* 1011 24(888) 24(888) 24(888) 24(888) 24(888) -* 1100 -none- 24(A887) 24(A887) 24(A887) 24(A887) -* 1101 -none- 25(A888) 25(A888) 25(A888) 25(A888) -* 1110 -none- -none- -none- -none- -none- -* 1111 -none- -none- -none- -none- -none- -*/ +#endif /* __ASM_ARCH_REGS_FB_H */ arch/arm/plat-s3c/include/plat/regs-fb-v4.h new file +235
-0@@ -0,0 +1,235 @@ +/* arch/arm/plat-s3c/include/plat/regs-fb-v4.h +* +* Copyright 2008 Openmoko, Inc. +* Copyright 2008 Simtec Electronics +* http://armlinux.simtec.co.uk/ +* Ben Dooks <[email protected]> +* +* S3C64XX - new-style framebuffer register definitions +* +* This is the register set for the new style framebuffer interface +* found from the S3C2443 onwards and specifically the S3C64XX series +* S3C6400 and S3C6410. +* +* The file contains the cpu specific items which change between whichever +* architecture is selected. See <plat/regs-fb.h> for the core definitions +* that are the same. +* +* 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 the core definitions here, in case we really do need to +* override them at a later date. +*/ + +#include <plat/regs-fb.h> + +#define S3C_FB_MAX_WIN (5)/* number of hardware windows available. */ +#define VIDCON1_FSTATUS_EVEN (1 << 15) + +/* Video timing controls */ +#define VIDTCON0 (0x10) +#define VIDTCON1 (0x14) +#define VIDTCON2 (0x18) + +/* Window position controls */ + +#define WINCON (_win) (0x20 + ((_win) * 4)) + +/* OSD1 and OSD4 do not have register D */ + +#define VIDOSD_A (_win) (0x40 + ((_win) * 16)) +#define VIDOSD_B (_win) (0x44 + ((_win) * 16)) +#define VIDOSD_C (_win) (0x48 + ((_win) * 16)) +#define VIDOSD_D (_win) (0x4C + ((_win) * 16)) + + +#define VIDINTCON0 (0x130) + +#define WxKEYCONy (_win, _con) ((0x140 + ((_win) * 8)) + ((_con) * 4)) + +/* WINCONx */ + +#define WINCONx_CSCWIDTH_MASK (0x3 << 26) +#define WINCONx_CSCWIDTH_SHIFT (26) +#define WINCONx_CSCWIDTH_WIDE (0x0 << 26) +#define WINCONx_CSCWIDTH_NARROW (0x3 << 26) + +#define WINCONx_ENLOCAL (1 << 22) +#define WINCONx_BUFSTATUS (1 << 21) +#define WINCONx_BUFSEL (1 << 20) +#define WINCONx_BUFAUTOEN (1 << 19) +#define WINCONx_YCbCr (1 << 13) + +#define WINCON1_LOCALSEL_CAMIF (1 << 23) + +#define WINCON2_LOCALSEL_CAMIF (1 << 23) +#define WINCON2_BLD_PIX (1 << 6) + +#define WINCON2_ALPHA_SEL (1 << 1) +#define WINCON2_BPPMODE_MASK (0xf << 2) +#define WINCON2_BPPMODE_SHIFT (2) +#define WINCON2_BPPMODE_1BPP (0x0 << 2) +#define WINCON2_BPPMODE_2BPP (0x1 << 2) +#define WINCON2_BPPMODE_4BPP (0x2 << 2) +#define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2) +#define WINCON2_BPPMODE_16BPP_565 (0x5 << 2) +#define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2) +#define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2) +#define WINCON2_BPPMODE_18BPP_666 (0x8 << 2) +#define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2) +#define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2) +#define WINCON2_BPPMODE_24BPP_888 (0xb << 2) +#define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2) +#define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2) +#define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2) + +#define WINCON3_BLD_PIX (1 << 6) + +#define WINCON3_ALPHA_SEL (1 << 1) +#define WINCON3_BPPMODE_MASK (0xf << 2) +#define WINCON3_BPPMODE_SHIFT (2) +#define WINCON3_BPPMODE_1BPP (0x0 << 2) +#define WINCON3_BPPMODE_2BPP (0x1 << 2) +#define WINCON3_BPPMODE_4BPP (0x2 << 2) +#define WINCON3_BPPMODE_16BPP_565 (0x5 << 2) +#define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2) +#define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2) +#define WINCON3_BPPMODE_18BPP_666 (0x8 << 2) +#define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2) +#define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2) +#define WINCON3_BPPMODE_24BPP_888 (0xb << 2) +#define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2) +#define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2) +#define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2) + +#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5) +#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5) +#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5) + +#define DITHMODE (0x170) +#define WINxMAP (_win) (0x180 + ((_win) * 4)) + + +#define DITHMODE_R_POS_MASK (0x3 << 5) +#define DITHMODE_R_POS_SHIFT (5) +#define DITHMODE_R_POS_8BIT (0x0 << 5) +#define DITHMODE_R_POS_6BIT (0x1 << 5) +#define DITHMODE_R_POS_5BIT (0x2 << 5) + +#define DITHMODE_G_POS_MASK (0x3 << 3) +#define DITHMODE_G_POS_SHIFT (3) +#define DITHMODE_G_POS_8BIT (0x0 << 3) +#define DITHMODE_G_POS_6BIT (0x1 << 3) +#define DITHMODE_G_POS_5BIT (0x2 << 3) + +#define DITHMODE_B_POS_MASK (0x3 << 1) +#define DITHMODE_B_POS_SHIFT (1) +#define DITHMODE_B_POS_8BIT (0x0 << 1) +#define DITHMODE_B_POS_6BIT (0x1 << 1) +#define DITHMODE_B_POS_5BIT (0x2 << 1) + +#define DITHMODE_DITH_EN (1 << 0) + +#define WPALCON (0x1A0) + +/* Palette control */ +/* Note for S5PC100: you can still use those macros on WPALCON (aka WPALCON_L), +* but make sure that WPALCON_H W2PAL-W4PAL entries are zeroed out */ +#define WPALCON_W4PAL_16BPP_A555 (1 << 8) +#define WPALCON_W3PAL_16BPP_A555 (1 << 7) +#define WPALCON_W2PAL_16BPP_A555 (1 << 6) + + +/* system specific implementation code for palette sizes, and other +* information that changes depending on which architecture is being +* compiled. +*/ + +/* return true if window _win has OSD register D */ +#define s3c_fb_has_osd_d (_win) ((_win) != 4 && (_win) != 0) + +static inline unsigned int s3c_fb_win_pal_size (unsigned int win) +{ +if (win <2 ) +return 256 ; +if (win <4 ) +return 16 ; +if (win ==4 ) +return 4 ; + +BUG ();/* shouldn't get here */ +} + +static inline int s3c_fb_validate_win_bpp (unsigned int win,unsigned int bpp) +{ +/* all windows can do 1/2 bpp */ + +if ((bpp ==25 || bpp ==19 ) && win ==0 ) +return 0 ;/* win 0 does not have 19 or 25bpp modes */ + +if (bpp ==4 && win ==4 ) +return 0 ; + +if (bpp ==8 && (win >=3 )) +return 0 ;/* win 3/4 cannot do 8bpp in any mode */ + +return 1 ; +} + +static inline int s3c_fb_pal_is16 (unsigned int window) +{ +return window >1 ; +} + +struct s3c_fb_palette { +struct fb_bitfield r; +struct fb_bitfield g; +struct fb_bitfield b; +struct fb_bitfield a; +}; + +static inline void s3c_fb_init_palette (unsigned int window, +struct s3c_fb_palette *palette) +{ +if (window <2 ) { +/* Windows 0/1 are 8/8/8 or A/8/8/8 */ + palette->r.offset =16 ; + palette->r.length =8 ; + palette->g.offset =8 ; + palette->g.length =8 ; + palette->b.offset =0 ; + palette->b.length =8 ; + }else { +/* currently we assume RGB 5/6/5 */ + palette->r.offset =11 ; + palette->r.length =5 ; + palette->g.offset =5 ; + palette->g.length =6 ; + palette->b.offset =0 ; + palette->b.length =5 ; + } +} + +/* Notes on per-window bpp settings +* +* Value Win0 Win1 Win2 Win3 Win 4 +* 0000 1(P) 1(P) 1(P) 1(P) 1(P) +* 0001 2(P) 2(P) 2(P) 2(P) 2(P) +* 0010 4(P) 4(P) 4(P) 4(P) -none- +* 0011 8(P) 8(P) -none- -none- -none- +* 0100 -none- 8(A232) 8(A232) -none- -none- +* 0101 16(565) 16(565) 16(565) 16(565) 16(565) +* 0110 -none- 16(A555) 16(A555) 16(A555) 16(A555) +* 0111 16(I555) 16(I565) 16(I555) 16(I555) 16(I555) +* 1000 18(666) 18(666) 18(666) 18(666) 18(666) +* 1001 -none- 18(A665) 18(A665) 18(A665) 16(A665) +* 1010 -none- 19(A666) 19(A666) 19(A666) 19(A666) +* 1011 24(888) 24(888) 24(888) 24(888) 24(888) +* 1100 -none- 24(A887) 24(A887) 24(A887) 24(A887) +* 1101 -none- 25(A888) 25(A888) 25(A888) 25(A888) +* 1110 -none- -none- -none- -none- -none- +* 1111 -none- -none- -none- -none- -none- +*/ Signature · 7 lines
1.6.5 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 9/18 ARM: S3C: Prepare s3c64xx-specific s3c-fb register definition for reuse
Hello,
Quoted 29 lines · Ben Dooks
arch/arm/mach-s3c6400/include/mach/regs-
Quoted 18 lines · Marek Szyprowski
S5PC1xx Samsung SOC series has very similar frame buffer hardware, so a lot of the code can be shared. Moved s3c64xx-specific s3c-fb register definitions from mach-s3c6400 to common platform directory as
regs-fb-v4.h. The new v4 file will be common for S3C6400, S3C6410, S5PC100 and possibly others. Some s3c64xx series specific defines (palette handling) were left ins3c-6400/mach/regs-fb.h, because it is handled differently in S5PC1xx series.Signed-off-by Pawel Osciak <[email protected]>Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/mach-s3c6400/include/mach/regs-fb.h | 236 +------------------------- arch/arm/plat-s3c/include/plat/regs-fb-v4.h | 235 +++++++++++++++++++++++++ 2 files changed, 244 insertions(+), 227 deletions(-) create mode 100644 arch/arm/plat-s3c/include/plat/regs-fb-v4.harch/arm/mach-s3c6400/include/mach/regs- renamed from arch/arm/mach-s3c6400/include/mach/regs-fb.h +0
-0
fb.hQuoted 9 lines
index 4701979..5fbc0d7 100644
arch/arm/mach-s3c6400/include/mach/regs-fb.h +1
-2@@ -1,195 +1,30 @@ -/* arch/arm/mach-s3c6400/include/mach/regs-fb.h -* +/* * Copyright 2008 Openmoko, Inc. * Copyright 2008 Simtec Electronics
Quoted 8 lines
arch/arm/mach-s3c6400/include/mach/regs-fb.h line 4
Quoted 5 lines
arch/arm/mach-s3c6400/include/mach/regs-fb.h +1
-4-* http://armlinux.simtec.co.uk/ -* Ben Dooks <[email protected]> -* -* S3C64XX - new-style framebuffer register definitions +* Copyright 2009 Samsung Electronics Co. I'm not sure what you are trying to do here, it looks like a file rename but leaving fragments of the original file?
Yes. All registers that are common for S3C64XX and S5PC100 series were moved to plat/regs-fb-v4.h. Some registers that are specific for S3C64XX series (mainly palette registers) were left in mach-s3c6400/include/mach/regs-fb.h. I will resend this patch with git format-patch -C option enable, so it will be a bit easier to track what has been changed.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
PATCH 7/18 ARM: S5PC1xx: add gpiolib and external/gpio interrupt support
In reply to Marek SzyprowskiQuoted 57 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Add support for gpiolib calls. This is based on the gpiolib implementation from plat-s3c64xx tree.
Add support for external interrupts for GPIO H banks.
Add support for GPIO interrupts for all banks.Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/plat-s3c/Kconfig | 6 + arch/arm/plat-s3c/include/plat/gpio-cfg.h | 1 + arch/arm/plat-s5pc1xx/Kconfig | 3 + arch/arm/plat-s5pc1xx/Makefile | 4 +- arch/arm/plat-s5pc1xx/cpu.c | 5 + arch/arm/plat-s5pc1xx/gpio-config.c | 60 +++ arch/arm/plat-s5pc1xx/gpiolib.c | 503 ++++++++++++++++++++ .../plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h | 32 ++ arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h | 44 ++ arch/arm/plat-s5pc1xx/include/plat/irqs.h | 15 +- arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h | 70 +++ arch/arm/plat-s5pc1xx/irq-eint.c | 281 +++++++++++ arch/arm/plat-s5pc1xx/irq-gpio.c | 266 +++++++++++ arch/arm/plat-s5pc1xx/irq.c | 2 +- 14 files changed, 1287 insertions(+), 5 deletions(-) create mode 100644 arch/arm/plat-s5pc1xx/gpio-config.c create mode 100644 arch/arm/plat-s5pc1xx/gpiolib.c create mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h create mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h create mode 100644 arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h create mode 100644 arch/arm/plat-s5pc1xx/irq-eint.c create mode 100644 arch/arm/plat-s5pc1xx/irq-gpio.carch/arm/plat-s3c/Kconfig +6
-0@@ -159,6 +159,12 @@ config S3C_GPIO_CFG_S3C64XX Internal configuration to enable S3C64XX style GPIO configuration functions. +config S5P_GPIO_CFG_S5PC1XX + bool + help + Internal configuration to enable S5PC1XX style GPIO configuration + functions. + # DMA config S3C_DMAarch/arm/plat-s3c/include/plat/gpio-cfg.h +0
-0
arch/arm/plat-s3c/include/plat/gpio-cfg.h struct s3c_gpio_cfg { · line 65
Quoted 4 lines
arch/arm/plat-s3c/include/plat/gpio-cfg.h +1
-0@@ -62,6 +62,7 @@ struct s3c_gpio_cfg {#define S3C_GPIO_INPUT (S3C_GPIO_SPECIAL(0))#define S3C_GPIO_OUTPUT (S3C_GPIO_SPECIAL(1))#define S3C_GPIO_SFN (x) (S3C_GPIO_SPECIAL(x)) +#define S3C_GPIO_IRQ (S3C_GPIO_SPECIAL(0xf))
I believ this to be wrong, this certainly won't work on at least some of the S3C64XX GPIO banks. It is also unused in this patch.
I'm not sure whether to just apply this one and remove this definition or ask for a response on why it should be in here?
Quoted 6 lines
arch/arm/plat-s5pc1xx/gpio-config.c new file +0
-0
arch/arm/plat-s5pc1xx/gpio-config.c line 10
Quoted 10 lines
arch/arm/plat-s5pc1xx/gpio-config.c new file +10
-0@@ -0,0 +1,60 @@ +/* linux/arch/arm/plat-s5pc1xx/gpio-config.c +* +* Copyright 2009 Samsung Electronics +* +* S5PC1XX GPIO Configuration. +* +* 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. +*/
An attribution to the original source this came from would be nice.
Quoted 1,331 lines
arch/arm/plat-s5pc1xx/gpio-config.c new file +49
-0+#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/gpio.h> +#include <linux/io.h> + +#include <mach/gpio-core.h> +#include <plat/gpio-cfg-s5pc1xx.h> + +s5p_gpio_drvstr_t s5p_gpio_get_drvstr (unsigned int pin,unsigned int off) +{ +struct s3c_gpio_chip *chip =s3c_gpiolib_getchip (pin); +void __iomem *reg; +int shift = off *2 ; +u32 drvstr; + +if (!chip) +return -EINVAL ; + + reg = chip->base +0x0C ; + + drvstr =__raw_readl (reg); + drvstr =0xffff & (0x3 << shift); + drvstr = drvstr >> shift; + +return (__force s5p_gpio_drvstr_t )drvstr; +} +EXPORT_SYMBOL (s5p_gpio_get_drvstr); + +int s5p_gpio_set_drvstr (unsigned int pin,unsigned int off, +s5p_gpio_drvstr_t drvstr) +{ +struct s3c_gpio_chip *chip =s3c_gpiolib_getchip (pin); +void __iomem *reg; +int shift = off *2 ; +u32 tmp; + +if (!chip) +return -EINVAL ; + + reg = chip->base +0x0C ; + + tmp =__raw_readl (reg); + tmp |= drvstr << shift; + +__raw_writel (tmp, reg); + +return 0 ; +} +EXPORT_SYMBOL (s5p_gpio_set_drvstr);arch/arm/plat-s5pc1xx/gpiolib.c new file +502
-0@@ -0,0 +1,503 @@ +/* +* arch/arm/plat-s5pc1xx/gpiolib.c +* +* Copyright 2009 Samsung Electronics Co +* Kyungmin Park <[email protected]> +* +* S5PC1XX - GPIOlib support +* +* 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/kernel.h> +#include <linux/irq.h> +#include <linux/io.h> + +#include <mach/map.h> +#include <mach/gpio.h> +#include <mach/gpio-core.h> + +#include <plat/gpio-cfg.h> +#include <plat/gpio-cfg-helpers.h> +#include <plat/regs-gpio.h> + +/* S5PC100 GPIO bank summary: +* +* Bank GPIOs Style INT Type +* A0 8 4Bit GPIO_INT0 +* A1 5 4Bit GPIO_INT1 +* B 8 4Bit GPIO_INT2 +* C 5 4Bit GPIO_INT3 +* D 7 4Bit GPIO_INT4 +* E0 8 4Bit GPIO_INT5 +* E1 6 4Bit GPIO_INT6 +* F0 8 4Bit GPIO_INT7 +* F1 8 4Bit GPIO_INT8 +* F2 8 4Bit GPIO_INT9 +* F3 4 4Bit GPIO_INT10 +* G0 8 4Bit GPIO_INT11 +* G1 3 4Bit GPIO_INT12 +* G2 7 4Bit GPIO_INT13 +* G3 7 4Bit GPIO_INT14 +* H0 8 4Bit WKUP_INT +* H1 8 4Bit WKUP_INT +* H2 8 4Bit WKUP_INT +* H3 8 4Bit WKUP_INT +* I 8 4Bit GPIO_INT15 +* J0 8 4Bit GPIO_INT16 +* J1 5 4Bit GPIO_INT17 +* J2 8 4Bit GPIO_INT18 +* J3 8 4Bit GPIO_INT19 +* J4 4 4Bit GPIO_INT20 +* K0 8 4Bit None +* K1 6 4Bit None +* K2 8 4Bit None +* K3 8 4Bit None +* L0 8 4Bit None +* L1 8 4Bit None +* L2 8 4Bit None +* L3 8 4Bit None +*/ + +#define OFF_GPCON (0x00) +#define OFF_GPDAT (0x04) + +#define con_4bit_shift (__off) ((__off) * 4) + +#if 1 +#define gpio_dbg(x...) do { } while (0) +#else +#define gpio_dbg(x...) printk(KERN_DEBUG x) +#endif + +/* The s5pc1xx_gpiolib routines are to control the gpio banks where +* the gpio configuration register (GPxCON) has 4 bits per GPIO, as the +* following example: +* +* base + 0x00: Control register, 4 bits per gpio +* gpio n: 4 bits starting at (4*n) +* 0000 = input, 0001 = output, others mean special-function +* base + 0x04: Data register, 1 bit per gpio +* bit n: data bit n +* +* Note, since the data register is one bit per gpio and is at base + 0x4 +* we can use s3c_gpiolib_get and s3c_gpiolib_set to change the state of +* the output. +*/ + +static int s5pc1xx_gpiolib_input (struct gpio_chip *chip,unsigned offset) +{ +struct s3c_gpio_chip *ourchip =to_s3c_gpio (chip); +void __iomem *base = ourchip->base; +unsigned long con; + + con =__raw_readl (base +OFF_GPCON ); + con &= ~(0xf <<con_4bit_shift (offset)); +__raw_writel (con, base +OFF_GPCON ); + +gpio_dbg ("%s: %p: CON now %08lx\n" , __func__, base, con); + +return 0 ; +} +static int s5pc1xx_gpiolib_output (struct gpio_chip *chip, +unsigned offset,int value) +{ +struct s3c_gpio_chip *ourchip =to_s3c_gpio (chip); +void __iomem *base = ourchip->base; +unsigned long con; +unsigned long dat; + + con =__raw_readl (base +OFF_GPCON ); + con &= ~(0xf <<con_4bit_shift (offset)); + con |=0x1 <<con_4bit_shift (offset); + + dat =__raw_readl (base +OFF_GPDAT ); +if (value) + dat |=1 << offset; +else + dat &= ~(1 << offset); + +__raw_writel (dat, base +OFF_GPDAT ); +__raw_writel (con, base +OFF_GPCON ); +__raw_writel (dat, base +OFF_GPDAT ); + +gpio_dbg ("%s: %p: CON %08lx, DAT %08lx\n" , __func__, base, con, dat); + +return 0 ; +} + +static int s5pc1xx_gpiolib_to_irq (struct gpio_chip *chip,unsigned int offset) +{ +return S3C_IRQ_GPIO (chip->base + offset); +} + +static int s5pc1xx_gpiolib_to_eint (struct gpio_chip *chip,unsigned int offset) +{ +int base; + + base = chip->base -S5PC100_GPH0 (0 ); +if (base ==0 ) +return IRQ_EINT (offset); + base = chip->base -S5PC100_GPH1 (0 ); +if (base ==0 ) +return IRQ_EINT (8 + offset); + base = chip->base -S5PC100_GPH2 (0 ); +if (base ==0 ) +return IRQ_EINT (16 + offset); + base = chip->base -S5PC100_GPH3 (0 ); +if (base ==0 ) +return IRQ_EINT (24 + offset); +return -EINVAL ; +} + +static struct s3c_gpio_cfg gpio_cfg = { + .set_config = s3c_gpio_setcfg_s3c64xx_4bit, + .set_pull = s3c_gpio_setpull_updown, + .get_pull = s3c_gpio_getpull_updown, +}; + +static struct s3c_gpio_cfg gpio_cfg_eint = { + .cfg_eint =0xf , + .set_config = s3c_gpio_setcfg_s3c64xx_4bit, + .set_pull = s3c_gpio_setpull_updown, + .get_pull = s3c_gpio_getpull_updown, +}; + +static struct s3c_gpio_cfg gpio_cfg_noint = { + .set_config = s3c_gpio_setcfg_s3c64xx_4bit, + .set_pull = s3c_gpio_setpull_updown, + .get_pull = s3c_gpio_getpull_updown, +}; + +static struct s3c_gpio_chip s5pc100_gpio_chips[] = { + { + .base =S5PC100_GPA0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPA0 (0 ), + .ngpio =S5PC100_GPIO_A0_NR , + .label ="GPA0" , + }, + }, { + .base =S5PC100_GPA1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPA1 (0 ), + .ngpio =S5PC100_GPIO_A1_NR , + .label ="GPA1" , + }, + }, { + .base =S5PC100_GPB_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPB (0 ), + .ngpio =S5PC100_GPIO_B_NR , + .label ="GPB" , + }, + }, { + .base =S5PC100_GPC_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPC (0 ), + .ngpio =S5PC100_GPIO_C_NR , + .label ="GPC" , + }, + }, { + .base =S5PC100_GPD_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPD (0 ), + .ngpio =S5PC100_GPIO_D_NR , + .label ="GPD" , + }, + }, { + .base =S5PC100_GPE0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPE0 (0 ), + .ngpio =S5PC100_GPIO_E0_NR , + .label ="GPE0" , + }, + }, { + .base =S5PC100_GPE1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPE1 (0 ), + .ngpio =S5PC100_GPIO_E1_NR , + .label ="GPE1" , + }, + }, { + .base =S5PC100_GPF0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPF0 (0 ), + .ngpio =S5PC100_GPIO_F0_NR , + .label ="GPF0" , + }, + }, { + .base =S5PC100_GPF1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPF1 (0 ), + .ngpio =S5PC100_GPIO_F1_NR , + .label ="GPF1" , + }, + }, { + .base =S5PC100_GPF2_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPF2 (0 ), + .ngpio =S5PC100_GPIO_F2_NR , + .label ="GPF2" , + }, + }, { + .base =S5PC100_GPF3_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPF3 (0 ), + .ngpio =S5PC100_GPIO_F3_NR , + .label ="GPF3" , + }, + }, { + .base =S5PC100_GPG0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPG0 (0 ), + .ngpio =S5PC100_GPIO_G0_NR , + .label ="GPG0" , + }, + }, { + .base =S5PC100_GPG1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPG1 (0 ), + .ngpio =S5PC100_GPIO_G1_NR , + .label ="GPG1" , + }, + }, { + .base =S5PC100_GPG2_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPG2 (0 ), + .ngpio =S5PC100_GPIO_G2_NR , + .label ="GPG2" , + }, + }, { + .base =S5PC100_GPG3_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPG3 (0 ), + .ngpio =S5PC100_GPIO_G3_NR , + .label ="GPG3" , + }, + }, { + .base =S5PC100_GPH0_BASE , + .config = &gpio_cfg_eint, + .chip = { + .base =S5PC100_GPH0 (0 ), + .ngpio =S5PC100_GPIO_H0_NR , + .label ="GPH0" , + }, + }, { + .base =S5PC100_GPH1_BASE , + .config = &gpio_cfg_eint, + .chip = { + .base =S5PC100_GPH1 (0 ), + .ngpio =S5PC100_GPIO_H1_NR , + .label ="GPH1" , + }, + }, { + .base =S5PC100_GPH2_BASE , + .config = &gpio_cfg_eint, + .chip = { + .base =S5PC100_GPH2 (0 ), + .ngpio =S5PC100_GPIO_H2_NR , + .label ="GPH2" , + }, + }, { + .base =S5PC100_GPH3_BASE , + .config = &gpio_cfg_eint, + .chip = { + .base =S5PC100_GPH3 (0 ), + .ngpio =S5PC100_GPIO_H3_NR , + .label ="GPH3" , + }, + }, { + .base =S5PC100_GPI_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPI (0 ), + .ngpio =S5PC100_GPIO_I_NR , + .label ="GPI" , + }, + }, { + .base =S5PC100_GPJ0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPJ0 (0 ), + .ngpio =S5PC100_GPIO_J0_NR , + .label ="GPJ0" , + }, + }, { + .base =S5PC100_GPJ1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPJ1 (0 ), + .ngpio =S5PC100_GPIO_J1_NR , + .label ="GPJ1" , + }, + }, { + .base =S5PC100_GPJ2_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPJ2 (0 ), + .ngpio =S5PC100_GPIO_J2_NR , + .label ="GPJ2" , + }, + }, { + .base =S5PC100_GPJ3_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPJ3 (0 ), + .ngpio =S5PC100_GPIO_J3_NR , + .label ="GPJ3" , + }, + }, { + .base =S5PC100_GPJ4_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC100_GPJ4 (0 ), + .ngpio =S5PC100_GPIO_J4_NR , + .label ="GPJ4" , + }, + }, { + .base =S5PC100_GPK0_BASE , + .config = &gpio_cfg_noint, + .chip = { + .base =S5PC100_GPK0 (0 ), + .ngpio =S5PC100_GPIO_K0_NR , + .label ="GPK0" , + }, + }, { + .base =S5PC100_GPK1_BASE , + .config = &gpio_cfg_noint, + .chip = { + .base =S5PC100_GPK1 (0 ), + .ngpio =S5PC100_GPIO_K1_NR , + .label ="GPK1" , + }, + }, { + .base =S5PC100_GPK2_BASE , + .config = &gpio_cfg_noint, + .chip = { + .base =S5PC100_GPK2 (0 ), + .ngpio =S5PC100_GPIO_K2_NR , + .label ="GPK2" , + }, + }, { + .base =S5PC100_GPK3_BASE , + .config = &gpio_cfg_noint, + .chip = { + .base =S5PC100_GPK3 (0 ), + .ngpio =S5PC100_GPIO_K3_NR , + .label ="GPK3" , + }, + }, { + .base =S5PC100_GPL0_BASE , + .config = &gpio_cfg_noint, + .chip = { + .base =S5PC100_GPL0 (0 ), + .ngpio =S5PC100_GPIO_L0_NR , + .label ="GPL0" , + }, + }, { + .base =S5PC100_GPL1_BASE , + .config = &gpio_cfg_noint, + .chip = { + .base =S5PC100_GPL1 (0 ), + .ngpio =S5PC100_GPIO_L1_NR , + .label ="GPL1" , + }, + }, { + .base =S5PC100_GPL2_BASE , + .config = &gpio_cfg_noint, + .chip = { + .base =S5PC100_GPL2 (0 ), + .ngpio =S5PC100_GPIO_L2_NR , + .label ="GPL2" , + }, + }, { + .base =S5PC100_GPL3_BASE , + .config = &gpio_cfg_noint, + .chip = { + .base =S5PC100_GPL3 (0 ), + .ngpio =S5PC100_GPIO_L3_NR , + .label ="GPL3" , + }, + }, { + .base =S5PC100_GPL4_BASE , + .config = &gpio_cfg_noint, + .chip = { + .base =S5PC100_GPL4 (0 ), + .ngpio =S5PC100_GPIO_L4_NR , + .label ="GPL4" , + }, + }, +}; + +/* FIXME move from irq-gpio.c */ +extern struct irq_chip s5pc1xx_gpioint; +extern void s5pc1xx_irq_gpioint_handler (unsigned int irq,struct irq_desc *desc); + +static __init void s5pc1xx_gpiolib_link (struct s3c_gpio_chip *chip) +{ + chip->chip.direction_input = s5pc1xx_gpiolib_input; + chip->chip.direction_output = s5pc1xx_gpiolib_output; + chip->pm =__gpio_pm (&s3c_gpio_pm_4bit); + +/* Interrupt */ +if (chip->config == &gpio_cfg) { +int i, irq; + + chip->chip.to_irq = s5pc1xx_gpiolib_to_irq; + +for (i =0 ; i < chip->chip.ngpio; i++) { + irq =S3C_IRQ_GPIO_BASE + chip->chip.base + i; +set_irq_chip (irq, &s5pc1xx_gpioint); +set_irq_data (irq, &chip->chip); +set_irq_handler (irq, handle_level_irq); +set_irq_flags (irq,IRQF_VALID ); + } + }else if (chip->config == &gpio_cfg_eint) + chip->chip.to_irq = s5pc1xx_gpiolib_to_eint; +} + +static __init void s5pc1xx_gpiolib_add (struct s3c_gpio_chip *chips, +int nr_chips, +void (*fn)(struct s3c_gpio_chip *)) +{ +for (; nr_chips >0 ; nr_chips--, chips++) { +if (fn) + (fn)(chips); +s3c_gpiolib_add (chips); + } +} + +static __init int s5pc1xx_gpiolib_init (void ) +{ +struct s3c_gpio_chip *chips; +int nr_chips; + + chips = s5pc100_gpio_chips; + nr_chips =ARRAY_SIZE (s5pc100_gpio_chips); + +s5pc1xx_gpiolib_add (chips, nr_chips, s5pc1xx_gpiolib_link); +/* Interrupt */ +set_irq_chained_handler (IRQ_GPIOINT , s5pc1xx_irq_gpioint_handler); + +return 0 ; +} +core_initcall (s5pc1xx_gpiolib_init);arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h new file +32
-0@@ -0,0 +1,32 @@ +/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg.h +* +* Copyright 2009 Samsung Electronic +* +* S5PC1XX Platform - GPIO pin configuration +* +* 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. +*/ + +/* This file contains the necessary definitions to get the basic gpio +* pin configuration done such as setting a pin to input or output or +* changing the pull-{up,down} configurations. +*/ + +#ifndef __GPIO_CFG_S5PC1XX_H +#define __GPIO_CFG_S5PC1XX_H __FILE__ + +typedef unsigned int __bitwise__ s5p_gpio_drvstr_t; + +#define S5P_GPIO_DRVSTR_LV1 0x00 +#define S5P_GPIO_DRVSTR_LV2 0x01 +#define S5P_GPIO_DRVSTR_LV3 0x10 +#define S5P_GPIO_DRVSTR_LV4 0x11 + +extern s5p_gpio_drvstr_t s5p_gpio_get_drvstr (unsigned int pin,unsigned int off); + +extern int s5p_gpio_set_drvstr (unsigned int pin,unsigned int off, +s5p_gpio_drvstr_t drvstr); + +#endif /* __GPIO_CFG_S5PC1XX_H */ arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h new file +44
-0@@ -0,0 +1,44 @@ +/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-eint.h +* +* Copyright 2009 Samsung Electronics Co. +* +* External Interrupt (GPH0 ~ GPH3) control register definitions +* +* 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. +*/ + +#define S5PC1XX_WKUP_INT_CON0_7 (S5PC1XX_EINT_BASE + 0x0) +#define S5PC1XX_WKUP_INT_CON8_15 (S5PC1XX_EINT_BASE + 0x4) +#define S5PC1XX_WKUP_INT_CON16_23 (S5PC1XX_EINT_BASE + 0x8) +#define S5PC1XX_WKUP_INT_CON24_31 (S5PC1XX_EINT_BASE + 0xC) +#define S5PC1XX_WKUP_INT_CON (x) (S5PC1XX_WKUP_INT_CON0_7 + (x * 0x4)) + +#define S5PC1XX_WKUP_INT_FLTCON0_3 (S5PC1XX_EINT_BASE + 0x80) +#define S5PC1XX_WKUP_INT_FLTCON4_7 (S5PC1XX_EINT_BASE + 0x84) +#define S5PC1XX_WKUP_INT_FLTCON8_11 (S5PC1XX_EINT_BASE + 0x88) +#define S5PC1XX_WKUP_INT_FLTCON12_15 (S5PC1XX_EINT_BASE + 0x8C) +#define S5PC1XX_WKUP_INT_FLTCON16_19 (S5PC1XX_EINT_BASE + 0x90) +#define S5PC1XX_WKUP_INT_FLTCON20_23 (S5PC1XX_EINT_BASE + 0x94) +#define S5PC1XX_WKUP_INT_FLTCON24_27 (S5PC1XX_EINT_BASE + 0x98) +#define S5PC1XX_WKUP_INT_FLTCON28_31 (S5PC1XX_EINT_BASE + 0x9C) +#define S5PC1XX_WKUP_INT_FLTCON (x) (S5PC1XX_WKUP_INT_FLTCON0_3 + (x * 0x4)) + +#define S5PC1XX_WKUP_INT_MASK0_7 (S5PC1XX_EINT_BASE + 0x100) +#define S5PC1XX_WKUP_INT_MASK8_15 (S5PC1XX_EINT_BASE + 0x104) +#define S5PC1XX_WKUP_INT_MASK16_23 (S5PC1XX_EINT_BASE + 0x108) +#define S5PC1XX_WKUP_INT_MASK24_31 (S5PC1XX_EINT_BASE + 0x10C) +#define S5PC1XX_WKUP_INT_MASK (x) (S5PC1XX_WKUP_INT_MASK0_7 + (x * 0x4)) + +#define S5PC1XX_WKUP_INT_PEND0_7 (S5PC1XX_EINT_BASE + 0x140) +#define S5PC1XX_WKUP_INT_PEND8_15 (S5PC1XX_EINT_BASE + 0x144) +#define S5PC1XX_WKUP_INT_PEND16_23 (S5PC1XX_EINT_BASE + 0x148) +#define S5PC1XX_WKUP_INT_PEND24_31 (S5PC1XX_EINT_BASE + 0x14C) +#define S5PC1XX_WKUP_INT_PEND (x) (S5PC1XX_WKUP_INT_PEND0_7 + (x * 0x4)) + +#define S5PC1XX_WKUP_INT_LOWLEV (0x00) +#define S5PC1XX_WKUP_INT_HILEV (0x01) +#define S5PC1XX_WKUP_INT_FALLEDGE (0x02) +#define S5PC1XX_WKUP_INT_RISEEDGE (0x03) +#define S5PC1XX_WKUP_INT_BOTHEDGE (0x04)arch/arm/plat-s5pc1xx/include/plat/irqs.h +12
-3@@ -171,12 +171,21 @@#define IRQ_SDMIRQ S5PC1XX_IRQ_VIC2(30)#define IRQ_SDMFIQ S5PC1XX_IRQ_VIC2(31) +/* External interrupt */ #define S3C_IRQ_EINT_BASE (IRQ_SDMFIQ + 1) -#define S3C_EINT (x) ((x) + S3C_IRQ_EINT_BASE) -#define IRQ_EINT (x) S3C_EINT(x) +#define S3C_EINT (x) (S3C_IRQ_EINT_BASE + (x - 16)) +#define IRQ_EINT (x) (x < 16 ? IRQ_EINT0 + x : S3C_EINT(x)) +#define IRQ_EINT_BIT (x) (x < IRQ_EINT16_31 ? x - IRQ_EINT0 : x - S3C_EINT(0)) -#define NR_IRQS (IRQ_EINT(31)+1) +/* GPIO interrupt */ +#define S3C_IRQ_GPIO_BASE (IRQ_EINT(31) + 1) +#define S3C_IRQ_GPIO (x) (S3C_IRQ_GPIO_BASE + (x)) + +/* +* Until MP04 Groups -> 40 (exactly 39) Groups * 8 ~= 320 GPIOs +*/ +#define NR_IRQS (S3C_IRQ_GPIO(320) + 1)#endif /* __ASM_PLAT_S5PC1XX_IRQS_H */ arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h new file +70
-0@@ -0,0 +1,70 @@ +/* linux/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* S5PC1XX - GPIO register definitions +*/ + +#ifndef __ASM_PLAT_S5PC1XX_REGS_GPIO_H +#define __ASM_PLAT_S5PC1XX_REGS_GPIO_H __FILE__ + +#include <mach/map.h> + +/* S5PC100 */ +#define S5PC100_GPIO_BASE S5PC1XX_VA_GPIO +#define S5PC100_GPA0_BASE (S5PC100_GPIO_BASE + 0x0000) +#define S5PC100_GPA1_BASE (S5PC100_GPIO_BASE + 0x0020) +#define S5PC100_GPB_BASE (S5PC100_GPIO_BASE + 0x0040) +#define S5PC100_GPC_BASE (S5PC100_GPIO_BASE + 0x0060) +#define S5PC100_GPD_BASE (S5PC100_GPIO_BASE + 0x0080) +#define S5PC100_GPE0_BASE (S5PC100_GPIO_BASE + 0x00A0) +#define S5PC100_GPE1_BASE (S5PC100_GPIO_BASE + 0x00C0) +#define S5PC100_GPF0_BASE (S5PC100_GPIO_BASE + 0x00E0) +#define S5PC100_GPF1_BASE (S5PC100_GPIO_BASE + 0x0100) +#define S5PC100_GPF2_BASE (S5PC100_GPIO_BASE + 0x0120) +#define S5PC100_GPF3_BASE (S5PC100_GPIO_BASE + 0x0140) +#define S5PC100_GPG0_BASE (S5PC100_GPIO_BASE + 0x0160) +#define S5PC100_GPG1_BASE (S5PC100_GPIO_BASE + 0x0180) +#define S5PC100_GPG2_BASE (S5PC100_GPIO_BASE + 0x01A0) +#define S5PC100_GPG3_BASE (S5PC100_GPIO_BASE + 0x01C0) +#define S5PC100_GPH0_BASE (S5PC100_GPIO_BASE + 0x0C00) +#define S5PC100_GPH1_BASE (S5PC100_GPIO_BASE + 0x0C20) +#define S5PC100_GPH2_BASE (S5PC100_GPIO_BASE + 0x0C40) +#define S5PC100_GPH3_BASE (S5PC100_GPIO_BASE + 0x0C60) +#define S5PC100_GPI_BASE (S5PC100_GPIO_BASE + 0x01E0) +#define S5PC100_GPJ0_BASE (S5PC100_GPIO_BASE + 0x0200) +#define S5PC100_GPJ1_BASE (S5PC100_GPIO_BASE + 0x0220) +#define S5PC100_GPJ2_BASE (S5PC100_GPIO_BASE + 0x0240) +#define S5PC100_GPJ3_BASE (S5PC100_GPIO_BASE + 0x0260) +#define S5PC100_GPJ4_BASE (S5PC100_GPIO_BASE + 0x0280) +#define S5PC100_GPK0_BASE (S5PC100_GPIO_BASE + 0x02A0) +#define S5PC100_GPK1_BASE (S5PC100_GPIO_BASE + 0x02C0) +#define S5PC100_GPK2_BASE (S5PC100_GPIO_BASE + 0x02E0) +#define S5PC100_GPK3_BASE (S5PC100_GPIO_BASE + 0x0300) +#define S5PC100_GPL0_BASE (S5PC100_GPIO_BASE + 0x0320) +#define S5PC100_GPL1_BASE (S5PC100_GPIO_BASE + 0x0340) +#define S5PC100_GPL2_BASE (S5PC100_GPIO_BASE + 0x0360) +#define S5PC100_GPL3_BASE (S5PC100_GPIO_BASE + 0x0380) +#define S5PC100_GPL4_BASE (S5PC100_GPIO_BASE + 0x03A0) +#define S5PC100_EINT_BASE (S5PC100_GPIO_BASE + 0x0E00) + +#define S5PC100_UHOST (S5PC100_GPIO_BASE + 0x0B68) +#define S5PC100_PDNEN (S5PC100_GPIO_BASE + 0x0F80) + +/* PDNEN */ +#define S5PC100_PDNEN_CFG_PDNEN (1 << 1) +#define S5PC100_PDNEN_CFG_AUTO (0 << 1) +#define S5PC100_PDNEN_POWERDOWN (1 << 0) +#define S5PC100_PDNEN_NORMAL (0 << 0) + +/* Common part */ +/* External interrupt base is same at both s5pc100 and s5pc110 */ +#define S5PC1XX_EINT_BASE (S5PC100_EINT_BASE) + +#define S5PC100_GPx_INPUT (__gpio) (0x0 << ((__gpio) * 4)) +#define S5PC100_GPx_OUTPUT (__gpio) (0x1 << ((__gpio) * 4)) +#define S5PC100_GPx_CONMASK (__gpio) (0xf << ((__gpio) * 4)) + +#endif /* __ASM_PLAT_S5PC1XX_REGS_GPIO_H */ +arch/arm/plat-s5pc1xx/irq-eint.c new file +281
-0@@ -0,0 +1,281 @@ +/* +* linux/arch/arm/plat-s5pc1xx/irq-eint.c +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* Kyungin Park <[email protected]> +* +* Based on plat-s3c64xx/irq-eint.c +* +* S5PC1XX - Interrupt handling for IRQ_EINT(x) +* +* 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/kernel.h> +#include <linux/interrupt.h> +#include <linux/irq.h> +#include <linux/io.h> +#include <linux/sysdev.h> +#include <linux/pm.h> + +#include <asm/hardware/vic.h> + +#include <mach/map.h> +#include <mach/gpio.h> + +#include <plat/gpio-cfg.h> +#include <plat/gpio-ext.h> +#include <plat/pm.h> +#include <plat/regs-gpio.h> +#include <plat/regs-irqtype.h> + +/* +* bank is a group of external interrupt +* bank0 means EINT0 ... EINT7 +* bank1 means EINT8 ... EINT15 +* bank2 means EINT16 ... EINT23 +* bank3 means EINT24 ... EINT31 +*/ + +static inline int s3c_get_eint (unsigned int irq) +{ +int real; + +if (irq <IRQ_EINT16_31 ) + real = (irq -IRQ_EINT0 ); +else + real = (irq -S3C_IRQ_EINT_BASE ) +IRQ_EINT16_31 -IRQ_EINT0 ; + +return real; +} + +static inline int s3c_get_bank (unsigned int irq) +{ +return s3c_get_eint (irq) >>3 ; +} + +static inline int s3c_eint_to_bit (unsigned int irq) +{ +int real, bit; + + real =s3c_get_eint (irq); + bit =1 << (real & (8 -1 )); + +return bit; +} + +static inline void s3c_irq_eint_mask (unsigned int irq) +{ +u32 mask; +u32 bank =s3c_get_bank (irq); + + mask =__raw_readl (S5PC1XX_WKUP_INT_MASK (bank)); + mask |=s3c_eint_to_bit (irq); +__raw_writel (mask,S5PC1XX_WKUP_INT_MASK (bank)); +} + +static void s3c_irq_eint_unmask (unsigned int irq) +{ +u32 mask; +u32 bank =s3c_get_bank (irq); + + mask =__raw_readl (S5PC1XX_WKUP_INT_MASK (bank)); + mask &= ~(s3c_eint_to_bit (irq)); +__raw_writel (mask,S5PC1XX_WKUP_INT_MASK (bank)); +} + +static inline void s3c_irq_eint_ack (unsigned int irq) +{ +u32 bank =s3c_get_bank (irq); + +__raw_writel (s3c_eint_to_bit (irq),S5PC1XX_WKUP_INT_PEND (bank)); +} + +static void s3c_irq_eint_maskack (unsigned int irq) +{ +/* compiler should in-line these */ +s3c_irq_eint_mask (irq); +s3c_irq_eint_ack (irq); +} + +static int s3c_irq_eint_set_type (unsigned int irq,unsigned int type) +{ +u32 bank =s3c_get_bank (irq); +int real =s3c_get_eint (irq); +int gpio, shift, sfn; +u32 ctrl, con =0 ; + +switch (type) { +case IRQ_TYPE_NONE : +printk (KERN_WARNING "No edge setting!\n" ); +break ; + +case IRQ_TYPE_EDGE_RISING : + con =S5PC1XX_WKUP_INT_RISEEDGE ; +break ; + +case IRQ_TYPE_EDGE_FALLING : + con =S5PC1XX_WKUP_INT_FALLEDGE ; +break ; + +case IRQ_TYPE_EDGE_BOTH : + con =S5PC1XX_WKUP_INT_BOTHEDGE ; +break ; + +case IRQ_TYPE_LEVEL_LOW : + con =S5PC1XX_WKUP_INT_LOWLEV ; +break ; + +case IRQ_TYPE_LEVEL_HIGH : + con =S5PC1XX_WKUP_INT_HILEV ; +break ; + +default : +printk (KERN_ERR "No such irq type %d" , type); +return -EINVAL ; + } + + gpio = real & (8 -1 ); + shift = gpio <<2 ; + + ctrl =__raw_readl (S5PC1XX_WKUP_INT_CON (bank)); + ctrl &= ~(0x7 << shift); + ctrl |= con << shift; +__raw_writel (ctrl,S5PC1XX_WKUP_INT_CON (bank)); + +switch (real) { + case 0 ... 7: + gpio =S5PC100_GPH0 (gpio); +break ; + case 8 ... 15: + gpio =S5PC100_GPH1 (gpio); +break ; + case 16 ... 23: + gpio =S5PC100_GPH2 (gpio); +break ; + case 24 ... 31: + gpio =S5PC100_GPH3 (gpio); +break ; +default : +return -EINVAL ; + } + + sfn =S3C_GPIO_SFN (0x2 ); +s3c_gpio_cfgpin (gpio, sfn); + +return 0 ; +} + +static struct irq_chip s3c_irq_eint = { + .name ="EINT" , + .mask = s3c_irq_eint_mask, + .unmask = s3c_irq_eint_unmask, + .mask_ack = s3c_irq_eint_maskack, + .ack = s3c_irq_eint_ack, + .set_type = s3c_irq_eint_set_type, + .set_wake = s3c_irqext_wake, +}; + +/* s3c_irq_demux_eint +* +* This function demuxes the IRQ from external interrupts, +* from IRQ_EINT(16) to IRQ_EINT(31). It is designed to be inlined into +* the specific handlers s3c_irq_demux_eintX_Y. +*/ +static inline void s3c_irq_demux_eint (unsigned int start,unsigned int end) +{ +u32 status =__raw_readl (S5PC1XX_WKUP_INT_PEND ((start >>3 ))); +u32 mask =__raw_readl (S5PC1XX_WKUP_INT_MASK ((start >>3 ))); +unsigned int irq; + + status &= ~mask; + status &= (1 << (end - start +1 )) -1 ; + +for (irq =IRQ_EINT (start); irq <=IRQ_EINT (end); irq++) { +if (status &1 ) +generic_handle_irq (irq); + + status >>=1 ; + } +} + +static void s3c_irq_demux_eint16_31 (unsigned int irq,struct irq_desc *desc) +{ +s3c_irq_demux_eint (16 ,23 ); +s3c_irq_demux_eint (24 ,31 ); +} + +/* +* Handle EINT0 ... EINT15 at VIC directly +*/ +static void s3c_irq_vic_eint_mask (unsigned int irq) +{ +void __iomem *base =get_irq_chip_data (irq); +unsigned int real; + +s3c_irq_eint_mask (irq); + real =s3c_get_eint (irq); +writel (1 << real, base +VIC_INT_ENABLE_CLEAR ); +} + +static void s3c_irq_vic_eint_unmask (unsigned int irq) +{ +void __iomem *base =get_irq_chip_data (irq); +unsigned int real; + +s3c_irq_eint_unmask (irq); + real =s3c_get_eint (irq); +writel (1 << real, base +VIC_INT_ENABLE ); +} + +static inline void s3c_irq_vic_eint_ack (unsigned int irq) +{ +u32 bit; +u32 bank =s3c_get_bank (irq); + + bit =s3c_eint_to_bit (irq); +__raw_writel (bit,S5PC1XX_WKUP_INT_PEND (bank)); +} + +static void s3c_irq_vic_eint_maskack (unsigned int irq) +{ +/* compiler should in-line these */ +s3c_irq_vic_eint_mask (irq); +s3c_irq_vic_eint_ack (irq); +} + +static struct irq_chip s3c_irq_vic_eint = { + .name ="EINT" , + .mask = s3c_irq_vic_eint_mask, + .unmask = s3c_irq_vic_eint_unmask, + .mask_ack = s3c_irq_vic_eint_maskack, + .ack = s3c_irq_vic_eint_ack, + .set_type = s3c_irq_eint_set_type, + .set_wake = s3c_irqext_wake, +}; + +static int __init s5pc1xx_init_irq_eint (void ) +{ +int irq; + +for (irq =IRQ_EINT0 ; irq <=IRQ_EINT15 ; irq++) { +set_irq_chip (irq, &s3c_irq_vic_eint); +set_irq_handler (irq, handle_level_irq); +set_irq_flags (irq,IRQF_VALID ); + } + +for (irq =IRQ_EINT (16 ); irq <=IRQ_EINT (31 ); irq++) { +set_irq_chip (irq, &s3c_irq_eint); +set_irq_handler (irq, handle_level_irq); +set_irq_flags (irq,IRQF_VALID ); + } + +set_irq_chained_handler (IRQ_EINT16_31 , s3c_irq_demux_eint16_31); + +return 0 ; +} + +arch_initcall (s5pc1xx_init_irq_eint);arch/arm/plat-s5pc1xx/irq-gpio.c new file +266
-0@@ -0,0 +1,266 @@ +/* +* arch/arm/plat-s5pc1xx/irq-gpio.c +* +* Copyright (C) 2009 Samsung Electronics +* +* S5PC1XX - Interrupt handling for IRQ_GPIO${group}(x) +* +* 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/kernel.h> +#include <linux/interrupt.h> +#include <linux/irq.h> +#include <linux/io.h> + +#include <mach/map.h> +#include <mach/gpio.h> +#include <plat/gpio-cfg.h> + +#define S5PC1XX_GPIOREG (x) (S5PC1XX_VA_GPIO + (x)) + +#define CON_OFFSET 0x700 +#define MASK_OFFSET 0x900 +#define PEND_OFFSET 0xA00 +#define CON_OFFSET_2 0xE00 +#define MASK_OFFSET_2 0xF00 +#define PEND_OFFSET_2 0xF40 + +#define GPIOINT_LEVEL_LOW 0x0 +#define GPIOINT_LEVEL_HIGH 0x1 +#define GPIOINT_EDGE_FALLING 0x2 +#define GPIOINT_EDGE_RISING 0x3 +#define GPIOINT_EDGE_BOTH 0x4 + +static int group_to_con_offset (int group) +{ +return group <<2 ; +} + +static int group_to_mask_offset (int group) +{ +return group <<2 ; +} + +static int group_to_pend_offset (int group) +{ +return group <<2 ; +} + +static int s5pc1xx_get_start (unsigned int group) +{ +switch (group) { +case 0 :return S5PC100_GPIO_A0_START ; +case 1 :return S5PC100_GPIO_A1_START ; +case 2 :return S5PC100_GPIO_B_START ; +case 3 :return S5PC100_GPIO_C_START ; +case 4 :return S5PC100_GPIO_D_START ; +case 5 :return S5PC100_GPIO_E0_START ; +case 6 :return S5PC100_GPIO_E1_START ; +case 7 :return S5PC100_GPIO_F0_START ; +case 8 :return S5PC100_GPIO_F1_START ; +case 9 :return S5PC100_GPIO_F2_START ; +case 10 :return S5PC100_GPIO_F3_START ; +case 11 :return S5PC100_GPIO_G0_START ; +case 12 :return S5PC100_GPIO_G1_START ; +case 13 :return S5PC100_GPIO_G2_START ; +case 14 :return S5PC100_GPIO_G3_START ; +case 15 :return S5PC100_GPIO_I_START ; +case 16 :return S5PC100_GPIO_J0_START ; +case 17 :return S5PC100_GPIO_J1_START ; +case 18 :return S5PC100_GPIO_J2_START ; +case 19 :return S5PC100_GPIO_J3_START ; +case 20 :return S5PC100_GPIO_J4_START ; +default : +BUG (); + } + +return -EINVAL ; +} + +static int s5pc1xx_get_group (unsigned int irq) +{ + irq -=S3C_IRQ_GPIO (0 ); + +switch (irq) { + case S5PC100_GPIO_A0_START ... S5PC100_GPIO_A1_START - 1: +return 0 ; + case S5PC100_GPIO_A1_START ... S5PC100_GPIO_B_START - 1: +return 1 ; + case S5PC100_GPIO_B_START ... S5PC100_GPIO_C_START - 1: +return 2 ; + case S5PC100_GPIO_C_START ... S5PC100_GPIO_D_START - 1: +return 3 ; + case S5PC100_GPIO_D_START ... S5PC100_GPIO_E0_START - 1: +return 4 ; + case S5PC100_GPIO_E0_START ... S5PC100_GPIO_E1_START - 1: +return 5 ; + case S5PC100_GPIO_E1_START ... S5PC100_GPIO_F0_START - 1: +return 6 ; + case S5PC100_GPIO_F0_START ... S5PC100_GPIO_F1_START - 1: +return 7 ; + case S5PC100_GPIO_F1_START ... S5PC100_GPIO_F2_START - 1: +return 8 ; + case S5PC100_GPIO_F2_START ... S5PC100_GPIO_F3_START - 1: +return 9 ; + case S5PC100_GPIO_F3_START ... S5PC100_GPIO_G0_START - 1: +return 10 ; + case S5PC100_GPIO_G0_START ... S5PC100_GPIO_G1_START - 1: +return 11 ; + case S5PC100_GPIO_G1_START ... S5PC100_GPIO_G2_START - 1: +return 12 ; + case S5PC100_GPIO_G2_START ... S5PC100_GPIO_G3_START - 1: +return 13 ; + case S5PC100_GPIO_G3_START ... S5PC100_GPIO_H0_START - 1: +return 14 ; + case S5PC100_GPIO_I_START ... S5PC100_GPIO_J0_START - 1: +return 15 ; + case S5PC100_GPIO_J0_START ... S5PC100_GPIO_J1_START - 1: +return 16 ; + case S5PC100_GPIO_J1_START ... S5PC100_GPIO_J2_START - 1: +return 17 ; + case S5PC100_GPIO_J2_START ... S5PC100_GPIO_J3_START - 1: +return 18 ; + case S5PC100_GPIO_J3_START ... S5PC100_GPIO_J4_START - 1: +return 19 ; + case S5PC100_GPIO_J4_START ... S5PC100_GPIO_K0_START - 1: +return 20 ; +default : +BUG (); + } + +return -EINVAL ; +} + +static int s5pc1xx_get_offset (unsigned int irq) +{ +struct gpio_chip *chip =get_irq_data (irq); +return irq -S3C_IRQ_GPIO (chip->base); +} + +static void s5pc1xx_gpioint_ack (unsigned int irq) +{ +int group, offset, pend_offset; +unsigned int value; + + group =s5pc1xx_get_group (irq); + offset =s5pc1xx_get_offset (irq); + pend_offset =group_to_pend_offset (group); + + value =__raw_readl (S5PC1XX_GPIOREG (PEND_OFFSET ) + pend_offset); + value |=1 << offset; +__raw_writel (value,S5PC1XX_GPIOREG (PEND_OFFSET ) + pend_offset); +} + +static void s5pc1xx_gpioint_mask (unsigned int irq) +{ +int group, offset, mask_offset; +unsigned int value; + + group =s5pc1xx_get_group (irq); + offset =s5pc1xx_get_offset (irq); + mask_offset =group_to_mask_offset (group); + + value =__raw_readl (S5PC1XX_GPIOREG (MASK_OFFSET ) + mask_offset); + value |=1 << offset; +__raw_writel (value,S5PC1XX_GPIOREG (MASK_OFFSET ) + mask_offset); +} + +static void s5pc1xx_gpioint_unmask (unsigned int irq) +{ +int group, offset, mask_offset; +unsigned int value; + + group =s5pc1xx_get_group (irq); + offset =s5pc1xx_get_offset (irq); + mask_offset =group_to_mask_offset (group); + + value =__raw_readl (S5PC1XX_GPIOREG (MASK_OFFSET ) + mask_offset); + value &= ~(1 << offset); +__raw_writel (value,S5PC1XX_GPIOREG (MASK_OFFSET ) + mask_offset); +} + +static void s5pc1xx_gpioint_mask_ack (unsigned int irq) +{ +s5pc1xx_gpioint_mask (irq); +s5pc1xx_gpioint_ack (irq); +} + +static int s5pc1xx_gpioint_set_type (unsigned int irq,unsigned int type) +{ +int group, offset, con_offset; +unsigned int value; + + group =s5pc1xx_get_group (irq); + offset =s5pc1xx_get_offset (irq); + con_offset =group_to_con_offset (group); + +switch (type) { +case IRQ_TYPE_NONE : +printk (KERN_WARNING "No irq type\n" ); +return -EINVAL ; +case IRQ_TYPE_EDGE_RISING : + type =GPIOINT_EDGE_RISING ; +break ; +case IRQ_TYPE_EDGE_FALLING : + type =GPIOINT_EDGE_FALLING ; +break ; +case IRQ_TYPE_EDGE_BOTH : + type =GPIOINT_EDGE_BOTH ; +break ; +case IRQ_TYPE_LEVEL_HIGH : + type =GPIOINT_LEVEL_HIGH ; +break ; +case IRQ_TYPE_LEVEL_LOW : + type =GPIOINT_LEVEL_LOW ; +break ; +default : +BUG (); + } + + + value =__raw_readl (S5PC1XX_GPIOREG (CON_OFFSET ) + con_offset); + value &= ~(0xf << (offset *0x4 )); + value |= (type << (offset *0x4 )); +__raw_writel (value,S5PC1XX_GPIOREG (CON_OFFSET ) + con_offset); + +return 0 ; +} + +struct irq_chip s5pc1xx_gpioint = { + .name ="GPIO" , + .ack = s5pc1xx_gpioint_ack, + .mask = s5pc1xx_gpioint_mask, + .mask_ack = s5pc1xx_gpioint_mask_ack, + .unmask = s5pc1xx_gpioint_unmask, + .set_type = s5pc1xx_gpioint_set_type, +}; + +void s5pc1xx_irq_gpioint_handler (unsigned int irq,struct irq_desc *desc) +{ +int group, offset, pend_offset, mask_offset; +int real_irq, group_end; +unsigned int pend, mask; + + group_end =21 ; + +for (group =0 ; group < group_end; group++) { + pend_offset =group_to_pend_offset (group); + pend =__raw_readl (S5PC1XX_GPIOREG (PEND_OFFSET ) + pend_offset); +if (!pend) +continue ; + + mask_offset =group_to_mask_offset (group); + mask =__raw_readl (S5PC1XX_GPIOREG (MASK_OFFSET ) + mask_offset); + pend &= ~mask; + +for (offset =0 ; offset <8 ; offset++) { +if (pend & (1 << offset)) { + real_irq =s5pc1xx_get_start (group) + offset; +generic_handle_irq (S3C_IRQ_GPIO (real_irq)); + } + } + } +}arch/arm/plat-s5pc1xx/irq.c +1
-1@@ -79,7 +79,7 @@ static void s3c_irq_timer_ack(unsigned int irq) {u32 reg =__raw_readl (S3C64XX_TINT_CSTAT ); - reg &=0x1f ; + reg &=0x1f ;/* mask out pending interrupts */ reg |= (1 <<5 ) << (irq -IRQ_TIMER0 );__raw_writel (reg,S3C64XX_TINT_CSTAT ); }Signature · 7 lines
1.6.5 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 7/18 ARM: S5PC1xx: add gpiolib and external/gpio interrupt support
Hello,
Quoted 52 lines · Ben Dooks
Quoted 51 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
Add support for gpiolib calls. This is based on the gpiolib implementation from plat-s3c64xx tree.
Add support for external interrupts for GPIO H banks.
Add support for GPIO interrupts for all banks.Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/plat-s3c/Kconfig | 6 + arch/arm/plat-s3c/include/plat/gpio-cfg.h | 1 + arch/arm/plat-s5pc1xx/Kconfig | 3 + arch/arm/plat-s5pc1xx/Makefile | 4 +- arch/arm/plat-s5pc1xx/cpu.c | 5 + arch/arm/plat-s5pc1xx/gpio-config.c | 60 +++ arch/arm/plat-s5pc1xx/gpiolib.c | 503 ++++++++++++++++++++ .../plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h | 32 ++ arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h | 44 ++ arch/arm/plat-s5pc1xx/include/plat/irqs.h | 15 +- arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h | 70 +++ arch/arm/plat-s5pc1xx/irq-eint.c | 281 +++++++++++ arch/arm/plat-s5pc1xx/irq-gpio.c | 266 +++++++++++ arch/arm/plat-s5pc1xx/irq.c | 2 +- 14 files changed, 1287 insertions(+), 5 deletions(-) create mode 100644 arch/arm/plat-s5pc1xx/gpio-config.c create mode 100644 arch/arm/plat-s5pc1xx/gpiolib.c create mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h create mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h create mode 100644 arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h create mode 100644 arch/arm/plat-s5pc1xx/irq-eint.c create mode 100644 arch/arm/plat-s5pc1xx/irq-gpio.carch/arm/plat-s3c/Kconfig +6
-0@@ -159,6 +159,12 @@ config S3C_GPIO_CFG_S3C64XX Internal configuration to enable S3C64XX style GPIO configuration functions. +config S5P_GPIO_CFG_S5PC1XX + bool + help + Internal configuration to enable S5PC1XX style GPIO configuration + functions. + # DMA
Quoted 13 lines
arch/arm/plat-s3c/include/plat/gpio-cfg.h struct s3c_gpio_cfg { · line 65
Quoted 10 lines
arch/arm/plat-s3c/Kconfig +0
-0config S3C_DMAarch/arm/plat-s3c/include/plat/gpio-cfg.h +1
-0@@ -62,6 +62,7 @@ struct s3c_gpio_cfg {#define S3C_GPIO_INPUT (S3C_GPIO_SPECIAL(0))#define S3C_GPIO_OUTPUT (S3C_GPIO_SPECIAL(1))#define S3C_GPIO_SFN (x) (S3C_GPIO_SPECIAL(x)) +#define S3C_GPIO_IRQ (S3C_GPIO_SPECIAL(0xf))I believ this to be wrong, this certainly won't work on at least some of the S3C64XX GPIO banks. It is also unused in this patch.
Right, I will remove it from this patch.
Quoted 2 lines
I'm not sure whether to just apply this one and remove this definition or ask for a response on why it should be in here?
I will send a new updated patch series.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
PATCH 1/18 ARM: MM: use 64bytes of L1 cache on plat S5PC1xx
In reply to Marek SzyprowskiQuoted 3 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
This one i'll keep out of the series, as it either needs to go to Russell's patch tracker on be on a branch for Russell to merge into the main arm tree.
Quoted 28 lines
Samsung S5PC1xx SoCs are Coretex8 based, so use 64 bytes of L1 cache line instead of the default 32 bytes.
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/mm/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/mm/Kconfig +1
-1@@ -774,5 +774,5 @@ config CACHE_XSC3L2 config ARM_L1_CACHE_SHIFT int - default 6 if ARCH_OMAP3 + default 6 if ARCH_OMAP3 || ARCH_S5PC1XX default 5Signature · 7 lines
1.6.5 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 1/18 ARM: MM: use 64bytes of L1 cache on plat S5PC1xx
Quoted 8 lines · Ben Dooks
Quoted 3 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
This one i'll keep out of the series, as it either needs to go to Russell's patch tracker on be on a branch for Russell to merge into the main arm tree.
FYI, I haven't seen it there yet.
PATCH 1/18 ARM: MM: use 64bytes of L1 cache on plat S5PC1xx
Hello,
Quoted 11 lines · Russell King
Quoted 8 lines · Ben Dooks
Quoted 3 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
This one i'll keep out of the series, as it either needs to go to Russell's patch tracker on be on a branch for Russell to merge into the main arm tree.
FYI, I haven't seen it there yet.
Ok. I've just posted it there. I thought that posting it again on ARM mailing list as a separate patch would be enough.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
PATCH 1/1 Update Samsung S5PC100 SoC support
In reply to Marek SzyprowskiQuoted 8 lines · Marek Szyprowski
Hello,
This patch series updates Samsung S5PC100 SoC support. S5PC100 platform core has been extended with new clocks hierarchy implementation, gpio lib, support for external and gpio interrupts and some basics of power management (cpu idle and system reset). Also platform helpers for s3c framebuffer, i2c and hsmmc drivers has been added.
Quoted 4 lines
All these patches has been tested on SMDKC100 board.
This patch series has been prepared against latest ARM Kernel tree from
http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm.git/
I'll put up a new git on git.fluff.org once this is processed.
Quoted 2 lines
This is a second version of this patch series. I've tried to address all the issues reported here on the mailing list.
Hmm, it seems your git-send-email is now putting
From: Kyungmin Park <[email protected]>
From: Kyungmin Park <[email protected]>
in twice.. wonder what happened here?
I'll edit out these before applying as it is easy enough to sort.
Quoted 25 lines
This patch series includes:
[PATCH 01/18] ARM: MM: use 64bytes of L1 cache on plat S5PC1xx
[PATCH 02/18] ARM: S5PC1XX: registers rename
[PATCH 03/18] ARM: S5PC1XX: clock registers rename
[PATCH 04/18] ARM: S5PC1XX: clocks reimplementation
[PATCH 05/18] ARM: S5PC1XX: add GPIO L banks to register definition [PATCH 06/18] ARM: S5PC1XX: GPIO registers rename
[PATCH 07/18] ARM: S5PC1xx: add gpiolib and external/gpio interrupt support [PATCH 08/18] ARM: S5PC1XX: add cpu idle and system reset support [PATCH 09/18] ARM: S3C: Prepare s3c64xx-specific s3c-fb register definition for reuse [PATCH 10/18] ARM: S5PC1xx: add platform helpers for s3c-fb device [PATCH 11/18] SMDKC100: enable S3C FrameBuffer
[PATCH 12/18] drivers: fb: enable S3C FrameBuffer on S5PC1XX platform [PATCH 13/18] ARM: S5PC1xx: add platform helpers for i2c adapter devices [PATCH 14/18] SMDKC100: add I2C0 and I2C1 buses support
[PATCH 15/18] drivers: i2c: s3c2410-i2c also on S5PC1XX platform
[PATCH 16/18] ARM: S5PC1xx: add platform helpers for SDHCI host controllers [PATCH 17/18] SMDKC100: add SDHCI controllers 0, 1 and 2 support
[PATCH 18/18] drivers: MMC: enable SDHCI-S3C on S5PC1XX platform_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 1/1 Update Samsung S5PC100 SoC support
In reply to Marek SzyprowskiQuoted 7 lines · Marek Szyprowski
Hello,
This patch series updates Samsung S5PC100 SoC support. S5PC100 platform core has been extended with new clocks hierarchy implementation, gpio lib, support for external and gpio interrupts and some basics of power management (cpu idle and system reset). Also platform helpers for s3c framebuffer, i2c and hsmmc drivers has been added.
As such, a new branch git://git.fluff.org/bjdooks/linux next-s5pc1xx has been created. This branch hasn't yet been build tested, or had the patches that failed to apply on them.
The following from the series still need fixups before applying due to the missing FB updates:
Applying: ARM: S5PC1xx: add platform helpers for SDHCI host controllers
Applying: ARM: S5PC1xx: add platform helpers for i2c adapter devices
I'll look at fixing these up tomorrow if the FB items haven't been sorted out.
The shortlog is:
Kyungmin Park (9):
ARM: SMDKC100: enable S3C FrameBuffer
ARM: S5PC1XX: registers rename
ARM: S5PC1XX: clock registers rename
ARM: S5PC1XX: clocks reimplementation
ARM: S5PC1XX: add GPIO L banks to register definition
ARM: S5PC1XX: GPIO registers rename
ARM: S5PC1XX: add cpu idle and system reset support
ARM: SMDKC100: add I2C0 and I2C1 buses support
ARM: SMDKC100: add SDHCI controllers 0, 1 and 2 support
If there are any problems, please let me know as soon as possible, as I will be looking to merge these into my main next branch in the next day or so to begin the final stages of the device and clock reworks.
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 1/1 Update Samsung S5PC100 SoC support
Hello,
Quoted 35 lines · Ben Dooks
Quoted 7 lines · Marek Szyprowski
Hello,
This patch series updates Samsung S5PC100 SoC support. S5PC100 platform core has been extended with new clocks hierarchy implementation, gpio lib, support for external and gpio interrupts and some basics of power management (cpu idle and system reset). Also platform helpers for s3c framebuffer, i2c and hsmmc drivers has been added.
As such, a new branch
git://git.fluff.org/bjdooks/linuxnext-s5pc1xx has been created. This branch hasn't yet been build tested, or had the patches that failed to apply on them.The following from the series still need fixups before applying due to the missing FB updates:
Applying: ARM: S5PC1xx: add platform helpers for SDHCI host controllers
Applying: ARM: S5PC1xx: add platform helpers for i2c adapter devicesI'll look at fixing these up tomorrow if the FB items haven't been sorted out.
The shortlog is:
Kyungmin Park (9):
ARM: SMDKC100: enable S3C FrameBuffer
ARM: S5PC1XX: registers rename
ARM: S5PC1XX: clock registers rename
ARM: S5PC1XX: clocks reimplementation
ARM: S5PC1XX: add GPIO L banks to register definition
ARM: S5PC1XX: GPIO registers rename
ARM: S5PC1XX: add cpu idle and system reset support
ARM: SMDKC100: add I2C0 and I2C1 buses support
ARM: SMDKC100: add SDHCI controllers 0, 1 and 2 support
Quoted 3 lines
If there are any problems, please let me know as soon as possible, as I will be looking to merge these into my main next branch in the next day or so to begin the final stages of the device and clock reworks.
This version does not compile without fb patches. I will send an updated version (with your last remarks addressed) of the whole patch series soon. Is there a chance you would accept that fb patch?
I'm really curious of the device and clock reworks. I hope you will manage to get it working soon and prepare a pre-release version.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
PATCH 1/1 Update Samsung S5PC100 SoC support
In reply to Marek SzyprowskiQuoted 1 line · Marek Szyprowski
This patch series updates Samsung S5PC100 SoC support.
Please go through all patches in this series looking for mach/gpio.h, asm/io.h, asm/gpio.h include statements, and change them to their linux/ equivalents. There's a number of such things in this patch set.