Re: [PATCH v5] ARM: EXYNOS: Add MFC device tree support

2012-10-23 Thread 김승우
Hi Arun,

On 2012년 09월 28일 02:09, Arun Kumar K wrote:
> This patch adds device tree entry for MFC v6 in the Exynos5
> SoC. Makes the required changes in the clock files and adds
> MFC to the DT device list.
> 
> Signed-off-by: Naveen Krishna Chatradhi 
> Signed-off-by: Arun Kumar K 
> ---
>  .../devicetree/bindings/media/s5p-mfc.txt  |   23 +
>  arch/arm/boot/dts/exynos5250-smdk5250.dts  |5 +++
>  arch/arm/boot/dts/exynos5250.dtsi  |6 +++
>  arch/arm/mach-exynos/Kconfig   |1 +
>  arch/arm/mach-exynos/clock-exynos5.c   |2 +-
>  arch/arm/mach-exynos/mach-exynos5-dt.c |   16 +
>  arch/arm/plat-samsung/devs.c   |1 +
>  arch/arm/plat-samsung/include/plat/mfc.h   |   11 ++
>  arch/arm/plat-samsung/s5p-dev-mfc.c|   34 
> 
>  9 files changed, 98 insertions(+), 1 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/media/s5p-mfc.txt
> 



> diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c 
> b/arch/arm/mach-exynos/mach-exynos5-dt.c
> index fee9dcd..b4ed43a 100644
> --- a/arch/arm/mach-exynos/mach-exynos5-dt.c
> +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
> @@ -11,6 +11,8 @@
>  
>  #include 
>  #include 
> +#include 
> +#include 
>  
>  #include 
>  #include 
> @@ -18,6 +20,7 @@
>  
>  #include 
>  #include 
> +#include 
>  
>  #include "common.h"
>  
> @@ -72,6 +75,7 @@ static const struct of_dev_auxdata 
> exynos5250_auxdata_lookup[] __initconst = {
>   "exynos-gsc.2", NULL),
>   OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3,
>   "exynos-gsc.3", NULL),
> + OF_DEV_AUXDATA("samsung,mfc-v6", 0x1100, "s5p-mfc-v6", NULL),
>   {},
>  };
>  
> @@ -92,6 +96,17 @@ static char const *exynos5250_dt_compat[] __initdata = {
>   NULL
>  };
>  
> +static void __init exynos5_reserve(void)
> +{
> + struct s5p_mfc_dt_meminfo mfc_mem;
> +
> + /* Reserve memory for MFC only if it's available */
> + mfc_mem.compatible = "samsung,mfc-v6";
> + if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))

of_scan_flat_dt() is called but it does not have __init on its
definition. So this causes section mismatch.

> + s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,
> + mfc_mem.lsize);
> +}
> +
>  DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
>   /* Maintainer: Kukjin Kim  */
>   .init_irq   = exynos5_init_irq,
> @@ -102,4 +117,5 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened 
> Device Tree)")
>   .timer  = &exynos4_timer,
>   .dt_compat  = exynos5250_dt_compat,
>   .restart= exynos5_restart,
> + .reserve= exynos5_reserve,
>  MACHINE_END




Best Regards,
- Seung-Woo Kim

-- 
Seung-Woo Kim
Samsung Software R&D 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 v5] ARM: EXYNOS: Add MFC device tree support

2012-10-23 Thread Arun Kumar K
Hi Seungwoo Kim,

Thank you for the review.

>> +
>> + /* Reserve memory for MFC only if it's available */
>> + mfc_mem.compatible = "samsung,mfc-v6";
>> + if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))
>
> of_scan_flat_dt() is called but it does not have __init on its
> definition. So this causes section mismatch.
>

The function of_scan_flat_dt is having __init in its definition.
I hope you meant the function s5p_fdt_find_mfc_mem which is not
defined with __init and causing section mismatch.
I will correct this and post an updated patch.

Regards
Arun
--
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: EXYNOS: Remove wrong I2S0 clock from peril clock

2012-10-23 Thread Kukjin Kim
Sangbeom Kim wrote:
> 
> On Friday, Oct 05, 2012 at 4:37 PM, Sangsu Park wrote:
> > Remove I2S0 clk from peril since peril clock doesn't have I2S0 clk for
> EXYNOS4.
> > Audio Subsystem block has I2S0 clk.
> >
> > Signed-off-by: Sangsu Park 
> 
> Peril control bit 19 is reserved.
> 
> Acked-by: Sangbeom Kim 
> 
Applied.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 1/2] ARM: samsung: clock: add clock_tree debugfs file

2012-10-23 Thread Kukjin Kim
최종환 wrote:
> 
> From: Colin Cross 
> 
> Add a clock/clock_tree debugfs file that shows the entire clock
> hierarchy including usage counts and rates.
> 
> Signed-off-by: Colin Cross 
> Signed-off-by: Jonghwan Choi 
> ---
>  arch/arm/plat-samsung/clock.c |   65
> -
>  1 files changed, 64 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
> index b7338ce..9392959 100644
> --- a/arch/arm/plat-samsung/clock.c
> +++ b/arch/arm/plat-samsung/clock.c
> @@ -396,6 +396,64 @@ int __init s3c24xx_register_baseclocks(unsigned long
> xtal)
> 
>  static struct dentry *clk_debugfs_root;
> 
> +static void clock_tree_show_one(struct seq_file *s, struct clk *c, int
> level)
> +{
> +   struct clk *child;
> +   const char *state;
> +   char buf[255] = { 0 };
> +   int n = 0;
> +
> +   if (c->name)
> +   n = snprintf(buf, sizeof(buf) - 1, "%s", c->name);
> +
> +   if (c->devname)
> +   n += snprintf(buf + n, sizeof(buf) - 1 - n, ":%s", c-
> >devname);
> +
> +   state = (c->usage > 0) ? "on" : "off";
> +
> +   seq_printf(s, "%*s%-*s %-6s %-3d %-10lu\n",
> +   level * 3 + 1, "",
> +   50 - level * 3, buf,
> +   state, c->usage, clk_get_rate(c));
> +
> +   list_for_each_entry(child, &clocks, list) {
> +   if (child->parent != c)
> +   continue;
> +
> +   clock_tree_show_one(s, child, level + 1);
> +   }
> +}
> +
> +static int clock_tree_show(struct seq_file *s, void *data)
> +{
> +   struct clk *c;
> +   unsigned long flags;
> +
> +   seq_printf(s, " clock
> state  ref rate\n");
> +   seq_printf(s, "---
-
> -
> ---\n");
> +
> +   spin_lock_irqsave(&clocks_lock, flags);
> +
> +   list_for_each_entry(c, &clocks, list)
> +   if (c->parent == NULL)
> +   clock_tree_show_one(s, c, 0);
> +
> +   spin_unlock_irqrestore(&clocks_lock, flags);
> +   return 0;
> +}
> +
> +static int clock_tree_open(struct inode *inode, struct file *file)
> +{
> +   return single_open(file, clock_tree_show, inode->i_private);
> +}
> +
> +static const struct file_operations clock_tree_fops = {
> +   .open   = clock_tree_open,
> +   .read   = seq_read,
> +   .llseek = seq_lseek,
> "0001-ARM-samsung-clock-add-clock_tree-debugfs-file.patch" 106L, 2832C
> 1,1   Top
> +   .read   = seq_read,
> +   .llseek = seq_lseek,
> +   .release= single_release,
> +};
> +
>  static int clk_debugfs_register_one(struct clk *c)
>  {
> int err;
> @@ -457,13 +515,18 @@ static int __init clk_debugfs_init(void)
>  {
> struct clk *c;
> struct dentry *d;
> -   int err;
> +   int err = -ENOMEM;
> 
> d = debugfs_create_dir("clock", NULL);
> if (!d)
> return -ENOMEM;
> clk_debugfs_root = d;
> 
> +   d = debugfs_create_file("clock_tree", S_IRUGO, clk_debugfs_root,
> NULL,
> +   &clock_tree_fops);
> +   if (!d)
> +   goto err_out;
> +
> list_for_each_entry(c, &clocks, list) {
> err = clk_debugfs_register(c);
> if (err)
> --
> 1.7.1

Applied with fixing patch format :(

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 2/2] ARM: samsung: call clk_get_rate for debugfs rate files

2012-10-23 Thread Kukjin Kim
최종환 wrote:
> 
> From: Colin Cross 
> 
> c->rate is rarely set, call clk_get_rate on the clock to print
> the value in /d/clock/.../rate.
> 
> Signed-off-by: Colin Cross 
> Signed-off-by: Jonghwan Choi 
> ---
>  arch/arm/plat-samsung/clock.c |   10 +-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
> index 9392959..b8ec1cf 100644
> --- a/arch/arm/plat-samsung/clock.c
> +++ b/arch/arm/plat-samsung/clock.c
> @@ -454,6 +454,14 @@ static const struct file_operations clock_tree_fops =
> {
> .release= single_release,
>  };
> 
> +static int clock_rate_show(void *data, u64 *val)
> +{
> +   struct clk *c = data;
> +   *val = clk_get_rate(c);
> +   return 0;
> +}
> +DEFINE_SIMPLE_ATTRIBUTE(clock_rate_fops, clock_rate_show, NULL,
"%llu\n");
> +
>  static int clk_debugfs_register_one(struct clk *c)
>  {
> int err;
> @@ -480,7 +488,7 @@ static int clk_debugfs_register_one(struct clk *c)
> goto err_out;
> }
> 
> -   d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
> +   d = debugfs_create_file("rate", S_IRUGO, c->dent, c,
> &clock_rate_fops);
> if (!d) {
> err = -ENOMEM;
> goto err_out;
> --
> 1.7.1

Looks good to me, applied.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 v2] ASoC: Samsung: Update Kconfig for Exynos5250 and Exynos4412

2012-10-23 Thread Kukjin Kim
Tushar Behera wrote:
> 
> On 09/28/2012 03:23 PM, Sangsu Park wrote:
> >
> > On Thu, Sep 27, 2012 at 07:30 PM, Padmavathi Venna wrote:
> >

[...]

> >> @@ -63,7 +63,7 @@ config SND_SOC_SAMSUNG_SMDK_WM8580
> >>
> >>  config SND_SOC_SAMSUNG_SMDK_WM8994
> >>tristate "SoC I2S Audio support for WM8994 on SMDK"
> >> -  depends on SND_SOC_SAMSUNG && (MACH_SMDKV310 || MACH_SMDKC210 ||
> >> MACH_SMDK4212)
> >> +  depends on SND_SOC_SAMSUNG && (MACH_SMDKV310 || MACH_SMDKC210 ||
> >> MACH_SMDK4212 || MACH_SMDK4412 || MACH_EXYNOS5_DT)
> >>depends on I2C=y && GENERIC_HARDIRQS
> >>select MFD_WM8994
> >>select SND_SOC_WM8994
> >
> > I'm not sure about this since MACH_EXYNOS5_DT can have others instead of
> SMDK.
> >
> 
> But there is no other way we can differentiate between two EXYNOS5_DT
> based boards in the kernel. So, support for all possible codecs and
> sound-cards should be enabled in the kernel. The instantiation of the
> drivers should depend on the device-tree entries.
> 
Hmm...any idea on this?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 v2] ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412

2012-10-23 Thread Kukjin Kim
Tomasz Figa wrote:
> 
> Exynos4412 uses different information register for each core. This patch
> adjusts the bring-up code to take that into account.
> 
> Signed-off-by: Tomasz Figa 
> Signed-off-by: Kyungmin Park 
> ---
>  arch/arm/mach-exynos/platsmp.c | 27 +--
>  1 file changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-
> exynos/platsmp.c
> index 36c3984..816a27d 100644
> --- a/arch/arm/mach-exynos/platsmp.c
> +++ b/arch/arm/mach-exynos/platsmp.c
> @@ -34,8 +34,19 @@
> 
>  extern void exynos4_secondary_startup(void);
> 
> -#define CPU1_BOOT_REG(samsung_rev() == EXYNOS4210_REV_1_1
? \
> - S5P_INFORM5 : S5P_VA_SYSRAM)
> +static inline void __iomem *cpu_boot_reg_base(void)
> +{
> + if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)
> + return S5P_INFORM5;
> + return S5P_VA_SYSRAM;
> +}
> +
> +static inline void __iomem *cpu_boot_reg(int cpu)
> +{
> + if (soc_is_exynos4412())
> + return cpu_boot_reg_base() + 4*cpu;
> + return cpu_boot_reg_base();
> +}
> 
>  /*
>   * control for which core is the next to come out of the secondary
> @@ -89,6 +100,7 @@ void __cpuinit platform_secondary_init(unsigned int
cpu)
>  int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
>  {
>   unsigned long timeout;
> + unsigned long phys_cpu = cpu_logical_map(cpu);
> 
>   /*
>* Set synchronisation state between this boot processor
> @@ -104,7 +116,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct
> task_struct *idle)
>* Note that "pen_release" is the hardware CPU ID, whereas
>* "cpu" is Linux's internal ID.
>*/
> - write_pen_release(cpu_logical_map(cpu));
> + write_pen_release(phys_cpu);
> 
>   if (!(__raw_readl(S5P_ARM_CORE1_STATUS) & S5P_CORE_LOCAL_PWR_EN)) {
>   __raw_writel(S5P_CORE_LOCAL_PWR_EN,
> @@ -138,7 +150,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct
> task_struct *idle)
>   smp_rmb();
> 
>   __raw_writel(virt_to_phys(exynos4_secondary_startup),
> - CPU1_BOOT_REG);
> +
cpu_boot_reg(phys_cpu));
>   gic_raise_softirq(cpumask_of(cpu), 1);
> 
>   if (pen_release == -1)
> @@ -186,6 +198,8 @@ void __init smp_init_cpus(void)
> 
>  void __init platform_smp_prepare_cpus(unsigned int max_cpus)
>  {
> + int i;
> +
>   if (!soc_is_exynos5250())
>   scu_enable(scu_base_addr());
> 
> @@ -195,6 +209,7 @@ void __init platform_smp_prepare_cpus(unsigned int
> max_cpus)
>* until it receives a soft interrupt, and then the
>* secondary CPU branches to this address.
>*/
> - __raw_writel(virt_to_phys(exynos4_secondary_startup),
> - CPU1_BOOT_REG);
> + for (i = 1; i < max_cpus; ++i)
> + __raw_writel(virt_to_phys(exynos4_secondary_startup),
> + cpu_boot_reg(cpu_logical_map(i)));
>  }
> --
> 1.7.12

Looks ok to me, applied.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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: dts: exynos4: Enable serial controllers on Origen and SMDKV310

2012-10-23 Thread Kukjin Kim
Tomasz Figa wrote:
> 
> However I think this should be considered a fix, because without it serial
> console on Origen and SMDKV310 will be broken.
> 
Well, I couldn't find any broken due to miss this for v3.7. I think, there
is no usage of serial controller in mainline for Origen and SMDKV310 now. So
this should be queued for -next. If not, please let me know.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 1/4] ARM: EXYNOS: Kconfig: Rename CPU_EXYNOS4210 to SOC_EXYNOS4210

2012-10-23 Thread Kukjin Kim
Tomasz Figa wrote:
> 
> This patch renames CONFIG_CPU_EXYNOS4210 to CONFIG_SOC_EXYNOS4210 to
> match the convention used by rest of Exynos SoCs and correctly represent
> the reality (Exynos4210 is a SoC, not a CPU).
> 
> Signed-off-by: Tomasz Figa 
> Signed-off-by: Kyungmin Park 

Cc: Rafael J. Wysocki 
Cc: MyungJoo Ham 
Cc: Chris Ball 
Cc: Greg Kroah-Hartman 
Cc: Grant Likely 
Cc: Linus Walleij 
Cc: Zhang Rui 

> ---
>  arch/arm/mach-exynos/Kconfig | 14 +++---
>  arch/arm/mach-exynos/Makefile|  2 +-
>  arch/arm/mach-exynos/common.h|  2 +-
>  arch/arm/plat-samsung/include/plat/cpu.h |  2 +-
>  drivers/cpufreq/Kconfig.arm  |  2 +-
>  drivers/devfreq/Kconfig  |  2 +-
>  drivers/mmc/host/sdhci-s3c.c |  2 +-
>  drivers/tty/serial/samsung.c |  2 +-
>  8 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> index 4372075..05dcd07 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -27,7 +27,7 @@ config ARCH_EXYNOS5
> 
>  comment "EXYNOS SoCs"
> 
> -config CPU_EXYNOS4210
> +config SOC_EXYNOS4210
>   bool "SAMSUNG EXYNOS4210"
>   default y
>   depends on ARCH_EXYNOS4
> @@ -188,7 +188,7 @@ config MACH_SMDKC210
> 
>  config MACH_SMDKV310
>   bool "SMDKV310"
> - select CPU_EXYNOS4210
> + select SOC_EXYNOS4210
>   select S5P_DEV_FIMD0
>   select S3C_DEV_RTC
>   select S3C_DEV_WDT
> @@ -227,7 +227,7 @@ config MACH_SMDKV310
> 
>  config MACH_ARMLEX4210
>   bool "ARMLEX4210"
> - select CPU_EXYNOS4210
> + select SOC_EXYNOS4210
>   select S3C_DEV_RTC
>   select S3C_DEV_WDT
>   select S3C_DEV_HSMMC
> @@ -241,7 +241,7 @@ config MACH_ARMLEX4210
> 
>  config MACH_UNIVERSAL_C210
>   bool "Mobile UNIVERSAL_C210 Board"
> - select CPU_EXYNOS4210
> + select SOC_EXYNOS4210
>   select S5P_HRT
>   select CLKSRC_MMIO
>   select HAVE_SCHED_CLOCK
> @@ -282,7 +282,7 @@ config MACH_UNIVERSAL_C210
> 
>  config MACH_NURI
>   bool "Mobile NURI Board"
> - select CPU_EXYNOS4210
> + select SOC_EXYNOS4210
>   select S5P_GPIO_INT
>   select S3C_DEV_WDT
>   select S3C_DEV_RTC
> @@ -323,7 +323,7 @@ config MACH_NURI
> 
>  config MACH_ORIGEN
>   bool "ORIGEN"
> - select CPU_EXYNOS4210
> + select SOC_EXYNOS4210
>   select S3C_DEV_RTC
>   select S3C_DEV_WDT
>   select S3C_DEV_HSMMC
> @@ -404,7 +404,7 @@ comment "Flattened Device Tree based board for EXYNOS
> SoCs"
>  config MACH_EXYNOS4_DT
>   bool "Samsung Exynos4 Machine using device tree"
>   depends on ARCH_EXYNOS4
> - select CPU_EXYNOS4210
> + select SOC_EXYNOS4210
>   select USE_OF
>   select ARM_AMBA
>   select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
> diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
> index 9b58024..ceeb8c9 100644
> --- a/arch/arm/mach-exynos/Makefile
> +++ b/arch/arm/mach-exynos/Makefile
> @@ -15,7 +15,7 @@ obj-:=
>  obj-$(CONFIG_ARCH_EXYNOS)+= common.o
>  obj-$(CONFIG_ARCH_EXYNOS4)   += clock-exynos4.o
>  obj-$(CONFIG_ARCH_EXYNOS5)   += clock-exynos5.o
> -obj-$(CONFIG_CPU_EXYNOS4210) += clock-exynos4210.o
> +obj-$(CONFIG_SOC_EXYNOS4210) += clock-exynos4210.o
>  obj-$(CONFIG_SOC_EXYNOS4212) += clock-exynos4212.o
> 
>  obj-$(CONFIG_PM) += pm.o
> diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
> index aed2eeb..054c786 100644
> --- a/arch/arm/mach-exynos/common.h
> +++ b/arch/arm/mach-exynos/common.h
> @@ -45,7 +45,7 @@ void exynos5_setup_clocks(void);
>  #define exynos5_setup_clocks()
>  #endif
> 
> -#ifdef CONFIG_CPU_EXYNOS4210
> +#ifdef CONFIG_SOC_EXYNOS4210
>  void exynos4210_register_clocks(void);
> 
>  #else
> diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-
> samsung/include/plat/cpu.h
> index ace4451..021fff0 100644
> --- a/arch/arm/plat-samsung/include/plat/cpu.h
> +++ b/arch/arm/plat-samsung/include/plat/cpu.h
> @@ -102,7 +102,7 @@ IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID,
> EXYNOS5_SOC_MASK)
>  # define soc_is_s5pv210()0
>  #endif
> 
> -#if defined(CONFIG_CPU_EXYNOS4210)
> +#if defined(CONFIG_SOC_EXYNOS4210)
>  # define soc_is_exynos4210() is_samsung_exynos4210()
>  #else
>  # define soc_is_exynos4210() 0
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index 5961e64..ca4ede3 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -60,7 +60,7 @@ config ARM_EXYNOS_CPUFREQ
> If in doubt, say N.
> 
>  config ARM_EXYNOS4210_CPUFREQ
> - def_bool CPU_EXYNOS4210
> + def_bool SOC_EXYNOS4210
>   help
> This adds the CPUFreq driver for Samsung EXYNOS4210
> SoC (S5PV310 or S5PC210).
> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
> index f6b0a6e2..8545069 100644
> --- a/drivers/devfreq/Kconf

