[PATCH 02/20] ARM: S5PC1XX: create sub-platform for S5PC100 SoCs

2009-11-20 Thread Marek Szyprowski
From: Kyungmin Park kyungmin.p...@samsung.com

Samsung S5PC100 and S5PC110 SoCs differs a lot in register map and other
core platform definitions, so it is not possible to have both SoCs in
the current platform framework without runtime hacks. To address this
issue a sub-platform has been introduced, so each SoC in sub-platform
can have its own set of include files (register map, irqgpio
definitions, etc)

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/Makefile |2 +-
 arch/arm/mach-s5pc100/Kconfig |4 
 arch/arm/plat-s5pc1xx/Kconfig |   10 ++
 3 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index a73caaf..daea150 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -160,7 +160,7 @@ machine-$(CONFIG_ARCH_RPC)  := rpc
 machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 
s3c2442 s3c2443
 machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0
 machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410
-machine-$(CONFIG_ARCH_S5PC1XX) := s5pc100
+machine-$(CONFIG_ARCH_S5PC100) := s5pc100
 machine-$(CONFIG_ARCH_SA1100)  := sa1100
 machine-$(CONFIG_ARCH_SHARK)   := shark
 machine-$(CONFIG_ARCH_STMP378X):= stmp378x
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 0dd2b8c..d72f881 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -5,6 +5,8 @@
 #
 # Licensed under GPLv2
 
+if ARCH_S5PC100
+
 # Configuration options for the S5PC100 CPU
 
 config CPU_S5PC100
@@ -34,3 +36,5 @@ config MACH_SMDKC100
select S5PC100_SETUP_SDHCI
help
  Machine support for the Samsung SMDKC100
+
+endif
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index 1608e62..eee2abb 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -23,6 +23,16 @@ config PLAT_S5PC1XX
 
 if PLAT_S5PC1XX
 
+choice
+   prompt S5PC1xx SoC Type
+   default ARCH_S5PC100
+
+config ARCH_S5PC100
+   bool S5PC100
+
+endchoice
+
+
 # Configuration options shared by all S3C64XX implementations
 
 config CPU_S5PC100_INIT
-- 
1.6.4

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] Add Samsung S5PC110 SoC support

2009-11-20 Thread Marek Szyprowski
Hello,

This preliminary patch series adds support for Samsung S5PC110 SoC.
S5PC110 belongs to S5PC1XX family (CortexA8 ARM core), but differs in
many places from the S5PC100 SoC: new memory map, different clock
hierarchy, new gpio banks and much more powerful integrated peripherals.
Such differences cannot be easily handled in the current Samsung
machineplatform framework. To avoid duplication of code and adding yet
another plat-* directory, we decided to introduce sub-platforms in
the current s5pc1xx platform.

First 8 patches prepare s5pc1xx platform code for introduction of the
new sub-platform approach. Then in the next 11 patches all core
functions and drivers are subsequently added, so S5PC110 sub-platform
gets similar level of support as S5PC100. The last patch updated
MAINTAINERS information.

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 the second version of this patch series. The following issues
reported by Ben have been fixed: gpiolib support has been rewriten, more
SoC specific files have been moved to mach-s5pc* directories (gpio chip,
plls and clocks definitions). Also author/sender issues are resolved.

The clock issue in S5PC110 driver has not been addressed. The driver
uses clock API in the same way as it is handled in other Samsung UART
drivers. This clock issue should be resolved in a separate patch which
would fix all Samsung drivers at once. Until then we would like to use
the current approach.

This patch series includes:

