[FE training-materials-updates] Switch the xenomai lab to the Xplained now that it works

Maxime Ripard maxime.ripard at free-electrons.com
Thu Jul 17 15:33:17 CEST 2014


Repository : git://git.free-electrons.com/training-materials.git

On branch  : sysdev-xplained
Link       : http://git.free-electrons.com/training-materials/commit/?id=03d4fe57d5d5981b4f1a90ad77f0ae381b10581b

>---------------------------------------------------------------

commit 03d4fe57d5d5981b4f1a90ad77f0ae381b10581b
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date:   Thu Jul 17 15:32:29 2014 +0200

    Switch the xenomai lab to the Xplained now that it works
    
    Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>


>---------------------------------------------------------------

03d4fe57d5d5981b4f1a90ad77f0ae381b10581b
 ...buildroot-2013.02-bump-xenomai-to-2.6.2.1.patch |  221 --------------------
 .../data/linux-3.14-ipipe-add-aic5-support.patch   |  143 +++++++++++++
 .../data/linux-3.5.7-igepv2-fix-pinmux.patch       |   65 ------
 labs/sysdev-real-time/sysdev-real-time.tex         |  115 +++++-----
 4 files changed, 200 insertions(+), 344 deletions(-)

diff --git a/lab-data/realtime/rttest/data/buildroot-2013.02-bump-xenomai-to-2.6.2.1.patch b/lab-data/realtime/rttest/data/buildroot-2013.02-bump-xenomai-to-2.6.2.1.patch
deleted file mode 100644
index bf0f43d..0000000
--- a/lab-data/realtime/rttest/data/buildroot-2013.02-bump-xenomai-to-2.6.2.1.patch
+++ /dev/null
@@ -1,221 +0,0 @@
-commit bd528977f1dbe232bd1ca2a0bd9a37f9172d579a
-Author: Victor Hiairrassary <victor.hiairrassary.ml at gmail.com>
-Date:   Sun Apr 21 22:07:23 2013 +0000
-
-    xenomai: bump to version 2.6.2.1
-    
-    - remove BR2_PACKAGE_XENOMAI_SMP since xenomai 2.6.2 no more
-    requires to pass the --enable-smp option : see release notes at
-    http://www.xenomai.org/index.php/Xenomai:News#2012-12-26_Xenomai_2.6.2
-    
-    - remove xenomai-thumb-fix.patch since it was completely merged
-    in xenomai 2.6.2
-    
-    Signed-off-by: Victor Hiairrassary <victor.hiairrassary.ml at gmail.com>
-    Signed-off-by: Peter Korsgaard <jacmet at sunsite.dk>
-
-diff --git a/package/xenomai/Config.in b/package/xenomai/Config.in
-index b09472d..767f622 100644
---- a/package/xenomai/Config.in
-+++ b/package/xenomai/Config.in
-@@ -39,13 +39,6 @@ config BR2_PACKAGE_XENOMAI_VERSION
- 	  BR2_LINUX_KERNEL_EXT_XENOMAI_ADEOS_PATCH, in the Linux
- 	  Kernel -> Linux Kernel Extensions menu.
- 
--config BR2_PACKAGE_XENOMAI_SMP
--	bool "Enable SMP support"
--	depends on BR2_cortex_a9 || !BR2_arm # only A9 has SMP support
--	help
--	  This option allows to enable or disable SMP support. It has
--	  to match your kernel configuration.
--
- config BR2_PACKAGE_XENOMAI_TESTSUITE
-        bool "Install testsuite"
-        help
-diff --git a/package/xenomai/xenomai-thumb-fix.patch b/package/xenomai/xenomai-thumb-fix.patch
-deleted file mode 100644
-index 7c98c2e..0000000
---- a/package/xenomai/xenomai-thumb-fix.patch
-+++ /dev/null
-@@ -1,157 +0,0 @@
--From ad3714e925f5c6b4ae0e0d31c4bab7f8c5e659db Mon Sep 17 00:00:00 2001
--From: Gilles Chanteperdrix <gilles.chanteperdrix at xenomai.org>
--Date: Fri, 10 Aug 2012 21:55:41 +0200
--Subject: [PATCH] hal/arm: fix compilation for thumb
--
-----
-- include/asm-arm/atomic.h |    3 ++
-- ksrc/arch/arm/switch.S   |   84 +++++++++++++++++++++++++++------------------
-- 2 files changed, 53 insertions(+), 34 deletions(-)
--
--diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
--index 5d55ae8..ae96847 100644
----- a/include/asm-arm/atomic.h
--+++ b/include/asm-arm/atomic.h
--@@ -183,6 +183,9 @@ xnarch_atomic_cmpxchg(xnarch_atomic_t *ptr,
-- 		"ldrex	%1, [%3]\n"
-- 		"mov	%0, #0\n"
-- 		"teq	%1, %4\n"
--+#ifdef __thumb__
--+		"it	eq\n"
--+#endif
-- 		"strexeq %0, %5, [%3]\n"
-- 		    : "=&r" (res), "=&r" (curval), "+Qo" (ptr->counter)
-- 		    : "r" (&ptr->counter), "Ir" (oldval), "r" (newval)
--diff --git a/ksrc/arch/arm/switch.S b/ksrc/arch/arm/switch.S
--index 83f4746..95c355f 100644
----- a/ksrc/arch/arm/switch.S
--+++ b/ksrc/arch/arm/switch.S
--@@ -37,6 +37,11 @@
-- 	.endm
-- #endif
-- 
--+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
--+#define ARM(x...)	x
--+#define THUMB(x...)
--+#endif
--+
-- #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 37)
-- #ifdef CONFIG_MMU
-- #define USE_DOMAINS
--@@ -83,18 +88,19 @@
--  * r0 = pointer to union vfp_state, r1 = fpexc
--  */
-- ENTRY(rthal_vfp_save)
---    VFPFSTMIA	r0, r2			@ save the working registers
---    VFPFMRX	r2, FPSCR		@ current status
---    tst		r1, #FPEXC_EX		@ is there additional state to save?
---    beq 1f
---    VFPFMRX	r3, FPINST		@ FPINST (only if FPEXC.EX is set)
---    tst		r1, #FPEXC_FP2V		@ is there an FPINST2 to read?
---    beq 1f
---    VFPFMRX	r12, FPINST2	@ FPINST2 if needed (and present)
--+	VFPFSTMIA	r0, r2		@ save the working registers
--+	VFPFMRX		r2, FPSCR	@ current status
--+	tst		r1, #FPEXC_EX	@ is there additional state to save?
--+	beq		1f
--+	VFPFMRX		r3, FPINST	@ FPINST (only if FPEXC.EX is set)
--+	tst		r1, #FPEXC_FP2V	@ is there an FPINST2 to read?
--+	beq		1f
--+	VFPFMRX		r12, FPINST2	@ FPINST2 if needed (and present)
-- 1:
---    stmia	r0, {r1, r2, r3, r12}	@ save FPEXC, FPSCR, FPINST, FPINST2
---    mov		pc, lr
---
--+	stmia		r0, {r1, r2, r3, r12}	@ save FPEXC, FPSCR, FPINST, FPINST2
--+	mov		pc, lr
--+ENDPROC(rthal_vfp_save)
--+	
-- /* Copied from no_old_VFP_process in arch/arm/vfp/vfphw.S
--  * r0 = pointer to union vfp_state
--  * r1 = current cpu
--@@ -102,20 +108,21 @@ ENTRY(rthal_vfp_save)
-- ENTRY(rthal_vfp_load)
-- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) \
-- 	|| defined(CONFIG_VFP_3_2_BACKPORT)) && defined(CONFIG_SMP)
---    str 	r1, [r0, #VFP_CPU]
--+	str		r1, [r0, #VFP_CPU]
-- #endif
---    VFPFLDMIA	r0, r2			@ reload the working registers while
--+	VFPFLDMIA	r0, r2		@ reload the working registers while
-- 					@ FPEXC is in a safe state
---    ldmia	r0, {r1, r2, r3, r12}	@ load FPEXC, FPSCR, FPINST, FPINST2
---    tst		r1, #FPEXC_EX		@ is there additional state to restore?
---    beq		1f
---    VFPFMXR	FPINST, r3		@ restore FPINST (only if FPEXC.EX is set)
---    tst		r1, #FPEXC_FP2V		@ is there an FPINST2 to write?
---    beq		1f
---    VFPFMXR	FPINST2, r12	@ FPINST2 if needed (and present)
--+	ldmia		r0, {r1, r2, r3, r12}	@ load FPEXC, FPSCR, FPINST, FPINST2
--+	tst		r1, #FPEXC_EX	@ is there additional state to restore?
--+	beq		1f
--+	VFPFMXR		FPINST, r3	@ restore FPINST (only if FPEXC.EX is set)
--+	tst		r1, #FPEXC_FP2V	@ is there an FPINST2 to write?
--+	beq		1f
--+	VFPFMXR		FPINST2, r12	@ FPINST2 if needed (and present)
-- 1:
---    VFPFMXR	FPSCR, r2		@ restore status
---    mov		pc, lr
--+	VFPFMXR		FPSCR, r2	@ restore status
--+	mov		pc, lr
--+ENDPROC(rthal_vfp_load)
-- #endif
-- 
-- /*
--@@ -144,28 +151,37 @@ ENTRY(rthal_vfp_load)
--  * r0 = previous task_struct, r1 = previous thread_info, r2 = next thread_info
--  */
-- ENTRY(rthal_thread_switch)
---    add     ip, r1, #TI_CPU_SAVE
---    ldr     r3, [r2, #TI_TP_VALUE]
---    stmia   ip!, {r4 - sl, fp, sp, lr}      @ Store most regs on stack
--+	add     ip, r1, #TI_CPU_SAVE
--+	ldr     r3, [r2, #TI_TP_VALUE]
--+ ARM(	stmia	ip!, {r4 - sl, fp, sp, lr} )	@ Store most regs on stack
--+ THUMB(	stmia	ip!, {r4 - sl, fp}	   )	@ Store most regs on stack
--+ THUMB(	str	sp, [ip], #4		   )
--+ THUMB(	str	lr, [ip], #4		   )
-- #ifdef USE_DOMAINS
---    ldr     r6, [r2, #TI_CPU_DOMAIN]
--+	ldr     r6, [r2, #TI_CPU_DOMAIN]
-- #endif
-- 
---    clear_exclusive_monitor
---    set_tls r3, r4, r5
--+	clear_exclusive_monitor
--+	set_tls r3, r4, r5
-- #ifdef USE_DOMAINS
---    mcr     p15, 0, r6, c3, c0, 0           @ Set domain register
--+	mcr     p15, 0, r6, c3, c0, 0           @ Set domain register
-- #endif
---    fpu_switch r4
---    add	    r4, r2, #TI_CPU_SAVE
---    ldmia   r4, {r4 - sl, fp, sp, pc}       @ Load all regs saved previously
--+	fpu_switch r4
--+ ARM(	add	r4, r2, #TI_CPU_SAVE	   )
--+ ARM(	ldmia	r4, {r4 - sl, fp, sp, pc}  )	@ Load all regs saved previously
--+ THUMB(	add	ip, r2, #TI_CPU_SAVE	   )
--+ THUMB(	ldmia	ip!, {r4 - sl, fp}	   )	@ Load all regs saved previously
--+ THUMB(	ldr	sp, [ip], #4		   )
--+ THUMB(	ldr	pc, [ip]		   )
--+ENDPROC(rthal_thread_switch)
-- 
-- /*
--  * r4 = xnarch_thread_trampoline
--  * r5 = xnarchtcb_t *
--  */
-- ENTRY(rthal_thread_trampoline)
---    mov     r0, r5
---    mov     pc, r4
--+	mov	r0, r5
--+	mov	pc, r4
--+ENDPROC(rthal_thread_trampoline)
-- 
-- // vim: ts=4 et sw=4 sts=4
---- 
--1.7.2.5
--
-diff --git a/package/xenomai/xenomai.mk b/package/xenomai/xenomai.mk
-index f40cbdc..fbf20b5 100644
---- a/package/xenomai/xenomai.mk
-+++ b/package/xenomai/xenomai.mk
-@@ -7,7 +7,7 @@
- 
- XENOMAI_VERSION = $(call qstrip,$(BR2_PACKAGE_XENOMAI_VERSION))
- ifeq ($(XENOMAI_VERSION),)
--XENOMAI_VERSION = 2.6.1
-+XENOMAI_VERSION = 2.6.2.1
- endif
- 
- XENOMAI_SITE = http://download.gna.org/xenomai/stable/
-@@ -18,10 +18,6 @@ XENOMAI_LICENSE_FILES = debian/copyright include/COPYING src/skins/native/COPYIN
- 
- XENOMAI_INSTALL_STAGING = YES
- 
--ifeq ($(BR2_PACKAGE_XENOMAI_SMP),y)
--XENOMAI_CONF_OPT += --enable-smp
--endif
--
- XENOMAI_CONF_OPT += --includedir=/usr/include/xenomai/
- 
- ifeq ($(BR2_HAVE_DEVFILES),)
diff --git a/lab-data/realtime/rttest/data/linux-3.14-ipipe-add-aic5-support.patch b/lab-data/realtime/rttest/data/linux-3.14-ipipe-add-aic5-support.patch
new file mode 100644
index 0000000..ade0a60
--- /dev/null
+++ b/lab-data/realtime/rttest/data/linux-3.14-ipipe-add-aic5-support.patch
@@ -0,0 +1,143 @@
+From: Gilles Chanteperdrix <gilles.chanteperdrix at xenomai.org>
+
+diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
+index 8ef9c3e..ec539bc 100644
+--- a/arch/arm/mach-at91/gpio.c
++++ b/arch/arm/mach-at91/gpio.c
+@@ -994,6 +994,10 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks)
+ }
+ 
+ #if defined(CONFIG_IPIPE)
++extern unsigned long at91_aic_caps;
++#define AT91_AIC_CAP_AIC5	(1 << 0)
++#define has_aic5()		(at91_aic_caps & AT91_AIC_CAP_AIC5)
++
+ static void at91_enable_irqdesc(struct ipipe_domain *ipd, unsigned irq)
+ {
+ 	struct irq_desc *desc = irq_to_desc(irq);
+@@ -1089,6 +1093,9 @@ void at91_pic_muter_register(void)
+ 		.unmute = at91_unmute_pic,
+ 	};
+ 
++	if (has_aic5())
++		return;
++
+ 	ipipe_pic_muter_register(&at91_pic_muter);
+ }
+ #endif /* CONFIG_IPIPE */
+diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c
+index a18f229..be13b65 100644
+--- a/arch/arm/mach-at91/irq.c
++++ b/arch/arm/mach-at91/irq.c
+@@ -48,7 +48,7 @@ void __iomem *at91_aic_base;
+ static struct irq_domain *at91_aic_domain;
+ static struct device_node *at91_aic_np;
+ static unsigned int n_irqs = NR_AIC_IRQS;
+-static unsigned long at91_aic_caps = 0;
++unsigned long at91_aic_caps = 0;
+ 
+ /* AIC5 introduces a Source Select Register */
+ #define AT91_AIC_CAP_AIC5	(1 << 0)
+@@ -202,7 +202,7 @@ static void at91_aic_mask_irq(struct irq_data *d)
+ 	hard_cond_local_irq_restore(flags);
+ }
+ 
+-static void __maybe_unused at91_aic5_mask_irq(struct irq_data *d)
++static inline void at91_aic5_hard_mask_irq(struct irq_data *d)
+ {
+ 	/* Disable interrupt on AIC5 */
+ 	at91_aic_write(AT91_AIC5_SSR, d->hwirq & AT91_AIC5_INTSEL_MSK);
+@@ -211,6 +211,16 @@ static void __maybe_unused at91_aic5_mask_irq(struct irq_data *d)
+ 	clear_backup(d->hwirq);
+ }
+ 
++static void __maybe_unused at91_aic5_mask_irq(struct irq_data *d)
++{
++	unsigned long flags;
++
++	flags = hard_cond_local_irq_save();
++	at91_aic5_hard_mask_irq(d);
++	ipipe_lock_irq(d->irq);
++	hard_cond_local_irq_restore(flags);
++}
++
+ static inline void at91_aic_hard_unmask_irq(struct irq_data *d)
+ {
+ 	/* Enable interrupt on AIC */
+@@ -229,7 +239,7 @@ static void at91_aic_unmask_irq(struct irq_data *d)
+ 	hard_cond_local_irq_restore(flags);
+ }
+ 
+-static void __maybe_unused at91_aic5_unmask_irq(struct irq_data *d)
++static inline void at91_aic5_hard_unmask_irq(struct irq_data *d)
+ {
+ 	/* Enable interrupt on AIC5 */
+ 	at91_aic_write(AT91_AIC5_SSR, d->hwirq & AT91_AIC5_INTSEL_MSK);
+@@ -238,6 +248,16 @@ static void __maybe_unused at91_aic5_unmask_irq(struct irq_data *d)
+ 	set_backup(d->hwirq);
+ }
+ 
++static void __maybe_unused at91_aic5_unmask_irq(struct irq_data *d)
++{
++	unsigned long flags;
++
++	flags = hard_cond_local_irq_save();
++	at91_aic5_hard_unmask_irq(d);
++	ipipe_unlock_irq(d->irq);
++	hard_cond_local_irq_restore(flags);
++}
++
+ static void at91_aic_eoi(struct irq_data *d)
+ {
+ 	/*
+@@ -247,6 +267,11 @@ static void at91_aic_eoi(struct irq_data *d)
+ 	at91_aic_write(AT91_AIC_EOICR, 0);
+ }
+ 
++static void __maybe_unused at91_aic5_eoi(struct irq_data *d)
++{
++	at91_aic_write(AT91_AIC5_EOICR, 0);
++}
++
+ #ifdef CONFIG_IPIPE
+ static void at91_aic_hold_irq(struct irq_data *d)
+ {
+@@ -256,14 +281,24 @@ static void at91_aic_hold_irq(struct irq_data *d)
+ 
+ static void at91_aic_release_irq(struct irq_data *d)
+ {
++	unsigned long flags = hard_local_irq_save();
+ 	at91_aic_hard_unmask_irq(d);
++	hard_local_irq_restore(flags);
+ }
+-#endif /* CONFIG_IPIPE */
+ 
+-static void __maybe_unused at91_aic5_eoi(struct irq_data *d)
++static void __maybe_unused at91_aic5_hold_irq(struct irq_data *d)
+ {
+-	at91_aic_write(AT91_AIC5_EOICR, 0);
++	at91_aic5_hard_mask_irq(d);
++	at91_aic5_eoi(d);
++}
++
++static void __maybe_unused at91_aic5_release_irq(struct irq_data *d)
++{
++	unsigned long flags = hard_local_irq_save();
++	at91_aic5_hard_unmask_irq(d);
++	hard_local_irq_restore(flags);
+ }
++#endif /* CONFIG_IPIPE */
+ 
+ static unsigned long *at91_extern_irq;
+ 
+@@ -527,6 +562,10 @@ int __init at91_aic5_of_init(struct device_node *node,
+ 	at91_aic_chip.irq_mask		= at91_aic5_mask_irq;
+ 	at91_aic_chip.irq_unmask	= at91_aic5_unmask_irq;
+ 	at91_aic_chip.irq_eoi		= at91_aic5_eoi;
++#ifdef CONFIG_IPIPE
++	at91_aic_chip.irq_hold		= at91_aic5_hold_irq;
++	at91_aic_chip.irq_release	= at91_aic5_release_irq;
++#endif
+ 	at91_aic_irq_ops.map		= at91_aic5_irq_map;
+ 
+ 	err = at91_aic_of_common_init(node, parent);
diff --git a/lab-data/realtime/rttest/data/linux-3.5.7-igepv2-fix-pinmux.patch b/lab-data/realtime/rttest/data/linux-3.5.7-igepv2-fix-pinmux.patch
deleted file mode 100644
index 6732c84..0000000
--- a/lab-data/realtime/rttest/data/linux-3.5.7-igepv2-fix-pinmux.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-commit a71eb61c9d077ec5019b35da6c883d67fc43d002
-Author: Javier Martinez Canillas <javier at dowhile0.org>
-Date:   Tue Jul 10 03:57:32 2012 +0200
-
-    ARM: OMAP3: igep0020: set GPIO mode for mux mcspi1_cs2 pin
-    
-    According to the IGEPv2 Rev.C data-sheet the LAN9221i pin 14 (IRQ) is
-    connected to the OMAP3730 mcspi1_cs2 pin. Since this omap mux pin acts
-    as an IRQ line, it has to be configured as an input GPIO.
-    
-    IGEPv2 platform code sets the smsc911x_cfg->gpio_irq to GPIO 176 but
-    since the mux pin default mode is MODE7 (safe_mode) the driver fails
-    when trying to register the IRQ with the following error message:
-    
-    [    1.994598] smsc911x: Driver version 2008-10-21
-    [    3.704162] irq 272: nobody cared (try booting with the "irqpoll" option)
-    [    3.711364] [<c001a114>] (unwind_backtrace+0x0/0xf0) from [<c009a0d4>] (__report_bad_irq+0x20/0xbc)
-    [    3.720916] [<c009a0d4>] (__report_bad_irq+0x20/0xbc) from [<c009a41c>] (note_interrupt+0x1d8/0x238)
-    [    3.730560] [<c009a41c>] (note_interrupt+0x1d8/0x238) from [<c0098234>] (handle_irq_event_percpu+0xc0/0x260)
-    [    3.740936] [<c0098234>] (handle_irq_event_percpu+0xc0/0x260) from [<c0098410>] (handle_irq_event+0x3c/0x5c)
-    [    3.751312] [<c0098410>] (handle_irq_event+0x3c/0x5c) from [<c009abe0>] (handle_level_irq+0xac/0x10c)
-    [    3.761047] [<c009abe0>] (handle_level_irq+0xac/0x10c) from [<c0097a34>] (generic_handle_irq+0x30/0x48)
-    [    3.770935] [<c0097a34>] (generic_handle_irq+0x30/0x48) from [<c02a6b74>] (gpio_irq_handler+0x180/0x1d4)
-    [    3.780944] [<c02a6b74>] (gpio_irq_handler+0x180/0x1d4) from [<c0097a34>] (generic_handle_irq+0x30/0x48)
-    [    3.790954] [<c0097a34>] (generic_handle_irq+0x30/0x48) from [<c0013e18>] (handle_IRQ+0x4c/0xac)
-    [    3.800231] [<c0013e18>] (handle_IRQ+0x4c/0xac) from [<c000858c>] (omap3_intc_handle_irq+0x60/0x74)
-    [    3.809783] [<c000858c>] (omap3_intc_handle_irq+0x60/0x74) from [<c04979e4>] (__irq_svc+0x44/0x60)
-    [    3.819213] Exception stack(0xee42fde0 to 0xee42fe28)
-    [    3.824554] fde0: 00000001 00000001 00000000 00000000 60000013 c06cce14 c06cce14 00000110
-    [    3.833190] fe00: 00000000 c06ccdf4 60000013 ee41d000 fb058064 ee42fe28 c0089e08 c04976b4
-    [    3.841796] fe20: 20000013 ffffffff
-    [    3.845489] [<c04979e4>] (__irq_svc+0x44/0x60) from [<c04976b4>] (_raw_spin_unlock_irqrestore+0x34/0x44)
-    [    3.855499] [<c04976b4>] (_raw_spin_unlock_irqrestore+0x34/0x44) from [<c0099744>] (__setup_irq+0x1b8/0x3f0)
-    [    3.865875] [<c0099744>] (__setup_irq+0x1b8/0x3f0) from [<c0099a34>] (request_threaded_irq+0xb8/0x140)
-    [    3.875701] [<c0099a34>] (request_threaded_irq+0xb8/0x140) from [<c0487950>] (smsc911x_drv_probe+0x75c/0x11a4)
-    [    3.886260] [<c0487950>] (smsc911x_drv_probe+0x75c/0x11a4) from [<c02e9bcc>] (platform_drv_probe+0x18/0x1c)
-    [    3.906707] [<c02e89b8>] (driver_probe_device+0x90/0x210) from [<c02e8bcc>] (__driver_attach+0x94/0x98)
-    [    3.916625] [<c02e8bcc>] (__driver_attach+0x94/0x98) from [<c02e7298>] (bus_for_each_dev+0x50/0x7c)
-    [    3.926177] [<c02e7298>] (bus_for_each_dev+0x50/0x7c) from [<c02e81d4>] (bus_add_driver+0x184/0x248)
-    [    3.935821] [<c02e81d4>] (bus_add_driver+0x184/0x248) from [<c02e909c>] (driver_register+0x78/0x12c)
-    [    3.945465] [<c02e909c>] (driver_register+0x78/0x12c) from [<c0008648>] (do_one_initcall+0x34/0x178)
-    [    3.955108] [<c0008648>] (do_one_initcall+0x34/0x178) from [<c066e8f4>] (kernel_init+0xfc/0x1c0)
-    [    3.964385] [<c066e8f4>] (kernel_init+0xfc/0x1c0) from [<c00140b0>] (kernel_thread_exit+0x0/0x8)
-    [    3.973632] handlers:
-    [    3.976043] [<c034e2cc>] smsc911x_irqhandler
-    [    3.980560] Disabling IRQ #272
-    
-    Signed-off-by: Javier Martinez Canillas <javier at dowhile0.org>
-    Acked-by: Enric Balletbo i Serra <eballetbo at gmail.com>
-    Tested-by: Enric Balletbo i Serra <eballetbo at gmail.com>
-    Signed-off-by: Tony Lindgren <tony at atomide.com>
-
-diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
-index 7491529..2821448 100644
---- a/arch/arm/mach-omap2/board-igep0020.c
-+++ b/arch/arm/mach-omap2/board-igep0020.c
-@@ -554,6 +554,8 @@ static const struct usbhs_omap_board_data igep3_usbhs_bdata __initconst = {
- 
- #ifdef CONFIG_OMAP_MUX
- static struct omap_board_mux board_mux[] __initdata = {
-+	/* SMSC9221 LAN Controller ETH IRQ (GPIO_176) */
-+	OMAP3_MUX(MCSPI1_CS2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
- 	{ .reg_offset = OMAP_MUX_TERMINATOR },
- };
- #endif
diff --git a/labs/sysdev-real-time/sysdev-real-time.tex b/labs/sysdev-real-time/sysdev-real-time.tex
index 9633949..4fb2193 100644
--- a/labs/sysdev-real-time/sysdev-real-time.tex
+++ b/labs/sysdev-real-time/sysdev-real-time.tex
@@ -8,7 +8,8 @@ After this lab, you will:
 \item Be able to start processes with real-time priority.
 \item Be able to build a real-time application against the standard
 POSIX real-time API, and against Xenomai's POSIX skin.
-\item Have compared scheduling latency on your system, between a standard kernel and a kernel with Xenomai.
+\item Have compared scheduling latency on your system, between a
+  standard kernel and a kernel with Xenomai.
 \end{itemize}
 
 \section{Setup}
@@ -36,30 +37,22 @@ supports Xenomai.
 
 Let's build this with Buildroot.
 
-Reuse and extract the Buildroot 2013.02 sources. Apply the
-Buildroot patch \code{buildroot-2013.02-bump-xenomai-to-2.6.2.1.patch}
-from the lab {\em data} directory to your Buildroot sources. It
-upgrades the Xenomai version to 2.6.2.1, which allows to use the 3.5
-kernel. Apply the
-\code{0001-ext-toolchain-wrapper-fix-paths-if-executable-was-re.patch}
-patch from this buildroot lab's \code{data} directory. It fixes a bug
-in Buildroot's external toolchain logic.
-
-Configure Buildroot with the following settings, using the \code{/}
-command in \code{make menuconfig} to find parameters by their name:
+Reuse and extract the Buildroot 2014.05 sources. Configure Buildroot
+with the following settings, using the \code{/} command in \code{make
+  menuconfig} to find parameters by their name:
 
 \begin{itemize}
 \item \code{Target architecture}: \code{ARM (little endian)} 
-\item \code{Target Architecture Variant}: \code{cortex-a8}
+\item \code{Target Architecture Variant}: \code{cortex-a5}
 \item In \code{Toolchain}:
    \begin{itemize}
    \item \code{Toolchain type}: \code{External toolchain}
-   \item \code{Toolchain}: \code{Sourcery CodeBench ARM 2012.03}
+   \item \code{Toolchain}: \code{Sourcery CodeBench ARM 2013.11}
    \end{itemize}
 \item In \code{System configuration}: 
    \begin{itemize}
    \item \code{/dev management}: \code{Dynamic using devtmpfs only}
-   \item \code{Port to run a getty (login prompt) on}: \code{ttyO2}
+   \item \code{Port to run a getty (login prompt) on}: \code{ttyS0}
    \end{itemize}
 \item In \code{Package Selection for the target}:
    \begin{itemize}
@@ -93,44 +86,22 @@ cp data/* nfsroot/root
 
 \section{Compile a standard Linux kernel}
 
-Download the exact Linux 3.5.7 version. That's the most recent
-ARM Linux version that Xenomai 2.6.2.1 supports. You will have trouble
-applying Xenomai kernel patches otherwise.
-
-Apply the \code{linux-3.5.7-igepv2-fix-pinmux.patch} patch from this
-lab's \code{data} directory.
-
-Configure your kernel with the default configuration for the IGEPv2
-board.
-
-In the kernel configuration interface:
-\begin{itemize}
-\item Enable \code{CONFIG_DEVTMPFS} and \code{CONFIG_DEVTMPFS_MOUNT}
-      The root filesystem that we use has an empty \code{/dev}
-      directory, and we let the kernel populate it with the devices
-      present on the system.
-\item For the moment, remove \code{CONFIG_HIGH_RES_TIMERS},
-      to start by testing the kernel without high-resolution timers.
-\item Disable \code{CONFIG_SMP}, as Xenomai 2.6.1 does not support
-  yet multi-processing on OMAP (and the IGEPv2 is anyway a single
-  core processor).
-\item Disable \code{CONFIG_PROVE_LOCKING},
-  \code{CONFIG_DEBUG_LOCK_ALLOC}, \code{CONFIG_DEBUG_MUTEXES} and
-  \code{CONFIG_DEBUG_SPINLOCK}.
-\end{itemize}
+Reusing the kernel we previously compiled, make sure that you disable
+\code{CONFIG_PROVE_LOCKING}, \code{CONFIG_DEBUG_LOCK_ALLOC},
+\code{CONFIG_DEBUG_MUTEXES} and \code{CONFIG_DEBUG_SPINLOCK}.
 
-Boot the IGEP board by mounting the root filesystem that you built.
-As usual, login as \code{root}, there is no password.
+Boot the Xplained board by mounting the root filesystem that you
+built. As usual, login as \code{root}, there is no password.
 
 \section{Compiling with the POSIX RT library}
 
 The root filesystem was built with the GNU C library, because it has
 better support for the POSIX RT API.
 
-In our case, when we created this lab, uClibc
-didn't support the \code{clock_nanosleep} function used in our
-\code{rttest.c} program. {\em uClibc} also does not support priority
-inheritance on mutexes.
+In our case, when we created this lab, uClibc didn't support the
+\code{clock_nanosleep} function used in our \code{rttest.c}
+program. {\em uClibc} also does not support priority inheritance on
+mutexes.
 
 Therefore, we will need to compile our test application with the
 toolchain that Buildroot used.
@@ -139,12 +110,12 @@ Let's configure our \code{PATH} to use this toolchain:
 
 \begin{verbatim}
 export
-PATH=$HOME/felabs/realtime/rttest/buildroot-2013.02/output/host/usr/bin:$PATH
+PATH=$HOME/felabs/realtime/rttest/buildroot-2014.05/output/host/usr/bin:$PATH
 \end{verbatim}
 
-Have a look at the \code{rttest.c} source file available in \code{root/} in
-the \code{nfsroot/} directory. See how it shows the resolution of the
-\code{CLOCK_MONOTONIC} clock.
+Have a look at the \code{rttest.c} source file available in
+\code{root/} in the \code{nfsroot/} directory. See how it shows the
+resolution of the \code{CLOCK_MONOTONIC} clock.
 
 Now compile this program:
 \begin{verbatim}
@@ -152,14 +123,15 @@ arm-none-linux-gnueabi-gcc -o rttest rttest.c -lrt
 \end{verbatim}
 
 Execute the program on the board. Is the clock resolution good or bad?
-Compare it to the timer tick of your system, as defined by \code{CONFIG_HZ}.
+Compare it to the timer tick of your system, as defined by
+\code{CONFIG_HZ}.
 
 Obviously, this resolution will not provide accurate sleep times, and
 this is because our kernel doesn't use high-resolution timers. So
 let's enable the \code{CONFIG_HIGH_RES_TIMERS} option in the kernel
 configuration.
 
-Recompile your kernel, boot your IGEP board with the new version, and
+Recompile your kernel, boot your Xplained with the new version, and
 check the new resolution. Better, isn't it?
 
 \section{Testing the non-preemptible kernel}
@@ -189,11 +161,38 @@ the results.
 
 \section{Testing Xenomai scheduling latency}
 
-Prepare the kernel for Xenomai compilation:
+Since the Xplained is pretty recent, no Xenomai release has been made
+yet with support for it. Fortunately, it is supported in the current
+development tree.
+
+First, download a 3.14 Xenomai-enabled kernel. We tested the kernel
+and the patch with the revision \code{4d7a9fefe28a}, so that's what we
+are going to use.
+\begin{verbatim}
+cd $HOME/felabs/realtime/rttest
+git clone git://git.xenomai.org/ipipe-gch.git ipipe
+cd ipipe
+git checkout 4d7a9fefe28a
+\end{verbatim}
+
+Then, we're going to need an additional patch in order to support the
+SoC used in the Xplained. Apply the patch
+\code{data/linux-3.14-ipipe-add-aic5-support.patch}
+
+Now, download Xenomai's master, in order to apply the extra patches
+needed for the interaction with the Xenomai user-space components.
+
+\begin{verbatim}
+cd $HOME/felabs/realtime/rttest
+git clone git://git.xenomai.org/xenomai-2.6.git xenomai
+cd xenomai
+git checkout 589882956280
+\end{verbatim}
+
+Now, prepare our kernel for Xenomai compilation:
 \begin{verbatim}
-cd $HOME/felabs/realtime/rttest/buildroot-2013.02/
-./output/build/xenomai-2.6.2.1/scripts/prepare-kernel.sh \
-   --arch=arm --linux=/path/to/linux-3.5.7
+cd $HOME/felabs/realtime/rttest
+./xenomai/scripts/prepare-kernel.sh --arch=arm --linux=ipipe/
 \end{verbatim}
 
 Now, run the kernel configuration interface, and make sure that
@@ -212,7 +211,7 @@ source directory, and force Buildroot to build the host variant of
 {\em pkg-config}:
 
 \begin{verbatim}
-cd $HOME/felabs/realtime/rttest/buildroot-2013.02/
+cd $HOME/felabs/realtime/rttest/buildroot-2014.05/
 make host-pkgconf
 \end{verbatim}
 
@@ -222,7 +221,7 @@ compile \code{rttest} for the Xenomai POSIX skin:
 \small
 \begin{verbatim}
 cd $HOME/felabs/realtime/rttest/nfsroot/root
-export PATH=$HOME/felabs/realtime/rttest/buildroot-2013.02/output/host/usr/bin:$PATH
+export PATH=$HOME/felabs/realtime/rttest/buildroot-2014.05/output/host/usr/bin:$PATH
 arm-none-linux-gnueabi-gcc -o rttest rttest.c $(pkg-config --libs --cflags libxenomai_posix)
 \end{verbatim}
 \normalsize



More information about the training-materials-updates mailing list