RE: [PATCH 2/4] ARM: EXYNOS: Kconfig: Sort out dependencies between options

2012-10-23 Thread Kukjin Kim
Tomasz Figa wrote:
> 
> This patch modifies the dependencies between Exynos-related Kconfig
> options to represent the real dependencies between code units more
> closely.
> 
> Originally it was possible to enable ARCH_EXYNOS{4,5} without any
> SOC_EXYNOS_{4,5}.* enabled, which could end with compilation or link
> errors. Now ARCH_EXYNOS{4,5} is only selected when there is a
> SOC_EXYNOS_{4,5}.* enabled, which requires it.
> 
> Signed-off-by: Tomasz Figa 
> Signed-off-by: Kyungmin Park 
> ---
>  arch/arm/mach-exynos/Kconfig | 15 ++-
>  drivers/devfreq/Kconfig  |  2 +-
>  drivers/mmc/host/sdhci-s3c.c |  2 +-
>  drivers/tty/serial/samsung.c |  3 +--
>  4 files changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> index 05dcd07..9f91892 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -12,15 +12,14 @@ if ARCH_EXYNOS
>  menu "SAMSUNG EXYNOS SoCs Support"
> 
>  config ARCH_EXYNOS4
> - bool "SAMSUNG EXYNOS4"
> - default y
> + def_bool n
>   select HAVE_SMP
>   select MIGHT_HAVE_CACHE_L2X0
>   help
> Samsung EXYNOS4 SoCs based systems
> 
>  config ARCH_EXYNOS5
> - bool "SAMSUNG EXYNOS5"
> + def_bool n
>   select HAVE_SMP
>   help
> Samsung EXYNOS5 (Cortex-A15) SoC based systems
> @@ -30,7 +29,7 @@ comment "EXYNOS SoCs"
>  config SOC_EXYNOS4210
>   bool "SAMSUNG EXYNOS4210"
>   default y
> - depends on ARCH_EXYNOS4
> + select ARCH_EXYNOS4
>   select SAMSUNG_DMADEV
>   select ARM_CPU_SUSPEND if PM
>   select S5P_PM if PM
> @@ -42,7 +41,7 @@ config SOC_EXYNOS4210
>  config SOC_EXYNOS4212
>   bool "SAMSUNG EXYNOS4212"
>   default y
> - depends on ARCH_EXYNOS4
> + select ARCH_EXYNOS4
>   select SAMSUNG_DMADEV
>   select S5P_PM if PM
>   select S5P_SLEEP if PM
> @@ -51,6 +50,7 @@ config SOC_EXYNOS4212
> 
>  config SOC_EXYNOS4412
>   bool "SAMSUNG EXYNOS4412"
> + select ARCH_EXYNOS4
>   default y
>   depends on ARCH_EXYNOS4
>   select SAMSUNG_DMADEV
> @@ -60,7 +60,7 @@ config SOC_EXYNOS4412
>  config SOC_EXYNOS5250
>   bool "SAMSUNG EXYNOS5250"
>   default y
> - depends on ARCH_EXYNOS5
> + select ARCH_EXYNOS5
>   select SAMSUNG_DMADEV
>   select S5P_PM if PM
>   select S5P_SLEEP if PM
> @@ -176,8 +176,6 @@ config EXYNOS_SETUP_SPI
> 

Basically, I agree with your approach. Its CONFIG_ARCH_EXYNOSx depends on
selecting own SOC.

BTW, I'm thinking, which one selecting is better to us board? Or SoC?...

>  # machine support
> 
> -if ARCH_EXYNOS4
> -

Well, according to removing above, we can select following exynos4210 boards
on other stuff. Of course, when select board, regarding soc is selected
though. So I'm thinking I said as above.

>  comment "EXYNOS4210 Boards"
> 
>  config MACH_SMDKC210
> @@ -397,7 +395,6 @@ config MACH_SMDK4412
>   select MACH_SMDK4212
>   help
> Machine support for Samsung SMDK4412
> -endif
> 
>  comment "Flattened Device Tree based board for EXYNOS SoCs"
> 
> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
> index 8545069..c559609 100644
> --- a/drivers/devfreq/Kconfig
> +++ b/drivers/devfreq/Kconfig
> @@ -67,7 +67,7 @@ comment "DEVFREQ Drivers"
> 
>  config ARM_EXYNOS4_BUS_DEVFREQ
>   bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver"
> - depends on SOC_EXYNOS4210 || CPU_EXYNOS4212 || CPU_EXYNOS4412
> + depends on ARCH_EXYNOS4

I don't think so, because it depends on SoC not architecture. In addition,
we don't know ARM_EXYNOS4_BUS_DEVFREQ is available on upcoming exynos4...

