Skip to contentSkip to conversation

refactor OMAP implementation

PATCH In review cmchao 2 participants 14 messages May 31, 2010 – Jun 30, 2010 Kbuild

lore
Share & tools
lore

cmchao

author
#0 lore raw

v2 cover refactor OMAP implementation

The following changes since commit aa6f63fff62faf2fe9ffba5a789675d49293614d Blue Swirl:
mc146818rtc: improve debugging
Add a separate flag for debugging coalesced interrupts.

The patches almostly base on http://meego.gitorious.org/qemu-maemo/qemu work and act as preparatory work to merge their OMAP3 and beagleboard support. All the work are to separate modules, which will be shared or extended in OMAP3 implementation and make some local function static

change from v1 :
1 fix missing static declaration leading to compilation error in patch #12 2 rebase to newer upstream

[PATCH v2 01/12] hw/omap1.c : separate gpio module
[PATCH v2 02/12] hw/omap2.c : separate gpio module
[PATCH v2 03/12] hw/omap2.c : separate gptimer module
[PATCH v2 04/12] hw/omap2.c : separate synctimer module
[PATCH v2 05/12] hw/omap2.c : separate gpmc(general purpose memory controller) [PATCH v2 06/12] hw/omap2.c : separate sdrc (sdram controller)
[PATCH v2 07/12] hw/omap1.c : separate interrupt controller module
[PATCH v2 08/12] hw/omap2.c : separate spi module
[PATCH v2 09/12] hw/omap2.c : separate tap module(Test-Chip-level)
[PATCH v2 10/12] hw/omwp2.c : separate l4 interconnect module
[PATCH v2 11/12] hw/omap1.c : separate uart module
[PATCH v2 12/12] hw/omap : make local function static and remove declaration from header

author
#1 lore raw

PATCH v2 1/12 hw/omap1.c : separate gpio module

---
 Makefile.target |    2 +-
 hw/omap.h       |    1 +
 hw/omap1.c      |  181 -------------------------------------------------
 hw/omap_gpio.c  |  202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 204 insertions(+), 182 deletions(-)
 create mode 100644 hw/omap_gpio.c
Makefile.target +1 -1
index d06c679..5628557 100644
@@ -264,7 +264,7 @@ obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
 obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 obj-arm-y += gumstix.o
 obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
-obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
+obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o
 obj-arm-y += omap2.o omap_dss.o soc_dma.o
 obj-arm-y += omap_sx1.o palm.o tsc210x.o
 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
hw/omap.h +1 -0
index d305779..ebd166f 100644
@@ -671,6 +671,7 @@ void omap_mpuio_key(struct omap_mpuio_s *s, int row, int col, int down);
 struct omap_gpio_s;
 struct omap_gpio_s *omap_gpio_init(target_phys_addr_t base,
                 qemu_irq irq, omap_clk clk);
+void omap_gpio_reset(struct omap_gpio_s *s);
 qemu_irq *omap_gpio_in_get(struct omap_gpio_s *s);
 void omap_gpio_out_set(struct omap_gpio_s *s, int line, qemu_irq handler);
 
hw/omap1.c +0 -181

187 lines not on this page · raw message

hw/omap_gpio.c new file +202 -0

202 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#2 lore raw

PATCH v2 2/12 hw/omap2.c : separate gpio module

In reply to cmchao
---
 hw/omap.h      |    3 +
 hw/omap2.c     |  523 --------------------------------------------------------
 hw/omap_gpio.c |  523 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 526 insertions(+), 523 deletions(-)
hw/omap.h +3 -0
index ebd166f..a37ee54 100644
@@ -668,6 +668,7 @@ qemu_irq *omap_mpuio_in_get(struct omap_mpuio_s *s);
 void omap_mpuio_out_set(struct omap_mpuio_s *s, int line, qemu_irq handler);
 void omap_mpuio_key(struct omap_mpuio_s *s, int row, int col, int down);
 
+/* omap1 gpio module interface */
 struct omap_gpio_s;
 struct omap_gpio_s *omap_gpio_init(target_phys_addr_t base,
                 qemu_irq irq, omap_clk clk);
@@ -675,9 +676,11 @@ void omap_gpio_reset(struct omap_gpio_s *s);
 qemu_irq *omap_gpio_in_get(struct omap_gpio_s *s);
 void omap_gpio_out_set(struct omap_gpio_s *s, int line, qemu_irq handler);
 