[PATCH 01/20] ARM: S5PC100: use 0x30008000 as memory base
[PATCH 02/20] ARM: S5PC1XX: create sub-platform for S5PC100 SoCs
[PATCH 03/20] ARM: S5PC1XX: prepare common cpuclocks code for S5PC110 
sub-platform
[PATCH 04/20] ARM: S5PC1XX: prepare common gpiolib code for S5PC110 sub-platform
[PATCH 05/20] ARM: S5PC1XX: move common s5pc1xx mach/* includes to 
plat-s5pc1xx/include/mach
[PATCH 06/20] ARM: S5PC1XX: cleanup of s5pc1xx common code
[PATCH 07/20] ARM: S5PC1XX: move s5pc100 specific device helpers to 
mach-s5pc100 dir
[PATCH 08/20] ARM: S5PC1XX: move common s5pc1xx s3c-fb regs to platform 
directory
[PATCH 09/20] drivers: serial: add support for Samsung S5PC110 SoC uart
[PATCH 10/20] ARM: S5PC1XX: add S5PC110 memory map
[PATCH 11/20] ARM: S5PC1XX: add S5PC110 cpu initialization code
[PATCH 12/20] ARM: S5PC1XX: add support for s5pc110 plls and clocks
[PATCH 13/20] ARM: S5PC1XX: add support for s5pc110 irqs
[PATCH 14/20] ARM: S5PC1XX: add support for s5pc110 gpio
[PATCH 15/20] ARM: S5PC1XX: add i2c platform helpers on s5pc110 sub-platform
[PATCH 16/20] ARM: S5PC1XX: enable S5PC110 sub-platform
[PATCH 17/20] ARM: S5PC1XX: add sdhci platform helpers for s5pc110 sub-platform
[PATCH 18/20] ARM: S5PC1XX: add framebuffer platform helpers for s5pc110 
sub-platform
[PATCH 19/20] ARM: S5PC1XX: add support for SMDKC110 board
[PATCH 20/20] MAINTAINERS: add ARM/S5PC100 and ARM/S5PC110 architectures
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/20] drivers: serial: add support for Samsung S5PC110 SoC uart

2009-11-20 Thread Marek Szyprowski
From: Kyungmin Park kyungmin.p...@samsung.com

Samsung S5PC110 SoCs have UART that differs a bit from the one known
from the previous Samsung SoCs. This patch adds support for this new
driver.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/plat-s3c/include/plat/regs-serial.h |   31 ++
 drivers/serial/Kconfig   |7 ++
 drivers/serial/Makefile  |1 +
 drivers/serial/s5pc110.c |  143 ++
 4 files changed, 182 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/s5pc110.c

diff --git a/arch/arm/plat-s3c/include/plat/regs-serial.h 
b/arch/arm/plat-s3c/include/plat/regs-serial.h
index 66af75a..910cfba 100644
--- a/arch/arm/plat-s3c/include/plat/regs-serial.h
+++ b/arch/arm/plat-s3c/include/plat/regs-serial.h
@@ -194,6 +194,37 @@
 #define S3C64XX_UINTSP 0x34
 #define S3C64XX_UINTM  0x38
 
+/* S5PC110 UCON */
+#define S5PC110_UCON_CLKMASK   (110)
+#define S5PC110_UCON_PCLK  (010)
+#define S5PC110_UCON_SCLK_UART (110)
+
+/* S5PC110 FIFO trigger levels */
+#define S5PC110_UFCON_RXTRIG1  (04)
+#define S5PC110_UFCON_RXTRIG4  (14)
+#define S5PC110_UFCON_RXTRIG8  (24)
+#define S5PC110_UFCON_RXTRIG16 (34)
+#define S5PC110_UFCON_RXTRIG32 (44)
+#define S5PC110_UFCON_RXTRIG64 (54)
+#define S5PC110_UFCON_RXTRIG128(64)
+#define S5PC110_UFCON_RXTRIG256(74)
+
+#define S5PC110_UFCON_TXTRIG1  (08)
+#define S5PC110_UFCON_TXTRIG4  (18)
+#define S5PC110_UFCON_TXTRIG8  (28)
+#define S5PC110_UFCON_TXTRIG16 (38)
+#define S5PC110_UFCON_TXTRIG32 (48)
+#define S5PC110_UFCON_TXTRIG64 (58)
+#define S5PC110_UFCON_TXTRIG128(68)
+#define S5PC110_UFCON_TXTRIG256(78)
+
+#define S5PC110_UFSTAT_TXFULL  (124)
+#define S5PC110_UFSTAT_RXFULL  (18)
+#define S5PC110_UFSTAT_TXSHIFT (16)
+#define S5PC110_UFSTAT_RXSHIFT (0)
+#define S5PC110_UFSTAT_TXMASK  (25516)
+#define S5PC110_UFSTAT_RXMASK  (255)
+
 #ifndef __ASSEMBLY__
 
 /* struct s3c24xx_uart_clksrc
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index e522572..d119cac 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -540,6 +540,13 @@ config SERIAL_S5PC100
help
  Serial port support for the Samsung S5PC100 SoCs
 
+config SERIAL_S5PC110
+   tristate Samsung S5PC110 Serial port support
+   depends on SERIAL_SAMSUNG  CPU_S5PC110
+   default y
+   help
+ Serial port support for the Samsung S5PC110 SoCs
+
 config SERIAL_MAX3100
tristate MAX3100 support
depends on SPI
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index d21d5dd..43d6123 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -45,6 +45,7 @@ obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o
 obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o
 obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o
 obj-$(CONFIG_SERIAL_S5PC100) += s3c6400.o
+obj-$(CONFIG_SERIAL_S5PC110) += s5pc110.o
 obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
 obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
 obj-$(CONFIG_SERIAL_MUX) += mux.o
diff --git a/drivers/serial/s5pc110.c b/drivers/serial/s5pc110.c
new file mode 100644
index 000..1e1e229
--- /dev/null
+++ b/drivers/serial/s5pc110.c
@@ -0,0 +1,143 @@
+/*
+ * linux/drivers/serial/s5pc110.c
+ *
+ * Driver for Samsung S5PC110 SoC onboard UARTs.
+ *
+ *  Copyright 2009 Samsung Electronics
+ *  Kyungin Park kyungmin.p...@samsung.com
+ *
+ * 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/module.h
+#include linux/ioport.h
+#include linux/io.h
+#include linux/platform_device.h
+#include linux/init.h
+#include linux/serial_core.h
+#include linux/serial.h
+
+#include asm/irq.h
+#include mach/hardware.h
+
+#include plat/regs-serial.h
+
+#include samsung.h
+
+static int s5pc110_serial_setsource(struct uart_port *port,
+   struct s3c24xx_uart_clksrc *clk)
+{
+   unsigned long ucon = rd_regl(port, S3C2410_UCON);
+
+   if (strcmp(clk-name, uclk0) == 0)
+   ucon |= S5PC110_UCON_SCLK_UART;
+   else if (strcmp(clk-name, pclk) == 0)
+   /* See notes about transitioning from UCLK to PCLK */
+   ucon = ~S5PC110_UCON_SCLK_UART;
+   else {
+   printk(KERN_ERR unknown clock source %s\n, clk-name);
+   return -EINVAL;
+   }
+
+   wr_regl(port, S3C2410_UCON, ucon);
+   return 0;
+}
+
+static int s5pc110_serial_getsource(struct uart_port *port,
+   struct s3c24xx_uart_clksrc *clk)
+{
+   u32 ucon = rd_regl(port, S3C2410_UCON);
+
+   clk-divisor = 1;
+
+   switch (ucon  S5PC110_UCON_CLKMASK) {
+   case S5PC110_UCON_SCLK_UART:
+   clk-name = uclk0;
+   break;
+
+   case 

[PATCH 03/20] ARM: S5PC1XX: prepare common cpuclocks code for S5PC110 sub-platform

2009-11-20 Thread Marek Szyprowski
From: Kyungmin Park kyungmin.p...@samsung.com

CLK_OTHER register block is specific for S5PC100 SoC, so move the
definition to mach-s5pc100/cpu.c. Size of CLK and PWR register block is
different on S5PC100 and S5PC110, thus new defines are introduced.

Clock and pll hierarchy is completely different between S5PC100 and
S5PC110 SoCs, so move related includes to new sub-platform and rename
plat-s5pc1xx/clocks.c and plat-s5pc1xx/s5pc100-clock.c to
s5pc100-clocks.c (periperal clocks definition) and s5pc100-plls.c (core
pll hierarchy definition).

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc100/Kconfig  |2 --
 arch/arm/mach-s5pc100/Makefile |3 +++
 .../clock.c = mach-s5pc100/clocks.c}  |4 ++--
 arch/arm/mach-s5pc100/cpu.c|6 ++
 arch/arm/mach-s5pc100/include/mach/map.h   |2 ++
 .../include/plat/regs-clock.h  |2 +-
 .../include/plat/regs-power.h  |2 +-
 .../s5pc100-clock.c = mach-s5pc100/plls.c}|2 +-
 .../s5pc100-init.c = mach-s5pc100/uarts.c}|2 +-
 arch/arm/plat-s5pc1xx/Kconfig  |   12 +---
 arch/arm/plat-s5pc1xx/Makefile |4 
 arch/arm/plat-s5pc1xx/cpu.c|   18 ++
 12 files changed, 24 insertions(+), 35 deletions(-)
 rename arch/arm/{plat-s5pc1xx/clock.c = mach-s5pc100/clocks.c} (99%)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/include/plat/regs-clock.h (99%)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/include/plat/regs-power.h (98%)
 rename arch/arm/{plat-s5pc1xx/s5pc100-clock.c = mach-s5pc100/plls.c} (99%)
 rename arch/arm/{plat-s5pc1xx/s5pc100-init.c = mach-s5pc100/uarts.c} (94%)

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index d72f881..1dbb5f1 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -11,8 +11,6 @@ if ARCH_S5PC100
 
 config CPU_S5PC100
bool
-   select CPU_S5PC100_INIT
-   select CPU_S5PC100_CLOCK
help
  Enable S5PC100 CPU support
 
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index 809ff10..dc6b0ff 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -12,6 +12,9 @@ obj-  :=
 # Core support for S5PC100 system
 
 obj-$(CONFIG_CPU_S5PC100)  += cpu.o
+obj-$(CONFIG_CPU_S5PC100)  += clocks.o
+obj-$(CONFIG_CPU_S5PC100)  += plls.o
+obj-$(CONFIG_CPU_S5PC100)  += uarts.o
 
 # Helper and device support
 
diff --git a/arch/arm/plat-s5pc1xx/clock.c b/arch/arm/mach-s5pc100/clocks.c
similarity index 99%
rename from arch/arm/plat-s5pc1xx/clock.c
rename to arch/arm/mach-s5pc100/clocks.c
index 26c21d8..a191beb 100644
--- a/arch/arm/plat-s5pc1xx/clock.c
+++ b/arch/arm/mach-s5pc100/clocks.c
@@ -1,8 +1,8 @@
-/* linux/arch/arm/plat-s5pc1xx/clock.c
+/* linux/arch/arm/mach-s5pc100/clocks.c
  *
  * Copyright 2009 Samsung Electronics Co.
  *
- * S5PC1XX Base clock support
+ * S5PC100 - Clocks support
  *
  * Based on plat-s3c64xx/clock.c
  *
diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/cpu.c
index d79e757..41fdecf 100644
--- a/arch/arm/mach-s5pc100/cpu.c
+++ b/arch/arm/mach-s5pc100/cpu.c
@@ -46,6 +46,12 @@
 /* Initial IO mappings */
 
 static struct map_desc s5pc100_iodesc[] __initdata = {
+   {
+   .virtual= (unsigned long)S5PC1XX_VA_CLK_OTHER,
+   .pfn= __phys_to_pfn(S5PC1XX_PA_CLK_OTHER),
+   .length = SZ_4K,
+   .type   = MT_DEVICE,
+   }
 };
 
 static void s5pc100_idle(void)
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h 
b/arch/arm/mach-s5pc100/include/mach/map.h
index f90c033..88f267a 100644
--- a/arch/arm/mach-s5pc100/include/mach/map.h
+++ b/arch/arm/mach-s5pc100/include/mach/map.h
@@ -46,6 +46,8 @@
 #define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x1)
 #define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x2)
 #define S5PC1XX_VA_CLK_OTHER   (S3C_VA_SYS + 0x3)
+#define S5PC1XX_SZ_CLK SZ_4K
+#define S5PC1XX_SZ_PWR SZ_4K
 
 /* GPIO */
 #define S5PC100_PA_GPIO(0xE030)
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h 
b/arch/arm/mach-s5pc100/include/plat/regs-clock.h
similarity index 99%
rename from arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
rename to arch/arm/mach-s5pc100/include/plat/regs-clock.h
index c5cc86e..f0a007b 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
+++ b/arch/arm/mach-s5pc100/include/plat/regs-clock.h
@@ -3,7 +3,7 @@
  * Copyright 2009 Samsung Electronics Co.
  * Byungho Min bh...@samsung.com
  *
