hw/avr/atmega.c: use the avr51 cpu for atmega1280
PATCH 1/1 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
Quoted 3 lines
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' CPUSo this fixes the atmega1280 class to use an avr51 CPU.
--- hw/avr/atmega.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/avr/atmega.c +1 -1
@@ -402,7 +402,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;
Signature · 1 line
2.30.1
Cc'ing Joaquín.
Quoted 42 lines · Frederic Konrad
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 << EOFQuoted 3 lines
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' CPUSo this fixes the atmega1280 class to use an avr51 CPU.
Signed-off-by Frederic Konrad <[email protected]>--- hw/avr/atmega.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/avr/atmega.c +1
-1@@ -402,7 +402,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;
Quoted 39 lines · Philippe Mathieu-Daudé
Cc'ing Joaquín.
Quoted 36 lines · Frederic Konrad
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 << EOFQuoted 3 lines
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' CPUSo this fixes the atmega1280 class to use an avr51 CPU.
Signed-off-by Frederic Konrad <[email protected]>--- hw/avr/atmega.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/avr/atmega.c +0
-0@@ -402,7 +402,7 @@ static void atmega1280_class_init(ObjectClass *oc, void *data) {AtmegaMcuClass *amc =ATMEGA_MCU_CLASS (oc);
Quoted 7 lines
hw/avr/atmega.c static void atmega1280_class_init(ObjectClass *oc, void *data) · line 408
Quoted 6 lines
hw/avr/atmega.c +1
-1- 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;
Good catch!
Le 4/30/21 à 12:27 PM, Joaquin de Andres a écrit :
Quoted 40 lines · Philippe Mathieu-Daudé
Quoted 39 lines
Cc'ing Joaquín.
Quoted 36 lines · Frederic Konrad
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 << EOFQuoted 3 lines
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' CPUSo this fixes the atmega1280 class to use an avr51 CPU.
Signed-off-by Frederic Konrad <[email protected]>--- hw/avr/atmega.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/avr/atmega.c +0
-0@@ -402,7 +402,7 @@ static void atmega1280_class_init(ObjectClass *oc, void *data) {AtmegaMcuClass *amc =ATMEGA_MCU_CLASS (oc);
Quoted 9 lines
Quoted 7 lines
hw/avr/atmega.c static void atmega1280_class_init(ObjectClass *oc, void *data) · line 408
Quoted 6 lines
hw/avr/atmega.c +1
-1- 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;Good catch!
Thanks, does that count as a reviewed-by :)?
Joaquin de Andres
Reviewed-byQuoted 52 lines · Fred Konrad
Le 4/30/21 à 12:27 PM, Joaquin de Andres a écrit :
Quoted 49 lines · Philippe Mathieu-Daudé
Quoted 48 lines
Cc'ing Joaquín.
Quoted 44 lines · Frederic Konrad
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 << EOFQuoted 3 lines
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' CPUSo this fixes the atmega1280 class to use an avr51 CPU.
Signed-off-by Frederic Konrad <[email protected]>---
hw/avr/atmega.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)hw/avr/atmega.c +1
-0@@ -402,7 +402,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;
Quoted 6 lines
Quoted 2 lines
Good catch!
Thanks, does that count as a reviewed-by :)?
Yes! sorry.
Cc'ing qemu-trivial@
Quoted 64 lines · Joaquin de Andres
Quoted 52 lines · Fred Konrad
Le 4/30/21 à 12:27 PM, Joaquin de Andres a écrit :
Quoted 49 lines · Philippe Mathieu-Daudé
Quoted 48 lines
Cc'ing Joaquín.
Quoted 44 lines · Frederic Konrad
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 << EOFQuoted 3 lines
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' CPUSo this fixes the atmega1280 class to use an avr51 CPU.
Signed-off-by Frederic Konrad <[email protected]>---
hw/avr/atmega.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)hw/avr/atmega.c +1
-0@@ -402,7 +402,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;Quoted 6 lines
Quoted 2 lines
Good catch!
Thanks, does that count as a reviewed-by :)?
Yes! sorry.
Reviewed-by Joaquin de Andres <[email protected]>
Laurent Vivier
AppliedLe 13/05/2021 à 19:04, Philippe Mathieu-Daudé a écrit :
Quoted 1 line
Cc'ing qemu-trivial@
Applied to my trivial-patches branch.
Thanks,
Laurent
Quoted 66 lines · Joaquin de Andres
Quoted 64 lines · Fred Konrad
Quoted 52 lines
Le 4/30/21 à 12:27 PM, Joaquin de Andres a écrit :
Quoted 49 lines · Philippe Mathieu-Daudé
Quoted 48 lines
Cc'ing Joaquín.
Quoted 44 lines · Frederic Konrad
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 << EOFQuoted 3 lines
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' CPUSo this fixes the atmega1280 class to use an avr51 CPU.
Signed-off-by Frederic Konrad <[email protected]>---
hw/avr/atmega.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)hw/avr/atmega.c +1
-0@@ -402,7 +402,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;Quoted 6 lines
Quoted 2 lines
Good catch!
Thanks, does that count as a reviewed-by :)?
Yes! sorry.
Reviewed-by Joaquin de Andres <[email protected]>