summaryrefslogtreecommitdiff
path: root/target/csky
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2018-01-13 21:07:10 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2018-02-03 16:27:56 +0000
commit1f032e95500d0e2ec60381e4ed3a5fde698427c7 (patch)
treefc9c22aaf2036a787f147da40d9bc74e23756f7c /target/csky
parentdaed5353981450089919ebf451e15d7726519644 (diff)
csky: add better qemu support
Diffstat (limited to 'target/csky')
-rw-r--r--target/csky/Makefile12
-rw-r--r--target/csky/ck610.dtbbin0 -> 1727 bytes
-rw-r--r--target/csky/ck610.dts98
-rw-r--r--target/csky/ck810.dtbbin0 -> 1759 bytes
-rw-r--r--target/csky/ck810.dts98
-rw-r--r--target/csky/kernel/qemu-csky-ck6108
-rw-r--r--target/csky/kernel/qemu-csky-ck807 (renamed from target/csky/kernel/qemu-csky-ck807f)0
-rw-r--r--target/csky/kernel/qemu-csky-ck81011
-rw-r--r--target/csky/kernel/qemu-csky-ck810f4
-rw-r--r--target/csky/qemu.dtbbin0 -> 1638 bytes
-rw-r--r--target/csky/qemu.dts87
-rw-r--r--target/csky/systems/qemu-csky-ck8077
-rw-r--r--target/csky/systems/qemu-csky-ck807f7
-rw-r--r--target/csky/systems/qemu-csky-ck8107
-rw-r--r--target/csky/systems/qemu-csky-ck810f7
15 files changed, 322 insertions, 24 deletions
diff --git a/target/csky/Makefile b/target/csky/Makefile
index 4765ed007..c60d44536 100644
--- a/target/csky/Makefile
+++ b/target/csky/Makefile
@@ -7,15 +7,15 @@ include $(ADK_TOPDIR)/mk/image.mk
KERNEL:=$(LINUX_DIR)/$(ADK_TARGET_KERNEL)
-QEMU_ARGS:=${ADK_QEMU_ARGS}
+QEMU_ARGS:=${ADK_QEMU_ARGS} -M virt
ifeq ($(ADK_TARGET_SYSTEM_QEMU_CSKY_CK610),y)
-QEMU:=qemu-system-cskyv1
+QEMU:=qemu-system-cskyv1 -dtb target/csky/ck610.dtb
endif
-ifeq ($(ADK_TARGET_SYSTEM_QEMU_CSKY_CK807F),y)
-QEMU:=qemu-system-cskyv2
+ifeq ($(ADK_TARGET_SYSTEM_QEMU_CSKY_CK807),y)
+QEMU:=qemu-system-cskyv2 -dtb target/csky/qemu.dtb
endif
-ifeq ($(ADK_TARGET_SYSTEM_QEMU_CSKY_CK810F),y)
-QEMU:=qemu-system-cskyv2
+ifeq ($(ADK_TARGET_SYSTEM_QEMU_CSKY_CK810),y)
+QEMU:=qemu-system-cskyv2 -dtb target/csky/ck810.dtb
endif
# target helper text
diff --git a/target/csky/ck610.dtb b/target/csky/ck610.dtb
new file mode 100644
index 000000000..a228fc6b7
--- /dev/null
+++ b/target/csky/ck610.dtb
Binary files differ
diff --git a/target/csky/ck610.dts b/target/csky/ck610.dts
new file mode 100644
index 000000000..b29a3cdf1
--- /dev/null
+++ b/target/csky/ck610.dts
@@ -0,0 +1,98 @@
+/dts-v1/;
+
+/ {
+ model = "qemu.csky.ck610";
+ compatible = "csky";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ memory {
+ device_type = "memory";
+ reg = <0x0 0x1f400000>;
+ };
+
+ cpus {
+ #address-cells = <0>;
+ #size-cells = <0>;
+
+ cpu {
+ device_type = "cpu";
+ ccr = <0x7d>;
+ hint = <0x1c>;
+ };
+ };
+
+ soc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ ranges;
+
+ dummy_apb: apb-clock {
+ compatible = "fixed-clock";
+ clock-frequency = <40000000>;
+ clock-output-names = "dummy_apb";
+ #clock-cells = <0>;
+ };
+
+ intc: interrupt-controller {
+ compatible = "csky,intc-v1";
+ reg = <0x1ffff000 0x1000>;
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ };
+
+ /* clockevent */
+ timer0 {
+ compatible = "snps,dw-apb-timer";
+ reg = <0x1fffd000 0x1000>;
+ clocks = <&dummy_apb>;
+ clock-names = "timer";
+ interrupts = <1>;
+ interrupt-parent = <&intc>;
+ };
+
+ /* clocksource */
+ timer1 {
+ compatible = "snps,dw-apb-timer";
+ reg = <0x1fffd014 0x800>;
+ clocks = <&dummy_apb>;
+ clock-names = "timer";
+ interrupts = <2>;
+ interrupt-parent = <&intc>;
+ };
+
+ serial0 {
+ compatible = "ns16550a";
+ reg = <0x1fffe000 0x1000>;
+ interrupt-parent = <&intc>;
+ interrupts = <3>;
+ clocks = <&dummy_apb>;
+ baud = <115200>;
+ reg-shift = <2>;
+ reg-io-width = <1>;
+ };
+
+ gmac: ethernet {
+ compatible = "snps,dwmac";
+ reg = <0x1fffa000 0x2000>;
+ interrupt-parent = <&intc>;
+ interrupts = <4>;
+ interrupt-names = "macirq";
+ clocks = <&dummy_apb>;
+ clock-names = "stmmaceth";
+ phy-mode = "mii";
+ snps,pbl = <32>;
+ snps,fixed-burst;
+ };
+
+ qemu-exit {
+ compatible = "csky,qemu-exit";
+ reg = <0x1fffc000 0x1000>;
+ };
+ };
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+};
diff --git a/target/csky/ck810.dtb b/target/csky/ck810.dtb
new file mode 100644
index 000000000..9248925d6
--- /dev/null
+++ b/target/csky/ck810.dtb
Binary files differ
diff --git a/target/csky/ck810.dts b/target/csky/ck810.dts
new file mode 100644
index 000000000..de5ad3d0a
--- /dev/null
+++ b/target/csky/ck810.dts
@@ -0,0 +1,98 @@
+/dts-v1/;
+
+/ {
+ model = "qemu.csky.ck810";
+ compatible = "csky";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ memory {
+ device_type = "memory";
+ reg = <0x0 0x1f400000>;
+ };
+
+ cpus {
+ #address-cells = <0>;
+ #size-cells = <0>;
+
+ cpu {
+ device_type = "cpu";
+ ccr = <0x417d>;
+ hint = <0xe>;
+ };
+ };
+
+ soc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ ranges;
+
+ intc: interrupt-controller {
+ compatible = "csky,intc-v1";
+ reg = <0x1ffff000 0x1000>;
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ };
+
+ /* clockevent */
+ timer0 {
+ compatible = "snps,dw-apb-timer";
+ reg = <0x1fffd000 0x1000>;
+ clocks = <&dummy_apb>;
+ clock-names = "timer";
+ interrupts = <1>;
+ interrupt-parent = <&intc>;
+ };
+
+ /* clocksource */
+ timer1 {
+ compatible = "snps,dw-apb-timer";
+ reg = <0x1fffd014 0x800>;
+ clocks = <&dummy_apb>;
+ clock-names = "timer";
+ interrupts = <2>;
+ interrupt-parent = <&intc>;
+ };
+
+ serial0 {
+ compatible = "ns16550a";
+ reg = <0x1fffe000 0x1000>;
+ interrupt-parent = <&intc>;
+ interrupts = <3>;
+ clocks = <&dummy_apb>;
+ baud = <115200>;
+ reg-shift = <2>;
+ reg-io-width = <1>;
+ };
+
+ dummy_apb: apb-clock {
+ compatible = "fixed-clock";
+ clock-frequency = <40000000>;
+ clock-output-names = "dummy_apb";
+ #clock-cells = <0>;
+ };
+
+ gmac: ethernet {
+ compatible = "snps,dwmac";
+ reg = <0x1fffa000 0x2000>;
+ interrupt-parent = <&intc>;
+ interrupts = <4>;
+ interrupt-names = "macirq";
+ clocks = <&dummy_apb>;
+ clock-names = "stmmaceth";
+ phy-mode = "mii";
+ snps,pbl = <32>;
+ snps,fixed-burst;
+ };
+
+ qemu-exit {
+ compatible = "csky,qemu-exit";
+ reg = <0x1fffc000 0x1000>;
+ };
+ };
+
+ chosen {
+ bootargs = "console=ttyS0,115200 rdinit=/sbin/init root=/dev/ram0";
+ };
+};
diff --git a/target/csky/kernel/qemu-csky-ck610 b/target/csky/kernel/qemu-csky-ck610
index 3725f01d2..341d9059d 100644
--- a/target/csky/kernel/qemu-csky-ck610
+++ b/target/csky/kernel/qemu-csky-ck610
@@ -1,3 +1,11 @@
CONFIG_CSKY=y
CONFIG_CPU_CK610=y
+CONFIG_CSKY_IRQ=y
+CONFIG_RAM_BASE=0x0
+CONFIG_NATIONALCHIP_IRQ=y
+CONFIG_NATIONALCHIP_TIMER=y
+CONFIG_CSKYMAC=y
+CONFIG_CSKY_ADDONS=y
+CONFIG_MMU_HARD_REFILL=y
+CONFIG_SOFT_HANDMISSALIGN=y
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
diff --git a/target/csky/kernel/qemu-csky-ck807f b/target/csky/kernel/qemu-csky-ck807
index 1dc23212a..1dc23212a 100644
--- a/target/csky/kernel/qemu-csky-ck807f
+++ b/target/csky/kernel/qemu-csky-ck807
diff --git a/target/csky/kernel/qemu-csky-ck810 b/target/csky/kernel/qemu-csky-ck810
new file mode 100644
index 000000000..d87522604
--- /dev/null
+++ b/target/csky/kernel/qemu-csky-ck810
@@ -0,0 +1,11 @@
+CONFIG_CSKY=y
+CONFIG_CPU_CK810=y
+CONFIG_CSKY_IRQ=y
+CONFIG_RAM_BASE=0x0
+CONFIG_NATIONALCHIP_IRQ=y
+CONFIG_NATIONALCHIP_TIMER=y
+CONFIG_CSKYMAC=y
+CONFIG_CSKY_ADDONS=y
+CONFIG_MMU_HARD_REFILL=y
+CONFIG_SOFT_HANDMISSALIGN=y
+CONFIG_SECTION_MISMATCH_WARN_ONLY=y
diff --git a/target/csky/kernel/qemu-csky-ck810f b/target/csky/kernel/qemu-csky-ck810f
deleted file mode 100644
index 58a17168d..000000000
--- a/target/csky/kernel/qemu-csky-ck810f
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_CSKY=y
-CONFIG_CPU_CK810=y
-CSKY_BUILTIN_DTB=y
-CONFIG_SECTION_MISMATCH_WARN_ONLY=y
diff --git a/target/csky/qemu.dtb b/target/csky/qemu.dtb
new file mode 100644
index 000000000..5cc22b091
--- /dev/null
+++ b/target/csky/qemu.dtb
Binary files differ
diff --git a/target/csky/qemu.dts b/target/csky/qemu.dts
new file mode 100644
index 000000000..59e1c8390
--- /dev/null
+++ b/target/csky/qemu.dts
@@ -0,0 +1,87 @@
+/dts-v1/;
+
+/ {
+ model = "qemu.csky";
+ compatible = "csky";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ memory {
+ device_type = "memory";
+ reg = <0x0 0x40000000>;
+ };
+
+ soc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ ranges;
+
+ intc: interrupt-controller {
+ compatible = "csky,intc-v1";
+ reg = <0xfffff000 0x1000>;
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ };
+
+ /* clockevent */
+ timer0 {
+ compatible = "snps,dw-apb-timer";
+ reg = <0xffffd000 0x1000>;
+ clocks = <&dummy_apb>;
+ clock-names = "timer";
+ interrupts = <1>;
+ interrupt-parent = <&intc>;
+ };
+
+ /* clocksource */
+ timer1 {
+ compatible = "snps,dw-apb-timer";
+ reg = <0xffffd014 0x800>;
+ clocks = <&dummy_apb>;
+ clock-names = "timer";
+ interrupts = <2>;
+ interrupt-parent = <&intc>;
+ };
+
+ serial0 {
+ compatible = "ns16550a";
+ reg = <0xffffe000 0x1000>;
+ interrupt-parent = <&intc>;
+ interrupts = <3>;
+ clocks = <&dummy_apb>;
+ baud = <115200>;
+ reg-shift = <2>;
+ reg-io-width = <1>;
+ };
+
+ dummy_apb: apb-clock {
+ compatible = "fixed-clock";
+ clock-frequency = <40000000>;
+ clock-output-names = "dummy_apb";
+ #clock-cells = <0>;
+ };
+
+ gmac: ethernet {
+ compatible = "snps,dwmac";
+ reg = <0xffffa000 0x2000>;
+ interrupt-parent = <&intc>;
+ interrupts = <4>;
+ interrupt-names = "macirq";
+ clocks = <&dummy_apb>;
+ clock-names = "stmmaceth";
+ phy-mode = "mii";
+ snps,pbl = <32>;
+ snps,fixed-burst;
+ };
+
+ qemu-exit {
+ compatible = "csky,qemu-exit";
+ reg = <0xffffc000 0x1000>;
+ };
+ };
+
+ chosen {
+ bootargs = "console=ttyS0,115200 rdinit=/sbin/init root=/dev/ram0";
+ };
+};
diff --git a/target/csky/systems/qemu-csky-ck807 b/target/csky/systems/qemu-csky-ck807
new file mode 100644
index 000000000..4b964dc1b
--- /dev/null
+++ b/target/csky/systems/qemu-csky-ck807
@@ -0,0 +1,7 @@
+config ADK_TARGET_SYSTEM_QEMU_CSKY_CK807
+ bool "Qemu Emulator (ck807)"
+ select ADK_TARGET_QEMU
+ select ADK_TARGET_CPU_CSKY_CK807
+ help
+ Qemu Emulator for C-SKY architecture (ck807).
+
diff --git a/target/csky/systems/qemu-csky-ck807f b/target/csky/systems/qemu-csky-ck807f
deleted file mode 100644
index f1deaef84..000000000
--- a/target/csky/systems/qemu-csky-ck807f
+++ /dev/null
@@ -1,7 +0,0 @@
-config ADK_TARGET_SYSTEM_QEMU_CSKY_CK807F
- bool "Qemu Emulator (ck807f)"
- select ADK_TARGET_QEMU
- select ADK_TARGET_CPU_CSKY_CK807F
- help
- Qemu Emulator for C-SKY architecture (ck807f).
-
diff --git a/target/csky/systems/qemu-csky-ck810 b/target/csky/systems/qemu-csky-ck810
new file mode 100644
index 000000000..02314bf6e
--- /dev/null
+++ b/target/csky/systems/qemu-csky-ck810
@@ -0,0 +1,7 @@
+config ADK_TARGET_SYSTEM_QEMU_CSKY_CK810
+ bool "Qemu Emulator (ck810)"
+ select ADK_TARGET_QEMU
+ select ADK_TARGET_CPU_CSKY_CK810
+ help
+ Qemu Emulator for C-SKY architecture (ck810).
+
diff --git a/target/csky/systems/qemu-csky-ck810f b/target/csky/systems/qemu-csky-ck810f
deleted file mode 100644
index d5bc10643..000000000
--- a/target/csky/systems/qemu-csky-ck810f
+++ /dev/null
@@ -1,7 +0,0 @@
-config ADK_TARGET_SYSTEM_QEMU_CSKY_CK810F
- bool "Qemu Emulator (ck810f)"
- select ADK_TARGET_QEMU
- select ADK_TARGET_CPU_CSKY_CK810F
- help
- Qemu Emulator for C-SKY architecture (ck810f).
-