All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 0/3] clk: at91: Enhance the peripheral clock and align compatibles
@ 2017-04-14  6:53 Wenyou Yang
  2017-04-14  6:53 ` [U-Boot] [PATCH v4 1/3] clk: at91: Enhance the peripheral clock Wenyou Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Wenyou Yang @ 2017-04-14  6:53 UTC (permalink / raw)
  To: u-boot

The purpose of the patch set is to enhance the peripheral clock to
support both at9sam9x5's and at91rm9200's peripheral clock, and align
the clk-master's and at91-pmc's compatibles with kernel.

Changes in v4:
 - Incorporate [PATCH v2] clk: at91: pmc: align the at91 pmc's compatibles.
 - Rebase on the master branch (22e10be45) of u-boot-dm git tree.
 - Add Reviewed-by tag.

Changes in v3:
 - Rebase on v2017.03.

Changes in v2:
 - Use an enum with a descriptive name to denote the clock type.
 - Add the Reviewed-by tags.

Wenyou Yang (3):
  clk: at91: Enhance the peripheral clock
  clk: at91: Align clk-master compatibles with kernel
  clk: at91: Align the at91 pmc's compatibles

 drivers/clk/at91/clk-master.c     |  1 +
 drivers/clk/at91/clk-peripheral.c | 29 ++++++++++++++++++++++++++---
 drivers/clk/at91/pmc.c            |  6 ++++++
 3 files changed, 33 insertions(+), 3 deletions(-)

-- 
2.11.0

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

* [U-Boot] [PATCH v4 1/3] clk: at91: Enhance the peripheral clock
  2017-04-14  6:53 [U-Boot] [PATCH v4 0/3] clk: at91: Enhance the peripheral clock and align compatibles Wenyou Yang
@ 2017-04-14  6:53 ` Wenyou Yang
  2017-04-22  3:07   ` sjg at google.com
  2017-04-14  6:53 ` [U-Boot] [PATCH v4 2/3] clk: at91: Align clk-master compatibles with kernel Wenyou Yang
  2017-04-14  6:53 ` [U-Boot] [PATCH v4 3/3] clk: at91: Align the at91 pmc's compatibles Wenyou Yang
  2 siblings, 1 reply; 7+ messages in thread
From: Wenyou Yang @ 2017-04-14  6:53 UTC (permalink / raw)
  To: u-boot

Enhance the peripheral clock to support both at9sam9x5's and
at91rm9200's peripheral clock via the different compatibles.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v4: None
Changes in v3: None
Changes in v2:
 - Use an enum with a descriptive name to denote the clock type.

 drivers/clk/at91/clk-peripheral.c | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c
index e1ed447133..62fabe304d 100644
--- a/drivers/clk/at91/clk-peripheral.c
+++ b/drivers/clk/at91/clk-peripheral.c
@@ -16,6 +16,10 @@
 #define PERIPHERAL_ID_MAX	31
 #define PERIPHERAL_MASK(id)	(1 << ((id) & PERIPHERAL_ID_MAX))
 
+enum periph_clk_type {
+	CLK_PERIPH_AT91RM9200 = 0,
+	CLK_PERIPH_AT91SAM9X5,
+};
 /**
  * sam9x5_periph_clk_bind() - for the periph clock driver
  * Recursively bind its children as clk devices.
@@ -28,7 +32,14 @@ static int sam9x5_periph_clk_bind(struct udevice *dev)
 }
 
 static const struct udevice_id sam9x5_periph_clk_match[] = {
-	{ .compatible = "atmel,at91sam9x5-clk-peripheral" },
+	{
+		.compatible = "atmel,at91rm9200-clk-peripheral",
+		.data = CLK_PERIPH_AT91RM9200,
+	},
+	{
+		.compatible = "atmel,at91sam9x5-clk-peripheral",
+		.data = CLK_PERIPH_AT91SAM9X5,
+	},
 	{}
 };
 
@@ -45,12 +56,24 @@ static int periph_clk_enable(struct clk *clk)
 {
 	struct pmc_platdata *plat = dev_get_platdata(clk->dev);
 	struct at91_pmc *pmc = plat->reg_base;
+	enum periph_clk_type clk_type;
+	void *addr;
 
 	if (clk->id < PERIPHERAL_ID_MIN)
 		return -1;
 
-	writel(clk->id & AT91_PMC_PCR_PID_MASK, &pmc->pcr);
-	setbits_le32(&pmc->pcr, AT91_PMC_PCR_CMD_WRITE | AT91_PMC_PCR_EN);
+	clk_type = dev_get_driver_data(dev_get_parent(clk->dev));
+	if (clk_type == CLK_PERIPH_AT91RM9200) {
+		addr = &pmc->pcer;
+		if (clk->id > PERIPHERAL_ID_MAX)
+			addr = &pmc->pcer1;
+
+		setbits_le32(addr, PERIPHERAL_MASK(clk->id));
+	} else {
+		writel(clk->id & AT91_PMC_PCR_PID_MASK, &pmc->pcr);
+		setbits_le32(&pmc->pcr,
+			     AT91_PMC_PCR_CMD_WRITE | AT91_PMC_PCR_EN);
+	}
 
 	return 0;
 }
-- 
2.11.0

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

* [U-Boot] [PATCH v4 2/3] clk: at91: Align clk-master compatibles with kernel
  2017-04-14  6:53 [U-Boot] [PATCH v4 0/3] clk: at91: Enhance the peripheral clock and align compatibles Wenyou Yang
  2017-04-14  6:53 ` [U-Boot] [PATCH v4 1/3] clk: at91: Enhance the peripheral clock Wenyou Yang
