RE: [PATCH v2 3/3] sdhci-s3c: Add SDHCI_QUIRK_NO_WP_BIT quirk

2010-07-05 Thread Marek Szyprowski
Hello,

On Saturday, July 03, 2010 3:01 AM Kukjin Kim wrote:

 From: Hyuk Lee hyuk1@samsung.com
 
 If host controller doesn't have WP pin which should be connnected with
 SDMMC
 card WP pin, can implement get_ro function with using the allocated gpio.
 In order to use this quirk wp_gpio in the platform data must be set.
 
 Signed-off-by: Hyuk Lee hyuk1@samsung.com
 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
  drivers/mmc/host/sdhci-s3c.c |   44
 ++
  drivers/mmc/host/sdhci.c |3 ++
  drivers/mmc/host/sdhci.h |3 ++
  3 files changed, 50 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
 index af21792..ed9376d 100644
 --- a/drivers/mmc/host/sdhci-s3c.c
 +++ b/drivers/mmc/host/sdhci-s3c.c
 @@ -18,11 +18,13 @@
  #include linux/slab.h
  #include linux/clk.h
  #include linux/io.h
 +#include linux/gpio.h
 
  #include linux/mmc/host.h
 
  #include plat/sdhci.h
  #include plat/regs-sdhci.h
 +#include plat/gpio-cfg.h
 
  #include sdhci.h
 
 @@ -209,6 +211,36 @@ static void sdhci_s3c_set_clock(struct sdhci_host
 *host, unsigned int clock)
   }
  }
 
 +/**
 + * sdhci_s3c_get_ro - callback for get_ro
 + * @host: The SDHCI host being changed
 + *
 + * If the WP pin is connected with GPIO, can get the value which indicates
 + * the card is locked or not.
 +*/
 +static int sdhci_s3c_get_ro(struct mmc_host *mmc)
 +{
 + struct sdhci_s3c *sc;
 + struct sdhci_host *host;
 +
 + host = mmc_priv(mmc);
 + sc = sdhci_priv(host);
 +
 + return gpio_get_value(sc-pdata-wp_gpio);
 +}
 +
 +/**
 + * sdhci_s3c_cfg_wp - configure GPIO for WP pin
 + * @gpio_num: GPIO number which connected with WP line from SD/MMC slot
 + *
 + * Configure GPIO for using WP line
 +*/
 +static void sdhci_s3c_cfg_wp(unsigned int gpio_num)
 +{
 + s3c_gpio_cfgpin(gpio_num, S3C_GPIO_INPUT);
 + s3c_gpio_setpull(gpio_num, S3C_GPIO_PULL_UP);
 +}
 +
  static struct sdhci_ops sdhci_s3c_ops = {
   .get_max_clock  = sdhci_s3c_get_max_clk,
   .get_timeout_clock  = sdhci_s3c_get_timeout_clk,
 @@ -311,6 +343,9 @@ static int __devinit sdhci_s3c_probe(struct
 platform_device *pdev)
   if (pdata-cfg_gpio)
   pdata-cfg_gpio(pdev, pdata-max_width);
 
 + if (pdata-wp_gpio)
 + sdhci_s3c_ops.get_ro = sdhci_s3c_get_ro;
 +
   host-hw_name = samsung-hsmmc;
   host-ops = sdhci_s3c_ops;
   host-quirks = 0;
 @@ -335,6 +370,15 @@ static int __devinit sdhci_s3c_probe(struct
 platform_device *pdev)
   host-quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
SDHCI_QUIRK_32BIT_DMA_SIZE);
 
 + /* Controller's WP pin donsn't connected with SD card. So we allocate
 +  * a GPIO for getting WP data from SD card and use that data as
 +  * the return value of the get_ro function */
 + host-quirks |= SDHCI_QUIRK_NO_WP_BIT;
 +
 + /* to configure gpio pin as a card write protection signal */
 + if (pdata-wp_gpio)
 + sdhci_s3c_cfg_wp(pdata-wp_gpio);
 +

Assuming that pdata-wp_gpio == 0 means that the board has no additional wp
feature is wrong from the 'good and clean' API point of view. For example
GPIO_A0(0) pin for S5PV210 is gpio number 0. This would mean that it cannot
be used for this feature at all. 

I was told to use gpio_is_valid() macro and use -1 as 'invalid gpio' pin
number for implementing similar checks.

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 3/3] sdhci-s3c: Add SDHCI_QUIRK_NO_WP_BIT quirk

2010-07-05 Thread Kukjin Kim
Marek Szyprowski wrote:
 
 Hello,
 
Hello :-)

 On Saturday, July 03, 2010 3:01 AM Kukjin Kim wrote:
 
  From: Hyuk Lee hyuk1@samsung.com
 
  If host controller doesn't have WP pin which should be connnected with
  SDMMC
  card WP pin, can implement get_ro function with using the allocated
gpio.
  In order to use this quirk wp_gpio in the platform data must be set.
 
  Signed-off-by: Hyuk Lee hyuk1@samsung.com
  Signed-off-by: Kukjin Kim kgene@samsung.com
  ---
   drivers/mmc/host/sdhci-s3c.c |   44
  ++
   drivers/mmc/host/sdhci.c |3 ++
   drivers/mmc/host/sdhci.h |3 ++
   3 files changed, 50 insertions(+), 0 deletions(-)
 
  diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
  index af21792..ed9376d 100644
  --- a/drivers/mmc/host/sdhci-s3c.c
  +++ b/drivers/mmc/host/sdhci-s3c.c
  @@ -18,11 +18,13 @@
   #include linux/slab.h
   #include linux/clk.h
   #include linux/io.h
  +#include linux/gpio.h
 
   #include linux/mmc/host.h
 
   #include plat/sdhci.h
   #include plat/regs-sdhci.h
  +#include plat/gpio-cfg.h
 
   #include sdhci.h
 
  @@ -209,6 +211,36 @@ static void sdhci_s3c_set_clock(struct sdhci_host
  *host, unsigned int clock)
  }
   }
 
  +/**
  + * sdhci_s3c_get_ro - callback for get_ro
  + * @host: The SDHCI host being changed
  + *
  + * If the WP pin is connected with GPIO, can get the value which
indicates
  + * the card is locked or not.
  +*/
  +static int sdhci_s3c_get_ro(struct mmc_host *mmc)
  +{
  +   struct sdhci_s3c *sc;
  +   struct sdhci_host *host;
  +
  +   host = mmc_priv(mmc);
  +   sc = sdhci_priv(host);
  +
  +   return gpio_get_value(sc-pdata-wp_gpio);
  +}
  +
  +/**
  + * sdhci_s3c_cfg_wp - configure GPIO for WP pin
  + * @gpio_num: GPIO number which connected with WP line from SD/MMC slot
  + *
  + * Configure GPIO for using WP line
  +*/
  +static void sdhci_s3c_cfg_wp(unsigned int gpio_num)
  +{
  +   s3c_gpio_cfgpin(gpio_num, S3C_GPIO_INPUT);
  +   s3c_gpio_setpull(gpio_num, S3C_GPIO_PULL_UP);
  +}
  +
   static struct sdhci_ops sdhci_s3c_ops = {
  .get_max_clock  = sdhci_s3c_get_max_clk,
  .get_timeout_clock  = sdhci_s3c_get_timeout_clk,
  @@ -311,6 +343,9 @@ static int __devinit sdhci_s3c_probe(struct
  platform_device *pdev)
  if (pdata-cfg_gpio)
  pdata-cfg_gpio(pdev, pdata-max_width);
 
  +   if (pdata-wp_gpio)
  +   sdhci_s3c_ops.get_ro = sdhci_s3c_get_ro;
  +
  host-hw_name = samsung-hsmmc;
  host-ops = sdhci_s3c_ops;
  host-quirks = 0;
  @@ -335,6 +370,15 @@ static int __devinit sdhci_s3c_probe(struct
  platform_device *pdev)
  host-quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
   SDHCI_QUIRK_32BIT_DMA_SIZE);
 
  +   /* Controller's WP pin donsn't connected with SD card. So we
allocate
  +* a GPIO for getting WP data from SD card and use that data as
  +* the return value of the get_ro function */
  +   host-quirks |= SDHCI_QUIRK_NO_WP_BIT;
  +
  +   /* to configure gpio pin as a card write protection signal */
  +   if (pdata-wp_gpio)
  +   sdhci_s3c_cfg_wp(pdata-wp_gpio);
  +
 
 Assuming that pdata-wp_gpio == 0 means that the board has no additional
