linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/2] Remove i2c sys_cfg register configuration from mach-exynos
@ 2014-11-24  8:47 Pankaj Dubey
  2014-11-24  8:47 ` [PATCH v6 1/2] i2c: s3c2410: add Sysreg phandle to i2c device nodes Pankaj Dubey
  2014-11-24  8:47 ` [PATCH v6 2/2] ARM: EXYNOS: Remove i2c sys configuration related code Pankaj Dubey
  0 siblings, 2 replies; 5+ messages in thread
From: Pankaj Dubey @ 2014-11-24  8:47 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series is removing i2c sys_cfg register configuration settings from
mach-exynos. All such configuration can be done into i2c driver.
So added new property to hold phandle of SYSREG into i2c device nodes.
This will help in removing static mapping of SYS registers.

This series is based on latest kgene/for-next. 

This patch series requires following change in i2c driver which has been separated
from this patch series and posted separately here [1]

https://patchwork.kernel.org/patch/5363981/

Revision V5 of these patches can related discussion can be found here.

http://www.spinics.net/lists/linux-samsung-soc/msg39326.html

This patch and patch [1] has been tested on kgene/for-next for S2R on Exynos5250 based
SMDK5250 board and it's working well.


Changes since v5:
 - Rebased on latest kgene/for-next (SHA-ID: 4059421c38d24f2f7e06778c8ee6da4ca9abb4b7)
 - Separated changes in i2c-s3c2410.c file and posted as separate patch.

Changes since v4:
 - Rebased on latest kgene/for-next (SHA-ID: 7552917ad948acad6c689d49604f93f725145173)
 - Addressed Wolfram Sang's review comments.

Change since v3:
 - Rebased on latest kgene/for-next (SHA-ID: 2b5fa1d5dabb9af8f2da4f380bea8684f9b96f59)
 - This series consist of only two patches from v3 [1] (v3[1/6] and v3[2/6]).
 - Addressed Tomasz Figa and Wolfram Sang's comments.
 - Updated i2c DT binding information.

Changes since v2:
 - Reorganized patches as suggested by Tomasz Figa.
 - Addressed review comments of Tomasz Figa in i2c-s3c2410.c file.

Changes since v1:
 - Added patch to move i2c interrupt re-configuration code from exynos.c
   to i2c driver, as suggested by Arnd.
 - After above patch only user of SYS_I2C_CFG register is pm.c so moving
   save/restore of this register also into i2c driver.
 - Spiltted up exynos4 and exynos5 machine descriptors to get rid from
   soc_is_exynos4/exynos5 kind of macros, as suggested by Arnd.
 - Changed location of chipid driver to "drivers/soc".
 - Added drivers/base/soc.c provided infrastructure to make SoC specific 
   information avaible to user space via sysfs entry, as suggested by Arnd.


Pankaj Dubey (2):
  i2c: s3c2410: add Sysreg phandle to i2c device nodes
  ARM: EXYNOS: Remove i2c sys configuration related code

 .../devicetree/bindings/i2c/i2c-s3c2410.txt        |    1 +
 arch/arm/boot/dts/exynos5250.dtsi                  |    4 ++
 arch/arm/boot/dts/exynos5420.dtsi                  |    4 ++
 arch/arm/mach-exynos/exynos.c                      |   39 +-------------------
 arch/arm/mach-exynos/include/mach/map.h            |    3 --
 arch/arm/mach-exynos/pm.c                          |    3 +-
 arch/arm/mach-exynos/regs-sys.h                    |   22 -----------
 arch/arm/mach-exynos/suspend.c                     |    7 ----
 8 files changed, 13 insertions(+), 70 deletions(-)
 delete mode 100644 arch/arm/mach-exynos/regs-sys.h

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v6 1/2] i2c: s3c2410: add Sysreg phandle to i2c device nodes
  2014-11-24  8:47 [PATCH v6 0/2] Remove i2c sys_cfg register configuration from mach-exynos Pankaj Dubey
@ 2014-11-24  8:47 ` Pankaj Dubey
  2014-11-26 18:43   ` Kukjin Kim
  2014-11-24  8:47 ` [PATCH v6 2/2] ARM: EXYNOS: Remove i2c sys configuration related code Pankaj Dubey
  1 sibling, 1 reply; 5+ messages in thread
From: Pankaj Dubey @ 2014-11-24  8:47 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds syscon based phandle to i2c device nodes of exynos5250
and exynos5420. These phandles will be used to save restore i2c sysreg
configuration register during s2r from i2c driver.

CC: Rob Herring <robh+dt@kernel.org>
CC: Randy Dunlap <rdunlap@infradead.org>
CC: Russell King <linux@arm.linux.org.uk>
CC: devicetree at vger.kernel.org
CC: linux-doc at vger.kernel.org
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 .../devicetree/bindings/i2c/i2c-s3c2410.txt        |    1 +
 arch/arm/boot/dts/exynos5250.dtsi                  |    4 ++++
 arch/arm/boot/dts/exynos5420.dtsi                  |    4 ++++
 3 files changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
index 278de8e..89b3250 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
@@ -32,6 +32,7 @@ Optional properties:
     specified, default value is 0.
   - samsung,i2c-max-bus-freq: Desired frequency in Hz of the bus. If not
     specified, the default value in Hz is 100000.
+  - samsung,sysreg-phandle - handle to syscon used to control the system registers
 
 Example:
 
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 0a588b4..d45a07e 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -293,6 +293,7 @@
 		clock-names = "i2c";
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2c0_bus>;
+		samsung,sysreg-phandle = <&sysreg_system_controller>;
 		status = "disabled";
 	};
 
@@ -306,6 +307,7 @@
 		clock-names = "i2c";
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2c1_bus>;
+		samsung,sysreg-phandle = <&sysreg_system_controller>;
 		status = "disabled";
 	};
 
@@ -319,6 +321,7 @@
 		clock-names = "i2c";
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2c2_bus>;
+		samsung,sysreg-phandle = <&sysreg_system_controller>;
 		status = "disabled";
 	};
 
@@ -332,6 +335,7 @@
 		clock-names = "i2c";
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2c3_bus>;
+		samsung,sysreg-phandle = <&sysreg_system_controller>;
 		status = "disabled";
 	};
 
diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index 8617a03..90bf401 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -560,6 +560,7 @@
 		clock-names = "i2c";
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2c0_bus>;
+		samsung,sysreg-phandle = <&sysreg_system_controller>;
 		status = "disabled";
 	};
 
@@ -573,6 +574,7 @@
 		clock-names = "i2c";
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2c1_bus>;
+		samsung,sysreg-phandle = <&sysreg_system_controller>;
 		status = "disabled";
 	};
 
@@ -586,6 +588,7 @@
 		clock-names = "i2c";
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2c2_bus>;
+		samsung,sysreg-phandle = <&sysreg_system_controller>;
 		status = "disabled";
 	};
 
@@ -599,6 +602,7 @@
 		clock-names = "i2c";
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2c3_bus>;
+		samsung,sysreg-phandle = <&sysreg_system_controller>;
 		status = "disabled";
 	};
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v6 2/2] ARM: EXYNOS: Remove i2c sys configuration related code
  2014-11-24  8:47 [PATCH v6 0/2] Remove i2c sys_cfg register configuration from mach-exynos Pankaj Dubey
  2014-11-24  8:47 ` [PATCH v6 1/2] i2c: s3c2410: add Sysreg phandle to i2c device nodes Pankaj Dubey
