Skip to contentSkip to conversation

i.MX31: Add initial support

PATCH Superseded [email protected] 2 participants 7 messages Jun 7, 2012 – Jun 11, 2012

Subsystems (2)

v9 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

v9 cover i.MX31: Add initial support

Changes since V8: Recovered my stuff-up from backup --- changes that
were in V7 are back in!
Andreas's comments addressed (except adding MAINTAINER field) Peter Maydell's comments against V6/7 are addressed.

Peter C

Signature · 2 lines
Dr Peter Chubb				        peter.chubb AT nicta.com.au
http://www.ssrg.nicta.com.au          Software Systems Research Group/NICTA
#4 lore raw

PATCH v9 4/5 i.MX31: Interrupt Controller

Implement the Freescale i.MX31 advanced vectored interrupt controller, at least to the extent it is used by Linux 3.x

Vectors are not implemented.

---
 Makefile.target |    2 
 hw/imx_avic.c   |  408 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 409 insertions(+), 1 deletion(-)
 create mode 100644 hw/imx_avic.c
Makefile.target +1 -1
Index: qemu-working/Makefile.target
===================================================================
@@ -368,7 +368,7 @@ obj-arm-y += vexpress.o
 obj-arm-y += strongarm.o
 obj-arm-y += collie.o
 obj-arm-y += pl041.o lm4549.o
-obj-arm-y += imx_serial.o imx_ccm.o imx_timer.o
+obj-arm-y += imx_serial.o imx_ccm.o imx_timer.o imx_avic.o
 obj-arm-$(CONFIG_FDT) += device_tree.o
 
 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
hw/imx_avic.c new file +408 -0

408 lines not on this page · raw message

#2 lore raw

PATCH v9 2/5 i.MX31: Clock Control Module

In reply to [email protected]

For Linux to be able to work out how fast its clocks are going, so that timer ticks come approximately at the right time, it needs to be able to query the clock control module (CCM).

This is the start of a CCM implementation. It currently knows only about the MCU, HSP and IPG clocks --- i.e., the ones used to feed the periodic and general purpose timers.

---
 Makefile.target |    2 
 hw/imx.h        |   10 +
 hw/imx_ccm.c    |  321 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 332 insertions(+), 1 deletion(-)
Makefile.target +1 -1
Index: qemu-working/Makefile.target
===================================================================
@@ -368,7 +368,7 @@ obj-arm-y += vexpress.o
 obj-arm-y += strongarm.o
 obj-arm-y += collie.o
 obj-arm-y += pl041.o lm4549.o
-obj-arm-y += imx_serial.o
+obj-arm-y += imx_serial.o imx_ccm.o
 obj-arm-$(CONFIG_FDT) += device_tree.o
 
 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
hw/imx.h +10 -0
Index: qemu-working/hw/imx.h
===================================================================
@@ -13,4 +13,14 @@
 
 void imx_serial_create(int uart, const target_phys_addr_t addr, qemu_irq irq);
 
+typedef enum  {
+    NOCLK,
+    MCU,
+    HSP,
+    IPG,
+    CLK_32k
+} IMXClk;
+
+uint32_t imx_clock_frequency(DeviceState *s, IMXClk clock);
+
 #endif /* IMX_H */
hw/imx_ccm.c new file +321 -0

321 lines not on this page · raw message

#1 lore raw

PATCH v9 1/5 i.MX: UART support

In reply to [email protected]

Implement the Freescale i.MX UART. This uart is used in a variety of SoCs, including some by Motorola, as well as in the Freescale i.MX series.

This patch gives only a `bare-bones' implementation, enough to run Linux or OKL4, but that's about it.

---
 Makefile.target |    1 
 hw/imx.h        |   16 +
 hw/imx_serial.c |  467 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 484 insertions(+)
 create mode 100644 hw/imx_serial.c
Makefile.target +1 -0
Index: qemu-working/Makefile.target
===================================================================
@@ -368,6 +368,7 @@ obj-arm-y += vexpress.o
 obj-arm-y += strongarm.o
 obj-arm-y += collie.o
 obj-arm-y += pl041.o lm4549.o
+obj-arm-y += imx_serial.o
 obj-arm-$(CONFIG_FDT) += device_tree.o
 
 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
hw/imx.h new file +16 -0
Index: qemu-working/hw/imx.h
===================================================================
@@ -0,0 +1,16 @@
+/*
+ * i.MX31 emulation
+ *
+ * Copyright (C) 2012 Peter Chubb
+ * NICTA
+ *
+ * This code is released under the GPL, version 2.0 or later
+ * See the file `../COPYING' for details.
+ */
+
+#ifndef IMX_H
+#define IMX_H
+
+void imx_serial_create(int uart, const target_phys_addr_t addr, qemu_irq irq);
+
+#endif /* IMX_H */
hw/imx_serial.c new file +467 -0

