Re: [PATCH RFT 1/2] drivers: bus: check cci device tree node status

2015-01-07 Thread Sudeep Holla

Hi Abhilash,

On Wednesday 10 December 2014 10:46 AM, Sudeep Holla wrote:



On Wednesday 10 December 2014 09:55 AM, Abhilash Kesavan wrote:

Hi Sudeep,

On Wed, Dec 10, 2014 at 9:44 AM, Sudeep Holla  wrote:

Hi Abhilash,

On Wednesday 10 December 2014 09:31 AM, Abhilash Kesavan wrote:


Hi,

On Fri, Nov 28, 2014 at 8:20 PM, Abhilash Kesavan 
wrote:


The arm-cci driver completes the probe sequence even if the cci node is
marked as disabled. Add a check in the driver to honour the cci status
in the device tree.

Signed-off-by: Abhilash Kesavan 



This patch helps disable CCI on the Arndale Octa board thus resolving
some imprecise aborts seen on that board. Kindly review.

Regards,
Abhilash


---
drivers/bus/arm-cci.c |3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index 860da40..0ce5e2d 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -1312,6 +1312,9 @@ static int cci_probe(void)
   if (!np)
   return -ENODEV;

+   if (!of_device_is_available(np))
+   return -ENODEV;
+



IIUC, by this change you are disabling the MCPM boot protocol here.
Is there any alternative boot protocol that works on this platform
to boot all 8 cores ? Sorry by quick grep couldn't find one, hence
so I am asking.


Thanks for the reply.
On disabling MCPM, we will default to platsmp.c/firmware.c which boots
4 cores as per Kevin's comment here[1]. This was the original behavior
before MCPM was enabled for all 5420 based SoCs.



Thanks for pointing that out. I assume the firmware can handle the
alternate boot protocol and no more workarounds are needed especially
when getting CPUIdle working in this mode.

Anyways the patch makes sense irrespective how it works on exynos, so
you can add,

Acked-by: Sudeep Holla 



What's the status of this patch. It was useful for me on vexpress for 
some testing. Please feel free to add


Tested-by: Sudeep Holla 

if this is not yet queued.

Regards,
Sudeep

--
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: [PULL] drm-exynos-next 2014-12-22

2015-01-07 Thread Inki Dae
On 2015년 01월 08일 03:06, Gustavo Padovan wrote:
> 2014-12-26 Inki Dae :
> 
>> On 2014년 12월 22일 22:04, Gustavo Padovan wrote:
>>> Hi Dave,
>>>
>>> Here goes a bunch of clean up for the exynos driver. I've posted this work 
>>> in
>>> the mailing list twice but never got a review on it, first time was about a
>>
>> Never no. I already had a review and they - your first time patch set -
>> had been merged to exynos-drm-next-todo. I was moving them to
>> exynos-drm-next locally but one of your patch set was not reasonable to
>> me so I gave you one comment. After that, you posted next patch set
>> which include new changes and patches just 9 days ago. So they should
>> also be reviewed enough at least for two weeks.
> 
> So please notify on the mailing list what you are doing. To me it looked that
> all patches but one didn't get any review. I have a lot of pending work to do
> on top of this pull request and review on them is quite important for me to
> keep working on new changes.
> 
>>
>> Please, do not hurry. Such big changes should really be reviewed enough.
>> I will wait for other reviews and them merge them if reviewed enough. If
>> nobody have reviews then I will merge them. So please, don't worry about
>> that.
> 
> It is been a way more than two weeks now, can you please merge all my
> patches but the 3 ones you had commented on? I'll send updated patches for
> those.

Actually, I am waiting for your reply because your second patch series
includes the changes and updates related to atomic page flip and mode
setting, which doesn't have consistency with your first patch series.
Anyway, I'll merge the only cleanup parts to exynos-drm-next. Please,
post atomic parts after updating later. In addition, I'll not merge
'[PATCH 01/29] drm/exynos/fimd: only finish pageflip if START ==
START_S' because not clear to me as I already mentioned before.

And lastly, thanks for your contribution. :)
Inki Dae

> 
> Also can you add you tree to the linux-next build?
> 
>   Gustavo
> 

--
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 00/21] irqchip: gic: killing gic_arch_extn and co, slowly

2015-01-07 Thread Nishanth Menon
On 17:42-20150107, Marc Zyngier wrote:
> As for the patches, they are on top of 3.19-rc3.
Applied the 21 patches and gave a quick dry run on various boards
BASE = v3.19-rc3 + 1 uImage+dtb patch for 
IRQ = v3.19-rc3 + irq series

NOTE: I am yet to dig in deeper to figure out which platform may have
valid regressions etc. will do that tomorrow. meanwhile, some raw test
results below:
+++v3.19-rc3 - BOOT TEST+++
boot
 1: am335x-evm: BOOT: PASS: http://slexy.org/raw/s2IOPX99Ty
 2:  am335x-sk: BOOT: FAIL: http://slexy.org/raw/s2dzt0lTF7
 3: am3517-evm: BOOT: PASS: http://slexy.org/raw/s23yAMKuRx
 4:  am37x-evm: BOOT: PASS: http://slexy.org/raw/s20vsYwsYQ
 5:  am437x-sk: BOOT: PASS: http://slexy.org/raw/s2QgujFs6l
 6:am43xx-epos: BOOT: PASS: http://slexy.org/raw/s2QHVg9XcB
 7:   am43xx-gpevm: BOOT: PASS: http://slexy.org/raw/s2Ep5DEQuk
 8:BeagleBoard-X15(am57xx-evm): BOOT: PASS: http://slexy.org/raw/s20STBNTs9
 9: BeagleBoard-XM: BOOT: PASS: http://slexy.org/raw/s2UhG6u7yM
10:beagleboard-vanilla: BOOT: PASS: http://slexy.org/raw/s2QB7ECFKw
11:   beaglebone-black: BOOT: PASS: http://slexy.org/raw/s20iAe7yTa
12: beaglebone: BOOT: PASS: http://slexy.org/raw/s20Uui1gkn
13: craneboard: BOOT: PASS: http://slexy.org/raw/s21DcY6gn4
14: dra72x-evm: BOOT: PASS: http://slexy.org/raw/s2qj7IvmaV
15: dra7xx-evm: BOOT: PASS: http://slexy.org/raw/s20lLxN8bR
16: OMAP3430-Labrador(LDP): BOOT: PASS: http://slexy.org/raw/s20GmT9ASX
17:   n900: BOOT: FAIL: http://slexy.org/raw/s2riSEzfea
18:  omap5-evm: BOOT: PASS: http://slexy.org/raw/s21adCD3Js
19:  pandaboard-es: BOOT: PASS: http://slexy.org/raw/s21Am3vEzM
20: pandaboard-vanilla: BOOT: PASS: http://slexy.org/raw/s2XLmW2ONB
21:sdp2430: BOOT: PASS: http://slexy.org/raw/s21ehzlzyv
22:sdp3430: BOOT: PASS: http://slexy.org/raw/s24gh1VUnl
23:sdp4430: BOOT: PASS: http://slexy.org/raw/s2HfgkFfOx
TOTAL = 23 boards, Booted Boards = 21, No Boot boards = 2
+++ IRQ - BOOT TEST+++
boot
 1: am335x-evm: BOOT: PASS: http://slexy.org/raw/s21411sejg
 2:  am335x-sk: BOOT: PASS: http://slexy.org/raw/s209N4Tu4E
 3: am3517-evm: BOOT: PASS: http://slexy.org/raw/s2Shbhciy8
 4:  am37x-evm: BOOT: PASS: http://slexy.org/raw/s20wfqH0Wo
 5:  am437x-sk: BOOT: PASS: http://slexy.org/raw/s21uAXcB12
 6:am43xx-epos: BOOT: PASS: http://slexy.org/raw/s26MGCZz0i
 7:   am43xx-gpevm: BOOT: PASS: http://slexy.org/raw/s2c8IGmWfB
 8:BeagleBoard-X15(am57xx-evm): BOOT: FAIL: http://slexy.org/raw/s2u1yV4hHK
 9: BeagleBoard-XM: BOOT: PASS: http://slexy.org/raw/s20zzOBKWJ
10:beagleboard-vanilla: BOOT: PASS: http://slexy.org/raw/s2wffxWVGa
11:   beaglebone-black: BOOT: PASS: http://slexy.org/raw/s2Yshc0Vkw
12: beaglebone: BOOT: PASS: http://slexy.org/raw/s2Ki0ohBVf
13: craneboard: BOOT: PASS: http://slexy.org/raw/s2GVlDWkzP
14: dra72x-evm: BOOT: PASS: http://slexy.org/raw/s2dfZIVZ42
15: dra7xx-evm: BOOT: PASS: http://slexy.org/raw/s25UqvqVna
16: OMAP3430-Labrador(LDP): BOOT: PASS: http://slexy.org/raw/s20plEBPRB
17:   n900: BOOT: FAIL: http://slexy.org/raw/s20zeM6YUP
18:  omap5-evm: BOOT: PASS: http://slexy.org/raw/s2JOb4VEGJ
19:  pandaboard-es: BOOT: PASS: http://slexy.org/raw/s20jCqY4OV
20: pandaboard-vanilla: BOOT: PASS: http://slexy.org/raw/s21TuquMeN
21:sdp2430: BOOT: PASS: http://slexy.org/raw/s20z1S6w1a
22:sdp3430: BOOT: PASS: http://slexy.org/raw/s20SJo6BqV
23:sdp4430: BOOT: PASS: http://slexy.org/raw/s204Bn9azX
TOTAL = 23 boards, Booted Boards = 21, No Boot boards = 2
+++v3.19-rc3 - POWER TEST+++
power
 1: am335x-evm: BOOT: PASS: err=10 warn=24, CPUFreq: PASS, 
CPUIdle: N/A: http://slexy.org/raw/s20t02tklu
 2:  am335x-sk: BOOT: FAIL: http://slexy.org/raw/s2HX7WisAk
 3: am3517-evm: BOOT: FAIL: http://slexy.org/raw/s2mdCPTUBw
 4:  am37x-evm: BOOT: FAIL: http://slexy.org/raw/s2beWlmPMy
 5:  am437x-sk: BOOT: PASS: crit=2 err=12 warn=25, CPUFreq: 
N/A, CPUIdle: N/A: http://slexy.org/raw/s2Z0QTrATC
 6:am43xx-epos: BOOT: PASS: crit=2 err=15 warn=26, CPUFreq: 
N/A, CPUIdle: N/A: http://slexy.org/raw/s21VqMaKE5
 7:   am43xx-gpevm: BOOT: PASS: crit=2 err=12 warn=25, CPUFreq: 

[RESEND PATCH] ARM: EXYNOS: Add exynos3250 suspend-to-ram support

2015-01-07 Thread Chanwoo Choi
This patch adds the support for suspend-to-ram feature of Exynos3250 SoC.
Exynos3250 don't contain the L2 cache.

Cc: Kukjin Kim 
Signed-off-by: Chanwoo Choi 
Acked-by: Kyungmin Park 
---
Depend on:
- v3.19-rc3

 arch/arm/mach-exynos/regs-pmu.h |  3 ++
 arch/arm/mach-exynos/suspend.c  | 77 +
 2 files changed, 80 insertions(+)

diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index b5f4406..eb461e1 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -160,12 +160,14 @@
 #define EXYNOS5_L2RSTDISABLE_VALUE BIT(3)
 
 #define S5P_PAD_RET_MAUDIO_OPTION  0x3028
+#define S5P_PAD_RET_MMC2_OPTION0x30c8
 #define S5P_PAD_RET_GPIO_OPTION0x3108
 #define S5P_PAD_RET_UART_OPTION0x3128
 #define S5P_PAD_RET_MMCA_OPTION0x3148
 #define S5P_PAD_RET_MMCB_OPTION0x3168
 #define S5P_PAD_RET_EBIA_OPTION0x3188
 #define S5P_PAD_RET_EBIB_OPTION0x31A8
+#define S5P_PAD_RET_SPI_OPTION 0x31c8
 
 #define S5P_PS_HOLD_CONTROL0x330C
 #define S5P_PS_HOLD_EN (1 << 31)
@@ -326,6 +328,7 @@
(EXYNOS3_ARM_CORE0_OPTION + ((_nr) * 0x80))
 
 #define EXYNOS3_ARM_COMMON_OPTION  0x2408
+#define EXYNOS3_ARM_L2_OPTION  0x2608
 #define EXYNOS3_TOP_PWR_OPTION 0x2C48
 #define EXYNOS3_CORE_TOP_PWR_OPTION0x2CA8
 #define EXYNOS3_XUSBXTI_DURATION   0x341C
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index f8e7dcd..d6feef3 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -91,6 +91,12 @@ static unsigned int exynos_pmu_spare3;
 
 static u32 exynos_irqwake_intmask = 0x;
 
+static const struct exynos_wkup_irq exynos3250_wkup_irq[] = {
+   { 73, BIT(1) }, /* RTC alarm */
+   { 74, BIT(2) }, /* RTC tick */
+   { /* sentinel */ },
+};
+
 static const struct exynos_wkup_irq exynos4_wkup_irq[] = {
{ 76, BIT(1) }, /* RTC alarm */
{ 77, BIT(2) }, /* RTC tick */
@@ -114,6 +120,19 @@ unsigned int exynos_release_ret_regs[] = {
REG_TABLE_END,
 };
 
+unsigned int exynos3250_release_ret_regs[] = {
+   S5P_PAD_RET_MAUDIO_OPTION,
+   S5P_PAD_RET_GPIO_OPTION,
+   S5P_PAD_RET_UART_OPTION,
+   S5P_PAD_RET_MMCA_OPTION,
+   S5P_PAD_RET_MMCB_OPTION,
+   S5P_PAD_RET_EBIA_OPTION,
+   S5P_PAD_RET_EBIB_OPTION,
+   S5P_PAD_RET_MMC2_OPTION,
+   S5P_PAD_RET_SPI_OPTION,
+   REG_TABLE_END,
+};
+
 unsigned int exynos5420_release_ret_regs[] = {
EXYNOS_PAD_RET_DRAM_OPTION,
EXYNOS_PAD_RET_MAUDIO_OPTION,
@@ -173,6 +192,12 @@ static int exynos_cpu_suspend(unsigned long arg)
return exynos_cpu_do_idle();
 }
 
+static int exynos3250_cpu_suspend(unsigned long arg)
+{
+   flush_cache_all();
+   return exynos_cpu_do_idle();
+}
+
 static int exynos5420_cpu_suspend(unsigned long arg)
 {
/* MCPM works with HW CPU identifiers */
@@ -230,6 +255,23 @@ static void exynos_pm_prepare(void)
pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0);
 }
 
+static void exynos3250_pm_prepare(void)
+{
+   unsigned int tmp;
+
+   /* Set wake-up mask registers */
+   exynos_pm_set_wakeup_mask();
+
+   tmp = pmu_raw_readl(EXYNOS3_ARM_L2_OPTION);
+   tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
+   pmu_raw_writel(tmp, EXYNOS3_ARM_L2_OPTION);
+
+   exynos_pm_enter_sleep_mode();
+
+   /* ensure at least INFORM0 has the resume address */
+   pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0);
+}
+
 static void exynos5420_pm_prepare(void)
 {
unsigned int tmp;
@@ -344,6 +386,28 @@ early_wakeup:
pmu_raw_writel(0x0, S5P_INFORM1);
 }
 
+static void exynos3250_pm_resume(void)
+{
+   u32 cpuid = read_cpuid_part();
+
+   if (exynos_pm_central_resume())
+   goto early_wakeup;
+
+   /* For release retention */
+   exynos_pm_release_retention();
+
+   pmu_raw_writel(S5P_USE_STANDBY_WFI_ALL, S5P_CENTRAL_SEQ_OPTION);
+
+   if (call_firmware_op(resume) == -ENOSYS
+   && cpuid == ARM_CPU_PART_CORTEX_A9)
+   exynos_cpu_restore_register();
+
+early_wakeup:
+
+   /* Clear SLEEP mode set in INFORM1 */
+   pmu_raw_writel(0x0, S5P_INFORM1);
+}
+
 static void exynos5420_prepare_pm_resume(void)
 {
if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM))
@@ -483,6 +547,16 @@ static const struct platform_suspend_ops 
exynos_suspend_ops = {
.valid  = suspend_valid_only_mem,
 };
 
+static const struct exynos_pm_data exynos3250_pm_data = {
+   .wkup_irq   = exynos3250_wkup_irq,
+   .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
+   .release_

Re: [PATCH v3 2/4] mmc: dw_mmc: exynos: support eMMC's HS400 mode

2015-01-07 Thread Jaehoon Chung
On 12/31/2014 03:43 PM, Alim Akhtar wrote:
> From: Seungwon Jeon 
> 
> Implements HS400 support for exynos host driver.
> And this patch includes some updates as new mode is added.
> 
> Signed-off-by: Seungwon Jeon 
> Signed-off-by: Alim Akhtar 
> ---
>  .../devicetree/bindings/mmc/exynos-dw-mshc.txt |6 +
>  drivers/mmc/host/dw_mmc-exynos.c   |  177 
> +++-
>  drivers/mmc/host/dw_mmc-exynos.h   |   17 +-
>  drivers/mmc/host/dw_mmc.c  |   16 +-
>  drivers/mmc/host/dw_mmc.h  |2 +
>  5 files changed, 178 insertions(+), 40 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt 
> b/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
> index 06455de..be30c94 100644
> --- a/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
> +++ b/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
> @@ -34,6 +34,7 @@ Required Properties:
>valid values.
>  
>  * samsung,dw-mshc-hs200-timing: Similar with dw-mshc-sdr-timing.
> +* samsung,dw-mshc-hs400-timing: Similar with dw-mshc-ddr-timing.
>  
>Notes for the sdr-timing and ddr-timing values:
>  
> @@ -51,6 +52,9 @@ Required Properties:
>- if CIU clock divider value is 0 (that is divide by 1), both tx and rx
>  phase shift clocks should be 0.
>  
> +* read-strobe-delay: RCLK (Data strobe) delay to control HS400 mode
> +  (Latency value for delay line in Read path)
> +
>  Required properties for a slot (Deprecated - Recommend to use one slot per 
> host):
>  
>  * gpios: specifies a list of gpios used for command, clock and data bus. The
> @@ -83,5 +87,7 @@ Example:
>   samsung,dw-mshc-sdr-timing = <2 3 3>;
>   samsung,dw-mshc-ddr-timing = <1 2 3>;
>   samsung,dw-mshc-hs200-timing = <0 2 3>;
> + samsung,dw-mshc-hs400-timing = <0 2 1>;
> + read-strobe-delay = <90>;
>   bus-width = <8>;
>   };
> diff --git a/drivers/mmc/host/dw_mmc-exynos.c 
> b/drivers/mmc/host/dw_mmc-exynos.c
> index be6530e..d37a631 100644
> --- a/drivers/mmc/host/dw_mmc-exynos.c
> +++ b/drivers/mmc/host/dw_mmc-exynos.c
> @@ -41,7 +41,12 @@ struct dw_mci_exynos_priv_data {
>   u32 sdr_timing;
>   u32 ddr_timing;
>   u32 hs200_timing;
> + u32 hs400_timing;
> + u32 tuned_sample;
>   u32 cur_speed;
> + u32 dqs_delay;
> + u32 saved_dqs_en;
> + u32 saved_strobe_ctrl;
>  };
>  
>  static struct dw_mci_exynos_compatible {
> @@ -101,6 +106,16 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host)
>  SDMMC_MPSCTRL_NON_SECURE_WRITE_BIT);
>   }
>  
> + if (priv->ctrl_type >= DW_MCI_TYPE_EXYNOS5420) {
> + priv->saved_strobe_ctrl = mci_readl(host, HS400_DLINE_CTRL);
> + priv->saved_dqs_en = mci_readl(host, HS400_DQS_EN);
> + priv->saved_dqs_en |= AXI_NON_BLOCKING_WR;
> + mci_writel(host, HS400_DQS_EN, priv->saved_dqs_en);
> + if (!priv->dqs_delay)
> + priv->dqs_delay =
> + DQS_CTRL_GET_RD_DELAY(priv->saved_strobe_ctrl);
> + }
> +
>   priv->ciu_div = dw_mci_exynos_get_ciu_div(host);
>  
>   return 0;
> @@ -115,6 +130,25 @@ static int dw_mci_exynos_setup_clock(struct dw_mci *host)
>   return 0;
>  }
>  
> +static void dw_mci_exynos_set_clksel_timing(struct dw_mci *host, u32 timing)
> +{
> + struct dw_mci_exynos_priv_data *priv = host->priv;
> + u32 clksel;
> +
> + if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS7 ||
> + priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU)
> + clksel = mci_readl(host, CLKSEL64);
> + else
> + clksel = mci_readl(host, CLKSEL);
> +
> + clksel = (clksel & ~SDMMC_CLKSEL_TIMING_MASK) | timing;
> + if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS7 ||
> + priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU)
> + mci_writel(host, CLKSEL64, clksel);
> + else
> + mci_writel(host, CLKSEL, clksel);
> +}
> +
>  #ifdef CONFIG_PM_SLEEP
>  static int dw_mci_exynos_suspend(struct device *dev)
>  {
> @@ -190,35 +224,37 @@ static void dw_mci_exynos_prepare_command(struct dw_mci 
> *host, u32 *cmdr)
>   }
>  }
>  
> -static void dw_mci_exynos_set_ios(struct dw_mci *host, struct mmc_ios *ios)
> +static void dw_mci_exynos_config_hs400(struct dw_mci *host, u32 timing)
>  {
>   struct dw_mci_exynos_priv_data *priv = host->priv;
> - unsigned int wanted = ios->clock;
> - unsigned long actual;
> + u32 dqs, strobe;
>  
> - if (ios->timing == MMC_TIMING_MMC_HS200) {
> - if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS7 ||
> -

[PATCHv3 4/8] clk: samsung: exynos4: Add divider clock id for memory bus frequency

2015-01-07 Thread Chanwoo Choi
This patch adds the divider clock id for Exynos4 memory bus frequency.
The clock id is used fo DVFS (Dynamic Voltage/Frequency Scaling)
feature of exynos memory bus frequency.

Cc: Sylwester Nawrocki 
Cc: Tomasz Figa 
Signed-off-by: Chanwoo Choi 
---
 drivers/clk/samsung/clk-exynos4.c   | 10 +-
 include/dt-bindings/clock/exynos4.h |  7 ++-
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos4.c 
b/drivers/clk/samsung/clk-exynos4.c
index 88e8c6b..51462e8 100644
--- a/drivers/clk/samsung/clk-exynos4.c
+++ b/drivers/clk/samsung/clk-exynos4.c
@@ -703,12 +703,12 @@ static struct samsung_mux_clock exynos4x12_mux_clks[] 
__initdata = {
 
 /* list of divider clocks supported in all exynos4 soc's */
 static struct samsung_div_clock exynos4_div_clks[] __initdata = {
-   DIV(0, "div_gdl", "mout_gdl", DIV_LEFTBUS, 0, 3),
+   DIV(CLK_DIV_GDL, "div_gdl", "mout_gdl", DIV_LEFTBUS, 0, 3),
DIV(0, "div_gpl", "div_gdl", DIV_LEFTBUS, 4, 3),
DIV(0, "div_clkout_leftbus", "mout_clkout_leftbus",
CLKOUT_CMU_LEFTBUS, 8, 6),
 
-   DIV(0, "div_gdr", "mout_gdr", DIV_RIGHTBUS, 0, 3),
+   DIV(CLK_DIV_GDR, "div_gdr", "mout_gdr", DIV_RIGHTBUS, 0, 3),
DIV(0, "div_gpr", "div_gdr", DIV_RIGHTBUS, 4, 3),
DIV(0, "div_clkout_rightbus", "mout_clkout_rightbus",
CLKOUT_CMU_RIGHTBUS, 8, 6),
@@ -781,10 +781,10 @@ static struct samsung_div_clock exynos4_div_clks[] 
__initdata = {
CLK_SET_RATE_PARENT, 0),
DIV(0, "div_clkout_top", "mout_clkout_top", CLKOUT_CMU_TOP, 8, 6),
 
-   DIV(0, "div_acp", "mout_dmc_bus", DIV_DMC0, 0, 3),
+   DIV(CLK_DIV_ACP, "div_acp", "mout_dmc_bus", DIV_DMC0, 0, 3),
DIV(0, "div_acp_pclk", "div_acp", DIV_DMC0, 4, 3),
DIV(0, "div_dphy", "mout_dphy", DIV_DMC0, 8, 3),
-   DIV(0, "div_dmc", "mout_dmc_bus", DIV_DMC0, 12, 3),
+   DIV(CLK_DIV_DMC, "div_dmc", "mout_dmc_bus", DIV_DMC0, 12, 3),
DIV(0, "div_dmcd", "div_dmc", DIV_DMC0, 16, 3),
DIV(0, "div_dmcp", "div_dmcd", DIV_DMC0, 20, 3),
DIV(0, "div_pwi", "mout_pwi", DIV_DMC1, 8, 4),
@@ -829,7 +829,7 @@ static struct samsung_div_clock exynos4x12_div_clks[] 
__initdata = {
DIV_F(CLK_DIV_MCUISP1, "div_mcuisp1", "div_mcuisp0", E4X12_DIV_ISP1,
8, 3, CLK_GET_RATE_NOCACHE, 0),
DIV(CLK_SCLK_FIMG2D, "sclk_fimg2d", "mout_g2d", DIV_DMC1, 0, 4),
-   DIV(0, "div_c2c", "mout_c2c", DIV_DMC1, 4, 3),
+   DIV(CLK_DIV_C2C, "div_c2c", "mout_c2c", DIV_DMC1, 4, 3),
DIV(0, "div_c2c_aclk", "div_c2c", DIV_DMC1, 12, 3),
 };
 
diff --git a/include/dt-bindings/clock/exynos4.h 
b/include/dt-bindings/clock/exynos4.h
index 34fe28c..c4b1676 100644
--- a/include/dt-bindings/clock/exynos4.h
+++ b/include/dt-bindings/clock/exynos4.h
@@ -262,8 +262,13 @@
 #define CLK_DIV_MCUISP1453 /* Exynos4x12 only */
 #define CLK_DIV_ACLK200454 /* Exynos4x12 only */
 #define CLK_DIV_ACLK400_MCUISP 455 /* Exynos4x12 only */
+#define CLK_DIV_ACP456
+#define CLK_DIV_DMC457
+#define CLK_DIV_C2C458 /* Exynos4x12 only */
+#define CLK_DIV_GDL459
+#define CLK_DIV_GDR460
 
 /* must be greater than maximal clock id */
-#define CLK_NR_CLKS456
+#define CLK_NR_CLKS461
 
 #endif /* _DT_BINDINGS_CLOCK_EXYNOS_4_H */
-- 
1.8.5.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


[PATCHv3 8/8] ARM: dts: Add memory bus node for Exynos4412-based TRATS2 board

2015-01-07 Thread Chanwoo Choi
This patch adds the Exynos4412 memory-bus node which includes the regulator
and devfreq-event phandle. The devfreq-event phandle is used for the
governor of devfreq device and provide the current usage state of
MIF (Memory Interface) / INT (Internal) memory bus group.

Cc: Kukjin Kim 
Cc: Myungjoo Ham 
Cc: Kyungmin Park 
Signed-off-by: Chanwoo Choi 
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 12 
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts 
b/arch/arm/boot/dts/exynos4412-trats2.dts
index bee0eed..21ba25e 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -917,6 +917,18 @@
};
 };
 
+&memory_bus_mif {
+   devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
+   vdd-mem-supply = <&buck1_reg>;
+   status = "okay";
+};
+
+&memory_bus_int {
+   devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
+   vdd-mem-supply = <&buck3_reg>;
+   status = "okay";
+};
+
 &pinctrl_0 {
pinctrl-names = "default";
pinctrl-0 = <&sleep0>;
-- 
1.8.5.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


[PATCHv3 3/8] ARM: dts: Add memory bus node for Exynos3250

2015-01-07 Thread Chanwoo Choi
This patch adds the memory bus node for Exynos3250 SoC. Exynos3250 has
following memory buses to translate data between DRAM and eMMC/sub-IPs.

Following list specifies the detailed relation between memory bus clock and DMC
IP in MIF (Memory Interface) block:
- DMC clock : DMC (Dynamic Memory Controller)

Following list specifies the detailed relation between memory bus clock and
sub-IPs in INT (Internal) block:
- ACLK100 clock : PERIL
- ACLK160 clock : LCD0
- ACLK200 clock : FSYS
- ACLK266 clock : ISP
- GDL/GDR clock : leftbus/rightbus
- SCLK_MFC clock : MFC

Cc: Kukjin Kim 
Cc: Myungjoo Ham 
Cc: Kyungmin Park 
Signed-off-by: Chanwoo Choi 
Acked-by: Kyungmin Park 
---
 arch/arm/boot/dts/exynos3250.dtsi | 125 ++
 1 file changed, 125 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250.dtsi 
b/arch/arm/boot/dts/exynos3250.dtsi
index 9ed1260..3eaed53 100644
--- a/arch/arm/boot/dts/exynos3250.dtsi
+++ b/arch/arm/boot/dts/exynos3250.dtsi
@@ -99,6 +99,131 @@
};
};
 
+   memory_bus_mif: memory_bus@0 {
+   compatible = "samsung,exynos-memory-bus";
+
+   operating-points = <
+   40 875000
+   20 80
+   133000 80
+   10 80
+   5  80>;
+   status = "disabled";
+
+   blocks {
+   dmc_block: memory_bus_block1 {
+   clocks = <&cmu_dmc CLK_DIV_DMC>;
+   clock-names = "memory-bus";
+   frequency = <
+   40
+   20
+   133000
+   10
+   5>;
+   };
+   };
+   };
+
+   memory_bus_int: memory_bus@1 {
+   compatible = "samsung,exynos-memory-bus";
+
+   operating-points = <
+   40 95
+   20 95
+   133000 925000
+   10 85
+   8  85
+   5  85>;
+
+   status = "disabled";
+
+   blocks {
+   peril_block: memory_bus_block1 {
+   clocks = <&cmu CLK_DIV_ACLK_100>;
+   clock-names = "memory-bus";
+   frequency = <
+   10
+   10
+   10
+   10
+   5
+   5>;
+   };
+
+   lcd0_block: memory_bus_block2 {
+   clocks = <&cmu CLK_DIV_ACLK_160>;
+   clock-names = "memory-bus";
+   frequency = <
+   20
+   16
+   10
+   8
+   8
+   5>;
+   };
+
+   fsys_block: memory_bus_block3 {
+   clocks = <&cmu CLK_DIV_ACLK_200>;
+   clock-names = "memory-bus";
+   frequency = <
+   20
+   20
+   10
+   8
+   5
+   5>;
+   };
+
+   isp_block: memory_bus_block4 {
+   clocks = <&cmu CLK_DIV_ACLK_266>;
+   clock-names = "memory-bus";
+   frequency = <
+   30
+   20
+   133000
+ 

[PATCHv3 1/8] devfreq: exynos: Add generic exynos memory bus frequency driver

2015-01-07 Thread Chanwoo Choi
This patch adds the generic exynos bus frequency driver for memory bus
with DEVFREQ framework. The Samsung Exynos SoCs have the common architecture
for memory bus between DRAM memory and MMC/sub IP in SoC. This driver can
support the memory bus frequency driver for Exynos SoCs.

Each memory bus block has a clock for memory bus speed and frequency
table which is changed according to the utilization of memory bus on runtime.
And then each memory bus group has the one more memory bus blocks and
OPP table (including frequency and voltage), regulator, devfreq-event
devices.

There are a little difference about the number of memory bus because each Exynos
SoC have the different sub-IP and different memory bus speed. In spite of this
difference among Exynos SoCs, we can support almost Exynos SoC by adding
unique data of memory bus to devicetree file.

Cc: Myungjoo Ham 
Cc: Kyungmin Park 
Cc: Kukjin Kim 
Signed-off-by: Chanwoo Choi 
---
 drivers/devfreq/Kconfig  |  15 +
 drivers/devfreq/Makefile |   1 +
 drivers/devfreq/exynos-busfreq.c | 589 +++
 3 files changed, 605 insertions(+)
 create mode 100644 drivers/devfreq/exynos-busfreq.c

diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
index 21f8f17..f1003eb 100644
--- a/drivers/devfreq/Kconfig
+++ b/drivers/devfreq/Kconfig
@@ -65,6 +65,21 @@ config DEVFREQ_GOV_USERSPACE
 
 comment "DEVFREQ Drivers"
 
+config ARM_EXYNOS_BUS_DEVFREQ
+   bool "EXYNOS Memory Bus DEVFREQ Driver"
+   depends on ARCH_EXYNOS
+   select DEVFREQ_GOV_SIMPLE_ONDEMAND
+   select DEVFREQ_EVENT_EXYNOS_PPMU
+   select PM_DEVFREQ_EVENT
+   select PM_OPP
+   help
+ This adds the common DEVFREQ driver for Exynos Memory bus. Exynos
+ Memory bus has one more group of memory bus (e.g, MIF and INT block).
+ Each memory bus group could contain many memoby bus block. It reads
+ PPMU counters of memory controllers by using DEVFREQ-event device
+ and adjusts the operating frequencies and voltages with OPP support.
+ This does not yet operate with optimal voltages.
+
 config ARM_EXYNOS4_BUS_DEVFREQ
bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver"
depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && 
!ARCH_MULTIPLATFORM
diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile
index c449336..2b82a4c 100644
--- a/drivers/devfreq/Makefile
+++ b/drivers/devfreq/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o
 obj-$(CONFIG_DEVFREQ_GOV_USERSPACE)+= governor_userspace.o
 
 # DEVFREQ Drivers
+obj-$(CONFIG_ARCH_EXYNOS)  += exynos-busfreq.o
 obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ)  += exynos/
 obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ)  += exynos/
 
diff --git a/drivers/devfreq/exynos-busfreq.c b/drivers/devfreq/exynos-busfreq.c
new file mode 100644
index 000..b180f43
--- /dev/null
+++ b/drivers/devfreq/exynos-busfreq.c
@@ -0,0 +1,589 @@
+/*
+ * Generic Exynos Memory Bus Frequency driver with DEVFREQ Framework
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Author : Chanwoo Choi 
+ *
+ * This driver is based on exynos4_bus.c, which was written
+ * by MyungJoo Ham , Samsung Electronics.
+ *
+ * This driver support Exynos Memory Bus frequency feature by using in DEVFREQ
+ * framework. This version supprots Exynos3250/Exynos4 series/Exynos5260 SoC.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define BUS_SATURATION_RATIO   40
+#define SAFEVOLT   5
+
+struct exynos_memory_bus_opp_info {
+   unsigned long rate;
+   unsigned long volt;
+};
+
+struct exynos_memory_bus_block {
+   struct clk *clk;
+   struct exynos_memory_bus_opp_info *freq_table;
+};
+
+struct exynos_memory_bus_data {
+   /* devfreq device to monitor and control memory bus group */
+   struct device *dev;
+   struct devfreq *devfreq;
+
+   struct exynos_memory_bus_opp_info *freq_table;
+   unsigned int freq_count;
+   struct regulator *regulator;
+   struct mutex lock;
+
+   struct exynos_memory_bus_opp_info curr_opp;
+
+   struct exynos_memory_bus_block *block;
+   unsigned int block_count;
+
+   /* devfreq-event device to get current state of memory bus group */
+   struct devfreq_event_dev **edev;
+   unsigned int edev_count;
+};
+
+/*
+ * Initialize the memory bus group/block by parsing dt node in the devicetree
+ */
+static int of_init_memory_bus(struct device_node *np,
+ struct exynos_memory_bus_data *data)
+{
+   struct device *dev = data->dev;
+   struct dev_pm_opp *opp;
+   unsigned long rate, volt;
+

[PATCHv3 2/8] devfreq: exynos: Add documentation for generic exynos memory bus frequency driver

2015-01-07 Thread Chanwoo Choi
This patch adds the documentation for generic exynos memory bus frequency
driver.

Cc: MyungJoo Ham 
Cc: Kyungmin Park 
Cc: Kukjin Kim 
Signed-off-by: Chanwoo Choi 
---
 .../devicetree/bindings/devfreq/exynos-busfreq.txt | 184 +
 1 file changed, 184 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/devfreq/exynos-busfreq.txt

diff --git a/Documentation/devicetree/bindings/devfreq/exynos-busfreq.txt 
b/Documentation/devicetree/bindings/devfreq/exynos-busfreq.txt
new file mode 100644
index 000..c601e88
--- /dev/null
+++ b/Documentation/devicetree/bindings/devfreq/exynos-busfreq.txt
@@ -0,0 +1,184 @@
+
+* Generic Exynos Memory Bus device
+
+The Samsung Exynos SoCs have many memory buses for data transfer between DRAM
+memory and MMC/sub-IP in SoC. Almost Exynos SoCs have the common architecture
+for memory buses. Generally, Exynos SoC express the memory bus by using memory
+bus group and block. The memory bus group has one more memory bus blocks and
+OPP table (including frequency and voltage for DVFS), regulator, devfreq-event
+devices. Each memory bus block has a clock for own memory bus speen and
+frequency table for DVFS. There are a little different among Exynos SoCs
+because each Exynos SoC has the different sub-IP and differnt memory bus.
+So, this difference should be specified in devicetree file.
+
+Required properties for memory bus group:
+- compatible: Should be "samsung,exynos-memory-bus".
+- operating-points: the OPP table including frequency/voltage information to
+  support DVFS (Dynamic Voltage/Frequency Scaling) feature.
+- devfreq-events: the devfreq-event device to monitor the curret state of
+  memory bus group.
+- vdd-mem-supply: the regulator to provide memory bus group with the voltage.
+
+Required properties for memory bus block:
+- clock-names : the name of clock used by the memory bus, "memory-bus".
+- clocks : phandles for clock specified in "clock-names" property.
+- #clock-cells: should be 1.
+- frequency: the frequency table to support DVFS feature.
+
+Example1 : Memory bus group/block in exynos3250.dtsi are listed below.
+   Exynos3250 has two memory bus group (MIF, INT group). MIF memory bus
+   group includes one memory bus block between DRAM and eMMC. Also, INT
+   memory bus group includes eight memory bus blocks which support each
+   sub-IPs between DRAM and sub-IPs.
+
+   memory_bus_mif: memory_bus@0 {
+   compatible = "samsung,exynos-memory-bus";
+
+   operating-points = <
+   40 875000
+   20 80
+   133000 80
+   10 80
+   5  80>;
+   status = "disabled";
+
+   blocks {
+   dmc_block: memory_bus_block1 {
+   clocks = <&cmu_dmc CLK_DIV_DMC>;
+   clock-names = "memory-bus";
+   frequency = <
+   40
+   20
+   133000
+   10
+   5>;
+   };
+   };
+   };
+
+   memory_bus_int: memory_bus@1 {
+   compatible = "samsung,exynos-memory-bus";
+
+   operating-points = <
+   40 95
+   20 95
+   133000 925000
+   10 85
+   8  85
+   5  85>;
+
+   status = "disabled";
+
+   blocks {
+   peri_block: memory_bus_block1 {
+   clocks = <&cmu CLK_DIV_ACLK_100>;
+   clock-names = "memory-bus";
+   frequency = <
+   10
+   10
+   10
+   10
+   5
+   5>;
+   };
+
+   display_block: memory_bus_block2 {
+   clocks = <&cmu CLK_DIV_ACLK_160>;
+   clock-names = "memory-bus";
+   frequency = <
+   20
+   16
+   10
+   8
+   8
+   5>;
+   };
+
+   isp_block: memory_bus_block3 {
+   clocks = <&cmu CLK_DIV_ACLK_200>;
+ 

[PATCHv3 0/8] devfreq: Add generic exynos memory-bus frequency driver

2015-01-07 Thread Chanwoo Choi
This patch-set adds the generic exynos bus frequency driver for memory bus
with DEVFREQ framework. The Samsung Exynos SoCs have the common architecture
for memory bus between DRAM memory and MMC/sub IP in SoC. This driver can
support the memory bus frequency driver for Exynos SoCs.

Each memory bus block has a clock for memory bus speed and frequency
table which is changed according to the utilization of memory bus on runtime.
And then each memory bus group has the one more memory bus blocks and
OPP table (including frequency and voltage), regulator, devfreq-event
devices.

There are a little difference about the number of memory bus because each Exynos
SoC have the different sub-IP and different memory bus speed. In spite of this
difference among Exynos SoCs, we can support almost Exynos SoC by adding
unique data of memory bus to devicetree file.

Depend on:
- v3.19-rc3
- [PATCHv7 00/10] devfreq: Add devfreq-event class to provide raw data for 
devfreq device
  : https://lkml.org/lkml/2015/1/7/795

Changelog:

Changes from v2:
(https://lkml.org/lkml/2014/12/31/2)
- Support the memory bus frequency feature for Exynos3250-based Monk board
- Fix build warning about variable uninitialized

Changes from v1:
(https://lkml.org/lkml/2014/12/23/178)
- This patchset is rebased on v3.19-rc2.
- Fix bug after wake-up from suspend state. If devfreq device fail to get event,
  exynos-busfreq retry to set the event for starting.
- Add memory bus group of Exynos4x12/Exynos4210
- Add divider clock id for Exynos4 memory bus frequency
- Support memory bus frequency driver on Exynos4412-based TRATS2 board
- This patch-set has the dependency on following patch-set[1]:
  [1] [PATCHv6 0/9] devfreq: Add devfreq-event class to provide raw data for 
devfreq device
  : https://lkml.org/lkml/2014/12/28/139

Chanwoo Choi (8):
  devfreq: exynos: Add generic exynos memory bus frequency driver
  devfreq: exynos: Add documentation for generic exynos memory bus frequency 
driver
  ARM: dts: Add memory bus node for Exynos3250
  clk: samsung: exynos4: Add divider clock id for memory bus frequency
  ARM: dts: Add memory bus node for Exynos4x12
  ARM: dts: Add memory bus node for Exynos4210
  ARM: dts: Add memory bus node for Exynos3250-based Rinato/Monk board
  ARM: dts: Add memory bus node for Exynos4412-based TRATS2 board

 .../devicetree/bindings/devfreq/exynos-busfreq.txt | 184 +++
 arch/arm/boot/dts/exynos3250-monk.dts  |  12 +
 arch/arm/boot/dts/exynos3250-rinato.dts|  12 +
 arch/arm/boot/dts/exynos3250.dtsi  | 125 +
 arch/arm/boot/dts/exynos4210.dtsi  |  93 
 arch/arm/boot/dts/exynos4412-trats2.dts|  12 +
 arch/arm/boot/dts/exynos4x12.dtsi  | 121 +
 drivers/clk/samsung/clk-exynos4.c  |  10 +-
 drivers/devfreq/Kconfig|  15 +
 drivers/devfreq/Makefile   |   1 +
 drivers/devfreq/exynos-busfreq.c   | 589 +
 include/dt-bindings/clock/exynos4.h|   7 +-
 12 files changed, 1175 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/devfreq/exynos-busfreq.txt
 create mode 100644 drivers/devfreq/exynos-busfreq.c

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


[PATCHv3 6/8] ARM: dts: Add memory bus node for Exynos4210

2015-01-07 Thread Chanwoo Choi
This patch adds the memory bus node for Exynos4210 SoC. Exynos4210 SoC has
one memory bus to translate data between DRAM and eMMC/sub-IPs because
Exynos4210 must need only one regulator for memory bus.

Following list specifies the detailed relation between memory bus clock and
sub-IPs:
- DMC/ACP clock : DMC (Dynamic Memory Controller)
- ACLK200 clock : LCD0
- ACLK100 clock : PERIL/PERIR/MFC(PCLK)
- ACLK160 clock : CAM/TV/LCD0/LCD1
- ACLK133 clock : FSYS/GPS
- GDL/GDR clock : leftbus/rightbus
- SCLK_MFC clock : MFC

Cc: Kukjin Kim 
Cc: Myungjoo Ham 
Cc: Kyungmin Park 
Signed-off-by: Chanwoo Choi 
---
 arch/arm/boot/dts/exynos4210.dtsi | 93 +++
 1 file changed, 93 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4210.dtsi 
b/arch/arm/boot/dts/exynos4210.dtsi
index b2598de..c039409 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -48,6 +48,99 @@
};
};
 
+   memory_bus: memory_bus@0 {
+   compatible = "samsung,exynos-memory-bus";
+
+   operating-points = <
+   40 115
+   267000 105
+   133000 1025000>;
+   status = "disabled";
+
+   blocks {
+   dmc_block: memory_bus_block1 {
+   clocks = <&clock CLK_DIV_DMC>;
+   clock-names = "memory-bus";
+   frequency = <
+   40
+   267000
+   133000>;
+   };
+
+   acp_block: memory_bus_block2 {
+   clocks = <&clock CLK_DIV_ACP>;
+   clock-names = "memory-bus";
+   frequency = <
+   20
+   16
+   133000>;
+   };
+
+   peri_block: memory_bus_block3 {
+   clocks = <&clock CLK_ACLK100>;
+   clock-names = "memory-bus";
+   frequency = <
+   10
+   10
+   10>;
+   };
+
+   fsys_block: memory_bus_block4 {
+   clocks = <&clock CLK_ACLK133>;
+   clock-names = "memory-bus";
+   frequency = <
+   133000
+   133000
+   10>;
+   };
+
+   display_block: memory_bus_block5 {
+   clocks = <&clock CLK_ACLK160>;
+   clock-names = "memory-bus";
+   frequency = <
+   16
+   133000
+   10>;
+   };
+
+   lcd0_block: memory_bus_block6 {
+   clocks = <&clock CLK_ACLK200>;
+   clock-names = "memory-bus";
+   frequency = <
+   20
+   16
+   10>;
+   };
+
+   leftbus_block: memory_bus_block7 {
+   clocks = <&clock CLK_DIV_GDL>;
+   clock-names = "memory-bus";
+   frequency = <
+   20
+   16
+   10>;
+   };
+
+   rightbus_block: memory_bus_block8 {
+   clocks = <&clock CLK_DIV_GDR>;
+   clock-names = "memory-bus";
+   frequency = <
+   20
+   16
+   10>;
+   };
+
+   mfc_block: memory_bus_block9 {
+   clocks = <&clock CLK_SCLK_MFC>;
+   clock-names = "memory-bus";
+   frequency = <
+   20
+   16
+   10>;
+   };
+   };
+   };
+
pmu_system_controller: system-controller@1002 {
clock-names = "clkout0", "clk

[PATCHv3 7/8] ARM: dts: Add memory bus node for Exynos3250-based Rinato/Monk board

2015-01-07 Thread Chanwoo Choi
This patch adds the Exynos3250 memory-bus node which includes the regulator
and devfreq-event phandle. The devfreq-event phandle is used for the
governor of devfreq device and provide the current usage state of
MIF (Memory Interface) / INT (Internal) memory bus group.

Cc: Kukjin Kim 
Cc: Myungjoo Ham 
Cc: Kyungmin Park 
Cc: Youngjun Cho 
Signed-off-by: Chanwoo Choi 
Acked-by: Kyungmin Park 
---
 arch/arm/boot/dts/exynos3250-monk.dts   | 12 
 arch/arm/boot/dts/exynos3250-rinato.dts | 12 
 2 files changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250-monk.dts 
b/arch/arm/boot/dts/exynos3250-monk.dts
index fcceb59..efadb16 100644
--- a/arch/arm/boot/dts/exynos3250-monk.dts
+++ b/arch/arm/boot/dts/exynos3250-monk.dts
@@ -460,6 +460,18 @@
};
 };
 
+&memory_bus_mif {
+   devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
+   vdd-mem-supply = <&buck1_reg>;
+   status = "okay";
+};
+
+&memory_bus_int {
+   devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
+   vdd-mem-supply = <&buck3_reg>;
+   status = "okay";
+};
+
 &xusbxti {
clock-frequency = <2400>;
 };
diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts 
b/arch/arm/boot/dts/exynos3250-rinato.dts
index 9dd1ce1..cf800ed 100644
--- a/arch/arm/boot/dts/exynos3250-rinato.dts
+++ b/arch/arm/boot/dts/exynos3250-rinato.dts
@@ -635,6 +635,18 @@
};
 };
 
+&memory_bus_mif {
+   devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
+   vdd-mem-supply = <&buck1_reg>;
+   status = "okay";
+};
+
+&memory_bus_int {
+   devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
+   vdd-mem-supply = <&buck3_reg>;
+   status = "okay";
+};
+
 &xusbxti {
clock-frequency = <2400>;
 };
-- 
1.8.5.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


[PATCHv3 5/8] ARM: dts: Add memory bus node for Exynos4x12

2015-01-07 Thread Chanwoo Choi
This patch adds the memory bus node for Exynos4x12 SoC. Exynos4x12 SoC has
two memory bus to translate data between DRAM and eMMC/sub-IPs.

Following list specifies the detailed relation between memory bus clock and DMC
IP in MIF (Memory Interface) block:
- DMC/ACP clock : DMC (Dynamic Memory Controller)

Following list specifies the detailed relation between memory bus clock and
sub-IPs in INT (Internal) block:
- ACLK100 clock : PERIL/PERIR/MFC(PCLK)
- ACLK160 clock : CAM/TV/LCD
- ACLK133 clock : FSYS
- GDL/GDR clock : leftbus/rightbus
- SCLK_MFC clock : MFC

Cc: Kukjin Kim 
Cc: Myungjoo Ham 
Cc: Kyungmin Park 
Signed-off-by: Chanwoo Choi 
---
 arch/arm/boot/dts/exynos4x12.dtsi | 121 ++
 1 file changed, 121 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4x12.dtsi 
b/arch/arm/boot/dts/exynos4x12.dtsi
index 93b7040..44f6272 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -31,6 +31,127 @@
mshc0 = &mshc_0;
};
 
+   memory_bus_mif: memory_bus@0 {
+   compatible = "samsung,exynos-memory-bus";
+
+   operating-points = <
+   40 110
+   20 100
+   16 95
+   133000 95
+   10 95>;
+   status = "disabled";
+
+   blocks {
+   dmc_block: memory_bus_block1 {
+   clocks = <&clock CLK_DIV_DMC>;
+   clock-names = "memory-bus";
+   frequency = <
+   40
+   20
+   16
+   133000
+   10>;
+   };
+
+   acp_block: memory_bus_block2 {
+   clocks = <&clock CLK_DIV_ACP>;
+   clock-names = "memory-bus";
+   frequency = <
+   20
+   16
+   133000
+   133000
+   10>;
+   };
+
+   c2c_block: memory_bus_block3 {
+   clocks = <&clock CLK_DIV_C2C>;
+   clock-names = "memory-bus";
+   frequency = <
+   40
+   20
+   16
+   133000
+   10>;
+   };
+   };
+   };
+
+   memory_bus_int: memory_bus@1 {
+   compatible = "samsung,exynos-memory-bus";
+
+   operating-points = <
+   20 100
+   16 95
+   133000 925000
+   10 90>;
+
+   status = "disabled";
+
+   blocks {
+   peri_block: memory_bus_block1 {
+   clocks = <&clock CLK_ACLK100>;
+   clock-names = "memory-bus";
+   frequency = <
+   10
+   10
+   10
+   10>;
+   };
+
+   fsys_block: memory_bus_block2 {
+   clocks = <&clock CLK_ACLK133>;
+   clock-names = "memory-bus";
+   frequency = <
+   133000
+   133000
+   10
+   10>;
+   };
+
+   display_block: memory_bus_block3 {
+   clocks = <&clock CLK_ACLK160>;
+   clock-names = "memory-bus";
+   frequency = <
+   16
+   16
+   133000
+   10>;
+   };
+
+   leftbus_block: memory_bus_block4 {
+   clocks = <&clock CLK_DIV_GDL>;
+   clock-names = "memory-bus";
+   frequency = <
+   20
+   16
+   133000
+  

Re: [PATCH v3 1/4] mmc: dw_mmc: exynos: incorporate ciu_div into timing property

2015-01-07 Thread Jaehoon Chung
Hi, 

On 12/31/2014 03:43 PM, Alim Akhtar wrote:
> From: Seungwon Jeon 
> 
> ciu_div may not be common value for all speed mode.
> So, it needs to be attached to CLKSEL timing.
> This also introduce a new compatibale 'dw-mshc-hs200-timing'
> for selecting hs200 timing value
> 
> Signed-off-by: Seungwon Jeon 
> Signed-off-by: Alim Akhtar 
> ---
>  .../devicetree/bindings/mmc/exynos-dw-mshc.txt |   15 ++--
>  drivers/mmc/host/dw_mmc-exynos.c   |   81 
> ++--
>  drivers/mmc/host/dw_mmc-exynos.h   |1 +
>  3 files changed, 67 insertions(+), 30 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt 
> b/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
> index ee4fc05..06455de 100644
> --- a/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
> +++ b/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
> @@ -23,10 +23,6 @@ Required Properties:
>   - "samsung,exynos7-dw-mshc-smu": for controllers with Samsung Exynos7
> specific extensions having an SMU.
>  
> -* samsung,dw-mshc-ciu-div: Specifies the divider value for the card interface
> -  unit (ciu) clock. This property is applicable only for Exynos5 SoC's and
> -  ignored for Exynos4 SoC's. The valid range of divider value is 0 to 7.
> -
>  * samsung,dw-mshc-sdr-timing: Specifies the value of CIU clock phase shift 
> value
>in transmit mode and CIU clock phase shift value in receive mode for single
>data rate mode operation. Refer notes below for the order of the cells and 
> the
> @@ -37,11 +33,16 @@ Required Properties:
>data rate mode operation. Refer notes below for the order of the cells and 
> the
>valid values.
>  
> +* samsung,dw-mshc-hs200-timing: Similar with dw-mshc-sdr-timing.

What does this comment mean? "Similar with dw-mshc-sdr-timing"
how about adding the comment "optional"?

And i think this timing doesn't need, we can reuse the sdr-timing or ddr-timing.
Because it's re-configurated at tuning time, isn't?

> +
>Notes for the sdr-timing and ddr-timing values:
>  
>  The order of the cells should be
>- First Cell: CIU clock phase shift value for tx mode.
>- Second Cell: CIU clock phase shift value for rx mode.
> +  - Thrid Cell: Specifies the divider value for the card interface
> +unit (ciu) clock. This property is applicable only for Exynos5 SoC's 
> and
> +ignored for Exynos4 SoC's. The valid range of divider value is 0 to 
> 7.
>  
>  Valid values for SDR and DDR CIU clock timing for Exynos5250:
>- valid value for tx phase shift and rx phase shift is 0 to 7.
> @@ -79,8 +80,8 @@ Example:
>   broken-cd;
>   fifo-depth = <0x80>;
>   card-detect-delay = <200>;
> - samsung,dw-mshc-ciu-div = <3>;
> - samsung,dw-mshc-sdr-timing = <2 3>;
> - samsung,dw-mshc-ddr-timing = <1 2>;
> + samsung,dw-mshc-sdr-timing = <2 3 3>;
> + samsung,dw-mshc-ddr-timing = <1 2 3>;
> + samsung,dw-mshc-hs200-timing = <0 2 3>;
>   bus-width = <8>;
>   };
> diff --git a/drivers/mmc/host/dw_mmc-exynos.c 
> b/drivers/mmc/host/dw_mmc-exynos.c
> index 12a5eaa..be6530e 100644
> --- a/drivers/mmc/host/dw_mmc-exynos.c
> +++ b/drivers/mmc/host/dw_mmc-exynos.c
> @@ -40,6 +40,7 @@ struct dw_mci_exynos_priv_data {
>   u8  ciu_div;
>   u32 sdr_timing;
>   u32 ddr_timing;
> + u32 hs200_timing;
>   u32 cur_speed;
>  };
>  
> @@ -71,6 +72,21 @@ static struct dw_mci_exynos_compatible {
>   },
>  };
>  
> +static inline u8 dw_mci_exynos_get_ciu_div(struct dw_mci *host)
> +{
> + struct dw_mci_exynos_priv_data *priv = host->priv;
> +
> + if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS4412)
> + return EXYNOS4412_FIXED_CIU_CLK_DIV;
> + else if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS4210)
> + return EXYNOS4210_FIXED_CIU_CLK_DIV;
> + else if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS7 ||
> + priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU)
> + return SDMMC_CLKSEL_GET_DIV(mci_readl(host, CLKSEL64)) + 1;
> + else
> + return SDMMC_CLKSEL_GET_DIV(mci_readl(host, CLKSEL)) + 1;

