RE: [PATCH] ARM: Exynos4: add support for GATE BLOCK clocks

2012-05-10 Thread Marek Szyprowski
Hello,

On Thursday, May 10, 2012 11:14 AM Kukjin Kim wrote:

 Marek Szyprowski wrote:
 
  EXYNOS4_CLKGATE_BLOCK register can be used to disable the respective
  multimedia block hardware planes. It acts similar to the power domains.
  This patch adds transparent support for this method of gating of
  multimedia blocks. New clocks are added as parents to the respective
  block bus clocks. This patch has been tested on NURI and UniversalC210
  boards, which have bootloader which disable all multimedia blocks with
  both GATE BLOCK method and power domains.
 
  Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  ---
   arch/arm/mach-exynos/clock-exynos4.c |   54
  ++
   1 files changed, 54 insertions(+), 0 deletions(-)
 
  diff --git a/arch/arm/mach-exynos/clock-exynos4.c b/arch/arm/mach-
  exynos/clock-exynos4.c
  index 4287311..a2f8b2e 100644
  --- a/arch/arm/mach-exynos/clock-exynos4.c
  +++ b/arch/arm/mach-exynos/clock-exynos4.c
  @@ -213,6 +213,11 @@ static int exynos4_clk_dac_ctrl(struct clk *clk, int
  enable)
  return s5p_gatectrl(S5P_DAC_PHY_CONTROL, clk, enable);
   }
 
  +static int exynos4_clk_gate_block_ctrl(struct clk *clk, int enable)
  +{
  +   return s5p_gatectrl(EXYNOS4_CLKGATE_BLOCK, clk, enable);
  +}
  +
   /* Core list of CMU_CPU side */
 
   static struct clksrc_clk exynos4_clk_mout_apll = {
  @@ -459,6 +464,37 @@ static struct clksrc_clk exynos4_clk_sclk_vpll = {
  .reg_src = { .reg = EXYNOS4_CLKSRC_TOP0, .shift = 8, .size = 1 },
   };
 
  +static struct clk exynos4_clk_gate_cam = {
  +   .name   = cam,
  +   .enable = exynos4_clk_gate_block_ctrl,
  +   .ctrlbit= (1  0),
  +};
  +
  +static struct clk exynos4_clk_gate_tv = {
  +   .name   = tv,
  +   .enable = exynos4_clk_gate_block_ctrl,
  +   .ctrlbit= (1  1),
  +};
  +
  +static struct clk exynos4_clk_gate_mfc = {
  +   .name   = mfc,
  +   .enable = exynos4_clk_gate_block_ctrl,
  +   .ctrlbit= (1  2),
  +};
  +
  +static struct clk exynos4_clk_gate_lcd0 = {
  +   .name   = lcd0,
  +   .enable = exynos4_clk_gate_block_ctrl,
  +   .ctrlbit= (1  4),
  +};
  +
  +static struct clk *exynos4_gate_clocks[] = {
  +   exynos4_clk_gate_cam,
  +   exynos4_clk_gate_tv,
  +   exynos4_clk_gate_mfc,
  +   exynos4_clk_gate_lcd0,
  +};
  +
   static struct clk exynos4_init_clocks_off[] = {
  {
  .name   = timers,
  @@ -470,36 +506,43 @@ static struct clk exynos4_init_clocks_off[] = {
  .devname= s5p-mipi-csis.0,
  .enable = exynos4_clk_ip_cam_ctrl,
  .ctrlbit= (1  4),
  +   .parent = exynos4_clk_gate_cam,
  }, {
  .name   = csis,
  .devname= s5p-mipi-csis.1,
  .enable = exynos4_clk_ip_cam_ctrl,
  .ctrlbit= (1  5),
  +   .parent = exynos4_clk_gate_cam,
  }, {
  .name   = jpeg,
  .id = 0,
  .enable = exynos4_clk_ip_cam_ctrl,
  .ctrlbit= (1  6),
  +   .parent = exynos4_clk_gate_cam,
  }, {
  .name   = fimc,
  .devname= exynos4-fimc.0,
  .enable = exynos4_clk_ip_cam_ctrl,
  .ctrlbit= (1  0),
  +   .parent = exynos4_clk_gate_cam,
  }, {
  .name   = fimc,
  .devname= exynos4-fimc.1,
  .enable = exynos4_clk_ip_cam_ctrl,
  .ctrlbit= (1  1),
  +   .parent = exynos4_clk_gate_cam,
  }, {
  .name   = fimc,
  .devname= exynos4-fimc.2,
  .enable = exynos4_clk_ip_cam_ctrl,
  .ctrlbit= (1  2),
  +   .parent = exynos4_clk_gate_cam,
  }, {
  .name   = fimc,
  .devname= exynos4-fimc.3,
  .enable = exynos4_clk_ip_cam_ctrl,
  .ctrlbit= (1  3),
  +   .parent = exynos4_clk_gate_cam,
  }, {
  .name   = hsmmc,
  .devname= s3c-sdhci.0,
  @@ -534,31 +577,37 @@ static struct clk exynos4_init_clocks_off[] = {
  .devname= s5p-sdo,
  .enable = exynos4_clk_ip_tv_ctrl,
  .ctrlbit= (1  2),
  +   .parent = exynos4_clk_gate_tv,
  }, {
  .name   = mixer,
  .devname= s5p-mixer,
  .enable = exynos4_clk_ip_tv_ctrl,
  .ctrlbit= (1  1),
  +   .parent = exynos4_clk_gate_tv,
  }, {
  .name   = vp,
  .devname= s5p-mixer,
  .enable

RE: [PATCHv2 0/3] Add support for DRM display subsystem

2012-05-10 Thread Marek Szyprowski
Hello,

On Thursday, May 10, 2012 11:36 AM Kukjin Kim wrote:

 Marek Szyprowski wrote:
 
  Hello,
 
  This patch set adds support for Exynos DRM display subsystem for
  Universal C210 and NURI boards. Exynos DRM driver has been merged to 3.3
  kernel tree and provides unified and more powerful alternative for
  s3c-fb and s5p-tv drivers. V2 includes update for the latest changes in
  platform data structure (added 'panel' entry).
 
  Best regards
 
  Marek Szyprowski
  Samsung Poland RD Center
 
  Patch summary:
 
  Marek Szyprowski (3):
ARM: Exynos: add platform device for core DRM subsystem
ARM: Exynos: Add DRM core device support for Universal C210 board
ARM: Exynos: Add DRM core support for NURI board
 
   arch/arm/mach-exynos/Kconfig   |7 ++
   arch/arm/mach-exynos/Makefile  |1 +
   arch/arm/mach-exynos/dev-drm.c |   29
 
   arch/arm/mach-exynos/mach-nuri.c   |   33
  
   arch/arm/mach-exynos/mach-universal_c210.c |   33
  
   arch/arm/plat-samsung/include/plat/devs.h  |2 +
   6 files changed, 105 insertions(+), 0 deletions(-)
   create mode 100644 arch/arm/mach-exynos/dev-drm.c
 
  --
  1.7.1.569.g6f426
 
 Well, 2nd and 3rd patches can break multi-platform for EXYNOS SoCs with one
 kernel image.

We can switch completely to DRM driver for both boards and remove entries for 
s3c-fb/tv if this is really needed. IMHO it is a bit lame that the DRM driver
is already in the mainline, but none of the boards use it. Even if one wants
to add support for it to his own board, he cannot find any reference code for
it...

 And I won't apply new feature for non-dt board file from now on. I think, we
 need to support DT in mach-exynos/ instead of non-DT and DT together, so
 please consider to move on dt supporting for Samsung mobile boards.
 
 Note that I have a plan to replace board files with DT supporting in
 mach-exynos/ next time.

Right now the DT support is so incomplete that even basic things like gpio 
interrupts are not yet supported. This will be a huge regression if you remove
the existing board files and replace them with DT stubs.
 
Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center


--
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


RE: [PATCH v2] ARM: Exynos4: read initial state of power domain from hw registers

2012-05-10 Thread Marek Szyprowski
Hello,

On Thursday, May 10, 2012 11:09 AM Kukjin Kim wrote:

 Marek Szyprowski wrote:
 
  Some bootloaders disable unused power domains, so kernel code should
  read the actual state from the hardware registers instead of assuming
  that their initial state is 'on'.
 
  Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  ---
   arch/arm/mach-exynos/pm_domains.c |9 ++---
   1 files changed, 6 insertions(+), 3 deletions(-)
 
  diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-
  exynos/pm_domains.c
  index 13b3068..26fc47d 100644
  --- a/arch/arm/mach-exynos/pm_domains.c
  +++ b/arch/arm/mach-exynos/pm_domains.c
  @@ -151,9 +151,12 @@ static __init int exynos4_pm_init_power_domain(void)
  if (of_have_populated_dt())
  return exynos_pm_dt_parse_domains();
 
  -   for (idx = 0; idx  ARRAY_SIZE(exynos4_pm_domains); idx++)
  -   pm_genpd_init(exynos4_pm_domains[idx]-pd, NULL,
  -   exynos4_pm_domains[idx]-is_off);
  +   for (idx = 0; idx  ARRAY_SIZE(exynos4_pm_domains); idx++) {
  +   struct exynos_pm_domain *pd = exynos4_pm_domains[idx];
  +   int on = __raw_readl(pd-base + 0x4)  S5P_INT_LOCAL_PWR_EN;
  +
  +   pm_genpd_init(pd-pd, NULL, !on);
  +   }
 
   #ifdef CONFIG_S5P_DEV_FIMD0
  exynos_pm_add_dev_to_genpd(s5p_device_fimd0, exynos4_pd_lcd0);
  --
  1.7.1.569.g6f426
 
 As you said, if bootloader changed some hardware setting which is not
 expected value in kernel, it should be notified to kernel. But for
 pm_domaine-is_off, it should be via DT on EXYNOS now. As you know, the
 functionality has been already implemented on dt.

I really doubt that we need such complex interface to pass the information 
which the driver can simply read from the register...

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center


--
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


RE: [PATCH] drivers: genpd: let platform code to register devices into disabled domains

2012-05-10 Thread Marek Szyprowski
Hi Rafael,

On Monday, May 07, 2012 8:45 PM Rafael J. Wysocki wrote:

 On Monday, May 07, 2012, Marek Szyprowski wrote:
  Hi Rafael,
 
  I'm sorry for a late reply, I was on holidays last week and just got back to
  the office.
 
  On Sunday, April 29, 2012 10:55 PM Rafael J. Wysocki wrote:
 
   On Friday, April 06, 2012, Marek Szyprowski wrote:
Some bootloaders disable power domains on boot and the platform startup
code registers them in the 'disabled' state. Current gen_pd code assumed
that the devices can be registered only to the power domain which is in
'enabled' state and these devices are active at the time of the
registration. This is not correct in our case. This patch lets drivers
to be registered into 'disabled' power domains and finally solves
mysterious freezes and lack of resume/suspend calls on Samsung Exynos4
NURI and UniversalC210 platforms.
   
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/base/power/domain.c |7 +--
 1 files changed, 1 insertions(+), 6 deletions(-)
   
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 73ce9fb..05f5799f 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1211,11 +1211,6 @@ int __pm_genpd_add_device(struct 
generic_pm_domain *genpd, struct
   device *dev,
   
genpd_acquire_lock(genpd);
   
-   if (genpd-status == GPD_STATE_POWER_OFF) {
-   ret = -EINVAL;
-   goto out;
-   }
-
if (genpd-prepared_count  0) {
ret = -EAGAIN;
goto out;
@@ -1239,7 +1234,7 @@ int __pm_genpd_add_device(struct 
generic_pm_domain *genpd, struct
   device *dev,
dev_pm_get_subsys_data(dev);
dev-power.subsys_data-domain_data = gpd_data-base;
gpd_data-base.dev = dev;
-   gpd_data-need_restore = false;
+   gpd_data-need_restore = true;
  
   I think that should be:
  
   + gpd_data-need_restore = genpd-status == GPD_STATE_POWER_OFF;
  
   Otherwise, on the next domain power off the device's state won't be saved.
  
list_add_tail(gpd_data-base.list_node, genpd-dev_list);
if (td)
gpd_data-td = *td;
 
  I've tested the above change and there is problem. Let me explain in detail 
  the
  sw/hw configuration I have.
 
  There is a power domain and the device driver. The device itself also has 
  it's own
  power management code (which enables and disables clocks).  Some power 
  domains are
  disabled by bootloader and some devices in the active power domains have 
  their
  clocks disabled too. In the current runtime pm code the devices were probed 
  in
  'disabled' state and had to enable itself by calling get_runtime_sync(). My 
  initial
  patch restored runtime pm handling to the old state (the same which was 
  with non
  gen_pd based driver or no power domain driver at all, where runtime pm was 
  handled
  by platform bus). If I apply your patch the runtime_restore
 
 I guess you mean .runtime_resume().
 
  callback is not called on first driver probe for devices inside the domain 
  which
  has been left enabled by the bootloader.
 
 I don't see why .probe() should depend on the runtime PM framework to call
 .runtime_resume() for it.  It looks like .probe() could just call
 .runtime_resume() directly if needed.
 
 Besides, your change breaks existing code as I said.

Before using gen_pd power domains we had the following flow of calls/controls:

1. fimc_probe(fimd_pdev)
...
2. pm_runtime_enable(fimd_pdev-dev)
3. pm_runtime_get_sync(fimd_pdev-dev)
3a. parent device's runtime_resume()
3b. fimc_runtime_resume(fimd_pdev-dev)
...
4. pm_runtime_put(fimd_pdev-dev)
...
5. (runtime put timer kicks off)
5a. fimc_runtime_put(fimd_pdev-dev)
5b. parent device's runtime_suspend()

(this flow assumed that fimc device was the only child of its parent platform 
device).

Now with power gen_pd driver with my patch I get the following call sequence:

1. fimc_probe(fimd_pdev)
...
2. pm_runtime_enable(fimd_pdev-dev)
3. pm_runtime_get_sync(fimd_pdev-dev)
3a. gen_pd pd_power_on(...)
3b. fimc_runtime_resume(fimd_pdev-dev)
4. pm_runtime_put(fimd_pdev-dev)
...
5. (runtime put timer kicks off)
5a. fimc_runtime_put(fimd_pdev-dev)
5b. gen_pd pd_power_off (...)

so it works like before.

Now with your suggested change I get following call sequence:

1. fimc_probe(fimc_pdev)
...
2. pm_runtime_enable(fimd_pdev-dev)
3. pm_runtime_get_sync(fimd_pdev-dev)
(gen_pd finds that the power domain is already activated)
...
4. pm_runtime_put(fimd_pdev-dev)
...
5. (runtime put timer kicks off)
5a. fimc_runtime_put(fimd_pdev-dev)
5b. gen_pd pd_power_off (...)

As you can notice in point 3, gen_pd driver checks

Re: [PATCH] drivers: genpd: let platform code to register devices into disabled domains

2012-05-14 Thread Marek Szyprowski

Hi

On 2012-05-11 22:51, Rafael J. Wysocki wrote:

On Thursday, May 10, 2012, Rafael J. Wysocki wrote:

On Thursday, May 10, 2012, Marek Szyprowski wrote:

Hi Rafael,

On Monday, May 07, 2012 8:45 PM Rafael J. Wysocki wrote:


On Monday, May 07, 2012, Marek Szyprowski wrote:

Hi Rafael,

I'm sorry for a late reply, I was on holidays last week and just got back to
the office.

On Sunday, April 29, 2012 10:55 PM Rafael J. Wysocki wrote:


On Friday, April 06, 2012, Marek Szyprowski wrote:

Some bootloaders disable power domains on boot and the platform startup
code registers them in the 'disabled' state. Current gen_pd code assumed
that the devices can be registered only to the power domain which is in
'enabled' state and these devices are active at the time of the
registration. This is not correct in our case. This patch lets drivers
to be registered into 'disabled' power domains and finally solves
mysterious freezes and lack of resume/suspend calls on Samsung Exynos4
NURI and UniversalC210 platforms.

Signed-off-by: Marek Szyprowskim.szyprow...@samsung.com
Signed-off-by: Kyungmin Parkkyungmin.p...@samsung.com
---
  drivers/base/power/domain.c |7 +--
  1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 73ce9fb..05f5799f 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1211,11 +1211,6 @@ int __pm_genpd_add_device(struct generic_pm_domain 
*genpd, struct

device *dev,


genpd_acquire_lock(genpd);

-   if (genpd-status == GPD_STATE_POWER_OFF) {
-   ret = -EINVAL;
-   goto out;
-   }
-
if (genpd-prepared_count  0) {
ret = -EAGAIN;
goto out;
@@ -1239,7 +1234,7 @@ int __pm_genpd_add_device(struct generic_pm_domain 
*genpd, struct

device *dev,

dev_pm_get_subsys_data(dev);
dev-power.subsys_data-domain_data =gpd_data-base;
gpd_data-base.dev = dev;
-   gpd_data-need_restore = false;
+   gpd_data-need_restore = true;


I think that should be:

+   gpd_data-need_restore = genpd-status == GPD_STATE_POWER_OFF;

Otherwise, on the next domain power off the device's state won't be saved.


list_add_tail(gpd_data-base.list_node,genpd-dev_list);
if (td)
gpd_data-td = *td;


I've tested the above change and there is problem. Let me explain in detail the
sw/hw configuration I have.

There is a power domain and the device driver. The device itself also has it's 
own
power management code (which enables and disables clocks).  Some power domains 
are
disabled by bootloader and some devices in the active power domains have their
clocks disabled too. In the current runtime pm code the devices were probed in
'disabled' state and had to enable itself by calling get_runtime_sync(). My 
initial
patch restored runtime pm handling to the old state (the same which was with non
gen_pd based driver or no power domain driver at all, where runtime pm was 
handled
by platform bus). If I apply your patch the runtime_restore


I guess you mean .runtime_resume().


callback is not called on first driver probe for devices inside the domain which
has been left enabled by the bootloader.


I don't see why .probe() should depend on the runtime PM framework to call
.runtime_resume() for it.  It looks like .probe() could just call
.runtime_resume() directly if needed.

Besides, your change breaks existing code as I said.


Before using gen_pd power domains we had the following flow of calls/controls:

1. fimc_probe(fimd_pdev)
...
2. pm_runtime_enable(fimd_pdev-dev)
3. pm_runtime_get_sync(fimd_pdev-dev)
3a. parent device's runtime_resume()
3b. fimc_runtime_resume(fimd_pdev-dev)
...
4. pm_runtime_put(fimd_pdev-dev)
...
5. (runtime put timer kicks off)
5a. fimc_runtime_put(fimd_pdev-dev)
5b. parent device's runtime_suspend()

(this flow assumed that fimc device was the only child of its parent platform 
device).

Now with power gen_pd driver with my patch I get the following call sequence:

1. fimc_probe(fimd_pdev)
...
2. pm_runtime_enable(fimd_pdev-dev)
3. pm_runtime_get_sync(fimd_pdev-dev)
3a. gen_pd pd_power_on(...)
3b. fimc_runtime_resume(fimd_pdev-dev)
4. pm_runtime_put(fimd_pdev-dev)
...
5. (runtime put timer kicks off)
5a. fimc_runtime_put(fimd_pdev-dev)
5b. gen_pd pd_power_off (...)

so it works like before.

Now with your suggested change I get following call sequence:

1. fimc_probe(fimc_pdev)
...
2. pm_runtime_enable(fimd_pdev-dev)
3. pm_runtime_get_sync(fimd_pdev-dev)
(gen_pd finds that the power domain is already activated)
...
4. pm_runtime_put(fimd_pdev-dev)
...
5. (runtime put timer kicks off)
5a. fimc_runtime_put(fimd_pdev-dev)
5b. gen_pd pd_power_off (...)

As you can notice in point 3, gen_pd driver checks its internal state,
finds that the power domain is already enabled and skips calling

Re: [PATCH] drivers: genpd: let platform code to register devices into disabled domains

2012-05-14 Thread Marek Szyprowski

Hello,

On 5/14/2012 9:04 PM, Rafael J. Wysocki wrote:

On Monday, May 14, 2012, Marek Szyprowski wrote:

Hi

On 2012-05-11 22:51, Rafael J. Wysocki wrote:

On Thursday, May 10, 2012, Rafael J. Wysocki wrote:

On Thursday, May 10, 2012, Marek Szyprowski wrote:

Hi Rafael,

On Monday, May 07, 2012 8:45 PM Rafael J. Wysocki wrote:


On Monday, May 07, 2012, Marek Szyprowski wrote:

Hi Rafael,

I'm sorry for a late reply, I was on holidays last week and just got back to
the office.

On Sunday, April 29, 2012 10:55 PM Rafael J. Wysocki wrote:


On Friday, April 06, 2012, Marek Szyprowski wrote:

Some bootloaders disable power domains on boot and the platform startup
code registers them in the 'disabled' state. Current gen_pd code assumed
that the devices can be registered only to the power domain which is in
'enabled' state and these devices are active at the time of the
registration. This is not correct in our case. This patch lets drivers
to be registered into 'disabled' power domains and finally solves
mysterious freezes and lack of resume/suspend calls on Samsung Exynos4
NURI and UniversalC210 platforms.

Signed-off-by: Marek Szyprowskim.szyprow...@samsung.com
Signed-off-by: Kyungmin Parkkyungmin.p...@samsung.com
---
   drivers/base/power/domain.c |7 +--
   1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 73ce9fb..05f5799f 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1211,11 +1211,6 @@ int __pm_genpd_add_device(struct generic_pm_domain 
*genpd, struct

device *dev,


genpd_acquire_lock(genpd);

-   if (genpd-status == GPD_STATE_POWER_OFF) {
-   ret = -EINVAL;
-   goto out;
-   }
-
if (genpd-prepared_count   0) {
ret = -EAGAIN;
goto out;
@@ -1239,7 +1234,7 @@ int __pm_genpd_add_device(struct generic_pm_domain 
*genpd, struct

device *dev,

dev_pm_get_subsys_data(dev);
dev-power.subsys_data-domain_data =gpd_data-base;
gpd_data-base.dev = dev;
-   gpd_data-need_restore = false;
+   gpd_data-need_restore = true;


I think that should be:

+   gpd_data-need_restore = genpd-status == GPD_STATE_POWER_OFF;

Otherwise, on the next domain power off the device's state won't be saved.


list_add_tail(gpd_data-base.list_node,genpd-dev_list);
if (td)
gpd_data-td = *td;


I've tested the above change and there is problem. Let me explain in detail the
sw/hw configuration I have.

There is a power domain and the device driver. The device itself also has it's 
own
power management code (which enables and disables clocks).  Some power domains 
are
disabled by bootloader and some devices in the active power domains have their
clocks disabled too. In the current runtime pm code the devices were probed in
'disabled' state and had to enable itself by calling get_runtime_sync(). My 
initial
patch restored runtime pm handling to the old state (the same which was with non
gen_pd based driver or no power domain driver at all, where runtime pm was 
handled
by platform bus). If I apply your patch the runtime_restore


I guess you mean .runtime_resume().


callback is not called on first driver probe for devices inside the domain which
has been left enabled by the bootloader.


I don't see why .probe() should depend on the runtime PM framework to call
.runtime_resume() for it.  It looks like .probe() could just call
.runtime_resume() directly if needed.

Besides, your change breaks existing code as I said.


Before using gen_pd power domains we had the following flow of calls/controls:

1. fimc_probe(fimd_pdev)
...
2. pm_runtime_enable(fimd_pdev-dev)
3. pm_runtime_get_sync(fimd_pdev-dev)
3a. parent device's runtime_resume()
3b. fimc_runtime_resume(fimd_pdev-dev)
...
4. pm_runtime_put(fimd_pdev-dev)
...
5. (runtime put timer kicks off)
5a. fimc_runtime_put(fimd_pdev-dev)
5b. parent device's runtime_suspend()

(this flow assumed that fimc device was the only child of its parent platform 
device).

Now with power gen_pd driver with my patch I get the following call sequence:

1. fimc_probe(fimd_pdev)
...
2. pm_runtime_enable(fimd_pdev-dev)
3. pm_runtime_get_sync(fimd_pdev-dev)
3a. gen_pd pd_power_on(...)
3b. fimc_runtime_resume(fimd_pdev-dev)
4. pm_runtime_put(fimd_pdev-dev)
...
5. (runtime put timer kicks off)
5a. fimc_runtime_put(fimd_pdev-dev)
5b. gen_pd pd_power_off (...)

so it works like before.

Now with your suggested change I get following call sequence:

1. fimc_probe(fimc_pdev)
...
2. pm_runtime_enable(fimd_pdev-dev)
3. pm_runtime_get_sync(fimd_pdev-dev)
(gen_pd finds that the power domain is already activated)
...
4. pm_runtime_put(fimd_pdev-dev)
...
5. (runtime put timer kicks off)
5a. fimc_runtime_put(fimd_pdev-dev)
5b. gen_pd pd_power_off (...)

As you can notice in point

[PATCH 0/2] Exynos4: power domain fixes for v3.5-rc

2012-06-15 Thread Marek Szyprowski
Hello,

This is a resend of my power domain fixes for Samsung Exynos platform.
They fix issues introduced by switching to gen_pd based driver in commit
91cfbd4ee0 ('ARM: EXYNOS: Hook up power domains to generic power domain
infrastructure') and restore runtime pm functionality for multimedia
drivers (s5p-fimc, s5p-mfc, s5p-tv, exynos-drm). Tested on Universal
C210 and NURI boards, but the issues were also reported for Origen
boards and others. If possible, please consider these patches as fixes
(runtime pm is broken without them) and merge to v3.5-rc line.

Best regards
Marek Szyprowski
Samsung Poland RD Center


Patch summary:

Marek Szyprowski (2):
  ARM: Exynos4: read initial state of power domain from hw registers
  ARM: Exynos4: pm_domains: register devices in 'need_restore' state

 arch/arm/mach-exynos/pm_domains.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

-- 
1.7.1.569.g6f426

--
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 2/2] ARM: Exynos4: pm_domains: register devices in 'need_restore' state

2012-06-15 Thread Marek Szyprowski
Commit ca1d72f033 ('PM / Domains: Make it possible to add devices to
inactive domains') introduced possibility to add devices to inactive
power domains and added pm_genpd_dev_need_restore() function which lets
platform core to notify power domain core that the specified device must
be restored (with its runtime_resume() callback) before first use.

This patch adds the pm_genpd_dev_need_restore() call what brings back
the suspend/resume behaviour for the client devices known from the
previous power domain driver (removed by commit 91cfbd4ee0 - 'ARM:
EXYNOS: Hook up power domains to generic power domain infrastructure').
Client device drivers relay on that suspend/resume behaviour, thus this
patch fixes runtime pm operation for client devices.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Reviewed-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-exynos/pm_domains.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-exynos/pm_domains.c 
b/arch/arm/mach-exynos/pm_domains.c
index 0a952a5..373c3c0 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -119,7 +119,9 @@ static __init void exynos_pm_add_dev_to_genpd(struct 
platform_device *pdev,
struct exynos_pm_domain *pd)
 {
if (pdev-dev.bus) {
-   if (pm_genpd_add_device(pd-pd, pdev-dev))
+   if (!pm_genpd_add_device(pd-pd, pdev-dev))
+   pm_genpd_dev_need_restore(pdev-dev, true);
+   else
pr_info(%s: error in adding %s device to %s power
domain\n, __func__, dev_name(pdev-dev),
pd-name);
-- 
1.7.1.569.g6f426

--
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


RE: [PATCH V2 3/7] ARM: EXYNOS5: add machine specific support for LCD

2012-07-18 Thread Marek Szyprowski
Hello,

On Wednesday, July 18, 2012 7:57 AM Leela Krishna Amudala wrote:

 This patch adds machine specific support for LCD controller like setting 
 power to LCD
 and adding LCD platform device.
 
 Signed-off-by: Prathyush K prathyus...@samsung.com
 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
  arch/arm/mach-exynos/mach-exynos5-dt.c |   56 
 
  1 files changed, 56 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c 
 b/arch/arm/mach-exynos/mach-exynos5-dt.c
 index e7113cc..02a0e68 100644
 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c
 +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
 @@ -13,6 +13,7 @@
  #include linux/serial_core.h
  #include linux/pwm_backlight.h
  #include linux/gpio.h
 +#include linux/delay.h
 
  #include asm/mach/arch.h
  #include asm/hardware/gic.h
 @@ -24,6 +25,7 @@
  #include plat/gpio-cfg.h
 
  #include common.h
 +#include video/platform_lcd.h
 
  static int smdk5250_bl_notify(struct device *unused, int brightness)
  {
 @@ -47,6 +49,55 @@ static struct platform_pwm_backlight_data smdk5250_bl_data 
 = {
   .notify = smdk5250_bl_notify,
  };
 
 +static void lcd_set_power(struct plat_lcd_data *pd,
 + unsigned int power)
 +{
 +
 + /* reset */
 + gpio_request_one(EXYNOS5_GPX1(5), GPIOF_OUT_INIT_HIGH, GPX1);
 +
 + mdelay(20);
 + if (power) {
 + /* fire nRESET on power up */
 + gpio_set_value(EXYNOS5_GPX1(5), 0);
 + mdelay(20);
 + gpio_set_value(EXYNOS5_GPX1(5), 1);
 + mdelay(20);
 + gpio_free(EXYNOS5_GPX1(5));
 + } else {
 + /* fire nRESET on power off */
 + gpio_set_value(EXYNOS5_GPX1(5), 0);
 + mdelay(20);
 + gpio_set_value(EXYNOS5_GPX1(5), 1);
 + mdelay(20);
 + gpio_free(EXYNOS5_GPX1(5));
 + }
 + mdelay(20);
 +
 + /*
 +  * Request lcd_bl_en GPIO for smdk5250_bl_notify().
 +  * TODO: Fix this so we are not at risk of requesting the GPIO
 +  * multiple times, this should be done with device tree, and
 +  * likely integrated into the plat-samsung/dev-backlight.c init.
 +  */
 + gpio_request_one(EXYNOS5_GPX3(0), GPIOF_OUT_INIT_LOW, GPX3);
 +}
 +
 +static int smdk5250_match_fb(struct plat_lcd_data *pd, struct fb_info *info)
 +{
 + /* Don't call .set_power callback while unblanking */
 + return 0;
 +}
 +
 +static struct plat_lcd_data smdk5250_lcd_data = {
 + .set_power  = lcd_set_power,
 + .match_fb   = smdk5250_match_fb,
 +};
 +
 +static struct platform_device smdk5250_lcd = {
 + .name   = platform-lcd,
 + .dev.platform_data  = smdk5250_lcd_data,
 +};
  /*
   * The following lookup table is used to override device names when devices
   * are registered from device tree. This is temporarily added to enable
 @@ -85,6 +136,10 @@ static const struct of_dev_auxdata 
 exynos5250_auxdata_lookup[] __initconst
 = {
   {},
  };
 
 +static struct platform_device *smdk5250_devices[] __initdata = {
 + smdk5250_lcd, /* for platform_lcd device */
 +};
 +
  static void __init exynos5250_dt_map_io(void)
  {
   exynos_init_io(NULL, 0);
 @@ -96,6 +151,7 @@ static void __init exynos5250_dt_machine_init(void)
   samsung_bl_set(smdk5250_bl_gpio_info, smdk5250_bl_data);
   of_platform_populate(NULL, of_default_bus_match_table,
   exynos5250_auxdata_lookup, NULL);
 + platform_add_devices(smdk5250_devices, ARRAY_SIZE(smdk5250_devices));
  }
 
  static char const *exynos5250_dt_compat[] __initdata = {

Sorry, but this patch looks completely weird to me. exynos5-dt machine is aimed 
to 
operate on ANY Exynos5 based board with proper device tree bindings, not only 
SMDK5250.
Please add DT support to platform lcd driver and create required bindings for it
instead of hardcoding the platform data and gpio numbers in mach-exynos5-dt.c

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center



--
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


RE: [PATCH V2 1/7] ARM: SAMSUNG: add additional registers and SFR definitions for writeback

2012-07-18 Thread Marek Szyprowski
   (0x3  9)
 +#define VIDCON1_VCLK_HOLD   (0x0  9)
 +#define VIDCON1_VCLK_RUN(0x1  9)
 
 +#ifdef CONFIG_FB_EXYNOS_FIMD_V8
 +#define VIDTCON2 (0x20018)
 +#else
  #define VIDTCON2 (0x18)
 +#endif
  #define VIDTCON2_LINEVAL_E(_x)   _x)  0x800)  11) 
  23)
  #define VIDTCON2_LINEVAL_MASK(0x7ff  11)
  #define VIDTCON2_LINEVAL_SHIFT   (11)
 @@ -186,6 +223,9 @@
  #define WINCONx_BYTSWP   (1  17)
  #define WINCONx_HAWSWP   (1  16)
  #define WINCONx_WSWP (1  15)
 +#define WINCONx_ENLOCAL_MASK (0xf  15)
 +#define WINCONx_INRGB_RGB(0  13)
 +#define WINCONx_INRGB_YCBCR  (1  13)
  #define WINCONx_BURSTLEN_MASK(0x3  9)
  #define WINCONx_BURSTLEN_SHIFT   (9)
  #define WINCONx_BURSTLEN_16WORD  (0x0  9)
 @@ -205,6 +245,7 @@
  #define WINCON0_BPPMODE_24BPP_888(0xb  2)
 
  #define WINCON1_BLD_PIX  (1  6)
 +#define WINCON1_BLD_PLANE(0  6)
 
  #define WINCON1_ALPHA_SEL(1  1)
  #define WINCON1_BPPMODE_MASK (0xf  2)
 @@ -395,9 +436,19 @@
  #define WPALCON_W0PAL_16BPP_A555 (0x5  0)
  #define WPALCON_W0PAL_16BPP_565  (0x6  0)
 
 +/* Clock gate mode control */
 +#define REG_CLKGATE_MODE (0x1b0)
 +#define REG_CLKGATE_MODE_AUTO_CLOCK_GATE (0  0)
 +#define REG_CLKGATE_MODE_NON_CLOCK_GATE  (1  0)
 +
  /* Blending equation control */
  #define BLENDCON (0x260)
  #define BLENDCON_NEW_MASK(1  0)
  #define BLENDCON_NEW_8BIT_ALPHA_VALUE(1  0)
  #define BLENDCON_NEW_4BIT_ALPHA_VALUE(0  0)
 
 +/* Window alpha control */
 +#define VIDW0ALPHA0  (0x200)
 +#define VIDW0ALPHA1  (0x204)
 +#define DPCLKCON (0x27c)
 +#define DPCLKCON_ENABLE  (1  1)
 diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
 index 0217f74..f81bf55 100644
 --- a/drivers/video/Kconfig
 +++ b/drivers/video/Kconfig
 @@ -2053,6 +2053,12 @@ config FB_S3C
 
 Currently the support is only for the S3C6400 and S3C6410 SoCs.
 
 +config FB_EXYNOS_FIMD_V8
 + bool register extensions for FIMD version 8
 + depends on ARCH_EXYNOS5
 + ---help---
 + This uses register extensions for FIMD version 8
 +
  config FB_S3C_DEBUG_REGWRITE
 bool Debug register writes
 depends on FB_S3C

Do we really need these defines in arch/arm/plat-samsung/include/plat/regs-fb* 
? 
IMHO they should be moved from arch/arm to drivers/video to live together with 
the driver.
They are not a part of core platform code. I thought that there have been some 
patches 
cleaning up regs-fb mess a long time ago, but it looks they didn't get their 
way to 
mainline.

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center


--
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


RE: [PATCH 1/3] Move FIMD register headers to include/video/

2012-07-31 Thread Marek Szyprowski
Hello,

On Tuesday, July 31, 2012 2:48 AM Jingoo Han wrote:

 On Monday, July 30, 2012 8:16 PM, Leela Krishna Amudala wrote:
 
  Hello Jingoo Han,
 
  On Mon, Jul 30, 2012 at 2:23 PM, Jingoo Han jg1@samsung.com wrote:
   On Monday, July 30, 2012 5:45 PM, Leela Krishna Amudala wrote:
  
   Moved the contents of regs-fb-v4.h and regs-fb.h from arch side
   to include/video/samsung_fimd.h
  
   Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
   ---
arch/arm/plat-samsung/include/plat/regs-fb-v4.h |  159 ---
arch/arm/plat-samsung/include/plat/regs-fb.h|  403 -
include/video/samsung_fimd.h|  533 
   +++
3 files changed, 533 insertions(+), 562 deletions(-)
delete mode 100644 arch/arm/plat-samsung/include/plat/regs-fb-v4.h
delete mode 100644 arch/arm/plat-samsung/include/plat/regs-fb.h
create mode 100644 include/video/samsung_fimd.h
  
   +*/
   +
   +/*FIMD V8 REG OFFSET */
   +#define FIMD_V8_VIDTCON0 (0x20010)
   +#define FIMD_V8_VIDTCON1 (0x20014)
   +#define FIMD_V8_VIDTCON2 (0x20018)
   +#define FIMD_V8_VIDTCON3 (0x2001C)
   +#define FIMD_V8_VIDCON1  (0x20004)
 
 
 How about using soc_is_exynos5250()?
 
 +#define VIDTCON0 (soc_is_exynos5250() ? \
 + (0x20010) : (0x10))
 
 In this case, the FIMD driver does not need to change.
 Also, one binary is available.

Please don't mix two methods of runtime detection. FIMD driver (s3c-fb) already
has runtime hw detection based on platform device id. Adding such detection for 
exynos5 to DRM FIMD driver should not be a big issue too.

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center


--
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/17] SMDKC100: add I2C0 and I2C1 buses support

2009-10-13 Thread Marek Szyprowski
Add required machine definitions for I2C 0 and 1 bus controllers.
Currently no I2C device are defined yet.

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/mach-smdkc100.c |   17 +
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 5e6b9a3..36e7e00 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -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
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c 
b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 098956d..2c0119f 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -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 */
-- 
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 01/17] ARM: MM: use 64bytes of L1 cache on plat S5PC1xx

2009-10-13 Thread Marek Szyprowski
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 kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mm/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index e993140..9cf7706 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -777,5 +777,5 @@ config CACHE_XSC3L2
 
 config ARM_L1_CACHE_SHIFT
int
-   default 6 if ARCH_OMAP3
+   default 6 if ARCH_OMAP3 || ARCH_S5PC1XX
default 5
-- 
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 11/17] drivers: fb: enable S3C FrameBuffer on S5PC1XX platform

2009-10-13 Thread Marek Szyprowski
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.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 drivers/video/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 9bbb285..bb2c7b6 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -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
-- 
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 08/17] ARM: S5PC1XX: add cpu idle and system reset support

2009-10-13 Thread Marek Szyprowski
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.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc100/cpu.c |   22 ++
 arch/arm/mach-s5pc100/include/mach/system.h |   15 +++-
 arch/arm/plat-s3c/include/plat/cpu.h|6 ++
 arch/arm/plat-s5pc1xx/include/plat/regs-power.h |   84 +++
 4 files changed, 124 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/plat-s5pc1xx/include/plat/regs-power.h

diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/cpu.c
index 0e71889..a23ca57 100644
--- a/arch/arm/mach-s5pc100/cpu.c
+++ b/arch/arm/mach-s5pc100/cpu.c
@@ -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);
 }
diff --git a/arch/arm/mach-s5pc100/include/mach/system.h 
b/arch/arm/mach-s5pc100/include/mach/system.h
index e390143..07f0907 100644
--- a/arch/arm/mach-s5pc100/include/mach/system.h
+++ b/arch/arm/mach-s5pc100/include/mach/system.h
@@ -11,14 +11,23 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H __FILE__
 
+#include linux/io.h
+#include mach/map.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 */
-}
+   unsigned long reset;
 
+   reset = 0xc100;
+   __raw_writel(reset, S5PC1XX_VA_CLK_OTHER);
+   return;
+}
 #endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/plat-s3c/include/plat/cpu.h 
b/arch/arm/plat-s3c/include/plat/cpu.h
index fbc3d49..d1131ca 100644
--- a/arch/arm/plat-s3c/include/plat/cpu.h
+++ b/arch/arm/plat-s3c/include/plat/cpu.h
@@ -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
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-power.h 
b/arch/arm/plat-s5pc1xx/include/plat/regs-power.h
new file mode 100644
index 000..02ffa49
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/regs-power.h
@@ -0,0 +1,84 @@
+/* arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
+ *
+ * Copyright 2009 Samsung Electronics Co.
+ * Jongse Won jongse@samsung.com
+ *
+ * S5PC1XX clock 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_ARM_REGS_PWR
+#define __ASM_ARM_REGS_PWR __FILE__
+
+#define S5PC1XX_PWRREG(x)  (S5PC1XX_VA_PWR + (x))
+
+/* s5pc100 (0xE0108000) register for power management */
+#define S5PC100_PWR_CFGS5PC1XX_PWRREG(0x0)
+#define S5PC100_EINT_WAKEUP_MASK   S5PC1XX_PWRREG(0x4)
+#define S5PC100_NORMAL_CFG S5PC1XX_PWRREG(0x10)
+#define S5PC100_STOP_CFG   S5PC1XX_PWRREG(0x14)
+#define S5PC100_SLEEP_CFG  S5PC1XX_PWRREG(0x18)
+#define S5PC100_STOP_MEM_CFG   S5PC1XX_PWRREG(0x1C)
+#define S5PC100_OSC_FREQ   S5PC1XX_PWRREG(0x100)
+#define S5PC100_OSC_STABLE S5PC1XX_PWRREG(0x104)
+#define S5PC100_PWR_STABLE S5PC1XX_PWRREG(0x108)
+#define S5PC100_MTC_STABLE S5PC1XX_PWRREG(0x110)
+#define S5PC100_CLAMP_STABLE   S5PC1XX_PWRREG(0x114

[PATCH 10/17] SMDKC100: enable S3C FrameBuffer

2009-10-13 Thread Marek Szyprowski
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 kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc100/Kconfig |2 +
 arch/arm/mach-s5pc100/mach-smdkc100.c |   67 +
 2 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index b1a4ba5..5e6b9a3 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -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
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c 
b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 05bb20a..098956d 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -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));
 }
 
-- 
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 11/17] drivers: fb: enable S3C FrameBuffer on S5PC1XX platform

2009-10-13 Thread Marek Szyprowski
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.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 drivers/video/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 9bbb285..bb2c7b6 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -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
-- 
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 14/17] drivers: i2c: s3c2410-i2c also on S5PC1XX platform

2009-10-13 Thread Marek Szyprowski
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.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 drivers/i2c/busses/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 737335f..5b173f3 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -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.
-- 
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 07/17] ARM: S5PC1xx: add gpiolib and external/gpio interrupt support

2009-10-13 Thread Marek Szyprowski
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 kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 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 |3 +-
 arch/arm/plat-s5pc1xx/cpu.c|5 +
 arch/arm/plat-s5pc1xx/gpio-config.c|   61 +++
 arch/arm/plat-s5pc1xx/gpiolib.c|  503 
 .../plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h   |   33 ++
 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, 1288 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

diff --git a/arch/arm/plat-s3c/Kconfig b/arch/arm/plat-s3c/Kconfig
index 8931c5f..f155a84 100644
--- a/arch/arm/plat-s3c/Kconfig
+++ b/arch/arm/plat-s3c/Kconfig
@@ -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
diff --git a/arch/arm/plat-s3c/include/plat/gpio-cfg.h 
b/arch/arm/plat-s3c/include/plat/gpio-cfg.h
index 29cd6a8..7e73429 100644
--- a/arch/arm/plat-s3c/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-s3c/include/plat/gpio-cfg.h
@@ -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)
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index a8a711c..86edd27 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -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
 
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index ebbf364..f126951 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -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
 
diff --git a/arch/arm/plat-s5pc1xx/cpu.c b/arch/arm/plat-s5pc1xx/cpu.c
index e8f3472..02baeaa 100644
--- a/arch/arm/plat-s5pc1xx/cpu.c
+++ b/arch/arm/plat-s5pc1xx/cpu.c
@@ -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,
diff --git a/arch/arm/plat-s5pc1xx/gpio-config.c 
b/arch/arm/plat-s5pc1xx/gpio-config.c
new file mode 100644
index 000..b911475
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/gpio-config.c
@@ -0,0 +1,61 @@
+/* linux/arch/arm/plat-s5pc1xx/gpio-config.c
+ *
+ * Copyright 2009 Samsung Electronics
+ * InKi Dae  inki@samsung.com
+ *
+ * S5PC110 GPIO Configuration.
+ *
+ * This program is free software; you can redistribute it and/or modify

[PATCH] Update Samsung S5PC100 SoC support

2009-11-12 Thread 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.

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
--
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 06/18] ARM: S5PC1XX: GPIO registers rename

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

From: Kyungmin Park kyungmin.p...@samsung.com

S5PC100 and S5PC110 GPIO registers differs in many places, rename all
previously defined registers to be S5PC100 specific.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc100/include/mach/gpio.h |  244 ++--
 1 files changed, 122 insertions(+), 122 deletions(-)

diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h 
b/arch/arm/mach-s5pc100/include/mach/gpio.h
index 5d22961..2c4cbe8 100644
--- a/arch/arm/mach-s5pc100/include/mach/gpio.h
+++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
@@ -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

[PATCH 14/18] SMDKC100: add I2C0 and I2C1 buses support

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

From: Kyungmin Park kyungmin.p...@samsung.com

Add required machine definitions for I2C 0 and 1 bus controllers.
Currently no I2C device are defined yet.

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/mach-smdkc100.c |   17 +
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 5e6b9a3..36e7e00 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -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
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c 
b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 098956d..2c0119f 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -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 */
-- 
1.6.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


[PATCH 15/18] drivers: i2c: s3c2410-i2c also on S5PC1XX platform

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

From: Kyungmin Park kyungmin.p...@samsung.com

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.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 drivers/i2c/busses/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 737335f..5b173f3 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -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.
-- 
1.6.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


[PATCH 07/18] ARM: S5PC1xx: add gpiolib and external/gpio interrupt support

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

From: Kyungmin Park kyungmin.p...@samsung.com

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 kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 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

diff --git a/arch/arm/plat-s3c/Kconfig b/arch/arm/plat-s3c/Kconfig
index 8931c5f..f155a84 100644
--- a/arch/arm/plat-s3c/Kconfig
+++ b/arch/arm/plat-s3c/Kconfig
@@ -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
diff --git a/arch/arm/plat-s3c/include/plat/gpio-cfg.h 
b/arch/arm/plat-s3c/include/plat/gpio-cfg.h
index 29cd6a8..7e73429 100644
--- a/arch/arm/plat-s3c/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-s3c/include/plat/gpio-cfg.h
@@ -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)
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index a8a711c..86edd27 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -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
 
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index ebbf364..e860813 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -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
diff --git a/arch/arm/plat-s5pc1xx/cpu.c b/arch/arm/plat-s5pc1xx/cpu.c
index e8f3472..02baeaa 100644
--- a/arch/arm/plat-s5pc1xx/cpu.c
+++ b/arch/arm/plat-s5pc1xx/cpu.c
@@ -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,
diff --git a/arch/arm/plat-s5pc1xx/gpio-config.c 
b/arch/arm/plat-s5pc1xx/gpio-config.c
new file mode 100644

RE: [PATCH v3] Update Samsung S5PC100 SoC support

2009-11-18 Thread Marek Szyprowski
Hello,

On Wednesday, November 18, 2009 12:59 AM Ben Dooks wrote:

 On Tue, Nov 17, 2009 at 08:41:10AM +0100, Marek Szyprowski wrote:
  Hello,
 
 ok, series applied and pushed to git.fluff.org.
 
 Will do a quick build test and then get on with other stuff.

Thanks. Let me know if you get any problems.

Best regards
--
Marek Szyprowski
Samsung Poland RD Center


--
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] Add Samsung S5PC110 SoC support