@ 2017-04-14  6:53 ` Wenyou Yang
  2017-04-22  3:07   ` sjg at google.com
  2017-04-14  6:53 ` [U-Boot] [PATCH v4 3/3] clk: at91: Align the at91 pmc's compatibles Wenyou Yang
  2 siblings, 1 reply; 7+ messages in thread
From: Wenyou Yang @ 2017-04-14  6:53 UTC (permalink / raw)
  To: u-boot

Add the compatible "atmel,at91rm9200-clk-master" to align with
the kernel.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v4: None
Changes in v3: None
Changes in v2:
 - Add the Reviewed-by tags.

 drivers/clk/at91/clk-master.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c
index 284b248271..72d0a739f1 100644
--- a/drivers/clk/at91/clk-master.c
+++ b/drivers/clk/at91/clk-master.c
@@ -21,6 +21,7 @@ static struct clk_ops at91_master_clk_ops = {
 };
 
 static const struct udevice_id at91_master_clk_match[] = {
+	{ .compatible = "atmel,at91rm9200-clk-master" },
 	{ .compatible = "atmel,at91sam9x5-clk-master" },
 	{}
 };
-- 
2.11.0

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

* [U-Boot] [PATCH v4 3/3] clk: at91: Align the at91 pmc's compatibles
  2017-04-14  6:53 [U-Boot] [PATCH v4 0/3] clk: at91: Enhance the peripheral clock and align compatibles Wenyou Yang
  2017-04-14  6:53 ` [U-Boot] [PATCH v4 1/3] clk: at91: Enhance the peripheral clock Wenyou Yang
  2017-04-14  6:53 ` [U-Boot] [PATCH v4 2/3] clk: at91: Align clk-master compatibles with kernel Wenyou Yang
@ 2017-04-14  6:53 ` Wenyou Yang
  2017-04-22  3:07   ` sjg at google.com
  2 siblings, 1 reply; 7+ messages in thread
From: Wenyou Yang @ 2017-04-14  6:53 UTC (permalink / raw)
  To: u-boot

Align the at91 pmc's compatibles with kernel.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
---

Changes in v4:
 - Incorporate [PATCH v2] clk: at91: pmc: align the at91 pmc's compatibles.
 - Rebase on the master branch (22e10be45) of u-boot-dm git tree.
 - Add Reviewed-by tag.

Changes in v3:
 - Rebase on v2017.03.

Changes in v2: None

 drivers/clk/at91/pmc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
index fcd693a2f6..72d52c5818 100644
--- a/drivers/clk/at91/pmc.c
+++ b/drivers/clk/at91/pmc.c
@@ -16,6 +16,12 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 static const struct udevice_id at91_pmc_match[] = {
+	{ .compatible = "atmel,at91rm9200-pmc" },
+	{ .compatible = "atmel,at91sam9260-pmc" },
+	{ .compatible = "atmel,at91sam9g45-pmc" },
+	{ .compatible = "atmel,at91sam9n12-pmc" },
+	{ .compatible = "atmel,at91sam9x5-pmc" },
+	{ .compatible = "atmel,sama5d3-pmc" },
 	{ .compatible = "atmel,sama5d2-pmc" },
 	{}
 };
-- 
2.11.0

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

* [U-Boot] [PATCH v4 3/3] clk: at91: Align the at91 pmc's compatibles
  2017-04-14  6:53 ` [U-Boot] [PATCH v4 3/3] clk: at91: Align the at91 pmc's compatibles Wenyou Yang