wp
 feature is wrong from the 'good and clean' API point of view. For example
 GPIO_A0(0) pin for S5PV210 is gpio number 0. This would mean that it
cannot
 be used for this feature at all.
 
Oh, you're right. missed that point.

 I was told to use gpio_is_valid() macro and use -1 as 'invalid gpio' pin
 number for implementing similar checks.

OK..will fix it.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim kgene@samsung.com, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

--
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] Samsung Aquila GONI update

2010-07-05 Thread Marek Szyprowski
Hello,

This short patch series adds basic framebuffer defintion to Samsung GONI
board as well as PMIC8998 support for both Samsung Aquila and GONI
boards. MAX8998 PMIC driver has been accepted by regulator subsystem
maintainers and is already available in the 'next' kernel tree (see
commit 8d017ab9f81089cb5ffde0e354d13130c1c1). 

Changes since v1:
- removed all consumer entries, will be readded with aproperiate devices
(suggested by Mark Brown)

The series contains the following patches:

[PATCH 1/3] arm: s5pv210: GONI: add support for framebuffer
[PATCH 2/3] arm: s5pv210: Aquila: add support for MAX8998 PMIC
[PATCH 3/3] arm: s5pv210: GONI: add support for MAX8998 PMIC

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 2/3] arm: s5pv210: Aquila: add support for MAX8998 PMIC

2010-07-05 Thread Marek Szyprowski
This patch adds required platform definitions for MAX8998 PMIC driver. Power
regulators for LDO and BUCK outputs has been defined as well as a simple
gpio-keys button for power key (to enable wakeup functionality with
external interrupt).

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

diff --git a/arch/arm/mach-s5pv210/mach-aquila.c 
b/arch/arm/mach-s5pv210/mach-aquila.c
index 44db0fc..ad0ee96 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -13,6 +13,11 @@
 #include linux/init.h
 #include linux/serial_core.h
 #include linux/fb.h
+#include linux/i2c.h
+#include linux/i2c-gpio.h
+#include linux/mfd/max8998.h
+#include linux/gpio_keys.h
+#include linux/input.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -22,7 +27,9 @@
 #include mach/map.h
 #include mach/regs-clock.h
 #include mach/regs-fb.h
+#include mach/gpio.h
 
+#include plat/gpio-cfg.h
 #include plat/regs-serial.h
 #include plat/s5pv210.h
 #include plat/devs.h
@@ -122,7 +129,321 @@ static struct s3c_fb_platdata aquila_lcd_pdata __initdata 
= {
.setup_gpio = s5pv210_fb_gpio_setup_24bpp,
 };
 