2009-11-18 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.

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 know that Ben is working hard on new Samsung SoC platform framework,
but stabilizing it and porting all the existing Samsung platforms would
take time. This sub-platform solution is already prepared and until the
new framework will be available and merged, we would like to use our
approach.

This patch series includes:

[PATCH 01/19] ARM: S5PC100: use 0x30008000 as memory base
[PATCH 02/19] ARM: S5PC1XX: create sub-platform for S5PC100 SoCs
[PATCH 03/19] ARM: S5PC1XX: prepare common cpuclocks code for S5PC110 
sub-platform
[PATCH 04/19] ARM: S5PC1XX: prepare common gpiolib code for S5PC110 sub-platform
[PATCH 05/19] ARM: S5PC1XX: move common s5pc1xx mach/* includes to 
plat-s5pc1xx/include/mach
[PATCH 06/19] ARM: S5PC1XX: cleanup of s5pc1xx common code
[PATCH 07/19] ARM: S5PC1XX: move s5pc100 specific device helpers to 
mach-s5pc100 dir
[PATCH 08/19] ARM: S5PC1XX: move common s5pc1xx s3c-fb regs to platform 
directory
[PATCH 09/19] drivers: serial: add support for Samsung S5PC110 SoC uart
[PATCH 10/19] ARM: S5PC1XX: add S5PC110 memory map
[PATCH 11/19] ARM: S5PC1XX: add S5PC110 cpu initialization code
[PATCH 12/19] ARM: S5PC1XX: add support for s5pc110 plls and clocks
[PATCH 13/19] ARM: S5PC1XX: add support for s5pc110 irqs
[PATCH 14/19] ARM: S5PC1XX: add support for s5pc110 gpio
[PATCH 15/19] ARM: S5PC1XX: add i2c platform helpers on s5pc110 sub-platform
[PATCH 16/19] ARM: S5PC1XX: enable S5PC110 sub-platform
[PATCH 17/19] ARM: S5PC1XX: add sdhci platform helpers for s5pc110 sub-platform
[PATCH 18/19] ARM: S5PC1XX: add framebuffer platform helpers for s5pc110 
sub-platform
[PATCH 19/19] ARM: S5PC1XX: add support for SMDKC110 board
--
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 06/19] ARM: S5PC1XX: cleanup of s5pc1xx common code

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

This patch removes all useless definitions from plat/s5pc100.h and
introduces new common plat/s5pc1xx.h include.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@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/plat-s5pc1xx/cpu.c |2 +-
 arch/arm/plat-s5pc1xx/include/plat/s5pc100.h|   51 ++-
 arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h|   21 +
 arch/arm/plat-s5pc1xx/s5pc100-init.c|7 ++-
 arch/arm/plat-s5pc1xx/s5pc100-plls.c|2 +-
 8 files changed, 46 insertions(+), 49 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/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 *mach_desc, int size);
-
-/* Some day, belows will be moved to plat-s5pc/include/plat/clock.h */
-extern struct clk clk_hpll;
-extern struct clk clk_hd0;
-extern struct clk clk_pd0;
+extern  int s5pc100_sclk0_ctrl(struct clk *clk, int enable);
+extern  int s5pc100_sclk1_ctrl(struct clk *clk, int enable);
 extern struct clk clk_54m;
-extern void s5pc1xx_register_clocks(void);
-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[];
-extern struct platform_device s3c_device_g2d;
-extern struct platform_device s3c_device_g3d;
-extern struct platform_device s3c_device_vpp;
-extern struct platform_device s3c_device_tvenc;
-extern struct platform_device s3c_device_tvscaler;
-extern struct platform_device s3c_device_rotator;
-extern struct platform_device s3c_device_jpeg;
-extern struct platform_device s3c_device_onenand;
-extern struct platform_device s3c_device_usb_otghcd;
-extern struct platform_device

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

2009-11-18 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/cpu.c|6 ++
 arch/arm/mach-s5pc100/include/mach/map.h   |2 ++
 .../include/plat/regs-clock.h  |2 +-
 .../include/plat/regs-power.h  |2 +-
 arch/arm/plat-s5pc1xx/Makefile |3 +--
 arch/arm/plat-s5pc1xx/cpu.c|   18 ++
 .../arm/plat-s5pc1xx/{clock.c = s5pc100-clocks.c} |4 ++--
 .../{s5pc100-clock.c = s5pc100-plls.c}|2 +-
 8 files changed, 20 insertions(+), 19 deletions(-)
 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/{clock.c = s5pc100-clocks.c} (99%)
 rename arch/arm/plat-s5pc1xx/{s5pc100-clock.c = s5pc100-plls.c} (99%)

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
  * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-power.h 
b/arch/arm/mach-s5pc100/include/plat/regs-power.h
similarity index 98%
rename from arch/arm/plat-s5pc1xx/include/plat/regs-power.h
rename to arch/arm/mach-s5pc100/include/plat/regs-power.h
index 02ffa49..50a9679 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/regs-power.h
+++ b/arch/arm/mach-s5pc100/include/plat/regs-power.h
@@ -3,7 +3,7 @@
  * Copyright 2009 Samsung Electronics Co.
  * Jongse Won jongse@samsung.com
  *
- * S5PC1XX clock register definitions
+ * S5PC100 power controll 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
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index 278f268..5da300e 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -14,13 +14,12 @@ obj-:=
 obj-y  += dev-uart.o
 obj-y  += cpu.o
 obj-y  += irq.o irq-gpio.o irq-eint.o
-obj-y  += clock.o
 obj-y  += gpiolib.o
 
 # CPU support
 
 obj-$(CONFIG_CPU_S5PC100_INIT) += s5pc100-init.o
-obj-$(CONFIG_CPU_S5PC100_CLOCK)+= s5pc100-clock.o
+obj-$(CONFIG_CPU_S5PC100_CLOCK)+= s5pc100-plls.o s5pc100-clocks.o
 
 # Device setup
 
diff --git a/arch/arm/plat-s5pc1xx/cpu.c b/arch/arm/plat-s5pc1xx/cpu.c
index 02baeaa..ecd6d38 100644
--- a/arch/arm/plat-s5pc1xx/cpu.c
+++ b/arch/arm/plat-s5pc1xx/cpu.c
@@ -50,18 +50,11 @@ static struct cpu_table

[PATCH 07/19] ARM: S5PC1XX: move s5pc100 specific device helpers to mach-s5pc100 dir

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

All device helpers that are defined in plat-s5pc1xx are S5PC100
specific. This patch moves them to mach-s5pc100 directory to make use of
newly created sub-platform support.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com

---
 arch/arm/mach-s5pc100/Kconfig  |   32 +--
 arch/arm/mach-s5pc100/Makefile |4 ++
 .../setup-fb-24bpp.c   |0
 .../{plat-s5pc1xx = mach-s5pc100}/setup-i2c0.c|0
 .../{plat-s5pc1xx = mach-s5pc100}/setup-i2c1.c|0
 .../setup-sdhci-gpio.c |0
 arch/arm/plat-s5pc1xx/Kconfig  |   24 ---
 arch/arm/plat-s5pc1xx/Makefile |4 --
 8 files changed, 32 insertions(+), 32 deletions(-)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/setup-fb-24bpp.c (100%)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/setup-i2c0.c (100%)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/setup-i2c1.c (100%)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/setup-sdhci-gpio.c (100%)

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index d72f881..7f73353 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -16,12 +16,36 @@ config CPU_S5PC100
help
  Enable S5PC100 CPU support
 