@ 2014-11-24  8:47 ` Pankaj Dubey
  1 sibling, 0 replies; 5+ messages in thread
From: Pankaj Dubey @ 2014-11-24  8:47 UTC (permalink / raw)
  To: linux-arm-kernel

As all these code has been moved into i2c driver, now we can
safely remove them from machine files.

CC: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-exynos/exynos.c           |   39 ++-----------------------------
 arch/arm/mach-exynos/include/mach/map.h |    3 ---
 arch/arm/mach-exynos/pm.c               |    3 ++-
 arch/arm/mach-exynos/regs-sys.h         |   22 -----------------
 arch/arm/mach-exynos/suspend.c          |    7 ------
 5 files changed, 4 insertions(+), 70 deletions(-)
 delete mode 100644 arch/arm/mach-exynos/regs-sys.h

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index c13d083..2c84439 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -27,20 +27,16 @@
 #include <asm/mach/map.h>
 #include <asm/memory.h>
 
+#include <mach/map.h>
+
 #include "common.h"
 #include "mfc.h"
 #include "regs-pmu.h"
-#include "regs-sys.h"
 
 void __iomem *pmu_base_addr;
 
 static struct map_desc exynos4_iodesc[] __initdata = {
 	{
-		.virtual	= (unsigned long)S3C_VA_SYS,
-		.pfn		= __phys_to_pfn(EXYNOS4_PA_SYSCON),
-		.length		= SZ_64K,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)S5P_VA_SROMC,
 		.pfn		= __phys_to_pfn(EXYNOS4_PA_SROMC),
 		.length		= SZ_4K,
@@ -70,11 +66,6 @@ static struct map_desc exynos4_iodesc[] __initdata = {
 
 static struct map_desc exynos5_iodesc[] __initdata = {
 	{
-		.virtual	= (unsigned long)S3C_VA_SYS,
-		.pfn		= __phys_to_pfn(EXYNOS5_PA_SYSCON),
-		.length		= SZ_64K,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)S5P_VA_SROMC,
 		.pfn		= __phys_to_pfn(EXYNOS5_PA_SROMC),
 		.length		= SZ_4K,
@@ -213,32 +204,6 @@ static void __init exynos_init_irq(void)
 
 static void __init exynos_dt_machine_init(void)
 {
-	struct device_node *i2c_np;
-	const char *i2c_compat = "samsung,s3c2440-i2c";
-	unsigned int tmp;
-	int id;
-
-	/*
-	 * Exynos5's legacy i2c controller and new high speed i2c
-	 * controller have muxed interrupt sources. By default the
-	 * interrupts for 4-channel HS-I2C controller are enabled.
-	 * If node for first four channels of legacy i2c controller
-	 * are available then re-configure the interrupts via the
-	 * system register.
-	 */
-	if (soc_is_exynos5()) {
-		for_each_compatible_node(i2c_np, NULL, i2c_compat) {
-			if (of_device_is_available(i2c_np)) {
-				id = of_alias_get_id(i2c_np, "i2c");
-				if (id < 4) {
-					tmp = readl(EXYNOS5_SYS_I2C_CFG);
-					writel(tmp & ~(0x1 << id),
-							EXYNOS5_SYS_I2C_CFG);
-				}
-			}
-		}
-	}
-
 	/*
 	 * This is called from smp_prepare_cpus if we've built for SMP, but
 	 * we still need to set it up for PM and firmware ops if not.
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index 1ad3f49..de3ae59 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -24,9 +24,6 @@
 
 #define EXYNOS_PA_CHIPID		0x10000000
 
-#define EXYNOS4_PA_SYSCON		0x10010000
-#define EXYNOS5_PA_SYSCON		0x10050100
-
 #define EXYNOS4_PA_CMU			0x10030000
 #define EXYNOS5_PA_CMU			0x10010000
 
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 86f3ecd..dfc8594 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -23,12 +23,13 @@
 #include <asm/smp_scu.h>
 #include <asm/suspend.h>
 
+#include <mach/map.h>
+
 #include <plat/pm-common.h>
 
 #include "common.h"
 #include "exynos-pmu.h"
 #include "regs-pmu.h"
-#include "regs-sys.h"
 
 static inline void __iomem *exynos_boot_vector_addr(void)
 {
diff --git a/arch/arm/mach-exynos/regs-sys.h b/arch/arm/mach-exynos/regs-sys.h
deleted file mode 100644
index 84332b0..0000000
--- a/arch/arm/mach-exynos/regs-sys.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com
- *
- * EXYNOS - system register definition
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_ARCH_REGS_SYS_H
-#define __ASM_ARCH_REGS_SYS_H __FILE__
-
-#include <mach/map.h>
-
-#define S5P_SYSREG(x)                          (S3C_VA_SYS + (x))
-
-/* For EXYNOS5 */
-#define EXYNOS5_SYS_I2C_CFG                    S5P_SYSREG(0x0234)
-
-#endif /* __ASM_ARCH_REGS_SYS_H */
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index f8e7dcd..342797b 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -34,7 +34,6 @@
 
 #include "common.h"
 #include "regs-pmu.h"
-#include "regs-sys.h"
 #include "exynos-pmu.h"
 
 #define S5P_CHECK_SLEEP 0x00000BAD
@@ -53,10 +52,6 @@ struct exynos_wkup_irq {
 	u32 mask;
 };
 
-static struct sleep_save exynos5_sys_save[] = {
-	SAVE_ITEM(EXYNOS5_SYS_I2C_CFG),
-};
-
 static struct sleep_save exynos_core_save[] = {
 	/* SROM side */
 	SAVE_ITEM(S5P_SROM_BW),
@@ -497,8 +492,6 @@ static const struct exynos_pm_data exynos5250_pm_data = {
 	.wkup_irq	= exynos5250_wkup_irq,
 	.wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
 	.release_ret_regs = exynos_release_ret_regs,
-	.extra_save	= exynos5_sys_save,
-	.num_extra_save	= ARRAY_SIZE(exynos5_sys_save),
 	.pm_suspend	= exynos_pm_suspend,
 	.pm_resume	= exynos_pm_resume,
 	.pm_prepare	= exynos_pm_prepare,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v6 1/2] i2c: s3c2410: add Sysreg phandle to i2c device nodes
  2014-11-24  8:47 ` [PATCH v6 1/2] i2c: s3c2410: add Sysreg phandle to i2c device nodes Pankaj Dubey
