From nobody Mon Feb 9 18:44:24 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 ARC-Seal: i=1; a=rsa-sha256; t=1590490091; cv=none; d=zohomail.com; s=zohoarc; b=BSGjrVIYICJk6RkYwvS9DW0gvWQBYhRwy+5G+VhJDAZs22pPV2Mp0lGfBJz9p308wSleAaRSbTC86/sByIDzQa6d8kq+Z6Ti9pAfxTMDo5901I3lk9ry5fvbwXekyef2DMdVEV2O2BTVg7KNFbDIyjBfOiZsddfkeXg/9eoBp6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590490091; 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=Umd1IsTIi7Qx5rxKBRSMhUVbMEWcjmkZXz7krbuGZAcsOgc8CL0xZ99/4+NDdbpNK/8Uv7ODQvCQq5B81jWE8wagsT+tHV9c3AtvBn7OGqZbxo8RHyk/MC1wXRWKWFVRDkZVgFErMQwnCMajqgW6YlhGHsn82MjxriHGGQiMt6A= 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 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 1590490091883349.24273853797945; Tue, 26 May 2020 03:48:11 -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-342-Yra9nkIdMkWpfwi9x-DLVQ-1; Tue, 26 May 2020 06:48:08 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B3E0F100CC90; Tue, 26 May 2020 10:48:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 951168ECE0; Tue, 26 May 2020 10:48:02 +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 62FB01809543; Tue, 26 May 2020 10:48:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04QAloSc029906 for ; Tue, 26 May 2020 06:47:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0BC8D2156A3A; Tue, 26 May 2020 10:47:50 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0756B2166BA4 for ; Tue, 26 May 2020 10:47:47 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 457938007DF for ; Tue, 26 May 2020 10:47:46 +0000 (UTC) Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-473-P5HB6veIO9SykWvRrrItYw-1; Tue, 26 May 2020 06:47:41 -0400 Received: by mail-ed1-f66.google.com with SMTP id c35so924044edf.5; Tue, 26 May 2020 03:47:40 -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 c27sm3342597ejd.19.2020.05.26.03.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 03:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590490090; 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=fVMOImlg9vSCdmmDI/2XTRli7NCOW8KbZPbPzOeMxBHVsiXUKV9ELt9O0rsUM07/0hzN44 X8ncZtxXNA5rZCR/Dz+Pj/eYD17iBP7rwZi/M0P6vEvUGBnQ5wM6au9kgj6PwNl4SVviDE ouZ4V+fCsGUkHBhyegpmpip/VvYddcA= X-MC-Unique: Yra9nkIdMkWpfwi9x-DLVQ-1 X-MC-Unique: P5HB6veIO9SykWvRrrItYw-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=iozB8UegZ5oLYPFuoRtLZkxur8Kc3je7X5K2E5bMFd3No/f0ZtrJkuIiWHtpuOdi5r bIym6eHqLTo1OncWlelFr8TPPrCht5X7W8SpQNZ7Uv5zNBJ1FxGPqpAlsZVxDeDO42Bs jdKrNZxH87B7AlpPRn2AouGmmCtVu2KsWS0eAiJEca8hZShUeMbFNpN0SYHE4YFdsT3V jct32joemOdFJXVye6nugFdr+dNyCxmhCyYhFutFNYPKzR0/oPhDmjv+tBCMCRC13HH+ 8fQdEFrWla/3VtH0tBMO2yP6AsA8JZsqJ8lOZICMbKprRfTxqZHk5AXsxHMtNf0nhxmB LzVg== X-Gm-Message-State: AOAM533xAGBTHmdsGZMuCpHDCi20hcItVujlax5UL7zQ/2GANaQAzH0b T0bS2494gEMCnCmGUCMMvGw= X-Google-Smtp-Source: ABdhPJx7A+aavnv8UeQ4jpnozPyWIgFVnM/s5spYdycN2n/BTeZlrr2nQOg/S3Ha68qtTyHrtE932w== X-Received: by 2002:a50:bb07:: with SMTP id y7mr18652600ede.176.1590490059616; Tue, 26 May 2020 03:47:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 08/14] hw/pci-host/bonito: Set the Config register reset value with FIELD_DP32 Date: Tue, 26 May 2020 12:47:20 +0200 Message-Id: <20200526104726.11273-9-f4bug@amsat.org> In-Reply-To: <20200526104726.11273-1-f4bug@amsat.org> References: <20200526104726.11273-1-f4bug@amsat.org> MIME-Version: 1.0 X-Mimecast-Spam-Signature: yes X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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.13 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