Re: [PATCH V4] spi: s3c64xx: Enable Word transfer

2013-10-30 Thread Rajeshwari Birje
Hi Mark Brown,

On Tue, Oct 29, 2013 at 10:09 PM, Mark Brown broo...@kernel.org wrote:
 On Tue, Oct 29, 2013 at 04:59:11PM +0530, Rajeshwari Birje wrote:
 On Tue, Oct 29, 2013 at 4:29 PM, Rajeshwari Birje

  This patch is still not setting bits_per_word_mask as far as I can see?

  Will send new version of patch including this.

 I had some confusion regarding this bits_per_word_mask, where do you
 want me to mask the bpw.
 bits_per_word is something which comes from the user, do we need to mask it?

 Have you looked at the code and documentation for this feature - if it's
 not clear can you please explain in more detail what needs clarifying?

The following patch already sets bits_per_word_mask for
drivers/spi/spi-s3c64xx.c in s3c64xx_spi_probe, hence I had a doubt do
I need to set the same again.

commit e761f4236e94f2dd36316f9892583b29ce986031
Author: Mark Brown broo...@opensource.wolfsonmicro.com
Date:   Mon Apr 1 14:17:37 2013 +0100

spi/s3c64xx: Convert to bits_per_word_mask

The core can do the validation for us.

Signed-off-by: Mark Brown broo...@opensource.wolfsonmicro.com

It is already present as follows in s3c64xx_spi_probe
master-bits_per_word_mask = SPI_BPW_MASK(32) | SPI_BPW_MASK(16) |
SPI_BPW_MASK(8);
-- 
Regards,
Rajeshwari Shinde
--
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 0/2] Add watchdog DT nodes and use syscon regmap interface to configure pmu registers

2013-10-30 Thread Leela Krishna Amudala
This patchset does the following things
- Adds watchdog DT nodes to Exynos5250 and 5420
- Uses syscon regmap interface to configure pmu registers
  to mask/unmask enable/disable of watchdog.

This patch set is rebased on Kgene's for-next branch and tested on SMDK5420

Changes since V2:
- used syscon regmap interface to configure pmu registers in WDT driver
  (suggested by Tomasz Figa t.f...@samsung.com)

Changes since V1:
- Added new compatible string for Exynos5 SoCs
- Introduced quirk mechanism to program PMU registers
- Addressed comments given by Tomasz Figa t.f...@samsung.com

Leela Krishna Amudala (2):
  ARM: dts: add watchdog device nodes for Exynos5250 and Exynos5420
  watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu
register

 .../devicetree/bindings/watchdog/samsung-wdt.txt   |   13 ++-
 arch/arm/boot/dts/exynos5.dtsi |   12 +--
 arch/arm/boot/dts/exynos5250.dtsi  |7 +-
 arch/arm/boot/dts/exynos5420.dtsi  |   10 ++
 drivers/watchdog/s3c2410_wdt.c |  114 ++--
 5 files changed, 139 insertions(+), 17 deletions(-)

-- 
1.7.10.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 1/2] ARM: dts: add watchdog device nodes for Exynos5250 and Exynos5420

2013-10-30 Thread Leela Krishna Amudala
Adds watchdog device nodes to the DT device list for Exynos5250 and Exynos5420

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
---
 arch/arm/boot/dts/exynos5.dtsi|   12 +---
 arch/arm/boot/dts/exynos5250.dtsi |7 ++-
 arch/arm/boot/dts/exynos5420.dtsi |   10 ++
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
index e52b038..e7b6dbd 100644
--- a/arch/arm/boot/dts/exynos5.dtsi
+++ b/arch/arm/boot/dts/exynos5.dtsi
@@ -81,13 +81,6 @@
status = disabled;
};
 
-   watchdog {
-   compatible = samsung,s3c2410-wdt;
-   reg = 0x101D 0x100;
-   interrupts = 0 42 0;
-   status = disabled;
-   };
-
fimd@1440 {
compatible = samsung,exynos5250-fimd;
interrupt-parent = combiner;
@@ -106,4 +99,9 @@
#size-cells = 0;
status = disabled;
};
+
+   pmu_sys_reg: pmusysreg {
+   compatible = samsung,exynos5-pmureg, syscon;
+   reg = 0x1004 0x5000;
+   };
 };
diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index c4a8662..3ccd150 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -158,9 +158,14 @@
interrupts = 0 47 0;
};
 
-   watchdog {
+   watchdog@101D {
+   compatible = samsung,s3c5250-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
clocks = clock 336;
clock-names = watchdog;
+   samsung,sysreg = pmu_sys_reg;
+   status = okay;
};
 
g2d@1085 {
diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 6ffefd1..5fb7ae2 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -369,4 +369,14 @@
clock-names = gscl;
samsung,power-domain = gsc_pd;
};
+
+watchdog@101D {
+   compatible = samsung,s3c5420-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
+   clocks = clock 316;
+   clock-names = watchdog;
+   samsung,sysreg = pmu_sys_reg;
+   status = okay;
+};
 };
-- 
1.7.10.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 2/2] watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu register

2013-10-30 Thread Leela Krishna Amudala
The syscon regmap interface is used to configure AUTOMATIC_WDT_RESET_DISABLE
and MASK_WDT_RESET_REQUEST registers of PMU to mask/unmask enable/disable of
watchdog in probe and s2r scenarios.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
---
 .../devicetree/bindings/watchdog/samsung-wdt.txt   |   13 ++-
 drivers/watchdog/s3c2410_wdt.c |  114 ++--
 2 files changed, 118 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt 
b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
index 2aa486c..c46c7ce 100644
--- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
@@ -5,10 +5,21 @@ after a preset amount of time during which the WDT reset 
event has not
 occurred.
 
 Required properties:
-- compatible : should be samsung,s3c2410-wdt
+- compatible : should be samsung,s3c2410-wdt or samsung,s3c5250-wdt or 
samsung,s3c5420-wdt
 - reg : base physical address of the controller and length of memory mapped
region.
 - interrupts : interrupt number to the cpu.
+- samsung,pmusysreg : reference node to pmu sysreg (required only in case of 
Exynos5250 and 5420)
 
 Optional properties:
 - timeout-sec : contains the watchdog timeout in seconds.
+
+watchdog@101D {
+   compatible = samsung,s3c5250-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
+   clocks = clock 336;
+   clock-names = watchdog;
+   samsung,sysreg = pmu_sys_reg;
+   status = okay;
+};
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 23aad7c..2a3429c 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -41,6 +41,8 @@
 #include linux/slab.h
 #include linux/err.h
 #include linux/of.h
+#include linux/mfd/syscon.h
+#include linux/regmap.h
 
 #define S3C2410_WTCON  0x00
 #define S3C2410_WTDAT  0x04
@@ -61,6 +63,10 @@
 #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0)
 #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME   (15)
 
+#define WDT_DISABLE_REG_OFFSET 0x0408
+#define WDT_MASK_RESET_REG_OFFSET  0x040c
+#define QUIRK_NEEDS_PMU_CONFIG (1  0)
+
 static bool nowayout   = WATCHDOG_NOWAYOUT;
 static int tmr_margin;
 static int tmr_atboot  = CONFIG_S3C2410_WATCHDOG_ATBOOT;
@@ -84,6 +90,12 @@ MODULE_PARM_DESC(soft_noboot, Watchdog action, set to 1 to 
ignore reboots, 
0 to reboot (default 0));
 MODULE_PARM_DESC(debug, Watchdog debug, set to 1 for debug (default 0));
 
+struct pmu_config {
+   int disable_reg;
+   int mask_reset_reg;
+   int mask_bit;
+};
+
 struct s3c2410_wdt {
struct device   *dev;
struct clk  *clock;
@@ -94,7 +106,34 @@ struct s3c2410_wdt {
unsigned long   wtdat_save;
struct watchdog_device  wdt_device;
struct notifier_block   freq_transition;
+   struct pmu_config   *wdt_pmu_config;
+   struct regmap   *pmureg;
+   unsigned intquirks;
+};
+
+static struct pmu_config pmu_config_5250  = {
+   .disable_reg = WDT_DISABLE_REG_OFFSET,
+   .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
+   .mask_bit = 20
+};
+
+static struct pmu_config pmu_config_5420 = {
+   .disable_reg = WDT_DISABLE_REG_OFFSET,
+   .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
+   .mask_bit = 0
+};
+
+#ifdef CONFIG_OF
+static const struct of_device_id s3c2410_wdt_match[] = {
+   { .compatible = samsung,s3c2410-wdt },
+   { .compatible = samsung,s3c5250-wdt,
+ .data = (struct pmu_config *) pmu_config_5250 },
+   { .compatible = samsung,s3c5420-wdt,
+ .data = (struct pmu_config *) pmu_config_5420 },
+   {},
 };
+MODULE_DEVICE_TABLE(of, s3c2410_wdt_match);
+#endif
 
 /* watchdog control routines */
 
@@ -111,6 +150,40 @@ static inline struct s3c2410_wdt *freq_to_wdt(struct 
notifier_block *nb)
return container_of(nb, struct s3c2410_wdt, freq_transition);
 }
 
+static void s3c2410wdt_mask_and_disable_reset(int mask, struct s3c2410_wdt 
*wdt)
+{
+   unsigned int disable, mask_reset;
+   int ret;
+
+   ret = regmap_read(wdt-pmureg, wdt-wdt_pmu_config-disable_reg,
+   disable);
+   if (ret  0) {
+   dev_err(wdt-dev, %s:%d fail to read disable reg(%d)\n,
+   __func__, __LINE__, ret);
+   return;
+   }
+
+   ret = regmap_read(wdt-pmureg, wdt-wdt_pmu_config-mask_reset_reg,
+   mask_reset);
+   if (ret  0) {
+   dev_err(wdt-dev, %s:%d fail to read mask reset reg(%d)\n,
+   __func__, __LINE__, ret);
+   return;
+   }
+
+   if (mask) {
+   disable |= (1  wdt-wdt_pmu_config-mask_bit);
+   

[RESEND] [PATCH V3 1/2] ARM: dts: add watchdog device nodes for Exynos5250 and Exynos5420

2013-10-30 Thread Leela Krishna Amudala
Adds watchdog device nodes to the DT device list for Exynos5250 and Exynos5420

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
---
 arch/arm/boot/dts/exynos5.dtsi|   12 +---
 arch/arm/boot/dts/exynos5250.dtsi |7 ++-
 arch/arm/boot/dts/exynos5420.dtsi |   10 ++
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
index e52b038..e7b6dbd 100644
--- a/arch/arm/boot/dts/exynos5.dtsi
+++ b/arch/arm/boot/dts/exynos5.dtsi
@@ -81,13 +81,6 @@
status = disabled;
};
 
-   watchdog {
-   compatible = samsung,s3c2410-wdt;
-   reg = 0x101D 0x100;
-   interrupts = 0 42 0;
-   status = disabled;
-   };
-
fimd@1440 {
compatible = samsung,exynos5250-fimd;
interrupt-parent = combiner;
@@ -106,4 +99,9 @@
#size-cells = 0;
status = disabled;
};
+
+   pmu_sys_reg: pmusysreg {
+   compatible = samsung,exynos5-pmureg, syscon;
+   reg = 0x1004 0x5000;
+   };
 };
diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index c4a8662..3ccd150 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -158,9 +158,14 @@
interrupts = 0 47 0;
};
 
-   watchdog {
+   watchdog@101D {
+   compatible = samsung,s3c5250-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
clocks = clock 336;
clock-names = watchdog;
+   samsung,sysreg = pmu_sys_reg;
+   status = okay;
};
 
g2d@1085 {
diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 6ffefd1..5fb7ae2 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -369,4 +369,14 @@
clock-names = gscl;
samsung,power-domain = gsc_pd;
};
+
+watchdog@101D {
+   compatible = samsung,s3c5420-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
+   clocks = clock 316;
+   clock-names = watchdog;
+   samsung,sysreg = pmu_sys_reg;
+   status = okay;
+};
 };
-- 
1.7.10.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


[RESEND] [PATCH V3 2/2] watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu register

2013-10-30 Thread Leela Krishna Amudala
The syscon regmap interface is used to configure AUTOMATIC_WDT_RESET_DISABLE
and MASK_WDT_RESET_REQUEST registers of PMU to mask/unmask enable/disable of
watchdog in probe and s2r scenarios.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
---
 .../devicetree/bindings/watchdog/samsung-wdt.txt   |   13 ++-
 drivers/watchdog/s3c2410_wdt.c |  114 ++--
 2 files changed, 118 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt 
b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
index 2aa486c..c46c7ce 100644
--- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
@@ -5,10 +5,21 @@ after a preset amount of time during which the WDT reset 
event has not
 occurred.
 
 Required properties:
-- compatible : should be samsung,s3c2410-wdt
+- compatible : should be samsung,s3c2410-wdt or samsung,s3c5250-wdt or 
samsung,s3c5420-wdt
 - reg : base physical address of the controller and length of memory mapped
region.
 - interrupts : interrupt number to the cpu.
+- samsung,pmusysreg : reference node to pmu sysreg (required only in case of 
Exynos5250 and 5420)
 
 Optional properties:
 - timeout-sec : contains the watchdog timeout in seconds.
+
+watchdog@101D {
+   compatible = samsung,s3c5250-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
+   clocks = clock 336;
+   clock-names = watchdog;
+   samsung,sysreg = pmu_sys_reg;
+   status = okay;
+};
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 23aad7c..2a3429c 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -41,6 +41,8 @@
 #include linux/slab.h
 #include linux/err.h
 #include linux/of.h
+#include linux/mfd/syscon.h
+#include linux/regmap.h
 
 #define S3C2410_WTCON  0x00
 #define S3C2410_WTDAT  0x04
@@ -61,6 +63,10 @@
 #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0)
 #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME   (15)
 
+#define WDT_DISABLE_REG_OFFSET 0x0408
+#define WDT_MASK_RESET_REG_OFFSET  0x040c
+#define QUIRK_NEEDS_PMU_CONFIG (1  0)
+
 static bool nowayout   = WATCHDOG_NOWAYOUT;
 static int tmr_margin;
 static int tmr_atboot  = CONFIG_S3C2410_WATCHDOG_ATBOOT;
@@ -84,6 +90,12 @@ MODULE_PARM_DESC(soft_noboot, Watchdog action, set to 1 to 
ignore reboots, 
0 to reboot (default 0));
 MODULE_PARM_DESC(debug, Watchdog debug, set to 1 for debug (default 0));
 
+struct pmu_config {
+   int disable_reg;
+   int mask_reset_reg;
+   int mask_bit;
+};
+
 struct s3c2410_wdt {
struct device   *dev;
struct clk  *clock;
@@ -94,7 +106,34 @@ struct s3c2410_wdt {
unsigned long   wtdat_save;
struct watchdog_device  wdt_device;
struct notifier_block   freq_transition;
+   struct pmu_config   *wdt_pmu_config;
+   struct regmap   *pmureg;
+   unsigned intquirks;
+};
+
+static struct pmu_config pmu_config_5250  = {
+   .disable_reg = WDT_DISABLE_REG_OFFSET,
+   .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
+   .mask_bit = 20
+};
+
+static struct pmu_config pmu_config_5420 = {
+   .disable_reg = WDT_DISABLE_REG_OFFSET,
+   .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
+   .mask_bit = 0
+};
+
+#ifdef CONFIG_OF
+static const struct of_device_id s3c2410_wdt_match[] = {
+   { .compatible = samsung,s3c2410-wdt },
+   { .compatible = samsung,s3c5250-wdt,
+ .data = (struct pmu_config *) pmu_config_5250 },
+   { .compatible = samsung,s3c5420-wdt,
+ .data = (struct pmu_config *) pmu_config_5420 },
+   {},
 };
+MODULE_DEVICE_TABLE(of, s3c2410_wdt_match);
+#endif
 
 /* watchdog control routines */
 
@@ -111,6 +150,40 @@ static inline struct s3c2410_wdt *freq_to_wdt(struct 
notifier_block *nb)
return container_of(nb, struct s3c2410_wdt, freq_transition);
 }
 
+static void s3c2410wdt_mask_and_disable_reset(int mask, struct s3c2410_wdt 
*wdt)
+{
+   unsigned int disable, mask_reset;
+   int ret;
+
+   ret = regmap_read(wdt-pmureg, wdt-wdt_pmu_config-disable_reg,
+   disable);
+   if (ret  0) {
+   dev_err(wdt-dev, %s:%d fail to read disable reg(%d)\n,
+   __func__, __LINE__, ret);
+   return;
+   }
+
+   ret = regmap_read(wdt-pmureg, wdt-wdt_pmu_config-mask_reset_reg,
+   mask_reset);
+   if (ret  0) {
+   dev_err(wdt-dev, %s:%d fail to read mask reset reg(%d)\n,
+   __func__, __LINE__, ret);
+   return;
+   }
+
+   if (mask) {
+   disable |= (1  wdt-wdt_pmu_config-mask_bit);
+   

[RESEND] [PATCH V3 0/2] Add watchdog DT nodes and use syscon regmap interface to configure pmu registers

2013-10-30 Thread Leela Krishna Amudala
This patchset does the following things
- Adds watchdog DT nodes to Exynos5250 and 5420
- Uses syscon regmap interface to configure pmu registers
  to mask/unmask enable/disable of watchdog.

This patch set is rebased on Kgene's for-next branch and tested on SMDK5420

Changes since V2:
- used syscon regmap interface to configure pmu registers in WDT driver
  (suggested by Tomasz Figa t.f...@samsung.com)

Changes since V1:
- Added new compatible string for Exynos5 SoCs
- Introduced quirk mechanism to program PMU registers
- Addressed comments given by Tomasz Figa t.f...@samsung.com

Leela Krishna Amudala (2):
  ARM: dts: add watchdog device nodes for Exynos5250 and Exynos5420
  watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu
register

 .../devicetree/bindings/watchdog/samsung-wdt.txt   |   13 ++-
 arch/arm/boot/dts/exynos5.dtsi |   12 +--
 arch/arm/boot/dts/exynos5250.dtsi  |7 +-
 arch/arm/boot/dts/exynos5420.dtsi  |   10 ++
 drivers/watchdog/s3c2410_wdt.c |  114 ++--
 5 files changed, 139 insertions(+), 17 deletions(-)

-- 
1.7.10.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 Resend 1/1] Documentation/watchdog: Add binding example in samsung-wdt

2013-10-30 Thread Leela Krishna Amudala
Hi Sachin,

On Wed, Oct 30, 2013 at 10:56 AM, Sachin Kamat sachin.ka...@linaro.org wrote:
 Added an example for reference.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 ---
  .../devicetree/bindings/watchdog/samsung-wdt.txt   |9 +
  1 file changed, 9 insertions(+)

 diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt 
 b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 index 2aa486c..7ddf461 100644
 --- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 +++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 @@ -12,3 +12,12 @@ Required properties:

  Optional properties:
  - timeout-sec : contains the watchdog timeout in seconds.
 +
 +Example:
 +
 +watchdog@101D {
 +   compatible = samsung,s3c2410-wdt;
 +   reg = 0x101D 0x100;
 +   interrupts = 0 42 0;
 +   status = disabled;
 +};

This example node has been changed and I posted the latest version.
So, you can abandon this patch now.

Best Wishes,
Leela Krishna

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


Re: [PATCH 1/2] ARM: dts: add watchdog device nodes for Exynos5250 and Exynos5420

2013-10-30 Thread Sachin Kamat
Hi Leela,

On 30 October 2013 12:23, Leela Krishna Amudala l.kris...@samsung.com wrote:
 Adds watchdog device nodes to the DT device list for Exynos5250 and Exynos5420

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
  arch/arm/boot/dts/exynos5.dtsi|   12 +---
  arch/arm/boot/dts/exynos5250.dtsi |7 ++-
  arch/arm/boot/dts/exynos5420.dtsi |   10 ++
  3 files changed, 21 insertions(+), 8 deletions(-)

 diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
 index e52b038..e7b6dbd 100644
 --- a/arch/arm/boot/dts/exynos5.dtsi
 +++ b/arch/arm/boot/dts/exynos5.dtsi
 @@ -81,13 +81,6 @@
 status = disabled;
 };

 -   watchdog {
 -   compatible = samsung,s3c2410-wdt;
 -   reg = 0x101D 0x100;
 -   interrupts = 0 42 0;
 -   status = disabled;
 -   };
 -
 fimd@1440 {
 compatible = samsung,exynos5250-fimd;
 interrupt-parent = combiner;
 @@ -106,4 +99,9 @@
 #size-cells = 0;
 status = disabled;
 };
 +
 +   pmu_sys_reg: pmusysreg {

Make this pmusysreg@1004.

 +   compatible = samsung,exynos5-pmureg, syscon;

I do not see any reference to samsung,exynos5-pmureg in the tree.

 +   reg = 0x1004 0x5000;
 +   };

Since this is a separate node, IMO it could be added in a separate patch.

  };
 diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
 b/arch/arm/boot/dts/exynos5250.dtsi
 index c4a8662..3ccd150 100644
 --- a/arch/arm/boot/dts/exynos5250.dtsi
 +++ b/arch/arm/boot/dts/exynos5250.dtsi
 @@ -158,9 +158,14 @@
 interrupts = 0 47 0;
 };

 -   watchdog {
 +   watchdog@101D {
 +   compatible = samsung,s3c5250-wdt;

Exynos5 does not belong to S3C series. Please change this to
exynos5250-wdt instead.

 +   reg = 0x101D 0x100;
 +   interrupts = 0 42 0;
 clocks = clock 336;
 clock-names = watchdog;
 +   samsung,sysreg = pmu_sys_reg;
 +   status = okay;
 };

 g2d@1085 {
 diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
 b/arch/arm/boot/dts/exynos5420.dtsi
 index 6ffefd1..5fb7ae2 100644
 --- a/arch/arm/boot/dts/exynos5420.dtsi
 +++ b/arch/arm/boot/dts/exynos5420.dtsi
 @@ -369,4 +369,14 @@
 clock-names = gscl;
 samsung,power-domain = gsc_pd;
 };
 +
 +watchdog@101D {
 +   compatible = samsung,s3c5420-wdt;

ditto

 +   reg = 0x101D 0x100;
 +   interrupts = 0 42 0;
 +   clocks = clock 316;
 +   clock-names = watchdog;
 +   samsung,sysreg = pmu_sys_reg;
 +   status = okay;
 +};
  };
 --
 1.7.10.4




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


