All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Support for ARCH_MV88F6290
@ 2009-09-25  6:12 Didenko Sergey
  2009-09-25  8:37 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 15+ messages in thread
From: Didenko Sergey @ 2009-09-25  6:12 UTC (permalink / raw)
  To: xenomai; +Cc: jorge.ramirez, Me (Samsung Account), mohamad.sharifi

[-- Attachment #1: Type: text/plain, Size: 2354 bytes --]

Hello All

I'm porting Xenomai 2.4.9 to the Linux Kernel 2.6.29.

Target platform is MV 88F6290
CPU: ARM926EJ-S
Adeos patch: adeos-ipipe-2.6.29-arm-1.13-03.patch

I do patch the kernel with xenomai and adeos:
./prepare-kernel.sh --arch=arm --linux=/.../kernel/linux-2.6.29-v02.00.29/
--adeos=/.../xenomai-2.4.9/ksrc/arch/arm/patches/adeos-ipipe-2.6.29-arm-1.13-03.patch

Then I compile the Linux kernel.
At the time when I start to compile the kernel I have to answer for many
questions regarding configuration, it is Ok!
But finally I got the compile error like:

===
arch/arm/kernel/ipipe.c: In function '__ipipe_grab_irq':
arch/arm/kernel/ipipe.c:492: error: implicit declaration of function
'__ipipe_mach_irq_mux_p'
make[1]: *** [arch/arm/kernel/ipipe.o] Error 1
make: *** [arch/arm/kernel] Error 2
===

the reason of this error is that there is no definition of the macro
"__ipipe_mach_irq_mux_p" for the target platform as well as there are no the
others CPU dependent definitions.

If I refer to the file "arch/arm/mach-at91/include/mach/irqs.h" all
definitions like
CONFIG_ARCH_AT91SAM9* are not defined

But, in the Xenomai's build questionnaire messages (build time) I found next
lines:

===

*
* System Type
*
ARM system type
  1. Agilent AAEC-2000 based (ARCH_AAEC2000)
 .
 .
 .
  38. Nuvoton W90X900 CPU (ARCH_W90X900)
> 39. Marvell MV88F6290 (ARCH_MV88F6290)
choice[1-39]: 39

===

Actually I did not select any system type anyhow. And it does not allow me
to select it somehow, but the default choice is correct - system type is
MV88F6290! I don't know why but it is a very nice that default system type
is exactly what I need :) (please give some comments on it)

The questions!

1) It looks like Xenomai do support the target SoC (MV88F6290), as well as
do support processor type ARM926 it has.
Then why I can not find the CPU dependent definitions in the patched
kernel's source code?
2) What does it takes for you to support this system and CPU if it is not
supported yet?

IF you do support for this system for 2.6.29 version of kernel It would be
great because I can test it on my target board and give you all feed back
with the results, and finally you can include it to the next patches.

Looking forward to hearing from you any help regarding anything I can do to
run the patched kernel on my board successfully.

Sergey Didenko

[-- Attachment #2: Type: text/html, Size: 2621 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [Xenomai-help] Support for ARCH_MV88F6290
@ 2009-10-08  8:27 Didenko Sergey
  2009-10-08  8:41 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 15+ messages in thread
From: Didenko Sergey @ 2009-10-08  8:27 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 10564 bytes --]

Dear Xenomai Experts,

So far I did not progress too much.

What I have now is that patched Linux is starting to boot as original kernel
and it hangs right after line
[42949373.240000] ata1: SATA max UDMA/133 irq 27

Next characters are printed out:
"?" - from __ipipe_mach_acktimer()
"^" - from orion_timer_interrupt()
"-" - from __ipipe_mach_set_dec()
"_" - from __ipipe_mach_get_tsc()

=========================== LOG - Start
Starting kernel ...

Uncompressing
Linux..........................................................................................................................................
[    0.000000] Linux version 2.6.29_V02.00.29 (gcc version 4.2.1
(CodeSourcery Sourcery G++ Lite 2007q3-51)) #46 PREEMPT Thu Oct 8 15:059
[    0.000000] CPU: Feroceon [41159260] revision 0 (ARMv5TE), cr=00053177
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine: Marvell 88f6290 Board
[    0.000000] Using u-boot passing parameters structure
[    0.000000] uboot version: 33757680
[    0.000000] board id: 240
[    0.000000] usb host: 3
[    0.000000] over ethernet address: 0x0
[    0.000000] MAC address: 00:00:00:00:51:81
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total
pages: 130048
[    0.000000] Kernel command line: root=/dev/nfs rw
nfsroot=10.88.198.79:/nfs/rootfs
ip=10.88.197.82:10.88.198.79:10.88.197.1:255.255.255.0::eth0:off conso8
[    0.000000] PID hash table entries: 2048 (order: 11, 8192 bytes)
[    0.000000]
[    0.000000] ===[Break point] orion_time_init - IN
[    0.000000] ===[Break point] orion_clkevt_mode - IN
[    0.000000] ===[Break point] orion_clkevt_mode - IN<6>I-pipe 1.13-03:
pipeline enabled.
[42949372.960000] Console: colour dummy device 80x30
[42949372.960000] Dentry cache hash table entries: 65536 (order: 6, 262144
bytes)
[42949372.960000] Inode-cache hash table entries: 32768 (order: 5, 131072
bytes)
[42949372.960000] ?^?^<6>Memory: 256MB 256MB = 512MB total
[42949372.980000] Memory: 383744KB available (4188K code, 389K data, 116K
init)
[42949372.980000] SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0,
CPUs=1, Nodes=1
[42949372.980000] Calibrating delay loop...
?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^797.90 BogoMIPS (lpj=3989504)
[42949373.190000] ?^Mount-cache hash table entries: 512
[42949373.200000] CPU: Testing write buffer coherency: ok
[42949373.200000]
[42949373.200000] ===[Break point] rest_init - IN<6>net_namespace: 884 bytes
[42949373.200000] NET: Registered protocol family 16
[42949373.200000] MV88F6290: MV88F6290-A0, TCLK=166666667.
[42949373.200000] GPIO-17 autorequested
[42949373.200000] MV88F6290 PCIe #0: <6>link up
[42949373.200000] MV88F6290 PCIe #1: <6>link down, ignoring
[42949373.200000] pci 0000:00:01.0: PME# supported from D0 D3hot D3cold
[42949373.200000] pci 0000:00:01.0: PME# disabled
[42949373.200000] PCI: bus0: Fast back to back transfers disabled
[42949373.200000] PCI: bus1: Fast back to back transfers enabled
[42949373.200000] pci 0000:00:01.0: PCI bridge, secondary bus 0000:01
[42949373.200000] pci 0000:00:01.0:   IO window: disabled
[42949373.200000] pci 0000:00:01.0:   MEM window: disabled
[42949373.200000] pci 0000:00:01.0:   PREFETCH window: disabled
[42949373.200000] ?^?^bio: create slab <bio-0> at 0
[42949373.220000] SCSI subsystem initialized
[42949373.220000] usbcore: registered new interface driver usbfs
[42949373.220000] usbcore: registered new interface driver hub
[42949373.220000] usbcore: registered new device driver usb
[42949373.220000] ?^<6>NET: Registered protocol family 2
[42949373.230000] IP route cache hash table entries: 16384 (order: 4, 65536
bytes)
[42949373.230000] TCP established hash table entries: 65536 (order: 7,
524288 bytes)
[42949373.230000] TCP bind hash table entries: 65536 (order: 6, 262144
bytes)
[42949373.230000] TCP: Hash tables configured (established 65536 bind 65536)
[42949373.230000] TCP reno registered
[42949373.230000] NET: Registered protocol family 1
[42949373.230000]
[42949373.230000] ===[Break point] __ipipe_mach_get_tscinfo - IN
[42949373.230000] ===[Break point] __ipipe_mach_get_tscinfo - IN<6>I-pipe:
Domain Xenomai registered.
[42949373.230000] Xenomai: hal/arm started.
[42949373.230000] ?^<6>Xenomai: real-time nucleus v2.4.9.1 (Big Bad Moon)
loaded.
[42949373.240000] _-___-__<6>Xenomai: starting native API services.
[42949373.240000] Xenomai: starting POSIX services.
[42949373.240000] Xenomai: starting RTDM services.
[42949373.240000] ?___-__<6>bigphysarea: Allocated 32768 pages at
0xc08a8000.
[42949373.240000] ?___-__<6>NTFS driver 2.1.29 [Flags: R/O].
[42949373.240000] JFFS2 version 2.2. (NAND) .. 2001-2006 Red Hat, Inc.
[42949373.240000] msgmni has been set to 749
[42949373.240000] alg: No test for stdrng (krng)
[42949373.240000] io scheduler noop registered
[42949373.240000] io scheduler anticipatory registered
[42949373.240000] io scheduler deadline registered
[42949373.240000] io scheduler cfq registered (default)
[42949373.240000] ?___-__?___-__?___-__<6>Serial: 8250/16550 driver, 2
ports, IRQ sharing disabled
[42949373.240000] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 3) is a
16550A
[42949373.240000] console [ttyS0] enabled
[42949373.240000]
??????????????????????????????????????????___-_____-_____-_____-_____-_____-_____-_____-_____-_____-_____-_____-_____-_____-_____-_____-__d
[42949373.240000] ?___-__<5>MV-643xx 10/100/1000 ethernet driver version 1.4
[42949373.240000] mv643xx_eth smi: probed
[42949373.240000] ?___-__?___-__<6>eth0 (mv643xx_eth_port): not using
net_device_ops yet
[42949373.240000] net eth0: port 0 with MAC address 00:00:00:00:51:81
[42949373.240000] ?___-__<6>usbcore: registered new interface driver
cdc_ether
[42949373.240000] ?___-__<6>usbcore: registered new interface driver
rndis_host
[42949373.240000] ?___-__<6>usbcore: registered new interface driver
cdc_subset
[42949373.240000] Driver 'sd' needs updating - please use bus_type methods
[42949373.240000] ?___-__<6>sata_mv sata_mv.0: version 1.25
[42949373.240000] ?___-__<6>sata_mv sata_mv.0: slots 32 ports 1
[42949373.240000] scsi0 : sata_mv
[42949373.240000] ?___-__<6>ata1: SATA max UDMA/133 irq 27
[42949373.240000] ?___-__?___-__?___-__?___-__?___-__?___-__?___-__?___-__

=========================== LOG - End

As you can see after line

[42949373.230000] ?^<6>Xenomai: real-time nucleus v2.4.9.1 (Big Bad Moon)
loaded.

System does not go to timer_interrupt() function any more.

What I'm worring about is that the system has 2 timers, one is free-running
with disabled interrupts, second one is interrupt-driven clockevent timer.

=========================== Code - Start

/*
 * Clockevent handling.
 */
static int
orion_clkevt_next_event(unsigned long delta, struct clock_event_device *dev)
{
    unsigned long flags;
    u32 u;

    XEN_PRINT("-ne-");

    if (delta == 0)
        return -ETIME;

    local_irq_save(flags);

    /*
     * Clear and enable clockevent timer interrupt.
     */
    writel(BRIDGE_INT_TIMER1_CLR, BRIDGE_CAUSE);

    u = readl(BRIDGE_MASK);
    u |= BRIDGE_INT_TIMER1;
    writel(u, BRIDGE_MASK);

    /*
     * Setup new clockevent timer value.
     */
    writel(delta, TIMER1_VAL);

    /*
     * Enable the timer.
     */
    u = readl(TIMER_CTRL);
    u = (u & ~TIMER1_RELOAD_EN) | TIMER1_EN;
    writel(u, TIMER_CTRL);

    local_irq_restore(flags);

    return 0;
}