- * S5PC1XX clock register definitions
+ * S5PC100 clock register definitions
  *
  * This program is free software; you can redistribute it and/or modify
  * 

[PATCH 08/20] ARM: S5PC1XX: move common s5pc1xx s3c-fb regs to platform directory

2009-11-20 Thread Marek Szyprowski
From: Pawel Osciak p.osc...@samsung.com

Framebuffer register blocks on S5PC100 and S5PC110 differ only slightly.
This patch moves all register definitions that are common for S5PC100
and S5PC110 to plat-s3c/plat/regs-fb-v5.h.

Signed-off-by: Pawel Osciak p.osc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc100/include/mach/regs-fb.h   |  133 ++--
 .../include/plat/regs-fb-v5.h} |   15 +--
 2 files changed, 15 insertions(+), 133 deletions(-)
 copy arch/arm/{mach-s5pc100/include/mach/regs-fb.h = 
plat-s3c/include/plat/regs-fb-v5.h} (93%)

diff --git a/arch/arm/mach-s5pc100/include/mach/regs-fb.h 
b/arch/arm/mach-s5pc100/include/mach/regs-fb.h
index 1732cd2..49764cb 100644
--- a/arch/arm/mach-s5pc100/include/mach/regs-fb.h
+++ b/arch/arm/mach-s5pc100/include/mach/regs-fb.h
@@ -1,139 +1,22 @@
-/* arch/arm/mach-s5pc100/include/mach/regs-fb.h
- *
+/*
  * Copyright 2009 Samsung Electronics Co.
  *   Pawel Osciak p.osc...@samsung.com
  *
- * Framebuffer register definitions for Samsung S5PC100.
+ * Machine-specific framebuffer definitions for Samsung S5PC100.
  *
  * 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.
-*/
-
-#ifndef __ASM_ARCH_REGS_FB_H
-#define __ASM_ARCH_REGS_FB_H __FILE__
-
-#include plat/regs-fb-v4.h
-
-/* VP1 interface timing control */
-#define VP1CON0(0x118)
-#define VP1_RATECON_EN (1  31)
-#define VP1_CLKRATE_MASK   (0xff)
-
-#define VP1CON1(0x11c)
-#define VP1_VTREGCON_EN(1  31)
-#define VP1_VBPD_MASK  (0xfff)
-#define VP1_VBPD_SHIFT (16)
-
-
-#define WPALCON_H  (0x19c)
-#define WPALCON_L  (0x1a0)
-
-/* Pallete contro for WPAL0 and WPAL1 is the same as in S3C64xx, but
- * different for WPAL2-4
- */
-/* In WPALCON_L (aka WPALCON) */
-#define WPALCON_W1PAL_32BPP_A888   (0x7  3)
-#define WPALCON_W0PAL_32BPP_A888   (0x7  0)
-
-/* To set W2PAL-W4PAL consist of one bit from WPALCON_L and two from WPALCON_H,
- * e.g. W2PAL[2..0] is made of (WPALCON_H[10..9], WPALCON_L[6]).
- */
-#define WPALCON_L_WxPAL_L_MASK (0x1)
-#define WPALCON_L_W2PAL_L_SHIFT(6)
-#define WPALCON_L_W3PAL_L_SHIFT(7)
-#define WPALCON_L_W4PAL_L_SHIFT(8)
-
-#define WPALCON_L_WxPAL_H_MASK (0x3)
-#define WPALCON_H_W2PAL_H_SHIFT(9)
-#define WPALCON_H_W3PAL_H_SHIFT(13)
-#define WPALCON_H_W4PAL_H_SHIFT(17)
-
-/* Per-window alpha value registers */
-/* For window 0 8-bit alpha values are in VIDW0ALPHAx,
- * for windows 1-4 alpha values consist of two parts, the 4 low bits are
- * taken from VIDWxALPHAx and 4 high bits are from VIDOSDxC,
- * e.g. WIN1_ALPHA0_B[7..0] = (VIDOSD1C[3..0], VIDW1ALPHA0[3..0])
- */
-#define VIDWxALPHA0(_win)  (0x200 + (_win * 8))
-#define VIDWxALPHA1(_win)  (0x204 + (_win * 8))
-
-/* Only for window 0 in VIDW0ALPHAx. */
-#define VIDW0ALPHAx_R(_x)  ((_x)  16)
-#define VIDW0ALPHAx_R_MASK (0xff  16)
-#define VIDW0ALPHAx_R_SHIFT(16)
-#define VIDW0ALPHAx_G(_x)  ((_x)  8)
-#define VIDW0ALPHAx_G_MASK (0xff  8)
-#define VIDW0ALPHAx_G_SHIFT(8)
-#define VIDW0ALPHAx_B(_x)  ((_x)  0)
-#define VIDW0ALPHAx_B_MASK (0xff  0)
-#define VIDW0ALPHAx_B_SHIFT(0)
-
-/* Low 4 bits of alpha0-1 for windows 1-4 */
-#define VIDW14ALPHAx_R_L(_x)   ((_x)  16)
-#define VIDW14ALPHAx_R_L_MASK  (0xf  16)
-#define VIDW14ALPHAx_R_L_SHIFT (16)
-#define VIDW14ALPHAx_G_L(_x)   ((_x)  8)
-#define VIDW14ALPHAx_G_L_MASK  (0xf  8)
-#define VIDW14ALPHAx_G_L_SHIFT (8)
-#define VIDW14ALPHAx_B_L(_x)   ((_x)  0)
-#define VIDW14ALPHAx_B_L_MASK  (0xf  0)
-#define VIDW14ALPHAx_B_L_SHIFT (0)
-
-
-/* Per-window blending equation control registers */
-#define BLENDEQx(_win) (0x244 + ((_win) * 4))
-#define BLENDEQ1   

[PATCH 11/20] ARM: S5PC1XX: add S5PC110 cpu initialization code

2009-11-20 Thread Marek Szyprowski
From: Kyungmin Park kyungmin.p...@samsung.com

Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based
on CortexA8 ARM CPU, but have much more powerfull integrated periperals.
This patch adds CPU initialization code for S5PC110 sub-platform.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Byungho Min bh...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc110/Kconfig|   17 +++
 arch/arm/mach-s5pc110/Makefile   |   18 
 arch/arm/mach-s5pc110/Makefile.boot  |2 +
 arch/arm/mach-s5pc110/cpu.c  |  117 ++
 arch/arm/mach-s5pc110/include/mach/debug-macro.S |   54 ++
 arch/arm/mach-s5pc110/include/mach/entry-macro.S |   56 ++
 arch/arm/mach-s5pc110/include/mach/system.h  |   31 ++
 arch/arm/mach-s5pc110/include/plat/regs-power.h  |   79 +++
 arch/arm/mach-s5pc110/uarts.c|   28 +
 arch/arm/plat-s5pc1xx/cpu.c  |9 ++
 arch/arm/plat-s5pc1xx/include/plat/s5pc110.h |   36 +++
 arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h |1 +
 12 files changed, 448 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pc110/Kconfig
 create mode 100644 arch/arm/mach-s5pc110/Makefile
 create mode 100644 arch/arm/mach-s5pc110/Makefile.boot
 create mode 100644 arch/arm/mach-s5pc110/cpu.c
 create mode 100644 arch/arm/mach-s5pc110/include/mach/debug-macro.S
 create mode 100644 arch/arm/mach-s5pc110/include/mach/entry-macro.S
 create mode 100644 arch/arm/mach-s5pc110/include/mach/system.h
 create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-power.h
 create mode 100644 arch/arm/mach-s5pc110/uarts.c
 create mode 100644 arch/arm/plat-s5pc1xx/include/plat/s5pc110.h