+/* omap2 gpio interface */
 struct omap_gpif_s;
 struct omap_gpif_s *omap2_gpio_init(struct omap_target_agent_s *ta,
                 qemu_irq *irq, omap_clk *fclk, omap_clk iclk, int modules);
+void omap_gpif_reset(struct omap_gpif_s *s);
 qemu_irq *omap2_gpio_in_get(struct omap_gpif_s *s, int start);
 void omap2_gpio_out_set(struct omap_gpif_s *s, int line, qemu_irq handler);
 
hw/omap2.c +0 -523

529 lines not on this page · raw message

hw/omap_gpio.c +523 -0

526 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#3 lore raw

PATCH v2 3/12 hw/omap2.c : separate gptimer module

In reply to cmchao
---
 Makefile.target   |    2 +-
 hw/omap.h         |    2 +
 hw/omap2.c        |  462 --------------------------------------------------
 hw/omap_gptimer.c |  484 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 487 insertions(+), 463 deletions(-)
 create mode 100644 hw/omap_gptimer.c
Makefile.target +1 -1
index 5628557..70b0b37 100644
@@ -265,7 +265,7 @@ obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 obj-arm-y += gumstix.o
 obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o
-obj-arm-y += omap2.o omap_dss.o soc_dma.o
+obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o
 obj-arm-y += omap_sx1.o palm.o tsc210x.o
 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
 obj-arm-y += mst_fpga.o mainstone.o
hw/omap.h +2 -0
index a37ee54..14fdb6f 100644
@@ -631,9 +631,11 @@ struct omap_mpu_timer_s;
 struct omap_mpu_timer_s *omap_mpu_timer_init(target_phys_addr_t base,
                 qemu_irq irq, omap_clk clk);
 
+/* OMAP2 gp timer */
 struct omap_gp_timer_s;
 struct omap_gp_timer_s *omap_gp_timer_init(struct omap_target_agent_s *ta,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk);
+void omap_gp_timer_reset(struct omap_gp_timer_s *s);
 
 struct omap_watchdog_timer_s;
 struct omap_watchdog_timer_s *omap_wd_timer_init(target_phys_addr_t base,
hw/omap2.c +0 -462

468 lines not on this page · raw message

hw/omap_gptimer.c new file +484 -0

484 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#4 lore raw

PATCH v2 4/12 hw/omap2.c : separate synctimer module

In reply to cmchao
---
 Makefile.target     |    2 +-
 hw/omap.h           |   11 +++---
 hw/omap2.c          |   72 +-------------------------------------
 hw/omap_synctimer.c |   96 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 104 insertions(+), 77 deletions(-)
 create mode 100644 hw/omap_synctimer.c
Makefile.target +1 -1
index 70b0b37..f6234bc 100644
@@ -265,7 +265,7 @@ obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 obj-arm-y += gumstix.o
 obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o
-obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o
+obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o
 obj-arm-y += omap_sx1.o palm.o tsc210x.o
 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
 obj-arm-y += mst_fpga.o mainstone.o
hw/omap.h +5 -6
index 14fdb6f..b898230 100644
@@ -645,8 +645,11 @@ struct omap_32khz_timer_s;
 struct omap_32khz_timer_s *omap_os_timer_init(target_phys_addr_t base,
                 qemu_irq irq, omap_clk clk);
 
-void omap_synctimer_init(struct omap_target_agent_s *ta,
+/* OMAP2 sysctimer */
+struct omap_synctimer_s;
+struct omap_synctimer_s *omap_synctimer_init(struct omap_target_agent_s *ta,
                 struct omap_mpu_state_s *mpu, omap_clk fclk, omap_clk iclk);
+void omap_synctimer_reset(struct omap_synctimer_s *s);
 
 struct omap_tipb_bridge_s;
 struct omap_tipb_bridge_s *omap_tipb_bridge_init(target_phys_addr_t base,
@@ -939,11 +942,7 @@ struct omap_mpu_state_s {
     struct omap_l4_s *l4;
 
     struct omap_gp_timer_s *gptimer[12];
-
-    struct omap_synctimer_s {
-        uint32_t val;
-        uint16_t readh;
-    } synctimer;
+    struct omap_synctimer_s *synctimer;
 
     struct omap_prcm_s *prcm;
     struct omap_sdrc_s *sdrc;
hw/omap2.c +2 -70

90 lines not on this page · raw message

hw/omap_synctimer.c new file +96 -0

96 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#5 lore raw

PATCH v2 5/12 hw/omap2.c : separate gpmc(general purpose memory controller)

In reply to cmchao
---
 Makefile.target |    2 +-
 hw/omap.h       |    2 +
 hw/omap2.c      |  396 ----------------------------------------------------
 hw/omap_gpmc.c  |  419 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 422 insertions(+), 397 deletions(-)
 create mode 100644 hw/omap_gpmc.c
Makefile.target +1 -1
index f6234bc..b932f79 100644
@@ -265,7 +265,7 @@ obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 obj-arm-y += gumstix.o
 obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o
-obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o
+obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o
 obj-arm-y += omap_sx1.o palm.o tsc210x.o
 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
 obj-arm-y += mst_fpga.o mainstone.o
hw/omap.h +2 -0
index b898230..c596953 100644
@@ -93,8 +93,10 @@ struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta,
 struct omap_sdrc_s;
 struct omap_sdrc_s *omap_sdrc_init(target_phys_addr_t base);
 
+/* OMAP2 general purpose memory controller */
 struct omap_gpmc_s;
 struct omap_gpmc_s *omap_gpmc_init(target_phys_addr_t base, qemu_irq irq);
+void omap_gpmc_reset(struct omap_gpmc_s *s);
 void omap_gpmc_attach(struct omap_gpmc_s *s, int cs, int iomemtype,
                 void (*base_upd)(void *opaque, target_phys_addr_t new),
                 void (*unmap)(void *opaque), void *opaque);
hw/omap2.c +0 -396

402 lines not on this page · raw message

hw/omap_gpmc.c new file +419 -0

419 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#6 lore raw

PATCH v2 6/12 hw/omap2.c : separate sdrc (sdram controller)

In reply to cmchao
---
 Makefile.target |    2 +-
 hw/omap.h       |    2 +
 hw/omap2.c      |  144 ------------------------------------------------
 hw/omap_sdrc.c  |  165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 168 insertions(+), 145 deletions(-)
 create mode 100644 hw/omap_sdrc.c
Makefile.target +1 -1
index b932f79..65be71b 100644
@@ -265,7 +265,7 @@ obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 obj-arm-y += gumstix.o
 obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o
-obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o
+obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o omap_sdrc.o
 obj-arm-y += omap_sx1.o palm.o tsc210x.o
 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
 obj-arm-y += mst_fpga.o mainstone.o
hw/omap.h +2 -0
index c596953..ad4a465 100644
@@ -90,8 +90,10 @@ struct omap_sysctl_s;
 struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta,
                 omap_clk iclk, struct omap_mpu_state_s *mpu);
 
+/* OMAP2 SDRAM controller */
 struct omap_sdrc_s;
 struct omap_sdrc_s *omap_sdrc_init(target_phys_addr_t base);
+void omap_sdrc_reset(struct omap_sdrc_s *s);
 
 /* OMAP2 general purpose memory controller */
 struct omap_gpmc_s;
hw/omap2.c +0 -144

150 lines not on this page · raw message

hw/omap_sdrc.c new file +165 -0

165 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#7 lore raw

PATCH v2 7/12 hw/omap1.c : separate interrupt controller module

In reply to cmchao
---
 Makefile.target |    2 +-
 hw/omap.h       |    2 +
 hw/omap1.c      |  576 +----------------------------------------------------
 hw/omap_intc.c  |  598 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 603 insertions(+), 575 deletions(-)
 create mode 100644 hw/omap_intc.c
Makefile.target +1 -1
index 65be71b..5afafe3 100644
@@ -264,7 +264,7 @@ obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
 obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 obj-arm-y += gumstix.o
 obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
-obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o
+obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o omap_intc.o
 obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o omap_sdrc.o
 obj-arm-y += omap_sx1.o palm.o tsc210x.o
 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
hw/omap.h +2 -0
index ad4a465..ea23ec9 100644
@@ -71,6 +71,7 @@ target_phys_addr_t omap_l4_attach(struct omap_target_agent_s *ta, int region,
                 int iotype);
 # define l4_register_io_memory	cpu_register_io_memory
 
+/* OMAP interrupt controller */
 struct omap_intr_handler_s;
 struct omap_intr_handler_s *omap_inth_init(target_phys_addr_t base,
                 unsigned long size, unsigned char nbanks, qemu_irq **pins,
@@ -80,6 +81,7 @@ struct omap_intr_handler_s *omap2_inth_init(target_phys_addr_t base,
                 qemu_irq parent_irq, qemu_irq parent_fiq,
                 omap_clk fclk, omap_clk iclk);
 void omap_inth_reset(struct omap_intr_handler_s *s);
+qemu_irq omap_inth_get_pin(struct omap_intr_handler_s *s, int n);
 
 struct omap_prcm_s;
 struct omap_prcm_s *omap_prcm_init(struct omap_target_agent_s *ta,
hw/omap1.c +2 -574

588 lines not on this page · raw message

hw/omap_intc.c new file +598 -0

598 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#8 lore raw

PATCH v2 8/12 hw/omap2.c : separate spi module

In reply to cmchao
---
 Makefile.target |    2 +-
 hw/omap.h       |    2 +
 hw/omap2.c      |  323 ---------------------------------------------------
 hw/omap_spi.c   |  346 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 349 insertions(+), 324 deletions(-)
 create mode 100644 hw/omap_spi.c
Makefile.target +1 -1
index 5afafe3..d532dc8 100644
@@ -265,7 +265,7 @@ obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 obj-arm-y += gumstix.o
 obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o omap_intc.o
-obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o omap_sdrc.o
+obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o omap_sdrc.o omap_spi.o
 obj-arm-y += omap_sx1.o palm.o tsc210x.o
 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
 obj-arm-y += mst_fpga.o mainstone.o
hw/omap.h +2 -0
index ea23ec9..fef495a 100644
@@ -706,12 +706,14 @@ struct omap_uwire_s *omap_uwire_init(target_phys_addr_t base,
 void omap_uwire_attach(struct omap_uwire_s *s,
                 uWireSlave *slave, int chipselect);
 
+/* OMAP2 spi */
 struct omap_mcspi_s;
 struct omap_mcspi_s *omap_mcspi_init(struct omap_target_agent_s *ta, int chnum,
                 qemu_irq irq, qemu_irq *drq, omap_clk fclk, omap_clk iclk);
 void omap_mcspi_attach(struct omap_mcspi_s *s,
                 uint32_t (*txrx)(void *opaque, uint32_t, int), void *opaque,
                 int chipselect);
+void omap_mcspi_reset(struct omap_mcspi_s *s);
 
 struct omap_rtc_s;
 struct omap_rtc_s *omap_rtc_init(target_phys_addr_t base,
hw/omap2.c +0 -323

329 lines not on this page · raw message

hw/omap_spi.c new file +346 -0

346 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#9 lore raw

PATCH v2 9/12 hw/omap2.c : separate tap module(Test-Chip-level)

In reply to cmchao
---
 Makefile.target |    2 +-
 hw/omap2.c      |   90 --------------------------------------------
 hw/omap_tap.c   |  112 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 113 insertions(+), 91 deletions(-)
 create mode 100644 hw/omap_tap.c
Makefile.target +1 -1
index d532dc8..b80d5e0 100644
@@ -265,7 +265,7 @@ obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 obj-arm-y += gumstix.o
 obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o omap_intc.o
-obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o omap_sdrc.o omap_spi.o
+obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o
 obj-arm-y += omap_sx1.o palm.o tsc210x.o
 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
 obj-arm-y += mst_fpga.o mainstone.o
hw/omap2.c +0 -90

96 lines not on this page · raw message

hw/omap_tap.c new file +112 -0

112 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#10 lore raw

PATCH v2 10/12 hw/omwp2.c : separate l4 interconnect module

In reply to cmchao
---
 Makefile.target |    3 +-
 hw/omap.h       |   37 ++++++--
 hw/omap2.c      |  269 ++-----------------------------------------------------
 hw/omap_l4.c    |  271 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 307 insertions(+), 273 deletions(-)
 create mode 100644 hw/omap_l4.c
Makefile.target +2 -1
index b80d5e0..55dbf67 100644
@@ -265,7 +265,8 @@ obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 obj-arm-y += gumstix.o
 obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o omap_intc.o
-obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o
+obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \
+		omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o
 obj-arm-y += omap_sx1.o palm.o tsc210x.o
 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
 obj-arm-y += mst_fpga.o mainstone.o
hw/omap.h +28 -9
index fef495a..34443b4 100644
@@ -61,15 +61,40 @@ void omap_clk_setrate(omap_clk clk, int divide, int multiply);
 int64_t omap_clk_getrate(omap_clk clk);
 void omap_clk_reparent(omap_clk clk, omap_clk parent);
 
-/* omap[123].c */
+/* OMAP2 l4 Interconnect */
 struct omap_l4_s;
+struct omap_l4_region_s {
+    target_phys_addr_t offset;
+    size_t size;
+    int access;
+};
+struct omap_l4_agent_info_s {
+    int ta;
+    int region;
+    int regions;
+    int ta_region;
+};
+struct omap_target_agent_s {
+    struct omap_l4_s *bus;
+    int regions;
+    const struct omap_l4_region_s *start;
+    target_phys_addr_t base;
+    uint32_t component;
+    uint32_t control;
+    uint32_t status;
+};
 struct omap_l4_s *omap_l4_init(target_phys_addr_t base, int ta_num);
 
 struct omap_target_agent_s;
-struct omap_target_agent_s *omap_l4ta_get(struct omap_l4_s *bus, int cs);
+struct omap_target_agent_s *omap_l4ta_get(
+    struct omap_l4_s *bus,
+    const struct omap_l4_region_s *regions,
+    const struct omap_l4_agent_info_s *agents,
+    int cs);
 target_phys_addr_t omap_l4_attach(struct omap_target_agent_s *ta, int region,
                 int iotype);
-# define l4_register_io_memory	cpu_register_io_memory
+int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read,
+                CPUWriteMemoryFunc * const *mem_write, void *opaque);
 
 /* OMAP interrupt controller */
 struct omap_intr_handler_s;
@@ -1146,10 +1171,4 @@ inline static int debug_register_io_memory(CPUReadMemoryFunc * const *mem_read,
 /* Define when we want to reduce the number of IO regions registered.  */
 /*# define L4_MUX_HACK*/
 
-# ifdef L4_MUX_HACK
-#  undef l4_register_io_memory
-int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read,
-                          CPUWriteMemoryFunc * const *mem_write, void *opaque);
-# endif
-
 #endif /* hw_omap_h */
hw/omap2.c +6 -263

290 lines not on this page · raw message

hw/omap_l4.c new file +271 -0

271 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#11 lore raw

PATCH v2 11/12 hw/omap1.c : separate uart module

In reply to cmchao
---
 Makefile.target |    3 +-
 hw/omap1.c      |  170 ------------------------------------------------
 hw/omap_uart.c  |  194 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 196 insertions(+), 171 deletions(-)
 create mode 100644 hw/omap_uart.c
Makefile.target +2 -1
index 55dbf67..b86a110 100644
@@ -264,7 +264,8 @@ obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
 obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 obj-arm-y += gumstix.o
 obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
-obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o omap_intc.o
+obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o \
+		omap_gpio.o omap_intc.o omap_uart.o
 obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \
 		omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o
 obj-arm-y += omap_sx1.o palm.o tsc210x.o
hw/omap1.c +0 -170

176 lines not on this page · raw message

hw/omap_uart.c new file +194 -0

194 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#12 lore raw

PATCH v2 12/12 hw/omap : make local function static and remove declaration from header

In reply to cmchao
---
 hw/omap.h  |   36 ------------------------------------
 hw/omap1.c |   12 ++++++------
 hw/omap2.c |    6 +++---
 3 files changed, 9 insertions(+), 45 deletions(-)
hw/omap.h +0 -36
index 34443b4..18eb72b 100644
@@ -108,15 +108,6 @@ struct omap_intr_handler_s *omap2_inth_init(target_phys_addr_t base,
 void omap_inth_reset(struct omap_intr_handler_s *s);
 qemu_irq omap_inth_get_pin(struct omap_intr_handler_s *s, int n);
 
-struct omap_prcm_s;
-struct omap_prcm_s *omap_prcm_init(struct omap_target_agent_s *ta,
-                qemu_irq mpu_int, qemu_irq dsp_int, qemu_irq iva_int,
-                struct omap_mpu_state_s *mpu);
-
-struct omap_sysctl_s;
-struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta,
-                omap_clk iclk, struct omap_mpu_state_s *mpu);
-
 /* OMAP2 SDRAM controller */
 struct omap_sdrc_s;
 struct omap_sdrc_s *omap_sdrc_init(target_phys_addr_t base);
@@ -658,34 +649,18 @@ struct omap_dma_lcd_channel_s {
 # define OMAP24XX_DMA_EXT_DMAREQ5	64
 
 /* omap[123].c */
-struct omap_mpu_timer_s;
-struct omap_mpu_timer_s *omap_mpu_timer_init(target_phys_addr_t base,
-                qemu_irq irq, omap_clk clk);
-
 /* OMAP2 gp timer */
 struct omap_gp_timer_s;
 struct omap_gp_timer_s *omap_gp_timer_init(struct omap_target_agent_s *ta,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk);
 void omap_gp_timer_reset(struct omap_gp_timer_s *s);
 
-struct omap_watchdog_timer_s;
-struct omap_watchdog_timer_s *omap_wd_timer_init(target_phys_addr_t base,
-                qemu_irq irq, omap_clk clk);
-
-struct omap_32khz_timer_s;
-struct omap_32khz_timer_s *omap_os_timer_init(target_phys_addr_t base,
-                qemu_irq irq, omap_clk clk);
-
 /* OMAP2 sysctimer */
 struct omap_synctimer_s;
 struct omap_synctimer_s *omap_synctimer_init(struct omap_target_agent_s *ta,
                 struct omap_mpu_state_s *mpu, omap_clk fclk, omap_clk iclk);
 void omap_synctimer_reset(struct omap_synctimer_s *s);
 
-struct omap_tipb_bridge_s;
-struct omap_tipb_bridge_s *omap_tipb_bridge_init(target_phys_addr_t base,
-                qemu_irq abort_irq, omap_clk clk);
-
 struct omap_uart_s;
 struct omap_uart_s *omap_uart_init(target_phys_addr_t base,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk,
@@ -740,10 +715,6 @@ void omap_mcspi_attach(struct omap_mcspi_s *s,
                 int chipselect);
 void omap_mcspi_reset(struct omap_mcspi_s *s);
 
-struct omap_rtc_s;
-struct omap_rtc_s *omap_rtc_init(target_phys_addr_t base,
-                qemu_irq *irq, omap_clk clk);
-
 struct I2SCodec {
     void *opaque;
 
@@ -773,16 +744,9 @@ struct omap_mcbsp_s *omap_mcbsp_init(target_phys_addr_t base,
                 qemu_irq *irq, qemu_irq *dma, omap_clk clk);
 void omap_mcbsp_i2s_attach(struct omap_mcbsp_s *s, I2SCodec *slave);
 
-struct omap_lpg_s;
-struct omap_lpg_s *omap_lpg_init(target_phys_addr_t base, omap_clk clk);
-
 void omap_tap_init(struct omap_target_agent_s *ta,
                 struct omap_mpu_state_s *mpu);
 
-struct omap_eac_s;
-struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,
-                qemu_irq irq, qemu_irq *drq, omap_clk fclk, omap_clk iclk);
-
 /* omap_lcdc.c */
 struct omap_lcd_panel_s;
 void omap_lcdc_reset(struct omap_lcd_panel_s *s);
hw/omap1.c +6 -6
index 301eec5..d400bbb 100644
@@ -247,7 +247,7 @@ static void omap_mpu_timer_reset(struct omap_mpu_timer_s *s)
     s->it_ena = 1;
 }
 
-struct omap_mpu_timer_s *omap_mpu_timer_init(target_phys_addr_t base,
+static struct omap_mpu_timer_s *omap_mpu_timer_init(target_phys_addr_t base,
                 qemu_irq irq, omap_clk clk)
 {
     int iomemtype;
@@ -371,7 +371,7 @@ static void omap_wd_timer_reset(struct omap_watchdog_timer_s *s)
     omap_timer_update(&s->timer);
 }
 
-struct omap_watchdog_timer_s *omap_wd_timer_init(target_phys_addr_t base,
+static struct omap_watchdog_timer_s *omap_wd_timer_init(target_phys_addr_t base,
                 qemu_irq irq, omap_clk clk)
 {
     int iomemtype;
@@ -473,7 +473,7 @@ static void omap_os_timer_reset(struct omap_32khz_timer_s *s)
     s->timer.ar = 1;
 }
 
-struct omap_32khz_timer_s *omap_os_timer_init(target_phys_addr_t base,
+static struct omap_32khz_timer_s *omap_os_timer_init(target_phys_addr_t base,
                 qemu_irq irq, omap_clk clk)
 {
     int iomemtype;
@@ -1180,7 +1180,7 @@ static void omap_tipb_bridge_reset(struct omap_tipb_bridge_s *s)
     s->enh_control = 0x000f;
 }
 
-struct omap_tipb_bridge_s *omap_tipb_bridge_init(target_phys_addr_t base,
+static struct omap_tipb_bridge_s *omap_tipb_bridge_init(target_phys_addr_t base,
                 qemu_irq abort_irq, omap_clk clk)
 {
     int iomemtype;
@@ -2809,7 +2809,7 @@ static void omap_rtc_reset(struct omap_rtc_s *s)
     omap_rtc_tick(s);
 }
 
-struct omap_rtc_s *omap_rtc_init(target_phys_addr_t base,
+static struct omap_rtc_s *omap_rtc_init(target_phys_addr_t base,
                 qemu_irq *irq, omap_clk clk)
 {
     int iomemtype;
@@ -3506,7 +3506,7 @@ static void omap_lpg_clk_update(void *opaque, int line, int on)
     omap_lpg_update(s);
 }
 
-struct omap_lpg_s *omap_lpg_init(target_phys_addr_t base, omap_clk clk)
+static struct omap_lpg_s *omap_lpg_init(target_phys_addr_t base, omap_clk clk)
 {
     int iomemtype;
     struct omap_lpg_s *s = (struct omap_lpg_s *)
hw/omap2.c +3 -3
index 9bac954..26e6da4 100644
@@ -583,7 +583,7 @@ static CPUWriteMemoryFunc * const omap_eac_writefn[] = {
     omap_badwidth_write16,
 };
 
-struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,
+static struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,
                 qemu_irq irq, qemu_irq *drq, omap_clk fclk, omap_clk iclk)
 {
     int iomemtype;
@@ -1783,7 +1783,7 @@ static void omap_prcm_coldreset(struct omap_prcm_s *s)
     omap_prcm_reset(s);
 }
 
-struct omap_prcm_s *omap_prcm_init(struct omap_target_agent_s *ta,
+static struct omap_prcm_s *omap_prcm_init(struct omap_target_agent_s *ta,
                 qemu_irq mpu_int, qemu_irq dsp_int, qemu_irq iva_int,
                 struct omap_mpu_state_s *mpu)
 {
@@ -2157,7 +2157,7 @@ static void omap_sysctl_reset(struct omap_sysctl_s *s)
     s->padconf[0x44] = 0x00000800;
 }
 
-struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta,
+static struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta,
                 omap_clk iclk, struct omap_mpu_state_s *mpu)
 {
     int iomemtype;
Signature · 1 line
1.7.0.4
#13 lore raw
In reply to cmchao
Quoted 14 lines · cmchao

The following changes since commit aa6f63fff62faf2fe9ffba5a789675d49293614d Blue Swirl:
mc146818rtc: improve debugging
Add a separate flag for debugging coalesced interrupts.

The patches almostly base on http://meego.gitorious.org/qemu-maemo/qemu work and act as preparatory work to merge their OMAP3 and beagleboard support. All the work are to separate modules, which will be shared or extended in OMAP3 implementation and make some local function static

change from v1 :
1 fix missing static declaration leading to compilation error in patch #12 2 rebase to newer upstream

Quoted 14 lines

[PATCH v2 01/12] hw/omap1.c : separate gpio module
[PATCH v2 02/12] hw/omap2.c : separate gpio module
[PATCH v2 03/12] hw/omap2.c : separate gptimer module
[PATCH v2 04/12] hw/omap2.c : separate synctimer module
[PATCH v2 05/12] hw/omap2.c : separate gpmc(general purpose memory controller) [PATCH v2 06/12] hw/omap2.c : separate sdrc (sdram controller)
[PATCH v2 07/12] hw/omap1.c : separate interrupt controller module
[PATCH v2 08/12] hw/omap2.c : separate spi module
[PATCH v2 09/12] hw/omap2.c : separate tap module(Test-Chip-level)
[PATCH v2 10/12] hw/omwp2.c : separate l4 interconnect module
[PATCH v2 11/12] hw/omap1.c : separate uart module
[PATCH v2 12/12] hw/omap : make local function static and remove declaration from header

Thanks, all applied.

Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net