[FE training-materials-updates] sysdev-real-time: few fixes

Alexandre Belloni alexandre.belloni at free-electrons.com
Mon Jul 28 10:18:18 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=7a060b275414207a2cfdf02c94106549469964b0

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

commit 7a060b275414207a2cfdf02c94106549469964b0
Author: Alexandre Belloni <alexandre.belloni at free-electrons.com>
Date:   Mon Jul 28 10:15:43 2014 +0200

    sysdev-real-time: few fixes
    
    Signed-off-by: Alexandre Belloni <alexandre.belloni at free-electrons.com>


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

7a060b275414207a2cfdf02c94106549469964b0
 .../data/linux-3.14-ipipe-add-aic5-support.patch   |  143 --------------------
 labs/sysdev-real-time/sysdev-real-time.tex         |   26 ++--
 2 files changed, 13 insertions(+), 156 deletions(-)

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
deleted file mode 100644
index ade0a60..0000000
--- a/lab-data/realtime/rttest/data/linux-3.14-ipipe-add-aic5-support.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-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/labs/sysdev-real-time/sysdev-real-time.tex b/labs/sysdev-real-time/sysdev-real-time.tex
index 7e83fe4..fb0b32a 100644
--- a/labs/sysdev-real-time/sysdev-real-time.tex
+++ b/labs/sysdev-real-time/sysdev-real-time.tex
@@ -42,8 +42,11 @@ 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-a5}
+\item In \code{Target}:
+   \begin{itemize}
+   \item \code{Target architecture}: \code{ARM (little endian)}
+   \item \code{Target Architecture Variant}: \code{cortex-a5}
+   \end{itemize}
 \item In \code{Toolchain}:
    \begin{itemize}
    \item \code{Toolchain type}: \code{External toolchain}
@@ -52,9 +55,9 @@ with the following settings, using the \code{/} command in \code{make
 \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{ttyS0}
+   \item in \code{getty options},  \code{TTY port}: \code{ttyS0}
    \end{itemize}
-\item In \code{Package Selection for the target}:
+\item In \code{Target packages}:
    \begin{itemize}
    \item Enable \code{Show packages that are also provided by busybox}.
          We need this to build the standard \code{netcat} command, not
@@ -119,7 +122,7 @@ resolution of the \code{CLOCK_MONOTONIC} clock.
 
 Now compile this program:
 \begin{verbatim}
-arm-none-linux-gnueabihf-gcc -o rttest rttest.c -lrt
+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?
@@ -143,8 +146,8 @@ Now, do the following tests:
 \item Test your program and at the same time, add some workload to the
   board, by running \code{/root/doload 300 > /dev/null 2>&1 &} on the
   board, and using \code{netcat 192.168.0.100 5566} on your
-  workstation in order to flood the network interface of the IGEP
-  board (where 192.168.0.100 is the IP address of the IGEP board).
+  workstation in order to flood the network interface of the Xplained
+  board (where 192.168.0.100 is the IP address of the Xplained board).
 \item Test your program again with the workload, but by running the
   program in the \code{SCHED_FIFO} scheduling class at priority 99,
   using the \code{chrt} command.
@@ -172,13 +175,9 @@ are going to use.
 cd $HOME/felabs/realtime/rttest
 git clone git://git.xenomai.org/ipipe-gch.git ipipe
 cd ipipe
-git checkout 4d7a9fefe28a
+git checkout 48da25366e93
 \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.
 
@@ -222,7 +221,8 @@ compile \code{rttest} for the Xenomai POSIX skin:
 \begin{verbatim}
 cd $HOME/felabs/realtime/rttest/nfsroot/root
 export PATH=$HOME/felabs/realtime/rttest/buildroot-2014.05/output/host/usr/bin:$PATH
-arm-none-linux-gnueabihf-gcc -o rttest rttest.c $(pkg-config --libs --cflags libxenomai_posix)
+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