linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/8] ARM: AM43 (OMAP2+) boot support
@ 2013-02-18  6:28 Afzal Mohammed
       [not found] ` <a7f62b8580aa4b33d5658f4f03371a453adaea9b.1361166003.git.afzal@ti.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Afzal Mohammed @ 2013-02-18  6:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

This series adds minimal support to boot Linux on platforms having
AM43 based SoC's.

This is being sent as an RFC to seek opinion about modification in
twd to register percpu local timer clock event for scheduler tick in
the case of one core SMP.

AM43 SoC's are based on ARM Cortex-A9. It is an ARM Cortex-A9 SMP
configuration with one core (not uniprocessor configuration). AM43 is
similar to AM335x in it's peripheral capabilities, with many of the
peripheral register mapping's similar like that of uart.

AM43 is in pre-silicon stage and currently there are no public
documents.

This series has been tested on a pre-silicon platform that emulates
AM43 SoC, changes proposed here are minimal - to get it booting.
Kernel was directly run without the help of bootloader - Images were
directly loaded onto a pre-initialized RAM and ARM registers updated
as required for booting.

Changes have been made over linux-next (next-20130213) with three "OF"
related reverts (which otherwise causes problem in other platforms
also) and compiled with omap2plus_defconfig. Multiplatform option was
enabled, while most of CONFIG options were deselected for a faster
boot. Beagle bone boots as earlier with these changes.

An interesting observation is that it may be possible to boot this
platform to console without any platform specific modification to
proper Kernel (by that I mean excluding DT sources) using Arnd's,

"[PATCH,RFC] default machine descriptor for multiplatform",

along with a "CLOCKSOURCE_OF_DECLARE" for smp twd.

But later on to make SoC do any really useful work or to get done
things that the SoC is meant to do, platform changes like omap-hwmod,
handling power management, clock tree, detecting SoC capabilities etc
would have to be made, necessitating DT_MACHINE_START at least in
the foreseeable future.

Patch - 8 that makes AM43 boot on pre-silicon platform would be
replaced later by a one for original board.

Last but not least, thanks to Ankur Kishore <a-kishore@ti.com>
(who first made Linux to boot on AM43) for all the help that made
Linux bringup easier.

Regards
Afzal

Afzal Mohammed (8):
  ARM: localtimer: return percpu clkevt on register
  ARM: twd: register clock event for 1 core SMP
  ARM: twd: clock rate from DT (if no DT clk tree)
  ARM: am33xx: ll debug config help
  ARM: OMAP2+: am43: Kconfig
  ARM: OMAP2+: am43: basic dt support
  ARM: dts: am4372: initial support
  ARM: dts: am43-pre-silicon support

 Documentation/devicetree/bindings/arm/twd.txt |  7 +++-
 arch/arm/Kconfig.debug                        |  3 ++
 arch/arm/boot/dts/Makefile                    |  3 +-
 arch/arm/boot/dts/am43-pre-silicon.dts        | 31 +++++++++++++++
 arch/arm/boot/dts/am4372.dtsi                 | 55 +++++++++++++++++++++++++++
 arch/arm/include/asm/localtimer.h             |  7 ++--
 arch/arm/kernel/smp.c                         |  8 ++--
 arch/arm/kernel/smp_twd.c                     | 16 +++++++-
 arch/arm/mach-omap2/Kconfig                   | 11 ++++++
 arch/arm/mach-omap2/board-generic.c           | 18 +++++++++
 10 files changed, 148 insertions(+), 11 deletions(-)
 create mode 100644 arch/arm/boot/dts/am43-pre-silicon.dts
 create mode 100644 arch/arm/boot/dts/am4372.dtsi

-- 
1.7.12

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

* [RFC 2/8] ARM: twd: register clock event for 1 core SMP
       [not found] ` <a7f62b8580aa4b33d5658f4f03371a453adaea9b.1361166003.git.afzal@ti.com>
@ 2013-02-18 13:47   ` Rob Herring
  2013-02-19  8:00     ` Mohammed, Afzal
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2013-02-18 13:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/18/2013 12:30 AM, Afzal Mohammed wrote:
> Register percpu local timer for scheduler tick in the case of one core
> SMP configuration. In other cases - secondary cpu's as well as boot
> cpu's having more than one core, this is being registered as per
> existing boot flow, with a difference that they happens after delay
> calibration. Registering the clock for tick in case of one core should
> be done before Kernel calibrates delay (this is required to boot,
> unless local timer is the only one registered for tick). Registering
> twd local timer at init_time (which platforms are doing now) helps
> achieve that with the proposed change.
> 
> This helps in an almost booting Kernel (minimal) by only relying on
> ARM parts for an A9 one core SMP.
> 
> Signed-off-by: Afzal Mohammed <afzal@ti.com>
> ---
>  arch/arm/kernel/smp_twd.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
> index 616268c..118f4f2 100644
> --- a/arch/arm/kernel/smp_twd.c
> +++ b/arch/arm/kernel/smp_twd.c
> @@ -335,6 +335,9 @@ static int __init twd_local_timer_common_register(struct device_node *np)
>  
>  	twd_get_clock(np);
>  
> +	if (num_possible_cpus() == 1)
> +		twd_timer_setup(evt);
> +

Shouldn't this be fixed in the core code, so the same issue is fixed for
all timers?

Rob

>  	return 0;
>  
>  out_irq:
> 

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

* [RFC 2/8] ARM: twd: register clock event for 1 core SMP
  2013-02-18 13:47   ` [RFC 2/8] ARM: twd: register clock event for 1 core SMP Rob Herring
@ 2013-02-19  8:00     ` Mohammed, Afzal
  0 siblings, 0 replies; 3+ messages in thread
From: Mohammed, Afzal @ 2013-02-19  8:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Rob,

On Mon, Feb 18, 2013 at 19:17:29, Rob Herring wrote:
> On 02/18/2013 12:30 AM, Afzal Mohammed wrote:

> > Register percpu local timer for scheduler tick in the case of one core
> > SMP configuration. In other cases - secondary cpu's as well as boot
> > cpu's having more than one core, this is being registered as per
> > existing boot flow, with a difference that they happens after delay
> > calibration. Registering the clock for tick in case of one core should
> > be done before Kernel calibrates delay (this is required to boot,
> > unless local timer is the only one registered for tick). Registering
> > twd local timer at init_time (which platforms are doing now) helps
> > achieve that with the proposed change.
> > 
> > This helps in an almost booting Kernel (minimal) by only relying on
> > ARM parts for an A9 one core SMP.

> >  arch/arm/kernel/smp_twd.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
> > index 616268c..118f4f2 100644
> > --- a/arch/arm/kernel/smp_twd.c
> > +++ b/arch/arm/kernel/smp_twd.c
> > @@ -335,6 +335,9 @@ static int __init twd_local_timer_common_register(struct device_node *np)
> >  
> >  	twd_get_clock(np);
> >  
> > +	if (num_possible_cpus() == 1)
> > +		twd_timer_setup(evt);
> > +

> Shouldn't this be fixed in the core code, so the same issue is fixed for
> all timers?

Is the following that you had in mind ? (with it, this patch as well as
1/8 would not be required),

diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index d3a22be..2b6417d 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -42,6 +42,8 @@ void handle_IPI(int ipinr, struct pt_regs *regs);
  */
 extern void smp_init_cpus(void);
 
+extern void smp_monocore_timer_setup(void);
+
 
 /*
  * Provide a function to raise an IPI cross call on CPUs in callmap.
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 5f73f70..7431b77 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -504,6 +504,15 @@ int local_timer_register(struct local_timer_ops *ops)
 }
 #endif
 
+void __init smp_monocore_timer_setup(void)
+{
+       unsigned int cpu = smp_processor_id();
+       struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
+
+       if (!lt_ops)
+               lt_ops->setup(evt);
+}
+
 static void __cpuinit percpu_timer_setup(void)
 {
        unsigned int cpu = smp_processor_id();
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 955d92d..eb023ee 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -116,5 +116,6 @@ int __init register_persistent_clock(clock_access_fn read_boot,
 void __init time_init(void)
 {
        machine_desc->init_time();
+       smp_monocore_timer_setup();
        sched_clock_postinit();
 }

Regards
Afzal

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

end of thread, other threads:[~2013-02-19  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-18  6:28 [RFC 0/8] ARM: AM43 (OMAP2+) boot support Afzal Mohammed
     [not found] ` <a7f62b8580aa4b33d5658f4f03371a453adaea9b.1361166003.git.afzal@ti.com>
2013-02-18 13:47   ` [RFC 2/8] ARM: twd: register clock event for 1 core SMP Rob Herring
2013-02-19  8:00     ` Mohammed, Afzal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).