static void
orion_clkevt_mode(enum clock_event_mode mode, struct clock_event_device
*dev)
{
    unsigned long flags;
    u32 u;

    local_irq_save(flags);
    if (mode == CLOCK_EVT_MODE_PERIODIC) {

        XEN_PRINT("-cm1-");

        /*
         * Setup timer to fire at 1/HZ intervals.
         */
        writel(ticks_per_jiffy - 1, TIMER1_RELOAD);
        writel(ticks_per_jiffy - 1, TIMER1_VAL);

        /*
         * Enable timer interrupt.
         */
        u = readl(BRIDGE_MASK);
        writel(u | BRIDGE_INT_TIMER1, BRIDGE_MASK);

        /*
         * Enable timer.
         */
        u = readl(TIMER_CTRL);
        writel(u | TIMER1_EN | TIMER1_RELOAD_EN, TIMER_CTRL);
    } else {

        XEN_PRINT("-cm2-");

        /*
         * Disable timer.
         */
        u = readl(TIMER_CTRL);
        writel(u & ~TIMER1_EN, TIMER_CTRL);

        /*
         * Disable timer interrupt.
         */
        u = readl(BRIDGE_MASK);
        writel(u & ~BRIDGE_INT_TIMER1, BRIDGE_MASK);

        /*
         * ACK pending timer interrupt.
         */
        writel(BRIDGE_INT_TIMER1_CLR, BRIDGE_CAUSE);

    }
    local_irq_restore(flags);
}

static struct clock_event_device orion_clkevt = {
    .name        = "orion_tick",
    .features    = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
    .shift        = 32,
    .rating        = 300,
    .set_next_event    = orion_clkevt_next_event,
    .set_mode    = orion_clkevt_mode,
};

static irqreturn_t orion_timer_interrupt(int irq, void *dev_id)
{
    XEN_PRINT("^");

    /*
     * ACK timer interrupt and call event handler.
     */
    writel(BRIDGE_INT_TIMER1_CLR, BRIDGE_CAUSE);
    orion_clkevt.event_handler(&orion_clkevt);

    return IRQ_HANDLED;
}

static struct irqaction orion_timer_irq = {
    .name        = "orion_tick",
    .flags        = IRQF_DISABLED | IRQF_TIMER,
    .handler    = orion_timer_interrupt
};

void __init orion_time_init(unsigned int irq, unsigned int tclk)
{
    u32 u;

    ticks_per_jiffy = (tclk + HZ/2) / HZ;


    /*
     * Setup free-running clocksource timer (interrupts
     * disabled.)
     */
    writel(0xffffffff, TIMER0_VAL);
    writel(0xffffffff, TIMER0_RELOAD);
    u = readl(BRIDGE_MASK);
    writel(u & ~BRIDGE_INT_TIMER0, BRIDGE_MASK);
    u = readl(TIMER_CTRL);
    writel(u | TIMER0_EN | TIMER0_RELOAD_EN, TIMER_CTRL);
    orion_clksrc.mult = clocksource_hz2mult(tclk, orion_clksrc.shift);
    clocksource_register(&orion_clksrc);


    /*
     * Setup clockevent timer (interrupt-driven.)
     */
    setup_irq(irq, &orion_timer_irq);
    orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift);
    orion_clkevt.max_delta_ns = clockevent_delta2ns(0xfffffffe,
&orion_clkevt);
    orion_clkevt.min_delta_ns = clockevent_delta2ns(1, &orion_clkevt);
    orion_clkevt.cpumask = cpumask_of(0);
    clockevents_register_device(&orion_clkevt);
}

=========================== Code - End

According to HOWTO Xenomai needs free-running counter, in my case it is
Timer 0, but all functions are configured to work with Timer 1, which is not
free running.

What would you sugest to do?

Sergey

[-- Attachment #2: Type: text/html, Size: 12315 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [Xenomai-help]  Support for ARCH_MV88F6290
@ 2009-10-14  6:19 Didenko Sergey
  2009-10-14  7:25 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 15+ messages in thread
From: Didenko Sergey @ 2009-10-14  6:19 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 2473 bytes --]

Dear Gilles

