From patchwork Tue May 18 19:41:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Leis X-Patchwork-Id: 12265547 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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham 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 2AC47C433ED for ; Tue, 18 May 2021 19:44:43 +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 D7BCD610A2 for ; Tue, 18 May 2021 19:44:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7BCD610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj5dy-0002nz-2e for qemu-devel@archiver.kernel.org; Tue, 18 May 2021 15:44:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3bBikYAcKCjkqZiopmZbjjbgZ.XjhlZhp-YZqZgijibip.jmb@flex--venture.bounces.google.com>) id 1lj5ax-0005p1-Th for qemu-devel@nongnu.org; Tue, 18 May 2021 15:41:35 -0400 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]:34753) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3bBikYAcKCjkqZiopmZbjjbgZ.XjhlZhp-YZqZgijibip.jmb@flex--venture.bounces.google.com>) id 1lj5aw-0003aO-6o for qemu-devel@nongnu.org; Tue, 18 May 2021 15:41:35 -0400 Received: by mail-yb1-xb49.google.com with SMTP id b66-20020a25cb450000b02905076ea039f1so13976397ybg.1 for ; Tue, 18 May 2021 12:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=dOyxWuIBx/Xq8N62SLAFrwjy4K72LHjzmIiChhjukB4=; b=MemlwoHfXUz/49Tlljb/Zxkafax0rtWVgl8vgSuHj7jRp+QET/GHWHAuXKaL94U0IH WdbI8/uFqe4j5mDcHFu9Eq4NzmknuF5Vfg7bfQVAd7qgledlo21q+c/DZCHe+Bb7IJw6 KhP/q5WJkdZFkpD/HeZXVpOrt7O/25B/VzA2N5yQCVxBW7a+COFuilaB/8QWsyxZQjbI WvCAIGaoT4dNPUYMkZvFN7SDntfOodxzEM6eIKLpK+ZyXvEbuvWNuSaqdE991KBJ/Zjw RWlBmHjZD94BYcO+4JrVfGYJ68lFmeARbiOWf39lx4yiyvdhVDU4OEFEmEFwq8IDNgLA EAqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=dOyxWuIBx/Xq8N62SLAFrwjy4K72LHjzmIiChhjukB4=; b=ZhFkbtsorjwTFjUbMhyechYPrxRK1G94vb0XPGju3zhDeWD+peMGh8awT2u30wd7Le qlV1C7+g29ObbRm9q2BU5zpP/199AH8wUdDWtHxdeH8K0uLfxuFlPYKomAueBWsXf3Tw mg2ZKepefzUWv2wZZbm41A08orT2VmHEdiUOqiTk1dIKhX3IX8pfWcSpS3ExNEV4UErb M3Or7K5qm5BltSUt8gj/VRMeHldtZgphiM+8qR/r5M6CB/5k5+iGxiqb8yYoZSHqWJsI 8mkaQTqtpebZqlel1LlOKEWpv1KTZo60QejU9cvxqsGTbYx7elHYwUz06+S6D2st9IwR LbAg== X-Gm-Message-State: AOAM5300KqWe2fFY0KqC894J1YwUAggKUyJbQXmATpk+f1r5FMlWuIlh gt+UI60p+cHY2LqQyhmJ+jXSGVszZUPW X-Google-Smtp-Source: ABdhPJzhCZ4QPipc/b7lcWrlKS2CY+iDjllRo5wFAn3ZclXA1dR1tnO6awBay7725BMJzn1Ljmrplgg9pUch X-Received: from venture.svl.corp.google.com ([2620:15c:2a3:200:5902:8a04:d917:4e93]) (user=venture job=sendgmr) by 2002:a25:883:: with SMTP id 125mr5487570ybi.523.1621366892306; Tue, 18 May 2021 12:41:32 -0700 (PDT) Date: Tue, 18 May 2021 12:41:15 -0700 In-Reply-To: <20210518194118.755410-1-venture@google.com> Message-Id: <20210518194118.755410-2-venture@google.com> Mime-Version: 1.0 References: <20210518194118.755410-1-venture@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH 1/4] hw/arm: gsj add i2c comments From: Patrick Venture To: hskinnemoen@google.com, kfting@nuvoton.com, clg@kaod.org, peter.maydell@linaro.org, andrew@aj.id.au, joel@jms.id.au Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Patrick Venture , Hao Wu Received-SPF: pass client-ip=2607:f8b0:4864:20::b49; envelope-from=3bBikYAcKCjkqZiopmZbjjbgZ.XjhlZhp-YZqZgijibip.jmb@flex--venture.bounces.google.com; helo=mail-yb1-xb49.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Adds comments to the board init to identify missing i2c devices. Signed-off-by: Patrick Venture Reviewed-by: Hao Wu Reviewed-by: Joel Stanley --- hw/arm/npcm7xx_boards.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index d4553e3786..9b7a7cd201 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -220,7 +220,21 @@ static void quanta_gsj_i2c_init(NPCM7xxState *soc) at24c_eeprom_init(soc, 9, 0x55, 8192); at24c_eeprom_init(soc, 10, 0x55, 8192); - /* TODO: Add additional i2c devices. */ + /* + * i2c-11: + * - power-brick@36: delta,dps800 + * - hotswap@15: ti,lm5066i + */ + + /* + * i2c-12: + * - ucd90160@6b + */ + + /* + * i2c-15: + * - pca9548@75 + */ } static void quanta_gsj_fan_init(NPCM7xxMachine *machine, NPCM7xxState *soc) From patchwork Tue May 18 19:41:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Leis X-Patchwork-Id: 12265553 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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham 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 AA1D5C433ED for ; Tue, 18 May 2021 19:47:39 +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 25861611BF for ; Tue, 18 May 2021 19:47:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 25861611BF Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj5gn-00079p-UO for qemu-devel@archiver.kernel.org; Tue, 18 May 2021 15:47:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3cBikYAcKCj0udmstqdfnnfkd.bnlpdlt-cdudkmnmfmt.nqf@flex--venture.bounces.google.com>) id 1lj5b1-0005zM-Av for qemu-devel@nongnu.org; Tue, 18 May 2021 15:41:39 -0400 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]:40624) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3cBikYAcKCj0udmstqdfnnfkd.bnlpdlt-cdudkmnmfmt.nqf@flex--venture.bounces.google.com>) id 1lj5az-0003dN-Nf for qemu-devel@nongnu.org; Tue, 18 May 2021 15:41:39 -0400 Received: by mail-yb1-xb49.google.com with SMTP id e138-20020a25e7900000b029050df4b648fcso8757358ybh.7 for ; Tue, 18 May 2021 12:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=DzfR3PCsNMjQmYWVC9UhsWtMuFHRpsDlBm2LP+qjcYs=; b=lIGtAhi8l7VO5+/+rIEeLeg+gXhm+PjhNpR57/2LfHnKVAmmiGPOcAGxv5qx8YhyDX jqo7iBSFWdvE434Veco6SGRwQDblDOko8GJYvRlCopNdvXQ1vMJzVBYTITkFglVDnxLp Qdx94oA/evCWU1EJ1osCYyhSKzpfmwWevhk0MUvFBLjgtsFEo9qyPwRMY1SMykrw4eP8 h5Rz5I+79/AelIuHGOjursVbHNQayT+EHRLhSb6zQUFCtOU7/y8hWTwi3USOUnRS5jTE mywQ/ehhKdY6EvIXbojFHpLRJ1/mKa/2CIgb+hR/3sLMb7W4niFlxf5ZYjZAFYKGVN6R XA4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=DzfR3PCsNMjQmYWVC9UhsWtMuFHRpsDlBm2LP+qjcYs=; b=DRXpLkAzMKWfl3XD7ZSdLBLrOsFj2afAGtVAIDpvFqHyDaZxW/ogfa5wCjGV+hq8xC eP8yVviTm0DGb075771Y1u5DHH4JS1VT3TssiCx9ZgPtGFtsGSC9UVK1qeox/rcwZpfD Pig+wGC+EOf9R6bdHQZDVo73GHJ8O6p4EiWhCka7uv+t/Ed74cAlqwOXTNkdCA66kCay KM+F+loIc8KILlgSvDMUjkZzGYttPedo8+bCIy9iGeOobCeat1QwsmoVqrsg8cOr6JR4 2/aK4QAN1e7/1KkZIrOUBsvxNrPaWPEHPy+HCUyguYdY5D+qVhbDwG5IUuQxYXGSEgTU 4uLw== X-Gm-Message-State: AOAM532fe9sfqsHHfuSmJ3MVry0VUAVDN+wQCrwwmX9/oChJYweX02Xx l5gTu7hpQ4Z0xIuNX+BNEsU65G4w5pLQ X-Google-Smtp-Source: ABdhPJxOqRwQwDlAS+hkNxxiKKe2rLKVraybp3K8DubOtmb5RnY1rVyguNWUIklxodvH8z6QWTFMHU+UTlVA X-Received: from venture.svl.corp.google.com ([2620:15c:2a3:200:5902:8a04:d917:4e93]) (user=venture job=sendgmr) by 2002:a25:d55:: with SMTP id 82mr9742425ybn.502.1621366896312; Tue, 18 May 2021 12:41:36 -0700 (PDT) Date: Tue, 18 May 2021 12:41:16 -0700 In-Reply-To: <20210518194118.755410-1-venture@google.com> Message-Id: <20210518194118.755410-3-venture@google.com> Mime-Version: 1.0 References: <20210518194118.755410-1-venture@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH 2/4] hw/arm: gsj add pca9548 From: Patrick Venture To: hskinnemoen@google.com, kfting@nuvoton.com, clg@kaod.org, peter.maydell@linaro.org, andrew@aj.id.au, joel@jms.id.au Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Patrick Venture , Hao Wu Received-SPF: pass client-ip=2607:f8b0:4864:20::b49; envelope-from=3cBikYAcKCj0udmstqdfnnfkd.bnlpdlt-cdudkmnmfmt.nqf@flex--venture.bounces.google.com; helo=mail-yb1-xb49.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Tested: Quanta-gsj firmware booted. i2c /dev entries driver I2C init bus 1 freq 100000 I2C init bus 2 freq 100000 I2C init bus 3 freq 100000 I2C init bus 4 freq 100000 I2C init bus 8 freq 100000 I2C init bus 9 freq 100000 at24 9-0055: 8192 byte 24c64 EEPROM, writable, 1 bytes/write I2C init bus 10 freq 100000 at24 10-0055: 8192 byte 24c64 EEPROM, writable, 1 bytes/write I2C init bus 12 freq 100000 I2C init bus 15 freq 100000 i2c i2c-15: Added multiplexed i2c bus 16 i2c i2c-15: Added multiplexed i2c bus 17 i2c i2c-15: Added multiplexed i2c bus 18 i2c i2c-15: Added multiplexed i2c bus 19 i2c i2c-15: Added multiplexed i2c bus 20 i2c i2c-15: Added multiplexed i2c bus 21 i2c i2c-15: Added multiplexed i2c bus 22 i2c i2c-15: Added multiplexed i2c bus 23 pca954x 15-0075: registered 8 multiplexed busses for I2C switch pca9548 Signed-off-by: Patrick Venture Reviewed-by: Hao Wu Reviewed-by: Joel Stanley --- hw/arm/Kconfig | 1 + hw/arm/npcm7xx_boards.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index b887f6a5b1..9d1c2a6f7b 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -377,6 +377,7 @@ config NPCM7XX select SERIAL select SSI select UNIMP + select PCA954X config FSL_IMX25 bool diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index 9b7a7cd201..f0a96564e2 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -18,6 +18,7 @@ #include "hw/arm/npcm7xx.h" #include "hw/core/cpu.h" +#include "hw/i2c/i2c_mux_pca954x.h" #include "hw/i2c/smbus_eeprom.h" #include "hw/loader.h" #include "hw/qdev-core.h" @@ -231,10 +232,7 @@ static void quanta_gsj_i2c_init(NPCM7xxState *soc) * - ucd90160@6b */ - /* - * i2c-15: - * - pca9548@75 - */ + i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 15), "pca9548", 0x75); } static void quanta_gsj_fan_init(NPCM7xxMachine *machine, NPCM7xxState *soc) From patchwork Tue May 18 19:41:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Leis X-Patchwork-Id: 12265545 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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham 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 BFBC4C433ED for ; Tue, 18 May 2021 19:43:40 +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 7ABCA610CB for ; Tue, 18 May 2021 19:43:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7ABCA610CB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj5cx-0001Fc-Iy for qemu-devel@archiver.kernel.org; Tue, 18 May 2021 15:43:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3cxikYAcKCkAxgpvwtgiqqing.eqosgow-fgxgnpqpipw.qti@flex--venture.bounces.google.com>) id 1lj5b5-000686-Bo for qemu-devel@nongnu.org; Tue, 18 May 2021 15:41:43 -0400 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]:40625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3cxikYAcKCkAxgpvwtgiqqing.eqosgow-fgxgnpqpipw.qti@flex--venture.bounces.google.com>) id 1lj5b2-0003gV-JH for qemu-devel@nongnu.org; Tue, 18 May 2021 15:41:43 -0400 Received: by mail-yb1-xb4a.google.com with SMTP id e138-20020a25e7900000b029050df4b648fcso8757602ybh.7 for ; Tue, 18 May 2021 12:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=wi/OXFrMKlEqPmSMbr0B+gTzFcvO+RgxBM3B9kQVjzE=; b=MpUTsiWhj4u66naM4O2ond0IfWxdBRiMiA18CuWb6PAKKIk8h/V69KY8FSoRojOE+g bYRUYN0GH5FU4/2NZ2xqV2sLhMQZq3PsAimqlhAnuKT2WHfxZ4YnmxjbvrwNN+cTHfME fglF43lXf7bw4WLG1RpOIUgMxo8Gh+5DxxTffvvcRSqOIK1BEBVI4Bie4ANOdI6BWuVO AbgsuXpAIDHh0HFGz3HWeSoDc6mbbAPs5k8er5LTNQh9949BzXa6RgkcAU4kFDWbsCZ3 XAmvwvmJq65z3FyJzmdWrpy33my2qEyW6urpFBK7cVAqZvcEmBMdWiSTGFUaVRChxpAh NOlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=wi/OXFrMKlEqPmSMbr0B+gTzFcvO+RgxBM3B9kQVjzE=; b=ETruTIpE2/ycesc5GMq6HzzZphFs9SzMFJfoE/4m0cila9xMMlmtulZE+z9qEHrRZD 4dDYC27FvUmeNH+fQvW8TYaGXwmj417wIBsmXrpVYDIgK/KrZ7h0JgsUa6GvdShkAN1Z r+OLPFVRFF4HecPW8C5sIsSn0iZ2/77aZ8dYdKsmc5A4NAcIwg6e6sCs/e8b0HeVk2dp 1ezuXYSgEDGDCUcZ3y1hmObtq/AiV2NKy+a3EfNyYrGBy3gnUZ3TOsARh3ZcJX41lTRv Ay5GAEt7dz8jlU7iw2EaSaeeDViRWFFbiHgMNKQFexGNGZ3Cb9OdKSFFGB/QSXnY3BaL eA/A== X-Gm-Message-State: AOAM530wTzPeagJcWbmn8gjHQnC9nZ6SWmtVtPQQhFXcAz3HiYN6wJ2D 4QAX/NuAT3lQN4FoCiU3kUoMe8hshBDB X-Google-Smtp-Source: ABdhPJzocDg2AXqxKjVQeDkN6cK5bHrbnAM80nKPCIOr6PUcJg+lcacTsI/eeKyDvUmLQk3VOaiWh7DO3sCF X-Received: from venture.svl.corp.google.com ([2620:15c:2a3:200:5902:8a04:d917:4e93]) (user=venture job=sendgmr) by 2002:a25:218b:: with SMTP id h133mr9813508ybh.160.1621366899094; Tue, 18 May 2021 12:41:39 -0700 (PDT) Date: Tue, 18 May 2021 12:41:17 -0700 In-Reply-To: <20210518194118.755410-1-venture@google.com> Message-Id: <20210518194118.755410-4-venture@google.com> Mime-Version: 1.0 References: <20210518194118.755410-1-venture@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH 3/4] hw/arm: quanta-q71l add pca954x muxes From: Patrick Venture To: hskinnemoen@google.com, kfting@nuvoton.com, clg@kaod.org, peter.maydell@linaro.org, andrew@aj.id.au, joel@jms.id.au Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Patrick Venture , Hao Wu Received-SPF: pass client-ip=2607:f8b0:4864:20::b4a; envelope-from=3cxikYAcKCkAxgpvwtgiqqing.eqosgow-fgxgnpqpipw.qti@flex--venture.bounces.google.com; helo=mail-yb1-xb4a.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Adds the pca954x muxes expected. Tested: Booted quanta-q71l image to userspace. Signed-off-by: Patrick Venture Reviewed-by: Hao Wu Reviewed-by: Joel Stanley --- hw/arm/Kconfig | 1 + hw/arm/aspeed.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 9d1c2a6f7b..4a033e81ef 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -413,6 +413,7 @@ config ASPEED_SOC select PCA9552 select SERIAL select SMBUS_EEPROM + select PCA954X select SSI select SSI_M25P80 select TMP105 diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 3fe6c55744..35a28b0e8b 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -14,6 +14,7 @@ #include "hw/arm/boot.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" +#include "hw/i2c/i2c_mux_pca954x.h" #include "hw/i2c/smbus_eeprom.h" #include "hw/misc/pca9552.h" #include "hw/misc/tmp105.h" @@ -461,14 +462,18 @@ static void quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc) /* TODO: i2c-1: Add Frontpanel FRU eeprom@57 24c64 */ /* TODO: Add Memory Riser i2c mux and eeproms. */ - /* TODO: i2c-2: pca9546@74 */ - /* TODO: i2c-2: pca9548@77 */ + i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9546", 0x74); + i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9548", 0x77); + /* TODO: i2c-3: Add BIOS FRU eeprom@56 24c64 */ - /* TODO: i2c-7: Add pca9546@70 */ + + /* i2c-7 */ + i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9546", 0x70); /* - i2c@0: pmbus@59 */ /* - i2c@1: pmbus@58 */ /* - i2c@2: pmbus@58 */ /* - i2c@3: pmbus@59 */ + /* TODO: i2c-7: Add PDB FRU eeprom@52 */ /* TODO: i2c-8: Add BMC FRU eeprom@50 */ } From patchwork Tue May 18 19:41:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Leis X-Patchwork-Id: 12265561 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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham 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 6A519C433B4 for ; Tue, 18 May 2021 19:51:38 +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 E3C93610CD for ; Tue, 18 May 2021 19:51:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3C93610CD Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj5kf-0007yl-1B for qemu-devel@archiver.kernel.org; Tue, 18 May 2021 15:51:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3dhikYAcKCkM0jsyzwjlttlqj.htrvjrz-ij0jqstslsz.twl@flex--venture.bounces.google.com>) id 1lj5b7-00069k-Aa for qemu-devel@nongnu.org; Tue, 18 May 2021 15:41:45 -0400 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]:56281) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3dhikYAcKCkM0jsyzwjlttlqj.htrvjrz-ij0jqstslsz.twl@flex--venture.bounces.google.com>) id 1lj5b5-0003i1-P8 for qemu-devel@nongnu.org; Tue, 18 May 2021 15:41:45 -0400 Received: by mail-yb1-xb4a.google.com with SMTP id o6-20020a5b06460000b02905004326697dso14798683ybq.22 for ; Tue, 18 May 2021 12:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=O9O4reEPqLUeYKHwxWKxGpiPoeJSbBXfRrJaRXnaRIE=; b=G2sobRNl/5RLrSEjgjh9UTm/0Ld0mh36P29VmtW6WJsuQcfAKzs5mnFpxoudiZ+FLI O27DCUyQuyuCAwtO2m57wu1PJf9dq+9gYrAVJ1nLyDy/l4pg8bNvfR0qaT/QAnAb5YF4 vpDeevk3skRfUp5fa8cLEMCnQ5l2P/5VrhOR5UdD9ZRIOsh4/H195EE06+ZiWAIskSEM jvjEBd59adD5ibre3h1XbMMabRi+agf+7XM02ODS/iNlmZ5sEyMKk1zd4cZ40xh3B6S8 /Z0oJrGJPoATshLOxORt9O3AekbzTt99KOZzrhV9AWktOwypAJFDmqtWcB0pB6ogGxcW UvXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=O9O4reEPqLUeYKHwxWKxGpiPoeJSbBXfRrJaRXnaRIE=; b=fOgKxjK+zlMbCrF14s26Y/3qEf0he/kKPV1Le7ZOhCP4K2YqQJLD+MnSsmtCX1L5ov JfODiyaop2n9S1WkQOsNra83or29KhmfZXuCj4dL9/xtUE6xGPGBK4Vz/nzho2yYc0xL 1DEpFUrK/9++ztubDF8qUpI4oG9H9ODS/QUAS2K9eSNjvcY8pL7HwoOgrGSUTio5FMsR jlGGGGonut2Y+Y/BoOiKT8+6RH0cTQZQfAkIOGR9LVQBEBIuRkEvMjMQWqS9IWN0ogy6 kQVBpuk6zV6j0ZuUgksHVdZPb/ux76jnoTKTQM9qVH7KwF8npQlOyKsXNounQCJVUin9 LC+Q== X-Gm-Message-State: AOAM533ZhcRFSl5sPGTUFYVGe90arKoCpGSokhzSi94XOT4KmY8EC0UX z+tlA0h/egLnOWtjGKp6esCqZQBYOkW9 X-Google-Smtp-Source: ABdhPJz/OcBApN6eUd87jM5ob68UzR/CNl4Yrd0wxpzKAo/XKMauGA4HlZXXXd8EEIZ67GUhDXtCPu/cQqLz X-Received: from venture.svl.corp.google.com ([2620:15c:2a3:200:5902:8a04:d917:4e93]) (user=venture job=sendgmr) by 2002:a25:7085:: with SMTP id l127mr10221604ybc.293.1621366902104; Tue, 18 May 2021 12:41:42 -0700 (PDT) Date: Tue, 18 May 2021 12:41:18 -0700 In-Reply-To: <20210518194118.755410-1-venture@google.com> Message-Id: <20210518194118.755410-5-venture@google.com> Mime-Version: 1.0 References: <20210518194118.755410-1-venture@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH 4/4] aspeed: sonorapass: enable pca954x muxes From: Patrick Venture To: hskinnemoen@google.com, kfting@nuvoton.com, clg@kaod.org, peter.maydell@linaro.org, andrew@aj.id.au, joel@jms.id.au Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Patrick Venture , Hao Wu Received-SPF: pass client-ip=2607:f8b0:4864:20::b4a; envelope-from=3dhikYAcKCkM0jsyzwjlttlqj.htrvjrz-ij0jqstslsz.twl@flex--venture.bounces.google.com; helo=mail-yb1-xb4a.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Enables the pca954x muxes in the bmc board configuration. Signed-off-by: Patrick Venture Reviewed-by: Hao Wu --- hw/arm/aspeed.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 35a28b0e8b..27fd51980c 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -541,14 +541,16 @@ static void swift_bmc_i2c_init(AspeedMachineState *bmc) static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc) { + I2CSlave *i2c_mux; AspeedSoCState *soc = &bmc->soc; /* bus 2 : */ i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x48); i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x49); - /* bus 2 : pca9546 @ 0x73 */ + i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9546", 0x73); - /* bus 3 : pca9548 @ 0x70 */ + /* bus 3 : */ + i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 3), "pca9548", 0x70); /* bus 4 : */ uint8_t *eeprom4_54 = g_malloc0(8 * 1024); @@ -562,7 +564,7 @@ static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc) /* bus 6 : */ i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x48); i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x49); - /* bus 6 : pca9546 @ 0x73 */ + i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "pca9546", 0x73); /* bus 8 : */ uint8_t *eeprom8_56 = g_malloc0(8 * 1024); @@ -573,14 +575,12 @@ static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc) /* bus 8 : adc128d818 @ 0x1d */ /* bus 8 : adc128d818 @ 0x1f */ - /* - * bus 13 : pca9548 @ 0x71 - * - channel 3: - * - tmm421 @ 0x4c - * - tmp421 @ 0x4e - * - tmp421 @ 0x4f - */ - + /* bus 13 : */ + i2c_mux = i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 13), + "pca9548", 0x71); + i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 3), "tmp421", 0x4c); + i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 3), "tmp421", 0x4e); + i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 3), "tmp421", 0x4f); } static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)