+config S5PC100_SETUP_FB_24BPP
+   bool
+   help
+  Common setup code for S5PC1XX with an 24bpp RGB display helper.
+
+config S5PC100_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 S5PC100_SETUP_I2C1
+   bool
+   help
+ Common setup code for i2c bus 1.
+
 config S5PC100_SETUP_SDHCI
 bool
-select S5PC1XX_SETUP_SDHCI_GPIO
+select S5PC100_SETUP_SDHCI_GPIO
 help
   Internal helper functions for S5PC100 based SDHCI systems
 
+config S5PC100_SETUP_SDHCI_GPIO
+   bool
+   help
+ Common setup code for SDHCI gpio.
+
 config MACH_SMDKC100
bool SMDKC100
select CPU_S5PC100
@@ -30,9 +54,9 @@ config MACH_SMDKC100
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_I2C0
+   select S5PC100_SETUP_I2C1
+   select S5PC100_SETUP_FB_24BPP
select S5PC100_SETUP_SDHCI
help
  Machine support for the Samsung SMDKC100
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index 809ff10..8846169 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -15,7 +15,11 @@ obj-$(CONFIG_CPU_S5PC100)+= cpu.o
 
 # Helper and device support
 
+obj-$(CONFIG_S5PC100_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_S5PC100_SETUP_SDHCI)   += setup-sdhci.o
+obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 
 # machine support
 obj-$(CONFIG_MACH_SMDKC100)+= mach-smdkc100.o
diff --git a/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c 
b/arch/arm/mach-s5pc100/setup-fb-24bpp.c
similarity index 100%
rename from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
rename to arch/arm/mach-s5pc100/setup-fb-24bpp.c
diff --git a/arch/arm/plat-s5pc1xx/setup-i2c0.c 
b/arch/arm/mach-s5pc100/setup-i2c0.c
similarity index 100%
rename from arch/arm/plat-s5pc1xx/setup-i2c0.c
rename to arch/arm/mach-s5pc100/setup-i2c0.c
diff --git a/arch/arm/plat-s5pc1xx/setup-i2c1.c 
b/arch/arm/mach-s5pc100/setup-i2c1.c
similarity index 100%
rename from arch/arm/plat-s5pc1xx/setup-i2c1.c
rename to arch/arm/mach-s5pc100/setup-i2c1.c
diff --git a/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c 
b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
similarity index 100%
rename from arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
rename to arch/arm/mach-s5pc100/setup-sdhci-gpio.c
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index eee2abb..9f76a9b 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -47,28 +47,4 @@ 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 S5PC1XX_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 S5PC1XX_SETUP_I2C1
-   bool
-   help
- Common setup code for i2c bus 1.
-
-config S5PC1XX_SETUP_SDHCI_GPIO
-   bool
-   help

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

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

From: Pawel Osciak p.osc...@samsung.com

Frame buffer register block on S5PC100 and S5PC110 differs 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: 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 ++---
 arch/arm/plat-s3c/include/plat/regs-fb-v5.h  |  138 ++
 2 files changed, 146 insertions(+), 125 deletions(-)
 create mode 100644 arch/arm/plat-s3c/include/plat/regs-fb-v5.h

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   (0x244)
-#define

[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)
+{
+   s3c_gpio_cfgpin

[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


RE: S5PC1XX clocki fixes

2010-01-12 Thread Marek Szyprowski
Hello,

On Tuesday, January 12, 2010 5:20 AM Ben Dooks wrote:

 Initial set of S5PC1XX clock fixes, two temporary patches in this series
 to allow it to build which will go away once the parent patches are fixed.
 
 Currently only build tested.
 
Thanks for your patches! I was about to send similar patches for S5PC100 today,
but had some issues left to resolve. I've tested your patches and there is some
regression. Kernel fails to boot trying to dereference NULL pointer. I will
sort this out asap.

I will also update S5PC110 patches to use as much as possible from new common
plat-samsung framework.

Best regards
--
Marek Szyprowski
Samsung Poland RD Center

--
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


RE: [PATCH] ARM: S5PC1XX: Move to using standard timer IRQ handling code

2010-01-12 Thread Marek Szyprowski
Hello,

On Tuesday, January 12, 2010 6:21 AM Ben Dooks wrote:

 Move to using the standard VIC/Timer IRQ handling code added previously\
 to avoid duplicating code.
 
 Signed-off-by: Ben Dooks ben-li...@fluff.org
 ---
  arch/arm/mach-s5pc100/include/mach/tick.h |2 +-
  arch/arm/plat-s5pc1xx/Kconfig |2 +
  arch/arm/plat-s5pc1xx/include/plat/irqs.h |   19 --
  arch/arm/plat-s5pc1xx/irq.c   |   88 ++--
  4 files changed, 23 insertions(+), 88 deletions(-)
 
 diff --git a/arch/arm/mach-s5pc100/include/mach/tick.h 
 b/arch/arm/mach-s5pc100/include/mach/tick.h
 index d3de0f3..f338c9e 100644
 --- a/arch/arm/mach-s5pc100/include/mach/tick.h
 +++ b/arch/arm/mach-s5pc100/include/mach/tick.h
 @@ -21,7 +21,7 @@
  static inline u32 s3c24xx_ostimer_pending(void)
  {
   u32 pend = __raw_readl(S3C_VA_VIC0 + VIC_RAW_STATUS);
 - return pend  1  (IRQ_TIMER4 - S5PC1XX_IRQ_VIC0(0));
 + return pend  1  (IRQ_TIMER4_VIC - S5PC1XX_IRQ_VIC0(0));
  }
 
  #define TICK_MAX (0x)
 diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
 index 5d97b1c..6438bcd 100644
 --- a/arch/arm/plat-s5pc1xx/Kconfig
 +++ b/arch/arm/plat-s5pc1xx/Kconfig
 @@ -12,11 +12,13 @@ config PLAT_S5PC1XX
   select NO_IOPORT
   select ARCH_REQUIRE_GPIOLIB
   select SAMSUNG_CLKSRC
 + select SAMSUNG_IRQ_VIC_TIMER
   select S3C_GPIO_TRACK
   select S3C_GPIO_PULL_UPDOWN
   select S3C_GPIO_CFG_S3C24XX
   select S3C_GPIO_CFG_S3C64XX
   select S5P_GPIO_CFG_S5PC1XX
 + select SAMSUNG_IRQ_VIC_TIMER
   help
 Base platform code for any Samsung S5PC1XX device

Double entry (probably a consequence of automatic merge or so).

 ...

Best regards
--
Marek Szyprowski
Samsung Poland RD Center

--
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


RE: [PATCH] ARM: S5PC1XX: Remove definitions deleted by previous clksrc changes

2010-01-12 Thread Marek Szyprowski
Hello,

On Tuesday, January 12, 2010 5:20 AM Ben Dooks wrote:

 From: Ben Dooks ben-li...@fluff.org
 
 Remove the definitions we've deleted in the previous updates to the
 clksrc_clk for arch/arm/plat-s5pc1xx/include/plat/regs-clock.h.
 
 Signed-off-by: Ben Dooks ben-li...@fluff.org
 ---
  arch/arm/plat-s5pc1xx/include/plat/regs-clock.h |   60 
 ---
  1 files changed, 0 insertions(+), 60 deletions(-)
 
 diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h b/arch/arm/plat-
 s5pc1xx/include/plat/regs-clock.h
 index c5cc86e..e88562e 100644
 --- a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
 +++ b/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
 @@ -62,53 +62,16 @@
  #define S5PC100_EPLLVAL(_m, _p, _s)  ((_m)  16 | ((_p)  8) | ((_s)))
 
  /* CLKSRC0 */
 -#define S5PC100_CLKSRC0_APLL_MASK(0x10)
 -#define S5PC100_CLKSRC0_APLL_SHIFT   (0)
 -#define S5PC100_CLKSRC0_MPLL_MASK(0x14)
 -#define S5PC100_CLKSRC0_MPLL_SHIFT   (4)
 -#define S5PC100_CLKSRC0_EPLL_MASK(0x18)
 -#define S5PC100_CLKSRC0_EPLL_SHIFT   (8)
 -#define S5PC100_CLKSRC0_HPLL_MASK(0x112)
 -#define S5PC100_CLKSRC0_HPLL_SHIFT   (12)
 -#define S5PC100_CLKSRC0_AMMUX_MASK   (0x116)
 -#define S5PC100_CLKSRC0_AMMUX_SHIFT  (16)
  #define S5PC100_CLKSRC0_HREF_MASK(0x120)
  #define S5PC100_CLKSRC0_HREF_SHIFT   (20)
 -#define S5PC100_CLKSRC0_ONENAND_MASK (0x124)
 -#define S5PC100_CLKSRC0_ONENAND_SHIFT(24)
 ...
  /* CLKDIV2 */
  #define S5PC100_CLKDIV2_UART_MASK(0x70)
 -#define S5PC100_CLKDIV2_UART_SHIFT   (0)
  #define S5PC100_CLKDIV2_SPI0_MASK(0xf4)
 -#define S5PC100_CLKDIV2_SPI0_SHIFT   (4)
  #define S5PC100_CLKDIV2_SPI1_MASK(0xf8)
 -#define S5PC100_CLKDIV2_SPI1_SHIFT   (8)
  #define S5PC100_CLKDIV2_SPI2_MASK(0xf12)
 -#define S5PC100_CLKDIV2_SPI2_SHIFT   (12)
  #define S5PC100_CLKDIV2_IRDA_MASK(0xf16)
  #define S5PC100_CLKDIV2_IRDA_SHIFT   (16)
  #define S5PC100_CLKDIV2_UHOST_MASK   (0xf20)
 -#define S5PC100_CLKDIV2_UHOST_SHIFT  (20)

 ...

IMHO it is not a good idea to remove these defines selectively. Header
would look strange and one might conclude that something is missing.

Removing all of them is also a bad idea, because some important
information is lost in such case (it would be harder to add missing
clocks to the system). Half of these defines are redundant anyway,
so maybe we should leave only *_MASK defines for informational purpose? 

Best regards
--
Marek Szyprowski
Samsung Poland RD Center

--
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 06/21] ARM: S5PC1XX: move common s5pc1xx mach/* includes to plat-s5pc1xx/include/mach

2010-01-14 Thread Marek Szyprowski
From: Kyungmin Park kyungmin.p...@samsung.com

All includes that are common for S5PC100 and S5PC110 are moved to
plat-s5pc1xx/include/mach, so they can be used by both sub-platforms.

Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc100/include/mach/gpio-core.h  |   21 -
 arch/arm/mach-s5pc100/include/mach/hardware.h   |   14 --
 arch/arm/mach-s5pc100/include/mach/irqs.h   |   19 
 arch/arm/mach-s5pc100/include/mach/memory.h |   18 ---
 arch/arm/mach-s5pc100/include/mach/pwm-clock.h  |   56 ---
 arch/arm/mach-s5pc100/include/mach/tick.h   |   29 
 arch/arm/mach-s5pc100/include/mach/uncompress.h |   28 ---
 arch/arm/plat-s5pc1xx/include/mach/gpio-core.h  |   21 +
 arch/arm/plat-s5pc1xx/include/mach/hardware.h   |   14 ++
 arch/arm/plat-s5pc1xx/include/mach/irqs.h   |   19 
 arch/arm/plat-s5pc1xx/include/mach/memory.h |   18 +++
 arch/arm/plat-s5pc1xx/include/mach/pwm-clock.h  |   56 +++
 arch/arm/plat-s5pc1xx/include/mach/tick.h   |   29 
 arch/arm/plat-s5pc1xx/include/mach/uncompress.h |   28 +++
 14 files changed, 185 insertions(+), 185 deletions(-)
 delete mode 100644 arch/arm/mach-s5pc100/include/mach/gpio-core.h
 delete mode 100644 arch/arm/mach-s5pc100/include/mach/hardware.h
 delete mode 100644 arch/arm/mach-s5pc100/include/mach/irqs.h
 delete mode 100644 arch/arm/mach-s5pc100/include/mach/memory.h
 delete mode 100644 arch/arm/mach-s5pc100/include/mach/pwm-clock.h
 delete mode 100644 arch/arm/mach-s5pc100/include/mach/tick.h
 delete mode 100644 arch/arm/mach-s5pc100/include/mach/uncompress.h
 create mode 100644 arch/arm/plat-s5pc1xx/include/mach/gpio-core.h
 create mode 100644 arch/arm/plat-s5pc1xx/include/mach/hardware.h
 create mode 100644 arch/arm/plat-s5pc1xx/include/mach/irqs.h
 create mode 100644 arch/arm/plat-s5pc1xx/include/mach/memory.h
 create mode 100644 arch/arm/plat-s5pc1xx/include/mach/pwm-clock.h
 create mode 100644 arch/arm/plat-s5pc1xx/include/mach/tick.h
 create mode 100644 arch/arm/plat-s5pc1xx/include/mach/uncompress.h

diff --git a/arch/arm/mach-s5pc100/include/mach/gpio-core.h 
b/arch/arm/mach-s5pc100/include/mach/gpio-core.h
deleted file mode 100644
index ad28d8e..000
--- a/arch/arm/mach-s5pc100/include/mach/gpio-core.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* arch/arm/mach-s5pc100/include/mach/gpio-core.h
- *
- * Copyright 2009 Samsung Electronics Co.
- *  Byungho Min bh...@samsung.com
- *
- * S5PC100 - GPIO core support
- *
- * Based on mach-s3c6400/include/mach/gpio-core.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.
-*/
-
-#ifndef __ASM_ARCH_GPIO_CORE_H
-#define __ASM_ARCH_GPIO_CORE_H __FILE__
-
-/* currently we just include the platform support */
-#include plat/gpio-core.h
-
-#endif /* __ASM_ARCH_GPIO_CORE_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/hardware.h 
b/arch/arm/mach-s5pc100/include/mach/hardware.h
deleted file mode 100644
index 6b38618..000
--- a/arch/arm/mach-s5pc100/include/mach/hardware.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* linux/arch/arm/mach-s5pc100/include/mach/hardware.h
- *
- * Copyright 2009 Samsung Electronics Co.
- *  Byungho Min bh...@samsung.com
- *
- * S5PC100 - Hardware support
- */
-
-#ifndef __ASM_ARCH_HARDWARE_H
-#define __ASM_ARCH_HARDWARE_H __FILE__
-
-/* currently nothing here, placeholder */
-
-#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h 
b/arch/arm/mach-s5pc100/include/mach/irqs.h
deleted file mode 100644
index b53fa48..000
--- a/arch/arm/mach-s5pc100/include/mach/irqs.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* linux/arch/arm/mach-s5pc100/include/mach/irqs.h
- *
- * Copyright 2009 Samsung Electronics Co.
- *  Byungho Min bh...@samsung.com
- *
- * S5PC100 - IRQ definitions
- */
-
-#ifndef __ASM_ARCH_IRQS_H
-#define __ASM_ARCH_IRQS_H __FILE__
-
-#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 */
diff --git a/arch/arm/mach-s5pc100/include/mach/memory.h 
b/arch/arm/mach-s5pc100/include/mach/memory.h
deleted file mode 100644
index 21cc182..000
--- a/arch/arm/mach-s5pc100/include/mach/memory.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* arch/arm/mach-s5pc100/include/mach/memory.h
- *
- * Copyright 2008 Samsung Electronics Co.
- *  Byungho Min bh...@samsung.com
- *
- * Based on mach-s3c6400/include/mach/memory.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.
-*/
-
-#ifndef __ASM_ARCH_MEMORY_H
-#define __ASM_ARCH_MEMORY_H

[PATCH 10/21] drivers: serial: add support for Samsung S5PC110 SoC uart

2010-01-14 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 85d8904..f38b852 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 b8158a5..228f25f 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -533,6 +533,13 @@ config SERIAL_S3C6400
  Serial port support for the Samsung S3C6400, S3C6410 and
  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 ce8c17f..02328c5 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -44,6 +44,7 @@ obj-$(CONFIG_SERIAL_S3C2412) += s3c2412.o
 obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o
 obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o
 obj-$(CONFIG_SERIAL_S3C6400) += 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

[PATCH 13/21] ARM: S5PC1XX: add support for s5pc110 plls and clocks

2010-01-14 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 clocks and plls definition for S5PC110 SoCs.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Byungho Min bh...@samsung.com
---
 arch/arm/mach-s5pc100/plls.c|8 +-
 arch/arm/mach-s5pc110/Makefile  |3 +
 arch/arm/mach-s5pc110/clocks.c  |  249 ++
 arch/arm/mach-s5pc110/cpu.c |3 +
 arch/arm/mach-s5pc110/include/plat/regs-clock.h |  347 +
 arch/arm/mach-s5pc110/plls.c|  944 +++
 arch/arm/plat-s5pc1xx/include/plat/pll.h|8 +-
 arch/arm/plat-s5pc1xx/include/plat/s5pc110.h|   19 +
 8 files changed, 1575 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/mach-s5pc110/clocks.c
 create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-clock.h
 create mode 100644 arch/arm/mach-s5pc110/plls.c

diff --git a/arch/arm/mach-s5pc100/plls.c b/arch/arm/mach-s5pc100/plls.c
index 32fb0ca..fcef615 100644
--- a/arch/arm/mach-s5pc100/plls.c
+++ b/arch/arm/mach-s5pc100/plls.c
@@ -788,10 +788,10 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 
printk(KERN_DEBUG %s: xtal is %ld\n, __func__, xtal);
 
-   apll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_APLL_CON));
-   mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_MPLL_CON));
-   epll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_EPLL_CON));
-   hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_HPLL_CON));
+   apll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_APLL_CON), 0);
+   mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_MPLL_CON), 0);
+   epll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_EPLL_CON), 0);
+   hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_HPLL_CON), 0);
 
printk(KERN_INFO S5PC100: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz
, Epll=%ld.%03ld Mhz, Hpll=%ld.%03ld Mhz\n,
diff --git a/arch/arm/mach-s5pc110/Makefile b/arch/arm/mach-s5pc110/Makefile
index d9fecf0..4dfb306 100644
--- a/arch/arm/mach-s5pc110/Makefile
+++ b/arch/arm/mach-s5pc110/Makefile
@@ -12,6 +12,9 @@ obj-:=
 # Core support for S5PC110 system
 
 obj-$(CONFIG_CPU_S5PC110)  += cpu.o
+obj-$(CONFIG_CPU_S5PC110)  += clocks.o
+obj-$(CONFIG_CPU_S5PC110)  += plls.o
+obj-$(CONFIG_CPU_S5PC110)  += uarts.o
 
 # Helper and device support
 
diff --git a/arch/arm/mach-s5pc110/clocks.c b/arch/arm/mach-s5pc110/clocks.c
new file mode 100644
index 000..75cf28e
--- /dev/null
+++ b/arch/arm/mach-s5pc110/clocks.c
@@ -0,0 +1,249 @@
+/* linux/arch/arm/mach-s5pc110/clocks.c
+ *
+ * Copyright 2009 Samsung Electronics Co.
+ *
+ * S5PC110 - Clocks support
+ *
+ * Based on plat-s3c64xx/clock.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/init.h
+#include linux/module.h
+#include linux/interrupt.h
+#include linux/ioport.h
+#include linux/clk.h
+#include linux/io.h
+
+#include mach/hardware.h
+#include mach/map.h
+
+#include plat/regs-clock.h
+#include plat/devs.h
+#include plat/clock.h
+#include plat/s5pc110.h
+
+struct clk clk_27m = {
+   .name   = clk_27m,
+   .id = -1,
+   .rate   = 2700,
+};
+
+struct clk clk_48m = {
+   .name   = clk_48m,
+   .id = -1,
+   .rate   = 4800,
+};
+
+struct clk clk_54m = {
+   .name   = clk_54m,
+   .id = -1,
+   .rate   = 5400,
+};
+
+struct clk clk_30m = {
+   .name   = clk_30m,
+   .id = -1,
+   .rate   = 3000,
+};
+
+static int s5pc1xx_clk_gate(void __iomem *reg, struct clk *clk, int enable)
+{
+   unsigned int ctrlbit = clk-ctrlbit;
+   u32 con;
+
+   con = __raw_readl(reg);
+   if (enable)
+   con |= ctrlbit;
+   else
+   con = ~ctrlbit;
+   __raw_writel(con, reg);
+
+   return 0;
+}
+
+int s5pc110_ip0_ctrl(struct clk *clk, int enable)
+{
+   return s5pc1xx_clk_gate(S5PC110_CLKGATE_IP0, clk, enable);
+}
+
+int s5pc110_ip1_ctrl(struct clk *clk, int enable)
+{
+   return s5pc1xx_clk_gate(S5PC110_CLKGATE_IP1, clk, enable);
+}
+
+int s5pc110_ip2_ctrl(struct clk *clk, int enable)
+{
+   return s5pc1xx_clk_gate(S5PC110_CLKGATE_IP2, clk, enable);
+}
+
+int s5pc110_ip3_ctrl(struct clk *clk, int enable)
+{
+   return s5pc1xx_clk_gate(S5PC110_CLKGATE_IP3, clk, enable);
+}
+
+int s5pc110_ip4_ctrl(struct clk *clk, int enable)
+{
+   return s5pc1xx_clk_gate(S5PC110_CLKGATE_IP4, clk, enable);
+}
+
+static struct clk s5pc110_soc_init_clocks_disable[] = {
+   {
+   .name

[PATCH 12/21] ARM: S5PC1XX: add S5PC110 cpu initialization code

2010-01-14 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 16/21] ARM: S5PC1XX: add i2c platform helpers on s5pc110 sub-platform

2010-01-14 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 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/include/plat/iic.h |2 +
 arch/arm/plat-samsung/Kconfig|5 ++
 arch/arm/plat-samsung/Makefile   |1 +
 arch/arm/plat-samsung/dev-i2c2.c |   69 ++
 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-samsung/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)
+{
+   s3c_gpio_cfgpin(S5PC110_GPD1(2), S3C_GPIO_SFN(2

RE: SAMSUNG kernel tree merge plans

2010-05-06 Thread Marek Szyprowski
Hello,

On Thursday, May 06, 2010 7:47 AM Ben Dooks wrote:

 I'm busy sorting out the trees for the next mege window, and should
 have a new next-samsung out in the next two or three days.
 
 As such, if there is anything that needs to go via Russell's tree, then
 it needs to be merged as soon as possible. I would like to send a pull
 before Wednesday.
 
 Anything else, if it is not merged into one of my trees by the end of
 next week (May 14th) then there is no guarantees that it will be merged.
 
 If everyone interested in this could check my trees after the weekend and
 make any reminders of other stuff to fix at that point as there is still
 items being processed.
 
 http://git.fluff.org/gitweb?p=bjdooks/linux.git;a=summary

We would really like to merge as much as possible from our current
development tree:
http://git.infradead.org/users/kmpark/linux-2.6-samsung/shortlog/refs/heads/SPRC-2.6.34-rc5-opensource

Some of the patches that we depend on are still in the review phase (s5p 
timer), some should be replaced by the ones that were
posted recently. Especially most of our patches depend on S5PV210 GPIO support, 
so without it we cannot go further. Is there any
chance to get it merged quickly? I will rebase our tree asap the mentioned 
patches get merged.

Best regards
--
Marek Szyprowski
Samsung Poland RD Center

--
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


RE: SAMSUNG kernel tree merge plans

2010-05-11 Thread Marek Szyprowski
Hello,

On Monday, May 10, 2010 5:50 AM Ben Dooks wrote:

  We would really like to merge as much as possible from our current
  development tree:
  http://git.infradead.org/users/kmpark/linux-2.6-
 samsung/shortlog/refs/heads/SPRC-2.6.34-rc5-opensource
 
  Some of the patches that we depend on are still in the review phase (s5p
 timer), some should be replaced by the ones that were
  posted recently. Especially most of our patches depend on S5PV210 GPIO
 support, so without it we cannot go further. Is there any
  chance to get it merged quickly? I will rebase our tree asap the
 mentioned patches get merged.
 
 I'll sort out what can be merged from the items on the list, but I'm
 not going git-tree diving just at the moment. The firstset will be
 stuff for Russell's tree, for linus' tree there is a ltitle more time
 to get prepared.

Ok, I understand. I've separated the patches into different categories and
rebased onto your next-samsung. I hope this will help sorting out these
things.

Patches are available at:

http://git.infradead.org/users/kmpark/linux-2.6-samsung

branches:
next-samsung-s5p-fixes - various fixes for s5p SoCs
next-samsung-s5pv210 - new features for s5pv210 SoCs
next-samsung-s5pc1xx - s5pc1xx cleanup (to be discussed)
next-samsung-onenand - platform patch for onenand driver (requires all
above patches)

Best regards
--
Marek Szyprowski
Samsung Poland RD Center



--
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


RE: [PATCH v2] ARM: S5PC100: Pre-requisite clock patch for plat-s5pc1xx to plat-s5p move.

2010-05-13 Thread Marek Szyprowski
Hello,

On Thursday, May 13, 2010 1:35 PM Kukjin Kim wrote:

 From: Thomas Abraham thomas...@samsung.com
 
 This is a pre-requisite clock patch for the plat-s5pc1xx to plat-s5p
 movement. The patches that perform the movement of the code from
 plat-s5pc1xx to plat-s5p (and mach-s5pc100) should also enable the
 build for the mach-s5pc100/clock.c code.
 
 Signed-off-by: Thomas Abraham thomas...@samsung.com
 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
  arch/arm/mach-s5pc100/clock.c   | 1362
 +++
  arch/arm/mach-s5pc100/include/mach/regs-clock.h |   71 ++
  arch/arm/plat-s5p/clock.c   |2 +-
  arch/arm/plat-s5p/include/plat/pll.h|   22 +
  arch/arm/plat-s5p/include/plat/s5p-clock.h  |2 +
  5 files changed, 1459 insertions(+), 1 deletions(-)
  create mode 100755 arch/arm/mach-s5pc100/clock.c
  create mode 100644 arch/arm/mach-s5pc100/include/mach/regs-clock.h
 
 diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c
 new file mode 100755
 index 000..3c9192b
 --- /dev/null
 +++ b/arch/arm/mach-s5pc100/clock.c
 @@ -0,0 +1,1362 @@
 +/* linux/arch/arm/mach-s5pc100/clock.c
 + *
 + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
 + *   http://www.samsung.com/
 + *
 + * S5PC100 - Clock 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/init.h
 +#include linux/module.h
 +#include linux/kernel.h
 +#include linux/list.h
 +#include linux/err.h
 +#include linux/clk.h
 +#include linux/io.h
 +
 +#include mach/map.h
 +
 +#include plat/cpu-freq.h
 +#include mach/regs-clock.h
 +#include plat/clock.h
 +#include plat/cpu.h
 +#include plat/pll.h
 +#include plat/s5p-clock.h
 +#include plat/clock-clksrc.h
 +#include plat/s5pc100.h
 +
 +static struct clk s5p_clk_otgphy = {
 + .name   = otg_phy,
 + .id = -1,
 +};
 +
 +static struct clk *clk_src_mout_href_list[] = {
 + [0] = s5p_clk_27m,
 + [1] = clk_fin_hpll,
 +};
 +
 +static struct clksrc_sources clk_src_mout_href = {
 + .sources= clk_src_mout_href_list,
 + .nr_sources = ARRAY_SIZE(clk_src_mout_href_list),
 +};
 +
 +static struct clksrc_clk clk_mout_href = {
 + .clk = {
 + .name   = mout_href,
 + .id = -1,
 + },
 + .sources= clk_src_mout_href,
 + .reg_src= { .reg = S5P_CLK_SRC0, .shift = 20, .size = 1 },
 +};
 +
 +static struct clk *clk_src_mout_48m_list[] = {
 + [0] = s5p_clk_xusbxti,

s5p_clk_xusbxti clock is not defined anywhere.

 ...

Best regards
--
Marek Szyprowski
Samsung Poland RD Center


--
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


RE: [PATCH v3] ARM: S5PC100: Pre-requisite clock patch for plat-s5pc1xx to plat-s5p move.

2010-05-13 Thread Marek Szyprowski
Hello,

On Friday, May 14, 2010 2:35 AM Kukjin Kim wrote:

 From: Thomas Abraham thomas...@samsung.com
 
 This is a pre-requisite clock patch for the plat-s5pc1xx to plat-s5p
 movement. The patches that perform the movement of the code from
 plat-s5pc1xx to plat-s5p (and mach-s5pc100) should also enable the
 build for the mach-s5pc100/clock.c code.
 
 Signed-off-by: Thomas Abraham thomas...@samsung.com
 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
  arch/arm/mach-s5pc100/clock.c   | 1362
 +++
  arch/arm/mach-s5pc100/include/mach/regs-clock.h |   71 ++
  arch/arm/plat-s5p/clock.c   |2 +-
  arch/arm/plat-s5p/include/plat/pll.h|   22 +
  arch/arm/plat-s5p/include/plat/s5p-clock.h  |2 +
  5 files changed, 1459 insertions(+), 1 deletions(-)
  create mode 100755 arch/arm/mach-s5pc100/clock.c
  create mode 100644 arch/arm/mach-s5pc100/include/mach/regs-clock.h
 
 diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c
 new file mode 100755

Please use 0644 mode for new files, no need to set the 'execute' bit.

 ...

I also got the following compilation warnings:

arch/arm/mach-s5pc100/clock.c:47: warning: 'clk_mout_href' defined but not used
arch/arm/mach-s5pc100/clock.c:400: warning: 's5pc100_d2_0_ctrl' defined but not
used

Besides the above this patch works fine. I will post my redesigned s5pc100 patch
series in a few minutes.

Best regards
--
Marek Szyprowski
Samsung Poland RD Center


--
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


RE: [PATCH v3 2/2] ARM: S5PV210: Add Ext interrupt support

2010-05-13 Thread Marek Szyprowski
  16))
 + s3c_gpio_cfgpin(S5P_EINT_SET1(offs0x7), 0xf((offs0x7)*4));
 +
 + else if ((16 = offs)  (offs  24))
 + s3c_gpio_cfgpin(S5P_EINT_SET2(offs0x7), 0xf((offs0x7)*4));
 +
 + else if ((24 = offs)  (offs  32))
 + s3c_gpio_cfgpin(S5P_EINT_SET3(offs0x7), 0xf((offs0x7)*4));
 +
 + else
 + printk(KERN_ERR No such irq number %d, offs);
 +

This code will be reused for other s5p SoCs - at least s5pc100 should also
use the common external interrupt code.

IMHO it would be better to use some common s5p defines to hide these magic
numbers. What about the similar code from my [PATCH 14/16] ARM: Samsung:
Move external interrupts support from plat-s5pc1xx to plat-s5p patch?
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-April/012618.html

I will be something like this:

switch (offs) {
case 0 ... 7:
gpio = S5P_GPH0(gpio);
break;
case 8 ... 15:
gpio = S5P_GPH1(gpio);
break;
case 16 ... 23:
gpio = S5P_GPH2(gpio);
break;
case 24 ... 31:
gpio = S5P_GPH3(gpio);
break;
default:
return -EINVAL;
}

sfn = S3C_GPIO_SFN_EINT;
s3c_gpio_cfgpin(gpio, sfn);

Please note that the gpio special function value for EINT is different
on s5pc100 and s5pv210 (0x2 vs. 0xf), so hiding this behind a define is
much more convenient.

Best regards
--
Marek Szyprowski
Samsung Poland RD Center


--
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 01/15] ARM: Samsung: fix broken timer irq base

2010-05-14 Thread Marek Szyprowski
Timer interrupts range was defined as 43-47, what overlaps with VIC0 range
(32-64). This was caused probably by a typo while the common interrupts
definition was refactored. This patch moves timer interrupt range to safe
area of 11-15 (just before uart range).

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/plat-s5p/include/plat/irqs.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-s5p/include/plat/irqs.h 
b/arch/arm/plat-s5p/include/plat/irqs.h
index 42e757f..9ff3d71 100644
--- a/arch/arm/plat-s5p/include/plat/irqs.h
+++ b/arch/arm/plat-s5p/include/plat/irqs.h
@@ -79,7 +79,7 @@
 #define S5P_IRQ_VIC2(x)(S5P_VIC2_BASE + (x))
 #define S5P_IRQ_VIC3(x)(S5P_VIC3_BASE + (x))
 
-#define S5P_TIMER_IRQ(x)   S5P_IRQ(11 + (x))
+#define S5P_TIMER_IRQ(x)   (11 + (x))
 
 #define IRQ_TIMER0 S5P_TIMER_IRQ(0)
 #define IRQ_TIMER1 S5P_TIMER_IRQ(1)
-- 
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 02/15] ARM: Samsung: move common I2C0 device helpers to machine directories

2010-05-14 Thread Marek Szyprowski
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5p6440/Makefile   |1 +
 arch/arm/{plat-s5p = mach-s5p6440}/setup-i2c0.c |2 +-
 arch/arm/mach-s5p6442/Makefile   |1 +
 arch/arm/{plat-s5p = mach-s5p6442}/setup-i2c0.c |2 +-
 arch/arm/mach-s5pv210/Makefile   |1 +
 arch/arm/{plat-s5p = mach-s5pv210}/setup-i2c0.c |   10 +-
 arch/arm/plat-s5p/Makefile   |1 -
 7 files changed, 10 insertions(+), 8 deletions(-)
 copy arch/arm/{plat-s5p = mach-s5p6440}/setup-i2c0.c (92%)
 copy arch/arm/{plat-s5p = mach-s5p6442}/setup-i2c0.c (92%)
 rename arch/arm/{plat-s5p = mach-s5pv210}/setup-i2c0.c (69%)

diff --git a/arch/arm/mach-s5p6440/Makefile b/arch/arm/mach-s5p6440/Makefile
index 1ad894b..9646cdf 100644
--- a/arch/arm/mach-s5p6440/Makefile
+++ b/arch/arm/mach-s5p6440/Makefile
@@ -13,6 +13,7 @@ obj-  :=
 # Core support for S5P6440 system
 
 obj-$(CONFIG_CPU_S5P6440)  += cpu.o init.o clock.o gpio.o
+obj-$(CONFIG_CPU_S5P6440)  += setup-i2c0.o
 
 # machine support
 
diff --git a/arch/arm/plat-s5p/setup-i2c0.c b/arch/arm/mach-s5p6440/setup-i2c0.c
similarity index 92%
copy from arch/arm/plat-s5p/setup-i2c0.c
copy to arch/arm/mach-s5p6440/setup-i2c0.c
index 67a66e0..69e8a66 100644
--- a/arch/arm/plat-s5p/setup-i2c0.c
+++ b/arch/arm/mach-s5p6440/setup-i2c0.c
@@ -1,4 +1,4 @@
-/* linux/arch/arm/plat-s5p/setup-i2c0.c
+/* linux/arch/arm/mach-s5p6440/setup-i2c0.c
  *
  * Copyright (c) 2009 Samsung Electronics Co., Ltd.
  * http://www.samsung.com/
diff --git a/arch/arm/mach-s5p6442/Makefile b/arch/arm/mach-s5p6442/Makefile
index dde39a6..4942c14 100644
--- a/arch/arm/mach-s5p6442/Makefile
+++ b/arch/arm/mach-s5p6442/Makefile
@@ -13,6 +13,7 @@ obj-  :=
 # Core support for S5P6442 system
 
 obj-$(CONFIG_CPU_S5P6442)  += cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5P6442)  += setup-i2c0.o
 
 # machine support
 
diff --git a/arch/arm/plat-s5p/setup-i2c0.c b/arch/arm/mach-s5p6442/setup-i2c0.c
similarity index 92%
copy from arch/arm/plat-s5p/setup-i2c0.c
copy to arch/arm/mach-s5p6442/setup-i2c0.c
index 67a66e0..662695d 100644
--- a/arch/arm/plat-s5p/setup-i2c0.c
+++ b/arch/arm/mach-s5p6442/setup-i2c0.c
@@ -1,4 +1,4 @@
-/* linux/arch/arm/plat-s5p/setup-i2c0.c
+/* linux/arch/arm/mach-s5p6442/setup-i2c0.c
  *
  * Copyright (c) 2009 Samsung Electronics Co., Ltd.
  * http://www.samsung.com/
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 8ebf51c..1a972a5 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -13,6 +13,7 @@ obj-  :=
 # Core support for S5PV210 system
 
 obj-$(CONFIG_CPU_S5PV210)  += cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5PV210)  += setup-i2c0.o
 
 # machine support
 
diff --git a/arch/arm/plat-s5p/setup-i2c0.c b/arch/arm/mach-s5pv210/setup-i2c0.c
similarity index 69%
rename from arch/arm/plat-s5p/setup-i2c0.c
rename to arch/arm/mach-s5pv210/setup-i2c0.c
index 67a66e0..27de0c1 100644
--- a/arch/arm/plat-s5p/setup-i2c0.c
+++ b/arch/arm/mach-s5pv210/setup-i2c0.c
@@ -1,11 +1,11 @@
-/* linux/arch/arm/plat-s5p/setup-i2c0.c
+/*
+ * linux/arch/arm/mach-s5pv210/setup-i2c2.c
  *
- * Copyright (c) 2009 Samsung Electronics Co., Ltd.
- * http://www.samsung.com/
+ * Copyright 2009 Samsung Electronics Co.
  *
- * I2C0 GPIO configuration.
+ * Base S5PV210 I2C bus 0 gpio configuration
  *
- * Based on plat-s3c64xx/setup-i2c0.c
+ * Based on mach-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
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index a7c54b3..0ec09a9 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -16,4 +16,3 @@ obj-y += dev-uart.o
 obj-y  += cpu.o
 obj-y  += clock.o
 obj-y  += irq.o
-obj-y  += setup-i2c0.o
-- 
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 05/15] ARM: S5PC100: Use common functions for gpiolib implementation

2010-05-14 Thread Marek Szyprowski
GPIOlib helpers from plat-samsung already have functions for accessing
4bit gpio banks. This patch removes the duplicated functions from
plat-s5pc1xx/gpiolib.c.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/plat-s5pc1xx/Kconfig   |1 +
 arch/arm/plat-s5pc1xx/gpiolib.c |   96 ---
 2 files changed, 10 insertions(+), 87 deletions(-)

diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index 79d3be7..98bbaf9 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -19,6 +19,7 @@ config PLAT_S5PC1XX
select S5P_GPIO_DRVSTR
select S3C_GPIO_CFG_S3C24XX
select S3C_GPIO_CFG_S3C64XX
+   select SAMSUNG_GPIOLIB_4BIT
help
  Base platform code for any Samsung S5PC1XX device
 
diff --git a/arch/arm/plat-s5pc1xx/gpiolib.c b/arch/arm/plat-s5pc1xx/gpiolib.c
index 1ffc57a..5a97a8f 100644
--- a/arch/arm/plat-s5pc1xx/gpiolib.c
+++ b/arch/arm/plat-s5pc1xx/gpiolib.c
@@ -61,74 +61,6 @@
  * L3  8   4BitNone
  */
 
-#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)
- *  = 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);
@@ -452,11 +384,8 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] = {
 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)
+static __init void s5pc100_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) {
@@ -475,26 +404,19 @@ static __init void s5pc1xx_gpiolib_link(struct 
s3c_gpio_chip *chip)
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;
+   struct s3c_gpio_chip *chip;
int nr_chips;
 
-   chips = s5pc100_gpio_chips;
-   nr_chips = ARRAY_SIZE(s5pc100_gpio_chips);
+   chip = s5pc100_gpio_chips;
+   nr_chips = ARRAY_SIZE(s5pc100_gpio_chips);
+
+   for (; nr_chips  0; nr_chips--, chip++)
+   s5pc100_gpiolib_link(chip);
 
-   s5pc1xx_gpiolib_add(chips, nr_chips, s5pc1xx_gpiolib_link);
+   samsung_gpiolib_add_4bit_chips(s5pc100_gpio_chips

[PATCH 13/15] ARM: Samsung: Move external interrupts support from plat-s5pc1xx to plat-s5p

2010-05-14 Thread Marek Szyprowski
This patch moves external interrupts support code from plat-s5pc1xx to
plat-s5p and enables support for it on ARCH_S5PC100. This code can be easily
reused by S5PV210/S5PC110 and probably S5P6442.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc100/Kconfig  |1 +
 arch/arm/mach-s5pc100/gpio.c   |8 ++--
 arch/arm/mach-s5pc100/include/mach/gpio.h  |8 +++
 arch/arm/plat-s5p/Kconfig  |5 ++
 arch/arm/plat-s5p/Makefile |1 +
 arch/arm/plat-s5p/include/plat/gpio-ext.h  |   44 ++
 arch/arm/{plat-s5pc1xx = plat-s5p}/irq-eint.c |   57 
 arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h  |   44 --
 8 files changed, 92 insertions(+), 76 deletions(-)
 create mode 100644 arch/arm/plat-s5p/include/plat/gpio-ext.h
 rename arch/arm/{plat-s5pc1xx = plat-s5p}/irq-eint.c (80%)
 delete mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index a6e21b2..86fe699 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -10,6 +10,7 @@ if ARCH_S5PC100
 config CPU_S5PC100
bool
select PLAT_S5P
+   select S5P_IRQ_EINT
help
  Enable S5PC100 CPU support
 
diff --git a/arch/arm/mach-s5pc100/gpio.c b/arch/arm/mach-s5pc100/gpio.c
index 494a53b..df539f6 100644
--- a/arch/arm/mach-s5pc100/gpio.c
+++ b/arch/arm/mach-s5pc100/gpio.c
@@ -61,7 +61,6 @@
  * L3  8   4BitNone
  */
 
-#if 0
 static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
 {
return S3C_IRQ_GPIO(chip-base + offset);
@@ -85,7 +84,7 @@ static int s5pc100_gpiolib_to_eint(struct gpio_chip *chip, 
unsigned int offset)
return IRQ_EINT(24 + offset);
return -EINVAL;
 }
-#endif
+
 static struct s3c_gpio_cfg gpio_cfg = {
.set_config = s3c_gpio_setcfg_s3c64xx_4bit,
.set_pull   = s3c_gpio_setpull_updown,
@@ -401,9 +400,10 @@ static __init void s5pc100_gpiolib_link(struct 
s3c_gpio_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 = s5pc100_gpiolib_to_eint;
+   } else
 #endif
+   if (chip-config == gpio_cfg_eint)
+   chip-chip.to_irq = s5pc100_gpiolib_to_eint;
 }
 
 static __init int s5pc100_gpiolib_init(void)
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h 
b/arch/arm/mach-s5pc100/include/mach/gpio.h
index fb2f40a..057c47a 100644
--- a/arch/arm/mach-s5pc100/include/mach/gpio.h
+++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
@@ -159,4 +159,12 @@ enum s3c_gpio_number {
 /* define the number of gpios we need to the one after the MP04() range */
 #define ARCH_NR_GPIOS  (S5PC100_GPIO_END + 1)
 
+/* Common compatibility defines */
+#define S5P_GPIO_EINT_SFN  S3C_GPIO_SFN(0x2)
+#define S5P_GPH0(n)S5PC100_GPH0(n)
+#define S5P_GPH1(n)S5PC100_GPH1(n)
+#define S5P_GPH2(n)S5PC100_GPH2(n)
+#define S5P_GPH3(n)S5PC100_GPH3(n)
+#define S5P_GPIO_INT_GROUP_END S5PC100_GPIO_INT_GROUP_END
+
 #include asm-generic/gpio.h
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index 189be6e..09d06a2 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -24,3 +24,8 @@ config PLAT_S5P
select SAMSUNG_IRQ_UART
help
  Base platform code for Samsung's S5P series SoC.
+
+config S5P_IRQ_EINT
+   bool
+   help
+ Common initialisation code for the EINT support on S5P platform
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index 0ec09a9..db4801f 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -16,3 +16,4 @@ obj-y += dev-uart.o
 obj-y  += cpu.o
 obj-y  += clock.o
 obj-y  += irq.o
+obj-$(CONFIG_S5P_IRQ_EINT) += irq-eint.o
diff --git a/arch/arm/plat-s5p/include/plat/gpio-ext.h 
b/arch/arm/plat-s5p/include/plat/gpio-ext.h
new file mode 100644
index 000..b298335
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/gpio-ext.h
@@ -0,0 +1,44 @@
+/* linux/arch/arm/plat-s5p/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 S5P_WKUP_INT_CON0_7(S5P_EINT_BASE + 0x0)
+#define S5P_WKUP_INT_CON8_15   (S5P_EINT_BASE + 0x4)
+#define S5P_WKUP_INT_CON16_23  (S5P_EINT_BASE + 0x8

[PATCH 14/15] ARM: S5PC100: Add support for gpio interrupt

2010-05-14 Thread Marek Szyprowski
This patch moves support for gpio interrupts from plat-s5pc1xx to
mach-s5pc100 directory.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc100/Makefile |2 +-
 arch/arm/mach-s5pc100/gpio.c   |   10 +--
 arch/arm/{plat-s5pc1xx = mach-s5pc100}/irq-gpio.c |   78 ++--
 3 files changed, 44 insertions(+), 46 deletions(-)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/irq-gpio.c (72%)

diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index c51b580..9976269 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -11,7 +11,7 @@ obj-  :=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)  += cpu.o init.o clock.o gpio.o
+obj-$(CONFIG_CPU_S5PC100)  += cpu.o init.o clock.o gpio.o irq-gpio.o
 obj-$(CONFIG_CPU_S5PC100)  += setup-i2c0.o
 
 # Helper and device support
diff --git a/arch/arm/mach-s5pc100/gpio.c b/arch/arm/mach-s5pc100/gpio.c
index df539f6..0fab7f2 100644
--- a/arch/arm/mach-s5pc100/gpio.c
+++ b/arch/arm/mach-s5pc100/gpio.c
@@ -386,7 +386,6 @@ extern void s5pc100_irq_gpioint_handler(unsigned int irq, 
struct irq_desc *desc)
 
 static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
 {
-#if 0
/* Interrupt */
if (chip-config == gpio_cfg) {
int i, irq;
@@ -400,10 +399,9 @@ static __init void s5pc100_gpiolib_link(struct 
s3c_gpio_chip *chip)
set_irq_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID);
}
-   } else
-#endif
-   if (chip-config == gpio_cfg_eint)
+   } else if (chip-config == gpio_cfg_eint) {
chip-chip.to_irq = s5pc100_gpiolib_to_eint;
+   }
 }
 
 static __init int s5pc100_gpiolib_init(void)
@@ -419,10 +417,10 @@ static __init int s5pc100_gpiolib_init(void)
 
samsung_gpiolib_add_4bit_chips(s5pc100_gpio_chips,
   ARRAY_SIZE(s5pc100_gpio_chips));
-#if 0
+
/* Interrupt */
set_irq_chained_handler(IRQ_GPIOINT, s5pc100_irq_gpioint_handler);
-#endif
+
return 0;
 }
 core_initcall(s5pc100_gpiolib_init);
diff --git a/arch/arm/plat-s5pc1xx/irq-gpio.c b/arch/arm/mach-s5pc100/irq-gpio.c
similarity index 72%
rename from arch/arm/plat-s5pc1xx/irq-gpio.c
rename to arch/arm/mach-s5pc100/irq-gpio.c
index fecca7a..2bf86c1 100644
--- a/arch/arm/plat-s5pc1xx/irq-gpio.c
+++ b/arch/arm/mach-s5pc100/irq-gpio.c
@@ -1,9 +1,9 @@
 /*
- * arch/arm/plat-s5pc1xx/irq-gpio.c
+ * arch/arm/mach-s5pc100/irq-gpio.c
  *
  * Copyright (C) 2009 Samsung Electronics
  *
- * S5PC1XX - Interrupt handling for IRQ_GPIO${group}(x)
+ * S5PC100 - 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
@@ -19,7 +19,7 @@
 #include mach/map.h
 #include plat/gpio-cfg.h
 
-#define S5PC1XX_GPIOREG(x) (S5PC1XX_VA_GPIO + (x))
+#define S5P_GPIOREG(x) (S5P_VA_GPIO + (x))
 
 #define CON_OFFSET 0x700
 #define MASK_OFFSET0x900
@@ -49,7 +49,7 @@ static int group_to_pend_offset(int group)
return group  2;
 }
 
-static int s5pc1xx_get_start(unsigned int group)
+static int s5pc100_get_start(unsigned int group)
 {
switch (group) {
case 0: return S5PC100_GPIO_A0_START;
@@ -80,7 +80,7 @@ static int s5pc1xx_get_start(unsigned int group)
return -EINVAL;
 }
 
-static int s5pc1xx_get_group(unsigned int irq)
+static int s5pc100_get_group(unsigned int irq)
 {
irq -= S3C_IRQ_GPIO(0);
 
@@ -134,67 +134,67 @@ static int s5pc1xx_get_group(unsigned int irq)
return -EINVAL;
 }
 
-static int s5pc1xx_get_offset(unsigned int irq)
+static int s5pc100_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)
+static void s5pc100_gpioint_ack(unsigned int irq)
 {
int group, offset, pend_offset;
unsigned int value;
 
-   group = s5pc1xx_get_group(irq);
-   offset = s5pc1xx_get_offset(irq);
+   group = s5pc100_get_group(irq);
+   offset = s5pc100_get_offset(irq);
pend_offset = group_to_pend_offset(group);
 
-   value = __raw_readl(S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset);
+   value = __raw_readl(S5P_GPIOREG(PEND_OFFSET) + pend_offset);
value |= 1  offset;
-   __raw_writel(value, S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset);
+   __raw_writel(value, S5P_GPIOREG(PEND_OFFSET) + pend_offset);
 }
 
-static void s5pc1xx_gpioint_mask(unsigned int irq)
+static void s5pc100_gpioint_mask(unsigned int irq)
 {
int group, offset, mask_offset;
unsigned int value;
 
-   group

[PATCH 03/15] ARM: Samsung: move driver strength gpio configuration helper to common dir

2010-05-14 Thread Marek Szyprowski
Driver strength parameter can be changed not only on S5PC100 but also
on S5PV210/S5PC110 platforms, so move the helper functions to the common
plat-samsung directory.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/plat-s5p/Kconfig  |1 +
 arch/arm/plat-s5pc1xx/Kconfig  |2 +-
 arch/arm/plat-s5pc1xx/Makefile |1 -
 arch/arm/plat-s5pc1xx/gpio-config.c|   62 
 .../plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h   |   32 --
 arch/arm/plat-s5pc1xx/setup-fb-24bpp.c |1 -
 arch/arm/plat-samsung/Kconfig  |   12 ++--
 arch/arm/plat-samsung/gpio-config.c|   48 +++
 arch/arm/plat-samsung/include/plat/gpio-cfg.h  |   30 ++
 9 files changed, 86 insertions(+), 103 deletions(-)
 delete mode 100644 arch/arm/plat-s5pc1xx/gpio-config.c
 delete mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h

diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index d400a6a..92bd756 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -13,6 +13,7 @@ config PLAT_S5P
select NO_IOPORT
select ARCH_REQUIRE_GPIOLIB
select S3C_GPIO_TRACK
+   select S5P_GPIO_DRVSTR
select SAMSUNG_GPIOLIB_4BIT
select S3C_GPIO_CFG_S3C64XX
select S3C_GPIO_PULL_UPDOWN
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index c7ccdf2..79d3be7 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -16,9 +16,9 @@ config PLAT_S5PC1XX
select SAMSUNG_IRQ_VIC_TIMER
select S3C_GPIO_TRACK
select S3C_GPIO_PULL_UPDOWN
+   select S5P_GPIO_DRVSTR
select S3C_GPIO_CFG_S3C24XX
select S3C_GPIO_CFG_S3C64XX
-   select S5P_GPIO_CFG_S5PC1XX
help
  Base platform code for any Samsung S5PC1XX device
 
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index 278f268..66a8f3e 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -24,7 +24,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_S5PC1XX_SETUP_I2C0) += setup-i2c0.o
 obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o
diff --git a/arch/arm/plat-s5pc1xx/gpio-config.c 
b/arch/arm/plat-s5pc1xx/gpio-config.c
deleted file mode 100644
index a4f67e8..000
--- a/arch/arm/plat-s5pc1xx/gpio-config.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* linux/arch/arm/plat-s5pc1xx/gpio-config.c
- *
- * Copyright 2009 Samsung Electronics
- *
- * S5PC1XX GPIO Configuration.
- *
- * Based on plat-s3c64xx/gpio-config.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/module.h
-#include linux/gpio.h
-#include linux/io.h
-
-#include plat/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 = 0x  (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);
diff --git a/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h 
b/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h
deleted file mode 100644
index 72ad59f..000
--- a/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* 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

[PATCH 11/15] ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework

2010-05-14 Thread Marek Szyprowski
This patch moves S5PC100 SoC support to plat-s5p framework. Most
periperal support code has been already moved from plat-s5pc1xx to
mach-s5pc100.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/Kconfig   |9 +-
 arch/arm/Makefile  |3 +-
 arch/arm/mach-s5pc100/Kconfig  |7 +-
 arch/arm/mach-s5pc100/Makefile |3 +-
 arch/arm/mach-s5pc100/cpu.c|   56 ---
 arch/arm/mach-s5pc100/gpio.c   |   24 ++--
 arch/arm/mach-s5pc100/include/mach/debug-macro.S   |6 +-
 arch/arm/mach-s5pc100/include/mach/entry-macro.S   |8 +-
 arch/arm/mach-s5pc100/include/mach/irqs.h  |  101 +-
 arch/arm/mach-s5pc100/include/mach/map.h   |  156 +---
 arch/arm/mach-s5pc100/include/mach/regs-clock.h|6 +
 arch/arm/mach-s5pc100/include/mach/regs-gpio.h |6 +-
 arch/arm/mach-s5pc100/include/mach/regs-irq.h  |7 +-
 arch/arm/mach-s5pc100/include/mach/system.h|9 +-
 arch/arm/mach-s5pc100/include/mach/tick.h  |4 +-
 .../s5pc100-init.c = mach-s5pc100/init.c} |7 +-
 arch/arm/mach-s5pc100/mach-smdkc100.c  |   11 +-
 arch/arm/plat-s5p/Kconfig  |2 +-
 arch/arm/plat-s5p/cpu.c|   10 ++
 arch/arm/plat-s5p/include/plat/s5pc100.h   |   33 
 arch/arm/plat-samsung/Kconfig  |2 +-
 21 files changed, 267 insertions(+), 203 deletions(-)
 rename arch/arm/{plat-s5pc1xx/s5pc100-init.c = mach-s5pc100/init.c} (68%)
 create mode 100644 arch/arm/plat-s5p/include/plat/s5pc100.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3f8718f..1cb098f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -699,14 +699,14 @@ config ARCH_S5P6442
help
  Samsung S5P6442 CPU based systems
 
-config ARCH_S5PC1XX
-   bool Samsung S5PC1XX
+config ARCH_S5PC100
+   bool Samsung S5PC100
select GENERIC_GPIO
select HAVE_CLK
select CPU_V7
select ARM_L1_CACHE_SHIFT_6
help
- Samsung S5PC1XX series based systems
+ Samsung S5PC100 series based systems
 
 config ARCH_S5PV210
bool Samsung S5PV210/S5PC110
@@ -890,7 +890,6 @@ source arch/arm/mach-sa1100/Kconfig
 source arch/arm/plat-samsung/Kconfig
 source arch/arm/plat-s3c24xx/Kconfig
 source arch/arm/plat-s5p/Kconfig
-source arch/arm/plat-s5pc1xx/Kconfig
 
 if ARCH_S3C2410
 source arch/arm/mach-s3c2400/Kconfig
@@ -909,9 +908,7 @@ source arch/arm/mach-s5p6440/Kconfig
 
 source arch/arm/mach-s5p6442/Kconfig
 
-if ARCH_S5PC1XX
 source arch/arm/mach-s5pc100/Kconfig
-endif
 
 source arch/arm/mach-s5pv210/Kconfig
 
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 9505a70..f7cb6d4 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -167,7 +167,7 @@ machine-$(CONFIG_ARCH_S3C24A0)  := s3c24a0
 machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx
 machine-$(CONFIG_ARCH_S5P6440) := s5p6440
 machine-$(CONFIG_ARCH_S5P6442) := s5p6442
-machine-$(CONFIG_ARCH_S5PC1XX) := s5pc100
+machine-$(CONFIG_ARCH_S5PC100) := s5pc100
 machine-$(CONFIG_ARCH_S5PV210) := s5pv210
 machine-$(CONFIG_ARCH_SA1100)  := sa1100
 machine-$(CONFIG_ARCH_SHARK)   := shark
@@ -192,7 +192,6 @@ plat-$(CONFIG_PLAT_NOMADIK) := nomadik
 plat-$(CONFIG_PLAT_ORION)  := orion
 plat-$(CONFIG_PLAT_PXA):= pxa
 plat-$(CONFIG_PLAT_S3C24XX):= s3c24xx samsung
-plat-$(CONFIG_PLAT_S5PC1XX):= s5pc1xx samsung
 plat-$(CONFIG_PLAT_S5P):= s5p samsung
 
 ifeq ($(CONFIG_ARCH_EBSA110),y)
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 176c9a1..a6e21b2 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -5,10 +5,11 @@
 
 # Configuration options for the S5PC100 CPU
 
+if ARCH_S5PC100
+
 config CPU_S5PC100
bool
-   select CPU_S5PC100_INIT
-   select CPU_S5PC100_CLOCK
+   select PLAT_S5P
help
  Enable S5PC100 CPU support
 
@@ -52,3 +53,5 @@ config MACH_SMDKC100
select S5PC100_SETUP_SDHCI
help
  Machine support for the Samsung SMDKC100
+
+endif
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index 1e3180e..c51b580 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -11,7 +11,7 @@ obj-  :=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)  += cpu.o gpio.o
+obj-$(CONFIG_CPU_S5PC100)  += cpu.o init.o clock.o gpio.o
 obj-$(CONFIG_CPU_S5PC100)  += setup-i2c0.o
 
 # Helper and device support
@@ -22,4 +22,5 @@ obj-$(CONFIG_S5PC100_SETUP_SDHCI)   += setup-sdhci.o
 obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o

[PATCH 12/15] ARM: SMDKC100: fix frame buffer definitions

2010-05-14 Thread Marek Szyprowski
Fix incorrectly defined pixel clock value for the default framebuffer
window.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc100/mach-smdkc100.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c 
b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 9155564..7df8ed0 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -118,8 +118,7 @@ static struct platform_device smdkc100_lcd_powerdev = {
 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),
+   .pixclock = 1ULL / ((8+13+3+800)*(7+5+1+480)*80),
.left_margin= 8,
.right_margin   = 13,
.upper_margin   = 7,
-- 
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 06/15] ARM: S5PC100: Move gpio support from plat-s5pc1xx to mach-s5pc100

2010-05-14 Thread Marek Szyprowski
Move gpio-lib support from plat-s5pc1xx to mach-s5pc100. Only basic gpio
functionality is now supported. Gpio interrupts are disabled temporarly
and will be added later.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc100/Makefile |2 +-
 .../gpiolib.c = mach-s5pc100/gpio.c}  |   11 +++
 .../plat = mach-s5pc100/include/mach}/regs-gpio.h |0
 arch/arm/mach-s5pc100/mach-smdkc100.c  |1 -
 arch/arm/plat-s5pc1xx/Makefile |3 +--
 5 files changed, 9 insertions(+), 8 deletions(-)
 rename arch/arm/{plat-s5pc1xx/gpiolib.c = mach-s5pc100/gpio.c} (99%)
 rename arch/arm/{plat-s5pc1xx/include/plat = 
mach-s5pc100/include/mach}/regs-gpio.h (100%)

diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index 809ff10..e1afdbf 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -11,7 +11,7 @@ obj-  :=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)  += cpu.o
+obj-$(CONFIG_CPU_S5PC100)  += cpu.o gpio.o
 
 # Helper and device support
 
diff --git a/arch/arm/plat-s5pc1xx/gpiolib.c b/arch/arm/mach-s5pc100/gpio.c
similarity index 99%
rename from arch/arm/plat-s5pc1xx/gpiolib.c
rename to arch/arm/mach-s5pc100/gpio.c
index 5a97a8f..c8e8336 100644
--- a/arch/arm/plat-s5pc1xx/gpiolib.c
+++ b/arch/arm/mach-s5pc100/gpio.c
@@ -17,11 +17,11 @@
 #include linux/gpio.h
 
 #include mach/map.h
+#include mach/regs-gpio.h
 
 #include plat/gpio-core.h
 #include plat/gpio-cfg.h
 #include plat/gpio-cfg-helpers.h
-#include plat/regs-gpio.h
 
 /* S5PC100 GPIO bank summary:
  *
@@ -61,6 +61,7 @@
  * L3  8   4BitNone
  */
 