when I did change the HW Timer interrupt number (__ipipe_mach_timerint) from
0 to 1
Patched kernel is able to boot up...but I'm not sure whether Xenomai is
running or not even I can see the messages that it is started...
To verify whether it is running or not I want to do latency test ..for
that..I'm following the HOWTO which says that I have to
1) configure Xenomai
$ ./configure --build=i686-pc-linux-gnu --host=arm-linux
--enable-arm-mach=generic --enable-arm-tsc

2) make Install
When I do "make DESTDIR=/nfs install" where /nfs - is the NFS path to rootfs
mounted by board.
I have next situation...

===

[d.sergey@domain.hid xenomai-2.4.9.1]$ make DESTDIR=/nfs install
Making install in src
make[1]: Entering directory `/home/d.sergey/xemomai/xenomai-2.4.9.1/src'
Making install in include
make[2]: Entering directory
`/home/d.sergey/xemomai/xenomai-2.4.9.1/src/include'
make[3]: Entering directory
`/home/d.sergey/xemomai/xenomai-2.4.9.1/src/include'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory
`/home/d.sergey/xemomai/xenomai-2.4.9.1/src/include'
make[2]: Leaving directory
`/home/d.sergey/xemomai/xenomai-2.4.9.1/src/include'
Making install in rtdk
make[2]: Entering directory
`/home/d.sergey/xemomai/xenomai-2.4.9.1/src/rtdk'
/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
-I../../src/include  -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -march=armv4
-D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../include    -MT
librtdk_la-init.lo -MD -MP -MF .deps/librtdk_la-init.Tpo -c -o
librtdk_la-init.lo `test -f 'init.c' || echo './'`init.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../src/include -O2
-D_GNU_SOURCE -D_REENTRANT -Wall -pipe -march=armv4 -D__XENO__ -D__IN_XENO__
-Wstrict-prototypes -I../../include -MT librtdk_la-init.lo -MD -MP -MF
.deps/librtdk_la-init.Tpo -c init.c  -fPIC -DPIC -o .libs/librtdk_la-init.o
init.c:1: error: bad value (armv4) for -march= switch
init.c:1: error: bad value (armv4) for -mtune= switch
make[2]: *** [librtdk_la-init.lo] Error 1
make[2]: Leaving directory `/home/d.sergey/xemomai/xenomai-2.4.9.1/src/rtdk'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/d.sergey/xemomai/xenomai-2.4.9.1/src'
make: *** [install-recursive] Error 1
[d.sergey@domain.hid xenomai-2.4.9.1]$

====

What is wrong?
How can I patch the rootfs with Xenomai libraries correctly?

Sergey

[-- Attachment #2: Type: text/html, Size: 2711 bytes --]

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

end of thread, other threads:[~2009-10-16  9:30 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25  6:12 [Xenomai-help] Support for ARCH_MV88F6290 Didenko Sergey
2009-09-25  8:37 ` Gilles Chanteperdrix
     [not found]   ` <1f3e02580909250400r7595efw769fedac12b71fce@domain.hid>
     [not found]     ` <4ABCA99D.1040206@domain.hid>
     [not found]       ` <1f3e02580909250526v52a0408ex455cc22191f3802@domain.hid>
     [not found]         ` <4ABCC977.6010500@domain.hid>
     [not found]           ` <1f3e02580909280458ubf3f610he5e52aab1efa1cc6@domain.hid>
2009-09-29 16:27             ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2009-10-08  8:27 Didenko Sergey
2009-10-08  8:41 ` Gilles Chanteperdrix
2009-10-09  2:09   ` Didenko Sergey
2009-10-09  9:12     ` Gilles Chanteperdrix
2009-10-14  6:19 Didenko Sergey
2009-10-14  7:25 ` Gilles Chanteperdrix
2009-10-16  5:26   ` Didenko Sergey
2009-10-16  7:43     ` Gilles Chanteperdrix
2009-10-16  8:30       ` Didenko Sergey
2009-10-16  8:46         ` Gilles Chanteperdrix
2009-10-16  8:56           ` Didenko Sergey
2009-10-16  9:30             ` Didenko Sergey

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.