qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Venture <venture@google.com>
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 <venture@google.com>,
	Hao Wu <wuhaotsh@google.com>
Subject: [PATCH 4/4] aspeed: sonorapass: enable pca954x muxes
Date: Tue, 18 May 2021 12:41:18 -0700	[thread overview]
Message-ID: <20210518194118.755410-5-venture@google.com> (raw)
In-Reply-To: <20210518194118.755410-1-venture@google.com>

Enables the pca954x muxes in the bmc board configuration.

Signed-off-by: Patrick Venture <venture@google.com>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
---
 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)
-- 
2.31.1.751.gd2f1c929bd-goog



  parent reply	other threads:[~2021-05-18 19:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 19:41 [PATCH 0/4] With the pca954x i2c mux available, enable it on aspeed and nuvoton BMC boards Patrick Venture
2021-05-18 19:41 ` [PATCH 1/4] hw/arm: gsj add i2c comments Patrick Venture
2021-05-18 23:22   ` Joel Stanley
2021-05-18 19:41 ` [PATCH 2/4] hw/arm: gsj add pca9548 Patrick Venture
2021-05-18 23:22   ` Joel Stanley
2021-05-18 19:41 ` [PATCH 3/4] hw/arm: quanta-q71l add pca954x muxes Patrick Venture
2021-05-18 23:26   ` Joel Stanley
2021-05-18 19:41 ` Patrick Venture [this message]
2021-05-18 23:27   ` [PATCH 4/4] aspeed: sonorapass: enable " Joel Stanley
2021-05-19 17:18     ` Patrick Venture
2021-06-08 19:55       ` Patrick Venture
2021-06-09  1:58         ` Joel Stanley
2021-06-09  5:23           ` Cédric Le Goater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210518194118.755410-5-venture@google.com \
    --to=venture@google.com \
    --cc=andrew@aj.id.au \
    --cc=clg@kaod.org \
    --cc=hskinnemoen@google.com \
    --cc=joel@jms.id.au \
    --cc=kfting@nuvoton.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wuhaotsh@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).