microblaze: Add petalogix-ml605 machine
Subsystems (2)
v2 cover microblaze: Add petalogix-ml605 machine
From: Edgar E. Iglesias <[email protected]>
Adds model of the petalogix-ml605 reference design. Normally this is a little endian machine allthough qemu supports it in both modes.
Changes since v1:
* Fix coding style issues.
* Endian swap DMA descriptors on the way in/out of DMA, if needed.
* Replace lots of magic numbers with enum constants.
* Remove unnecessary array size checks from DMA IO read/writes.
Edgar E. Iglesias (1):
xilinx: Add AXIENET & DMA models
Michal Simek (2):
microblaze: Compile uart 16550 serial driver
microblaze: Add PetaLogix ml605 MMU little-endian ref design
Makefile | 2 +- Makefile.target | 3 + default-configs/microblaze-softmmu.mak | 1 + default-configs/microblazeel-softmmu.mak | 1 + hw/petalogix_ml605_mmu.c | 267 +++++++++ hw/xilinx.h | 39 ++ hw/xilinx_axidma.c | 509 +++++++++++++++++ hw/xilinx_axidma.h | 39 ++ hw/xilinx_axienet.c | 898 ++++++++++++++++++++++++++++++ pc-bios/petalogix-ml605.dtb | Bin 0 -> 9982 bytes 10 files changed, 1758 insertions(+), 1 deletions(-) create mode 100644 hw/petalogix_ml605_mmu.c create mode 100644 hw/xilinx_axidma.c create mode 100644 hw/xilinx_axidma.h create mode 100644 hw/xilinx_axienet.c create mode 100644 pc-bios/petalogix-ml605.dtb
Signature · 1 line
1.7.3.4
PATCH v2 1/3 microblaze: Compile uart 16550 serial driver
From: Michal Simek <[email protected]>
Upcomming little endian platform will use 16550 serial driver.
--- default-configs/microblaze-softmmu.mak | 1 + default-configs/microblazeel-softmmu.mak | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
default-configs/microblaze-softmmu.mak +1 -0
@@ -2,3 +2,4 @@ CONFIG_PTIMER=y CONFIG_PFLASH_CFI01=y +CONFIG_SERIAL=y
default-configs/microblazeel-softmmu.mak +1 -0
@@ -2,3 +2,4 @@ CONFIG_PTIMER=y CONFIG_PFLASH_CFI01=y +CONFIG_SERIAL=y
Signature · 1 line
1.7.3.4
PATCH v2 2/3 xilinx: Add AXIENET & DMA models
In reply to [email protected]From: Edgar E. Iglesias <[email protected]>
--- Makefile.target | 2 + hw/xilinx_axidma.c | 509 +++++++++++++++++++++++++++++ hw/xilinx_axidma.h | 39 +++ hw/xilinx_axienet.c | 898 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1448 insertions(+), 0 deletions(-) create mode 100644 hw/xilinx_axidma.c create mode 100644 hw/xilinx_axidma.h create mode 100644 hw/xilinx_axienet.c
Makefile.target +2 -0
@@ -272,6 +272,8 @@ obj-microblaze-y += xilinx_intc.o obj-microblaze-y += xilinx_timer.o obj-microblaze-y += xilinx_uartlite.o obj-microblaze-y += xilinx_ethlite.o +obj-microblaze-y += xilinx_axidma.o +obj-microblaze-y += xilinx_axienet.o obj-microblaze-$(CONFIG_FDT) += device_tree.o
hw/xilinx_axidma.c new file +509 -0
509 lines not on this page · raw message
hw/xilinx_axidma.h new file +39 -0
@@ -0,0 +1,39 @@ +/* AXI DMA connection. Used until qdev provides a generic way. */ +typedef void (*DMAPushFn )(void *opaque, +unsigned char *buf,size_t len,uint32_t *app); + +struct XilinxDMAConnection { +void *dma; +void *client; + +DMAPushFn to_dma; +DMAPushFn to_client; +}; + +static inline void xlx_dma_connect_client (struct XilinxDMAConnection *dmach, +void *c,DMAPushFn f) +{ + dmach->client = c; + dmach->to_client = f; +} + +static inline void xlx_dma_connect_dma (struct XilinxDMAConnection *dmach, +void *d,DMAPushFn f) +{ + dmach->dma = d; + dmach->to_dma = f; +} + +static inline +void xlx_dma_push_to_dma (struct XilinxDMAConnection *dmach, +uint8_t *buf,size_t len,uint32_t *app) +{ + dmach->to_dma (dmach->dma, buf, len, app); +} +static inline +void xlx_dma_push_to_client (struct XilinxDMAConnection *dmach, +uint8_t *buf,size_t len,uint32_t *app) +{ + dmach->to_client (dmach->client, buf, len, app); +} +
hw/xilinx_axienet.c new file +898 -0
898 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v2 3/3 microblaze: Add PetaLogix ml605 MMU little-endian ref design
In reply to [email protected]From: Michal Simek <[email protected]>
Add the first Microblaze little endian platform. Platform uses uart16550, axi ethernet, timer, intc.
--- Makefile | 2 +- Makefile.target | 1 + hw/petalogix_ml605_mmu.c | 267 +++++++++++++++++++++++++++++++++++++++++++ hw/xilinx.h | 39 +++++++ pc-bios/petalogix-ml605.dtb | Bin 0 -> 9982 bytes 5 files changed, 308 insertions(+), 1 deletions(-) create mode 100644 hw/petalogix_ml605_mmu.c create mode 100644 pc-bios/petalogix-ml605.dtb
Makefile +1 -1
@@ -211,7 +211,7 @@ gpxe-eepro100-80861209.rom \ pxe-e1000.bin \ pxe-ne2k_pci.bin pxe-pcnet.bin \ pxe-rtl8139.bin pxe-virtio.bin \ -bamboo.dtb petalogix-s3adsp1800.dtb \ +bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \ multiboot.bin linuxboot.bin \ s390-zipl.rom else
Makefile.target +1 -0
@@ -266,6 +266,7 @@ obj-mips-y += cirrus_vga.o obj-mips-$(CONFIG_FULONG) += bonito.o vt82c686.o mips_fulong2e.o obj-microblaze-y = petalogix_s3adsp1800_mmu.o +obj-microblaze-y += petalogix_ml605_mmu.o obj-microblaze-y += microblaze_pic_cpu.o obj-microblaze-y += xilinx_intc.o
hw/petalogix_ml605_mmu.c new file +267 -0
267 lines not on this page · raw message
hw/xilinx.h +39 -0
@@ -48,3 +48,42 @@ xilinx_ethlite_create(NICInfo *nd, target_phys_addr_t base, qemu_irq irq,sysbus_connect_irq (sysbus_from_qdev (dev),0 , irq);return dev; } + +static inline DeviceState * +xilinx_axiethernet_create (void *dmach, +NICInfo *nd,target_phys_addr_t base,qemu_irq irq, +int txmem,int rxmem) +{ +DeviceState *dev; +qemu_check_nic_model (nd,"xilinx-axienet" ); + + dev =qdev_create (NULL ,"xilinx,axienet" ); +qdev_set_nic_properties (dev, nd); +qdev_prop_set_uint32 (dev,"c_rxmem" , rxmem); +qdev_prop_set_uint32 (dev,"c_txmem" , txmem); +qdev_prop_set_ptr (dev,"dmach" , dmach); +qdev_init_nofail (dev); +sysbus_mmio_map (sysbus_from_qdev (dev),0 , base); +sysbus_connect_irq (sysbus_from_qdev (dev),0 , irq); + +return dev; +} + +static inline DeviceState * +xilinx_axiethernetdma_create (void *dmach, +target_phys_addr_t base,qemu_irq irq, +qemu_irq irq2,int freqhz) +{ +DeviceState *dev =NULL ; + + dev =qdev_create (NULL ,"xilinx,axidma" ); +qdev_prop_set_uint32 (dev,"freqhz" , freqhz); +qdev_prop_set_ptr (dev,"dmach" , dmach); +qdev_init_nofail (dev); + +sysbus_mmio_map (sysbus_from_qdev (dev),0 , base); +sysbus_connect_irq (sysbus_from_qdev (dev),0 , irq2); +sysbus_connect_irq (sysbus_from_qdev (dev),1 , irq); + +return dev; +}
pc-bios/petalogix-ml605.dtb new file binary +0 -0
Signature · 1 line
1.7.3.4