Patchwork [v9,3/3] xilinx_zynq: added pl330 to machine model

login
register
mail settings
Submitter Peter Crosthwaite
Date Feb. 8, 2013, 3:42 a.m.
Message ID <d6437a83-7dc1-461b-8b55-6d93fab37c85@TX2EHSMHS008.ehs.local>
Download mbox | patch
Permalink /patch/219037/
State New
Headers show

Comments

Peter Crosthwaite - Feb. 8, 2013, 3:42 a.m.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 hw/xilinx_zynq.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
Blue Swirl - Feb. 9, 2013, 1:05 p.m.
On Fri, Feb 8, 2013 at 3:42 AM, Peter Crosthwaite
<peter.crosthwaite@xilinx.com> wrote:
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> ---
>
>  hw/xilinx_zynq.c |   24 ++++++++++++++++++++++++
>  1 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c
> index 0ac33b5..f826bff 100644
> --- a/hw/xilinx_zynq.c
> +++ b/hw/xilinx_zynq.c
> @@ -35,6 +35,10 @@
>
>  #define IRQ_OFFSET 32 /* pic interrupts start from index 32 */
>
> +int dma_irqs[8] = {

static const

> +    46, 47, 48, 49, 72, 73, 74, 75
> +};
> +
>  static struct arm_boot_info zynq_binfo = {};
>
>  static void gem_init(NICInfo *nd, uint32_t base, qemu_irq irq)
> @@ -187,6 +191,26 @@ static void zynq_init(QEMUMachineInitArgs *args)
>          }
>      }
>
> +    dev = qdev_create(NULL, "pl330");
> +    qdev_prop_set_uint8(dev, "num_chnls",  8);
> +    qdev_prop_set_uint8(dev, "num_periph_req",  4);
> +    qdev_prop_set_uint8(dev, "num_events",  16);
> +
> +    qdev_prop_set_uint8(dev, "data_width",  64);
> +    qdev_prop_set_uint8(dev, "wr_cap",  8);
> +    qdev_prop_set_uint8(dev, "wr_q_dep",  16);
> +    qdev_prop_set_uint8(dev, "rd_cap",  8);
> +    qdev_prop_set_uint8(dev, "rd_q_dep",  16);
> +    qdev_prop_set_uint16(dev, "data_buffer_dep",  256);
> +
> +    qdev_init_nofail(dev);
> +    busdev = SYS_BUS_DEVICE(dev);
> +    sysbus_mmio_map(busdev, 0, 0xF8003000);
> +    sysbus_connect_irq(busdev, 0, pic[45-IRQ_OFFSET]); /* abort irq line */
> +    for (n = 0; n < 8; ++n) { /* event irqs */
> +        sysbus_connect_irq(busdev, n + 1, pic[dma_irqs[n] - IRQ_OFFSET]);
> +    }
> +
>      zynq_binfo.ram_size = ram_size;
>      zynq_binfo.kernel_filename = kernel_filename;
>      zynq_binfo.kernel_cmdline = kernel_cmdline;
> --
> 1.7.0.4
>
>
>
Peter Crosthwaite - Feb. 19, 2013, 6:16 a.m.
On Sat, Feb 9, 2013 at 11:05 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
> On Fri, Feb 8, 2013 at 3:42 AM, Peter Crosthwaite
> <peter.crosthwaite@xilinx.com> wrote:
>> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
>> ---
>>
>>  hw/xilinx_zynq.c |   24 ++++++++++++++++++++++++
>>  1 files changed, 24 insertions(+), 0 deletions(-)
>>
>> diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c
>> index 0ac33b5..f826bff 100644
>> --- a/hw/xilinx_zynq.c
>> +++ b/hw/xilinx_zynq.c
>> @@ -35,6 +35,10 @@
>>
>>  #define IRQ_OFFSET 32 /* pic interrupts start from index 32 */
>>
>> +int dma_irqs[8] = {
>
> static const
>

Fixed,

Regards,
Peter

>> +    46, 47, 48, 49, 72, 73, 74, 75
>> +};
>> +
>>  static struct arm_boot_info zynq_binfo = {};
>>
>>  static void gem_init(NICInfo *nd, uint32_t base, qemu_irq irq)
>> @@ -187,6 +191,26 @@ static void zynq_init(QEMUMachineInitArgs *args)
>>          }
>>      }
>>
>> +    dev = qdev_create(NULL, "pl330");
>> +    qdev_prop_set_uint8(dev, "num_chnls",  8);
>> +    qdev_prop_set_uint8(dev, "num_periph_req",  4);
>> +    qdev_prop_set_uint8(dev, "num_events",  16);
>> +
>> +    qdev_prop_set_uint8(dev, "data_width",  64);
>> +    qdev_prop_set_uint8(dev, "wr_cap",  8);
>> +    qdev_prop_set_uint8(dev, "wr_q_dep",  16);
>> +    qdev_prop_set_uint8(dev, "rd_cap",  8);
>> +    qdev_prop_set_uint8(dev, "rd_q_dep",  16);
>> +    qdev_prop_set_uint16(dev, "data_buffer_dep",  256);
>> +
>> +    qdev_init_nofail(dev);
>> +    busdev = SYS_BUS_DEVICE(dev);
>> +    sysbus_mmio_map(busdev, 0, 0xF8003000);
>> +    sysbus_connect_irq(busdev, 0, pic[45-IRQ_OFFSET]); /* abort irq line */
>> +    for (n = 0; n < 8; ++n) { /* event irqs */
>> +        sysbus_connect_irq(busdev, n + 1, pic[dma_irqs[n] - IRQ_OFFSET]);
>> +    }
>> +
>>      zynq_binfo.ram_size = ram_size;
>>      zynq_binfo.kernel_filename = kernel_filename;
>>      zynq_binfo.kernel_cmdline = kernel_cmdline;
>> --
>> 1.7.0.4
>>
>>
>>
>

Patch

diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c
index 0ac33b5..f826bff 100644
--- a/hw/xilinx_zynq.c
+++ b/hw/xilinx_zynq.c
@@ -35,6 +35,10 @@ 
 
 #define IRQ_OFFSET 32 /* pic interrupts start from index 32 */
 
+int dma_irqs[8] = {
+    46, 47, 48, 49, 72, 73, 74, 75
+};
+
 static struct arm_boot_info zynq_binfo = {};
 
 static void gem_init(NICInfo *nd, uint32_t base, qemu_irq irq)
@@ -187,6 +191,26 @@  static void zynq_init(QEMUMachineInitArgs *args)
         }
     }
 
+    dev = qdev_create(NULL, "pl330");
+    qdev_prop_set_uint8(dev, "num_chnls",  8);
+    qdev_prop_set_uint8(dev, "num_periph_req",  4);
+    qdev_prop_set_uint8(dev, "num_events",  16);
+
+    qdev_prop_set_uint8(dev, "data_width",  64);
+    qdev_prop_set_uint8(dev, "wr_cap",  8);
+    qdev_prop_set_uint8(dev, "wr_q_dep",  16);
+    qdev_prop_set_uint8(dev, "rd_cap",  8);
+    qdev_prop_set_uint8(dev, "rd_q_dep",  16);
+    qdev_prop_set_uint16(dev, "data_buffer_dep",  256);
+
+    qdev_init_nofail(dev);
+    busdev = SYS_BUS_DEVICE(dev);
+    sysbus_mmio_map(busdev, 0, 0xF8003000);
+    sysbus_connect_irq(busdev, 0, pic[45-IRQ_OFFSET]); /* abort irq line */
+    for (n = 0; n < 8; ++n) { /* event irqs */
+        sysbus_connect_irq(busdev, n + 1, pic[dma_irqs[n] - IRQ_OFFSET]);
+    }
+
     zynq_binfo.ram_size = ram_size;
     zynq_binfo.kernel_filename = kernel_filename;
     zynq_binfo.kernel_cmdline = kernel_cmdline;