diff --git a/arch/arm/mach-s5pc110/Kconfig b/arch/arm/mach-s5pc110/Kconfig
new file mode 100644
index 000..4257b96
--- /dev/null
+++ b/arch/arm/mach-s5pc110/Kconfig
@@ -0,0 +1,17 @@
+# arch/arm/mach-s5pc110/Kconfig
+#
+#  Copyright 2009 Samsung Electronics Co.
+#  Kyungmin Park kyungmin.p...@samsung.com
+#
+# Licensed under GPLv2
+
+if ARCH_S5PC110
+
+# Configuration options for the S5PC110 CPU
+
+config CPU_S5PC110
+   bool
+   help
+ Enable S5PC110 CPU support
+
+endif
diff --git a/arch/arm/mach-s5pc110/Makefile b/arch/arm/mach-s5pc110/Makefile
new file mode 100644
index 000..d9fecf0
--- /dev/null
+++ b/arch/arm/mach-s5pc110/Makefile
@@ -0,0 +1,18 @@
+# arch/arm/mach-s5pc100/Makefile
+#
+# Copyright 2009 Samsung Electronics Co.
+#
+# Licensed under GPLv2
+
+obj-y   :=
+obj-m   :=
+obj-n   :=
+obj-:=
+
+# Core support for S5PC110 system
+
+obj-$(CONFIG_CPU_S5PC110)  += cpu.o
+
+# Helper and device support
+
+# machine support
diff --git a/arch/arm/mach-s5pc110/Makefile.boot 
b/arch/arm/mach-s5pc110/Makefile.boot
new file mode 100644
index 000..b0909e3
--- /dev/null
+++ b/arch/arm/mach-s5pc110/Makefile.boot
@@ -0,0 +1,2 @@
+   zreladdr-y  := 0x30008000
+params_phys-y  := 0x3100
diff --git a/arch/arm/mach-s5pc110/cpu.c b/arch/arm/mach-s5pc110/cpu.c
new file mode 100644
index 000..1a4a5e4
--- /dev/null
+++ b/arch/arm/mach-s5pc110/cpu.c
@@ -0,0 +1,117 @@
+/* linux/arch/arm/mach-s5pc110/cpu.c
+ *
+ * Copyright 2009 Samsung Electronics Co.
+ * Byungho Min bh...@samsung.com
+ *
+ * Based on mach-s3c6410/cpu.c
+ *
+ * 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/list.h
+#include linux/timer.h
+#include linux/init.h
+#include linux/clk.h
+#include linux/io.h
+#include linux/sysdev.h
+#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
+
+#include mach/hardware.h
+#include mach/map.h
+
+#include plat/regs-serial.h
+#include plat/regs-power.h
+#include plat/cpu.h
+#include plat/devs.h
+#include plat/clock.h
+#include plat/sdhci.h
+#include plat/iic-core.h
+#include plat/s5pc1xx.h
+
+/* Initial IO mappings */
+
+static struct map_desc s5pc110_iodesc[] __initdata = {
+};
+
+static void s5pc110_idle(void)
+{
+   unsigned long tmp;
+
+   tmp = __raw_readl(S5PC110_IDLE_CFG);
+   tmp = ~(S5PC110_IDLECFG_TOP_LOGIC_MASK |
+   S5PC110_IDLECFG_TOP_MEMORY_MASK |
+   S5PC110_IDLECFG_OSC_EN);
+   tmp |= S5PC110_IDLECFG_TOP_LOGIC_ON |
+   S5PC110_IDLECFG_TOP_MEMORY_ON;
+   __raw_writel(tmp, S5PC110_IDLE_CFG);
+
+   tmp = __raw_readl(S5PC110_PWR_CFG);
+   tmp = ~S5PC110_PWRCFG_CFG_WFI_MASK;
+   /* S5pc110 EVT0 chip bug */
+   /* tmp |= 

[PATCH 04/20] ARM: S5PC1XX: prepare common gpiolib code for S5PC110 sub-platform

2009-11-20 Thread Marek Szyprowski
S5PC100 GPIOlib support has been rewriten to make it possible to reuse
most of the common code in the upcoming S5PC110 sub-platform.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc100/Makefile |1 +
 arch/arm/mach-s5pc100/gpio-chips.c |  106 ++
 arch/arm/mach-s5pc100/include/mach/gpio.h  |   46 +++
 .../include/plat/irqs.h|2 +-
 .../include/plat/regs-gpio.h   |2 +-
 arch/arm/plat-s5pc1xx/gpiolib.c|  374 ++--
 arch/arm/plat-s5pc1xx/include/plat/gpio-s5pc1xx.h  |   79 
 arch/arm/plat-s5pc1xx/irq-eint.c   |   13 +-
 arch/arm/plat-s5pc1xx/irq-gpio.c   |  105 +-
 9 files changed, 292 insertions(+), 436 deletions(-)
 create mode 100644 arch/arm/mach-s5pc100/gpio-chips.c
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/include/plat/irqs.h (99%)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/include/plat/regs-gpio.h (98%)
 create mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-s5pc1xx.h

diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index dc6b0ff..8d29ea1 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -13,6 +13,7 @@ obj-  :=
 
 obj-$(CONFIG_CPU_S5PC100)  += cpu.o
 obj-$(CONFIG_CPU_S5PC100)  += clocks.o
+obj-$(CONFIG_CPU_S5PC100)  += gpio-chips.o
 obj-$(CONFIG_CPU_S5PC100)  += plls.o
 obj-$(CONFIG_CPU_S5PC100)  += uarts.o
 
diff --git a/arch/arm/mach-s5pc100/gpio-chips.c 
b/arch/arm/mach-s5pc100/gpio-chips.c
new file mode 100644
index 000..f8fa8d7
--- /dev/null
+++ b/arch/arm/mach-s5pc100/gpio-chips.c
@@ -0,0 +1,106 @@
+/*
+ * linux/arch/arm/mach-s5pc100/gpio-chips.c
+ *
+ *  Copyright 2009 Samsung Electronics Co
+ *  Kyungmin Park kyungmin.p...@samsung.com
+ *  Marek Szyprowski m.szyprow...@samsung.com
+ *
+ * S5PC100 - GPIOlib chip 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.
+ */
+
+#include linux/kernel.h
+#include linux/irq.h
+#include linux/io.h
+#include linux/gpio.h
+
+#include mach/map.h
+#include mach/gpio-core.h
+
+#include plat/gpio-cfg.h
+#include plat/gpio-cfg-helpers.h
+#include plat/gpio-s5pc1xx.h
+#include plat/regs-gpio.h
+
+/* S5PC100 GPIO bank summary:
+ *
+ * BankGPIOs   Style   INT Type
+ * A0  8   4BitGPIO_INT0
+ * A1  5   4BitGPIO_INT1
+ * B   8   4BitGPIO_INT2
+ * C   5   4BitGPIO_INT3
+ * D   7   4BitGPIO_INT4
+ * E0  8   4BitGPIO_INT5
+ * E1  6   4BitGPIO_INT6
+ * F0  8   4BitGPIO_INT7
+ * F1  8   4BitGPIO_INT8
+ * F2  8   4BitGPIO_INT9
+ * F3  4   4BitGPIO_INT10
+ * G0  8   4BitGPIO_INT11
+ * G1  3   4BitGPIO_INT12
+ * G2  7   4BitGPIO_INT13
+ * G3  7   4BitGPIO_INT14
+ * H0  8   4BitWKUP_INT
+ * H1  8   4BitWKUP_INT
+ * H2  8   4BitWKUP_INT
+ * H3  8   4BitWKUP_INT
+ * I   8   4BitGPIO_INT15
+ * J0  8   4BitGPIO_INT16
+ * J1  5   4BitGPIO_INT17
+ * J2  8   4BitGPIO_INT18
+ * J3  8   4BitGPIO_INT19
+ * J4  4   4BitGPIO_INT20
+ * K0  8   4BitNone
+ * K1  6   4BitNone
+ * K2  8   4BitNone
+ * K3  8   4BitNone
+ * L0  8   4BitNone
+ * L1  8   4BitNone
+ * L2  8   4BitNone
+ * L3  8   4BitNone
+ */
+
+static struct s5pc1xx_gpio_chip s5pc100_gpio_chips[] = {
+   S5PC1XX_INT_CHIP_DEF(S5PC100, A0),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, A1),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, B),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, C),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, D),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, E0),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, E1),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, F0),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, F1),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, F2),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, F3),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, G0),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, G1),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, G2),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, G3),
+   S5PC1XX_EINT_CHIP_DEF(S5PC100, H0),
+   S5PC1XX_EINT_CHIP_DEF(S5PC100, H1),
+   S5PC1XX_EINT_CHIP_DEF(S5PC100, H2),
+   S5PC1XX_EINT_CHIP_DEF(S5PC100, H3),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, I),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, J0),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, J1),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, J2),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, J3),
+   S5PC1XX_INT_CHIP_DEF(S5PC100, J4),
+   S5PC1XX_NOINT_CHIP_DEF(S5PC100, K0),
+   S5PC1XX_NOINT_CHIP_DEF(S5PC100, K1),
+   S5PC1XX_NOINT_CHIP_DEF(S5PC100, K2),
+   S5PC1XX_NOINT_CHIP_DEF(S5PC100, 

[PATCH 19/20] ARM: S5PC1XX: add support for SMDKC110 board

2009-11-20 Thread Marek Szyprowski
From: Kyungmin Park kyungmin.p...@samsung.com

Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based
on CortexA8 ARM CPU, but have much more powerfull integrated periperals.
This patch adds support for SMDKC110 evaluation board. The board can be
obtained from Meritech (http://www.meritech.co.kr).

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc110/Kconfig |6 ++
 arch/arm/mach-s5pc110/Makefile|1 +
 arch/arm/mach-s5pc110/mach-smdkc110.c |  102 +
 3 files changed, 109 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pc110/mach-smdkc110.c

diff --git a/arch/arm/mach-s5pc110/Kconfig b/arch/arm/mach-s5pc110/Kconfig
index ef2f940..b2374fd 100644
--- a/arch/arm/mach-s5pc110/Kconfig
+++ b/arch/arm/mach-s5pc110/Kconfig
@@ -49,4 +49,10 @@ config S5PC110_SETUP_SDHCI_GPIO
help
  Common setup code for SDHCI gpio.
 
+config MACH_SMDKC110
+   bool SMDKC110
+   select CPU_S5PC110
+   help
+ Machine support for the SMDKC110 board
+
 endif
diff --git a/arch/arm/mach-s5pc110/Makefile b/arch/arm/mach-s5pc110/Makefile
index d7e03b6..3017ddd 100644
--- a/arch/arm/mach-s5pc110/Makefile
+++ b/arch/arm/mach-s5pc110/Makefile
@@ -26,3 +26,4 @@ obj-$(CONFIG_S5PC110_SETUP_SDHCI)   += setup-sdhci.o
 obj-$(CONFIG_S5PC110_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 
 # machine support
+obj-$(CONFIG_MACH_SMDKC110)+= mach-smdkc110.o
diff --git a/arch/arm/mach-s5pc110/mach-smdkc110.c 
b/arch/arm/mach-s5pc110/mach-smdkc110.c
new file mode 100644
index 000..2d39dfb
--- /dev/null
+++ b/arch/arm/mach-s5pc110/mach-smdkc110.c
@@ -0,0 +1,102 @@
+/*
+ * linux/arch/arm/mach-s5pc110/mach-smdkc110.c
+ *
+ *  Copyright (C) 2009 Samsung Electronics Co.
+ *
+ * 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/list.h
+#include linux/timer.h
+#include linux/init.h
+#include linux/serial_core.h
+#include linux/platform_device.h
+#include linux/io.h
+#include linux/gpio.h
+#include linux/i2c.h
+#include linux/fb.h
+#include linux/delay.h
+
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include mach/map.h
+
+#include asm/irq.h
+#include asm/mach-types.h
+
+#include plat/regs-serial.h
+
+#include plat/clock.h
+#include plat/devs.h
+#include plat/cpu.h
+#include plat/s5pc1xx.h
+
+#define UCON   (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK)
+#define ULCON  (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)
+#define UFCON  (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
+
+static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = {
+   [0] = {
+   .hwport  = 0,
+   .flags   = 0,
+   .ucon= 0x3c5,
+   .ulcon   = 0x03,
+   .ufcon   = 0x51,
+   },
+   [1] = {
+   .hwport  = 1,
+   .flags   = 0,
+   .ucon= 0x3c5,
+   .ulcon   = 0x03,
+   .ufcon   = 0x51,
+   },
+   [2] = {
+   .hwport  = 2,
+   .flags   = 0,
+   .ucon= 0x3c5,
+   .ulcon   = 0x03,
+   .ufcon   = 0x51,
+   },
+   [3] = {
+   .hwport  = 3,
+   .flags   = 0,
+   .ucon= 0x3c5,
+   .ulcon   = 0x03,
+   .ufcon   = 0x51,
+   },
+};
+
+static struct platform_device *universal_devices[] __initdata = {
+};
+
+static struct map_desc universal_iodesc[] = {};
+
+static void __init universal_map_io(void)
+{
+   s5pc1xx_init_io(universal_iodesc, ARRAY_SIZE(universal_iodesc));
+   s3c24xx_init_clocks(2400);
+   s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
+}
+
+static void __init universal_machine_init(void)
+{
+   platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices));
+}
+
+MACHINE_START(SMDKC110, SMDKC110)
+   /* Maintainer: Samsung Electronics */
+   .phys_io= S5PC110_PA_UART  0xfff0,
+   .io_pg_offst= (((u32)S5PC1XX_VA_UART)  18)  0xfffc,
+   .boot_params= S5PC110_PA_SDRAM + 0x100,
+   .init_irq   = s5pc110_init_irq,
+   .map_io = universal_map_io,
+   .init_machine   = universal_machine_init,
+   .timer  = s3c24xx_timer,
+MACHINE_END
-- 
1.6.4

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 13/20] ARM: S5PC1XX: add support for s5pc110 irqs

2009-11-20 Thread Marek Szyprowski
From: Kyungmin Park kyungmin.p...@samsung.com

Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based
on CortexA8 ARM CPU, but have much more powerfull integrated periperals.
This patch adds interrupt support on S5PC110 SoCs. Unlike S5PC100,
S5PC110 has 4 VICs, so the S5PC110 specifi virtual memory area is
extended to cover VIC3 register block.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Byungho Min bh...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc110/cpu.c   |   10 ++
 arch/arm/mach-s5pc110/include/mach/regs-irq.h |   25 +++
 arch/arm/mach-s5pc110/include/plat/irqs.h |  209 +
 3 files changed, 244 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pc110/include/mach/regs-irq.h
 create mode 100644 arch/arm/mach-s5pc110/include/plat/irqs.h

diff --git a/arch/arm/mach-s5pc110/cpu.c b/arch/arm/mach-s5pc110/cpu.c
index 6c9ebcb..3ea26ff 100644
--- a/arch/arm/mach-s5pc110/cpu.c
+++ b/arch/arm/mach-s5pc110/cpu.c
@@ -43,6 +43,12 @@
 /* Initial IO mappings */
 
 static struct map_desc s5pc110_iodesc[] __initdata = {
+   {
+   .virtual= (unsigned long)S5PC1XX_VA_VIC(3),
+   .pfn= __phys_to_pfn(S5PC1XX_PA_VIC(3)),
+   .length = SZ_4K,
+   .type   = MT_DEVICE,
+   },
 };
 
 static void s5pc110_idle(void)
@@ -93,6 +99,10 @@ void __init s5pc110_init_clocks(int xtal)
 
 void __init s5pc110_init_irq(void)
 {
+   u32 vic_valid[] = {~0, ~0, ~0, ~0};
+
+   /* VIC0, VIC1, VIC2, and VIC3 are fully populated. */
+   s5pc1xx_init_irq(vic_valid, ARRAY_SIZE(vic_valid));
 }
 
 struct sysdev_class s5pc110_sysclass = {
diff --git a/arch/arm/mach-s5pc110/include/mach/regs-irq.h 
b/arch/arm/mach-s5pc110/include/mach/regs-irq.h
new file mode 100644
index 000..b467e3b
--- /dev/null
+++ b/arch/arm/mach-s5pc110/include/mach/regs-irq.h
@@ -0,0 +1,25 @@
+/* linux/arch/arm/mach-s5pc110/include/mach/regs-irq.h
+ *
+ * Copyright 2009 Samsung Electronics Co.
+ * Byungho Min bh...@samsung.com
+ *
+ * S5PC110 - IRQ 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.
+*/
+
+#ifndef __ASM_ARCH_REGS_IRQ_H
+#define __ASM_ARCH_REGS_IRQ_H __FILE__
+
+#include mach/map.h
+#include asm/hardware/vic.h
+
+/* interrupt controller */
+#define S5PC1XX_VIC0REG(x) ((x) + S5PC1XX_VA_VIC(0))
+#define S5PC1XX_VIC1REG(x) ((x) + S5PC1XX_VA_VIC(1))
+#define S5PC1XX_VIC2REG(x) ((x) + S5PC1XX_VA_VIC(2))
+#define S5PC1XX_VIC3REG(x) ((x) + S5PC1XX_VA_VIC(3))
+
+#endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-s5pc110/include/plat/irqs.h 
b/arch/arm/mach-s5pc110/include/plat/irqs.h
new file mode 100644
index 000..d1a2a21
--- /dev/null
+++ b/arch/arm/mach-s5pc110/include/plat/irqs.h
@@ -0,0 +1,209 @@
+/* linux/arch/arm/plat-s5pc1xx/include/plat/irqs.h
+ *
+ * Copyright 2009 Samsung Electronics Co.
+ *  Byungho Min bh...@samsung.com
+ *
+ * S5PC110 - Common IRQ support
+ *
+ * Based on plat-s3c64xx/include/plat/irqs.h
+ */
+
+#ifndef __ASM_PLAT_S5PC110_IRQS_H
+#define __ASM_PLAT_S5PC110_IRQS_H __FILE__
+
+/* we keep the first set of CPU IRQs out of the range of
+ * the ISA space, so that the PC104 has them to itself
+ * and we don't end up having to do horrible things to the
+ * standard ISA drivers
+ *
+ * note, since we're using the VICs, our start must be a
+ * mulitple of 32 to allow the common code to work
+ */
+
+#define S3C_IRQ_OFFSET (32)
+
+#define S3C_IRQ(x) ((x) + S3C_IRQ_OFFSET)
+
+#define S3C_VIC0_BASE  S3C_IRQ(0)
+#define S3C_VIC1_BASE  S3C_IRQ(32)
+#define S3C_VIC2_BASE  S3C_IRQ(64)
+#define S3C_VIC3_BASE  S3C_IRQ(96)
+
+/* UART interrupts, each UART has 4 interupts per channel so
+ * use the space between the ISA and S3C main interrupts. Note, these
+ * are not in the same order as the S3C24XX series! */
+
+#define IRQ_S3CUART_BASE0  (16)
+#define IRQ_S3CUART_BASE1  (20)
+#define IRQ_S3CUART_BASE2  (24)
+#define IRQ_S3CUART_BASE3  (28)
+
+#define UART_IRQ_RXD   (0)
+#define UART_IRQ_ERR   (1)
+#define UART_IRQ_TXD   (2)
+#define UART_IRQ_MODEM (3)
+
+#define IRQ_S3CUART_RX0(IRQ_S3CUART_BASE0 + UART_IRQ_RXD)
+#define IRQ_S3CUART_TX0(IRQ_S3CUART_BASE0 + UART_IRQ_TXD)
+#define IRQ_S3CUART_ERR0   (IRQ_S3CUART_BASE0 + UART_IRQ_ERR)
+
+#define IRQ_S3CUART_RX1(IRQ_S3CUART_BASE1 + UART_IRQ_RXD)
+#define IRQ_S3CUART_TX1(IRQ_S3CUART_BASE1 + UART_IRQ_TXD)
+#define IRQ_S3CUART_ERR1   (IRQ_S3CUART_BASE1 + UART_IRQ_ERR)
+
+#define IRQ_S3CUART_RX2(IRQ_S3CUART_BASE2 + 

[PATCH 06/20] ARM: S5PC1XX: cleanup of s5pc1xx common code

2009-11-20 Thread Marek Szyprowski
This patch removes all useless definitions from plat/s5pc100.h and
introduces new common plat/s5pc1xx.h include.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc100/cpu.c |2 +-
 arch/arm/mach-s5pc100/include/plat/regs-clock.h |8 ++--
 arch/arm/mach-s5pc100/mach-smdkc100.c   |2 +-
 arch/arm/mach-s5pc100/plls.c|2 +-
 arch/arm/mach-s5pc100/uarts.c   |5 +-
 arch/arm/plat-s5pc1xx/cpu.c |2 +-
 arch/arm/plat-s5pc1xx/include/plat/s5pc100.h|   51 ++-
 arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h|   21 +
 8 files changed, 45 insertions(+), 48 deletions(-)
 create mode 100644 arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h

diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/cpu.c
index 41fdecf..f383e33 100644
--- a/arch/arm/mach-s5pc100/cpu.c
+++ b/arch/arm/mach-s5pc100/cpu.c
@@ -41,7 +41,7 @@
 #include plat/clock.h
 #include plat/sdhci.h
 #include plat/iic-core.h
-#include plat/s5pc100.h
+#include plat/s5pc1xx.h
 
 /* Initial IO mappings */
 
diff --git a/arch/arm/mach-s5pc100/include/plat/regs-clock.h 
b/arch/arm/mach-s5pc100/include/plat/regs-clock.h
index f0a007b..637ff71 100644
--- a/arch/arm/mach-s5pc100/include/plat/regs-clock.h
+++ b/arch/arm/mach-s5pc100/include/plat/regs-clock.h
@@ -341,10 +341,10 @@
 #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_OTHERS_PMU_INT_DISALBE (1  24)
+#define S5PC100_OTHERS_STABLE_COUNTER_TYPE_MASK(1  23)
+#define S5PC100_OTHERS_STABLE_COUNTER_TYPE_SFR (1  23)
+#define S5PC100_OTHERS_STABLE_COUNTER_TYPE_EXP (0  23)
 
 #define S5PC100_SLEEP_CFG_OSC_EN   0
 
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c 
b/arch/arm/mach-s5pc100/mach-smdkc100.c
index ae3c52c..29b95f1 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -40,7 +40,7 @@
 #include plat/clock.h
 #include plat/devs.h
 #include plat/cpu.h
-#include plat/s5pc100.h
+#include plat/s5pc1xx.h
 #include plat/fb.h
 #include plat/iic.h
 
diff --git a/arch/arm/mach-s5pc100/plls.c b/arch/arm/mach-s5pc100/plls.c
index cd3f6a7..970f49d 100644
--- a/arch/arm/mach-s5pc100/plls.c
+++ b/arch/arm/mach-s5pc100/plls.c
@@ -32,7 +32,7 @@
 #include plat/cpu.h
 #include plat/pll.h
 #include plat/devs.h
-#include plat/s5pc100.h
+#include plat/s5pc1xx.h
 
 /* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
  * ext_xtal_mux for want of an actual name from the manual.
diff --git a/arch/arm/mach-s5pc100/uarts.c b/arch/arm/mach-s5pc100/uarts.c
index 32972f2..6bab6d2 100644
--- a/arch/arm/mach-s5pc100/uarts.c
+++ b/arch/arm/mach-s5pc100/uarts.c
@@ -13,14 +13,15 @@
 #include linux/kernel.h
 #include linux/types.h
 #include linux/init.h
+#include linux/clk.h
 
 #include plat/cpu.h
 #include plat/devs.h
-#include plat/s5pc100.h
+#include plat/s5pc1xx.h
 
 /* uart registration process */
 
-void __init s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
+void __init s5pc100_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 {
/* The driver name is s3c6400-uart to reuse s3c6400_serial_drv  */
s3c24xx_init_uartdevs(s3c6400-uart, s5pc1xx_uart_resources, cfg, no);
diff --git a/arch/arm/plat-s5pc1xx/cpu.c b/arch/arm/plat-s5pc1xx/cpu.c
index ecd6d38..d30998d 100644
--- a/arch/arm/plat-s5pc1xx/cpu.c
+++ b/arch/arm/plat-s5pc1xx/cpu.c
@@ -31,7 +31,7 @@
 #include plat/devs.h
 #include plat/clock.h
 
-#include plat/s5pc100.h
+#include plat/s5pc1xx.h
 
 /* table of supported CPUs */
 
diff --git a/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h 
b/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
index 2531f34..32eb6e7 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
+++ b/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
@@ -13,52 +13,27 @@
 */
 
 /* Common init code for S5PC100 related SoCs */
+
+#ifdef CONFIG_CPU_S5PC100
+
 extern  int s5pc100_init(void);
 extern void s5pc100_map_io(void);
 extern void s5pc100_init_clocks(int xtal);
 extern  int s5pc100_register_baseclocks(unsigned long xtal);
 extern void s5pc100_init_irq(void);
 extern void s5pc100_init_io(struct map_desc *mach_desc, int size);
-extern void s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+extern void s5pc100_init_uarts(struct s3c2410_uartcfg *cfg, int no);
 extern void s5pc100_register_clocks(void);
 extern void s5pc100_setup_clocks(void);
-extern struct sysdev_class s5pc100_sysclass;
-
-#define s5pc100_init_uarts s5pc100_common_init_uarts
-
-/* Some day, belows will be moved to plat-s5pc/include/plat/cpu.h */
-extern void s5pc1xx_init_irq(u32 *vic_valid, int num);
-extern void s5pc1xx_init_io(struct map_desc 

[PATCH 15/20] ARM: S5PC1XX: add i2c platform helpers on s5pc110 sub-platform

2009-11-20 Thread Marek Szyprowski
From: Kyungmin Park kyungmin.p...@samsung.com

Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based
on CortexA8 ARM CPU, but have much more powerfull integrated periperals.
This patch adds required I2C platform helpers. S5PC110 SoCs has 3 I2C
controllers.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Byungho Min bh...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc110/Kconfig|   18 +
 arch/arm/mach-s5pc110/Makefile   |3 +
 arch/arm/mach-s5pc110/cpu.c  |3 +
 arch/arm/mach-s5pc110/setup-i2c0.c   |   31 +++
 arch/arm/mach-s5pc110/setup-i2c1.c   |   31 +++
 arch/arm/mach-s5pc110/setup-i2c2.c   |   32 
 arch/arm/plat-s3c/Kconfig|5 ++
 arch/arm/plat-s3c/Makefile   |1 +
 arch/arm/plat-s3c/dev-i2c2.c |   69 ++
 arch/arm/plat-s3c/include/plat/iic.h |2 +
 10 files changed, 195 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pc110/setup-i2c0.c
 create mode 100644 arch/arm/mach-s5pc110/setup-i2c1.c
 create mode 100644 arch/arm/mach-s5pc110/setup-i2c2.c
 create mode 100644 arch/arm/plat-s3c/dev-i2c2.c

diff --git a/arch/arm/mach-s5pc110/Kconfig b/arch/arm/mach-s5pc110/Kconfig
index 4257b96..6b4d977 100644
--- a/arch/arm/mach-s5pc110/Kconfig
+++ b/arch/arm/mach-s5pc110/Kconfig
@@ -14,4 +14,22 @@ config CPU_S5PC110
help
  Enable S5PC110 CPU support
 
+config S5PC110_SETUP_I2C0
+   bool
+   default y
+   help
+ Common setup code for i2c bus 0.
+
+ Note, currently since i2c0 is always compiled, this setup helper
+ is always compiled with it.
+
+config S5PC110_SETUP_I2C1
+   bool
+   help
+ Common setup code for i2c bus 1.
+
+config S5PC110_SETUP_I2C2
+   bool
+   help
+ Common setup code for i2c bus 2.
 endif
diff --git a/arch/arm/mach-s5pc110/Makefile b/arch/arm/mach-s5pc110/Makefile
index 3849e27..93311b3 100644
--- a/arch/arm/mach-s5pc110/Makefile
+++ b/arch/arm/mach-s5pc110/Makefile
@@ -18,5 +18,8 @@ obj-$(CONFIG_CPU_S5PC110) += plls.o
 obj-$(CONFIG_CPU_S5PC110)  += uarts.o
 
 # Helper and device support
+obj-$(CONFIG_S5PC110_SETUP_I2C0)   += setup-i2c0.o
+obj-$(CONFIG_S5PC110_SETUP_I2C1)   += setup-i2c1.o
+obj-$(CONFIG_S5PC110_SETUP_I2C2)   += setup-i2c2.o
 
 # machine support
diff --git a/arch/arm/mach-s5pc110/cpu.c b/arch/arm/mach-s5pc110/cpu.c
index 3ea26ff..d16ba68 100644
--- a/arch/arm/mach-s5pc110/cpu.c
+++ b/arch/arm/mach-s5pc110/cpu.c
@@ -86,6 +86,9 @@ void __init s5pc110_map_io(void)
iotable_init(s5pc110_iodesc, ARRAY_SIZE(s5pc110_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 s5pc110_init_clocks(int xtal)
diff --git a/arch/arm/mach-s5pc110/setup-i2c0.c 
b/arch/arm/mach-s5pc110/setup-i2c0.c
new file mode 100644
index 000..596b139
--- /dev/null
+++ b/arch/arm/mach-s5pc110/setup-i2c0.c
@@ -0,0 +1,31 @@
+/*
+ * linux/arch/arm/mach-s5pc110/setup-i2c2.c
+ *
+ * Copyright 2009 Samsung Electronics Co.
+ * Byungho Min bh...@samsung.com
+ *
+ * Base S5PC110 I2C bus 0 gpio configuration
+ *
+ * Based on plat-s3c64xx/setup-i2c0.c
+ *
+ * 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
+
+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)
+{
+   s3c_gpio_cfgpin(S5PC110_GPD1(0), S3C_GPIO_SFN(2));
+   s3c_gpio_setpull(S5PC110_GPD1(0), S3C_GPIO_PULL_UP);
+   s3c_gpio_cfgpin(S5PC110_GPD1(1), S3C_GPIO_SFN(2));
+   s3c_gpio_setpull(S5PC110_GPD1(1), S3C_GPIO_PULL_UP);
+}
diff --git a/arch/arm/mach-s5pc110/setup-i2c1.c 
b/arch/arm/mach-s5pc110/setup-i2c1.c
new file mode 100644
index 000..cd9649b
--- /dev/null
+++ b/arch/arm/mach-s5pc110/setup-i2c1.c
@@ -0,0 +1,31 @@
+/*
+ * linux/arch/arm/mach-s5pc110/setup-i2c1.c
+ *
+ * Copyright 2009 Samsung Electronics Co.
+ * Byungho Min bh...@samsung.com
+ *
+ * Base S5PC110 I2C bus 1 gpio configuration
+ *
+ * Based on plat-s3c64xx/setup-i2c1.c
+ *
+ * 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
+
+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)
+{
+   

[PATCH 14/20] ARM: S5PC1XX: add support for s5pc110 gpio

2009-11-20 Thread Marek Szyprowski
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based
on CortexA8 ARM CPU, but have much more powerfull integrated periperals.
This patch adds gpiolib support for S5PC110 sub-platform.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Byungho Min bh...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc110/Makefile |1 +
 arch/arm/mach-s5pc110/gpio-chips.c |   66 +
 arch/arm/mach-s5pc110/include/mach/gpio.h  |  187 
 arch/arm/mach-s5pc110/include/plat/regs-gpio.h |   65 
 4 files changed, 319 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pc110/gpio-chips.c
 create mode 100644 arch/arm/mach-s5pc110/include/mach/gpio.h
 create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-gpio.h

diff --git a/arch/arm/mach-s5pc110/Makefile b/arch/arm/mach-s5pc110/Makefile
index 4dfb306..3849e27 100644
--- a/arch/arm/mach-s5pc110/Makefile
+++ b/arch/arm/mach-s5pc110/Makefile
@@ -13,6 +13,7 @@ obj-:=
 
 obj-$(CONFIG_CPU_S5PC110)  += cpu.o
 obj-$(CONFIG_CPU_S5PC110)  += clocks.o
+obj-$(CONFIG_CPU_S5PC110)  += gpio-chips.o
 obj-$(CONFIG_CPU_S5PC110)  += plls.o
 obj-$(CONFIG_CPU_S5PC110)  += uarts.o
 
diff --git a/arch/arm/mach-s5pc110/gpio-chips.c 
b/arch/arm/mach-s5pc110/gpio-chips.c
new file mode 100644
index 000..4f1e591
--- /dev/null
+++ b/arch/arm/mach-s5pc110/gpio-chips.c
@@ -0,0 +1,66 @@
+/*
+ * linux/arch/arm/mach-s5pc110/gpio-chips.c
+ *
+ *  Copyright 2009 Samsung Electronics Co
+ *  Kyungmin Park kyungmin.p...@samsung.com
+ *  Marek Szyprowski m.szyprow...@samsung.com
+ *
+ * S5PC110 - GPIOlib chip 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.
+ */
+
+#include linux/kernel.h
+#include linux/irq.h
+#include linux/io.h
+#include linux/gpio.h
+
+#include mach/map.h
+#include mach/gpio-core.h
+
+#include plat/gpio-cfg.h
+#include plat/gpio-cfg-helpers.h
+#include plat/gpio-s5pc1xx.h
+#include plat/regs-gpio.h
+
+static struct s5pc1xx_gpio_chip s5pc110_gpio_chips[] = {
+   S5PC1XX_INT_CHIP_DEF(S5PC110, A0),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, A1),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, B),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, C0),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, C1),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, D0),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, D1),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, E0),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, E1),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, F0),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, F1),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, F2),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, F3),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, G0),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, G1),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, G2),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, G3),
+   S5PC1XX_EINT_CHIP_DEF(S5PC110, H0),
+   S5PC1XX_EINT_CHIP_DEF(S5PC110, H1),
+   S5PC1XX_EINT_CHIP_DEF(S5PC110, H2),
+   S5PC1XX_EINT_CHIP_DEF(S5PC110, H3),
+   S5PC1XX_NOINT_CHIP_DEF(S5PC110, I),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, J0),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, J1),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, J2),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, J3),
+   S5PC1XX_INT_CHIP_DEF(S5PC110, J4),
+   S5PC1XX_MP_CHIP_DEF(S5PC110, MP0_1),
+   S5PC1XX_MP_CHIP_DEF(S5PC110, MP0_2),
+   S5PC1XX_MP_CHIP_DEF(S5PC110, MP0_3),
+   S5PC1XX_MP_CHIP_DEF(S5PC110, MP0_4),
+   S5PC1XX_MP_CHIP_DEF(S5PC110, MP0_5),
+};
+
+struct s5pc1xx_gpio s5pc1xx_gpio_chips = {
+   .chips = s5pc110_gpio_chips,
+   .count = ARRAY_SIZE(s5pc110_gpio_chips),
+};
diff --git a/arch/arm/mach-s5pc110/include/mach/gpio.h 
b/arch/arm/mach-s5pc110/include/mach/gpio.h
new file mode 100644
index 000..ae36f1e
--- /dev/null
+++ b/arch/arm/mach-s5pc110/include/mach/gpio.h
@@ -0,0 +1,187 @@
+/* arch/arm/mach-s5pc110/include/mach/gpio.h
+ *
+ * Copyright 2009 Samsung Electronics Co.
+ * Byungho Min bh...@samsung.com
+ *
+ * S5PC110 - GPIO lib support
+ *
+ * Base on mach-s3c6400/include/mach/gpio.h
+ *
+ * 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 gpio_get_value __gpio_get_value
+#define gpio_set_value __gpio_set_value
+#define gpio_cansleep  __gpio_cansleep
+#define gpio_to_irq__gpio_to_irq
+
+/* GPIO bank sizes */
+#define S5PC110_GPIO_A0_NR (8)
+#define S5PC110_GPIO_A1_NR (8)
+#define S5PC110_GPIO_B_NR  (8)
+#define S5PC110_GPIO_C0_NR (8)
+#define S5PC110_GPIO_C1_NR (8)
+#define S5PC110_GPIO_D0_NR (8)
+#define S5PC110_GPIO_D1_NR (8)
+#define S5PC110_GPIO_E0_NR (8)
+#define S5PC110_GPIO_E1_NR (8)
+#define S5PC110_GPIO_F0_NR (8)