@ 2014-11-26 18:43   ` Kukjin Kim
  2014-11-27  2:49     ` Pankaj Dubey
  0 siblings, 1 reply; 5+ messages in thread
From: Kukjin Kim @ 2014-11-26 18:43 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/24/14 17:47, Pankaj Dubey wrote:
> This patch adds syscon based phandle to i2c device nodes of exynos5250
> and exynos5420. These phandles will be used to save restore i2c sysreg
> configuration register during s2r from i2c driver.
> 
> CC: Rob Herring <robh+dt@kernel.org>
> CC: Randy Dunlap <rdunlap@infradead.org>
> CC: Russell King <linux@arm.linux.org.uk>
> CC: devicetree at vger.kernel.org
> CC: linux-doc at vger.kernel.org
> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>

Applied with change the subject 'ARM: dts: add sysreg phandle to...'

BTW I'm holding on 2nd because conflicts between pm update and cleanup
branches in my tree...

- Kukjin

> ---
>  .../devicetree/bindings/i2c/i2c-s3c2410.txt        |    1 +
>  arch/arm/boot/dts/exynos5250.dtsi                  |    4 ++++
>  arch/arm/boot/dts/exynos5420.dtsi                  |    4 ++++
>  3 files changed, 9 insertions(+)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v6 1/2] i2c: s3c2410: add Sysreg phandle to i2c device nodes
  2014-11-26 18:43   ` Kukjin Kim
@ 2014-11-27  2:49     ` Pankaj Dubey
  0 siblings, 0 replies; 5+ messages in thread
From: Pankaj Dubey @ 2014-11-27  2:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 27 November 2014 12:13 AM, Kukjin Kim wrote:
> On 11/24/14 17:47, Pankaj Dubey wrote:
>> This patch adds syscon based phandle to i2c device nodes of exynos5250
>> and exynos5420. These phandles will be used to save restore i2c sysreg
>> configuration register during s2r from i2c driver.
>>
>> CC: Rob Herring <robh+dt@kernel.org>
>> CC: Randy Dunlap <rdunlap@infradead.org>
>> CC: Russell King <linux@arm.linux.org.uk>
>> CC: devicetree at vger.kernel.org
>> CC: linux-doc at vger.kernel.org
>> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
>
> Applied with change the subject 'ARM: dts: add sysreg phandle to...'
>

Thanks for correcting subject message.

> BTW I'm holding on 2nd because conflicts between pm update and cleanup
> branches in my tree...

Please let me know if anything to be done from my end.

Thanks,
Pankaj Dubey
>
> - Kukjin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-27  2:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-24  8:47 [PATCH v6 0/2] Remove i2c sys_cfg register configuration from mach-exynos Pankaj Dubey
2014-11-24  8:47 ` [PATCH v6 1/2] i2c: s3c2410: add Sysreg phandle to i2c device nodes Pankaj Dubey
2014-11-26 18:43   ` Kukjin Kim
2014-11-27  2:49     ` Pankaj Dubey
2014-11-24  8:47 ` [PATCH v6 2/2] ARM: EXYNOS: Remove i2c sys configuration related code Pankaj Dubey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).