Microblaze Patches
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(-)
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
@@ -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
@@ -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
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
@@ -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
PATCH 3/6 xilinx_timer: Fixed "frequency" prop name
In reply to Peter A. G. CrosthwaiteThe "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
@@ -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
@@ -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
PATCH 4/6 xilinx.h: Error check when setting links
In reply to Peter A. G. CrosthwaiteAssert 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
@@ -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
PATCH 5/6 xilinx: fix names of ethernet and dma links.
In reply to Peter A. G. CrosthwaiteThese 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
@@ -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
Re: [Qemu-devel] [PATCH v1 5/6] xilinx: fix names of ethernet and dma links.
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
Signed-off-by Peter A. G. Crosthwaite <[email protected]>--- hw/xilinx.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)hw/xilinx.h +2
-1@@ -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
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
Signed-off-by Peter A. G. Crosthwaite <[email protected]>--- hw/xilinx.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)hw/xilinx.h +2
-1@@ -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
-1qdev_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
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
-1qdev_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_STYLEand 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
PATCH 6/6 xilinx_timer: Fix a compile error if debug enabled
In reply to Peter A. G. CrosthwaiteFrom: 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
@@ -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
Edgar E. Iglesias
AppliedQuoted 1 line · Peter A. G. Crosthwaite
Misc microblaze patches.
I've applied this (including your indentation fix to patch 5)
Thanks,
Edgar