All of lore.kernel.org
 help / color / mirror / Atom feed
From: aubin.rebillat@domain.hid
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Xenomai on the TS-7553 ARM SBC
Date: Thu, 10 May 2012 18:04:12 +0200 (CEST)	[thread overview]
Message-ID: <1274569547.144858251.1336665852058.JavaMail.root@domain.hid> (raw)
In-Reply-To: <4FABDF16.2090702@domain.hid>

> De: "Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org>
> À: "aubin rebillat" <aubin.rebillat@domain.hid>
> Cc: xenomai@xenomai.org
> Envoyé: Jeudi 10 Mai 2012 17:30:30
> Objet: Re: [Xenomai-help] Xenomai on the TS-7553 ARM SBC
> 
> On 05/10/2012 05:18 PM, aubin.rebillat@domain.hid wrote:
> >> root=/dev/ram0 means that you are using an initrd, which has been
> >> deprecated for many years.
> > 
> > I don't really have another option because the board does not
> > support
> > U-BOOT (according to the manufacturer) and due to the specific
> > bootloader on the board I need an initrd : The bootloader only
> > initialises some hardware and loads the kernel image and the initrd
> > in memory before jumping on the kernel code. Then it uses the
> > "linux
> > booting linux" technique to launch debian. I agree with you that it
> > is not the way of doing it today and i suspect the board
> > manufacturer
> > to do so to sell a "fast booting board" because linux is booted in
> > less than 4 secs (of course for debian, it takes really more). They
> > actually made many things that seemed nice when i read the
> > description but when i wanted to develop with it I saw a lot of
> > really strange technique / behaviors (See the UART after for
> > example).
> 
> There is no difference that I know of from the bootloader side
> whether
> booting with an initrd or an initramfs. Anyway, the only difference
> is
> that initramfs wastes more memory, it is not what is causing the
> problem. Either using an initrd or an initramfs wastes boot time,
> which
> is usually a scarse resource on embedded systems. Whatever the
> bootloader, I do not see what prevents you from passing different
> parameters than "root=/dev/ram0" to the kernel, which would be enough
> to
> boot from another device.
> 
> But all this is unimportant.
>

I'm not that experienced with initrd/initramfs and that was what the manufacturer recommended and i followed it so i can have support from them. But yes, at first, i think it can boot from another device.

> 
> > I will look into the OABI and EABI settings then. I will also set
> > up
> > an NFS file system to mount debian from and see what is happening.
> > 
> > Thank you Gilles for your reply. I will keep posting about my
> > progresses.
> 
> The issue may simply well be that your timer code does not work.
> Could
> you post the code for your port? That is, the code you added to get
> it
> work with the I-pipe patch. 
> Have you checked that linux timer is
> still
> ticking after Xenomai has been started?

No, i did not check that the linux timer is still ticking.
But i think it is because parts of the init script are executed and it is a shell script calling several sub-processes.
Nevertheless, I will put some printk in the linux timer handler to be sure.

> 
> You can also try to boot with CONFIG_IPIPE but without
> CONFIG_XENOMAI.

I did, and it's booting just fine.

> 
> Note that in case you do not know it, there is a guide for porting
> the
> I-pipe patch on new ARM platforms:
> 
> http://www.xenomai.org/index.php/I-pipe:ArmPorting

This is the HOWTO I followed to make the port.

Here is the code :

- Timer :

#ifdef CONFIG_IPIPE
# ifdef CONFIG_NO_IDLE_HZ
#  error "Dynamic tick timer not yet supported with IPIPE"
# endif /* CONFIG_NO_IDLE_HZ */

union tsc_reg
{
#ifdef __BIG_ENDIAN
    struct
    {
        unsigned long high;
        unsigned long low;
    };
#else
    struct
    {
        unsigned long low;
        unsigned long high;
    };
#endif
    unsigned long long full;
};

#ifdef CONFIG_SMP
static union tsc_reg tsc[NR_CPUS];
#else /* !CONFIG_SMP */
static union tsc_reg tsc[1];
#endif

int __ipipe_mach_timerint = INTC_TIMER1_BIT_INDEX;
int __ipipe_mach_timerstolen = 0;
unsigned __ipipe_mach_ticks_per_jiffy = LATCH;
int str8100_timer_initialised = 0;
#endif /* CONFIG_IPIPE */


