Remove i2c sys_cfg register configuration from mach-exynos
Subsystems (6)
v6 cover Remove i2c sys_cfg register configuration from mach-exynos
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
Signature · 1 line
1.7.9.5
PATCH v6 1/2 i2c: s3c2410: add Sysreg phandle to i2c device nodes
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.
--- .../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(+)
Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt +1 -0
@@ -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:
arch/arm/boot/dts/exynos5250.dtsi +4 -0
@@ -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"; };
arch/arm/boot/dts/exynos5420.dtsi +4 -0
@@ -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"; };
Signature · 1 line
1.7.9.5
Kukjin Kim
maintainerPATCH v6 1/2 i2c: s3c2410: add Sysreg phandle to i2c device nodes
Quoted 10 lines · Pankaj Dubey
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 <[email protected]>CC Randy Dunlap <[email protected]>CC Russell King <[email protected]>CC devicetree at vger.kernel.orgCC linux-doc at vger.kernel.orgSigned-off-by Pankaj Dubey <[email protected]>
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
Quoted 5 lines
--- .../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(+)
PATCH v6 1/2 i2c: s3c2410: add Sysreg phandle to i2c device nodes
Quoted 5 lines · Kukjin Kim
Quoted 4 lines · Pankaj Dubey
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.
Quoted 9 lines
Quoted 6 lines
CC Rob Herring <[email protected]>CC Randy Dunlap <[email protected]>CC Russell King <[email protected]>CC devicetree at vger.kernel.orgCC linux-doc at vger.kernel.orgSigned-off-by Pankaj Dubey <[email protected]>Applied with change the subject 'ARM: dts: add sysreg phandle to...'
Thanks for correcting subject message.
Quoted 2 lines
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
Quoted 2 lines
- Kukjin
PATCH v6 2/2 ARM: EXYNOS: Remove i2c sys configuration related code
In reply to Pankaj DubeyAs all these code has been moved into i2c driver, now we can safely remove them from machine files.
--- 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
arch/arm/mach-exynos/exynos.c +2 -37
@@ -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.
arch/arm/mach-exynos/include/mach/map.h +0 -3
@@ -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
arch/arm/mach-exynos/pm.c +2 -1
@@ -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 ) {
arch/arm/mach-exynos/regs-sys.h deleted +0 -22
@@ -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 */
arch/arm/mach-exynos/suspend.c +0 -7
@@ -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,
Signature · 1 line
1.7.9.5