If need this, I think more readable that use the switch-case statement. how 
about?

   switch (priv->ctrl_type) {
   case DW_MCI_TYPE_EXYNOS4412:
return EXYNOS4412_FIXED_CIU_CLK_DIV;
   case DW_MCI_TYPE_EXYNOS4210:
return EXYNOS4210_FIXED_CIU_CLK_DIV;
   case DW_MCI_TYPE_EXYNOS7:
   case DW_MCI_TYPE_EXYNOS7_SMU:
return SDMMC_CLKSEL_GET_DIV(mci_readl(host, CLKSEL64)) + 1;
   default:
return SDMMC_CLKSEL_GET_DIV(mci_readl(host, CLKSEL)) + 1;
   }


> +}
> +
>  static int dw_mci_exynos_priv_init(stru

[PATCHv7 06/10] ARM: dts: Add PPMU dt node for Exynos3250 SoC

2015-01-07 Thread Chanwoo Choi
This patch add PPMU (Platform Performance Monitoring Unit) dt node
to estimate the utilization of each IP in Exynos SoC throught DEVFREQ Event
subsystem.

This patch adds following PPMU dt nodes:
- PPMU_DMC0 0x106a
- PPMU_DMC1 0x106b
- PPMU_RIGHTBUS 0x112A
- PPMU_LEFTBUS  0x116A
- PPMU_CAMIF0x11AC
- PPMU_LCD0 0x11E4
- PPMU_FSYS 0x1263
- PPMU_3D   0x1322
- PPMU_MFC  0x1366
- PPMU_CPU  0x106c

Cc: Kukjin Kim 
Signed-off-by: Chanwoo Choi 
Acked-by: Kyungmin Park 
---
 arch/arm/boot/dts/exynos3250.dtsi | 74 +++
 1 file changed, 74 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250.dtsi 
b/arch/arm/boot/dts/exynos3250.dtsi
index 2246549..9ed1260 100644
--- a/arch/arm/boot/dts/exynos3250.dtsi
+++ b/arch/arm/boot/dts/exynos3250.dtsi
@@ -515,6 +515,80 @@
compatible = "arm,cortex-a7-pmu";
interrupts = <0 18 0>, <0 19 0>;
};
+
+   ppmu_dmc0: ppmu_dmc0@106a {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x106a 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_dmc1: ppmu_dmc1@106b {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x106b 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_cpu: ppmu_cpu@106c {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x106c 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_rightbus: ppmu_rightbus@112a {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x112a 0x2000>;
+   clocks = <&cmu CLK_PPMURIGHT>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_leftbus: ppmu_leftbus0@116a {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x116a 0x2000>;
+   clocks = <&cmu CLK_PPMULEFT>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_camif: ppmu_camif@11ac {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x11ac 0x2000>;
+   clocks = <&cmu CLK_PPMUCAMIF>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_lcd0: ppmu_lcd0@11e4 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x11e4 0x2000>;
+   clocks = <&cmu CLK_PPMULCD0>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_fsys: ppmu_fsys@1263 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1263 0x2000>;
+   clocks = <&cmu CLK_PPMUFILE>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_g3d: ppmu_g3d@1322 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1322 0x2000>;
+   clocks = <&cmu CLK_PPMUG3D>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_mfc: ppmu_mfc@1366 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1366 0x2000>;
+   clocks = <&cmu CLK_PPMUMFC_L>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
};
 };
 
-- 
1.8.5.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


[PATCHv7 03/10] devfreq: event: Add resource-managed function for devfreq-event device

2015-01-07 Thread Chanwoo Choi
This patch add the resource-managed function for devfreq-event device as
following functions. The devm_devfreq_event_add_edev() manages automatically
the memory of devfreq-event device using resource management.
- devm_devfreq_event_add_edev()
- devm_devfreq_event_remove_edev()

Cc: Myungjoo Ham 
Cc: Kyungmin Park 
Signed-off-by: Chanwoo Choi 
---
 drivers/devfreq/devfreq-event.c | 63 +
 include/linux/devfreq-event.h   | 16 +++
 2 files changed, 79 insertions(+)

diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index 64c1764..5301e2b 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -451,6 +451,69 @@ int devfreq_event_remove_edev(struct devfreq_event_dev 
*edev)
 }
 EXPORT_SYMBOL_GPL(devfreq_event_remove_edev);
 
+static int devm_devfreq_event_match(struct device *dev, void *res, void *data)
+{
+   struct devfreq_event_dev **r = res;
+
+   if (WARN_ON(!r || !*r))
+   return 0;
+
+   return *r == data;
+}
+
+static void devm_devfreq_event_release(struct device *dev, void *res)
+{
+   devfreq_event_remove_edev(*(struct devfreq_event_dev **)res);
+}
+
+/**
+ * devm_devfreq_event_add_edev() - Resource-managed devfreq_event_add_edev()
+ * @dev: the device owning the devfreq-event device being 
created
+ * @desc   : the devfreq-event device's decriptor which include essential
+ *   data for devfreq-event device.
+ *
+ * Note that this function manages automatically the memory of devfreq-event
+ * device using device resource management and simplify the free operation
+ * for memory of devfreq-event device.
+ */
+struct devfreq_event_dev *devm_devfreq_event_add_edev(struct device *dev,
+   struct devfreq_event_desc *desc)
+{
+   struct devfreq_event_dev **ptr, *edev;
+
+   ptr = devres_alloc(devm_devfreq_event_release, sizeof(*ptr), 
GFP_KERNEL);
+   if (!ptr)
+   return ERR_PTR(-ENOMEM);
+
+   edev = devfreq_event_add_edev(dev, desc);
+   if (IS_ERR(edev)) {
+   devres_free(ptr);
+   return ERR_PTR(-ENOMEM);
+   }
+
+   *ptr = edev;
+   devres_add(dev, ptr);
+
+   return edev;
+}
+EXPORT_SYMBOL(devm_devfreq_event_add_edev);
+
+/**
+ * devm_devfreq_event_remove_edev()- Resource-managed 
devfreq_event_remove_edev()
+ * @dev: the device owning the devfreq-event device being 
created
+ * @edev   : the devfreq-event device
+ *
+ * Note that this function manages automatically the memory of devfreq-event
+ * device using device resource management.
+ */
+void devm_devfreq_event_remove_edev(struct device *dev,
+   struct devfreq_event_dev *edev)
+{
+   WARN_ON(devres_release(dev, devm_devfreq_event_release,
+  devm_devfreq_event_match, edev));
+}
+EXPORT_SYMBOL(devm_devfreq_event_remove_edev);
+
 /*
  * Device attributes for devfreq-event class.
  */
diff --git a/include/linux/devfreq-event.h b/include/linux/devfreq-event.h
index 13a5703..3c44ad1 100644
--- a/include/linux/devfreq-event.h
+++ b/include/linux/devfreq-event.h
@@ -123,6 +123,10 @@ extern int devfreq_event_get_edev_count(struct device 
*dev);
 extern struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev,
struct devfreq_event_desc *desc);
 extern int devfreq_event_remove_edev(struct devfreq_event_dev *edev);
+extern struct devfreq_event_dev *devm_devfreq_event_add_edev(struct device 
*dev,
+   struct devfreq_event_desc *desc);
+extern void devm_devfreq_event_remove_edev(struct device *dev,
+   struct devfreq_event_dev *edev);
 
 #else
 static inline int devfreq_event_enable_edev(struct devfreq_event_dev *edev)
@@ -184,6 +188,18 @@ static inline int devfreq_event_remove_edev(struct 
devfreq_event_dev *edev)
 {
return -EINVAL;
 }
+
+static inline struct devfreq_event_dev *devm_devfreq_event_add_edev(
+   struct device *dev,
+   struct devfreq_event_desc *desc)
+{
+   return ERR_PTR(-EINVAL);
+}
+
+static inline void devm_devfreq_event_remove_edev(struct device *dev,
+   struct devfreq_event_dev *edev)
+{
+}
 #endif /* CONFIG_PM_DEVFREQ_EVENT */
 
 #endif /* __LINUX_DEVFREQ_EVENT_H__ */
-- 
1.8.5.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


[PATCHv7 09/10] ARM: dts: exynos: Add PPMU node to Exynos3250-based Rinato/Monk board

2015-01-07 Thread Chanwoo Choi
This patch add PPMU dt node to Exynos3250-base Rinato/Monk board. The PPMU node
is used to get the utilization of DMC0/DMC1/LEFTBUS/RIGHTBUS Block.

Cc: Kukjin Kim 
Signed-off-by: Chanwoo Choi 
Acked-by: Kyungmin Park 
---
 arch/arm/boot/dts/exynos3250-monk.dts   | 40 +
 arch/arm/boot/dts/exynos3250-rinato.dts | 40 +
 2 files changed, 80 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250-monk.dts 
b/arch/arm/boot/dts/exynos3250-monk.dts
index 24822aa..fcceb59 100644
--- a/arch/arm/boot/dts/exynos3250-monk.dts
+++ b/arch/arm/boot/dts/exynos3250-monk.dts
@@ -420,6 +420,46 @@
status = "okay";
 };
 
+&ppmu_dmc0 {
+   status = "okay";
+
+   events {
+   ppmu_dmc0_3: ppmu-event3-dmc0 {
+   event-name = "ppmu-event3-dmc0";
+   };
+   };
+};
+
+&ppmu_dmc1 {
+   status = "okay";
+
+   events {
+   ppmu_dmc1_3: ppmu-event3-dmc1 {
+   event-name = "ppmu-event3-dmc1";
+   };
+   };
+};
+
+&ppmu_leftbus {
+   status = "okay";
+
+   events {
+   ppmu_leftbus_3: ppmu-event3-leftbus {
+   event-name = "ppmu-event3-leftbus";
+   };
+   };
+};
+
+&ppmu_rightbus {
+   status = "okay";
+
+   events {
+   ppmu_rightbus_3: ppmu-event3-rightbus {
+   event-name = "ppmu-event3-rightbus";
+   };
+   };
+};
+
 &xusbxti {
clock-frequency = <2400>;
 };
diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts 
b/arch/arm/boot/dts/exynos3250-rinato.dts
index 7cc52b5..9dd1ce1 100644
--- a/arch/arm/boot/dts/exynos3250-rinato.dts
+++ b/arch/arm/boot/dts/exynos3250-rinato.dts
@@ -595,6 +595,46 @@
status = "okay";
 };
 
+&ppmu_dmc0 {
+   status = "okay";
+
+   events {
+   ppmu_dmc0_3: ppmu-event3-dmc0 {
+   event-name = "ppmu-event3-dmc0";
+   };
+   };
+};
+
+&ppmu_dmc1 {
+   status = "okay";
+
+   events {
+   ppmu_dmc1_3: ppmu-event3-dmc1 {
+   event-name = "ppmu-event3-dmc1";
+   };
+   };
+};
+
+&ppmu_leftbus {
+   status = "okay";
+
+   events {
+   ppmu_leftbus_3: ppmu-event3-leftbus {
+   event-name = "ppmu-event3-leftbus";
+   };
+   };
+};
+
+&ppmu_rightbus {
+   status = "okay";
+
+   events {
+   ppmu_rightbus_3: ppmu-event3-rightbus {
+   event-name = "ppmu-event3-rightbus";
+   };
+   };
+};
+
 &xusbxti {
clock-frequency = <2400>;
 };
-- 
1.8.5.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


[PATCHv7 08/10] ARM: dts: Add PPMU dt node for Exynos5260 SoC

2015-01-07 Thread Chanwoo Choi
This patch adds PPMU (Performance Profiling Monitoring Unit) dt node
Exynos5260 SoC.

Exynos5260 SoC has following PPMU IPs:
- PPMU_DREX0_S0 0x10c6
- PPMU_DREX0_S1 0x10c7
- PPMU_DREX1_S0 0x10c8
- PPMU_DREX1_S1 0x10c9
- PPMU_EAGLE0x10cc
- PPMU_KFC  0x10cd
- PPMU_MFC  0x1104
- PPMU_G3D  0x1188
- PPMU_FSYS 0x1222
- PPMU_ISP  0x1337
- PPMU_FICM 0x13cb
- PPMU_GSCL 0x13e6
- PPMU_MSCL 0x13ee
- PPMU_FIMD0X   0x145b
- PPMU_FIMD1X   0x145c

The drivers/devfreq/exynos/exynos5_bus.c supports the memory bus frequency/
voltage scaling of Exynos5260 SoC with DEVFREQ framework.

Cc: Kukjin Kim 
Cc: Abhilash Kesavan 
Cc: Jonghwan Choi 
Signed-off-by: Chanwoo Choi 
---
 arch/arm/boot/dts/exynos5260.dtsi | 90 +++
 1 file changed, 90 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5260.dtsi 
