All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "Marcin Kuśka" <marckuska@gmail.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Cortex-a9 - please fix xenomai-fix-lfs-issue.patch
Date: Thu, 06 Sep 2012 10:27:44 +0200	[thread overview]
Message-ID: <50485E80.6050800@xenomai.org> (raw)
In-Reply-To: <CAHue_TUfY4f4CdCXyEYQ5mPFNiCazwZLgv9yy29W5r78tfftYA@mail.gmail.com>

On 09/06/2012 10:00 AM, Marcin Kuśka wrote:
>> Well, maybe some kernel debug option causes an issue.
>>
> 
>> Please try disabling oprofile, tracepoints and profiling.
>>
> 
> oprofile and profiling disabled - tracepoints not set
> 
> Never tested that on ARM, always run with VMSPLIT_3G.
>>
> 
> Changed.
> 
> 
>> Disable FTRACE. You should also remove all these kernel debugging
>> options, they probably have nothing to do with the issue you are seeing.
>>
> 
> ftrace disabled and all debug options also.
> 
> After disabling all the debugs the xeno-test with a dohell test looks like
> this:

Like what, no kernel message ? I guess you should re-enable the debug
then. And please do not forget what I asked you:
- what of the SLAB issue?
- what of the disassembly of the address where the fault happens?

> 
> As you said "A Cortex-A9 (in MP mode) should use the "global timer" clock
> source," but in the startup log the twd_timer_setup return a "no clock
> found" message.
> 
> The code in smp_twd.c:
> 
> if (twd_clk == NULL) {
>         twd_clk = clk_get(NULL, "smp_twd");
>         if (IS_ERR(twd_clk))
>             pr_warn("%s: no clock found\n", __func__);
>         else
>             clk_enable(twd_clk);
>     }
> 
> That's probably because the clock is not registered in v2m.c (as I suppose
> it should be).

That is a non fatal error, it simply results in an imprecise timer
frequency, but the system works.

> The initialization function looks like this:
> 
> static void __init v2m_timer_init(void)
> {
>     u32 scctrl;
> 
>     /* Select 1MHz TIMCLK as the reference clock for SP804 timers */
>     scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL));
>     scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK;
>     scctrl |= SCCTRL_TIMEREN1SEL_TIMCLK;
>     writel(scctrl, MMIO_P2V(V2M_SYSCTL + SCCTRL));
> 
>     writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL);
>     writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL);
> 
>     sp804_clocksource_init(MMIO_P2V(V2M_TIMER1), V2M_TIMER1, "v2m-timer1");
>     sp804_clockevents_init(MMIO_P2V(V2M_TIMER0),
> IRQ_V2M_TIMER0,"v2m-timer0");
> }
> 
> I'm not sure about what addresses should I pass to sp804_clocksource_init()
> and sp804_clockevents_init() functions. I tried with v2m-timer2 but it
> didn't work.

The first address is the virtual address of the timer registers base the
result of ioremap or of a static mapping by iotable_init), and the
second is the physical address for the same address. Normally the I-pipe
core code is already modified to call these functions with the right
parameter, but since this code is untested, you are right to double
check it.

> 
> I also added to v2m.c following code:
> 
> static struct clk smp_twd = {
>     .rate   = 2000000,
> };

2MHz ? Normally the clock runs at half the core frequency, your ARM core
is running at 4MHz?

> I following the I-pipe-core:ArmPorting document.

Good, what about the call to gt_setup ?

http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#The_Cortex_A9_case

It will allow you to use the global timer as clocksource instead of the
sp804. In order to check the tsc emulation, you can run the xenomai
regression test named "tsc".

-- 
					    Gilles.


  reply	other threads:[~2012-09-06  8:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 14:43 [Xenomai] Cortex-a9 - please fix xenomai-fix-lfs-issue.patch Marcin Kuśka
2012-08-08 16:44 ` Gilles Chanteperdrix
2012-08-08 18:54 ` Gilles Chanteperdrix
2012-08-21 14:05   ` Marcin Kuśka
2012-08-21 14:16     ` Gilles Chanteperdrix
2012-09-03 17:58       ` Marcin Kuśka
2012-09-03 18:04         ` Marcin Kuśka
2012-09-03 19:24           ` Gilles Chanteperdrix
2012-09-03 23:04             ` Marcin Kuśka
2012-09-03 23:31               ` Gilles Chanteperdrix
2012-09-06  8:00                 ` Marcin Kuśka
2012-09-06  8:27                   ` Gilles Chanteperdrix [this message]
2012-09-06 13:31                     ` Marcin Kuśka
2012-09-06 13:44                       ` Marcin Kuśka
2012-09-06 14:02                       ` Gilles Chanteperdrix
2012-09-07 11:16                         ` Marcin Kuśka
2012-09-07 11:38                           ` Gilles Chanteperdrix
2012-09-03 18:24         ` Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50485E80.6050800@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=marckuska@gmail.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.