exynos: add basic support for exynos5260 SoC
Subsystems (8)
cover exynos: add basic support for exynos5260 SoC
add basic support for exynos5260 SoC.
This series is based on linux-next, Kukjin's for-next and Mike's clk-for-linus-3.13 branches.
This patch is dependent on the following series from Tomasz Figa <[email protected]>:
http://www.spinics.net/lists/arm-kernel/msg280223.html
Arun Kumar K (1):
ARM: dts: add dts files for exynos5260 SoC
Pankaj Dubey (2):
ARM: EXYNOS: initial board support for exynos5260 SoC clk/samsung: add support for pll2550xx
Rahul Sharma (3):
clk/samsung: add support for multuple clock providers clk/samsung: add support for pll2650xx clk/exynos5260: add clock file for exynos5260
Young-Gun Jang (1):
pinctrl: exynos: add exynos5260 SoC specific data
.../devicetree/bindings/clock/exynos5260-clock.txt | 228 ++ .../bindings/pinctrl/samsung-pinctrl.txt | 1 + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/exynos5260-pinctrl.dtsi | 586 +++++ arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts | 85 + arch/arm/boot/dts/exynos5260.dtsi | 315 +++ arch/arm/mach-exynos/Kconfig | 9 + arch/arm/mach-exynos/common.c | 19 +- arch/arm/mach-exynos/cpuidle.c | 2 +- arch/arm/mach-exynos/include/mach/map.h | 1 + arch/arm/mach-exynos/include/mach/regs-pmu.h | 4 + arch/arm/mach-exynos/mach-exynos5-dt.c | 1 + arch/arm/plat-samsung/include/plat/cpu.h | 8 + arch/arm/plat-samsung/include/plat/map-s5p.h | 1 + drivers/clk/samsung/Makefile | 1 + drivers/clk/samsung/clk-exynos4.c | 47 +- drivers/clk/samsung/clk-exynos5250.c | 26 +- drivers/clk/samsung/clk-exynos5260.c | 2661 ++++++++++++++++++++ drivers/clk/samsung/clk-exynos5260.h | 496 ++++ drivers/clk/samsung/clk-exynos5420.c | 24 +- drivers/clk/samsung/clk-exynos5440.c | 18 +- drivers/clk/samsung/clk-pll.c | 222 +- drivers/clk/samsung/clk-pll.h | 3 +- drivers/clk/samsung/clk-s3c64xx.c | 44 +- drivers/clk/samsung/clk.c | 110 +- drivers/clk/samsung/clk.h | 46 +- drivers/pinctrl/pinctrl-exynos.c | 82 + drivers/pinctrl/pinctrl-samsung.c | 2 + drivers/pinctrl/pinctrl-samsung.h | 1 + include/dt-bindings/clk/exynos5260-clk.h | 169 ++ 30 files changed, 5076 insertions(+), 137 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/exynos5260-clock.txt create mode 100644 arch/arm/boot/dts/exynos5260-pinctrl.dtsi create mode 100644 arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts create mode 100644 arch/arm/boot/dts/exynos5260.dtsi create mode 100644 drivers/clk/samsung/clk-exynos5260.c create mode 100644 drivers/clk/samsung/clk-exynos5260.h create mode 100644 include/dt-bindings/clk/exynos5260-clk.h
Signature · 1 line
1.7.9.5
PATCH 1/7 ARM: EXYNOS: initial board support for exynos5260 SoC
From: Pankaj Dubey <[email protected]>
This patch add basic arch side support for exynos5260 SoC.
--- arch/arm/mach-exynos/Kconfig | 9 +++++++++ arch/arm/mach-exynos/common.c | 19 ++++++++++++++++++- arch/arm/mach-exynos/cpuidle.c | 2 +- arch/arm/mach-exynos/include/mach/map.h | 1 + arch/arm/mach-exynos/include/mach/regs-pmu.h | 4 ++++ arch/arm/mach-exynos/mach-exynos5-dt.c | 1 + arch/arm/plat-samsung/include/plat/cpu.h | 8 ++++++++ arch/arm/plat-samsung/include/plat/map-s5p.h | 1 + 8 files changed, 43 insertions(+), 2 deletions(-)
arch/arm/mach-exynos/Kconfig +9 -0
@@ -93,6 +93,15 @@ config SOC_EXYNOS5250 help Enable EXYNOS5250 SoC support +config SOC_EXYNOS5260 + bool "SAMSUNG EXYNOS5260" + default y + depends on ARCH_EXYNOS5 + select AUTO_ZRELADDR + select SAMSUNG_DMADEV + help + Enable EXYNOS5260 SoC support + config SOC_EXYNOS5420 bool "SAMSUNG EXYNOS5420" default y
arch/arm/mach-exynos/common.c +18 -1
@@ -52,6 +52,7 @@ static const char name_exynos4210[] = "EXYNOS4210";static const char name_exynos4212[] ="EXYNOS4212" ;static const char name_exynos4412[] ="EXYNOS4412" ;static const char name_exynos5250[] ="EXYNOS5250" ; +static const char name_exynos5260[] ="EXYNOS5260" ;static const char name_exynos5420[] ="EXYNOS5420" ;static const char name_exynos5440[] ="EXYNOS5440" ;
@@ -85,6 +86,12 @@ static struct cpu_table cpu_ids[] __initdata = { .init = exynos_init, .name = name_exynos5250, }, { + .idcode = EXYNOS5260_SOC_ID, + .idmask = EXYNOS5_SOC_MASK, + .map_io = exynos5_map_io, + .init = exynos_init, + .name = name_exynos5260, + }, { .idcode = EXYNOS5420_SOC_ID, .idmask = EXYNOS5_SOC_MASK, .map_io = exynos5_map_io,
@@ -263,6 +270,15 @@ static struct map_desc exynos5_iodesc[] __initdata = { }, }; +static struct map_desc exynos5260_iodesc[]__initdata = { + { + .virtual = (unsigned long )S5P_VA_SYSRAM_NS , + .pfn =__phys_to_pfn (EXYNOS5260_PA_SYSRAM_NS ), + .length =SZ_4K , + .type =MT_DEVICE , + }, +}; +void exynos4_restart (enum reboot_mode mode,const char *cmd) {__raw_writel (0x1 ,S5P_SWRESET );
@@ -371,7 +387,8 @@ static void __init exynos4_map_io(void)static void __init exynos5_map_io (void ) {iotable_init (exynos5_iodesc,ARRAY_SIZE (exynos5_iodesc)); - +if (soc_is_exynos5260 ()) +iotable_init (exynos5260_iodesc,ARRAY_SIZE (exynos5260_iodesc));if (soc_is_exynos5250 ())iotable_init (exynos5250_iodesc,ARRAY_SIZE (exynos5250_iodesc)); }
arch/arm/mach-exynos/cpuidle.c +1 -1
@@ -120,7 +120,7 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev,cpu_suspend (0 , idle_finisher);#ifdef CONFIG_SMP -if (!soc_is_exynos5250 ()) +if (!soc_is_exynos5250 () ||soc_is_exynos5260 ())scu_enable (S5P_VA_SCU );#endif cpu_pm_exit ();
arch/arm/mach-exynos/include/mach/map.h +1 -0
@@ -29,6 +29,7 @@#define EXYNOS4210_PA_SYSRAM_NS 0x0203F000#define EXYNOS4x12_PA_SYSRAM_NS 0x0204F000#define EXYNOS5250_PA_SYSRAM_NS 0x0204F000 +#define EXYNOS5260_PA_SYSRAM_NS 0x02073000#define EXYNOS_PA_CHIPID 0x10000000
arch/arm/mach-exynos/include/mach/regs-pmu.h +4 -0
@@ -234,6 +234,10 @@#define EXYNOS5_SYS_WDTRESET (1 << 20) +#define EXYNOS5260_A7_WDTRST (1 << 24) +#define EXYNOS5260_A15_WDTRST (1 << 23) +#define EXYNOS5260_SYS_WDTRESET (EXYNOS5260_A7_WDTRST || EXYNOS5260_A15_WDTRST) +#define EXYNOS5_ARM_CORE0_SYS_PWR_REG S5P_PMUREG(0x1000)#define EXYNOS5_DIS_IRQ_ARM_CORE0_LOCAL_SYS_PWR_REG S5P_PMUREG(0x1004)#define EXYNOS5_DIS_IRQ_ARM_CORE0_CENTRAL_SYS_PWR_REG S5P_PMUREG(0x1008)
arch/arm/mach-exynos/mach-exynos5-dt.c +1 -0
@@ -50,6 +50,7 @@ static void __init exynos5_dt_machine_init(void)static char const *exynos5_dt_compat[]__initdata = {"samsung,exynos5250" , +"samsung,exynos5260" ,"samsung,exynos5420" ,"samsung,exynos5440" ,NULL
arch/arm/plat-samsung/include/plat/cpu.h +8 -0
@@ -46,6 +46,7 @@ extern unsigned long samsung_cpu_id;#define EXYNOS4_CPU_MASK 0xFFFE0000#define EXYNOS5250_SOC_ID 0x43520000 +#define EXYNOS5260_SOC_ID 0xE5260000#define EXYNOS5420_SOC_ID 0xE5420000#define EXYNOS5440_SOC_ID 0xE5440000#define EXYNOS5_SOC_MASK 0xFFFFF000
@@ -68,6 +69,7 @@ IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK) IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) +IS_SAMSUNG_CPU(exynos5260, EXYNOS5260_SOC_ID, EXYNOS5_SOC_MASK) IS_SAMSUNG_CPU(exynos5420, EXYNOS5420_SOC_ID, EXYNOS5_SOC_MASK)IS_SAMSUNG_CPU (exynos5440,EXYNOS5440_SOC_ID ,EXYNOS5_SOC_MASK )
@@ -148,6 +150,12 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK)# define soc_is_exynos5250 () 0#endif +#if defined(CONFIG_SOC_EXYNOS5260 ) +# define soc_is_exynos5260 () is_samsung_exynos5260() +#else +# define soc_is_exynos5260 () 0 +#endif +#if defined(CONFIG_SOC_EXYNOS5420 )# define soc_is_exynos5420 () is_samsung_exynos5420()#else
arch/arm/plat-samsung/include/plat/map-s5p.h +1 -0
@@ -23,6 +23,7 @@#define S5P_VA_SYSRAM S3C_ADDR(0x02400000)#define S5P_VA_SYSRAM_NS S3C_ADDR(0x02410000) +#define S5P_VA_DMC0 S3C_ADDR(0x02440000)#define S5P_VA_DMC1 S3C_ADDR(0x02480000)#define S5P_VA_SROMC S3C_ADDR(0x024C0000)
Signature · 1 line
1.7.9.5
PATCH 1/7 ARM: EXYNOS: initial board support for exynos5260 SoC
Hi Rahul,
Quoted 6 lines · Rahul Sharma
From: Pankaj Dubey <[email protected]>
This patch add basic arch side support for exynos5260 SoC.
Signed-off-by Pankaj Dubey <[email protected]>Signed-off-by Arun Kumar K <[email protected]>
Since you are posting the patch, your signed off is also required.
[snip]
arch/arm/mach-exynos/common.c static void __init exynos4_map_io(void) · line 391
Quoted 10 lines
void
exynos4_restart(enum reboot_mode mode, const char *cmd){ __raw_writel(0x1, S5P_SWRESET);arch/arm/mach-exynos/common.c +2
-1@@ -371,7 +387,8 @@ static void __init exynos4_map_io(void)static void __init exynos5_map_io (void ) {iotable_init (exynos5_iodesc,ARRAY_SIZE (exynos5_iodesc)); - +if (soc_is_exynos5260 ()) +iotable_init (exynos5260_iodesc,ARRAY_SIZE (exynos5260_iodesc));
Add this after 5250 to maintain numerical order.
Quoted 3 lines
arch/arm/mach-exynos/common.c +0
-0if (soc_is_exynos5250 ())iotable_init (exynos5250_iodesc,ARRAY_SIZE (exynos5250_iodesc)); }
[snip]
Quoted 4 lines
#define
S5P_VA_SYSRAMS3C_ADDR(0x02400000)
#defineS5P_VA_SYSRAM_NSS3C_ADDR(0x02410000)
+
Unnecessary blank line addition.
Signature · 2 lines
With warm regards, Sachin
PATCH 1/7 ARM: EXYNOS: initial board support for exynos5260 SoC
Thanks Sachin,
Quoted 31 lines · Sachin Kamat
Hi Rahul,
Quoted 6 lines · Rahul Sharma
From: Pankaj Dubey <[email protected]>
This patch add basic arch side support for exynos5260 SoC.
Signed-off-by Pankaj Dubey <[email protected]>Signed-off-by Arun Kumar K <[email protected]>Since you are posting the patch, your signed off is also required.
[snip]
arch/arm/mach-exynos/common.c static void __init exynos4_map_io(void) · line 391
Quoted 10 lines
void
exynos4_restart(enum reboot_mode mode, const char *cmd){ __raw_writel(0x1, S5P_SWRESET);arch/arm/mach-exynos/common.c +2
-1@@ -371,7 +387,8 @@ static void __init exynos4_map_io(void)static void __init exynos5_map_io (void ) {iotable_init (exynos5_iodesc,ARRAY_SIZE (exynos5_iodesc)); - +if (soc_is_exynos5260 ()) +iotable_init (exynos5260_iodesc,ARRAY_SIZE (exynos5260_iodesc));Add this after 5250 to maintain numerical order.
arch/arm/mach-exynos/common.c static void __init exynos4_map_io(void) · line 394
Quoted 3 lines
arch/arm/mach-exynos/common.c +0
-0if (soc_is_exynos5250 ())iotable_init (exynos5250_iodesc,ARRAY_SIZE (exynos5250_iodesc)); }
Quoted 7 lines
[snip]
Quoted 4 lines
#define
S5P_VA_SYSRAMS3C_ADDR(0x02400000)
#defineS5P_VA_SYSRAM_NSS3C_ADDR(0x02410000)
+Unnecessary blank line addition.
I will correct all these in next version.
Regards,
Rahul Sharma
Quoted 4 lines
--
With warm regards,
Sachin
PATCH 1/7 ARM: EXYNOS: initial board support for exynos5260 SoC
In reply to Sachin KamatThanks Sachin,
Quoted 11 lines · Sachin Kamat
Hi Rahul,
Quoted 6 lines · Rahul Sharma
From: Pankaj Dubey <[email protected]>
This patch add basic arch side support for exynos5260 SoC.
Signed-off-by Pankaj Dubey <[email protected]>Signed-off-by Arun Kumar K <[email protected]>Since you are posting the patch, your signed off is also required.
Right. I will add my Sign off.
Quoted 15 lines
[snip]
arch/arm/mach-exynos/common.c static void __init exynos4_map_io(void) · line 391
Quoted 10 lines
void
exynos4_restart(enum reboot_mode mode, const char *cmd){ __raw_writel(0x1, S5P_SWRESET);arch/arm/mach-exynos/common.c +2
-1@@ -371,7 +387,8 @@ static void __init exynos4_map_io(void)static void __init exynos5_map_io (void ) {iotable_init (exynos5_iodesc,ARRAY_SIZE (exynos5_iodesc)); - +if (soc_is_exynos5260 ()) +iotable_init (exynos5260_iodesc,ARRAY_SIZE (exynos5260_iodesc));Add this after 5250 to maintain numerical order.
ok.
Quoted 11 lines
Quoted 4 lines
arch/arm/mach-exynos/common.c +0
-0if (soc_is_exynos5250 ())iotable_init (exynos5250_iodesc,ARRAY_SIZE (exynos5250_iodesc)); }[snip]
Quoted 4 lines
#define
S5P_VA_SYSRAMS3C_ADDR(0x02400000)
#defineS5P_VA_SYSRAM_NSS3C_ADDR(0x02410000)
+Unnecessary blank line addition.
I will remove this.
Regards,
Rahul Sharma.
Quoted 5 lines
--
With warm regards,
Sachin
PATCH 1/7 ARM: EXYNOS: initial board support for exynos5260 SoC
In reply to Rahul SharmaHi Pankaj, Rahul, Arun,
In addition to issues already pointed by Sachin, please also see my comments inline.
Quoted 16 lines · On Friday 06 of December 2013 21:26:25 Rahul Sharma wrote:
From: Pankaj Dubey <[email protected]>
This patch add basic arch side support for exynos5260 SoC.
Signed-off-by Pankaj Dubey <[email protected]>Signed-off-by Arun Kumar K <[email protected]>--- arch/arm/mach-exynos/Kconfig | 9 +++++++++ arch/arm/mach-exynos/common.c | 19 ++++++++++++++++++- arch/arm/mach-exynos/cpuidle.c | 2 +- arch/arm/mach-exynos/include/mach/map.h | 1 + arch/arm/mach-exynos/include/mach/regs-pmu.h | 4 ++++ arch/arm/mach-exynos/mach-exynos5-dt.c | 1 + arch/arm/plat-samsung/include/plat/cpu.h | 8 ++++++++ arch/arm/plat-samsung/include/plat/map-s5p.h | 1 + 8 files changed, 43 insertions(+), 2 deletions(-)
[snip]
arch/arm/mach-exynos/cpuidle.c static int exynos4_enter_core0_aftr(struct cpuidle_device *dev, · line 123
Quoted 10 lines
arch/arm/mach-exynos/cpuidle.c +1
-1@@ -120,7 +120,7 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev,cpu_suspend (0 , idle_finisher);#ifdef CONFIG_SMP -if (!soc_is_exynos5250 ()) +if (!soc_is_exynos5250 () ||soc_is_exynos5260 ())
The added OR condition doesn't affect the if condition in any way, because when running on Exynos5260, soc_is_exynos5250() will return false and make the whole condition evaluate to true.
Shouldn't it be
if (!soc_is_exynos5250() && !soc_is_exynos5260())
if Exynos5260 doesn't need scu_enable(), or left as is if it needs?
Quoted 20 lines
arch/arm/mach-exynos/cpuidle.c +0
-0scu_enable (S5P_VA_SCU );#endif cpu_pm_exit ();arch/arm/mach-exynos/include/mach/map.h +1
-0@@ -29,6 +29,7 @@#define EXYNOS4210_PA_SYSRAM_NS 0x0203F000#define EXYNOS4x12_PA_SYSRAM_NS 0x0204F000#define EXYNOS5250_PA_SYSRAM_NS 0x0204F000 +#define EXYNOS5260_PA_SYSRAM_NS 0x02073000#define EXYNOS_PA_CHIPID 0x10000000arch/arm/mach-exynos/include/mach/regs-pmu.h +0
-0
arch/arm/mach-exynos/include/mach/regs-pmu.h line 240
Quoted 7 lines
arch/arm/mach-exynos/include/mach/regs-pmu.h +4
-0@@ -234,6 +234,10 @@#define EXYNOS5_SYS_WDTRESET (1 << 20) +#define EXYNOS5260_A7_WDTRST (1 << 24) +#define EXYNOS5260_A15_WDTRST (1 << 23) +#define EXYNOS5260_SYS_WDTRESET (EXYNOS5260_A7_WDTRST || EXYNOS5260_A15_WDTRST) +
Are these definitions needed? I don't see any user in this patch.
Best regards,
Tomasz
PATCH 1/7 ARM: EXYNOS: initial board support for exynos5260 SoC
Hi Tomasz,
Sorry for responding late.
Quoted 38 lines · Tomasz Figa
Hi Pankaj, Rahul, Arun,
In addition to issues already pointed by Sachin, please also see my comments inline.
Quoted 16 lines · On Friday 06 of December 2013 21:26:25 Rahul Sharma wrote:
From: Pankaj Dubey <[email protected]>
This patch add basic arch side support for exynos5260 SoC.
Signed-off-by Pankaj Dubey <[email protected]>Signed-off-by Arun Kumar K <[email protected]>--- arch/arm/mach-exynos/Kconfig | 9 +++++++++ arch/arm/mach-exynos/common.c | 19 ++++++++++++++++++- arch/arm/mach-exynos/cpuidle.c | 2 +- arch/arm/mach-exynos/include/mach/map.h | 1 + arch/arm/mach-exynos/include/mach/regs-pmu.h | 4 ++++ arch/arm/mach-exynos/mach-exynos5-dt.c | 1 + arch/arm/plat-samsung/include/plat/cpu.h | 8 ++++++++ arch/arm/plat-samsung/include/plat/map-s5p.h | 1 + 8 files changed, 43 insertions(+), 2 deletions(-)[snip]
arch/arm/mach-exynos/cpuidle.c static int exynos4_enter_core0_aftr(struct cpuidle_device *dev, · line 123
Quoted 10 lines
arch/arm/mach-exynos/cpuidle.c +1
-1@@ -120,7 +120,7 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev,cpu_suspend (0 , idle_finisher);#ifdef CONFIG_SMP -if (!soc_is_exynos5250 ()) +if (!soc_is_exynos5250 () ||soc_is_exynos5260 ())The added OR condition doesn't affect the if condition in any way, because when running on Exynos5260,
soc_is_exynos5250()will return false and make the whole condition evaluate to true.
Quoted 6 lines
Shouldn't it be
if (!soc_is_exynos5250() && !soc_is_exynos5260())if Exynos5260 doesn't need
scu_enable(), or left as is if it needs?
Actually we don't need to call scu_enable() for 5260. Hence leaving it as it is.
Quoted 21 lines
Quoted 21 lines
arch/arm/mach-exynos/cpuidle.c +0
-0scu_enable (S5P_VA_SCU );#endif cpu_pm_exit ();arch/arm/mach-exynos/include/mach/map.h +1
-0@@ -29,6 +29,7 @@#define EXYNOS4210_PA_SYSRAM_NS 0x0203F000#define EXYNOS4x12_PA_SYSRAM_NS 0x0204F000#define EXYNOS5250_PA_SYSRAM_NS 0x0204F000 +#define EXYNOS5260_PA_SYSRAM_NS 0x02073000#define EXYNOS_PA_CHIPID 0x10000000arch/arm/mach-exynos/include/mach/regs-pmu.h +0
-0@@ -234,6 +234,10 @@
Quoted 9 lines
arch/arm/mach-exynos/include/mach/regs-pmu.h line 240
Quoted 6 lines
arch/arm/mach-exynos/include/mach/regs-pmu.h +4
-0#define EXYNOS5_SYS_WDTRESET (1 << 20) +#define EXYNOS5260_A7_WDTRST (1 << 24) +#define EXYNOS5260_A15_WDTRST (1 << 23) +#define EXYNOS5260_SYS_WDTRESET (EXYNOS5260_A7_WDTRST || EXYNOS5260_A15_WDTRST) +Are these definitions needed? I don't see any user in this patch.
Removed these definitions.
Regards,
Rahul Sharma.
Quoted 3 lines
Best regards,
Tomasz
PATCH 2/7 pinctrl: exynos: add exynos5260 SoC specific data
In reply to Rahul SharmaFrom: Young-Gun Jang <[email protected]>
Add Samsung Exynos5260 SoC specific data to enable pinctrl support for all platforms based on EXYNOS5260.
--- .../bindings/pinctrl/samsung-pinctrl.txt | 1 + drivers/pinctrl/pinctrl-exynos.c | 82 ++++++++++++++++++++ drivers/pinctrl/pinctrl-samsung.c | 2 + drivers/pinctrl/pinctrl-samsung.h | 1 + 4 files changed, 86 insertions(+)
Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +1 -0
@@ -16,6 +16,7 @@ Required Properties: - "samsung,exynos4210-pinctrl": for Exynos4210 compatible pin-controller. - "samsung,exynos4x12-pinctrl": for Exynos4x12 compatible pin-controller. - "samsung,exynos5250-pinctrl": for Exynos5250 compatible pin-controller. + - "samsung,exynos5260-pinctrl": for Exynos5260 compatible pin-controller. - "samsung,exynos5420-pinctrl": for Exynos5420 compatible pin-controller. - reg: Base address of the pin controller hardware module and length of
drivers/pinctrl/pinctrl-exynos.c +82 -0
88 lines not on this page · raw message
drivers/pinctrl/pinctrl-samsung.c +2 -0
@@ -1120,6 +1120,8 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = { .data = (void *)exynos4x12_pin_ctrl }, { .compatible = "samsung,exynos5250-pinctrl", .data = (void *)exynos5250_pin_ctrl }, + { .compatible = "samsung,exynos5260-pinctrl", + .data = (void *)exynos5260_pin_ctrl }, { .compatible = "samsung,exynos5420-pinctrl", .data = (void *)exynos5420_pin_ctrl }, { .compatible = "samsung,s5pv210-pinctrl",
drivers/pinctrl/pinctrl-samsung.h +1 -0
@@ -254,6 +254,7 @@ struct samsung_pmx_func {extern struct samsung_pin_ctrl exynos4210_pin_ctrl[];extern struct samsung_pin_ctrl exynos4x12_pin_ctrl[];extern struct samsung_pin_ctrl exynos5250_pin_ctrl[]; +extern struct samsung_pin_ctrl exynos5260_pin_ctrl[];extern struct samsung_pin_ctrl exynos5420_pin_ctrl[];extern struct samsung_pin_ctrl s3c64xx_pin_ctrl[];extern struct samsung_pin_ctrl s3c2412_pin_ctrl[];
Signature · 1 line
1.7.9.5
PATCH 2/7 pinctrl: exynos: add exynos5260 SoC specific data
Hi Rahul, Young-Gun,
Quoted 8 lines · Rahul Sharma
From: Young-Gun Jang <[email protected]>
Add Samsung Exynos5260 SoC specific data to enable pinctrl support for all platforms based on EXYNOS5260.
Signed-off-by Pankaj Dubey <[email protected]>Signed-off-by Rahul Sharma <[email protected]>Signed-off-by Arun Kumar K <[email protected]>
Author's (Young-Gun Jang) signed-off by is missing here.
[snip]
drivers/pinctrl/pinctrl-exynos.c struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { · line 1086
Quoted 9 lines
drivers/pinctrl/pinctrl-exynos.c +9
-0+ +/* pin banks of exynos5260 pin-controller 2 */ +static struct samsung_pin_bank exynos5260_pin_banks2[] = { +EXYNOS_PIN_BANK_EINTG (7 ,0x000 ,"gpz0" ,0x00 ), +EXYNOS_PIN_BANK_EINTG (4 ,0x020 ,"gpz1" ,0x04 ), +}; + +/* +* Samsung pinctrl driver data for Exynos5260 SoC. Exynos5420 SoC includes
s/5420/5260 ?
Signature · 2 lines
With warm regards, Sachin
PATCH 2/7 pinctrl: exynos: add exynos5260 SoC specific data
Quoted 5 lines · Sachin Kamat
Hi Rahul, Young-Gun,
Quoted 2 lines · Rahul Sharma
From: Young-Gun Jang <[email protected]>
Quoted 8 lines
Quoted 6 lines
Add Samsung Exynos5260 SoC specific data to enable pinctrl support for all platforms based on EXYNOS5260.
Signed-off-by Pankaj Dubey <[email protected]>Signed-off-by Rahul Sharma <[email protected]>Signed-off-by Arun Kumar K <[email protected]>Author's (Young-Gun Jang) signed-off by is missing here.
I will add his signed-off.
Quoted 15 lines
[snip]
drivers/pinctrl/pinctrl-exynos.c struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { · line 1086
Quoted 9 lines
drivers/pinctrl/pinctrl-exynos.c +9
-0+ +/* pin banks of exynos5260 pin-controller 2 */ +static struct samsung_pin_bank exynos5260_pin_banks2[] = { +EXYNOS_PIN_BANK_EINTG (7 ,0x000 ,"gpz0" ,0x00 ), +EXYNOS_PIN_BANK_EINTG (4 ,0x020 ,"gpz1" ,0x04 ), +}; + +/* +* Samsung pinctrl driver data for Exynos5260 SoC. Exynos5420 SoC includes s/5420/5260 ?
It should be 5260. I will change this in next version.
Thanks,
Rahul Sharma.
Quoted 3 lines
--
With warm regards,
Sachin
PATCH 2/7 pinctrl: exynos: add exynos5260 SoC specific data
In reply to Sachin KamatHi Sachin,
Quoted 5 lines · Sachin Kamat
Hi Rahul, Young-Gun,
Quoted 2 lines · Rahul Sharma
From: Young-Gun Jang <[email protected]>
Quoted 9 lines
Quoted 6 lines
Add Samsung Exynos5260 SoC specific data to enable pinctrl support for all platforms based on EXYNOS5260.
Signed-off-by Pankaj Dubey <[email protected]>Signed-off-by Rahul Sharma <[email protected]>Signed-off-by Arun Kumar K <[email protected]>Author's (Young-Gun Jang) signed-off by is missing here.
done.
Quoted 13 lines
[snip]
drivers/pinctrl/pinctrl-exynos.c struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { · line 1086
Quoted 9 lines
drivers/pinctrl/pinctrl-exynos.c +9
-0+ +/* pin banks of exynos5260 pin-controller 2 */ +static struct samsung_pin_bank exynos5260_pin_banks2[] = { +EXYNOS_PIN_BANK_EINTG (7 ,0x000 ,"gpz0" ,0x00 ), +EXYNOS_PIN_BANK_EINTG (4 ,0x020 ,"gpz1" ,0x04 ), +}; + +/* +* Samsung pinctrl driver data for Exynos5260 SoC. Exynos5420 SoC includes s/5420/5260 ?
done.
Regards,
Rahul Sharma.
Quoted 4 lines
--
With warm regards,
Sachin
PATCH 2/7 pinctrl: exynos: add exynos5260 SoC specific data
In reply to Rahul SharmaHi Young-Gun, Pankaj, Rahul, Arun,
Please see my comments inline.
Quoted 4 lines · On Friday 06 of December 2013 21:26:26 Rahul Sharma wrote:
From: Young-Gun Jang <[email protected]>
Add Samsung Exynos5260 SoC specific data to enable pinctrl support for all platforms based on EXYNOS5260.
[snip]
Quoted 21 lines
drivers/pinctrl/pinctrl-exynos.c +13
-0@@ -1042,6 +1042,88 @@ struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { }, }; +/* pin banks of exynos5260 pin-controller 0 */ +static struct samsung_pin_bank exynos5260_pin_banks0[] = { +EXYNOS_PIN_BANK_EINTG (4 ,0x000 ,"gpa0" ,0x00 ), +EXYNOS_PIN_BANK_EINTG (7 ,0x020 ,"gpa1" ,0x04 ), +EXYNOS_PIN_BANK_EINTG (8 ,0x040 ,"gpa2" ,0x08 ), +EXYNOS_PIN_BANK_EINTG (5 ,0x060 ,"gpb0" ,0x0c ), +EXYNOS_PIN_BANK_EINTG (4 ,0x080 ,"gpb1" ,0x10 ), +EXYNOS_PIN_BANK_EINTG (5 ,0x0A0 ,"gpb2" ,0x14 ), +EXYNOS_PIN_BANK_EINTG (8 ,0x0C0 ,"gpb3" ,0x18 ), +EXYNOS_PIN_BANK_EINTG (8 ,0x0E0 ,"gpb4" ,0x1c ), +EXYNOS_PIN_BANK_EINTG (8 ,0x100 ,"gpb5" ,0x20 ), +EXYNOS_PIN_BANK_EINTG (8 ,0x120 ,"gpd0" ,0x24 ), +EXYNOS_PIN_BANK_EINTG (7 ,0x140 ,"gpd1" ,0x28 ),
drivers/pinctrl/pinctrl-exynos.c struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { · line 1067
Quoted 10 lines
drivers/pinctrl/pinctrl-exynos.c +10
-0+EXYNOS_PIN_BANK_EINTG (5 ,0x160 ,"gpd2" ,0x2c ), +EXYNOS_PIN_BANK_EINTG (8 ,0x180 ,"gpe0" ,0x30 ), +EXYNOS_PIN_BANK_EINTG (5 ,0x1A0 ,"gpe1" ,0x34 ), +EXYNOS_PIN_BANK_EINTG (4 ,0x1C0 ,"gpf0" ,0x38 ), +EXYNOS_PIN_BANK_EINTG (8 ,0x1E0 ,"gpf1" ,0x3c ), +EXYNOS_PIN_BANK_EINTG (2 ,0x200 ,"gpk0" ,0x40 ), +EXYNOS_PIN_BANK_EINTW (8 ,0xC00 ,"gpx0" ,0x00 ), +EXYNOS_PIN_BANK_EINTW (8 ,0xC20 ,"gpx1" ,0x04 ), +EXYNOS_PIN_BANK_EINTW (8 ,0xC40 ,"gpx2" ,0x08 ), + EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
nit: Please use lowercase hexadecimal characters. Despite of already existing code, lowercase is the preferred way.
Quoted 10 lines
drivers/pinctrl/pinctrl-exynos.c +10
-0+}; + +/* pin banks of exynos5260 pin-controller 1 */ +static struct samsung_pin_bank exynos5260_pin_banks1[] = { +EXYNOS_PIN_BANK_EINTG (7 ,0x000 ,"gpc0" ,0x00 ), +EXYNOS_PIN_BANK_EINTG (6 ,0x020 ,"gpc1" ,0x04 ), +EXYNOS_PIN_BANK_EINTG (7 ,0x040 ,"gpc2" ,0x08 ), +EXYNOS_PIN_BANK_EINTG (4 ,0x060 ,"gpc3" ,0x0c ), +EXYNOS_PIN_BANK_EINTG (4 ,0x080 ,"gpc4" ,0x10 ), +};
drivers/pinctrl/pinctrl-exynos.c struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { · line 1087
Quoted 10 lines
drivers/pinctrl/pinctrl-exynos.c +10
-0+ +/* pin banks of exynos5260 pin-controller 2 */ +static struct samsung_pin_bank exynos5260_pin_banks2[] = { +EXYNOS_PIN_BANK_EINTG (7 ,0x000 ,"gpz0" ,0x00 ), +EXYNOS_PIN_BANK_EINTG (4 ,0x020 ,"gpz1" ,0x04 ), +}; + +/* +* Samsung pinctrl driver data for Exynos5260 SoC. Exynos5420 SoC includes +* four gpio/pin-mux/pinconfig controllers.
Hmm, I can see only three of them below. Is there one left undefined?
Otherwise, the patch looks fine.
Best regards,
Tomasz
PATCH 2/7 pinctrl: exynos: add exynos5260 SoC specific data
Tomasz,
Quoted 36 lines · Tomasz Figa
Hi Young-Gun, Pankaj, Rahul, Arun,
Please see my comments inline.
Quoted 4 lines · On Friday 06 of December 2013 21:26:26 Rahul Sharma wrote:
From: Young-Gun Jang <[email protected]>
Add Samsung Exynos5260 SoC specific data to enable pinctrl support for all platforms based on EXYNOS5260.
[snip]
Quoted 26 lines
drivers/pinctrl/pinctrl-exynos.c +18
-0@@ -1042,6 +1042,88 @@ struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { }, }; +/* pin banks of exynos5260 pin-controller 0 */ +static struct samsung_pin_bank exynos5260_pin_banks0[] = { +EXYNOS_PIN_BANK_EINTG (4 ,0x000 ,"gpa0" ,0x00 ), +EXYNOS_PIN_BANK_EINTG (7 ,0x020 ,"gpa1" ,0x04 ), +EXYNOS_PIN_BANK_EINTG (8 ,0x040 ,"gpa2" ,0x08 ), +EXYNOS_PIN_BANK_EINTG (5 ,0x060 ,"gpb0" ,0x0c ), +EXYNOS_PIN_BANK_EINTG (4 ,0x080 ,"gpb1" ,0x10 ), +EXYNOS_PIN_BANK_EINTG (5 ,0x0A0 ,"gpb2" ,0x14 ), +EXYNOS_PIN_BANK_EINTG (8 ,0x0C0 ,"gpb3" ,0x18 ), +EXYNOS_PIN_BANK_EINTG (8 ,0x0E0 ,"gpb4" ,0x1c ), +EXYNOS_PIN_BANK_EINTG (8 ,0x100 ,"gpb5" ,0x20 ), +EXYNOS_PIN_BANK_EINTG (8 ,0x120 ,"gpd0" ,0x24 ), +EXYNOS_PIN_BANK_EINTG (7 ,0x140 ,"gpd1" ,0x28 ), +EXYNOS_PIN_BANK_EINTG (5 ,0x160 ,"gpd2" ,0x2c ), +EXYNOS_PIN_BANK_EINTG (8 ,0x180 ,"gpe0" ,0x30 ), +EXYNOS_PIN_BANK_EINTG (5 ,0x1A0 ,"gpe1" ,0x34 ), +EXYNOS_PIN_BANK_EINTG (4 ,0x1C0 ,"gpf0" ,0x38 ), +EXYNOS_PIN_BANK_EINTG (8 ,0x1E0 ,"gpf1" ,0x3c ),
Quoted 9 lines
drivers/pinctrl/pinctrl-exynos.c struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { · line 1067
Quoted 5 lines
drivers/pinctrl/pinctrl-exynos.c +5
-0+EXYNOS_PIN_BANK_EINTG (2 ,0x200 ,"gpk0" ,0x40 ), +EXYNOS_PIN_BANK_EINTW (8 ,0xC00 ,"gpx0" ,0x00 ), +EXYNOS_PIN_BANK_EINTW (8 ,0xC20 ,"gpx1" ,0x04 ), +EXYNOS_PIN_BANK_EINTW (8 ,0xC40 ,"gpx2" ,0x08 ), + EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),nit: Please use lowercase hexadecimal characters. Despite of already existing code, lowercase is the preferred way.
Changed.
Quoted 14 lines
Quoted 14 lines
drivers/pinctrl/pinctrl-exynos.c +14
-0+}; + +/* pin banks of exynos5260 pin-controller 1 */ +static struct samsung_pin_bank exynos5260_pin_banks1[] = { +EXYNOS_PIN_BANK_EINTG (7 ,0x000 ,"gpc0" ,0x00 ), +EXYNOS_PIN_BANK_EINTG (6 ,0x020 ,"gpc1" ,0x04 ), +EXYNOS_PIN_BANK_EINTG (7 ,0x040 ,"gpc2" ,0x08 ), +EXYNOS_PIN_BANK_EINTG (4 ,0x060 ,"gpc3" ,0x0c ), +EXYNOS_PIN_BANK_EINTG (4 ,0x080 ,"gpc4" ,0x10 ), +}; + +/* pin banks of exynos5260 pin-controller 2 */ +static struct samsung_pin_bank exynos5260_pin_banks2[] = { +EXYNOS_PIN_BANK_EINTG (7 ,0x000 ,"gpz0" ,0x00 ),
Quoted 8 lines
drivers/pinctrl/pinctrl-exynos.c struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { · line 1087
Quoted 6 lines
drivers/pinctrl/pinctrl-exynos.c +6
-0+ EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04), +}; + +/* +* Samsung pinctrl driver data for Exynos5260 SoC. Exynos5420 SoC includes +* four gpio/pin-mux/pinconfig controllers. Hmm, I can see only three of them below. Is there one left undefined?
There are only three. I updated the comment.
regards,
Rahul Sharma
Quoted 6 lines
Otherwise, the patch looks fine.
Best regards,
Tomasz
PATCH 3/7 ARM: dts: add dts files for exynos5260 SoC
In reply to Rahul SharmaFrom: Arun Kumar K <[email protected]>
The patch adds the dts files for exynos5260 and for xyref evt0 board.
--- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/exynos5260-pinctrl.dtsi | 586 +++++++++++++++++++++++ arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts | 85 ++++ arch/arm/boot/dts/exynos5260.dtsi | 315 ++++++++++++ 4 files changed, 987 insertions(+) create mode 100644 arch/arm/boot/dts/exynos5260-pinctrl.dtsi create mode 100644 arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts create mode 100644 arch/arm/boot/dts/exynos5260.dtsi
arch/arm/boot/dts/Makefile +1 -0
@@ -63,6 +63,7 @@ dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \ exynos5250-arndale.dtb \ exynos5250-smdk5250.dtb \ exynos5250-snow.dtb \ + exynos5260-xyref5260-evt0.dtb \ exynos5420-smdk5420.dtb \ exynos5440-sd5v1.dtb \ exynos5440-ssdk5440.dtb
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +586 -0
586 lines not on this page · raw message
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +85 -0
85 lines not on this page · raw message
arch/arm/boot/dts/exynos5260.dtsi new file +315 -0
315 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 3/7 ARM: dts: add dts files for exynos5260 SoC
Hi Pankaj, Rahul, Arun,
Please split generic SoC dtsi files and board dts files into separate patches. Also please see my comments inline.
Quoted 4 lines · On Friday 06 of December 2013 21:26:27 Rahul Sharma wrote:
From: Arun Kumar K <[email protected]>
The patch adds the dts files for exynos5260 and for xyref evt0 board.
[snip]
arch/arm/boot/dts/exynos5260-pinctrl.dtsi line 158
Quoted 6 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +6
-0+ gpx0: gpx0 { + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>;
Just to make sure, all your GPX banks are muxed type, with wake-up interrupts muxed to a single GIC interrupt line, right?
Quoted 1 line
(quoted diff) +1
-0+ };
[snip]
arch/arm/boot/dts/exynos5260-pinctrl.dtsi line 359
Quoted 5 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +5
-0+ cam_gpio_a: cam-gpio-a { + samsung,pins = "gpe0-0", "gpe0-1", "gpe0-2", "gpe0-3", + "gpe0-4", "gpe0-5", "gpe0-6", "gpe0-7", + "gpe1-0", "gpe1-1"; + samsung,pin-function = <2>;
Incorrect indentation.
Quoted 3 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +3
-0+ samsung,pin-pud = <0>; + samsung,pin-drv = <0>; + };
[snip]
arch/arm/boot/dts/exynos5260-pinctrl.dtsi line 402
Quoted 3 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +3
-0+ hdmi_hpd_irq: hdmi-hpd-irq { + samsung,pins = "gpx3-7"; + samsung,pin-function = <0>;
Function 0 is input, not a special function. It shouldn't be handled this way. If a board needs to set up pull-up/down and driver strength for GPIO pins then it should add its own board-specific pinconf nodes with just pin-pud and/or pin-drv properties and without pin-function.
Quoted 4 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +4
-0+ samsung,pin-pud = <1>; + samsung,pin-drv = <0>; + }; + };
[snip]
Quoted 10 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +10
-0+ sd0_bus1: sd0-bus-width1 { + samsung,pins = "gpc0-3"; + samsung,pin-function = <2>; + samsung,pin-pud = <3>; + samsung,pin-drv = <3>; + }; + + sd0_bus4: sd0-bus-width4 { + samsung,pins = "gpc0-3", "gpc0-4", "gpc0-5", "gpc0-6"; + samsung,pin-function = <2>;
arch/arm/boot/dts/exynos5260-pinctrl.dtsi line 489
Quoted 10 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +10
-0+ samsung,pin-pud = <3>; + samsung,pin-drv = <3>; + }; + + sd0_bus8: sd0-bus-width8 { + samsung,pins = "gpc3-0", "gpc3-1", "gpc3-2", "gpc3-3"; + samsung,pin-function = <2>; + samsung,pin-pud = <3>; + samsung,pin-drv = <3>; + };
This is inconsistent. To specify 1- and 4-bit SD busses you need to include reference to just one pinconf node (sd0_bus1 or sd0_bus4), but for 8-bit bus you need to specify both sd0_bus4 and sd0_bus8.
Please make the nodes exclusive, so you always need to specify all possible configurations with given wiring (e.g. with 4 wires, you can run in 1-bit and 4-bit modes, not just 4-bit).
Same for remaining instances of SD bus.
[snip]
Quoted 14 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +8
-0@@ -0,0 +1,85 @@ +/* + * SAMSUNG XYREF5260 EVT0 board device tree source + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 18
Quoted 10 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +10
-0+ * published by the Free Software Foundation. +*/ + +/dts-v1/; +#include "exynos5260.dtsi" + +/ { + model = "SAMSUNG XYREF5260 EVT0 board based on EXYNOS5260"; + compatible = "samsung,xyref5260", "samsung,exynos5260"; +
Shouldn't you have a memory node here?
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 28
Quoted 10 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +10
-0+ chosen { + bootargs = "console=ttySAC2,115200"; + }; + + fixed-rate-clocks { + oscclk { + compatible = "samsung,exynos5260-oscclk"; + clock-frequency = <24000000>; + }; + };
Please use generic fixed clock bindings. You can take [1] as an example how to use them.
[1] arch/arm/boot/dts/s3c6410-smdk6410.dtsi
Quoted 4 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +4
-0+ + serial at 12C00000 { + status = "okay"; + };
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 42
Quoted 10 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +10
-0+ + serial at 12C10000 { + status = "okay"; + }; + + serial at 12C20000 { + status = "okay"; + }; + + serial at 12860000 {
Is it the correct UART address? It seems a bit off compared to addresses of other ports.
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 50
Quoted 8 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +8
-0+ status = "okay"; + }; + + dwmmc0 at 12140000 { + status = "okay"; + num-slots = <1>; + broken-cd; + bypass-smu;
This is not a valid property, according to binding documentation.
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 52
Quoted 2 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +2
-0+ supports-highspeed; + supports-hs200-mode; /* 200 Mhz */
Neither is this one.
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 53
Quoted 1 line
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +1
-0+ fifo-depth = <0x40>;
This is a property of the SoC, not the board.
Quoted 8 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +8
-0+ card-detect-delay = <200>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <0 4>; + samsung,dw-mshc-ddr-timing = <0 2>; + pinctrl-names = "default"; + pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus4 &sd0_bus8>; + + slot at 0 {
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 71
Quoted 10 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +10
-0+ reg = <0>; + bus-width = <8>; + }; + }; + + dwmmc2 at 12160000 { + status = "okay"; + num-slots = <1>; + supports-highspeed; + fifo-depth = <0x40>;
See above.
Quoted 25 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +14
-0+ card-detect-delay = <200>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <2 3>; + samsung,dw-mshc-ddr-timing = <1 2>; + pinctrl-names = "default"; + pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>; + + slot at 0 { + reg = <0>; + bus-width = <4>; + disable-wp; + }; + }; +};arch/arm/boot/dts/exynos5260.dtsi new file +5
-0@@ -0,0 +1,315 @@ +/* + * SAMSUNG EXYNOS5260 SoC device tree source + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. + * http://www.samsung.com
arch/arm/boot/dts/exynos5260.dtsi line 15
Quoted 10 lines
arch/arm/boot/dts/exynos5260.dtsi new file +10
-0+ * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include "skeleton.dtsi" +#include "exynos5260-pinctrl.dtsi" + +#include <dt-bindings/clk/exynos5260-clk.h>
This won't compile, because this file hasn't been added yet by previous patches.
Isn't it possible to reuse some of the definitions from exynos5.dtsi? How much different is this SoC from other SoCs from the series?
Quoted 23 lines
arch/arm/boot/dts/exynos5260.dtsi new file +23
-0+ +/ { + compatible = "samsung,exynos5260"; + interrupt-parent = <&gic>; + + aliases { + pinctrl0 = &pinctrl_0; + pinctrl1 = &pinctrl_1; + pinctrl2 = &pinctrl_2; + }; + + chipid at 10000000 { + compatible = "samsung,exynos4210-chipid"; + reg = <0x10000000 0x100>; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a15";
arch/arm/boot/dts/exynos5260.dtsi line 48
Quoted 10 lines
arch/arm/boot/dts/exynos5260.dtsi new file +10
-0+ reg = <0>; + cci-control-port = <&cci_control1>; + }; + cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <1>; + cci-control-port = <&cci_control1>; + }; + cpu at 2 {
@unit-address suffix must match the first entry of reg property.
arch/arm/boot/dts/exynos5260.dtsi line 54
Quoted 6 lines
arch/arm/boot/dts/exynos5260.dtsi new file +6
-0+ device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x100>; + cci-control-port = <&cci_control0>; + }; + cpu at 3 {
Ditto.
arch/arm/boot/dts/exynos5260.dtsi line 60
Quoted 6 lines
arch/arm/boot/dts/exynos5260.dtsi new file +6
-0+ device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x101>; + cci-control-port = <&cci_control0>; + }; + cpu at 4 {
Ditto.
arch/arm/boot/dts/exynos5260.dtsi line 66
Quoted 6 lines
arch/arm/boot/dts/exynos5260.dtsi new file +6
-0+ device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x102>; + cci-control-port = <&cci_control0>; + }; + cpu at 5 {
Ditto.
arch/arm/boot/dts/exynos5260.dtsi line 74
Quoted 8 lines
arch/arm/boot/dts/exynos5260.dtsi new file +8
-0+ device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x103>; + cci-control-port = <&cci_control0>; + }; + }; + + cmus {
You need compatible = "simple-bus" here if you need the nodes below to be instantiated.
However I'm not sure if there is a point in placing them inside a simple-bus. This needs more thought, so please give me a bit more time to think over this and patches 4 and 7.
arch/arm/boot/dts/exynos5260.dtsi line 79
Quoted 5 lines
arch/arm/boot/dts/exynos5260.dtsi new file +5
-0+ #address-cells = <1>; + #size-cells = <1>; + ranges; + + cmu_top: clock-controller at 0x10010000 {
coding style: There should be no 0x prefix in @unit-address suffix.
+ all the CMU instances below.
[snip]
arch/arm/boot/dts/exynos5260.dtsi line 159
Quoted 2 lines
arch/arm/boot/dts/exynos5260.dtsi new file +2
-0+ + gic:interrupt-controller at 10481000 {
coding style: There should be a space after the colon ending the label.
Quoted 5 lines
arch/arm/boot/dts/exynos5260.dtsi new file +5
-0+ compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <0>; + #size-cells = <0>; + interrupt-controller;
arch/arm/boot/dts/exynos5260.dtsi line 174
Quoted 10 lines
arch/arm/boot/dts/exynos5260.dtsi new file +10
-0+ reg = <0x10481000 0x1000>, + <0x10482000 0x1000>, + <0x10484000 0x2000>, + <0x10486000 0x2000>; + interrupts = <1 9 0xf04>; + }; + + mct at 100B0000 { + compatible = "samsung,exynos4210-mct"; + reg = <0x100B0000 0xb00>;
nit: Inconsistent hexadecimal character case, on Exynos in dts* files upper case should be used.
Also the reg size looks a bit suspicious, as it's not even page aligned. Is it the whole area used by the MCT block, not just the used registers?
arch/arm/boot/dts/exynos5260.dtsi line 97
Quoted 1 line
arch/arm/boot/dts/exynos5260.dtsi new file +1
-0+ interrupt-controller;
MCT is not an interrupt controller.
arch/arm/boot/dts/exynos5260.dtsi line 176
Quoted 1 line
arch/arm/boot/dts/exynos5260.dtsi new file +1
-0+ #interrups-cells = <2>;
Ditto. This is a property specific to interrupt controllers.
arch/arm/boot/dts/exynos5260.dtsi line 185
Quoted 9 lines
arch/arm/boot/dts/exynos5260.dtsi new file +9
-0+ interrupt-parent = <&mct_map>; + interrupts = <0 0>, <1 0>, <2 0>, <3 0>, + <4 0>, <5 0>, <6 0>, <7 0>, + <8 0>, <9 0>, <10 0>, <11 0>; + clocks = <&cmu_top FIN_PLL>, <&cmu_peri PERI_PCLK_MCT>; + clock-names = "fin_pll", "mct"; + + mct_map: mct-map { + #interrupt-cells = <2>;
Why two cells are needed? Using just one woudl simplify interrupt specifiers above and interrupt-map specifiers below.
Quoted 15 lines
arch/arm/boot/dts/exynos5260.dtsi new file +15
-0+ #address-cells = <0>; + #size-cells = <0>; + interrupt-map = <0x0 0 &gic 0 104 0>, + <0x1 0 &gic 0 105 0>, + <0x2 0 &gic 0 106 0>, + <0x3 0 &gic 0 107 0>, + <0x4 0 &gic 0 122 0>, + <0x5 0 &gic 0 123 0>, + <0x6 0 &gic 0 124 0>, + <0x7 0 &gic 0 125 0>, + <0x8 0 &gic 0 126 0>, + <0x9 0 &gic 0 127 0>, + <0xa 0 &gic 0 128 0>, + <0xb 0 &gic 0 129 0>; + };
arch/arm/boot/dts/exynos5260.dtsi line 210
Quoted 10 lines
arch/arm/boot/dts/exynos5260.dtsi new file +10
-0+ }; + + cci at 10F00000 { + compatible = "arm,cci-400"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x10F00000 0x1000>; + ranges = <0x0 0x10F00000 0x6000>; + + cci_control0: slave-if at 4000 { /* Please check again */
Huh? Please check again and send correct data.
Quoted 6 lines
arch/arm/boot/dts/exynos5260.dtsi new file +6
-0+ compatible = "arm,cci-400-ctrl-if"; + interface-type = "ace"; + reg = <0x4000 0x1000>; /* Please check again */ + }; + + cci_control1: slave-if at 5000 { /* Please check again */
arch/arm/boot/dts/exynos5260.dtsi line 226
Quoted 10 lines
arch/arm/boot/dts/exynos5260.dtsi new file +10
-0+ compatible = "arm,cci-400-ctrl-if"; + interface-type = "ace"; + reg = <0x5000 0x1000>; /* Please check again */ + }; + }; + + pinctrl_0: pinctrl at 11600000 { + compatible = "samsung,exynos5260-pinctrl"; + reg = <0x11600000 0x1000>; + interrupts = <0 79 0>; /* GPIO_RT */
Instead of using such comment, maybe it would be better to rename labels of pinctrl nodes to be more meaningful, such as pinctrl_rt, pinctrl_fsys and pinctrl_aud?
Quoted 7 lines
arch/arm/boot/dts/exynos5260.dtsi new file +7
-0+ + wakeup-interrupt-controller { + compatible = "samsung,exynos4210-wakeup-eint"; + interrupt-parent = <&gic>; + interrupts = <0 32 0>; + }; + };
[snip]
arch/arm/boot/dts/exynos5260.dtsi line 283
Quoted 2 lines
arch/arm/boot/dts/exynos5260.dtsi new file +2
-0+ + dwmmc_0: dwmmc0 at 12140000 {
Please use generic "mmc@" names for MMC nodes and move fifo-depth property here to SoC-level dtsi.
Best regards,
Tomasz
PATCH 3/7 ARM: dts: add dts files for exynos5260 SoC
Hi Tomasz,
Quoted 4 lines · Tomasz Figa
Hi Pankaj, Rahul, Arun,
Please split generic SoC dtsi files and board dts files into separate patches. Also please see my comments inline.
I will split them to SoC and Board DT patches.
Quoted 14 lines · On Friday 06 of December 2013 21:26:27 Rahul Sharma wrote:
Quoted 4 lines
From: Arun Kumar K <[email protected]>
The patch adds the dts files for exynos5260 and for xyref evt0 board.
[snip]
arch/arm/boot/dts/exynos5260-pinctrl.dtsi line 158
Quoted 6 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +6
-0+ gpx0: gpx0 { + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>;
Quoted 2 lines
Just to make sure, all your GPX banks are muxed type, with wake-up interrupts muxed to a single GIC interrupt line, right?
There is no combiner in 5260. Each GPX bank is connected one GIC interrupt line.
Quoted 11 lines
Quoted 2 lines
+ };
[snip]
arch/arm/boot/dts/exynos5260-pinctrl.dtsi line 359
Quoted 5 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +5
-0+ cam_gpio_a: cam-gpio-a { + samsung,pins = "gpe0-0", "gpe0-1", "gpe0-2", "gpe0-3", + "gpe0-4", "gpe0-5", "gpe0-6", "gpe0-7", + "gpe1-0", "gpe1-1"; + samsung,pin-function = <2>;Incorrect indentation.
Done.
Quoted 4 lines
Quoted 3 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +3
-0+ samsung,pin-pud = <0>; + samsung,pin-drv = <0>; + };[snip]
Quoted 8 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi line 402
Quoted 3 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +3
-0+ hdmi_hpd_irq: hdmi-hpd-irq { + samsung,pins = "gpx3-7"; + samsung,pin-function = <0>;Function 0 is input, not a special function. It shouldn't be handled this way. If a board needs to set up pull-up/down and driver strength for GPIO pins then it should add its own board-specific pinconf nodes with just pin-pud and/or pin-drv properties and without pin-function.
I moved this node to Board file. I hope that is correct.
Quoted 31 lines
Quoted 5 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +4
-0+ samsung,pin-pud = <1>; + samsung,pin-drv = <0>; + }; + };[snip]
Quoted 10 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +10
-0+ sd0_bus1: sd0-bus-width1 { + samsung,pins = "gpc0-3"; + samsung,pin-function = <2>; + samsung,pin-pud = <3>; + samsung,pin-drv = <3>; + }; + + sd0_bus4: sd0-bus-width4 { + samsung,pins = "gpc0-3", "gpc0-4", "gpc0-5", "gpc0-6"; + samsung,pin-function = <2>;arch/arm/boot/dts/exynos5260-pinctrl.dtsi line 489
Quoted 10 lines
arch/arm/boot/dts/exynos5260-pinctrl.dtsi new file +10
-0+ samsung,pin-pud = <3>; + samsung,pin-drv = <3>; + }; + + sd0_bus8: sd0-bus-width8 { + samsung,pins = "gpc3-0", "gpc3-1", "gpc3-2", "gpc3-3"; + samsung,pin-function = <2>; + samsung,pin-pud = <3>; + samsung,pin-drv = <3>; + };This is inconsistent. To specify 1- and 4-bit SD busses you need to include reference to just one pinconf node (
sd0_bus1orsd0_bus4), but for 8-bit bus you need to specify bothsd0_bus4andsd0_bus8.
Quoted 4 lines
Please make the nodes exclusive, so you always need to specify all possible configurations with given wiring (e.g. with 4 wires, you can run in 1-bit and 4-bit modes, not just 4-bit).
Ok. I will remove "gpc0-3" from sdX_bus4.
Quoted 22 lines
Same for remaining instances of SD bus.
[snip]
Quoted 18 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +12
-0@@ -0,0 +1,85 @@ +/* + * SAMSUNG XYREF5260 EVT0 board device tree source + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +/dts-v1/;
Quoted 8 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 18
Quoted 6 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +6
-0+#include "exynos5260.dtsi" + +/ { + model = "SAMSUNG XYREF5260 EVT0 board based on EXYNOS5260"; + compatible = "samsung,xyref5260", "samsung,exynos5260"; +Shouldn't you have a memory node here?
I added memory node here.
Quoted 12 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 28
Quoted 11 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +10
-0+ chosen { + bootargs = "console=ttySAC2,115200"; + }; + + fixed-rate-clocks { + oscclk { + compatible = "samsung,exynos5260-oscclk"; + clock-frequency = <24000000>; + }; + };
Quoted 4 lines
Please use generic fixed clock bindings. You can take [1] as an example how to use them.
[1]
arch/arm/boot/dts/s3c6410-smdk6410.dtsi
Ok. I will changes this.
Quoted 10 lines
Quoted 10 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +9
-0+ + serial at 12C00000 { + status = "okay"; + }; + + serial at 12C10000 { + status = "okay"; + }; +
Quoted 9 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 42
Quoted 5 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +5
-0+ serial at 12C20000 { + status = "okay"; + }; + + serial at 12860000 {Is it the correct UART address? It seems a bit off compared to addresses of other ports.
This is correct.
Quoted 32 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 50
Quoted 8 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +8
-0+ status = "okay"; + }; + + dwmmc0 at 12140000 { + status = "okay"; + num-slots = <1>; + broken-cd; + bypass-smu;This is not a valid property, according to binding documentation.
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 52
Quoted 2 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +2
-0+ supports-highspeed; + supports-hs200-mode; /* 200 Mhz */Neither is this one.
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 53
Quoted 1 line
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +1
-0+ fifo-depth = <0x40>;This is a property of the SoC, not the board.
Quoted 12 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +12
-0+ card-detect-delay = <200>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <0 4>; + samsung,dw-mshc-ddr-timing = <0 2>; + pinctrl-names = "default"; + pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus4 &sd0_bus8>; + + slot at 0 { + reg = <0>; + bus-width = <8>; + }; + };
Quoted 8 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts line 71
Quoted 6 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +6
-0+ + dwmmc2 at 12160000 { + status = "okay"; + num-slots = <1>; + supports-highspeed; + fifo-depth = <0x40>;See above.
I will remove them. These are optional properties which are not being referred in the mainline driver.
Quoted 31 lines
Quoted 31 lines
arch/arm/boot/dts/exynos5260-xyref5260-evt0.dts new file +14
-0+ card-detect-delay = <200>; + samsung,dw-mshc-ciu-div = <3>; + samsung,dw-mshc-sdr-timing = <2 3>; + samsung,dw-mshc-ddr-timing = <1 2>; + pinctrl-names = "default"; + pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>; + + slot at 0 { + reg = <0>; + bus-width = <4>; + disable-wp; + }; + }; +};arch/arm/boot/dts/exynos5260.dtsi new file +10
-0@@ -0,0 +1,315 @@ +/* + * SAMSUNG EXYNOS5260 SoC device tree source + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/
Quoted 9 lines
arch/arm/boot/dts/exynos5260.dtsi line 15
Quoted 5 lines
arch/arm/boot/dts/exynos5260.dtsi new file +5
-0+ +#include "skeleton.dtsi" +#include "exynos5260-pinctrl.dtsi" + +#include <dt-bindings/clk/exynos5260-clk.h>This won't compile, because this file hasn't been added yet by previous patches.
I will reorder the patches to ensure build doesn't break.
Quoted 2 lines
Isn't it possible to reuse some of the definitions from
exynos5.dtsi? How much different is this SoC from other SoCs from the series?
It is quite different than other Exynos5 SoCs specially the physical address of the
IPs.
Quoted 28 lines
Quoted 28 lines
arch/arm/boot/dts/exynos5260.dtsi new file +27
-0+ +/ { + compatible = "samsung,exynos5260"; + interrupt-parent = <&gic>; + + aliases { + pinctrl0 = &pinctrl_0; + pinctrl1 = &pinctrl_1; + pinctrl2 = &pinctrl_2; + }; + + chipid at 10000000 { + compatible = "samsung,exynos4210-chipid"; + reg = <0x10000000 0x100>; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <0>; + cci-control-port = <&cci_control1>; + }; + cpu at 1 {
Quoted 8 lines
arch/arm/boot/dts/exynos5260.dtsi line 48
Quoted 6 lines
arch/arm/boot/dts/exynos5260.dtsi new file +6
-0+ device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <1>; + cci-control-port = <&cci_control1>; + }; + cpu at 2 {@unit-address suffix must match the first entry of reg property.
Ok. I will change this.
Quoted 37 lines
arch/arm/boot/dts/exynos5260.dtsi line 54
Quoted 7 lines
arch/arm/boot/dts/exynos5260.dtsi new file +6
-0+ device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x100>; + cci-control-port = <&cci_control0>; + }; + cpu at 3 {Ditto.
arch/arm/boot/dts/exynos5260.dtsi line 60
Quoted 6 lines
arch/arm/boot/dts/exynos5260.dtsi new file +6
-0+ device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x101>; + cci-control-port = <&cci_control0>; + }; + cpu at 4 {Ditto.
arch/arm/boot/dts/exynos5260.dtsi line 66
Quoted 6 lines
arch/arm/boot/dts/exynos5260.dtsi new file +6
-0+ device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x102>; + cci-control-port = <&cci_control0>; + }; + cpu at 5 {Ditto.
arch/arm/boot/dts/exynos5260.dtsi line 74
Quoted 8 lines
arch/arm/boot/dts/exynos5260.dtsi new file +8
-0+ device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x103>; + cci-control-port = <&cci_control0>; + }; + }; + + cmus {
Quoted 6 lines
You need compatible = "simple-bus" here if you need the nodes below to be instantiated.
However I'm not sure if there is a point in placing them inside a simple-bus. This needs more thought, so please give me a bit more time to think over this and patches 4 and 7.
Please let me know if you have a better solution.
Quoted 8 lines
arch/arm/boot/dts/exynos5260.dtsi line 79
Quoted 6 lines
arch/arm/boot/dts/exynos5260.dtsi new file +5
-0+ #address-cells = <1>; + #size-cells = <1>; + ranges; + + cmu_top: clock-controller at 0x10010000 {coding style: There should be no 0x prefix in @unit-address suffix.
ok. Done.
Quoted 8 lines
+ all the CMU instances below.
[snip]
arch/arm/boot/dts/exynos5260.dtsi line 159
Quoted 2 lines
arch/arm/boot/dts/exynos5260.dtsi new file +2
-0+ + gic:interrupt-controller at 10481000 {coding style: There should be a space after the colon ending the label.
Done.
Quoted 16 lines
Quoted 5 lines
arch/arm/boot/dts/exynos5260.dtsi new file +5
-0+ compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <0>; + #size-cells = <0>; + interrupt-controller;arch/arm/boot/dts/exynos5260.dtsi line 174
Quoted 10 lines
arch/arm/boot/dts/exynos5260.dtsi new file +10
-0+ reg = <0x10481000 0x1000>, + <0x10482000 0x1000>, + <0x10484000 0x2000>, + <0x10486000 0x2000>; + interrupts = <1 9 0xf04>; + }; + + mct at 100B0000 { + compatible = "samsung,exynos4210-mct"; + reg = <0x100B0000 0xb00>;
Quoted 6 lines
nit: Inconsistent hexadecimal character case, on Exynos in dts* files upper case should be used.
Also the reg size looks a bit suspicious, as it's not even page aligned. Is it the whole area used by the MCT block, not just the used registers?
Done.
Quoted 18 lines
arch/arm/boot/dts/exynos5260.dtsi line 97
Quoted 1 line
arch/arm/boot/dts/exynos5260.dtsi new file +1
-0+ interrupt-controller;MCT is not an interrupt controller.
arch/arm/boot/dts/exynos5260.dtsi line 176
Quoted 1 line
arch/arm/boot/dts/exynos5260.dtsi new file +1
-0+ #interrups-cells = <2>;Ditto. This is a property specific to interrupt controllers.
arch/arm/boot/dts/exynos5260.dtsi line 185
Quoted 9 lines
arch/arm/boot/dts/exynos5260.dtsi new file +9
-0+ interrupt-parent = <&mct_map>; + interrupts = <0 0>, <1 0>, <2 0>, <3 0>, + <4 0>, <5 0>, <6 0>, <7 0>, + <8 0>, <9 0>, <10 0>, <11 0>; + clocks = <&cmu_top FIN_PLL>, <&cmu_peri PERI_PCLK_MCT>; + clock-names = "fin_pll", "mct"; + + mct_map: mct-map { + #interrupt-cells = <2>;
Quoted 3 lines
Why two cells are needed? Using just one woudl simplify interrupt specifiers above and interrupt-map specifiers below.
Done.
Quoted 40 lines
Quoted 15 lines
arch/arm/boot/dts/exynos5260.dtsi new file +15
-0+ #address-cells = <0>; + #size-cells = <0>; + interrupt-map = <0x0 0 &gic 0 104 0>, + <0x1 0 &gic 0 105 0>, + <0x2 0 &gic 0 106 0>, + <0x3 0 &gic 0 107 0>, + <0x4 0 &gic 0 122 0>, + <0x5 0 &gic 0 123 0>, + <0x6 0 &gic 0 124 0>, + <0x7 0 &gic 0 125 0>, + <0x8 0 &gic 0 126 0>, + <0x9 0 &gic 0 127 0>, + <0xa 0 &gic 0 128 0>, + <0xb 0 &gic 0 129 0>; + };arch/arm/boot/dts/exynos5260.dtsi line 210
Quoted 10 lines
arch/arm/boot/dts/exynos5260.dtsi new file +10
-0+ }; + + cci at 10F00000 { + compatible = "arm,cci-400"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x10F00000 0x1000>; + ranges = <0x0 0x10F00000 0x6000>; + + cci_control0: slave-if at 4000 { /* Please check again */Huh? Please check again and send correct data.
Quoted 12 lines
arch/arm/boot/dts/exynos5260.dtsi new file +12
-0+ compatible = "arm,cci-400-ctrl-if"; + interface-type = "ace"; + reg = <0x4000 0x1000>; /* Please check again */ + }; + + cci_control1: slave-if at 5000 { /* Please check again */ + compatible = "arm,cci-400-ctrl-if"; + interface-type = "ace"; + reg = <0x5000 0x1000>; /* Please check again */ + }; + }; +
Quoted 8 lines
arch/arm/boot/dts/exynos5260.dtsi line 226
Quoted 4 lines
arch/arm/boot/dts/exynos5260.dtsi new file +4
-0+ pinctrl_0: pinctrl at 11600000 { + compatible = "samsung,exynos5260-pinctrl"; + reg = <0x11600000 0x1000>; + interrupts = <0 79 0>; /* GPIO_RT */Instead of using such comment, maybe it would be better to rename labels of pinctrl nodes to be more meaningful, such as
pinctrl_rt,pinctrl_fsysandpinctrl_aud?
I removed the comments.
Quoted 8 lines
arch/arm/boot/dts/exynos5260.dtsi line 233
Quoted 8 lines
arch/arm/boot/dts/exynos5260.dtsi new file +7
-0+ + wakeup-interrupt-controller { + compatible = "samsung,exynos4210-wakeup-eint"; + interrupt-parent = <&gic>; + interrupts = <0 32 0>; + }; + };
Quoted 6 lines
[snip]
arch/arm/boot/dts/exynos5260.dtsi line 283
Quoted 2 lines
arch/arm/boot/dts/exynos5260.dtsi new file +2
-0+ + dwmmc_0: dwmmc0 at 12140000 {Please use generic "mmc@" names for MMC nodes and move fifo-depth property here to SoC-level dtsi.
Done.
Regards,
Rahul Sharma.
Quoted 4 lines
Best regards,
Tomasz
PATCH 4/7 clk/samsung: add support for multuple clock providers
In reply to Rahul SharmaSamsung CCF helper functions do not provide support to register multiple Clock Providers for a given SoC. Due to this limitation SoC platforms are not able to use these helpers for registering mulitple clock providers and are forced to bypass this layer.
This layer is modified acordingly to enable the support.
Clockfile for exynos4, exynos5250, exynos5420, exynos5440 and S3c64xx are also modified as per changed helper functions.
--- drivers/clk/samsung/clk-exynos4.c | 47 ++++++++------- drivers/clk/samsung/clk-exynos5250.c | 26 ++++---- drivers/clk/samsung/clk-exynos5420.c | 24 +++++--- drivers/clk/samsung/clk-exynos5440.c | 18 +++--- drivers/clk/samsung/clk-pll.c | 14 +++-- drivers/clk/samsung/clk-s3c64xx.c | 44 ++++++++------ drivers/clk/samsung/clk.c | 110 +++++++++++++++++++--------------- drivers/clk/samsung/clk.h | 46 ++++++++++---- 8 files changed, 195 insertions(+), 134 deletions(-)
drivers/clk/samsung/clk-exynos4.c +25 -22
@@ -1093,7 +1093,7 @@ static unsigned long exynos4_get_xom(void)return xom; } -static void __init exynos4_clk_register_finpll (void ) +static void __init exynos4_clk_register_finpll (struct samsung_clk_provider *ctx) {struct samsung_fixed_rate_clock fclk;struct clk *clk;
@@ -1116,7 +1116,7 @@ static void __init exynos4_clk_register_finpll(void) fclk.parent_name =NULL ; fclk.flags =CLK_IS_ROOT ; fclk.fixed_rate = finpll_f; -samsung_clk_register_fixed_rate (&fclk,1 ); +samsung_clk_register_fixed_rate (ctx, &fclk,1 ); }
@@ -1226,22 +1226,25 @@ static struct samsung_pll_clock exynos4x12_plls[nr_plls] __initdata = {static void __init exynos4_clk_init (struct device_node *np,enum exynos4_soc soc) { +struct samsung_clk_provider *ctx; exynos4_soc = soc; reg_base =of_iomap (np,0 );if (!reg_base)panic ("%s: failed to map registers\n" , __func__); -samsung_clk_init (np, reg_base, nr_clks); + ctx =samsung_clk_init (np, reg_base, nr_clks); +if (!ctx) +panic ("%s: unable to allocate context.\n" , __func__); -samsung_clk_of_register_fixed_ext (exynos4_fixed_rate_ext_clks, +samsung_clk_of_register_fixed_ext (ctx, exynos4_fixed_rate_ext_clks,ARRAY_SIZE (exynos4_fixed_rate_ext_clks), ext_clk_match); -exynos4_clk_register_finpll (); +exynos4_clk_register_finpll (ctx);if (exynos4_soc ==EXYNOS4210 ) { -samsung_clk_register_mux (exynos4210_mux_early, +samsung_clk_register_mux (ctx, exynos4210_mux_early,ARRAY_SIZE (exynos4210_mux_early));if (_get_rate ("fin_pll" ) ==24000000 ) {
@@ -1255,7 +1258,7 @@ static void __init exynos4_clk_init(struct device_node *np, exynos4210_plls[vpll].rate_table = exynos4210_vpll_rates; -samsung_clk_register_pll (exynos4210_plls, +samsung_clk_register_pll (ctx, exynos4210_plls,ARRAY_SIZE (exynos4210_plls), reg_base); }else {if (_get_rate ("fin_pll" ) ==24000000 ) {
@@ -1267,42 +1270,42 @@ static void __init exynos4_clk_init(struct device_node *np, exynos4x12_vpll_rates; } -samsung_clk_register_pll (exynos4x12_plls, +samsung_clk_register_pll (ctx, exynos4x12_plls,ARRAY_SIZE (exynos4x12_plls), reg_base); } -samsung_clk_register_fixed_rate (exynos4_fixed_rate_clks, +samsung_clk_register_fixed_rate (ctx, exynos4_fixed_rate_clks,ARRAY_SIZE (exynos4_fixed_rate_clks)); -samsung_clk_register_mux (exynos4_mux_clks, +samsung_clk_register_mux (ctx, exynos4_mux_clks,ARRAY_SIZE (exynos4_mux_clks)); -samsung_clk_register_div (exynos4_div_clks, +samsung_clk_register_div (ctx, exynos4_div_clks,ARRAY_SIZE (exynos4_div_clks)); -samsung_clk_register_gate (exynos4_gate_clks, +samsung_clk_register_gate (ctx, exynos4_gate_clks,ARRAY_SIZE (exynos4_gate_clks));if (exynos4_soc ==EXYNOS4210 ) { -samsung_clk_register_fixed_rate (exynos4210_fixed_rate_clks, +samsung_clk_register_fixed_rate (ctx, exynos4210_fixed_rate_clks,ARRAY_SIZE (exynos4210_fixed_rate_clks)); -samsung_clk_register_mux (exynos4210_mux_clks, +samsung_clk_register_mux (ctx, exynos4210_mux_clks,ARRAY_SIZE (exynos4210_mux_clks)); -samsung_clk_register_div (exynos4210_div_clks, +samsung_clk_register_div (ctx, exynos4210_div_clks,ARRAY_SIZE (exynos4210_div_clks)); -samsung_clk_register_gate (exynos4210_gate_clks, +samsung_clk_register_gate (ctx, exynos4210_gate_clks,ARRAY_SIZE (exynos4210_gate_clks)); -samsung_clk_register_alias (exynos4210_aliases, +samsung_clk_register_alias (ctx, exynos4210_aliases,ARRAY_SIZE (exynos4210_aliases)); }else { -samsung_clk_register_mux (exynos4x12_mux_clks, +samsung_clk_register_mux (ctx, exynos4x12_mux_clks,ARRAY_SIZE (exynos4x12_mux_clks)); -samsung_clk_register_div (exynos4x12_div_clks, +samsung_clk_register_div (ctx, exynos4x12_div_clks,ARRAY_SIZE (exynos4x12_div_clks)); -samsung_clk_register_gate (exynos4x12_gate_clks, +samsung_clk_register_gate (ctx, exynos4x12_gate_clks,ARRAY_SIZE (exynos4x12_gate_clks)); -samsung_clk_register_alias (exynos4x12_aliases, +samsung_clk_register_alias (ctx, exynos4x12_aliases,ARRAY_SIZE (exynos4x12_aliases)); } -samsung_clk_register_alias (exynos4_aliases, +samsung_clk_register_alias (ctx, exynos4_aliases,ARRAY_SIZE (exynos4_aliases));exynos4_clk_sleep_init ();
drivers/clk/samsung/clk-exynos5250.c +16 -10
@@ -583,6 +583,8 @@ static struct of_device_id ext_clk_match[] __initdata = {/* register exynox5250 clocks */ static void __init exynos5250_clk_init (struct device_node *np) { +struct samsung_clk_provider *ctx; +if (np) { reg_base =of_iomap (np,0 );if (!reg_base)
@@ -591,11 +593,14 @@ static void __init exynos5250_clk_init(struct device_node *np)panic ("%s: unable to determine soc\n" , __func__); } -samsung_clk_init (np, reg_base, nr_clks); -samsung_clk_of_register_fixed_ext (exynos5250_fixed_rate_ext_clks, + ctx =samsung_clk_init (np, reg_base, nr_clks); +if (!ctx) +panic ("%s: unable to allocate context.\n" , __func__); + +samsung_clk_of_register_fixed_ext (ctx, exynos5250_fixed_rate_ext_clks,ARRAY_SIZE (exynos5250_fixed_rate_ext_clks), ext_clk_match); -samsung_clk_register_mux (exynos5250_pll_pmux_clks, +samsung_clk_register_mux (ctx, exynos5250_pll_pmux_clks,ARRAY_SIZE (exynos5250_pll_pmux_clks));if (_get_rate ("fin_pll" ) ==24 *MHZ )
@@ -604,17 +609,18 @@ static void __init exynos5250_clk_init(struct device_node *np)if (_get_rate ("mout_vpllsrc" ) ==24 *MHZ ) exynos5250_plls[vpll].rate_table = vpll_24mhz_tbl; -samsung_clk_register_pll (exynos5250_plls,ARRAY_SIZE (exynos5250_plls), - reg_base); -samsung_clk_register_fixed_rate (exynos5250_fixed_rate_clks, +samsung_clk_register_pll (ctx, exynos5250_plls, +ARRAY_SIZE (exynos5250_plls), + reg_base); +samsung_clk_register_fixed_rate (ctx, exynos5250_fixed_rate_clks,ARRAY_SIZE (exynos5250_fixed_rate_clks)); -samsung_clk_register_fixed_factor (exynos5250_fixed_factor_clks, +samsung_clk_register_fixed_factor (ctx, exynos5250_fixed_factor_clks,ARRAY_SIZE (exynos5250_fixed_factor_clks)); -samsung_clk_register_mux (exynos5250_mux_clks, +samsung_clk_register_mux (ctx, exynos5250_mux_clks,ARRAY_SIZE (exynos5250_mux_clks)); -samsung_clk_register_div (exynos5250_div_clks, +samsung_clk_register_div (ctx, exynos5250_div_clks,ARRAY_SIZE (exynos5250_div_clks)); -samsung_clk_register_gate (exynos5250_gate_clks, +samsung_clk_register_gate (ctx, exynos5250_gate_clks,ARRAY_SIZE (exynos5250_gate_clks));exynos5250_clk_sleep_init ();
drivers/clk/samsung/clk-exynos5420.c +15 -9
@@ -808,6 +808,8 @@ static struct of_device_id ext_clk_match[] __initdata = {/* register exynos5420 clocks */ static void __init exynos5420_clk_init (struct device_node *np) { +struct samsung_clk_provider *ctx; +if (np) { reg_base =of_iomap (np,0 );if (!reg_base)
@@ -816,21 +818,25 @@ static void __init exynos5420_clk_init(struct device_node *np)panic ("%s: unable to determine soc\n" , __func__); } -samsung_clk_init (np, reg_base, nr_clks); -samsung_clk_of_register_fixed_ext (exynos5420_fixed_rate_ext_clks, + ctx =samsung_clk_init (np, reg_base, nr_clks); +if (!ctx) +panic ("%s: unable to allocate context.\n" , __func__); + +samsung_clk_of_register_fixed_ext (ctx, exynos5420_fixed_rate_ext_clks,ARRAY_SIZE (exynos5420_fixed_rate_ext_clks), ext_clk_match); -samsung_clk_register_pll (exynos5420_plls,ARRAY_SIZE (exynos5420_plls), - reg_base); -samsung_clk_register_fixed_rate (exynos5420_fixed_rate_clks, +samsung_clk_register_pll (ctx, exynos5420_plls, +ARRAY_SIZE (exynos5420_plls), + reg_base); +samsung_clk_register_fixed_rate (ctx, exynos5420_fixed_rate_clks,ARRAY_SIZE (exynos5420_fixed_rate_clks)); -samsung_clk_register_fixed_factor (exynos5420_fixed_factor_clks, +samsung_clk_register_fixed_factor (ctx, exynos5420_fixed_factor_clks,ARRAY_SIZE (exynos5420_fixed_factor_clks)); -samsung_clk_register_mux (exynos5420_mux_clks, +samsung_clk_register_mux (ctx, exynos5420_mux_clks,ARRAY_SIZE (exynos5420_mux_clks)); -samsung_clk_register_div (exynos5420_div_clks, +samsung_clk_register_div (ctx, exynos5420_div_clks,ARRAY_SIZE (exynos5420_div_clks)); -samsung_clk_register_gate (exynos5420_gate_clks, +samsung_clk_register_gate (ctx, exynos5420_gate_clks,ARRAY_SIZE (exynos5420_gate_clks));exynos5420_clk_sleep_init ();
drivers/clk/samsung/clk-exynos5440.c +11 -7
@@ -106,6 +106,7 @@ static struct of_device_id ext_clk_match[] __initdata = {static void __init exynos5440_clk_init (struct device_node *np) {void __iomem *reg_base; +struct samsung_clk_provider *ctx; reg_base =of_iomap (np,0 );if (!reg_base) {
@@ -114,22 +115,25 @@ static void __init exynos5440_clk_init(struct device_node *np)return ; } -samsung_clk_init (np, reg_base, nr_clks); -samsung_clk_of_register_fixed_ext (exynos5440_fixed_rate_ext_clks, + ctx =samsung_clk_init (np, reg_base, nr_clks); +if (!ctx) +panic ("%s: unable to allocate context.\n" , __func__); + +samsung_clk_of_register_fixed_ext (ctx, exynos5440_fixed_rate_ext_clks,ARRAY_SIZE (exynos5440_fixed_rate_ext_clks), ext_clk_match);samsung_clk_register_pll2550x ("cplla" ,"xtal" , reg_base +0x1c ,0x10 );samsung_clk_register_pll2550x ("cpllb" ,"xtal" , reg_base +0x20 ,0x10 ); -samsung_clk_register_fixed_rate (exynos5440_fixed_rate_clks, +samsung_clk_register_fixed_rate (ctx, exynos5440_fixed_rate_clks,ARRAY_SIZE (exynos5440_fixed_rate_clks)); -samsung_clk_register_fixed_factor (exynos5440_fixed_factor_clks, +samsung_clk_register_fixed_factor (ctx, exynos5440_fixed_factor_clks,ARRAY_SIZE (exynos5440_fixed_factor_clks)); -samsung_clk_register_mux (exynos5440_mux_clks, +samsung_clk_register_mux (ctx, exynos5440_mux_clks,ARRAY_SIZE (exynos5440_mux_clks)); -samsung_clk_register_div (exynos5440_div_clks, +samsung_clk_register_div (ctx, exynos5440_div_clks,ARRAY_SIZE (exynos5440_div_clks)); -samsung_clk_register_gate (exynos5440_gate_clks, +samsung_clk_register_gate (ctx, exynos5440_gate_clks,ARRAY_SIZE (exynos5440_gate_clks));pr_info ("Exynos5440: arm_clk = %ldHz\n" ,_get_rate ("arm_clk" ));
drivers/clk/samsung/clk-pll.c +8 -6
@@ -710,8 +710,9 @@ struct clk * __init samsung_clk_register_pll2550x(const char *name,return clk; } -static void __init _samsung_clk_register_pll (struct samsung_pll_clock *pll_clk, -void __iomem *base) +static void __init _samsung_clk_register_pll (struct samsung_clk_provider *ctx, +struct samsung_pll_clock *pll_clk, +void __iomem *base) {struct samsung_clk_pll *pll;struct clk *clk;
@@ -804,7 +805,7 @@ static void __init _samsung_clk_register_pll(struct samsung_pll_clock *pll_clk,return ; } -samsung_clk_add_lookup (clk, pll_clk->id); +samsung_clk_add_lookup (ctx, clk, pll_clk->id);if (!pll_clk->alias)return ;
@@ -815,11 +816,12 @@ static void __init _samsung_clk_register_pll(struct samsung_pll_clock *pll_clk, __func__, pll_clk->name, ret); } -void __init samsung_clk_register_pll (struct samsung_pll_clock *pll_list, -unsigned int nr_pll,void __iomem *base) +void __init samsung_clk_register_pll (struct samsung_clk_provider *ctx, +struct samsung_pll_clock *pll_list, +unsigned int nr_pll,void __iomem *base) {int cnt;for (cnt =0 ; cnt < nr_pll; cnt++) -_samsung_clk_register_pll (&pll_list[cnt], base); +_samsung_clk_register_pll (ctx, &pll_list[cnt], base); }
drivers/clk/samsung/clk-s3c64xx.c +25 -19
91 lines not on this page · raw message
drivers/clk/samsung/clk.c +61 -49
240 lines not on this page · raw message
drivers/clk/samsung/clk.h +34 -12
69 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 4/7 clk/samsung: add support for multuple clock providers
Hi Rahul,
Please see my comments inline.
Quoted 10 lines · On Friday 06 of December 2013 21:26:28 Rahul Sharma wrote:
Samsung CCF helper functions do not provide support to register multiple Clock Providers for a given SoC. Due to this limitation SoC platforms are not able to use these helpers for registering mulitple clock providers and are forced to bypass this layer.
This layer is modified acordingly to enable the support.
Clockfile for exynos4, exynos5250, exynos5420, exynos5440 and S3c64xx are also modified as per changed helper functions.
[snip]
drivers/clk/samsung/clk.c line 17
Quoted 8 lines
drivers/clk/samsung/clk.c +0
-0@@ -15,11 +15,6 @@#include "clk.h" static DEFINE_SPINLOCK (lock);
IMHO you can also move the spinlock into samsung_clk_provider struct, to have more fine grained locking, as you shouldn't need to lock between particular providers, just multiple requests for one.
Quoted 14 lines
drivers/clk/samsung/clk.c +0
-7-static struct clk **clk_table; -static void __iomem *reg_base; -#ifdef CONFIG_OF -static struct clk_onecell_data clk_data; -#endif void samsung_clk_save(void __iomem *base, struct samsung_clk_reg_dump *rd,@@ -55,40 +50,53 @@ struct samsung_clk_reg_dump *samsung_clk_alloc_reg_dump( }/* setup the essentials required to support clock lookup using ccf */ -void __init samsung_clk_init (struct device_node *np,void __iomem *base, -unsigned long nr_clks)
drivers/clk/samsung/clk.c struct samsung_clk_reg_dump *samsung_clk_alloc_reg_dump( · line 61
Quoted 10 lines
drivers/clk/samsung/clk.c +8
-1+struct samsung_clk_provider *__init samsung_clk_init (struct device_node *np, +void __iomem *base,unsigned long nr_clks) { - reg_base = base; +struct samsung_clk_provider *ctx; +struct clk **clk_table; +int ret; + +if (!np) +return NULL ;
This check is incorrect. It's completely correct to call this function with NULL np, when booted without DT and this was handled correctly before this patch. Please keep the same behavior.
Quoted 27 lines
drivers/clk/samsung/clk.c +13
-7+ + ctx =kzalloc (sizeof (struct samsung_clk_provider ),GFP_KERNEL ); +if (!ctx) +panic ("could not allocate clock provider context.\n" ); clk_table =kzalloc (sizeof (struct clk *) * nr_clks,GFP_KERNEL );if (!clk_table)panic ("could not allocate clock lookup table\n" ); -if (!np) -return ; + ctx->reg_base = base; + ctx->clk_data.clks = clk_table; + ctx->clk_data.clk_num = nr_clks; -#ifdef CONFIG_OF - clk_data.clks = clk_table; - clk_data.clk_num = nr_clks; -of_clk_add_provider (np, of_clk_src_onecell_get, &clk_data); -#endif + ret =of_clk_add_provider (np, of_clk_src_onecell_get, + &ctx->clk_data); +if (ret) +panic ("could not register clock provide\n" ); + +return ctx; }
[snip]
drivers/clk/samsung/clk.h line 26
Quoted 11 lines
drivers/clk/samsung/clk.h +3
-0@@ -21,6 +21,17 @@#include <linux/of_address.h> #include "clk-pll.h" +/* Context node which holds information about the clock provider. */ +/** +* struct samsung_clk_provider: information about clock plovider
typo: s/plovider/provider/
drivers/clk/samsung/clk.h line 29
Quoted 3 lines
drivers/clk/samsung/clk.h +3
-0+* @reg_base: virtual address for the register base. +* @clk_data: holds clock related data like clk* and number of clocks. +*/
Why two comments? The kerneldoc one should be enough.
Quoted 51 lines
drivers/clk/samsung/clk.h +24
-10+struct samsung_clk_provider { +void __iomem *reg_base; +struct clk_onecell_data clk_data; +}; +/** * struct samsung_clock_alias: information about mux clock * @id: platform specific id of the clock. @@ -312,29 +323,40 @@ struct samsung_pll_clock {__PLL (_typ, _id,NULL , _name, _pname,CLK_GET_RATE_NOCACHE , \ _lock, _con, _rtable, _alias) -extern void __init samsung_clk_init (struct device_node *np,void __iomem *base, -unsigned long nr_clks); +extern struct samsung_clk_provider *__init samsung_clk_init ( +struct device_node *np,void __iomem *base, +unsigned long nr_clks);extern void __init samsung_clk_of_register_fixed_ext ( +struct samsung_clk_provider *ctx,struct samsung_fixed_rate_clock *fixed_rate_clk,unsigned int nr_fixed_rate_clk,struct of_device_id *clk_matches); -extern void samsung_clk_add_lookup (struct clk *clk,unsigned int id); +extern void samsung_clk_add_lookup (struct samsung_clk_provider *ctx, +struct clk *clk,unsigned int id); -extern void samsung_clk_register_alias (struct samsung_clock_alias *list, -unsigned int nr_clk); +extern void samsung_clk_register_alias (struct samsung_clk_provider *ctx, +struct samsung_clock_alias *list, +unsigned int nr_clk);extern void __init samsung_clk_register_fixed_rate ( -struct samsung_fixed_rate_clock *clk_list,unsigned int nr_clk); +struct samsung_clk_provider *ctx, +struct samsung_fixed_rate_clock *clk_list, +unsigned int nr_clk);extern void __init samsung_clk_register_fixed_factor ( -struct samsung_fixed_factor_clock *list,unsigned int nr_clk); -extern void __init samsung_clk_register_mux (struct samsung_mux_clock *clk_list, +struct samsung_clk_provider *ctx, +struct samsung_fixed_factor_clock *list, +unsigned int nr_clk); +extern void __init samsung_clk_register_mux (struct samsung_clk_provider *ctx, +struct samsung_mux_clock *clk_list,unsigned int nr_clk); -extern void __init samsung_clk_register_div (struct samsung_div_clock *clk_list, +extern void __init samsung_clk_register_div (struct samsung_clk_provider *ctx, +struct samsung_div_clock *clk_list,unsigned int nr_clk); -extern void __init samsung_clk_register_gate(
drivers/clk/samsung/clk.h struct samsung_pll_clock { · line 362
Quoted 10 lines
drivers/clk/samsung/clk.h +4
-2+extern void __init samsung_clk_register_gate (struct samsung_clk_provider *ctx,struct samsung_gate_clock *clk_list,unsigned int nr_clk); -extern void __init samsung_clk_register_pll (struct samsung_pll_clock *pll_list, -unsigned int nr_clk,void __iomem *base); +extern void __init samsung_clk_register_pll (struct samsung_clk_provider *ctx, +struct samsung_pll_clock *pll_list, +unsigned int nr_clk,void __iomem *base);extern unsigned long _get_rate (const char *clk_name);
nit: Please keep the indentation consistent in all the function prototypes above.
Best regards,
Tomasz
PATCH 4/7 clk/samsung: add support for multuple clock providers
Hi Tomasz,
Quoted 23 lines · Tomasz Figa
Hi Rahul,
Please see my comments inline.
Quoted 10 lines · On Friday 06 of December 2013 21:26:28 Rahul Sharma wrote:
Samsung CCF helper functions do not provide support to register multiple Clock Providers for a given SoC. Due to this limitation SoC platforms are not able to use these helpers for registering mulitple clock providers and are forced to bypass this layer.
This layer is modified acordingly to enable the support.
Clockfile for exynos4, exynos5250, exynos5420, exynos5440 and S3c64xx are also modified as per changed helper functions.
[snip]
Quoted 7 lines
drivers/clk/samsung/clk.c +0
-0@@ -15,11 +15,6 @@#include "clk.h"
Quoted 6 lines
drivers/clk/samsung/clk.c line 17
Quoted 1 line
drivers/clk/samsung/clk.c +0
-0static DEFINE_SPINLOCK (lock);IMHO you can also move the spinlock into
samsung_clk_providerstruct, to have more fine grained locking, as you shouldn't need to lock between particular providers, just multiple requests for one.
Done.
Quoted 20 lines
Quoted 20 lines
drivers/clk/samsung/clk.c +4
-8-static struct clk **clk_table; -static void __iomem *reg_base; -#ifdef CONFIG_OF -static struct clk_onecell_data clk_data; -#endif void samsung_clk_save(void __iomem *base, struct samsung_clk_reg_dump *rd,@@ -55,40 +50,53 @@ struct samsung_clk_reg_dump *samsung_clk_alloc_reg_dump( }/* setup the essentials required to support clock lookup using ccf */ -void __init samsung_clk_init (struct device_node *np,void __iomem *base, -unsigned long nr_clks) +struct samsung_clk_provider *__init samsung_clk_init (struct device_node *np, +void __iomem *base,unsigned long nr_clks) { - reg_base = base; +struct samsung_clk_provider *ctx; +struct clk **clk_table;
Quoted 9 lines
drivers/clk/samsung/clk.c struct samsung_clk_reg_dump *samsung_clk_alloc_reg_dump( · line 61
Quoted 4 lines
drivers/clk/samsung/clk.c +4
-0+int ret; + +if (!np) +return NULL ;This check is incorrect. It's completely correct to call this function with NULL np, when booted without DT and this was handled correctly before this patch. Please keep the same behavior.
Done.
Quoted 36 lines
Quoted 27 lines
drivers/clk/samsung/clk.c +13
-7+ + ctx =kzalloc (sizeof (struct samsung_clk_provider ),GFP_KERNEL ); +if (!ctx) +panic ("could not allocate clock provider context.\n" ); clk_table =kzalloc (sizeof (struct clk *) * nr_clks,GFP_KERNEL );if (!clk_table)panic ("could not allocate clock lookup table\n" ); -if (!np) -return ; + ctx->reg_base = base; + ctx->clk_data.clks = clk_table; + ctx->clk_data.clk_num = nr_clks; -#ifdef CONFIG_OF - clk_data.clks = clk_table; - clk_data.clk_num = nr_clks; -of_clk_add_provider (np, of_clk_src_onecell_get, &clk_data); -#endif + ret =of_clk_add_provider (np, of_clk_src_onecell_get, + &ctx->clk_data); +if (ret) +panic ("could not register clock provide\n" ); + +return ctx; }[snip]
Quoted 8 lines
drivers/clk/samsung/clk.h +0
-0@@ -21,6 +21,17 @@#include <linux/of_address.h> #include "clk-pll.h"
Quoted 5 lines
drivers/clk/samsung/clk.h line 26
Quoted 3 lines
drivers/clk/samsung/clk.h +3
-0+/* Context node which holds information about the clock provider. */ +/** +* struct samsung_clk_provider: information about clock plovider typo: s/plovider/provider/
Ok.
Quoted 66 lines
drivers/clk/samsung/clk.h line 29
Quoted 4 lines
drivers/clk/samsung/clk.h +3
-0+* @reg_base: virtual address for the register base. +* @clk_data: holds clock related data like clk* and number of clocks. +*/ Why two comments? The kerneldoc one should be enough.
Quoted 59 lines
drivers/clk/samsung/clk.h +28
-12+struct samsung_clk_provider { +void __iomem *reg_base; +struct clk_onecell_data clk_data; +}; +/** * struct samsung_clock_alias: information about mux clock * @id: platform specific id of the clock. @@ -312,29 +323,40 @@ struct samsung_pll_clock {__PLL (_typ, _id,NULL , _name, _pname,CLK_GET_RATE_NOCACHE , \ _lock, _con, _rtable, _alias) -extern void __init samsung_clk_init (struct device_node *np,void __iomem *base, -unsigned long nr_clks); +extern struct samsung_clk_provider *__init samsung_clk_init ( +struct device_node *np,void __iomem *base, +unsigned long nr_clks);extern void __init samsung_clk_of_register_fixed_ext ( +struct samsung_clk_provider *ctx,struct samsung_fixed_rate_clock *fixed_rate_clk,unsigned int nr_fixed_rate_clk,struct of_device_id *clk_matches); -extern void samsung_clk_add_lookup (struct clk *clk,unsigned int id); +extern void samsung_clk_add_lookup (struct samsung_clk_provider *ctx, +struct clk *clk,unsigned int id); -extern void samsung_clk_register_alias (struct samsung_clock_alias *list, -unsigned int nr_clk); +extern void samsung_clk_register_alias (struct samsung_clk_provider *ctx, +struct samsung_clock_alias *list, +unsigned int nr_clk);extern void __init samsung_clk_register_fixed_rate ( -struct samsung_fixed_rate_clock *clk_list,unsigned int nr_clk); +struct samsung_clk_provider *ctx, +struct samsung_fixed_rate_clock *clk_list, +unsigned int nr_clk);extern void __init samsung_clk_register_fixed_factor ( -struct samsung_fixed_factor_clock *list,unsigned int nr_clk); -extern void __init samsung_clk_register_mux (struct samsung_mux_clock *clk_list, +struct samsung_clk_provider *ctx, +struct samsung_fixed_factor_clock *list, +unsigned int nr_clk); +extern void __init samsung_clk_register_mux (struct samsung_clk_provider *ctx, +struct samsung_mux_clock *clk_list,unsigned int nr_clk); -extern void __init samsung_clk_register_div (struct samsung_div_clock *clk_list, +extern void __init samsung_clk_register_div (struct samsung_clk_provider *ctx, +struct samsung_div_clock *clk_list,unsigned int nr_clk); -extern void __init samsung_clk_register_gate ( +extern void __init samsung_clk_register_gate (struct samsung_clk_provider *ctx,struct samsung_gate_clock *clk_list,unsigned int nr_clk); -extern void __init samsung_clk_register_pll (struct samsung_pll_clock *pll_list, -unsigned int nr_clk,void __iomem *base); +extern void __init samsung_clk_register_pll (struct samsung_clk_provider *ctx, +struct samsung_pll_clock *pll_list, +unsigned int nr_clk,void __iomem *base);
Quoted 5 lines
drivers/clk/samsung/clk.h struct samsung_pll_clock { · line 362
Quoted 2 lines
drivers/clk/samsung/clk.h +0
-0extern unsigned long _get_rate (const char *clk_name);nit: Please keep the indentation consistent in all the function prototypes above.
ok.
regards,
Rahul Sharma.
Quoted 4 lines
Best regards,
Tomasz
PATCH 5/7 clk/samsung: add support for pll2550xx
In reply to Rahul SharmaFrom: Pankaj Dubey <[email protected]>
exynos5260 use pll2520xx and it has different bitfields for P,M,S values as compared to pll2550xx. Support for pll2520xx is added here.
--- drivers/clk/samsung/clk-pll.c | 107 +++++++++++++++++++++++++++++++++++++++++ drivers/clk/samsung/clk-pll.h | 1 + 2 files changed, 108 insertions(+)
drivers/clk/samsung/clk-pll.c +107 -0
@@ -710,6 +710,107 @@ struct clk * __init samsung_clk_register_pll2550x(const char *name,return clk; } +/* +* PLL2550xx Clock Type +*/ + +/* Maximum lock time can be 270 * PDIV cycles */ +#define PLL2550XX_LOCK_FACTOR (270) + +#define PLL2550XX_MDIV_MASK (0x3FF) +#define PLL2550XX_PDIV_MASK (0x3F) +#define PLL2550XX_SDIV_MASK (0x7) +#define PLL2550XX_LOCK_STAT_MASK (0x1) +#define PLL2550XX_MDIV_SHIFT (9) +#define PLL2550XX_PDIV_SHIFT (3) +#define PLL2550XX_SDIV_SHIFT (0) +#define PLL2550XX_LOCK_STAT_SHIFT (21) + +static unsigned long samsung_pll2550xx_recalc_rate (struct clk_hw *hw, +unsigned long parent_rate) +{ +struct samsung_clk_pll *pll =to_clk_pll (hw); +u32 mdiv, pdiv, sdiv, pll_con; +u64 fvco = parent_rate; + + pll_con =__raw_readl (pll->con_reg); + mdiv = (pll_con >>PLL2550XX_MDIV_SHIFT ) &PLL2550XX_MDIV_MASK ; + pdiv = (pll_con >>PLL2550XX_PDIV_SHIFT ) &PLL2550XX_PDIV_MASK ; + sdiv = (pll_con >>PLL2550XX_SDIV_SHIFT ) &PLL2550XX_SDIV_MASK ; + + fvco *= mdiv; +do_div (fvco, (pdiv << sdiv)); + +return (unsigned long )fvco; +} + +static inline bool samsung_pll2550xx_mp_change (u32 mdiv,u32 pdiv,u32 pll_con) +{ +if ((mdiv != ((pll_con >>PLL2550XX_MDIV_SHIFT ) & +PLL2550XX_MDIV_MASK )) || + (pdiv != ((pll_con >>PLL2550XX_PDIV_SHIFT ) & +PLL2550XX_PDIV_MASK ))) +return 1 ; +else +return 0 ; +} + +static int samsung_pll2550xx_set_rate (struct clk_hw *hw,unsigned long drate, +unsigned long prate) +{ +struct samsung_clk_pll *pll =to_clk_pll (hw); +const struct samsung_pll_rate_table *rate; +u32 tmp; + +/* Get required rate settings from table */ + rate =samsung_get_pll_settings (pll, drate); +if (!rate) { +pr_err ("%s: Invalid rate : %lu for pll clk %s\n" , __func__, + drate,__clk_get_name (hw->clk)); +return -EINVAL ; + } + + tmp =__raw_readl (pll->con_reg); + +if (!(samsung_pll2550xx_mp_change (rate->mdiv, rate->pdiv, tmp))) { +/* If only s change, change just s value only*/ + tmp &= ~(PLL2550XX_SDIV_MASK <<PLL2550XX_SDIV_SHIFT ); + tmp |= rate->sdiv <<PLL2550XX_SDIV_SHIFT ; +__raw_writel (tmp, pll->con_reg); + }else { +/* Set PLL lock time. */ +__raw_writel (rate->pdiv *PLL2550XX_LOCK_FACTOR , pll->lock_reg); + +/* Change PLL PMS values */ + tmp &= ~((PLL2550XX_MDIV_MASK <<PLL2550XX_MDIV_SHIFT ) | + (PLL2550XX_PDIV_MASK <<PLL2550XX_PDIV_SHIFT ) | + (PLL2550XX_SDIV_MASK <<PLL2550XX_SDIV_SHIFT )); + tmp |= (rate->mdiv <<PLL2550XX_MDIV_SHIFT ) | + (rate->pdiv <<PLL2550XX_PDIV_SHIFT ) | + (rate->sdiv <<PLL2550XX_SDIV_SHIFT ); +__raw_writel (tmp, pll->con_reg); + +/* wait_lock_time */ +do { +cpu_relax (); + tmp =__raw_readl (pll->con_reg); + }while (!(tmp & (PLL2550XX_LOCK_STAT_MASK + <<PLL2550XX_LOCK_STAT_SHIFT ))); + } + +return 0 ; +} + +static const struct clk_ops samsung_pll2550xx_clk_ops = { + .recalc_rate = samsung_pll2550xx_recalc_rate, + .round_rate = samsung_pll_round_rate, + .set_rate = samsung_pll2550xx_set_rate, +}; + +static const struct clk_ops samsung_pll2550xx_clk_min_ops = { + .recalc_rate = samsung_pll2550xx_recalc_rate, +}; +static void __init _samsung_clk_register_pll (struct samsung_clk_provider *ctx,struct samsung_pll_clock *pll_clk,void __iomem *base)
@@ -787,6 +888,12 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx,else init.ops = &samsung_pll46xx_clk_ops;break ; +case pll_2550xx: +if (!pll->rate_table) + init.ops = &samsung_pll2550xx_clk_min_ops; +else + init.ops = &samsung_pll2550xx_clk_ops; +break ;default :pr_warn ("%s: Unknown pll type for pll clk %s\n" , __func__, pll_clk->name);
drivers/clk/samsung/clk-pll.h +1 -0
@@ -25,6 +25,7 @@ enum samsung_pll_type { pll_4650c, pll_6552, pll_6553, + pll_2550xx, };#define PLL_35XX_RATE (_rate, _m, _p, _s) \
Signature · 1 line
1.7.9.5
PATCH 5/7 clk/samsung: add support for pll2550xx
Hi Rahul,
Quoted 5 lines · Rahul Sharma
From: Pankaj Dubey <[email protected]>
exynos5260 use pll2520xx and it has different bitfields for P,M,S values as compared to pll2550xx. Support for pll2520xx is added here.
This is a bit confusing to me. The commit message says "Support for pll2520xx is added". However, the patch subject and the entire code looks to be adding support for 2550xx.
Signature · 2 lines
With warm regards, Sachin
PATCH 5/7 clk/samsung: add support for pll2550xx
In reply to Rahul SharmaHi Pankaj, Rahul, Arun,
Quoted 55 lines · On Friday 06 of December 2013 21:26:29 Rahul Sharma wrote:
From: Pankaj Dubey <[email protected]>
exynos5260 use pll2520xx and it has different bitfields for P,M,S values as compared to pll2550xx. Support for pll2520xx is added here.
Signed-off-by Pankaj Dubey <[email protected]>Signed-off-by Rahul Sharma <[email protected]>Signed-off-by Arun Kumar K <[email protected]>--- drivers/clk/samsung/clk-pll.c | 107 +++++++++++++++++++++++++++++++++++++++++ drivers/clk/samsung/clk-pll.h | 1 + 2 files changed, 108 insertions(+)drivers/clk/samsung/clk-pll.c +33
-0@@ -710,6 +710,107 @@ struct clk * __init samsung_clk_register_pll2550x(const char *name,return clk; } +/* +* PLL2550xx Clock Type +*/ + +/* Maximum lock time can be 270 * PDIV cycles */ +#define PLL2550XX_LOCK_FACTOR (270) + +#define PLL2550XX_MDIV_MASK (0x3FF) +#define PLL2550XX_PDIV_MASK (0x3F) +#define PLL2550XX_SDIV_MASK (0x7) +#define PLL2550XX_LOCK_STAT_MASK (0x1) +#define PLL2550XX_MDIV_SHIFT (9) +#define PLL2550XX_PDIV_SHIFT (3) +#define PLL2550XX_SDIV_SHIFT (0) +#define PLL2550XX_LOCK_STAT_SHIFT (21) + +static unsigned long samsung_pll2550xx_recalc_rate (struct clk_hw *hw, +unsigned long parent_rate) +{ +struct samsung_clk_pll *pll =to_clk_pll (hw); +u32 mdiv, pdiv, sdiv, pll_con; +u64 fvco = parent_rate; + + pll_con =__raw_readl (pll->con_reg); + mdiv = (pll_con >>PLL2550XX_MDIV_SHIFT ) &PLL2550XX_MDIV_MASK ; + pdiv = (pll_con >>PLL2550XX_PDIV_SHIFT ) &PLL2550XX_PDIV_MASK ; + sdiv = (pll_con >>PLL2550XX_SDIV_SHIFT ) &PLL2550XX_SDIV_MASK ; + + fvco *= mdiv; +do_div (fvco, (pdiv << sdiv)); + +return (unsigned long )fvco; +}
drivers/clk/samsung/clk-pll.c struct clk * __init samsung_clk_register_pll2550x(const char *name, · line 755
Quoted 10 lines
drivers/clk/samsung/clk-pll.c +10
-0+ +static inline bool samsung_pll2550xx_mp_change (u32 mdiv,u32 pdiv,u32 pll_con) +{ +if ((mdiv != ((pll_con >>PLL2550XX_MDIV_SHIFT ) & +PLL2550XX_MDIV_MASK )) || + (pdiv != ((pll_con >>PLL2550XX_PDIV_SHIFT ) & +PLL2550XX_PDIV_MASK ))) +return 1 ; +else +return 0 ;
This doesn't look too good. Can you make this consistent with implementations of this helper for other PLLs, such as samsung_pll35xx_mp_change()?
Quoted 15 lines
drivers/clk/samsung/clk-pll.c +15
-0+} + +static int samsung_pll2550xx_set_rate (struct clk_hw *hw,unsigned long drate, +unsigned long prate) +{ +struct samsung_clk_pll *pll =to_clk_pll (hw); +const struct samsung_pll_rate_table *rate; +u32 tmp; + +/* Get required rate settings from table */ + rate =samsung_get_pll_settings (pll, drate); +if (!rate) { +pr_err ("%s: Invalid rate : %lu for pll clk %s\n" , __func__, + drate,__clk_get_name (hw->clk)); +return -EINVAL ;
drivers/clk/samsung/clk-pll.c struct clk * __init samsung_clk_register_pll2550x(const char *name, · line 780
Quoted 10 lines
drivers/clk/samsung/clk-pll.c +10
-0+ } + + tmp =__raw_readl (pll->con_reg); + +if (!(samsung_pll2550xx_mp_change (rate->mdiv, rate->pdiv, tmp))) { +/* If only s change, change just s value only*/ + tmp &= ~(PLL2550XX_SDIV_MASK <<PLL2550XX_SDIV_SHIFT ); + tmp |= rate->sdiv <<PLL2550XX_SDIV_SHIFT ; +__raw_writel (tmp, pll->con_reg); + }else {
Please make coding style of this function consistent with implementations of this operation for other PLLs, such as samsung_pll35xx_set_rate().
Otherwise the patch looks fine.
Best regards,
Tomasz
PATCH 5/7 clk/samsung: add support for pll2550xx
Hi Tomasz,
Quoted 64 lines · Tomasz Figa
Hi Pankaj, Rahul, Arun,
Quoted 61 lines · On Friday 06 of December 2013 21:26:29 Rahul Sharma wrote:
From: Pankaj Dubey <[email protected]>
exynos5260 use pll2520xx and it has different bitfields for P,M,S values as compared to pll2550xx. Support for pll2520xx is added here.
Signed-off-by Pankaj Dubey <[email protected]>Signed-off-by Rahul Sharma <[email protected]>Signed-off-by Arun Kumar K <[email protected]>--- drivers/clk/samsung/clk-pll.c | 107 +++++++++++++++++++++++++++++++++++++++++ drivers/clk/samsung/clk-pll.h | 1 + 2 files changed, 108 insertions(+)drivers/clk/samsung/clk-pll.c +39
-0@@ -710,6 +710,107 @@ struct clk * __init samsung_clk_register_pll2550x(const char *name,return clk; } +/* +* PLL2550xx Clock Type +*/ + +/* Maximum lock time can be 270 * PDIV cycles */ +#define PLL2550XX_LOCK_FACTOR (270) + +#define PLL2550XX_MDIV_MASK (0x3FF) +#define PLL2550XX_PDIV_MASK (0x3F) +#define PLL2550XX_SDIV_MASK (0x7) +#define PLL2550XX_LOCK_STAT_MASK (0x1) +#define PLL2550XX_MDIV_SHIFT (9) +#define PLL2550XX_PDIV_SHIFT (3) +#define PLL2550XX_SDIV_SHIFT (0) +#define PLL2550XX_LOCK_STAT_SHIFT (21) + +static unsigned long samsung_pll2550xx_recalc_rate (struct clk_hw *hw, +unsigned long parent_rate) +{ +struct samsung_clk_pll *pll =to_clk_pll (hw); +u32 mdiv, pdiv, sdiv, pll_con; +u64 fvco = parent_rate; + + pll_con =__raw_readl (pll->con_reg); + mdiv = (pll_con >>PLL2550XX_MDIV_SHIFT ) &PLL2550XX_MDIV_MASK ; + pdiv = (pll_con >>PLL2550XX_PDIV_SHIFT ) &PLL2550XX_PDIV_MASK ; + sdiv = (pll_con >>PLL2550XX_SDIV_SHIFT ) &PLL2550XX_SDIV_MASK ; + + fvco *= mdiv; +do_div (fvco, (pdiv << sdiv)); + +return (unsigned long )fvco; +} + +static inline bool samsung_pll2550xx_mp_change (u32 mdiv,u32 pdiv,u32 pll_con) +{ + if ((mdiv != ((pll_con >> PLL2550XX_MDIV_SHIFT) & + PLL2550XX_MDIV_MASK)) || + (pdiv != ((pll_con >> PLL2550XX_PDIV_SHIFT) &
Quoted 8 lines
drivers/clk/samsung/clk-pll.c struct clk * __init samsung_clk_register_pll2550x(const char *name, · line 755
Quoted 4 lines
drivers/clk/samsung/clk-pll.c +4
-0+ PLL2550XX_PDIV_MASK))) + return 1; + else + return 0;This doesn't look too good. Can you make this consistent with implementations of this helper for other PLLs, such as
samsung_pll35xx_mp_change()?
I have changed this in V2.
Quoted 30 lines
Quoted 16 lines
drivers/clk/samsung/clk-pll.c +15
-0+} + +static int samsung_pll2550xx_set_rate (struct clk_hw *hw,unsigned long drate, +unsigned long prate) +{ +struct samsung_clk_pll *pll =to_clk_pll (hw); +const struct samsung_pll_rate_table *rate; +u32 tmp; + +/* Get required rate settings from table */ + rate =samsung_get_pll_settings (pll, drate); +if (!rate) { +pr_err ("%s: Invalid rate : %lu for pll clk %s\n" , __func__, + drate,__clk_get_name (hw->clk)); +return -EINVAL ;drivers/clk/samsung/clk-pll.c struct clk * __init samsung_clk_register_pll2550x(const char *name, · line 780
Quoted 10 lines
drivers/clk/samsung/clk-pll.c +10
-0+ } + + tmp =__raw_readl (pll->con_reg); + +if (!(samsung_pll2550xx_mp_change (rate->mdiv, rate->pdiv, tmp))) { +/* If only s change, change just s value only*/ + tmp &= ~(PLL2550XX_SDIV_MASK <<PLL2550XX_SDIV_SHIFT ); + tmp |= rate->sdiv <<PLL2550XX_SDIV_SHIFT ; +__raw_writel (tmp, pll->con_reg); + }else {Please make coding style of this function consistent with implementations of this operation for other PLLs, such as
samsung_pll35xx_set_rate().
Quoted 1 line
Otherwise the patch looks fine.
Ok.
Regards,
Rahul Sharma.
Quoted 4 lines
Best regards,
Tomasz
PATCH 6/7 clk/samsung: add support for pll2650xx
In reply to Rahul SharmaAdd support for pll2650xx in samsung pll file. This pll variant is close to pll36xx but uses CON2 registers instead of CON1.
Aud_pll in Exynos5260 is pll2650xx and uses this code.
--- drivers/clk/samsung/clk-pll.c | 101 +++++++++++++++++++++++++++++++++++++++++ drivers/clk/samsung/clk-pll.h | 2 +- 2 files changed, 102 insertions(+), 1 deletion(-)
drivers/clk/samsung/clk-pll.c +101 -0
@@ -811,6 +811,101 @@ static const struct clk_ops samsung_pll2550xx_clk_min_ops = { .recalc_rate = samsung_pll2550xx_recalc_rate, }; +/* +* PLL2650XX Clock Type +*/ + +/* Maximum lock time can be 3000 * PDIV cycles */ +#define PLL2650XX_LOCK_FACTOR (3000) + +#define PLL2650XX_MDIV_SHIFT (9) +#define PLL2650XX_PDIV_SHIFT (3) +#define PLL2650XX_SDIV_SHIFT (0) +#define PLL2650XX_KDIV_SHIFT (0) +#define PLL2650XX_MDIV_MASK (0x1ff) +#define PLL2650XX_PDIV_MASK (0x3f) +#define PLL2650XX_SDIV_MASK (0x7) +#define PLL2650XX_KDIV_MASK (0xffff) +#define PLL2650XX_PLL_ENABLE_SHIFT (23) +#define PLL2650XX_PLL_LOCKTIME_SHIFT (21) +#define PLL2650XX_PLL_FOUTMASK_SHIFT (31) + +static unsigned long samsung_pll2650xx_recalc_rate (struct clk_hw *hw, +unsigned long parent_rate) +{ +struct samsung_clk_pll *pll =to_clk_pll (hw); +u32 mdiv, pdiv, sdiv, pll_con0, pll_con2; +s16 kdiv; +u64 fvco = parent_rate; + + pll_con0 =__raw_readl (pll->con_reg); + pll_con2 =__raw_readl (pll->con_reg +8 ); + mdiv = (pll_con0 >>PLL2650XX_MDIV_SHIFT ) &PLL2650XX_MDIV_MASK ; + pdiv = (pll_con0 >>PLL2650XX_PDIV_SHIFT ) &PLL2650XX_PDIV_MASK ; + sdiv = (pll_con0 >>PLL2650XX_SDIV_SHIFT ) &PLL2650XX_SDIV_MASK ; + kdiv = (s16)(pll_con2 &PLL2650XX_KDIV_MASK ); + + fvco *= (mdiv <<16 ) + kdiv; +do_div (fvco, (pdiv << sdiv)); + fvco >>=16 ; + +return (unsigned long )fvco; +} + +static int samsung_pll2650xx_set_rate (struct clk_hw *hw,unsigned long drate, +unsigned long parent_rate) +{ +struct samsung_clk_pll *pll =to_clk_pll (hw); +u32 tmp, pll_con0, pll_con2; +const struct samsung_pll_rate_table *rate; + + rate =samsung_get_pll_settings (pll, drate); +if (!rate) { +pr_err ("%s: Invalid rate : %lu for pll clk %s\n" , __func__, + drate,__clk_get_name (hw->clk)); +return -EINVAL ; + } + + pll_con0 =__raw_readl (pll->con_reg); + pll_con2 =__raw_readl (pll->con_reg +8 ); + +/* Change PLL PMS values */ + pll_con0 &= ~(PLL2650XX_MDIV_MASK <<PLL2650XX_MDIV_SHIFT | +PLL2650XX_PDIV_MASK <<PLL2650XX_PDIV_SHIFT | +PLL2650XX_SDIV_MASK <<PLL2650XX_SDIV_SHIFT ); + pll_con0 |= rate->mdiv <<PLL2650XX_MDIV_SHIFT ; + pll_con0 |= rate->pdiv <<PLL2650XX_PDIV_SHIFT ; + pll_con0 |= rate->sdiv <<PLL2650XX_SDIV_SHIFT ; + pll_con0 |=1 <<PLL2650XX_PLL_ENABLE_SHIFT ; + pll_con0 |=1 <<PLL2650XX_PLL_FOUTMASK_SHIFT ; + + pll_con2 &= ~(PLL2650XX_KDIV_MASK <<PLL2650XX_KDIV_SHIFT ); + pll_con2 |= ((~(rate->kdiv) +1 ) &PLL2650XX_KDIV_MASK ) + <<PLL2650XX_KDIV_SHIFT ; + +/* Set PLL lock time. */ +__raw_writel (PLL2650XX_LOCK_FACTOR * rate->pdiv, pll->lock_reg); + +__raw_writel (pll_con0, pll->con_reg); +__raw_writel (pll_con2, pll->con_reg +8 ); + +do { + tmp =__raw_readl (pll->con_reg); + }while (!(tmp & (0x1 <<PLL2650XX_PLL_LOCKTIME_SHIFT ))); + +return 0 ; +} + +static const struct clk_ops samsung_pll2650xx_clk_ops = { + .recalc_rate = samsung_pll2650xx_recalc_rate, + .set_rate = samsung_pll2650xx_set_rate, + .round_rate = samsung_pll_round_rate, +}; + +static const struct clk_ops samsung_pll2650xx_clk_min_ops = { + .recalc_rate = samsung_pll2650xx_recalc_rate, +}; +static void __init _samsung_clk_register_pll (struct samsung_clk_provider *ctx,struct samsung_pll_clock *pll_clk,void __iomem *base)
@@ -894,6 +989,12 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx,else init.ops = &samsung_pll2550xx_clk_ops;break ; +case pll_2650xx: +if (!pll->rate_table) + init.ops = &samsung_pll2650xx_clk_min_ops; +else + init.ops = &samsung_pll2650xx_clk_ops; +break ;default :pr_warn ("%s: Unknown pll type for pll clk %s\n" , __func__, pll_clk->name);
drivers/clk/samsung/clk-pll.h +1 -1
@@ -26,6 +26,7 @@ enum samsung_pll_type { pll_6552, pll_6553, pll_2550xx, + pll_2650xx, };#define PLL_35XX_RATE (_rate, _m, _p, _s) \
@@ -93,5 +94,4 @@ struct samsung_pll_rate_table {extern struct clk *__init samsung_clk_register_pll2550x (const char *name,const char *pname,const void __iomem *reg_base,const unsigned long offset); -#endif /* __SAMSUNG_CLK_PLL_H */
Signature · 1 line
1.7.9.5
PATCH 6/7 clk/samsung: add support for pll2650xx
Hi Rahul,
Quoted 27 lines · Rahul Sharma
Add support for pll2650xx in samsung pll file. This pll variant is close to pll36xx but uses CON2 registers instead of CON1.
Aud_pllin Exynos5260 is pll2650xx and uses this code.Signed-off-by Rahul Sharma <[email protected]>--- drivers/clk/samsung/clk-pll.c | 101 +++++++++++++++++++++++++++++++++++++++++ drivers/clk/samsung/clk-pll.h | 2 +- 2 files changed, 102 insertions(+), 1 deletion(-)drivers/clk/samsung/clk-pll.c +8
-0@@ -811,6 +811,101 @@ static const struct clk_ops samsung_pll2550xx_clk_min_ops = { .recalc_rate = samsung_pll2550xx_recalc_rate, }; +/* +* PLL2650XX Clock Type +*/ + +/* Maximum lock time can be 3000 * PDIV cycles */ +#define PLL2650XX_LOCK_FACTOR (3000) + +#define PLL2650XX_MDIV_SHIFT (9)
drivers/clk/samsung/clk-pll.c static const struct clk_ops samsung_pll2550xx_clk_min_ops = { · line 831
Quoted 10 lines
drivers/clk/samsung/clk-pll.c +10
-0+#define PLL2650XX_PDIV_SHIFT (3) +#define PLL2650XX_SDIV_SHIFT (0) +#define PLL2650XX_KDIV_SHIFT (0) +#define PLL2650XX_MDIV_MASK (0x1ff) +#define PLL2650XX_PDIV_MASK (0x3f) +#define PLL2650XX_SDIV_MASK (0x7) +#define PLL2650XX_KDIV_MASK (0xffff) +#define PLL2650XX_PLL_ENABLE_SHIFT (23) +#define PLL2650XX_PLL_LOCKTIME_SHIFT (21) +#define PLL2650XX_PLL_FOUTMASK_SHIFT (31)
nit: Braces are unnecessary.
Signature · 2 lines
With warm regards, Sachin
PATCH 6/7 clk/samsung: add support for pll2650xx
In reply to Rahul SharmaHi Rahul,
Quoted 2 lines · On Friday 06 of December 2013 21:26:30 Rahul Sharma wrote:
Add support for pll2650xx in samsung pll file. This pll variant is close to pll36xx but uses CON2 registers instead of CON1.
If the ops are otherwise idential, why not reuse the ops for pll36xx and use CON1 or CON2 register conditionally based on pll->type field? (Just as it is already done for pll4600, 4650 and 4650c.)
Best regards,
Tomasz
PATCH 6/7 clk/samsung: add support for pll2650xx
Hi Tomasz,
Quoted 10 lines · Tomasz Figa
Hi Rahul,
Quoted 2 lines · On Friday 06 of December 2013 21:26:30 Rahul Sharma wrote:
Add support for pll2650xx in samsung pll file. This pll variant is close to pll36xx but uses CON2 registers instead of CON1.
If the ops are otherwise idential, why not reuse the ops for pll36xx and use CON1 or CON2 register conditionally based on
pll->typefield? (Just as it is already done for pll4600, 4650 and 4650c.)
I verified the difference and found that pll2650xx is fairly different in terms of
Bit Fields, Con2 register, and additional PLL config bits than pll36xx. Due to this, I have to add lot of if-else code based on pll type which doesn't looks clean.
Regards,
Rahul Sharma.
Quoted 3 lines
Best regards,
Tomasz
PATCH 6/7 clk/samsung: add support for pll2650xx
Quoted 14 lines · On Monday 06 of January 2014 17:14:48 Rahul Sharma wrote:
Hi Tomasz,
Quoted 10 lines · Tomasz Figa
Hi Rahul,
Quoted 2 lines · On Friday 06 of December 2013 21:26:30 Rahul Sharma wrote:
Add support for pll2650xx in samsung pll file. This pll variant is close to pll36xx but uses CON2 registers instead of CON1.
If the ops are otherwise idential, why not reuse the ops for pll36xx and use CON1 or CON2 register conditionally based on
pll->typefield? (Just as it is already done for pll4600, 4650 and 4650c.)
Quoted 5 lines
I verified the difference and found that pll2650xx is fairly different in terms of
Bit Fields, Con2 register, and additional PLL config bits than pll36xx. Due to this, I have to add lot of if-else code based on pll type which doesn't looks clean.
Fair enough.
Best regards,
Tomasz
A message that is not in the archive (sent off-list or not yet received): 1386345391-23482-1-git-send-email-rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org
PATCH 7/7 clk/exynos5260: add clock file for exynos5260
Add support for exynos5260 clocks in clock driver.
--- .../devicetree/bindings/clock/exynos5260-clock.txt | 228 ++ drivers/clk/samsung/Makefile | 1 + drivers/clk/samsung/clk-exynos5260.c | 2661 ++++++++++++++++++++ drivers/clk/samsung/clk-exynos5260.h | 496 ++++ include/dt-bindings/clk/exynos5260-clk.h | 169 ++ 5 files changed, 3555 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/exynos5260-clock.txt create mode 100644 drivers/clk/samsung/clk-exynos5260.c create mode 100644 drivers/clk/samsung/clk-exynos5260.h create mode 100644 include/dt-bindings/clk/exynos5260-clk.h
Documentation/devicetree/bindings/clock/exynos5260-clock.txt new file +228 -0
@@ -0,0 +1,228 @@ +* Samsung Exynos5260 Clock Controller + +The Exynos5260 clock controller encalsulate all CMUs which are +instantiaited independently from the device-tree. As a whole, +these CMUs generates and supplies clocks to various controllers +within the Exynos5260 SoC. + +Required Properties: + +- compatible: should be one of the following. + - First compatible should be one of the following + "exynos5260-cmu-all" + "exynos5260-cmu-top" + "exynos5260-cmu-peri" + "exynos5260-cmu-egl" + "exynos5260-cmu-kfc" + "exynos5260-cmu-g2d" + "exynos5260-cmu-mif" + "exynos5260-cmu-mfc" + "exynos5260-cmu-g3d" + "exynos5260-cmu-fsys" + "exynos5260-cmu-aud" + "exynos5260-cmu-isp" + "exynos5260-cmu-gscl" + "exynos5260-cmu-disp" + - Second compatible should be "samsung,exynos5260-clock". + +- reg: physical base address of the controller and length of memory mapped + region. + +- #clock-cells: should be 1. + +The following is the list of clocks generated by the each controller. Each +clock is assigned a MACRO constant. These constants are defined in +"dt-bindings/clk/exynos5260-clk.h". DT client nodes use this MACRO to specify +the clock which they consume. + +----------------------- + CMU_TOP clocks +----------------------- + + FIN_PLL + TOP_FOUT_DISP_PLL + TOP_FOUT_AUD_PLL + TOP_SCLK_MMC0 + TOP_SCLK_MMC1 + TOP_SCLK_MMC2 + TOP_SCLK_HDMIPHY + TOP_SCLK_FIMD1 + TOP_MOUT_FIMD1 + TOP_MOUT_DISP_PLL + +----------------------- + CMU_EGL clocks +----------------------- + + EGL_FOUT_EGL_PLL + EGL_FOUT_EGL_DPLL + +----------------------- + CMU_KFC clocks +----------------------- + + KFC_FOUT_KFC_PLL + +----------------------- + CMU_MIF clocks +----------------------- + + MIF_FOUT_MEM_PLL + MIF_FOUT_BUS_PLL + MIF_FOUT_MEDIA_PLL + +----------------------- + CMU_G3D clocks +----------------------- + + G3D_FOUT_G3D_PLL + G3D_ACLK_G3D + +----------------------- + CMU_AUD clocks +----------------------- + + AUD_SCLK_AUD_UART + AUD_SCLK_PCM + AUD_ACLK_SRAMC + AUD_ACLK_DMAC + AUD_PCLK_AUD_UART + AUD_PCLK_PCM + AUD_PCLK_I2S + AUD_PCLK_DMAC + +----------------------- + CMU_MFC clocks +----------------------- + + MFC_ACLK_MFC + MFC_PCLK_MFC + MFC_PCLK_SMMU_MFC0 + MFC_PCLK_SMMU_MFC1 + +----------------------- + CMU_GSCL clocks +----------------------- + + GSCL_ACLK_GSCL0 + GSCL_ACLK_GSCL1 + GSCL_PCLK_GSCL0 + GSCL_PCLK_GSCL1 + GSCL_PCLK_SMMU_GSCL0 + GSCL_PCLK_SMMU_GSCL1 + +----------------------- + CMU_FSYS clocks +----------------------- + + FSYS_HCLK_TSI + FSYS_PCLK_GPIO + FSYS_HCLK_USBHOST20 + FSYS_ACLK_USBDRD30 + FSYS_ACLK_PDMA0 + FSYS_ACLK_RTIC + FSYS_PCLK_SMMU_RTIC + FSYS_PHYCLK_USBDRD30 + FSYS_PHYCLK_USBHOST20 + FSYS_HCLK_MMC0 + FSYS_HCLK_MMC1 + FSYS_HCLK_MMC2 + FSYS_HCLK_SROMC + +----------------------- + CMU_PERI clocks +----------------------- + + PERI_PCLK_ADC + PERI_PCLK_TMU1 + PERI_PCLK_TMU0 + PERI_PCLK_SPI0 + PERI_PCLK_SPI1 + PERI_PCLK_SPI2 + PERI_PCLK_I2S1 + PERI_PCLK_PWM + PERI_PCLK_SPDIF + PERI_PCLK_ABB + PERI_PCLK_MCT + PERI_PCLK_HSIC0 + PERI_PCLK_HSIC1 + PERI_PCLK_HSIC2 + PERI_PCLK_HSIC3 + PERI_PCLK_UART0 + PERI_PCLK_UART1 + PERI_PCLK_UART2 + PERI_PCLK_PCM1 + PERI_PCLK_WDT_EGL + PERI_PCLK_WDT_KFC + PERI_PCLK_CHIPID + PERI_CLK_TMU0 + PERI_CLK_TMU1 + PERI_CLK_TMU2 + PERI_CLK_TMU3 + PERI_CLK_TMU4 + PERI_PCLK_I2C4 + PERI_PCLK_I2C5 + PERI_PCLK_I2C6 + PERI_PCLK_I2C7 + PERI_PCLK_I2C8 + PERI_PCLK_I2C9 + PERI_PCLK_I2C10 + PERI_PCLK_I2C11 + PERI_PCLK_TOP_RTC + PERI_SCLK_RTC + PERI_SCLK_UART0 + PERI_SCLK_UART1 + PERI_SCLK_UART2 + PERI_SCLK_SPDIF + PERI_SCLK_SPI0 + PERI_SCLK_SPI1 + PERI_SCLK_SPI2 + PERI_SCLK_I2S + PERI_SCLK_PCM1 + +----------------------- + CMU_DISP clocks +----------------------- + + DISP_SCLK_HDMI + DISP_SCLK_PIXEL + DISP_ACLK_MIXER + DISP_ACLK_HDMI + DISP_ACLK_FIMD1 + DISP_PCLK_SMMU_TV + DISP_PCLK_SMMU_FIMD1M1 + DISP_PCLK_SMMU_FIMD1M0 + DISP_PCLK_DSIM1 + DISP_PCLK_HDMIPHY + DISP_PCLK_HDMI + DISP_DP + DISP_MOUT_HDMI_PHY_PIXEL + +----------------------- + CMU_G2D clocks +----------------------- + + G2D_ACLK_MDMA + G2D_NR_CLK + +Example 1: An example of a clock controller node is listed below. + + cmu_disp: clock-controller@0x14550000 { + compatible = "exynos5260-cmu-disp", "samsung,exynos5260-clock"; + reg = <0x14550000 0x10000>; + #clock-cells = <1>; + }; + +Example 2: UART controller node that consumes the clock generated by the + peri clock controller. Refer to the standard clock bindings for + information about 'clocks' and 'clock-names' property. + + serial@12C00000 { + compatible = "samsung,exynos4210-uart"; + reg = <0x12C00000 0x100>; + interrupts = <0 146 0>; + clocks = <&cmu_peri PERI_PCLK_UART0>, <&cmu_peri PERI_SCLK_UART0>; + clock-names = "uart", "clk_uart_baud0"; + status = "disabled"; + }; +
drivers/clk/samsung/Makefile +1 -0
@@ -5,6 +5,7 @@ obj-$(CONFIG_COMMON_CLK) += clk.o clk-pll.o obj-$(CONFIG_ARCH_EXYNOS4) += clk-exynos4.o obj-$(CONFIG_SOC_EXYNOS5250) += clk-exynos5250.o +obj-$(CONFIG_SOC_EXYNOS5260) += clk-exynos5260.o obj-$(CONFIG_SOC_EXYNOS5420) += clk-exynos5420.o obj-$(CONFIG_SOC_EXYNOS5440) += clk-exynos5440.o obj-$(CONFIG_ARCH_EXYNOS) += clk-exynos-audss.o
drivers/clk/samsung/clk-exynos5260.c new file +2661 -0
2,661 lines not on this page · raw message
drivers/clk/samsung/clk-exynos5260.h new file +496 -0
104 lines not on this page · raw message
include/dt-bindings/clk/exynos5260-clk.h new file +169 -0
169 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Part of the diff is not shown here. View the raw message.