b/arch/arm/boot/dts/exynos5260.dtsi
index 36da38e..26f3074 100644
--- a/arch/arm/boot/dts/exynos5260.dtsi
+++ b/arch/arm/boot/dts/exynos5260.dtsi
@@ -307,6 +307,96 @@
fifo-depth = <64>;
status = "disabled";
};
+
+   ppmu_drex0_s0: ppmu_drex0_s0@10c6 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x10c6 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_drex0_s1: ppmu_drex0_s1@10c7 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x10c7 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_drex1_s0: ppmu_drex1_s0@10c8 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x10c8 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_drex1_s1: ppmu_drex1_s1@10c9 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x10c9 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_eagle: ppmu_eagle@10cc {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x10cc 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_kfc: ppmu_kfc@10cd {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x10cd 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_mfc: ppmu_mfc@1104 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1104 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_g3d: ppmu_g3d@1188 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1188 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_fsys: ppmu_fsys@1222 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1222 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_isp: ppmu_isp@1337 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1337 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_fimc: ppmu_fimc@13cb {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x13cb 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_gscl: ppmu_gscl@13e6 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x13e6 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_mscl: ppmu_gscl@13ee {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x13ee 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_fimd0x: ppmu_fimd0x@145b {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x145b 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_fimd1x: ppmu_fimd1x@145c {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x145c 0x2000>;
+   status = "disabled";
+   };
};
 };
 
-- 
1.8.5.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


[PATCHv7 02/10] devfreq: event: Add the list of supported devfreq-event type

2015-01-07 Thread Chanwoo Choi
This patch adds the list of supported devfreq-event type as following.
Each devfreq-event device driver would support the various devfreq-event type
for devfreq governor at the same time.
- DEVFREQ_EVENT_TYPE_RAW_DATA
- DEVFREQ_EVENT_TYPE_UTILIZATION
- DEVFREQ_EVENT_TYPE_BANDWIDTH
- DEVFREQ_EVENT_TYPE_LATENCY

Cc: MyungJoo Ham 
Cc: Kyungmin Park 
Signed-off-by: Chanwoo Choi 
---
 drivers/devfreq/devfreq-event.c | 58 -
 include/linux/devfreq-event.h   | 25 +++---
 2 files changed, 73 insertions(+), 10 deletions(-)

diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index 81448ba..64c1764 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -20,6 +20,9 @@
 #include 
 #include 
 
+#define EVENT_TYPE_RAW_DATA_MAXULONG_MAX
+#define EVENT_TYPE_UTILIZATION_MAX 100
+
 static struct class *devfreq_event_class;
 
 /* The list of all devfreq event list */
@@ -132,7 +135,8 @@ EXPORT_SYMBOL_GPL(devfreq_event_is_enabled);
  * Note that this function set the event to the devfreq-event device to start
  * for getting the event data which could be various event type.
  */
-int devfreq_event_set_event(struct devfreq_event_dev *edev)
+int devfreq_event_set_event(struct devfreq_event_dev *edev,
+   enum devfreq_event_type type)
 {
int ret;
 
@@ -146,7 +150,15 @@ int devfreq_event_set_event(struct devfreq_event_dev *edev)
return -EPERM;
 
mutex_lock(&edev->lock);
-   ret = edev->desc->ops->set_event(edev);
+
+   if ((edev->desc->type & type) == 0) {
+   dev_err(&edev->dev, "unsupported devfreq-event type\n");
+   mutex_unlock(&edev->lock);
+   return -EINVAL;
+   }
+
+   ret = edev->desc->ops->set_event(edev, type);
+
mutex_unlock(&edev->lock);
 
return ret;
@@ -162,6 +174,7 @@ EXPORT_SYMBOL_GPL(devfreq_event_set_event);
  * after stoping the progress of whole sequence of devfreq-event dev.
  */
 int devfreq_event_get_event(struct devfreq_event_dev *edev,
+   enum devfreq_event_type type,
struct devfreq_event_data *edata)
 {
int ret;
@@ -175,18 +188,49 @@ int devfreq_event_get_event(struct devfreq_event_dev 
*edev,
if (!devfreq_event_is_enabled(edev))
return -EINVAL;
 
+   mutex_lock(&edev->lock);
+
+   if ((edev->desc->type & type) == 0) {
+   dev_err(&edev->dev, "unsupported devfreq-event type\n");
+   return -EINVAL;
+   }
+
edata->event = edata->total_event = 0;
+   ret = edev->desc->ops->get_event(edev, type, edata);
+   if (ret < 0
+   || edata->total_event <= 0
+   || edata->event > edata->total_event) {
+   edata->event = edata->total_event = 0;
+   mutex_unlock(&edev->lock);
+   return -EINVAL;
+   }
 
-   mutex_lock(&edev->lock);
-   ret = edev->desc->ops->get_event(edev, edata);
-   mutex_unlock(&edev->lock);
+   switch (type) {
+   case DEVFREQ_EVENT_TYPE_RAW_DATA:
+   case DEVFREQ_EVENT_TYPE_BANDWIDTH:
+   case DEVFREQ_EVENT_TYPE_LATENCY:
+   if ((edata->event > EVENT_TYPE_RAW_DATA_MAX) ||
+   (edata->total_event > EVENT_TYPE_RAW_DATA_MAX)) {
+   edata->event = edata->total_event = 0;
+   ret = -EINVAL;
+   }
+   break;
+   case DEVFREQ_EVENT_TYPE_UTILIZATION:
+   edata->total_event = EVENT_TYPE_UTILIZATION_MAX;
 
-   if ((edata->total_event <= 0)
-   || (edata->event > edata->total_event)) {
+   if (edata->event > EVENT_TYPE_UTILIZATION_MAX) {
+   edata->event = edata->total_event = 0;
+   ret = -EINVAL;
+   }
+   break;
+   default:
edata->event = edata->total_event = 0;
ret = -EINVAL;
+   break;
}
 
+   mutex_unlock(&edev->lock);
+
return ret;
 }
 EXPORT_SYMBOL_GPL(devfreq_event_get_event);
diff --git a/include/linux/devfreq-event.h b/include/linux/devfreq-event.h
index b7363f5..13a5703 100644
--- a/include/linux/devfreq-event.h
+++ b/include/linux/devfreq-event.h
@@ -36,6 +36,14 @@ struct devfreq_event_dev {
const struct devfreq_event_desc *desc;
 };
 
+/* The supported type by devfreq-event device */
+enum devfreq_event_type {
+   DEVFREQ_EVENT_TYPE_RAW_DATA = BIT(0),
+   DEVFREQ_EVENT_TYPE_UTILIZATION  = BIT(1),
+   DEVFREQ_EVENT_TYPE_BANDWIDTH= BIT(2),
+   DEVFREQ_EVENT_TYPE_LATENCY  = BIT(3),
+};
+
 /**
  * struct devfreq_event_data - the devfreq-event data
  *
@@ -69,8 +77,10 @@ struct devfreq_event_ops {
int (*reset)(struct devfreq_event_dev *edev);
 
/* Mandatory functions */
-   int (*set_event)(struc

[PATCHv7 05/10] devfreq: event: Add documentation for exynos-ppmu devfreq-event driver

2015-01-07 Thread Chanwoo Choi
This patch adds the documentation for Exynos PPMU (Platform Performance
Monitoring Unit) devfreq-event driver.

Cc: MyungJoo Ham 
Cc: Kyungmin Park 
Signed-off-by: Chanwoo Choi 
---
 .../bindings/devfreq/event/exynos-ppmu.txt | 110 +
 1 file changed, 110 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt

diff --git a/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt 
b/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt
new file mode 100644
index 000..e665d30
--- /dev/null
+++ b/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt
@@ -0,0 +1,110 @@
+
+* Samsung Exynos PPMU (Performance Profiling Monitoring Unit) device
+
+The Samsung Exynos SoC have PPMU (Performance Profiling Monitoring Unit) for
+each IPs. PPMU provides the primitive values to get performance data. These
+events provide useful information about the behavior of the SoC that you can
+use when analyzing system performance, and made visible and can be counted
+using login in each IP (DMC, CPU, RIGHTBUS, LEFTBUS, CAM interface, LCD, G3D,
+MFC). The Exynos PPMU driver use the devfreq-event class to provide event data
+to various devfreq device. The devfreq device would use the event data when
+derterming the current state of each IP.
+
+Required properties:
+- compatible: Should be "samsung,exynos-ppmu".
+- reg: physical base address of each PPMU and length of memory mapped region.
+
+Optional properties:
+- clock-names : the name of clock used by the PPMU, "ppmu"
+- clocks : phandles for clock specified in "clock-names" property
+- #clock-cells: should be 1.
+
+Example1 : PPMU nodes in exynos3250.dtsi are listed below.
+
+   ppmu_dmc0: ppmu_dmc0@106a {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x106a 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_dmc1: ppmu_dmc1@106b {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x106b 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_cpu: ppmu_cpu@106c {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x106c 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_rightbus: ppmu_rightbus@112a {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x112a 0x2000>;
+   clocks = <&cmu CLK_PPMURIGHT>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_leftbus: ppmu_leftbus0@116a {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x116a 0x2000>;
+   clocks = <&cmu CLK_PPMULEFT>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+Example2 : Events of each PPMU node in exynos3250-rinato.dts are listed below.
+
+   &ppmu_dmc0 {
+   status = "okay";
+
+   events {
+   ppmu_dmc0_3: ppmu-event3-dmc0 {
+   event-name = "ppmu-event3-dmc0";
+   };
+
+   ppmu_dmc0_2: ppmu-event2-dmc0 {
+   event-name = "ppmu-event2-dmc0";
+   };
+
+   ppmu_dmc0_1: ppmu-event1-dmc0 {
+   event-name = "ppmu-event1-dmc0";
+   };
+
+   ppmu_dmc0_0: ppmu-event0-dmc0 {
+   event-name = "ppmu-event0-dmc0";
+   };
+   };
+   };
+
+   &ppmu_dmc1 {
+   status = "okay";
+
+   events {
+   ppmu_dmc1_3: ppmu-event3-dmc1 {
+   event-name = "ppmu-event3-dmc1";
+   };
+   };
+   };
+
+   &ppmu_leftbus {
+   status = "okay";
+
+   events {
+   ppmu_leftbus_3: ppmu-event3-leftbus {
+   event-name = "ppmu-event3-leftbus";
+   };
+   };
+   };
+
+   &ppmu_rightbus {
+   status = "okay";
+
+   events {
+   ppmu_rightbus_3: ppmu-event3-rightbus {
+   event-name = "ppmu-event3-rightbus";
+   };
+   };
+   };
-- 
1.8.5.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


[PATCHv7 10/10] ARM: dts: exynos: Add PPMU node for Exynos4412-based TRATS2 board

2015-01-07 Thread Chanwoo Choi
This patch add dt node for PPMU_{DMC0|DMC1|LEFTBUS|RIGHTBUS} for
exynos4412-trats2 board. Each PPMU dt node includes one event of 'PPMU Count3'.

Cc: Kukjin Kim 
Cc: Myungjoo Ham 
Cc: Kyungmin Park 
Signed-off-by: Chanwoo Choi 
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 40 +
 1 file changed, 40 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts 
b/arch/arm/boot/dts/exynos4412-trats2.dts
index c9b70b6..bee0eed 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -877,6 +877,46 @@
};
 };
 
+&ppmu_dmc0 {
+   status = "okay";
+
+   events {
+   ppmu_dmc0_3: ppmu-event3-dmc0 {
+   event-name = "ppmu-event3-dmc0";
+   };
+   };
+};
+
+&ppmu_dmc1 {
+   status = "okay";
+
+   events {
+   ppmu_dmc1_3: ppmu-event3-dmc1 {
+   event-name = "ppmu-event3-dmc1";
+   };
+   };
+};
+
+&ppmu_leftbus {
+   status = "okay";
+
+   events {
+   ppmu_leftbus_3: ppmu-event3-leftbus {
+   event-name = "ppmu-event3-leftbus";
+   };
+   };
+};
+
+&ppmu_rightbus {
+   status = "okay";
+
+   events {
+   ppmu_rightbus_3: ppmu-event3-rightbus {
+   event-name = "ppmu-event3-rightbus";
+   };
+   };
+};
+
 &pinctrl_0 {
pinctrl-names = "default";
pinctrl-0 = <&sleep0>;
-- 
1.8.5.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


[PATCHv7 04/10] devfreq: event: Add exynos-ppmu devfreq-event driver

2015-01-07 Thread Chanwoo Choi
This patch adds exynos-ppmu devfreq-event driver to get performance data
of each IP for Samsung Exynos SoC. These event from Exynos PPMU provide
useful information about the behavior of the SoC that you can use when
analyzing system performance, and made visible and can be counted using
logic in each IP.

This patch is based on existing drivers/devfreq/exynos/exynos-ppmu.c

Cc: MyungJoo Ham 
Cc: Kyungmin Park 
Signed-off-by: Chanwoo Choi 
---
 drivers/devfreq/event/Kconfig   |   9 +
 drivers/devfreq/event/Makefile  |   1 +
 drivers/devfreq/event/exynos-ppmu.c | 399 
 3 files changed, 409 insertions(+)
 create mode 100644 drivers/devfreq/event/exynos-ppmu.c

diff --git a/drivers/devfreq/event/Kconfig b/drivers/devfreq/event/Kconfig
index 1ced42c..a11720a 100644
--- a/drivers/devfreq/event/Kconfig
+++ b/drivers/devfreq/event/Kconfig
@@ -13,4 +13,13 @@ menuconfig PM_DEVFREQ_EVENT
 
 if PM_DEVFREQ_EVENT
 
+config DEVFREQ_EVENT_EXYNOS_PPMU
+   bool "EXYNOS PPMU (Platform Performance Monitoring Unit) DEVFREQ event 
Driver"
+   depends on ARCH_EXYNOS
+   select PM_OPP
+   help
+ This add the devfreq-event driver for Exynos SoC. It provides PPMU
+ (Platform Performance Monitoring Unit) counters to estimate the
+ utilization of each module.
+
 endif # PM_DEVFREQ_EVENT
diff --git a/drivers/devfreq/event/Makefile b/drivers/devfreq/event/Makefile
index dc56005..be146ea 100644
--- a/drivers/devfreq/event/Makefile
+++ b/drivers/devfreq/event/Makefile
@@ -1 +1,2 @@
 # Exynos DEVFREQ Event Drivers
+obj-$(CONFIG_DEVFREQ_EVENT_EXYNOS_PPMU) += exynos-ppmu.o
diff --git a/drivers/devfreq/event/exynos-ppmu.c 
b/drivers/devfreq/event/exynos-ppmu.c
new file mode 100644
index 000..b38ab6e
--- /dev/null
+++ b/drivers/devfreq/event/exynos-ppmu.c
@@ -0,0 +1,399 @@
+/*
+ * exynos_ppmu.c - EXYNOS PPMU (Platform Performance Monitoring Unit) support
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Author : Chanwoo Choi 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This driver is based on drivers/devfreq/exynos/exynos_ppmu.c
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define PPMU_ENABLE BIT(0)
+#define PPMU_DISABLE0x0
+#define PPMU_CYCLE_RESETBIT(1)
+#define PPMU_COUNTER_RESET  BIT(2)
+
+#define PPMU_ENABLE_COUNT0  BIT(0)
+#define PPMU_ENABLE_COUNT1  BIT(1)
+#define PPMU_ENABLE_COUNT2  BIT(2)
+#define PPMU_ENABLE_COUNT3  BIT(3)
+#define PPMU_ENABLE_CYCLE   BIT(31)
+
+#define PPMU_CNTENS0x10
+#define PPMU_FLAG  0x50
+#define PPMU_CCNT_OVERFLOW BIT(31)
+#define PPMU_CCNT  0x100
+
+#define PPMU_PMCNT00x110
+#define PPMU_PMCNT_OFFSET  0x10
+#define PMCNT_OFFSET(x)(PPMU_PMCNT0 + (PPMU_PMCNT_OFFSET * x))
+
+#define PPMU_BEVT0SEL  0x1000
+#define PPMU_BEVTSEL_OFFSET0x100
+#define PPMU_BEVTSEL(x)(PPMU_BEVT0SEL + (x * 
PPMU_BEVTSEL_OFFSET))
+
+#define RD_DATA_COUNT  0x5
+#define WR_DATA_COUNT  0x6
+#define RDWR_DATA_COUNT0x7
+
+enum ppmu_counter {
+   PPMU_PMNCNT0 = 0,
+   PPMU_PMNCNT1,
+   PPMU_PMNCNT2,
+   PPMU_PMNCNT3,
+
+   PPMU_PMNCNT_MAX,
+};
+
+struct exynos_ppmu_data {
+   struct devfreq_event_dev **edev;
+   struct devfreq_event_desc *desc;
+   unsigned int num_events;
+
+   struct device *dev;
+   struct clk *clk_ppmu;
+   struct mutex lock;
+
+   struct __exynos_ppmu {
+   void __iomem *base;
+   unsigned int event[PPMU_PMNCNT_MAX];
+   unsigned int count[PPMU_PMNCNT_MAX];
+   bool ccnt_overflow;
+   bool count_overflow[PPMU_PMNCNT_MAX];
+   } ppmu;
+};
+
+#define PPMU_EVENT(name)   \
+   { "ppmu-event0-"#name, PPMU_PMNCNT0 },  \
+   { "ppmu-event1-"#name, PPMU_PMNCNT1 },  \
+   { "ppmu-event2-"#name, PPMU_PMNCNT2 },  \
+   { "ppmu-event3-"#name, PPMU_PMNCNT3 }
+
+struct __exynos_ppmu_events {
+   char *name;
+   int id;
+} ppmu_events[] = {
+   /* For Exynos3250, Exynos4 and Exynos5260 */
+   PPMU_EVENT(g3d),
+   PPMU_EVENT(fsys),
+
+   /* For Exynos4 SoCs and Exynos3250 */
+   PPMU_EVENT(dmc0),
+   PPMU_EVENT(dmc1),
+   PPMU_EVENT(cpu),
+   PPMU_EVENT(rightbus),
+   PPMU_EVENT(leftbus),
+   PPMU_EVENT(lcd0),
+   PPMU_EVENT(camif),
+
+   /* Only for Exynos3250 and Exynos5260 */
+   PPMU_EVENT(mfc),
+
+   /* Only for Exynos4 SoCs */
+   PPMU_EVENT(mfc-left),
+   PPMU_EVENT(mfc-right),
+
+   /* Only for Exynos5260 SoCs */
+   PPMU_EVENT(drex0-s0),
+   PPMU_EVENT(drex0-s1),
+   PPMU_EVENT(drex1-s0),
+ 

[PATCHv7 01/10] devfreq: event: Add new devfreq_event class to provide basic data for devfreq governor

2015-01-07 Thread Chanwoo Choi
This patch add new devfreq_event class for devfreq_event device which provide
raw data (e.g., memory bus utilization/GPU utilization). This raw data from
devfreq_event data would be used for the governor of devfreq subsystem.
- devfreq_event device : Provide raw data for governor of existing devfreq 
device
- devfreq device   : Monitor device state and change frequency/voltage of 
device
 using the raw data from devfreq_event device

The devfreq subsystem support generic DVFS(Dynamic Voltage/Frequency Scaling)
for Non-CPU Devices. The devfreq device would dertermine current device state
using various governor (e.g., ondemand, performance, powersave). After completed
determination of system state, devfreq device would change the frequency/voltage
of devfreq device according to the result of governor.

But, devfreq governor must need basic data which indicates current device state.
Existing devfreq subsystem only consider devfreq device which check current 
system
state and determine proper system state using basic data. There is no subsystem
for device providing basic data to devfreq device.

The devfreq subsystem must need devfreq_event device(data-provider device) for
existing devfreq device. So, this patch add new devfreq_event class for
devfreq_event device which read various basic data(e.g, memory bus utilization,
GPU utilization) and provide measured data to existing devfreq device through
standard APIs of devfreq_event class.

The following description explains the feature of two kind of devfreq class:
- devfreq class (existing)
 : devfreq consumer device use raw data from devfreq_event device for
   determining proper current system state and change voltage/frequency
   dynamically using various governors.

- devfreq_event class (new)
 : Provide measured raw data to devfreq device for governor

Cc: MyungJoo Ham 
Cc: Kyungmin Park 
Signed-off-by: Chanwoo Choi 
---
 drivers/devfreq/Kconfig |   2 +
 drivers/devfreq/Makefile|   6 +-
 drivers/devfreq/devfreq-event.c | 466 
 drivers/devfreq/event/Kconfig   |  16 ++
 drivers/devfreq/event/Makefile  |   1 +
 include/linux/devfreq-event.h   | 170 +++
 6 files changed, 660 insertions(+), 1 deletion(-)
 create mode 100644 drivers/devfreq/devfreq-event.c
 create mode 100644 drivers/devfreq/event/Kconfig
 create mode 100644 drivers/devfreq/event/Makefile
 create mode 100644 include/linux/devfreq-event.h

diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
index faf4e70..21f8f17 100644
--- a/drivers/devfreq/Kconfig
+++ b/drivers/devfreq/Kconfig
@@ -87,4 +87,6 @@ config ARM_EXYNOS5_BUS_DEVFREQ
  It reads PPMU counters of memory controllers and adjusts the
  operating frequencies and voltages with OPP support.
 
+source "drivers/devfreq/event/Kconfig"
+
 endif # PM_DEVFREQ
diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile
index 16138c9..c449336 100644
--- a/drivers/devfreq/Makefile
+++ b/drivers/devfreq/Makefile
@@ -1,4 +1,5 @@
-obj-$(CONFIG_PM_DEVFREQ)   += devfreq.o
+obj-$(CONFIG_PM_DEVFREQ)   += devfreq.o
+obj-$(CONFIG_PM_DEVFREQ_EVENT) += devfreq-event.o
 obj-$(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)  += governor_simpleondemand.o
 obj-$(CONFIG_DEVFREQ_GOV_PERFORMANCE)  += governor_performance.o
 obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE)+= governor_powersave.o
@@ -7,3 +8,6 @@ obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o
 # DEVFREQ Drivers
 obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ)  += exynos/
 obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ)  += exynos/
+
+# DEVFREQ Event Drivers
+obj-$(CONFIG_PM_DEVFREQ_EVENT) += event/
diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
new file mode 100644
index 000..81448ba
--- /dev/null
+++ b/drivers/devfreq/devfreq-event.c
@@ -0,0 +1,466 @@
+/*
+ * devfreq-event: a framework to provide raw data and events of devfreq devices
+ *
+ * Copyright (C) 2014 Samsung Electronics
+ * Author: Chanwoo Choi 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This driver is based on drivers/devfreq/devfreq.c.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct class *devfreq_event_class;
+
+/* The list of all devfreq event list */
+static LIST_HEAD(devfreq_event_list);
+static DEFINE_MUTEX(devfreq_event_list_lock);
+
+#define to_devfreq_event(DEV) container_of(DEV, struct devfreq_event_dev, dev)
+
+/**
+ * devfreq_event_enable_edev() - Enable the devfreq-event dev and increase
+ *  the enable_count of devfreq-event dev.
+ * @edev   : the devfreq-event device
+ *
+ * Note that this function increase the enable_count and enable the
+ * devfreq-event device. The devfreq-event device should be enabled b

[PATCHv7 07/10] ARM: dts: Add PPMU dt node for Exynos4 SoCs

2015-01-07 Thread Chanwoo Choi
This patch add PPMU (Platform Performance Monitoring Unit) dt node for Exynos4
(Exynos4210/4212/4412) SoC. PPMU dt node is used to monitor the utilization of
each IP.

The Exynos4210/Exynos4212/Exynos4412 SoC includes following PPMUs:
- PPMU_DMC0  0x106A_
- PPMU_DMC1  0x106B_
- PPMU_CPU   0x106C_
- PPMU_ACP   0x10AE_
- PPMU_RIGHT_BUS 0x112A_
- PPMU_LEFT_BUS  0x116A_
- PPMU_FSYS  0x1263_
- PPMU_LCD0  0x11E4_
- PPMU_CAMIF 0x11AC_
- PPMU_IMAGE 0x12AA_
- PPMU_TV0x12E4_
- PPMU_3D0x1322_
- PPMU_MFC_LEFT  0x1366_
- PPMU_MFC_RIGHT 0x1367_

Additionally, the Exynos4210 SoC includes following PPMUs:
- PPMU_LCD1  0x1224_

Cc: Kukjin Kim 
Signed-off-by: Chanwoo Choi 
---
 arch/arm/boot/dts/exynos4.dtsi| 108 ++
 arch/arm/boot/dts/exynos4210.dtsi |   8 +++
 2 files changed, 116 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index b8168f1..70064dc 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -645,4 +645,112 @@
samsung,sysreg = <&sys_reg>;
status = "disabled";
};
+
+   ppmu_dmc0: ppmu_dmc0@106a {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x106a 0x2000>;
+   clocks = <&clock CLK_PPMUDMC0>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_dmc1: ppmu_dmc1@106b {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x106b 0x2000>;
+   clocks = <&clock CLK_PPMUDMC1>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_cpu: ppmu_cpu@106c {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x106c 0x2000>;
+   clocks = <&clock CLK_PPMUCPU>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_acp: ppmu_acp@10ae {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x106e 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_rightbus: ppmu_rightbus@112a {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x112a 0x2000>;
+   clocks = <&clock CLK_PPMURIGHT>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_leftbus: ppmu_leftbus0@116a {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x116a 0x2000>;
+   clocks = <&clock CLK_PPMULEFT>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_camif: ppmu_camif@11ac {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x11ac 0x2000>;
+   clocks = <&clock CLK_PPMUCAMIF>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_lcd0: ppmu_lcd0@11e4 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x11e4 0x2000>;
+   clocks = <&clock CLK_PPMULCD0>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_fsys: ppmu_g3d@1263 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1263 0x2000>;
+   status = "disabled";
+   };
+
+   ppmu_image: ppmu_image@12aa {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x12aa 0x2000>;
+   clocks = <&clock CLK_PPMUIMAGE>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_tv: ppmu_tv@12e4 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x12e4 0x2000>;
+   clocks = <&clock CLK_PPMUTV>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_g3d: ppmu_g3d@1322 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1322 0x2000>;
+   clocks = <&clock CLK_PPMUG3D>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_mfc_left: ppmu_mfc_left@1366 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1366 0x2000>;
+   clocks = <&clock CLK_PPMUMFC_L>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
+
+   ppmu_mfc_right: ppmu_mfc_right@1367 {
+   compatible = "samsung,exynos-ppmu";
+   reg = <0x1367 0x2000>;
+   clocks = <&clock CLK_PPMUMFC_R>;
+   clock-names = "ppmu";
+   status = "disabled";
+   };
 };
diff --git a/arch/arm/boot/dts/exynos4210.dtsi 
b/arch/arm/boot/dts/exynos4210.dtsi
index bcc9e63..b2598de 1

[PATCHv7 00/10] devfreq: Add devfreq-event class to provide raw data for devfreq device

2015-01-07 Thread Chanwoo Choi
This patchset add new devfreq_event class to provide raw data to determine
current utilization of device  which is used for devfreq governor.

The following description explains the feature of two kind of devfreq class:
- devfreq class (existing)
 : devfreq consumer device use raw data from devfreq_event device for
   determining proper current system state and change voltage/frequency
   dynamically using various governors.
- devfreq_event class (new)
 : Provide measured raw data to devfreq device for governor

---
Changes from v6:
- This patchset is based on v3.19-rc3.
1. devfreq-event class driver
- Fix build break if devfreq-event framework is off
- Add resource-managed function for devfreq-event device
: devm_devfreq_event_add_edev()
: devm_devfreq_event_remove_edev()

Changes from v5:
- Rebase these patch-set on v3.19-rc1 and Test it.
1. exynos-ppmu.c
- Change the error value when of_iomap() fail to map the memory
- Remove owner setting of platform_driver
- Add exynos_ppmu_disable() function
2. exynos dts file
- Add PPMU node to Exynos3250-based Monk board
- Remove ppmu_cpu node on Exynos4412-based TRATS2 board and add 
ppmu_leftbus/rightbus node

Changes from v4:
1. devfreq-event class driver
- Add devfreq_event_get_edev_count() function
- Modify the simple description of devfreq-event framework in devfreq-event.c
- Minimize the usage range of global lock usage in devfreq_event_add_edev()
- Remove '_is_enabled()' function pointer in devfreq_event_ops structure
- Add separte CONFIG_PM_DEVFREQ_EVENT configuration
- Add new devfreq-event.h header file including devfreq-event helper functions
2. exynos dts file
- Add new patch to support PPMU with DEVFREQ-event on Exynos4412-based TRATS2

Changes from v3:
1. devfreq-event class driver
- Fix return value of devfreq_event_get_event()
- Add new structure devfreq_event_data for devfreq_event_get_event()
- Modify the prototype of devfreq_event_get_event() function
- Call of_node_put after calling of_parse_phandle() to decrement refcount
2. exynos-ppmu driver
- Modify usage of devfreq_event_get_event() function
  according to new prototype of this funciton
- Add the additional description to exynos-ppmu.txt how to add PPMU node
  in board dts file
- Use 'PPMU_EVENT' macro to remove duplicate codes
- Add the support of PPMU for Exynos5260
3. exynos dts file
- Add missing PPMU_FSYS node to exynos3250.dtsi
- Fix 'ppmu_mfc_l' node name as 'ppmu_mfc' because exynos3250 has only one MFC 
IP.
- Add missing PPMU_ACP/G3D to exynos4.dtsi
4. etc
- Fix wrong abbreviation of PPMU (PPMU :Platform Performance Monitoring Unit)
- Add new patch to support the PPMU of Exynos5260 SoC

Changes from v2:
1. devfreq-event class driver
- Rename all the helper functions of devfreq-event device
- Add devfreq_event_remove_edev() instead of devfreq_put_event_dev()
- Add devfreq_event_release_edev() to initialize it before put device
- Add the detailed description of devfreq-event API
- Add the attributes of devfreq-event class (enable_count)
- Check the overflow about event/total_event data in devfreq_event_get_event()
- Remove the 'exclusive flag' feature
- Set set_event()/get_event() functions as mandary
- Add missing of_node_put() call
- Change variable type of 'get_event()' funciton from 'int' to 'u64'
2. exynos-ppmu driver
- Remove un-used field (struct devfreq)
- Use 'of_get_child_by_name()' instead of 'of_find_node_by_name()'
- Add missing of_node_put() call
- Fix wrong clock control
- Use devfreq_event_remove_edev() instead of devfreq_remove_device()
- Add the documentation for exynos-ppmu driver
- Remove 'enable/disable/is_enabled/reset' function of exynos-ppmu driver
3. exynos3250-rinato.dts
- Add ppmu_{leftbus|rightbus} dt node and remove ppmu_cpu dt node

Changes from v1:
- Code clean
- Add the description of devfreq-event structure
- Add 'is_enabled' function to devfreq_event_ops structure
- Add 'enable_count' field to devfreq_event_dev structure
- Check whether devfreq-event device is enabled or not
  during calling devfreq_event API
- Define the type of devfreq-event device as following
  : DEVFREQ_EVENT_TYPE_RAW_DATA
  : DEVFREQ_EVENT_TYPE_UTILIZATION
  : DEVFREQ_EVENT_TYPE_BANDWIDTH
  : DEVFREQ_EVENT_TYPE_LATENCY
- Add the exclusive feature of devfreq-event device.
  If devfreq-event device is used on only on devfreq driver,
  should used 'devfreq_enable_event_dev_exclusive()' function
- Add new patch6 for test on Exynos3250-based Rinato board

Chanwoo Choi (10):
  devfreq: event: Add new devfreq_event class to provide basic data for devfreq 
governor
  devfreq: event: Add the list of supported devfreq-event type
  devfreq: event: Add resource-managed function for devfreq-event device
  devfreq: event: Add exynos-ppmu devfreq-event driver
  devfreq: event: Add documentation for exynos-ppmu devfreq-event driver
  ARM: dts: Add PPMU dt node for Exynos3250 SoC
  ARM: dts: Add PPMU dt node for Exynos4 SoCs
  ARM: dts: Add PPMU dt node for Exynos5260 SoC
  ARM: dt

RE: [PATCH v2] ARM: dts: Add dts file for odroid XU3 board

2015-01-07 Thread Jonathan Stone -SISA

On On Wed, 2015-01-07 at 18:37 +, Sjoerd Simons writes wrote:
>On Wed, 2015-01-07 at 18:37 +, Anand Moon wrote:>
[...]

>> Only 4 core cpu's are on my board. Also CpuFreq is not working.
> 
> Can you share some point on this.

>The defconfig is using the bL switcher, which pairs up big and little cores to 
>make them appear as one core.. So for 8 real cores, you'll get
>4 "virtual cores".

That configuration is appropriate for the 5420, which allegedly has a hardware 
bug in the cache-coherence between the Cortex-A7 block and the Cortex-A15 block.
Newer Exynos 5 SoCs -- 5422/5800, 5620, etc -- don't have that bug. The 
scheduler should configured to  do HMP on all 8 (or 6) cores.
I don't have a 5410, but I assume it has the same bug as the 5420.

The XU3 kernel supplied by HardKernel shows all 8 cores, and does HMP 
scheduling across all 8.

I tried v1.0 of the Odroid-XU3 DTB patch, applied to linux-next 20150107.  I'm 
only seeing 1 core running on my Odroid-XU3.  The USB 3.0 port works (great!) 
but I'm not getting any HDMI output.  I didn't try DisplayPort.   I'll gladly 
try v2 of the patch on an XU3; is there a better base to apply the patch to?




[PATCH RESEND] ARM: EXYNOS: Recognize Samsung MFC v8 devices

2015-01-07 Thread Sjoerd Simons
Also setup memory allocations for version 8 of the MFC as present in
Samsung Exynos 5422/5800 SoCs

Signed-off-by: Sjoerd Simons 
---
 arch/arm/mach-exynos/exynos.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index c13d083..b343a1a 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -282,6 +282,7 @@ static void __init exynos_reserve(void)
"samsung,mfc-v5",
"samsung,mfc-v6",
"samsung,mfc-v7",
+   "samsung,mfc-v8",
};
 
for (i = 0; i < ARRAY_SIZE(mfc_mem); i++)
-- 
2.1.4

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


[PATCH RESEND] pwm: samsung: Fix output race on disabling

2015-01-07 Thread Sjoerd Simons
When disabling the samsung PWM the output state remains at the level it
was in the end of a pwm cycle. In other words, calling pwm_disable when
at 100% duty will keep the output active, while at all other setting the
output will go/stay inactive. On top of that the samsung PWM settings are
double-buffered, which means the new settings only get applied at the
start of a new PWM cycle.

This results in a race if the PWM is at 100% duty and a driver calls:
  pwm_config (pwm, 0, period);
  pwm_disable (pwm);

In this case the PWMs output will unexpectedly stay active, unless a new
PWM cycle happened to start between the register writes in _config and
_disable. As far as i can tell this is a regression introduced by 3bdf878,
before that a call to pwm_config would call pwm_samsung_enable which,
while heavy-handed, made sure the expected settings were live.

To resolve this, while not re-introducing the issues 3bdf878 (flickering
as the PWM got reset while in a PWM cycle). Only force an update of the
settings when at 100% duty, which shouldn't have a noticeable effect on
the output but is enough to ensure the behaviour is as expected on
disable.

Signed-off-by: Sjoerd Simons 
---
 drivers/pwm/pwm-samsung.c | 21 +
 1 file changed, 21 insertions(+)

diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c
index 3e9b583..3e252dc 100644
--- a/drivers/pwm/pwm-samsung.c
+++ b/drivers/pwm/pwm-samsung.c
@@ -335,6 +335,27 @@ static int pwm_samsung_config(struct pwm_chip *chip, 
struct pwm_device *pwm,
writel(tcnt, our_chip->base + REG_TCNTB(pwm->hwpwm));
writel(tcmp, our_chip->base + REG_TCMPB(pwm->hwpwm));
 
+   /* In case the PWM is currently at 100% duty, trigger a manual update to
+* prevent unexpected results when disabling the pwm */
+   if (chan->period_ns/chan->tin_ns == chan->duty_ns/chan->tin_ns) {
+   unsigned int tcon_chan = to_tcon_channel(pwm->hwpwm);
+   u32 tcon;
+   unsigned long flags;
+
+   dev_dbg(our_chip->chip.dev, "Forcing manual update");
+
+   spin_lock_irqsave(&samsung_pwm_lock, flags);
+
+   tcon = readl(our_chip->base + REG_TCON);
+   tcon |= TCON_MANUALUPDATE(tcon_chan);
+   writel(tcon, our_chip->base + REG_TCON);
+
+   tcon &= ~TCON_MANUALUPDATE(tcon_chan);
+   writel(tcon, our_chip->base + REG_TCON);
+
+   spin_unlock_irqrestore(&samsung_pwm_lock, flags);
+   }
+
chan->period_ns = period_ns;
chan->tin_ns = tin_ns;
chan->duty_ns = duty_ns;
-- 
2.1.4

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


[PATCH v3] ARM: dts: Add dts file for odroid XU3 board

2015-01-07 Thread Sjoerd Simons
Add DTS for the Hardkernel Odroid XU3. The name of the DTS file is kept the
same as the vendors naming, which means it's prefixed with exynos5422
instead of exynos5800 as the SoC name even though it includes the
exyno5800 dtsi.

Signed-off-by: Sjoerd Simons 
---
Changes since v1:
 * Add chosen/linux,stdout-path to point the serial console device
 * Change memory start offset to 0x4000 to match the vendors DTS (pointed
   out by Heesub Shin)
  * Declare base address & size for the memory banks to be used by the MFC

Changes since v2:
  * Correct hdmi supplies (spotted by Joonyoung Shim). This currently doesn't
have a practical impact as all supplies are always-on, but makes the dts
match the schematics.

 arch/arm/boot/dts/Makefile |   1 +
 arch/arm/boot/dts/exynos5422-odroidxu3.dts | 332 +
 2 files changed, 333 insertions(+)
 create mode 100644 arch/arm/boot/dts/exynos5422-odroidxu3.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 91bd5bd..df397c2 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -98,6 +98,7 @@ dtb-$(CONFIG_ARCH_EXYNOS) += exynos3250-monk.dtb \
exynos5420-arndale-octa.dtb \
exynos5420-peach-pit.dtb \
exynos5420-smdk5420.dtb \
+   exynos5422-odroidxu3.dtb \
exynos5440-sd5v1.dtb \
exynos5440-ssdk5440.dtb \
exynos5800-peach-pi.dtb
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts 
b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
new file mode 100644
index 000..c29123c
--- /dev/null
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
@@ -0,0 +1,332 @@
+/*
+ * Hardkernel Odroid XU3 board device tree source
+ *
+ * Copyright (c) 2014 Collabora Ltd.
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+/dts-v1/;
+#include "exynos5800.dtsi"
+
+/ {
+   model = "Hardkernel Odroid XU3";
+   compatible = "hardkernel,odroid-xu3", "samsung,exynos5800", 
"samsung,exynos5";
+
+   memory {
+   reg = <0x4000 0x8000>;
+   };
+
+   chosen {
+   linux,stdout-path = &serial_2;
+   };
+
+   fimd@1440 {
+   status = "okay";
+   };
+
+   firmware@02073000 {
+   compatible = "samsung,secure-firmware";
+   reg = <0x02073000 0x1000>;
+   };
+
+   fixed-rate-clocks {
+   oscclk {
+   compatible = "samsung,exynos5420-oscclk";
+   clock-frequency = <2400>;
+   };
+   };
+
+   hsi2c_4: i2c@12CA {
+   status = "okay";
+
+   s2mps11_pmic@66 {
+   compatible = "samsung,s2mps11-pmic";
+   reg = <0x66>;
+   s2mps11,buck2-ramp-delay = <12>;
+   s2mps11,buck34-ramp-delay = <12>;
+   s2mps11,buck16-ramp-delay = <12>;
+   s2mps11,buck6-ramp-enable = <1>;
+   s2mps11,buck2-ramp-enable = <1>;
+   s2mps11,buck3-ramp-enable = <1>;
+   s2mps11,buck4-ramp-enable = <1>;
+
+   s2mps11_osc: clocks {
+   #clock-cells = <1>;
+   clock-output-names = "s2mps11_ap",
+   "s2mps11_cp", "s2mps11_bt";
+   };
+
+   regulators {
+   ldo1_reg: LDO1 {
+   regulator-name = "vdd_ldo1";
+   regulator-min-microvolt = <100>;
+   regulator-max-microvolt = <100>;
+   regulator-always-on;
+   };
+
+   ldo3_reg: LDO3 {
+   regulator-name = "vdd_ldo3";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   regulator-always-on;
+   };
+
+   ldo5_reg: LDO5 {
+   regulator-name = "vdd_ldo5";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   regulator-always-on;
+   };
+
+   ldo6_reg: LDO6 {
+   regulator-name = "vdd_ldo6";
+   regulator-min-microvolt = <10

Re: [PATCH v2] ARM: dts: Add dts file for odroid XU3 board

2015-01-07 Thread Sjoerd Simons
On Wed, 2015-01-07 at 18:37 +, Anand Moon wrote:
> Hi Sjoerd,
> 
> I am using 3.18.0 kernel on my odroidxu3 board.
> Using exynos_defconfig I am able to boot the board.
> 
> Are you able to get all the 8 core CPU up and running ?
> 
> 
> Only 4 core cpu's are on my board. Also CpuFreq is not working.
> 
> Can you share some point on this.

The defconfig is using the bL switcher, which pairs up big and little
cores to make them appear as one core.. So for 8 real cores, you'll get
4 "virtual cores".




> 
> root@odroid-xu3:/usr/src/odroidxu3-3.18.y-debug# cat /proc/cpuinfo | grep 
> processor
> processor : 0
> processor : 5
> processor : 6
> processor : 7
> 
> 
> Below are the logs of the board.
> 
> [9.720905] Registering SWP/SWPB emulation handler
> [9.725457] big.LITTLE switcher initializing
> [9.729518] CPU0 paired with CPU4
> [9.732805] CPU5 paired with CPU3
> [9.736069] CPU6 paired with CPU2
> [9.739386] CPU7 paired with CPU1
> [9.742688] GIC ID for CPU 0 cluster 1 is 4
> [9.746816] GIC ID for CPU 0 cluster 0 is 0
> [9.800575] IRQ153 no longer affine to CPU1
> [9.803065] CPU1: shutdown
> [9.813482] GIC ID for CPU 1 cluster 0 is 1
> [9.869776] IRQ154 no longer affine to CPU2
> [9.872218] CPU2: shutdown
> [9.879985] GIC ID for CPU 2 cluster 0 is 2
> [9.924656] IRQ155 no longer affine to CPU3
> [9.927094] CPU3: shutdown
> [9.935544] GIC ID for CPU 3 cluster 0 is 3
> [9.989578] IRQ160 no longer affine to CPU4
> [9.991787] CPU4: shutdown
> [   10.001003] GIC ID for CPU 1 cluster 1 is 5
> [   10.003812] GIC ID for CPU 2 cluster 1 is 6
> [   10.007976] GIC ID for CPU 3 cluster 1 is 7
> [   10.015308] big.LITTLE switcher initialized
> [   10.031368] registered taskstats version 1
> [   10.038110] pinctrl core: add 2 pinmux maps
> [   10.038374] samsung-pinctrl 1340.pinctrl: found group selector 39 for 
> gpx3-7
> [   10.038541] samsung-pinctrl 1340.pinctrl: found group selector 39 for 
> gpx3-7
> [   10.038586] samsung-pinctrl 1340.pinctrl: request pin 39 (gpx3-7) for 
> 1453.hdmi
> [   10.039440] of_get_named_gpiod_flags: parsed 'hpd-gpio' property of node 
> '/hdmi@1453[0]' - status (0)
> [   10.040227] exynos-hdmi 1453.hdmi: Looking up vdd-supply from device 
> tree
> [   10.042869] exynos-hdmi 1453.hdmi: Looking up vdd_osc-supply from 
> device tree
> [   10.044700] exynos-hdmi 1453.hdmi: Looking up vdd_pll-supply from 
> device tree
> [   10.046528] exynos-hdmi 1453.hdmi: Looking up hdmi-en-supply from 
> device tree
> [   10.046558] exynos-hdmi 1453.hdmi: Looking up hdmi-en-supply property 
> in node /hdmi@1453 failed
> [   10.048281] samsung-pinctrl 1340.pinctrl: request pin 39 (gpx3-7) for 
> gpx3:39
> [   10.071915] exynos-mixer 1445.mixer: probe start
> [   10.076942] exynos-sysmmu 1465.sysmmu: Enabled
> [   10.076975] exynos-mixer 1445.mixer: exynos_iommu_attach_device: 
> Attached IOMMU with pgtable 0x42264000
> [   10.077570] exynos-drm exynos-drm: bound 1445.mixer (ops 
> mixer_component_ops)
> [   10.089655] exynos-drm exynos-drm: bound 1453.hdmi (ops 
> hdmi_component_ops)
> [   10.095639] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> [   10.102242] [drm] No driver support for vblank timestamp query.
> [   10.161814] cma: cma_alloc(cma c11c3218, count 2025, align 8)
> [   10.256074] cma: cma_alloc(): returned ef6cd400
> [   10.457934] Console: switching to colour frame buffer device 274x77
> [   10.511095] exynos-drm exynos-drm: fb0:  frame buffer device
> [   10.516212] exynos-drm exynos-drm: registered panic notifier
> [   10.537871] [drm] Initialized exynos 1.0.0 20110530 on minor 0
> [   10.545873] s3c-rtc 101e.rtc: setting system clock to 2015-01-07 
> 17:50:09 UTC (1420653009)
> [   10.553979] power-domain: Power-off latency exceeded, new value 388375 ns
> [   10.560076] power-domain: Power-off latency exceeded, new value 6221750 ns
> [   10.567225] power-domain: Power-off latency exceeded, new value 248791 ns
> [   10.573666] power-domain: Power-off latency exceeded, new value 6502916 ns
> [   11.093083] MAIN_DC: disabling
> [   11.099738] ALSA device list:
> [   11.101347]   No soundcards found.
> [   11.117975] Freeing unused kernel memory: 1732K (c079b000 - c094c000)
> [   11.775702] systemd-udevd[1676]: starting version 204
> [   15.298783] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data 
> mode. Opts: (null)
> [   17.878286] init: plymouth-upstart-bridge main process (1732) terminated 
> with status 1
> [   17.885458] init: plymouth-upstart-bridge main process ended, respawning
> [   18.211733] init: plymouth-upstart-bridge main process (1741) terminated 
> with status 1
> [   18.219007] init: plymouth-upstart-bridge main process ended, respawning
> [   18.432104] init: plymouth-upstart-bridge main process (1745) terminated 
> with status 1
> [   18.439365] init: plymouth-upstart-bridge main process ended, 

Re: [PATCH 26/29] drm/exynos: atomic phase 1: add atomic_begin()/atomic_flush()

2015-01-07 Thread Gustavo Padovan
2014-12-30 Inki Dae :

> On 2014년 12월 18일 22:58, Gustavo Padovan wrote:
> > From: Gustavo Padovan 
> > 
> > Add CRTC callbacks .atomic_begin() .atomic_flush(). On exynos they
> > unprotect the windows before the commit and protects it after based on
> > a plane mask tha store which plane will be updated.
> 
> tha? Typo?

Okay.

> 
> > 
> > For that we create two new exynos_crtc callbacks: .win_protect() and
> > .win_unprotect(). The only driver that implement those now is FIMD.
> > 
> > Signed-off-by: Gustavo Padovan 
> > ---
> >  drivers/gpu/drm/exynos/exynos_drm_crtc.c  | 34 +++
> >  drivers/gpu/drm/exynos/exynos_drm_drv.h   |  4 +++
> >  drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 56 
> > ++-
> >  drivers/gpu/drm/exynos/exynos_drm_plane.c |  4 +++
> >  4 files changed, 82 insertions(+), 16 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c 
> > b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
> > index 74980c5..f231eb8 100644
> > --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
> > +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
> > @@ -156,6 +156,38 @@ static void exynos_drm_crtc_disable(struct drm_crtc 
> > *crtc)
> > }
> >  }
> >  
> > +static void exynos_crtc_atomic_begin(struct drm_crtc *crtc)
> > +{
> > +   struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
> > +   struct drm_plane *plane;
> > +   int index = 0;
> > +
> 
> Isn't drm_modest_lock_all(dev) required? Or is this function atomic
> context? I didn't look into all codes yet so there may be my missing point.

the atomic code already protects it by calling drm_modeset_lock_all() so we
are running in a safe context.

Gustavo
--
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 25/29] drm/exynos: atomic phase 1: use drm_plane_helper_disable()

2015-01-07 Thread Gustavo Padovan
2014-12-30 Inki Dae :

> On 2014년 12월 18일 22:58, Gustavo Padovan wrote:
> > From: Gustavo Padovan 
> > 
> > The atomic helper to disable planes also uses exynos_update_plane() to
> > disable plane so we had to adapt it to both commit and disable planes.
> > 
> > A check for NULL CRTC was added to exynos_plane_mode_set() since planes
> > to be disabled have plane_state->crtc set to NULL.
> > 
> > Also win_disable() callback uses plane->crtc as arg for the same reason.
> > 
> > exynos_drm_fb_get_buf_cnt() needs a fb check too to avoid a null pointer.
> > 
> > Signed-off-by: Gustavo Padovan 
> > ---
> >  drivers/gpu/drm/exynos/exynos_drm_fb.c|  2 +-
> >  drivers/gpu/drm/exynos/exynos_drm_plane.c | 24 ++--
> >  2 files changed, 19 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c 
> > b/drivers/gpu/drm/exynos/exynos_drm_fb.c
> > index d346d1e..470456d 100644
> > --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
> > +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
> > @@ -136,7 +136,7 @@ unsigned int exynos_drm_fb_get_buf_cnt(struct 
> > drm_framebuffer *fb)
> >  
> > exynos_fb = to_exynos_fb(fb);
> >  
> > -   return exynos_fb->buf_cnt;
> > +   return exynos_fb ? exynos_fb->buf_cnt : 0;
> 
> This change isn't related with this patch.

This patch will be reworked to use atomic_disable() as suggested by Daniel
Vetter in the previous comment.

Gustavo
--
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 00/21] irqchip: gic: killing gic_arch_extn and co, slowly

2015-01-07 Thread santosh shilimkar

Marc,

On 1/7/2015 9:42 AM, Marc Zyngier wrote:

The gic_arch_extn hack that a number of platform use has been nagging
me for too long. It is only there for the benefit of a few platform,
and yet it impacts all GIC users. Moreover, it gives people the wrong
idea ("let's use it to put some new custom hack in there"...).

But now that stacked irq domains have landed in -next, the time has
come for gic_arch_extn to meet the Big Bit Bucket.

This patch series takes several steps towards the elimination of
gic_arch_extn:

- moves Tegra's legacy interrupt controller support to
   drivers/irqchip, implementing a stacked domain on top of the
   standard GIC.

- OMAP, imx6 and exynos are also converted to stacked domains, but
   their implementation is left in place (the code is far too
   intricately mixed with other details of the platform for me to even
   try to move it). Some OMAP variants get a special treatment as we
   also kill the crossbar horror (more on that below).

- shmobile, ux500 and zynq are only slightly modified.

- The GIC itself is cleaned up, and some other bits and bobs are
   adjusted for a good measure.

About the TI crossbar:

- The allocation of interrupts in this domain is fairly similar to
   what we do for MSI (see the GICv2m driver), and stacked domains have
   proved to be a fitting solution.

- The current description in DT is currently entierely inaccurate, and
   as we already broke it for the OMAP WUGEN block, we might as well do
   it again for the TI crossbar.

- The way crossbar, WUGEN and GIC interract is quite complex (this is
   effectively a stack of three interrupt controllers with interesting
   exceptions and braindead routing), and stacked domains are the right
   abstraction for that.

- Other platforms (Freescale Vybrid) are starting to come up with the
   same type of things, and it'd be good to avoid them following the
   same broken model.

- It removes a few lines from the code base so it can't completely be
   a bad idea!

So this patch series does exactly that: make the crossbar a stacked
interrupt controller that only takes care of setting up the routing,
fix the DTs to represent the actual HW, and remove a bit of the
craziness from the GIC code.

It is worth realizing that:

- I haven't been able to test this as much as I would have wanted to
   (it's only been tested on tegra2 and omap5).

- I've created DT bindings when needed, updated existing ones, but I
   haven't created a binding for platforms that already used an
   undocumented one (imx6, I'm looking at you).

- I've relaxed quite a bit of the locking in the GIC code. I believe
   this is safe, but someone else should give it a long hard look.

- This actively *breaks* existing setups. Once you boot a new kernel
   with an old DT, suspend/resume *will* be broken. Old kernels on a
   new DT won't even boot! You've been warned. This really outline the
   necessity of actually describing the HW in device trees...

As for the patches, they are on top of 3.19-rc3.

I've pushed the code to:
git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git 
irq/die-gic-arch-extn-die-die-die

Comments welcome,

 M.

Marc Zyngier (21):
   ARM: tegra: irq: nuke leftovers from non-DT support
   irqchip: tegra: add DT-based support for legacy interrupt controller
   ARM: tegra: skip gic_arch_extn setup if DT has a LIC node
   ARM: tegra: update DTs to expose legacy interrupt controller
   DT: tegra: add binding for the legacy interrupt controller
   ARM: tegra: remove old LIC support
   genirq: Add irqchip_set_wake_parent
   irqchip: crossbar: convert dra7 crossbar to stacked domains
   DT: update ti,irq-crossbar binding
   irqchip: GIC: get rid of routable domain
   DT: arm,gic: kill arm,routable-irqs
   ARM: omap: convert wakeupgen to stacked domains
   DT: omap4/5: add binding for the wake-up generator
   ARM: imx6: convert GPC to stacked domains
   ARM: exynos4/5: convert pmu wakeup to stacked domains
   DT: exynos: update PMU binding
   irqchip: gic: add an entry point to set up irqchip flags
   ARM: shmobile: remove use of gic_arch_extn.irq_set_wake
   ARM: ux500: switch from gic_arch_extn to gic_set_irqchip_flags
   ARM: zynq: switch from gic_arch_extn to gic_set_irqchip_flags
   irqchip: gic: Drop support for gic_arch_extn


Thanks a lot for killing those gic_arch_extn and cross-bar with
newly added stacked domains. It cleans up the GIC code for better.
Feel free to add my ack if you need one.

Acked-by: Santosh Shilimkar 

Regards,
Snatosh
--
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: [PULL] drm-exynos-next 2014-12-22

2015-01-07 Thread Gustavo Padovan
2014-12-26 Inki Dae :

> On 2014년 12월 22일 22:04, Gustavo Padovan wrote:
> > Hi Dave,
> >
> > Here goes a bunch of clean up for the exynos driver. I've posted this work 
> > in
> > the mailing list twice but never got a review on it, first time was about a
> 
> Never no. I already had a review and they - your first time patch set -
> had been merged to exynos-drm-next-todo. I was moving them to
> exynos-drm-next locally but one of your patch set was not reasonable to
> me so I gave you one comment. After that, you posted next patch set
> which include new changes and patches just 9 days ago. So they should
> also be reviewed enough at least for two weeks.

So please notify on the mailing list what you are doing. To me it looked that
all patches but one didn't get any review. I have a lot of pending work to do
on top of this pull request and review on them is quite important for me to
keep working on new changes.

> 
> Please, do not hurry. Such big changes should really be reviewed enough.
> I will wait for other reviews and them merge them if reviewed enough. If
> nobody have reviews then I will merge them. So please, don't worry about
> that.

It is been a way more than two weeks now, can you please merge all my
patches but the 3 ones you had commented on? I'll send updated patches for
those.

Also can you add you tree to the linux-next build?

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


[PATCH v2 17/21] irqchip: gic: add an entry point to set up irqchip flags

2015-01-07 Thread Marc Zyngier
A common use of gic_arch_extn is to set up additional flags
to the GIC irqchip. It looks like a benign enough hack that
doesn't really require the users of that feature to be converted
to stacked domains.

Add a gic_set_irqchip_flags() function that platform code can
call instead of using the dreaded gic_arch_extn.

Signed-off-by: Marc Zyngier 
---
 drivers/irqchip/irq-gic.c   | 5 +
 include/linux/irqchip/arm-gic.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 9c30a76..23fe3be 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -877,6 +877,11 @@ static const struct irq_domain_ops gic_irq_domain_ops = {
.xlate = gic_irq_domain_xlate,
 };
 
+void gic_set_irqchip_flags(unsigned long flags)
+{
+   gic_chip.flags |= flags;
+}
+
 void __init gic_init_bases(unsigned int gic_nr, int irq_start,
   void __iomem *dist_base, void __iomem *cpu_base,
   u32 percpu_offset, struct device_node *node)
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index 3978c5b..36ec4ae 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -97,6 +97,7 @@ struct device_node;
 
 extern struct irq_chip gic_arch_extn;
 
+void gic_set_irqchip_flags(unsigned long flags);
 void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
u32 offset, struct device_node *);
 void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
-- 
2.1.4

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


[PATCH v2 20/21] ARM: zynq: switch from gic_arch_extn to gic_set_irqchip_flags

2015-01-07 Thread Marc Zyngier
Instead of directly touching gic_arch_extn, which is about to
be removed, use gic_set_irqchip_flags instead.

Signed-off-by: Marc Zyngier 
---
 arch/arm/mach-zynq/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index 26f92c2..82734d5 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -188,7 +188,7 @@ static void __init zynq_map_io(void)
 
 static void __init zynq_irq_init(void)
 {
-   gic_arch_extn.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND;
+   gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND);
irqchip_init();
 }
 
-- 
2.1.4

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


[PATCH v2 16/21] DT: exynos: update PMU binding

2015-01-07 Thread Marc Zyngier
Document the fact that some Exynos PMUs are capable of acting as
an interrupt controller.

Signed-off-by: Marc Zyngier 
---
 Documentation/devicetree/bindings/arm/samsung/pmu.txt | 13 +
 1 file changed, 13 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.txt 
b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
index 1e1979b..d698e74 100644
--- a/Documentation/devicetree/bindings/arm/samsung/pmu.txt
+++ b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
@@ -28,10 +28,23 @@ Properties:
  - clocks : list of phandles and specifiers to all input clocks listed in
clock-names property.
 
+Optional properties:
+
+Some PMUs are capable of behaving as an interrupt controller (mostly
+to wake up a suspended PMU). In which case, they can have the
+following properties:
+
+- interrupt-controller: indicate that said PMU is an interrupt controller
+
+- interrupt-parent: a phandle indicating which interrupt controller
+  this PMU signals interrupts to.
+
 Example :
 pmu_system_controller: system-controller@1004 {
compatible = "samsung,exynos5250-pmu", "syscon";
reg = <0x1004 0x5000>;
+   interrupt-controller;
+   interrupt-parent = <&gic>;
#clock-cells = <1>;
clock-names = "clkout0", "clkout1", "clkout2", "clkout3",
"clkout4", "clkout8", "clkout9";
-- 
2.1.4

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


[PATCH v2 19/21] ARM: ux500: switch from gic_arch_extn to gic_set_irqchip_flags

2015-01-07 Thread Marc Zyngier
Instead of directly touching gic_arch_extn, which is about to
be removed, use gic_set_irqchip_flags instead.

Acked-by: Linus Walleij 
Signed-off-by: Marc Zyngier 
---
 arch/arm/mach-ux500/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index dbb2970..6ced0f6 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -52,7 +52,7 @@ void ux500_restart(enum reboot_mode mode, const char *cmd)
 */
 void __init ux500_init_irq(void)
 {
-   gic_arch_extn.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND;
+   gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND);
irqchip_init();
 
/*
-- 
2.1.4

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


[PATCH v2 12/21] ARM: omap: convert wakeupgen to stacked domains

2015-01-07 Thread Marc Zyngier
OMAP4/5 has been (ab)using the gic_arch_extn to provide
wakeup from suspend, and it makes a lot of sense to convert
this code to use stacked domains instead.

This patch does just this, updating the DT files to actually
reflect what the HW provides.

BIG FAT WARNING: because the DTs were so far lying by not
exposing the WUGEN HW block, kernels with this patch applied
won't have any suspend-resume facility when booted with old DTs,
and old kernels with updated DTs won't even boot.

On a platform with this patch applied, the system looks like
this:

root@bacon-fat:~# cat /proc/interrupts
CPU0   CPU1
 16:  0  0 WUGEN  37  gp_timer
 19: 233799 155916   GIC  27  arch_timer
 23:  0  0 WUGEN   9  l3-dbg-irq
 24:  1  0 WUGEN  10  l3-app-irq
 27:282  0 WUGEN  13  omap-dma-engine
 44:  0  0  4ae1.gpio  13  DMA
294:  0  0 WUGEN  20  gpmc
297:506  0 WUGEN  56  4807.i2c
298:  0  0 WUGEN  57  48072000.i2c
299:  0  0 WUGEN  61  4806.i2c
300:  0  0 WUGEN  62  4807a000.i2c
301:  8  0 WUGEN  60  4807c000.i2c
308:   2439  0 WUGEN  74  OMAP UART2
312:362  0 WUGEN  83  mmc2
313:502  0 WUGEN  86  mmc0
314: 13  0 WUGEN  94  mmc1
350:  0  0  PRCM  pinctrl, pinctrl
406:   35155709  0   GIC 109  ehci_hcd:usb1
407:  0  0 WUGEN   7  palmas
409:  0  0 WUGEN 119  twl6040
410:  0  0   twl6040   5  twl6040_irq_ready
411:  0  0   twl6040   0  twl6040_irq_th
IPI0:  0  1  CPU wakeup interrupts
IPI1:  0  0  Timer broadcast interrupts
IPI2:  95334 902334  Rescheduling interrupts
IPI3:  0  0  Function call interrupts
IPI4:479648  Single function call interrupts
IPI5:  0  0  CPU stop interrupts
IPI6:  0  0  IRQ work interrupts
IPI7:  0  0  completion interrupts
Err:  0

Signed-off-by: Marc Zyngier 
---
 arch/arm/boot/dts/am4372.dtsi |  11 ++-
 arch/arm/boot/dts/dra7.dtsi   |  12 ++-
 arch/arm/boot/dts/dra72x.dtsi |   2 +-
 arch/arm/boot/dts/dra74x.dtsi |   2 +-
 arch/arm/boot/dts/omap4-duovero.dtsi  |   2 -
 arch/arm/boot/dts/omap4-panda-common.dtsi |   8 +-
 arch/arm/boot/dts/omap4-sdp.dts   |   8 +-
 arch/arm/boot/dts/omap4-var-som-om44.dtsi |   2 -
 arch/arm/boot/dts/omap4.dtsi  |  18 -
 arch/arm/boot/dts/omap5-cm-t54.dts|   1 -
 arch/arm/boot/dts/omap5-uevm.dts  |   2 -
 arch/arm/boot/dts/omap5.dtsi  |  24 --
 arch/arm/mach-omap2/omap-wakeupgen.c  | 125 +++---
 arch/arm/mach-omap2/omap-wakeupgen.h  |   1 -
 arch/arm/mach-omap2/omap4-common.c|   1 -
 15 files changed, 154 insertions(+), 65 deletions(-)

diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index b62a1cd..9d672a7 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -15,7 +15,7 @@
 
 / {
compatible = "ti,am4372", "ti,am43";
-   interrupt-parent = <&gic>;
+   interrupt-parent = <&wakeupgen>;
 
 
aliases {
@@ -48,6 +48,15 @@
#interrupt-cells = <3>;
reg = <0x48241000 0x1000>,
  <0x48240100 0x0100>;
+   interrupt-parent = <&gic>;
+   };
+
+   wakeupgen: interrupt-controller@48281000 {
+   compatible = "ti,omap4-wugen-mpu";
+   interrupt-controller;
+   #interrupt-cells = <3>;
+   reg = <0x48281000 0x1000>;
+   interrupt-parent = <&gic>;
};
 
l2-cache-controller@48242000 {
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 59ec0e6..a5741ae 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -64,6 +64,14 @@
interrupt-parent = <&gic>;
};
 
+   wakeupgen: interrupt-controller@48281000 {
+   compatible = "ti,omap5-wugen-mpu", "ti,omap4-wugen-mpu";
+   interrupt-controller;
+   #interrupt-cells = <3>;
+   reg = <0x48281000 0x1000>;
+   interrupt-parent = <&gic>;
+   };
+
/*
 * The soc node represents the soc top level view. It is used for IPs
 * that are not memory mapped in the MPU view or for the MPU itself.
@@ -92,7 +100,7 @@
reg = <0x4400 0x100>,
  <0x4500 0x1000>;
interrupts-extended = <&crossbar_mpu GIC_SPI 4 
IRQ_TYPE_LEVEL_HIGH>,
- <&gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+ 

[PATCH v2 11/21] DT: arm,gic: kill arm,routable-irqs

2015-01-07 Thread Marc Zyngier
Nobody will regret it.

Signed-off-by: Marc Zyngier 
---
 Documentation/devicetree/bindings/arm/gic.txt | 6 --
 1 file changed, 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/gic.txt 
b/Documentation/devicetree/bindings/arm/gic.txt
index 8112d0c..631cb71 100644
--- a/Documentation/devicetree/bindings/arm/gic.txt
+++ b/Documentation/devicetree/bindings/arm/gic.txt
@@ -52,11 +52,6 @@ Optional
   regions, used when the GIC doesn't have banked registers. The offset is
   cpu-offset * cpu-nr.
 
-- arm,routable-irqs : Total number of gic irq inputs which are not directly
- connected from the peripherals, but are routed dynamically
- by a crossbar/multiplexer preceding the GIC. The GIC irq
- input line is assigned dynamically when the corresponding
- peripheral's crossbar line is mapped.
 Example:
 
intc: interrupt-controller@fff11000 {
@@ -64,7 +59,6 @@ Example:
#interrupt-cells = <3>;
#address-cells = <1>;
interrupt-controller;
-   arm,routable-irqs = <160>;
reg = <0xfff11000 0x1000>,
  <0xfff10100 0x100>;
};
-- 
2.1.4

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


[PATCH v2 18/21] ARM: shmobile: remove use of gic_arch_extn.irq_set_wake

2015-01-07 Thread Marc Zyngier
shmobile only uses gic_arch_extn.irq_set_wake to prevent the GIC
from returning -ENXIO when receiving a wake-up configuration request.

It is a lot simpler to tell the irq layer that we don't need any
configuration by using the IRQCHIP_SKIP_SET_WAKE, thanks to the
new gic_set_irqchip_flags function.

Acked-by: Simon Horman 
Signed-off-by: Marc Zyngier 
---
 arch/arm/mach-shmobile/intc-sh73a0.c   | 7 +--
 arch/arm/mach-shmobile/setup-r8a7779.c | 7 +--
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c 
b/arch/arm/mach-shmobile/intc-sh73a0.c
index 9e36180..fd63ae6 100644
--- a/arch/arm/mach-shmobile/intc-sh73a0.c
+++ b/arch/arm/mach-shmobile/intc-sh73a0.c
@@ -252,11 +252,6 @@ static irqreturn_t sh73a0_intcs_demux(int irq, void 
*dev_id)
return IRQ_HANDLED;
 }
 
-static int sh73a0_set_wake(struct irq_data *data, unsigned int on)
-{
-   return 0; /* always allow wakeup */
-}
-
 #define PINTER0_PHYS 0xe69000a0
 #define PINTER1_PHYS 0xe69000a4
 #define PINTER0_VIRT IOMEM(0xe69000a0)
@@ -318,8 +313,8 @@ void __init sh73a0_init_irq(void)
void __iomem *gic_cpu_base = IOMEM(0xf100);
void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
 
+   gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE);
gic_init(0, 29, gic_dist_base, gic_cpu_base);
-   gic_arch_extn.irq_set_wake = sh73a0_set_wake;
 
register_intc_controller(&intcs_desc);
register_intc_controller(&intc_pint0_desc);
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c 
b/arch/arm/mach-shmobile/setup-r8a7779.c
index 6156d17..989de2d 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -713,14 +713,9 @@ void __init r8a7779_init_late(void)
 }
 
 #ifdef CONFIG_USE_OF
-static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
-{
-   return 0; /* always allow wakeup */
-}
-
 void __init r8a7779_init_irq_dt(void)
 {
-   gic_arch_extn.irq_set_wake = r8a7779_set_wake;
+   gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE);
 
irqchip_init();
 
-- 
2.1.4

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


[PATCH v2 14/21] ARM: imx6: convert GPC to stacked domains

2015-01-07 Thread Marc Zyngier
IMX6 has been (ab)using the gic_arch_extn to provide
wakeup from suspend, and it makes a lot of sense to convert
this code to use stacked domains instead.

This patch does just this, updating the DT files to actually
reflect what the HW provides.

BIG FAT WARNING: because the DTs were so far lying by not
exposing the fact that the GPC block is actually the first
interrupt controller in the chain, kernels with this patch
applied wont have any suspend-resume facility when booted
with old DTs, and old kernels with updated DTs won't even boot.

Signed-off-by: Marc Zyngier 
---
 arch/arm/boot/dts/imx6qdl.dtsi  |   6 +-
 arch/arm/boot/dts/imx6sl.dtsi   |   5 +-
 arch/arm/boot/dts/imx6sx.dtsi   |   5 +-
 arch/arm/mach-imx/common.h  |   1 -
 arch/arm/mach-imx/gpc.c | 127 
 arch/arm/mach-imx/mach-imx6q.c  |   1 -
 arch/arm/mach-imx/mach-imx6sl.c |   1 -
 arch/arm/mach-imx/mach-imx6sx.c |   1 -
 8 files changed, 116 insertions(+), 31 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 4fc03b7..c16d428 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -53,6 +53,7 @@
interrupt-controller;
reg = <0x00a01000 0x1000>,
  <0x00a00100 0x100>;
+   interrupt-parent = <&intc>;
};
 
clocks {
@@ -82,7 +83,7 @@
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
-   interrupt-parent = <&intc>;
+   interrupt-parent = <&gpc>;
ranges;
 
dma_apbh: dma-apbh@0011 {
@@ -122,6 +123,7 @@
compatible = "arm,cortex-a9-twd-timer";
reg = <0x00a00600 0x20>;
interrupts = <1 13 0xf01>;
+   interrupt-parent = <&intc>;
clocks = <&clks IMX6QDL_CLK_TWD>;
};
 
@@ -694,8 +696,10 @@
gpc: gpc@020dc000 {
compatible = "fsl,imx6q-gpc";
reg = <0x020dc000 0x4000>;
+   interrupt-controller;
interrupts = <0 89 IRQ_TYPE_LEVEL_HIGH>,
 <0 90 IRQ_TYPE_LEVEL_HIGH>;
+   interrupt-parent = <&intc>;
};
 
gpr: iomuxc-gpr@020e {
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 36ab8e0..35099b7 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -72,6 +72,7 @@
interrupt-controller;
reg = <0x00a01000 0x1000>,
  <0x00a00100 0x100>;
+   interrupt-parent = <&intc>;
};
 
clocks {
@@ -95,7 +96,7 @@
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
-   interrupt-parent = <&intc>;
+   interrupt-parent = <&gpc>;
ranges;
 
ocram: sram@0090 {
@@ -603,7 +604,9 @@
gpc: gpc@020dc000 {
compatible = "fsl,imx6sl-gpc", "fsl,imx6q-gpc";
reg = <0x020dc000 0x4000>;
+   interrupt-controller;
interrupts = <0 89 IRQ_TYPE_LEVEL_HIGH>;
+   interrupt-parent = <&intc>;
};
 
gpr: iomuxc-gpr@020e {
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
index 7a24fee..c476e67 100644
--- a/arch/arm/boot/dts/imx6sx.dtsi
+++ b/arch/arm/boot/dts/imx6sx.dtsi
@@ -88,6 +88,7 @@
interrupt-controller;
reg = <0x00a01000 0x1000>,
  <0x00a00100 0x100>;
+   interrupt-parent = <&intc>;
};
 
clocks {
@@ -131,7 +132,7 @@
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
-   interrupt-parent = <&intc>;
+   interrupt-parent = <&gpc>;
ranges;
 
pmu {
@@ -700,7 +701,9 @@
gpc: gpc@020dc000 {
compatible = "fsl,imx6sx-gpc", "fsl,imx6q-gpc";
reg = <0x020dc000 0x4000>;
+   interrupt-controller;
interrupts = ;
+   interrupt-parent = <&intc>;
};
 
iomuxc: iomuxc@020e {
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index cfcdb62..7052302 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -102,7 +102,6 @@ static inline void imx_scu

[PATCH v2 13/21] DT: omap4/5: add binding for the wake-up generator

2015-01-07 Thread Marc Zyngier
Signed-off-by: Marc Zyngier 
---
 .../interrupt-controller/ti,omap4-wugen-mpu| 32 ++
 1 file changed, 32 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu

diff --git 
a/Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu 
b/Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu
new file mode 100644
index 000..16149d9
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu
@@ -0,0 +1,32 @@
+TI OMAP4 Wake-up Generator
+
+All TI OMAP4/5 (and their derivatives) an interrupt controllerthat
+routes interrupts to the GIC, and also serves as a wakeup source. It
+is also refered to as "WUGEN-MPU", hence the name of the binding.
+
+Reguired properties:
+
+- compatible : should contain at least "ti,omap4-wugen-mpu"
+- reg : Specifies base physical address and size of the registers.
+- interrupt-controller : Identifies the node as an interrupt controller.
+- #interrupt-cells : Specifies the number of cells needed to encode an
+  interrupt source. The value must be 3.
+- interrupt-parent : a phandle to the GIC these interrupts are routed
+  to.
+
+Notes:
+
+- Because this HW ultimately routes interrupts to the GIC, the
+  interrupt specifier must be that of the GIC.
+- Only SPIs can use the ictlr as an interrupt parent. SGIs and PPIs
+  are explicitely forbiden.
+
+Example:
+
+   wakeupgen: interrupt-controller@48281000 {
+   compatible = "ti,omap5-wugen-mpu", "ti,omap4-wugen-mpu";
+   interrupt-controller;
+   #interrupt-cells = <3>;
+   reg = <0x48281000 0x1000>;
+   interrupt-parent = <&gic>;
+   };
-- 
2.1.4

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


[PATCH v2 21/21] irqchip: gic: Drop support for gic_arch_extn

2015-01-07 Thread Marc Zyngier
Now that the users of gic_arch_extn have been fixed, drop the
"feature" for good. This leads to the removal of some now useless
locking.

Signed-off-by: Marc Zyngier 
---
 drivers/irqchip/irq-gic.c   | 54 -
 include/linux/irqchip/arm-gic.h |  2 --
 2 files changed, 56 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 23fe3be..78d4dee 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -80,19 +80,6 @@ static DEFINE_RAW_SPINLOCK(irq_controller_lock);
 #define NR_GIC_CPU_IF 8
 static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly;
 
-/*
- * Supported arch specific GIC irq extension.
- * Default make them NULL.
- */
-struct irq_chip gic_arch_extn = {
-   .irq_eoi= NULL,
-   .irq_mask   = NULL,
-   .irq_unmask = NULL,
-   .irq_retrigger  = NULL,
-   .irq_set_type   = NULL,
-   .irq_set_wake   = NULL,
-};
-
 #ifndef MAX_GIC_NR
 #define MAX_GIC_NR 1
 #endif
@@ -155,32 +142,18 @@ static void gic_mask_irq(struct irq_data *d)
 {
u32 mask = 1 << (gic_irq(d) % 32);
 
-   raw_spin_lock(&irq_controller_lock);
writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + 
(gic_irq(d) / 32) * 4);
-   if (gic_arch_extn.irq_mask)
-   gic_arch_extn.irq_mask(d);
-   raw_spin_unlock(&irq_controller_lock);
 }
 
 static void gic_unmask_irq(struct irq_data *d)
 {
u32 mask = 1 << (gic_irq(d) % 32);
 
-   raw_spin_lock(&irq_controller_lock);
-   if (gic_arch_extn.irq_unmask)
-   gic_arch_extn.irq_unmask(d);
writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + 
(gic_irq(d) / 32) * 4);
-   raw_spin_unlock(&irq_controller_lock);
 }
 
 static void gic_eoi_irq(struct irq_data *d)
 {
-   if (gic_arch_extn.irq_eoi) {
-   raw_spin_lock(&irq_controller_lock);
-   gic_arch_extn.irq_eoi(d);
-   raw_spin_unlock(&irq_controller_lock);
-   }
-
writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI);
 }
 
@@ -196,23 +169,13 @@ static int gic_set_type(struct irq_data *d, unsigned int 
type)
if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
return -EINVAL;
 
-   raw_spin_lock(&irq_controller_lock);
-
-   if (gic_arch_extn.irq_set_type)
-   gic_arch_extn.irq_set_type(d, type);
-
gic_configure_irq(gicirq, type, base, NULL);
 
-   raw_spin_unlock(&irq_controller_lock);
-
return 0;
 }
 
 static int gic_retrigger(struct irq_data *d)
 {
-   if (gic_arch_extn.irq_retrigger)
-   return gic_arch_extn.irq_retrigger(d);
-
/* the genirq layer expects 0 if we can't retrigger in hardware */
return 0;
 }
@@ -244,21 +207,6 @@ static int gic_set_affinity(struct irq_data *d, const 
struct cpumask *mask_val,
 }
 #endif
 
-#ifdef CONFIG_PM
-static int gic_set_wake(struct irq_data *d, unsigned int on)
-{
-   int ret = -ENXIO;
-
-   if (gic_arch_extn.irq_set_wake)
-   ret = gic_arch_extn.irq_set_wake(d, on);
-
-   return ret;
-}
-
-#else
-#define gic_set_wake   NULL
-#endif
-
 static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
 {
u32 irqstat, irqnr;
@@ -321,7 +269,6 @@ static struct irq_chip gic_chip = {
 #ifdef CONFIG_SMP
.irq_set_affinity   = gic_set_affinity,
 #endif
-   .irq_set_wake   = gic_set_wake,
 };
 
 void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
@@ -985,7 +932,6 @@ void __init gic_init_bases(unsigned int gic_nr, int 
irq_start,
set_handle_irq(gic_handle_irq);
}
 
-   gic_chip.flags |= gic_arch_extn.flags;
gic_dist_init(gic);
gic_cpu_init(gic);
gic_pm_init(gic);
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index 36ec4ae..9de976b 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -95,8 +95,6 @@
 
 struct device_node;
 
-extern struct irq_chip gic_arch_extn;
-
 void gic_set_irqchip_flags(unsigned long flags);
 void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
u32 offset, struct device_node *);
-- 
2.1.4

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


[PATCH v2 15/21] ARM: exynos4/5: convert pmu wakeup to stacked domains

2015-01-07 Thread Marc Zyngier
Exynos has been (ab)using the gic_arch_extn to provide
wakeup from suspend, and it makes a lot of sense to convert
this code to use stacked domains instead.

This patch does just this, updating the DT files to actually
reflect what the HW provides.

BIG FAT WARNING: because the DTs were so far lying by not
exposing the fact that the PMU block is actually the first
interrupt controller in the chain for RTC, kernels with this patch
applied wont have any suspend-resume facility when booted
with old DTs, and old kernels with updated DTs may not even boot.

Also, I stronly suspect that there is more than two wake-up
interrupts on these platforms, but I leave it to the maintainers
to fix their mess.

Signed-off-by: Marc Zyngier 
---
 arch/arm/boot/dts/exynos4.dtsi|   3 +
 arch/arm/boot/dts/exynos5250.dtsi |   3 +
 arch/arm/boot/dts/exynos5420.dtsi |   3 +
 arch/arm/mach-exynos/exynos.c |  14 ++---
 arch/arm/mach-exynos/suspend.c| 122 ++
 5 files changed, 126 insertions(+), 19 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index b8168f1..adc189f 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -141,6 +141,8 @@
pmu_system_controller: system-controller@1002 {
compatible = "samsung,exynos4210-pmu", "syscon";
reg = <0x1002 0x4000>;
+   interrupt-controller;
+   interrupt-parent = <&gic>;
};
 
dsi_0: dsi@11C8 {
@@ -253,6 +255,7 @@
rtc@1007 {
compatible = "samsung,s3c6410-rtc";
reg = <0x1007 0x100>;
+   interrupt-parent = <&pmu_system_controller>;
interrupts = <0 44 0>, <0 45 0>;
clocks = <&clock CLK_RTC>;
clock-names = "rtc";
diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index 0a229fc..c31007c 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -194,6 +194,8 @@
clock-names = "clkout16";
clocks = <&clock CLK_FIN_PLL>;
#clock-cells = <1>;
+   interrupt-controller;
+   interrupt-parent = <&gic>;
};
 
sysreg_system_controller: syscon@1005 {
@@ -230,6 +232,7 @@
rtc: rtc@101E {
clocks = <&clock CLK_RTC>;
clock-names = "rtc";
+   interrupt-parent = <&pmu_system_controller>;
status = "disabled";
};
 
diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 517e50f..1946c76c 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -309,6 +309,7 @@
rtc: rtc@101E {
clocks = <&clock CLK_RTC>;
clock-names = "rtc";
+   interrupt-parent = <&pmu_system_controller>;
status = "disabled";
};
 
@@ -748,6 +749,8 @@
clock-names = "clkout16";
clocks = <&clock CLK_FIN_PLL>;
#clock-cells = <1>;
+   interrupt-controller;
+   interrupt-parent = <&gic>;
};
 
sysreg_system_controller: syscon@1005 {
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index c13d083..e417fdc 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -175,16 +175,15 @@ static void __init exynos_init_io(void)
exynos_map_io();
 }
 
+/*
+ * Apparently, these SoCs are not able to wake-up from suspend using
+ * the PMU. Too bad. Should they suddenly become capable of such a
+ * feat, the matches below should be moved to suspend.c.
+ */
 static const struct of_device_id exynos_dt_pmu_match[] = {
{ .compatible = "samsung,exynos3250-pmu" },
-   { .compatible = "samsung,exynos4210-pmu" },
-   { .compatible = "samsung,exynos4212-pmu" },
-   { .compatible = "samsung,exynos4412-pmu" },
-   { .compatible = "samsung,exynos4415-pmu" },
-   { .compatible = "samsung,exynos5250-pmu" },
{ .compatible = "samsung,exynos5260-pmu" },
{ .compatible = "samsung,exynos5410-pmu" },
-   { .compatible = "samsung,exynos5420-pmu" },
{ /*sentinel*/ },
 };
 
@@ -195,9 +194,6 @@ static void exynos_map_pmu(void)
np = of_find_matching_node(NULL, exynos_dt_pmu_match);
if (np)
pmu_base_addr = of_iomap(np, 0);
-
-   if (!pmu_base_addr)
-   panic("failed to find exynos pmu register\n");
 }
 
 static void __init exynos_init_irq(void)
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index f8e7dcd..24fc7f8 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -18,7 +18,9 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 
@@ -44,8 +46,8 @@
 #define E

[PATCH v2 02/21] irqchip: tegra: add DT-based support for legacy interrupt controller

2015-01-07 Thread Marc Zyngier
Tegra's LIC (Legacy Interrupt Controller) has been so far only
supported as a weird extension of the GIC, which is not exactly
pretty.

The stacked irq domain framework fits this pretty well, and allows
the LIC code to be turned into a standalone irqchip. In the process,
make the driver DT aware, something that was sorely missing from
the mach-tegra implementation.

Signed-off-by: Marc Zyngier 
---
 drivers/irqchip/Makefile|   1 +
 drivers/irqchip/irq-tegra.c | 335 
 2 files changed, 336 insertions(+)
 create mode 100644 drivers/irqchip/irq-tegra.c

diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
index 9516a32..59f34be 100644
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_ARCH_HIP04)+= irq-hip04.o
 obj-$(CONFIG_ARCH_MMP) += irq-mmp.o
 obj-$(CONFIG_ARCH_MVEBU)   += irq-armada-370-xp.o
 obj-$(CONFIG_ARCH_MXS) += irq-mxs.o
+obj-$(CONFIG_ARCH_TEGRA)   += irq-tegra.o
 obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o
 obj-$(CONFIG_DW_APB_ICTL)  += irq-dw-apb-ictl.o
 obj-$(CONFIG_METAG)+= irq-metag-ext.o
diff --git a/drivers/irqchip/irq-tegra.c b/drivers/irqchip/irq-tegra.c
new file mode 100644
index 000..b4fc2e3
--- /dev/null
+++ b/drivers/irqchip/irq-tegra.c
@@ -0,0 +1,335 @@
+/*
+ * Driver code for Tegra's Legacy Interrupt Controller
+ *
+ * Author: Marc Zyngier 
+ *
+ * Heavily based on the original arch/arm/mach-tegra/irq.c code:
+ * Copyright (C) 2011 Google, Inc.
+ *
+ * Author:
+ * Colin Cross 
+ *
+ * Copyright (C) 2010,2013, NVIDIA Corporation
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "irqchip.h"
+
+#define ICTLR_CPU_IEP_VFIQ 0x08
+#define ICTLR_CPU_IEP_FIR  0x14
+#define ICTLR_CPU_IEP_FIR_SET  0x18
+#define ICTLR_CPU_IEP_FIR_CLR  0x1c
+
+#define ICTLR_CPU_IER  0x20
+#define ICTLR_CPU_IER_SET  0x24
+#define ICTLR_CPU_IER_CLR  0x28
+#define ICTLR_CPU_IEP_CLASS0x2C
+
+#define ICTLR_COP_IER  0x30
+#define ICTLR_COP_IER_SET  0x34
+#define ICTLR_COP_IER_CLR  0x38
+#define ICTLR_COP_IEP_CLASS0x3c
+
+#define TEGRA_MAX_NUM_ICTLRS   5
+
+static int num_ictlrs;
+
+struct tegra_ictlr_info {
+   void __iomem *ictlr_reg_base[TEGRA_MAX_NUM_ICTLRS];
+#ifdef CONFIG_PM_SLEEP
+   u32 cop_ier[TEGRA_MAX_NUM_ICTLRS];
+   u32 cop_iep[TEGRA_MAX_NUM_ICTLRS];
+   u32 cpu_ier[TEGRA_MAX_NUM_ICTLRS];
+   u32 cpu_iep[TEGRA_MAX_NUM_ICTLRS];
+
+   u32 ictlr_wake_mask[TEGRA_MAX_NUM_ICTLRS];
+#endif
+};
+
+static struct tegra_ictlr_info *tegra_ictlr_info;
+
+static inline void tegra_ictlr_write_mask(struct irq_data *d, unsigned long 
reg)
+{
+   void __iomem *base = d->chip_data;
+   u32 mask;
+
+   mask = BIT(d->hwirq % 32);
+   writel_relaxed(mask, base + reg);
+}
+
+static void tegra_mask(struct irq_data *d)
+{
+   tegra_ictlr_write_mask(d, ICTLR_CPU_IER_CLR);
+   irq_chip_mask_parent(d);
+}
+
+static void tegra_unmask(struct irq_data *d)
+{
+   tegra_ictlr_write_mask(d, ICTLR_CPU_IER_SET);
+   irq_chip_unmask_parent(d);
+}
+
+static void tegra_eoi(struct irq_data *d)
+{
+   tegra_ictlr_write_mask(d, ICTLR_CPU_IEP_FIR_CLR);
+   irq_chip_eoi_parent(d);
+}
+
+static int tegra_retrigger(struct irq_data *d)
+{
+   tegra_ictlr_write_mask(d, ICTLR_CPU_IEP_FIR_SET);
+   return irq_chip_retrigger_hierarchy(d);
+}
+
+#ifdef CONFIG_PM_SLEEP
+static int tegra_set_wake(struct irq_data *d, unsigned int enable)
+{
+   u32 irq = d->hwirq;
+   u32 index, mask;
+
+   index = (irq / 32);
+   mask = BIT(irq % 32);
+   if (enable)
+   tegra_ictlr_info->ictlr_wake_mask[index] |= mask;
+   else
+   tegra_ictlr_info->ictlr_wake_mask[index] &= ~mask;
+
+   /*
+* Do *not* call into the parent, as the GIC doesn't have any
+* wake-up facility...
+*/
+   return 0;
+}
+
+static int tegra_ictlr_suspend(void)
+{
+   unsigned long flags;
+   int i;
+
+   local_irq_save(flags);
+   for (i = 0; i < num_ictlrs; i++) {
+   void __iomem *ictlr = tegra_ictlr_info->ictlr_reg_base[i];
+   /* Save interrupt state */
+   tegra_ictlr_info->cpu_ier[i] = readl_relaxed(ictlr + 
ICTLR_CPU_IER);
+   tegra_ictlr_info->cpu_iep[i] = readl_relaxed(ictlr + 
ICTLR_CPU_IEP_CLASS);
+   teg

[PATCH v2 07/21] genirq: Add irqchip_set_wake_parent

2015-01-07 Thread Marc Zyngier
This proves to be usefull with stacked domains, when the current
domain doesn't implement wake-up, but expect the parent to do so.

Signed-off-by: Marc Zyngier 
---
 include/linux/irq.h |  1 +
 kernel/irq/chip.c   | 16 
 2 files changed, 17 insertions(+)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index d09ec7a..3057c48 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -460,6 +460,7 @@ extern void irq_chip_eoi_parent(struct irq_data *data);
 extern int irq_chip_set_affinity_parent(struct irq_data *data,
const struct cpumask *dest,
bool force);
+extern int irq_chip_set_wake_parent(struct irq_data *data, unsigned int on);
 #endif
 
 /* Handling of unhandled and spurious interrupts: */
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 6f1c7a5..eb9a4ea 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -948,6 +948,22 @@ int irq_chip_retrigger_hierarchy(struct irq_data *data)
 
return -ENOSYS;
 }
+
+/**
+ * irq_chip_set_wake_parent - Set/reset wake-up on the parent interrupt
+ * @data:  Pointer to interrupt specific data
+ * @on:Whether to set or reset the wake-up capability of this 
irq
+ *
+ * Conditional, as the underlying parent chip might not implement it.
+ */
+int irq_chip_set_wake_parent(struct irq_data *data, unsigned int on)
+{
+   data = data->parent_data;
+   if (data->chip->irq_set_wake)
+   return data->chip->irq_set_wake(data, on);
+
+   return -ENOSYS;
+}
 #endif
 
 /**
-- 
2.1.4

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


[PATCH v2 08/21] irqchip: crossbar: convert dra7 crossbar to stacked domains

2015-01-07 Thread Marc Zyngier
Support for the TI crossbar used on the DRA7 family of chips
is implemented as an ugly hack on the side of the GIC.

Converting it to stacked domains makes it slightly more
palatable, as it results in a cleanup.

Unfortunately, as the DT bindings failed to acknowledge the
fact that this is actually yet another interrupt controller
(the third, actually), we have yet another breakage. Oh well.

Signed-off-by: Marc Zyngier 
---
 arch/arm/boot/dts/dra7-evm.dts   |   2 +-
 arch/arm/boot/dts/dra7.dtsi  |  35 +++---
 arch/arm/boot/dts/dra72-evm.dts  |   1 -
 arch/arm/boot/dts/dra72x.dtsi|   3 +-
 arch/arm/boot/dts/dra74x.dtsi|   5 +-
 arch/arm/mach-omap2/omap4-common.c   |   4 -
 drivers/irqchip/irq-crossbar.c   | 202 ---
 include/linux/irqchip/irq-crossbar.h |  11 --
 8 files changed, 141 insertions(+), 122 deletions(-)
 delete mode 100644 include/linux/irqchip/irq-crossbar.h

diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index 10b725c..048cfeb 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -423,7 +423,7 @@
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&uart1_pins>;
-   interrupts-extended = <&gic GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
+   interrupts-extended = <&crossbar_mpu GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
  <&dra7_pmx_core 0x3e0>;
 };
 
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 22771bc..59ec0e6 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -13,14 +13,13 @@
 #include "skeleton.dtsi"
 
 #define MAX_SOURCES 400
-#define DIRECT_IRQ(irq) (MAX_SOURCES + irq)
 
 / {
#address-cells = <1>;
#size-cells = <1>;
 
compatible = "ti,dra7xx";
-   interrupt-parent = <&gic>;
+   interrupt-parent = <&crossbar_mpu>;
 
aliases {
i2c0 = &i2c1;
@@ -50,18 +49,19 @@
 ,
 ,
 ;
+   interrupt-parent = <&gic>;
};
 
gic: interrupt-controller@48211000 {
compatible = "arm,cortex-a15-gic";
interrupt-controller;
#interrupt-cells = <3>;
-   arm,routable-irqs = <192>;
reg = <0x48211000 0x1000>,
  <0x48212000 0x1000>,
  <0x48214000 0x2000>,
  <0x48216000 0x2000>;
interrupts = ;
+   interrupt-parent = <&gic>;
};
 
/*
@@ -91,8 +91,8 @@
ti,hwmods = "l3_main_1", "l3_main_2";
reg = <0x4400 0x100>,
  <0x4500 0x1000>;
-   interrupts = ,
-;
+   interrupts-extended = <&crossbar_mpu GIC_SPI 4 
IRQ_TYPE_LEVEL_HIGH>,
+ <&gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
 
prm: prm@4ae06000 {
compatible = "ti,dra7-prm";
@@ -344,7 +344,7 @@
uart1: serial@4806a000 {
compatible = "ti,omap4-uart";
reg = <0x4806a000 0x100>;
-   interrupts-extended = <&gic GIC_SPI 67 
IRQ_TYPE_LEVEL_HIGH>;
+   interrupts = ;
ti,hwmods = "uart1";
clock-frequency = <4800>;
status = "disabled";
@@ -355,7 +355,7 @@
uart2: serial@4806c000 {
compatible = "ti,omap4-uart";
reg = <0x4806c000 0x100>;
-   interrupts-extended = <&gic GIC_SPI 68 
IRQ_TYPE_LEVEL_HIGH>;
+   interrupts = ;
ti,hwmods = "uart2";
clock-frequency = <4800>;
status = "disabled";
@@ -366,7 +366,7 @@
uart3: serial@4802 {
compatible = "ti,omap4-uart";
reg = <0x4802 0x100>;
-   interrupts-extended = <&gic GIC_SPI 69 
IRQ_TYPE_LEVEL_HIGH>;
+   interrupts = ;
ti,hwmods = "uart3";
clock-frequency = <4800>;
status = "disabled";
@@ -377,7 +377,7 @@
uart4: serial@4806e000 {
compatible = "ti,omap4-uart";
reg = <0x4806e000 0x100>;
-   interrupts-extended = <&gic GIC_SPI 65 
IRQ_TYPE_LEVEL_HIGH>;
+   interrupts = ;
ti,hwmods = "uart4";
clock-frequency = <4800>;
 status = "disabled";
@@ -388,7 +388,7 @@
uart5: serial@48066000 {
compatible = "ti,omap4-uart";
reg = <0x48066000 0x

[PATCH v2 05/21] DT: tegra: add binding for the legacy interrupt controller

2015-01-07 Thread Marc Zyngier
Signed-off-by: Marc Zyngier 
---
 .../interrupt-controller/nvidia,tegra-ictlr.txt| 39 ++
 1 file changed, 39 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra-ictlr.txt

diff --git 
a/Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra-ictlr.txt 
b/Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra-ictlr.txt
new file mode 100644
index 000..44fd873
--- /dev/null
+++ 
b/Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra-ictlr.txt
@@ -0,0 +1,39 @@
+NVIDIA Legacy Interrupt Controller
+
+All Tegra SoCs contain a legacy interrupt controller that routes
+interrupts to the GIC, and also serves as a wakeup source. It is also
+refered to as "ictlr", hence the name of the binding.
+
+The HW block exposes a number of frames, each implementing a set of 32
+interrupts.
+
+Reguired properties:
+
+- compatible : should contain at least "nvidia,tegra-ictlr".
+- reg : Specifies base physical address and size of the registers.
+  Each frame must be described separately.
+- interrupt-controller : Identifies the node as an interrupt controller.
+- #interrupt-cells : Specifies the number of cells needed to encode an
+  interrupt source. The value must be 3.
+- interrupt-parent : a phandle to the GIC these interrupts are routed
+  to.
+
+Notes:
+
+- Because this HW ultimately routes interrupts to the GIC, the
+  interrupt specifier must be that of the GIC.
+- Only SPIs can use the ictlr as an interrupt parent. SGIs and PPIs
+  are explicitely forbiden.
+
+Example:
+
+   ictlr: interrupt-controller@60004000 {
+   compatible = "nvidia,tegra20-ictlr", "nvidia,tegra-ictlr";
+   reg = <0x60004000 64>,
+ <0x60004100 64>,
+ <0x60004200 64>,
+ <0x60004300 64>;
+   interrupt-controller;
+   #interrupt-cells = <3>;
+   interrupt-parent = <&intc>;
+   };
-- 
2.1.4

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


[PATCH v2 09/21] DT: update ti,irq-crossbar binding

2015-01-07 Thread Marc Zyngier
Make it look like a real interrupt controller.

Signed-off-by: Marc Zyngier 
---
 .../devicetree/bindings/arm/omap/crossbar.txt  | 18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/omap/crossbar.txt 
b/Documentation/devicetree/bindings/arm/omap/crossbar.txt
index 4139db3..a9b28d7 100644
--- a/Documentation/devicetree/bindings/arm/omap/crossbar.txt
+++ b/Documentation/devicetree/bindings/arm/omap/crossbar.txt
@@ -9,7 +9,9 @@ inputs.
 Required properties:
 - compatible : Should be "ti,irq-crossbar"
 - reg: Base address and the size of the crossbar registers.
-- ti,max-irqs: Total number of irqs available at the interrupt controller.
+- interrupt-controller: indicates that this block is an interrupt controller.
+- interrupt-parent: the interrupt controller this block is connected to.
+- ti,max-irqs: Total number of irqs available at the parent interrupt 
controller.
 - ti,max-crossbar-sources: Maximum number of crossbar sources that can be 
routed.
 - ti,reg-size: Size of a individual register in bytes. Every individual
register is assumed to be of same size. Valid sizes are 1, 2, 4.
@@ -27,13 +29,13 @@ Optional properties:
   when the interrupt controller irq is unused (when not provided, default is 0)
 
 Examples:
-   crossbar_mpu: @4a02 {
+   crossbar_mpu: crossbar@4a002a48 {
compatible = "ti,irq-crossbar";
reg = <0x4a002a48 0x130>;
ti,max-irqs = <160>;
ti,max-crossbar-sources = <400>;
ti,reg-size = <2>;
-   ti,irqs-reserved = <0 1 2 3 5 6 131 132 139 140>;
+   ti,irqs-reserved = <0 1 2 3 5 6 131 132>;
ti,irqs-skip = <10 133 139 140>;
};
 
@@ -44,10 +46,6 @@ Documentation/devicetree/bindings/arm/gic.txt for further 
details.
 
 An interrupt consumer on an SoC using crossbar will use:
interrupts = 
-When the request number is between 0 to that described by
-"ti,max-crossbar-sources", it is assumed to be a crossbar mapping. If the
-request_number is greater than "ti,max-crossbar-sources", then it is mapped as 
a
-quirky hardware mapping direct to GIC.
 
 Example:
device_x@0x4a023000 {
@@ -55,9 +53,3 @@ Example:
interrupts = ;
...
};
-
-   device_y@0x4a033000 {
-   /* Direct mapped GIC SPI 1 used */
-   interrupts = ;
-   ...
-   };
-- 
2.1.4

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


[PATCH v2 04/21] ARM: tegra: update DTs to expose legacy interrupt controller

2015-01-07 Thread Marc Zyngier
Describe the legacy interrupt controller in every tegra DTSI files,
and make it the parent of most interrupts.

Signed-off-by: Marc Zyngier 
---
 arch/arm/boot/dts/tegra114.dtsi | 16 +++-
 arch/arm/boot/dts/tegra124.dtsi | 16 +++-
 arch/arm/boot/dts/tegra20.dtsi  | 15 ++-
 arch/arm/boot/dts/tegra30.dtsi  | 16 +++-
 4 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
index 4296b53..f70bed0 100644
--- a/arch/arm/boot/dts/tegra114.dtsi
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -8,7 +8,7 @@
 
 / {
compatible = "nvidia,tegra114";
-   interrupt-parent = <&gic>;
+   interrupt-parent = <&ictlr>;
 
host1x@5000 {
compatible = "nvidia,tegra114-host1x", "simple-bus";
@@ -134,6 +134,19 @@
  <0x50046000 0x2000>;
interrupts = ;
+   interrupt-parent = <&gic>;
+   };
+
+   ictlr: interrupt-controller@60004000 {
+   compatible = "nvidia,tegra114-ictlr", "nvidia,tegra-ictlr";
+   reg = <0x60004000 64>,
+ <0x60004100 64>,
+ <0x60004200 64>,
+ <0x60004300 64>,
+ <0x60004400 64>;
+   interrupt-controller;
+   #interrupt-cells = <3>;
+   interrupt-parent = <&gic>;
};
 
timer@60005000 {
@@ -766,5 +779,6 @@
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
;
+   interrupt-parent = <&gic>;
};
 };
diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
index 4be06c6..6ed6ca0 100644
--- a/arch/arm/boot/dts/tegra124.dtsi
+++ b/arch/arm/boot/dts/tegra124.dtsi
@@ -10,7 +10,7 @@
 
 / {
compatible = "nvidia,tegra124";
-   interrupt-parent = <&gic>;
+   interrupt-parent = <&ictlr>;
#address-cells = <2>;
#size-cells = <2>;
 
@@ -173,6 +173,7 @@
  <0x0 0x50046000 0x0 0x2000>;
interrupts = ;
+   interrupt-parent = <&gic>;
};
 
gpu@0,5700 {
@@ -190,6 +191,18 @@
status = "disabled";
};
 
+   ictlr: interrupt-controller@60004000 {
+   compatible = "nvidia,tegra124-ictlr", "nvidia,tegra-ictlr";
+   reg = <0x0 0x60004000 0x0 0x40>,
+ <0x0 0x60004100 0x0 0x40>,
+ <0x0 0x60004200 0x0 0x40>,
+ <0x0 0x60004300 0x0 0x40>,
+ <0x0 0x60004400 0x0 0x40>;
+   interrupt-controller;
+   #interrupt-cells = <3>;
+   interrupt-parent = <&gic>;
+   };
+
timer@0,60005000 {
compatible = "nvidia,tegra124-timer", "nvidia,tegra20-timer";
reg = <0x0 0x60005000 0x0 0x400>;
@@ -955,5 +968,6 @@
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
 ;
+   interrupt-parent = <&gic>;
};
 };
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 8acf5d8..ab2f004 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -7,7 +7,7 @@
 
 / {
compatible = "nvidia,tegra20";
-   interrupt-parent = <&intc>;
+   interrupt-parent = <&ictlr>;
 
host1x@5000 {
compatible = "nvidia,tegra20-host1x", "simple-bus";
@@ -142,6 +142,7 @@
 
timer@50004600 {
compatible = "arm,cortex-a9-twd-timer";
+   interrupt-parent = <&intc>;
reg = <0x50040600 0x20>;
interrupts = ;
@@ -154,6 +155,7 @@
   0x50040100 0x0100>;
interrupt-controller;
#interrupt-cells = <3>;
+   interrupt-parent = <&intc>;
};
 
cache-controller@50043000 {
@@ -165,6 +167,17 @@
cache-level = <2>;
};
 
+   ictlr: interrupt-controller@60004000 {
+   compatible = "nvidia,tegra20-ictlr", "nvidia,tegra-ictlr";
+   reg = <0x60004000 64>,
+ <0x60004100 64>,
+ <0x60004200 64>,
+ <0x60004300 64>;
+   interrupt-controller;
+   #interrupt-cells = <3>;
+   interrupt-parent = <&intc>;
+   };
+
timer@60005000 {
compatible = "nvidia,tegra20-timer";
reg = <0x60005000 0x60>;
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index 99475f6..c621e30 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -8,7 +8,7 @@
 
 / {
compatible = "nvidia,tegra30";
-   interrupt-parent = <&intc>;
+   interrupt-parent = <&ictlr>;
 
pcie-controller@3000 {
compatible = "nvidia,tegra30-pcie";
@@

[PATCH v2 10/21] irqchip: GIC: get rid of routable domain

2015-01-07 Thread Marc Zyngier
The only user of the so called "routable domain" functionnality
now being fixed, let's clean up the GIC.

Signed-off-by: Marc Zyngier 
---
 drivers/irqchip/irq-gic.c   | 59 -
 include/linux/irqchip/arm-gic.h |  6 -
 2 files changed, 5 insertions(+), 60 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index d617ee5..9c30a76 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -795,15 +795,12 @@ static int gic_irq_domain_map(struct irq_domain *d, 
unsigned int irq,
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_fasteoi_irq, NULL, NULL);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-
-   gic_routable_irq_domain_ops->map(d, irq, hw);
}
return 0;
 }
 
 static void gic_irq_domain_unmap(struct irq_domain *d, unsigned int irq)
 {
-   gic_routable_irq_domain_ops->unmap(d, irq);
 }
 
 static int gic_irq_domain_xlate(struct irq_domain *d,
@@ -822,16 +819,8 @@ static int gic_irq_domain_xlate(struct irq_domain *d,
*out_hwirq = intspec[1] + 16;
 
/* For SPIs, we need to add 16 more to get the GIC irq ID number */
-   if (!intspec[0]) {
-   ret = gic_routable_irq_domain_ops->xlate(d, controller,
-intspec,
-intsize,
-out_hwirq,
-out_type);
-
-   if (IS_ERR_VALUE(ret))
-   return ret;
-   }
+   if (!intspec[0])
+   *out_hwirq += 16;
 
*out_type = intspec[2] & IRQ_TYPE_SENSE_MASK;
 
@@ -888,37 +877,6 @@ static const struct irq_domain_ops gic_irq_domain_ops = {
.xlate = gic_irq_domain_xlate,
 };
 
-/* Default functions for routable irq domain */
-static int gic_routable_irq_domain_map(struct irq_domain *d, unsigned int irq,
- irq_hw_number_t hw)
-{
-   return 0;
-}
-
-static void gic_routable_irq_domain_unmap(struct irq_domain *d,
- unsigned int irq)
-{
-}
-
-static int gic_routable_irq_domain_xlate(struct irq_domain *d,
-   struct device_node *controller,
-   const u32 *intspec, unsigned int intsize,
-   unsigned long *out_hwirq,
-   unsigned int *out_type)
-{
-   *out_hwirq += 16;
-   return 0;
-}
-
-static const struct irq_domain_ops gic_default_routable_irq_domain_ops = {
-   .map = gic_routable_irq_domain_map,
-   .unmap = gic_routable_irq_domain_unmap,
-   .xlate = gic_routable_irq_domain_xlate,
-};
-
-const struct irq_domain_ops *gic_routable_irq_domain_ops =
-   &gic_default_routable_irq_domain_ops;
-
 void __init gic_init_bases(unsigned int gic_nr, int irq_start,
   void __iomem *dist_base, void __iomem *cpu_base,
   u32 percpu_offset, struct device_node *node)
@@ -926,7 +884,6 @@ void __init gic_init_bases(unsigned int gic_nr, int 
irq_start,
irq_hw_number_t hwirq_base;
struct gic_chip_data *gic;
int gic_irqs, irq_base, i;
-   int nr_routable_irqs;
 
BUG_ON(gic_nr >= MAX_GIC_NR);
 
@@ -982,15 +939,9 @@ void __init gic_init_bases(unsigned int gic_nr, int 
irq_start,
gic->gic_irqs = gic_irqs;
 
if (node) { /* DT case */
-   const struct irq_domain_ops *ops = 
&gic_irq_domain_hierarchy_ops;
-
-   if (!of_property_read_u32(node, "arm,routable-irqs",
- &nr_routable_irqs)) {
-   ops = &gic_irq_domain_ops;
-   gic_irqs = nr_routable_irqs;
-   }
-
-   gic->domain = irq_domain_add_linear(node, gic_irqs, ops, gic);
+   gic->domain = irq_domain_add_linear(node, gic_irqs,
+   
&gic_irq_domain_hierarchy_ops,
+   gic);
} else {/* Non-DT case */
/*
 * For primary GICs, skip over SGIs.
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index 71d706d..3978c5b 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -115,11 +115,5 @@ int gic_get_cpu_id(unsigned int cpu);
 void gic_migrate_target(unsigned int new_cpu_id);
 unsigned long gic_get_sgir_physaddr(void);
 
-extern const struct irq_domain_ops *gic_routable_irq_domain_ops;
-static inline void __init register_routable_domain_ops
-   (const struct irq_domain_ops *ops)
-{
-   gic_routable_irq_domain_ops = ops;
-}
 #endi

[PATCH v2 06/21] ARM: tegra: remove old LIC support

2015-01-07 Thread Marc Zyngier
Now that all DTs have been updated, entierely drop support for
the non-DT code.

This is likely to break platforms that do not update their DT,
so print a warning at boot time.

Signed-off-by: Marc Zyngier 
---
 arch/arm/mach-tegra/iomap.h |  15 
 arch/arm/mach-tegra/irq.c   | 201 +---
 arch/arm/mach-tegra/irq.h   |   6 --
 3 files changed, 2 insertions(+), 220 deletions(-)

diff --git a/arch/arm/mach-tegra/iomap.h b/arch/arm/mach-tegra/iomap.h
index ee79808..81dc950 100644
--- a/arch/arm/mach-tegra/iomap.h
+++ b/arch/arm/mach-tegra/iomap.h
@@ -31,21 +31,6 @@
 #define TEGRA_ARM_INT_DIST_BASE0x50041000
 #define TEGRA_ARM_INT_DIST_SIZESZ_4K
 
-#define TEGRA_PRIMARY_ICTLR_BASE   0x60004000
-#define TEGRA_PRIMARY_ICTLR_SIZE   SZ_64
-
-#define TEGRA_SECONDARY_ICTLR_BASE 0x60004100
-#define TEGRA_SECONDARY_ICTLR_SIZE SZ_64
-
-#define TEGRA_TERTIARY_ICTLR_BASE  0x60004200
-#define TEGRA_TERTIARY_ICTLR_SIZE  SZ_64
-
-#define TEGRA_QUATERNARY_ICTLR_BASE0x60004300
-#define TEGRA_QUATERNARY_ICTLR_SIZESZ_64
-
-#define TEGRA_QUINARY_ICTLR_BASE   0x60004400
-#define TEGRA_QUINARY_ICTLR_SIZE   SZ_64
-
 #define TEGRA_TMR1_BASE0x60005000
 #define TEGRA_TMR1_SIZESZ_8
 
diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index b37141d..a1befd3 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -30,43 +30,9 @@
 #include "board.h"
 #include "iomap.h"
 
-#define ICTLR_CPU_IEP_VFIQ 0x08
-#define ICTLR_CPU_IEP_FIR  0x14
-#define ICTLR_CPU_IEP_FIR_SET  0x18
-#define ICTLR_CPU_IEP_FIR_CLR  0x1c
-
-#define ICTLR_CPU_IER  0x20
-#define ICTLR_CPU_IER_SET  0x24
-#define ICTLR_CPU_IER_CLR  0x28
-#define ICTLR_CPU_IEP_CLASS0x2C
-
-#define ICTLR_COP_IER  0x30
-#define ICTLR_COP_IER_SET  0x34
-#define ICTLR_COP_IER_CLR  0x38
-#define ICTLR_COP_IEP_CLASS0x3c
-
-#define FIRST_LEGACY_IRQ 32
-#define TEGRA_MAX_NUM_ICTLRS   5
-
 #define SGI_MASK 0x
 
-static int num_ictlrs;
-
-static void __iomem *ictlr_reg_base[] = {
-   IO_ADDRESS(TEGRA_PRIMARY_ICTLR_BASE),
-   IO_ADDRESS(TEGRA_SECONDARY_ICTLR_BASE),
-   IO_ADDRESS(TEGRA_TERTIARY_ICTLR_BASE),
-   IO_ADDRESS(TEGRA_QUATERNARY_ICTLR_BASE),
-   IO_ADDRESS(TEGRA_QUINARY_ICTLR_BASE),
-};
-
 #ifdef CONFIG_PM_SLEEP
-static u32 cop_ier[TEGRA_MAX_NUM_ICTLRS];
-static u32 cop_iep[TEGRA_MAX_NUM_ICTLRS];
-static u32 cpu_ier[TEGRA_MAX_NUM_ICTLRS];
-static u32 cpu_iep[TEGRA_MAX_NUM_ICTLRS];
-
-static u32 ictlr_wake_mask[TEGRA_MAX_NUM_ICTLRS];
 static void __iomem *tegra_gic_cpu_base;
 #endif
 
@@ -83,140 +49,7 @@ bool tegra_pending_sgi(void)
return false;
 }
 
-static inline void tegra_irq_write_mask(unsigned int irq, unsigned long reg)
-{
-   void __iomem *base;
-   u32 mask;
-
-   BUG_ON(irq < FIRST_LEGACY_IRQ ||
-   irq >= FIRST_LEGACY_IRQ + num_ictlrs * 32);
-
-   base = ictlr_reg_base[(irq - FIRST_LEGACY_IRQ) / 32];
-   mask = BIT((irq - FIRST_LEGACY_IRQ) % 32);
-
-   __raw_writel(mask, base + reg);
-}
-
-static void tegra_mask(struct irq_data *d)
-{
-   if (d->hwirq < FIRST_LEGACY_IRQ)
-   return;
-
-   tegra_irq_write_mask(d->hwirq, ICTLR_CPU_IER_CLR);
-}
-
-static void tegra_unmask(struct irq_data *d)
-{
-   if (d->hwirq < FIRST_LEGACY_IRQ)
-   return;
-
-   tegra_irq_write_mask(d->hwirq, ICTLR_CPU_IER_SET);
-}
-
-static void tegra_ack(struct irq_data *d)
-{
-   if (d->hwirq < FIRST_LEGACY_IRQ)
-   return;
-
-   tegra_irq_write_mask(d->hwirq, ICTLR_CPU_IEP_FIR_CLR);
-}
-
-static void tegra_eoi(struct irq_data *d)
-{
-   if (d->hwirq < FIRST_LEGACY_IRQ)
-   return;
-
-   tegra_irq_write_mask(d->hwirq, ICTLR_CPU_IEP_FIR_CLR);
-}
-
-static int tegra_retrigger(struct irq_data *d)
-{
-   if (d->hwirq < FIRST_LEGACY_IRQ)
-   return 0;
-
-   tegra_irq_write_mask(d->hwirq, ICTLR_CPU_IEP_FIR_SET);
-
-   return 1;
-}
-
 #ifdef CONFIG_PM_SLEEP
-static int tegra_set_wake(struct irq_data *d, unsigned int enable)
-{
-   u32 irq = d->hwirq;
-   u32 index, mask;
-
-   if (irq < FIRST_LEGACY_IRQ ||
-   irq >= FIRST_LEGACY_IRQ + num_ictlrs * 32)
-   return -EINVAL;
-
-   index = ((irq - FIRST_LEGACY_IRQ) / 32);
-   mask = BIT((irq - FIRST_LEGACY_IRQ) % 32);
-   if (enable)
-   ictlr_wake_mask[index] |= mask;
-   else
-   ictlr_wake_mask[index] &= ~mask;
-
-   return 0;
-}
-
-static int tegra_legacy_irq_suspend(void)
-{
-   unsigned long flags;
-   int i;
-
-   local_irq_save(flags);
-   for (i = 0; i < num_ictlrs; i++) {
-   void __iomem *ictlr = ictlr_reg_base[i];
-   /* Save interrupt state */
-   cpu_ier[i] = readl_relaxed(ictlr + ICTLR_CPU_IER);
-   cpu_iep[

[PATCH v2 00/21] irqchip: gic: killing gic_arch_extn and co, slowly

2015-01-07 Thread Marc Zyngier
The gic_arch_extn hack that a number of platform use has been nagging
me for too long. It is only there for the benefit of a few platform,
and yet it impacts all GIC users. Moreover, it gives people the wrong
idea ("let's use it to put some new custom hack in there"...).

But now that stacked irq domains have landed in -next, the time has
come for gic_arch_extn to meet the Big Bit Bucket.

This patch series takes several steps towards the elimination of
gic_arch_extn:

- moves Tegra's legacy interrupt controller support to
  drivers/irqchip, implementing a stacked domain on top of the
  standard GIC.

- OMAP, imx6 and exynos are also converted to stacked domains, but
  their implementation is left in place (the code is far too
  intricately mixed with other details of the platform for me to even
  try to move it). Some OMAP variants get a special treatment as we
  also kill the crossbar horror (more on that below).

- shmobile, ux500 and zynq are only slightly modified.

- The GIC itself is cleaned up, and some other bits and bobs are
  adjusted for a good measure.

About the TI crossbar:

- The allocation of interrupts in this domain is fairly similar to
  what we do for MSI (see the GICv2m driver), and stacked domains have
  proved to be a fitting solution.

- The current description in DT is currently entierely inaccurate, and
  as we already broke it for the OMAP WUGEN block, we might as well do
  it again for the TI crossbar.

- The way crossbar, WUGEN and GIC interract is quite complex (this is
  effectively a stack of three interrupt controllers with interesting
  exceptions and braindead routing), and stacked domains are the right
  abstraction for that.

- Other platforms (Freescale Vybrid) are starting to come up with the
  same type of things, and it'd be good to avoid them following the
  same broken model.

- It removes a few lines from the code base so it can't completely be
  a bad idea!

So this patch series does exactly that: make the crossbar a stacked
interrupt controller that only takes care of setting up the routing,
fix the DTs to represent the actual HW, and remove a bit of the
craziness from the GIC code.

It is worth realizing that:

- I haven't been able to test this as much as I would have wanted to
  (it's only been tested on tegra2 and omap5).

- I've created DT bindings when needed, updated existing ones, but I
  haven't created a binding for platforms that already used an
  undocumented one (imx6, I'm looking at you).

- I've relaxed quite a bit of the locking in the GIC code. I believe
  this is safe, but someone else should give it a long hard look.

- This actively *breaks* existing setups. Once you boot a new kernel
  with an old DT, suspend/resume *will* be broken. Old kernels on a
  new DT won't even boot! You've been warned. This really outline the
  necessity of actually describing the HW in device trees...

As for the patches, they are on top of 3.19-rc3.

I've pushed the code to:
git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git 
irq/die-gic-arch-extn-die-die-die

Comments welcome,

 M.

Marc Zyngier (21):
  ARM: tegra: irq: nuke leftovers from non-DT support
  irqchip: tegra: add DT-based support for legacy interrupt controller
  ARM: tegra: skip gic_arch_extn setup if DT has a LIC node
  ARM: tegra: update DTs to expose legacy interrupt controller
  DT: tegra: add binding for the legacy interrupt controller
  ARM: tegra: remove old LIC support
  genirq: Add irqchip_set_wake_parent
  irqchip: crossbar: convert dra7 crossbar to stacked domains
  DT: update ti,irq-crossbar binding
  irqchip: GIC: get rid of routable domain
  DT: arm,gic: kill arm,routable-irqs
  ARM: omap: convert wakeupgen to stacked domains
  DT: omap4/5: add binding for the wake-up generator
  ARM: imx6: convert GPC to stacked domains
  ARM: exynos4/5: convert pmu wakeup to stacked domains
  DT: exynos: update PMU binding
  irqchip: gic: add an entry point to set up irqchip flags
  ARM: shmobile: remove use of gic_arch_extn.irq_set_wake
  ARM: ux500: switch from gic_arch_extn to gic_set_irqchip_flags
  ARM: zynq: switch from gic_arch_extn to gic_set_irqchip_flags
  irqchip: gic: Drop support for gic_arch_extn

 Documentation/devicetree/bindings/arm/gic.txt  |   6 -
 .../devicetree/bindings/arm/omap/crossbar.txt  |  18 +-
 .../devicetree/bindings/arm/samsung/pmu.txt|  13 +
 .../interrupt-controller/nvidia,tegra-ictlr.txt|  39 +++
 .../interrupt-controller/ti,omap4-wugen-mpu|  32 ++
 arch/arm/boot/dts/am4372.dtsi  |  11 +-
 arch/arm/boot/dts/dra7-evm.dts |   2 +-
 arch/arm/boot/dts/dra7.dtsi|  43 ++-
 arch/arm/boot/dts/dra72-evm.dts|   1 -
 arch/arm/boot/dts/dra72x.dtsi  |   3 +-
 arch/arm/boot/dts/dra74x.dtsi  |   5 +-
 arch/arm/boot/dts/exynos4.dtsi |   3 +
 arch/arm/boot/dts/exynos5250.dtsi

[PATCH v2 03/21] ARM: tegra: skip gic_arch_extn setup if DT has a LIC node

2015-01-07 Thread Marc Zyngier
If we detect that our DT has a LIC node, don't setup gic_arch_extn,
and skip tegra_legacy_irq_syscore_init as well.

This is only a temporary measure until that code is removed for good.

Signed-off-by: Marc Zyngier 
---
 arch/arm/mach-tegra/irq.c   | 11 +++
 arch/arm/mach-tegra/tegra.c |  1 -
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index 7f87a50..b37141d 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -255,11 +255,21 @@ static void tegra114_gic_cpu_pm_registration(void)
 static void tegra114_gic_cpu_pm_registration(void) { }
 #endif
 
+static const struct of_device_id tegra_ictlr_match[] __initconst = {
+   { .compatible = "nvidia,tegra-ictlr" },
+   { }
+};
+
 void __init tegra_init_irq(void)
 {
int i;
void __iomem *distbase;
 
+   if (of_find_matching_node(NULL, tegra_ictlr_match))
+   goto skip_extn_setup;
+
+   tegra_legacy_irq_syscore_init();
+
distbase = IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE);
num_ictlrs = readl_relaxed(distbase + GIC_DIST_CTR) & 0x1f;
 
@@ -283,5 +293,6 @@ void __init tegra_init_irq(void)
gic_arch_extn.irq_set_wake = tegra_set_wake;
gic_arch_extn.flags = IRQCHIP_MASK_ON_SUSPEND;
 
+skip_extn_setup:
tegra114_gic_cpu_pm_registration();
 }
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index ef016af..c33fba7 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -82,7 +82,6 @@ static void __init tegra_dt_init_irq(void)
 {
tegra_init_irq();
irqchip_init();
-   tegra_legacy_irq_syscore_init();
 }
 
 static void __init tegra_dt_init(void)
-- 
2.1.4

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


[PATCH v2 01/21] ARM: tegra: irq: nuke leftovers from non-DT support

2015-01-07 Thread Marc Zyngier
The GIC is now always initialized from DT on tegra, and there is
no point in keeping non-DT init code.

Signed-off-by: Marc Zyngier 
---
 arch/arm/mach-tegra/irq.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index ab95f53..7f87a50 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -283,13 +283,5 @@ void __init tegra_init_irq(void)
gic_arch_extn.irq_set_wake = tegra_set_wake;
gic_arch_extn.flags = IRQCHIP_MASK_ON_SUSPEND;
 
-   /*
-* Check if there is a devicetree present, since the GIC will be
-* initialized elsewhere under DT.
-*/
-   if (!of_have_populated_dt())
-   gic_init(0, 29, distbase,
-   IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
-
tegra114_gic_cpu_pm_registration();
 }
-- 
2.1.4

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


Re: [PATCH v12 0/9] Enable L2 cache support on Exynos4210/4x12 SoCs

2015-01-07 Thread Nishanth Menon
On 01/07/2015 05:30 AM, Marek Szyprowski wrote:
> This is an updated patchset, which intends to add support for L2 cache
> on Exynos4 SoCs on boards running under secure firmware, which requires
> certain initialization steps to be done with help of firmware, as
> selected registers are writable only from secure mode.
> 
> First patch updates Omap2+ platforms by moving l2cache initialization to
> common code. This will resolve too early call to l2cache init, what might
> cause kmalloc failure in code added in next patches.
> 
> Next patch fixes access method to latency and filter settings in l2cache
> driver.
> 
> Next four patches extend existing support for secure write in L2C driver
> to account for design of secure firmware running on Exynos. Namely:
>  1) direct read access to certain registers is needed on Exynos, because
> secure firmware calls set several registers at once,
>  2) not all boards are running secure firmware, so .write_sec callback
> needs to be installed in Exynos firmware ops initialization code,
>  3) write access to {DATA,TAG}_LATENCY_CTRL registers fron non-secure world
> is not allowed and so must use l2c_write_sec as well,
>  4) on certain boards, default value of prefetch register is incorrect
> and must be overridden at L2C initialization.
> For boards running with firmware that provides access to individual
> L2C registers this series should introduce no functional changes. However
> since the driver is widely used on other platforms I'd like to kindly ask
> any interested people for testing.
> 
> Further three patches add implementation of .write_sec and .configure
> callbacks for Exynos secure firmware and necessary DT nodes to enable
> L2 cache.
> 
> Changes in this version tested on Exynos4412-based TRATS2 and OdroidU3+
> boards (both with secure firmware). There should be no functional change
> for Exynos boards running without secure firmware. OMAP based platforms
> were tested by Nishanth Menon and Tony Lindgren.
> 
> Depends on:
> - v3.19-rc2
> 
> Changelog:
> 
> Changes since v11:
> (https://lkml.org/lkml/2015/1/5/254)
> - Added changes suggested by Nishanth to 'ARM: l2c: use l2c_write_sec()
>   for restoring latency and filter regs' patch
> - Fixed 'checkpatch --strict' issues
> - Added Nishanth's and Tony's acked/tested tags
> 
> Changes since v10:
> (https://lkml.org/lkml/2014/12/23/151)
> - Added patch, which fixes access method to latency and filter settings
>   in l2cache
> 
> Changes since v9:
> (https://lkml.org/lkml/2014/11/17/217)
> - Rebased onto vanilla v3.19-rc1
> - Added patch for Omap2+ (move l2cache initialization to common code), what
>   fixes too early initialization (kmalloc failure)
> 
> Changes since v8:
> (http://lkml.org/lkml/2014/11/13/263)
> - Rebased onto vanilla v3.18-rc3 and added required includes, which were
>   previously added by other patches
> - Added Acked-by tags for Exynos part
> 
> Changes since v7:
> (https://lkml.org/lkml/2014/10/29/158)
> - rebased onto arm-soc/for-next kernel tree (depends on patches merged to
>   v3.18-rc3 and arm-soc/samsung/pm2 branch)
> - removed 'ARM: l2c: unify L2C-310 OF initialization error messages' patch
>   (no longer needed)
> 
> Changes since v6:
> (https://lkml.org/lkml/2014/10/27/233)
> - changed PL310 to L2C-310 prefix in error messages
> - added patch shortening the error message about incorrect associativity
> 
> Changes since v5:
> (https://lkml.org/lkml/2014/9/24/364)
> - rebased onto v3.18-rc2
> - added error message about missing properties values
> 
> Changes since v4:
> (https://lkml.org/lkml/2014/8/26/461)
>  - rewrote the code accessing l2x0_saved_regs from assembly code
>  - added comment and reworked unconditional call to SMC_CMD_L2X0INVALL
> 
> 
> Patch summary:
> 
> Marek Szyprowski (2):
>   ARM: OMAP2+: use common l2cache initialization code
>   ARM: l2c: use l2c_write_sec() for restoring latency and filter regs
> 
> Tomasz Figa (7):
>   ARM: l2c: Refactor the driver to use commit-like interface
>   ARM: l2c: Add interface to ask hypervisor to configure L2C
>   ARM: l2c: Get outer cache .write_sec callback from mach_desc only if
> not NULL
>   ARM: l2c: Add support for overriding prefetch settings
>   ARM: EXYNOS: Add .write_sec outer cache callback for L2C-310
>   ARM: EXYNOS: Add support for non-secure L2X0 resume
>   ARM: dts: exynos4: Add nodes for L2 cache controller
> 
>  Documentation/devicetree/bindings/arm/l2cc.txt |  10 +
>  arch/arm/boot/dts/exynos4210.dtsi  |   9 +
>  arch/arm/boot/dts/exynos4x12.dtsi  |  14 ++
>  arch/arm/include/asm/outercache.h  |   3 +
>  arch/arm/kernel/irq.c  |   3 +-
>  arch/arm/mach-exynos/firmware.c|  50 +
>  arch/arm/mach-exynos/sleep.S   |  46 +
>  arch/arm/mach-omap2/board-generic.c|   6 +
>  arch/arm/mach-omap2/common.h   |   8 +
>  arch/arm/mach-omap2/omap4-common.c |  16 +-
> 

Re: [PATCH v11 1/9] ARM: OMAP2+: use common l2cache initialization code

2015-01-07 Thread Tomasz Figa
2015-01-06 5:25 GMT+09:00 Arnd Bergmann :
> On Monday 05 January 2015 13:19:00 Marek Szyprowski wrote:
>>  DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
>> +   .l2c_aux_val= OMAP_L2C_AUX_CTRL,
>> +   .l2c_aux_mask   = 0xcf9f,
>> +   .l2c_write_sec  = omap4_l2c310_write_sec,
>> .reserve= omap_reserve,
>> .smp= smp_ops(omap4_smp_ops),
>> .map_io = omap4_map_io,
>>
>
> Could we also get those values into the dts files? Clearly we
> can't remove them here without breaking compatibility with old
> dtbs, but it would be nice to have all new dtbs do the right thing.

Sounds like a good next step after merging this series. :)

Best regards,
Tomasz
--
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_defconfig: Enable CONFIG_LOCKUP_DETECTOR

2015-01-07 Thread Krzysztof Kozlowski
On śro, 2015-01-07 at 13:56 +, Anand Moon wrote:
> Hi Kszysztof Kozlowski,
> 
> I picked up the bellow line from 
> 
> 
> Documentation/locking/lockdep-design.txt  line no 18
> 
> I understand that by enabling this flag we could detect possible 
> 
> deadlock situation with the kernel. Sorry for the noise.

...and lockdep-design.txt describes LOCKDEP. Not LOCKUP. So why you are
enabling lockup?

Best regards,
Krzysztof

> 
> 
> -Anand Moon
> 
> 
> 
> On Wednesday, January 7, 2015 6:57 PM, Krzysztof Kozlowski 
>  wrote:
> On śro, 2015-01-07 at 18:29 +0530, Anand Moon wrote:
> > Enable CONFIG_LOCKUP_DETECTOR to validate kernel locks state for exynos SOC.
> > 
> > Enabling CONFIG_LOCKUP_DETECTOR help validator tracks the 'state' of 
> > lock-classes,
> > and it tracks dependencies between different lock-classes.
> > The validator maintains a rolling proof that the state and
> > the dependencies are correct.
> 
> Unfortunately this is not correct. Lockup detector does something else.
> Please read the help/manual for LOCKUP_DETECTOR. You can find in
> lib/Kconfig.debug (around line 667).
> 
> Best regards,
> Krzysztof
> 
> > 
> > Changes since v2:
> >  * Made commit message more clear
> >  * Corrected grammer in code comment
> > 
> > Tested on Exynos5422 ODROID XU3 board.
> > 
> > Signed-off-by: Anand Moon 
> > Reviewed-by: Krzysztof Kozlowski 
> > ---
> >  arch/arm/configs/exynos_defconfig | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm/configs/exynos_defconfig 
> > b/arch/arm/configs/exynos_defconfig
> > index 5ef14de..ecd9987 100644
> > --- a/arch/arm/configs/exynos_defconfig
> > +++ b/arch/arm/configs/exynos_defconfig
> > @@ -178,6 +178,7 @@ CONFIG_PRINTK_TIME=y
> >  CONFIG_DEBUG_FS=y
> >  CONFIG_MAGIC_SYSRQ=y
> >  CONFIG_DEBUG_KERNEL=y
> > +CONFIG_LOCKUP_DETECTOR=y
> >  CONFIG_DETECT_HUNG_TASK=y
> >  CONFIG_DEBUG_RT_MUTEXES=y
> >  CONFIG_DEBUG_SPINLOCK=y

--
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 RESEND v2 3/4] ARM: dts: Enable USB node for exynos3250-rinato

2015-01-07 Thread Jaewon Kim
This patch enables hsotg and usbphy node to use USB 2.0 Device.

Signed-off-by: Jaewon Kim 
---
 arch/arm/boot/dts/exynos3250-rinato.dts |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts 
b/arch/arm/boot/dts/exynos3250-rinato.dts
index 0e3d499..b3f217c 100644
--- a/arch/arm/boot/dts/exynos3250-rinato.dts
+++ b/arch/arm/boot/dts/exynos3250-rinato.dts
@@ -132,6 +132,16 @@
};
 };
 
+&exynos_usbphy {
+   status = "okay";
+};
+
+&hsotg {
+   vusb_d-supply = <&ldo15_reg>;
+   vusb_a-supply = <&ldo12_reg>;
+   status = "okay";
+};
+
 &i2c_0 {
#address-cells = <1>;
#size-cells = <0>;
-- 
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 RESEND v2 1/4] ARM: dts: Add exynos_usbphy node for exynos3250

2015-01-07 Thread Jaewon Kim
This patch adds device tree node for exynos_usbphy to use USB 2.0 Device.

Signed-off-by: Jaewon Kim 
---
 arch/arm/boot/dts/exynos3250.dtsi |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250.dtsi 
b/arch/arm/boot/dts/exynos3250.dtsi
index 2246549..27d385f 100644
--- a/arch/arm/boot/dts/exynos3250.dtsi
+++ b/arch/arm/boot/dts/exynos3250.dtsi
@@ -279,6 +279,16 @@
status = "disabled";
};
 
+   exynos_usbphy: exynos-usbphy@125B {
+   compatible = "samsung,exynos3250-usb2-phy";
+   reg = <0x125B 0x100>;
+   samsung,pmureg-phandle = <&pmu_system_controller>;
+   clocks = <&cmu CLK_USBOTG>, <&cmu CLK_SCLK_UPLL>;
+   clock-names = "phy", "ref";
+   #phy-cells = <1>;
+   status = "disabled";
+   };
+
amba {
compatible = "arm,amba-bus";
#address-cells = <1>;
-- 
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 RESEND v2 2/4] ARM: dts: Add hsotg node for exynos3250

2015-01-07 Thread Jaewon Kim
This patch adds device tree node for hsotg to control USB 2.0 Device.

Signed-off-by: Jaewon Kim 
---
 arch/arm/boot/dts/exynos3250.dtsi |   11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250.dtsi 
b/arch/arm/boot/dts/exynos3250.dtsi
index 27d385f..204a84b 100644
--- a/arch/arm/boot/dts/exynos3250.dtsi
+++ b/arch/arm/boot/dts/exynos3250.dtsi
@@ -255,6 +255,17 @@
status = "disabled";
};
 
+   hsotg: hsotg@1248 {
+   compatible = "snps,dwc2";
+   reg = <0x1248 0x2>;
+   interrupts = <0 141 0>;
+   clocks = <&cmu CLK_USBOTG>;
+   clock-names = "otg";
+   phys = <&exynos_usbphy 0>;
+   phy-names = "usb2-phy";
+   status = "disabled";
+   };
+
mshc_0: mshc@1251 {
compatible = "samsung,exynos5250-dw-mshc";
reg = <0x1251 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 RESEND v2 4/4] ARM: dts: Enable USB node for exynos3250-monk

2015-01-07 Thread Jaewon Kim
This patch adds device tree node for hsotg to control USB 2.0 Device.

Signed-off-by: Jaewon Kim 
---
 arch/arm/boot/dts/exynos3250-monk.dts |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250-monk.dts 
b/arch/arm/boot/dts/exynos3250-monk.dts
index 7102d88..3f18b21 100644
--- a/arch/arm/boot/dts/exynos3250-monk.dts
+++ b/arch/arm/boot/dts/exynos3250-monk.dts
@@ -141,6 +141,16 @@
};
 };
 
+&exynos_usbphy {
+   status = "okay";
+};
+
+&hsotg {
+   vusb_d-supply = <&ldo15_reg>;
+   vusb_a-supply = <&ldo12_reg>;
+   status = "okay";
+};
+
 &i2c_0 {
#address-cells = <1>;
#size-cells = <0>;
-- 
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 RESEND v2 0/4] ARM: dts: Add USB node for exynos3250 SoC boards

2015-01-07 Thread Jaewon Kim
This patch series adds USB device node and phy for exynos3250 SoC.
And enables for rinato and monk boards.

Changes in v2:
 - remove unnessasary property "samsung,sysreg-phandle"
 - change "xusbxti" clock to "CLK_SCLK_UPLL"

Jaewon Kim (4):
  ARM: dts: Add exynos_usbphy node for exynos3250
  ARM: dts: Add hsotg node for exynos3250
  ARM: dts: Enable USB node for exynos3250-rinato
  ARM: dts: Enable USB node for exynos3250-monk

 arch/arm/boot/dts/exynos3250-monk.dts   |   10 ++
 arch/arm/boot/dts/exynos3250-rinato.dts |   10 ++
 arch/arm/boot/dts/exynos3250.dtsi   |   21 +
 3 files changed, 41 insertions(+)

-- 
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 RESEND 2/2] ARM: dts: exynos3250-monk: Add regulator-haptic node for haptics

2015-01-07 Thread Jaewon Kim
This patch adds regulator-haptic device node controlled by regulator.

Signed-off-by: Jaewon Kim 
Reviewed-by: Chanwoo Choi 
---
 arch/arm/boot/dts/exynos3250-monk.dts |7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250-monk.dts 
b/arch/arm/boot/dts/exynos3250-monk.dts
index 24822aa..7102d88 100644
--- a/arch/arm/boot/dts/exynos3250-monk.dts
+++ b/arch/arm/boot/dts/exynos3250-monk.dts
@@ -109,6 +109,13 @@
};
};
};
+
+   haptics {
+   compatible = "regulator-haptic";
+   haptic-supply = <&motor_reg>;
+   min-microvolt = <110>;
+   max-microvolt = <270>;
+   };
 };
 
 &adc {
-- 
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 RESEND 0/2] Add regulator-haptic device tree

2015-01-07 Thread Jaewon Kim
This patch series adds regulator-haptic device tree in rinato and monk boards.

The regulator-haptic has haptic motor and it is controlled by
voltage of regulator via force feedback framework.

Jaewon Kim (2):
  ARM: dts: exynos3250-rinato: Add regulator-haptic node for haptics
  ARM: dts: exynos3250-monk: Add regulator-haptic node for haptics

 arch/arm/boot/dts/exynos3250-monk.dts   |7 +++
 arch/arm/boot/dts/exynos3250-rinato.dts |7 +++
 2 files changed, 14 insertions(+)

-- 
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 RESEND 1/2] ARM: dts: exynos3250-rinato: Add regulator-haptic node for haptics

2015-01-07 Thread Jaewon Kim
This patch adds regulator-haptic device node controlled by regulator.

Signed-off-by: Jaewon Kim 
Reviewed-by: Chanwoo Choi 
---
 arch/arm/boot/dts/exynos3250-rinato.dts |7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts 
b/arch/arm/boot/dts/exynos3250-rinato.dts
index 80aa8b4..0e3d499 100644
--- a/arch/arm/boot/dts/exynos3250-rinato.dts
+++ b/arch/arm/boot/dts/exynos3250-rinato.dts
@@ -100,6 +100,13 @@
};
};
};
+
+   haptics {
+   compatible = "regulator-haptic";
+   haptic-supply = <&motor_reg>;
+   min-microvolt = <110>;
+   max-microvolt = <270>;
+   };
 };
 
 &adc {
-- 
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


Re: [PATCH v2] ARM: exynos_defconfig: Enable CONFIG_LOCKUP_DETECTOR

2015-01-07 Thread Krzysztof Kozlowski
On śro, 2015-01-07 at 18:29 +0530, Anand Moon wrote:
> Enable CONFIG_LOCKUP_DETECTOR to validate kernel locks state for exynos SOC.
> 
> Enabling CONFIG_LOCKUP_DETECTOR help validator tracks the 'state' of 
> lock-classes,
> and it tracks dependencies between different lock-classes.
> The validator maintains a rolling proof that the state and
> the dependencies are correct.

Unfortunately this is not correct. Lockup detector does something else.
Please read the help/manual for LOCKUP_DETECTOR. You can find in
lib/Kconfig.debug (around line 667).

Best regards,
Krzysztof

> 
> Changes since v2:
>  * Made commit message more clear
>  * Corrected grammer in code comment
> 
> Tested on Exynos5422 ODROID XU3 board.
> 
> Signed-off-by: Anand Moon 
> Reviewed-by: Krzysztof Kozlowski 
> ---
>  arch/arm/configs/exynos_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/configs/exynos_defconfig 
> b/arch/arm/configs/exynos_defconfig
> index 5ef14de..ecd9987 100644
> --- a/arch/arm/configs/exynos_defconfig
> +++ b/arch/arm/configs/exynos_defconfig
> @@ -178,6 +178,7 @@ CONFIG_PRINTK_TIME=y
>  CONFIG_DEBUG_FS=y
>  CONFIG_MAGIC_SYSRQ=y
>  CONFIG_DEBUG_KERNEL=y
> +CONFIG_LOCKUP_DETECTOR=y
>  CONFIG_DETECT_HUNG_TASK=y
>  CONFIG_DEBUG_RT_MUTEXES=y
>  CONFIG_DEBUG_SPINLOCK=y

--
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] [media] s5p-jpeg: Adding Exynos7 Jpeg variant support

