Skip to contentSkip to conversation

Add TPCI200 and IP-Octal 232 IndustryPack emulation

PATCH Applied Alberto Garcia 3 participants 6 messages Jan 11, 2013 – Jan 15, 2013

lore
Share & tools
lore
#0 lore raw

v5 cover Add TPCI200 and IP-Octal 232 IndustryPack emulation

I updated the patches again, here are the changes from v4:

* Replaced DO_UPCAST() with checked casts.
* Added ipack_bus_new_inplace(). The fields of IPackBus are now private.
* Renamed ipoctal.c to ipoctal232.c (*).
* Replaced qdev->parent_bus with qdev_get_parent_bus(qdev).
* Replaced bus->qbus with BUS(bus).
* Replaced dev->qdev with DEVICE(dev).

(*) I didn't rename everything in the code from ipoctal to ipoctal232 for the reasons I told Andreas: all devices from the IP-Octal family are almost identical from the emulation point of view.

Regards,

Berto

Alberto Garcia (2):
Add TEWS TPCI200 IndustryPack emulation
Add GE IP-Octal 232 IndustryPack emulation

 default-configs/pci.mak |    1 +
 hw/Makefile.objs        |    3 +
 hw/ipack.c              |  115 ++++++++
 hw/ipack.h              |   79 ++++++
 hw/ipoctal232.c         |  619 +++++++++++++++++++++++++++++++++++++++++++
 hw/pci/pci_ids.h        |    3 +
 hw/tpci200.c            |  671 +++++++++++++++++++++++++++++++++++++++++++++++
 7 ficheiros modificados, 1491 adições(+)
 create mode 100644 hw/ipack.c
 create mode 100644 hw/ipack.h
 create mode 100644 hw/ipoctal232.c
 create mode 100644 hw/tpci200.c
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v5 1/2 Add TEWS TPCI200 IndustryPack emulation

The TPCI200 is a PCI board that supports up to 4 IndustryPack modules.

A new bus type called 'IndustryPack' has been created so any compatible module can be attached to this board.

---
 default-configs/pci.mak |    1 +
 hw/Makefile.objs        |    3 +
 hw/ipack.c              |  115 ++++++++
 hw/ipack.h              |   79 ++++++
 hw/pci/pci_ids.h        |    3 +
 hw/tpci200.c            |  671 +++++++++++++++++++++++++++++++++++++++++++++++
 6 ficheiros modificados, 872 adições(+)
 create mode 100644 hw/ipack.c
 create mode 100644 hw/ipack.h
 create mode 100644 hw/tpci200.c
default-configs/pci.mak +1 -0
index ae9d1eb..ee2d18d 100644
@@ -21,3 +21,4 @@ CONFIG_ESP=y
 CONFIG_ESP_PCI=y
 CONFIG_SERIAL=y
 CONFIG_SERIAL_PCI=y
+CONFIG_IPACK=y
hw/Makefile.objs +3 -0
index d867184..7b47b73 100644
@@ -107,6 +107,9 @@ common-obj-$(CONFIG_XGMAC) += xgmac.o
 # PCI watchdog devices
 common-obj-$(CONFIG_PCI) += wdt_i6300esb.o
 
+# IndustryPack
+common-obj-$(CONFIG_IPACK) += tpci200.o ipack.o
+
 # PCI network cards
 common-obj-$(CONFIG_NE2000_PCI) += ne2000.o
 common-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o
hw/ipack.c new file +115 -0

115 lines not on this page · raw message

hw/ipack.h new file +79 -0

79 lines not on this page · raw message

hw/pci/pci_ids.h +3 -0
index 271d935..d8dc2f1 100644
@@ -148,4 +148,7 @@
 #define PCI_VENDOR_ID_NEC                0x1033
 #define PCI_DEVICE_ID_NEC_UPD720200      0x0194
 
+#define PCI_VENDOR_ID_TEWS               0x1498
+#define PCI_DEVICE_ID_TEWS_TPCI200       0x30C8
+
 #endif
hw/tpci200.c new file +671 -0

671 lines not on this page · raw message

Signature · 1 line
1.7.10.4
Reviewed-by on v5 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH v5 1/2] Add TEWS TPCI200 IndustryPack emulation

Am 11.01.2013 18:25, schrieb Alberto Garcia:

Quoted 6 lines

The TPCI200 is a PCI board that supports up to 4 IndustryPack modules.

A new bus type called 'IndustryPack' has been created so any compatible module can be attached to this board.

I do wonder if adjust_value() can be replaced by switching MemoryRegion endianness between DEVICE_LITTLE_ENDIAN and DEVICE_BIG_ENDIAN rather than having it as DEVICE_NATIVE_ENDIAN and doing a manual bswap16()?

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

Re: [Qemu-devel] [PATCH v5 1/2] Add TEWS TPCI200 IndustryPack emulation

Quoted 4 lines · Andreas Färber

I do wonder if adjust_value() can be replaced by switching MemoryRegion endianness between DEVICE_LITTLE_ENDIAN and DEVICE_BIG_ENDIAN rather than having it as DEVICE_NATIVE_ENDIAN and doing a manual bswap16()?

Avi had actually suggested to have two memory regions with different endianness and switch between them.

I had taken a look back then and it didn't seem to make things any simpler due to how the TPCI200 works in big-endian mode.

Berto

#4 lore raw

PATCH v5 2/2 Add GE IP-Octal 232 IndustryPack emulation

In reply to Alberto Garcia

The GE IP-Octal 232 is an IndustryPack module that implements eight RS-232 serial ports, each one of which can be redirected to a character device in the host.

---
 hw/Makefile.objs |    2 +-
 hw/ipoctal232.c  |  619 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 ficheiros modificados, 620 adições(+), 1 eliminado(-)
 create mode 100644 hw/ipoctal232.c
hw/Makefile.objs +1 -1
index 7b47b73..77e212c 100644
@@ -108,7 +108,7 @@ common-obj-$(CONFIG_XGMAC) += xgmac.o
 common-obj-$(CONFIG_PCI) += wdt_i6300esb.o
 
 # IndustryPack
-common-obj-$(CONFIG_IPACK) += tpci200.o ipack.o
+common-obj-$(CONFIG_IPACK) += tpci200.o ipoctal232.o ipack.o
 
 # PCI network cards
 common-obj-$(CONFIG_NE2000_PCI) += ne2000.o
hw/ipoctal232.c new file +619 -0

619 lines not on this page · raw message

Signature · 1 line
1.7.10.4