Skip to contentSkip to conversation

hw/misc/mt7628-sysctrl.c: Add mt7628 system control support.

PATCH New ~luhux 1 participant 3 messages Jan 18, 2023

Subsystems (2)
lore
Share & tools
lore

~luhux

author
#0 lore raw

PATCH 1/3 hw/misc/mt7628-sysctrl.c: Add mt7628 system control support.

From: LuHui <[email protected]>

---
 MAINTAINERS                      |   5 +
 hw/misc/meson.build              |   3 +
 hw/misc/mt7628-sysctrl.c         | 169 +++++++++++++++++++++++++++++++
 include/hw/misc/mt7628-sysctrl.h |  66 ++++++++++++
 4 files changed, 243 insertions(+)
 create mode 100644 hw/misc/mt7628-sysctrl.c
 create mode 100644 include/hw/misc/mt7628-sysctrl.h
MAINTAINERS +5 -0
index 0fe50d01e3..41854e939c 100644
@@ -1234,6 +1234,11 @@ F: configs/devices/mips*/*
 F: hw/mips/
 F: include/hw/mips/
 
+VoCore2
+M: Lu Hui <[email protected]>
+S: Maintained
+F: hw/*/*mt7628*
+
 Jazz
 M: Hervé Poussineau <[email protected]>
 R: Aleksandar Rikalo <[email protected]>
hw/misc/meson.build +3 -0
index 448e14b531..0dfe7d9740 100644
@@ -140,3 +140,6 @@ softmmu_ss.add(when: 'CONFIG_SBSA_REF', if_true: files('sbsa_ec.c'))
 
 # HPPA devices
 softmmu_ss.add(when: 'CONFIG_LASI', if_true: files('lasi.c'))
+
+# mt7628
+softmmu_ss.add(when: 'CONFIG_MT7628', if_true: files('mt7628-sysctrl.c'))
hw/misc/mt7628-sysctrl.c new file +169 -0

169 lines not on this page · raw message

include/hw/misc/mt7628-sysctrl.h new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
2.34.5
author
#1 lore raw

PATCH 2/3 hw/intc/mt7628-intc.c: add mt7628 interrupt control support.

From: LuHui <[email protected]>

---
 hw/intc/meson.build           |   1 +
 hw/intc/mt7628-intc.c         | 155 ++++++++++++++++++++++++++++++++++
 include/hw/intc/mt7628-intc.h |  30 +++++++
 3 files changed, 186 insertions(+)
 create mode 100644 hw/intc/mt7628-intc.c
 create mode 100644 include/hw/intc/mt7628-intc.h
hw/intc/meson.build +1 -0
index cd9f1ee888..2ce3ddb4d2 100644
@@ -73,3 +73,4 @@ specific_ss.add(when: 'CONFIG_LOONGARCH_IPI', if_true: files('loongarch_ipi.c'))
 specific_ss.add(when: 'CONFIG_LOONGARCH_PCH_PIC', if_true: files('loongarch_pch_pic.c'))
 specific_ss.add(when: 'CONFIG_LOONGARCH_PCH_MSI', if_true: files('loongarch_pch_msi.c'))
 specific_ss.add(when: 'CONFIG_LOONGARCH_EXTIOI', if_true: files('loongarch_extioi.c'))
+specific_ss.add(when: 'CONFIG_MT7628', if_true: files('mt7628-intc.c'))
hw/intc/mt7628-intc.c new file +155 -0

155 lines not on this page · raw message

include/hw/intc/mt7628-intc.h new file +30 -0
new file mode 100644
index 0000000000..a2f4690d1d
@@ -0,0 +1,30 @@
+#ifndef MT7628_INTC_H
+#define MT7628_INTC_H
+
+#include "hw/sysbus.h"
+#include "qom/object.h"
+
+#define TYPE_MT7628_INTC  "mt7628-intc"
+OBJECT_DECLARE_SIMPLE_TYPE(mt7628intcState, MT7628_INTC)
+
+#define MT7628_INTC_REG_STATUS0     (0x9c)
+#define MT7628_INTC_REG_TYPE        (0x6c)
+#define MT7628_INTC_REG_ENABLE      (0x80)
+#define MT7628_INTC_REG_DISABLE     (0x78)
+
+#define MT7628_INTC_REGS_MAXADDR (0xFF)
+
+struct mt7628intcState {
+    /*< private >*/
+    SysBusDevice parent_obj;
+    /*< public >*/
+    MemoryRegion iomem;
+    qemu_irq parent_irq;
+
+    uint32_t type;
+    uint32_t enable;
+    uint32_t disable;
+    /*priority setting here*/
+};
+
+#endif
Signature · 1 line
2.34.5
author
#2 lore raw

PATCH 3/3 hw/mips/mt7628.c: add mt7628 soc support, add a mt7628 board VoCore2.

In reply to ~luhux

From: LuHui <[email protected]>

---
 MAINTAINERS                             |   1 +
 configs/devices/mips-softmmu/common.mak |   2 +
 hw/mips/Kconfig                         |  11 ++
 hw/mips/meson.build                     |   2 +
 hw/mips/mt7628.c                        | 189 ++++++++++++++++++++++++
 hw/mips/vocore2.c                       | 180 ++++++++++++++++++++++
 include/hw/mips/mt7628.h                |  77 ++++++++++
 7 files changed, 462 insertions(+)
 create mode 100644 hw/mips/mt7628.c
 create mode 100644 hw/mips/vocore2.c
 create mode 100644 include/hw/mips/mt7628.h
MAINTAINERS +1 -0
index 41854e939c..1b2f92e078 100644
@@ -1238,6 +1238,7 @@ VoCore2
 M: Lu Hui <[email protected]>
 S: Maintained
 F: hw/*/*mt7628*
+F: hw/mips/vocore2.c
 
 Jazz
 M: Hervé Poussineau <[email protected]>
configs/devices/mips-softmmu/common.mak +2 -0
index 7da99327a7..e4a5c54635 100644
@@ -29,3 +29,5 @@ CONFIG_PCNET_PCI=y
 CONFIG_MIPSSIM=y
 CONFIG_SMBUS_EEPROM=y
 CONFIG_TEST_DEVICES=y
+CONFIG_MT7628=y
+CONFIG_VOCORE2=y
hw/mips/Kconfig +11 -0
index da3a37e215..f7faec010c 100644
@@ -10,6 +10,17 @@ config MIPSSIM
     select SERIAL_ISA
     select MIPSNET
 
+config MT7628
+    bool
+    select SERIAL
+    select USB_EHCI
+    select USB_EHCI_SYSBUS
+    select UNIMP
+
+config VOCORE2
+    bool
+    select MT7628
+
 config JAZZ
     bool
     select ISA_BUS
hw/mips/meson.build +2 -0
index 900613fc08..9ad125a996 100644
@@ -10,6 +10,8 @@ mips_ss.add(when: 'CONFIG_JAZZ', if_true: files('jazz.c'))
 mips_ss.add(when: 'CONFIG_MIPSSIM', if_true: files('mipssim.c'))
 mips_ss.add(when: 'CONFIG_FULOONG', if_true: files('fuloong2e.c'))
 mips_ss.add(when: 'CONFIG_MIPS_BOSTON', if_true: [files('boston.c'), fdt])
+mips_ss.add(when: 'CONFIG_MT7628', if_true: files('mt7628.c'))
+mips_ss.add(when: 'CONFIG_VOCORE2', if_true: files('vocore2.c'))
 endif
 
 hw_arch += {'mips': mips_ss}
hw/mips/mt7628.c new file +189 -0

189 lines not on this page · raw message

hw/mips/vocore2.c new file +180 -0

180 lines not on this page · raw message

include/hw/mips/mt7628.h new file +77 -0

77 lines not on this page · raw message

Signature · 1 line
2.34.5