2015-01-07 Thread Jacek Anaszewski

Hi Tony,

On 01/07/2015 01:08 PM, Tony K Nadackal wrote:

Dear Jacek,

On Wednesday, January 07, 2015 3:15 PM Jacek Anaszewski wrote,


Hi Tony,

Sorry for late response, just got back from vacation.

On 12/19/2014 04:37 AM, Tony K Nadackal wrote:

Hi Jacek,

On Wednesday, December 17, 2014 7:46 PM Jacek Anaszewski wrote,

Hi Tony,

Thanks for the patches.



Thanks for the review.


Please process them with scripts/checkpatch.pl as you will be
submitting the

next

version - they contain many coding style related issues.



I ran checkpatch before posting. Do you find any checkpatch related
issues in the patch?


There was a problem on my side, sorry for making confusion.


My remaining comments below.



[snip]


+   if (ctx->jpeg->variant->version == SJPEG_EXYNOS7) {
+   exynos4_jpeg_set_interrupt(jpeg->regs,

SJPEG_EXYNOS7);

+   exynos4_jpeg_set_enc_out_fmt(jpeg->regs,
+   ctx->subsampling,

EXYNOS7_ENC_FMT_MASK);

+   exynos4_jpeg_set_img_fmt(jpeg->regs,
+   ctx->out_q.fmt->fourcc,
+   EXYNOS7_SWAP_CHROMA_SHIFT);
+   } else {
+   exynos4_jpeg_set_interrupt(jpeg->regs,

SJPEG_EXYNOS4);

+   exynos4_jpeg_set_enc_out_fmt(jpeg->regs,
+   ctx->subsampling,

EXYNOS4_ENC_FMT_MASK);

+   exynos4_jpeg_set_img_fmt(jpeg->regs,
+   ctx->out_q.fmt->fourcc,
+   EXYNOS4_SWAP_CHROMA_SHIFT);
+   }
+