+#if 0
 static int s5pc1xx_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
 {
return S3C_IRQ_GPIO(chip-base + offset);
@@ -84,7 +85,7 @@ static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, 
unsigned int offset)
return IRQ_EINT(24 + offset);
return -EINVAL;
 }
-
+#endif
 static struct s3c_gpio_cfg gpio_cfg = {
.set_config = s3c_gpio_setcfg_s3c64xx_4bit,
.set_pull   = s3c_gpio_setpull_updown,
@@ -386,7 +387,7 @@ extern void s5pc1xx_irq_gpioint_handler(unsigned int irq, 
struct irq_desc *desc)
 
 static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
 {
-
+#if 0
/* Interrupt */
if (chip-config == gpio_cfg) {
int i, irq;
@@ -402,6 +403,7 @@ static __init void s5pc100_gpiolib_link(struct 
s3c_gpio_chip *chip)
}
} else if (chip-config == gpio_cfg_eint)
chip-chip.to_irq = s5pc1xx_gpiolib_to_eint;
+#endif
 }
 
 static __init int s5pc1xx_gpiolib_init(void)
@@ -417,9 +419,10 @@ static __init int s5pc1xx_gpiolib_init(void)
 
samsung_gpiolib_add_4bit_chips(s5pc100_gpio_chips,
   ARRAY_SIZE(s5pc100_gpio_chips));
+#if 0
/* Interrupt */
set_irq_chained_handler(IRQ_GPIOINT, s5pc1xx_irq_gpioint_handler);
-
+#endif
return 0;
 }
 core_initcall(s5pc1xx_gpiolib_init);
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h 
b/arch/arm/mach-s5pc100/include/mach/regs-gpio.h
similarity index 100%
rename from arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
rename to arch/arm/mach-s5pc100/include/mach/regs-gpio.h
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c 
b/arch/arm/mach-s5pc100/mach-smdkc100.c
index ae3c52c..bfe67db 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -35,7 +35,6 @@
 
 #include plat/regs-serial.h
 #include plat/gpio-cfg.h
-#include plat/regs-gpio.h
 
 #include plat/clock.h
 #include plat/devs.h
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index 66a8f3e..540fca5 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -13,9 +13,8 @@ obj-  :=
 
 obj-y  += dev-uart.o
 obj-y  += cpu.o
-obj-y  += irq.o irq-gpio.o irq-eint.o
+obj-y  += irq.o
 obj-y  += clock.o
-obj-y  += gpiolib.o
 
 # CPU support
 
-- 
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


RE: [PATCH] ARM: S5P: Dynamicly numbered GPIO interrupt support

2010-05-14 Thread Marek Szyprowski
Hello,

On Friday, May 14, 2010 10:40 AM Ben Dooks wrote:

 Add support for GPIO interrupts where the interrupt number
 is dynamically allocated at first request from gpiolib.
 
 This method is employed as the newer SoCs have a large number
 of possible interrupt numbers which are very rarely heavily
 used. However, the classic code has always registered all
 possible interrupts, using a large amount of memory for the
 irq_desc[] table.

I like this idea, however I already see some problems. This solves
only gpio to irq mappings, but what about reverse mappings? There
are many i2c/spi/whatever drivers that requires a irq number to be
passed with platform data. With static gpio-irq mappings this is
trivial. However with dynamic gpio2irq mappings this becomes more
complicated. 

Machine startup code would need to:
1. request the gpio pin used for interrupt (ok)
2. convert it to irq number (ok)
3. put it in driver specific platform data (ok)
4. release the gpio pin (?)

Would request_irq() work after release of that gpio pin?
 
Best regards
--
Marek Szyprowski
Samsung Poland RD Center


--
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 4/7] ARM: S5PV210: add framebuffer platform helpers for s5pv210 based machines

2010-05-17 Thread Marek Szyprowski
This patch adds common framebuffer device helpers and register defines
for S5PV210 based machines.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig   |5 ++
 arch/arm/mach-s5pv210/Makefile  |4 ++
 arch/arm/mach-s5pv210/include/mach/irqs.h   |5 ++
 arch/arm/mach-s5pv210/include/mach/map.h|3 +
 arch/arm/mach-s5pv210/include/mach/regs-clock.h |1 +
 arch/arm/mach-s5pv210/setup-fb-24bpp.c  |   62 +++
 arch/arm/plat-samsung/include/plat/fb.h |7 +++
 7 files changed, 87 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-fb-24bpp.c

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index c42bcba..3717b52 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -15,6 +15,11 @@ config CPU_S5PV210
help
  Enable S5PV210 CPU support
 
+config S5PV210_SETUP_FB_24BPP
+   bool
+   help
+  Common setup code for S5PV210 with an 24bpp RGB display helper.
+
 config MACH_SMDKV210
bool SMDKV210
select CPU_S5PV210
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 0bb1680..a2707a8 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -15,6 +15,10 @@ obj- :=
 obj-$(CONFIG_CPU_S5PV210)  += cpu.o init.o clock.o gpiolib.o
 obj-$(CONFIG_CPU_S5PV210)  += setup-i2c0.o
 
+# Helper and device support
+
+obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)   += setup-fb-24bpp.o
+
 # machine support
 
 obj-$(CONFIG_MACH_SMDKV210)+= mach-smdkv210.o
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h 
b/arch/arm/mach-s5pv210/include/mach/irqs.h
index 62c5175..ee6e07b 100644
--- a/arch/arm/mach-s5pv210/include/mach/irqs.h
+++ b/arch/arm/mach-s5pv210/include/mach/irqs.h
@@ -143,4 +143,9 @@
 
 #define NR_IRQS(IRQ_EINT(31) + 1)
 
+/* Compatibility */
+#define IRQ_LCD_FIFO   IRQ_LCD0
+#define IRQ_LCD_VSYNC  IRQ_LCD1
+#define IRQ_LCD_SYSTEM IRQ_LCD2
+
 #endif /* ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h 
b/arch/arm/mach-s5pv210/include/mach/map.h
index c22694c..5903056 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -43,6 +43,8 @@
 
 #define S5PV210_PA_SROMC   (0xE800)
 
+#define S5PV210_PA_FB  (0xF800)
+
 #define S5PV210_PA_VIC0(0xF200)
 #define S5P_PA_VIC0S5PV210_PA_VIC0
 
@@ -61,5 +63,6 @@
 /* compatibiltiy defines. */
 #define S3C_PA_UARTS5PV210_PA_UART
 #define S3C_PA_IIC S5PV210_PA_IIC0
+#define S3C_PA_FB  S5PV210_PA_FB
 
 #endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h 
b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
index 40dd24f..0a3d7ad 100644
--- a/arch/arm/mach-s5pv210/include/mach/regs-clock.h
+++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
@@ -128,6 +128,7 @@
 
 #define S5P_RST_STAT   S5P_CLKREG(0xA000)
 #define S5P_OSC_CONS5P_CLKREG(0x8000)
+#define S5P_MDNIE_SEL  S5P_CLKREG(0x7008)
 #define S5P_MIPI_PHY_CON0  S5P_CLKREG(0x7200)
 #define S5P_MIPI_PHY_CON1  S5P_CLKREG(0x7204)
 #define S5P_MIPI_CONTROL   S5P_CLKREG(0xE814)
diff --git a/arch/arm/mach-s5pv210/setup-fb-24bpp.c 
b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
new file mode 100644
index 000..b039a55
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
@@ -0,0 +1,62 @@
+/*
+ * linux/arch/arm/plat-s5pv210/setup-fb-24bpp.c
+ *
+ * Copyright 2009 Samsung Electronics
+ *
+ * Base s5pv210 setup information for 24bpp LCD framebuffer
+ *
+ * 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/fb.h
+
+#include mach/regs-fb.h
+#include mach/gpio.h
+#include mach/map.h
+#include plat/fb.h
+#include mach/regs-clock.h
+#include plat/gpio-cfg.h
+
+void s5pv210_fb_gpio_setup_24bpp(void)
+{
+   unsigned int gpio = 0;
+
+   for (gpio = S5PV210_GPF0(0); gpio = S5PV210_GPF0(7); gpio++) {
+   s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+   s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+   s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
+   }
+
+   for (gpio = S5PV210_GPF1(0); gpio = S5PV210_GPF1(7); gpio++) {
+   s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+   s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+   s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
+   }
+
+   for (gpio = S5PV210_GPF2(0); gpio = S5PV210_GPF2(7); gpio++) {
+   s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2

[PATCH 5/7] ARM: S5PV210: add support for s3c-fb driver on Aquila machine

2010-05-17 Thread Marek Szyprowski
This patch adds required platform definitions to enable s3c-fb
driver. Two framebuffer windows in 480x800x16bpp mode are defined.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig   |2 +
 arch/arm/mach-s5pv210/mach-aquila.c |   49 +++
 2 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 3717b52..a7adc24 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -39,6 +39,8 @@ config MACH_AQUILA
bool Samsung Aquila
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
+   select S5PV210_SETUP_FB_24BPP
+   select S3C_DEV_FB
help
  Machine support for the Samsung Aquila target based on S5PC110 SoC
 
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c 
b/arch/arm/mach-s5pv210/mach-aquila.c
index 6a1db39..10bc76e 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -12,6 +12,7 @@
 #include linux/types.h
 #include linux/init.h
 #include linux/serial_core.h
+#include linux/fb.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -20,11 +21,13 @@
 
 #include mach/map.h
 #include mach/regs-clock.h
+#include mach/regs-fb.h
 
 #include plat/regs-serial.h
 #include plat/s5pv210.h
 #include plat/devs.h
 #include plat/cpu.h
+#include plat/fb.h
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PV210_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |\
@@ -71,7 +74,50 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata 
= {
},
 };
 
+/* Frame Buffer */
+static struct s3c_fb_pd_win aquila_fb_win0 = {
+   .win_mode = {
+   .pixclock = 1ULL / ((16+16+2+480)*(28+3+2+800)*60),
+   .left_margin = 16,
+   .right_margin = 16,
+   .upper_margin = 3,
+   .lower_margin = 28,
+   .hsync_len = 2,
+   .vsync_len = 2,
+   .xres = 480,
+   .yres = 800,
+   },
+   .max_bpp = 32,
+   .default_bpp = 16,
+};
+
+static struct s3c_fb_pd_win aquila_fb_win1 = {
+   .win_mode = {
+   .pixclock = 1ULL / ((16+16+2+480)*(28+3+2+800)*60),
+   .left_margin = 16,
+   .right_margin = 16,
+   .upper_margin = 3,
+   .lower_margin = 28,
+   .hsync_len = 2,
+   .vsync_len = 2,
+   .xres = 480,
+   .yres = 800,
+   },
+   .max_bpp = 32,
+   .default_bpp = 16,
+};
+
+static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
+   .win[0] = aquila_fb_win0,
+   .win[1] = aquila_fb_win1,
+   .vidcon0= VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
+   .vidcon1= VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
+ VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
+   .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
+};
+
 static struct platform_device *aquila_devices[] __initdata = {
+   s3c_device_fb,
 };
 
 static void __init aquila_map_io(void)
@@ -83,6 +129,9 @@ static void __init aquila_map_io(void)
 
 static void __init aquila_machine_init(void)
 {
+   /* FB */
+   s3c_fb_set_platdata(aquila_lcd_pdata);
+
platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
 }
 
-- 
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


RE: [PATCH v6] ARM: S5PV210: Add Ext interrupt support.

2010-05-17 Thread Marek Szyprowski
Hello,

On Monday, May 17, 2010 9:56 AM Kukjin Kim wrote:

 From: Jongpill Lee boyko@samsung.com
 
 Add support for external interrupts on S5PV210.
 
 Signed-off-by: Jongpill Lee boyko@samsung.com
 Signed-off-by: Pannaga Bhushan p.bhus...@samsung.com
 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
  arch/arm/mach-s5pv210/Kconfig  |1 +
  arch/arm/mach-s5pv210/include/mach/irqs.h  |   31 ++---
  arch/arm/mach-s5pv210/include/mach/regs-gpio.h |   44 +
  arch/arm/plat-s5p/Kconfig  |5 +
  arch/arm/plat-s5p/Makefile |1 +
  arch/arm/plat-s5p/irq-eint.c   |  213
 
  6 files changed, 275 insertions(+), 20 deletions(-)
  create mode 100644 arch/arm/mach-s5pv210/include/mach/regs-gpio.h
  create mode 100644 arch/arm/plat-s5p/irq-eint.c
 
 diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
 index af33a1a..c4c2a7f 100644
 --- a/arch/arm/mach-s5pv210/Kconfig
 +++ b/arch/arm/mach-s5pv210/Kconfig
 @@ -12,6 +12,7 @@ if ARCH_S5PV210
  config CPU_S5PV210
   bool
   select PLAT_S5P
 + select S5P_EXT_INT
   help
 Enable S5PV210 CPU support
 
 diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-
 s5pv210/include/mach/irqs.h
 index 62c5175..3a9e42e 100644
 --- a/arch/arm/mach-s5pv210/include/mach/irqs.h
 +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h
 @@ -17,22 +17,6 @@
 
  /* VIC0: System, DMA, Timer */
 
 -#define IRQ_EINT0S5P_IRQ_VIC0(0)
 -#define IRQ_EINT1S5P_IRQ_VIC0(1)
 -#define IRQ_EINT2S5P_IRQ_VIC0(2)
 -#define IRQ_EINT3S5P_IRQ_VIC0(3)
 -#define IRQ_EINT4S5P_IRQ_VIC0(4)
 -#define IRQ_EINT5S5P_IRQ_VIC0(5)
 -#define IRQ_EINT6S5P_IRQ_VIC0(6)
 -#define IRQ_EINT7S5P_IRQ_VIC0(7)
 -#define IRQ_EINT8S5P_IRQ_VIC0(8)
 -#define IRQ_EINT9S5P_IRQ_VIC0(9)
 -#define IRQ_EINT10   S5P_IRQ_VIC0(10)
 -#define IRQ_EINT11   S5P_IRQ_VIC0(11)
 -#define IRQ_EINT12   S5P_IRQ_VIC0(12)
 -#define IRQ_EINT13   S5P_IRQ_VIC0(13)
 -#define IRQ_EINT14   S5P_IRQ_VIC0(14)
 -#define IRQ_EINT15   S5P_IRQ_VIC0(15)
  #define IRQ_EINT16_31S5P_IRQ_VIC0(16)
  #define IRQ_BATF S5P_IRQ_VIC0(17)
  #define IRQ_MDMA S5P_IRQ_VIC0(18)
 @@ -134,13 +118,20 @@
  #define IRQ_MDNIE3   S5P_IRQ_VIC3(8)
  #define IRQ_VIC_END  S5P_IRQ_VIC3(31)
 
 -#define S5P_IRQ_EINT_BASE(IRQ_VIC_END + 1)
 +#define S5P_EINT_16_31_BASE  (IRQ_VIC_END + 1)
 
 -#define S5P_EINT(x)  ((x) + S5P_IRQ_EINT_BASE)
 -#define IRQ_EINT(x)  S5P_EINT(x)

ok

 +#define EINT_MODES3C_GPIO_SFN(0xf)

IMHO the irq.h is not the right place for this define

 +
 +#define IRQ_EINT(x)  ((x)  16 ? ((x) + S5P_IRQ_VIC0(0)) \
 + : ((x) + S5P_EINT_16_31_BASE))
 
  /* Set the default NR_IRQS */
 
 -#define NR_IRQS  (IRQ_EINT(31) + 1)
 +#define NR_IRQS  (IRQ_EINT(31) + 1)
 +

ok

 +#define EINT_GPIO_0(x)   S5PV210_GPH0(x)
 +#define EINT_GPIO_1(x)   S5PV210_GPH1(x)
 +#define EINT_GPIO_2(x)   S5PV210_GPH2(x)
 +#define EINT_GPIO_3(x)   S5PV210_GPH3(x)

Again, gpio.h would be much better for these.

 ...

Best regards
--
Marek Szyprowski
Samsung Poland RD Center


--
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] SMDKC100 fixes

2010-05-18 Thread Marek Szyprowski
Hello,

This patch series introduces 2 fixes to SMDKC100 board setup code. On
request I've separated them from the s5pc1xx cleanup patch series.

This patch series includes:

[PATCH 1/2] ARM: SMDKC100: fix frame buffer definitions
[PATCH 2/2] ARM: SMDKC100: remove magic values from uart setup structures

Best regards,
Marek Szyprowski
--
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 2/2] ARM: SMDKC100: remove magic values from uart setup structures

2010-05-18 Thread Marek Szyprowski
This patch introduces nice defines for the initial values for UART devices
on SMDKC100.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc100/mach-smdkc100.c |   40 
 1 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c 
b/arch/arm/mach-s5pc100/mach-smdkc100.c
index dd8c154..3a7dc3e 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -44,38 +44,48 @@
 #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)
-#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
+/* Following are default values for UCON, ULCON and UFCON UART registers */
+#define S5PC100_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |\
+S3C2410_UCON_RXILEVEL |\
+S3C2410_UCON_TXIRQMODE |   \
+S3C2410_UCON_RXIRQMODE |   \
+S3C2410_UCON_RXFIFO_TOI |  \
+S3C2443_UCON_RXERR_IRQEN)
+
+#define S5PC100_ULCON_DEFAULT  S3C2410_LCON_CS8
+
+#define S5PC100_UFCON_DEFAULT  (S3C2410_UFCON_FIFOMODE |   \
+S3C2440_UFCON_RXTRIG8 |\
+S3C2440_UFCON_TXTRIG16)
 
 static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
[0] = {
.hwport  = 0,
.flags   = 0,
-   .ucon= 0x3c5,
-   .ulcon   = 0x03,
-   .ufcon   = 0x51,
+   .ucon= S5PC100_UCON_DEFAULT,
+   .ulcon   = S5PC100_ULCON_DEFAULT,
+   .ufcon   = S5PC100_UFCON_DEFAULT,
},
[1] = {
.hwport  = 1,
.flags   = 0,
-   .ucon= 0x3c5,
-   .ulcon   = 0x03,
-   .ufcon   = 0x51,
+   .ucon= S5PC100_UCON_DEFAULT,
+   .ulcon   = S5PC100_ULCON_DEFAULT,
+   .ufcon   = S5PC100_UFCON_DEFAULT,
},
[2] = {
.hwport  = 2,
.flags   = 0,
-   .ucon= 0x3c5,
-   .ulcon   = 0x03,
-   .ufcon   = 0x51,
+   .ucon= S5PC100_UCON_DEFAULT,
+   .ulcon   = S5PC100_ULCON_DEFAULT,
+   .ufcon   = S5PC100_UFCON_DEFAULT,
},
[3] = {
.hwport  = 3,
.flags   = 0,
-   .ucon= 0x3c5,
-   .ulcon   = 0x03,
-   .ufcon   = 0x51,
+   .ucon= S5PC100_UCON_DEFAULT,
+   .ulcon   = S5PC100_ULCON_DEFAULT,
+   .ufcon   = S5PC100_UFCON_DEFAULT,
},
 };
 
-- 
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] Common plat-s5p updates

2010-05-18 Thread Marek Szyprowski
Hello,

This patch series contains some core plat-s5p updates, required for both
plat-s5pc1xx cleanup series as well as patches that add Samsung Aquila
board support. This patch series has been rebased onto next-samsung git
tree.

Changes since the previous version:
- updated copyright header in mach-s5pv210/setup-i2c0.c

This patch series has been sent earlier under the 'Common plat-s5p
fixes' thread.

The series contain the following patches:

[PATCH 1/2] ARM: Samsung: copy common I2C0 device helpers to machine directories
[PATCH 2/2] ARM: Samsung: move driver strength gpio configuration helper to 
common dir

Best regards,
Marek Szyprowski
--
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 1/2] ARM: Samsung: copy common I2C0 device helpers to machine directories

2010-05-18 Thread Marek Szyprowski
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5p6440/Makefile   |1 +
 arch/arm/{plat-s5p = mach-s5p6440}/setup-i2c0.c |2 +-
 arch/arm/mach-s5p6442/Makefile   |1 +
 arch/arm/{plat-s5p = mach-s5p6442}/setup-i2c0.c |2 +-
 arch/arm/mach-s5pv210/Makefile   |1 +
 arch/arm/{plat-s5p = mach-s5pv210}/setup-i2c0.c |2 +-
 arch/arm/plat-s5p/Makefile   |1 -
 7 files changed, 6 insertions(+), 4 deletions(-)
 copy arch/arm/{plat-s5p = mach-s5p6440}/setup-i2c0.c (92%)
 copy arch/arm/{plat-s5p = mach-s5p6442}/setup-i2c0.c (92%)
 rename arch/arm/{plat-s5p = mach-s5pv210}/setup-i2c0.c (92%)

diff --git a/arch/arm/mach-s5p6440/Makefile b/arch/arm/mach-s5p6440/Makefile
index 1ad894b..9646cdf 100644
--- a/arch/arm/mach-s5p6440/Makefile
+++ b/arch/arm/mach-s5p6440/Makefile
@@ -13,6 +13,7 @@ obj-  :=
 # Core support for S5P6440 system
 
 obj-$(CONFIG_CPU_S5P6440)  += cpu.o init.o clock.o gpio.o