[PATCH 20/20] MAINTAINERS: add ARM/S5PC100 and ARM/S5PC110 architectures

2009-11-20 Thread Marek Szyprowski
From: Kyungmin Park kyungmin.p...@samsung.com

Add entries for the ARM S5PC100 and ARM S5PC110 architectures that are
currently being maintained by ourself.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 MAINTAINERS |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 81d68d5..de7daad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -877,6 +877,22 @@ W: http://www.fluff.org/ben/linux/
 S: Maintained
 F: arch/arm/mach-s3c6410/
 
+ARM/S5PC100 ARM ARCHITECTURE
+M: Kyungmin Park kyungmin.p...@samsung.com
+M: Marek Szyprowski m.szyprow...@samsung.com
+L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers)
+L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
+S: Supported
+F: arch/arm/mach-s5pc100/
+
+ARM/S5PC110 ARM ARCHITECTURE
+M: Kyungmin Park kyungmin.p...@samsung.com
+M: Marek Szyprowski m.szyprow...@samsung.com
+L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers)
+L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
+S: Supported
+F: arch/arm/mach-s5pc110/
+
 ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
 M: Lennert Buytenhek ker...@wantstofly.org
 L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers)
-- 
1.6.4

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/6] SMDK6410 SPI: Added spidev support as an example

