Skip to contentSkip to conversation

arch: arm64: enable support for Samsung Exynos7 SoC

PATCH Superseded Naveen Krishna Chatradhi 6 participants 16 messages Sep 2, 2014 – Sep 11, 2014

Subsystems (7)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover arch: arm64: enable support for Samsung Exynos7 SoC

Changes since v1:
- Reduced the number of features targetted for the initial platform support.

This patchset supports new Exynos7 Samsung SoC based on Cortex-A57. Exynos7 is a System-On-Chip (SoC) that is based on 64-bit ARMv8 RISC processor.

NOTE:
We tested these patches with the
"arm64: dts: add <dt-bindings/> symlink" change posted @
https://lkml.org/lkml/2014/9/1/688

The following patches are tested based on Kgene's for-next tree.
https://git.kernel.org/cgit/linux/kernel/git/kgene/linux-samsung.git/log/?h=for-next

The following patches are required for this series.
1- "irqchip: exynos-combiner: Fix compilation error on ARM64"
https://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg36209.html
2- "tty/serial: fix config dependencies for samsung serial"
https://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg36208.html

Alim Akhtar (1):
arm64: exynos7: Enable ARMv8 based Exynos7 (SoC) support

Naveen Krishna Chatradhi (6):
clk: samsung: add support for 145xx and 1460x PLLs
clk: samsung: Factor out the common code to clk.c
clk: samsung: Add fixed_factor_clocks field to struct exynos_cmu_info
clk: samsung: add initial clock support for Exynos7 SoC tty/serial: samsung: enable usage for 64-bit Exynos platforms
arm64: dts: Add initial device tree support for EXYNOS7

 .../devicetree/bindings/clock/exynos7-clock.txt    |   37 ++
 arch/arm64/Kconfig                                 |   12 +
 arch/arm64/boot/dts/Makefile                       |    1 +
 arch/arm64/boot/dts/exynos/exynos7-espresso.dts    |   31 ++
 arch/arm64/boot/dts/exynos/exynos7.dtsi            |  168 ++++++++
 drivers/clk/samsung/Makefile                       |    1 +
 drivers/clk/samsung/clk-exynos5260.c               |  183 ++------
 drivers/clk/samsung/clk-exynos7.c                  |  438 ++++++++++++++++++++
 drivers/clk/samsung/clk-pll.c                      |   25 +-
 drivers/clk/samsung/clk-pll.h                      |    4 +
 drivers/clk/samsung/clk.c                          |   98 +++++
 drivers/clk/samsung/clk.h                          |   37 ++
 drivers/tty/serial/Kconfig                         |    2 +-
 include/dt-bindings/clock/exynos7-clk.h            |   55 +++
 14 files changed, 929 insertions(+), 163 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/exynos7-clock.txt
 create mode 100644 arch/arm64/boot/dts/exynos/exynos7-espresso.dts
 create mode 100644 arch/arm64/boot/dts/exynos/exynos7.dtsi
 create mode 100644 drivers/clk/samsung/clk-exynos7.c
 create mode 100644 include/dt-bindings/clock/exynos7-clk.h
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/7 clk: samsung: add support for 145xx and 1460x PLLs

PLL145xx is similar to PLL35xx and PLL1460x is almost similar to PLL46xx with minor differences in bit positions. Hence, reuse the functions defined for pll_35xx and pll_46xx to support 145xx and 1460x PLLs respectively.

---
 drivers/clk/samsung/clk-pll.c |   25 ++++++++++++++++++++-----
 drivers/clk/samsung/clk-pll.h |    4 ++++
 2 files changed, 24 insertions(+), 5 deletions(-)