#ifdef CONFIG_IPIPE
void ipipe_mach_update_tsc(void)
{
  union tsc_reg *local_tsc;
  unsigned long stamp;
  unsigned long flags;

  local_irq_save_hw(flags);
  local_tsc = &tsc[ipipe_processor_id()];
  stamp = str8100_read_timer_counter();
  if (stamp < local_tsc->low)
    local_tsc->high++;
  local_tsc->low = stamp;
  local_irq_restore_hw(flags);
}

void __ipipe_mach_acktimer(void)
{
#ifndef CONFIG_VIC_INTERRUPT
  write_seqlock(&xtime_lock);
  str8100_clear_timer_interrupt_status(__ipipe_mach_timerint);
  write_sequnlock(&xtime_lock);
#endif

  ipipe_mach_update_tsc();
}

notrace unsigned long long __ipipe_mach_get_tsc(void)
{
  if (likely(str8100_timer_initialised))
  {
    union tsc_reg *local_tsc, result;
    unsigned long stamp;

    local_tsc = &tsc[ipipe_processor_id()];

    __asm__ ("ldmia %1, %M0\n"
             : "=r"(result.full), "+&r"(local_tsc)
             : "m"(*local_tsc));
    barrier();
    stamp = str8100_read_timer_counter();
    if (stamp < result.low)
      result.high++;
    result.low = stamp;
    return result.full;
  }
  return 0;
}

#ifdef CONFIG_SMP
void __ipipe_mach_get_tscinfo(struct __ipipe_tscinfo *info)
{
  info->type = IPIPE_TSC_TYPE_NONE;
}
#else /* !CONFIG_SMP */
void __ipipe_mach_get_tscinfo(struct __ipipe_tscinfo *info)
{
  info->type = IPIPE_TSC_TYPE_FREERUNNING;
  info->u.fr.counter = (unsigned *)(SYSPA_TIMER_BASE_ADDR + 0x40);
  info->u.fr.mask = 0xFFFFFFFF;
  info->u.fr.tsc = &tsc->full;
}
#endif /* !CONFIG_SMP */

void __ipipe_mach_set_dec(unsigned long delay)
{
  unsigned long flags;

  if (delay > 8)
  {
    local_irq_save_hw(flags);
    TIMER1_MATCH_VALUE1_REG = TIMER1_COUNTER_REG + delay;
    local_irq_restore_hw(flags);
  }
  else
    ipipe_trigger_irq(__ipipe_mach_timerint);
}

unsigned long __ipipe_mach_get_dec(void)
{
  return (TIMER1_MATCH_VALUE1_REG - TIMER1_COUNTER_REG);
}

void __ipipe_mach_release_timer(void)
{
  __ipipe_mach_set_dec(__ipipe_mach_ticks_per_jiffy);
}

#endif /* CONFIG_IPIPE */

- Interrupts :

#ifdef CONFIG_IPIPE
void __ipipe_mach_demux_irq(unsigned irq, struct pt_regs *regs)
{
  // No cascaded interrupt using the VIC
}
#endif /* CONFIG_IPIPE */

Best regards,

-- 
Aubin REBILLAT


  reply	other threads:[~2012-05-10 16:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <80969791.144436365.1336656376390.JavaMail.root@domain.hid>
2012-05-10 13:26 ` [Xenomai-help] Xenomai on the TS-7553 ARM SBC aubin.rebillat
2012-05-10 13:42   ` Gilles Chanteperdrix
2012-05-10 15:18     ` aubin.rebillat
2012-05-10 15:30       ` Gilles Chanteperdrix
2012-05-10 16:04         ` aubin.rebillat [this message]
2012-05-10 16:34           ` Gilles Chanteperdrix
2012-05-10 17:29             ` aubin.rebillat
2012-05-10 17:42               ` Gilles Chanteperdrix
2012-05-14 16:13                 ` aubin.rebillat
2012-05-14 16:18                   ` Gilles Chanteperdrix
2012-05-14 18:54                     ` Gilles Chanteperdrix
2012-05-15 14:34                       ` aubin.rebillat
2012-05-15 14:37                         ` Gilles Chanteperdrix
2012-05-10 17:28   ` Gilles Chanteperdrix
2012-05-10 17:38     ` aubin.rebillat
2012-05-10 17:48       ` 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=1274569547.144858251.1336665852058.JavaMail.root@domain.hid \
    --to=aubin.rebillat@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --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.