467 lines not on this page · raw message

#3 lore raw

PATCH v9 3/5 i.MX31: Timers

In reply to [email protected]

Implement the timers on the Freescale i.MX31 SoC.
This is not a complete implementation, but gives enough for Linux to boot and run. In particular external triggers, which are not useful under QEMU, are not implemented.

---
 Makefile.target |    2 
 hw/imx.h        |    8 
 hw/imx_timer.c  |  689 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 698 insertions(+), 1 deletion(-)
 create mode 100644 hw/imx_timer.c
Makefile.target +1 -1
Index: qemu-working/Makefile.target
===================================================================
@@ -368,7 +368,7 @@ obj-arm-y += vexpress.o
 obj-arm-y += strongarm.o
 obj-arm-y += collie.o
 obj-arm-y += pl041.o lm4549.o
-obj-arm-y += imx_serial.o imx_ccm.o
+obj-arm-y += imx_serial.o imx_ccm.o imx_timer.o
 obj-arm-$(CONFIG_FDT) += device_tree.o
 
 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
hw/imx.h +8 -0
Index: qemu-working/hw/imx.h
===================================================================
@@ -23,4 +23,12 @@ typedef enum  {
 
 uint32_t imx_clock_frequency(DeviceState *s, IMXClk clock);
 
+void imx_timerp_create(const target_phys_addr_t addr,
+                      qemu_irq irq,
+                      DeviceState *ccm);
+void imx_timerg_create(const target_phys_addr_t addr,
+                      qemu_irq irq,
+                      DeviceState *ccm);
+
+
 #endif /* IMX_H */
hw/imx_timer.c new file +689 -0

689 lines not on this page · raw message

#5 lore raw

PATCH v9 5/5 i.MX31: KZM-ARM11-01 evaluation board

In reply to [email protected]

Board support for Kyoto Micro's KZM-ARM11-01, an evaluation board built around the Freescale i.MX31.

---
 Makefile.target |    2 
 hw/kzm.c        |  156 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 157 insertions(+), 1 deletion(-)
 create mode 100644 hw/kzm.c
Makefile.target +1 -1
Index: qemu-working/Makefile.target
===================================================================
@@ -368,7 +368,7 @@ obj-arm-y += vexpress.o
 obj-arm-y += strongarm.o
 obj-arm-y += collie.o
 obj-arm-y += pl041.o lm4549.o
-obj-arm-y += imx_serial.o imx_ccm.o imx_timer.o imx_avic.o
+obj-arm-y += imx_serial.o imx_ccm.o imx_timer.o imx_avic.o kzm.o
 obj-arm-$(CONFIG_FDT) += device_tree.o
 
 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
hw/kzm.c new file +156 -0

156 lines not on this page · raw message

#6 lore raw
In reply to [email protected]

Am 07.06.2012 05:31, schrieb [email protected]:

Quoted 5 lines

Changes since V8: Recovered my stuff-up from backup --- changes that
were in V7 are back in!
Andreas's comments addressed

(except adding MAINTAINER field)

Why? Are you unwilling to maintain the code you contribute, or do you have questions on placement, format or something we can help resolve?

The Makefile system has changed by now. The way you're adding the files you could move them to hw/arm/Makefile.objs. I'd suggest to add a CONFIG_IMX=y in default-configs/arm-softmmu.mak and to add the CPU-independent files (serial, ccm, timer, even avic apparently) to hw/Makefile.objs instead using hw-obj-$(CONFIG_IMX).
For an example see my Tegra2 branch:
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/tegra

Andreas

Quoted 3 lines

Peter Maydell's comments against V6/7 are addressed.

Peter C

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg