From nobody Mon Feb 9 22:39:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1590500010; cv=none; d=zohomail.com; s=zohoarc; b=SzY0C/mLYdS4Eqdd/ay658INtXo5ZxP6f9t/lsK7bEMDf4vX1NdxCmiaJWjl83D0ObFAYvwLJLDylbiePRFoQ5JPuhjoKELVGDNHLXb3o3hMFXbMyyFLQSkbzoFHVxj2Dcodx5v6kgc5539OH43QzjKc7myAy8qIFTN0uoLWrkA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590500010; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mBHAYQ31sriu1PFVXi6ty+G9pR4qR9G0hm00u+LnXSk=; b=fnimjULxviFhEPcgRO5IMIN6WWxIRsICB8GaIWs7QnIb9y4a8z+FdetvfFUJQIGSCvlB1Z6Zl/hq6rizNRwpN5ycOK+5+5y2POmaQ6fRiSURpT5fXtRBjCokU0e8XB5RjdxyApXjjHJzp/hAXD0bDUjU+XqhmmB0/XkU2msH420= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1590500010238838.4012404422739; Tue, 26 May 2020 06:33:30 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-384-Eari3kobPhGZ3jaRVeBLvw-1; Tue, 26 May 2020 09:33:26 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2FF191855A20; Tue, 26 May 2020 13:33:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CC7F610B0; Tue, 26 May 2020 13:33:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D04876B499; Tue, 26 May 2020 13:33:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04QDXB9J012462 for ; Tue, 26 May 2020 09:33:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 595435AB8D; Tue, 26 May 2020 13:33:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 435CF5AB88 for ; Tue, 26 May 2020 13:33:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1BECF862F84 for ; Tue, 26 May 2020 13:33:11 +0000 (UTC) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-499-8Xg5VK1CML2QLWrmarx6Eg-1; Tue, 26 May 2020 09:33:04 -0400 Received: by mail-ej1-f48.google.com with SMTP id n24so23831525ejd.0; Tue, 26 May 2020 06:33:03 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id n25sm1623084edo.56.2020.05.26.06.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 06:33:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590500008; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=mBHAYQ31sriu1PFVXi6ty+G9pR4qR9G0hm00u+LnXSk=; b=ewmUMd5QIprAyxYmLVaZjUl09KtQ5y7Yvr94LI4Rrl/dyT1eNSnRBNxM3Iwl13GFDr+4zz ecA4DHmOeTvD4vSXNp6b1Qbk4ZMJUrP1DXNpc8FkDls7mJY1whmABMOhbxspMhhvQIoa/O 3xCK4SlY7qIstC0Y4qkztWQ6mraxQro= X-MC-Unique: Eari3kobPhGZ3jaRVeBLvw-1 X-MC-Unique: 8Xg5VK1CML2QLWrmarx6Eg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=mBHAYQ31sriu1PFVXi6ty+G9pR4qR9G0hm00u+LnXSk=; b=Pk1pt1b3FswG0Qbv/eg5Ccu7dnDnxropqzJ1uXo392kazvmzxULG7Yi+pw5ia2Ttn6 lRasSSoMlEMyr/uEHjaCDTgs7gy4E/+MYCp8pwk1QxPETZXhI2i7hjk50ntk2B7xSztA JGnmPjTXCXqxI94K0SAzZd85125lcInbhVCh3G7srpjuh75LyBzM7T2iyA+M8UB+nTdH +1dWjK2JFnKCCxVebUyLQnx8DhEGeKpALxBjJK7gfq84wrswpZql/RhJdCdxk9xVhrIt DCC8kwmZbXI1Fxj4sYaJPKX8i1Kxd5A1ZdkE5EMGEy6ZpyeZUsMLjnL+votGnwHPfA7d jcCQ== X-Gm-Message-State: AOAM533T0qbDueHGMv52wzR3zeYGd04SSjBMljUKM49akHBibxUnmWwj uQnyEad1fpni4qPfS8SY5Fg= X-Google-Smtp-Source: ABdhPJybldAC6vnDY3YrrHQfs46A6e72b/KGxAMMaVxfoZiliFeAqmoOvL16jHYuofFSbupHFeaBng== X-Received: by 2002:a17:906:379a:: with SMTP id n26mr1100313ejc.513.1590499981758; Tue, 26 May 2020 06:33:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 08/14] hw/pci-host/bonito: Set the Config register reset value with FIELD_DP32 Date: Tue, 26 May 2020 15:32:41 +0200 Message-Id: <20200526133247.13066-9-f4bug@amsat.org> In-Reply-To: <20200526133247.13066-1-f4bug@amsat.org> References: <20200526133247.13066-1-f4bug@amsat.org> MIME-Version: 1.0 X-Mimecast-Spam-Signature: yes X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Laurent Vivier , Aleksandar Rikalo , libvir-list@redhat.com, Thomas Huth , Jiaxun Yang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Huacai Chen , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Describe some bits of the Config registers fields with the registerfields API. Use the FIELD_DP32() macro to set the BONGENCFG register bits at reset. Reviewed-by: Aleksandar Markovic Message-id: <20200510210128.18343-12-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci-host/bonito.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 20f2797a73..d0201ce59e 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -50,6 +50,7 @@ #include "sysemu/runstate.h" #include "exec/address-spaces.h" #include "hw/misc/unimp.h" +#include "hw/registerfields.h" =20 /* #define DEBUG_BONITO */ =20 @@ -112,8 +113,19 @@ /* Power on register */ =20 #define BONITO_BONPONCFG (0x00 >> 2) /* 0x100 */ + +/* PCI configuration register */ #define BONITO_BONGENCFG_OFFSET 0x4 #define BONITO_BONGENCFG (BONITO_BONGENCFG_OFFSET >> 2) /*0x104 */ +REG32(BONGENCFG, 0x104) +FIELD(BONGENCFG, DEBUGMODE, 0, 1) +FIELD(BONGENCFG, SNOOP, 1, 1) +FIELD(BONGENCFG, CPUSELFRESET, 2, 1) +FIELD(BONGENCFG, BYTESWAP, 6, 1) +FIELD(BONGENCFG, UNCACHED, 7, 1) +FIELD(BONGENCFG, PREFETCH, 8, 1) +FIELD(BONGENCFG, WRITEBEHIND, 9, 1) +FIELD(BONGENCFG, PCIQUEUE, 12, 1) =20 /* 2. IO & IDE configuration */ #define BONITO_IODEVCFG (0x08 >> 2) /* 0x108 */ @@ -577,11 +589,18 @@ static int pci_bonito_map_irq(PCIDevice *pci_dev, int= irq_num) static void bonito_reset(void *opaque) { PCIBonitoState *s =3D opaque; + uint32_t val =3D 0; =20 /* set the default value of north bridge registers */ =20 s->regs[BONITO_BONPONCFG] =3D 0xc40; - s->regs[BONITO_BONGENCFG] =3D 0x1384; + val =3D FIELD_DP32(val, BONGENCFG, PCIQUEUE, 1); + val =3D FIELD_DP32(val, BONGENCFG, WRITEBEHIND, 1); + val =3D FIELD_DP32(val, BONGENCFG, PREFETCH, 1); + val =3D FIELD_DP32(val, BONGENCFG, UNCACHED, 1); + val =3D FIELD_DP32(val, BONGENCFG, CPUSELFRESET, 1); + s->regs[BONITO_BONGENCFG] =3D val; + s->regs[BONITO_IODEVCFG] =3D 0x2bff8010; s->regs[BONITO_SDCFG] =3D 0x255e0091; =20 --=20 2.21.3