aspeed queue
Subsystems (2)
The following changes since commit 609d7596524ab204ccd71ef42c9eee4c7c338ea4:
Update version for v6.0.0 release (2021-04-29 18:05:29 +0100)
are available in the Git repository at:
https://github.com/legoater/qemu/ tags/pull-aspeed-20210430
for you to fetch changes up to 1401dcd8aac9039797b995bfab078877a820c9c5:
aspeed: Add support for the quanta-q7l1-bmc board (2021-04-30 10:30:42 +0200)
----------------------------------------------------------------
Aspeed patches :
* Fixes for the DMA space
* New model for ASPEED's Hash and Crypto Engine (Joel and Klaus)
* Acceptance tests (Joel)
* A fix for the XDMA model
* Some extra features for the SMC controller.
* Two new boards : rainier-bmc and quanta-q7l1-bmc (Patrick)
----------------------------------------------------------------
Cédric Le Goater (11):
aspeed/smc: Use the RAM memory region for DMAs aspeed/smc: Remove unused "sdram-base" property aspeed/i2c: Fix DMA address mask
aspeed/i2c: Rename DMA address space hw/misc/aspeed_xdma: Add AST2600 support aspeed/smc: Add a 'features' attribute to the object class aspeed/smc: Add extra controls to request DMA tests/qtest: Rename m25p80 test in aspeed_smc test
aspeed: Deprecate the swift-bmc machine
aspeed: Add support for the rainier-bmc board hw/block: m25p80: Add support for mt25ql02g and mt25qu02g
Joel Stanley (5):
hw: Model ASPEED's Hash and Crypto Engine
aspeed: Integrate HACE
tests/qtest: Add test for Aspeed HACE tests/acceptance: Test ast2400 and ast2500 machines tests/acceptance: Test ast2600 machine
Patrick Venture (1):
aspeed: Add support for the quanta-q7l1-bmc board
Philippe Mathieu-Daudé (1):
hw/arm/aspeed: Do not sysbus-map mmio flash region directly, use alias
docs/system/arm/aspeed.rst | 2 +-
docs/system/deprecated.rst | 7 +
include/hw/arm/aspeed_soc.h | 3 +
include/hw/misc/aspeed_hace.h | 43 +++
include/hw/misc/aspeed_xdma.h | 17 +-
include/hw/ssi/aspeed_smc.h | 7 +-
hw/arm/aspeed.c | 146 ++++++-
hw/arm/aspeed_ast2600.c | 22 +-
hw/arm/aspeed_soc.c | 23 +-
hw/block/m25p80.c | 2 +
hw/i2c/aspeed_i2c.c | 5 +-
hw/misc/aspeed_hace.c | 389 +++++++++++++++++++
hw/misc/aspeed_xdma.c | 124 ++++--
hw/ssi/aspeed_smc.c | 119 ++++--
tests/qtest/aspeed_hace-test.c | 469 +++++++++++++++++++++++
tests/qtest/{m25p80-test.c => aspeed_smc-test.c} | 12 +-
MAINTAINERS | 1 +
hw/misc/meson.build | 1 +
tests/acceptance/boot_linux_console.py | 68 ++++
tests/qtest/meson.build | 5 +-
20 files changed, 1389 insertions(+), 76 deletions(-)
create mode 100644 include/hw/misc/aspeed_hace.h
create mode 100644 hw/misc/aspeed_hace.c
create mode 100644 tests/qtest/aspeed_hace-test.c
rename tests/qtest/{m25p80-test.c => aspeed_smc-test.c} (96%)[PULL 03/18] aspeed/i2c: Fix DMA address mask
The RAM memory region is now used for DMAs accesses instead of the memory address space region. Mask off the top bits of the DMA address to reflect this change.
Message-Id: <[email protected]>
--- hw/i2c/aspeed_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i2c/aspeed_i2c.c +1 -1
@@ -601,7 +601,7 @@ static void aspeed_i2c_bus_write(void *opaque, hwaddr offset,break ; } - bus->dma_addr = value &0xfffffffc ; + bus->dma_addr = value &0x3ffffffc ;break ;case I2CD_DMA_LEN :
Signature · 1 line
2.26.3
[PULL 06/18] hw: Model ASPEED's Hash and Crypto Engine
In reply to Cédric Le GoaterFrom: Joel Stanley <[email protected]>
The HACE (Hash and Crypto Engine) is a device that offloads MD5, SHA1, SHA2, RSA and other cryptographic algorithms.
This initial model implements a subset of the device's functionality; currently only MD5/SHA hashing, and on the ast2600's scatter gather engine.
Message-Id: <[email protected]>
--- docs/system/arm/aspeed.rst | 1 + include/hw/misc/aspeed_hace.h | 43 ++++ hw/misc/aspeed_hace.c | 389 ++++++++++++++++++++++++++++++++++ hw/misc/meson.build | 1 + 4 files changed, 434 insertions(+) create mode 100644 include/hw/misc/aspeed_hace.h create mode 100644 hw/misc/aspeed_hace.c
docs/system/arm/aspeed.rst +1 -0
@@ -49,6 +49,7 @@ Supported devices * Ethernet controllers * Front LEDs (PCA9552 on I2C bus) * LPC Peripheral Controller (a subset of subdevices are supported) + * Hash/Crypto Engine (HACE) - Hash support only. TODO: HMAC and RSA Missing devices
include/hw/misc/aspeed_hace.h new file +43 -0
43 lines not on this page · raw message
hw/misc/aspeed_hace.c new file +389 -0
389 lines not on this page · raw message
hw/misc/meson.build +1 -0
@@ -109,6 +109,7 @@ softmmu_ss.add(when: 'CONFIG_PVPANIC_ISA', if_true: files('pvpanic-isa.c')) softmmu_ss.add(when: 'CONFIG_PVPANIC_PCI', if_true: files('pvpanic-pci.c')) softmmu_ss.add(when: 'CONFIG_AUX', if_true: files('auxbus.c')) softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files( + 'aspeed_hace.c', 'aspeed_lpc.c', 'aspeed_scu.c', 'aspeed_sdmc.c',
Signature · 1 line
2.26.3
[PULL 04/18] aspeed/i2c: Rename DMA address space
In reply to Cédric Le GoaterIt improves 'info mtree' output.
Message-Id: <[email protected]>
--- hw/i2c/aspeed_i2c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/i2c/aspeed_i2c.c +2 -1
@@ -816,7 +816,8 @@ static void aspeed_i2c_realize(DeviceState *dev, Error **errp)return ; } -address_space_init (&s->dram_as, s->dram_mr,"dma-dram" ); +address_space_init (&s->dram_as, s->dram_mr, +TYPE_ASPEED_I2C "-dma-dram" ); } }
Signature · 1 line
2.26.3
[PULL 08/18] tests/qtest: Add test for Aspeed HACE
In reply to Cédric Le GoaterFrom: Joel Stanley <[email protected]>
This adds a test for the Aspeed Hash and Crypto (HACE) engine. It tests the currently implemented behavior of the hash functionality.
The tests are similar, but are cut/pasted instead of broken out into a common function so the assert machinery produces useful output when a test fails.
Message-Id: <[email protected]>
--- tests/qtest/aspeed_hace-test.c | 469 +++++++++++++++++++++++++++++++++ MAINTAINERS | 1 + tests/qtest/meson.build | 3 + 3 files changed, 473 insertions(+) create mode 100644 tests/qtest/aspeed_hace-test.c
tests/qtest/aspeed_hace-test.c new file +469 -0
@@ -0,0 +1,469 @@ +/* +* QTest testcase for the ASPEED Hash and Crypto Engine +* +* SPDX-License-Identifier: GPL-2.0-or-later +* Copyright 2021 IBM Corp. +*/ + +#include "qemu/osdep.h" + +#include "libqos/libqtest.h" +#include "qemu-common.h" +#include "qemu/bitops.h" + +#define HACE_CMD 0x10 +#define HACE_SHA_BE_EN BIT(3) +#define HACE_MD5_LE_EN BIT(2) +#define HACE_ALGO_MD5 0 +#define HACE_ALGO_SHA1 BIT(5) +#define HACE_ALGO_SHA224 BIT(6) +#define HACE_ALGO_SHA256 (BIT(4) | BIT(6)) +#define HACE_ALGO_SHA512 (BIT(5) | BIT(6)) +#define HACE_ALGO_SHA384 (BIT(5) | BIT(6) | BIT(10)) +#define HACE_SG_EN BIT(18) + +#define HACE_STS 0x1c +#define HACE_RSA_ISR BIT(13) +#define HACE_CRYPTO_ISR BIT(12) +#define HACE_HASH_ISR BIT(9) +#define HACE_RSA_BUSY BIT(2) +#define HACE_CRYPTO_BUSY BIT(1) +#define HACE_HASH_BUSY BIT(0) +#define HACE_HASH_SRC 0x20 +#define HACE_HASH_DIGEST 0x24 +#define HACE_HASH_KEY_BUFF 0x28 +#define HACE_HASH_DATA_LEN 0x2c +#define HACE_HASH_CMD 0x30 +/* Scatter-Gather Hash */ +#define SG_LIST_LEN_LAST BIT(31) +struct AspeedSgList { +uint32_t len; +uint32_t addr; +} __attribute__ ((__packed__ )); + +/* +* Test vector is the ascii "abc" +* +* Expected results were generated using command line utitiles: +* +* echo -n -e 'abc' | dd of=/tmp/test +* for hash in sha512sum sha256sum md5sum; do $hash /tmp/test; done +* +*/ +static const uint8_t test_vector[] = {0x61 ,0x62 ,0x63 }; + +static const uint8_t test_result_sha512[] = { +0xdd ,0xaf ,0x35 ,0xa1 ,0x93 ,0x61 ,0x7a ,0xba ,0xcc ,0x41 ,0x73 ,0x49 , +0xae ,0x20 ,0x41 ,0x31 ,0x12 ,0xe6 ,0xfa ,0x4e ,0x89 ,0xa9 ,0x7e ,0xa2 , +0x0a ,0x9e ,0xee ,0xe6 ,0x4b ,0x55 ,0xd3 ,0x9a ,0x21 ,0x92 ,0x99 ,0x2a , +0x27 ,0x4f ,0xc1 ,0xa8 ,0x36 ,0xba ,0x3c ,0x23 ,0xa3 ,0xfe ,0xeb ,0xbd , +0x45 ,0x4d ,0x44 ,0x23 ,0x64 ,0x3c ,0xe8 ,0x0e ,0x2a ,0x9a ,0xc9 ,0x4f , +0xa5 ,0x4c ,0xa4 ,0x9f }; + +static const uint8_t test_result_sha256[] = { +0xba ,0x78 ,0x16 ,0xbf ,0x8f ,0x01 ,0xcf ,0xea ,0x41 ,0x41 ,0x40 ,0xde , +0x5d ,0xae ,0x22 ,0x23 ,0xb0 ,0x03 ,0x61 ,0xa3 ,0x96 ,0x17 ,0x7a ,0x9c , +0xb4 ,0x10 ,0xff ,0x61 ,0xf2 ,0x00 ,0x15 ,0xad }; + +static const uint8_t test_result_md5[] = { +0x90 ,0x01 ,0x50 ,0x98 ,0x3c ,0xd2 ,0x4f ,0xb0 ,0xd6 ,0x96 ,0x3f ,0x7d , +0x28 ,0xe1 ,0x7f ,0x72 }; + +/* +* The Scatter-Gather Test vector is the ascii "abc" "def" "ghi", broken +* into blocks of 3 characters as shown +* +* Expected results were generated using command line utitiles: +* +* echo -n -e 'abcdefghijkl' | dd of=/tmp/test +* for hash in sha512sum sha256sum; do $hash /tmp/test; done +* +*/ +static const uint8_t test_vector_sg1[] = {0x61 ,0x62 ,0x63 ,0x64 ,0x65 ,0x66 }; +static const uint8_t test_vector_sg2[] = {0x67 ,0x68 ,0x69 }; +static const uint8_t test_vector_sg3[] = {0x6a ,0x6b ,0x6c }; + +static const uint8_t test_result_sg_sha512[] = { +0x17 ,0x80 ,0x7c ,0x72 ,0x8e ,0xe3 ,0xba ,0x35 ,0xe7 ,0xcf ,0x7a ,0xf8 , +0x23 ,0x11 ,0x6d ,0x26 ,0xe4 ,0x1e ,0x5d ,0x4d ,0x6c ,0x2f ,0xf1 ,0xf3 , +0x72 ,0x0d ,0x3d ,0x96 ,0xaa ,0xcb ,0x6f ,0x69 ,0xde ,0x64 ,0x2e ,0x63 , +0xd5 ,0xb7 ,0x3f ,0xc3 ,0x96 ,0xc1 ,0x2b ,0xe3 ,0x8b ,0x2b ,0xd5 ,0xd8 , +0x84 ,0x25 ,0x7c ,0x32 ,0xc8 ,0xf6 ,0xd0 ,0x85 ,0x4a ,0xe6 ,0xb5 ,0x40 , +0xf8 ,0x6d ,0xda ,0x2e }; + +static const uint8_t test_result_sg_sha256[] = { +0xd6 ,0x82 ,0xed ,0x4c ,0xa4 ,0xd9 ,0x89 ,0xc1 ,0x34 ,0xec ,0x94 ,0xf1 , +0x55 ,0x1e ,0x1e ,0xc5 ,0x80 ,0xdd ,0x6d ,0x5a ,0x6e ,0xcd ,0xe9 ,0xf3 , +0xd3 ,0x5e ,0x6e ,0x4a ,0x71 ,0x7f ,0xbd ,0xe4 }; + + +static void write_regs (QTestState *s,uint32_t base,uint32_t src, +uint32_t length,uint32_t out,uint32_t method) +{ +qtest_writel (s, base +HACE_HASH_SRC , src); +qtest_writel (s, base +HACE_HASH_DIGEST , out); +qtest_writel (s, base +HACE_HASH_DATA_LEN , length); +qtest_writel (s, base +HACE_HASH_CMD ,HACE_SHA_BE_EN | method); +} + +static void test_md5 (const char *machine,const uint32_t base, +const uint32_t src_addr) + +{ +QTestState *s =qtest_init (machine); + +uint32_t digest_addr = src_addr +0x01000000 ; +uint8_t digest[16 ] = {0 }; + +/* Check engine is idle, no busy or irq bits set */ + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0); + +/* Write test vector into memory */ +qtest_memwrite (s, src_addr, test_vector,sizeof (test_vector)); + +write_regs (s, base, src_addr,sizeof (test_vector), digest_addr,HACE_ALGO_MD5 ); + +/* Check hash IRQ status is asserted */ + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0x00000200); + +/* Clear IRQ status and check status is deasserted */ +qtest_writel (s, base +HACE_STS ,0x00000200 ); + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0); + +/* Read computed digest from memory */ +qtest_memread (s, digest_addr, digest,sizeof (digest)); + +/* Check result of computation */ +g_assert_cmpmem (digest,sizeof (digest), + test_result_md5,sizeof (digest)); + +qtest_quit (s); +} + +static void test_sha256 (const char *machine,const uint32_t base, +const uint32_t src_addr) +{ +QTestState *s =qtest_init (machine); + +const uint32_t digest_addr = src_addr +0x1000000 ; +uint8_t digest[32 ] = {0 }; + +/* Check engine is idle, no busy or irq bits set */ + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0); + +/* Write test vector into memory */ +qtest_memwrite (s, src_addr, test_vector,sizeof (test_vector)); + +write_regs (s, base, src_addr,sizeof (test_vector), digest_addr,HACE_ALGO_SHA256 ); + +/* Check hash IRQ status is asserted */ + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0x00000200); + +/* Clear IRQ status and check status is deasserted */ +qtest_writel (s, base +HACE_STS ,0x00000200 ); + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0); + +/* Read computed digest from memory */ +qtest_memread (s, digest_addr, digest,sizeof (digest)); + +/* Check result of computation */ +g_assert_cmpmem (digest,sizeof (digest), + test_result_sha256,sizeof (digest)); + +qtest_quit (s); +} + +static void test_sha512 (const char *machine,const uint32_t base, +const uint32_t src_addr) +{ +QTestState *s =qtest_init (machine); + +const uint32_t digest_addr = src_addr +0x1000000 ; +uint8_t digest[64 ] = {0 }; + +/* Check engine is idle, no busy or irq bits set */ + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0); + +/* Write test vector into memory */ +qtest_memwrite (s, src_addr, test_vector,sizeof (test_vector)); + +write_regs (s, base, src_addr,sizeof (test_vector), digest_addr,HACE_ALGO_SHA512 ); + +/* Check hash IRQ status is asserted */ + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0x00000200); + +/* Clear IRQ status and check status is deasserted */ +qtest_writel (s, base +HACE_STS ,0x00000200 ); + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0); + +/* Read computed digest from memory */ +qtest_memread (s, digest_addr, digest,sizeof (digest)); + +/* Check result of computation */ +g_assert_cmpmem (digest,sizeof (digest), + test_result_sha512,sizeof (digest)); + +qtest_quit (s); +} + +static void test_sha256_sg (const char *machine,const uint32_t base, +const uint32_t src_addr) +{ +QTestState *s =qtest_init (machine); + +const uint32_t src_addr_1 = src_addr +0x1000000 ; +const uint32_t src_addr_2 = src_addr +0x2000000 ; +const uint32_t src_addr_3 = src_addr +0x3000000 ; +const uint32_t digest_addr = src_addr +0x4000000 ; +uint8_t digest[32 ] = {0 }; +struct AspeedSgList array[] = { + {cpu_to_le32 (sizeof (test_vector_sg1)), +cpu_to_le32 (src_addr_1) }, + {cpu_to_le32 (sizeof (test_vector_sg2)), +cpu_to_le32 (src_addr_2) }, + {cpu_to_le32 (sizeof (test_vector_sg3) |SG_LIST_LEN_LAST ), +cpu_to_le32 (src_addr_3) }, + }; + +/* Check engine is idle, no busy or irq bits set */ + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0); + +/* Write test vector into memory */ +qtest_memwrite (s, src_addr_1, test_vector_sg1,sizeof (test_vector_sg1)); +qtest_memwrite (s, src_addr_2, test_vector_sg2,sizeof (test_vector_sg2)); +qtest_memwrite (s, src_addr_3, test_vector_sg3,sizeof (test_vector_sg3)); +qtest_memwrite (s, src_addr, array,sizeof (array)); + +write_regs (s, base, src_addr, + (sizeof (test_vector_sg1) + +sizeof (test_vector_sg2) + +sizeof (test_vector_sg3)), + digest_addr,HACE_ALGO_SHA256 |HACE_SG_EN ); + +/* Check hash IRQ status is asserted */ + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0x00000200); + +/* Clear IRQ status and check status is deasserted */ +qtest_writel (s, base +HACE_STS ,0x00000200 ); + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0); + +/* Read computed digest from memory */ +qtest_memread (s, digest_addr, digest,sizeof (digest)); + +/* Check result of computation */ +g_assert_cmpmem (digest,sizeof (digest), + test_result_sg_sha256,sizeof (digest)); + +qtest_quit (s); +} + +static void test_sha512_sg (const char *machine,const uint32_t base, +const uint32_t src_addr) +{ +QTestState *s =qtest_init (machine); + +const uint32_t src_addr_1 = src_addr +0x1000000 ; +const uint32_t src_addr_2 = src_addr +0x2000000 ; +const uint32_t src_addr_3 = src_addr +0x3000000 ; +const uint32_t digest_addr = src_addr +0x4000000 ; +uint8_t digest[64 ] = {0 }; +struct AspeedSgList array[] = { + {cpu_to_le32 (sizeof (test_vector_sg1)), +cpu_to_le32 (src_addr_1) }, + {cpu_to_le32 (sizeof (test_vector_sg2)), +cpu_to_le32 (src_addr_2) }, + {cpu_to_le32 (sizeof (test_vector_sg3) |SG_LIST_LEN_LAST ), +cpu_to_le32 (src_addr_3) }, + }; + +/* Check engine is idle, no busy or irq bits set */ + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0); + +/* Write test vector into memory */ +qtest_memwrite (s, src_addr_1, test_vector_sg1,sizeof (test_vector_sg1)); +qtest_memwrite (s, src_addr_2, test_vector_sg2,sizeof (test_vector_sg2)); +qtest_memwrite (s, src_addr_3, test_vector_sg3,sizeof (test_vector_sg3)); +qtest_memwrite (s, src_addr, array,sizeof (array)); + +write_regs (s, base, src_addr, + (sizeof (test_vector_sg1) + +sizeof (test_vector_sg2) + +sizeof (test_vector_sg3)), + digest_addr,HACE_ALGO_SHA512 |HACE_SG_EN ); + +/* Check hash IRQ status is asserted */ + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0x00000200); + +/* Clear IRQ status and check status is deasserted */ +qtest_writel (s, base +HACE_STS ,0x00000200 ); + g_assert_cmphex(qtest_readl(s, base + HACE_STS), ==, 0); + +/* Read computed digest from memory */ +qtest_memread (s, digest_addr, digest,sizeof (digest)); + +/* Check result of computation */ +g_assert_cmpmem (digest,sizeof (digest), + test_result_sg_sha512,sizeof (digest)); + +qtest_quit (s); +} + +struct masks { +uint32_t src; +uint32_t dest; +uint32_t len; +}; + +static const struct masks ast2600_masks = { + .src =0x7fffffff , + .dest =0x7ffffff8 , + .len =0x0fffffff , +}; + +static const struct masks ast2500_masks = { + .src =0x3fffffff , + .dest =0x3ffffff8 , + .len =0x0fffffff , +}; + +static const struct masks ast2400_masks = { + .src =0x0fffffff , + .dest =0x0ffffff8 , + .len =0x0fffffff , +}; + +static void test_addresses (const char *machine,const uint32_t base, +const struct masks *expected) +{ +QTestState *s =qtest_init (machine); + +/* +* Check command mode is zero, meaning engine is in direct access mode, +* as this affects the masking behavior of the HASH_SRC register. +*/ + g_assert_cmphex(qtest_readl(s, base + HACE_CMD), ==, 0); + g_assert_cmphex(qtest_readl(s, base + HACE_HASH_SRC), ==, 0); + g_assert_cmphex(qtest_readl(s, base + HACE_HASH_DIGEST), ==, 0); + g_assert_cmphex(qtest_readl(s, base + HACE_HASH_DATA_LEN), ==, 0); + + +/* Check that the address masking is correct */ +qtest_writel (s, base +HACE_HASH_SRC ,0xffffffff ); + g_assert_cmphex(qtest_readl(s, base + HACE_HASH_SRC), ==, expected->src); + +qtest_writel (s, base +HACE_HASH_DIGEST ,0xffffffff ); + g_assert_cmphex(qtest_readl(s, base + HACE_HASH_DIGEST), ==, expected->dest); + +qtest_writel (s, base +HACE_HASH_DATA_LEN ,0xffffffff ); + g_assert_cmphex(qtest_readl(s, base + HACE_HASH_DATA_LEN), ==, expected->len); + +/* Reset to zero */ +qtest_writel (s, base +HACE_HASH_SRC ,0 ); +qtest_writel (s, base +HACE_HASH_DIGEST ,0 ); +qtest_writel (s, base +HACE_HASH_DATA_LEN ,0 ); + +/* Check that all bits are now zero */ + g_assert_cmphex(qtest_readl(s, base + HACE_HASH_SRC), ==, 0); + g_assert_cmphex(qtest_readl(s, base + HACE_HASH_DIGEST), ==, 0); + g_assert_cmphex(qtest_readl(s, base + HACE_HASH_DATA_LEN), ==, 0); + +qtest_quit (s); +} + +/* ast2600 */ +static void test_md5_ast2600 (void ) +{ +test_md5 ("-machine ast2600-evb" ,0x1e6d0000 ,0x80000000 ); +} + +static void test_sha256_ast2600 (void ) +{ +test_sha256 ("-machine ast2600-evb" ,0x1e6d0000 ,0x80000000 ); +} + +static void test_sha256_sg_ast2600 (void ) +{ +test_sha256_sg ("-machine ast2600-evb" ,0x1e6d0000 ,0x80000000 ); +} + +static void test_sha512_ast2600 (void ) +{ +test_sha512 ("-machine ast2600-evb" ,0x1e6d0000 ,0x80000000 ); +} + +static void test_sha512_sg_ast2600 (void ) +{ +test_sha512_sg ("-machine ast2600-evb" ,0x1e6d0000 ,0x80000000 ); +} + +static void test_addresses_ast2600 (void ) +{ +test_addresses ("-machine ast2600-evb" ,0x1e6d0000 , &ast2600_masks); +} + +/* ast2500 */ +static void test_md5_ast2500 (void ) +{ +test_md5 ("-machine ast2500-evb" ,0x1e6e3000 ,0x80000000 ); +} + +static void test_sha256_ast2500 (void ) +{ +test_sha256 ("-machine ast2500-evb" ,0x1e6e3000 ,0x80000000 ); +} + +static void test_sha512_ast2500 (void ) +{ +test_sha512 ("-machine ast2500-evb" ,0x1e6e3000 ,0x80000000 ); +} + +static void test_addresses_ast2500 (void ) +{ +test_addresses ("-machine ast2500-evb" ,0x1e6e3000 , &ast2500_masks); +} + +/* ast2400 */ +static void test_md5_ast2400 (void ) +{ +test_md5 ("-machine palmetto-bmc" ,0x1e6e3000 ,0x40000000 ); +} + +static void test_sha256_ast2400 (void ) +{ +test_sha256 ("-machine palmetto-bmc" ,0x1e6e3000 ,0x40000000 ); +} + +static void test_sha512_ast2400 (void ) +{ +test_sha512 ("-machine palmetto-bmc" ,0x1e6e3000 ,0x40000000 ); +} + +static void test_addresses_ast2400 (void ) +{ +test_addresses ("-machine palmetto-bmc" ,0x1e6e3000 , &ast2400_masks); +} + +int main (int argc,char **argv) +{ +g_test_init (&argc, &argv,NULL ); + +qtest_add_func ("ast2600/hace/addresses" , test_addresses_ast2600); +qtest_add_func ("ast2600/hace/sha512" , test_sha512_ast2600); +qtest_add_func ("ast2600/hace/sha256" , test_sha256_ast2600); +qtest_add_func ("ast2600/hace/md5" , test_md5_ast2600); + +qtest_add_func ("ast2600/hace/sha512_sg" , test_sha512_sg_ast2600); +qtest_add_func ("ast2600/hace/sha256_sg" , test_sha256_sg_ast2600); + +qtest_add_func ("ast2500/hace/addresses" , test_addresses_ast2500); +qtest_add_func ("ast2500/hace/sha512" , test_sha512_ast2500); +qtest_add_func ("ast2500/hace/sha256" , test_sha256_ast2500); +qtest_add_func ("ast2500/hace/md5" , test_md5_ast2500); + +qtest_add_func ("ast2400/hace/addresses" , test_addresses_ast2400); +qtest_add_func ("ast2400/hace/sha512" , test_sha512_ast2400); +qtest_add_func ("ast2400/hace/sha256" , test_sha256_ast2400); +qtest_add_func ("ast2400/hace/md5" , test_md5_ast2400); + +return g_test_run (); +}
MAINTAINERS +1 -0
@@ -1026,6 +1026,7 @@ F: include/hw/misc/pca9552*.h F: hw/net/ftgmac100.c F: include/hw/net/ftgmac100.h F: docs/system/arm/aspeed.rst +F: tests/qtest/*aspeed* NRF51 M: Joel Stanley <[email protected]>
tests/qtest/meson.build +3 -0
@@ -161,12 +161,15 @@ qtests_npcm7xx = \ 'npcm7xx_timer-test', 'npcm7xx_watchdog_timer-test'] + \ (slirp.found() ? ['npcm7xx_emc-test'] : []) +qtests_aspeed = \ + ['aspeed_hace-test'] qtests_arm = \ (config_all_devices.has_key('CONFIG_MPS2') ? ['sse-timer-test'] : []) + \ (config_all_devices.has_key('CONFIG_CMSDK_APB_DUALTIMER') ? ['cmsdk-apb-dualtimer-test'] : []) + \ (config_all_devices.has_key('CONFIG_CMSDK_APB_TIMER') ? ['cmsdk-apb-timer-test'] : []) + \ (config_all_devices.has_key('CONFIG_CMSDK_APB_WATCHDOG') ? ['cmsdk-apb-watchdog-test'] : []) + \ (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \ + (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) + \ (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \ ['arm-cpu-features', 'microbit-test',
Signature · 1 line
2.26.3
[PULL 09/18] tests/acceptance: Test ast2400 and ast2500 machines
In reply to Cédric Le GoaterFrom: Joel Stanley <[email protected]>
Test MTD images from the OpenBMC project on AST2400 and AST2500 SoCs from ASPEED, by booting Palmetto and Romulus BMC machines.
The images are fetched from OpenBMC's release directory on github.
[ clg : - removed comment
- removed ending self.vm.shutdown() ]
Message-Id: <[email protected]>
Message-Id: <[email protected]>
--- tests/acceptance/boot_linux_console.py | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
tests/acceptance/boot_linux_console.py +43 -0
@@ -1010,6 +1010,49 @@ def test_arm_vexpressa9(self): self.vm.add_args('-dtb', self.workdir + '/day16/vexpress-v2p-ca9.dtb') self.do_test_advcal_2018('16', tar_hash, 'winter.zImage') + def test_arm_ast2400_palmetto_openbmc_v2_9_0(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:palmetto-bmc + """ + + image_url = ('https://github.com/openbmc/openbmc/releases/download/2.9.0/' + 'obmc-phosphor-image-palmetto.static.mtd') + image_hash = ('3e13bbbc28e424865dc42f35ad672b10f2e82cdb11846bb28fa625b48beafd0d') + image_path = self.fetch_asset(image_url, asset_hash=image_hash, + algorithm='sha256') + + self.do_test_arm_aspeed(image_path) + + def test_arm_ast2500_romulus_openbmc_v2_9_0(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:romulus-bmc + """ + + image_url = ('https://github.com/openbmc/openbmc/releases/download/2.9.0/' + 'obmc-phosphor-image-romulus.static.mtd') + image_hash = ('820341076803f1955bc31e647a512c79f9add4f5233d0697678bab4604c7bb25') + image_path = self.fetch_asset(image_url, asset_hash=image_hash, + algorithm='sha256') + + self.do_test_arm_aspeed(image_path) + + def do_test_arm_aspeed(self, image): + self.vm.set_console() + self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw', + '-net', 'nic') + self.vm.launch() + + self.wait_for_console_pattern("U-Boot 2016.07") + self.wait_for_console_pattern("## Loading kernel from FIT Image at 20080000") + self.wait_for_console_pattern("Starting kernel ...") + self.wait_for_console_pattern("Booting Linux on physical CPU 0x0") + self.wait_for_console_pattern( + "aspeed-smc 1e620000.spi: read control register: 203b0641") + self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ") + self.wait_for_console_pattern("systemd[1]: Set hostname to") + def test_m68k_mcf5208evb(self): """ :avocado: tags=arch:m68k
Signature · 1 line
2.26.3
[PULL 02/18] aspeed/smc: Remove unused "sdram-base" property
In reply to Cédric Le GoaterMessage-Id: <[email protected]>
--- include/hw/ssi/aspeed_smc.h | 3 --- hw/arm/aspeed_ast2600.c | 4 ---- hw/arm/aspeed_soc.c | 4 ---- hw/ssi/aspeed_smc.c | 1 - 4 files changed, 12 deletions(-)
include/hw/ssi/aspeed_smc.h +0 -3
@@ -103,9 +103,6 @@ struct AspeedSMCState {uint8_t r_timings;uint8_t conf_enable_w0; -/* for DMA support */ -uint64_t sdram_base; -AddressSpace flash_as;MemoryRegion *dram_mr;AddressSpace dram_as;
hw/arm/aspeed_ast2600.c +0 -4
@@ -344,10 +344,6 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)/* FMC, The number of CS is set at the board level */ object_property_set_link (OBJECT (&s->fmc),"dram" ,OBJECT (s->dram_mr), &error_abort); -if (!object_property_set_int (OBJECT (&s->fmc),"sdram-base" , - sc->memmap[ASPEED_DEV_SDRAM ], errp)) { -return ; - }if (!sysbus_realize (SYS_BUS_DEVICE (&s->fmc), errp)) {return ; }
hw/arm/aspeed_soc.c +0 -4
@@ -301,10 +301,6 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)/* FMC, The number of CS is set at the board level */ object_property_set_link (OBJECT (&s->fmc),"dram" ,OBJECT (s->dram_mr), &error_abort); -if (!object_property_set_int (OBJECT (&s->fmc),"sdram-base" , - sc->memmap[ASPEED_DEV_SDRAM ], errp)) { -return ; - }if (!sysbus_realize (SYS_BUS_DEVICE (&s->fmc), errp)) {return ; }
hw/ssi/aspeed_smc.c +0 -1
@@ -1431,7 +1431,6 @@ static const VMStateDescription vmstate_aspeed_smc = {static Property aspeed_smc_properties[] = {DEFINE_PROP_UINT32 ("num-cs" , AspeedSMCState, num_cs,1 ),DEFINE_PROP_BOOL ("inject-failure" , AspeedSMCState, inject_failure, false), -DEFINE_PROP_UINT64 ("sdram-base" , AspeedSMCState, sdram_base,0 ),DEFINE_PROP_LINK ("dram" , AspeedSMCState, dram_mr, TYPE_MEMORY_REGION, MemoryRegion *),DEFINE_PROP_END_OF_LIST (),
Signature · 1 line
2.26.3
[PULL 05/18] hw/arm/aspeed: Do not sysbus-map mmio flash region directly, use alias
In reply to Cédric Le GoaterFrom: Philippe Mathieu-Daudé <[email protected]>
The flash mmio region is exposed as an AddressSpace. AddressSpaces must not be sysbus-mapped, therefore map the region using an alias.
Message-Id: <[email protected]>
Message-Id: <[email protected]>
--- include/hw/ssi/aspeed_smc.h | 1 + hw/ssi/aspeed_smc.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-)
include/hw/ssi/aspeed_smc.h +1 -0
@@ -84,6 +84,7 @@ struct AspeedSMCState {MemoryRegion mmio;MemoryRegion mmio_flash; +MemoryRegion mmio_flash_alias;qemu_irq irq;int irqline;
hw/ssi/aspeed_smc.c +4 -3
@@ -179,8 +179,7 @@* 0x7FFFFF: 32M bytes */ #define DMA_DRAM_ADDR (s, val) ((val) & (s)->ctrl->dma_dram_mask) -#define DMA_FLASH_ADDR (s, val) ((s)->ctrl->flash_window_base | \ - ((val) & (s)->ctrl->dma_flash_mask)) +#define DMA_FLASH_ADDR (s, val) ((val) & (s)->ctrl->dma_flash_mask)#define DMA_LENGTH (val) ((val) & 0x01FFFFFC)/* Flash opcodes. */
@@ -1385,7 +1384,9 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp)memory_region_init_io (&s->mmio_flash,OBJECT (s), &aspeed_smc_flash_default_ops, s, name, s->ctrl->flash_window_size); -sysbus_init_mmio (sbd, &s->mmio_flash); +memory_region_init_alias (&s->mmio_flash_alias,OBJECT (s), name, + &s->mmio_flash,0 , s->ctrl->flash_window_size); +sysbus_init_mmio (sbd, &s->mmio_flash_alias); s->flashes =g_new0 (AspeedSMCFlash, s->ctrl->max_peripherals);
Signature · 1 line
2.26.3
[PULL 01/18] aspeed/smc: Use the RAM memory region for DMAs
In reply to Cédric Le GoaterInstead of passing the memory address space region, simply use the RAM memory region instead. This simplifies RAM accesses.
This patch breaks migration compatibility.
Message-Id: <[email protected]>
--- hw/arm/aspeed.c | 2 +- hw/ssi/aspeed_smc.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
hw/arm/aspeed.c +1 -1
@@ -327,7 +327,7 @@ static void aspeed_machine_init(MachineState *machine)object_property_set_int (OBJECT (&bmc->soc),"num-cs" , amc->num_cs, &error_abort);object_property_set_link (OBJECT (&bmc->soc),"dram" , -OBJECT (&bmc->ram_container), &error_abort); +OBJECT (machine->ram), &error_abort);if (machine->kernel_filename) {/* * When booting with a -kernel command line there is no u-boot
hw/ssi/aspeed_smc.c +1 -2
@@ -178,8 +178,7 @@* 0: 4 bytes * 0x7FFFFF: 32M bytes */ -#define DMA_DRAM_ADDR (s, val) ((s)->sdram_base | \ - ((val) & (s)->ctrl->dma_dram_mask)) +#define DMA_DRAM_ADDR (s, val) ((val) & (s)->ctrl->dma_dram_mask)#define DMA_FLASH_ADDR (s, val) ((s)->ctrl->flash_window_base | \ ((val) & (s)->ctrl->dma_flash_mask))#define DMA_LENGTH (val) ((val) & 0x01FFFFFC)
Signature · 1 line
2.26.3
[PULL 07/18] aspeed: Integrate HACE
In reply to Cédric Le GoaterFrom: Joel Stanley <[email protected]>
Add the hash and crypto engine model to the Aspeed socs.
Message-Id: <[email protected]>
--- docs/system/arm/aspeed.rst | 1 - include/hw/arm/aspeed_soc.h | 3 +++ hw/arm/aspeed_ast2600.c | 15 +++++++++++++++ hw/arm/aspeed_soc.c | 16 ++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-)
docs/system/arm/aspeed.rst +0 -1
@@ -60,7 +60,6 @@ Missing devices * PWM and Fan Controller * Slave GPIO Controller * Super I/O Controller - * Hash/Crypto Engine * PCI-Express 1 Controller * Graphic Display Controller * PECI Controller
include/hw/arm/aspeed_soc.h +3 -0
@@ -21,6 +21,7 @@#include "hw/rtc/aspeed_rtc.h" #include "hw/i2c/aspeed_i2c.h" #include "hw/ssi/aspeed_smc.h" +#include "hw/misc/aspeed_hace.h" #include "hw/watchdog/wdt_aspeed.h" #include "hw/net/ftgmac100.h" #include "target/arm/cpu.h"
@@ -50,6 +51,7 @@ struct AspeedSoCState {AspeedTimerCtrlState timerctrl;AspeedI2CState i2c;AspeedSCUState scu; +AspeedHACEState hace;AspeedXDMAState xdma;AspeedSMCState fmc;AspeedSMCState spi[ASPEED_SPIS_NUM ];
@@ -133,6 +135,7 @@ enum {ASPEED_DEV_XDMA ,ASPEED_DEV_EMMC ,ASPEED_DEV_KCS , + ASPEED_DEV_HACE, };#endif /* ASPEED_SOC_H */
hw/arm/aspeed_ast2600.c +15 -0
@@ -42,6 +42,7 @@ static const hwaddr aspeed_soc_ast2600_memmap[] = { [ASPEED_DEV_ETH2] = 0x1E680000, [ASPEED_DEV_ETH4] = 0x1E690000, [ASPEED_DEV_VIC] = 0x1E6C0000, + [ASPEED_DEV_HACE] = 0x1E6D0000, [ASPEED_DEV_SDMC] = 0x1E6E0000, [ASPEED_DEV_SCU] = 0x1E6E2000, [ASPEED_DEV_XDMA] = 0x1E6E7000,
@@ -102,6 +103,7 @@ static const int aspeed_soc_ast2600_irqmap[] = { [ASPEED_DEV_I2C] = 110, /* 110 -> 125 */ [ASPEED_DEV_ETH1] = 2, [ASPEED_DEV_ETH2] = 3, + [ASPEED_DEV_HACE] = 4, [ASPEED_DEV_ETH3] = 32, [ASPEED_DEV_ETH4] = 33, [ASPEED_DEV_KCS] = 138, /* 138 -> 142 */
@@ -213,6 +215,9 @@ static void aspeed_soc_ast2600_init(Object *obj) TYPE_SYSBUS_SDHCI);object_initialize_child (obj,"lpc" , &s->lpc,TYPE_ASPEED_LPC ); + +snprintf (typename,sizeof (typename),"aspeed.hace-%s" , socname); +object_initialize_child (obj,"hace" , &s->hace, typename); }/*
@@ -494,6 +499,16 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)sysbus_connect_irq (SYS_BUS_DEVICE (&s->lpc),1 + aspeed_lpc_kcs_4,qdev_get_gpio_in (DEVICE (&s->a7mpcore), sc->irqmap[ASPEED_DEV_KCS ] + aspeed_lpc_kcs_4)); + +/* HACE */ +object_property_set_link (OBJECT (&s->hace),"dram" ,OBJECT (s->dram_mr), + &error_abort); +if (!sysbus_realize (SYS_BUS_DEVICE (&s->hace), errp)) { +return ; + } +sysbus_mmio_map (SYS_BUS_DEVICE (&s->hace),0 , sc->memmap[ASPEED_DEV_HACE ]); +sysbus_connect_irq (SYS_BUS_DEVICE (&s->hace),0 , +aspeed_soc_get_irq (s,ASPEED_DEV_HACE )); }static void aspeed_soc_ast2600_class_init (ObjectClass *oc,void *data)
hw/arm/aspeed_soc.c +16 -0
@@ -34,6 +34,7 @@ static const hwaddr aspeed_soc_ast2400_memmap[] = { [ASPEED_DEV_VIC] = 0x1E6C0000, [ASPEED_DEV_SDMC] = 0x1E6E0000, [ASPEED_DEV_SCU] = 0x1E6E2000, + [ASPEED_DEV_HACE] = 0x1E6E3000, [ASPEED_DEV_XDMA] = 0x1E6E7000, [ASPEED_DEV_VIDEO] = 0x1E700000, [ASPEED_DEV_ADC] = 0x1E6E9000,
@@ -65,6 +66,7 @@ static const hwaddr aspeed_soc_ast2500_memmap[] = { [ASPEED_DEV_VIC] = 0x1E6C0000, [ASPEED_DEV_SDMC] = 0x1E6E0000, [ASPEED_DEV_SCU] = 0x1E6E2000, + [ASPEED_DEV_HACE] = 0x1E6E3000, [ASPEED_DEV_XDMA] = 0x1E6E7000, [ASPEED_DEV_ADC] = 0x1E6E9000, [ASPEED_DEV_VIDEO] = 0x1E700000,
@@ -117,6 +119,7 @@ static const int aspeed_soc_ast2400_irqmap[] = { [ASPEED_DEV_ETH2] = 3, [ASPEED_DEV_XDMA] = 6, [ASPEED_DEV_SDHCI] = 26, + [ASPEED_DEV_HACE] = 4, };#define aspeed_soc_ast2500_irqmap aspeed_soc_ast2400_irqmap
@@ -212,6 +215,9 @@ static void aspeed_soc_init(Object *obj) }object_initialize_child (obj,"lpc" , &s->lpc,TYPE_ASPEED_LPC ); + +snprintf (typename,sizeof (typename),"aspeed.hace-%s" , socname); +object_initialize_child (obj,"hace" , &s->hace, typename); }static void aspeed_soc_realize (DeviceState *dev,Error **errp)
@@ -421,6 +427,16 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)sysbus_connect_irq (SYS_BUS_DEVICE (&s->lpc),1 + aspeed_lpc_kcs_4,qdev_get_gpio_in (DEVICE (&s->lpc), aspeed_lpc_kcs_4)); + +/* HACE */ +object_property_set_link (OBJECT (&s->hace),"dram" ,OBJECT (s->dram_mr), + &error_abort); +if (!sysbus_realize (SYS_BUS_DEVICE (&s->hace), errp)) { +return ; + } +sysbus_mmio_map (SYS_BUS_DEVICE (&s->hace),0 , sc->memmap[ASPEED_DEV_HACE ]); +sysbus_connect_irq (SYS_BUS_DEVICE (&s->hace),0 , +aspeed_soc_get_irq (s,ASPEED_DEV_HACE )); }static Property aspeed_soc_properties[] = { DEFINE_PROP_LINK("dram", AspeedSoCState, dram_mr, TYPE_MEMORY_REGION,
Signature · 1 line
2.26.3
Peter,
Quoted 15 lines · Cédric Le Goater
The following changes since commit
609d7596524ab204ccd71ef42c9eee4c7c338ea4:Update version for v6.0.0 release (2021-04-29 18:05:29 +0100)
are available in the Git repository at:
https://github.com/legoater/qemu/ tags/pull-aspeed-20210430
for you to fetch changes up to
1401dcd8aac9039797b995bfab078877a820c9c5:aspeed: Add support for the quanta-q7l1-bmc board (2021-04-30 10:30:42 +0200)
----------------------------------------------------------------
Aspeed patches :
Quoted 6 lines
* Fixes for the DMA space
* New model for ASPEED's Hash and Crypto Engine (Joel and Klaus)
* Acceptance tests (Joel)
* A fix for the XDMA model
* Some extra features for the SMC controller.
* Two new boards : rainier-bmc and quanta-q7l1-bmc (Patrick)
I sent the patchset in two rounds: 0-9 and 10-18, so the threading is broken :/ Sorry about that.
Thanks,
C.
Quoted 16 lines · Cédric Le Goater
The following changes since commit
609d7596524ab204ccd71ef42c9eee4c7c338ea4:Update version for v6.0.0 release (2021-04-29 18:05:29 +0100)
are available in the Git repository at:
https://github.com/legoater/qemu/ tags/pull-aspeed-20210430
for you to fetch changes up to
1401dcd8aac9039797b995bfab078877a820c9c5:aspeed: Add support for the quanta-q7l1-bmc board (2021-04-30 10:30:42 +0200)
----------------------------------------------------------------
Aspeed patches :
Quoted 7 lines
* Fixes for the DMA space
* New model for ASPEED's Hash and Crypto Engine (Joel and Klaus)
* Acceptance tests (Joel)
* A fix for the XDMA model
* Some extra features for the SMC controller.
* Two new boards : rainier-bmc and quanta-q7l1-bmc (Patrick)
Fails to build, OSX:
../../hw/misc/aspeed_hace.c:128:49: error: incompatible pointer types passing 'size_t *' (aka 'unsigned long *') to parameter of type 'hwaddr *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
&iov[i].iov_len, false,
^~~~~~~~~~~~~~~
/Users/pm215/src/qemu-for-merges/include/exec/memory.h:2439:33: note:
passing argument to parameter 'plen' here
hwaddr *plen, bool is_write, MemTxAttrs attrs);
^1 error generated.
(OpenBSD reports the same, but there it is only a warning.)
Same thing is also a build failure on 32-bit hosts (where the types are genuinely different sizes):
../../hw/misc/aspeed_hace.c: In function 'do_hash_operation':../../hw/misc/aspeed_hace.c:128:49: error: passing argument 3 of 'address_space_map' from incompatible pointer type [-Werror=incompatible-pointer-types]
&iov[i].iov_len, false,
^
In file included from /home/peter.maydell/qemu/include/hw/sysbus.h:7:0,
from /home/peter.maydell/qemu/include/hw/misc/aspeed_hace.h:12,
from ../../hw/misc/aspeed_hace.c:14:/home/peter.maydell/qemu/include/exec/memory.h:2438:7: note: expected 'hwaddr * {aka long long unsigned int *}' but argument is of type 'size_t * {aka unsigned int *}'
void *address_space_map(AddressSpace *as, hwaddr addr,
^~~~~~~~~~~~~~~~~
thanks
-- PMM
Quoted 12 lines · Peter Maydell
Same thing is also a build failure on 32-bit hosts (where the types are genuinely different sizes):
../../hw/misc/aspeed_hace.c: In function 'do_hash_operation':../../hw/misc/aspeed_hace.c:128:49: error: passing argument 3 of 'address_space_map' from incompatible pointer type [-Werror=incompatible-pointer-types]&iov[i].iov_len, false, ^ In file included from /home/peter.maydell/qemu/include/hw/sysbus.h:7:0, from /home/peter.maydell/qemu/include/hw/misc/aspeed_hace.h:12, from ../../hw/misc/aspeed_hace.c:14:
Quoted 5 lines
/home/peter.maydell/qemu/include/exec/memory.h:2438:7: note: expected 'hwaddr * {aka long long unsigned int *}' but argument is of type 'size_t* {aka unsigned int *}'
void *address_space_map(AddressSpace *as, hwaddr addr,^~~~~~~~~~~~~~~~~
If you like you can repro this on the gitlab CI where we have cross-build jobs for the 32-bit targets, eg:
https://gitlab.com/qemu-project/qemu/-/jobs/1227559504
-- PMM
Quoted 19 lines · Peter Maydell
Quoted 12 lines · Peter Maydell
Same thing is also a build failure on 32-bit hosts (where the types are genuinely different sizes):
../../hw/misc/aspeed_hace.c: In function 'do_hash_operation':../../hw/misc/aspeed_hace.c:128:49: error: passing argument 3 of 'address_space_map' from incompatible pointer type [-Werror=incompatible-pointer-types]&iov[i].iov_len, false, ^ In file included from /home/peter.maydell/qemu/include/hw/sysbus.h:7:0, from /home/peter.maydell/qemu/include/hw/misc/aspeed_hace.h:12, from ../../hw/misc/aspeed_hace.c:14:Quoted 5 lines
/home/peter.maydell/qemu/include/exec/memory.h:2438:7: note: expected 'hwaddr * {aka long long unsigned int *}' but argument is of type 'size_t* {aka unsigned int *}'
void *address_space_map(AddressSpace *as, hwaddr addr,^~~~~~~~~~~~~~~~~
Quoted 3 lines
If you like you can repro this on the gitlab CI where we have cross-build jobs for the 32-bit targets, eg:
https://gitlab.com/qemu-project/qemu/-/jobs/1227559504
Yes. It is time for me to migrate. I will send a fixed v2 when this is done.
Thanks,
C.