I'd implement it this way:

exynos4_jpeg_set_interrupt(jpeg->regs, ctx->jpeg->variant->version);
exynos4_jpeg_set_enc_out_fmt(jpeg->regs, ctx->subsampling,
(ctx->jpeg->variant->version == SJPEG_EXYNOS4) ?
EXYNOS4_ENC_FMT_MASK :
EXYNOS7_ENC_FMT_MASK);
exynos4_jpeg_set_img_fmt(jpeg->regs, ctx->out_q.fmt->fourcc,
(ctx->jpeg->variant->version == SJPEG_EXYNOS4) ?
EXYNOS4_SWAP_CHROMA_SHIFT :
EXYNOS7_SWAP_CHROMA_SHIFT);



OK. Looks goods to me. Thanks for the suggestion.


exynos4_jpeg_set_img_addr(ctx);
exynos4_jpeg_set_jpeg_addr(ctx);
exynos4_jpeg_set_encode_hoff_cnt(jpeg->regs,


ctx->out_q.fmt->fourcc);

} else {
exynos4_jpeg_sw_reset(jpeg->regs);
-   exynos4_jpeg_set_interrupt(jpeg->regs);
exynos4_jpeg_set_img_addr(ctx);
exynos4_jpeg_set_jpeg_addr(ctx);
-   exynos4_jpeg_set_img_fmt(jpeg->regs, ctx->cap_q.fmt-
fourcc);

-   bitstream_size = DIV_ROUND_UP(ctx->out_q.size, 32);
+   if (ctx->jpeg->variant->version == SJPEG_EXYNOS7) {
+   exynos4_jpeg_set_interrupt(jpeg->regs,

SJPEG_EXYNOS7);

+   exynos4_jpeg_set_huff_tbl(jpeg->regs);
+   exynos4_jpeg_set_huf_table_enable(jpeg->regs, 1);
+
+   /*
+* JPEG IP allows storing 4 quantization tables
+* We fill table 0 for luma and table 1 for chroma
+*/
+   exynos4_jpeg_set_qtbl_lum(jpeg->regs,
+   ctx->compr_quality);
+   exynos4_jpeg_set_qtbl_chr(jpeg->regs,
+   ctx->compr_quality);


Is it really required to setup quantization tables for encoding?



Without setting up the quantization tables, encoder is working fine.
But, as per Exynos7 User Manual setting up the quantization tables are
required for encoding also.




Sorry I also got it mixed up.
*Decoder* works fine without setting up the quantization tables. But this step
is mentioned in User Manual.


I'm ok with it provided that you will get an ack from Samsung SOCs
maintainer.


Actually I intended to ask if setting the quantization tables is required for
*decoding*, as you set it also in decoding path, whereas for Exynos4 it is not
required. I looks strange for me as quantization tables are usually required

only

for encoding raw images.
The same is related to huffman tables.


Huffman table is required for Exynos7 decoding.
User Manual says about  Update_Huf_Tbl [bit 19 of PEG_CNTL], "User/Host should
mandatory program this Bit as "1" for every decoder operation. SFR
"HUFF_TBL_ENT" and SFR "HUFF_CNT" should be programmed accordingly for every
encoder/decoder operation."


Same situation as above.




+   exynos4_jpeg_set_stream_size(jpeg->regs, ctx-
cap_q.w,
+   ctx->cap_q.h);


For exynos4 this function writes the number of samples per line and
number lines of the resulting JPEG image

Re: [PATCH] ARM: exynos_defconfig: Enable CONFIG_LOCKUP_DETECTOR

2015-01-07 Thread Krzysztof Kozlowski
On śro, 2015-01-07 at 17:45 +0530, Anand Moon wrote:
> ARM Enable CONFIG_LOCKUP_DETECTOR to validation of kernel locks
> 
> v2 Fixed the commit log
> This config item helps getting some useful information when lockup
> happens. If you want to validate locks then probably you want
> PROVE_LOCKING... but its overhead is larger.
> 
> Anyway the overhead of LOCKUP_DETECTOR is small and multi_v7_defconfig
> has it enabled so I guess exynos may do it as well.

Err? Why did you include my response as commit message? It does not
really make sense.

Let me point this once again:
1. The commit message is inaccurate because CONFIG_LOCKUP_DETECTOR does
not validate the locks.
2. Please write proper commit message describing WHY you want to add
this config option.

Best regards,
Krzysztof

> 
> Tested on Exynos5422 ODROID XU3 board.
> 
> Signed-off-by: Anand Moon 
> Reviewed-by: Krzysztof Kozlowski 
> ---
>  arch/arm/configs/exynos_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/configs/exynos_defconfig 
> b/arch/arm/configs/exynos_defconfig
> index 5ef14de..ecd9987 100644
> --- a/arch/arm/configs/exynos_defconfig
> +++ b/arch/arm/configs/exynos_defconfig
> @@ -178,6 +178,7 @@ CONFIG_PRINTK_TIME=y
>  CONFIG_DEBUG_FS=y
>  CONFIG_MAGIC_SYSRQ=y
>  CONFIG_DEBUG_KERNEL=y
> +CONFIG_LOCKUP_DETECTOR=y
>  CONFIG_DETECT_HUNG_TASK=y
>  CONFIG_DEBUG_RT_MUTEXES=y
>  CONFIG_DEBUG_SPINLOCK=y

--
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 2/2] [media] s5p-jpeg: Adding Exynos7 JPEG variant

2015-01-07 Thread Jacek Anaszewski

Hi Tony,

On 01/07/2015 12:22 PM, Tony K Nadackal wrote:

Hi Jacek,

On  Wednesday, January 07, 2015 3:43 PM : Jacek Anaszewski wrote,


Hi Tony,

On 12/19/2014 08:38 AM, Tony K Nadackal wrote:

Fimp_jpeg used in Exynos7 is a revised version. Some register
configurations are slightly different from JPEG in Exynos4.
Added one more variant SJPEG_EXYNOS7 to handle these differences.

Signed-off-by: Tony K Nadackal 
---
   .../bindings/media/exynos-jpeg-codec.txt   |  2 +-
   drivers/media/platform/s5p-jpeg/jpeg-core.c| 61

++-

---

   drivers/media/platform/s5p-jpeg/jpeg-core.h| 10 ++--
   drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c  | 32 ++--
   drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.h  |  8 +--
   drivers/media/platform/s5p-jpeg/jpeg-regs.h| 17 --
   6 files changed, 93 insertions(+), 37 deletions(-)

diff --git
a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
index bf52ed4..cd19417 100644
--- a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
+++ b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
@@ -4,7 +4,7 @@ Required properties:

   - compatible : should be one of:
  "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg",
- "samsung,exynos3250-jpeg";
+ "samsung,exynos3250-jpeg", "samsung,exynos7-jpeg";
   - reg: address and length of the JPEG codec IP register set;
   - interrupts : specifies the JPEG codec IP interrupt;
   - clock-names   : should contain:


This should be put in a separate patch.


Checkpatch gives warning if this change is not there.
If that is ok with you, I will make this change a separate patch.


If the patch updating the DT documentation will go first, then
checkpatch shouldn't raise a warning.

--
Best Regards,
Jacek Anaszewski
--
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] [media] s5p-jpeg: Adding Exynos7 Jpeg variant support

2015-01-07 Thread Tony K Nadackal
Dear Jacek,

On Wednesday, January 07, 2015 3:15 PM Jacek Anaszewski wrote,

> Hi Tony,
> 
> Sorry for late response, just got back from vacation.
> 
> On 12/19/2014 04:37 AM, Tony K Nadackal wrote:
> > Hi Jacek,
> >
> > On Wednesday, December 17, 2014 7:46 PM Jacek Anaszewski wrote,
> >> Hi Tony,
> >>
> >> Thanks for the patches.
> >>
> >
> > Thanks for the review.
> >
> >> Please process them with scripts/checkpatch.pl as you will be
> >> submitting the
> > next
> >> version - they contain many coding style related issues.
> >>
> >
> > I ran checkpatch before posting. Do you find any checkpatch related
> > issues in the patch?
> 
> There was a problem on my side, sorry for making confusion.
> 
> >> My remaining comments below.
> >>
> >
> > [snip]
> >
> >>> + if (ctx->jpeg->variant->version == SJPEG_EXYNOS7) {
> >>> + exynos4_jpeg_set_interrupt(jpeg->regs,
> >> SJPEG_EXYNOS7);
> >>> + exynos4_jpeg_set_enc_out_fmt(jpeg->regs,
> >>> + ctx->subsampling,
> >> EXYNOS7_ENC_FMT_MASK);
> >>> + exynos4_jpeg_set_img_fmt(jpeg->regs,
> >>> + ctx->out_q.fmt->fourcc,
> >>> + EXYNOS7_SWAP_CHROMA_SHIFT);
> >>> + } else {
> >>> + exynos4_jpeg_set_interrupt(jpeg->regs,
> >> SJPEG_EXYNOS4);
> >>> + exynos4_jpeg_set_enc_out_fmt(jpeg->regs,
> >>> + ctx->subsampling,
> >> EXYNOS4_ENC_FMT_MASK);
> >>> + exynos4_jpeg_set_img_fmt(jpeg->regs,
> >>> + ctx->out_q.fmt->fourcc,
> >>> + EXYNOS4_SWAP_CHROMA_SHIFT);
> >>> + }
> >>> +
> >>
> >> I'd implement it this way:
> >>
> >> exynos4_jpeg_set_interrupt(jpeg->regs, ctx->jpeg->variant->version);
> >> exynos4_jpeg_set_enc_out_fmt(jpeg->regs, ctx->subsampling,
> >>(ctx->jpeg->variant->version == SJPEG_EXYNOS4) ?
> >>EXYNOS4_ENC_FMT_MASK :
> >>EXYNOS7_ENC_FMT_MASK);
> >> exynos4_jpeg_set_img_fmt(jpeg->regs, ctx->out_q.fmt->fourcc,
> >>(ctx->jpeg->variant->version == SJPEG_EXYNOS4) ?
> >>EXYNOS4_SWAP_CHROMA_SHIFT :
> >>EXYNOS7_SWAP_CHROMA_SHIFT);
> >>
> >
> > OK. Looks goods to me. Thanks for the suggestion.
> >
> >>>   exynos4_jpeg_set_img_addr(ctx);
> >>>   exynos4_jpeg_set_jpeg_addr(ctx);
> >>>   exynos4_jpeg_set_encode_hoff_cnt(jpeg->regs,
> >>>
ctx->out_q.fmt->fourcc);
> >>>   } else {
> >>>   exynos4_jpeg_sw_reset(jpeg->regs);
> >>> - exynos4_jpeg_set_interrupt(jpeg->regs);
> >>>   exynos4_jpeg_set_img_addr(ctx);
> >>>   exynos4_jpeg_set_jpeg_addr(ctx);
> >>> - exynos4_jpeg_set_img_fmt(jpeg->regs, ctx->cap_q.fmt-
> >>> fourcc);
> >>>
> >>> - bitstream_size = DIV_ROUND_UP(ctx->out_q.size, 32);
> >>> + if (ctx->jpeg->variant->version == SJPEG_EXYNOS7) {
> >>> + exynos4_jpeg_set_interrupt(jpeg->regs,
> >> SJPEG_EXYNOS7);
> >>> + exynos4_jpeg_set_huff_tbl(jpeg->regs);
> >>> + exynos4_jpeg_set_huf_table_enable(jpeg->regs, 1);
> >>> +
> >>> + /*
> >>> +  * JPEG IP allows storing 4 quantization tables
> >>> +  * We fill table 0 for luma and table 1 for chroma
> >>> +  */
> >>> + exynos4_jpeg_set_qtbl_lum(jpeg->regs,
> >>> + ctx->compr_quality);
> >>> + exynos4_jpeg_set_qtbl_chr(jpeg->regs,
> >>> + ctx->compr_quality);
> >>
> >> Is it really required to setup quantization tables for encoding?
> >>
> >
> > Without setting up the quantization tables, encoder is working fine.
> > But, as per Exynos7 User Manual setting up the quantization tables are
> > required for encoding also.
> 

Sorry I also got it mixed up.
*Decoder* works fine without setting up the quantization tables. But this step
is mentioned in User Manual.

> Actually I intended to ask if setting the quantization tables is required for
> *decoding*, as you set it also in decoding path, whereas for Exynos4 it is not
> required. I looks strange for me as quantization tables are usually required
only
> for encoding raw images.
> The same is related to huffman tables.

Huffman table is required for Exynos7 decoding.
User Manual says about  Update_Huf_Tbl [bit 19 of PEG_CNTL], "User/Host should
mandatory program this Bit as "1" for every decoder operation. SFR
"HUFF_TBL_ENT" and SFR "HUFF_CNT" should be programmed accordingly for every
encoder/decoder operation."

> 
> >>> + exynos4_jpeg_set_stream_size(jpeg->regs, ctx-
> >>> cap_q.w,
> >>> + ctx->cap_q.h);
> >>
> 

RE: [PATCH v2 1/2] [media] s5p-jpeg: Fix modification sequence of interrupt enable register

2015-01-07 Thread Tony K Nadackal
Hi Jacek,

On Wednesday, January 07, 2015 3:38 PM Jacek Anaszewski wrote,

> Hi Tony,
> 
> On 12/19/2014 08:37 AM, Tony K Nadackal wrote:
> > Fix the bug in modifying the interrupt enable register.
> 
> For Exynos4 this was not a bug as there are only five bit fields used in the
> EXYNOS4_INT_EN_REG - all of them enable related interrupt signal and
> EXYNOS4_INT_EN_ALL value is 0x1f which just sets these bit fields to 1.
> 

I agree that it is not a bug. 
I added the register read before modifying it to avoid any potential bugs in the
future.

> If for Exynos7 there are other bit fields in this register and it has to be
read prior
> setting to find out current state then I'd parametrize this function with
version
> argument as you do it in the patch adding support for Exynos7, but for Exynos4
> case I'd left the behaviour as it is currenlty, i.e.
> avoid reading the register and do it only for Exynos7 case.

Directly writing the value EXYNOS4_INT_EN_ALL (0x1B6 in Exynos7) to
EXYNOS4_INT_EN_REG works in case of Exynos7 too.
I  will parametrize this function with version to take care of the Exynos7 bit
fields.

> Effectively, this patch is not required, as it doesn't fix anything but adds
> redundant call to readl.
> 
> > Signed-off-by: Tony K Nadackal 
> > ---
> >   drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c | 5 -
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
> > b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
> > index e53f13a..a61ff7e 100644
> > --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
> > +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
> > @@ -155,7 +155,10 @@ void exynos4_jpeg_set_enc_out_fmt(void __iomem
> > *base, unsigned int out_fmt)
> >
> >   void exynos4_jpeg_set_interrupt(void __iomem *base)
> >   {
> > -   writel(EXYNOS4_INT_EN_ALL, base + EXYNOS4_INT_EN_REG);
> > +   unsigned int reg;
> > +
> > +   reg = readl(base + EXYNOS4_INT_EN_REG) & ~EXYNOS4_INT_EN_MASK;
> > +   writel(reg | EXYNOS4_INT_EN_ALL, base + EXYNOS4_INT_EN_REG);
> >   }
> >
> >   unsigned int exynos4_jpeg_get_int_status(void __iomem *base)
> >
> 
> 
> --
> Best Regards,
> Jacek Anaszewski

Thanks and Regards,
Tony

--
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 v12 1/9] ARM: OMAP2+: use common l2cache initialization code

2015-01-07 Thread Marek Szyprowski
This patch implements generic DT L2C initialisation (the one from
init_IRQ in arch/arm/kernel/irq.c) for Omap4 and AM43 platforms and
kills the SoC specific stuff in arch/arm/mach-omap2/omap4-common.c.

Signed-off-by: Marek Szyprowski 
Tested-by: Nishanth Menon 
Acked-by: Nishanth Menon 
Acked-by: Tony Lindgren 
---
 arch/arm/mach-omap2/board-generic.c |  6 ++
 arch/arm/mach-omap2/common.h|  8 
 arch/arm/mach-omap2/omap4-common.c  | 16 +---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index 608079a1aba6..c5c480b76da5 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -171,6 +171,9 @@ static const char *const omap4_boards_compat[] __initconst 
= {
 };
 
 DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
+   .l2c_aux_val= OMAP_L2C_AUX_CTRL,
+   .l2c_aux_mask   = 0xcf9f,
+   .l2c_write_sec  = omap4_l2c310_write_sec,
.reserve= omap_reserve,
.smp= smp_ops(omap4_smp_ops),
.map_io = omap4_map_io,
@@ -214,6 +217,9 @@ static const char *const am43_boards_compat[] __initconst = 
{
 };
 
 DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
+   .l2c_aux_val= OMAP_L2C_AUX_CTRL,
+   .l2c_aux_mask   = 0xcf9f,
+   .l2c_write_sec  = omap4_l2c310_write_sec,
.map_io = am33xx_map_io,
.init_early = am43xx_init_early,
.init_late  = am43xx_init_late,
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 377eea849e7b..2610c9f8d29f 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -35,6 +35,7 @@
 #include 
 
 #include 
+#include 
 
 #include "i2c.h"
 #include "serial.h"
@@ -94,11 +95,18 @@ extern void omap3_gptimer_timer_init(void);
 extern void omap4_local_timer_init(void);
 #ifdef CONFIG_CACHE_L2X0
 int omap_l2_cache_init(void);
+#define OMAP_L2C_AUX_CTRL  (L2C_AUX_CTRL_SHARED_OVERRIDE | \
+L310_AUX_CTRL_DATA_PREFETCH | \
+L310_AUX_CTRL_INSTR_PREFETCH)
+void omap4_l2c310_write_sec(unsigned long val, unsigned reg);
 #else
 static inline int omap_l2_cache_init(void)
 {
return 0;
 }
