]> Git Repo - qemu.git/commitdiff
target/avr: Add basic parameters of the new platform
authorMichael Rolnik <[email protected]>
Fri, 24 Jan 2020 00:51:07 +0000 (01:51 +0100)
committerPhilippe Mathieu-Daudé <[email protected]>
Fri, 10 Jul 2020 15:58:32 +0000 (17:58 +0200)
This includes definitions of various basic parameters needed
for integration of a new platform into QEMU.

[AM: Split a larger AVR introduction patch into logical units]
Suggested-by: Aleksandar Markovic <[email protected]>
Co-developed-by: Michael Rolnik <[email protected]>
Co-developed-by: Sarah Harris <[email protected]>
Signed-off-by: Michael Rolnik <[email protected]>
Signed-off-by: Sarah Harris <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Acked-by: Igor Mammedov <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
[thuth: Simplify MAINTAINERS right from the start]
Signed-off-by: Thomas Huth <[email protected]>
Message-Id: <20200705140315[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
MAINTAINERS
target/avr/cpu-param.h [new file with mode: 0644]
target/avr/cpu.h [new file with mode: 0644]

index 6aa54f7f8f01b86ce24c8282827aeb1b9a6b23b2..dda872ef2a01d2ec925662fcca24f54fc7000249 100644 (file)
@@ -167,6 +167,12 @@ S: Maintained
 F: hw/arm/smmu*
 F: include/hw/arm/smmu*
 
+AVR TCG CPUs
+M: Michael Rolnik <[email protected]>
+R: Sarah Harris <[email protected]>
+S: Maintained
+F: target/avr/
+
 CRIS TCG CPUs
 M: Edgar E. Iglesias <[email protected]>
 S: Maintained
diff --git a/target/avr/cpu-param.h b/target/avr/cpu-param.h
new file mode 100644 (file)
index 0000000..7ef4e7c
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * QEMU AVR CPU
+ *
+ * Copyright (c) 2016-2020 Michael Rolnik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#ifndef AVR_CPU_PARAM_H
+#define AVR_CPU_PARAM_H
+
+#define TARGET_LONG_BITS 32
+/*
+ * TARGET_PAGE_BITS cannot be more than 8 bits because
+ * 1.  all IO registers occupy [0x0000 .. 0x00ff] address range, and they
+ *     should be implemented as a device and not memory
+ * 2.  SRAM starts at the address 0x0100
+ */
+#define TARGET_PAGE_BITS 8
+#define TARGET_PHYS_ADDR_SPACE_BITS 24
+#define TARGET_VIRT_ADDR_SPACE_BITS 24
+#define NB_MMU_MODES 2
+
+#endif
diff --git a/target/avr/cpu.h b/target/avr/cpu.h
new file mode 100644 (file)
index 0000000..45a87c5
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * QEMU AVR CPU
+ *
+ * Copyright (c) 2016-2020 Michael Rolnik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#ifndef QEMU_AVR_CPU_H
+#define QEMU_AVR_CPU_H
+
+#include "exec/cpu-defs.h"
+
+#define TCG_GUEST_DEFAULT_MO 0
+
+/*
+ * AVR has two memory spaces, data & code.
+ * e.g. both have 0 address
+ * ST/LD instructions access data space
+ * LPM/SPM and instruction fetching access code memory space
+ */
+#define MMU_CODE_IDX 0
+#define MMU_DATA_IDX 1
+
+#define EXCP_RESET 1
+#define EXCP_INT(n) (EXCP_RESET + (n) + 1)
+
+/* Number of CPU registers */
+#define NUMBER_OF_CPU_REGISTERS 32
+/* Number of IO registers accessible by ld/st/in/out */
+#define NUMBER_OF_IO_REGISTERS 64
+
+/*
+ * Offsets of AVR memory regions in host memory space.
+ *
+ * This is needed because the AVR has separate code and data address
+ * spaces that both have start from zero but have to go somewhere in
+ * host memory.
+ *
+ * It's also useful to know where some things are, like the IO registers.
+ */
+/* Flash program memory */
+#define OFFSET_CODE 0x00000000
+/* CPU registers, IO registers, and SRAM */
+#define OFFSET_DATA 0x00800000
+/* CPU registers specifically, these are mapped at the start of data */
+#define OFFSET_CPU_REGISTERS OFFSET_DATA
+/*
+ * IO registers, including status register, stack pointer, and memory
+ * mapped peripherals, mapped just after CPU registers
+ */
+#define OFFSET_IO_REGISTERS (OFFSET_DATA + NUMBER_OF_CPU_REGISTERS)
+
+#endif /* !defined (QEMU_AVR_CPU_H) */
This page took 0.032676 seconds and 4 git commands to generate.