diff options
author | Frederic Konrad | 2021-04-28 21:15:19 +0200 |
---|---|---|
committer | Laurent Vivier | 2021-05-13 19:11:42 +0200 |
commit | 6cd04a88fa3fc5941fcd3677355e1b75efe9c7a8 (patch) | |
tree | 915d26b79e5c6f55747f7de5bed8f53e18dfa903 /hw | |
parent | target/sh4: Return error if CPUClass::get_phys_page_debug() fails (diff) | |
download | qemu-6cd04a88fa3fc5941fcd3677355e1b75efe9c7a8.tar.gz qemu-6cd04a88fa3fc5941fcd3677355e1b75efe9c7a8.tar.xz qemu-6cd04a88fa3fc5941fcd3677355e1b75efe9c7a8.zip |
hw/avr/atmega.c: use the avr51 cpu for atmega1280
According to the as documentation:
(https://sourceware.org/binutils/docs-2.36/as/AVR-Options.html)
"Instruction set avr51 is for the enhanced AVR core with exactly 128K
program memory space (MCU types: atmega128, atmega128a, atmega1280,
atmega1281, atmega1284, atmega1284p, atmega128rfa1, atmega128rfr2,
atmega1284rfr2, at90can128, at90usb1286, at90usb1287, m3000)."
But when compiling a program for atmega1280 or avr51 and trying to execute
it:
$ cat > test.S << EOF
> loop:
> rjmp loop
> EOF
$ avr-gcc -nostdlib -nostartfiles -mmcu=atmega1280 test.S -o test.elf
$ qemu-system-avr -serial mon:stdio -nographic -no-reboot -M mega \
-bios test.elf
qemu-system-avr: Current machine: Arduino Mega (ATmega1280) with 'avr6' CPU
qemu-system-avr: ELF image 'test.elf' is for 'avr51' CPU
So this fixes the atmega1280 class to use an avr51 CPU.
Signed-off-by: Frederic Konrad <frederic.konrad@adacore.com>
Reviewed-by: Joaquin de Andres <me@xcancerberox.com.ar>
Message-Id: <1619637319-22299-1-git-send-email-frederic.konrad@adacore.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/avr/atmega.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/avr/atmega.c b/hw/avr/atmega.c index 80b8a41cb5..0608e2d475 100644 --- a/hw/avr/atmega.c +++ b/hw/avr/atmega.c @@ -401,7 +401,7 @@ static void atmega1280_class_init(ObjectClass *oc, void *data) { AtmegaMcuClass *amc = ATMEGA_MCU_CLASS(oc); - amc->cpu_type = AVR_CPU_TYPE_NAME("avr6"); + amc->cpu_type = AVR_CPU_TYPE_NAME("avr51"); amc->flash_size = 128 * KiB; amc->eeprom_size = 4 * KiB; amc->sram_size = 8 * KiB; |