+
+#define OMAP_L2C_AUX_CTRL  0
+#define omap4_l2c310_write_sec NULL
 #endif
 extern void omap5_realtime_timer_init(void);
 
diff --git a/arch/arm/mach-omap2/omap4-common.c 
b/arch/arm/mach-omap2/omap4-common.c
index b7cb44abe49b..fe99ceff2e2d 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -166,7 +166,7 @@ void __iomem *omap4_get_l2cache_base(void)
return l2cache_base;
 }
 
-static void omap4_l2c310_write_sec(unsigned long val, unsigned reg)
+void omap4_l2c310_write_sec(unsigned long val, unsigned reg)
 {
unsigned smc_op;
 
@@ -201,24 +201,10 @@ static void omap4_l2c310_write_sec(unsigned long val, 
unsigned reg)
 
 int __init omap_l2_cache_init(void)
 {
-   u32 aux_ctrl;
-
/* Static mapping, never released */
l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
if (WARN_ON(!l2cache_base))
return -ENOMEM;
-
-   /* 16-way associativity, parity disabled, way size - 64KB (es2.0 +) */
-   aux_ctrl = L2C_AUX_CTRL_SHARED_OVERRIDE |
-  L310_AUX_CTRL_DATA_PREFETCH |
-  L310_AUX_CTRL_INSTR_PREFETCH;
-
-   outer_cache.write_sec = omap4_l2c310_write_sec;
-   if (of_have_populated_dt())
-   l2x0_of_init(aux_ctrl, 0xcf9f);
-   else
-   l2x0_init(l2cache_base, aux_ctrl, 0xcf9f);
-
return 0;
 }
 #endif
-- 
1.9.2

--
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 v12 0/9] Enable L2 cache support on Exynos4210/4x12 SoCs

2015-01-07 Thread Marek Szyprowski
This is an updated patchset, which intends to add support for L2 cache
on Exynos4 SoCs on boards running under secure firmware, which requires
certain initialization steps to be done with help of firmware, as
selected registers are writable only from secure mode.

First patch updates Omap2+ platforms by moving l2cache initialization to
common code. This will resolve too early call to l2cache init, what might
cause kmalloc failure in code added in next patches.

Next patch fixes access method to latency and filter settings in l2cache
driver.

Next four patches extend existing support for secure write in L2C driver
to account for design of secure firmware running on Exynos. Namely:
 1) direct read access to certain registers is needed on Exynos, because
secure firmware calls set several registers at once,
 2) not all boards are running secure firmware, so .write_sec callback
needs to be installed in Exynos firmware ops initialization code,
 3) write access to {DATA,TAG}_LATENCY_CTRL registers fron non-secure world
is not allowed and so must use l2c_write_sec as well,
 4) on certain boards, default value of prefetch register is incorrect
and must be overridden at L2C initialization.
For boards running with firmware that provides access to individual
L2C registers this series should introduce no functional changes. However
since the driver is widely used on other platforms I'd like to kindly ask
any interested people for testing.

Further three patches add implementation of .write_sec and .configure
callbacks for Exynos secure firmware and necessary DT nodes to enable
L2 cache.

Changes in this version tested on Exynos4412-based TRATS2 and OdroidU3+
boards (both with secure firmware). There should be no functional change
for Exynos boards running without secure firmware. OMAP based platforms
were tested by Nishanth Menon and Tony Lindgren.

Depends on:
- v3.19-rc2

Changelog:

Changes since v11:
(https://lkml.org/lkml/2015/1/5/254)
- Added changes suggested by Nishanth to 'ARM: l2c: use l2c_write_sec()
  for restoring latency and filter regs' patch
- Fixed 'checkpatch --strict' issues
- Added Nishanth's and Tony's acked/tested tags

Changes since v10:
(https://lkml.org/lkml/2014/12/23/151)
- Added patch, which fixes access method to latency and filter settings
  in l2cache

Changes since v9:
(https://lkml.org/lkml/2014/11/17/217)
- Rebased onto vanilla v3.19-rc1
- Added patch for Omap2+ (move l2cache initialization to common code), what
  fixes too early initialization (kmalloc failure)

Changes since v8:
(http://lkml.org/lkml/2014/11/13/263)
- Rebased onto vanilla v3.18-rc3 and added required includes, which were
  previously added by other patches
- Added Acked-by tags for Exynos part

Changes since v7:
(https://lkml.org/lkml/2014/10/29/158)
- rebased onto arm-soc/for-next kernel tree (depends on patches merged to
  v3.18-rc3 and arm-soc/samsung/pm2 branch)
- removed 'ARM: l2c: unify L2C-310 OF initialization error messages' patch
  (no longer needed)

Changes since v6:
(https://lkml.org/lkml/2014/10/27/233)
- changed PL310 to L2C-310 prefix in error messages
- added patch shortening the error message about incorrect associativity

Changes since v5:
(https://lkml.org/lkml/2014/9/24/364)
- rebased onto v3.18-rc2
- added error message about missing properties values

Changes since v4:
(https://lkml.org/lkml/2014/8/26/461)
 - rewrote the code accessing l2x0_saved_regs from assembly code
 - added comment and reworked unconditional call to SMC_CMD_L2X0INVALL


Patch summary:

Marek Szyprowski (2):
  ARM: OMAP2+: use common l2cache initialization code
  ARM: l2c: use l2c_write_sec() for restoring latency and filter regs

Tomasz Figa (7):
  ARM: l2c: Refactor the driver to use commit-like interface
  ARM: l2c: Add interface to ask hypervisor to configure L2C
  ARM: l2c: Get outer cache .write_sec callback from mach_desc only if
not NULL
  ARM: l2c: Add support for overriding prefetch settings
  ARM: EXYNOS: Add .write_sec outer cache callback for L2C-310
  ARM: EXYNOS: Add support for non-secure L2X0 resume
  ARM: dts: exynos4: Add nodes for L2 cache controller

 Documentation/devicetree/bindings/arm/l2cc.txt |  10 +
 arch/arm/boot/dts/exynos4210.dtsi  |   9 +
 arch/arm/boot/dts/exynos4x12.dtsi  |  14 ++
 arch/arm/include/asm/outercache.h  |   3 +
 arch/arm/kernel/irq.c  |   3 +-
 arch/arm/mach-exynos/firmware.c|  50 +
 arch/arm/mach-exynos/sleep.S   |  46 +
 arch/arm/mach-omap2/board-generic.c|   6 +
 arch/arm/mach-omap2/common.h   |   8 +
 arch/arm/mach-omap2/omap4-common.c |  16 +-
 arch/arm/mm/cache-l2x0.c   | 272 -
 11 files changed, 325 insertions(+), 112 deletions(-)

-- 
1.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.o

[PATCH v12 5/9] ARM: l2c: Get outer cache .write_sec callback from mach_desc only if not NULL

2015-01-07 Thread Marek Szyprowski
From: Tomasz Figa 

Certain platforms (i.e. Exynos) might need to set .write_sec callback
from firmware initialization which is happenning in .init_early callback
of machine descriptor. However current code will overwrite the pointer
with whatever is present in machine descriptor, even though it can be
already set earlier. This patch fixes this by making the assignment
conditional, depending on whether current .write_sec callback is NULL.

Signed-off-by: Tomasz Figa 
Signed-off-by: Marek Szyprowski 
Tested-by: Nishanth Menon 
Acked-by: Nishanth Menon 
Acked-by: Tony Lindgren 
---
 arch/arm/kernel/irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index ad857bada96c..350f188c92d2 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -109,7 +109,8 @@ void __init init_IRQ(void)
 
if (IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_CACHE_L2X0) &&
(machine_desc->l2c_aux_mask || machine_desc->l2c_aux_val)) {
-   outer_cache.write_sec = machine_desc->l2c_write_sec;
+   if (!outer_cache.write_sec)
+   outer_cache.write_sec = machine_desc->l2c_write_sec;
ret = l2x0_of_init(machine_desc->l2c_aux_val,
   machine_desc->l2c_aux_mask);
if (ret)
-- 
1.9.2

--
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 v12 3/9] ARM: l2c: Refactor the driver to use commit-like interface

2015-01-07 Thread Marek Szyprowski
From: Tomasz Figa 

Certain implementations of secure hypervisors (namely the one found on
Samsung Exynos-based boards) do not provide access to individual L2C
registers. This makes the .write_sec()-based interface insufficient and
provoking ugly hacks.

This patch is first step to make the driver not rely on availability of
writes to individual registers. This is achieved by refactoring the
driver to use a commit-like operation scheme: all register values are
prepared first and stored in an instance of l2x0_regs struct and then a
single callback is responsible to flush those values to the hardware.

Signed-off-by: Tomasz Figa 
[mszyprow: rebased onto 'ARM: l2c: use l2c_write_sec() for restoring
 latency and filter regs' patch]
Signed-off-by: Marek Szyprowski 
Tested-by: Nishanth Menon 
Acked-by: Tony Lindgren 
---
 arch/arm/mm/cache-l2x0.c | 212 ++-
 1 file changed, 116 insertions(+), 96 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index b83c401ca50c..dde0d54ac41e 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -41,12 +41,14 @@ struct l2c_init_data {
void (*enable)(void __iomem *, u32, unsigned);
void (*fixup)(void __iomem *, u32, struct outer_cache_fns *);
void (*save)(void __iomem *);
+   void (*configure)(void __iomem *);
struct outer_cache_fns outer_cache;
 };
 
 #define CACHE_LINE_SIZE32
 
 static void __iomem *l2x0_base;
+static const struct l2c_init_data *l2x0_data;
 static DEFINE_RAW_SPINLOCK(l2x0_lock);
 static u32 l2x0_way_mask;  /* Bitmask of active ways */
 static u32 l2x0_size;
@@ -106,6 +108,14 @@ static inline void l2c_unlock(void __iomem *base, unsigned 
num)
}
 }
 
+static void l2c_configure(void __iomem *base)
+{
+   if (l2x0_data->configure)
+   l2x0_data->configure(base);
+
+   l2c_write_sec(l2x0_saved_regs.aux_ctrl, base, L2X0_AUX_CTRL);
+}
+
 /*
  * Enable the L2 cache controller.  This function must only be
  * called when the cache controller is known to be disabled.
@@ -114,7 +124,12 @@ static void l2c_enable(void __iomem *base, u32 aux, 
unsigned num_lock)
 {
unsigned long flags;
 
-   l2c_write_sec(aux, base, L2X0_AUX_CTRL);
+   /* Do not touch the controller if already enabled. */
+   if (readl_relaxed(base + L2X0_CTRL) & L2X0_CTRL_EN)
+   return;
+
+   l2x0_saved_regs.aux_ctrl = aux;
+   l2c_configure(base);
 
l2c_unlock(base, num_lock);
 
@@ -208,6 +223,11 @@ static void l2c_save(void __iomem *base)
l2x0_saved_regs.aux_ctrl = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
 }
 
+static void l2c_resume(void)
+{
+   l2c_enable(l2x0_base, l2x0_saved_regs.aux_ctrl, l2x0_data->num_lock);
+}
+
 /*
  * L2C-210 specific code.
  *
@@ -288,14 +308,6 @@ static void l2c210_sync(void)
__l2c210_cache_sync(l2x0_base);
 }
 
-static void l2c210_resume(void)
-{
-   void __iomem *base = l2x0_base;
-
-   if (!(readl_relaxed(base + L2X0_CTRL) & L2X0_CTRL_EN))
-   l2c_enable(base, l2x0_saved_regs.aux_ctrl, 1);
-}
-
 static const struct l2c_init_data l2c210_data __initconst = {
.type = "L2C-210",
.way_size_0 = SZ_8K,
@@ -309,7 +321,7 @@ static const struct l2c_init_data l2c210_data __initconst = 
{
.flush_all = l2c210_flush_all,
.disable = l2c_disable,
.sync = l2c210_sync,
-   .resume = l2c210_resume,
+   .resume = l2c_resume,
},
 };
 
@@ -466,7 +478,7 @@ static const struct l2c_init_data l2c220_data = {
.flush_all = l2c220_flush_all,
.disable = l2c_disable,
.sync = l2c220_sync,
-   .resume = l2c210_resume,
+   .resume = l2c_resume,
},
 };
 
@@ -615,39 +627,29 @@ static void __init l2c310_save(void __iomem *base)
L310_POWER_CTRL);
 }
 
-static void l2c310_resume(void)
+static void l2c310_configure(void __iomem *base)
 {
-   void __iomem *base = l2x0_base;
+   unsigned revision;
 
-   if (!(readl_relaxed(base + L2X0_CTRL) & L2X0_CTRL_EN)) {
-   unsigned revision;
-
-   /* restore pl310 setup */
-   l2c_write_sec(l2x0_saved_regs.tag_latency, base,
- L310_TAG_LATENCY_CTRL);
-   l2c_write_sec(l2x0_saved_regs.data_latency, base,
- L310_DATA_LATENCY_CTRL);
-   l2c_write_sec(l2x0_saved_regs.filter_end, base,
- L310_ADDR_FILTER_END);
-   l2c_write_sec(l2x0_saved_regs.filter_start, base,
- L310_ADDR_FILTER_START);
-
-   revision = readl_relaxed(base + L2X0_CACHE_ID) &
-   L2X0_CACHE_ID_RTL_MASK;
-
-   if (revision >= L310_CACHE_ID_RTL_R2P0)
-   l2c_write

[PATCH v12 4/9] ARM: l2c: Add interface to ask hypervisor to configure L2C

2015-01-07 Thread Marek Szyprowski
From: Tomasz Figa 

Because certain secure hypervisor do not allow writes to individual L2C
registers, but rather expect set of parameters to be passed as argument
to secure monitor calls, there is a need to provide an interface for the
L2C driver to ask the firmware to configure the hardware according to
specified parameters. This patch adds such.

Signed-off-by: Tomasz Figa 
Signed-off-by: Marek Szyprowski 
Tested-by: Nishanth Menon 
Acked-by: Nishanth Menon 
Acked-by: Tony Lindgren 
---
 arch/arm/include/asm/outercache.h | 3 +++
 arch/arm/mm/cache-l2x0.c  | 6 ++
 2 files changed, 9 insertions(+)

diff --git a/arch/arm/include/asm/outercache.h 
b/arch/arm/include/asm/outercache.h
index 891a56b35bcf..563b92fc2f41 100644
--- a/arch/arm/include/asm/outercache.h
+++ b/arch/arm/include/asm/outercache.h
@@ -23,6 +23,8 @@
 
 #include 
 
+struct l2x0_regs;
+
 struct outer_cache_fns {
void (*inv_range)(unsigned long, unsigned long);
void (*clean_range)(unsigned long, unsigned long);
@@ -36,6 +38,7 @@ struct outer_cache_fns {
 
/* This is an ARM L2C thing */
void (*write_sec)(unsigned long, unsigned);
+   void (*configure)(const struct l2x0_regs *);
 };
 
 extern struct outer_cache_fns outer_cache;
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index dde0d54ac41e..5288153f28b8 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -110,6 +110,11 @@ static inline void l2c_unlock(void __iomem *base, unsigned 
num)
 
 static void l2c_configure(void __iomem *base)
 {
+   if (outer_cache.configure) {
+   outer_cache.configure(&l2x0_saved_regs);
+   return;
+   }
+
if (l2x0_data->configure)
l2x0_data->configure(base);
 
@@ -910,6 +915,7 @@ static int __init __l2c_init(const struct l2c_init_data 
*data,
 
fns = data->outer_cache;
fns.write_sec = outer_cache.write_sec;
+   fns.configure = outer_cache.configure;
if (data->fixup)
data->fixup(l2x0_base, cache_id, &fns);
 
-- 
1.9.2

--
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 v12 2/9] ARM: l2c: use l2c_write_sec() for restoring latency and filter regs

2015-01-07 Thread Marek Szyprowski
All four register for latency and filter settings cannot be written in
non-secure mode and they should go through l2c_write_sec(). More on this
can be found in CoreLink Level 2 Cache Controller L2C-310 Technical
Reference Manual, 3.2. Register summary, table 3.1. This have been checked
the TRM for r3p3, but it should be uniform for all revisions.

Reported-by: Nishanth Menon 
Suggested-by: Tomasz Figa 
Signed-off-by: Marek Szyprowski 
Tested-by: Nishanth Menon 
Acked-by: Nishanth Menon 
Acked-by: Tony Lindgren 
---
 arch/arm/mm/cache-l2x0.c | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 5e65ca8dea62..b83c401ca50c 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -623,14 +623,14 @@ static void l2c310_resume(void)
unsigned revision;
 
/* restore pl310 setup */
-   writel_relaxed(l2x0_saved_regs.tag_latency,
-  base + L310_TAG_LATENCY_CTRL);
-   writel_relaxed(l2x0_saved_regs.data_latency,
-  base + L310_DATA_LATENCY_CTRL);
-   writel_relaxed(l2x0_saved_regs.filter_end,
-  base + L310_ADDR_FILTER_END);
-   writel_relaxed(l2x0_saved_regs.filter_start,
-  base + L310_ADDR_FILTER_START);
+   l2c_write_sec(l2x0_saved_regs.tag_latency, base,
+ L310_TAG_LATENCY_CTRL);
+   l2c_write_sec(l2x0_saved_regs.data_latency, base,
+ L310_DATA_LATENCY_CTRL);
+   l2c_write_sec(l2x0_saved_regs.filter_end, base,
+ L310_ADDR_FILTER_END);
+   l2c_write_sec(l2x0_saved_regs.filter_start, base,
+ L310_ADDR_FILTER_START);
 
revision = readl_relaxed(base + L2X0_CACHE_ID) &
L2X0_CACHE_ID_RTL_MASK;
@@ -1135,28 +1135,28 @@ static void __init l2c310_of_parse(const struct 
device_node *np,
 
of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag));
if (tag[0] && tag[1] && tag[2])
-   writel_relaxed(
+   l2c_write_sec(
L310_LATENCY_CTRL_RD(tag[0] - 1) |
L310_LATENCY_CTRL_WR(tag[1] - 1) |
L310_LATENCY_CTRL_SETUP(tag[2] - 1),
-   l2x0_base + L310_TAG_LATENCY_CTRL);
+   l2x0_base, L310_TAG_LATENCY_CTRL);
 
of_property_read_u32_array(np, "arm,data-latency",
   data, ARRAY_SIZE(data));
if (data[0] && data[1] && data[2])
-   writel_relaxed(
+   l2c_write_sec(
L310_LATENCY_CTRL_RD(data[0] - 1) |
L310_LATENCY_CTRL_WR(data[1] - 1) |
L310_LATENCY_CTRL_SETUP(data[2] - 1),
-   l2x0_base + L310_DATA_LATENCY_CTRL);
+   l2x0_base,  L310_DATA_LATENCY_CTRL);
 
of_property_read_u32_array(np, "arm,filter-ranges",
   filter, ARRAY_SIZE(filter));
if (filter[1]) {
-   writel_relaxed(ALIGN(filter[0] + filter[1], SZ_1M),
-  l2x0_base + L310_ADDR_FILTER_END);
-   writel_relaxed((filter[0] & ~(SZ_1M - 1)) | L310_ADDR_FILTER_EN,
-  l2x0_base + L310_ADDR_FILTER_START);
+   l2c_write_sec(ALIGN(filter[0] + filter[1], SZ_1M),
+ l2x0_base, L310_ADDR_FILTER_END);
+   l2c_write_sec((filter[0] & ~(SZ_1M - 1)) | L310_ADDR_FILTER_EN,
+ l2x0_base, L310_ADDR_FILTER_START);
}
 
ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_512K);
-- 
1.9.2

--
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 v12 8/9] ARM: EXYNOS: Add support for non-secure L2X0 resume

2015-01-07 Thread Marek Szyprowski
From: Tomasz Figa 

On Exynos SoCs it is necessary to resume operation of L2C early in
assembly code, because otherwise certain systems will crash. This patch
adds necessary code to non-secure resume handler.

Signed-off-by: Tomasz Figa 
[rewrote the code accessing l2x0_saved_regs]
Signed-off-by: Marek Szyprowski 
Acked-by: Arnd Bergmann 
Acked-by: Kukjin Kim 
---
 arch/arm/mach-exynos/sleep.S | 46 
 1 file changed, 46 insertions(+)

diff --git a/arch/arm/mach-exynos/sleep.S b/arch/arm/mach-exynos/sleep.S
index e3c373082bbe..31d25834b9c4 100644
--- a/arch/arm/mach-exynos/sleep.S
+++ b/arch/arm/mach-exynos/sleep.S
@@ -16,6 +16,8 @@
  */
 
 #include 
+#include 
+#include 
 #include "smc.h"
 
 #define CPU_MASK   0xff00
@@ -74,6 +76,45 @@ ENTRY(exynos_cpu_resume_ns)
mov r0, #SMC_CMD_C15RESUME
dsb
smc #0
+#ifdef CONFIG_CACHE_L2X0
+   adr r0, 1f
+   ldr r2, [r0]
+   add r0, r2, r0
+
+   /* Check that the address has been initialised. */
+   ldr r1, [r0, #L2X0_R_PHY_BASE]
+   teq r1, #0
+   beq skip_l2x0
+
+   /* Check if controller has been enabled. */
+   ldr r2, [r1, #L2X0_CTRL]
+   tst r2, #0x1
+   bne skip_l2x0
+
+   ldr r1, [r0, #L2X0_R_TAG_LATENCY]
+   ldr r2, [r0, #L2X0_R_DATA_LATENCY]
+   ldr r3, [r0, #L2X0_R_PREFETCH_CTRL]
+   mov r0, #SMC_CMD_L2X0SETUP1
+   smc #0
+
+   /* Reload saved regs pointer because smc corrupts registers. */
+   adr r0, 1f
+   ldr r2, [r0]
+   add r0, r2, r0
+
+   ldr r1, [r0, #L2X0_R_PWR_CTRL]
+   ldr r2, [r0, #L2X0_R_AUX_CTRL]
+   mov r0, #SMC_CMD_L2X0SETUP2
+   smc #0
+
+   mov r0, #SMC_CMD_L2X0INVALL
+   smc #0
+
+   mov r1, #1
+   mov r0, #SMC_CMD_L2X0CTRL
+   smc #0
+skip_l2x0:
+#endif /* CONFIG_CACHE_L2X0 */
 skip_cp15:
b   cpu_resume
 ENDPROC(exynos_cpu_resume_ns)
@@ -83,3 +124,8 @@ cp15_save_diag:
.globl cp15_save_power
 cp15_save_power:
.long   0   @ cp15 power control
+
+#ifdef CONFIG_CACHE_L2X0
+   .align
+1: .long   l2x0_saved_regs - .
+#endif /* CONFIG_CACHE_L2X0 */
-- 
1.9.2

--
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 v12 7/9] ARM: EXYNOS: Add .write_sec outer cache callback for L2C-310

2015-01-07 Thread Marek Szyprowski
From: Tomasz Figa 

Exynos4 SoCs equipped with an L2C-310 cache controller and running under
secure firmware require certain registers of aforementioned IP to be
accessed only from secure mode. This means that SMC calls are required
for certain register writes. To handle this, an implementation of
.write_sec and .configure callbacks is provided by this patch.

Signed-off-by: Tomasz Figa 
[added comment and reworked unconditional call to SMC_CMD_L2X0INVALL]
Signed-off-by: Marek Szyprowski 
Acked-by: Arnd Bergmann 
Acked-by: Kukjin Kim 
---
 arch/arm/mach-exynos/firmware.c | 50 +
 1 file changed, 50 insertions(+)

diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
index 766f57d2f029..4791a3cc00f9 100644
--- a/arch/arm/mach-exynos/firmware.c
+++ b/arch/arm/mach-exynos/firmware.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -136,6 +137,43 @@ static const struct firmware_ops exynos_firmware_ops = {
.resume = IS_ENABLED(CONFIG_EXYNOS_CPU_SUSPEND) ? 
exynos_resume : NULL,
 };
 
+static void exynos_l2_write_sec(unsigned long val, unsigned reg)
+{
+   static int l2cache_enabled;
+
+   switch (reg) {
+   case L2X0_CTRL:
+   if (val & L2X0_CTRL_EN) {
+   /*
+* Before the cache can be enabled, due to firmware
+* design, SMC_CMD_L2X0INVALL must be called.
+*/
+   if (!l2cache_enabled) {
+   exynos_smc(SMC_CMD_L2X0INVALL, 0, 0, 0);
+   l2cache_enabled = 1;
+   }
+   } else {
+   l2cache_enabled = 0;
+   }
+   exynos_smc(SMC_CMD_L2X0CTRL, val, 0, 0);
+   break;
+
+   case L2X0_DEBUG_CTRL:
+   exynos_smc(SMC_CMD_L2X0DEBUG, val, 0, 0);
+   break;
+
+   default:
+   WARN_ONCE(1, "%s: ignoring write to reg 0x%x\n", __func__, reg);
+   }
+}
+
+static void exynos_l2_configure(const struct l2x0_regs *regs)
+{
+   exynos_smc(SMC_CMD_L2X0SETUP1, regs->tag_latency, regs->data_latency,
+  regs->prefetch_ctrl);
+   exynos_smc(SMC_CMD_L2X0SETUP2, regs->pwr_ctrl, regs->aux_ctrl, 0);
+}
+
 void __init exynos_firmware_init(void)
 {
struct device_node *nd;
@@ -155,4 +193,16 @@ void __init exynos_firmware_init(void)
pr_info("Running under secure firmware.\n");
 
register_firmware_ops(&exynos_firmware_ops);
+
+   /*
+* Exynos 4 SoCs (based on Cortex A9 and equipped with L2C-310),
+* running under secure firmware, require certain registers of L2
+* cache controller to be written in secure mode. Here .write_sec
+* callback is provided to perform necessary SMC calls.
+*/
+   if (IS_ENABLED(CONFIG_CACHE_L2X0) &&
+   read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
+   outer_cache.write_sec = exynos_l2_write_sec;
+   outer_cache.configure = exynos_l2_configure;
+   }
 }
-- 
1.9.2

--
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 v12 6/9] ARM: l2c: Add support for overriding prefetch settings

2015-01-07 Thread Marek Szyprowski
From: Tomasz Figa 

Firmware on certain boards (e.g. ODROID-U3) can leave incorrect L2C prefetch
settings configured in registers leading to crashes if L2C is enabled
without overriding them. This patch introduces bindings to enable
prefetch settings to be specified from DT and necessary support in the
driver.

Signed-off-by: Tomasz Figa 
[mszyprow: rebased onto v3.18-rc1, added error message when prefetch related
 dt property has been provided without any value]
Signed-off-by: Marek Szyprowski 
Tested-by: Nishanth Menon 
Acked-by: Nishanth Menon 
Acked-by: Tony Lindgren 
---
 Documentation/devicetree/bindings/arm/l2cc.txt | 10 +
 arch/arm/mm/cache-l2x0.c   | 54 ++
 2 files changed, 64 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/l2cc.txt 
b/Documentation/devicetree/bindings/arm/l2cc.txt
index 292ef7ca3058..0dbabe9a6b0a 100644
--- a/Documentation/devicetree/bindings/arm/l2cc.txt
+++ b/Documentation/devicetree/bindings/arm/l2cc.txt
@@ -57,6 +57,16 @@ Optional properties:
 - cache-id-part: cache id part number to be used if it is not present
   on hardware
 - wt-override: If present then L2 is forced to Write through mode
+- arm,double-linefill : Override double linefill enable setting. Enable if
+  non-zero, disable if zero.
+- arm,double-linefill-incr : Override double linefill on INCR read. Enable
+  if non-zero, disable if zero.
+- arm,double-linefill-wrap : Override double linefill on WRAP read. Enable
+  if non-zero, disable if zero.
+- arm,prefetch-drop : Override prefetch drop enable setting. Enable if 
non-zero,
+  disable if zero.
+- arm,prefetch-offset : Override prefetch offset value. Valid values are
+  0-7, 15, 23, and 31.
 
 Example:
 
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 5288153f28b8..01de13809454 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -1169,6 +1169,8 @@ static void __init l2c310_of_parse(const struct 
device_node *np,
u32 tag[3] = { 0, 0, 0 };
u32 filter[2] = { 0, 0 };
u32 assoc;
+   u32 prefetch;
+   u32 val;
int ret;
 
of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag));
@@ -1214,6 +1216,58 @@ static void __init l2c310_of_parse(const struct 
device_node *np,
   assoc);
break;
}
+
+   prefetch = l2x0_saved_regs.prefetch_ctrl;
+
+   ret = of_property_read_u32(np, "arm,double-linefill", &val);
+   if (ret == 0) {
+   if (val)
+   prefetch |= L310_PREFETCH_CTRL_DBL_LINEFILL;
+   else
+   prefetch &= ~L310_PREFETCH_CTRL_DBL_LINEFILL;
+   } else if (ret != -EINVAL) {
+   pr_err("L2C-310 OF arm,double-linefill property value is 
missing\n");
+   }
+
+   ret = of_property_read_u32(np, "arm,double-linefill-incr", &val);
+   if (ret == 0) {
+   if (val)
+   prefetch |= L310_PREFETCH_CTRL_DBL_LINEFILL_INCR;
+   else
+   prefetch &= ~L310_PREFETCH_CTRL_DBL_LINEFILL_INCR;
+   } else if (ret != -EINVAL) {
+   pr_err("L2C-310 OF arm,double-linefill-incr property value is 
missing\n");
+   }
+
+   ret = of_property_read_u32(np, "arm,double-linefill-wrap", &val);
+   if (ret == 0) {
+   if (!val)
+   prefetch |= L310_PREFETCH_CTRL_DBL_LINEFILL_WRAP;
+   else
+   prefetch &= ~L310_PREFETCH_CTRL_DBL_LINEFILL_WRAP;
+   } else if (ret != -EINVAL) {
+   pr_err("L2C-310 OF arm,double-linefill-wrap property value is 
missing\n");
+   }
+
+   ret = of_property_read_u32(np, "arm,prefetch-drop", &val);
+   if (ret == 0) {
+   if (val)
+   prefetch |= L310_PREFETCH_CTRL_PREFETCH_DROP;
+   else
+   prefetch &= ~L310_PREFETCH_CTRL_PREFETCH_DROP;
+   } else if (ret != -EINVAL) {
+   pr_err("L2C-310 OF arm,prefetch-drop property value is 
missing\n");
+   }
+
+   ret = of_property_read_u32(np, "arm,prefetch-offset", &val);
+   if (ret == 0) {
+   prefetch &= ~L310_PREFETCH_CTRL_OFFSET_MASK;
+   prefetch |= val & L310_PREFETCH_CTRL_OFFSET_MASK;
+   } else if (ret != -EINVAL) {
+   pr_err("L2C-310 OF arm,prefetch-offset property value is 
missing\n");
+   }
+
+   l2x0_saved_regs.prefetch_ctrl = prefetch;
 }
 
 static const struct l2c_init_data of_l2c310_data __initconst = {
-- 
1.9.2

--
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 v12 9/9] ARM: dts: exynos4: Add nodes for L2 cache controller

2015-01-07 Thread Marek Szyprowski
From: Tomasz Figa 

This patch adds device tree nodes for L2 cache controller present on
Exynos4 SoCs.

Signed-off-by: Tomasz Figa 
Signed-off-by: Marek Szyprowski 
Acked-by: Arnd Bergmann 
Acked-by: Kukjin Kim 
---
 arch/arm/boot/dts/exynos4210.dtsi |  9 +
 arch/arm/boot/dts/exynos4x12.dtsi | 14 ++
 2 files changed, 23 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4210.dtsi 
b/arch/arm/boot/dts/exynos4210.dtsi
index bcc9e63c8070..8e45ea44317e 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -81,6 +81,15 @@
reg = <0x10023CA0 0x20>;
};
 
+   l2c: l2-cache-controller@10502000 {
+   compatible = "arm,pl310-cache";
+   reg = <0x10502000 0x1000>;
+   cache-unified;
+   cache-level = <2>;
+   arm,tag-latency = <2 2 1>;
+   arm,data-latency = <2 2 1>;
+   };
+
gic: interrupt-controller@1049 {
cpu-offset = <0x8000>;
};
diff --git a/arch/arm/boot/dts/exynos4x12.dtsi 
b/arch/arm/boot/dts/exynos4x12.dtsi
index 93b70402e943..8bc97c415c9a 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -54,6 +54,20 @@
reg = <0x10023CA0 0x20>;
};
 
+   l2c: l2-cache-controller@10502000 {
+   compatible = "arm,pl310-cache";
+   reg = <0x10502000 0x1000>;
+   cache-unified;
+   cache-level = <2>;
+   arm,tag-latency = <2 2 1>;
+   arm,data-latency = <3 2 1>;
+   arm,double-linefill = <1>;
+   arm,double-linefill-incr = <0>;
+   arm,double-linefill-wrap = <1>;
+   arm,prefetch-drop = <1>;
+   arm,prefetch-offset = <7>;
+   };
+
clock: clock-controller@1003 {
compatible = "samsung,exynos4412-clock";
reg = <0x1003 0x2>;
-- 
1.9.2

--
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 v11 3/9] ARM: l2c: Refactor the driver to use commit-like interface

2015-01-07 Thread Marek Szyprowski

Hello,

On 2015-01-05 18:22, Nishanth Menon wrote:

On 13:19-20150105, Marek Szyprowski wrote:

From: Tomasz Figa 

Certain implementations of secure hypervisors (namely the one found on
Samsung Exynos-based boards) do not provide access to individual L2C
registers. This makes the .write_sec()-based interface insufficient and
provoking ugly hacks.

This patch is first step to make the driver not rely on availability of
writes to individual registers. This is achieved by refactoring the
driver to use a commit-like operation scheme: all register values are
prepared first and stored in an instance of l2x0_regs struct and then a
single callback is responsible to flush those values to the hardware.

Signed-off-by: Tomasz Figa 
[mszyprow: rebased onto 'ARM: l2c: use l2c_write_sec() for restoring
  latency and filter regs' patch]
Signed-off-by: Marek Szyprowski 
---
  arch/arm/mm/cache-l2x0.c | 210 ++-
  1 file changed, 115 insertions(+), 95 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 0aeeaa95c42d..f9013320c8ce 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -41,12 +41,14 @@ struct l2c_init_data {
void (*enable)(void __iomem *, u32, unsigned);
void (*fixup)(void __iomem *, u32, struct outer_cache_fns *);
void (*save)(void __iomem *);
+   void (*configure)(void __iomem *);
struct outer_cache_fns outer_cache;
  };
  
  #define CACHE_LINE_SIZE		32
  
  static void __iomem *l2x0_base;

+static const struct l2c_init_data *l2x0_data;
  static DEFINE_RAW_SPINLOCK(l2x0_lock);
  static u32 l2x0_way_mask; /* Bitmask of active ways */
  static u32 l2x0_size;
@@ -106,6 +108,14 @@ static inline void l2c_unlock(void __iomem *base, unsigned 
num)
}
  }
  
+static void l2c_configure(void __iomem *base)

+{
+   if (l2x0_data->configure)
+   l2x0_data->configure(base);
+
+   l2c_write_sec(l2x0_saved_regs.aux_ctrl, base, L2X0_AUX_CTRL);
+}
+
  /*
   * Enable the L2 cache controller.  This function must only be
   * called when the cache controller is known to be disabled.
@@ -114,7 +124,12 @@ static void l2c_enable(void __iomem *base, u32 aux, 
unsigned num_lock)
  {
unsigned long flags;
  
-	l2c_write_sec(aux, base, L2X0_AUX_CTRL);

+   /* Do not touch the controller if already enabled. */
+   if (readl_relaxed(base + L2X0_CTRL) & L2X0_CTRL_EN)
+   return;
+
+   l2x0_saved_regs.aux_ctrl = aux;
+   l2c_configure(base);
  
  	l2c_unlock(base, num_lock);
  
@@ -208,6 +223,11 @@ static void l2c_save(void __iomem *base)

l2x0_saved_regs.aux_ctrl = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
  }
  
+static void l2c_resume(void)

+{
+   l2c_enable(l2x0_base, l2x0_saved_regs.aux_ctrl, l2x0_data->num_lock);
+}
+
  /*
   * L2C-210 specific code.
   *
@@ -288,14 +308,6 @@ static void l2c210_sync(void)
__l2c210_cache_sync(l2x0_base);
  }
  
-static void l2c210_resume(void)

-{
-   void __iomem *base = l2x0_base;
-
-   if (!(readl_relaxed(base + L2X0_CTRL) & L2X0_CTRL_EN))
-   l2c_enable(base, l2x0_saved_regs.aux_ctrl, 1);
-}
-
  static const struct l2c_init_data l2c210_data __initconst = {
.type = "L2C-210",
.way_size_0 = SZ_8K,
@@ -309,7 +321,7 @@ static const struct l2c_init_data l2c210_data __initconst = 
{
.flush_all = l2c210_flush_all,
.disable = l2c_disable,
.sync = l2c210_sync,
-   .resume = l2c210_resume,
+   .resume = l2c_resume,
},
  };
  
@@ -466,7 +478,7 @@ static const struct l2c_init_data l2c220_data = {

.flush_all = l2c220_flush_all,
.disable = l2c_disable,
.sync = l2c220_sync,
-   .resume = l2c210_resume,
+   .resume = l2c_resume,
},
  };
  
@@ -615,39 +627,29 @@ static void __init l2c310_save(void __iomem *base)

L310_POWER_CTRL);
  }
  
-static void l2c310_resume(void)

+static void l2c310_configure(void __iomem *base)
  {
-   void __iomem *base = l2x0_base;
+   unsigned revision;
  
-	if (!(readl_relaxed(base + L2X0_CTRL) & L2X0_CTRL_EN)) {

-   unsigned revision;
-
-   /* restore pl310 setup */
-   l2c_write_sec(l2x0_saved_regs.tag_latency, base,
- L310_TAG_LATENCY_CTRL);
-   l2c_write_sec(l2x0_saved_regs.data_latency, base,
- L310_DATA_LATENCY_CTRL);
-   l2c_write_sec(l2x0_saved_regs.filter_end, base,
- L310_ADDR_FILTER_END);
-   l2c_write_sec(l2x0_saved_regs.filter_start, base,
- L310_ADDR_FILTER_START);
-
-   revision = readl_relaxed(base + L2X0_CACHE_ID) &
-   L2X0_CACHE_ID_RTL_MASK;
-
-   if (revision >

RE: [PATCH v2 2/2] [media] s5p-jpeg: Adding Exynos7 JPEG variant

2015-01-07 Thread Tony K Nadackal
Hi Jacek,

On  Wednesday, January 07, 2015 3:43 PM : Jacek Anaszewski wrote,

> Hi Tony,
> 
> On 12/19/2014 08:38 AM, Tony K Nadackal wrote:
> > Fimp_jpeg used in Exynos7 is a revised version. Some register
> > configurations are slightly different from JPEG in Exynos4.
> > Added one more variant SJPEG_EXYNOS7 to handle these differences.
> >
> > Signed-off-by: Tony K Nadackal 
> > ---
> >   .../bindings/media/exynos-jpeg-codec.txt   |  2 +-
> >   drivers/media/platform/s5p-jpeg/jpeg-core.c| 61
++-
> ---
> >   drivers/media/platform/s5p-jpeg/jpeg-core.h| 10 ++--
> >   drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c  | 32 ++--
> >   drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.h  |  8 +--
> >   drivers/media/platform/s5p-jpeg/jpeg-regs.h| 17 --
> >   6 files changed, 93 insertions(+), 37 deletions(-)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
> > b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
> > index bf52ed4..cd19417 100644
> > --- a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
> > +++ b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
> > @@ -4,7 +4,7 @@ Required properties:
> >
> >   - compatible  : should be one of:
> >   "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg",
> > - "samsung,exynos3250-jpeg";
> > + "samsung,exynos3250-jpeg", "samsung,exynos7-jpeg";
> >   - reg : address and length of the JPEG codec IP register set;
> >   - interrupts  : specifies the JPEG codec IP interrupt;
> >   - clock-names   : should contain:
> 
> This should be put in a separate patch.

Checkpatch gives warning if this change is not there.
If that is ok with you, I will make this change a separate patch. 

[snip]

> --
> Best Regards,
> Jacek Anaszewski

Thanks and Regards,
Tony

--
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 v11 2/9] ARM: l2c: use l2c_write_sec() for restoring latency and filter regs

2015-01-07 Thread Marek Szyprowski

Hello,

On 2015-01-05 18:20, Nishanth Menon wrote:

On 13:19-20150105, Marek Szyprowski wrote:

All four register for latency and filter settings cannot be written in
non-secure mode and they should go through l2c_write_sec(). More on this
can be found in CoreLink Level 2 Cache Controller L2C-310 Technical
Reference Manual, 3.2. Register summary, table 3.1. This have been checked
the TRM for r3p3, but it should be uniform for all revisions.

Reported-by: Nishanth Menon 
Suggested-by: Tomasz Figa 
Signed-off-by: Marek Szyprowski 
---
  arch/arm/mm/cache-l2x0.c | 16 
  1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 5e65ca8dea62..0aeeaa95c42d 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -623,14 +623,14 @@ static void l2c310_resume(void)
unsigned revision;
  
  		/* restore pl310 setup */

-   writel_relaxed(l2x0_saved_regs.tag_latency,
-  base + L310_TAG_LATENCY_CTRL);
-   writel_relaxed(l2x0_saved_regs.data_latency,
-  base + L310_DATA_LATENCY_CTRL);
-   writel_relaxed(l2x0_saved_regs.filter_end,
-  base + L310_ADDR_FILTER_END);
-   writel_relaxed(l2x0_saved_regs.filter_start,
-  base + L310_ADDR_FILTER_START);
+   l2c_write_sec(l2x0_saved_regs.tag_latency, base,
+ L310_TAG_LATENCY_CTRL);
+   l2c_write_sec(l2x0_saved_regs.data_latency, base,
+ L310_DATA_LATENCY_CTRL);
+   l2c_write_sec(l2x0_saved_regs.filter_end, base,
+ L310_ADDR_FILTER_END);
+   l2c_write_sec(l2x0_saved_regs.filter_start, base,
+ L310_ADDR_FILTER_START);
  
  		revision = readl_relaxed(base + L2X0_CACHE_ID) &

L2X0_CACHE_ID_RTL_MASK;

Do you need the following as well at this point in the patch series?
Agreed that the writes will disappear later in the series.


Right. Thanks for pointing this. I will send an updated version, which
will also fix the checkpatch --strict issues.


diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 0aeeaa9..7afab37 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -1135,28 +1135,28 @@ static void __init l2c310_of_parse(const struct 
device_node *np,
  
  	of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag));

if (tag[0] && tag[1] && tag[2])
-   writel_relaxed(
+   l2c_write_sec(
L310_LATENCY_CTRL_RD(tag[0] - 1) |
L310_LATENCY_CTRL_WR(tag[1] - 1) |
L310_LATENCY_CTRL_SETUP(tag[2] - 1),
-   l2x0_base + L310_TAG_LATENCY_CTRL);
+   l2x0_base, L310_TAG_LATENCY_CTRL);
  
  	of_property_read_u32_array(np, "arm,data-latency",

   data, ARRAY_SIZE(data));
if (data[0] && data[1] && data[2])
-   writel_relaxed(
+   l2c_write_sec(
L310_LATENCY_CTRL_RD(data[0] - 1) |
L310_LATENCY_CTRL_WR(data[1] - 1) |
L310_LATENCY_CTRL_SETUP(data[2] - 1),
-   l2x0_base + L310_DATA_LATENCY_CTRL);
+   l2x0_base,  L310_DATA_LATENCY_CTRL);
  
  	of_property_read_u32_array(np, "arm,filter-ranges",

   filter, ARRAY_SIZE(filter));
if (filter[1]) {
-   writel_relaxed(ALIGN(filter[0] + filter[1], SZ_1M),
-  l2x0_base + L310_ADDR_FILTER_END);
-   writel_relaxed((filter[0] & ~(SZ_1M - 1)) | L310_ADDR_FILTER_EN,
-  l2x0_base + L310_ADDR_FILTER_START);
+   l2c_write_sec(ALIGN(filter[0] + filter[1], SZ_1M),
+  l2x0_base, L310_ADDR_FILTER_END);
+   l2c_write_sec((filter[0] & ~(SZ_1M - 1)) | L310_ADDR_FILTER_EN,
+  l2x0_base, L310_ADDR_FILTER_START);
}
  
  	ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_512K);
  


Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

--
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 2/2] [media] s5p-jpeg: Adding Exynos7 JPEG variant

2015-01-07 Thread Jacek Anaszewski

Hi Tony,

On 12/19/2014 08:38 AM, Tony K Nadackal wrote:

Fimp_jpeg used in Exynos7 is a revised version. Some register
configurations are slightly different from JPEG in Exynos4.
Added one more variant SJPEG_EXYNOS7 to handle these differences.

Signed-off-by: Tony K Nadackal 
---
  .../bindings/media/exynos-jpeg-codec.txt   |  2 +-
  drivers/media/platform/s5p-jpeg/jpeg-core.c| 61 ++
  drivers/media/platform/s5p-jpeg/jpeg-core.h| 10 ++--
  drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c  | 32 ++--
  drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.h  |  8 +--
  drivers/media/platform/s5p-jpeg/jpeg-regs.h| 17 --
  6 files changed, 93 insertions(+), 37 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt 
b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
index bf52ed4..cd19417 100644
--- a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
+++ b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
@@ -4,7 +4,7 @@ Required properties:

  - compatible  : should be one of:
  "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg",
- "samsung,exynos3250-jpeg";
+ "samsung,exynos3250-jpeg", "samsung,exynos7-jpeg";
  - reg : address and length of the JPEG codec IP register set;
  - interrupts  : specifies the JPEG codec IP interrupt;
  - clock-names   : should contain:


This should be put in a separate patch.


diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 54fa5d9..204013e 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1225,8 +1225,9 @@ static int s5p_jpeg_try_fmt_vid_cap(struct file *file, 
void *priv,
return -EINVAL;
}

-   if ((ctx->jpeg->variant->version != SJPEG_EXYNOS4) ||
-   (ctx->mode != S5P_JPEG_DECODE))
+   if (((ctx->jpeg->variant->version != SJPEG_EXYNOS4) &&
+   (ctx->jpeg->variant->version != SJPEG_EXYNOS7)) ||
+   (ctx->mode != S5P_JPEG_DECODE))
goto exit;

/*
@@ -1349,7 +1350,8 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, struct 
v4l2_format *f)
 * the JPEG_IMAGE_SIZE register. In order to avoid sysmmu
 * page fault calculate proper buffer size in such a case.
 */
-   if (ct->jpeg->variant->version == SJPEG_EXYNOS4 &&
+   if (((ct->jpeg->variant->version == SJPEG_EXYNOS4) ||
+   (ct->jpeg->variant->version == SJPEG_EXYNOS7)) &&
f_type == FMT_TYPE_OUTPUT && ct->mode == S5P_JPEG_ENCODE)
q_data->size = exynos4_jpeg_get_output_buffer_size(ct,
f,
@@ -1901,7 +1903,8 @@ static void exynos4_jpeg_device_run(void *priv)

if (ctx->mode == S5P_JPEG_ENCODE) {
exynos4_jpeg_sw_reset(jpeg->regs);
-   exynos4_jpeg_set_interrupt(jpeg->regs);
+   exynos4_jpeg_set_interrupt(jpeg->regs,
+   ctx->jpeg->variant->version);
exynos4_jpeg_set_huf_table_enable(jpeg->regs, 1);

exynos4_jpeg_set_huff_tbl(jpeg->regs);
@@ -1918,20 +1921,50 @@ static void exynos4_jpeg_device_run(void *priv)
exynos4_jpeg_set_stream_size(jpeg->regs, ctx->cap_q.w,
ctx->cap_q.h);

-   exynos4_jpeg_set_enc_out_fmt(jpeg->regs, ctx->subsampling);
-   exynos4_jpeg_set_img_fmt(jpeg->regs, ctx->out_q.fmt->fourcc);
+   exynos4_jpeg_set_enc_out_fmt(jpeg->regs, ctx->subsampling,
+   (ctx->jpeg->variant->version == SJPEG_EXYNOS4) ?
+   EXYNOS4_ENC_FMT_MASK :
+   EXYNOS7_ENC_FMT_MASK);
+   exynos4_jpeg_set_img_fmt(jpeg->regs, ctx->out_q.fmt->fourcc,
+   (ctx->jpeg->variant->version == SJPEG_EXYNOS4) ?
+   EXYNOS4_SWAP_CHROMA_SHIFT :
+   EXYNOS7_SWAP_CHROMA_SHIFT);
exynos4_jpeg_set_img_addr(ctx);
exynos4_jpeg_set_jpeg_addr(ctx);
exynos4_jpeg_set_encode_hoff_cnt(jpeg->regs,
ctx->out_q.fmt->fourcc);
} else {
exynos4_jpeg_sw_reset(jpeg->regs);
-   exynos4_jpeg_set_interrupt(jpeg->regs);
+   exynos4_jpeg_set_interrupt(jpeg->regs,
+   ctx->jpeg->variant->version);
exynos4_jpeg_set_img_addr(ctx);
exynos4_jpeg_set_jpeg_addr(ctx);
-   exynos4_jpeg_set_img_fmt(jpeg->regs, ctx->cap_q.fmt->fourcc);

-

Re: [PATCH v2 1/2] [media] s5p-jpeg: Fix modification sequence of interrupt enable register

2015-01-07 Thread Jacek Anaszewski

Hi Tony,

On 12/19/2014 08:37 AM, Tony K Nadackal wrote:

Fix the bug in modifying the interrupt enable register.


For Exynos4 this was not a bug as there are only five bit fields
used in the EXYNOS4_INT_EN_REG - all of them enable related
interrupt signal and EXYNOS4_INT_EN_ALL value is 0x1f which
just sets these bit fields to 1.

If for Exynos7 there are other bit fields in this register
and it has to be read prior setting to find out current
state then I'd parametrize this function with version argument
as you do it in the patch adding support for Exynos7, but
for Exynos4 case I'd left the behaviour as it is currenlty, i.e.
avoid reading the register and do it only for Exynos7 case.
Effectively, this patch is not required, as it doesn't fix
anything but adds redundant call to readl.


Signed-off-by: Tony K Nadackal 
---
  drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c 
b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
index e53f13a..a61ff7e 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
@@ -155,7 +155,10 @@ void exynos4_jpeg_set_enc_out_fmt(void __iomem *base, 
unsigned int out_fmt)

  void exynos4_jpeg_set_interrupt(void __iomem *base)
  {
-   writel(EXYNOS4_INT_EN_ALL, base + EXYNOS4_INT_EN_REG);
+   unsigned int reg;
+
+   reg = readl(base + EXYNOS4_INT_EN_REG) & ~EXYNOS4_INT_EN_MASK;
+   writel(reg | EXYNOS4_INT_EN_ALL, base + EXYNOS4_INT_EN_REG);
  }

  unsigned int exynos4_jpeg_get_int_status(void __iomem *base)




--
Best Regards,
Jacek Anaszewski
--
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 00/19] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem

2015-01-07 Thread Joonyoung Shim
Hi Javier,

On 01/07/2015 06:33 PM, Javier Martinez Canillas wrote:
> Hello Joonyoung,
> 
> On 01/07/2015 03:03 AM, Joonyoung Shim wrote:
>> On 01/06/2015 06:49 PM, Javier Martinez Canillas wrote:
>>>
>>> Also I tried forcing the kernel to not disable unused power domains by
>>> passing the pd_ignore_unused parameter to the kernel command line. I
>>> see on the kernel log a "genpd: Not disabling unused power domains"
>>> message but HDMI output still has the stripes that Sjoerd mentioned.
>>> Do you know if Exynos DRM HDMI in mainline is supposed to work without
>>> SysMMU / IOMMU support?
>>>
>>
>> I don't think iommu support and power domain issue are related. I also
>> get displaying stripes via hdmi but it is just power domain issue
>> regardless iommu support.
>>
>> I observed 8th bit from 0x1445000C register of mixer is set to 1 with
>> displaying stripes. It means "The graphic layer0 line buffer underflow".
>> There was same underflow issue on Exynos4 based boards. As Marek said,
>> because LCD0 power domain was turned off.
>>
> 
> Interesting, thanks a lot for sharing this information.
>  
>> I just tried to turn off DISP1 power domain at u-boot and DISP1 power
>> domain is turned on from kernel hdmi and mixer driver on odroid xu3 
>> board. As the result, i can see displaying penguin logo from hdmi.
>>
> 
> Can you share the patches you are using to turn on the DISP1 power domain
> since AFAIU the kernel does not know about the DISP1 power domain after
> commit d51cad7df871 ("ARM: dts: remove display power domain for exynos5420").
> 
> I tried reverting that commit before so the kernel knows about the DISP1
> power domain and booting with pd_ignore_unused but still had the stripes.
>  

I add DISP1 power domain on dts and please refer below patch[0] with
some modification on hdmi phy(Actually, i think this is not related).
You also should disable DISP1 power domain from bootloader.

>> But the problem exists still because it is failed to control on/off of
>> DISP1 power domain more than twice from kernel hdmi and mixer driver.[0]
>>
> 
> Something that is not clear to me is how display panel is working on the
> Peach boards if this is a power domain issue since according to the manual
> both the modules used for display (LCD controller and DP) and the modules
> used for HDMI (MIXER and HDMI) belong to the same power domain (DISP1).
> 

I don't know about that because i just tested on odroid xu3 board
without display panel. Hmm, It can be any conditions to success on/off
power domain e.g. power state of clocks and of on/off order display
devices.

Is DISP1 power domain disabled on Peach boards to save power, not always
on?

> Or am I misunderstanding something? 
> 
> Thanks a lot for your help and best regards,
> Javier
> 

Thanks.

[0]:
---
 arch/arm/boot/dts/exynos5420.dtsi  | 10 ++
 drivers/clk/samsung/clk-exynos5420.c   |  4 ++--
 drivers/gpu/drm/exynos/exynos_hdmi.c   |  8 ++--
 include/dt-bindings/clock/exynos5420.h |  2 ++
 4 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 8617a03..ff9ad4a 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -270,6 +270,14 @@
reg = <0x10044120 0x20>;
};
 
+   disp1_pd: power-domain@100440C0 {
+   compatible = "samsung,exynos4210-pd";
+   reg = <0x100440C0 0x20>;
+   clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_SW_ACLK200>,
+   <&clock CLK_MOUT_USER_ACLK200_DISP1>;
+   clock-names = "oscclk", "pclk0", "clk0";
+   };
+
pinctrl_0: pinctrl@1340 {
compatible = "samsung,exynos5420-pinctrl";
reg = <0x1340 0x1000>;
@@ -704,6 +712,7 @@
"sclk_hdmiphy", "mout_hdmi";
phy = <&hdmiphy>;
samsung,syscon-phandle = <&pmu_system_controller>;
+   samsung,power-domain = <&disp1_pd>;
status = "disabled";
};
 
@@ -717,6 +726,7 @@
interrupts = <0 94 0>;
clocks = <&clock CLK_MIXER>, <&clock CLK_SCLK_HDMI>;
clock-names = "mixer", "sclk_hdmi";
+   samsung,power-domain = <&disp1_pd>;
};
 
gsc_0: video-scaler@13e0 {
diff --git a/drivers/clk/samsung/clk-exynos5420.c 
b/drivers/clk/samsung/clk-exynos5420.c
index 848d602..52ba0e6 100644
--- a/drivers/clk/samsung/clk-exynos5420.c
+++ b/drivers/clk/samsung/clk-exynos5420.c
@@ -635,7 +635,7 @@ static struct samsung_mux_clock exynos5x_mux_clks[] 
__initdata = {
SRC_TOP3, 0, 1),
MUX(0, "mout_user_aclk400_mscl", mout_user_aclk400_mscl_p,
SRC_TOP3, 4, 1),
-   MUX(0, "mout_user_aclk200_disp1", mout_user_aclk200_disp1_p,
+   MUX(CLK_MOUT_USER_ACLK200_DISP1, "mout_user_aclk200_disp1", 
mout_user_aclk200_disp1_p,

[PATCH] ARM: dts: exynos4412-trats2: Add Maxim 77693 fuel gauge node

2015-01-07 Thread Krzysztof Kozlowski
Add node for fuel gauge present in Maxim 77693 PMIC. This allows control
over battery charging state on Trats2 board.

The fuel gauge is compatible with max17042 battery driver (Maxim
17042/17047/17050).  Although datasheet rev 2.2 for MAX77693 describes
fuel gauge as Maxim 17042-like, the chip on Trats2 board identifies
itself as Maxim 17047-like.

Signed-off-by: Krzysztof Kozlowski 
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts 
b/arch/arm/boot/dts/exynos4412-trats2.dts
index 496a05faca37..7b3e58d781d8 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -15,6 +15,7 @@
 /dts-v1/;
 #include "exynos4412.dtsi"
 #include 
+#include 
 
 / {
model = "Samsung Trats 2 based on Exynos4412";
@@ -24,6 +25,7 @@
i2c9 = &i2c_ak8975;
i2c10 = &i2c_cm36651;
i2c11 = &i2c_max77693;
+   i2c12 = &i2c_max77693_fuel;
};
 
memory {
@@ -562,6 +564,22 @@
};
};
 
+   i2c_max77693_fuel: i2c-gpio-3 {
+   compatible = "i2c-gpio";
+   gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>, <&gpf1 4 GPIO_ACTIVE_HIGH>;
+   i2c-gpio,delay-us = <2>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   max77693-fuel-gauge@36 {
+   compatible = "maxim,max17047";
+   interrupt-parent = <&gpx2>;
+   interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
+   reg = <0x36>;
+   };
+   };
+
mmc@1255 {
num-slots = <1>;
broken-cd;
-- 
1.9.1

--
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] [media] s5p-jpeg: Adding Exynos7 Jpeg variant support

2015-01-07 Thread Jacek Anaszewski

Hi Tony,

Sorry for late response, just got back from vacation.

On 12/19/2014 04:37 AM, Tony K Nadackal wrote:

Hi Jacek,

On Wednesday, December 17, 2014 7:46 PM Jacek Anaszewski wrote,

Hi Tony,

Thanks for the patches.



Thanks for the review.


Please process them with scripts/checkpatch.pl as you will be submitting the

next

version - they contain many coding style related issues.



I ran checkpatch before posting. Do you find any checkpatch related issues in
the patch?


There was a problem on my side, sorry for making confusion.


My remaining comments below.



[snip]


+   if (ctx->jpeg->variant->version == SJPEG_EXYNOS7) {
+   exynos4_jpeg_set_interrupt(jpeg->regs,

SJPEG_EXYNOS7);

+   exynos4_jpeg_set_enc_out_fmt(jpeg->regs,
+   ctx->subsampling,

EXYNOS7_ENC_FMT_MASK);

+   exynos4_jpeg_set_img_fmt(jpeg->regs,
+   ctx->out_q.fmt->fourcc,
+   EXYNOS7_SWAP_CHROMA_SHIFT);
+   } else {
+   exynos4_jpeg_set_interrupt(jpeg->regs,

SJPEG_EXYNOS4);

+   exynos4_jpeg_set_enc_out_fmt(jpeg->regs,
+   ctx->subsampling,

EXYNOS4_ENC_FMT_MASK);

+   exynos4_jpeg_set_img_fmt(jpeg->regs,
+   ctx->out_q.fmt->fourcc,
+   EXYNOS4_SWAP_CHROMA_SHIFT);
+   }
+


I'd implement it this way:

exynos4_jpeg_set_interrupt(jpeg->regs, ctx->jpeg->variant->version);
exynos4_jpeg_set_enc_out_fmt(jpeg->regs, ctx->subsampling,
(ctx->jpeg->variant->version == SJPEG_EXYNOS4) ?
EXYNOS4_ENC_FMT_MASK :
EXYNOS7_ENC_FMT_MASK);
exynos4_jpeg_set_img_fmt(jpeg->regs, ctx->out_q.fmt->fourcc,
(ctx->jpeg->variant->version == SJPEG_EXYNOS4) ?
EXYNOS4_SWAP_CHROMA_SHIFT :
EXYNOS7_SWAP_CHROMA_SHIFT);



OK. Looks goods to me. Thanks for the suggestion.


exynos4_jpeg_set_img_addr(ctx);
exynos4_jpeg_set_jpeg_addr(ctx);
exynos4_jpeg_set_encode_hoff_cnt(jpeg->regs,
ctx->out_q.fmt->fourcc);
} else {
exynos4_jpeg_sw_reset(jpeg->regs);
-   exynos4_jpeg_set_interrupt(jpeg->regs);
exynos4_jpeg_set_img_addr(ctx);
exynos4_jpeg_set_jpeg_addr(ctx);
-   exynos4_jpeg_set_img_fmt(jpeg->regs, ctx->cap_q.fmt-
fourcc);

-   bitstream_size = DIV_ROUND_UP(ctx->out_q.size, 32);
+   if (ctx->jpeg->variant->version == SJPEG_EXYNOS7) {
+   exynos4_jpeg_set_interrupt(jpeg->regs,

SJPEG_EXYNOS7);

+   exynos4_jpeg_set_huff_tbl(jpeg->regs);
+   exynos4_jpeg_set_huf_table_enable(jpeg->regs, 1);
+
+   /*
+* JPEG IP allows storing 4 quantization tables
+* We fill table 0 for luma and table 1 for chroma
+*/
+   exynos4_jpeg_set_qtbl_lum(jpeg->regs,
+   ctx->compr_quality);
+   exynos4_jpeg_set_qtbl_chr(jpeg->regs,
+   ctx->compr_quality);


Is it really required to setup quantization tables for encoding?



Without setting up the quantization tables, encoder is working fine.
But, as per Exynos7 User Manual setting up the quantization tables are required
for encoding also.


Actually I intended to ask if setting the quantization tables is
required for *decoding*, as you set it also in decoding path, whereas
for Exynos4 it is not required. I looks strange for me as quantization
tables are usually required only for encoding raw images.
The same is related to huffman tables.


+   exynos4_jpeg_set_stream_size(jpeg->regs, ctx-
cap_q.w,
+   ctx->cap_q.h);


For exynos4 this function writes the number of samples per line and number
lines of the resulting JPEG image and is used only during encoding. Is the
semantics of the related register different in case of Exynos7?



Yes. In case of Exynos7 Encoding, This step is required.


Ack.


[snip]


--- a/drivers/media/platform/s5p-jpeg/jpeg-core.h
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.h
@@ -71,6 +71,7 @@
   #define SJPEG_S5P1
   #define SJPEG_EXYNOS3250 2
   #define SJPEG_EXYNOS43
+#define SJPEG_EXYNOS7  4


As you adding a new variant I propose to turn these macros into enum.



Ok. I will make this change in my next version.


Thanks.


[snip]


-void exynos4_jpeg_set_interrupt(void __iomem *b

Re: [PATCH v3 00/19] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem

2015-01-07 Thread Javier Martinez Canillas
Hello Joonyoung,

On 01/07/2015 03:03 AM, Joonyoung Shim wrote:
> On 01/06/2015 06:49 PM, Javier Martinez Canillas wrote:
>> 
>> Also I tried forcing the kernel to not disable unused power domains by
>> passing the pd_ignore_unused parameter to the kernel command line. I
>> see on the kernel log a "genpd: Not disabling unused power domains"
>> message but HDMI output still has the stripes that Sjoerd mentioned.
>> Do you know if Exynos DRM HDMI in mainline is supposed to work without
>> SysMMU / IOMMU support?
>> 
> 
> I don't think iommu support and power domain issue are related. I also
> get displaying stripes via hdmi but it is just power domain issue
> regardless iommu support.
> 
> I observed 8th bit from 0x1445000C register of mixer is set to 1 with
> displaying stripes. It means "The graphic layer0 line buffer underflow".
> There was same underflow issue on Exynos4 based boards. As Marek said,
> because LCD0 power domain was turned off.
>

Interesting, thanks a lot for sharing this information.
 
> I just tried to turn off DISP1 power domain at u-boot and DISP1 power
> domain is turned on from kernel hdmi and mixer driver on odroid xu3 
> board. As the result, i can see displaying penguin logo from hdmi.
>

Can you share the patches you are using to turn on the DISP1 power domain
since AFAIU the kernel does not know about the DISP1 power domain after
commit d51cad7df871 ("ARM: dts: remove display power domain for exynos5420").

I tried reverting that commit before so the kernel knows about the DISP1
power domain and booting with pd_ignore_unused but still had the stripes.
 
> But the problem exists still because it is failed to control on/off of
> DISP1 power domain more than twice from kernel hdmi and mixer driver.[0]
>

Something that is not clear to me is how display panel is working on the
Peach boards if this is a power domain issue since according to the manual
both the modules used for display (LCD controller and DP) and the modules
used for HDMI (MIXER and HDMI) belong to the same power domain (DISP1).

Or am I misunderstanding something? 

Thanks a lot for your help and best regards,
Javier
--
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_defconfig: Enable CONFIG_LOCKUP_DETECTOR

2015-01-07 Thread Krzysztof Kozlowski
On wto, 2015-01-06 at 23:12 +0530, Anand Moon wrote:
> ARM Enable CONFIG_LOCKUP_DETECTOR to validaion of kernel locks
s/validaion/validation/

This config item helps getting some useful information when lockup
happens. If you want to validate locks then probably you want
PROVE_LOCKING... but its overhead is larger.

Anyway the overhead of LOCKUP_DETECTOR is small and multi_v7_defconfig
has it enabled so I guess exynos may do it as well.

Could you only fix up the commit msg?


Reviewed-by: Krzysztof Kozlowski 


Best regards,
Krzysztof

> 
> Tested on Exynos5422 ODROID XU3 board.
> 
> Signed-off-by: Anand Moon 
> ---
>  arch/arm/configs/exynos_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/configs/exynos_defconfig 
> b/arch/arm/configs/exynos_defconfig
> index 5ef14de..ecd9987 100644
> --- a/arch/arm/configs/exynos_defconfig
> +++ b/arch/arm/configs/exynos_defconfig
> @@ -178,6 +178,7 @@ CONFIG_PRINTK_TIME=y
>  CONFIG_DEBUG_FS=y
>  CONFIG_MAGIC_SYSRQ=y
>  CONFIG_DEBUG_KERNEL=y
> +CONFIG_LOCKUP_DETECTOR=y
>  CONFIG_DETECT_HUNG_TASK=y
>  CONFIG_DEBUG_RT_MUTEXES=y
>  CONFIG_DEBUG_SPINLOCK=y

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