Re: [PATCH 2/2] watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu register

2013-10-30 Thread Sachin Kamat
On 30 October 2013 12:23, Leela Krishna Amudala l.kris...@samsung.com wrote:
 The syscon regmap interface is used to configure AUTOMATIC_WDT_RESET_DISABLE
 and MASK_WDT_RESET_REQUEST registers of PMU to mask/unmask enable/disable of
 watchdog in probe and s2r scenarios.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
  .../devicetree/bindings/watchdog/samsung-wdt.txt   |   13 ++-
  drivers/watchdog/s3c2410_wdt.c |  114 
 ++--
  2 files changed, 118 insertions(+), 9 deletions(-)

 diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt 
 b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 index 2aa486c..c46c7ce 100644
 --- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 +++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 @@ -5,10 +5,21 @@ after a preset amount of time during which the WDT reset 
 event has not
  occurred.

  Required properties:
 -- compatible : should be samsung,s3c2410-wdt
 +- compatible : should be samsung,s3c2410-wdt or samsung,s3c5250-wdt or 
 samsung,s3c5420-wdt

This should be written as should be one among the following:
(a) samsung,s3c2410-wdt for xyz SoC
(b) 
(c) ...

  - reg : base physical address of the controller and length of memory mapped
 region.
  - interrupts : interrupt number to the cpu.
 +- samsung,pmusysreg : reference node to pmu sysreg (required only in case of 
 Exynos5250 and 5420)

This property is samsung,sysreg.


  Optional properties:
  - timeout-sec : contains the watchdog timeout in seconds.
 +
 +watchdog@101D {
 +   compatible = samsung,s3c5250-wdt;
 +   reg = 0x101D 0x100;
 +   interrupts = 0 42 0;
 +   clocks = clock 336;
 +   clock-names = watchdog;
 +   samsung,sysreg = pmu_sys_reg;
 +   status = okay;
 +};
 diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
 index 23aad7c..2a3429c 100644
 --- a/drivers/watchdog/s3c2410_wdt.c
 +++ b/drivers/watchdog/s3c2410_wdt.c
 @@ -41,6 +41,8 @@
  #include linux/slab.h
  #include linux/err.h
  #include linux/of.h
 +#include linux/mfd/syscon.h
 +#include linux/regmap.h

  #define S3C2410_WTCON  0x00
  #define S3C2410_WTDAT  0x04
 @@ -61,6 +63,10 @@
  #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0)
  #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME   (15)

 +#define WDT_DISABLE_REG_OFFSET 0x0408
 +#define WDT_MASK_RESET_REG_OFFSET  0x040c
 +#define QUIRK_NEEDS_PMU_CONFIG (1  0)
 +
  static bool nowayout   = WATCHDOG_NOWAYOUT;
  static int tmr_margin;
  static int tmr_atboot  = CONFIG_S3C2410_WATCHDOG_ATBOOT;
 @@ -84,6 +90,12 @@ MODULE_PARM_DESC(soft_noboot, Watchdog action, set to 1 
 to ignore reboots, 
 0 to reboot (default 0));
  MODULE_PARM_DESC(debug, Watchdog debug, set to 1 for debug (default 0));

 +struct pmu_config {
 +   int disable_reg;
 +   int mask_reset_reg;
 +   int mask_bit;
 +};
 +
  struct s3c2410_wdt {
 struct device   *dev;
 struct clk  *clock;
 @@ -94,7 +106,34 @@ struct s3c2410_wdt {
 unsigned long   wtdat_save;
 struct watchdog_device  wdt_device;
 struct notifier_block   freq_transition;
 +   struct pmu_config   *wdt_pmu_config;
 +   struct regmap   *pmureg;
 +   unsigned intquirks;
 +};
 +
 +static struct pmu_config pmu_config_5250  = {
 +   .disable_reg = WDT_DISABLE_REG_OFFSET,
 +   .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
 +   .mask_bit = 20
 +};
 +
 +static struct pmu_config pmu_config_5420 = {
 +   .disable_reg = WDT_DISABLE_REG_OFFSET,
 +   .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
 +   .mask_bit = 0
 +};
 +

The above 2 structures could also be under ifdef CONFIG_OF

 +#ifdef CONFIG_OF
 +static const struct of_device_id s3c2410_wdt_match[] = {
 +   { .compatible = samsung,s3c2410-wdt },
 +   { .compatible = samsung,s3c5250-wdt,
 + .data = (struct pmu_config *) pmu_config_5250 },
 +   { .compatible = samsung,s3c5420-wdt,
 + .data = (struct pmu_config *) pmu_config_5420 },
 +   {},
  };
 +MODULE_DEVICE_TABLE(of, s3c2410_wdt_match);
 +#endif

  /* watchdog control routines */

 @@ -111,6 +150,40 @@ static inline struct s3c2410_wdt *freq_to_wdt(struct 
 notifier_block *nb)
 return container_of(nb, struct s3c2410_wdt, freq_transition);
  }

 +static void s3c2410wdt_mask_and_disable_reset(int mask, struct s3c2410_wdt 
 *wdt)
 +{
 +   unsigned int disable, mask_reset;
 +   int ret;
 +
 +   ret = regmap_read(wdt-pmureg, wdt-wdt_pmu_config-disable_reg,
 +   disable);
 +   if (ret  0) {
 +   dev_err(wdt-dev, %s:%d fail to read disable reg(%d)\n,
 +   __func__, __LINE__, ret);

func and LINE does not 

Re: [PATCH Resend 1/1] Documentation/watchdog: Add binding example in samsung-wdt

2013-10-30 Thread Sachin Kamat
On 30 October 2013 12:13, Leela Krishna Amudala
leelakrishn...@gmail.com wrote:
 Hi Sachin,

 On Wed, Oct 30, 2013 at 10:56 AM, Sachin Kamat sachin.ka...@linaro.org 
 wrote:
 Added an example for reference.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 ---
  .../devicetree/bindings/watchdog/samsung-wdt.txt   |9 +
  1 file changed, 9 insertions(+)

 diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt 
 b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 index 2aa486c..7ddf461 100644
 --- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 +++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 @@ -12,3 +12,12 @@ Required properties:

  Optional properties:
  - timeout-sec : contains the watchdog timeout in seconds.
 +
 +Example:
 +
 +watchdog@101D {
 +   compatible = samsung,s3c2410-wdt;
 +   reg = 0x101D 0x100;
 +   interrupts = 0 42 0;
 +   status = disabled;
 +};

 This example node has been changed and I posted the latest version.
 So, you can abandon this patch now.


Yes. Makes sense.

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


Re: [PATCH 2/2] watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu register

2013-10-30 Thread Leela Krishna Amudala
Hi Sachin,

Thanks for reviewing the patch

On Wed, Oct 30, 2013 at 12:33 PM, Sachin Kamat sachin.ka...@linaro.org wrote:
 On 30 October 2013 12:23, Leela Krishna Amudala l.kris...@samsung.com wrote:
 The syscon regmap interface is used to configure AUTOMATIC_WDT_RESET_DISABLE
 and MASK_WDT_RESET_REQUEST registers of PMU to mask/unmask enable/disable of
 watchdog in probe and s2r scenarios.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
  .../devicetree/bindings/watchdog/samsung-wdt.txt   |   13 ++-
  drivers/watchdog/s3c2410_wdt.c |  114 
 ++--
  2 files changed, 118 insertions(+), 9 deletions(-)

 diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt 
 b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 index 2aa486c..c46c7ce 100644
 --- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 +++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 @@ -5,10 +5,21 @@ after a preset amount of time during which the WDT reset 
 event has not
  occurred.

  Required properties:
 -- compatible : should be samsung,s3c2410-wdt
 +- compatible : should be samsung,s3c2410-wdt or samsung,s3c5250-wdt or 
 samsung,s3c5420-wdt

 This should be written as should be one among the following:
 (a) samsung,s3c2410-wdt for xyz SoC
 (b) 
 (c) ...


Okay, will change it.

  - reg : base physical address of the controller and length of memory mapped
 region.
  - interrupts : interrupt number to the cpu.
 +- samsung,pmusysreg : reference node to pmu sysreg (required only in case 
 of Exynos5250 and 5420)

 This property is samsung,sysreg.


Okay, will keep this as it is and take care in driver


  Optional properties:
  - timeout-sec : contains the watchdog timeout in seconds.
 +
 +watchdog@101D {
 +   compatible = samsung,s3c5250-wdt;
 +   reg = 0x101D 0x100;
 +   interrupts = 0 42 0;
 +   clocks = clock 336;
 +   clock-names = watchdog;
 +   samsung,sysreg = pmu_sys_reg;
 +   status = okay;
 +};
 diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
 index 23aad7c..2a3429c 100644
 --- a/drivers/watchdog/s3c2410_wdt.c
 +++ b/drivers/watchdog/s3c2410_wdt.c
 @@ -41,6 +41,8 @@
  #include linux/slab.h
  #include linux/err.h
  #include linux/of.h
 +#include linux/mfd/syscon.h
 +#include linux/regmap.h

  #define S3C2410_WTCON  0x00
  #define S3C2410_WTDAT  0x04
 @@ -61,6 +63,10 @@
  #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0)
  #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME   (15)

 +#define WDT_DISABLE_REG_OFFSET 0x0408
 +#define WDT_MASK_RESET_REG_OFFSET  0x040c
 +#define QUIRK_NEEDS_PMU_CONFIG (1  0)
 +
  static bool nowayout   = WATCHDOG_NOWAYOUT;
  static int tmr_margin;
  static int tmr_atboot  = CONFIG_S3C2410_WATCHDOG_ATBOOT;
 @@ -84,6 +90,12 @@ MODULE_PARM_DESC(soft_noboot, Watchdog action, set to 1 
 to ignore reboots, 
 0 to reboot (default 0));
  MODULE_PARM_DESC(debug, Watchdog debug, set to 1 for debug (default 0));

 +struct pmu_config {
 +   int disable_reg;
 +   int mask_reset_reg;
 +   int mask_bit;
 +};
 +
  struct s3c2410_wdt {
 struct device   *dev;
 struct clk  *clock;
 @@ -94,7 +106,34 @@ struct s3c2410_wdt {
 unsigned long   wtdat_save;
 struct watchdog_device  wdt_device;
 struct notifier_block   freq_transition;
 +   struct pmu_config   *wdt_pmu_config;
 +   struct regmap   *pmureg;
 +   unsigned intquirks;
 +};
 +
 +static struct pmu_config pmu_config_5250  = {
 +   .disable_reg = WDT_DISABLE_REG_OFFSET,
 +   .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
 +   .mask_bit = 20
 +};
 +
 +static struct pmu_config pmu_config_5420 = {
 +   .disable_reg = WDT_DISABLE_REG_OFFSET,
 +   .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
 +   .mask_bit = 0
 +};
 +

 The above 2 structures could also be under ifdef CONFIG_OF


Okay, will move it

 +#ifdef CONFIG_OF
 +static const struct of_device_id s3c2410_wdt_match[] = {
 +   { .compatible = samsung,s3c2410-wdt },
 +   { .compatible = samsung,s3c5250-wdt,
 + .data = (struct pmu_config *) pmu_config_5250 },
 +   { .compatible = samsung,s3c5420-wdt,
 + .data = (struct pmu_config *) pmu_config_5420 },
 +   {},
  };
 +MODULE_DEVICE_TABLE(of, s3c2410_wdt_match);
 +#endif

  /* watchdog control routines */

 @@ -111,6 +150,40 @@ static inline struct s3c2410_wdt *freq_to_wdt(struct 
 notifier_block *nb)
 return container_of(nb, struct s3c2410_wdt, freq_transition);
  }

 +static void s3c2410wdt_mask_and_disable_reset(int mask, struct s3c2410_wdt 
 *wdt)
 +{
 +   unsigned int disable, mask_reset;
 +   int ret;
 +
 +   ret = regmap_read(wdt-pmureg, wdt-wdt_pmu_config-disable_reg,
 +

Re: [PATCH 1/2] ARM: dts: add watchdog device nodes for Exynos5250 and Exynos5420

2013-10-30 Thread Leela Krishna Amudala
Hi,

On Wed, Oct 30, 2013 at 12:20 PM, Sachin Kamat sachin.ka...@linaro.org wrote:
 Hi Leela,

 On 30 October 2013 12:23, Leela Krishna Amudala l.kris...@samsung.com wrote:
 Adds watchdog device nodes to the DT device list for Exynos5250 and 
 Exynos5420

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
  arch/arm/boot/dts/exynos5.dtsi|   12 +---
  arch/arm/boot/dts/exynos5250.dtsi |7 ++-
  arch/arm/boot/dts/exynos5420.dtsi |   10 ++
  3 files changed, 21 insertions(+), 8 deletions(-)

 diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
 index e52b038..e7b6dbd 100644
 --- a/arch/arm/boot/dts/exynos5.dtsi
 +++ b/arch/arm/boot/dts/exynos5.dtsi
 @@ -81,13 +81,6 @@
 status = disabled;
 };

 -   watchdog {
 -   compatible = samsung,s3c2410-wdt;
 -   reg = 0x101D 0x100;
 -   interrupts = 0 42 0;
 -   status = disabled;
 -   };
 -
 fimd@1440 {
 compatible = samsung,exynos5250-fimd;
 interrupt-parent = combiner;
 @@ -106,4 +99,9 @@
 #size-cells = 0;
 status = disabled;
 };
 +
 +   pmu_sys_reg: pmusysreg {

 Make this pmusysreg@1004.


Okay, will do it

 +   compatible = samsung,exynos5-pmureg, syscon;

 I do not see any reference to samsung,exynos5-pmureg in the tree.


Okay, will take care of it

 +   reg = 0x1004 0x5000;
 +   };

 Since this is a separate node, IMO it could be added in a separate patch.


Okay, will do it

  };
 diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
 b/arch/arm/boot/dts/exynos5250.dtsi
 index c4a8662..3ccd150 100644
 --- a/arch/arm/boot/dts/exynos5250.dtsi
 +++ b/arch/arm/boot/dts/exynos5250.dtsi
 @@ -158,9 +158,14 @@
 interrupts = 0 47 0;
 };

 -   watchdog {
 +   watchdog@101D {
 +   compatible = samsung,s3c5250-wdt;

 Exynos5 does not belong to S3C series. Please change this to
 exynos5250-wdt instead.


My mistake, will change it

 +   reg = 0x101D 0x100;
 +   interrupts = 0 42 0;
 clocks = clock 336;
 clock-names = watchdog;
 +   samsung,sysreg = pmu_sys_reg;
 +   status = okay;
 };

 g2d@1085 {
 diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
 b/arch/arm/boot/dts/exynos5420.dtsi
 index 6ffefd1..5fb7ae2 100644
 --- a/arch/arm/boot/dts/exynos5420.dtsi
 +++ b/arch/arm/boot/dts/exynos5420.dtsi
 @@ -369,4 +369,14 @@
 clock-names = gscl;
 samsung,power-domain = gsc_pd;
 };
 +
 +watchdog@101D {
 +   compatible = samsung,s3c5420-wdt;

 ditto

 +   reg = 0x101D 0x100;
 +   interrupts = 0 42 0;
 +   clocks = clock 316;
 +   clock-names = watchdog;
 +   samsung,sysreg = pmu_sys_reg;
 +   status = okay;
 +};
  };
 --
 1.7.10.4




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


[PATCH V4 0/3] Add watchdog DT nodes and use syscon regmap interfac to configure pmu registers

2013-10-30 Thread Leela Krishna Amudala
This patchset does the following things
- Adds pmusysreg device node to exynos5.dtsi file
- Adds watchdog DT nodes to Exynos5250 and 5420
- Uses syscon regmap interface to configure pmu registers
  to mask/unmask enable/disable of watchdog.

This patch set is rebased on Kgene's for-next branch and tested on SMDK5420

Changes since V3:
- changed the compatible strings for watchdog node
- splitted up adding pmusysreg node and made it separate patch
- Addressed comments given by Sachin Kamat sachin.ka...@linaro.org

Changes since V2:
- used syscon regmap interface to configure pmu registers in WDT driver
  (suggested by Tomasz Figa t.f...@samsung.com)

Changes since V1:
- Added new compatible string for Exynos5 SoCs
- Introduced quirk mechanism to program PMU registers
- Addressed comments given by Tomasz Figa t.f...@samsung.com

Leela Krishna Amudala (3):
  ARM: dts: Add pmu sysreg node to Exynos5 dtsi file
  ARM: dts: add watchdog device nodes for Exynos5250 and Exynos5420
  watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu
register

 .../devicetree/bindings/watchdog/samsung-wdt.txt   |   19 +++-
 arch/arm/boot/dts/exynos5.dtsi |   12 +--
 arch/arm/boot/dts/exynos5250.dtsi  |7 +-
 arch/arm/boot/dts/exynos5420.dtsi  |   10 ++
 drivers/watchdog/s3c2410_wdt.c |  112 ++--
 5 files changed, 143 insertions(+), 17 deletions(-)

-- 
1.7.10.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 V4 1/3] ARM: dts: Add pmu sysreg node to Exynos5 dtsi file

2013-10-30 Thread Leela Krishna Amudala
This patch adds pmusysreg node to Exynos5 dtsi file to handle PMU
register accesses in a centralized way using syscon driver

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
---
 arch/arm/boot/dts/exynos5.dtsi |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
index e52b038..918e732 100644
--- a/arch/arm/boot/dts/exynos5.dtsi
+++ b/arch/arm/boot/dts/exynos5.dtsi
@@ -106,4 +106,9 @@
#size-cells = 0;
status = disabled;
};
+
+   pmu_sys_reg: pmusysreg@1004000 {
+   compatible = syscon;
+   reg = 0x1004 0x5000;
+   };
 };
-- 
1.7.10.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 V4 3/3] watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu register

2013-10-30 Thread Leela Krishna Amudala
The syscon regmap interface is used to configure AUTOMATIC_WDT_RESET_DISABLE
and MASK_WDT_RESET_REQUEST registers of PMU to mask/unmask enable/disable of
watchdog in probe and s2r scenarios.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
---
 .../devicetree/bindings/watchdog/samsung-wdt.txt   |   19 +++-
 drivers/watchdog/s3c2410_wdt.c |  112 ++--
 2 files changed, 122 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt 
b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
index 2aa486c..5a9889b 100644
--- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
@@ -5,10 +5,27 @@ after a preset amount of time during which the WDT reset 
event has not
 occurred.
 
 Required properties:
-- compatible : should be samsung,s3c2410-wdt
+- compatible : should be one among the following
+   (a) samsung,s3c2410-wdt for Exynos4 and previous SoCs
+   (b) samsung,exynos5250-wdt for Exynos5250
+   (c) samsung,exynos5420-wdt for Exynos5420
+
 - reg : base physical address of the controller and length of memory mapped
region.
 - interrupts : interrupt number to the cpu.
+- samsung,pmusysreg : reference node to pmu sysreg (required only in case of 
Exynos5250 and 5420)
 
 Optional properties:
 - timeout-sec : contains the watchdog timeout in seconds.
+
+Example:
+
+watchdog@101D {
+   compatible = samsung,exynos5250-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
+   clocks = clock 336;
+   clock-names = watchdog;
+   samsung,sysreg = pmu_sys_reg;
+   status = okay;
+};
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 23aad7c..d8aefef 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -41,6 +41,8 @@
 #include linux/slab.h
 #include linux/err.h
 #include linux/of.h
+#include linux/mfd/syscon.h
+#include linux/regmap.h
 
 #define S3C2410_WTCON  0x00
 #define S3C2410_WTDAT  0x04
@@ -61,6 +63,10 @@
 #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0)
 #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME   (15)
 
+#define WDT_DISABLE_REG_OFFSET 0x0408
+#define WDT_MASK_RESET_REG_OFFSET  0x040c
+#define QUIRK_NEEDS_PMU_CONFIG (1  0)
+
 static bool nowayout   = WATCHDOG_NOWAYOUT;
 static int tmr_margin;
 static int tmr_atboot  = CONFIG_S3C2410_WATCHDOG_ATBOOT;
@@ -84,6 +90,12 @@ MODULE_PARM_DESC(soft_noboot, Watchdog action, set to 1 to 
ignore reboots, 
0 to reboot (default 0));
 MODULE_PARM_DESC(debug, Watchdog debug, set to 1 for debug (default 0));
 
+struct pmu_config {
+   int disable_reg;
+   int mask_reset_reg;
+   int mask_bit;
+};
+
 struct s3c2410_wdt {
struct device   *dev;
struct clk  *clock;
@@ -94,7 +106,34 @@ struct s3c2410_wdt {
unsigned long   wtdat_save;
struct watchdog_device  wdt_device;
struct notifier_block   freq_transition;
+   struct pmu_config   *wdt_pmu_config;
+   struct regmap   *pmureg;
+   unsigned intquirks;
+};
+
+#ifdef CONFIG_OF
+static struct pmu_config pmu_config_5250  = {
+   .disable_reg = WDT_DISABLE_REG_OFFSET,
+   .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
+   .mask_bit = 20
+};
+
+static struct pmu_config pmu_config_5420 = {
+   .disable_reg = WDT_DISABLE_REG_OFFSET,
+   .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
+   .mask_bit = 0
+};
+
+static const struct of_device_id s3c2410_wdt_match[] = {
+   { .compatible = samsung,s3c2410-wdt },
+   { .compatible = samsung,exynos5250-wdt,
+ .data = (struct pmu_config *) pmu_config_5250 },
+   { .compatible = samsung,exynos5420-wdt,
+ .data = (struct pmu_config *) pmu_config_5420 },
+   {},
 };
+MODULE_DEVICE_TABLE(of, s3c2410_wdt_match);
+#endif
 
 /* watchdog control routines */
 
@@ -111,6 +150,38 @@ static inline struct s3c2410_wdt *freq_to_wdt(struct 
notifier_block *nb)
return container_of(nb, struct s3c2410_wdt, freq_transition);
 }
 
