From nobody Tue Nov 18 10:38:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) client-ip=209.85.221.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1609455024; cv=none; d=zohomail.com; s=zohoarc; b=lz2nWSCA2mdv1KQENO+ACTYspQl4jEGBQJ2JCRKzGrsIjnPvGnXd2CLKSuS9lryBn/EQ7UKM/Ucp+o7KBNoB08K48QnoalpmnA3zFX3HwPT4Bs8oZUETNB8h1Od5bDh3Ndu1MnZiQSGlW/B5l/n8INxp+XJ4t2TuS6+8KCJbOKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609455024; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qScEGFj7AcZq0QlXolKGt5D9IhypmF9z1VDvyAbEW+g=; b=TuZSTP8+CmdNmwdj+1bQMr67LCh6lL3tvFRJ7I2dWUJahFlBf2HKT4qUyC37PgORpgSOKQcKYxzGLYrryZJcLlew0w6kcGgUSBOww/Bgb7uz0DISYH2vBdkWhxjb8tkSr2ztECKZ/wMtubVdRS6TqTsPtED5fL33TyOnc+IeB44= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.zohomail.com with SMTPS id 1609455024192366.90628890180164; Thu, 31 Dec 2020 14:50:24 -0800 (PST) Received: by mail-wr1-f47.google.com with SMTP id q18so21083388wrn.1 for ; Thu, 31 Dec 2020 14:50:23 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (239.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.239]) by smtp.gmail.com with ESMTPSA id j9sm71603552wrm.14.2020.12.31.14.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Dec 2020 14:50:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qScEGFj7AcZq0QlXolKGt5D9IhypmF9z1VDvyAbEW+g=; b=V3SX3xbHRjtZmp+wuexeWM6t8GEg7BN1cgLLee4UfkJAUzxWZsdQ89owwPe/Sw3Yve aBFouVKcgma4qv2zOl8KrRa3Yo3X+eLRXTyfgXRTjflFhQIVx0EPPTH46XyhC8AiZBb+ lMKTzaG32MFgqBG3gSEHn6YVv5Ome7drdUTl158iu9Yf60SuXoS4awD2h8dxtB07nplG BOPIt/JTKW+aY4ZiqS6kwD3NCUj9xuR47PVAFTc/n3GqTpDgu50cASJbh+mqKZOt23ly NGbhGaMUku4nHjHGh5iiqksPUnuk4tUjGNdrUsfHt3NNZDp4PxMTLTInjUnr1Q6bg2QF Ajrw== 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=qScEGFj7AcZq0QlXolKGt5D9IhypmF9z1VDvyAbEW+g=; b=hWEHeILFTmmunMQXCuX6qHjEawBwUU4bDHsJ1ebmZh8dtt0fZMezn/DrbupAsT1KDf Ei59eOWdqnbKoxLIBFYqt9rgxluz5foQj4Z2L6J+N+MeUItau39bu3/w82NEflFgShM0 aVWqNG1R0B556Uuah6X7F80L2v0lqkY6qlN1d0Lfu8Z3M5HdtWo1cdRlRvqKwIdsNYkd z1boznCJYCcyid3xluOpj96kXWgxGvJGOj9FI0U90/ze6PAE1ZqdVLcvH6X4rLDL3Ed7 R5b3NiafJPEv8DKi413O6hgMlIArf8A2pFe763wrGMzSM9bEWLvcs/DoK6AxcJxYHXsW hKLw== X-Gm-Message-State: AOAM531WutMJxNP+fO+nY7SMZX1APMw7LZTg9r341Cs9b0SPn4Dxcwq0 BsKyPHUkQ/ZDkv6Wo7M3v6M= X-Google-Smtp-Source: ABdhPJxDM5KTXzzp4L6BHkGKP3OCWU1ZMHQlBm4/8rDR04Yq5Fn9BNOXpW0EHzYnfdX82zk74r4PXA== X-Received: by 2002:a5d:5401:: with SMTP id g1mr65489938wrv.93.1609455022445; Thu, 31 Dec 2020 14:50:22 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Aurelien Jarno , Huacai Chen Subject: [RFC PATCH 14/18] hw/pci-host/bonito: Simplify using pci_host_conf_le_ops MemoryRegionOps Date: Thu, 31 Dec 2020 23:49:07 +0100 Message-Id: <20201231224911.1467352-15-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201231224911.1467352-1-f4bug@amsat.org> References: <20201231224911.1467352-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci-host/bonito.c | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 4dcaa2fa8bb..c09d54cca82 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -362,39 +362,6 @@ static const MemoryRegionOps bonito_northbridge_ops = =3D { }, }; =20 -static void bonito_pciconf_writel(void *opaque, hwaddr addr, - uint64_t val, unsigned size) -{ - BonitoPciState *s =3D opaque; - PCIDevice *d =3D PCI_DEVICE(s); - - DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %lx\n", addr, val); - d->config_write(d, addr, val, 4); -} - -static uint64_t bonito_pciconf_readl(void *opaque, hwaddr addr, - unsigned size) -{ - - BonitoPciState *s =3D opaque; - PCIDevice *d =3D PCI_DEVICE(s); - - DPRINTF("bonito_pciconf_readl "TARGET_FMT_plx"\n", addr); - return d->config_read(d, addr, 4); -} - -/* north bridge PCI configure space. 0x1fe0 0000 - 0x1fe0 00ff */ - -static const MemoryRegionOps bonito_pciconf_ops =3D { - .read =3D bonito_pciconf_readl, - .write =3D bonito_pciconf_writel, - .endianness =3D DEVICE_LITTLE_ENDIAN, - .valid =3D { - .min_access_size =3D 4, - .max_access_size =3D 4, - }, -}; - static uint64_t bonito_ldma_readl(void *opaque, hwaddr addr, unsigned size) { @@ -694,7 +661,7 @@ static void bonito_pci_realize(PCIDevice *dev, Error **= errp) sysbus_mmio_map(sysbus, 0, BONITO_INTERNAL_REG_BASE); =20 /* set the north bridge pci configure mapping */ - memory_region_init_io(&phb->conf_mem, OBJECT(s), &bonito_pciconf_ops, = s, + memory_region_init_io(&phb->conf_mem, OBJECT(s), &pci_host_conf_le_ops= , s, "north-bridge-pci-config", BONITO_PCICONFIG_SIZE= ); sysbus_init_mmio(sysbus, &phb->conf_mem); sysbus_mmio_map(sysbus, 1, BONITO_PCICONFIG_BASE); --=20 2.26.2