+obj-$(CONFIG_CPU_S5P6440)  += setup-i2c0.o
 
 # machine support
 
diff --git a/arch/arm/plat-s5p/setup-i2c0.c b/arch/arm/mach-s5p6440/setup-i2c0.c
similarity index 92%
copy from arch/arm/plat-s5p/setup-i2c0.c
copy to arch/arm/mach-s5p6440/setup-i2c0.c
index 67a66e0..69e8a66 100644
--- a/arch/arm/plat-s5p/setup-i2c0.c
+++ b/arch/arm/mach-s5p6440/setup-i2c0.c
@@ -1,4 +1,4 @@
-/* linux/arch/arm/plat-s5p/setup-i2c0.c
+/* linux/arch/arm/mach-s5p6440/setup-i2c0.c
  *
  * Copyright (c) 2009 Samsung Electronics Co., Ltd.
  * http://www.samsung.com/
diff --git a/arch/arm/mach-s5p6442/Makefile b/arch/arm/mach-s5p6442/Makefile
index dde39a6..4942c14 100644
--- a/arch/arm/mach-s5p6442/Makefile
+++ b/arch/arm/mach-s5p6442/Makefile
@@ -13,6 +13,7 @@ obj-  :=
 # Core support for S5P6442 system
 
 obj-$(CONFIG_CPU_S5P6442)  += cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5P6442)  += setup-i2c0.o
 
 # machine support
 
diff --git a/arch/arm/plat-s5p/setup-i2c0.c b/arch/arm/mach-s5p6442/setup-i2c0.c
similarity index 92%
copy from arch/arm/plat-s5p/setup-i2c0.c
copy to arch/arm/mach-s5p6442/setup-i2c0.c
index 67a66e0..662695d 100644
--- a/arch/arm/plat-s5p/setup-i2c0.c
+++ b/arch/arm/mach-s5p6442/setup-i2c0.c
@@ -1,4 +1,4 @@
-/* linux/arch/arm/plat-s5p/setup-i2c0.c
+/* linux/arch/arm/mach-s5p6442/setup-i2c0.c
  *
  * Copyright (c) 2009 Samsung Electronics Co., Ltd.
  * http://www.samsung.com/
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 8ebf51c..1a972a5 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -13,6 +13,7 @@ obj-  :=
 # Core support for S5PV210 system
 
 obj-$(CONFIG_CPU_S5PV210)  += cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5PV210)  += setup-i2c0.o
 
 # machine support
 
diff --git a/arch/arm/plat-s5p/setup-i2c0.c b/arch/arm/mach-s5pv210/setup-i2c0.c
similarity index 92%
rename from arch/arm/plat-s5p/setup-i2c0.c
rename to arch/arm/mach-s5pv210/setup-i2c0.c
index 67a66e0..9ec6845 100644
--- a/arch/arm/plat-s5p/setup-i2c0.c
+++ b/arch/arm/mach-s5pv210/setup-i2c0.c
@@ -1,4 +1,4 @@
-/* linux/arch/arm/plat-s5p/setup-i2c0.c
+/* linux/arch/arm/mach-s5pv210/setup-i2c0.c
  *
  * Copyright (c) 2009 Samsung Electronics Co., Ltd.
  * http://www.samsung.com/
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index a7c54b3..0ec09a9 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -16,4 +16,3 @@ obj-y += dev-uart.o
 obj-y  += cpu.o
 obj-y  += clock.o
 obj-y  += irq.o
-obj-y  += setup-i2c0.o
-- 
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 05/11] ARM: S5PC100: Move frame buffer helpers from plat-s5pc1xx to mach-s5pc100

2010-05-18 Thread Marek Szyprowski
Move frame buffer helpers from plat-s5pc1xx to mach-s5pc100.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc100/Kconfig  |7 ++-
 arch/arm/mach-s5pc100/Makefile |1 +
 .../setup-fb-24bpp.c   |4 ++--
 arch/arm/plat-s5pc1xx/Kconfig  |5 -
 arch/arm/plat-s5pc1xx/Makefile |1 -
 5 files changed, 9 insertions(+), 9 deletions(-)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/setup-fb-24bpp.c (91%)

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 27ec167..7d9b68c 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -12,6 +12,11 @@ config CPU_S5PC100
help
  Enable S5PC100 CPU support
 
+config S5PC100_SETUP_FB_24BPP
+   bool
+   help
+ Common setup code for S5PC1XX with an 24bpp RGB display helper.
+
 config S5PC100_SETUP_SDHCI
 bool
 select S5PC1XX_SETUP_SDHCI_GPIO
@@ -28,7 +33,7 @@ config MACH_SMDKC100
select S3C_DEV_HSMMC2
select S5PC1XX_SETUP_I2C0
select S5PC1XX_SETUP_I2C1
-   select S5PC1XX_SETUP_FB_24BPP
+   select S5PC100_SETUP_FB_24BPP
select S5PC100_SETUP_SDHCI
help
  Machine support for the Samsung SMDKC100
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index 4199ce2..1d1276c 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_CPU_S5PC100) += cpu.o gpiolib.o
 
 # Helper and device support
 
+obj-$(CONFIG_S5PC100_SETUP_FB_24BPP)   += setup-fb-24bpp.o
 obj-$(CONFIG_S5PC100_SETUP_SDHCI)   += setup-sdhci.o
 
 # machine support
diff --git a/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c 
b/arch/arm/mach-s5pc100/setup-fb-24bpp.c
similarity index 91%
rename from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
rename to arch/arm/mach-s5pc100/setup-fb-24bpp.c
index b02c36f..6eba6cb 100644
--- a/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
+++ b/arch/arm/mach-s5pc100/setup-fb-24bpp.c
@@ -1,9 +1,9 @@
 /*
- * linux/arch/arm/plat-s5pc100/setup-fb-24bpp.c
+ * linux/arch/arm/mach-s5pc100/setup-fb-24bpp.c
  *
  * Copyright 2009 Samsung Electronics
  *
- * Base S5PC1XX setup information for 24bpp LCD framebuffer
+ * Base S5PC100 setup information for 24bpp LCD framebuffer
  *
  * 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
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index 98bbaf9..708f7a0 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -39,11 +39,6 @@ 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 S5PC1XX_SETUP_I2C0
bool
default y
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index 540fca5..a5b90c0 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -23,7 +23,6 @@ obj-$(CONFIG_CPU_S5PC100_CLOCK)   += s5pc100-clock.o
 
 # Device setup
 
-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
-- 
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 06/11] ARM: S5PC100: Move i2c helpers from plat-s5pc1xx to mach-s5pc100

2010-05-18 Thread Marek Szyprowski
Move i2c helpers from plat-s5pc1xx to mach-s5pc100.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc100/Kconfig  |8 ++--
 arch/arm/mach-s5pc100/Makefile |2 ++
 .../{plat-s5pc1xx = mach-s5pc100}/setup-i2c0.c|4 ++--
 .../{plat-s5pc1xx = mach-s5pc100}/setup-i2c1.c|4 ++--
 arch/arm/plat-s5pc1xx/Kconfig  |   14 --
 arch/arm/plat-s5pc1xx/Makefile |2 --
 6 files changed, 12 insertions(+), 22 deletions(-)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/setup-i2c0.c (89%)
 rename arch/arm/{plat-s5pc1xx = mach-s5pc100}/setup-i2c1.c (89%)

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 7d9b68c..8593337 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -23,6 +23,11 @@ config S5PC100_SETUP_SDHCI
 help
   Internal helper functions for S5PC100 based SDHCI systems
 
+config S5PC100_SETUP_I2C1
+   bool
+   help
+ Common setup code for i2c bus 1.
+
 config MACH_SMDKC100
bool SMDKC100
select CPU_S5PC100
@@ -31,9 +36,8 @@ config MACH_SMDKC100
select S3C_DEV_HSMMC
select S3C_DEV_HSMMC1
select S3C_DEV_HSMMC2
-   select S5PC1XX_SETUP_I2C0
-   select S5PC1XX_SETUP_I2C1
select S5PC100_SETUP_FB_24BPP
+   select S5PC100_SETUP_I2C1
select S5PC100_SETUP_SDHCI
help
  Machine support for the Samsung SMDKC100
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index 1d1276c..373bc54 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -12,10 +12,12 @@ obj-:=
 # Core support for S5PC100 system
 
 obj-$(CONFIG_CPU_S5PC100)  += cpu.o gpiolib.o
+obj-$(CONFIG_CPU_S5PC100)  += setup-i2c0.o
 
 # Helper and device support
 
 obj-$(CONFIG_S5PC100_SETUP_FB_24BPP)   += setup-fb-24bpp.o
+obj-$(CONFIG_S5PC100_SETUP_I2C1)   += setup-i2c1.o
 obj-$(CONFIG_S5PC100_SETUP_SDHCI)   += setup-sdhci.o
 
 # machine support
diff --git a/arch/arm/plat-s5pc1xx/setup-i2c0.c 
b/arch/arm/mach-s5pc100/setup-i2c0.c
similarity index 89%
rename from arch/arm/plat-s5pc1xx/setup-i2c0.c
rename to arch/arm/mach-s5pc100/setup-i2c0.c
index 5e4a7c3..dd3174e 100644
--- a/arch/arm/plat-s5pc1xx/setup-i2c0.c
+++ b/arch/arm/mach-s5pc100/setup-i2c0.c
@@ -1,9 +1,9 @@
-/* linux/arch/arm/plat-s5pc1xx/setup-i2c0.c
+/* linux/arch/arm/mach-s5pc100/setup-i2c0.c
  *
  * Copyright 2009 Samsung Electronics Co.
  * Byungho Min bh...@samsung.com
  *
- * Base S5PC1XX I2C bus 0 gpio configuration
+ * Base S5PC100 I2C bus 0 gpio configuration
  *
  * Based on plat-s3c64xx/setup-i2c0.c
  *
diff --git a/arch/arm/plat-s5pc1xx/setup-i2c1.c 
b/arch/arm/mach-s5pc100/setup-i2c1.c
similarity index 89%
rename from arch/arm/plat-s5pc1xx/setup-i2c1.c
rename to arch/arm/mach-s5pc100/setup-i2c1.c
index a0a8b4a..d1fec26 100644
--- a/arch/arm/plat-s5pc1xx/setup-i2c1.c
+++ b/arch/arm/mach-s5pc100/setup-i2c1.c
@@ -1,9 +1,9 @@
-/* linux/arch/arm/plat-s3c64xx/setup-i2c1.c
+/* linux/arch/arm/mach-s5pc100/setup-i2c1.c
  *
  * Copyright 2009 Samsung Electronics Co.
  * Byungho Min bh...@samsung.com
  *
- * Base S5PC1XX I2C bus 1 gpio configuration
+ * Base S5PC100 I2C bus 1 gpio configuration
  *
  * Based on plat-s3c64xx/setup-i2c1.c
  *
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index 708f7a0..c7bd2bb 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -39,20 +39,6 @@ config CPU_S5PC100_CLOCK
 
 # platform specific device setup
 
-config S5PC1XX_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 S5PC1XX_SETUP_I2C1
-   bool
-   help
- Common setup code for i2c bus 1.
-
 config S5PC1XX_SETUP_SDHCI_GPIO
bool
help
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index a5b90c0..9ce6409 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -23,6 +23,4 @@ obj-$(CONFIG_CPU_S5PC100_CLOCK)   += s5pc100-clock.o
 
 # Device setup
 
-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
-- 
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 01/11] drivers: serial: S5PC100 serial driver cleanup

2010-05-18 Thread Marek Szyprowski
Remove unnecessary Kconfig entry. S5PC100 has exactly the same driver as
S3C6400/S3C6410/S5P6440.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/serial/Kconfig  |   16 
 drivers/serial/Makefile |1 -
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 5f3f03d..302836a 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -534,21 +534,13 @@ config SERIAL_S3C24A0
  Serial port support for the Samsung S3C24A0 SoC
 
 config SERIAL_S3C6400
-   tristate Samsung S3C6400/S3C6410/S5P6440 Seria port support
-   depends on SERIAL_SAMSUNG  (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440)
+   tristate Samsung S3C6400/S3C6410/S5P6440/S5PC100 Serial port support
+   depends on SERIAL_SAMSUNG  (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440 
|| CPU_S5PC100)
select SERIAL_SAMSUNG_UARTS_4
default y
help
- Serial port support for the Samsung S3C6400, S3C6410 and S5P6440
- SoCs
-
-config SERIAL_S5PC100
-   tristate Samsung S5PC100 Serial port support
-   depends on SERIAL_SAMSUNG  CPU_S5PC100
-   select SERIAL_SAMSUNG_UARTS_4
-   default y
-   help
- Serial port support for the Samsung S5PC100 SoCs
+ Serial port support for the Samsung S3C6400, S3C6410, S5P6440
+ and S5PC100 SoCs
 
 config SERIAL_S5PV210
tristate Samsung S5PV210 Serial port support
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 6aa4723..328f107 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -44,7 +44,6 @@ obj-$(CONFIG_SERIAL_S3C2412) += s3c2412.o
 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_S5PV210) += s5pv210.o
 obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
 obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
-- 
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 04/11] ARM: S5PC100: gpio.h cleanup

2010-05-18 Thread Marek Szyprowski
This patch renames gpio related registers from s5pc1xx to s5pc100 to
better match the plat-s5p framework style. GPIO_MP* defines now used
anywhere thus has been removed.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc100/include/mach/gpio.h  |   95 +++-
 arch/arm/mach-s5pc100/include/mach/regs-gpio.h |8 +-
 2 files changed, 46 insertions(+), 57 deletions(-)

diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h 
b/arch/arm/mach-s5pc100/include/mach/gpio.h
index 2c4cbe8..29a8a12 100644
--- a/arch/arm/mach-s5pc100/include/mach/gpio.h
+++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
@@ -12,6 +12,9 @@
  * published by the Free Software Foundation.
 */
 
+#ifndef __ASM_ARCH_GPIO_H
+#define __ASM_ARCH_GPIO_H __FILE__
+
 #define gpio_get_value __gpio_get_value
 #define gpio_set_value __gpio_set_value
 #define gpio_cansleep  __gpio_cansleep
@@ -52,11 +55,6 @@
 #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 */
 
@@ -65,50 +63,45 @@
  * change from one gpio bank to another can be caught.
 */
 
-#define S5PC1XX_GPIO_NEXT(__gpio) \
+#define S5PC100_GPIO_NEXT(__gpio) \
((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
 
-enum s3c_gpio_number {
+enum s5p_gpio_number {
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),
+   S5PC100_GPIO_A1_START   = S5PC100_GPIO_NEXT(S5PC100_GPIO_A0),
+   S5PC100_GPIO_B_START= S5PC100_GPIO_NEXT(S5PC100_GPIO_A1),
+   S5PC100_GPIO_C_START= S5PC100_GPIO_NEXT(S5PC100_GPIO_B),
+   S5PC100_GPIO_D_START= S5PC100_GPIO_NEXT(S5PC100_GPIO_C),
+   S5PC100_GPIO_E0_START   = S5PC100_GPIO_NEXT(S5PC100_GPIO_D),
+   S5PC100_GPIO_E1_START   = S5PC100_GPIO_NEXT(S5PC100_GPIO_E0),
+   S5PC100_GPIO_F0_START   = S5PC100_GPIO_NEXT(S5PC100_GPIO_E1),
+   S5PC100_GPIO_F1_START   = S5PC100_GPIO_NEXT(S5PC100_GPIO_F0),
+   S5PC100_GPIO_F2_START   = S5PC100_GPIO_NEXT(S5PC100_GPIO_F1

RE: [PATCH 10/11] ARM: S5PC100: use common plat-s5p external interrupt code

2010-05-18 Thread Marek Szyprowski
Hello,

On Wednesday, May 19, 2010 6:02 AM Ben Dooks wrote:

 On Tue, May 18, 2010 at 12:38:48PM +0200, Marek Szyprowski wrote:
  Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
  ---
   arch/arm/mach-s5pc100/Kconfig  |1 +
   arch/arm/mach-s5pc100/gpiolib.c|3 +-
   arch/arm/mach-s5pc100/include/mach/irqs.h  |   15 --
   arch/arm/mach-s5pc100/include/mach/regs-gpio.h |   36 ++
 -
   4 files changed, 36 insertions(+), 19 deletions(-)
 
  diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-
 s5pc100/Kconfig
  index fe1216b..2eb9497 100644
  --- a/arch/arm/mach-s5pc100/Kconfig
  +++ b/arch/arm/mach-s5pc100/Kconfig
  @@ -10,6 +10,7 @@ if ARCH_S5PC100
   config CPU_S5PC100
  bool
  select PLAT_S5P
  +   select S5P_EXT_INT
  help
Enable S5PC100 CPU support
 
  diff --git a/arch/arm/mach-s5pc100/gpiolib.c b/arch/arm/mach-
 s5pc100/gpiolib.c
  index 88dd913..0fab7f2 100644
  --- a/arch/arm/mach-s5pc100/gpiolib.c
  +++ b/arch/arm/mach-s5pc100/gpiolib.c
  @@ -61,7 +61,6 @@
* L3  8   4BitNone
*/
 
  -#if 0
   static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int
 offset)
   {
  return S3C_IRQ_GPIO(chip-base + offset);
  @@ -85,7 +84,7 @@ static int s5pc100_gpiolib_to_eint(struct gpio_chip
 *chip, unsigned int offset)
  return IRQ_EINT(24 + offset);
  return -EINVAL;
   }
  -#endif
  +
   static struct s3c_gpio_cfg gpio_cfg = {
  .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
  .set_pull   = s3c_gpio_setpull_updown,
  diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-
 s5pc100/include/mach/irqs.h
  index 84c74ac..f26c4d9 100644
  --- a/arch/arm/mach-s5pc100/include/mach/irqs.h
  +++ b/arch/arm/mach-s5pc100/include/mach/irqs.h
  @@ -97,10 +97,19 @@
   #define IRQ_SDMFIQ S5P_IRQ_VIC2(31)
   #define IRQ_VIC_ENDS5P_IRQ_VIC2(31)
 
  -#define S5P_IRQ_EINT_BASE  (IRQ_VIC_END + 1)
  +#define S5P_EINT_16_31_BASE(IRQ_VIC_END + 1)
 
  -#define IRQ_EINT(x) ((x)  16 ? S5P_IRQ_VIC0(x) : \
  -   (S5P_IRQ_EINT_BASE + (x)-16))
  +#define S3C_IRQ_EINT_BASE  (IRQ_VIC_END + 1)
 
 we seem to have this and S5P_EINT_16_31_BASE? Let's use just the one.
 
  +#define EINT_MODE  S3C_GPIO_SFN(0x2)
  +
  +#define IRQ_EINT(x)((x)  16 ? ((x) + S5P_IRQ_VIC0(0)) \
  +   : ((x) + S5P_EINT_16_31_BASE))
 
 ok, could we put this in arch/arm/plat-s5p/include/plat/irqs.h and
 just have the per-platform files defining the base?

I'm not sure if this is a good idea. Although this code works for s5pc100
and s5pv210, there might be problems with s5p6440, which has external
interrupts designed like s3c6410. But I'm not sure if this would cause
the problems. If so then we can always just move it from plat/irqs.h to
mach/irqs.h again.

 
  +#define EINT_GPIO_0(x) S5PC100_GPH0(x)
  +#define EINT_GPIO_1(x) S5PC100_GPH1(x)
  +#define EINT_GPIO_2(x) S5PC100_GPH2(x)
  +#define EINT_GPIO_3(x) S5PC100_GPH3(x)
 
   #define S3C_IRQ_GPIO_BASE  (IRQ_EINT(31) + 1)
   #define S3C_IRQ_GPIO(x)(S3C_IRQ_GPIO_BASE + (x))

What about moving these to mach/gpio.h? IMHO mach/irqs.h is not the
best place for them.

 ...

Best regards
--
Marek Szyprowski
Samsung Poland RD Center


--
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


RE: [PATCH v6] ARM: S5P: Add Ext interrupt support.

2010-05-19 Thread Marek Szyprowski
Hello,

On Thursday, May 20, 2010 5:21 AM Kukjin Kim wrote:

 From: Jongpill Lee boyko@samsung.com
 
 This patch adds the following:
 
 1. Adds external interrupt support for S5PV210.
 2. Adds common defines related to external interrupt support for plat-s5p
based platforms.
 3. Based on the new common defines, corresponding changes are made in the
affected platforms (S5P6440 and S5P6442).
 
 Signed-off-by: Jongpill Lee boyko@samsung.com
 Signed-off-by: Pannaga Bhushan p.bhus...@samsung.com
 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
  arch/arm/mach-s5p6440/include/mach/irqs.h  |9 +-
  arch/arm/mach-s5p6442/include/mach/irqs.h  |5 +-
  arch/arm/mach-s5pv210/Kconfig  |1 +
  arch/arm/mach-s5pv210/include/mach/irqs.h  |   25 +---
  arch/arm/mach-s5pv210/include/mach/memory.h|2 +-
  arch/arm/mach-s5pv210/include/mach/regs-gpio.h |   48 +
  arch/arm/plat-s5p/Kconfig  |6 +
  arch/arm/plat-s5p/Makefile |1 +
  arch/arm/plat-s5p/include/plat/irqs.h  |7 +
  arch/arm/plat-s5p/irq-eint.c   |  218
 
  10 files changed, 296 insertions(+), 26 deletions(-)
 ...

Works fine here on S5PC100. I will post relevant patches for s5pc100 in
a minute.

Best regards
--
Marek Szyprowski
Samsung Poland RD Center



--
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 3/4] ARM: S5PC100: use common plat-s5p external interrupt code

2010-05-19 Thread Marek Szyprowski
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pc100/Kconfig  |1 +
 arch/arm/mach-s5pc100/gpiolib.c|3 +-
 arch/arm/mach-s5pc100/include/mach/gpio.h  |7 +
 arch/arm/mach-s5pc100/include/mach/irqs.h  |6 +---
 arch/arm/mach-s5pc100/include/mach/regs-gpio.h |   33 +--
 5 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index fe1216b..2eb9497 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -10,6 +10,7 @@ if ARCH_S5PC100
 config CPU_S5PC100
bool
select PLAT_S5P
+   select S5P_EXT_INT
help
  Enable S5PC100 CPU support
 
diff --git a/arch/arm/mach-s5pc100/gpiolib.c b/arch/arm/mach-s5pc100/gpiolib.c
index 88dd913..0fab7f2 100644
--- a/arch/arm/mach-s5pc100/gpiolib.c
+++ b/arch/arm/mach-s5pc100/gpiolib.c
@@ -61,7 +61,6 @@
  * L3  8   4BitNone
  */
 
-#if 0
 static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
 {
return S3C_IRQ_GPIO(chip-base + offset);
@@ -85,7 +84,7 @@ static int s5pc100_gpiolib_to_eint(struct gpio_chip *chip, 
unsigned int offset)
return IRQ_EINT(24 + offset);
return -EINVAL;
 }
-#endif
+
 static struct s3c_gpio_cfg gpio_cfg = {
.set_config = s3c_gpio_setcfg_s3c64xx_4bit,
.set_pull   = s3c_gpio_setpull_updown,
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h 
b/arch/arm/mach-s5pc100/include/mach/gpio.h
index 29a8a12..71ae1f5 100644
--- a/arch/arm/mach-s5pc100/include/mach/gpio.h
+++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
@@ -146,6 +146,13 @@ enum s5p_gpio_number {
 /* define the number of gpios we need to the one after the MP04() range */
 #define ARCH_NR_GPIOS  (S5PC100_GPIO_END + 1)
 
+#define EINT_MODE  S3C_GPIO_SFN(0x2)
+
+#define EINT_GPIO_0(x) S5PC100_GPH0(x)
+#define EINT_GPIO_1(x) S5PC100_GPH1(x)
+#define EINT_GPIO_2(x) S5PC100_GPH2(x)
+#define EINT_GPIO_3(x) S5PC100_GPH3(x)
+
 #include asm-generic/gpio.h
 
 #endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h 
b/arch/arm/mach-s5pc100/include/mach/irqs.h
index 84c74ac..28aa551 100644
--- a/arch/arm/mach-s5pc100/include/mach/irqs.h
+++ b/arch/arm/mach-s5pc100/include/mach/irqs.h
@@ -97,10 +97,8 @@
 #define IRQ_SDMFIQ S5P_IRQ_VIC2(31)
 #define IRQ_VIC_ENDS5P_IRQ_VIC2(31)
 
-#define S5P_IRQ_EINT_BASE  (IRQ_VIC_END + 1)
-
-#define IRQ_EINT(x) ((x)  16 ? S5P_IRQ_VIC0(x) : \
-   (S5P_IRQ_EINT_BASE + (x)-16))
+#define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0))
+#define S5P_EINT_BASE2 (IRQ_VIC_END + 1)
 
 #define S3C_IRQ_GPIO_BASE  (IRQ_EINT(31) + 1)
 #define S3C_IRQ_GPIO(x)(S3C_IRQ_GPIO_BASE + (x))
diff --git a/arch/arm/mach-s5pc100/include/mach/regs-gpio.h 
b/arch/arm/mach-s5pc100/include/mach/regs-gpio.h
index cd6200a..dd6295e 100644
--- a/arch/arm/mach-s5pc100/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s5pc100/include/mach/regs-gpio.h
@@ -47,24 +47,29 @@
 #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)
+#define S5PC100EINT30CON   (S5P_VA_GPIO + 0xE00)
+#define S5P_EINT_CON(x)(S5PC100EINT30CON + ((x) * 0x4))
 
-/* 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)
+#define S5PC100EINT30FLTCON0   (S5P_VA_GPIO + 0xE80)
+#define S5P_EINT_FLTCON(x) (S5PC100EINT30FLTCON0 + ((x) * 0x4))
 
-/* Common part */
-/* External interrupt base is same at both s5pc100 and s5pc110 */
-#define S5P_EINT_BASE  (S5PC100_EINT_BASE)
+#define S5PC100EINT30MASK  (S5P_VA_GPIO + 0xF00)
+#define S5P_EINT_MASK(x)   (S5PC100EINT30MASK + ((x) * 0x4))
 
-#define S5PC100_GPx_INPUT(__gpio)  (0x0  ((__gpio) * 4))
-#define S5PC100_GPx_OUTPUT(__gpio) (0x1  ((__gpio) * 4))
-#define S5PC100_GPx_CONMASK(__gpio)(0xf  ((__gpio) * 4))
+#define S5PC100EINT30PEND  (S5P_VA_GPIO + 0xF40)
+#define S5P_EINT_PEND(x)   (S5PC100EINT30PEND + ((x) * 0x4))
+
+#define EINT_REG_NR(x) (EINT_OFFSET(x)  3)
+
+#define eint_irq_to_bit(irq)   (1  (EINT_OFFSET(irq)  0x7))
+
+/* values for S5P_EXTINT0 */
+#define S5P_EXTINT_LOWLEV  (0x00)
+#define S5P_EXTINT_HILEV   (0x01)
+#define S5P_EXTINT_FALLEDGE(0x02)
+#define S5P_EXTINT_RISEEDGE

[PATCH v4] ARM: Samsung: plat-s5pc1xx cleanup

2010-05-19 Thread Marek Szyprowski
This patch series perform a general cleanup in Samsung S5PC100 SoC support.
This chip is moved from custom s5pc1xx platform framework to new plat-s5p
framework, so more common code can be easily reused in upcomming extensions
for S5PV210/S5PC110 SoCs.

This patch series is prepared against for-linus/samsung4 tree, with
assumption that the [PATCH v6] ARM: S5P: Add Ext interrupt support and
ARM: S5PC100: Move sdhci helpers from plat-s5pc1xx to mach-s5pc100
patches has been previously applied.

I've tried to split my changes as much as possible to clearly show how the
transition from plat-s5pc1xx to plat-s5p is being done.

Changes since v3:
- use common external interrupt code from plat-s5p
- rebased onto git://git.fluff.org/bjdooks/linux for-linus/samsung4

Changes since v2:
- fixed some whitespace/tabs errors
- removed external interrupt code, a common code from plat-s5p will be used
- moved SMDKC100 fixes to separate patch series

Changes since v1:
- bases on completely new clock code provided by Kukjin Kim
- added some plat-s5p fixes required for transition
- removed custom functions from gpiolib implementation (now uses common
  code from plat-samsung)
- restructured the changes to avoid breaking the functionality beteen the
  patches
- some other minor cleanups (mainly c1xx to c100 renames)

This patch series includes:

[PATCH 1/4] ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p 
framework
[PATCH 2/4] ARM: S5PC100: Add support for gpio interrupt
[PATCH 3/4] ARM: S5PC100: use common plat-s5p external interrupt code
[PATCH 4/4] ARM: remove obsolete plat-s5pc1xx directory

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center

--
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 1/4] ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework

2010-05-19 Thread Marek Szyprowski
This patch moves S5PC100 SoC support to plat-s5p framework. Most
periperal support code has been already moved from plat-s5pc1xx to
mach-s5pc100.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/Kconfig   |9 +-
 arch/arm/Makefile  |3 +-
 arch/arm/mach-s5pc100/Kconfig  |7 +-
 arch/arm/mach-s5pc100/Makefile |3 +-
 arch/arm/mach-s5pc100/cpu.c|   56 ---
 arch/arm/mach-s5pc100/gpiolib.c|   24 ++--
 arch/arm/mach-s5pc100/include/mach/debug-macro.S   |6 +-
 arch/arm/mach-s5pc100/include/mach/entry-macro.S   |8 +-
 arch/arm/mach-s5pc100/include/mach/irqs.h  |  101 +-
 arch/arm/mach-s5pc100/include/mach/map.h   |  156 +---
 arch/arm/mach-s5pc100/include/mach/regs-clock.h|6 +
 arch/arm/mach-s5pc100/include/mach/regs-gpio.h |6 +-
 arch/arm/mach-s5pc100/include/mach/regs-irq.h  |7 +-
 arch/arm/mach-s5pc100/include/mach/system.h|9 +-
 arch/arm/mach-s5pc100/include/mach/tick.h  |4 +-
 .../s5pc100-init.c = mach-s5pc100/init.c} |7 +-
 arch/arm/mach-s5pc100/mach-smdkc100.c  |   11 +-
 arch/arm/plat-s5p/Kconfig  |2 +-
 arch/arm/plat-s5p/cpu.c|   10 ++
 arch/arm/plat-s5p/include/plat/s5pc100.h   |   33 
 arch/arm/plat-samsung/Kconfig  |2 +-
 21 files changed, 267 insertions(+), 203 deletions(-)
 rename arch/arm/{plat-s5pc1xx/s5pc100-init.c = mach-s5pc100/init.c} (68%)
 create mode 100644 arch/arm/plat-s5p/include/plat/s5pc100.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3f8718f..1cb098f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -699,14 +699,14 @@ config ARCH_S5P6442