+static void s3c2410wdt_mask_and_disable_reset(int mask, struct s3c2410_wdt 
*wdt)
+{
+   unsigned int disable, mask_reset;
+   int ret;
+
+   ret = regmap_read(wdt-pmureg, wdt-wdt_pmu_config-disable_reg,
+   disable);
+   if (ret  0) {
+   dev_err(wdt-dev, failed to read disable reg(%d)\n, ret);
+   return;
+   }
+
+   ret = regmap_read(wdt-pmureg, wdt-wdt_pmu_config-mask_reset_reg,
+   mask_reset);
+   if (ret  0) {
+   dev_err(wdt-dev, failed to read mask reset reg(%d)\n, ret);
+   return;
+   }
+
+   if (mask) {
+   disable |= (1  

[PATCH V4 2/3] ARM: dts: add watchdog device nodes for Exynos5250 and Exynos5420

2013-10-30 Thread Leela Krishna Amudala
Adds watchdog device nodes to the DT device list for Exynos5250 and Exynos5420

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
---
 arch/arm/boot/dts/exynos5.dtsi|7 ---
 arch/arm/boot/dts/exynos5250.dtsi |7 ++-
 arch/arm/boot/dts/exynos5420.dtsi |   10 ++
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
index 918e732..fec8aa7 100644
--- a/arch/arm/boot/dts/exynos5.dtsi
+++ b/arch/arm/boot/dts/exynos5.dtsi
@@ -81,13 +81,6 @@
status = disabled;
};
 
-   watchdog {
-   compatible = samsung,s3c2410-wdt;
-   reg = 0x101D 0x100;
-   interrupts = 0 42 0;
-   status = disabled;
-   };
-
fimd@1440 {
compatible = samsung,exynos5250-fimd;
interrupt-parent = combiner;
diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index c4a8662..e46b5d9 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -158,9 +158,14 @@
interrupts = 0 47 0;
};
 
-   watchdog {
+   watchdog@101D {
+   compatible = samsung,exynos5250-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
clocks = clock 336;
clock-names = watchdog;
+   samsung,pmusysreg = pmu_sys_reg;
+   status = okay;
};
 
g2d@1085 {
diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 6ffefd1..c95385b 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -369,4 +369,14 @@
clock-names = gscl;
samsung,power-domain = gsc_pd;
};
+
+watchdog@101D {
+   compatible = samsung,exynos5420-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
+   clocks = clock 316;
+   clock-names = watchdog;
+   samsung,pmusysreg = pmu_sys_reg;
+   status = okay;
+};
 };
-- 
1.7.10.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 V4 1/3] ARM: dts: Add pmu sysreg node to Exynos5 dtsi file

2013-10-30 Thread Leela Krishna Amudala
Hi,

On Wed, Oct 30, 2013 at 3:22 PM, Sachin Kamat sachin.ka...@linaro.org wrote:
 Hi Leela,

 On 30 October 2013 15:21, Leela Krishna Amudala l.kris...@samsung.com wrote:
 This patch adds pmusysreg node to Exynos5 dtsi file to handle PMU
 register accesses in a centralized way using syscon driver

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
  arch/arm/boot/dts/exynos5.dtsi |5 +
  1 file changed, 5 insertions(+)

 diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
 index e52b038..918e732 100644
 --- a/arch/arm/boot/dts/exynos5.dtsi
 +++ b/arch/arm/boot/dts/exynos5.dtsi
 @@ -106,4 +106,9 @@
 #size-cells = 0;
 status = disabled;
 };
 +
 +   pmu_sys_reg: pmusysreg@1004000 {
 +   compatible = syscon;
 +   reg = 0x1004 0x5000;
 +   };
  };

 Had a look at this in a bit detail and found the following.
 The register base address for this block on 5250 and 5420 as per the
 TRM is 0x1005.

 Also, the binding document specifies the naming convention. According
 to it this node
 should like:

 sys_reg: sysreg@1005 {
compatible = samsung,exynos5-sysreg, syscon;
reg = 0x1005 0x500;
 };


I know, but here my intention is not to regmap system register (0x1005),
but instead PMU register (0x1004), Hence created this node.

~Leela Krishna

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


Re: [PATCH V4 1/3] ARM: dts: Add pmu sysreg node to Exynos5 dtsi file

2013-10-30 Thread Sachin Kamat
On 30 October 2013 15:39, Leela Krishna Amudala l.kris...@samsung.com wrote:
 Hi,

 On Wed, Oct 30, 2013 at 3:22 PM, Sachin Kamat sachin.ka...@linaro.org wrote:
 Hi Leela,

 On 30 October 2013 15:21, Leela Krishna Amudala l.kris...@samsung.com 
 wrote:
 This patch adds pmusysreg node to Exynos5 dtsi file to handle PMU
 register accesses in a centralized way using syscon driver

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
  arch/arm/boot/dts/exynos5.dtsi |5 +
  1 file changed, 5 insertions(+)

 diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
 index e52b038..918e732 100644
 --- a/arch/arm/boot/dts/exynos5.dtsi
 +++ b/arch/arm/boot/dts/exynos5.dtsi
 @@ -106,4 +106,9 @@
 #size-cells = 0;
 status = disabled;
 };
 +
 +   pmu_sys_reg: pmusysreg@1004000 {
 +   compatible = syscon;
 +   reg = 0x1004 0x5000;
 +   };
  };

 Had a look at this in a bit detail and found the following.
 The register base address for this block on 5250 and 5420 as per the
 TRM is 0x1005.

 Also, the binding document specifies the naming convention. According
 to it this node
 should like:

 sys_reg: sysreg@1005 {
compatible = samsung,exynos5-sysreg, syscon;
reg = 0x1005 0x500;
 };


 I know, but here my intention is not to regmap system register (0x1005),
 but instead PMU register (0x1004), Hence created this node.

This clashes with the existing binding for this type of node. Probably
you will need to
define it differently?

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


Re: [PATCH V4 1/3] ARM: dts: Add pmu sysreg node to Exynos5 dtsi file

2013-10-30 Thread Tomasz Figa
On Wednesday 30 of October 2013 15:43:19 Sachin Kamat wrote:
 On 30 October 2013 15:39, Leela Krishna Amudala l.kris...@samsung.com wrote:
  Hi,
 
  On Wed, Oct 30, 2013 at 3:22 PM, Sachin Kamat sachin.ka...@linaro.org 
  wrote:
  Hi Leela,
 
  On 30 October 2013 15:21, Leela Krishna Amudala l.kris...@samsung.com 
  wrote:
  This patch adds pmusysreg node to Exynos5 dtsi file to handle PMU
  register accesses in a centralized way using syscon driver
 
  Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
  ---
   arch/arm/boot/dts/exynos5.dtsi |5 +
   1 file changed, 5 insertions(+)
 
  diff --git a/arch/arm/boot/dts/exynos5.dtsi 
  b/arch/arm/boot/dts/exynos5.dtsi
  index e52b038..918e732 100644
  --- a/arch/arm/boot/dts/exynos5.dtsi
  +++ b/arch/arm/boot/dts/exynos5.dtsi
  @@ -106,4 +106,9 @@
  #size-cells = 0;
  status = disabled;
  };
  +
  +   pmu_sys_reg: pmusysreg@1004000 {
  +   compatible = syscon;
  +   reg = 0x1004 0x5000;
  +   };
   };
 
  Had a look at this in a bit detail and found the following.
  The register base address for this block on 5250 and 5420 as per the
  TRM is 0x1005.
 
  Also, the binding document specifies the naming convention. According
  to it this node
  should like:
 
  sys_reg: sysreg@1005 {
 compatible = samsung,exynos5-sysreg, syscon;
 reg = 0x1005 0x500;
  };
 
 
  I know, but here my intention is not to regmap system register (0x1005),
  but instead PMU register (0x1004), Hence created this node.
 
 This clashes with the existing binding for this type of node. Probably
 you will need to
 define it differently?

PMU and System Registers are two completely separate entities. However
a generic syscon binding can be used to represent both, because they are
just collections of registers shared by multiple IPs.

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: [RESEND] [PATCH V3 2/2] watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu register

2013-10-30 Thread Kumar Gala

On Oct 30, 2013, at 2:01 AM, Leela Krishna Amudala wrote:

 The syscon regmap interface is used to configure AUTOMATIC_WDT_RESET_DISABLE
 and MASK_WDT_RESET_REQUEST registers of PMU to mask/unmask enable/disable of
 watchdog in probe and s2r scenarios.
 
 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
 .../devicetree/bindings/watchdog/samsung-wdt.txt   |   13 ++-
 drivers/watchdog/s3c2410_wdt.c |  114 ++--
 2 files changed, 118 insertions(+), 9 deletions(-)
 
 diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt 
 b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 index 2aa486c..c46c7ce 100644
 --- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 +++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 @@ -5,10 +5,21 @@ after a preset amount of time during which the WDT reset 
 event has not
 occurred.
 
 Required properties:
 -- compatible : should be samsung,s3c2410-wdt
 +- compatible : should be samsung,s3c2410-wdt or samsung,s3c5250-wdt or 
 samsung,s3c5420-wdt
 - reg : base physical address of the controller and length of memory mapped
   region.
 - interrupts : interrupt number to the cpu.
 +- samsung,pmusysreg : reference node to pmu sysreg (required only in case of 
 Exynos5250 and 5420)

Rather than saying required only on Exynos5250 and 5420, how about saying 
required only in case of compatible being samsung,s3c5250-wdt or 
samsung,s3c5420-wdt

 
 Optional properties:
 - timeout-sec : contains the watchdog timeout in seconds.
 +
 +watchdog@101D {
 + compatible = samsung,s3c5250-wdt;
 + reg = 0x101D 0x100;
 + interrupts = 0 42 0;
 + clocks = clock 336;
 + clock-names = watchdog;
 + samsung,sysreg = pmu_sys_reg;
 + status = okay;
 +};

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by 
The Linux Foundation

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


Re: [PATCH V4 3/3] watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu register

2013-10-30 Thread Tomasz Figa
Hi Leela,

