Skip to contentSkip to conversation

Microblaze Patches

PATCH Applied Peter A. G. Crosthwaite 3 participants 11 messages Sep 17, 2012 – Sep 19, 2012 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

cover Microblaze Patches

Misc microblaze patches.

Chris Wulff (1):
xilinx_timer: Fix a compile error if debug enabled

Peter A. G. Crosthwaite (5):
xilinx_timer: Removed comma in device name
xilinx_timer: Send dbg msgs to stderr not stdout
xilinx_timer: Fixed "frequency" prop name xilinx.h: Error check when setting links
xilinx: fix names of ethernet and dma links.

 hw/xilinx.h       |   16 ++++++++++++----
 hw/xilinx_timer.c |   16 +++++++++-------
 2 files changed, 21 insertions(+), 11 deletions(-)
#1 lore raw

PATCH 1/6 xilinx_timer: Removed comma in device name

Fixes an error in a61e4b07a30c062260d2d01771773f14820d1eb7

---
 hw/xilinx.h       |    2 +-
 hw/xilinx_timer.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
hw/xilinx.h +1 -1
index 556c5aa..df06a00 100644
@@ -21,7 +21,7 @@ xilinx_timer_create(target_phys_addr_t base, qemu_irq irq, int oto, int freq)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "xlnx,xps-timer");
+    dev = qdev_create(NULL, "xlnx.xps-timer");
     qdev_prop_set_uint32(dev, "one-timer-only", oto);
     qdev_prop_set_uint32(dev, "frequency", freq);
     qdev_init_nofail(dev);
hw/xilinx_timer.c +2 -2
index b562bd0..053ba02 100644
@@ -217,7 +217,7 @@ static int xilinx_timer_init(SysBusDevice *dev)
         ptimer_set_freq(xt->ptimer, t->freq_hz);
     }
 
-    memory_region_init_io(&t->mmio, &timer_ops, t, "xlnx,xps-timer",
+    memory_region_init_io(&t->mmio, &timer_ops, t, "xlnx.xps-timer",
                           R_MAX * 4 * num_timers(t));
     sysbus_init_mmio(dev, &t->mmio);
     return 0;
@@ -239,7 +239,7 @@ static void xilinx_timer_class_init(ObjectClass *klass, void *data)
 }
 
 static TypeInfo xilinx_timer_info = {
-    .name          = "xlnx,xps-timer",
+    .name          = "xlnx.xps-timer",
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(struct timerblock),
     .class_init    = xilinx_timer_class_init,
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 2/6 xilinx_timer: Send dbg msgs to stderr not stdout

In reply to Peter A. G. Crosthwaite
---
 hw/xilinx_timer.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
hw/xilinx_timer.c +4 -4
index 053ba02..c02e6ca 100644
@@ -119,7 +119,7 @@ timer_read(void *opaque, target_phys_addr_t addr, unsigned int size)
             break;
 
     }
-    D(printf("%s timer=%d %x=%x\n", __func__, timer, addr * 4, r));
+    D(fprintf(stderr, "%s timer=%d %x=%x\n", __func__, timer, addr * 4, r));
     return r;
 }
 
@@ -127,7 +127,7 @@ static void timer_enable(struct xlx_timer *xt)
 {
     uint64_t count;
 
-    D(printf("%s timer=%d down=%d\n", __func__,
+    D(fprintf(stderr, "%s timer=%d down=%d\n", __func__,
               xt->nr, xt->regs[R_TCSR] & TCSR_UDT));
 
     ptimer_stop(xt->ptimer);
@@ -152,7 +152,7 @@ timer_write(void *opaque, target_phys_addr_t addr,
     addr >>= 2;
     timer = timer_from_addr(addr);
     xt = &t->timers[timer];
-    D(printf("%s addr=%x val=%x (timer=%d off=%d)\n",
+    D(fprintf(stderr, "%s addr=%x val=%x (timer=%d off=%d)\n",
              __func__, addr * 4, value, timer, addr & 3));
     /* Further decoding to address a specific timers reg.  */
     addr &= 3;
@@ -189,7 +189,7 @@ static void timer_hit(void *opaque)
 {
     struct xlx_timer *xt = opaque;
     struct timerblock *t = xt->parent;
-    D(printf("%s %d\n", __func__, timer));
+    D(fprintf(stderr, "%s %d\n", __func__, timer));
     xt->regs[R_TCSR] |= TCSR_TINT;
 
     if (xt->regs[R_TCSR] & TCSR_ARHT)
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 3/6 xilinx_timer: Fixed "frequency" prop name

In reply to Peter A. G. Crosthwaite

The "frequency" qdev prop matches the "clock-frequency" property in Xilinx EDK. Renamed "frequency" -> "clock-frequency" accordingly.

---
 hw/xilinx.h       |    2 +-
 hw/xilinx_timer.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
hw/xilinx.h +1 -1
index df06a00..45a6bdc 100644
@@ -23,7 +23,7 @@ xilinx_timer_create(target_phys_addr_t base, qemu_irq irq, int oto, int freq)
 
     dev = qdev_create(NULL, "xlnx.xps-timer");
     qdev_prop_set_uint32(dev, "one-timer-only", oto);
-    qdev_prop_set_uint32(dev, "frequency", freq);
+    qdev_prop_set_uint32(dev, "clock-frequency", freq);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
     sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
hw/xilinx_timer.c +2 -1
index c02e6ca..9eb5ef7 100644
@@ -224,7 +224,8 @@ static int xilinx_timer_init(SysBusDevice *dev)
 }
 
 static Property xilinx_timer_properties[] = {
-    DEFINE_PROP_UINT32("frequency", struct timerblock, freq_hz,   62 * 1000000),
+    DEFINE_PROP_UINT32("clock-frequency", struct timerblock, freq_hz,
+                                                                62 * 1000000),
     DEFINE_PROP_UINT8("one-timer-only", struct timerblock, one_timer_only, 0),
     DEFINE_PROP_END_OF_LIST(),
 };
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH 4/6 xilinx.h: Error check when setting links

In reply to Peter A. G. Crosthwaite

Assert that the ethernet and dma controller are sucessfully linked to their peers.

---
 hw/xilinx.h |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
hw/xilinx.h +8 -2
index 45a6bdc..4d29265 100644
@@ -55,13 +55,16 @@ xilinx_axiethernet_create(NICInfo *nd, StreamSlave *peer,
                           int txmem, int rxmem)
 {
     DeviceState *dev;
+    Error *errp = NULL;
+
     qemu_check_nic_model(nd, "xlnx.axi-ethernet");
 
     dev = qdev_create(NULL, "xlnx.axi-ethernet");
     qdev_set_nic_properties(dev, nd);
     qdev_prop_set_uint32(dev, "rxmem", rxmem);
     qdev_prop_set_uint32(dev, "txmem", txmem);
-    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", NULL);
+    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+    assert_no_error(errp);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
     sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
@@ -74,8 +77,11 @@ xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer,
                            target_phys_addr_t base, qemu_irq irq,
                            qemu_irq irq2, int freqhz)
 {
+    Error *errp = NULL;
+
     qdev_prop_set_uint32(dev, "freqhz", freqhz);
-    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", NULL);
+    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+    assert_no_error(errp);
     qdev_init_nofail(dev);
 
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
Signature · 1 line
1.7.0.4
#5 lore raw

PATCH 5/6 xilinx: fix names of ethernet and dma links.

In reply to Peter A. G. Crosthwaite

These names were incorrect. Fixed to match to actual link names

---
 hw/xilinx.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
hw/xilinx.h +4 -2
index 4d29265..6449bd4 100644
@@ -63,7 +63,8 @@ xilinx_axiethernet_create(NICInfo *nd, StreamSlave *peer,
     qdev_set_nic_properties(dev, nd);
     qdev_prop_set_uint32(dev, "rxmem", rxmem);
     qdev_prop_set_uint32(dev, "txmem", txmem);
-    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+    object_property_set_link(OBJECT(dev), OBJECT(peer), "axistream-connected",
+                                &errp);
     assert_no_error(errp);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
@@ -80,7 +81,8 @@ xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer,
     Error *errp = NULL;
 
     qdev_prop_set_uint32(dev, "freqhz", freqhz);
-    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+    object_property_set_link(OBJECT(dev), OBJECT(peer), "axistream-connected",
+                                &errp);
     assert_no_error(errp);
     qdev_init_nofail(dev);
 
Signature · 1 line
1.7.0.4
#9 lore raw

PATCH 6/6 xilinx_timer: Fix a compile error if debug enabled

In reply to Peter A. G. Crosthwaite

From: Chris Wulff <[email protected]>

There was a missing include of qemu-log and a variable name in a printf was out of date.

---
 hw/xilinx_timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
hw/xilinx_timer.c +2 -1
index 9eb5ef7..2e48ca2 100644
@@ -24,6 +24,7 @@
 
 #include "sysbus.h"
 #include "ptimer.h"
+#include "qemu-log.h"
 
 #define D(x)
 
@@ -189,7 +190,7 @@ static void timer_hit(void *opaque)
 {
     struct xlx_timer *xt = opaque;
     struct timerblock *t = xt->parent;
-    D(fprintf(stderr, "%s %d\n", __func__, timer));
+    D(fprintf(stderr, "%s %d\n", __func__, xt->nr));
     xt->regs[R_TCSR] |= TCSR_TINT;
 
     if (xt->regs[R_TCSR] & TCSR_ARHT)
Signature · 1 line
1.7.0.4
#6 lore raw

Re: [Qemu-devel] [PATCH v1 5/6] xilinx: fix names of ethernet and dma links.

In reply to Peter A. G. Crosthwaite

Hi,

Am 17.09.2012 10:47, schrieb Peter A. G. Crosthwaite:

Quoted 22 lines

These names were incorrect. Fixed to match to actual link names

---
 hw/xilinx.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
hw/xilinx.h +2 -1
index 4d29265..6449bd4 100644
@@ -63,7 +63,8 @@ xilinx_axiethernet_create(NICInfo *nd, StreamSlave *peer,
     qdev_set_nic_properties(dev, nd);
     qdev_prop_set_uint32(dev, "rxmem", rxmem);
     qdev_prop_set_uint32(dev, "txmem", txmem);
-    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+    object_property_set_link(OBJECT(dev), OBJECT(peer), "axistream-connected",
+                                &errp);
     assert_no_error(errp);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);

hw/xilinx.h xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer, · line 88

Quoted 9 lines
hw/xilinx.h +2 -1
@@ -80,7 +81,8 @@ xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer,
     Error *errp = NULL;
 
     qdev_prop_set_uint32(dev, "freqhz", freqhz);
-    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+    object_property_set_link(OBJECT(dev), OBJECT(peer), "axistream-connected",
+                                &errp);
     assert_no_error(errp);
     qdev_init_nofail(dev);
 

Indentation of &errp looks odd despite no tabs - intentional?

Andreas

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
#7 lore raw

Re: [Qemu-devel] [PATCH v1 5/6] xilinx: fix names of ethernet and dma links.

Quoted 27 lines · Andreas Färber

Hi,

Am 17.09.2012 10:47, schrieb Peter A. G. Crosthwaite:

Quoted 24 lines

These names were incorrect. Fixed to match to actual link names

---
 hw/xilinx.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
hw/xilinx.h +2 -1
index 4d29265..6449bd4 100644
@@ -63,7 +63,8 @@ xilinx_axiethernet_create(NICInfo *nd, StreamSlave *peer,
     qdev_set_nic_properties(dev, nd);
     qdev_prop_set_uint32(dev, "rxmem", rxmem);
     qdev_prop_set_uint32(dev, "txmem", txmem);
-    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+    object_property_set_link(OBJECT(dev), OBJECT(peer), "axistream-connected",
+                                &errp);
     assert_no_error(errp);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
@@ -80,7 +81,8 @@ xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer,
     Error *errp = NULL;
 
Quoted 10 lines

hw/xilinx.h xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer, · line 88

Quoted 7 lines
hw/xilinx.h +2 -1
     qdev_prop_set_uint32(dev, "freqhz", freqhz);
-    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+    object_property_set_link(OBJECT(dev), OBJECT(peer), "axistream-connected",
+                                &errp);
     assert_no_error(errp);
     qdev_init_nofail(dev);
 

Indentation of &errp looks odd despite no tabs - intentional?

I have indented to the first multiple of 4 spaces after the function opening brace. Is there a prescribed way? Can it be added to CODING_STYLE and checkpatch if there is a particular recommended way?

Regards,
Peter

Quoted 5 lines

Andreas

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

#8 lore raw

Re: [Qemu-devel] [PATCH v1 5/6] xilinx: fix names of ethernet and dma links.

Am 18.09.2012 01:36, schrieb Peter Crosthwaite:

Quoted 16 lines · Andreas Färber
Quoted 4 lines

Am 17.09.2012 10:47, schrieb Peter A. G. Crosthwaite:

Quoted 3 lines
hw/xilinx.h +0 -0
@@ -80,7 +81,8 @@ xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer,
     Error *errp = NULL;
 
Quoted 10 lines

hw/xilinx.h xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer, · line 88

Quoted 7 lines
hw/xilinx.h +2 -1
     qdev_prop_set_uint32(dev, "freqhz", freqhz);
-    object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+    object_property_set_link(OBJECT(dev), OBJECT(peer), "axistream-connected",
+                                &errp);
     assert_no_error(errp);
     qdev_init_nofail(dev);
 

Indentation of &errp looks odd despite no tabs - intentional?

Quoted 3 lines

I have indented to the first multiple of 4 spaces after the function opening brace. Is there a prescribed way? Can it be added to CODING_STYLE and checkpatch if there is a particular recommended way?

The usual convention is to align with the opening brace (i.e., 3 spaces less), or if the function name or string argument is too long I believe one 4-spaces indent from the block.

Cheers,
Andreas

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