>   select ARCH_HAS_OPP
>   select DEVFREQ_GOV_SIMPLE_ONDEMAND
>   help
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index b090415..5e2083b 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -716,7 +716,7 @@ static const struct dev_pm_ops sdhci_s3c_pmops = {
>  #define SDHCI_S3C_PMOPS NULL
>  #endif
> 
> -#if defined(CONFIG_SOC_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS4212)
> +#if defined(CONFIG_ARCH_EXYNOS4)

Same as above.

>  static struct sdhci_s3c_drv_data exynos4_sdhci_drv_data = {
>   .sdhci_quirks = SDHCI_QUIRK_NONSTANDARD_CLOCK,
>  };
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index 175ba6e..c689091 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -1594,8 +1594,7 @@ static struct s3c24xx_serial_drv_data
> s5pv210_serial_drv_data = {
>  #define S5PV210_SERIAL_DRV_DATA  (kernel_ulong_t)NULL
>  #endif
> 
> -#if defined(CONFIG_SOC_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS4212) || \
> - defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
> +#if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5)

Same as above.

>  static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = {
>   .info = &(struct s3c24xx_uar

RE: [PATCH 3/4] ARM: EXYNOS: Kconfig: Group EXYNOS{4212,4412} into EXYNOS4X12

2012-10-23 Thread Kukjin Kim
Tomasz Figa wrote:
> 
> This patch adds CONFIG_EXYNOS4X12, which is automatically selected
> whenever there is at least one SoC from Exynos4x12 line enabled. All the
> shared dependencies of EXYNOS{4212,4412} are moved to this new
> option.
> 
> This fixes build with Exynos4412 enabled and Exynos4212 and Exynos4210
> disabled and also allows to simplify conditional compilation in several
> places.
> 
> Signed-off-by: Tomasz Figa 
> Signed-off-by: Kyungmin Park 
> ---
>  arch/arm/mach-exynos/Kconfig  | 15 +--
>  arch/arm/mach-exynos/Makefile |  2 +-
>  arch/arm/mach-exynos/common.h |  2 +-
>  drivers/cpufreq/Kconfig.arm   |  2 +-
>  4 files changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> index 9f91892..6ea95f0 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -38,22 +38,25 @@ config SOC_EXYNOS4210
>   help
> Enable EXYNOS4210 CPU support
> 
> -config SOC_EXYNOS4212
> - bool "SAMSUNG EXYNOS4212"
> - default y
> +config SOC_EXYNOS4X12
> + def_bool n
>   select ARCH_EXYNOS4
>   select SAMSUNG_DMADEV
> + select ARM_CPU_SUSPEND if PM
>   select S5P_PM if PM
>   select S5P_SLEEP if PM
> +
> +config SOC_EXYNOS4212
> + bool "SAMSUNG EXYNOS4212"
> + select SOC_EXYNOS4X12
> + default y
>   help
> Enable EXYNOS4212 SoC support
> 
>  config SOC_EXYNOS4412
>   bool "SAMSUNG EXYNOS4412"
> - select ARCH_EXYNOS4
> + select SOC_EXYNOS4X12
>   default y
> - depends on ARCH_EXYNOS4
> - select SAMSUNG_DMADEV
>   help
> Enable EXYNOS4412 SoC support
> 
> diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
> index ceeb8c9..f88fcb6 100644
> --- a/arch/arm/mach-exynos/Makefile
> +++ b/arch/arm/mach-exynos/Makefile
> @@ -16,7 +16,7 @@ obj-$(CONFIG_ARCH_EXYNOS)   += common.o
>  obj-$(CONFIG_ARCH_EXYNOS4)   += clock-exynos4.o
>  obj-$(CONFIG_ARCH_EXYNOS5)   += clock-exynos5.o
>  obj-$(CONFIG_SOC_EXYNOS4210) += clock-exynos4210.o
> -obj-$(CONFIG_SOC_EXYNOS4212) += clock-exynos4212.o
> +obj-$(CONFIG_SOC_EXYNOS4X12) += clock-exynos4212.o
> 
>  obj-$(CONFIG_PM) += pm.o
>  obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
> diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
> index 054c786..a8cb3e6 100644
> --- a/arch/arm/mach-exynos/common.h
> +++ b/arch/arm/mach-exynos/common.h
> @@ -52,7 +52,7 @@ void exynos4210_register_clocks(void);
>  #define exynos4210_register_clocks()
>  #endif
> 
> -#ifdef CONFIG_SOC_EXYNOS4212
> +#ifdef CONFIG_SOC_EXYNOS4X12
>  void exynos4212_register_clocks(void);
> 
>  #else
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index ca4ede3..d0ff91a 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -66,7 +66,7 @@ config ARM_EXYNOS4210_CPUFREQ
> SoC (S5PV310 or S5PC210).
> 
>  config ARM_EXYNOS4X12_CPUFREQ
> - def_bool (SOC_EXYNOS4212 || SOC_EXYNOS4412)
> + def_bool SOC_EXYNOS4X12
>   help
> This adds the CPUFreq driver for Samsung EXYNOS4X12
> SoC (EXYNOS4212 or EXYNOS4412).
> --
> 1.7.12

Well, do we _really_ need to define CONFIG_SOC_EXYNOS4X12 for supporting
common part of exynos4212 and exynos4412? In my opinion, it will cause
confusion rather than reducing code size. Let's just use its own name for
SoC.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 4/4] ARM: EXYNOS: Kconfig: Remove dependencies on particular SoCs from DT machines

2012-10-23 Thread Kukjin Kim
Tomasz Figa wrote:
> 
> MACH_EXYNOS{4,5}_DT are used for whole SoC lines, so they should depend
> on ARCH_EXYNOS{4,5} rather than on particular SoCs.
> 
> Signed-off-by: Tomasz Figa 
> Signed-off-by: Kyungmin Park 
> ---
>  arch/arm/mach-exynos/Kconfig | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> index 6ea95f0..2e82ce7 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -404,7 +404,6 @@ comment "Flattened Device Tree based board for EXYNOS
> SoCs"
>  config MACH_EXYNOS4_DT
>   bool "Samsung Exynos4 Machine using device tree"
>   depends on ARCH_EXYNOS4
> - select SOC_EXYNOS4210
>   select USE_OF
>   select ARM_AMBA
>   select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
> @@ -419,7 +418,6 @@ config MACH_EXYNOS4_DT
>  config MACH_EXYNOS5_DT
>   bool "SAMSUNG EXYNOS5 Machine using device tree"
>   depends on ARCH_EXYNOS5
> - select SOC_EXYNOS5250
>   select USE_OF
>   select ARM_AMBA
>   help
> --
> 1.7.12

Hmm...your comment is correct, but we need to think again its selecting
order, between ARCH name, SoC and board. In addition, in case of MACH_XXX_DT
depending on SoC is rather to be supposed...

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 v4 1/5] ARM: EXYNOS: Add set_irq_affinity function for combiner_irq

2012-10-23 Thread Kukjin Kim
Chanho Park wrote:
> 
> This patch adds set_irq_affinity function for combiner_irq. We need this
> function to enable a arm-pmu because the pmu of exynos has combined type
> irqs.
> 
> Reviewed-by: Thomas Abraham 
> Signed-off-by: Chanho Park 
> Signed-off-by: Kyungmin Park 
> ---
>  arch/arm/mach-exynos/common.c |   30 +-
>  1 file changed, 25 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
> index 715b690..709245e 100644
> --- a/arch/arm/mach-exynos/common.c
> +++ b/arch/arm/mach-exynos/common.c
> @@ -405,6 +405,7 @@ struct combiner_chip_data {
>   unsigned int irq_offset;
>   unsigned int irq_mask;
>   void __iomem *base;
> + unsigned int parent_irq;
>  };
> 
>  static struct irq_domain *combiner_irq_domain;
> @@ -461,10 +462,28 @@ static void combiner_handle_cascade_irq(unsigned int
> irq, struct irq_desc *desc)
>   chained_irq_exit(chip, desc);
>  }
> 
> +#ifdef CONFIG_SMP
> +static int combiner_set_affinity(struct irq_data *d,
> +  const struct cpumask *mask_val, bool force)
> +{
> + struct combiner_chip_data *chip_data =
> irq_data_get_irq_chip_data(d);
> + struct irq_chip *chip = irq_get_chip(chip_data->parent_irq);
> + struct irq_data *data = irq_get_irq_data(chip_data->parent_irq);
> +
> + if (chip && chip->irq_set_affinity)
> + return chip->irq_set_affinity(data, mask_val, force);
> + else
> + return -EINVAL;
> +}
> +#endif
> +
>  static struct irq_chip combiner_chip = {
> - .name   = "COMBINER",
> - .irq_mask   = combiner_mask_irq,
> - .irq_unmask = combiner_unmask_irq,
> + .name   = "COMBINER",
> + .irq_mask   = combiner_mask_irq,
> + .irq_unmask = combiner_unmask_irq,
> +#ifdef CONFIG_SMP
> + .irq_set_affinity   = combiner_set_affinity,
> +#endif
>  };
> 
>  static void __init combiner_cascade_irq(unsigned int combiner_nr,
> unsigned int irq)
> @@ -484,12 +503,13 @@ static void __init combiner_cascade_irq(unsigned int
> combiner_nr, unsigned int i
>  }
> 
>  static void __init combiner_init_one(unsigned int combiner_nr,
> -  void __iomem *base)
> +  void __iomem *base, unsigned int irq)
>  {
>   combiner_data[combiner_nr].base = base;
>   combiner_data[combiner_nr].irq_offset = irq_find_mapping(
>   combiner_irq_domain, combiner_nr * MAX_IRQ_IN_COMBINER);
>   combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) <<
> 3);
> + combiner_data[combiner_nr].parent_irq = irq;
> 
>   /* Disable all interrupts */
>   __raw_writel(combiner_data[combiner_nr].irq_mask,
> @@ -573,12 +593,12 @@ static void __init combiner_init(void __iomem
> *combiner_base,
>   }
> 
>   for (i = 0; i < max_nr; i++) {
> - combiner_init_one(i, combiner_base + (i >> 2) * 0x10);
>   irq = IRQ_SPI(i);
>  #ifdef CONFIG_OF
>   if (np)
>   irq = irq_of_parse_and_map(np, i);
>  #endif
> + combiner_init_one(i, combiner_base + (i >> 2) * 0x10, irq);
>   combiner_cascade_irq(i, irq);
>   }
>  }
> --
> 1.7.9.5

Looks good to me, applied.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 v4 2/5] ARM: EXYNOS: Correct combined IRQs for exynos4

2012-10-23 Thread Kukjin Kim
Chanho Park wrote:
> 
> This patch corrects combined IRQs for exynos4 series platform. The
> exynos4412
> has four extra combined irq group and the exynos4212 has two more combined
> irqs
> than exynos4210. Each irq is mapped to IRQ_SPI(xx). Unfortunately, extra 4
> combined IRQs isn't sequential. So, we need to map the irqs manually.
> 
> Signed-off-by: Chanho Park 
> Signed-off-by: Kyungmin Park 
> ---
>  arch/arm/mach-exynos/common.c|   42
+
> -
>  arch/arm/mach-exynos/include/mach/irqs.h |4 ++-
>  2 files changed, 39 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
> index 709245e..fdd582a 100644
> --- a/arch/arm/mach-exynos/common.c
> +++ b/arch/arm/mach-exynos/common.c
> @@ -560,23 +560,50 @@ static struct irq_domain_ops combiner_irq_domain_ops
> = {
>   .map= combiner_irq_domain_map,
>  };
> 
> +static unsigned int combiner_extra_irq(int group)

This is only for exynos4212 and exynos4412 so how about to use
exynos4x12_combiner_extra_irq()?

> +{
> + switch (group) {
> + case 16:
> + return IRQ_SPI(107);
> + case 17:
> + return IRQ_SPI(108);
> + case 18:
> + return IRQ_SPI(48);
> + case 19:
> + return IRQ_SPI(42);
> + default:
> + return 0;
> + }
> +}
> +
> +static unsigned int max_combiner_nr(void)
> +{
> + if (soc_is_exynos5250())
> + return EXYNOS5_MAX_COMBINER_NR;
> + else if (soc_is_exynos4412())
> + return EXYNOS4_MAX_COMBINER_NR;

EXYNOS4412_MAX_COMBINER_NR is more clear?

> + else if (soc_is_exynos4212())
> + return EXYNOS4212_MAX_COMBINER_NR;
> + else
> + return EXYNOS4210_MAX_COMBINER_NR;
> +}
> +
>  static void __init combiner_init(void __iomem *combiner_base,
>struct device_node *np)
>  {
>   int i, irq, irq_base;
>   unsigned int max_nr, nr_irq;
> 
> + max_nr = max_combiner_nr();
> +
>   if (np) {
>   if (of_property_read_u32(np, "samsung,combiner-nr",
&max_nr))
> {
>   pr_warning("%s: number of combiners not specified, "

Hmm...the message should be changed, because it is just defined by checking
SoC with this changes not property of device tree...So how about just using
pr_info() with proper message?

>   "setting default as %d.\n",
> - __func__, EXYNOS4_MAX_COMBINER_NR);
> - max_nr = EXYNOS4_MAX_COMBINER_NR;
> + __func__, max_nr);
>   }
> - } else {
> - max_nr = soc_is_exynos5250() ? EXYNOS5_MAX_COMBINER_NR :
> - EXYNOS4_MAX_COMBINER_NR;
>   }
> +
>   nr_irq = max_nr * MAX_IRQ_IN_COMBINER;
> 
>   irq_base = irq_alloc_descs(COMBINER_IRQ(0, 0), 1, nr_irq, 0);
> @@ -593,7 +620,10 @@ static void __init combiner_init(void __iomem
> *combiner_base,
>   }
> 
>   for (i = 0; i < max_nr; i++) {
> - irq = IRQ_SPI(i);
> + if (i < EXYNOS4210_MAX_COMBINER_NR || soc_is_exynos5250())
> + irq = IRQ_SPI(i);
> + else
> + irq = combiner_extra_irq(i);
>  #ifdef CONFIG_OF
>   if (np)
>   irq = irq_of_parse_and_map(np, i);
> diff --git a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-
> exynos/include/mach/irqs.h
> index 35bced6..3a83546 100644
> --- a/arch/arm/mach-exynos/include/mach/irqs.h
> +++ b/arch/arm/mach-exynos/include/mach/irqs.h
> @@ -165,7 +165,9 @@
>  #define EXYNOS4_IRQ_FIMD0_VSYNC  COMBINER_IRQ(11, 1)
>  #define EXYNOS4_IRQ_FIMD0_SYSTEM COMBINER_IRQ(11, 2)
> 
> -#define EXYNOS4_MAX_COMBINER_NR  16
> +#define EXYNOS4210_MAX_COMBINER_NR   16
> +#define EXYNOS4212_MAX_COMBINER_NR   18
> +#define EXYNOS4_MAX_COMBINER_NR  20

EXYNOS4412_MAX_COMBINER_NR ?

> 
>  #define EXYNOS4_IRQ_GPIO1_NR_GROUPS  16
>  #define EXYNOS4_IRQ_GPIO2_NR_GROUPS  9
> --
> 1.7.9.5



Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 v4 3/5] ARM: EXYNOS: Enable PMUs for exynos4

2012-10-23 Thread Kukjin Kim
Chanho Park wrote:
> 
> This patch defines irq numbers of ARM performance monitoring unit for
> exynos4.
> Firs of all, we need to fix IRQ_PMU correctly and to split pmu
> initialization
> of exynos from plat-samsung for easily defining it.
> 
> The number of CPU cores and PMU irq numbers are vary according to soc
> types.
> So, we need to identify each soc type using soc_is_xxx function and to
> define
> the pmu irqs dynamically. For example, the exynos4412 has 4 cpu cores and
> pmus.
> 
> Signed-off-by: Chanho Park 
> Signed-off-by: Kyungmin Park 
> ---
>  arch/arm/mach-exynos/common.c|   28

>  arch/arm/mach-exynos/include/mach/irqs.h |8 ++--
>  arch/arm/plat-samsung/devs.c |2 +-
>  3 files changed, 35 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
> index fdd582a..5183426 100644
> --- a/arch/arm/mach-exynos/common.c
> +++ b/arch/arm/mach-exynos/common.c
> @@ -35,6 +35,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  #include 
>  #include 
> @@ -1093,3 +1094,30 @@ static int __init exynos_init_irq_eint(void)
>   return 0;
>  }
>  arch_initcall(exynos_init_irq_eint);
> +
> +static struct resource exynos4_pmu_resource[] = {
> + DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU),
> + DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU1),
> +#if defined(CONFIG_SOC_EXYNOS4412)
> + DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU2),
> + DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU3),
> +#endif
> +};
> +
> +static struct platform_device exynos4_device_pmu = {
> + .name   = "arm-pmu",
> + .num_resources  = ARRAY_SIZE(exynos4_pmu_resource),
> + .resource   = exynos4_pmu_resource,
> +};
> +
> +static int __init exynos_armpmu_init(void)
> +{
> + if (!of_have_populated_dt()) {
> + if (soc_is_exynos4210() || soc_is_exynos4212())
> + exynos4_device_pmu.num_resources = 2;
> + platform_device_register(&exynos4_device_pmu);
> + }
> +
> + return 0;
> +}
> +arch_initcall(exynos_armpmu_init);
> diff --git a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-
> exynos/include/mach/irqs.h
> index 3a83546..c67a54e 100644
> --- a/arch/arm/mach-exynos/include/mach/irqs.h
> +++ b/arch/arm/mach-exynos/include/mach/irqs.h
> @@ -128,7 +128,7 @@
>  #define EXYNOS4_IRQ_ADC1 IRQ_SPI(107)
>  #define EXYNOS4_IRQ_PEN1 IRQ_SPI(108)
>  #define EXYNOS4_IRQ_KEYPAD   IRQ_SPI(109)
> -#define EXYNOS4_IRQ_PMU  IRQ_SPI(110)
> +#define EXYNOS4_IRQ_POWER_PMUIRQ_SPI(110)
>  #define EXYNOS4_IRQ_GPS  IRQ_SPI(111)
>  #define EXYNOS4_IRQ_INTFEEDCTRL_SSS  IRQ_SPI(112)
>  #define EXYNOS4_IRQ_SLIMBUS  IRQ_SPI(113)
> @@ -136,6 +136,11 @@
>  #define EXYNOS4_IRQ_TSI  IRQ_SPI(115)
>  #define EXYNOS4_IRQ_SATA IRQ_SPI(116)
> 
> +#define EXYNOS4_IRQ_PMU  COMBINER_IRQ(2, 2)
> +#define EXYNOS4_IRQ_PMU_CPU1 COMBINER_IRQ(3, 2)
> +#define EXYNOS4_IRQ_PMU_CPU2 COMBINER_IRQ(18, 2)
> +#define EXYNOS4_IRQ_PMU_CPU3 COMBINER_IRQ(19, 2)
> +
>  #define EXYNOS4_IRQ_SYSMMU_MDMA0_0   COMBINER_IRQ(4, 0)
>  #define EXYNOS4_IRQ_SYSMMU_SSS_0 COMBINER_IRQ(4, 1)
>  #define EXYNOS4_IRQ_SYSMMU_FIMC0_0   COMBINER_IRQ(4, 2)
> @@ -232,7 +237,6 @@
>  #define IRQ_TC   EXYNOS4_IRQ_PEN0
> 
>  #define IRQ_KEYPAD   EXYNOS4_IRQ_KEYPAD
> -#define IRQ_PMU  EXYNOS4_IRQ_PMU
> 
>  #define IRQ_FIMD0_FIFO   EXYNOS4_IRQ_FIMD0_FIFO
>  #define IRQ_FIMD0_VSYNC  EXYNOS4_IRQ_FIMD0_VSYNC
> diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
> index 03f654d..ace76b4 100644
> --- a/arch/arm/plat-samsung/devs.c
> +++ b/arch/arm/plat-samsung/devs.c
> @@ -1125,7 +1125,7 @@ struct platform_device s5p_device_onenand = {
> 
>  /* PMU */
> 
> -#ifdef CONFIG_PLAT_S5P
> +#if defined(CONFIG_PLAT_S5P) && !defined(CONFIG_ARCH_EXYNOS)
>  static struct resource s5p_pmu_resource[] = {
>   DEFINE_RES_IRQ(IRQ_PMU)
>  };
> --
> 1.7.9.5

Looks OK to me, will apply with your updated 2nd patch.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 v4 4/5] ARM: EXYNOS: Add arm-pmu DT binding for exynos5250

2012-10-23 Thread Kukjin Kim
Chanho Park wrote:
> 
> This patch enables arm-pmu to bind device tree for exynos5250. The
> exynos5250
> has two pmus which have combiner irq type.
> 
> Reviewed-by: Thomas Abraham 
> Signed-off-by: Chanho Park 
> Signed-off-by: Kyungmin Park 
> ---
>  arch/arm/boot/dts/exynos5250.dtsi |6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos5250.dtsi
> b/arch/arm/boot/dts/exynos5250.dtsi
> index dddfd6e..fab3eae 100644
> --- a/arch/arm/boot/dts/exynos5250.dtsi
> +++ b/arch/arm/boot/dts/exynos5250.dtsi
> @@ -56,6 +56,12 @@
><0 28 0>, <0 29 0>, <0 30 0>, <0 31 0>;
>   };
> 
> + pmu {
> + compatible = "arm,cortex-a15-pmu";
> + interrupt-parent = <&combiner>;
> + interrupts = <1 2>, <22 4>;
> + };
> +
>   watchdog {
>   compatible = "samsung,s3c2410-wdt";
>   reg = <0x101D 0x100>;
> --
> 1.7.9.5

OK, applied.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 v4 5/5] ARM: EXYNOS: Add arm-pmu DT binding for exynos421x

2012-10-23 Thread Kukjin Kim
Chanho Park wrote:
> 
> This patch adds a arm-pmu node to bind device tree for exynos4210.
> The exynos4210 and 4212 have two cpus which includes a pmu. In contrast,
> the
> exynos4412 has 4 cpus and pmus. We need to define two more pmus for this
> type
> board. However, supporting arm-pmu for the exynos4412 will handle it later
> because there is no dts support for 4412 based board.
> 
> Signed-off-by: Chanho Park 
> Signed-off-by: Kyungmin Park 
> ---
>  arch/arm/boot/dts/exynos4210.dtsi |6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos4210.dtsi
> b/arch/arm/boot/dts/exynos4210.dtsi
> index 214c557..90f9aed 100644
> --- a/arch/arm/boot/dts/exynos4210.dtsi
> +++ b/arch/arm/boot/dts/exynos4210.dtsi
> @@ -42,6 +42,12 @@
><0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>;
>   };
> 
> + pmu {
> + compatible = "arm,cortex-a9-pmu";
> + interrupt-parent = <&combiner>;
> + interrupts = <2 2>, <3 2>;
> + };
> +
>   pinctrl_0: pinctrl@1140 {
>   compatible = "samsung,pinctrl-exynos4210";
>   reg = <0x1140 0x1000>;
> --
> 1.7.9.5

Looks OK, applied.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 v4 0/6] arm: exynos: add dt based support for exynos5 hdmi

2012-10-23 Thread Kukjin Kim
Rahul Sharma wrote:
> 
> This patch set adds the DT based support for Samsung's Exynos5250. It adds
> device tree nodes for hdmi, mixer, hdmiphy and hdmiddc. The name of these
> devices are changed to the one matching with drivers. Exynos-drm and
> exynos
> hdmi-drm-commmon devices are removed from machine init code.
> 
> Exynos-drm and exynos hdmi-drm-commmon devices are removed from machine
> init code. Patch set which adds this code is posted to dri-devel list at
> http://comments.gmane.org/gmane.comp.video.dri.devel/75121.
> 
> This patchset is based on linux v3.6-rc6, branch v3.7-next/dt-samsung at
> git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> 
> v1:
> - dropped patch for hpd gpio initialisation from machine init.
> - dropped patch for platform device registration.
> - removed platform device registration from non-dt platforms.
> 
> v2:
> - removed version information from hdmi, mixer dt nodes.
> - added DT binding documentation for hdmi, mixer, hdmiphy and hdmiddc.
> 
> v3:
> - corrected indentations.
> - changed dt node names to name@address format.
> 
> v4:
> - added newline at end of device-tree binding document files.
> - removes macros for mixer, hdmi physical addresses.
> - removed @address from mixer and hdmi DT nodes.
> 
> Rahul Sharma (6):
>   dts: exynos: add device tree support for exynos5 hdmi
>   dts: exynos: add device tree support for exynos5 mixer
>   dts: exynos: add device tree support for exynos5 hdmiphy
>   dts: exynos: add device tree support for exynos5 hdmiddc
>   arm: exynos: add clocks for exynos5 hdmi
>   arm: exynos: removing exynos-drm device registration from non-dt
> platforms
> 
>  .../devicetree/bindings/drm/exynos/hdmi.txt|   22 +++
>  .../devicetree/bindings/drm/exynos/hdmiddc.txt |   12 
>  .../devicetree/bindings/drm/exynos/hdmiphy.txt |   12 
>  .../devicetree/bindings/drm/exynos/mixer.txt   |   15 ++
>  arch/arm/boot/dts/exynos5250-smdk5250.dts  |   24
+++-
>  arch/arm/boot/dts/exynos5250.dtsi  |   20 +
>  arch/arm/mach-exynos/Makefile  |1 -
>  arch/arm/mach-exynos/clock-exynos5.c   |   14 -
>  arch/arm/mach-exynos/dev-drm.c |   29

>  arch/arm/mach-exynos/mach-exynos5-dt.c |8 +
>  arch/arm/mach-exynos/mach-nuri.c   |3 --
>  arch/arm/mach-exynos/mach-origen.c |3 --
>  arch/arm/mach-exynos/mach-smdk4x12.c   |3 --
>  arch/arm/mach-exynos/mach-smdkv310.c   |3 --
>  arch/arm/mach-exynos/mach-universal_c210.c |3 --
>  arch/arm/plat-samsung/include/plat/devs.h  |2 -
>  16 files changed, 124 insertions(+), 50 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/drm/exynos/hdmi.txt
>  create mode 100644
> Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt
>  create mode 100644
> Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt
>  create mode 100644 Documentation/devicetree/bindings/drm/exynos/mixer.txt
>  delete mode 100644 arch/arm/mach-exynos/dev-drm.c

Looks OK to me, will apply this whole series.

Inki, if you want to need a topic branch for this series, please let me
know. I will create it for you.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 V3] gpio: samsung: use pr_* instead of printk

2012-10-23 Thread Kukjin Kim
Linus Walleij wrote:
> 
> On Mon, Oct 22, 2012 at 3:02 AM, Jingoo Han  wrote:
> > On Friday, October 19, 2012 7:09 PM Linus Walleij wrote
> >>
> >> On Wed, Oct 17, 2012 at 3:52 AM, Jingoo Han 
wrote:
> >>
> >> > This patch uses pr_* instead of printk. Also, gpio_dbg
> >> > is replaced with pr_debug.
> >> >
> >> > Signed-off-by: Jingoo Han 
> >> > Reviewed-by: Linus Walleij  <- NAK
> >>
> >> Please consult Documentation/SubmittingPatches as to the conditions
> that
> >> apply when you add Reviewed-by tags.
> >
> > Um, you already gave the Reviewed-by to the same patch, a month ago.
> > Anyway, I will remove Reviewed-by and send v4 patch, soon.
> 
> My bad. I confused this mail thread for something else, sorry
> for this. :-(
> 
> Please keep the Reviewed-tag if you want to!
> 
Linus, if you don't have any objection, let me take this into Samsung tree.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 2/2] gpio: samsung: Fix input mode setting function for GPIO int

2012-10-23 Thread Kukjin Kim
Linus Walleij wrote:
> 
> On Thu, Sep 27, 2012 at 5:55 AM, Eunki Kim  wrote:
> 
> > This patch makes GPIO pin to INTERRUPT mode or INPUT mode according
> > to bitmap_gpio_int. When the related bit of bitmap_gpio_int is set,
> > it makes GPIO pin to INTERRUPT mode instrad of INPUT mode in the
> > samsung_gpiolib_4bit_input function.
> >
> > Signed-off-by: Eunki Kim 
> > Cc: Kukjin Kim 
> 
> Acked-by: Linus Walleij 
> 
> Are you taking this into the Samsung tree or shall I merge it
> into my GPIO tree? In the latter case I need an ACK from
> some Samsung maintainer.
> 
Hi, Linus

Let me pick this into Samsung tree with your ack :)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 1/2] ARM: SAMSUNG: Insert bitmap_gpio_int member in samsung_gpio_chip

2012-10-23 Thread Kukjin Kim
Eunki Kim wrote:
> 
> When a device uses GPIO interrupt, its driver assumes that GPIO
> should be INPUT mode. However, GPIO of SAMSUNG SoC is sepated to
> INPUT mode and INTERRUPT mode. They are set by 0x0 and 0xF in GPIO
> control register. If the register is set to INPUT mode, the
> interrupt never occur. Therefore, it's necessary to set INTERRUPT
> mode instead of INPUT mode when the pin is used for GPIO interrupt.
> 
> This patch inserts the bitmap_gpio_int member in struct samsung_
> gpio_chip in order to represent use of GPIO interrupt for each pin
> and sets the related bit when s5p_register_gpio_interrupt function
> is called.
> 
> Signed-off-by: Eunki Kim 
> Cc: Grant Likely 
> Cc: Linus Walleij 
> ---
>  arch/arm/plat-samsung/include/plat/gpio-core.h |2 ++
>  arch/arm/plat-samsung/s5p-irq-gpioint.c|8 ++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/plat-samsung/include/plat/gpio-core.h
> b/arch/arm/plat-samsung/include/plat/gpio-core.h
> index 1fe6917..dfd8b7a 100644
> --- a/arch/arm/plat-samsung/include/plat/gpio-core.h
> +++ b/arch/arm/plat-samsung/include/plat/gpio-core.h
> @@ -48,6 +48,7 @@ struct samsung_gpio_cfg;
>   * @config: special function and pull-resistor control information.
>   * @lock: Lock for exclusive access to this gpio bank.
>   * @pm_save: Save information for suspend/resume support.
> + * @bitmap_gpio_int: Bitmap for representing GPIO interrupt or not.
>   *
>   * This wrapper provides the necessary information for the Samsung
>   * specific gpios being registered with gpiolib.
> @@ -71,6 +72,7 @@ struct samsung_gpio_chip {
>  #ifdef CONFIG_PM
>   u32 pm_save[4];
>  #endif
> + u32 bitmap_gpio_int;
>  };
> 
>  static inline struct samsung_gpio_chip *to_samsung_gpio(struct gpio_chip
> *gpc)
> diff --git a/arch/arm/plat-samsung/s5p-irq-gpioint.c b/arch/arm/plat-
> samsung/s5p-irq-gpioint.c
> index f9431fe..d981c61 100644
> --- a/arch/arm/plat-samsung/s5p-irq-gpioint.c
> +++ b/arch/arm/plat-samsung/s5p-irq-gpioint.c
> @@ -185,7 +185,7 @@ int __init s5p_register_gpio_interrupt(int pin)
> 
>   /* check if the group has been already registered */
>   if (my_chip->irq_base)
> - return my_chip->irq_base + offset;
> + goto success;
> 
>   /* register gpio group */
>   ret = s5p_gpioint_add(my_chip);
> @@ -193,9 +193,13 @@ int __init s5p_register_gpio_interrupt(int pin)
>   my_chip->chip.to_irq = samsung_gpiolib_to_irq;
>   printk(KERN_INFO "Registered interrupt support for gpio
> group %d.\n",
>  group);
> - return my_chip->irq_base + offset;
> + goto success;
>   }
>   return ret;
> +success:
> + my_chip->bitmap_gpio_int |= BIT(offset);
> +
> + return my_chip->irq_base + offset;
>  }
> 
>  int __init s5p_register_gpioint_bank(int chain_irq, int start, int
> nr_groups)
> --
> 1.7.1

OK, applied.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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 v5] ARM: EXYNOS: Add MFC device tree support

2012-10-23 Thread Kukjin Kim
Arun Kumar K wrote:
> 
> This patch adds device tree entry for MFC v6 in the Exynos5
> SoC. Makes the required changes in the clock files and adds
> MFC to the DT device list.
> 
> Signed-off-by: Naveen Krishna Chatradhi 
> Signed-off-by: Arun Kumar K 
> ---
>  .../devicetree/bindings/media/s5p-mfc.txt  |   23 +
>  arch/arm/boot/dts/exynos5250-smdk5250.dts  |5 +++
>  arch/arm/boot/dts/exynos5250.dtsi  |6 +++
>  arch/arm/mach-exynos/Kconfig   |1 +
>  arch/arm/mach-exynos/clock-exynos5.c   |2 +-
>  arch/arm/mach-exynos/mach-exynos5-dt.c |   16 +
>  arch/arm/plat-samsung/devs.c   |1 +
>  arch/arm/plat-samsung/include/plat/mfc.h   |   11 ++
>  arch/arm/plat-samsung/s5p-dev-mfc.c|   34

>  9 files changed, 98 insertions(+), 1 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/media/s5p-mfc.txt
> 
Looks ok to me, applied.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , 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


ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined

2012-10-23 Thread Kukjin Kim
Hi all,

Now, v3.7-rc2 happens following build error with s3c2410_defconfig...

ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make[1]: *** Waiting for unfinished jobs

Any idea on this?

Thanks.

K-Gene 

--
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] ASoC: Samsung: Update Kconfig for Exynos5250 and Exynos4412

2012-10-23 Thread Olof Johansson
2012/10/23 Kukjin Kim :
> Tushar Behera wrote:
>>
>> On 09/28/2012 03:23 PM, Sangsu Park wrote:
>> >
>> > On Thu, Sep 27, 2012 at 07:30 PM, Padmavathi Venna wrote:
>> >
>
> [...]
>
>> >> @@ -63,7 +63,7 @@ config SND_SOC_SAMSUNG_SMDK_WM8580
>> >>
>> >>  config SND_SOC_SAMSUNG_SMDK_WM8994
>> >>tristate "SoC I2S Audio support for WM8994 on SMDK"
>> >> -  depends on SND_SOC_SAMSUNG && (MACH_SMDKV310 || MACH_SMDKC210 ||
>> >> MACH_SMDK4212)
>> >> +  depends on SND_SOC_SAMSUNG && (MACH_SMDKV310 || MACH_SMDKC210 ||
>> >> MACH_SMDK4212 || MACH_SMDK4412 || MACH_EXYNOS5_DT)
>> >>depends on I2C=y && GENERIC_HARDIRQS
>> >>select MFD_WM8994
>> >>select SND_SOC_WM8994
>> >
>> > I'm not sure about this since MACH_EXYNOS5_DT can have others instead of
>> SMDK.
>> >
>>
>> But there is no other way we can differentiate between two EXYNOS5_DT
>> based boards in the kernel. So, support for all possible codecs and
>> sound-cards should be enabled in the kernel. The instantiation of the
>> drivers should depend on the device-tree entries.
>>
> Hmm...any idea on this?