@ 2017-04-22  3:07   ` sjg at google.com
  0 siblings, 0 replies; 7+ messages in thread
From: sjg at google.com @ 2017-04-22  3:07 UTC (permalink / raw)
  To: u-boot

Align the at91 pmc's compatibles with kernel.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
---

Changes in v4:
 - Incorporate [PATCH v2] clk: at91: pmc: align the at91 pmc's compatibles.
 - Rebase on the master branch (22e10be45) of u-boot-dm git tree.
 - Add Reviewed-by tag.

Changes in v3:
 - Rebase on v2017.03.

Changes in v2: None

 drivers/clk/at91/pmc.c | 6 ++++++
 1 file changed, 6 insertions(+)

Applied to u-boot-dm/next, thanks!

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

* [U-Boot] [PATCH v4 2/3] clk: at91: Align clk-master compatibles with kernel
  2017-04-14  6:53 ` [U-Boot] [PATCH v4 2/3] clk: at91: Align clk-master compatibles with kernel Wenyou Yang
@ 2017-04-22  3:07   ` sjg at google.com
  0 siblings, 0 replies; 7+ messages in thread
From: sjg at google.com @ 2017-04-22  3:07 UTC (permalink / raw)
  To: u-boot

Add the compatible "atmel,at91rm9200-clk-master" to align with
the kernel.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v4: None
Changes in v3: None
Changes in v2:
 - Add the Reviewed-by tags.

 drivers/clk/at91/clk-master.c | 1 +
 1 file changed, 1 insertion(+)

Applied to u-boot-dm/next, thanks!

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

* [U-Boot] [PATCH v4 1/3] clk: at91: Enhance the peripheral clock
  2017-04-14  6:53 ` [U-Boot] [PATCH v4 1/3] clk: at91: Enhance the peripheral clock Wenyou Yang
@ 2017-04-22  3:07   ` sjg at google.com
  0 siblings, 0 replies; 7+ messages in thread
From: sjg at google.com @ 2017-04-22  3:07 UTC (permalink / raw)
  To: u-boot

Enhance the peripheral clock to support both at9sam9x5's and
at91rm9200's peripheral clock via the different compatibles.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v4: None
Changes in v3: None
Changes in v2:
 - Use an enum with a descriptive name to denote the clock type.

 drivers/clk/at91/clk-peripheral.c | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

Applied to u-boot-dm/next, thanks!

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

end of thread, other threads:[~2017-04-22  3:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-14  6:53 [U-Boot] [PATCH v4 0/3] clk: at91: Enhance the peripheral clock and align compatibles Wenyou Yang
2017-04-14  6:53 ` [U-Boot] [PATCH v4 1/3] clk: at91: Enhance the peripheral clock Wenyou Yang
2017-04-22  3:07   ` sjg at google.com
2017-04-14  6:53 ` [U-Boot] [PATCH v4 2/3] clk: at91: Align clk-master compatibles with kernel Wenyou Yang
2017-04-22  3:07   ` sjg at google.com
2017-04-14  6:53 ` [U-Boot] [PATCH v4 3/3] clk: at91: Align the at91 pmc's compatibles Wenyou Yang
2017-04-22  3:07   ` sjg at google.com

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.