help
  Samsung S5P6442 CPU based systems
 
-config ARCH_S5PC1XX
-   bool Samsung S5PC1XX
+config ARCH_S5PC100
+   bool Samsung S5PC100
select GENERIC_GPIO
select HAVE_CLK
select CPU_V7
select ARM_L1_CACHE_SHIFT_6
help
- Samsung S5PC1XX series based systems
+ Samsung S5PC100 series based systems
 
 config ARCH_S5PV210
bool Samsung S5PV210/S5PC110
@@ -890,7 +890,6 @@ source arch/arm/mach-sa1100/Kconfig
 source arch/arm/plat-samsung/Kconfig
 source arch/arm/plat-s3c24xx/Kconfig
 source arch/arm/plat-s5p/Kconfig
-source arch/arm/plat-s5pc1xx/Kconfig
 
 if ARCH_S3C2410
 source arch/arm/mach-s3c2400/Kconfig
@@ -909,9 +908,7 @@ source arch/arm/mach-s5p6440/Kconfig
 
 source arch/arm/mach-s5p6442/Kconfig
 
-if ARCH_S5PC1XX
 source arch/arm/mach-s5pc100/Kconfig
-endif
 
 source arch/arm/mach-s5pv210/Kconfig
 
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 9505a70..f7cb6d4 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -167,7 +167,7 @@ machine-$(CONFIG_ARCH_S3C24A0)  := s3c24a0
 machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx
 machine-$(CONFIG_ARCH_S5P6440) := s5p6440
 machine-$(CONFIG_ARCH_S5P6442) := s5p6442
-machine-$(CONFIG_ARCH_S5PC1XX) := s5pc100
+machine-$(CONFIG_ARCH_S5PC100) := s5pc100
 machine-$(CONFIG_ARCH_S5PV210) := s5pv210
 machine-$(CONFIG_ARCH_SA1100)  := sa1100
 machine-$(CONFIG_ARCH_SHARK)   := shark
@@ -192,7 +192,6 @@ plat-$(CONFIG_PLAT_NOMADIK) := nomadik
 plat-$(CONFIG_PLAT_ORION)  := orion
 plat-$(CONFIG_PLAT_PXA):= pxa
 plat-$(CONFIG_PLAT_S3C24XX):= s3c24xx samsung
-plat-$(CONFIG_PLAT_S5PC1XX):= s5pc1xx samsung
 plat-$(CONFIG_PLAT_S5P):= s5p samsung
 
 ifeq ($(CONFIG_ARCH_EBSA110),y)
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 70b57d1..fe1216b 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -5,10 +5,11 @@
 
 # Configuration options for the S5PC100 CPU
 
+if ARCH_S5PC100
+
 config CPU_S5PC100
bool
-   select CPU_S5PC100_INIT
-   select CPU_S5PC100_CLOCK
+   select PLAT_S5P
help
  Enable S5PC100 CPU support
 
@@ -46,3 +47,5 @@ config MACH_SMDKC100
select S5PC100_SETUP_SDHCI
help
  Machine support for the Samsung SMDKC100
+
+endif
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index 9a545ca..9b52d2a 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -11,7 +11,7 @@ obj-  :=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)  += cpu.o gpiolib.o
+obj-$(CONFIG_CPU_S5PC100)  += cpu.o init.o clock.o gpiolib.o
 obj-$(CONFIG_CPU_S5PC100)  += setup-i2c0.o
 
 # Helper and device support
@@ -22,4 +22,5 @@ obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o
 obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o

[PATCH 1/7] ARM: S5PV210: add support for software reset

2010-05-20 Thread Marek Szyprowski
Add missing call for software reset (system reboot).

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pv210/include/mach/regs-clock.h |2 ++
 arch/arm/mach-s5pv210/include/mach/system.h |7 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h 
b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
index e56e0e4..40dd24f 100644
--- a/arch/arm/mach-s5pv210/include/mach/regs-clock.h
+++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
@@ -91,6 +91,8 @@
 #define S5P_CLKDIV0_PCLK66_MASK(0x7  
S5P_CLKDIV0_PCLK66_SHIFT)
 
 /* Registers related to power management */
+#define S5P_SWRESETS5P_CLKREG(0x2000)
+
 #define S5P_PWR_CFGS5P_CLKREG(0xC000)
 #define S5P_EINT_WAKEUP_MASK   S5P_CLKREG(0xC004)
 #define S5P_WAKEUP_MASKS5P_CLKREG(0xC008)
diff --git a/arch/arm/mach-s5pv210/include/mach/system.h 
b/arch/arm/mach-s5pv210/include/mach/system.h
index 1ca04d5..ba39203 100644
--- a/arch/arm/mach-s5pv210/include/mach/system.h
+++ b/arch/arm/mach-s5pv210/include/mach/system.h
@@ -13,6 +13,10 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H __FILE__
 
+#include linux/io.h
+#include mach/map.h
+#include mach/regs-clock.h
+
 static void arch_idle(void)
 {
/* nothing here yet */
@@ -20,7 +24,8 @@ static void arch_idle(void)
 
 static void arch_reset(char mode, const char *cmd)
 {
-   /* nothing here yet */
+   __raw_writel(0x1, S5P_SWRESET);
+   return;
 }
 
 #endif /* __ASM_ARCH_SYSTEM_H */
-- 
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 3/7] ARM: Samsung: move common framebuffer regs to common platform directory

2010-05-20 Thread Marek Szyprowski
From: Pawel Osciak p.osc...@samsung.com

The framebuffer register blocks on S5PC100 and S5PV210/S5PC110 differ
only slightly. This patch extracts all register definitions that are
common to S5PC100 and S5PC110 into plat-samsung/plat/regs-fb-v5.h and
adds a new file with C110-specific register definitions to the
mach-s5pv210/include/mach directory.

Signed-off-by: Pawel Osciak p.osc...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pc100/include/mach/regs-fb.h|  130 +
 arch/arm/mach-s5pv210/include/mach/regs-fb.h|   91 +++
 arch/arm/plat-samsung/include/plat/regs-fb-v5.h |  138 +++
 3 files changed, 236 insertions(+), 123 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/include/mach/regs-fb.h
 create mode 100644 arch/arm/plat-samsung/include/plat/regs-fb-v5.h

diff --git a/arch/arm/mach-s5pc100/include/mach/regs-fb.h 
b/arch/arm/mach-s5pc100/include/mach/regs-fb.h
index 1732cd2..c5d75c5 100644
--- a/arch/arm/mach-s5pc100/include/mach/regs-fb.h
+++ b/arch/arm/mach-s5pc100/include/mach/regs-fb.h
@@ -3,137 +3,21 @@
  * 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

[PATCH v3] Add support for Samsung Aquila board (S5PC110 based)

2010-05-20 Thread Marek Szyprowski
Hello,

This patch series add basic support for Samsung Aquila board. The board
is based on Samsung S5PC110 SoC. This patch series also add platform
device helpers for i2c, fb and hsmmc drivers.

Changes since v2:
- rebased onto git://git.fluff.org/bjdooks/linux for-linus/samsung4
- added missing changes to mach-s5pv210/setup-i2c0.c

Changes since v1:
- removed custom gpiolib implementation in favour of the GPIOlib patch
  provided by Pannaga Bhushan,
- adjusted hsmmc setup code for 'sclk_mmc' clock names

This patch series includes:

[PATCH 1/7] ARM: S5PV210: add support for software reset
[PATCH 2/7] ARM: S5PV210: add Aquila board
[PATCH 3/7] ARM: Samsung: move common framebuffer regs to common platform 
directory
[PATCH 4/7] ARM: S5PV210: add framebuffer platform helpers for s5pv210 based 
machines
[PATCH 5/7] ARM: S5PV210: add support for s3c-fb driver on Aquila machine
[PATCH 6/7] ARM: S5PV210: add common I2C device helpers
[PATCH 7/7] ARM: S5PV210: add common HSMMC device helpers

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center
--
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 7/7] ARM: S5PV210: add common HSMMC device helpers

2010-05-20 Thread Marek Szyprowski
This patch adds sdhci platform helpers required by sdhci-s3c driver.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig  |   11 +++
 arch/arm/mach-s5pv210/Makefile |2 +
 arch/arm/mach-s5pv210/cpu.c|6 ++
 arch/arm/mach-s5pv210/include/mach/map.h   |5 ++
 arch/arm/mach-s5pv210/setup-sdhci-gpio.c   |  104 
 arch/arm/mach-s5pv210/setup-sdhci.c|   63 +
 arch/arm/plat-samsung/include/plat/sdhci.h |   55 +++
 7 files changed, 246 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-sdhci-gpio.c
 create mode 100644 arch/arm/mach-s5pv210/setup-sdhci.c

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 7e5c264..bccd3f5 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -32,6 +32,17 @@ config S5PV210_SETUP_FB_24BPP
help
   Common setup code for S5PV210 with an 24bpp RGB display helper.
 
+config S5PV210_SETUP_SDHCI
+bool
+select S5PV210_SETUP_SDHCI_GPIO
+help
+  Internal helper functions for S5PV210 based SDHCI systems
+
+config S5PV210_SETUP_SDHCI_GPIO
+   bool
+   help
+ Common setup code for SDHCI gpio.
+
 config MACH_SMDKV210
bool SMDKV210
select CPU_S5PV210
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 722b69f..0b389bb 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -27,3 +27,5 @@ obj-y += dev-audio.o
 obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)   += setup-fb-24bpp.o
 obj-$(CONFIG_S5PV210_SETUP_I2C1)   += setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2)   += setup-i2c2.o
+obj-$(CONFIG_S5PV210_SETUP_SDHCI)   += setup-sdhci.o
+obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c
index 2d4a3d2..c5d53ab 100644
--- a/arch/arm/mach-s5pv210/cpu.c
+++ b/arch/arm/mach-s5pv210/cpu.c
@@ -33,6 +33,7 @@
 #include plat/clock.h
 #include plat/s5pv210.h
 #include plat/iic-core.h
+#include plat/sdhci.h
 
 /* Initial IO mappings */
 
@@ -77,6 +78,11 @@ void __init s5pv210_map_io(void)
 {
iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
 
+   /* initialise device information early */
+   s5pv210_default_sdhci0();
+   s5pv210_default_sdhci1();
+   s5pv210_default_sdhci2();
+
/* the i2c devices are directly compatible with s3c2440 */
s3c_i2c0_setname(s3c2440-i2c);
s3c_i2c1_setname(s3c2440-i2c);
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h 
b/arch/arm/mach-s5pv210/include/mach/map.h
index 0254e08..eeb1ca7 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -51,6 +51,8 @@
 
 #define S5PV210_PA_FB  (0xF800)
 
+#define S5PV210_PA_HSMMC(x)(0xEB00 + ((x) * 0x10))
+
 #define S5PV210_PA_VIC0(0xF200)
 #define S5P_PA_VIC0S5PV210_PA_VIC0
 
@@ -81,6 +83,9 @@
 
 /* compatibiltiy defines. */
 #define S3C_PA_UARTS5PV210_PA_UART
+#define S3C_PA_HSMMC0  S5PV210_PA_HSMMC(0)
+#define S3C_PA_HSMMC1  S5PV210_PA_HSMMC(1)
+#define S3C_PA_HSMMC2  S5PV210_PA_HSMMC(2)
 #define S3C_PA_IIC S5PV210_PA_IIC0
 #define S3C_PA_IIC1S5PV210_PA_IIC1
 #define S3C_PA_IIC2S5PV210_PA_IIC2
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c 
b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
new file mode 100644
index 000..fe7d86d
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -0,0 +1,104 @@
+/* linux/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
+ *
+ * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * S5PV210 - 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 s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
+{
+   unsigned int gpio;
+
+   /* Set all the necessary GPG0/GPG1 pins to special-function 2 */
+   for (gpio = S5PV210_GPG0(0); gpio  S5PV210_GPG0(2); gpio++) {
+   s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+   s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+   }
+   switch (width) {
+   case 8:
+   /* GPG1[3:6] special-funtion 3 */
+   for (gpio

[PATCH 2/7] ARM: S5PV210: add Aquila board

2010-05-20 Thread Marek Szyprowski
Add basic support for Samsung Aquila board. This board is based
on S5PC110 SoC.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig   |   12 ++--
 arch/arm/mach-s5pv210/Makefile  |1 +
 arch/arm/mach-s5pv210/mach-aquila.c |  100 +++
 3 files changed, 107 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/mach-aquila.c

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 525964e..195ac8f 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -17,11 +17,6 @@ config CPU_S5PV210
help
  Enable S5PV210 CPU support
 
-choice
-   prompt Select machine type
-   depends on ARCH_S5PV210
-   default MACH_SMDKV210
-
 config MACH_SMDKV210
bool SMDKV210
select CPU_S5PV210
@@ -37,6 +32,11 @@ config MACH_SMDKC110
  Machine support for Samsung SMDKC110
  S5PC110(MCP) is one of package option of S5PV210
 
-endchoice
+config MACH_AQUILA
+   bool Samsung Aquila
+   select CPU_S5PV210
+   select ARCH_SPARSEMEM_ENABLE
+   help
+ Machine support for the Samsung Aquila target based on S5PC110 SoC
 
 endif
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 9982781..8f23acf 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_CPU_S5PV210) += setup-i2c0.o
 
 obj-$(CONFIG_MACH_SMDKV210)+= mach-smdkv210.o
 obj-$(CONFIG_MACH_SMDKC110)+= mach-smdkc110.o
+obj-$(CONFIG_MACH_AQUILA)  += mach-aquila.o
 
 # device support
 
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c 
b/arch/arm/mach-s5pv210/mach-aquila.c
new file mode 100644
index 000..6a1db39
--- /dev/null
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -0,0 +1,100 @@
+/* linux/arch/arm/mach-s5pv210/mach-aquila.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ * http://www.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/kernel.h
+#include linux/types.h
+#include linux/init.h
+#include linux/serial_core.h
+
+#include asm/mach/arch.h
+#include asm/mach/map.h
+#include asm/setup.h
+#include asm/mach-types.h
+
+#include mach/map.h
+#include mach/regs-clock.h
+
+#include plat/regs-serial.h
+#include plat/s5pv210.h
+#include plat/devs.h
+#include plat/cpu.h
+
+/* Following are default values for UCON, ULCON and UFCON UART registers */
+#define S5PV210_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |\
+S3C2410_UCON_RXILEVEL |\
+S3C2410_UCON_TXIRQMODE |   \
+S3C2410_UCON_RXIRQMODE |   \
+S3C2410_UCON_RXFIFO_TOI |  \
+S3C2443_UCON_RXERR_IRQEN)
+
+#define S5PV210_ULCON_DEFAULT  S3C2410_LCON_CS8
+
+#define S5PV210_UFCON_DEFAULT  (S3C2410_UFCON_FIFOMODE |   \
+S5PV210_UFCON_TXTRIG4 |\
+S5PV210_UFCON_RXTRIG4)
+
+static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
+   [0] = {
+   .hwport = 0,
+   .flags  = 0,
+   .ucon   = S5PV210_UCON_DEFAULT,
+   .ulcon  = S5PV210_ULCON_DEFAULT,
+   .ufcon  = S5PV210_UFCON_DEFAULT,
+   },
+   [1] = {
+   .hwport = 1,
+   .flags  = 0,
+   .ucon   = S5PV210_UCON_DEFAULT,
+   .ulcon  = S5PV210_ULCON_DEFAULT,
+   .ufcon  = S5PV210_UFCON_DEFAULT,
+   },
+   [2] = {
+   .hwport = 2,
+   .flags  = 0,
+   .ucon   = S5PV210_UCON_DEFAULT,
+   .ulcon  = S5PV210_ULCON_DEFAULT,
+   .ufcon  = S5PV210_UFCON_DEFAULT,
+   },
+   [3] = {
+   .hwport = 3,
+   .flags  = 0,
+   .ucon   = S5PV210_UCON_DEFAULT,
+   .ulcon  = S5PV210_ULCON_DEFAULT,
+   .ufcon  = S5PV210_UFCON_DEFAULT,
+   },
+};
+
+static struct platform_device *aquila_devices[] __initdata = {
+};
+
+static void __init aquila_map_io(void)
+{
+   s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+   s3c24xx_init_clocks(2400);
+   s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
+}
+
+static void __init aquila_machine_init(void)
+{
+   platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
+}
+
+MACHINE_START(AQUILA, Aquila)
+   /* Maintainers:
+  Marek Szyprowski m.szyprow

[PATCH 5/7] ARM: S5PV210: add support for s3c-fb driver on Aquila machine

2010-05-20 Thread Marek Szyprowski
This patch adds required platform definitions to enable s3c-fb
driver. Two framebuffer windows in 480x800x16bpp mode are defined.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig   |2 +
 arch/arm/mach-s5pv210/mach-aquila.c |   49 +++
 2 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 9a05e16..073d9c5 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -41,6 +41,8 @@ config MACH_AQUILA
bool Samsung Aquila
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
+   select S5PV210_SETUP_FB_24BPP
+   select S3C_DEV_FB
help
  Machine support for the Samsung Aquila target based on S5PC110 SoC
 
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c 
b/arch/arm/mach-s5pv210/mach-aquila.c
index 6a1db39..10bc76e 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -12,6 +12,7 @@
 #include linux/types.h
 #include linux/init.h
 #include linux/serial_core.h
+#include linux/fb.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -20,11 +21,13 @@
 
 #include mach/map.h
 #include mach/regs-clock.h
+#include mach/regs-fb.h
 
 #include plat/regs-serial.h
 #include plat/s5pv210.h
 #include plat/devs.h
 #include plat/cpu.h
+#include plat/fb.h
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PV210_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |\
@@ -71,7 +74,50 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata 
= {
},
 };
 
+/* Frame Buffer */
+static struct s3c_fb_pd_win aquila_fb_win0 = {
+   .win_mode = {
+   .pixclock = 1ULL / ((16+16+2+480)*(28+3+2+800)*60),
+   .left_margin = 16,
+   .right_margin = 16,
+   .upper_margin = 3,
+   .lower_margin = 28,
+   .hsync_len = 2,
+   .vsync_len = 2,
+   .xres = 480,
+   .yres = 800,
+   },
+   .max_bpp = 32,
+   .default_bpp = 16,
+};
+
+static struct s3c_fb_pd_win aquila_fb_win1 = {
+   .win_mode = {
+   .pixclock = 1ULL / ((16+16+2+480)*(28+3+2+800)*60),
+   .left_margin = 16,
+   .right_margin = 16,
+   .upper_margin = 3,
+   .lower_margin = 28,
+   .hsync_len = 2,
+   .vsync_len = 2,
+   .xres = 480,
+   .yres = 800,
+   },
+   .max_bpp = 32,
+   .default_bpp = 16,
+};
+
+static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
+   .win[0] = aquila_fb_win0,
+   .win[1] = aquila_fb_win1,
+   .vidcon0= VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
+   .vidcon1= VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
+ VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
+   .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
+};
+
 static struct platform_device *aquila_devices[] __initdata = {
+   s3c_device_fb,
 };
 
 static void __init aquila_map_io(void)
@@ -83,6 +129,9 @@ static void __init aquila_map_io(void)
 
 static void __init aquila_machine_init(void)
 {
+   /* FB */
+   s3c_fb_set_platdata(aquila_lcd_pdata);
+
platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
 }
 
-- 
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 4/7] ARM: S5PV210: add framebuffer platform helpers for s5pv210 based machines

2010-05-20 Thread Marek Szyprowski
This patch adds common framebuffer device helpers and register defines
for S5PV210 based machines.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig   |5 ++
 arch/arm/mach-s5pv210/Makefile  |1 +
 arch/arm/mach-s5pv210/include/mach/irqs.h   |5 ++
 arch/arm/mach-s5pv210/include/mach/map.h|3 +
 arch/arm/mach-s5pv210/include/mach/regs-clock.h |1 +
 arch/arm/mach-s5pv210/setup-fb-24bpp.c  |   62 +++
 arch/arm/plat-samsung/include/plat/fb.h |7 +++
 7 files changed, 84 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-fb-24bpp.c

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 195ac8f..9a05e16 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -17,6 +17,11 @@ config CPU_S5PV210
help
  Enable S5PV210 CPU support
 
+config S5PV210_SETUP_FB_24BPP
+   bool
+   help
+  Common setup code for S5PV210 with an 24bpp RGB display helper.
+
 config MACH_SMDKV210
bool SMDKV210
select CPU_S5PV210
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 8f23acf..f73975d 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -24,3 +24,4 @@ obj-$(CONFIG_MACH_AQUILA) += mach-aquila.o
 # device support
 
 obj-y  += dev-audio.o
+obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)   += setup-fb-24bpp.o
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h 
b/arch/arm/mach-s5pv210/include/mach/irqs.h
index 69712bb..9689537 100644
--- a/arch/arm/mach-s5pv210/include/mach/irqs.h
+++ b/arch/arm/mach-s5pv210/include/mach/irqs.h
@@ -124,4 +124,9 @@
 /* Set the default NR_IRQS */
 #define NR_IRQS(IRQ_EINT(31) + 1)
 
+/* Compatibility */
+#define IRQ_LCD_FIFO   IRQ_LCD0
+#define IRQ_LCD_VSYNC  IRQ_LCD1
+#define IRQ_LCD_SYSTEM IRQ_LCD2
+
 #endif /* ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h 
b/arch/arm/mach-s5pv210/include/mach/map.h
index 5adcb9f..e6bb12c 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -47,6 +47,8 @@
 #define S5PV210_PA_PDMA0   0xE090
 #define S5PV210_PA_PDMA1   0xE0A0
 
+#define S5PV210_PA_FB  (0xF800)
+
 #define S5PV210_PA_VIC0(0xF200)
 #define S5P_PA_VIC0S5PV210_PA_VIC0
 
@@ -78,5 +80,6 @@
 /* compatibiltiy defines. */
 #define S3C_PA_UARTS5PV210_PA_UART
 #define S3C_PA_IIC S5PV210_PA_IIC0
+#define S3C_PA_FB  S5PV210_PA_FB
 
 #endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h 
b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
index 40dd24f..0a3d7ad 100644
--- a/arch/arm/mach-s5pv210/include/mach/regs-clock.h
+++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
@@ -128,6 +128,7 @@
 
 #define S5P_RST_STAT   S5P_CLKREG(0xA000)
 #define S5P_OSC_CONS5P_CLKREG(0x8000)
+#define S5P_MDNIE_SEL  S5P_CLKREG(0x7008)
 #define S5P_MIPI_PHY_CON0  S5P_CLKREG(0x7200)
 #define S5P_MIPI_PHY_CON1  S5P_CLKREG(0x7204)
 #define S5P_MIPI_CONTROL   S5P_CLKREG(0xE814)