Tushar is right. In particular, there is absolutely no reason to
enforce driver selection based on platform enablement, as long as it
still builds no matter what (and if it doesn't, that should probably
be fixed).

It should be possible to enable a superset of all drivers, and only
have the ones that are actually instantiated by platform devices or
device tree entries probe and configure. That's how the kernel works
on nearly all platforms.


So, removing as much "depends on" as possible (probably only keep
SND_SOC_SAMSUNG here) seems like a good choice, and fixing any
compilation errors caused by it.


-Olof
--
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: ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined

2012-10-23 Thread Marc Zyngier
On 23/10/12 15:48, Kukjin Kim wrote:
> Hi all,
> 
> Now, v3.7-rc2 happens following build error with s3c2410_defconfig...
> 
> ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
> make[2]: *** [__modpost] Error 1
> make[1]: *** [modules] Error 2
> make[1]: *** Waiting for unfinished jobs
> 
> Any idea on this?

This is becoming a recurring pattern...

Please see:
https://patchwork.kernel.org/patch/1570611/
https://lkml.org/lkml/2012/10/9/393

and probably a few other instances...

M.
-- 
Jazz is not dead. It just smells funny...

--
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: ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined

2012-10-23 Thread Will Deacon
On Tue, Oct 23, 2012 at 03:48:21PM +0100, Kukjin Kim wrote:
> Hi all,
> 
> Now, v3.7-rc2 happens following build error with s3c2410_defconfig...
> 
> ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
> make[2]: *** [__modpost] Error 1
> make[1]: *** [modules] Error 2
> make[1]: *** Waiting for unfinished jobs
> 
> Any idea on this?

A fix for this is queued in rmk's fixes branch.

Will
--
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: dts: exynos4: Enable serial controllers on Origen and SMDKV310

2012-10-23 Thread Tomasz Figa
On Tuesday 23 of October 2012 21:03:01 Kukjin Kim wrote:
> Tomasz Figa wrote:
> > However I think this should be considered a fix, because without it
> > serial console on Origen and SMDKV310 will be broken.
> 
> Well, I couldn't find any broken due to miss this for v3.7. I think,
> there is no usage of serial controller in mainline for Origen and
> SMDKV310 now. So this should be queued for -next. If not, please let me
> know.

Personally I'm fine with this, but it sounds a bit off, since (correct me 
if I am wrong) it looks like serial console is the only way to check if 
the board boots.

Best regards,
Tomasz Figa

--
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: EXYNOS: Add support for secondary CPU bring-up on Exynos4412

2012-10-23 Thread Tomasz Figa
Hi Kgene,