On Wednesday 30 of October 2013 15:21:13 Leela Krishna Amudala wrote:
 The syscon regmap interface is used to configure AUTOMATIC_WDT_RESET_DISABLE
 and MASK_WDT_RESET_REQUEST registers of PMU to mask/unmask enable/disable of
 watchdog in probe and s2r scenarios.
 
 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
  .../devicetree/bindings/watchdog/samsung-wdt.txt   |   19 +++-
  drivers/watchdog/s3c2410_wdt.c |  112 
 ++--
  2 files changed, 122 insertions(+), 9 deletions(-)
 
 diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt 
 b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 index 2aa486c..5a9889b 100644
 --- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 +++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 @@ -5,10 +5,27 @@ after a preset amount of time during which the WDT reset 
 event has not
  occurred.
  
  Required properties:
 -- compatible : should be samsung,s3c2410-wdt
 +- compatible : should be one among the following
 + (a) samsung,s3c2410-wdt for Exynos4 and previous SoCs
 + (b) samsung,exynos5250-wdt for Exynos5250
 + (c) samsung,exynos5420-wdt for Exynos5420
 +
  - reg : base physical address of the controller and length of memory mapped
   region.
  - interrupts : interrupt number to the cpu.
 +- samsung,pmusysreg : reference node to pmu sysreg (required only in case of 
 Exynos5250 and 5420)

I don't really like the name of this property. Maybe
samsung,syscon-phandle would be better?

I'm not sure if this property should be tied to PMU, as on future SoCs
those registers might be located in another syscon-style IP. The
description should note that in case of Exynos 5250 and 5420 this should
point to the PMU node, though.

  
  Optional properties:
  - timeout-sec : contains the watchdog timeout in seconds.
 +
 +Example:
 +
 +watchdog@101D {
 + compatible = samsung,exynos5250-wdt;
 + reg = 0x101D 0x100;
 + interrupts = 0 42 0;
 + clocks = clock 336;
 + clock-names = watchdog;
 + samsung,sysreg = pmu_sys_reg;
 + status = okay;
 +};
 diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
 index 23aad7c..d8aefef 100644
 --- a/drivers/watchdog/s3c2410_wdt.c
 +++ b/drivers/watchdog/s3c2410_wdt.c
 @@ -41,6 +41,8 @@
  #include linux/slab.h
  #include linux/err.h
  #include linux/of.h
 +#include linux/mfd/syscon.h
 +#include linux/regmap.h
  
  #define S3C2410_WTCON0x00
  #define S3C2410_WTDAT0x04
 @@ -61,6 +63,10 @@
  #define CONFIG_S3C2410_WATCHDOG_ATBOOT   (0)
  #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15)
  
 +#define WDT_DISABLE_REG_OFFSET   0x0408
 +#define WDT_MASK_RESET_REG_OFFSET0x040c
 +#define QUIRK_NEEDS_PMU_CONFIG   (1  0)
 +
  static bool nowayout = WATCHDOG_NOWAYOUT;
  static int tmr_margin;
  static int tmr_atboot= CONFIG_S3C2410_WATCHDOG_ATBOOT;
 @@ -84,6 +90,12 @@ MODULE_PARM_DESC(soft_noboot, Watchdog action, set to 1 
 to ignore reboots, 
   0 to reboot (default 0));
  MODULE_PARM_DESC(debug, Watchdog debug, set to 1 for debug (default 0));
  
 +struct pmu_config {

For the sake of future extensibility I'd rename this struct to
s3c2410_wdt_variant and add an u32 quirks field, which would has
the QUIRK_NEEDS_PMU_CONFIG set for 5250 and 5420 variants.

 + int disable_reg;
 + int mask_reset_reg;
 + int mask_bit;
 +};
 +
  struct s3c2410_wdt {
   struct device   *dev;
   struct clk  *clock;
 @@ -94,7 +106,34 @@ struct s3c2410_wdt {
   unsigned long   wtdat_save;
   struct watchdog_device  wdt_device;
   struct notifier_block   freq_transition;
 + struct pmu_config   *wdt_pmu_config;
 + struct regmap   *pmureg;
 + unsigned intquirks;

Quirks should be a static per-variant property.

 +};
 +
 +#ifdef CONFIG_OF
 +static struct pmu_config pmu_config_5250  = {
 + .disable_reg = WDT_DISABLE_REG_OFFSET,
 + .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
 + .mask_bit = 20
 +};
 +
 +static struct pmu_config pmu_config_5420 = {
 + .disable_reg = WDT_DISABLE_REG_OFFSET,
 + .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
 + .mask_bit = 0
 +};
 +
 +static const struct of_device_id s3c2410_wdt_match[] = {
 + { .compatible = samsung,s3c2410-wdt },

If you follow what I suggested above, the basic variant would also have
a variant struct associated with it, which would be more consistent.

 + { .compatible = samsung,exynos5250-wdt,
 +   .data = (struct pmu_config *) pmu_config_5250 },
 + { .compatible = samsung,exynos5420-wdt,
 +   .data = (struct pmu_config *) pmu_config_5420 },
 + {},
  };
 +MODULE_DEVICE_TABLE(of, s3c2410_wdt_match);
 +#endif
  
  /* watchdog control routines */
  
 @@ -111,6 +150,38 @@ static inline struct s3c2410_wdt 

Re: [PATCH V4 1/3] ARM: dts: Add pmu sysreg node to Exynos5 dtsi file

2013-10-30 Thread Tomasz Figa
Hi Leela,

On Wednesday 30 of October 2013 15:21:11 Leela Krishna Amudala wrote:
 This patch adds pmusysreg node to Exynos5 dtsi file to handle PMU
 register accesses in a centralized way using syscon driver
 
 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
  arch/arm/boot/dts/exynos5.dtsi |5 +
  1 file changed, 5 insertions(+)
 
 diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
 index e52b038..918e732 100644
 --- a/arch/arm/boot/dts/exynos5.dtsi
 +++ b/arch/arm/boot/dts/exynos5.dtsi
 @@ -106,4 +106,9 @@
   #size-cells = 0;
   status = disabled;
   };
 +
 + pmu_sys_reg: pmusysreg@1004000 {

Please keep the node name generic, syscon should be fine. Also there is
a typo in unit-address suffix. The label could also have a better name,
like pmu_syscon.

Best regards,
Tomasz

 + compatible = syscon;
 + reg = 0x1004 0x5000;
 + };
  };
 

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


Re: [PATCH 1/2] ARM: dts: Fix sysreg node name in exynos4.dtsi

2013-10-30 Thread Tomasz Figa
Hi Sachin,

On Wednesday 30 of October 2013 15:35:53 Sachin Kamat wrote:
 Fix the name as per DT node naming convention.
 
 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 ---
  arch/arm/boot/dts/exynos4.dtsi |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
 index e262946..68479c3 100644
 --- a/arch/arm/boot/dts/exynos4.dtsi
 +++ b/arch/arm/boot/dts/exynos4.dtsi
 @@ -99,7 +99,7 @@
   reg = 0x1044 0x1000;
   };
  
 - sys_reg: sysreg {
 + sys_reg: sysreg@1001 {

While at changing node name, could you rename it to syscon? Nodes
should have more generic names, while sysreg is an Exynos-specific term.

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 V4 1/3] ARM: dts: Add pmu sysreg node to Exynos5 dtsi file

2013-10-30 Thread Guenter Roeck
On Wed, Oct 30, 2013 at 12:22:09PM +0100, Tomasz Figa wrote:
 On Wednesday 30 of October 2013 15:43:19 Sachin Kamat wrote:
  On 30 October 2013 15:39, Leela Krishna Amudala l.kris...@samsung.com 
  wrote:
   Hi,
  
   On Wed, Oct 30, 2013 at 3:22 PM, Sachin Kamat sachin.ka...@linaro.org 
   wrote:
   Hi Leela,
  
   On 30 October 2013 15:21, Leela Krishna Amudala l.kris...@samsung.com 
   wrote:
   This patch adds pmusysreg node to Exynos5 dtsi file to handle PMU
   register accesses in a centralized way using syscon driver
  
   Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
   ---
arch/arm/boot/dts/exynos5.dtsi |5 +
1 file changed, 5 insertions(+)
  
   diff --git a/arch/arm/boot/dts/exynos5.dtsi 
   b/arch/arm/boot/dts/exynos5.dtsi
   index e52b038..918e732 100644
   --- a/arch/arm/boot/dts/exynos5.dtsi
   +++ b/arch/arm/boot/dts/exynos5.dtsi
   @@ -106,4 +106,9 @@
   #size-cells = 0;
   status = disabled;
   };
   +
   +   pmu_sys_reg: pmusysreg@1004000 {
   +   compatible = syscon;
   +   reg = 0x1004 0x5000;
   +   };
};
  
   Had a look at this in a bit detail and found the following.
   The register base address for this block on 5250 and 5420 as per the
   TRM is 0x1005.
  
   Also, the binding document specifies the naming convention. According
   to it this node
   should like:
  
   sys_reg: sysreg@1005 {
  compatible = samsung,exynos5-sysreg, syscon;
  reg = 0x1005 0x500;
   };
  
  
   I know, but here my intention is not to regmap system register 
   (0x1005),
   but instead PMU register (0x1004), Hence created this node.
  
  This clashes with the existing binding for this type of node. Probably
  you will need to
  define it differently?
 
 PMU and System Registers are two completely separate entities. However
 a generic syscon binding can be used to represent both, because they are
 just collections of registers shared by multiple IPs.
 

I would suggest for the participants in this discussion to send Reviewed-by:
or Acked-by: feedback once you are happy with the patches. I am sure this
would help Wim tremendously when deciding if the series is ready for
integration.

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


Re: [PATCH V4] spi: s3c64xx: Enable Word transfer

2013-10-30 Thread Mark Brown
On Wed, Oct 30, 2013 at 11:52:54AM +0530, Rajeshwari Birje wrote:

 The following patch already sets bits_per_word_mask for
 drivers/spi/spi-s3c64xx.c in s3c64xx_spi_probe, hence I had a doubt do
 I need to set the same again.

OK, so how did this work before then?  You're just adding new code but
the driver was previously claiming to support different bits per word
(and now I look at the code there is some handling for that in code).
Is this a bug fix?


signature.asc
Description: Digital signature


Re: [PATCH V4] spi: s3c64xx: Enable Word transfer

2013-10-30 Thread Tomasz Figa
On Wednesday 30 of October 2013 10:00:29 Mark Brown wrote:
 On Wed, Oct 30, 2013 at 11:52:54AM +0530, Rajeshwari Birje wrote:
 
  The following patch already sets bits_per_word_mask for
  drivers/spi/spi-s3c64xx.c in s3c64xx_spi_probe, hence I had a doubt do
  I need to set the same again.
 
 OK, so how did this work before then?  You're just adding new code but
 the driver was previously claiming to support different bits per word
 (and now I look at the code there is some handling for that in code).
 Is this a bug fix?

That's a good question. Rajeshwari, what SPI device did you test this
patch with? Does it have a driver in mainline kernel?

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 1/2] ARM: s3c64xx: cpuidle: convert to platform driver

2013-10-30 Thread Daniel Lezcano

On 10/25/2013 03:23 PM, Daniel Lezcano wrote:

[ ... ]


Won't it be worth to add a new WFI_SLEEP state to the cpuidle driver ?


