Received: by 2002:a17:907:c68a:b0:84d:2074:29bb with SMTP id ue10csp240254ejc; Sat, 14 Jan 2023 09:02:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXtOlG9WlRHrI7G2yTpWVtY8xd5H2v6+OWjWBROKxDVwSTfZkBpGaEKYmFEwJc6mcd25+JCU X-Received: by 2002:a1f:e381:0:b0:3c5:9374:d6ec with SMTP id a123-20020a1fe381000000b003c59374d6ecmr38211597vkh.14.1673715740632; Sat, 14 Jan 2023 09:02:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673715740; cv=none; d=google.com; s=arc-20160816; b=ykKNtjzOy+wR2ugfZ8XvEUk/4XKEk+vvZaWNyj9CyMpLY2y7HHo7EzYP9fnH7LsOaS Dd//OZ0rj2AiqHCYN9kXgqhVODeQ9HxPLgYS+Uoi42Db7vGn+DDuJCFi+lEPbyyGlBBe wt2/Sy58Af7yu2soFZc2kGLeCAvGR/sKPjpFeEJ2XTM7grOmdwz6ad/F0io0JnyDbmZF iz8LaRqCHouur2lM0c7LtLmDRB3nmHgvo7i3mRMjI0WdyOkrGWCp1W5JAKrOU710djKP 6S/db341xKIkCDnHs2Ngez6JRMtw3NaNJJrfSoeh+41qWrb3xrlS1SklTTO4mazJTdDq 3p0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:feedback-id:dkim-signature:dkim-signature; bh=nm78oN9BBO1E0nwvftxvIO+6A3EDc/cOD893O1ZxQgk=; b=gUh+eQ0szRxEjMCKRqiqUA/6e1He6fMkK7Q8T6Wgpy5wRcZGbLG+3jMhQ7mcWE5JWC WBSwg7omf8g9U6DtRssvcwEwurhPpUE9sa6fYVAAzRdZZbrk34InioUJX7kaM7lnJYHM SmLdhmXrxb1+7MLe5wk/bZi+Dq8DvkqYpK+8bMydZN6NAACY0Uq/4aANWqtkl78EAoYn NZjHlUtDtyaaPPW42oLUb+Cnt4Y6AlKM7aJWQhUj1pYG9tj1+3Z4nuJxfaRlktL2b7RD HPLU6xahYAttvSQ/nJE1XMQbAMWVsduxbXzjlERPZojLDTfZ87hsrcfFf34PQ23e9gcU CqGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@pjd.dev header.s=fm1 header.b=wTBHU0Hb; dkim=fail header.i=@messagingengine.com header.s=fm3 header.b=DiquBDJ5; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 199-20020a1f19d0000000b003e0880f2c5fsi307958vkz.25.2023.01.14.09.02.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Jan 2023 09:02:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@pjd.dev header.s=fm1 header.b=wTBHU0Hb; dkim=fail header.i=@messagingengine.com header.s=fm3 header.b=DiquBDJ5; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGjv6-0005Y9-Va; Sat, 14 Jan 2023 12:02:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGjuw-0005Kp-MK; Sat, 14 Jan 2023 12:02:07 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGjuv-0005Ut-4G; Sat, 14 Jan 2023 12:02:06 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6064F5C00DF; Sat, 14 Jan 2023 12:02:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 14 Jan 2023 12:02:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pjd.dev; h=cc:cc :content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1673715724; x=1673802124; bh=nm 78oN9BBO1E0nwvftxvIO+6A3EDc/cOD893O1ZxQgk=; b=wTBHU0HbJ6YQFQm/9t 458KezZqouEmOpNZf/X94c3R+xPQkQBbqpc7uILPHGnXBHoYQQ9gfMXPCYz7AUj4 TdH4GKkrdmkPb9Z7iBEgyIdBIYPBjwmEmUtFECTZyKFJAjbK5urYO7iRVfl+/UdR PvgJoqN6JJor+0+V3PBv8vwKu4f62lUvJsBShNRkjr+UFN2dEeyYusTCaOZUdFB8 DQb6STNIjUy4I8DFcSFUXPFqbaTumxGxSGHpyeyEhzLriwIxfh72fO2bBQ51+Xki mib52bJQyYbLGSvORzOWV3lOX1jlGKotTTiKy97kdFS1SRVYgoOMaw9jhtDRtnyQ ssfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1673715724; x=1673802124; bh=nm78oN9BBO1E0 nwvftxvIO+6A3EDc/cOD893O1ZxQgk=; b=DiquBDJ5lySS9yG3bxwXHRNdHwsPk 7sIgOkkGRVxjew72S2ndmWsUzK4ricIoIvQvnskACTwvDRmWZ1ZWxaL1aPrQqRdM vzcyY2CLpDXznlO8YFNutj7v/P31fNSEjuGoKW0xfjQUigy16wD8pCnYtGxE+CIP WfmXXefo9hwh6GkAeSkXkHOsLmVP4gEsqqXvspfu5K0yS9CorWz+z90m1rUU/SIN NLUZ072RUyztC57Jr3R2+XdW06QGmUbBhVO01VSyb6AwzztxYCQ4oJUfvkqcHdsO 3euyabzerzhUC8P4EeU4N96r6U2RgpSLeg2ysdsw3TUoXjwcpQNILZmTQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddttddgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenuchmihhsshhinhhgucfvqfcufhhivghlugculdeftd dmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheprfgv thgvrhcuffgvlhgvvhhorhihrghsuceophgvthgvrhesphhjugdruggvvheqnecuggftrf grthhtvghrnhepteelgfeuleeffffffeekiefghfejuefgtdfgteeigeekvdefffevieek vdelteevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epphgvthgvrhesphhjugdruggvvh X-ME-Proxy: Feedback-ID: i9e814621:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 14 Jan 2023 12:02:01 -0500 (EST) From: Peter Delevoryas To: Cc: patrick@stwcx.xyz, peter@pjd.dev, clg@kaod.org, peter.maydell@linaro.org, andrew@aj.id.au, joal@jms.id.au, hskinnemoen@google.com, kfting@nuvoton.com, qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 4/6] hw/arm/npcm7xx: Remove local copy of at24c_eeprom_init Date: Sat, 14 Jan 2023 09:01:49 -0800 Message-Id: <20230114170151.87833-5-peter@pjd.dev> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230114170151.87833-1-peter@pjd.dev> References: <20230114170151.87833-1-peter@pjd.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=66.111.4.28; envelope-from=peter@pjd.dev; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: Og2WHzpRvczf Signed-off-by: Peter Delevoryas --- hw/arm/npcm7xx_boards.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index 6bc6f5d2fe29..9b31207a06e9 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -21,6 +21,7 @@ #include "hw/i2c/i2c_mux_pca954x.h" #include "hw/i2c/smbus_eeprom.h" #include "hw/loader.h" +#include "hw/nvram/eeprom_at24c.h" #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "qapi/error.h" @@ -140,17 +141,6 @@ static I2CBus *npcm7xx_i2c_get_bus(NPCM7xxState *soc, uint32_t num) return I2C_BUS(qdev_get_child_bus(DEVICE(&soc->smbus[num]), "i2c-bus")); } -static void at24c_eeprom_init(NPCM7xxState *soc, int bus, uint8_t addr, - uint32_t rsize) -{ - I2CBus *i2c_bus = npcm7xx_i2c_get_bus(soc, bus); - I2CSlave *i2c_dev = i2c_slave_new("at24c-eeprom", addr); - DeviceState *dev = DEVICE(i2c_dev); - - qdev_prop_set_uint32(dev, "rom-size", rsize); - i2c_slave_realize_and_unref(i2c_dev, i2c_bus, &error_abort); -} - static void npcm7xx_init_pwm_splitter(NPCM7xxMachine *machine, NPCM7xxState *soc, const int *fan_counts) { @@ -253,8 +243,8 @@ static void quanta_gsj_i2c_init(NPCM7xxState *soc) i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 3), "tmp105", 0x5c); i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 4), "tmp105", 0x5c); - at24c_eeprom_init(soc, 9, 0x55, 8192); - at24c_eeprom_init(soc, 10, 0x55, 8192); + at24c_eeprom_init(npcm7xx_i2c_get_bus(soc, 9), 0x55, 8192); + at24c_eeprom_init(npcm7xx_i2c_get_bus(soc, 10), 0x55, 8192); /* * i2c-11: @@ -360,7 +350,7 @@ static void kudo_bmc_i2c_init(NPCM7xxState *soc) i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 4), TYPE_PCA9548, 0x77); - at24c_eeprom_init(soc, 4, 0x50, 8192); /* mbfru */ + at24c_eeprom_init(npcm7xx_i2c_get_bus(soc, 4), 0x50, 8192); /* mbfru */ i2c_mux = i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 13), TYPE_PCA9548, 0x77); @@ -371,7 +361,7 @@ static void kudo_bmc_i2c_init(NPCM7xxState *soc) i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 4), "tmp105", 0x48); i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 5), "tmp105", 0x49); - at24c_eeprom_init(soc, 14, 0x55, 8192); /* bmcfru */ + at24c_eeprom_init(npcm7xx_i2c_get_bus(soc, 14), 0x55, 8192); /* bmcfru */ /* TODO: Add remaining i2c devices. */ } -- 2.39.0