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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 D01AAC433F5 for ; Thu, 23 Sep 2021 10:53: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 7B1C16023F for ; Thu, 23 Sep 2021 10:53:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7B1C16023F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:32910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTMLo-0001ro-Oc for qemu-devel@archiver.kernel.org; Thu, 23 Sep 2021 06:53:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTMKu-0000Jp-MC; Thu, 23 Sep 2021 06:52:16 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:42582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mTMKt-0006Yu-46; Thu, 23 Sep 2021 06:52:16 -0400 Received: by mail-wr1-x429.google.com with SMTP id q11so15870884wrr.9; Thu, 23 Sep 2021 03:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=GVORcyaLv3syAmBkfSaYTVn3/eMmXDx6hPlGBkz/PUA=; b=k6hnXZhMTzl/7xD42lAq5o2D87buaWxjziPww9tkZeMt0oEMiN4vS0u1Iak5j/3awL vdKkUPMuIoSK6b6VOieEsyhXgVvoiU9oimDwLqmleIvN0WHACflx6TKlShLWeLQIILQJ Xk+9cyW1QEBRsrzJ1JzK76cn6xfYmaV5Nerojlvv9AyB4YK+eqSjKu8KPzrhaiPAEuL3 ejm1ikyJc3BtsqSfTnoMN0zhKYHnfR7eFsnSlnbBZP/Qi5cwcpBidHaXFcgISoj9ue+Q bzMT36C/Ro6VpsREDDv6ixUN2UStEq0fho7nzA58y48ohxwys+/N+z9whgQIYvf4XRkV KEYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=GVORcyaLv3syAmBkfSaYTVn3/eMmXDx6hPlGBkz/PUA=; b=rF9q5JpzeQ4q7vwPnW6yUyHFWsjUltJEFECzs0FBrYOcfrlHsfDm2gquyZ8d+zm/am dDlQj0ZTxfHtrdKWkaUV0rL9Lu1EOf+ZZhCDol0dhtfoBq/61qk/70R5z6kYMFu7AnCy hHBPVkYHe4NnnZ1D7EYtnFJiF+273HIhi7HAMC9AhKPtIoytWB6BNXVT2MurQKCvLTYu pjpTOBm6Y9z8FRyR2+nlmT6Nzqp843ZM6Y72ToD51k+HmIwR3dzbG85ayHMP4cm8OkDX hKQnaGu8VJuOx0QHDLLg7p01bUC1nJ0YmkE/47fKNI7OIWqRYWfAn7qz3HHag3HhBa5u L1VA== X-Gm-Message-State: AOAM531olilnxRhiqNL+DLqgvtkL4WkXDf+WgX7caPbMgfD2rfZ43MLF OqJF7rejGDv9MQgNPPDKbXo= X-Google-Smtp-Source: ABdhPJxUh4VDiUZHpBpKGT4SSa3Zt3TfUoBC6czaAzERKOVrXV9ACfCcRcQphCxkvr/zpyTn8CzUsA== X-Received: by 2002:adf:fd03:: with SMTP id e3mr4342990wrr.46.1632394332909; Thu, 23 Sep 2021 03:52:12 -0700 (PDT) Received: from [192.168.1.36] (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id 20sm9666228wme.46.2021.09.23.03.52.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Sep 2021 03:52:12 -0700 (PDT) Message-ID: <58a51968-39b9-1477-5c18-db9638fa66e3@amsat.org> Date: Thu, 23 Sep 2021 12:52:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH] hw/char/mchp_pfsoc_mmuart: QOM'ify PolarFire MMUART Content-Language: en-US To: Peter Maydell References: <20210918180738.2506799-1-f4bug@amsat.org> <0cfcd1c1-8bff-f0dc-02ac-ac12ac392fc8@amsat.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: "open list:RISC-V" , Bin Meng , Markus Armbruster , Alistair Francis , "qemu-devel@nongnu.org Developers" , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Paolo Bonzini , Bin Meng Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 9/23/21 12:41, Peter Maydell wrote: > On Thu, 23 Sept 2021 at 11:29, Philippe Mathieu-Daudé wrote: >> On 9/23/21 07:16, Bin Meng wrote:> On Sun, Sep 19, 2021 at 2:07 AM >> Philippe Mathieu-Daudé wrote: >>>> +static void mchp_pfsoc_mmuart_realize(DeviceState *dev, Error **errp) >>>> +{ >>>> + MchpPfSoCMMUartState *s = MCHP_PFSOC_UART(dev); >>>> + >>>> + qdev_prop_set_uint8(DEVICE(&s->serial_mm), "regshift", 2); >>>> + qdev_prop_set_uint32(DEVICE(&s->serial_mm), "baudbase", 399193); >>>> + qdev_prop_set_uint8(DEVICE(&s->serial_mm), "endianness", >>>> + DEVICE_LITTLE_ENDIAN); >>> >>> It looks like serial_mm_init() does one more thing: >>> >>> qdev_set_legacy_instance_id(DEVICE(smm), base, 2); >>> >>> I am not sure what that is. >> >> I'll defer on Paolo / Marc-André for that part, I think this is for >> migrating legacy (x86?) machines, which is not the case. > > Yes, this is only needed for backwards-compatibility of incoming > migration data with old versions of QEMU which implemented migration > of devices with hand-rolled code. If a device didn't previously > handle migration at all then it should not now be setting the > legacy instance ID. Thanks. I'll try to add that in the documentation somewhere. > Speaking of migration, I notice that this QOM conversion does > not add a vmstate, which usually we do as part of the QOM conversion. > The device is also missing a reset method. OK, I'll add that in a previous patch. Thanks, Phil. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mTMKw-0000NV-R5 for mharc-qemu-riscv@gnu.org; Thu, 23 Sep 2021 06:52:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTMKu-0000Jp-MC; Thu, 23 Sep 2021 06:52:16 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:42582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mTMKt-0006Yu-46; Thu, 23 Sep 2021 06:52:16 -0400 Received: by mail-wr1-x429.google.com with SMTP id q11so15870884wrr.9; Thu, 23 Sep 2021 03:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=GVORcyaLv3syAmBkfSaYTVn3/eMmXDx6hPlGBkz/PUA=; b=k6hnXZhMTzl/7xD42lAq5o2D87buaWxjziPww9tkZeMt0oEMiN4vS0u1Iak5j/3awL vdKkUPMuIoSK6b6VOieEsyhXgVvoiU9oimDwLqmleIvN0WHACflx6TKlShLWeLQIILQJ Xk+9cyW1QEBRsrzJ1JzK76cn6xfYmaV5Nerojlvv9AyB4YK+eqSjKu8KPzrhaiPAEuL3 ejm1ikyJc3BtsqSfTnoMN0zhKYHnfR7eFsnSlnbBZP/Qi5cwcpBidHaXFcgISoj9ue+Q bzMT36C/Ro6VpsREDDv6ixUN2UStEq0fho7nzA58y48ohxwys+/N+z9whgQIYvf4XRkV KEYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=GVORcyaLv3syAmBkfSaYTVn3/eMmXDx6hPlGBkz/PUA=; b=rF9q5JpzeQ4q7vwPnW6yUyHFWsjUltJEFECzs0FBrYOcfrlHsfDm2gquyZ8d+zm/am dDlQj0ZTxfHtrdKWkaUV0rL9Lu1EOf+ZZhCDol0dhtfoBq/61qk/70R5z6kYMFu7AnCy hHBPVkYHe4NnnZ1D7EYtnFJiF+273HIhi7HAMC9AhKPtIoytWB6BNXVT2MurQKCvLTYu pjpTOBm6Y9z8FRyR2+nlmT6Nzqp843ZM6Y72ToD51k+HmIwR3dzbG85ayHMP4cm8OkDX hKQnaGu8VJuOx0QHDLLg7p01bUC1nJ0YmkE/47fKNI7OIWqRYWfAn7qz3HHag3HhBa5u L1VA== X-Gm-Message-State: AOAM531olilnxRhiqNL+DLqgvtkL4WkXDf+WgX7caPbMgfD2rfZ43MLF OqJF7rejGDv9MQgNPPDKbXo= X-Google-Smtp-Source: ABdhPJxUh4VDiUZHpBpKGT4SSa3Zt3TfUoBC6czaAzERKOVrXV9ACfCcRcQphCxkvr/zpyTn8CzUsA== X-Received: by 2002:adf:fd03:: with SMTP id e3mr4342990wrr.46.1632394332909; Thu, 23 Sep 2021 03:52:12 -0700 (PDT) Received: from [192.168.1.36] (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id 20sm9666228wme.46.2021.09.23.03.52.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Sep 2021 03:52:12 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Message-ID: <58a51968-39b9-1477-5c18-db9638fa66e3@amsat.org> Date: Thu, 23 Sep 2021 12:52:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH] hw/char/mchp_pfsoc_mmuart: QOM'ify PolarFire MMUART Content-Language: en-US To: Peter Maydell Cc: "open list:RISC-V" , Bin Meng , Markus Armbruster , "qemu-devel@nongnu.org Developers" , Paolo Bonzini , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Alistair Francis , Bin Meng References: <20210918180738.2506799-1-f4bug@amsat.org> <0cfcd1c1-8bff-f0dc-02ac-ac12ac392fc8@amsat.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2021 10:52:16 -0000 On 9/23/21 12:41, Peter Maydell wrote: > On Thu, 23 Sept 2021 at 11:29, Philippe Mathieu-Daudé wrote: >> On 9/23/21 07:16, Bin Meng wrote:> On Sun, Sep 19, 2021 at 2:07 AM >> Philippe Mathieu-Daudé wrote: >>>> +static void mchp_pfsoc_mmuart_realize(DeviceState *dev, Error **errp) >>>> +{ >>>> + MchpPfSoCMMUartState *s = MCHP_PFSOC_UART(dev); >>>> + >>>> + qdev_prop_set_uint8(DEVICE(&s->serial_mm), "regshift", 2); >>>> + qdev_prop_set_uint32(DEVICE(&s->serial_mm), "baudbase", 399193); >>>> + qdev_prop_set_uint8(DEVICE(&s->serial_mm), "endianness", >>>> + DEVICE_LITTLE_ENDIAN); >>> >>> It looks like serial_mm_init() does one more thing: >>> >>> qdev_set_legacy_instance_id(DEVICE(smm), base, 2); >>> >>> I am not sure what that is. >> >> I'll defer on Paolo / Marc-André for that part, I think this is for >> migrating legacy (x86?) machines, which is not the case. > > Yes, this is only needed for backwards-compatibility of incoming > migration data with old versions of QEMU which implemented migration > of devices with hand-rolled code. If a device didn't previously > handle migration at all then it should not now be setting the > legacy instance ID. Thanks. I'll try to add that in the documentation somewhere. > Speaking of migration, I notice that this QOM conversion does > not add a vmstate, which usually we do as part of the QOM conversion. > The device is also missing a reset method. OK, I'll add that in a previous patch. Thanks, Phil.