2009-11-20 Thread Jassi Brar
As an illustration of using the newly implemented SPI driver,
'spidev' master device has been enabled on SMDK6410.

Signed-off-by: Jassi Brar jassi.b...@samsung.com
---
 arch/arm/mach-s3c6410/mach-smdk6410.c |   47 +
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c 
b/arch/arm/mach-s3c6410/mach-smdk6410.c
index ea51dbe..1230fa9 100644
--- a/arch/arm/mach-s3c6410/mach-smdk6410.c
+++ b/arch/arm/mach-s3c6410/mach-smdk6410.c
@@ -25,6 +25,7 @@
 #include linux/gpio.h
 #include linux/delay.h
 #include linux/smsc911x.h
+#include linux/spi/spi.h
 
 #ifdef CONFIG_SMDK6410_WM1190_EV1
 #include linux/mfd/wm8350/core.h
@@ -49,8 +50,10 @@
 #include plat/regs-gpio.h
 #include plat/regs-sys.h
 #include plat/iic.h
+#include plat/spi.h
 #include plat/fb.h
 #include plat/gpio-cfg.h
+#include plat/gpio-bank-c.h
 
 #include plat/s3c6410.h
 #include plat/clock.h
@@ -193,6 +196,7 @@ static struct platform_device *smdk6410_devices[] 
__initdata = {
 #ifdef CONFIG_SMDK6410_SD_CH1
s3c_device_hsmmc1,
 #endif
+   s3c64xx_device_spi0,
s3c_device_i2c0,
s3c_device_i2c1,
s3c_device_fb,
@@ -351,6 +355,40 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
{ I2C_BOARD_INFO(24c128, 0x57), },/* Samsung S524AD0XD1 */
 };
 
