Initial i.MX7 support
v7 cover Initial i.MX7 support
Hi everyone,
This v7 of the patch series containing the work that I've done in order to enable support for i.MX7 emulation in QEMU.
As the one before last commit in the series states the supported i.MX7 features are:
* up to 2 Cortex A9 cores (SMP works with PSCI)
* A7 MPCORE (identical to A15 MPCORE)
* 4 GPTs modules
* 7 GPIO controllers
* 2 IOMUXC controllers
* 1 CCM module
* 1 SVNS module
* 1 SRC module
* 1 GPCv2 controller
* 4 eCSPI controllers
* 4 I2C controllers
* 7 i.MX UART controllers
* 2 FlexCAN controllers
* 2 Ethernet controllers (FEC)
* 3 SD controllers (USDHC)
* 4 WDT modules
* 1 SDMA module
* 1 GPR module
* 2 USBMISC modules
* 2 ADC modules
* 1 PCIe controller
* 3 USB controllers
* 1 LCD controller
* 1 ARMv7 DAP IP block
Feedback is welcome!
Changes since [v6]:
- All endiannes in Designware PCI implementation is now specified as little-endian
Changes since [v5]:
- Rebase patchest on top of latest QEMU master, so now the patchset is down to three patches
- Reverted the change to use pci_data_* functions becuase the patch supporting this change was causing trouble
- Fixed endiannes of MSI and configuration space accessors to be LITTLE_ENDIAN
Changes since [v4]:
- Rebase patchest on top of latest QEMU master
- Reworked PCIE emulation code to create MemoryRegions only once
- Fixed incorrect usages of PCI instead of PCIE
- Fixed device class reported by PCIE bridge
- Added patch to make pci_data_read() and pci_data_write() usable for PCIE devices as well
- Converted PCIE code to use pci_data_read() and pci_data_write()
- Added VMStateDescription code for PCIE
- Collected Reviewed-by tag from Philippe
Changes since [v3]:
- Changes to FEC were split into a separate set and merged to master
- Patchest is rebased on latest master
- Converted to use PSCI DT fixup code that is shared with virt platform (now relocated to live in arm/boot.c)
- Large number of dummy block were converted to use create_unimplemented_device() as opposed to its own dedicated type
- Incorporated varios small feedback items
- Collected Reviewed-by tags from Peter
Changes since [v2]:
- Added stubs for more blocks that were causing memory transactions when booting Linux guest as were revealed by additional testing of the patchest
- Added proper USB emulation code, so now it should be possible to emulated guest's USB bus
Changes since [v1]:
- Patchset no longer relies on "ignore_memory_transaction_failures = false" for its functionality
- As a consequnce of implementing the above a number of patches implementing dummy IP block emulation as well as PCIe emulation patches that I alluded to in [v1] are now included in this patch series
- "has_el3" property is no longer being set to "false" as a part of intialization of A7 CPU. I couldn't reproduce the issues that I thought I was having, so I just dropped that code.
- A number of smaller feedback items from Peter and other has been incorporated into the patches.
Thanks,
Andrey Smirnov
[v6] https://lists.gnu.org/archive/html/qemu-devel/2018-02/msg03587.html
[v5] https://lists.gnu.org/archive/html/qemu-devel/2018-02/msg01558.html
[v4] https://lists.gnu.org/archive/html/qemu-devel/2018-01/msg03264.html
[v3] https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg04236.html
[v2] https://lists.gnu.org/archive/html/qemu-devel/2017-10/msg05516.html
[v1] https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg04770.html
Andrey Smirnov (3):
pci: Add support for Designware IP block
i.MX: Add i.MX7 SOC implementation.
Implement support for i.MX7 Sabre board
default-configs/arm-softmmu.mak | 3 + include/hw/arm/fsl-imx7.h | 222 ++++++++++++ include/hw/pci-host/designware.h | 102 ++++++ include/hw/pci/pci_ids.h | 2 + hw/arm/fsl-imx7.c | 580 ++++++++++++++++++++++++++++++ hw/arm/mcimx7d-sabre.c | 90 +++++ hw/pci-host/designware.c | 755 +++++++++++++++++++++++++++++++++++++++ hw/arm/Makefile.objs | 3 + hw/pci-host/Makefile.objs | 2 + 9 files changed, 1759 insertions(+) create mode 100644 include/hw/arm/fsl-imx7.h create mode 100644 include/hw/pci-host/designware.h create mode 100644 hw/arm/fsl-imx7.c create mode 100644 hw/arm/mcimx7d-sabre.c create mode 100644 hw/pci-host/designware.c
Signature · 1 line
2.14.3
PATCH v7 1/3 pci: Add support for Designware IP block
Add code needed to get a functional PCI subsytem when using in conjunction with upstream Linux guest (4.13+). Tested to work against "e1000e" (network adapter, using MSI interrupts) as well as "usb-ehci" (USB controller, using legacy PCI interrupts).
Based on "i.MX6 Applications Processor Reference Manual" (Document
Number: IMX6DQRM Rev. 4) as well as corresponding dirver in Linux kernel (circa 4.13 - 4.16 found in drivers/pci/dwc/*)
--- default-configs/arm-softmmu.mak | 2 + include/hw/pci-host/designware.h | 102 ++++++ include/hw/pci/pci_ids.h | 2 + hw/pci-host/designware.c | 755 +++++++++++++++++++++++++++++++++++++++ hw/pci-host/Makefile.objs | 2 + 5 files changed, 863 insertions(+) create mode 100644 include/hw/pci-host/designware.h create mode 100644 hw/pci-host/designware.c
default-configs/arm-softmmu.mak +2 -0
@@ -140,3 +140,5 @@ CONFIG_GPIO_KEY=y CONFIG_MSF2=y CONFIG_FW_CFG_DMA=y CONFIG_XILINX_AXI=y +CONFIG_PCI_DESIGNWARE=y +
include/hw/pci-host/designware.h new file +102 -0
102 lines not on this page · raw message
include/hw/pci/pci_ids.h +2 -0
@@ -269,4 +269,6 @@#define PCI_VENDOR_ID_VMWARE 0x15ad#define PCI_DEVICE_ID_VMWARE_PVRDMA 0x0820 +#define PCI_VENDOR_ID_SYNOPSYS 0x16C3 +#endif
hw/pci-host/designware.c new file +755 -0
755 lines not on this page · raw message
hw/pci-host/Makefile.objs +2 -0
@@ -17,3 +17,5 @@ common-obj-$(CONFIG_PCI_PIIX) += piix.o common-obj-$(CONFIG_PCI_Q35) += q35.o common-obj-$(CONFIG_PCI_GENERIC) += gpex.o common-obj-$(CONFIG_PCI_XILINX) += xilinx-pcie.o + +common-obj-$(CONFIG_PCI_DESIGNWARE) += designware.o
Signature · 1 line
2.14.3
PATCH v7 2/3 i.MX: Add i.MX7 SOC implementation.
In reply to Andrey SmirnovThe following interfaces are partially or fully emulated:
* up to 2 Cortex A9 cores (SMP works with PSCI)
* A7 MPCORE (identical to A15 MPCORE)
* 4 GPTs modules
* 7 GPIO controllers
* 2 IOMUXC controllers
* 1 CCM module
* 1 SVNS module
* 1 SRC module
* 1 GPCv2 controller
* 4 eCSPI controllers
* 4 I2C controllers
* 7 i.MX UART controllers
* 2 FlexCAN controllers
* 2 Ethernet controllers (FEC)
* 3 SD controllers (USDHC)
* 4 WDT modules
* 1 SDMA module
* 1 GPR module
* 2 USBMISC modules
* 2 ADC modules
* 1 PCIe controller
Tested to boot and work with upstream Linux (4.13+) guest.
--- default-configs/arm-softmmu.mak | 1 + include/hw/arm/fsl-imx7.h | 222 +++++++++++++++ hw/arm/fsl-imx7.c | 580 ++++++++++++++++++++++++++++++++++++++++ hw/arm/Makefile.objs | 2 + 4 files changed, 805 insertions(+) create mode 100644 include/hw/arm/fsl-imx7.h create mode 100644 hw/arm/fsl-imx7.c
default-configs/arm-softmmu.mak +1 -0
@@ -126,6 +126,7 @@ CONFIG_ALLWINNER_A10=y CONFIG_FSL_IMX6=y CONFIG_FSL_IMX31=y CONFIG_FSL_IMX25=y +CONFIG_FSL_IMX7=y CONFIG_IMX_I2C=y
include/hw/arm/fsl-imx7.h new file +222 -0
222 lines not on this page · raw message
hw/arm/fsl-imx7.c new file +580 -0
580 lines not on this page · raw message
hw/arm/Makefile.objs +2 -0
@@ -22,3 +22,5 @@ obj-$(CONFIG_MPS2) += mps2.o obj-$(CONFIG_MPS2) += mps2-tz.o obj-$(CONFIG_MSF2) += msf2-soc.o msf2-som.o obj-$(CONFIG_IOTKIT) += iotkit.o +obj-$(CONFIG_FSL_IMX7) += fsl-imx7.o +
Signature · 1 line
2.14.3
Quoted 2 lines · Andrey Smirnov
Hi everyone,
Ugh, just realized that I was too hasty to call git "send-email" and patch 1/3 in this submission is broken since I forgot to remove "is_express" field. Please disregard this version of v7 and I'll resend corrected one shortly.
Very sorry for the noise.
Thanks,
Andrey Smirnov