On Tuesday 23 of October 2012 20:57:33 Kukjin Kim wrote:
> Tomasz Figa wrote:
> > Exynos4412 uses different information register for each core. This
> > patch adjusts the bring-up code to take that into account.
> > 
> > Signed-off-by: Tomasz Figa 
> > Signed-off-by: Kyungmin Park 
> > ---
> > 
> >  arch/arm/mach-exynos/platsmp.c | 27 +--
> >  1 file changed, 21 insertions(+), 6 deletions(-)
> > 
> > diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-
> > exynos/platsmp.c
> > index 36c3984..816a27d 100644
> > --- a/arch/arm/mach-exynos/platsmp.c
> > +++ b/arch/arm/mach-exynos/platsmp.c
> > @@ -34,8 +34,19 @@
> > 
> >  extern void exynos4_secondary_startup(void);
> > 
> > -#define CPU1_BOOT_REG  (samsung_rev() == EXYNOS4210_REV_1_1
> 
> ? \
> 
> > -   S5P_INFORM5 : S5P_VA_SYSRAM)
> > +static inline void __iomem *cpu_boot_reg_base(void)
> > +{
> > +   if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)
> > +   return S5P_INFORM5;
> > +   return S5P_VA_SYSRAM;
> > +}
> > +
> > +static inline void __iomem *cpu_boot_reg(int cpu)
> > +{
> > +   if (soc_is_exynos4412())
> > +   return cpu_boot_reg_base() + 4*cpu;
> > +   return cpu_boot_reg_base();
> > +}
> > 
> >  /*
> >  
> >   * control for which core is the next to come out of the secondary
> > 
> > @@ -89,6 +100,7 @@ void __cpuinit platform_secondary_init(unsigned int
> 
> cpu)
> 
> >  int __cpuinit boot_secondary(unsigned int cpu, struct task_struct
> >  *idle) {
> >  
> > unsigned long timeout;
> > 
> > +   unsigned long phys_cpu = cpu_logical_map(cpu);
> > 
> > /*
> > 
> >  * Set synchronisation state between this boot processor
> > 
> > @@ -104,7 +116,7 @@ int __cpuinit boot_secondary(unsigned int cpu,
> > struct task_struct *idle)
> > 
> >  * Note that "pen_release" is the hardware CPU ID, whereas
> >  * "cpu" is Linux's internal ID.
> >  */
> > 
> > -   write_pen_release(cpu_logical_map(cpu));
> > +   write_pen_release(phys_cpu);
> > 
> > if (!(__raw_readl(S5P_ARM_CORE1_STATUS) & S5P_CORE_LOCAL_PWR_EN)) {
> > 
> > __raw_writel(S5P_CORE_LOCAL_PWR_EN,
> > 
> > @@ -138,7 +150,7 @@ int __cpuinit boot_secondary(unsigned int cpu,
> > struct task_struct *idle)
> > 
> > smp_rmb();
> > 
> > __raw_writel(virt_to_phys(exynos4_secondary_startup),
> > 
> > -   CPU1_BOOT_REG);
> > +
> 
> cpu_boot_reg(phys_cpu));
> 
> > gic_raise_softirq(cpumask_of(cpu), 1);
> > 
> > if (pen_release == -1)
> > 
> > @@ -186,6 +198,8 @@ void __init smp_init_cpus(void)
> > 
> >  void __init platform_smp_prepare_cpus(unsigned int max_cpus)
> >  {
> > 
> > +   int i;
> > +
> > 
> > if (!soc_is_exynos5250())
> > 
> > scu_enable(scu_base_addr());
> > 
> > @@ -195,6 +209,7 @@ void __init platform_smp_prepare_cpus(unsigned int
> > max_cpus)
> > 
> >  * until it receives a soft interrupt, and then the
> >  * secondary CPU branches to this address.
> >  */
> > 
> > -   __raw_writel(virt_to_phys(exynos4_secondary_startup),
> > -   CPU1_BOOT_REG);
> > +   for (i = 1; i < max_cpus; ++i)
> > +   __raw_writel(virt_to_phys(exynos4_secondary_startup),
> > +   cpu_boot_reg(cpu_logical_map(i)));
> > 
> >  }
> > 
> > --
> > 1.7.12
> 
> Looks ok to me, applied.
> 
> Thanks.

This is an old version of the patch. A new one was posted as a part of the 
series adding support for firmware ops, with corrections for received 
comments.

Best regards,
Tomasz Figa

--
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: EXYNOS: Kconfig: Rename CPU_EXYNOS4210 to SOC_EXYNOS4210

2012-10-23 Thread Tomasz Figa
Hi Kgene,

Thanks for your comments.

On Tuesday 23 of October 2012 21:24:54 Kukjin Kim wrote:
> Tomasz Figa wrote:
> > This patch renames CONFIG_CPU_EXYNOS4210 to CONFIG_SOC_EXYNOS4210 to
> > match the convention used by rest of Exynos SoCs and correctly
> > represent the reality (Exynos4210 is a SoC, not a CPU).
> > 
> > Signed-off-by: Tomasz Figa 
> > Signed-off-by: Kyungmin Park 
> 
> Cc: Rafael J. Wysocki 
> Cc: MyungJoo Ham 
> Cc: Chris Ball 
> Cc: Greg Kroah-Hartman 
> Cc: Grant Likely 
> Cc: Linus Walleij 
> Cc: Zhang Rui 
> 
> > ---
> > 
> >  arch/arm/mach-exynos/Kconfig | 14 +++---
> >  arch/arm/mach-exynos/Makefile|  2 +-
> >  arch/arm/mach-exynos/common.h|  2 +-
> >  arch/arm/plat-samsung/include/plat/cpu.h |  2 +-
> >  drivers/cpufreq/Kconfig.arm  |  2 +-
> >  drivers/devfreq/Kconfig  |  2 +-
> >  drivers/mmc/host/sdhci-s3c.c |  2 +-
> >  drivers/tty/serial/samsung.c |  2 +-
> >  8 files changed, 14 insertions(+), 14 deletions(-)
> > 
[snip]
> > diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
> > index f6b0a6e2..8545069 100644
> > --- a/drivers/devfreq/Kconfig
> > +++ b/drivers/devfreq/Kconfig
> > @@ -67,7 +67,7 @@ comment "DEVFREQ Drivers"
> > 
> >  config ARM_EXYNOS4_BUS_DEVFREQ
> >  
> > bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver"
> > 
> > -   depends on CPU_EXYNOS4210 || CPU_EXYNOS4212 || CPU_EXYNOS4412
> > +   depends on SOC_EXYNOS4210 || CPU_EXYNOS4212 || CPU_EXYNOS4412
> 
> (+ MyungJoo Ham)
> 
> MyungJoo, should be fixed separately with this.
> 
> 8<--
> 
> From: Kukjin Kim 
> Subject: PM / devfreq: fix the dependency for EXYNOS4212 and EXYNOS4412
> 
> The CPU_EXYNOS4212 and CPU_EXYNOS4412 should be fixed.
> 
> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
> index f6b0a6e2..e73cede 100644
> --- a/drivers/devfreq/Kconfig
> +++ b/drivers/devfreq/Kconfig
> @@ -67,7 +67,7 @@ comment "DEVFREQ Drivers"
> 
>  config ARM_EXYNOS4_BUS_DEVFREQ
>   bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver"
> - depends on CPU_EXYNOS4210 || CPU_EXYNOS4212 || CPU_EXYNOS4412
> + depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412
>   select ARCH_HAS_OPP
>   select DEVFREQ_GOV_SIMPLE_ONDEMAND
>   help
> 8<--


Indeed, in result this would make my patch:

-   depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412
+   depends on SOC_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412

(with your patch as a dependency)

> > select ARCH_HAS_OPP
> > select DEVFREQ_GOV_SIMPLE_ONDEMAND
> > help
> > 
> > diff --git a/drivers/mmc/host/sdhci-s3c.c
> > b/drivers/mmc/host/sdhci-s3c.c index a50c205..b090415 100644
> > --- a/drivers/mmc/host/sdhci-s3c.c
> > +++ b/drivers/mmc/host/sdhci-s3c.c
> > @@ -716,7 +716,7 @@ static const struct dev_pm_ops sdhci_s3c_pmops = {
> > 
> >  #define SDHCI_S3C_PMOPS NULL
> >  #endif
> > 
> > -#if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS4212)
> > +#if defined(CONFIG_SOC_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS4212)
> > 
> >  static struct sdhci_s3c_drv_data exynos4_sdhci_drv_data = {
> >  
> > .sdhci_quirks = SDHCI_QUIRK_NONSTANDARD_CLOCK,
> >  
> >  };
> > 
> > diff --git a/drivers/tty/serial/samsung.c
> > b/drivers/tty/serial/samsung.c index 02d07bf..175ba6e 100644
> > --- a/drivers/tty/serial/samsung.c
> > +++ b/drivers/tty/serial/samsung.c
> > @@ -1594,7 +1594,7 @@ static struct s3c24xx_serial_drv_data
> > s5pv210_serial_drv_data = {
> > 
> >  #define S5PV210_SERIAL_DRV_DATA(kernel_ulong_t)NULL
> >  #endif
> > 
> > -#if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS4212)
> > || \ +#if defined(CONFIG_SOC_EXYNOS4210) ||
> > defined(CONFIG_SOC_EXYNOS4212) || \> 
> > defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
> >  
> >  static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = {
> >  
> > .info = &(struct s3c24xx_uart_info) {
> > 
> > --
> > 1.7.12
> 
> Tomasz, looks ok to me but I think, accordingly, following should be
> updated together?
> 
> 8<
> 
> diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
> index a006f0d..3a665ff 100644
> --- a/drivers/gpio/gpio-samsung.c
> +++ b/drivers/gpio/gpio-samsung.c
> @@ -2790,7 +2790,7 @@ static __init void
> exynos_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip,
> 
>  static __init void exynos4_gpiolib_init(void)
>  {
> -#ifdef CONFIG_CPU_EXYNOS4210
> +#ifdef CONFIG_SOC_EXYNOS4210
>   struct samsung_gpio_chip *chip;
>   int i, nr_chips;
>   void __iomem *gpio_base1, *gpio_base2, *gpio_base3;
> @@ -2887,7 +2887,7 @@ static __init void exynos4_gpiolib_init(void)
>   samsung_gpiolib_add_4bit_chips(exynos4_gpios_3,
>  nr_chips, gpio_base3);
> 
> -#if defined(CONFIG_CPU_EXYNOS4210) && defined(CON

Re: [PATCH 2/4] ARM: EXYNOS: Kconfig: Sort out dependencies between options

2012-10-23 Thread Tomasz Figa
On Tuesday 23 of October 2012 21:35:32 Kukjin Kim wrote:
> Tomasz Figa wrote:
> > This patch modifies the dependencies between Exynos-related Kconfig
> > options to represent the real dependencies between code units more
> > closely.
> > 
> > Originally it was possible to enable ARCH_EXYNOS{4,5} without any
> > SOC_EXYNOS_{4,5}.* enabled, which could end with compilation or link
> > errors. Now ARCH_EXYNOS{4,5} is only selected when there is a
> > SOC_EXYNOS_{4,5}.* enabled, which requires it.
> > 
> > Signed-off-by: Tomasz Figa 
> > Signed-off-by: Kyungmin Park 
> > ---
> > 
> >  arch/arm/mach-exynos/Kconfig | 15 ++-
> >  drivers/devfreq/Kconfig  |  2 +-
> >  drivers/mmc/host/sdhci-s3c.c |  2 +-
> >  drivers/tty/serial/samsung.c |  3 +--
> >  4 files changed, 9 insertions(+), 13 deletions(-)
> > 
> > diff --git a/arch/arm/mach-exynos/Kconfig
> > b/arch/arm/mach-exynos/Kconfig index 05dcd07..9f91892 100644
> > --- a/arch/arm/mach-exynos/Kconfig
> > +++ b/arch/arm/mach-exynos/Kconfig
> > @@ -12,15 +12,14 @@ if ARCH_EXYNOS
> > 
> >  menu "SAMSUNG EXYNOS SoCs Support"
> >  
> >  config ARCH_EXYNOS4
> > 
> > -   bool "SAMSUNG EXYNOS4"
> > -   default y
> > +   def_bool n
> > 
> > select HAVE_SMP
> > select MIGHT_HAVE_CACHE_L2X0
> > help
> > 
> >   Samsung EXYNOS4 SoCs based systems
> >  
> >  config ARCH_EXYNOS5
> > 
> > -   bool "SAMSUNG EXYNOS5"
> > +   def_bool n
> > 
> > select HAVE_SMP
> > help
> > 
> >   Samsung EXYNOS5 (Cortex-A15) SoC based systems
> > 
> > @@ -30,7 +29,7 @@ comment "EXYNOS SoCs"
> > 
> >  config SOC_EXYNOS4210
> >  
> > bool "SAMSUNG EXYNOS4210"
> > default y
> > 
> > -   depends on ARCH_EXYNOS4
> > +   select ARCH_EXYNOS4
> > 
> > select SAMSUNG_DMADEV
> > select ARM_CPU_SUSPEND if PM
> > select S5P_PM if PM
> > 
> > @@ -42,7 +41,7 @@ config SOC_EXYNOS4210
> > 
> >  config SOC_EXYNOS4212
> >  
> > bool "SAMSUNG EXYNOS4212"
> > default y
> > 
> > -   depends on ARCH_EXYNOS4
> > +   select ARCH_EXYNOS4
> > 
> > select SAMSUNG_DMADEV
> > select S5P_PM if PM
> > select S5P_SLEEP if PM
> > 
> > @@ -51,6 +50,7 @@ config SOC_EXYNOS4212
> > 
> >  config SOC_EXYNOS4412
> >  
> > bool "SAMSUNG EXYNOS4412"
> > 
> > +   select ARCH_EXYNOS4
> > 
> > default y
> > depends on ARCH_EXYNOS4
> > select SAMSUNG_DMADEV
> > 
> > @@ -60,7 +60,7 @@ config SOC_EXYNOS4412
> > 
> >  config SOC_EXYNOS5250
> >  
> > bool "SAMSUNG EXYNOS5250"
> > default y
> > 
> > -   depends on ARCH_EXYNOS5
> > +   select ARCH_EXYNOS5
> > 
> > select SAMSUNG_DMADEV
> > select S5P_PM if PM
> > select S5P_SLEEP if PM
> > 
> > @@ -176,8 +176,6 @@ config EXYNOS_SETUP_SPI
> 
> Basically, I agree with your approach. Its CONFIG_ARCH_EXYNOSx depends
> on selecting own SOC.
> 
> BTW, I'm thinking, which one selecting is better to us board? Or SoC?...

IMHO board selecting SoC selecting arch seems to represent reality the 
best, because a board is based on particular SoC, which is based on 
particular arch (family).

> >  # machine support
> > 
> > -if ARCH_EXYNOS4
> > -
> 
> Well, according to removing above, we can select following exynos4210
> boards on other stuff. Of course, when select board, regarding soc is
> selected though. So I'm thinking I said as above.

Sorry, I'm not sure what you mean.

> >  comment "EXYNOS4210 Boards"
> >  
> >  config MACH_SMDKC210
> > 
> > @@ -397,7 +395,6 @@ config MACH_SMDK4412
> > 
> > select MACH_SMDK4212
> > help
> > 
> >   Machine support for Samsung SMDK4412
> > 
> > -endif
> > 
> >  comment "Flattened Device Tree based board for EXYNOS SoCs"
> > 
> > diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
> > index 8545069..c559609 100644
> > --- a/drivers/devfreq/Kconfig
> > +++ b/drivers/devfreq/Kconfig
> > @@ -67,7 +67,7 @@ comment "DEVFREQ Drivers"
> > 
> >  config ARM_EXYNOS4_BUS_DEVFREQ
> >  
> > bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver"
> > 
> > -   depends on SOC_EXYNOS4210 || CPU_EXYNOS4212 || CPU_EXYNOS4412
> > +   depends on ARCH_EXYNOS4
> 
> I don't think so, because it depends on SoC not architecture. In
> addition, we don't know ARM_EXYNOS4_BUS_DEVFREQ is available on
> upcoming exynos4...

Hmm, good point, but wouldn't this apply as well to any Makefile option 
using CONFIG_ARCH_EXYNOS4 at the moment? (e.g. clock-exynos4.o, dev-
audio.o, etc.)

Best regards,
Tomasz Figa

--
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 3/4] ARM: EXYNOS: Kconfig: Group EXYNOS{4212,4412} into EXYNOS4X12

2012-10-23 Thread Tomasz Figa
On Tuesday 23 of October 2012 21:42:04 Kukjin Kim wrote:
> Tomasz Figa wrote:
> > This patch adds CONFIG_EXYNOS4X12, which is automatically selected
> > whenever there is at least one SoC from Exynos4x12 line enabled. All
> > the shared dependencies of EXYNOS{4212,4412} are moved to this new
> > option.
> > 
> > This fixes build with Exynos4412 enabled and Exynos4212 and Exynos4210
> > disabled and also allows to simplify conditional compilation in
> > several
> > places.
> > 
> > Signed-off-by: Tomasz Figa 
> > Signed-off-by: Kyungmin Park 
> > ---
> > 
> >  arch/arm/mach-exynos/Kconfig  | 15 +--
> >  arch/arm/mach-exynos/Makefile |  2 +-
> >  arch/arm/mach-exynos/common.h |  2 +-
> >  drivers/cpufreq/Kconfig.arm   |  2 +-
> >  4 files changed, 12 insertions(+), 9 deletions(-)
> > 
> > diff --git a/arch/arm/mach-exynos/Kconfig
> > b/arch/arm/mach-exynos/Kconfig index 9f91892..6ea95f0 100644
> > --- a/arch/arm/mach-exynos/Kconfig
> > +++ b/arch/arm/mach-exynos/Kconfig
> > @@ -38,22 +38,25 @@ config SOC_EXYNOS4210
> > 
> > help
> > 
> >   Enable EXYNOS4210 CPU support
> > 
> > -config SOC_EXYNOS4212
> > -   bool "SAMSUNG EXYNOS4212"
> > -   default y
> > +config SOC_EXYNOS4X12
> > +   def_bool n
> > 
> > select ARCH_EXYNOS4
> > select SAMSUNG_DMADEV
> > 
> > +   select ARM_CPU_SUSPEND if PM
> > 
> > select S5P_PM if PM
> > select S5P_SLEEP if PM
> > 
> > +
> > +config SOC_EXYNOS4212
> > +   bool "SAMSUNG EXYNOS4212"
> > +   select SOC_EXYNOS4X12
> > +   default y
> > 
> > help
> > 
> >   Enable EXYNOS4212 SoC support
> >  
> >  config SOC_EXYNOS4412
> >  
> > bool "SAMSUNG EXYNOS4412"
> > 
> > -   select ARCH_EXYNOS4
> > +   select SOC_EXYNOS4X12
> > 
> > default y
> > 
> > -   depends on ARCH_EXYNOS4
> > -   select SAMSUNG_DMADEV
> > 
> > help
> > 
> >   Enable EXYNOS4412 SoC support
> > 
> > diff --git a/arch/arm/mach-exynos/Makefile
> > b/arch/arm/mach-exynos/Makefile index ceeb8c9..f88fcb6 100644
> > --- a/arch/arm/mach-exynos/Makefile
> > +++ b/arch/arm/mach-exynos/Makefile
> > @@ -16,7 +16,7 @@ obj-$(CONFIG_ARCH_EXYNOS) += common.o
> > 
> >  obj-$(CONFIG_ARCH_EXYNOS4) += clock-exynos4.o
> >  obj-$(CONFIG_ARCH_EXYNOS5) += clock-exynos5.o
> >  obj-$(CONFIG_SOC_EXYNOS4210)   += clock-exynos4210.o
> > 
> > -obj-$(CONFIG_SOC_EXYNOS4212)   += clock-exynos4212.o
> > +obj-$(CONFIG_SOC_EXYNOS4X12)   += clock-exynos4212.o
> > 
> >  obj-$(CONFIG_PM)   += pm.o
> >  obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
> > 
> > diff --git a/arch/arm/mach-exynos/common.h
> > b/arch/arm/mach-exynos/common.h index 054c786..a8cb3e6 100644
> > --- a/arch/arm/mach-exynos/common.h
> > +++ b/arch/arm/mach-exynos/common.h
> > @@ -52,7 +52,7 @@ void exynos4210_register_clocks(void);
> > 
> >  #define exynos4210_register_clocks()
> >  #endif
> > 
> > -#ifdef CONFIG_SOC_EXYNOS4212
> > +#ifdef CONFIG_SOC_EXYNOS4X12
> > 
> >  void exynos4212_register_clocks(void);
> >  
> >  #else
> > 
> > diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> > index ca4ede3..d0ff91a 100644
> > --- a/drivers/cpufreq/Kconfig.arm
> > +++ b/drivers/cpufreq/Kconfig.arm
> > @@ -66,7 +66,7 @@ config ARM_EXYNOS4210_CPUFREQ
> > 
> >   SoC (S5PV310 or S5PC210).
> >  
> >  config ARM_EXYNOS4X12_CPUFREQ
> > 
> > -   def_bool (SOC_EXYNOS4212 || SOC_EXYNOS4412)
> > +   def_bool SOC_EXYNOS4X12
> > 
> > help
> > 
> >   This adds the CPUFreq driver for Samsung EXYNOS4X12
> >   SoC (EXYNOS4212 or EXYNOS4412).
> > 
> > --
> > 1.7.12
> 
> Well, do we _really_ need to define CONFIG_SOC_EXYNOS4X12 for supporting
> common part of exynos4212 and exynos4412? In my opinion, it will cause
> confusion rather than reducing code size. Let's just use its own name
> for SoC.

There are files that must be compiled if any of these SoCs is enabled, for 
example clock-exynos4212.o (it contains clocks for both of them regardless 
of the misleading name).

This common Kconfig entry would be used in Makefiles for such cases.

Best regards,
Tomasz Figa

--
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 4/4] ARM: EXYNOS: Kconfig: Remove dependencies on particular SoCs from DT machines

2012-10-23 Thread Tomasz Figa
On Tuesday 23 of October 2012 22:27:41 Kukjin Kim wrote:
> Tomasz Figa wrote:
> > MACH_EXYNOS{4,5}_DT are used for whole SoC lines, so they should
> > depend
> > on ARCH_EXYNOS{4,5} rather than on particular SoCs.
> > 
> > Signed-off-by: Tomasz Figa 
> > Signed-off-by: Kyungmin Park 
> > ---
> > 
> >  arch/arm/mach-exynos/Kconfig | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/arch/arm/mach-exynos/Kconfig
> > b/arch/arm/mach-exynos/Kconfig index 6ea95f0..2e82ce7 100644
> > --- a/arch/arm/mach-exynos/Kconfig
> > +++ b/arch/arm/mach-exynos/Kconfig
> > @@ -404,7 +404,6 @@ comment "Flattened Device Tree based board for
> > EXYNOS SoCs"
> > 
> >  config MACH_EXYNOS4_DT
> >  
> > bool "Samsung Exynos4 Machine using device tree"
> > depends on ARCH_EXYNOS4
> > 
> > -   select SOC_EXYNOS4210
> > 
> > select USE_OF
> > select ARM_AMBA
> > select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
> > 
> > @@ -419,7 +418,6 @@ config MACH_EXYNOS4_DT
> > 
> >  config MACH_EXYNOS5_DT
> >  
> > bool "SAMSUNG EXYNOS5 Machine using device tree"
> > depends on ARCH_EXYNOS5
> > 
> > -   select SOC_EXYNOS5250
> > 
> > select USE_OF
> > select ARM_AMBA
> > help
> > 
> > --
> > 1.7.12
> 
> Hmm...your comment is correct, but we need to think again its selecting
> order, between ARCH name, SoC and board. In addition, in case of
> MACH_XXX_DT depending on SoC is rather to be supposed...

With device tree the situation is a bit different than with boards, 
because mach-exynos4-dt does not limit the scope to a single SoC, but 
rather to the whole Exynos4 arch/family.

Making MACH_EXYNOS4_DT select all SOC_EXYNOS4* would remove the ability to 
enable/disable support for particular Exynos4 SoCs, so in my opinion it is 
not a good option.

Selecting ARCH_EXYNOS4 is not enough for the kernel to work, because at 
least one SoC must be enabled.

So I think that letting the user select the SoCs he want to be supported 
and making MACH_EXYNOS4_DT depend on at least one of Exynos4 SoCs (which 
is implied by ARCH_EXYNOS4 enabled) is the most reasonable variant.

Btw. Maybe this could go in pair with something like

 static char const *exynos4_dt_compat[] __initdata = {
+#ifdef CONFIG_SOC_EXYNOS4210
"samsung,exynos4210",
+#endif
/* and so on for any Exynos4 SoCs added in future... */
NULL
 };

to make the kernel reject booting DT-enabled boards with unsupported SoCs. 
What do you think?

Best regards,
Tomasz Figa

--
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] mmc: sdhci-s3c: use clk_prepare_enable and clk_disable_unprepare

2012-10-23 Thread Chris Ball
Hi,

On Tue, Oct 02 2012, Thomas Abraham wrote:
> Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
> calls as required by common clock framework.
>
> Signed-off-by: Thomas Abraham 

Thanks, pushed to mmc-next for 3.8.

- Chris.
-- 
Chris Ball  
One Laptop Per Child
--
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] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host

2012-10-23 Thread Chris Ball
Hi,

On Mon, Oct 08 2012, Yuvaraj CD wrote:
> As mmc_start_host is getting called before enabling the dw_mmc controller
> interrupt, there is a problem of missing the SDMMC_INT_CMD_DONE for the
> very first command sent by the sdio_reset.
> This problem occurs only when we disable MMC debugging i.e, MMC_DEBUG [=n].
> Hence this patch enables the dw_mmc controller interrupt before 
> mmc_start_host.
>
> Signed-off-by: Yuvaraj CD 

Is "Yuvaraj CD" your legal name?  We should use your full name so that
we can track copyright attribution properly.

Thanks!

- Chris.
-- 
Chris Ball  
One Laptop Per Child
--
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 v5] ARM: EXYNOS: Add MFC device tree support

2012-10-23 Thread Kukjin Kim

On 10/23/12 19:12, Arun Kumar K wrote:

Hi Seungwoo Kim,

Thank you for the review.


+
+ /* Reserve memory for MFC only if it's available */
+ mfc_mem.compatible = "samsung,mfc-v6";
+ if (of_scan_flat_dt(s5p_fdt_find_mfc_mem,&mfc_mem))


of_scan_flat_dt() is called but it does not have __init on its
definition. So this causes section mismatch.



The function of_scan_flat_dt is having __init in its definition.


Yes.


I hope you meant the function s5p_fdt_find_mfc_mem which is not
defined with __init and causing section mismatch.


I think so.


I will correct this and post an updated patch.


I fixed when I applied.

Seung-Woo, thanks for your reporting.

Best regards,
Kgene.
--
Kukjin Kim , 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 v4 2/5] ARM: EXYNOS: Correct combined IRQs for exynos4

2012-10-23 Thread Chanho Park
> -Original Message-
> From: linux-arm-kernel-boun...@lists.infradead.org [mailto:linux-arm-
> kernel-boun...@lists.infradead.org] On Behalf Of Kukjin Kim
> Sent: Tuesday, October 23, 2012 10:59 PM
> To: 'Chanho Park'; ben-li...@fluff.org; linux-arm-ker...@lists.infradead.org;
> linux-samsung-soc@vger.kernel.org
> Cc: sachin.ka...@linaro.org; will.dea...@arm.com;
> kyungmin.p...@samsung.com; li...@arm.linux.org.uk;
> thomas.abra...@linaro.org
> Subject: RE: [PATCH v4 2/5] ARM: EXYNOS: Correct combined IRQs for
> exynos4
> 
> Chanho Park wrote:
> >
> > This patch corrects combined IRQs for exynos4 series platform. The
> > exynos4412
> > has four extra combined irq group and the exynos4212 has two more
> > combined irqs than exynos4210. Each irq is mapped to IRQ_SPI(xx).
> > Unfortunately, extra 4 combined IRQs isn't sequential. So, we need to
> > map the irqs manually.
> >
> > Signed-off-by: Chanho Park 
> > Signed-off-by: Kyungmin Park 
> > ---
> >  arch/arm/mach-exynos/common.c|   42
> +
> > -
> >  arch/arm/mach-exynos/include/mach/irqs.h |4 ++-
> >  2 files changed, 39 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/arm/mach-exynos/common.c
> > b/arch/arm/mach-exynos/common.c index 709245e..fdd582a 100644
> > --- a/arch/arm/mach-exynos/common.c
> > +++ b/arch/arm/mach-exynos/common.c
> > @@ -560,23 +560,50 @@ static struct irq_domain_ops
> > combiner_irq_domain_ops = {
> > .map= combiner_irq_domain_map,
> >  };
> >
> > +static unsigned int combiner_extra_irq(int group)
> 
> This is only for exynos4212 and exynos4412 so how about to use
> exynos4x12_combiner_extra_irq()?

I agree with you. I'll change it in next patchset.

> 
> > +{
> > +   switch (group) {
> > +   case 16:
> > +   return IRQ_SPI(107);
> > +   case 17:
> > +   return IRQ_SPI(108);
> > +   case 18:
> > +   return IRQ_SPI(48);
> > +   case 19:
> > +   return IRQ_SPI(42);
> > +   default:
> > +   return 0;
> > +   }
> > +}
> > +
> > +static unsigned int max_combiner_nr(void) {
> > +   if (soc_is_exynos5250())
> > +   return EXYNOS5_MAX_COMBINER_NR;
> > +   else if (soc_is_exynos4412())
> > +   return EXYNOS4_MAX_COMBINER_NR;
> 
> EXYNOS4412_MAX_COMBINER_NR is more clear?

EXYNOS4_MAX_COMBINER_NR is defined for MAX_COMBINER_NR which determines maximum 
combined irq number.
In this situation, EXYNOS4_MAX_COMBINER_NR is more clear than EXYNOS4412_xx.
How about this? I think it's more clearer in all cases.

-#define EXYNOS4_MAX_COMBINER_NR16
+#define EXYNOS4210_MAX_COMBINER_NR 16
+#define EXYNOS4212_MAX_COMBINER_NR 18
+#define EXYNOS4412_MAX_COMBINER_NR 20
+#define EXYNOS4_MAX_COMBINER_NREXYNOS4412_MAX_COMBINER_NR

> 
> > +   else if (soc_is_exynos4212())
> > +   return EXYNOS4212_MAX_COMBINER_NR;
> > +   else
> > +   return EXYNOS4210_MAX_COMBINER_NR;
> > +}
> > +
> >  static void __init combiner_init(void __iomem *combiner_base,
> >  struct device_node *np)
> >  {
> > int i, irq, irq_base;
> > unsigned int max_nr, nr_irq;
> >
> > +   max_nr = max_combiner_nr();
> > +
> > if (np) {
> > if (of_property_read_u32(np, "samsung,combiner-nr",
> &max_nr))
> > {
> > pr_warning("%s: number of combiners not specified,
> "
> 
> Hmm...the message should be changed, because it is just defined by
> checking SoC with this changes not property of device tree...So how about
> just using
> pr_info() with proper message?

I agree with you. I'll fix it.

> 
> > "setting default as %d.\n",
> > -   __func__, EXYNOS4_MAX_COMBINER_NR);
> > -   max_nr = EXYNOS4_MAX_COMBINER_NR;
> > +   __func__, max_nr);
> > }
> > -   } else {
> > -   max_nr = soc_is_exynos5250() ?
> EXYNOS5_MAX_COMBINER_NR :
> > -
>   EXYNOS4_MAX_COMBINER_NR;
> > }
> > +
> > nr_irq = max_nr * MAX_IRQ_IN_COMBINER;
> >
> > irq_base = irq_alloc_descs(COMBINER_IRQ(0, 0), 1, nr_irq, 0); @@
> > -593,7 +620,10 @@ static void __init combiner_init(void __iomem
> > *combiner_base,
> > }
> >
> > for (i = 0; i < max_nr; i++) {
> > -   irq = IRQ_SPI(i);
> > +   if (i < EXYNOS4210_MAX_COMBINER_NR ||
> soc_is_exynos5250())
> > +   irq = IRQ_SPI(i);
> > +   else
> > +   irq = combiner_extra_irq(i);
> >  #ifdef CONFIG_OF
> > if (np)
> > irq = irq_of_parse_and_map(np, i); diff --git
> > a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-
> > exynos/include/mach/irqs.h index 35bced6..3a83546 100644
> > --- a/arch/arm/mach-exynos/include/mach/irqs.h
> > +++ b/arch/arm/mach-exynos/include/mach/irqs.h
> > @@ -165,7 +165,9 @@
> >  #define EXYNOS4_IRQ_FIMD0_VSYNCCOMBINER_IRQ(11, 1)
> >  #define EXYNOS4_IRQ_FIMD

Re: [PATCH v2 2/4] DMA: PL330: Change allocation method to properly free DMA descriptors

2012-10-23 Thread Vinod Koul
On Fri, 2012-10-05 at 15:47 +0530, Inderpal Singh wrote:
> In probe, memory for multiple DMA descriptors were being allocated at once
> and then it was being split and added into DMA pool one by one. The address
> of this memory allocation is not being saved anywhere. To free this memory,
> the address is required. Initially the first node of the pool will be
> pointed by this address but as we use this pool the descs will shuffle and
> hence we will lose the track of the address.
> 
> This patch does following:
> 
> 1. Allocates DMA descs one by one and then adds them to pool so that all
>descs can be fetched and memory freed one by one. This way runtime
>added descs can also be freed.
> 2. Free DMA descs in case of error in probe and in module's remove function
For probe, again you have cleaner code by using devm_kzalloc.

On 1, if we use the devm_kzalloc then we don't need to allocate in
chunks right?

> 
> Signed-off-by: Inderpal Singh 
> ---
>  drivers/dma/pl330.c |   35 +--
>  1 file changed, 25 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index 10c6b6a..bf71ff7 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -2541,20 +2541,20 @@ static int add_desc(struct dma_pl330_dmac *pdmac, 
> gfp_t flg, int count)
>   if (!pdmac)
>   return 0;
>  
> - desc = kmalloc(count * sizeof(*desc), flg);
> - if (!desc)
> - return 0;
> + for (i = 0; i < count; i++) {
> + desc = kmalloc(sizeof(*desc), flg);
> + if (!desc)
> + break;
> + _init_desc(desc);
>  
> - spin_lock_irqsave(&pdmac->pool_lock, flags);
> + spin_lock_irqsave(&pdmac->pool_lock, flags);
>  
> - for (i = 0; i < count; i++) {
> - _init_desc(&desc[i]);
> - list_add_tail(&desc[i].node, &pdmac->desc_pool);
> - }
> + list_add_tail(&desc->node, &pdmac->desc_pool);
>  
> - spin_unlock_irqrestore(&pdmac->pool_lock, flags);
> + spin_unlock_irqrestore(&pdmac->pool_lock, flags);
> + }
>  
> - return count;
> + return i;
>  }
>  
>  static struct dma_pl330_desc *
> @@ -2857,6 +2857,7 @@ pl330_probe(struct amba_device *adev, const struct 
> amba_id *id)
>   struct dma_pl330_platdata *pdat;
>   struct dma_pl330_dmac *pdmac;
>   struct dma_pl330_chan *pch;
> + struct dma_pl330_desc *desc;
>   struct pl330_info *pi;
>   struct dma_device *pd;
>   struct resource *res;
> @@ -2978,6 +2979,12 @@ pl330_probe(struct amba_device *adev, const struct 
> amba_id *id)
>  probe_err5:
>   kfree(pdmac->peripherals);
>  probe_err4:
> + while (!list_empty(&pdmac->desc_pool)) {
> + desc = list_entry(pdmac->desc_pool.next,
> + struct dma_pl330_desc, node);
> + list_del(&desc->node);
> + kfree(desc);
> + }
>   pl330_del(pi);
>  probe_err3:
>   free_irq(irq, pi);
> @@ -2994,6 +3001,7 @@ static int __devexit pl330_remove(struct amba_device 
> *adev)
>  {
>   struct dma_pl330_dmac *pdmac = amba_get_drvdata(adev);
>   struct dma_pl330_chan *pch, *_p;
> + struct dma_pl330_desc *desc;
>   struct pl330_info *pi;
>   struct resource *res;
>   int irq;
> @@ -3015,6 +3023,13 @@ static int __devexit pl330_remove(struct amba_device 
> *adev)
>   pl330_free_chan_resources(&pch->chan);
>   }
>  
> + while (!list_empty(&pdmac->desc_pool)) {
> + desc = list_entry(pdmac->desc_pool.next,
> + struct dma_pl330_desc, node);
> + list_del(&desc->node);
> + kfree(desc);
> + }
> +
>   pi = &pdmac->pif;
>  
>   pl330_del(pi);


-- 
Vinod Koul
Intel Corp.

--
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/4] DMA: PL330: Balance module remove function with probe

2012-10-23 Thread Vinod Koul
On Fri, 2012-10-05 at 15:47 +0530, Inderpal Singh wrote:
> Since peripheral channel resources are not being allocated at probe,
> no need to flush the channels and free the resources in remove function.
> In case, the channel is in use by some client, return EBUSY.
> 
> Signed-off-by: Inderpal Singh 
> ---
>  drivers/dma/pl330.c |   13 -
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index bf71ff7..4b7a34d 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -3009,18 +3009,21 @@ static int __devexit pl330_remove(struct amba_device 
> *adev)
>   if (!pdmac)
>   return 0;
>  
> + /* check if any client is using any channel */
> + list_for_each_entry(pch, &pdmac->ddma.channels,
> + chan.device_node) {
> +
> + if (pch->chan.client_count)
> + return -EBUSY;
> + }
> +
>   while (!list_empty(&pdmac->desc_pool)) {

Did you get this code executed?
I think No.

The dmaengine holds the reference to channels, so if they are in use and
not freed by client your remove wont be called. So this check is
redundant

-- 
Vinod Koul
Intel Corp.

--
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 4/4] DMA: PL330: unregister dma_device in module's remove function

2012-10-23 Thread Vinod Koul
On Fri, 2012-10-05 at 15:47 +0530, Inderpal Singh wrote:
> unregister dma_device in module's remove function.
> 
> Signed-off-by: Inderpal Singh 
> ---
>  drivers/dma/pl330.c |2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index 4b7a34d..e7dc040 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -3017,6 +3017,8 @@ static int __devexit pl330_remove(struct amba_device 
> *adev)
>   return -EBUSY;
>   }
>  
> + dma_async_device_unregister(&pdmac->ddma);
> +
>   amba_set_drvdata(adev, NULL);
>  
>   list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,

Ok with this one :)

Tried applying but didn't work out. You would need to regenerate this
one.

Thanks
-- 
Vinod Koul
Intel Corp.

--
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/4] DMA: PL330: Free memory allocated for peripheral channels

2012-10-23 Thread Vinod Koul
On Fri, 2012-10-05 at 15:47 +0530, Inderpal Singh wrote:
> The allocated memory for peripheral channels is not being freed upon
> failure in probe and in module's remove funtion. It will lead to memory
> leakage. Hence free the allocated memory.
> 
> Signed-off-by: Inderpal Singh 
> ---
>  drivers/dma/pl330.c |5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index 2ebd4cd..10c6b6a 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -2962,7 +2962,7 @@ pl330_probe(struct amba_device *adev, const struct 
> amba_id *id)
>   ret = dma_async_device_register(pd);
>   if (ret) {
>   dev_err(&adev->dev, "unable to register DMAC\n");
> - goto probe_err4;
> + goto probe_err5;
>   }
>  
>   dev_info(&adev->dev,
> @@ -2975,6 +2975,8 @@ pl330_probe(struct amba_device *adev, const struct 
> amba_id *id)
>  
>   return 0;
>  
> +probe_err5:
> + kfree(pdmac->peripherals);
>  probe_err4:
>   pl330_del(pi);
>  probe_err3:
> @@ -3025,6 +3027,7 @@ static int __devexit pl330_remove(struct amba_device 
> *adev)
>   res = &adev->res;
>   release_mem_region(res->start, resource_size(res));
>  
> + kfree(pdmac->peripherals);
>   kfree(pdmac);
>  
>   return 0;

This looks fine, but if you use devm_ functions then you dont need to do
all this.
Can you do that conversion instead?

-- 
Vinod Koul
Intel Corp.

--
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 v5 0/5] Add support to enable ARM PMU for EXYNOS

2012-10-23 Thread Chanho Park
This patchset fixes irq numbers of ARM Performance Monitoring unit and enable
it for Perf(Performance Counter) on the exynos 4 and 5. The exynos4 and 5 have 2
more cpu cores which has its own pmu.

The exynos uses combiner-irq type for arm-pmu. Especially, the exynos4412 has 4
extra combined irq groups. So, we need to change a max combiner number and to
retreive it according to each soc types.

To enable perf, we need also to implement a set_irq_affinity function for the
combiner-irq. After applying this patch, we can use the perf for the exynos
machine.

Changes from v4:
 - Use max_combiner_nr() in combiner_cascade_irq
 - Add EXYNOS4412_MAX_COMBINER_NR to clarify a meaning
 - Change combiner_extra_irq to exynos4x12_combiner_extra_irq

Changes from v3:
 - Define max_combiner_nr according to soc types
 - Add armpmu dt binding for exynos4210
 - Clean up soc types comparison from v2

Changes from v2:
 - Convert to dt binding of exynos5250

Changes from v1:
 - Split arm-pmu init of exynos from plat-samsung
 - Correct combined irqs of exynos4412
 - Use soc_is_xxx function instead of CONFIG_XXX to identify dynamically

Chanho Park (5):
  ARM: EXYNOS: Add set_irq_affinity function for combiner_irq
  ARM: EXYNOS: Correct combined IRQs for exynos4
  ARM: EXYNOS: Enable PMUs for exynos4
  ARM: EXYNOS: Add arm-pmu DT binding for exynos5250
  ARM: EXYNOS: Add arm-pmu DT binding for exynos421x

 arch/arm/boot/dts/exynos4210.dtsi|6 ++
 arch/arm/boot/dts/exynos5250.dtsi|6 ++
 arch/arm/mach-exynos/common.c|  108 +-
 arch/arm/mach-exynos/include/mach/irqs.h |   13 +++-
 arch/arm/plat-samsung/devs.c |2 +-
 5 files changed, 113 insertions(+), 22 deletions(-)

-- 
1.7.9.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 v5 2/5] ARM: EXYNOS: Correct combined IRQs for exynos4

2012-10-23 Thread Chanho Park
This patch corrects combined IRQs for exynos4 series platform. The exynos4412
has four extra combined irq group and the exynos4212 has two more combined irqs
than exynos4210. Each irq is mapped to IRQ_SPI(xx). Unfortunately, extra 4
combined IRQs isn't sequential. So, we need to map the irqs manually.

Signed-off-by: Chanho Park 
Signed-off-by: Kyungmin Park 
---
 arch/arm/mach-exynos/common.c|   50 ++
 arch/arm/mach-exynos/include/mach/irqs.h |5 ++-
 2 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 709245e..19a5460 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -486,16 +486,22 @@ static struct irq_chip combiner_chip = {
 #endif
 };
 
-static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int 
irq)
+static unsigned int max_combiner_nr(void)
 {
-   unsigned int max_nr;
-
if (soc_is_exynos5250())
-   max_nr = EXYNOS5_MAX_COMBINER_NR;
+   return EXYNOS5_MAX_COMBINER_NR;
+   else if (soc_is_exynos4412())
+   return EXYNOS4412_MAX_COMBINER_NR;
+   else if (soc_is_exynos4212())
+   return EXYNOS4212_MAX_COMBINER_NR;
else
-   max_nr = EXYNOS4_MAX_COMBINER_NR;
+   return EXYNOS4210_MAX_COMBINER_NR;
+}
 
-   if (combiner_nr >= max_nr)
+static void __init combiner_cascade_irq(unsigned int combiner_nr,
+   unsigned int irq)
+{
+   if (combiner_nr >= max_combiner_nr())
BUG();
if (irq_set_handler_data(irq, &combiner_data[combiner_nr]) != 0)
BUG();
@@ -560,23 +566,38 @@ static struct irq_domain_ops combiner_irq_domain_ops = {
.map= combiner_irq_domain_map,
 };
 
+static unsigned int exynos4x12_combiner_extra_irq(int group)
+{
+   switch (group) {
+   case 16:
+   return IRQ_SPI(107);
+   case 17:
+   return IRQ_SPI(108);
+   case 18:
+   return IRQ_SPI(48);
+   case 19:
+   return IRQ_SPI(42);
+   default:
+   return 0;
+   }
+}
+
 static void __init combiner_init(void __iomem *combiner_base,
 struct device_node *np)
 {
int i, irq, irq_base;
unsigned int max_nr, nr_irq;
 
+   max_nr = max_combiner_nr();
+
if (np) {
if (of_property_read_u32(np, "samsung,combiner-nr", &max_nr)) {
-   pr_warning("%s: number of combiners not specified, "
+   pr_info("%s: number of combiners not specified, "
"setting default as %d.\n",
-   __func__, EXYNOS4_MAX_COMBINER_NR);
-   max_nr = EXYNOS4_MAX_COMBINER_NR;
+   __func__, max_nr);
}
-   } else {
-   max_nr = soc_is_exynos5250() ? EXYNOS5_MAX_COMBINER_NR :
-   EXYNOS4_MAX_COMBINER_NR;
}
+
nr_irq = max_nr * MAX_IRQ_IN_COMBINER;
 
irq_base = irq_alloc_descs(COMBINER_IRQ(0, 0), 1, nr_irq, 0);
@@ -593,7 +614,10 @@ static void __init combiner_init(void __iomem 
*combiner_base,
}
 
for (i = 0; i < max_nr; i++) {
-   irq = IRQ_SPI(i);
+   if (i < EXYNOS4210_MAX_COMBINER_NR || soc_is_exynos5250())
+   irq = IRQ_SPI(i);
+   else
+   irq = exynos4x12_combiner_extra_irq(i);
 #ifdef CONFIG_OF
if (np)
irq = irq_of_parse_and_map(np, i);
diff --git a/arch/arm/mach-exynos/include/mach/irqs.h 
b/arch/arm/mach-exynos/include/mach/irqs.h
index 35bced6..e740a6f 100644
--- a/arch/arm/mach-exynos/include/mach/irqs.h
+++ b/arch/arm/mach-exynos/include/mach/irqs.h
@@ -165,7 +165,10 @@
 #define EXYNOS4_IRQ_FIMD0_VSYNCCOMBINER_IRQ(11, 1)
 #define EXYNOS4_IRQ_FIMD0_SYSTEM   COMBINER_IRQ(11, 2)
 
-#define EXYNOS4_MAX_COMBINER_NR16
+#define EXYNOS4210_MAX_COMBINER_NR 16
+#define EXYNOS4212_MAX_COMBINER_NR 18
+#define EXYNOS4412_MAX_COMBINER_NR 20
+#define EXYNOS4_MAX_COMBINER_NREXYNOS4412_MAX_COMBINER_NR
 
 #define EXYNOS4_IRQ_GPIO1_NR_GROUPS16
 #define EXYNOS4_IRQ_GPIO2_NR_GROUPS9
-- 
1.7.9.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 v5 5/5] ARM: EXYNOS: Add arm-pmu DT binding for exynos421x

2012-10-23 Thread Chanho Park
This patch adds a arm-pmu node to bind device tree for exynos4210.
The exynos4210 and 4212 have two cpus which includes a pmu. In contrast, the
exynos4412 has 4 cpus and pmus. We need to define two more pmus for this type
board. However, supporting arm-pmu for the exynos4412 will handle it later
because there is no dts support for 4412 based board.

Signed-off-by: Chanho Park 
Signed-off-by: Kyungmin Park 
---
 arch/arm/boot/dts/exynos4210.dtsi |6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4210.dtsi 
b/arch/arm/boot/dts/exynos4210.dtsi
index 214c557..90f9aed 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -42,6 +42,12 @@
 <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>;
};
 
+   pmu {
+   compatible = "arm,cortex-a9-pmu";
+   interrupt-parent = <&combiner>;
+   interrupts = <2 2>, <3 2>;
+   };
+
pinctrl_0: pinctrl@1140 {
compatible = "samsung,pinctrl-exynos4210";
reg = <0x1140 0x1000>;
-- 
1.7.9.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 v5 3/5] ARM: EXYNOS: Enable PMUs for exynos4

2012-10-23 Thread Chanho Park
This patch defines irq numbers of ARM performance monitoring unit for exynos4.
Firs of all, we need to fix IRQ_PMU correctly and to split pmu initialization
of exynos from plat-samsung for easily defining it.

The number of CPU cores and PMU irq numbers are vary according to soc types.
So, we need to identify each soc type using soc_is_xxx function and to define
the pmu irqs dynamically. For example, the exynos4412 has 4 cpu cores and pmus.

Signed-off-by: Chanho Park 
Signed-off-by: Kyungmin Park 
---
 arch/arm/mach-exynos/common.c|   28 
 arch/arm/mach-exynos/include/mach/irqs.h |8 ++--
 arch/arm/plat-samsung/devs.c |2 +-
 3 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 19a5460..071b0a6 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1087,3 +1088,30 @@ static int __init exynos_init_irq_eint(void)
return 0;
 }
 arch_initcall(exynos_init_irq_eint);
+
+static struct resource exynos4_pmu_resource[] = {
+   DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU),
+   DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU1),
+#if defined(CONFIG_SOC_EXYNOS4412)
+   DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU2),
+   DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU3),
+#endif
+};
+
+static struct platform_device exynos4_device_pmu = {
+   .name   = "arm-pmu",
+   .num_resources  = ARRAY_SIZE(exynos4_pmu_resource),
+   .resource   = exynos4_pmu_resource,
+};
+
+static int __init exynos_armpmu_init(void)
+{
+   if (!of_have_populated_dt()) {
+   if (soc_is_exynos4210() || soc_is_exynos4212())
+   exynos4_device_pmu.num_resources = 2;
+   platform_device_register(&exynos4_device_pmu);
+   }
+
+   return 0;
+}
+arch_initcall(exynos_armpmu_init);
diff --git a/arch/arm/mach-exynos/include/mach/irqs.h 
b/arch/arm/mach-exynos/include/mach/irqs.h
index e740a6f..0b75835 100644
--- a/arch/arm/mach-exynos/include/mach/irqs.h
+++ b/arch/arm/mach-exynos/include/mach/irqs.h
@@ -128,7 +128,7 @@
 #define EXYNOS4_IRQ_ADC1   IRQ_SPI(107)
 #define EXYNOS4_IRQ_PEN1   IRQ_SPI(108)
 #define EXYNOS4_IRQ_KEYPAD IRQ_SPI(109)
-#define EXYNOS4_IRQ_PMUIRQ_SPI(110)
+#define EXYNOS4_IRQ_POWER_PMU  IRQ_SPI(110)
 #define EXYNOS4_IRQ_GPSIRQ_SPI(111)
 #define EXYNOS4_IRQ_INTFEEDCTRL_SSSIRQ_SPI(112)
 #define EXYNOS4_IRQ_SLIMBUSIRQ_SPI(113)
@@ -136,6 +136,11 @@
 #define EXYNOS4_IRQ_TSIIRQ_SPI(115)
 #define EXYNOS4_IRQ_SATA   IRQ_SPI(116)
 
+#define EXYNOS4_IRQ_PMUCOMBINER_IRQ(2, 2)
+#define EXYNOS4_IRQ_PMU_CPU1   COMBINER_IRQ(3, 2)
+#define EXYNOS4_IRQ_PMU_CPU2   COMBINER_IRQ(18, 2)
+#define EXYNOS4_IRQ_PMU_CPU3   COMBINER_IRQ(19, 2)
+
 #define EXYNOS4_IRQ_SYSMMU_MDMA0_0 COMBINER_IRQ(4, 0)
 #define EXYNOS4_IRQ_SYSMMU_SSS_0   COMBINER_IRQ(4, 1)
 #define EXYNOS4_IRQ_SYSMMU_FIMC0_0 COMBINER_IRQ(4, 2)
@@ -233,7 +238,6 @@
 #define IRQ_TC EXYNOS4_IRQ_PEN0
 
 #define IRQ_KEYPAD EXYNOS4_IRQ_KEYPAD
-#define IRQ_PMUEXYNOS4_IRQ_PMU
 
 #define IRQ_FIMD0_FIFO EXYNOS4_IRQ_FIMD0_FIFO
 #define IRQ_FIMD0_VSYNCEXYNOS4_IRQ_FIMD0_VSYNC
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 03f654d..ace76b4 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -1125,7 +1125,7 @@ struct platform_device s5p_device_onenand = {
 
 /* PMU */
 
-#ifdef CONFIG_PLAT_S5P
+#if defined(CONFIG_PLAT_S5P) && !defined(CONFIG_ARCH_EXYNOS)
 static struct resource s5p_pmu_resource[] = {
DEFINE_RES_IRQ(IRQ_PMU)
 };
-- 
1.7.9.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 v5 4/5] ARM: EXYNOS: Add arm-pmu DT binding for exynos5250

2012-10-23 Thread Chanho Park
This patch enables arm-pmu to bind device tree for exynos5250. The exynos5250
has two pmus which have combiner irq type.

Reviewed-by: Thomas Abraham 
Signed-off-by: Chanho Park 
Signed-off-by: Kyungmin Park 
---
 arch/arm/boot/dts/exynos5250.dtsi |6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index dddfd6e..fab3eae 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -56,6 +56,12 @@
 <0 28 0>, <0 29 0>, <0 30 0>, <0 31 0>;
};
 
+   pmu {
+   compatible = "arm,cortex-a15-pmu";
+   interrupt-parent = <&combiner>;
+   interrupts = <1 2>, <22 4>;
+   };
+
watchdog {
compatible = "samsung,s3c2410-wdt";
reg = <0x101D 0x100>;
-- 
1.7.9.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 v5 1/5] ARM: EXYNOS: Add set_irq_affinity function for combiner_irq

2012-10-23 Thread Chanho Park
This patch adds set_irq_affinity function for combiner_irq. We need this
function to enable a arm-pmu because the pmu of exynos has combined type irqs.

Reviewed-by: Thomas Abraham 
Signed-off-by: Chanho Park 
Signed-off-by: Kyungmin Park 
---
 arch/arm/mach-exynos/common.c |   30 +-
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 715b690..709245e 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -405,6 +405,7 @@ struct combiner_chip_data {
unsigned int irq_offset;
unsigned int irq_mask;
void __iomem *base;
+   unsigned int parent_irq;
 };
 
 static struct irq_domain *combiner_irq_domain;
@@ -461,10 +462,28 @@ static void combiner_handle_cascade_irq(unsigned int irq, 
struct irq_desc *desc)
chained_irq_exit(chip, desc);
 }
 
+#ifdef CONFIG_SMP
+static int combiner_set_affinity(struct irq_data *d,
+const struct cpumask *mask_val, bool force)
+{
+   struct combiner_chip_data *chip_data = irq_data_get_irq_chip_data(d);
+   struct irq_chip *chip = irq_get_chip(chip_data->parent_irq);
+   struct irq_data *data = irq_get_irq_data(chip_data->parent_irq);
+
+   if (chip && chip->irq_set_affinity)
+   return chip->irq_set_affinity(data, mask_val, force);
+   else
+   return -EINVAL;
+}
+#endif
+
 static struct irq_chip combiner_chip = {
-   .name   = "COMBINER",
-   .irq_mask   = combiner_mask_irq,
-   .irq_unmask = combiner_unmask_irq,
+   .name   = "COMBINER",
+   .irq_mask   = combiner_mask_irq,
+   .irq_unmask = combiner_unmask_irq,
+#ifdef CONFIG_SMP
+   .irq_set_affinity   = combiner_set_affinity,
+#endif
 };
 
 static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int 
irq)
@@ -484,12 +503,13 @@ static void __init combiner_cascade_irq(unsigned int 
combiner_nr, unsigned int i
 }
 
 static void __init combiner_init_one(unsigned int combiner_nr,
-void __iomem *base)
+void __iomem *base, unsigned int irq)
 {
combiner_data[combiner_nr].base = base;
combiner_data[combiner_nr].irq_offset = irq_find_mapping(
combiner_irq_domain, combiner_nr * MAX_IRQ_IN_COMBINER);
combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3);
+   combiner_data[combiner_nr].parent_irq = irq;
 
/* Disable all interrupts */
__raw_writel(combiner_data[combiner_nr].irq_mask,
@@ -573,12 +593,12 @@ static void __init combiner_init(void __iomem 
*combiner_base,
}
 
for (i = 0; i < max_nr; i++) {
-   combiner_init_one(i, combiner_base + (i >> 2) * 0x10);
irq = IRQ_SPI(i);
 #ifdef CONFIG_OF
if (np)
irq = irq_of_parse_and_map(np, i);
 #endif
+   combiner_init_one(i, combiner_base + (i >> 2) * 0x10, irq);
combiner_cascade_irq(i, irq);
}
 }
-- 
1.7.9.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