+static void smdk6410_spidev_cs_set_level(int high)
+{
+   u32 val;
+
+   val = readl(S3C64XX_GPCDAT);
+
+   if (high)
+   val |= (13);
+   else
+   val = ~(13);
+
+   writel(val, S3C64XX_GPCDAT);
+}
+
+#define SMDK6410_SPIDEV_CS 0
+
+static struct s3c64xx_spi_csinfo smdk6410_spi0_csi[] = {
+   [SMDK6410_SPIDEV_CS] = {
+   .set_level = smdk6410_spidev_cs_set_level,
+   .fb_delay = 0x3, /* 9ns feedback delay */
+   },
+};
+
+static struct spi_board_info smdk6410_spi_devices[] __initdata = {
+   {
+   .modalias= spidev,
+   .mode= SPI_MODE_0,
+   .max_speed_hz= 400,
+   .bus_num = 0,
+   .chip_select = 0,
+   .controller_data = smdk6410_spi1_csi[SMDK6410_SPIDEV_CS],
+   },
+};
+
 static void __init smdk6410_map_io(void)
 {
u32 tmp;
@@ -385,6 +423,15 @@ static void __init smdk6410_machine_init(void)
i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
 
+   /* SPI Controller-0 generates its clocks from PCLK and
+* emulates ARRAY_SIZE(smdk6410_spi0_csi) chipselects.
+*/
+   s3c64xx_spi_set_info(BUSNUM(0), S3C64XX_SPI_SRCCLK_PCLK,
+ARRAY_SIZE(smdk6410_spi0_csi));
+
+   spi_register_board_info(smdk6410_spi_devices,
+   ARRAY_SIZE(smdk6410_spi_devices));
+
platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
 }
 
-- 
1.6.2.5

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html