add sunxi machine type
v2 cover add sunxi machine type
this patch-set implemented a device-reduced
machine type for Allwinner's sunxi series SoC,
like sunxi-4i/5i/7i ...
now, It can support sunxi-4i with a cortex-a8 processor. and will support more later, like sunxi-7i with cortex-a7, and will add more devices.
V2: split timer and interrupt controller emulation into
their corresponding files.
Peter,
I want to add VMState later, can I?
because currently I'm not sure how to pick up
the elements to be packed into VMState.
reference:
http://linux-sunxi.org/Main_Page
Li Guang (4)
hw/timer: add sunxi timer device hw/intc: add sunxi interrupt controller device hw/arm: add sunxi machine type
MAINTAINERS: add myself to maintain sunxi machine
default-configs/arm-softmmu.mak | 3 + hw/arm/Makefile.objs | 1 + hw/arm/sunxi-soc.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++ hw/intc/Makefile.objs | 1 + hw/intc/sunxi-pic.c | 297 +++++++++++++++++++++++++++++++++++++++ hw/timer/Makefile.objs | 1 + hw/timer/sunxi-pit.c | 218 +++++++++++++++++++++++++++++++++++++++ include/hw/intc/sunxi-pic.h | 27 ++++ include/hw/timer/sunxi-pit.h | 25 +++++ MAINTAINERS | 9 +++++++++ 10 files changed, 695 insertions(+), 0 deletions(-) create mode 100644 hw/timer/sunxi-pit.c create mode 100644 include/hw/timer/sunxi-pit.h create mode 100644 hw/intc/sunxi-pic.c create mode 100644 include/hw/intc/sunxi-pic.h create mode 100644 hw/arm/sunxi-soc.c
PATCH v2 1/4 hw/timer: add sunxi timer device
--- default-configs/arm-softmmu.mak | 2 + hw/timer/Makefile.objs | 1 + hw/timer/sunxi-pit.c | 218 +++++++++++++++++++++++++++++++++++++++ include/hw/timer/sunxi-pit.h | 25 +++++ 4 files changed, 246 insertions(+), 0 deletions(-) create mode 100644 hw/timer/sunxi-pit.c create mode 100644 include/hw/timer/sunxi-pit.h
default-configs/arm-softmmu.mak +2 -0
@@ -81,3 +81,5 @@ CONFIG_VERSATILE_I2C=y CONFIG_SDHCI=y CONFIG_INTEGRATOR_DEBUG=y + +CONFIG_SUNXI_PIT=y
hw/timer/Makefile.objs +1 -0
@@ -27,3 +27,4 @@ obj-$(CONFIG_SH4) += sh_timer.o obj-$(CONFIG_TUSB6010) += tusb6010.o obj-$(CONFIG_MC146818RTC) += mc146818rtc.o +obj-$(CONFIG_SUNXI_PIT) += sunxi-pit.o
hw/timer/sunxi-pit.c new file +218 -0
218 lines not on this page · raw message
include/hw/timer/sunxi-pit.h new file +25 -0
@@ -0,0 +1,25 @@ +#ifndef SUNXI_PIT_H +#define SUNXI_PIT_H + + +#define TYPE_SUNXI_PIT "sunix-timer" +#define SUNXI_PIT (obj) OBJECT_CHECK(SunxiPITState, (obj), TYPE_SUNXI_PIT) + +#define SUNXI_TIMER_NR 6 +#define SUNXI_TIMER_IRQ 0x1 +#define SUNXI_WDOG_IRQ 0x100 + +#define SUNXI_TIMER_IRQ_EN 0 +#define SUNXI_TIMER_IRQ_ST 0x4 +#define SUNXI_TIMER_CONTROL 0x0 +#define SUNXI_TIMER_INTERVAL 0x4 +#define SUNXI_TIMER_COUNT 0x8 +#define SUNXI_WDOG_CONTROL 0x90 +#define SUNXI_WDOG_MODE 0x94 +#define SUNXI_WDOG_COUNT_LO 0xa4 +#define SUNXI_WDOG_COUNT_HI 0xa8 +#define SUNXI_TIMER_BASE 0x10 + + +#endif +
Signature · 1 line
1.7.2.5
PATCH v2 2/4 hw/intc: add sunxi interrupt controller device
In reply to liguang--- default-configs/arm-softmmu.mak | 1 + hw/intc/Makefile.objs | 1 + hw/intc/sunxi-pic.c | 297 +++++++++++++++++++++++++++++++++++++++ include/hw/intc/sunxi-pic.h | 27 ++++ 4 files changed, 326 insertions(+), 0 deletions(-) create mode 100644 hw/intc/sunxi-pic.c create mode 100644 include/hw/intc/sunxi-pic.h
default-configs/arm-softmmu.mak +1 -0
@@ -83,3 +83,4 @@ CONFIG_SDHCI=y CONFIG_INTEGRATOR_DEBUG=y CONFIG_SUNXI_PIT=y +CONFIG_SUNXI_PIC=y
hw/intc/Makefile.objs +1 -0
@@ -12,6 +12,7 @@ common-obj-$(CONFIG_IOAPIC) += ioapic_common.o common-obj-$(CONFIG_ARM_GIC) += arm_gic_common.o common-obj-$(CONFIG_ARM_GIC) += arm_gic.o common-obj-$(CONFIG_OPENPIC) += openpic.o +common-obj-$(CONFIG_SUNXI_PIC) += sunxi-pic.o obj-$(CONFIG_APIC) += apic.o apic_common.o obj-$(CONFIG_ARM_GIC_KVM) += arm_gic_kvm.o
hw/intc/sunxi-pic.c new file +297 -0
297 lines not on this page · raw message
include/hw/intc/sunxi-pic.h new file +27 -0
@@ -0,0 +1,27 @@ +#ifndef SUNXI_PIC_H +#define SUNXI_PIC_H + +#define TYPE_SUNXI_PIC "sunxi_PIC" +#define SUNXI_PIC (obj) OBJECT_CHECK(SunxiPICState, (obj), TYPE_SUNXI_PIC) + +#define PIC_VECTOR 0 +#define PIC_BASE_ADDR 4 +#define PIC_PROTECT 8 +#define PIC_NMI 0xc +#define PIC_IRQ_PENDING0 0x10 +#define PIC_IRQ_PENDING1 0x14 +#define PIC_IRQ_PENDING2 0x18 +#define PIC_FIQ_PENDING0 0x20 +#define PIC_FIQ_PENDING1 0x24 +#define PIC_FIQ_PENDING2 0x28 +#define PIC_SELECT0 0x30 +#define PIC_SELECT1 0x34 +#define PIC_SELECT2 0x38 +#define PIC_ENABLE0 0x40 +#define PIC_ENABLE1 0x44 +#define PIC_ENABLE2 0x48 +#define PIC_MASK0 0x50 +#define PIC_MASK1 0x54 +#define PIC_MASK2 0x58 + +#endif
Signature · 1 line
1.7.2.5
PATCH v2 3/4 hw/arm: add sunxi machine type
In reply to liguang--- hw/arm/Makefile.objs | 1 + hw/arm/sunxi-soc.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 0 deletions(-) create mode 100644 hw/arm/sunxi-soc.c
hw/arm/Makefile.objs +1 -0
@@ -5,3 +5,4 @@ obj-y += tosa.o versatilepb.o vexpress.o xilinx_zynq.o z2.o obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o obj-y += omap1.o omap2.o strongarm.o +obj-y += sunxi-soc.o
hw/arm/sunxi-soc.c new file +113 -0
113 lines not on this page · raw message
Signature · 1 line
1.7.2.5
PATCH v2 4/4 MAINTAINERS: add myself to maintain sunxi machine
In reply to liguang--- MAINTAINERS | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
MAINTAINERS +9 -0
@@ -284,6 +284,15 @@ M: Peter Maydell <[email protected]> S: Maintained F: hw/*/stellaris* +Sunxi +M: Li Guang <[email protected]> +S: Maintained +F: hw/arm/sunxi-soc.c +F: hw/intc/sunxi-pic.c +F: hw/timer/sunxi-pit.c +F: include/hw/intc/sunxi-pic.h +F: include/hw/timer/sunxi-pit.h + Versatile PB M: Peter Maydell <[email protected]> S: Maintained
Signature · 1 line
1.7.2.5