From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AF15C433B4 for ; Wed, 5 May 2021 14:04:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7818F613BC for ; Wed, 5 May 2021 14:04:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7818F613BC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xcancerberox.com.ar Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leI8C-00063p-TV for qemu-devel@archiver.kernel.org; Wed, 05 May 2021 10:04:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leI59-0004dL-6c for qemu-devel@nongnu.org; Wed, 05 May 2021 10:00:55 -0400 Received: from cloud.estebanecheverria.gob.ar ([67.227.157.153]:43728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leI56-0006SE-4e for qemu-devel@nongnu.org; Wed, 05 May 2021 10:00:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xcancerberox.com.ar; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ysCNK3+ZLH3k1cR3l3gFBXynWsjChYnnstbz/Gwv2Q0=; b=TQyR/P5KDb1AkjMDd6dKM8bSzq gL8EG4IkLvfHBSpsw8Lu+IrZyGwc0a2OOUccrPnZBmWCLO3l8D+RuvNROreuNlUnXLoZbLjehLcQT FuwDogV+fPsUxKyizQ7rSouF7//vqSVfPfvB1+DLz8dJn22TMsCW0TZsnLT5/Ii70JEyfdtg1MmBf 7ipfTF1FOCBbJg3jfOciIACMfCfbnA8/V6alH9SIszePhYzgE1xO+CoeKTRxvZlfHPdIYprygwyTn 0S4KQZXniOJY+3INoka5PEBhDR9a+EtN5zR3ne8WPASNlmloq45er2XAR6/vKQNw1T0knhV8ySTe0 38vUnvaA==; Received: from 120.net-94.228.4.isbl.embou.net ([94.228.4.120]:44320 helo=[192.168.2.151]) by cloud.estebanecheverria.gob.ar with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1leI4O-0008Bz-RC; Wed, 05 May 2021 11:00:07 -0300 Subject: Re: [PATCH] hw/avr/atmega.c: use the avr51 cpu for atmega1280 To: Fred Konrad , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , qemu-devel@nongnu.org References: <1619637319-22299-1-git-send-email-frederic.konrad@adacore.com> <7970a6ec-f5ac-bcc9-9184-d8450b64b116@amsat.org> <27cc1bc5-ee71-abf6-fd8f-58ec44e1767f@xcancerberox.com.ar> From: Joaquin de Andres Message-ID: Date: Wed, 5 May 2021 16:00:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud.estebanecheverria.gob.ar X-AntiAbuse: Original Domain - nongnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - xcancerberox.com.ar X-Get-Message-Sender-Via: cloud.estebanecheverria.gob.ar: authenticated_id: me@xcancerberox.com.ar X-Authenticated-Sender: cloud.estebanecheverria.gob.ar: me@xcancerberox.com.ar X-Source: X-Source-Args: X-Source-Dir: Received-SPF: pass client-ip=67.227.157.153; envelope-from=me@xcancerberox.com.ar; helo=cloud.estebanecheverria.gob.ar X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Rolnik Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 5/5/21 3:33 PM, Fred Konrad wrote: > > > Le 4/30/21 à 12:27 PM, Joaquin de Andres a écrit : >> On 4/28/21 9:17 PM, Philippe Mathieu-Daudé wrote: >>> Cc'ing Joaquín. >>> >>> On 4/28/21 9:15 PM, Frederic Konrad wrote: >>>> 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 >>>> --- >>>>   hw/avr/atmega.c | 2 +- >>>>   1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/hw/avr/atmega.c b/hw/avr/atmega.c >>>> index 44c6afebbb..e3ea5702f5 100644 >>>> --- a/hw/avr/atmega.c >>>> +++ b/hw/avr/atmega.c >>>> @@ -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; >>>> >>> >> Good catch! >> > > Thanks, does that count as a reviewed-by :)? > > Yes! sorry. Reviewed-by: Joaquin de Andres