+/* MAX8998 regulators */
+#if defined(CONFIG_REGULATOR_MAX8998) || \
+   defined(CONFIG_REGULATOR_MAX8998_MODULE)
+
+static struct regulator_init_data aquila_ldo2_data = {
+   .constraints= {
+   .name   = VALIVE_1.1V,
+   .min_uV = 110,
+   .max_uV = 110,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   .state_mem  = {
+   .enabled = 1,
+   },
+   },
+};
+
+static struct regulator_init_data aquila_ldo3_data = {
+   .constraints= {
+   .name   = VUSB/MIPI_1.1V,
+   .min_uV = 110,
+   .max_uV = 110,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo4_data = {
+   .constraints= {
+   .name   = VDAC_3.3V,
+   .min_uV = 330,
+   .max_uV = 330,
+   .apply_uV   = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo5_data = {
+   .constraints= {
+   .name   = VTF_2.8V,
+   .min_uV = 280,
+   .max_uV = 280,
+   .apply_uV   = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo6_data = {
+   .constraints= {
+   .name   = VCC_3.3V,
+   .min_uV = 330,
+   .max_uV = 330,
+   .apply_uV   = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo7_data = {
+   .constraints= {
+   .name   = VCC_3.0V,
+   .min_uV = 300,
+   .max_uV = 300,
+   .apply_uV   = 1,
+   .boot_on= 1,
+   .always_on  = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo8_data = {
+   .constraints= {
+   .name   = VUSB/VADC_3.3V,
+   .min_uV = 330,
+   .max_uV = 330,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo9_data = {
+   .constraints= {
+   .name   = VCC/VCAM_2.8V,
+   .min_uV = 280,
+   .max_uV = 280,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo10_data = {
+   .constraints= {
+   .name   = VPLL_1.1V,
+   .min_uV = 110,
+   .max_uV = 110,
+   .apply_uV   = 1,
+   .boot_on= 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo11_data = {
+   .constraints= {
+   .name   = CAM_IO_2.8V,
+   .min_uV = 280,
+   .max_uV = 280,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo12_data = {
+   .constraints= {
+   .name   = CAM_ISP_1.2V,
+   .min_uV = 120,
+   .max_uV = 120,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo13_data = {
+   .constraints= {
+   .name  

[PATCH 1/3] arm: s5pv210: GONI: add support for framebuffer

2010-07-05 Thread Marek Szyprowski
This patch adds required platform definitions to enable s3c-fb
driver on GONI board. One framebuffer window in 480x800x16bpp mode is
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-goni.c |   39 +
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 5e88941..8ab4bb0 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -59,6 +59,8 @@ config MACH_GONI
bool GONI
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
+   select S5PV210_SETUP_FB_24BPP
+   select S3C_DEV_FB
select S5PC110_DEV_ONENAND
help
  Machine support for Samsung GONI board
diff --git a/arch/arm/mach-s5pv210/mach-goni.c 
b/arch/arm/mach-s5pv210/mach-goni.c
index 88c38e3..05b4a1a 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -12,6 +12,9 @@
 #include linux/types.h
 #include linux/init.h
 #include linux/serial_core.h
+#include linux/fb.h
+#include linux/delay.h
+#include linux/clk.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -20,11 +23,15 @@
 
 #include mach/map.h
 #include mach/regs-clock.h
+#include mach/regs-fb.h
+#include mach/gpio.h
 
+#include plat/gpio-cfg.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 |\
@@ -73,7 +80,35 @@ static struct s3c2410_uartcfg goni_uartcfgs[] __initdata = {
},
 };
 
+/* Frame Buffer */
+static struct s3c_fb_pd_win goni_fb_win0 = {
+   .win_mode = {
+   .pixclock = 1ULL / ((16+16+2+480)*(28+3+2+800)*55),
+   .left_margin = 16,
+   .right_margin = 16,
+   .upper_margin = 3,
+   .lower_margin = 28,
+   .hsync_len = 2,
+   .vsync_len = 2,
+   .xres = 480,
+   .yres = 800,
+   .refresh = 55,
+   },
+   .max_bpp = 32,
+   .default_bpp = 16,
+};
+
+static struct s3c_fb_platdata goni_lcd_pdata __initdata = {
+   .win[0] = goni_fb_win0,
+   .vidcon0= VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
+   VIDCON0_CLKSEL_LCD,
+   .vidcon1= VIDCON1_INV_VCLK | VIDCON1_INV_VDEN
+   | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
+   .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
+};
+
 static struct platform_device *goni_devices[] __initdata = {
+   s3c_device_fb,
s5pc110_device_onenand,
 };
 
@@ -86,6 +121,10 @@ static void __init goni_map_io(void)
 
 static void __init goni_machine_init(void)
 {
+
+   /* FB */
+   s3c_fb_set_platdata(goni_lcd_pdata);
+
platform_add_devices(goni_devices, ARRAY_SIZE(goni_devices));
 }
 
-- 
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] ARM: S5P: Add PMU device

2010-07-05 Thread Maurus Cuelenaere
 Op 05-07-10 03:46, Joonyoung Shim schreef:
 This patch adds an initcall for the s5p platforms so that they register
 their PMU IRQs with the PMU framework in the Kernel.

 Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
 ---
  arch/arm/mach-s5p6442/include/mach/irqs.h |2 +-
  arch/arm/mach-s5pc100/include/mach/irqs.h |1 +
  arch/arm/mach-s5pv210/include/mach/irqs.h |1 +
  arch/arm/plat-s5p/Makefile|1 +
  arch/arm/plat-s5p/dev-pmu.c   |   37 
 +
  5 files changed, 41 insertions(+), 1 deletions(-)
  create mode 100644 arch/arm/plat-s5p/dev-pmu.c

Wouldn't it be better if this was in plat-samsung? I can see that the S3C6410
datasheet mentions a PMU_IRQ_ENABLE bit in SYS_OTHERS so I suspect that it has
the same functionality (even though there's no mention of which interrupt this
is).


-- 
Maurus Cuelenaere
--
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 v3] Add support HSMMC on Samsung SMDKV210

2010-07-05 Thread Kukjin Kim
This patch adds support hsmmc on SMDKV210.

Changes since v2:

- Moved some codes for support hsmmc3 on smdkv210 to second patch

Changes since v1:

- Fixed wrong pin name in comments
- Adding missed call s5pv210_default_sdhci3() in s5pv210_map_io()
- Minor coding style fixes

[PATCH v3 1/2] ARM: SAMSUNG: Add device definition for HSMMC3
[PATCH v3 2/2] ARM: S5PV210: Add support HSMMC on SMDKV210
--
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 v3 1/2] ARM: SAMSUNG: Add device definition for HSMMC3

2010-07-05 Thread Kukjin Kim
From: Hyuk Lee hyuk1@samsung.com

This patch adds hsmmc3 device definition in plat-samsung. Because now
S5PV210 can support 4 hsmmc such as hsmmc0, hsmmc1, hsmmc2 and hsmmc3
and that can be used in further Samsung SoCs.

Signed-off-by: Hyuk Lee hyuk1@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
 arch/arm/plat-samsung/Kconfig  |5 ++
 arch/arm/plat-samsung/Makefile |1 +
 arch/arm/plat-samsung/dev-hsmmc3.c |   72 
 arch/arm/plat-samsung/include/plat/devs.h  |1 +
 arch/arm/plat-samsung/include/plat/sdhci.h |2 +
 5 files changed, 81 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-samsung/dev-hsmmc3.c

diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 2753fb3..8efb012 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -160,6 +160,11 @@ config S3C_DEV_HSMMC2
help
  Compile in platform device definitions for HSMMC channel 2
 
+config S3C_DEV_HSMMC3
+   bool
+   help
+ Compile in platform device definitions for HSMMC channel 3
+
 config S3C_DEV_HWMON
bool
help
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index b1d82cc..c9abae5 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_S3C_ADC) += adc.o
 obj-$(CONFIG_S3C_DEV_HSMMC)+= dev-hsmmc.o
 obj-$(CONFIG_S3C_DEV_HSMMC1)   += dev-hsmmc1.o
 obj-$(CONFIG_S3C_DEV_HSMMC2)   += dev-hsmmc2.o
+obj-$(CONFIG_S3C_DEV_HSMMC3)   += dev-hsmmc3.o
 obj-$(CONFIG_S3C_DEV_HWMON)+= dev-hwmon.o
 obj-y  += dev-i2c0.o
 obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c 
b/arch/arm/plat-samsung/dev-hsmmc3.c
new file mode 100644
index 000..57bd394
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-hsmmc3.c
@@ -0,0 +1,72 @@
+/* linux/arch/arm/plat-samsung/dev-hsmmc3.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * Copyright (c) 2008 Simtec Electronics
+ * Ben Dooks b...@simtec.co.uk
+ * http://armlinux.simtec.co.uk/
+ *
+ * Based on arch/arm/plat-samsung/dev-hsmmc1.c
+ *
+ * Samsung device definition for hsmmc device 3
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include linux/kernel.h
+#include linux/platform_device.h
+#include linux/mmc/host.h
+
+#include mach/map.h
+#include plat/sdhci.h
+#include plat/devs.h
+
+#define S3C_SZ_HSMMC   (0x1000)
+
+static struct resource s3c_hsmmc3_resource[] = {
+   [0] = {
+   .start  = S3C_PA_HSMMC3,
+   .end= S3C_PA_HSMMC3 + S3C_SZ_HSMMC - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = IRQ_MMC3,
+   .end= IRQ_MMC3,
+   .flags  = IORESOURCE_IRQ,
+   }
+};
+
+static u64 s3c_device_hsmmc3_dmamask = 0xUL;
+
+struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
+   .max_width  = 4,
+   .host_caps  = (MMC_CAP_4_BIT_DATA |
+  MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
+};
+
+struct platform_device s3c_device_hsmmc3 = {
+   .name   = s3c-sdhci,
+   .id = 3,
+   .num_resources  = ARRAY_SIZE(s3c_hsmmc3_resource),
+   .resource   = s3c_hsmmc3_resource,
+   .dev= {
+   .dma_mask   = s3c_device_hsmmc3_dmamask,
+   .coherent_dma_mask  = 0xUL,
+   .platform_data  = s3c_hsmmc3_def_platdata,
+   },
+};
+
+void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
+{
+   struct s3c_sdhci_platdata *set = s3c_hsmmc3_def_platdata;
+
+   set-max_width = pd-max_width;
+
+   if (pd-cfg_gpio)
+   set-cfg_gpio = pd-cfg_gpio;
+   if (pd-cfg_card)
+   set-cfg_card = pd-cfg_card;
+}
diff --git a/arch/arm/plat-samsung/include/plat/devs.h 
b/arch/arm/plat-samsung/include/plat/devs.h
index e6144e4..7842acd 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -54,6 +54,7 @@ extern struct platform_device s3c_device_hwmon;
 extern struct platform_device s3c_device_hsmmc0;
 extern struct platform_device s3c_device_hsmmc1;
 extern struct platform_device s3c_device_hsmmc2;
+extern struct platform_device s3c_device_hsmmc3;
 
 extern struct platform_device s3c_device_spi0;
 extern struct platform_device s3c_device_spi1;
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h 
b/arch/arm/plat-samsung/include/plat/sdhci.h
index 98ebd50..72224db 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -58,6 +58,7 @@ struct s3c_sdhci_platdata {
 extern void 

[PATCH v3 2/2] ARM: S5PV210: Add support HSMMC on SMDKV210

2010-07-05 Thread Kukjin Kim
From: Hyuk Lee hyuk1@samsung.com

This patch adds support HSMMC on SMDKV210, and gpio configuration for
S5PV210 hsmmc3.

Signed-off-by: Hyuk Lee hyuk1@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig  |5 +
 arch/arm/mach-s5pv210/cpu.c|1 +
 arch/arm/mach-s5pv210/include/mach/map.h   |1 +
 arch/arm/mach-s5pv210/mach-smdkv210.c  |4 
 arch/arm/mach-s5pv210/setup-sdhci-gpio.c   |   20 
 arch/arm/plat-samsung/include/plat/sdhci.h |   13 +
 6 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 0761eac..6aee967 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -72,9 +72,14 @@ config MACH_SMDKV210
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
select SAMSUNG_DEV_ADC
+   select S3C_DEV_HSMMC
+   select S3C_DEV_HSMMC1
+   select S3C_DEV_HSMMC2
+   select S3C_DEV_HSMMC3
select SAMSUNG_DEV_TS
select S3C_DEV_WDT
select HAVE_S3C2410_WATCHDOG
+   select S5PV210_SETUP_SDHCI
help
  Machine support for Samsung SMDKV210
 
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c
index 411a4a9..765034e 100644
--- a/arch/arm/mach-s5pv210/cpu.c
+++ b/arch/arm/mach-s5pv210/cpu.c
@@ -86,6 +86,7 @@ void __init s5pv210_map_io(void)
s5pv210_default_sdhci0();
s5pv210_default_sdhci1();
s5pv210_default_sdhci2();
+   s5pv210_default_sdhci3();
 
/* the i2c devices are directly compatible with s3c2440 */
s3c_i2c0_setname(s3c2440-i2c);
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h 
b/arch/arm/mach-s5pv210/include/mach/map.h
index 34eb168..fa9d7c2 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -97,6 +97,7 @@
 #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_HSMMC3  S5PV210_PA_HSMMC(3)
 #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/mach-smdkv210.c 
b/arch/arm/mach-s5pv210/mach-smdkv210.c
index 0d46279..b08f376 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -77,6 +77,10 @@ static struct platform_device *smdkv210_devices[] __initdata 
= {
s5pv210_device_iis0,
s5pv210_device_ac97,
s3c_device_adc,
+   s3c_device_hsmmc0,
+   s3c_device_hsmmc1,
+   s3c_device_hsmmc2,
+   s3c_device_hsmmc3,
s3c_device_ts,
s3c_device_wdt,
 };
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c 
b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
index fe7d86d..143bfec 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -102,3 +102,23 @@ void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device 
*dev, int width)
s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_UP);
s3c_gpio_cfgpin(S5PV210_GPG2(2), S3C_GPIO_SFN(2));
 }
+
+void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
+{
+   unsigned int gpio;
+
+   /* Set all the necessary GPG3[0:2] pins to special-function 2 */
+   for (gpio = S5PV210_GPG3(0); gpio  S5PV210_GPG3(2); gpio++) {
+   s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+   s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+   }
+
+   /* Data pin GPG3[3:6] to special-function 2 */
+   for (gpio = S5PV210_GPG3(3); gpio = S5PV210_GPG3(6); gpio++) {
+   s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+   s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+   }
+
+   s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP);
+   s3c_gpio_cfgpin(S5PV210_GPG3(2), S3C_GPIO_SFN(2));
+}
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h 
b/arch/arm/plat-samsung/include/plat/sdhci.h
index 72224db..1314ffa 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -80,6 +80,7 @@ extern void s3c64xx_setup_sdhci2_cfg_gpio(struct 
platform_device *, int w);
 extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
 extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
 extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
+extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
 
 /* S3C6400 SDHCI setup */
 
@@ -266,10 +267,22 @@ static inline void s5pv210_default_sdhci2(void)
 static inline void s5pv210_default_sdhci2(void) { }
 #endif /* CONFIG_S3C_DEV_HSMMC2 */
 
+#ifdef CONFIG_S3C_DEV_HSMMC3
+static inline void s5pv210_default_sdhci3(void)
+{
+   s3c_hsmmc3_def_platdata.clocks = 

RE: [PATCH] ARM: S5P: Add PMU device

2010-07-05 Thread Kukjin Kim
Joonyoung Shim wrote:
 
 This patch adds an initcall for the s5p platforms so that they register
 their PMU IRQs with the PMU framework in the Kernel.
 
Please include Ben Dooks email address in the CC.

 Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
 ---
  arch/arm/mach-s5p6442/include/mach/irqs.h |2 +-
  arch/arm/mach-s5pc100/include/mach/irqs.h |1 +
  arch/arm/mach-s5pv210/include/mach/irqs.h |1 +
  arch/arm/plat-s5p/Makefile|1 +
  arch/arm/plat-s5p/dev-pmu.c   |   37
 +
  5 files changed, 41 insertions(+), 1 deletions(-)
  create mode 100644 arch/arm/plat-s5p/dev-pmu.c
 
 diff --git a/arch/arm/mach-s5p6442/include/mach/irqs.h b/arch/arm/mach-
 s5p6442/include/mach/irqs.h
 index 02c2374..22173cc 100644
 --- a/arch/arm/mach-s5p6442/include/mach/irqs.h
 +++ b/arch/arm/mach-s5p6442/include/mach/irqs.h
 @@ -32,7 +32,7 @@
  #define IRQ_GPIOINT  S5P_IRQ_VIC0(30)
 
  /* VIC1 */
 -#define IRQ_nPMUIRQ  S5P_IRQ_VIC1(0)
 +#define IRQ_PMUIRQ   S5P_IRQ_VIC1(0)

I'm not sure this changing is better..as you know, nXXX has some meaning.

  #define IRQ_ONENAND  S5P_IRQ_VIC1(7)
  #define IRQ_UART0S5P_IRQ_VIC1(10)
  #define IRQ_UART1S5P_IRQ_VIC1(11)
 diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-
 s5pc100/include/mach/irqs.h
 index 28aa551..9cc1b0d 100644
 --- a/arch/arm/mach-s5pc100/include/mach/irqs.h
 +++ b/arch/arm/mach-s5pc100/include/mach/irqs.h
 @@ -110,5 +110,6 @@
  #define IRQ_LCD_FIFO IRQ_LCD0
  #define IRQ_LCD_VSYNCIRQ_LCD1
  #define IRQ_LCD_SYSTEM   IRQ_LCD2
 +#define IRQ_PMUIRQ   IRQ_CORTEX0
 
I think, we don't need remapping in here.
How about use direct mapping like following:
#define IRQ_PMUIRQ  S5P_IRQ_VIC1(0)

  #endif /* __ASM_ARCH_IRQS_H */
 diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-
 s5pv210/include/mach/irqs.h
 index 9689537..3972f8d 100644
 --- a/arch/arm/mach-s5pv210/include/mach/irqs.h
 +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h
 @@ -128,5 +128,6 @@
  #define IRQ_LCD_FIFO IRQ_LCD0
  #define IRQ_LCD_VSYNCIRQ_LCD1
  #define IRQ_LCD_SYSTEM   IRQ_LCD2
 +#define IRQ_PMUIRQ   IRQ_CORTEX0
 
same.

  #endif /* ASM_ARCH_IRQS_H */
 diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
 index 39c242b..7e34194 100644
 --- a/arch/arm/plat-s5p/Makefile
 +++ b/arch/arm/plat-s5p/Makefile
 @@ -12,6 +12,7 @@ obj-:=
 
  # Core files
 
 +obj-y+= dev-pmu.o
  obj-y+= dev-uart.o
  obj-y+= cpu.o
  obj-y+= clock.o
 diff --git a/arch/arm/plat-s5p/dev-pmu.c b/arch/arm/plat-s5p/dev-pmu.c
 new file mode 100644
 index 000..de3b118
 --- /dev/null
 +++ b/arch/arm/plat-s5p/dev-pmu.c
 @@ -0,0 +1,37 @@
 +/*
 + * linux/arch/arm/plat-s5p/dev-pmu.c
 + *
 + * Copyright (C) 2010 Samsung Electronics Co.Ltd
 + * Author: Joonyoung Shim jy0922.s...@samsung.com
 + *
 + *  This program is free software; you can redistribute  it and/or modify
it
 + *  under  the terms of  the GNU General  Public License as published by
the
 + *  Free Software Foundation;  either version 2 of the  License, or (at
your
 + *  option) any later version.
 + *
 + */
 +
 +#include linux/platform_device.h
 +#include asm/pmu.h
 +#include mach/irqs.h
 +#include mach/map.h

really need mach/map.h?

 +
 +static struct resource s5p_pmu_resource = {
 + .start  = IRQ_PMUIRQ,
 + .end= IRQ_PMUIRQ,
 + .flags  = IORESOURCE_IRQ,
 +};
 +
 +struct platform_device s5p_device_pmu = {
 + .name   = arm-pmu,
 + .id = ARM_PMU_DEVICE_CPU,
 + .num_resources  = 1,
 + .resource   = s5p_pmu_resource,
 +};
 +
 +static int __init s5p_pmu_init(void)
 +{
 + platform_device_register(s5p_device_pmu);
 + return 0;
 +}
 +arch_initcall(s5p_pmu_init);
 --



Thanks.

Best regards,
Kgene.
--
Kukjin Kim kgene@samsung.com, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

--
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: SAMSUNG: updates sdhci.h for Samsung SoCs

2010-07-05 Thread Kyungmin Park
Hi,

Instead of refactoring, how about to delete it and move to dev-hsmmc file.
We don't need to call each sdhci_setup at each cpu files. just set
platform data and register platform data.

Just focus the each dev-hsmmc file and no need to change header file anymore.

How do you think?

Thank you,
Kyungmin Park

On Mon, Jul 5, 2010 at 9:18 PM, Kukjin Kim kgene@samsung.com wrote:
 This patch updates sdhci.h as Maurus suggestion like following:

 From:
        #ifdef ...
        function()
        {
                blahblah;
        }
        #else
        function() { }
        #endif

 To:
        function()
        {
        #ifdef ...
                blahblah;
        #endif
        }

 And fixes a couple of typos.

 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
 Note: depends on previous v3 patch set, Add support HSMMC on Samsung SMDKV210

  arch/arm/plat-samsung/include/plat/sdhci.h |   91 
 +---
  1 files changed, 30 insertions(+), 61 deletions(-)

 diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h 
 b/arch/arm/plat-samsung/include/plat/sdhci.h
 index 1314ffa..5ad1e94 100644
 --- a/arch/arm/plat-samsung/include/plat/sdhci.h
 +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
 @@ -82,12 +82,11 @@ extern void s5pv210_setup_sdhci1_cfg_gpio(struct 
 platform_device *, int w);
  extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
  extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w);

 -/* S3C6400 SDHCI setup */
 +/* S3C64XX SDHCI setup */

  #ifdef CONFIG_S3C64XX_SETUP_SDHCI
  extern char *s3c64xx_hsmmc_clksrcs[4];

 -#ifdef CONFIG_S3C_DEV_HSMMC
  extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
                                         void __iomem *r,
                                         struct mmc_ios *ios,
 @@ -95,76 +94,62 @@ extern void s3c6400_setup_sdhci_cfg_card(struct 
 platform_device *dev,

  static inline void s3c6400_default_sdhci0(void)
  {
 +#ifdef CONFIG_S3C_DEV_HSMMC
        s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
        s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
 +#endif
  }

 -#else
 -static inline void s3c6400_default_sdhci0(void) { }
 -#endif  /* CONFIG_S3C_DEV_HSMMC */
 -
 -#ifdef CONFIG_S3C_DEV_HSMMC1
  static inline void s3c6400_default_sdhci1(void)
  {
 +#ifdef CONFIG_S3C_DEV_HSMMC1
        s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
        s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
 +#endif
  }
 -#else
 -static inline void s3c6400_default_sdhci1(void) { }
 -#endif /* CONFIG_S3C_DEV_HSMMC1 */

 -#ifdef CONFIG_S3C_DEV_HSMMC2
  static inline void s3c6400_default_sdhci2(void)
  {
 +#ifdef CONFIG_S3C_DEV_HSMMC2
        s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
        s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
 +#endif
  }
 -#else
 -static inline void s3c6400_default_sdhci2(void) { }
 -#endif /* CONFIG_S3C_DEV_HSMMC2 */
 -
 -/* S3C6410 SDHCI setup */

  extern void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev,
                                         void __iomem *r,
                                         struct mmc_ios *ios,
                                         struct mmc_card *card);

 -#ifdef CONFIG_S3C_DEV_HSMMC
  static inline void s3c6410_default_sdhci0(void)
  {
 +#ifdef CONFIG_S3C_DEV_HSMMC
        s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
        s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
 +#endif
  }
 -#else
 -static inline void s3c6410_default_sdhci0(void) { }
 -#endif /* CONFIG_S3C_DEV_HSMMC */

 -#ifdef CONFIG_S3C_DEV_HSMMC1
  static inline void s3c6410_default_sdhci1(void)
  {
 +#ifdef CONFIG_S3C_DEV_HSMMC1
        s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
        s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
 +#endif
  }
 -#else
 -static inline void s3c6410_default_sdhci1(void) { }
 -#endif /* CONFIG_S3C_DEV_HSMMC1 */

 -#ifdef CONFIG_S3C_DEV_HSMMC2
  static inline void s3c6410_default_sdhci2(void)
  {
 +#ifdef CONFIG_S3C_DEV_HSMMC2
        s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
        s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
 +#endif
  }
 -#else
 -static inline void s3c6410_default_sdhci2(void) { }
 -#endif /* CONFIG_S3C_DEV_HSMMC2 */

  #else
  static inline void s3c6410_default_sdhci0(void) { }
 @@ -184,48 +169,42 @@ extern void s5pc100_setup_sdhci0_cfg_card(struct 
 platform_device 

Re: [PATCH] ARM: S5P: Add PMU device

2010-07-05 Thread Kyungmin Park
On Mon, Jul 5, 2010 at 9:57 PM, Kukjin Kim kgene@samsung.com wrote:
 Maurus Cuelenaere wrote:

  Op 05-07-10 03:46, Joonyoung Shim schreef:
  This patch adds an initcall for the s5p platforms so that they register
  their PMU IRQs with the PMU framework in the Kernel.
 
  Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
  ---
   arch/arm/mach-s5p6442/include/mach/irqs.h |    2 +-
   arch/arm/mach-s5pc100/include/mach/irqs.h |    1 +
   arch/arm/mach-s5pv210/include/mach/irqs.h |    1 +
   arch/arm/plat-s5p/Makefile                |    1 +
   arch/arm/plat-s5p/dev-pmu.c               |   37
 +
   5 files changed, 41 insertions(+), 1 deletions(-)
   create mode 100644 arch/arm/plat-s5p/dev-pmu.c

 Wouldn't it be better if this was in plat-samsung? I can see that the S3C6410
 datasheet mentions a PMU_IRQ_ENABLE bit in SYS_OTHERS so I suspect that it
 has
 the same functionality (even though there's no mention of which interrupt 
 this
 is).

 Yes, I also found PMU_IRQ_ENABLE bit in System Others register of S3C6410 
 datasheet. But as your comments, could not found the interrupt number and any 
 description...Actually, need to check whether it's available or not.

 And S5P6440 has it.
 So Joonyoung, it would be helpful if you could add 6440 PMUIRQ (VIC1[23]) in 
 this patch.

It's another story. Can you explain the difference between 6440 and 6442?
As I heard it's same chip and type is difference. If true, how about
to delete the 6442 directory?
It makes a single kernel simple.

Thank you,
Kyungmin Park



 Thanks.

 Best regards,
 Kgene.
 --
 Kukjin Kim kgene@samsung.com, Senior Engineer,
 SW Solution Development Team, Samsung Electronics Co., Ltd.


 ___
 linux-arm-kernel mailing list
 linux-arm-ker...@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

--
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: Add PMU device

2010-07-05 Thread Joonyoung Shim
On 7/5/2010 9:57 PM, Kukjin Kim wrote:
 Maurus Cuelenaere wrote:
  Op 05-07-10 03:46, Joonyoung Shim schreef:
 This patch adds an initcall for the s5p platforms so that they register
 their PMU IRQs with the PMU framework in the Kernel.

 Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
 ---
  arch/arm/mach-s5p6442/include/mach/irqs.h |2 +-
  arch/arm/mach-s5pc100/include/mach/irqs.h |1 +
  arch/arm/mach-s5pv210/include/mach/irqs.h |1 +
  arch/arm/plat-s5p/Makefile|1 +
  arch/arm/plat-s5p/dev-pmu.c   |   37
 +
  5 files changed, 41 insertions(+), 1 deletions(-)
  create mode 100644 arch/arm/plat-s5p/dev-pmu.c
 Wouldn't it be better if this was in plat-samsung? I can see that the S3C6410
 datasheet mentions a PMU_IRQ_ENABLE bit in SYS_OTHERS so I suspect that it
 has
 the same functionality (even though there's no mention of which interrupt 
 this
 is).

 Yes, I also found PMU_IRQ_ENABLE bit in System Others register of S3C6410 
 datasheet. But as your comments, could not found the interrupt number and any 
 description...Actually, need to check whether it's available or not.
 

Right, please check it, i cannot do it.

 And S5P6440 has it.
 So Joonyoung, it would be helpful if you could add 6440 PMUIRQ (VIC1[23]) in 
 this patch.
 

It already was added.

 Thanks.
 
 Best regards,
 Kgene.
 --
 Kukjin Kim kgene@samsung.com, Senior Engineer,
 SW Solution Development Team, Samsung Electronics Co., Ltd.
 
 

--
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: Add PMU device

2010-07-05 Thread Kukjin Kim
Kyungmin Park wrote:
 
 On Mon, Jul 5, 2010 at 9:57 PM, Kukjin Kim kgene@samsung.com wrote:
  Maurus Cuelenaere wrote:
 
   Op 05-07-10 03:46, Joonyoung Shim schreef:
   This patch adds an initcall for the s5p platforms so that they
register
   their PMU IRQs with the PMU framework in the Kernel.
  
   Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
   ---
    arch/arm/mach-s5p6442/include/mach/irqs.h |    2 +-
    arch/arm/mach-s5pc100/include/mach/irqs.h |    1 +
    arch/arm/mach-s5pv210/include/mach/irqs.h |    1 +
    arch/arm/plat-s5p/Makefile                |    1 +
    arch/arm/plat-s5p/dev-pmu.c               |   37
  +
    5 files changed, 41 insertions(+), 1 deletions(-)
    create mode 100644 arch/arm/plat-s5p/dev-pmu.c
 
  Wouldn't it be better if this was in plat-samsung? I can see that the
S3C6410
  datasheet mentions a PMU_IRQ_ENABLE bit in SYS_OTHERS so I suspect
 that it
  has
  the same functionality (even though there's no mention of which
interrupt this
  is).
 
  Yes, I also found PMU_IRQ_ENABLE bit in System Others register of
S3C6410
 datasheet. But as your comments, could not found the interrupt number and
any
 description...Actually, need to check whether it's available or not.
 
  And S5P6440 has it.
  So Joonyoung, it would be helpful if you could add 6440 PMUIRQ
(VIC1[23]) in
 this patch.
 
 It's another story. Can you explain the difference between 6440 and 6442?
 As I heard it's same chip and type is difference. If true, how about
 to delete the 6442 directory?
 It makes a single kernel simple.
 

I remember, already explained about that.
Hmm..Where did you hear wrong information that they are same? :-(
Absolutely, they are different !! not same chip.
...

But actually, I'm working on merge some S5P SoCs...

Thanks.

Best regards,
Kgene.
--
Kukjin Kim kgene@samsung.com, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

--
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: Add PMU device

2010-07-05 Thread Kukjin Kim
Joonyoung Shim wrote:
 
 On 7/5/2010 9:57 PM, Kukjin Kim wrote:
  Maurus Cuelenaere wrote:
   Op 05-07-10 03:46, Joonyoung Shim schreef:
  This patch adds an initcall for the s5p platforms so that they register
  their PMU IRQs with the PMU framework in the Kernel.
 
  Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
  ---
   arch/arm/mach-s5p6442/include/mach/irqs.h |2 +-
   arch/arm/mach-s5pc100/include/mach/irqs.h |1 +
   arch/arm/mach-s5pv210/include/mach/irqs.h |1 +
   arch/arm/plat-s5p/Makefile|1 +
   arch/arm/plat-s5p/dev-pmu.c   |   37
  +
   5 files changed, 41 insertions(+), 1 deletions(-)
   create mode 100644 arch/arm/plat-s5p/dev-pmu.c
  Wouldn't it be better if this was in plat-samsung? I can see that the 
  S3C6410
  datasheet mentions a PMU_IRQ_ENABLE bit in SYS_OTHERS so I suspect
 that it
  has
  the same functionality (even though there's no mention of which interrupt 
  this
  is).
 
  Yes, I also found PMU_IRQ_ENABLE bit in System Others register of S3C6410
 datasheet. But as your comments, could not found the interrupt number and any
 description...Actually, need to check whether it's available or not.
 
 
 Right, please check it, i cannot do it.
 
Hahaha..should I check it?..ok..let you know about that soon.

  And S5P6440 has it.
  So Joonyoung, it would be helpful if you could add 6440 PMUIRQ (VIC1[23]) in
 this patch.
 
 
 It already was added.
 
Oh, ok. I found.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim kgene@samsung.com, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

--
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: Add PMU device

2010-07-05 Thread Kukjin Kim
Joonyoung Shim wrote:
 
 On 7/5/2010 9:44 PM, Kukjin Kim wrote:
  Joonyoung Shim wrote:
  This patch adds an initcall for the s5p platforms so that they register
  their PMU IRQs with the PMU framework in the Kernel.
 
  Please include Ben Dooks email address in the CC.
 
 OK.
 
 
  Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
  ---
   arch/arm/mach-s5p6442/include/mach/irqs.h |2 +-
   arch/arm/mach-s5pc100/include/mach/irqs.h |1 +
   arch/arm/mach-s5pv210/include/mach/irqs.h |1 +
   arch/arm/plat-s5p/Makefile|1 +
   arch/arm/plat-s5p/dev-pmu.c   |   37
  +
   5 files changed, 41 insertions(+), 1 deletions(-)
   create mode 100644 arch/arm/plat-s5p/dev-pmu.c
 
  diff --git a/arch/arm/mach-s5p6442/include/mach/irqs.h b/arch/arm/mach-
  s5p6442/include/mach/irqs.h
  index 02c2374..22173cc 100644
  --- a/arch/arm/mach-s5p6442/include/mach/irqs.h
  +++ b/arch/arm/mach-s5p6442/include/mach/irqs.h
  @@ -32,7 +32,7 @@
   #define IRQ_GPIOINT   S5P_IRQ_VIC0(30)
 
   /* VIC1 */
  -#define IRQ_nPMUIRQ   S5P_IRQ_VIC1(0)
  +#define IRQ_PMUIRQS5P_IRQ_VIC1(0)
 
  I'm not sure this changing is better..as you know, nXXX has some meaning.
 
 
 Otherwise, we should redefine it and s5p6440 was defined to IRQ_PMUIRQ.
 
Hmm..so I said...I'm not sure... :-)
OK...just IRQ_PMUIRQ looks good.

   #define IRQ_ONENAND   S5P_IRQ_VIC1(7)
   #define IRQ_UART0 S5P_IRQ_VIC1(10)
   #define IRQ_UART1 S5P_IRQ_VIC1(11)
  diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-
  s5pc100/include/mach/irqs.h
  index 28aa551..9cc1b0d 100644
  --- a/arch/arm/mach-s5pc100/include/mach/irqs.h
  +++ b/arch/arm/mach-s5pc100/include/mach/irqs.h
  @@ -110,5 +110,6 @@
   #define IRQ_LCD_FIFO  IRQ_LCD0
   #define IRQ_LCD_VSYNC IRQ_LCD1
   #define IRQ_LCD_SYSTEMIRQ_LCD2
  +#define IRQ_PMUIRQIRQ_CORTEX0
 
  I think, we don't need remapping in here.
  How about use direct mapping like following:
  #define IRQ_PMUIRQ  S5P_IRQ_VIC1(0)
 
 
 I don't care, but above codes uses already remapping.
 
Yeah, used remapping..but written by IRQ_LCD[0-2] in datasheet.
In the PMUIRQ case, written by CORTEX0(nPMUIRQ).
...
Anyway, I mean just no need IRQ_CORTEX0.

So suggested direct mapping like above.
I think, we don't need to add an unused code.

   #endif /* __ASM_ARCH_IRQS_H */
  diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-
  s5pv210/include/mach/irqs.h
  index 9689537..3972f8d 100644
  --- a/arch/arm/mach-s5pv210/include/mach/irqs.h
  +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h
  @@ -128,5 +128,6 @@
   #define IRQ_LCD_FIFO  IRQ_LCD0
   #define IRQ_LCD_VSYNC IRQ_LCD1
   #define IRQ_LCD_SYSTEMIRQ_LCD2
  +#define IRQ_PMUIRQIRQ_CORTEX0
 
  same.
 
   #endif /* ASM_ARCH_IRQS_H */
  diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
  index 39c242b..7e34194 100644
  --- a/arch/arm/plat-s5p/Makefile
  +++ b/arch/arm/plat-s5p/Makefile
  @@ -12,6 +12,7 @@ obj- :=
 
   # Core files
 
  +obj-y += dev-pmu.o
   obj-y += dev-uart.o
   obj-y += cpu.o
   obj-y += clock.o
  diff --git a/arch/arm/plat-s5p/dev-pmu.c b/arch/arm/plat-s5p/dev-pmu.c
  new file mode 100644
  index 000..de3b118
  --- /dev/null
  +++ b/arch/arm/plat-s5p/dev-pmu.c
  @@ -0,0 +1,37 @@
  +/*
  + * linux/arch/arm/plat-s5p/dev-pmu.c
  + *
  + * Copyright (C) 2010 Samsung Electronics Co.Ltd
  + * Author: Joonyoung Shim jy0922.s...@samsung.com
  + *
  + *  This program is free software; you can redistribute  it and/or modify
  it
  + *  under  the terms of  the GNU General  Public License as published by
  the
  + *  Free Software Foundation;  either version 2 of the  License, or (at
  your
  + *  option) any later version.
  + *
  + */
  +
  +#include linux/platform_device.h
  +#include asm/pmu.h
  +#include mach/irqs.h
  +#include mach/map.h
 
  really need mach/map.h?
 
 
 Ah, it is unnecessary. i will remove it.
 
  +
  +static struct resource s5p_pmu_resource = {
  +  .start  = IRQ_PMUIRQ,
  +  .end= IRQ_PMUIRQ,
  +  .flags  = IORESOURCE_IRQ,
  +};
  +
  +struct platform_device s5p_device_pmu = {
  +  .name   = arm-pmu,
  +  .id = ARM_PMU_DEVICE_CPU,
  +  .num_resources  = 1,
  +  .resource   = s5p_pmu_resource,
  +};
  +
  +static int __init s5p_pmu_init(void)
  +{
  +  platform_device_register(s5p_device_pmu);
  +  return 0;
  +}
  +arch_initcall(s5p_pmu_init);
  --
 
 
 


Thanks.

Best regards,
Kgene.
--
Kukjin Kim kgene@samsung.com, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a 

Re: [PATCH] ARM: S5P: Add PMU device

2010-07-05 Thread Kyungmin Park
On Tue, Jul 6, 2010 at 12:12 PM, Kukjin Kim kgene@samsung.com wrote:
 Kyungmin Park wrote:

 On Mon, Jul 5, 2010 at 9:57 PM, Kukjin Kim kgene@samsung.com wrote:
  Maurus Cuelenaere wrote:
 
   Op 05-07-10 03:46, Joonyoung Shim schreef:
   This patch adds an initcall for the s5p platforms so that they
 register
   their PMU IRQs with the PMU framework in the Kernel.
  
   Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
   ---
    arch/arm/mach-s5p6442/include/mach/irqs.h |    2 +-
    arch/arm/mach-s5pc100/include/mach/irqs.h |    1 +
    arch/arm/mach-s5pv210/include/mach/irqs.h |    1 +
    arch/arm/plat-s5p/Makefile                |    1 +
    arch/arm/plat-s5p/dev-pmu.c               |   37
  +
    5 files changed, 41 insertions(+), 1 deletions(-)
    create mode 100644 arch/arm/plat-s5p/dev-pmu.c
 
  Wouldn't it be better if this was in plat-samsung? I can see that the
 S3C6410
  datasheet mentions a PMU_IRQ_ENABLE bit in SYS_OTHERS so I suspect
 that it
  has
  the same functionality (even though there's no mention of which
 interrupt this
  is).
 
  Yes, I also found PMU_IRQ_ENABLE bit in System Others register of
 S3C6410
 datasheet. But as your comments, could not found the interrupt number and
 any
 description...Actually, need to check whether it's available or not.
 
  And S5P6440 has it.
  So Joonyoung, it would be helpful if you could add 6440 PMUIRQ
 (VIC1[23]) in
 this patch.

 It's another story. Can you explain the difference between 6440 and 6442?
 As I heard it's same chip and type is difference. If true, how about
 to delete the 6442 directory?
 It makes a single kernel simple.


 I remember, already explained about that.
 Hmm..Where did you hear wrong information that they are same? :-(
 Absolutely, they are different !! not same chip.
 ...

 But actually, I'm working on merge some S5P SoCs...

Can you tell me in details?
Now we start the merge the s5p6442 and s5pc110.
And how about to merge the s5pc100 with s3c6410?
it's not good decision to place the c100 at s5p with name prefix.
I think it's better to place the similar core at same directory instead of name.

Thank you,
Kyungmin Park


 Thanks.

 Best regards,
 Kgene.
 --
 Kukjin Kim kgene@samsung.com, Senior Engineer,
 SW Solution Development Team, Samsung Electronics Co., Ltd.

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

--
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] ARM: S5PV210: Fix on SECTION_SIZE_BITS on S5PV210/S5PC110.

2010-07-05 Thread Kukjin Kim
This patch fixes on SECTION_SIZE_BITS for Sparsemem on S5PV210/S5PC110.
Because smallest size of a bank on S5PV210/S5PC110 is aligned by 16MB.
So each section's maximum size should be 16MB.

Reported-by: Kyongho Cho pullip@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
 arch/arm/mach-s5pv210/include/mach/memory.h |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-s5pv210/include/mach/memory.h 
b/arch/arm/mach-s5pv210/include/mach/memory.h
index 379117e..4a372d8 100644
--- a/arch/arm/mach-s5pv210/include/mach/memory.h
+++ b/arch/arm/mach-s5pv210/include/mach/memory.h
@@ -16,8 +16,12 @@
 #define PHYS_OFFSETUL(0x2000)
 #define CONSISTENT_DMA_SIZE(SZ_8M + SZ_4M + SZ_2M)
 
-/* Maximum of 256MiB in one bank */
+/* Sparsemem support. Each section is a maximum of 16MB.
+ * Because there are many different memory type on S5PC110(MCP),
+ * and there is a case that having 80MB, 128MB or 256MB in one
+ * bank.
+*/
 #define MAX_PHYSMEM_BITS   32
-#define SECTION_SIZE_BITS  28
+#define SECTION_SIZE_BITS  24
 
 #endif /* __ASM_ARCH_MEMORY_H */
-- 
1.6.2.5

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


Re: [PATCH v2] SDHCI-S3C fixes and enhancements (driver specific code)

2010-07-05 Thread Kyungmin Park
Hi Andrew,

I hope to merge it at next merge windows.

Others any comments?

Thank you,
Kyungmin Park

On Wed, Jun 16, 2010 at 3:49 PM, Marek Szyprowski
m.szyprow...@samsung.com wrote:
 Hello,

 This series includes various fixes to sdhci-s3c driver as well as a
 major feature enhancement. This patch series is prepared to get complete
 sdhci support on Samsung Aquila board.

 A quick overview on the patches:

 #1 - add missing sdhci_s3c_driver_remove() function
 #2 - introduce new sdhci quirk to get rid of anoying runtime warning and
     possible problems with slow mmc/sd cards
 #3 - add support for various methods of notifying the host driver about
     the card insertion/removal (should be compatible with existing code)

 Last patch requires changes to the Samsung platform setup code, which
 has been posted in a separate patch series for easier merging, please
 refer to the [PATCH v2] SDHCI-S3C fixes and enhancements (platform
 specific code) thread.

 Changes since V1:
 - added support for gpio external interrupt card based detect method
  directly to sdhci-s3c driver
 - removed duplicate Kconfig patch
 - removed timeout patch (not really needed)

 A complete list of patches:

 [PATCH 1/3] sdhci-s3c: add missing remove function
 [PATCH 2/3] sdhci-s3c: add support for the non standard minimal clock value
 [PATCH 3/3] sdhci-s3c: add support for new card detection methods

 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

--
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: S5PV210: Fix on SECTION_SIZE_BITS on S5PV210/S5PC110.

2010-07-05 Thread Kyungmin Park
On Tue, Jul 6, 2010 at 1:36 PM, Kukjin Kim kgene@samsung.com wrote:
 This patch fixes on SECTION_SIZE_BITS for Sparsemem on S5PV210/S5PC110.
 Because smallest size of a bank on S5PV210/S5PC110 is aligned by 16MB.
 So each section's maximum size should be 16MB.

Could you explain what's the problem?

Even though 80MiB is used at logical size. it used the physical 128MiB
so. it's reasonable to use 128MiB align instead of 16MiB. Are there
boards use 64MiB or less?

I think if decrease the SECTIONS_SIZE_BITS, it wastes the memory.

Thank you,
Kyungmin Park


 Reported-by: Kyongho Cho pullip@samsung.com
 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
  arch/arm/mach-s5pv210/include/mach/memory.h |    8 ++--
  1 files changed, 6 insertions(+), 2 deletions(-)

 diff --git a/arch/arm/mach-s5pv210/include/mach/memory.h 
 b/arch/arm/mach-s5pv210/include/mach/memory.h
 index 379117e..4a372d8 100644
 --- a/arch/arm/mach-s5pv210/include/mach/memory.h
 +++ b/arch/arm/mach-s5pv210/include/mach/memory.h
 @@ -16,8 +16,12 @@
  #define PHYS_OFFSET            UL(0x2000)
  #define CONSISTENT_DMA_SIZE    (SZ_8M + SZ_4M + SZ_2M)

 -/* Maximum of 256MiB in one bank */
 +/* Sparsemem support. Each section is a maximum of 16MB.
 + * Because there are many different memory type on S5PC110(MCP),
 + * and there is a case that having 80MB, 128MB or 256MB in one
 + * bank.
 +*/
  #define MAX_PHYSMEM_BITS       32
 -#define SECTION_SIZE_BITS      28
 +#define SECTION_SIZE_BITS      24

  #endif /* __ASM_ARCH_MEMORY_H */
 --
 1.6.2.5

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

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