diff --git a/arch/arm/mach-s5pv210/setup-fb-24bpp.c 
b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
new file mode 100644
index 000..a50cbac
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
@@ -0,0 +1,62 @@
+/* linux/arch/arm/plat-s5pv210/setup-fb-24bpp.c
+ *
+ * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * Base s5pv210 setup information for 24bpp LCD framebuffer
+ *
+ * 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/fb.h
+
+#include mach/regs-fb.h
+#include mach/gpio.h
+#include mach/map.h
+#include plat/fb.h
+#include mach/regs-clock.h
+#include plat/gpio-cfg.h
+
+void s5pv210_fb_gpio_setup_24bpp(void)
+{
+   unsigned int gpio = 0;
+
+   for (gpio = S5PV210_GPF0(0); gpio = S5PV210_GPF0(7); gpio++) {
+   s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+   s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+   s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
+   }
+
+   for (gpio = S5PV210_GPF1(0); gpio = S5PV210_GPF1(7); gpio++) {
+   s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+   s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+   s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
+   }
+
+   for (gpio = S5PV210_GPF2(0); gpio = S5PV210_GPF2(7); gpio++) {
+   s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2

[PATCH] ARM: Samsung: Add platform support code for OneNAND controller

2010-05-20 Thread Marek Szyprowski
This patch adds setup code for Samsung OneNAND controller driver. The
driver needs to be aware on which SoC it is running, so the actual
device id is being changed in cpu init code. S3C64xx SoCs have 2 OneNAND
controllers while S5PC100 and S5PC110 has only one.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com

---

The patch has been prepared in assumtion that the plat-s5pc1xx cleanup
patches has been applied as well as Add support for Samsung Aquila
board (S5PC110 based) patch series.

The driver itself has been merged by mtd maintainers, but without the
platform setup code it is useless.

Changes sinve v2:
* rebased onto git://git.fluff.org/bjdooks/linux for-linus/samsung4

Changes since v1:
* addressed all coding style issues reported by Ben
* moved all resource definitions to platform device resources
* moved all resource definitions for different SoCs from regs-onenand.h to
  arch/arm/mach-{s3c64xx,s5pc100,s5pv210}/include/mach/map.h
* moved all #ifdef conditional code to separate functions

Changes since first submission attempt (long time ago):
* all cpu conditional code in the driver has been redesigned from cpu_is_xxx()
macros to actual device ids.

The Samsung OneNAND driver itself has been posted also to the Linux MTD
mailing list (linux-...@lists.infradead.org).

---
 arch/arm/mach-s3c64xx/Kconfig |5 ++
 arch/arm/mach-s3c64xx/Makefile|1 +
 arch/arm/mach-s3c64xx/dev-onenand1.c  |   55 ++
 arch/arm/mach-s3c64xx/include/mach/irqs.h |4 +
 arch/arm/mach-s3c64xx/include/mach/map.h  |   13 
 arch/arm/mach-s3c64xx/s3c6400.c   |4 +
 arch/arm/mach-s3c64xx/s3c6410.c   |3 +
 arch/arm/mach-s5pc100/cpu.c   |3 +
 arch/arm/mach-s5pc100/include/mach/map.h  |7 ++
 arch/arm/mach-s5pv210/Kconfig |5 ++
 arch/arm/mach-s5pv210/Makefile|2 +
 arch/arm/mach-s5pv210/dev-onenand.c   |   50 
 arch/arm/mach-s5pv210/include/mach/map.h  |3 +
 arch/arm/plat-samsung/Kconfig |5 ++
 arch/arm/plat-samsung/Makefile|1 +
 arch/arm/plat-samsung/dev-onenand.c   |   55 ++
 arch/arm/plat-samsung/include/plat/devs.h |3 +
 arch/arm/plat-samsung/include/plat/onenand-core.h |   37 
 arch/arm/plat-samsung/include/plat/regs-onenand.h |   63 +
 19 files changed, 319 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s3c64xx/dev-onenand1.c
 create mode 100644 arch/arm/mach-s5pv210/dev-onenand.c
 create mode 100644 arch/arm/plat-samsung/dev-onenand.c
 create mode 100644 arch/arm/plat-samsung/include/plat/onenand-core.h
 create mode 100644 arch/arm/plat-samsung/include/plat/regs-onenand.h

diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 69e9fbf..805da81 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -35,6 +35,11 @@ config S3C64XX_SETUP_SDHCI
  Internal configuration for default SDHCI setup for S3C6400 and
  S3C6410 SoCs.
 
+config S3C64XX_DEV_ONENAND1
+   bool
+   help
+ Compile in platform device definition for OneNAND1 controller
+
 # platform specific device setup
 
 config S3C64XX_SETUP_I2C0
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index a10f1fc..1788318 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -59,3 +59,4 @@ obj-y += dev-uart.o
 obj-y  += dev-audio.o
 obj-$(CONFIG_S3C64XX_DEV_SPI)  += dev-spi.o
 obj-$(CONFIG_S3C64XX_DEV_TS)   += dev-ts.o
+obj-$(CONFIG_S3C64XX_DEV_ONENAND1) += dev-onenand1.o
diff --git a/arch/arm/mach-s3c64xx/dev-onenand1.c 
b/arch/arm/mach-s3c64xx/dev-onenand1.c
new file mode 100644
index 000..92ffd5b
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/dev-onenand1.c
@@ -0,0 +1,55 @@
+/*
+ * linux/arch/arm/mach-s3c64xx/dev-onenand1.c
+ *
+ *  Copyright (c) 2008-2010 Samsung Electronics
+ *  Kyungmin Park kyungmin.p...@samsung.com
+ *
+ * S3C64XX series device definition for OneNAND devices
+ *
+ * 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/mtd/mtd.h
+#include linux/mtd/onenand.h
+
+#include mach/irqs.h
+#include mach/map.h
+
+static struct resource s3c64xx_onenand1_resources[] = {
+   [0] = {
+   .start  = S3C64XX_PA_ONENAND1,
+   .end= S3C64XX_PA_ONENAND1 + 0x400 - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = S3C64XX_PA_ONENAND1_BUF

RE: [PATCH] ARM: Samsung: Add platform support code for OneNAND controller

2010-05-20 Thread Marek Szyprowski
Hello,

On Thursday, May 20, 2010 10:49 AM Ben Dooks wrote:

 On Thu, May 20, 2010 at 08:59:05AM +0200, Marek Szyprowski wrote:
  This patch adds setup code for Samsung OneNAND controller driver. The
  driver needs to be aware on which SoC it is running, so the actual
  device id is being changed in cpu init code. S3C64xx SoCs have 2 OneNAND
  controllers while S5PC100 and S5PC110 has only one.
 
  Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 
 Ok, in future please try and keep a core and then have the architecture
 additions seperate, it makes it very difficult to deal with any problems
 whilst merging and means there is a higher possibility of a problem during
 this.

Ok, but I'm still not 100% sure how should I handle case like this properly.
I thought that separating platform files from the driver itself would help
merging it, because each part (the driver and platform setup code/register
definitions) can be merged separately by the respective maintainers. Was it
wrong that the platform patch was prepared for the tree after plat-s5pc1xx
moves? 

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center


--
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


RE: [PATCH] ARM: S5P: Fix the platform external interrupt issues.

2010-05-24 Thread Marek Szyprowski
Hello,

On Monday, May 24, 2010 9:44 AM Kukjin Kim wrote:

 From: Pannaga Bhushan p.bhus...@samsung.com
 
 This patch does the following:
 
 1. Corrects the common platform code for external interrupts for using the
VIC mask/unmask bits also.
 2. Moves the common defines related to external interrupt for plat-s5p
to common files.
 3. Based on the new common defines, corresponding changes are made in the
affected platforms (S5P6440, S5P6442 and S5PC100).
 
 Signed-off-by: Pannaga Bhushan p.bhus...@samsung.com
 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
  arch/arm/mach-s5p6440/include/mach/irqs.h  |9 -
  arch/arm/mach-s5p6442/include/mach/irqs.h  |5 +++--
  arch/arm/mach-s5pc100/include/mach/irqs.h  |3 ---
  arch/arm/mach-s5pv210/include/mach/irqs.h  |   14 ++
  arch/arm/mach-s5pv210/include/mach/regs-gpio.h |   14 +-
  arch/arm/plat-s5p/Kconfig  |1 +
  arch/arm/plat-s5p/include/plat/irqs.h  |7 +++
  arch/arm/plat-s5p/irq-eint.c   |   15 ++-
  8 files changed, 40 insertions(+), 28 deletions(-)

This patch lacks a fix for arch/arm/mach-s5pc100/include/mach/regs-gpio.h
file. It should revert the changes from commit 45c79433c02b8fe7b8a1cbf6054
to that file. Without it the external interrupt 16..31 does not work on
S5PC100.

Best regards
--
Marek Szyprowski
Samsung Poland RD Center

--
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


RE: [PATCH 1/4] ARM: S3C64XX: Add support for Compact Flash driver on SMDK6410

2010-05-27 Thread Marek Szyprowski
  S3C_CLKREG(0x3C)
   #define S3C6410_CLK_SRC2   S3C_CLKREG(0x10C)
  +#define S3C_MEM_SYS_CFGS3C_CLKREG(0x120)
 
   /* CLKDIV0 */
   #define S3C6400_CLKDIV0_PCLK_MASK  (0xf  12)
  @@ -154,4 +155,8 @@
   #define S3C6400_CLKSRC_EPLL_MOUT_SHIFT (2)
   #define S3C6400_CLKSRC_MFC (1  4)
 
  +/* MEM_SYS_CFG */
  +#define MEM_SYS_CFG_INDEP_CF   0x4000
  +#define MEM_SYS_CFG_EBI_FIX_PRI_CFCON  0x30
  +
   #endif /* _PLAT_REGS_CLOCK_H */
  diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-
 s3c64xx/mach-smdk6410.c
  index d9a0355..cc1bb0f 100644
  --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
  +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
  @@ -56,6 +56,7 @@
   #include mach/regs-gpio.h
   #include mach/regs-sys.h
   #include mach/regs-srom.h
  +#include plat/ata.h
   #include plat/iic.h
   #include plat/fb.h
   #include plat/gpio-cfg.h
  @@ -242,6 +243,11 @@ static struct platform_device smdk6410_b_pwr_5v = {
   };
   #endif
 
  +static struct s3c_ide_platdata smdk6410_ide_pdata __initdata = {
  +   .setup_gpio = s3c_ide_setup_gpio,
  +   .cfg_mode   = s3c_ide_cfg_mode,
 
 
 These should have been called s3c64xx_ide...
 
 I'll have a think about what we should be doing with this, it might
 be wroth passing this via the archdata and leaving the platform data
 for the board. If these configs are generally going to be per SoC
 then i'd prefer to see this in the archdata and once per SoC.
 
  +};
  +
   static struct map_desc smdk6410_iodesc[] = {};
 
   static struct platform_device *smdk6410_devices[] __initdata = {
  @@ -267,6 +273,7 @@ static struct platform_device *smdk6410_devices[]
 __initdata = {
  s3c_device_adc,
  s3c_device_ts,
  s3c_device_wdt,
  +   s3c_device_cfcon,
   };
 
   #ifdef CONFIG_REGULATOR
  @@ -665,6 +672,8 @@ 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));
 
  +   s3c_ide_set_platdata(smdk6410_ide_pdata);
  +
  platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
   }
 
  diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-
 s3c64xx/s3c6410.c
  index 014401c..1d1dce4 100644
  --- a/arch/arm/mach-s3c64xx/s3c6410.c
  +++ b/arch/arm/mach-s3c64xx/s3c6410.c
  @@ -58,6 +58,7 @@ void __init s3c6410_map_io(void)
  s3c_device_nand.name = s3c6400-nand;
  s3c_onenand_setname(s3c6410-onenand);
  s3c64xx_onenand1_setname(s3c6410-onenand);
  +   s3c_device_cfcon.name = s3c6400-pata;
   }
 
 let's get this sorted out and use one method. see Kyungmin Park's prev.
 comments on the subject.

There are boards that doesn't have cf/ide connector at all. It would be good
to have s3c-dev not compiled in for some custom kernels. It would be better
to hide the driver name change behind a function/macro like it is done for
the one-nand driver.

Best regards
--
Marek Szyprowski
Samsung Poland RD Center



--
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 3/3] s5pv210: Aquila: add definitions for sdhci devices

2010-06-09 Thread Marek Szyprowski
This patch add support for SDHCI blocks on Samsung Aquila board. The
following host controllers are defined:
1. Internal MoviNAND device (permanently wired to the controller)
2. Internal WiFI SDIO device (card is activated by power regualor)
3. External MMC/SD socket (card detection is provided by external
gpio interrupt)

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig   |4 ++
 arch/arm/mach-s5pv210/mach-aquila.c |   66 +++
 2 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index b7a2f38..dcc9d74 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -57,7 +57,11 @@ config MACH_AQUILA
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
select S5PV210_SETUP_FB_24BPP
+   select S5PV210_SETUP_SDHCI
select S3C_DEV_FB
+   select S3C_DEV_HSMMC
+   select S3C_DEV_HSMMC1
+   select S3C_DEV_HSMMC2
select S5PC110_DEV_ONENAND
help
  Machine support for the Samsung Aquila target based on S5PC110 SoC
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c 
b/arch/arm/mach-s5pv210/mach-aquila.c
index fb9dbb2..1b7fe79 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -13,6 +13,7 @@
 #include linux/init.h
 #include linux/serial_core.h
 #include linux/fb.h
+#include linux/gpio.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -22,12 +23,15 @@
 #include mach/map.h
 #include mach/regs-clock.h
 #include mach/regs-fb.h
+#include mach/regs-gpio.h
 
 #include plat/regs-serial.h
 #include plat/s5pv210.h
 #include plat/devs.h
 #include plat/cpu.h
 #include plat/fb.h
+#include plat/gpio-cfg.h
+#include plat/sdhci.h
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PV210_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |\
@@ -116,9 +120,66 @@ static struct s3c_fb_platdata aquila_lcd_pdata __initdata 
= {
.setup_gpio = s5pv210_fb_gpio_setup_24bpp,
 };
 
+/* MoviNAND */
+static struct s3c_sdhci_platdata aquila_hsmmc0_data __initdata = {
+   .max_width  = 4,
+   .cd_type= S3C_SDHCI_CD_PERMANENT,
+};
+
+/* Wireless LAN */
+static struct s3c_sdhci_platdata aquila_hsmmc1_data __initdata = {
+   .max_width  = 4,
+   .cd_type= S3C_SDHCI_CD_EXTERNAL,
+   /* ext_cd_{init,cleanup} callbacks will be added later */
+};
+
+/* External Flash */
+#define AQUILA_EXT_FLASH_IRQ   IRQ_EINT(28)/* S5PV210_GPH3(4) */
+#define AQUILA_EXT_FLASH_ENS5PV210_MP05(4)
+#define AQUILA_EXT_FLASH_CDS5PV210_GPH3(4)
+
+static irqreturn_t aquila_ext_flash_card_detect_isr(int irq, void *dev_id)
+{
+   void (*notify_func)(struct platform_device *, int state) = dev_id;
+   notify_func(s3c_device_hsmmc2, !gpio_get_value(AQUILA_EXT_FLASH_CD));
+   return IRQ_HANDLED;
+}
+
+static int aquila_ext_flash_card_detect_init(
+   void (*notify_func)(struct platform_device *, int state))
+{
+   gpio_request(AQUILA_EXT_FLASH_EN, FLASH_EN);
+   gpio_direction_output(AQUILA_EXT_FLASH_EN, 1);
+
+   if (request_irq(AQUILA_EXT_FLASH_IRQ, aquila_ext_flash_card_detect_isr,
+   IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+   SDHCI card detect, notify_func))
+   printk(KERN_ERR Error: cannot request irq for External 
Flash\n);
+   return 0;
+}
+
+static int aquila_ext_flash_card_detect_cleanup(
+   void (*notify_func)(struct platform_device *, int state))
+{
+   free_irq(AQUILA_EXT_FLASH_IRQ, notify_func);
+   gpio_direction_output(AQUILA_EXT_FLASH_EN, 0);
+   gpio_free(AQUILA_EXT_FLASH_EN);
+   return 0;
+}
+
+static struct s3c_sdhci_platdata aquila_hsmmc2_data __initdata = {
+   .max_width  = 4,
+   .cd_type= S3C_SDHCI_CD_EXTERNAL,
+   .ext_cd_init= aquila_ext_flash_card_detect_init,
+   .ext_cd_cleanup = aquila_ext_flash_card_detect_cleanup,
+};
+
 static struct platform_device *aquila_devices[] __initdata = {
s3c_device_fb,
s5pc110_device_onenand,
+   s3c_device_hsmmc0,
+   s3c_device_hsmmc1,
+   s3c_device_hsmmc2,
 };
 
 static void __init aquila_map_io(void)
@@ -130,6 +191,11 @@ static void __init aquila_map_io(void)
 
 static void __init aquila_machine_init(void)
 {
+   /* SDHCI */
+   s3c_sdhci0_set_platdata(aquila_hsmmc0_data);
+   s3c_sdhci1_set_platdata(aquila_hsmmc1_data);
+   s3c_sdhci2_set_platdata(aquila_hsmmc2_data);
+
/* FB */
s3c_fb_set_platdata(aquila_lcd_pdata);
 
-- 
1.7.1.240.g225c

--
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

[PATCH 1/3] s3c64xx: Fix build without SDHCI controllers

2010-06-09 Thread Marek Szyprowski
This patch fixes the following compilation problem if only NCP machine
is selected:

arch/arm/mach-s3c64xx/s3c6410.c: In function ‘s3c6410_map_io’:
arch/arm/mach-s3c64xx/s3c6410.c:51: error: implicit declaration of function 
‘s3c6410_default_sdhci2’

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/plat-samsung/include/plat/sdhci.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h 
b/arch/arm/plat-samsung/include/plat/sdhci.h
index 13f9fb2..c2044e5 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -166,6 +166,7 @@ static inline void s3c6410_default_sdhci2(void) { }
 #else
 static inline void s3c6410_default_sdhci0(void) { }
 static inline void s3c6410_default_sdhci1(void) { }
+static inline void s3c6410_default_sdhci2(void) { }
 static inline void s3c6400_default_sdhci0(void) { }
 static inline void s3c6400_default_sdhci1(void) { }
 
-- 
1.7.1.240.g225c

--
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 1/5] sdhci-s3c: depend on plat-samsung

2010-06-09 Thread Marek Szyprowski
Most Samsung SoC have support for SDHCI block, so make the driver
dependent on the Samsung platform instead on listing all SoCs in the
Kconfig (and updating it again when support for the new SoC variant is
added).

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/mmc/host/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index e171e77..acf5bf6 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -123,7 +123,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_SAMSUNG
help
  This selects the Secure Digital Host Controller Interface (SDHCI)
  often referrered to as the HSMMC block in some of the Samsung S3C
-- 
1.7.1.240.g225c

--
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 3/5] sdhci-s3c: increase the timeout value

2010-06-09 Thread Marek Szyprowski
This patch increases the timeout value on sdhci-s3c controller by using
SDHCI_QUIRK_BROKEN_TIMEOUT_VAL quirk. Without it most transfers from
external mmc cards fails on Samsung s5pv210 SoCs based systems. Tested
on Samsung Aquila board.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/mmc/host/sdhci-s3c.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index ad30f07..2b6cb44 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -331,6 +331,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device 
*pdev)
 * transfers, not sure if this is a problem with this specific
 * SDHCI block, or a missing configuration that needs to be set. */
host-quirks |= SDHCI_QUIRK_NO_BUSY_IRQ;
+   host-quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
host-quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
 SDHCI_QUIRK_32BIT_DMA_SIZE);
-- 
1.7.1.240.g225c

--
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 4/5] sdhci-s3c: add support for the non standard minimal clock value

2010-06-09 Thread Marek Szyprowski
S3C SDHCI host controller can change the source for generating mmc clock.
By default host bus clock is used, what causes some problems on machines
with 133MHz bus, because the SDHCI divider cannot be as high get proper
clock value for identification mode. This is not a problem for the
controller, because it can generate lower frequencies from other clock
sources. This patch adds a new quirk to SDHCI driver to calculate the
minimal supported clock frequency.

This fixes the flood of the following warnings on Samsung S5PV210 SoCs:
mmc0: Minimum clock frequency too high for identification mode

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/mmc/host/sdhci-of-esdhc.c |1 +
 drivers/mmc/host/sdhci-s3c.c  |   29 +
 drivers/mmc/host/sdhci.c  |2 +-
 drivers/mmc/host/sdhci.h  |2 ++
 4 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c 
b/drivers/mmc/host/sdhci-of-esdhc.c
index c8623de..64b3f79 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -124,6 +124,7 @@ struct sdhci_of_data sdhci_esdhc = {
  SDHCI_QUIRK_BROKEN_CARD_DETECTION |
  SDHCI_QUIRK_NO_BUSY_IRQ |
  SDHCI_QUIRK_NONSTANDARD_CLOCK |
+ SDHCI_QUIRK_NONSTANDARD_MINCLOCK |
  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
  SDHCI_QUIRK_PIO_NEEDS_DELAY |
  SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET |
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 2b6cb44..615008d 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -209,10 +209,37 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, 
unsigned int clock)
}
 }
 
+/**
+ * sdhci_s3c_get_min_clock - callback to get minimal supported clock value
+ * @host: The SDHCI host being queried
+ *
+ * To init mmc host properly a minimal clock value is needed. For high system
+ * bus clock's values the standard formula gives values out of allowed range.
+ * The clock still can be set to lower values, if clock source other then
+ * system bus is selected.
+*/
+static unsigned int sdhci_s3c_get_min_clock(struct sdhci_host *host)
+{
+   struct sdhci_s3c *ourhost = to_s3c(host);
+   unsigned int delta, min = UINT_MAX;
+   int src;
+
+   for (src = 0; src  MAX_BUS_CLK; src++) {
+   delta = sdhci_s3c_consider_clock(ourhost, src, 0);
+   if (delta == UINT_MAX)
+   continue;
+   /* delta is a negative value in this case */
+   if (-delta  min)
+   min = -delta;
+   }
+   return min;
+}
+
 static struct sdhci_ops sdhci_s3c_ops = {
.get_max_clock  = sdhci_s3c_get_max_clk,
.get_timeout_clock  = sdhci_s3c_get_timeout_clk,
.set_clock  = sdhci_s3c_set_clock,
+   .get_min_clock  = sdhci_s3c_get_min_clock,
 };
 
 static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
@@ -316,6 +343,8 @@ static int __devinit sdhci_s3c_probe(struct platform_device 
*pdev)
host-quirks = 0;
host-irq = irq;
 
+   host-quirks |= SDHCI_QUIRK_NONSTANDARD_MINCLOCK;
+
/* Setup quirks for the controller */
host-quirks |= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC;
 
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c6d1bd8..8b3ee53 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1785,7 +1785,7 @@ int sdhci_add_host(struct sdhci_host *host)
 * Set host parameters.
 */
mmc-ops = sdhci_ops;
-   if (host-quirks  SDHCI_QUIRK_NONSTANDARD_CLOCK 
+   if (host-quirks  SDHCI_QUIRK_NONSTANDARD_MINCLOCK 
host-ops-set_clock  host-ops-get_min_clock)
mmc-f_min = host-ops-get_min_clock(host);
else
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index c846813..3fd87c2 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -240,6 +240,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN  (125)
 /* Controller cannot support End Attribute in NOP ADMA descriptor */
 #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC  (126)
+/* Controller has nonstandard clock management */
+#define SDHCI_QUIRK_NONSTANDARD_MINCLOCK   (127)
 
int irq;/* Device IRQ */
void __iomem *  ioaddr; /* Mapped address */
-- 
1.7.1.240.g225c

--
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] arm: s5pv210: add more banks to gpiolib

2010-06-09 Thread Marek Szyprowski
This patch adds support for MP04 and MP05 gpio banks.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com

---

Changes since v1:
- fixed style issues reported by Kukjin Kim

 arch/arm/mach-s5pv210/gpiolib.c   |   14 ++
 arch/arm/mach-s5pv210/include/mach/gpio.h |   12 +---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-s5pv210/gpiolib.c b/arch/arm/mach-s5pv210/gpiolib.c
index f4ac81f..0261908 100644
--- a/arch/arm/mach-s5pv210/gpiolib.c
+++ b/arch/arm/mach-s5pv210/gpiolib.c
@@ -208,6 +208,20 @@ static struct s3c_gpio_chip s5pv210_gpio_4bit[] = {
.label  = MP03,
},
}, {
+   .config = gpio_cfg_noint,
+   .chip   = {
+   .base   = S5PV210_MP04(0),
+   .ngpio  = S5PV210_GPIO_MP04_NR,
+   .label  = MP04,
+   },
+   }, {
+   .config = gpio_cfg_noint,
+   .chip   = {
+   .base   = S5PV210_MP05(0),
+   .ngpio  = S5PV210_GPIO_MP05_NR,
+   .label  = MP05,
+   },
+   }, {
.base   = (S5P_VA_GPIO + 0xC00),
.config = gpio_cfg_noint,
.chip   = {
diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h 
b/arch/arm/mach-s5pv210/include/mach/gpio.h
index d6461ba..1f4b595 100644
--- a/arch/arm/mach-s5pv210/include/mach/gpio.h
+++ b/arch/arm/mach-s5pv210/include/mach/gpio.h
@@ -52,6 +52,8 @@
 #define S5PV210_GPIO_MP01_NR   (8)
 #define S5PV210_GPIO_MP02_NR   (4)
 #define S5PV210_GPIO_MP03_NR   (8)
+#define S5PV210_GPIO_MP04_NR   (8)
+#define S5PV210_GPIO_MP05_NR   (8)
 
 /* GPIO bank numbers */
 
@@ -94,6 +96,8 @@ enum s5p_gpio_number {
S5PV210_GPIO_MP01_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_J4),
S5PV210_GPIO_MP02_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP01),
S5PV210_GPIO_MP03_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP02),
+   S5PV210_GPIO_MP04_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP03),
+   S5PV210_GPIO_MP05_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP04),
 };
 
 /* S5PV210 GPIO number definitions */
@@ -127,13 +131,15 @@ enum s5p_gpio_number {
 #define S5PV210_MP01(_nr)  (S5PV210_GPIO_MP01_START + (_nr))
 #define S5PV210_MP02(_nr)  (S5PV210_GPIO_MP02_START + (_nr))
 #define S5PV210_MP03(_nr)  (S5PV210_GPIO_MP03_START + (_nr))
+#define S5PV210_MP04(_nr)  (S5PV210_GPIO_MP04_START + (_nr))
+#define S5PV210_MP05(_nr)  (S5PV210_GPIO_MP05_START + (_nr))
 
 /* the end of the S5PV210 specific gpios */
-#define S5PV210_GPIO_END   (S5PV210_MP03(S5PV210_GPIO_MP03_NR) + 1)
+#define S5PV210_GPIO_END   (S5PV210_MP05(S5PV210_GPIO_MP05_NR) + 1)
 #define S3C_GPIO_END   S5PV210_GPIO_END
 
-/* define the number of gpios we need to the one after the MP03() range */
-#define ARCH_NR_GPIOS  (S5PV210_MP03(S5PV210_GPIO_MP03_NR) +   \
+/* define the number of gpios we need to the one after the MP05() range */
+#define ARCH_NR_GPIOS  (S5PV210_MP05(S5PV210_GPIO_MP05_NR) +   \
 CONFIG_SAMSUNG_GPIO_EXTRA + 1)
 
 #include asm-generic/gpio.h
-- 
1.7.1.240.g225c

--
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] s3c64xx: Fix build without SDHCI controllers

2010-06-10 Thread Marek Szyprowski
This patch fixes the following compilation problem if only NCP machine
is selected:

arch/arm/mach-s3c64xx/s3c6410.c: In function ‘s3c6410_map_io’:
arch/arm/mach-s3c64xx/s3c6410.c:51: error: implicit declaration of function 
‘s3c6410_default_sdhci2’

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/plat-samsung/include/plat/sdhci.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h 
b/arch/arm/plat-samsung/include/plat/sdhci.h
index 13f9fb2..2e263a8 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -166,8 +166,10 @@ static inline void s3c6410_default_sdhci2(void) { }
 #else
 static inline void s3c6410_default_sdhci0(void) { }
 static inline void s3c6410_default_sdhci1(void) { }
+static inline void s3c6410_default_sdhci2(void) { }
 static inline void s3c6400_default_sdhci0(void) { }
 static inline void s3c6400_default_sdhci1(void) { }
+static inline void s3c6400_default_sdhci2(void) { }
 
 #endif /* CONFIG_S3C64XX_SETUP_SDHCI */
 
-- 
1.7.1.240.g225c

--
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


  1   2   3   4   5   6   7   8   9   10   >