Skip to contentSkip to conversation

aspeed queue

GIT PULL Applied Cédric Le Goater 3 participants 9 messages Mar 7, 2023 – Mar 9, 2023 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

The following changes since commit 817fd33836e73812df2f1907612b57750fcb9491:

Merge tag 'audio-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2023-03-06 14:06:06 +0000)

are available in the Git repository at:

https://github.com/legoater/qemu/ tags/pull-aspeed-20230307

for you to fetch changes up to 7840ba985a7c0fcf90a7318ff1f827f89571cb3c:

hw/arm/aspeed: Modified BMC FRU byte data in yosemitev2 (2023-03-07 16:53:18 +0100)

----------------------------------------------------------------
aspeed queue:

* Small adjustments for the newest Meta machines
* blk_pread_nonzeroes() fix required for pflash and m25p80 devices
* Improve error reporting on file size for m25p80 devices

----------------------------------------------------------------
Cédric Le Goater (1):
m25p80: Improve error when the backend file size does not match the device

Karthikeyan Pasupathi (3):
hw/arm/aspeed: Added TMP421 type sensor's support in yosemitev2 hw/arm/aspeed: Added TMP421 type sensor's support in tiogapass hw/arm/aspeed: Modified BMC FRU byte data in yosemitev2

Kevin Wolf (1):
pflash: Fix blk_pread_nonzeroes()

 hw/arm/aspeed.c        |  9 +++++++++
 hw/arm/aspeed_eeprom.c | 10 +++++-----
 hw/block/block.c       |  3 +--
 hw/block/m25p80.c      |  4 ++--
 4 files changed, 17 insertions(+), 9 deletions(-)
#1 lore raw

[PULL 4/5] hw/arm/aspeed: Added TMP421 type sensor's support in tiogapass

From: Karthikeyan Pasupathi <[email protected]>

Added TMP421 type sensor support in tiogapass platform.

Tested: Tested and verified in tiogapass platform.

Message-Id: <[email protected]>

---
 hw/arm/aspeed.c | 4 ++++
 1 file changed, 4 insertions(+)
hw/arm/aspeed.c +4 -0
index 7b5e603bc4..c1f2b9cfca 100644
@@ -547,6 +547,10 @@ static void tiogapass_bmc_i2c_init(AspeedMachineState *bmc)
     at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 4), 0x54, 128 * KiB);
     at24c_eeprom_init_rom(aspeed_i2c_get_bus(&soc->i2c, 6), 0x54, 128 * KiB,
                           tiogapass_bmc_fruid, tiogapass_bmc_fruid_len);
+    /* TMP421 */
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8), "tmp421", 0x1f);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp421", 0x4f);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp421", 0x4e);
 }
 
 static void create_pca9552(AspeedSoCState *soc, int bus_id, int addr)
Signature · 1 line
2.39.2
#2 lore raw

[PULL 2/5] pflash: Fix blk_pread_nonzeroes()

In reply to Cédric Le Goater

From: Kevin Wolf <[email protected]>

Commit a4b15a8b introduced a new function blk_pread_nonzeroes(). Instead of reading directly from the root node of the BlockBackend, it reads from its 'file' child node. This can happen to mostly work for raw images (as long as the 'raw' format driver is in use, but not actually doing anything), but it breaks everything else.

Fix it to read from the root node instead.

Fixes a4b15a8b9ef25b44fa92a4825312622600c1f37c

Message-Id: <[email protected]>

---
 hw/block/block.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
hw/block/block.c +1 -2
index af0710e477..9f52ee6e72 100644
@@ -39,8 +39,7 @@ static int blk_pread_nonzeroes(BlockBackend *blk, hwaddr size, void *buf)
             return ret;
         }
         if (!(ret & BDRV_BLOCK_ZERO)) {
-            ret = bdrv_pread(bs->file, offset, bytes,
-                             (uint8_t *) buf + offset, 0);
+            ret = blk_pread(blk, offset, bytes, (uint8_t *) buf + offset, 0);
             if (ret < 0) {
                 return ret;
             }
Signature · 1 line
2.39.2
Tested-by Maciej S. Szmigiero
#3 lore raw

Re: [PULL 2/5] pflash: Fix blk_pread_nonzeroes()

Quoted 11 lines · Cédric Le Goater

From: Kevin Wolf <[email protected]>

Commit a4b15a8b introduced a new function blk_pread_nonzeroes(). Instead of reading directly from the root node of the BlockBackend, it reads from its 'file' child node. This can happen to mostly work for raw images (as long as the 'raw' format driver is in use, but not actually doing anything), but it breaks everything else.

Fix it to read from the root node instead.

Fixes a4b15a8b9ef25b44fa92a4825312622600c1f37c

You missed:

Fixes a4b15a8b9e ("pflash: Only read non-zero parts of backend image")

by 3min:
https://lore.kernel.org/qemu-devel/[email protected]/

Quoted 22 lines

Message-Id: <[email protected]>

---
  hw/block/block.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
hw/block/block.c +1 -2
index af0710e477..9f52ee6e72 100644
@@ -39,8 +39,7 @@ static int blk_pread_nonzeroes(BlockBackend *blk, hwaddr size, void *buf)
              return ret;
          }
          if (!(ret & BDRV_BLOCK_ZERO)) {
-            ret = bdrv_pread(bs->file, offset, bytes,
-                             (uint8_t *) buf + offset, 0);
+            ret = blk_pread(blk, offset, bytes, (uint8_t *) buf + offset, 0);
              if (ret < 0) {
                  return ret;
              }
#4 lore raw

Re: [PULL 2/5] pflash: Fix blk_pread_nonzeroes()

Quoted 13 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Cédric Le Goater

From: Kevin Wolf <[email protected]>

Commit a4b15a8b introduced a new function blk_pread_nonzeroes(). Instead of reading directly from the root node of the BlockBackend, it reads from its 'file' child node. This can happen to mostly work for raw images (as long as the 'raw' format driver is in use, but not actually doing anything), but it breaks everything else.

Fix it to read from the root node instead.

Fixes a4b15a8b9ef25b44fa92a4825312622600c1f37c
Quoted 7 lines

You missed:

Fixes a4b15a8b9e ("pflash: Only read non-zero parts of backend image")

by 3min:
https://lore.kernel.org/qemu-devel/[email protected]/

yes :) I waited for the CI to complete and didn't check my email before sending. If I respin, I will fix.

C.

Quoted 24 lines
Quoted 23 lines

Message-Id: <[email protected]>

---
  hw/block/block.c | 3 +--

  1 file changed, 1 insertion(+), 2 deletions(-)
hw/block/block.c +1 -2
index af0710e477..9f52ee6e72 100644
@@ -39,8 +39,7 @@ static int blk_pread_nonzeroes(BlockBackend *blk, hwaddr size, void *buf)
               return ret;
           }
           if (!(ret & BDRV_BLOCK_ZERO)) {
-            ret = bdrv_pread(bs->file, offset, bytes,
-                             (uint8_t *) buf + offset, 0);
+            ret = blk_pread(blk, offset, bytes, (uint8_t *) buf + offset, 0);
               if (ret < 0) {
                   return ret;
               }
#5 lore raw

[PULL 3/5] hw/arm/aspeed: Added TMP421 type sensor's support in yosemitev2

In reply to Cédric Le Goater

From: Karthikeyan Pasupathi <[email protected]>

Added TMP421 type support in yosemite v2 platform.

Tested: Tested and verified in yosemite V2 platform.

Message-Id: <[email protected]>

---
 hw/arm/aspeed.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/arm/aspeed.c +5 -0
index 86601cb1a5..7b5e603bc4 100644
@@ -524,6 +524,11 @@ static void yosemitev2_bmc_i2c_init(AspeedMachineState *bmc)
     at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 4), 0x51, 128 * KiB);
     at24c_eeprom_init_rom(aspeed_i2c_get_bus(&soc->i2c, 8), 0x51, 128 * KiB,
                           yosemitev2_bmc_fruid, yosemitev2_bmc_fruid_len);
+    /* TMP421 */
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "tmp421", 0x1f);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 9), "tmp421", 0x4e);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 9), "tmp421", 0x4f);
+
 }
 
 static void romulus_bmc_i2c_init(AspeedMachineState *bmc)
Signature · 1 line
2.39.2
#6 lore raw

[PULL 1/5] m25p80: Improve error when the backend file size does not match the device

In reply to Cédric Le Goater

Currently, when a block backend is attached to a m25p80 device and the associated file size does not match the flash model, QEMU complains with the error message "failed to read the initial flash content". This is confusing for the user.

Instead, use helper blk_check_size_and_read_all() introduced by commit 06f1521795 ("pflash: Require backend size to match device, improve errors").

Message-Id: <[email protected]>

---
 hw/block/m25p80.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/block/m25p80.c +2 -2
index 802d2eb021..dc5ffbc4ff 100644
@@ -24,6 +24,7 @@
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "sysemu/block-backend.h"
+#include "hw/block/block.h"
 #include "hw/qdev-properties.h"
 #include "hw/qdev-properties-system.h"
 #include "hw/ssi/ssi.h"
@@ -1615,8 +1616,7 @@ static void m25p80_realize(SSIPeripheral *ss, Error **errp)
         trace_m25p80_binding(s);
         s->storage = blk_blockalign(s->blk, s->size);
 
-        if (blk_pread(s->blk, 0, s->size, s->storage, 0) < 0) {
-            error_setg(errp, "failed to read the initial flash content");
+        if (!blk_check_size_and_read_all(s->blk, s->storage, s->size, errp)) {
             return;
         }
     } else {
Signature · 1 line
2.39.2
#7 lore raw

[PULL 5/5] hw/arm/aspeed: Modified BMC FRU byte data in yosemitev2

In reply to Cédric Le Goater

From: Karthikeyan Pasupathi <[email protected]>

Modified BMC FRU data in yosemite v2 platform.

Tested: Tested and Verified in yosemitev2 platform.

Fixes 34f73a81e6 ("hw/arm/aspeed: Adding new machine Yosemitev2 in QEMU")

Message-Id: <[email protected]>

---
 hw/arm/aspeed_eeprom.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
hw/arm/aspeed_eeprom.c +5 -5
index 2fb2d5dbb7..dc33a88a54 100644
@@ -101,17 +101,17 @@ const uint8_t fby35_bmc_fruid[] = {
 /* Yosemite V2 BMC FRU */
 const uint8_t yosemitev2_bmc_fruid[] = {
     0x01, 0x00, 0x00, 0x01, 0x0d, 0x00, 0x00, 0xf1, 0x01, 0x0c, 0x00, 0x36,
-    0xe6, 0xd0, 0xc6, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xd2, 0x42, 0x4d,
-    0x43, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x4d, 0x6f,
-    0x64, 0x75, 0x6c, 0x65, 0xcd, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
+    0xe6, 0xd0, 0xc6, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xd2, 0x42, 0x61,
+    0x73, 0x65, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x20, 0x4d, 0x50, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xcd, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
     0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xce, 0x58, 0x58, 0x58, 0x58, 0x58,
     0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xc3, 0x31, 0x2e,
     0x30, 0xc9, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xd2,
     0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
     0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xc1, 0x39, 0x01, 0x0c, 0x00, 0xc6,
     0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xd2, 0x59, 0x6f, 0x73, 0x65, 0x6d,
-    0x69, 0x74, 0x65, 0x20, 0x56, 0x32, 0x2e, 0x30, 0x20, 0x45, 0x56, 0x54,
-    0x32, 0xce, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
+    0x69, 0x74, 0x65, 0x20, 0x56, 0x32, 0x20, 0x4d, 0x50, 0x00, 0x00, 0x00,
+    0x00, 0xce, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,
     0x58, 0x58, 0x58, 0x58, 0xc4, 0x45, 0x56, 0x54, 0x32, 0xcd, 0x58, 0x58,
     0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xc7,
     0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xc3, 0x31, 0x2e, 0x30, 0xc9,
Signature · 1 line
2.39.2
#8 lore raw
In reply to Cédric Le Goater
Quoted 11 lines · Cédric Le Goater

The following changes since commit 817fd33836e73812df2f1907612b57750fcb9491:

Merge tag 'audio-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2023-03-06 14:06:06 +0000)

are available in the Git repository at:

https://github.com/legoater/qemu/ tags/pull-aspeed-20230307

for you to fetch changes up to 7840ba985a7c0fcf90a7318ff1f827f89571cb3c:

Quoted 9 lines

hw/arm/aspeed: Modified BMC FRU byte data in yosemitev2 (2023-03-07 16:53:18 +0100)

----------------------------------------------------------------
aspeed queue:

* Small adjustments for the newest Meta machines
* blk_pread_nonzeroes() fix required for pflash and m25p80 devices
* Improve error reporting on file size for m25p80 devices

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/8.0
for any user-visible changes.

-- PMM