I don't think so. How a suspend-to-RAM specific thing like WFI_SLEEP
could
be relevant to a cpuidle driver? (Unless there are some plans to
consolidate STR with cpuidle that I haven't heard about...)


I finally found a documentation for the s3c6410x and the description of
the different modes. Indeed, the sleep mode is not adequate for a
cpuidle state. What about the 'stop' and 'deep stop' state ?


Hi Thomas,

just a reminder about the question above, so I can go ahead: fix what 
you pointed out or remove the driver directly.


You mentionned in the previous email the STOP is not usful because it 
can be controlled by manually outside of the cpuidle driver. But I see 
in the documentation, the stop states power gates the cpu and deep-stop 
stops the regulator.


If these states have to been added later, still it worth to remove the 
driver ?


Thanks!
  -- Daniel


--
 http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  http://www.facebook.com/pages/Linaro Facebook |
http://twitter.com/#!/linaroorg Twitter |
http://www.linaro.org/linaro-blog/ Blog

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


Re: [PATCH 1/2] ARM: EXYNOS: Use dev_err() instead of printk() for cpuidle driver

2013-10-30 Thread Rafael J. Wysocki
On Monday, October 21, 2013 10:52:15 AM Jingoo Han wrote:
 Change raw printk() call to dev_err() to provide a better message
 to userspace so it can properly identify the device.
 
 Signed-off-by: Jingoo Han jg1@samsung.com

Both [1-2/2] queued up for 3.13, thanks!

 ---
 - Based against pm-cpuidle branch
 - Tested on Exynos5440
 
  arch/arm/mach-exynos/cpuidle.c |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
 index 1bde6ad..6616e0f 100644
 --- a/arch/arm/mach-exynos/cpuidle.c
 +++ b/arch/arm/mach-exynos/cpuidle.c
 @@ -206,7 +206,7 @@ static int __init exynos_cpuidle_probe(struct 
 platform_device *pdev)
  
   ret = cpuidle_register_driver(exynos4_idle_driver);
   if (ret) {
 - printk(KERN_ERR CPUidle failed to register driver\n);
 + dev_err(pdev-dev, failed to register cpuidle driver\n);
   return ret;
   }
  
 @@ -220,7 +220,7 @@ static int __init exynos_cpuidle_probe(struct 
 platform_device *pdev)
  
   ret = cpuidle_register_device(device);
   if (ret) {
 - printk(KERN_ERR CPUidle register device failed\n);
 + dev_err(pdev-dev, failed to register cpuidle 
 device\n);
   return ret;
   }
   }
 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] ARM: s3c64xx: cpuidle: convert to platform driver

2013-10-30 Thread Tomasz Figa
Hi Daniel,

On Wednesday 30 of October 2013 14:43:51 Daniel Lezcano wrote:
 On 10/25/2013 03:23 PM, Daniel Lezcano wrote:
 
 [ ... ]
 
  Won't it be worth to add a new WFI_SLEEP state to the cpuidle driver
  ?
  
  I don't think so. How a suspend-to-RAM specific thing like WFI_SLEEP
  could
  be relevant to a cpuidle driver? (Unless there are some plans to
  consolidate STR with cpuidle that I haven't heard about...)
  
  I finally found a documentation for the s3c6410x and the description
  of
  the different modes. Indeed, the sleep mode is not adequate for a
  cpuidle state. What about the 'stop' and 'deep stop' state ?
 
 Hi Thomas,
 
 just a reminder about the question above, so I can go ahead: fix what
 you pointed out or remove the driver directly.
 
 You mentionned in the previous email the STOP is not usful because it
 can be controlled by manually outside of the cpuidle driver. But I see
 in the documentation, the stop states power gates the cpu and deep-stop
 stops the regulator.

STOP clock-gates the CPU and DEEP-STOP power-gates it by stopping the 
regulator.

There are some interesting aspects of those modes, like memory self-
refresh, PLL power-off and system-wide down clocking, but I believe they 
are too tricky to handle (coupling with device PM, stopped timers) and 
with too little possible power saving to justify the effort of adding 
support for them.

In the end, I haven't seen support for them implemented even in strange 
vendor kernels used even on production devices, like Android phones.

 
 If these states have to been added later, still it worth to remove the
 driver ?

I don't think that anybody is even going to add support for them and by 
anybody I should probably mean myself, since I'm currently the only person 
actively adding new code for this platform, as a part of my hobby.

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 1/2] ARM: s3c64xx: cpuidle: convert to platform driver

2013-10-30 Thread Daniel Lezcano

On 10/30/2013 03:40 PM, Tomasz Figa wrote:

Hi Daniel,

On Wednesday 30 of October 2013 14:43:51 Daniel Lezcano wrote:

On 10/25/2013 03:23 PM, Daniel Lezcano wrote:

[ ... ]


Won't it be worth to add a new WFI_SLEEP state to the cpuidle driver
?


I don't think so. How a suspend-to-RAM specific thing like WFI_SLEEP
could
be relevant to a cpuidle driver? (Unless there are some plans to
consolidate STR with cpuidle that I haven't heard about...)


I finally found a documentation for the s3c6410x and the description
of
the different modes. Indeed, the sleep mode is not adequate for a
cpuidle state. What about the 'stop' and 'deep stop' state ?


Hi Thomas,

just a reminder about the question above, so I can go ahead: fix what
you pointed out or remove the driver directly.

You mentionned in the previous email the STOP is not usful because it
can be controlled by manually outside of the cpuidle driver. But I see
in the documentation, the stop states power gates the cpu and deep-stop
stops the regulator.


STOP clock-gates the CPU and DEEP-STOP power-gates it by stopping the
regulator.

There are some interesting aspects of those modes, like memory self-
refresh, PLL power-off and system-wide down clocking, but I believe they
are too tricky to handle (coupling with device PM, stopped timers) and
with too little possible power saving to justify the effort of adding
support for them.

In the end, I haven't seen support for them implemented even in strange
vendor kernels used even on production devices, like Android phones.



If these states have to been added later, still it worth to remove the
driver ?


I don't think that anybody is even going to add support for them and by
anybody I should probably mean myself, since I'm currently the only person
actively adding new code for this platform, as a part of my hobby.


Ok, I will kill the driver then.

Thanks
  -- Daniel


--
 http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  http://www.facebook.com/pages/Linaro Facebook |
http://twitter.com/#!/linaroorg Twitter |
http://www.linaro.org/linaro-blog/ Blog

--
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 0/4] Exynos 5410 Dual cluster support

2013-10-30 Thread Kevin Hilman
Hi Mauro,

Mauro Ribeiro mdr...@gmail.com writes:

 Kevin,

 https://github.com/hardkernel/u-boot/tree/odroid-v2012.07

Yes, this is the one I'm using, but USB networking doesn't seem to work
with that.  Do you have USB networking working with that u-boot?  If so,
what changes to the config did you make?

Kevin


 On Thu, Oct 17, 2013 at 5:00 PM, Kevin Hilman khil...@linaro.org wrote:

 Aliaksei Katovich aliaksei.katov...@gmail.com writes:

  hi Kevin;
 
  Vyacheslav Tyrtov v.tyr...@samsung.com writes:
 
   The series of patches represent support of Exynos 5410 SoC
  
   The Exynos 5410 is the first Samsung SoC based on bigLITTLE
 architecture.
   Patches allow all 8 CPU cores (4 x A7 and 4 x A15) to run at the same
 time
  
   Patches add new platform description, support of clock controller,
   dual cluster support and device tree for Exynos 5410
  
   Has been build on v3.12-rc5.
   Has been tested on Exynos 5410 reference board (exynos_defconfig).
 
  Has anyone tried this on the exynos5410 based odroid-xu yet?
 
  I tried booting this on my recently arrived odroid-xu, but am not
  getting it to boot.
 
I am able to boot my odroid-xu+e to busybox with these patches
 applied
against 3.12-rc5: exynos_defconfig and exynos5410-smdk5410.dtb were
used.
 
However there seem to be some issues with virq allocations, like
 this:

 Ah, I've seen the same thing, but for me it doesn't boot reliably.
 Sometimes there's an immediate fault like this[1], and once in a rare
 while, it starts to boot and I see the same virq errors.

 Curious what you guys are using for boot loaders.  I found some
 pre-build u-boot binaries along with the necessary BL1/2 binary blobs in
 the hardkernel kernel repo: https://github.com/hardkernel/linux.git
 branch: origin/odroidxu-3.4.y
 path: tools/hardkernel/u-boot-pre-built

 Unfortunatly, that u-boot doesn't have usb networking support built in
 so I couln't use u-boot to tftp the kernel, so I was able to use fasboot
 to load the kernel/ramdisk, but it's very flaky.

 Do you have an pointers of where to get a known working bootloader.
 Ideally, a u-boot with networking/tftp support would be ideal.

 Thanks,

 Kevin

 [1]
 USB cable Connected![0x4]
 Starting download of 10008576 bytes
 .
 downloading of 10008576 bytes finished
 Kernel size: 00296bc5
 Ramdisk size: 006f3c00
 Booting kernel..
 ## Booting kernel from Legacy Image at 40008000 ...
Image Name:   Linux
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:2714501 Bytes = 2.6 MiB
Load Address: 40008000
Entry Point:  40008000
Verifying Checksum ... OK
XIP Kernel Image ... OK
 OK

 Starting kernel ...

 undefined instruction
 pc : [4000800c]  lr : [bfc65df4]
 sp : bfb5bbc8  ip :  fp : 1251
 r10:   r9 :  r8 : bfb5bf30
 r7 :   r6 :  r5 : 40008000  r4 : bfcabac0
 r3 : bfb5bfa8  r2 : 4100 r1 : 1251  r0 : 
 Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
 Resetting CPU ...

 emmc resetting ...
 resetting ...

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

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


[PATCH v2 1/2] ARM: dts: Fix sysreg node name in exynos4.dtsi

2013-10-30 Thread Sachin Kamat
Fix the name as per DT node naming convention.
- rename the node to syscon which is a more generic name.
- append the register value to the node name.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
Changes since v1:
 * Renamed the node to syscon as suggested by Tomasz Figa.
---
 arch/arm/boot/dts/exynos4.dtsi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index e2629464376f..ce24edba7f6d 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -99,7 +99,7 @@
reg = 0x1044 0x1000;
};
 
-   sys_reg: sysreg {
+   sys_reg: syscon@1001 {
compatible = samsung,exynos4-sysreg, syscon;
reg = 0x1001 0x400;
};
-- 
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 v2 2/2] ARM: dts: Update Samsung sysreg binding document

2013-10-30 Thread Sachin Kamat
Added a binding example for reference and updated the
node name.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 .../devicetree/bindings/arm/samsung/sysreg.txt |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/arm/samsung/sysreg.txt 
b/Documentation/devicetree/bindings/arm/samsung/sysreg.txt
index 5039c0a12f55..f165567a9df0 100644
--- a/Documentation/devicetree/bindings/arm/samsung/sysreg.txt
+++ b/Documentation/devicetree/bindings/arm/samsung/sysreg.txt
@@ -1,7 +1,13 @@
 SAMSUNG S5P/Exynos SoC series System Registers (SYSREG)
 
 Properties:
- - name : should be 'sysreg';
+ - name : should be 'syscon';
  - compatible : should contain samsung,chip name-sysreg, syscon;
For Exynos4 SoC series it should be samsung,exynos4-sysreg, syscon;
  - reg : offset and length of the register set.
+
+Example:
+   syscon@1001 {
+   compatible = samsung,exynos4-sysreg, syscon;
+   reg = 0x1001 0x400;
+   };
-- 
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 1/1] dmaengine: s3c24xx-dma: use DMA_COMPLETE for dma completion status

2013-10-30 Thread Sachin Kamat
Use the recently introduced DMA_COMPLETE instead of DMA_SUCCESS.
Without this patch we get the following build error:
drivers/dma/s3c24xx-dma.c: In function ‘s3c24xx_dma_tx_status’:
drivers/dma/s3c24xx-dma.c:798:13: error: ‘DMA_SUCCESS’ undeclared
(first use in this function)

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Heiko Stuebner he...@sntech.de
Cc: Vinod Koul vinod.k...@intel.com
---
 drivers/dma/s3c24xx-dma.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/s3c24xx-dma.c b/drivers/dma/s3c24xx-dma.c
index 4cb127978636..085da4fe6613 100644
--- a/drivers/dma/s3c24xx-dma.c
+++ b/drivers/dma/s3c24xx-dma.c
@@ -795,7 +795,7 @@ static enum dma_status s3c24xx_dma_tx_status(struct 
dma_chan *chan,
 
spin_lock_irqsave(s3cchan-vc.lock, flags);
ret = dma_cookie_status(chan, cookie, txstate);
-   if (ret == DMA_SUCCESS) {
+   if (ret == DMA_COMPLETE) {
spin_unlock_irqrestore(s3cchan-vc.lock, flags);
return ret;
}
-- 
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 V4 3/3] watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu register

2013-10-30 Thread Leela Krishna Amudala
Hi Tomasz,

On Wed, Oct 30, 2013 at 8:09 PM, Tomasz Figa t.f...@samsung.com wrote:
 Hi Leela,

 On Wednesday 30 of October 2013 15:21:13 Leela Krishna Amudala wrote:
 The syscon regmap interface is used to configure AUTOMATIC_WDT_RESET_DISABLE
 and MASK_WDT_RESET_REQUEST registers of PMU to mask/unmask enable/disable of
 watchdog in probe and s2r scenarios.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 ---
  .../devicetree/bindings/watchdog/samsung-wdt.txt   |   19 +++-
  drivers/watchdog/s3c2410_wdt.c |  112 
 ++--
  2 files changed, 122 insertions(+), 9 deletions(-)

 diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt 
 b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 index 2aa486c..5a9889b 100644
 --- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 +++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
 @@ -5,10 +5,27 @@ after a preset amount of time during which the WDT reset 
 event has not
  occurred.

  Required properties:
 -- compatible : should be samsung,s3c2410-wdt
 +- compatible : should be one among the following
 + (a) samsung,s3c2410-wdt for Exynos4 and previous SoCs
 + (b) samsung,exynos5250-wdt for Exynos5250
 + (c) samsung,exynos5420-wdt for Exynos5420
 +
  - reg : base physical address of the controller and length of memory mapped
   region.
  - interrupts : interrupt number to the cpu.
 +- samsung,pmusysreg : reference node to pmu sysreg (required only in case 
 of Exynos5250 and 5420)

 I don't really like the name of this property. Maybe
 samsung,syscon-phandle would be better?

Okay, changed.

 I'm not sure if this property should be tied to PMU, as on future SoCs
 those registers might be located in another syscon-style IP. The
 description should note that in case of Exynos 5250 and 5420 this should
 point to the PMU node, though.


Added


  Optional properties:
  - timeout-sec : contains the watchdog timeout in seconds.
 +
 +Example:
 +
 +watchdog@101D {
 + compatible = samsung,exynos5250-wdt;
 + reg = 0x101D 0x100;
 + interrupts = 0 42 0;
 + clocks = clock 336;
 + clock-names = watchdog;
 + samsung,sysreg = pmu_sys_reg;
 + status = okay;
 +};
 diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
 index 23aad7c..d8aefef 100644
 --- a/drivers/watchdog/s3c2410_wdt.c
 +++ b/drivers/watchdog/s3c2410_wdt.c
 @@ -41,6 +41,8 @@
  #include linux/slab.h
  #include linux/err.h
  #include linux/of.h
 +#include linux/mfd/syscon.h
 +#include linux/regmap.h

  #define S3C2410_WTCON0x00
  #define S3C2410_WTDAT0x04
 @@ -61,6 +63,10 @@
  #define CONFIG_S3C2410_WATCHDOG_ATBOOT   (0)
  #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15)

 +#define WDT_DISABLE_REG_OFFSET   0x0408
 +#define WDT_MASK_RESET_REG_OFFSET0x040c
 +#define QUIRK_NEEDS_PMU_CONFIG   (1  0)
 +
  static bool nowayout = WATCHDOG_NOWAYOUT;
  static int tmr_margin;
  static int tmr_atboot= CONFIG_S3C2410_WATCHDOG_ATBOOT;
 @@ -84,6 +90,12 @@ MODULE_PARM_DESC(soft_noboot, Watchdog action, set to 1 
 to ignore reboots, 
   0 to reboot (default 0));
  MODULE_PARM_DESC(debug, Watchdog debug, set to 1 for debug (default 0));

 +struct pmu_config {

 For the sake of future extensibility I'd rename this struct to
 s3c2410_wdt_variant and add an u32 quirks field, which would has
 the QUIRK_NEEDS_PMU_CONFIG set for 5250 and 5420 variants.


Modified

 + int disable_reg;
 + int mask_reset_reg;
 + int mask_bit;
 +};
 +
  struct s3c2410_wdt {
   struct device   *dev;
   struct clk  *clock;
 @@ -94,7 +106,34 @@ struct s3c2410_wdt {
   unsigned long   wtdat_save;
   struct watchdog_device  wdt_device;
   struct notifier_block   freq_transition;
 + struct pmu_config   *wdt_pmu_config;
 + struct regmap   *pmureg;
 + unsigned intquirks;

 Quirks should be a static per-variant property.


Taken care

 +};
 +
 +#ifdef CONFIG_OF
 +static struct pmu_config pmu_config_5250  = {
 + .disable_reg = WDT_DISABLE_REG_OFFSET,
 + .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
 + .mask_bit = 20
 +};
 +
 +static struct pmu_config pmu_config_5420 = {
 + .disable_reg = WDT_DISABLE_REG_OFFSET,
 + .mask_reset_reg = WDT_MASK_RESET_REG_OFFSET,
 + .mask_bit = 0
 +};
 +
 +static const struct of_device_id s3c2410_wdt_match[] = {
 + { .compatible = samsung,s3c2410-wdt },

 If you follow what I suggested above, the basic variant would also have
 a variant struct associated with it, which would be more consistent.

 + { .compatible = samsung,exynos5250-wdt,
 +   .data = (struct pmu_config *) pmu_config_5250 },
 + { .compatible = samsung,exynos5420-wdt,
 +   .data = (struct pmu_config *) pmu_config_5420 },
 + {},
  };
 +MODULE_DEVICE_TABLE(of, 

[PATCH V5 2/3] ARM: dts: add watchdog device nodes for Exynos5250 and Exynos5420

2013-10-30 Thread Leela Krishna Amudala
Adds watchdog device nodes to the DT device list for Exynos5250 and Exynos5420

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
---
 arch/arm/boot/dts/exynos5.dtsi|7 ---
 arch/arm/boot/dts/exynos5250.dtsi |7 ++-
 arch/arm/boot/dts/exynos5420.dtsi |   10 ++
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
index ad6e47c9..e6ab5d9 100644
--- a/arch/arm/boot/dts/exynos5.dtsi
+++ b/arch/arm/boot/dts/exynos5.dtsi
@@ -81,13 +81,6 @@
status = disabled;
};
 
-   watchdog {
-   compatible = samsung,s3c2410-wdt;
-   reg = 0x101D 0x100;
-   interrupts = 0 42 0;
-   status = disabled;
-   };
-
fimd@1440 {
compatible = samsung,exynos5250-fimd;
interrupt-parent = combiner;
diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index c4a8662..7e4867f 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -158,9 +158,14 @@
interrupts = 0 47 0;
};
 
-   watchdog {
+   watchdog@101D {
+   compatible = samsung,exynos5250-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
clocks = clock 336;
clock-names = watchdog;
+   samsung,syscon-phandle = pmu_syscon;
+   status = okay;
};
 
g2d@1085 {
diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 6ffefd1..8585fe7 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -369,4 +369,14 @@
clock-names = gscl;
samsung,power-domain = gsc_pd;
};
+
+watchdog@101D {
+   compatible = samsung,exynos5420-wdt;
+   reg = 0x101D 0x100;
+   interrupts = 0 42 0;
+   clocks = clock 316;
+   clock-names = watchdog;
+   samsung,syscon-phandle = pmu_syscon;
+   status = okay;
+};
 };
-- 
1.7.10.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 V5 0/3] Add watchdog DT nodes and use syscon regmap interfac to configure pmu registers

2013-10-30 Thread Leela Krishna Amudala
This patchset does the following things
- Adds pmusysreg device node to exynos5.dtsi file
- Adds watchdog DT nodes to Exynos5250 and 5420
- Uses syscon regmap interface to configure pmu registers
  to mask/unmask enable/disable of watchdog.

This patch set is rebased on Kgene's for-next branch and tested on SMDK5420

Changes since V4:
- changed the node name from pmusysreg to syscon and node label from 
pmu_sys_reg to pmu_syscon
- changed the property name from samsung,pmusysreg to 
samsung,syscon-phandle
- used regmap_update_bits instead of remap_read/regmap_write
- Addressed other comments given by Tomasz Figa t.f...@samsung.com

Changes since V3:
- changed the compatible strings for watchdog node
- splitted up adding pmusysreg node and made it separate patch
- Addressed comments given by Sachin Kamat sachin.ka...@linaro.org

Changes since V2:
- used syscon regmap interface to configure pmu registers in WDT driver
  (suggested by Tomasz Figa t.f...@samsung.com)

Changes since V1:
- Added new compatible string for Exynos5 SoCs
- Introduced quirk mechanism to program PMU registers
- Addressed comments given by Tomasz Figa t.f...@samsung.com

Leela Krishna Amudala (3):
  ARM: dts: Add pmu sysreg node to Exynos5 dtsi file
  ARM: dts: add watchdog device nodes for Exynos5250 and Exynos5420
  watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu
register

 .../devicetree/bindings/watchdog/samsung-wdt.txt   |   22 ++-
 arch/arm/boot/dts/exynos5.dtsi |   12 +-
 arch/arm/boot/dts/exynos5250.dtsi  |7 +-
 arch/arm/boot/dts/exynos5420.dtsi  |   10 ++
 drivers/watchdog/s3c2410_wdt.c |  150 +---
 5 files changed, 175 insertions(+), 26 deletions(-)

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