ARM with Qemu

Nicolas VARONA nvarona at pactenovation.fr
Thu Apr 9 14:41:42 CEST 2015


Hi l4Hackers,

This post is to sum up and expose the solution of my problem. But before
everything, thanks a lot to Adam Lackorzynski which took a lot of time
helping me.

Briefly I sum up the initial problem:

My initial configuration was:
Qemu from Xilinx: QEMU emulator version 2.0.50
Ubuntu 14.04.1 LTS and x86-32bit
Toolchain : gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) or
"arm-linux-gnueabi-gcc" on aptitude

With the same Image of L4linux I had no input on Qemu and a kernel panic
on the Zynq board. Then, after a bare metal test with Fiasco, I had no
input on Qemu but it worked on the board.

To conclude, the Adam's fix of the Fiasco is added below. But the kernel
panic was due to the toolchain I used for the cross compilation.

My final configuration was:
Qemu from Xilinx: QEMU emulator version 2.0.50
Ubuntu 14.04.1 LTS and x86-32bit
Toolchain : 
1)gcc version 4.8.2 (Ubuntu/Linaro 4.8.2-16ubuntu4) or
"arm-linux-gnueabihf-gcc" on aptitude 
or
2)gcc version 4.7.1 20120402 (prerelease) (crosstool-NG
linaro-1.13.1-2012.04-20120426 - Linaro GCC 2012.04) from linaro
(arm-linux-gnueabi-gcc).
or
3)gcc version 4.8.2 20131014 (prerelease) (crosstool-NG
linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) from linaro
(arm-linux-gnueabihf-gcc)

Thanks a lot,

Nicolas

##############################################
FIX
##############################################
Index: src/drivers/uart.cpp
===================================================================
--- src/drivers/uart.cpp	(revision 66)
+++ src/drivers/uart.cpp	(working copy)
@@ -61,6 +61,10 @@
    * (abstract) Get the IRQ assigned to the port.
    */
   int irq() const;
+
+  /**
+   * (abstract) Acknowledge UART interrupt.
+   */
   void irq_ack();
 
   Address base() const;
@@ -114,11 +118,6 @@
   return UART | IN | OUT;
 }
 
-IMPLEMENT_DEFAULT
-void
-Uart::irq_ack()
-{}
-
 
//----------------------------------------------------------------------
-----
 INTERFACE [libuart]:
 
@@ -202,3 +201,15 @@
   uart()->enable_rx_irq(false);
 }
 
+IMPLEMENT
+void Uart::irq_ack()
+{
+  uart()->irq_ack();
+}
+
+//---------------------------------------------------------------------
------
+IMPLEMENTATION [!libuart]:
+
+IMPLEMENT_DEFAULT
+void Uart::irq_ack()
+{}
Index: src/lib/uart/uart_base.h
===================================================================
--- src/lib/uart/uart_base.h	(revision 66)
+++ src/lib/uart/uart_base.h	(working copy)
@@ -33,6 +33,8 @@
     virtual int char_avail() const = 0;
     virtual int write(char const *s, unsigned long count) const = 0;
 
+    virtual void irq_ack() {}
+
     virtual bool enable_rx_irq(bool = true) { return false; }
     Transfer_mode mode() const { return _mode; }
     Baud_rate rate() const { return _rate; }
Index: src/lib/uart/uart_cadence.cc
===================================================================
--- src/lib/uart/uart_cadence.cc	(revision 66)
+++ src/lib/uart/uart_cadence.cc	(working copy)
@@ -117,4 +117,9 @@
 
     return count;
   }
+
+  void Uart_cadence::irq_ack()
+  {
+    _regs->write<unsigned>(ISR, IXR_RXOVR);
+  }
 };
Index: src/lib/uart/uart_cadence.h
===================================================================
--- src/lib/uart/uart_cadence.h	(revision 66)
+++ src/lib/uart/uart_cadence.h	(working copy)
@@ -23,5 +23,6 @@
     int char_avail() const;
     inline void out_char(char c) const;
     int write(char const *s, unsigned long count) const;
+    void irq_ack();
   };
 };





More information about the l4-hackers mailing list