* [PATCH 0/2] OMAP4: DT update for L2 controller and local timers
@ 2012-07-09 13:11 Santosh Shilimkar
2012-07-09 13:11 ` [PATCH 1/2] ARM: OMAP4: Add L2 Cache Controller in Device Tree Santosh Shilimkar
2012-07-09 13:11 ` [PATCH 2/2] ARM: OMAP4: Add local timer support for " Santosh Shilimkar
0 siblings, 2 replies; 5+ messages in thread
From: Santosh Shilimkar @ 2012-07-09 13:11 UTC (permalink / raw)
To: linux-arm-kernel
Couple of patches which updates the device tree support for OMAP4.
- Pl310 L2 cache controller DT support
- ARM cortex-A9 local timer DT support
Tested on OMAP4430 SDP.
Santosh Shilimkar (2):
ARM: OMAP4: Add L2 Cache Controller in Device Tree
ARM: OMAP4: Add local timer support for Device Tree
arch/arm/boot/dts/omap4.dtsi | 13 +++++++++++++
arch/arm/mach-omap2/omap4-common.c | 6 +++++-
arch/arm/mach-omap2/timer.c | 11 ++++++++---
3 files changed, 26 insertions(+), 4 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] ARM: OMAP4: Add L2 Cache Controller in Device Tree
2012-07-09 13:11 [PATCH 0/2] OMAP4: DT update for L2 controller and local timers Santosh Shilimkar
@ 2012-07-09 13:11 ` Santosh Shilimkar
2012-07-09 13:11 ` [PATCH 2/2] ARM: OMAP4: Add local timer support for " Santosh Shilimkar
1 sibling, 0 replies; 5+ messages in thread
From: Santosh Shilimkar @ 2012-07-09 13:11 UTC (permalink / raw)
To: linux-arm-kernel
This provides PL310 Level 2 Cache Controller Device Tree
support for OMAP4 based devices.
Cc: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
arch/arm/boot/dts/omap4.dtsi | 7 +++++++
arch/arm/mach-omap2/omap4-common.c | 6 +++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 359c497..57f7cd4 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -36,6 +36,13 @@
};
};
+ L2: l2-cache-controller {
+ compatible = "arm,pl310-cache";
+ reg = <0x48242000 0x1000>;
+ cache-unified;
+ cache-level = <2>;
+ };
+
/*
* The soc node represents the soc top level view. It is uses for IPs
* that are not memory mapped in the MPU view or for the MPU itself.
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index a8161e5..40bb560 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -16,6 +16,7 @@
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/memblock.h>
+#include <linux/of.h>
#include <asm/hardware/gic.h>
#include <asm/hardware/cache-l2x0.h>
@@ -169,7 +170,10 @@ static int __init omap_l2_cache_init(void)
/* Enable PL310 L2 Cache controller */
omap_smc1(0x102, 0x1);
- l2x0_init(l2cache_base, aux_ctrl, L2X0_AUX_CTRL_MASK);
+ if (of_have_populated_dt())
+ l2x0_of_init(aux_ctrl, L2X0_AUX_CTRL_MASK);
+ else
+ l2x0_init(l2cache_base, aux_ctrl, L2X0_AUX_CTRL_MASK);
/*
* Override default outer_cache.disable with a OMAP4
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] ARM: OMAP4: Add local timer support for Device Tree
2012-07-09 13:11 [PATCH 0/2] OMAP4: DT update for L2 controller and local timers Santosh Shilimkar
2012-07-09 13:11 ` [PATCH 1/2] ARM: OMAP4: Add L2 Cache Controller in Device Tree Santosh Shilimkar
@ 2012-07-09 13:11 ` Santosh Shilimkar
2012-07-09 13:15 ` Tony Lindgren
1 sibling, 1 reply; 5+ messages in thread
From: Santosh Shilimkar @ 2012-07-09 13:11 UTC (permalink / raw)
To: linux-arm-kernel
Add cortex-a9 local timer support for all OMAP4 based
SOCs using DT.
Cc: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
arch/arm/boot/dts/omap4.dtsi | 6 ++++++
arch/arm/mach-omap2/timer.c | 11 ++++++++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 57f7cd4..8504397 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -43,6 +43,12 @@
cache-level = <2>;
};
+ local-timer {
+ compatible = "arm,cortex-a9-twd-timer";
+ reg = <0x48240600 0x20>;
+ interrupts = <1 13 0x304>;
+ };
+
/*
* The soc node represents the soc top level view. It is uses for IPs
* that are not memory mapped in the MPU view or for the MPU itself.
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 840929b..dbdd9a6 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -36,6 +36,7 @@
#include <linux/clocksource.h>
#include <linux/clockchips.h>
#include <linux/slab.h>
+#include <linux/of.h>
#include <asm/mach/time.h>
#include <plat/dmtimer.h>
@@ -384,9 +385,13 @@ static void __init omap4_timer_init(void)
if (omap_rev() != OMAP4430_REV_ES1_0) {
int err;
- err = twd_local_timer_register(&twd_local_timer);
- if (err)
- pr_err("twd_local_timer_register failed %d\n", err);
+ if (of_have_populated_dt()) {
+ twd_local_timer_of_register();
+ } else {
+ err = twd_local_timer_register(&twd_local_timer);
+ if (err)
+ pr_err("twd_local_timer_register failed %d\n", err);
+ }
}
#endif
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] ARM: OMAP4: Add local timer support for Device Tree
2012-07-09 13:11 ` [PATCH 2/2] ARM: OMAP4: Add local timer support for " Santosh Shilimkar
@ 2012-07-09 13:15 ` Tony Lindgren
2012-07-09 13:25 ` Shilimkar, Santosh
0 siblings, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2012-07-09 13:15 UTC (permalink / raw)
To: linux-arm-kernel
* Santosh Shilimkar <santosh.shilimkar@ti.com> [120709 06:16]:
> Add cortex-a9 local timer support for all OMAP4 based
> SOCs using DT.
...
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -36,6 +36,7 @@
> #include <linux/clocksource.h>
> #include <linux/clockchips.h>
> #include <linux/slab.h>
> +#include <linux/of.h>
>
> #include <asm/mach/time.h>
> #include <plat/dmtimer.h>
> @@ -384,9 +385,13 @@ static void __init omap4_timer_init(void)
> if (omap_rev() != OMAP4430_REV_ES1_0) {
> int err;
>
> - err = twd_local_timer_register(&twd_local_timer);
> - if (err)
> - pr_err("twd_local_timer_register failed %d\n", err);
> + if (of_have_populated_dt()) {
> + twd_local_timer_of_register();
> + } else {
> + err = twd_local_timer_register(&twd_local_timer);
> + if (err)
> + pr_err("twd_local_timer_register failed %d\n", err);
> + }
> }
> #endif
> }
How about just return after twd_local_timer_of_register() instead?
That avoids nesting the code further.
Tony
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 2/2] ARM: OMAP4: Add local timer support for Device Tree
2012-07-09 13:15 ` Tony Lindgren
@ 2012-07-09 13:25 ` Shilimkar, Santosh
0 siblings, 0 replies; 5+ messages in thread
From: Shilimkar, Santosh @ 2012-07-09 13:25 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jul 9, 2012 at 6:45 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Santosh Shilimkar <santosh.shilimkar@ti.com> [120709 06:16]:
>> Add cortex-a9 local timer support for all OMAP4 based
>> SOCs using DT.
> ...
>
>> --- a/arch/arm/mach-omap2/timer.c
>> +++ b/arch/arm/mach-omap2/timer.c
>> @@ -36,6 +36,7 @@
>> #include <linux/clocksource.h>
>> #include <linux/clockchips.h>
>> #include <linux/slab.h>
>> +#include <linux/of.h>
>>
>> #include <asm/mach/time.h>
>> #include <plat/dmtimer.h>
>> @@ -384,9 +385,13 @@ static void __init omap4_timer_init(void)
>> if (omap_rev() != OMAP4430_REV_ES1_0) {
>> int err;
>>
>> - err = twd_local_timer_register(&twd_local_timer);
>> - if (err)
>> - pr_err("twd_local_timer_register failed %d\n", err);
>> + if (of_have_populated_dt()) {
>> + twd_local_timer_of_register();
>> + } else {
>> + err = twd_local_timer_register(&twd_local_timer);
>> + if (err)
>> + pr_err("twd_local_timer_register failed %d\n", err);
>> + }
>> }
>> #endif
>> }
>
> How about just return after twd_local_timer_of_register() instead?
> That avoids nesting the code further.
>
Yep. Make sense. Will consider that in next version.
Regards
Santosh
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-07-09 13:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-09 13:11 [PATCH 0/2] OMAP4: DT update for L2 controller and local timers Santosh Shilimkar
2012-07-09 13:11 ` [PATCH 1/2] ARM: OMAP4: Add L2 Cache Controller in Device Tree Santosh Shilimkar
2012-07-09 13:11 ` [PATCH 2/2] ARM: OMAP4: Add local timer support for " Santosh Shilimkar
2012-07-09 13:15 ` Tony Lindgren
2012-07-09 13:25 ` Shilimkar, Santosh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox