Re: [Xenomai] RPi zero: high resolution clock not working

2018-05-23 Thread Greg Gallagher
I have the ipipe support for the bcm2835 done, I'll submit the patch
shortly.  Once that's in the ipipe-arm tree we can start building
xenomai for the rpi zero.

On Wed, May 9, 2018 at 8:50 AM, Gustav Johansson  wrote:
> Hi!
>
>
> I have managed to boot RPI zero with Cobalt on kernel version 4.9.51, with 
> ipipe #4.
>
> Im using the mainline. I used config multi_v7_defconfig and chose armv6 from 
> there.
>
> Im using the device tree bcm2835-rpi-zero.dtb
>
>
> During the boot I receives errors:
>
> [0.27] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps 
> every 2147483647500ns
> [0.74] clocksource: timer: mask: 0x max_cycles: 0x, 
> max_idle_ns: 1911260446275 ns
> [0.000698] Interrupt pipeline (release #4)
> [0.069805] clocksource: jiffies: mask: 0x max_cycles: 0x, 
> max_idle_ns: 1911260446275 ns
> [0.107627] PTP clock support registered
> [0.111409] clocksource: Switched to clocksource timer
> [0.180098] [Xenomai] scheduling class idle registered.
> [0.180287] [Xenomai] scheduling class rt registered.
> [0.180527] I-pipe: high-resolution clock not working
> [0.180726] [Xenomai] init failed, code -19
> [0.207251] clk: couldn't get clock 0 for /soc/pwm@7e20c000
> [0.572597] i2c-bcm2835 20805000.i2c: Could not read clock-frequency 
> property
> [5.063088] systemd[1]: System time before build time, advancing clock.
> [6.685798] systemd[1]: Mounting RPC Pipe File System...
>
>
> So the error tells me that the high-resolution clock is not working and 
> Xenomai failed the init with error code -19.
>
>
> The boot continues and I can use it as regular but /proc/xenomai does not 
> exist.
>
>
> Any ideas on ways I can make it work? I have included the dmesg log and 
> kernel config.
>
>
> Regards,
>
> Gustav
> -- next part --
> A non-text attachment was scrubbed...
> Name: dmesg.log
> Type: text/x-log
> Size: 17028 bytes
> Desc: dmesg.log
> URL: 
> 
> -- next part --
> A non-text attachment was scrubbed...
> Name: ATT07561.config
> Type: application/octet-stream
> Size: 134322 bytes
> Desc: ATT07561.config
> URL: 
> 
> ___
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai

___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


Re: [Xenomai] Only 2 serial ports at a time with xeno_16550A driver

2018-05-23 Thread Lennart Sorensen
On Wed, May 23, 2018 at 11:18:04AM +0200, Jan Kiszka wrote:
> As noted in the other thread, IRQ 5 is most probably wrong. Check what
> Linux uses when you attach the device to a normal Linux driver.

Agreed.  PCs use IRQ 4 and 3 for serial ports at addresses 3f8, 2f8,
3e8 and 2e8.

ttyS0: 0x3f8 irq 4
ttyS1: 0x2f8 irq 3
ttyS2: 0x3e8 irq 4
ttyS3: 0x2f8 irq 3

It can often be changed, but those are the defaults.

-- 
Len Sorensen

___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


Re: [Xenomai] Only 2 serial ports at a time with xeno_16550A driver

2018-05-23 Thread Jan Kiszka
On 2018-05-23 07:25, C Smith wrote:
> I'm not familiar with the chaining of shared interrupts in the RTDM
> architecture. I think the EOI should somehow be done in the very last
> invocation of rt_16550_interrupt() by the last peripheral needing service.
> 

Just like under Linux, the driver does not have to worry about that
details. Xenomai will EOI the IRQ when needed. The driver handler just
need to tell if a particular invocation was (also) triggered by the
device it drives.

> 
> I read this from an old interrupt handler:
> (assuming IBM PC (Intel) architecture)
> An interrupt handler issues an EOI by writing the value 0x20 to the PIC at
> address 0x20. If the interrupt was number 8-15, do the same thing again,
> write 0x20 to address 0x20.
> 
> So perhaps something like this at the end of rt_16550_interrupt() ?
> 
> if (ctx->irq_handle.irq <= 7)/* non-specific EOI to 8259 */
>   rt_16550_reg_out(mode, 0, 0x20, 0x20);
> if (ctx->irq_handle.irq <= 15)  /* extra EOI for upper ISA IRQs */
>   rt_16550_reg_out(mode, 0, 0x20, 0x20);
> 
> But again I don't know if that will work with shared interrupts. Surely
> RTDM implements some "master" handler which is already doing an EOI?
> Remember lower interrupts like IRQ 5 work fine with the xeno_16550A driver

As noted in the other thread, IRQ 5 is most probably wrong. Check what
Linux uses when you attach the device to a normal Linux driver.

Jan

> unless another port is sharing the same IRQ.
> 
> -C Smith
> 

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai