Skip to contentSkip to conversation

arm-devs queue (to go after target-arm queue)

GIT PULL New Peter Maydell 2 participants 7 messages Jan 26, 2012 – Jan 27, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi; this is a pullreq for my arm-devs queue, which is basically the Highbank patches.

There is a slight sequencing issue here: it would be better if this went in after the target-arm queue which I sent a pullreq for yesterday, because that includes a bugfix which Highbank depends on. It's not a disaster to put them in out of order, because it won't fail to build, it's just you don't get a working Highbank model until both bits are there and it seems aesthetically more pleasing for that to be the point where we commit the actual board model patch.

I'd also like this to go in before Anthony's QOM patchset, which is why I'm posting this now rather than waiting for target-arm to be pulled :-)

thanks
-- PMM

The following changes since commit 331636431af32ece373f4b1fb7c3ae9d0615e2a6:

vga: compile cirrus_vga in hwlib (2012-01-25 18:32:59 +0000)

are available in the git repository at:
git://git.linaro.org/people/pmaydell/qemu-arm.git arm-devs.for-upstream

Mark Langsdorf (1):
arm: add secondary cpu boot callbacks to arm_boot.c

Peter Maydell (1):
arm_boot: support board IDs more than 16 bits wide

Rob Herring (3):
Add xgmac ethernet model
ahci: add support for non-PCI based controllers
arm: SoC model for Calxeda Highbank

 Makefile.target |    2 +
 hw/arm-misc.h   |   17 +++
 hw/arm_boot.c   |   65 +++++++---
 hw/highbank.c   |  330 +++++++++++++++++++++++++++++++++++++++++++
 hw/ide/ahci.c   |   44 ++++++
 hw/xgmac.c      |  421 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 862 insertions(+), 17 deletions(-)
 create mode 100644 hw/highbank.c
 create mode 100644 hw/xgmac.c
#1 lore raw

PATCH 1/5 Add xgmac ethernet model

From: Rob Herring <[email protected]>

This adds very basic support for the xgmac ethernet core. Missing things include:

- statistics counters
- WoL support
- rx checksum offload
- chained descriptors (only linear descriptor ring)
- broadcast and multicast handling

---
 Makefile.target |    1 +
 hw/xgmac.c      |  421 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 422 insertions(+), 0 deletions(-)
 create mode 100644 hw/xgmac.c
Makefile.target +1 -0
index e554d33..063ec54 100644
@@ -340,6 +340,7 @@ obj-arm-y += arm_l2x0.o
 obj-arm-y += arm_mptimer.o
 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
 obj-arm-y += pl061.o
+obj-arm-y += xgmac.o
 obj-arm-y += arm-semi.o
 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
hw/xgmac.c new file +421 -0

421 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/5 ahci: add support for non-PCI based controllers

In reply to Peter Maydell

From: Rob Herring <[email protected]>

Add support for ahci on sysbus.

---
 hw/ide/ahci.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)
hw/ide/ahci.c +44 -0
index 0af201d..0309dd6 100644
@@ -25,6 +25,7 @@
 #include <hw/msi.h>
 #include <hw/pc.h>
 #include <hw/pci.h>
+#include <hw/sysbus.h>
 
 #include "monitor.h"
 #include "dma.h"
@@ -1214,3 +1215,46 @@ void ahci_reset(void *opaque)
         ahci_reset_port(&d->ahci, i);
     }
 }
+
+typedef struct SysbusAHCIState {
+    SysBusDevice busdev;
+    AHCIState ahci;
+    uint32_t num_ports;
+} SysbusAHCIState;
+
+static const VMStateDescription vmstate_sysbus_ahci = {
+    .name = "sysbus-ahci",
+    .unmigratable = 1,
+};
+
+static int sysbus_ahci_init(SysBusDevice *dev)
+{
+    SysbusAHCIState *s = FROM_SYSBUS(SysbusAHCIState, dev);
+    ahci_init(&s->ahci, &dev->qdev, s->num_ports);
+
+    sysbus_init_mmio(dev, &s->ahci.mem);
+    sysbus_init_irq(dev, &s->ahci.irq);
+
+    qemu_register_reset(ahci_reset, &s->ahci);
+    return 0;
+}
+
+static SysBusDeviceInfo sysbus_ahci_info = {
+    .qdev.name    = "sysbus-ahci",
+    .qdev.size    = sizeof(SysbusAHCIState),
+    .qdev.vmsd    = &vmstate_sysbus_ahci,
+    .qdev.props = (Property[]) {
+        DEFINE_PROP_UINT32("num-ports", SysbusAHCIState, num_ports, 1),
+        DEFINE_PROP_END_OF_LIST(),
+    },
+    .init         = sysbus_ahci_init,
+
+
+};
+
+static void sysbus_ahci_register(void)
+{
+    sysbus_register_withprop(&sysbus_ahci_info);
+}
+
+device_init(sysbus_ahci_register);
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/5 arm: add secondary cpu boot callbacks to arm_boot.c

In reply to Peter Maydell

From: Mark Langsdorf <[email protected]>

Create two functions, write_secondary_boot() and secondary_cpu_reset_hook(), to allow platforms more control of how secondary CPUs are brought up. The new functions default to NULL and aren't called unless they are populated so there are no changes to existing platform models.

---
 hw/arm-misc.h |   17 +++++++++++++++++
 hw/arm_boot.c |   54 +++++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 60 insertions(+), 11 deletions(-)
hw/arm-misc.h +17 -0
index 6e8ae6b..5e5204b 100644
@@ -30,12 +30,29 @@ struct arm_boot_info {
     const char *kernel_cmdline;
     const char *initrd_filename;
     target_phys_addr_t loader_start;
+    /* multicore boards that use the default secondary core boot functions
+     * need to put the address of the secondary boot code, the boot reg,
+     * and the GIC address in the next 3 values, respectively. boards that
+     * have their own boot functions can use these values as they want.
+     */
     target_phys_addr_t smp_loader_start;
     target_phys_addr_t smp_bootreg_addr;
     target_phys_addr_t smp_priv_base;
     int nb_cpus;
     int board_id;
     int (*atag_board)(const struct arm_boot_info *info, void *p);
+    /* multicore boards that use the default secondary core boot functions
+     * can ignore these two function calls. If the default functions won't
+     * work, then write_secondary_boot() should write a suitable blob of
+     * code mimicing the secondary CPU startup process used by the board's
+     * boot loader/boot ROM code, and secondary_cpu_reset_hook() should
+     * perform any necessary CPU reset handling and set the PC for thei
+     * secondary CPUs to point at this boot blob.
+     */
+    void (*write_secondary_boot)(CPUState *env,
+                                 const struct arm_boot_info *info);
+    void (*secondary_cpu_reset_hook)(CPUState *env,
+                                     const struct arm_boot_info *info);
     /* Used internally by arm_boot.c */
     int is_linux;
     target_phys_addr_t initrd_size;
hw/arm_boot.c +43 -11

84 lines not on this page · raw message

Signature · 1 line
1.7.1
#4 lore raw

PATCH 4/5 arm_boot: support board IDs more than 16 bits wide

In reply to Peter Maydell

Support passing a board ID value to the kernel in r1 that is more than 16 bits wide. This is needed to pass the '-1 == invalid' value for boards which only support device tree booting.

---
 hw/arm_boot.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
hw/arm_boot.c +5 -6
index 35ca22f..5f163fd 100644
@@ -20,10 +20,10 @@
 /* The worlds second smallest bootloader.  Set r0-r2, then jump to kernel.  */
 static uint32_t bootloader[] = {
   0xe3a00000, /* mov     r0, #0 */
-  0xe3a01000, /* mov     r1, #0x?? */
-  0xe3811c00, /* orr     r1, r1, #0x??00 */
-  0xe59f2000, /* ldr     r2, [pc, #0] */
-  0xe59ff000, /* ldr     pc, [pc, #0] */
+  0xe59f1004, /* ldr     r1, [pc, #4] */
+  0xe59f2004, /* ldr     r2, [pc, #4] */
+  0xe59ff004, /* ldr     pc, [pc, #4] */
+  0, /* Board ID */
   0, /* Address of kernel args.  Set by integratorcp_init.  */
   0  /* Kernel entry point.  Set by integratorcp_init.  */
 };
@@ -301,8 +301,7 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
         } else {
             initrd_size = 0;
         }
-        bootloader[1] |= info->board_id & 0xff;
-        bootloader[2] |= (info->board_id >> 8) & 0xff;
+        bootloader[4] = info->board_id;
         bootloader[5] = info->loader_start + KERNEL_ARGS_ADDR;
         bootloader[6] = entry;
         for (n = 0; n < sizeof(bootloader) / 4; n++) {
Signature · 1 line
1.7.1
#5 lore raw

PATCH 5/5 arm: SoC model for Calxeda Highbank

In reply to Peter Maydell

From: Rob Herring <[email protected]>

Adds support for Calxeda's Highbank SoC.

---
 Makefile.target |    1 +
 hw/highbank.c   |  330 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 331 insertions(+), 0 deletions(-)
 create mode 100644 hw/highbank.c
Makefile.target +1 -0
index 063ec54..3c85085 100644
@@ -339,6 +339,7 @@ obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
 obj-arm-y += arm_l2x0.o
 obj-arm-y += arm_mptimer.o
 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
+obj-arm-y += highbank.o
 obj-arm-y += pl061.o
 obj-arm-y += xgmac.o
 obj-arm-y += arm-semi.o
hw/highbank.c new file +330 -0

330 lines not on this page · raw message

Signature · 1 line
1.7.1
#6 lore raw
In reply to Peter Maydell
Quoted 12 lines · Peter Maydell

Hi; this is a pullreq for my arm-devs queue, which is basically the Highbank patches.

There is a slight sequencing issue here: it would be better if this went in after the target-arm queue which I sent a pullreq for yesterday, because that includes a bugfix which Highbank depends on. It's not a disaster to put them in out of order, because it won't fail to build, it's just you don't get a working Highbank model until both bits are there and it seems aesthetically more pleasing for that to be the point where we commit the actual board model patch.

Quoted 6 lines

I'd also like this to go in before Anthony's QOM patchset, which is why I'm posting this now rather than waiting for target-arm to be pulled :-)

thanks
-- PMM

Pulled. Thanks.

Regards,

Anthony Liguori

Quoted 30 lines

The following changes since commit 331636431af32ece373f4b1fb7c3ae9d0615e2a6:

   vga: compile cirrus_vga in hwlib (2012-01-25 18:32:59 +0000)

are available in the git repository at:
git://git.linaro.org/people/pmaydell/qemu-arm.git arm-devs.for-upstream

Mark Langsdorf (1):
arm: add secondary cpu boot callbacks to arm_boot.c

Peter Maydell (1):
arm_boot: support board IDs more than 16 bits wide

Rob Herring (3):
Add xgmac ethernet model
ahci: add support for non-PCI based controllers
arm: SoC model for Calxeda Highbank

  Makefile.target |    2 +
  hw/arm-misc.h   |   17 +++
  hw/arm_boot.c   |   65 +++++++---
  hw/highbank.c   |  330 +++++++++++++++++++++++++++++++++++++++++++
  hw/ide/ahci.c   |   44 ++++++
  hw/xgmac.c      |  421 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
  6 files changed, 862 insertions(+), 17 deletions(-)

create mode 100644 hw/highbank.c
create mode 100644 hw/xgmac.c