drivers/clk/samsung/clk-pll.c +20 -5
index b07fad2..9d70e5c 100644
@@ -482,6 +482,8 @@ static const struct clk_ops samsung_pll45xx_clk_min_ops = {
 
 #define PLL46XX_VSEL_MASK	(1)
 #define PLL46XX_MDIV_MASK	(0x1FF)
+#define PLL1460X_MDIV_MASK	(0x3FF)
+
 #define PLL46XX_PDIV_MASK	(0x3F)
 #define PLL46XX_SDIV_MASK	(0x7)
 #define PLL46XX_VSEL_SHIFT	(27)
@@ -511,13 +513,15 @@ static unsigned long samsung_pll46xx_recalc_rate(struct clk_hw *hw,
 
 	pll_con0 = __raw_readl(pll->con_reg);
 	pll_con1 = __raw_readl(pll->con_reg + 4);
-	mdiv = (pll_con0 >> PLL46XX_MDIV_SHIFT) & PLL46XX_MDIV_MASK;
+	mdiv = (pll_con0 >> PLL46XX_MDIV_SHIFT) & ((pll->type == pll_1460x) ?
+				PLL1460X_MDIV_MASK : PLL46XX_MDIV_MASK);
 	pdiv = (pll_con0 >> PLL46XX_PDIV_SHIFT) & PLL46XX_PDIV_MASK;
 	sdiv = (pll_con0 >> PLL46XX_SDIV_SHIFT) & PLL46XX_SDIV_MASK;
 	kdiv = pll->type == pll_4650c ? pll_con1 & PLL4650C_KDIV_MASK :
 					pll_con1 & PLL46XX_KDIV_MASK;
 
-	shift = pll->type == pll_4600 ? 16 : 10;
+	shift = ((pll->type == pll_4600) || (pll->type == pll_1460x)) ? 16 : 10;
+
 	fvco *= (mdiv << shift) + kdiv;
 	do_div(fvco, (pdiv << sdiv));
 	fvco >>= shift;
@@ -573,14 +577,21 @@ static int samsung_pll46xx_set_rate(struct clk_hw *hw, unsigned long drate,
 		lock = 0xffff;
 
 	/* Set PLL PMS and VSEL values. */
-	con0 &= ~((PLL46XX_MDIV_MASK << PLL46XX_MDIV_SHIFT) |
+	if (pll->type == pll_1460x) {
+		con0 &= ~((PLL1460X_MDIV_MASK << PLL46XX_MDIV_SHIFT) |
+			(PLL46XX_PDIV_MASK << PLL46XX_PDIV_SHIFT) |
+			(PLL46XX_SDIV_MASK << PLL46XX_SDIV_SHIFT));
+	} else {
+		con0 &= ~((PLL46XX_MDIV_MASK << PLL46XX_MDIV_SHIFT) |
 			(PLL46XX_PDIV_MASK << PLL46XX_PDIV_SHIFT) |
 			(PLL46XX_SDIV_MASK << PLL46XX_SDIV_SHIFT) |
 			(PLL46XX_VSEL_MASK << PLL46XX_VSEL_SHIFT));
+		con0 |=	rate->vsel << PLL46XX_VSEL_SHIFT;
+	}
+
 	con0 |= (rate->mdiv << PLL46XX_MDIV_SHIFT) |
 			(rate->pdiv << PLL46XX_PDIV_SHIFT) |
-			(rate->sdiv << PLL46XX_SDIV_SHIFT) |
-			(rate->vsel << PLL46XX_VSEL_SHIFT);
+			(rate->sdiv << PLL46XX_SDIV_SHIFT);
 
 	/* Set PLL K, MFR and MRR values. */
 	con1 = __raw_readl(pll->con_reg + 0x4);
@@ -1190,6 +1201,9 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx,
 	/* clk_ops for 35xx and 2550 are similar */
 	case pll_35xx:
 	case pll_2550:
+	case pll_1450x:
+	case pll_1451x:
+	case pll_1452x:
 		if (!pll->rate_table)
 			init.ops = &samsung_pll35xx_clk_min_ops;
 		else
@@ -1223,6 +1237,7 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx,
 	case pll_4600:
 	case pll_4650:
 	case pll_4650c:
+	case pll_1460x:
 		if (!pll->rate_table)
 			init.ops = &samsung_pll46xx_clk_min_ops;
 		else
drivers/clk/samsung/clk-pll.h +4 -0
index c0ed4d4..213de9a 100644
@@ -33,6 +33,10 @@ enum samsung_pll_type {
 	pll_s3c2440_mpll,
 	pll_2550xx,
 	pll_2650xx,
+	pll_1450x,
+	pll_1451x,
+	pll_1452x,
+	pll_1460x,
 };
 
 #define PLL_35XX_RATE(_rate, _m, _p, _s)			\
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 2/7 clk: samsung: Factor out the common code to clk.c

In reply to Naveen Krishna Chatradhi

While adding clock support for Exynos5260, the infrastructure to register multiple clock controllers was introduced. Factor out the support for registering multiple clock controller from Exynos5260 clock code to common samsung clock code so that it can be used by other Exynos SoC which have multiple clock controllers.

---
 drivers/clk/samsung/clk-exynos5260.c |  183 +++++-----------------------------
 drivers/clk/samsung/clk.c            |   95 ++++++++++++++++++
 drivers/clk/samsung/clk.h            |   34 +++++++
 3 files changed, 155 insertions(+), 157 deletions(-)
drivers/clk/samsung/clk-exynos5260.c +26 -157
index ce3de97..d72c982 100644
@@ -11,10 +11,8 @@
 
 #include <linux/clk.h>
 #include <linux/clkdev.h>
-#include <linux/clk-provider.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/syscore_ops.h>
 
 #include "clk-exynos5260.h"
 #include "clk.h"
@@ -22,39 +20,6 @@
 
 #include <dt-bindings/clock/exynos5260-clk.h>
 
-static LIST_HEAD(clock_reg_cache_list);
-
-struct exynos5260_clock_reg_cache {
-	struct list_head node;
-	void __iomem *reg_base;
-	struct samsung_clk_reg_dump *rdump;
-	unsigned int rd_num;
-};
-
-struct exynos5260_cmu_info {
-	/* list of pll clocks and respective count */
-	struct samsung_pll_clock *pll_clks;
-	unsigned int nr_pll_clks;
-	/* list of mux clocks and respective count */
-	struct samsung_mux_clock *mux_clks;
-	unsigned int nr_mux_clks;
-	/* list of div clocks and respective count */
-	struct samsung_div_clock *div_clks;
-	unsigned int nr_div_clks;
-	/* list of gate clocks and respective count */
-	struct samsung_gate_clock *gate_clks;
-	unsigned int nr_gate_clks;
-	/* list of fixed clocks and respective count */
-	struct samsung_fixed_rate_clock *fixed_clks;
-	unsigned int nr_fixed_clks;
-	/* total number of clocks with IDs assigned*/
-	unsigned int nr_clk_ids;
-
-	/* list and number of clocks registers */
-	unsigned long *clk_regs;
-	unsigned int nr_clk_regs;
-};
-
 /*
  * Applicable for all 2550 Type PLLS for Exynos5260, listed below
  * DISP_PLL, EGL_PLL, KFC_PLL, MEM_PLL, BUS_PLL, MEDIA_PLL, G3D_PLL.
@@ -115,102 +80,6 @@ static struct samsung_pll_rate_table pll2650_24mhz_tbl[] __initdata = {
 
 #ifdef CONFIG_PM_SLEEP
 
-static int exynos5260_clk_suspend(void)
-{
-	struct exynos5260_clock_reg_cache *cache;
-
-	list_for_each_entry(cache, &clock_reg_cache_list, node)
-		samsung_clk_save(cache->reg_base, cache->rdump,
-				cache->rd_num);
-
-	return 0;
-}
-
-static void exynos5260_clk_resume(void)
-{
-	struct exynos5260_clock_reg_cache *cache;
-
-	list_for_each_entry(cache, &clock_reg_cache_list, node)
-		samsung_clk_restore(cache->reg_base, cache->rdump,
-				cache->rd_num);
-}
-
-static struct syscore_ops exynos5260_clk_syscore_ops = {
-	.suspend = exynos5260_clk_suspend,
-	.resume = exynos5260_clk_resume,
-};
-
-static void exynos5260_clk_sleep_init(void __iomem *reg_base,
-			unsigned long *rdump,
-			unsigned long nr_rdump)
-{
-	struct exynos5260_clock_reg_cache *reg_cache;
-
-	reg_cache = kzalloc(sizeof(struct exynos5260_clock_reg_cache),
-			GFP_KERNEL);
-	if (!reg_cache)
-		panic("could not allocate register cache.\n");
-
-	reg_cache->rdump = samsung_clk_alloc_reg_dump(rdump, nr_rdump);
-
-	if (!reg_cache->rdump)
-		panic("could not allocate register dump storage.\n");
-
-	if (list_empty(&clock_reg_cache_list))
-		register_syscore_ops(&exynos5260_clk_syscore_ops);
-
-	reg_cache->rd_num = nr_rdump;
-	reg_cache->reg_base = reg_base;
-	list_add_tail(&reg_cache->node, &clock_reg_cache_list);
-}
-
-#else
-static void exynos5260_clk_sleep_init(void __iomem *reg_base,
-			unsigned long *rdump,
-			unsigned long nr_rdump){}
-#endif
-
-/*
- * Common function which registers plls, muxes, dividers and gates
- * for each CMU. It also add CMU register list to register cache.
- */
-
-void __init exynos5260_cmu_register_one(struct device_node *np,
-			struct exynos5260_cmu_info *cmu)
-{
-	void __iomem *reg_base;
-	struct samsung_clk_provider *ctx;
-
-	reg_base = of_iomap(np, 0);
-	if (!reg_base)
-		panic("%s: failed to map registers\n", __func__);
-
-	ctx = samsung_clk_init(np, reg_base, cmu->nr_clk_ids);
-	if (!ctx)
-		panic("%s: unable to alllocate ctx\n", __func__);
-
-	if (cmu->pll_clks)
-		samsung_clk_register_pll(ctx, cmu->pll_clks, cmu->nr_pll_clks,
-			reg_base);
-	if (cmu->mux_clks)
-		samsung_clk_register_mux(ctx,  cmu->mux_clks,
-			cmu->nr_mux_clks);
-	if (cmu->div_clks)
-		samsung_clk_register_div(ctx, cmu->div_clks, cmu->nr_div_clks);
-	if (cmu->gate_clks)
-		samsung_clk_register_gate(ctx, cmu->gate_clks,
-			cmu->nr_gate_clks);
-	if (cmu->fixed_clks)
-		samsung_clk_register_fixed_rate(ctx, cmu->fixed_clks,
-			cmu->nr_fixed_clks);
-	if (cmu->clk_regs)
-		exynos5260_clk_sleep_init(reg_base, cmu->clk_regs,
-			cmu->nr_clk_regs);
-
-	samsung_clk_of_add_provider(np, ctx);
-}
-
-
 /* CMU_AUD */
 
 static unsigned long aud_clk_regs[] __initdata = {
@@ -268,7 +137,7 @@ struct samsung_gate_clock aud_gate_clks[] __initdata = {
 
 static void __init exynos5260_clk_aud_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.mux_clks = aud_mux_clks;
 	cmu.nr_mux_clks = ARRAY_SIZE(aud_mux_clks);
@@ -280,7 +149,7 @@ static void __init exynos5260_clk_aud_init(struct device_node *np)
 	cmu.clk_regs = aud_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(aud_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_aud, "samsung,exynos5260-clock-aud",
@@ -458,7 +327,7 @@ struct samsung_gate_clock disp_gate_clks[] __initdata = {
 
 static void __init exynos5260_clk_disp_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.mux_clks = disp_mux_clks;
 	cmu.nr_mux_clks = ARRAY_SIZE(disp_mux_clks);
@@ -470,7 +339,7 @@ static void __init exynos5260_clk_disp_init(struct device_node *np)
 	cmu.clk_regs = disp_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(disp_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_disp, "samsung,exynos5260-clock-disp",
@@ -522,7 +391,7 @@ static struct samsung_pll_clock egl_pll_clks[] __initdata = {
 
 static void __init exynos5260_clk_egl_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.pll_clks = egl_pll_clks;
 	cmu.nr_pll_clks =  ARRAY_SIZE(egl_pll_clks);
@@ -534,7 +403,7 @@ static void __init exynos5260_clk_egl_init(struct device_node *np)
 	cmu.clk_regs = egl_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(egl_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_egl, "samsung,exynos5260-clock-egl",
@@ -624,7 +493,7 @@ struct samsung_gate_clock fsys_gate_clks[] __initdata = {
 
 static void __init exynos5260_clk_fsys_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.mux_clks = fsys_mux_clks;
 	cmu.nr_mux_clks = ARRAY_SIZE(fsys_mux_clks);
@@ -634,7 +503,7 @@ static void __init exynos5260_clk_fsys_init(struct device_node *np)
 	cmu.clk_regs = fsys_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(fsys_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_fsys, "samsung,exynos5260-clock-fsys",
@@ -713,7 +582,7 @@ struct samsung_gate_clock g2d_gate_clks[] __initdata = {
 
 static void __init exynos5260_clk_g2d_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.mux_clks = g2d_mux_clks;
 	cmu.nr_mux_clks = ARRAY_SIZE(g2d_mux_clks);
@@ -725,7 +594,7 @@ static void __init exynos5260_clk_g2d_init(struct device_node *np)
 	cmu.clk_regs = g2d_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(g2d_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_g2d, "samsung,exynos5260-clock-g2d",
@@ -774,7 +643,7 @@ static struct samsung_pll_clock g3d_pll_clks[] __initdata = {
 
 static void __init exynos5260_clk_g3d_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.pll_clks = g3d_pll_clks;
 	cmu.nr_pll_clks =  ARRAY_SIZE(g3d_pll_clks);
@@ -788,7 +657,7 @@ static void __init exynos5260_clk_g3d_init(struct device_node *np)
 	cmu.clk_regs = g3d_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(g3d_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_g3d, "samsung,exynos5260-clock-g3d",
@@ -909,7 +778,7 @@ struct samsung_gate_clock gscl_gate_clks[] __initdata = {
 
 static void __init exynos5260_clk_gscl_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.mux_clks = gscl_mux_clks;
 	cmu.nr_mux_clks = ARRAY_SIZE(gscl_mux_clks);
@@ -921,7 +790,7 @@ static void __init exynos5260_clk_gscl_init(struct device_node *np)
 	cmu.clk_regs = gscl_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(gscl_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_gscl, "samsung,exynos5260-clock-gscl",
@@ -1028,7 +897,7 @@ struct samsung_gate_clock isp_gate_clks[] __initdata = {
 
 static void __init exynos5260_clk_isp_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.mux_clks = isp_mux_clks;
 	cmu.nr_mux_clks = ARRAY_SIZE(isp_mux_clks);
@@ -1040,7 +909,7 @@ static void __init exynos5260_clk_isp_init(struct device_node *np)
 	cmu.clk_regs = isp_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(isp_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_isp, "samsung,exynos5260-clock-isp",
@@ -1092,7 +961,7 @@ static struct samsung_pll_clock kfc_pll_clks[] __initdata = {
 
 static void __init exynos5260_clk_kfc_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.pll_clks = kfc_pll_clks;
 	cmu.nr_pll_clks =  ARRAY_SIZE(kfc_pll_clks);
@@ -1104,7 +973,7 @@ static void __init exynos5260_clk_kfc_init(struct device_node *np)
 	cmu.clk_regs = kfc_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(kfc_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_kfc, "samsung,exynos5260-clock-kfc",
@@ -1148,7 +1017,7 @@ struct samsung_gate_clock mfc_gate_clks[] __initdata = {
 
 static void __init exynos5260_clk_mfc_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.mux_clks = mfc_mux_clks;
 	cmu.nr_mux_clks = ARRAY_SIZE(mfc_mux_clks);
@@ -1160,7 +1029,7 @@ static void __init exynos5260_clk_mfc_init(struct device_node *np)
 	cmu.clk_regs = mfc_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(mfc_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_mfc, "samsung,exynos5260-clock-mfc",
@@ -1295,7 +1164,7 @@ static struct samsung_pll_clock mif_pll_clks[] __initdata = {
 
 static void __init exynos5260_clk_mif_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.pll_clks = mif_pll_clks;
 	cmu.nr_pll_clks =  ARRAY_SIZE(mif_pll_clks);
@@ -1309,7 +1178,7 @@ static void __init exynos5260_clk_mif_init(struct device_node *np)
 	cmu.clk_regs = mif_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(mif_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_mif, "samsung,exynos5260-clock-mif",
@@ -1503,7 +1372,7 @@ struct samsung_gate_clock peri_gate_clks[] __initdata = {
 
 static void __init exynos5260_clk_peri_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.mux_clks = peri_mux_clks;
 	cmu.nr_mux_clks = ARRAY_SIZE(peri_mux_clks);
@@ -1515,7 +1384,7 @@ static void __init exynos5260_clk_peri_init(struct device_node *np)
 	cmu.clk_regs = peri_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(peri_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_peri, "samsung,exynos5260-clock-peri",
@@ -1959,7 +1828,7 @@ static struct samsung_pll_clock top_pll_clks[] __initdata = {
 
 static void __init exynos5260_clk_top_init(struct device_node *np)
 {
-	struct exynos5260_cmu_info cmu = {0};
+	struct exynos_cmu_info cmu = {0};
 
 	cmu.pll_clks = top_pll_clks;
 	cmu.nr_pll_clks =  ARRAY_SIZE(top_pll_clks);
@@ -1975,7 +1844,7 @@ static void __init exynos5260_clk_top_init(struct device_node *np)
 	cmu.clk_regs = top_clk_regs;
 	cmu.nr_clk_regs = ARRAY_SIZE(top_clk_regs);
 
-	exynos5260_cmu_register_one(np, &cmu);
+	exynos_cmu_register_one(np, &cmu);
 }
 
 CLK_OF_DECLARE(exynos5260_clk_top, "samsung,exynos5260-clock-top",
drivers/clk/samsung/clk.c +95 -0

104 lines not on this page · raw message

drivers/clk/samsung/clk.h +34 -0
index 66ab36b..552d155 100644
@@ -324,6 +324,37 @@ struct samsung_pll_clock {
 	__PLL(_typ, _id, NULL, _name, _pname, CLK_GET_RATE_NOCACHE,	\
 		_lock, _con, _rtable, _alias)
 
+struct exynos_clock_reg_cache {
+	struct list_head node;
+	void __iomem *reg_base;
+	struct samsung_clk_reg_dump *rdump;
+	unsigned int rd_num;
+};
+
+struct exynos_cmu_info {
+	/* list of pll clocks and respective count */
+	struct samsung_pll_clock *pll_clks;
+	unsigned int nr_pll_clks;
+	/* list of mux clocks and respective count */
+	struct samsung_mux_clock *mux_clks;
+	unsigned int nr_mux_clks;
+	/* list of div clocks and respective count */
+	struct samsung_div_clock *div_clks;
+	unsigned int nr_div_clks;
+	/* list of gate clocks and respective count */
+	struct samsung_gate_clock *gate_clks;
+	unsigned int nr_gate_clks;
+	/* list of fixed clocks and respective count */
+	struct samsung_fixed_rate_clock *fixed_clks;
+	unsigned int nr_fixed_clks;
+	/* total number of clocks with IDs assigned*/
+	unsigned int nr_clk_ids;
+
+	/* list and number of clocks registers */
+	unsigned long *clk_regs;
+	unsigned int nr_clk_regs;
+};
+
 extern struct samsung_clk_provider *__init samsung_clk_init(
 			struct device_node *np, void __iomem *base,
 			unsigned long nr_clks);
@@ -362,6 +393,9 @@ 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 void __init exynos_cmu_register_one(struct device_node *,
+			struct exynos_cmu_info *);
+
 extern unsigned long _get_rate(const char *clk_name);
 
 extern void samsung_clk_save(void __iomem *base,
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v2 3/7 clk: samsung: Add fixed_factor_clocks field to struct exynos_cmu_info

In reply to Naveen Krishna Chatradhi

Add the fields "fixed_factor_clks" and "nr_fixed_factor_clks" to "struct exynos_cmu_info" to allow registering of fixed factor clocks as well with exynos_cmu_register_one().

---
 drivers/clk/samsung/clk.c |    3 +++
 drivers/clk/samsung/clk.h |    3 +++
 2 files changed, 6 insertions(+)
drivers/clk/samsung/clk.c +3 -0
index a043654..4b31267 100644
@@ -402,6 +402,9 @@ void __init exynos_cmu_register_one(struct device_node *np,
 	if (cmu->fixed_clks)
 		samsung_clk_register_fixed_rate(ctx, cmu->fixed_clks,
 			cmu->nr_fixed_clks);
+	if (cmu->fixed_factor_clks)
+		samsung_clk_register_fixed_factor(ctx, cmu->fixed_factor_clks,
+			cmu->nr_fixed_factor_clks);
 	if (cmu->clk_regs)
 		exynos_clk_sleep_init(reg_base, cmu->clk_regs,
 			cmu->nr_clk_regs);
drivers/clk/samsung/clk.h +3 -0
index 552d155..993b51c 100644
@@ -347,6 +347,9 @@ struct exynos_cmu_info {
 	/* list of fixed clocks and respective count */
 	struct samsung_fixed_rate_clock *fixed_clks;
 	unsigned int nr_fixed_clks;
+	/* list of fixed factor clocks and respective count */
+	struct samsung_fixed_factor_clock *fixed_factor_clks;
+	unsigned int nr_fixed_factor_clks;
 	/* total number of clocks with IDs assigned*/
 	unsigned int nr_clk_ids;
 
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v2 4/7 clk: samsung: add initial clock support for Exynos7 SoC

In reply to Naveen Krishna Chatradhi

Add initial clock support for Exynos7 SoC which is required to bring up platforms based on Exynos7.

---
 .../devicetree/bindings/clock/exynos7-clock.txt    |   37 ++
 drivers/clk/samsung/Makefile                       |    1 +
 drivers/clk/samsung/clk-exynos7.c                  |  438 ++++++++++++++++++++
 include/dt-bindings/clock/exynos7-clk.h            |   55 +++
 4 files changed, 531 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/exynos7-clock.txt
 create mode 100644 drivers/clk/samsung/clk-exynos7.c
 create mode 100644 include/dt-bindings/clock/exynos7-clk.h
Documentation/devicetree/bindings/clock/exynos7-clock.txt new file +37 -0
new file mode 100644
index 0000000..798eb10
@@ -0,0 +1,37 @@
+* Samsung Exynos7 Clock Controller
+
+Exynos7 clock controller has various blocks which are instantiated
+independently from the device-tree. These clock controllers
+generate and supply clocks to various hardware blocks within
+the SoC.
+
+Each clock is assigned an identifier and client nodes can use
+this identifier to specify the clock which they consume. All
+available clocks are defined as preprocessor macros in
+dt-bindings/clock/exynos7-clk.h header and can be used in
+device tree sources.
+
+External clocks:
+
+There are several clocks that are generated outside the SoC. It
+is expected that they are defined using standard clock bindings
+with following clock-output-names:
+
+ - "fin_pll" - PLL input clock from XXTI
+
+Required Properties for Clock Controller:
+
+ - compatible: clock controllers will use one of the following
+	compatible strings to indicate the clock controller
+	functionality.
+
+	- "samsung,exynos7-clock-topc"
+	- "samsung,exynos7-clock-top0"
+	- "samsung,exynos7-clock-peric0"
+	- "samsung,exynos7-clock-peric1"
+	- "samsung,exynos7-clock-peris"
+
+ - reg: physical base address of the controller and the length of
+	memory mapped region.
+
+ - #clock-cells: should be 1.
drivers/clk/samsung/Makefile +1 -0
index 6fb4bc6..5da0ba9 100644
@@ -18,3 +18,4 @@ obj-$(CONFIG_S3C2412_COMMON_CLK)+= clk-s3c2412.o
 obj-$(CONFIG_S3C2443_COMMON_CLK)+= clk-s3c2443.o
 obj-$(CONFIG_ARCH_S3C64XX)	+= clk-s3c64xx.o
 obj-$(CONFIG_ARCH_S5PV210)	+= clk-s5pv210.o clk-s5pv210-audss.o
+obj-$(CONFIG_ARCH_EXYNOS7)	+= clk-exynos7.o
drivers/clk/samsung/clk-exynos7.c new file +438 -0

438 lines not on this page · raw message

include/dt-bindings/clock/exynos7-clk.h new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v2 5/7 arm64: dts: Add initial device tree support for EXYNOS7

In reply to Naveen Krishna Chatradhi

Add initial device tree nodes for EXYNOS7 SoC and board dts file to support Espresso board based on Exynos7 SoC.

---
 arch/arm64/boot/dts/Makefile                    |    1 +
 arch/arm64/boot/dts/exynos/exynos7-espresso.dts |   31 +++++
 arch/arm64/boot/dts/exynos/exynos7.dtsi         |  168 +++++++++++++++++++++++
 3 files changed, 200 insertions(+)
 create mode 100644 arch/arm64/boot/dts/exynos/exynos7-espresso.dts
 create mode 100644 arch/arm64/boot/dts/exynos/exynos7.dtsi
arch/arm64/boot/dts/Makefile +1 -0
index c52bdb0..a3bc18a 100644
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_ARCH_EXYNOS7) += exynos/exynos7-espresso.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb foundation-v8.dtb
 dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb
 
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +31 -0
new file mode 100644
index 0000000..f6a8879
@@ -0,0 +1,31 @@
+/*
+ * SAMSUNG Exynos7 Espresso board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+/dts-v1/;
+#include "exynos7.dtsi"
+
+/ {
+	model = "Samsung Exynos7 Espresso board based on EXYNOS7";
+	compatible = "samsung,exynos7-espresso", "samsung,exynos7";
+
+	chosen {
+		linux,stdout-path = &serial_2;
+	};
+
+	memory at 40000000 {
+		device_type = "memory";
+		reg = <0x0 0x40000000 0x0 0xC0000000>;
+	};
+};
+
+&serial_2 {
+	status = "okay";
+};
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +168 -0

168 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#6 lore raw

PATCH v2 5/7 arm64: dts: Add initial device tree support for EXYNOS7

Quoted 7 lines · Naveen Krishna Chatradhi

Add initial device tree nodes for EXYNOS7 SoC and board dts file to support Espresso board based on Exynos7 SoC.

NAK.

There are several exynos7 SoCs which cannot be supported with one dt file. I mean just one exynos7 cannot represent all of exynos7 SoCs...

Quoted 34 lines
---
 arch/arm64/boot/dts/Makefile                    |    1 +
 arch/arm64/boot/dts/exynos/exynos7-espresso.dts |   31 +++++
 arch/arm64/boot/dts/exynos/exynos7.dtsi         |  168 +++++++++++++++++++++++
 3 files changed, 200 insertions(+)
 create mode 100644 arch/arm64/boot/dts/exynos/exynos7-espresso.dts
 create mode 100644 arch/arm64/boot/dts/exynos/exynos7.dtsi
arch/arm64/boot/dts/Makefile +1 -0
index c52bdb0..a3bc18a 100644
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_ARCH_EXYNOS7) += exynos/exynos7-espresso.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb foundation-v8.dtb
 dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb
 
arch/arm64/boot/dts/exynos/exynos7- renamed from arch/arm64/boot/dts/exynos/exynos7-espresso.dts +0 -0

espresso.dts
new file mode 100644
index 0000000..f6a8879

arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +10 -0
@@ -0,0 +1,31 @@
+/*
+ * SAMSUNG Exynos7 Espresso board device tree source
+ *
+ * Copyright (c) 2014 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.
+*/

arch/arm64/boot/dts/exynos/exynos7-espresso.dts line 20

Quoted 10 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +10 -0
+
+/dts-v1/;
+#include "exynos7.dtsi"
+
+/ {
+	model = "Samsung Exynos7 Espresso board based on EXYNOS7";
+	compatible = "samsung,exynos7-espresso", "samsung,exynos7";
+
+	chosen {
+		linux,stdout-path = &serial_2;

Well...

arch/arm64/boot/dts/exynos/exynos7-espresso.dts line 25

Quoted 5 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +5 -0
+	};
+
+	memory at 40000000 {
+		device_type = "memory";
+		reg = <0x0 0x40000000 0x0 0xC0000000>;

The base address of system memory is depending on each board, actually some of them are 0x20000000.

Quoted 26 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +6 -0
+	};
+};
+
+&serial_2 {
+	status = "okay";
+};
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +14 -0
new file mode 100644
index 0000000..e593af55
@@ -0,0 +1,168 @@
+/*
+ * SAMSUNG EXYNOS7 SoC device tree source
+ *
+ * Copyright (c) 2014 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.
+ */
+
+#include <dt-bindings/clock/exynos7-clk.h>
+
+/ {

arch/arm64/boot/dts/exynos/exynos7.dtsi line 24

Quoted 10 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +10 -0
+	compatible = "samsung,exynos7";
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	aliases {
+		serial0 = &serial_0;
+		serial1 = &serial_1;
+		serial2 = &serial_2;
+		serial3 = &serial_3;

There are exynos7 SoC is having 3 serial IPs...

Quoted 24 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +24 -0
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu at 0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a57", "arm,armv8";
+			enable-method = "psci";
+			reg = <0x0>;
+		};
+
+		cpu at 1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a57", "arm,armv8";
+			enable-method = "psci";
+			reg = <0x1>;
+		};
+
+		cpu at 2 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a57", "arm,armv8";
+			enable-method = "psci";

arch/arm64/boot/dts/exynos/exynos7.dtsi line 58

Quoted 10 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +10 -0
+			reg = <0x2>;
+		};
+
+		cpu at 3 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a57", "arm,armv8";
+			enable-method = "psci";
+			reg = <0x3>;
+		};
+	};

Naveen, please don't assume all of exynos7 SoCs are having quad a57s...

Quoted 10 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +10 -0
+
+	psci {
+		compatible = "arm,psci-0.2";
+		method = "smc";
+	};
+
+	soc: soc {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;

arch/arm64/boot/dts/exynos/exynos7.dtsi line 78

Quoted 10 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +10 -0
+		ranges = <0 0 0 0x18000000>;
+
+		chipid at 10000000 {
+			compatible = "samsung,exynos4210-chipid";
+			reg = <0x10000000 0x100>;
+		};
+
+		fin_pll: xxti {
+			compatible = "fixed-clock";
+			clock-frequency = <24000000>;

It's wrong on some exynos7 SoCs...

arch/arm64/boot/dts/exynos/exynos7.dtsi line 82

Quoted 4 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +4 -0
+			clock-output-names = "fin_pll";
+			#clock-cells = <0>;
+		};
+

Unfortunately the addresses are different on each exynos7 SoCs...

Quoted 87 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +86 -1
+		gic: interrupt-controller at 11001000 {
+			compatible = "arm,gic-400";
+			#interrupt-cells = <3>;
+			#address-cells = <0>;
+			interrupt-controller;
+			reg =	<0x11001000 0x1000>,
+				<0x11002000 0x1000>,
+				<0x11004000 0x2000>,
+				<0x11006000 0x2000>;
+		};
+
+		clock_topc: clock-controller at 10570000 {
+			compatible = "samsung,exynos7-clock-topc";
+			reg = <0x10570000 0x10000>;
+			#clock-cells = <1>;
+		};
+
+		clock_top0: clock-controller at 105d0000 {
+			compatible = "samsung,exynos7-clock-top0";
+			reg = <0x105d0000 0xb000>;
+			#clock-cells = <1>;
+		};
+
+		clock_peric0: clock-controller at 13610000 {
+			compatible = "samsung,exynos7-clock-peric0";
+			reg = <0x13610000 0xd00>;
+			#clock-cells = <1>;
+		};
+
+		clock_peric1: clock-controller at 14C80000 {
+			compatible = "samsung,exynos7-clock-peric1";
+			reg = <0x14c80000 0xd00>;
+			#clock-cells = <1>;
+		};
+
+		clock_peris: clock-controller at 10040000 {
+			compatible = "samsung,exynos7-clock-peris";
+			reg = <0x10040000 0xd00>;
+			#clock-cells = <1>;
+		};
+
+		serial_0: serial at 13630000 {
+			compatible = "samsung,exynos4210-uart";
+			reg = <0x13630000 0x100>;
+			interrupts = <0 440 0>;
+			clocks = <&clock_peric0 PCLK_UART0>, <&clock_peric0 SCLK_UART0>;
+			clock-names = "uart", "clk_uart_baud0";
+			status = "disabled";
+		};
+
+		serial_1: serial at 14c20000 {
+			compatible = "samsung,exynos4210-uart";
+			reg = <0x14c20000 0x100>;
+			interrupts = <0 456 0>;
+			clocks = <&clock_peric1 PCLK_UART1>, <&clock_peric1 SCLK_UART1>;
+			clock-names = "uart", "clk_uart_baud0";
+			status = "disabled";
+		};
+
+		serial_2: serial at 14c30000 {
+			compatible = "samsung,exynos4210-uart";
+			reg = <0x14c30000 0x100>;
+			interrupts = <0 457 0>;
+			clocks = <&clock_peric1 PCLK_UART2>, <&clock_peric1 SCLK_UART2>;
+			clock-names = "uart", "clk_uart_baud0";
+			status = "disabled";
+		};
+
+		serial_3: serial at 14c40000 {
+			compatible = "samsung,exynos4210-uart";
+			reg = <0x14c40000 0x100>;
+			interrupts = <0 458 0>;
+			clocks = <&clock_peric1 PCLK_UART3>, <&clock_peric1 SCLK_UART3>;
+			clock-names = "uart", "clk_uart_baud0";
+			status = "disabled";
+		};
+
+		timer {
+			compatible = "arm,armv8-timer";
+			interrupts = <1 13 0xff01>,
+				     <1 14 0xff01>,
+				     <1 11 0xff01>,
+				     <1 10 0xff01>;
+		};
+	};
+};
--
Quoted 1 line

1.7.9.5

So this is not acceptable...

- Kukjin

maintainer
#7 lore raw

PATCH v2 5/7 arm64: dts: Add initial device tree support for EXYNOS7

Quoted 32 lines · On Thursday 04 September 2014 01:15:20 Kukjin Kim wrote:
Quoted 17 lines · Naveen Krishna Chatradhi
arch/arm64/boot/dts/exynos/exynos7- renamed from arch/arm64/boot/dts/exynos/exynos7-espresso.dts +0 -0

espresso.dts
new file mode 100644
index 0000000..f6a8879

arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +10 -0
@@ -0,0 +1,31 @@
+/*
+ * SAMSUNG Exynos7 Espresso board device tree source
+ *
+ * Copyright (c) 2014 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.
+*/

arch/arm64/boot/dts/exynos/exynos7-espresso.dts line 20

Quoted 10 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +10 -0
+
+/dts-v1/;
+#include "exynos7.dtsi"
+
+/ {
+	model = "Samsung Exynos7 Espresso board based on EXYNOS7";
+	compatible = "samsung,exynos7-espresso", "samsung,exynos7";
+
+	chosen {
+		linux,stdout-path = &serial_2;

Well...

Quoted 8 lines

arch/arm64/boot/dts/exynos/exynos7-espresso.dts line 25

Quoted 5 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +5 -0
+	};
+
+	memory at 40000000 {
+		device_type = "memory";
+		reg = <0x0 0x40000000 0x0 0xC0000000>;

The base address of system memory is depending on each board, actually some of them are 0x20000000.

This is the board specific file, so it seems ok.

Quoted 7 lines
Quoted 7 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +7 -0
+#include <dt-bindings/clock/exynos7-clk.h>
+
+/ {
+	compatible = "samsung,exynos7";
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;
+	#size-cells = <2>;
Quoted 8 lines

arch/arm64/boot/dts/exynos/exynos7-espresso.dts

Quoted 6 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +6 -0
+
+	aliases {
+		serial0 = &serial_0;
+		serial1 = &serial_1;
+		serial2 = &serial_2;
+		serial3 = &serial_3;

There are exynos7 SoC is having 3 serial IPs...

These aliases should just go into the board file as well, and since it seems to have only one uart, the best way is to list that as serial0:

	serial0 = &serial_2;
Quoted 14 lines
Quoted 14 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +14 -0
+
+	psci {
+		compatible = "arm,psci-0.2";
+		method = "smc";
+	};
+
+	soc: soc {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0 0 0x18000000>;
+
+		chipid at 10000000 {
+			compatible = "samsung,exynos4210-chipid";
Quoted 9 lines

arch/arm64/boot/dts/exynos/exynos7-espresso.dts

Quoted 6 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +6 -0
+			reg = <0x10000000 0x100>;
+		};
+
+		fin_pll: xxti {
+			compatible = "fixed-clock";
+			clock-frequency = <24000000>;

It's wrong on some exynos7 SoCs...

Is this an external clock input? If so, the frequency should also go into the board file, otherwise into the soc-specific one.

Arnd

#8 lore raw

PATCH v2 5/7 arm64: dts: Add initial device tree support for EXYNOS7

Quoted 1 line · Arnd Bergmann

Hi, Arnd

Quoted 42 lines · On Thursday 04 September 2014 01:15:20 Kukjin Kim wrote:
Quoted 32 lines
Quoted 17 lines · Naveen Krishna Chatradhi
arch/arm64/boot/dts/exynos/exynos7- renamed from arch/arm64/boot/dts/exynos/exynos7-espresso.dts +0 -0

espresso.dts
new file mode 100644
index 0000000..f6a8879

arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +10 -0
@@ -0,0 +1,31 @@
+/*
+ * SAMSUNG Exynos7 Espresso board device tree source
+ *
+ * Copyright (c) 2014 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.
+*/

arch/arm64/boot/dts/exynos/exynos7-espresso.dts line 20

Quoted 10 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +10 -0
+
+/dts-v1/;
+#include "exynos7.dtsi"
+
+/ {
+	model = "Samsung Exynos7 Espresso board based on EXYNOS7";
+	compatible = "samsung,exynos7-espresso", "samsung,exynos7";
+
+	chosen {
+		linux,stdout-path = &serial_2;

Well...

Quoted 8 lines

arch/arm64/boot/dts/exynos/exynos7-espresso.dts line 25

Quoted 5 lines
arch/arm64/boot/dts/exynos/exynos7-espresso.dts new file +5 -0
+	};
+
+	memory at 40000000 {
+		device_type = "memory";
+		reg = <0x0 0x40000000 0x0 0xC0000000>;

The base address of system memory is depending on each board, actually some of them are 0x20000000.

Quoted 2 lines

This is the board specific file, so it seems ok.

I mean there are many espresso boards are having different exynos7 SoC. I mean exynos7-espresso cannot represent all of espresso boards.

- Kukjin

maintainer
#9 lore raw

PATCH v2 5/7 arm64: dts: Add initial device tree support for EXYNOS7

Quoted 5 lines · On Thursday 04 September 2014 01:31:21 Kukjin Kim wrote:
Quoted 2 lines

This is the board specific file, so it seems ok.

I mean there are many espresso boards are having different exynos7 SoC. I mean exynos7-espresso cannot represent all of espresso boards.

Ah, I see, that makes sense.

We definitely need a top-level .dts file for each board that is different in a nondiscoverable way then.

If the mmc settings and possibly some other nodes (to be added later) are common across them, those can be in a board specific .dtsi file.

For the memory node, I would actually expect that to be filled by the boot loader, so we could leave it out entirely. The same applies to the command line: the parts that are in there at the moment ( "console=ttySAC2,115200n8 root=/dev/ram0 ramdisk=16384 initrd=0x42000000,16M") clearly don't belong into a generic dts file and none of them should be set that way.

For the initial version, that would mean that the file comes down to having as its only contents

/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include "exynos7123.dtsi"
#include "exynos7-espresso.dtsi" // for the mmc nodes

/ {
       model = "Samsung ESPRESSO board based on EXYNOS7123";
       compatible = "samsung,espresso", "samsung,exynos7123", "samsung,exynos7";
};

One more thing I just noticed is the GPL statement in the dts files. Can we please change that to a permissive license in order to allow including it in non-GPL boot loaders and operating systems?

Dual GPL+MIT or GPL+BSD would make most sense here.

Arnd

#10 lore raw

PATCH v2 5/7 arm64: dts: Add initial device tree support for EXYNOS7

Quoted 4 lines · Arnd Bergmann
Quoted 2 lines · On Thursday 04 September 2014 01:31:21 Kukjin Kim wrote:
Quoted 2 lines

This is the board specific file, so it seems ok.

Quoted 9 lines
Quoted 3 lines

I mean there are many espresso boards are having different exynos7 SoC. I mean exynos7-espresso cannot represent all of espresso boards.

Ah, I see, that makes sense.

We definitely need a top-level .dts file for each board that is different in a nondiscoverable way then.

Agreed.

And one more, at this moment just using exynos7 would be nice to us then if required, we could add any specific properties later.

Quoted 3 lines

If the mmc settings and possibly some other nodes (to be added later) are common across them, those can be in a board specific .dtsi file.

Yes, right.

Quoted 7 lines

For the memory node, I would actually expect that to be filled by the boot loader, so we could leave it out entirely. The same applies to the command line: the parts that are in there at the moment ( "console=ttySAC2,115200n8 root=/dev/ram0 ramdisk=16384 initrd=0x42000000,16M") clearly don't belong into a generic dts file and none of them should be set that way.

Hmm...yeah we need to use proper boot-loader but I think kernel needs having default memory property if boot loader doesn't have anything?

Quoted 13 lines

For the initial version, that would mean that the file comes down to having as its only contents

/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include "exynos7123.dtsi"
#include "exynos7-espresso.dtsi" // for the mmc nodes

/ {
       model = "Samsung ESPRESSO board based on EXYNOS7123";
       compatible = "samsung,espresso", "samsung,exynos7123", "samsung,exynos7";
};
Quoted 6 lines

One more thing I just noticed is the GPL statement in the dts files. Can we please change that to a permissive license in order to allow including it in non-GPL boot loaders and operating systems?

Dual GPL+MIT or GPL+BSD would make most sense here.

I need to check about that with license guy in my team ;)

Naveen, I'll have a look at the patch again.

Thanks,
Kukjin

#11 lore raw

PATCH v2 5/7 arm64: dts: Add initial device tree support for EXYNOS7

In reply to Naveen Krishna Chatradhi
Quoted 14 lines · Naveen Krishna Chatradhi

Add initial device tree nodes for EXYNOS7 SoC and board dts file to support Espresso board based on Exynos7 SoC.

---
 arch/arm64/boot/dts/Makefile                    |    1 +
 arch/arm64/boot/dts/exynos/exynos7-espresso.dts |   31 +++++
 arch/arm64/boot/dts/exynos/exynos7.dtsi         |  168 +++++++++++++++++++++++
 3 files changed, 200 insertions(+)
 create mode 100644 arch/arm64/boot/dts/exynos/exynos7-espresso.dts
 create mode 100644 arch/arm64/boot/dts/exynos/exynos7.dtsi

[...]

Quoted 13 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +7 -0
new file mode 100644
index 0000000..e593af55
@@ -0,0 +1,168 @@
+/*
+ * SAMSUNG EXYNOS7 SoC device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify

arch/arm64/boot/dts/exynos/exynos7.dtsi line 17

Quoted 10 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +10 -0
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <dt-bindings/clock/exynos7-clk.h>
+
+/ {
+	compatible = "samsung,exynos7";
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;

+ #address-cells = <1>; ?

Hmm...I can't see any 64-bit address here.

Quoted 2 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +2 -0
+	#size-cells = <2>;
+

[...]

arch/arm64/boot/dts/exynos/exynos7.dtsi line 74

Quoted 11 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +11 -0
+
+	soc: soc {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0 0 0x18000000>;
+
+		chipid at 10000000 {
+			compatible = "samsung,exynos4210-chipid";
+			reg = <0x10000000 0x100>;
+		};

Maybe this is not required? There is no check chipid in arm/arm64.

[...]

arch/arm64/boot/dts/exynos/exynos7.dtsi line 165

Quoted 6 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +6 -0
+		timer {
+			compatible = "arm,armv8-timer";
+			interrupts = <1 13 0xff01>,
+				     <1 14 0xff01>,
+				     <1 11 0xff01>,
+				     <1 10 0xff01>;

clock-frequency ?

[...]

- Kukjin

#12 lore raw

PATCH v2 5/7 arm64: dts: Add initial device tree support for EXYNOS7

Quoted 44 lines · On 9 September 2014 08:58, <[email protected]> wrote:
Quoted 14 lines · Naveen Krishna Chatradhi

Add initial device tree nodes for EXYNOS7 SoC and board dts file to support Espresso board based on Exynos7 SoC.

---
 arch/arm64/boot/dts/Makefile                    |    1 +
 arch/arm64/boot/dts/exynos/exynos7-espresso.dts |   31 +++++
 arch/arm64/boot/dts/exynos/exynos7.dtsi         |  168 +++++++++++++++++++++++
 3 files changed, 200 insertions(+)
 create mode 100644 arch/arm64/boot/dts/exynos/exynos7-espresso.dts
 create mode 100644 arch/arm64/boot/dts/exynos/exynos7.dtsi

[...]

Quoted 13 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +7 -0
new file mode 100644
index 0000000..e593af55
@@ -0,0 +1,168 @@
+/*
+ * SAMSUNG EXYNOS7 SoC device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *           http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify

arch/arm64/boot/dts/exynos/exynos7.dtsi line 17

Quoted 10 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +10 -0
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <dt-bindings/clock/exynos7-clk.h>
+
+/ {
+     compatible = "samsung,exynos7";
+     interrupt-parent = <&gic>;
+     #address-cells = <2>;

+ #address-cells = <1>; ?

Quoted 1 line

Hmm...I can't see any 64-bit address here.

All the SoC peripherals have been put into the soc node and ranges property in that node is used to convert 64-bit to 32-bit addresses. But since this is a 64-bit SoC, we use #address-cells as 2.

Quoted 6 lines
Quoted 3 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +2 -0
+     #size-cells = <2>;
+

[...]

Quoted 13 lines

arch/arm64/boot/dts/exynos/exynos7.dtsi line 74

Quoted 11 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +11 -0
+
+     soc: soc {
+             compatible = "simple-bus";
+             #address-cells = <1>;
+             #size-cells = <1>;
+             ranges = <0 0 0 0x18000000>;
+
+             chipid at 10000000 {
+                     compatible = "samsung,exynos4210-chipid";
+                     reg = <0x10000000 0x100>;
+             };

Maybe this is not required? There is no check chipid in arm/arm64.

This is only describing the hardware and it does not depend on linux using this information. And support for chip id can be used later for 64-bit Exynos platforms as well.

Quoted 11 lines

[...]

arch/arm64/boot/dts/exynos/exynos7.dtsi line 165

Quoted 6 lines
arch/arm64/boot/dts/exynos/exynos7.dtsi new file +6 -0
+             timer {
+                     compatible = "arm,armv8-timer";
+                     interrupts = <1 13 0xff01>,
+                                  <1 14 0xff01>,
+                                  <1 11 0xff01>,
+                                  <1 10 0xff01>;

clock-frequency ?

That is programmed by the bootloader / firmware.

Quoted 5 lines

[...]

- Kukjin

Thanks,

Signature · 2 lines
Shine bright,
(: Nav :)
#13 lore raw

PATCH v2 6/7 tty/serial: samsung: enable usage for 64-bit Exynos platforms

In reply to Naveen Krishna Chatradhi

Allow Samsung serial driver to be usable on Exynos 64-bit SoC based platforms.

---
 drivers/tty/serial/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/Kconfig +1 -1
index 26cec64..3383744 100644
@@ -220,7 +220,7 @@ config SERIAL_CLPS711X_CONSOLE
 
 config SERIAL_SAMSUNG
 	tristate "Samsung SoC serial support"
-	depends on PLAT_SAMSUNG
+	depends on PLAT_SAMSUNG || ARCH_EXYNOS
 	select SERIAL_CORE
 	help
 	  Support for the on-chip UARTs on the Samsung S3C24XX series CPUs,
Signature · 1 line
1.7.9.5
#14 lore raw

PATCH v2 7/7 arm64: exynos7: Enable ARMv8 based Exynos7 (SoC) support

In reply to Naveen Krishna Chatradhi

From: Alim Akhtar <[email protected]>

This patch adds the necessary Kconfig entries to enable support for the ARMv8 based Exynos7 SoC.

---
 arch/arm64/Kconfig |   12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/Kconfig +12 -0
index fd4e81a..b4d1dc2 100644
@@ -134,6 +134,18 @@ source "kernel/Kconfig.freezer"
 
 menu "Platform selection"
 
+config ARCH_EXYNOS
+	bool
+	help
+	  This enables support for Samsung Exynos SoC family
+
+config ARCH_EXYNOS7
+	bool "ARMv8 based Samsung Exynos7"
+	select ARCH_EXYNOS
+	select COMMON_CLK_SAMSUNG
+	help
+	  This enables support for Samsung Exynos7 SoC family
+
 config ARCH_VEXPRESS
 	bool "ARMv8 software model (Versatile Express)"
 	select ARCH_REQUIRE_GPIOLIB
Signature · 1 line
1.7.9.5
#15 lore raw

v2 cover arch: arm64: enable support for Samsung Exynos7 SoC

In reply to Naveen Krishna Chatradhi

Hi Naveen,

Quoted 3 lines · Naveen Krishna Chatradhi

Changes since v1:
- Reduced the number of features targetted for the initial platform support.

Are you going to reply to my comments to previous version?

Btw. My @samsung.com e-mail is no longer valid. Please use my private one for patches related to Samsung clocks and pin control drivers. Respective patch for MAINTAINERS file has been applied already.

Best regards,
Tomasz