Skip to contentSkip to conversation

davinci: device tree - small simplifications

PATCH New David Lechner 2 participants 6 messages Feb 29, 2016 – Apr 12, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover davinci: device tree - small simplifications

I have been trying out device tree with mach-davinci. Here are some small simplifications that I have made.

I would also like to know if anyone is working on getting the clocks and related soc devices (pll and psc) into device tree as well.

David Lechner (3):
arm: davinci: simplify call to of populate
arm: davinci: remove unused DA8XX_NUM_UARTS
arm: davinci: use IRQCHIP_DECLARE for cp_intc

 arch/arm/mach-davinci/cp_intc.c  |  3 +++
 arch/arm/mach-davinci/da8xx-dt.c | 17 +----------------
 2 files changed, 4 insertions(+), 16 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/3 arm: davinci: simplify call to of populate

Take advantage of of_platoform_default_populate convience function.

---
 arch/arm/mach-davinci/da8xx-dt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/arm/mach-davinci/da8xx-dt.c +1 -3
index c4b5808..358ab34 100644
@@ -54,9 +54,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 
 static void __init da850_init_machine(void)
 {
-	of_platform_populate(NULL, of_default_bus_match_table,
-			     da850_auxdata_lookup, NULL);
-
+	of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
 }
 
 static const char *const da850_boards_compat[] __initconst = {
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 arm: davinci: remove unused DA8XX_NUM_UARTS

In reply to David Lechner

DA8X_NUM_UARTS not used in the code anywhere and should be determined by DT anyway.

---
 arch/arm/mach-davinci/da8xx-dt.c | 2 --
 1 file changed, 2 deletions(-)
arch/arm/mach-davinci/da8xx-dt.c +0 -2
index 358ab34..08880e7 100644
@@ -18,8 +18,6 @@
 #include "cp_intc.h"
 #include <mach/da8xx.h>
 
-#define DA8XX_NUM_UARTS	3
-
 static const struct of_device_id const da8xx_irq_match[] __initconst = {
 	{ .compatible = "ti,cp-intc", .data = cp_intc_of_init, },
 	{ }
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/3 arm: davinci: use IRQCHIP_DECLARE for cp_intc

In reply to David Lechner

Remove boilerplate code by using IRQCHIP_DECLARE macro.

---
 arch/arm/mach-davinci/cp_intc.c  |  3 +++
 arch/arm/mach-davinci/da8xx-dt.c | 11 -----------
 2 files changed, 3 insertions(+), 11 deletions(-)
arch/arm/mach-davinci/cp_intc.c +3 -0
index 1a68d24..94085d2 100644
@@ -12,6 +12,7 @@
 #include <linux/export.h>
 #include <linux/init.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/irqdomain.h>
 #include <linux/io.h>
 #include <linux/of.h>
@@ -210,3 +211,5 @@ void __init cp_intc_init(void)
 {
 	cp_intc_of_init(NULL, NULL);
 }
+
+IRQCHIP_DECLARE(cp_intc, "ti,cp-intc", cp_intc_of_init);
arch/arm/mach-davinci/da8xx-dt.c +0 -11
index 08880e7..fac6d43 100644
@@ -18,16 +18,6 @@
 #include "cp_intc.h"
 #include <mach/da8xx.h>
 
-static const struct of_device_id const da8xx_irq_match[] __initconst = {
-	{ .compatible = "ti,cp-intc", .data = cp_intc_of_init, },
-	{ }
-};
-
-static void __init da8xx_init_irq(void)
-{
-	of_irq_init(da8xx_irq_match);
-}
-
 static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
 	OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "davinci-wdt", NULL),
@@ -64,7 +54,6 @@ static const char *const da850_boards_compat[] __initconst = {
 
 DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x")
 	.map_io		= da850_init,
-	.init_irq	= da8xx_init_irq,
 	.init_time	= davinci_timer_init,
 	.init_machine	= da850_init_machine,
 	.dt_compat	= da850_boards_compat,
Signature · 1 line
1.9.1
#4 lore raw

cover davinci: device tree - small simplifications

In reply to David Lechner

Hi David,

Quoted 2 lines · David Lechner

I have been trying out device tree with mach-davinci. Here are some small simplifications that I have made.

Thanks! I will take a look. I have already sent my pull request for v4.6 so these would now be targeted to v4.7

Quoted 2 lines

I would also like to know if anyone is working on getting the clocks and related soc devices (pll and psc) into device tree as well.

Not to my knowledge. As you might have noticed, keystone platform has a (very similar) psc and has a common clock framework driver for that in mainline. The goal should be to reuse that for DaVinci.

Thanks,
Sekhar

#5 lore raw

cover davinci: device tree - small simplifications

Quoted 8 lines · Sekhar Nori

Hi David,

Quoted 2 lines · David Lechner

I have been trying out device tree with mach-davinci. Here are some small simplifications that I have made.

Thanks! I will take a look. I have already sent my pull request for v4.6 so these would now be targeted to v4.7

All applied for v4.7. I capitalized the "arm: " prefix while applying.

Thanks,
Sekhar