aspeed queue
Subsystems (2)
The following changes since commit 28a6ca268c2cd3718b5bf24c2d97e3d1e95fc604:
Merge tag 'single-binary-20260203' of https://github.com/philmd/qemu into staging (2026-02-04 01:57:26 +1000)
are available in the Git repository at:
https://github.com/legoater/qemu/ tags/pull-aspeed-20260204
for you to fetch changes up to e56e45d5bdc808ed52f943d1a785e4d885b6f18f:
tests/functional/aarch64: Add I2C test for AST1700 IO expanders (2026-02-04 10:10:57 +0100)
----------------------------------------------------------------
aspeed queue:
* Added support for the new AST1700 IO expander, including several device models (LTPI, PWM, I2C, GPIO, etc.).
* Updated the AST2700 SoC with LTPI support, EHCI IRQ fixes, and other improvements.
* Updated test images and test cases for various Aspeed platforms.
* Fixed issues in the Aspeed I2C and ADC models.
* Added support for pca9535 GPIO expander.
* Updated documentation for Aspeed boards.
----------------------------------------------------------------
Cédric Le Goater (3):
Merge tag 'pull-vbootrom-20260116-v3' into aspeed-next tests/functional/arm/aspeed: Update buildroot images to 2025.11 hw/adc: Fix out-of-bounds write in Aspeed ADC model
Jamin Lin (17):
pc-bios: Update vbootrom image to commit 1c8e9510b22c
MAINTAINERS: Update ASPEED entry tests/functional/arm/test_aspeed_ast2500: Update test ASPEED SDK v10.00 hw/pci-host/aspeed_pcie: Drop AST2600 PCIe root device hw/pci-host/aspeed_pcie: Drop AST2600 RC_H root-bus remap and bus-nr property hw/arm/aspeed_ast2600: Expand RC_H PCIe MMIO window to 0x60000000 - 0x80000000 tests/functional/arm/test_aspeed_ast2600_sdk: Update test ASPEED SDK v11.00 tests/functional/arm/test_aspeed_ast1060: Update test aspeed-zephyr-project v03.04 tests/functional/arm/test_aspeed_ast1030: Update test ASPEED Zephyr SDK v03.05 hw/arm/aspeed_ast27x0: Fix EHCI3/4 IRQ routing to GIC hw/arm/aspeed_ast27x0: Sort SSP and TSP memmap tables by address hw/arm/aspeed_ast27x0: Sort SSP and TSP IRQ maps
hw/i2c/aspeed_i2c: Fix DMA moving data into incorrect address tests/functional/aarch64/test_aspeed_ast2700: Enable PCIe2 DTS status for AST2700 tests tests/functional/aarch64/test_aspeed_ast2700: Update test ASPEED SDK v11.00 for A1 tests/functional/aarch64/test_aspeed_ast2700fc: Update test ASPEED SDK v11.00 for A1 docs/system/arm/aspeed: Load raw U-Boot image in AST2700 boot example
Kane Chen (22):
hw/misc: Add LTPI controller
hw/arm/aspeed: Attach LTPI controller to AST27X0 platform hw/misc: Add basic Aspeed PWM model
hw/arm/aspeed: Add AST1700 LTPI expander device model hw/arm/aspeed: Integrate AST1700 device into AST27X0 hw/arm/aspeed: Integrate interrupt controller for AST1700 hw/arm/aspeed: Attach LTPI controller to AST1700 model hw/arm/aspeed: Attach UART device to AST1700 model hw/arm/aspeed: Attach SRAM device to AST1700 model hw/arm/aspeed: Attach SPI device to AST1700 model hw/arm/aspeed: Attach ADC device to AST1700 model hw/arm/aspeed: Attach SCU device to AST1700 model hw/arm/aspeed: Attach GPIO device to AST1700 model hw/arm/aspeed: attach I2C device to AST1700 model hw/arm/aspeed: Attach WDT device to AST1700 model hw/arm/aspeed: Attach PWM device to AST1700 model hw/arm/aspeed: Attach SGPIOM device to AST1700 model hw/arm/aspeed: Model AST1700 I3C block as unimplemented device hw/arm/aspeed: Enable AST1700 IO expander support tests/functional/aarch64: Parameterize I2C bus ID in AST2700 test tests/functional/aarch64: Parameterize PCIe2 initialization in AST2700 tests/functional/aarch64: Add I2C test for AST1700 IO expanders
Kane-Chen-AS (1):
hw/i2c/aspeed: Introduce 'bus-label' to customize bus naming
Nabih Estefan (1):
hw/i2c/aspeed_i2c.c: Add a check for dma_read
Patrick Williams (2):
hw/gpio/pca9552: add pca9535 support
hw/arm/aspeed: catalina: use pca9535
MAINTAINERS | 2 + docs/system/arm/aspeed.rst | 8 +- include/hw/arm/aspeed_ast1700.h | 54 ++++ include/hw/arm/aspeed_soc.h | 25 +- include/hw/gpio/pca9552.h | 1 + include/hw/gpio/pca9552_regs.h | 10 + include/hw/i2c/aspeed_i2c.h | 2 + include/hw/intc/aspeed_intc.h | 2 + include/hw/misc/aspeed_ltpi.h | 33 +++ include/hw/misc/aspeed_pwm.h | 30 +++ include/hw/pci-host/aspeed_pcie.h | 11 - hw/adc/aspeed_adc.c | 3 +- hw/arm/aspeed_ast1700.c | 276 +++++++++++++++++++++ hw/arm/aspeed_ast2600.c | 8 +- hw/arm/aspeed_ast2600_catalina.c | 4 +- hw/arm/aspeed_ast27x0-ssp.c | 14 +- hw/arm/aspeed_ast27x0-tsp.c | 14 +- hw/arm/aspeed_ast27x0.c | 169 ++++++++++++- hw/gpio/pca9552.c | 176 +++++++++---- hw/i2c/aspeed_i2c.c | 120 ++++++--- hw/intc/aspeed_intc.c | 60 +++++ hw/misc/aspeed_ltpi.c | 193 ++++++++++++++ hw/misc/aspeed_pwm.c | 120 +++++++++ hw/pci-host/aspeed_pcie.c | 76 +----- hw/arm/meson.build | 1 + hw/misc/meson.build | 2 + hw/misc/trace-events | 4 + pc-bios/ast27x0_bootrom.bin | Bin 16408 -> 28564 bytes pc-bios/npcm7xx_bootrom.bin | Bin 672 -> 736 bytes pc-bios/npcm8xx_bootrom.bin | Bin 672 -> 672 bytes roms/vbootrom | 2 +- tests/functional/aarch64/test_aspeed_ast2700.py | 137 ++++++---- tests/functional/aarch64/test_aspeed_ast2700fc.py | 54 ++-- tests/functional/arm/test_aspeed_ast1030.py | 12 +- tests/functional/arm/test_aspeed_ast1060.py | 14 +- tests/functional/arm/test_aspeed_ast2500.py | 16 +- .../arm/test_aspeed_ast2600_buildroot.py | 8 +- tests/functional/arm/test_aspeed_ast2600_sdk.py | 22 +- 38 files changed, 1352 insertions(+), 331 deletions(-) create mode 100644 include/hw/arm/aspeed_ast1700.h create mode 100644 include/hw/misc/aspeed_ltpi.h create mode 100644 include/hw/misc/aspeed_pwm.h create mode 100644 hw/arm/aspeed_ast1700.c create mode 100644 hw/misc/aspeed_ltpi.c create mode 100644 hw/misc/aspeed_pwm.c
[PULL 02/45] tests/functional/arm/aspeed: Update buildroot images to 2025.11
The main changes compared to upstream 2025.11 buildroot are
- Linux v6.18
- latest OpenBMC U-Boot
- extra packages (ssh, etc.)
See
https://github.com/legoater/buildroot/commits/aspeed-2025.11
--- tests/functional/arm/test_aspeed_ast2500.py | 8 ++++---- tests/functional/arm/test_aspeed_ast2600_buildroot.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
tests/functional/arm/test_aspeed_ast2500.py +4 -4
@@ -10,15 +10,15 @@ class AST2500Machine(AspeedTest): - ASSET_BR2_202411_AST2500_FLASH = Asset( + ASSET_BR2_202511_AST2500_FLASH = Asset( ('https://github.com/legoater/qemu-aspeed-boot/raw/master/' - 'images/ast2500-evb/buildroot-2024.11/flash.img'), - '641e6906c18c0f19a2aeb48099d66d4771929c361001d554d0d45c667413e13a') + 'images/ast2500-evb/buildroot-2025.11/flash.img'), + '31e5a8e280b982fb0e7c07eb71c94851002f99ac604dfe620e71a5d47cc87e78') def test_arm_ast2500_evb_buildroot(self): self.set_machine('ast2500-evb') - image_path = self.ASSET_BR2_202411_AST2500_FLASH.fetch() + image_path = self.ASSET_BR2_202511_AST2500_FLASH.fetch() self.vm.add_args('-device', 'tmp105,bus=aspeed.i2c.bus.3,address=0x4d,id=tmp-test')
tests/functional/arm/test_aspeed_ast2600_buildroot.py +4 -4
@@ -16,15 +16,15 @@ class AST2600Machine(AspeedTest): - ASSET_BR2_202411_AST2600_FLASH = Asset( + ASSET_BR2_202511_AST2600_FLASH = Asset( ('https://github.com/legoater/qemu-aspeed-boot/raw/master/' - 'images/ast2600-evb/buildroot-2024.11/flash.img'), - '4bb2f3dfdea31199b51d66b42f686dc5374c144a7346fdc650194a5578b73609') + 'images/ast2600-evb/buildroot-2025.11/flash.img'), + 'c64a0755501393d570ca318e326e1e9f8372edc5a6452cdccc3649bc9fd2c138') def test_arm_ast2600_evb_buildroot(self): self.set_machine('ast2600-evb') - image_path = self.ASSET_BR2_202411_AST2600_FLASH.fetch() + image_path = self.ASSET_BR2_202511_AST2600_FLASH.fetch() self.vm.add_args('-device', 'tmp105,bus=aspeed.i2c.bus.3,address=0x4d,id=tmp-test')
Signature · 1 line
2.52.0
[PULL 05/45] hw/i2c/aspeed_i2c.c: Add a check for dma_read
In reply to Cédric Le GoaterFrom: Nabih Estefan <[email protected]>
If aspeed_i2c_dma_read fails in aspeed_i2c_bus_send currently, we get stuck in an infinite retry loop. Add a check for the return value of aspeed_i2c_dma_read that will break us out of said loop.
--- hw/i2c/aspeed_i2c.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
hw/i2c/aspeed_i2c.c +5 -1
@@ -272,7 +272,11 @@ static int aspeed_i2c_bus_send(AspeedI2CBus *bus) }while (bus->regs[reg_dma_len]) {uint8_t data; -aspeed_i2c_dma_read (bus, &data); + ret =aspeed_i2c_dma_read (bus, &data); +/* Check that we were able to read the DMA */ +if (ret) { +break ; + }trace_aspeed_i2c_bus_send ("DMA" , bus->regs[reg_dma_len], bus->regs[reg_dma_len], data); ret =i2c_send (bus->bus, data);
Signature · 1 line
2.52.0
[PULL 04/45] MAINTAINERS: Update ASPEED entry
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
--- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
@@ -1249,11 +1249,13 @@ F: hw/net/ftgmac100.c F: include/hw/net/ftgmac100.h F: docs/system/arm/aspeed.rst F: docs/system/arm/fby35.rst +F: docs/specs/aspeed* F: tests/functional/*/*aspeed* F: tests/*/*aspeed* F: tests/*/*ast2700* F: hw/arm/fby35.c F: pc-bios/ast27x0_bootrom.bin +F: roms/vbootrom NRF51 M: Joel Stanley <[email protected]>
Signature · 1 line
2.52.0
[PULL 10/45] hw/pci-host/aspeed_pcie: Drop AST2600 PCIe root device
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
AST2600 PCIe previously exposed a root bus at 0x80 with both a root device at 80:00.0 and a root port at 80:08.0.
Recent ASPEED SDK PCIe driver updates decided to remove the root device and keep only a single root port. This behavior has already been accepted by the upstream Linux kernel.
Update the QEMU PCIe model accordingly by dropping the root device implementation and related properties. AST2600 now matches the AST2700 PCIe topology and no longer supports the legacy RC_L layout.
--- include/hw/pci-host/aspeed_pcie.h | 9 ----- hw/pci-host/aspeed_pcie.c | 57 ------------------------------- 2 files changed, 66 deletions(-)
include/hw/pci-host/aspeed_pcie.h +0 -9
@@ -50,13 +50,6 @@ typedef struct AspeedPCIERootPortState {PCIESlot parent_obj; } AspeedPCIERootPortState; -#define TYPE_ASPEED_PCIE_ROOT_DEVICE "aspeed.pcie-root-device" -OBJECT_DECLARE_SIMPLE_TYPE (AspeedPCIERootDeviceState,ASPEED_PCIE_ROOT_DEVICE ); - -struct AspeedPCIERootDeviceState { -PCIBridge parent_obj; -}; -#define TYPE_ASPEED_PCIE_RC "aspeed.pcie-rc"OBJECT_DECLARE_SIMPLE_TYPE (AspeedPCIERcState,ASPEED_PCIE_RC );
@@ -78,10 +71,8 @@ struct AspeedPCIERcState {uint32_t rp_addr;uint32_t bus_nr;char name[16 ]; -bool has_rd;qemu_irq irq; -AspeedPCIERootDeviceState root_device;AspeedPCIERootPortState root_port; };
hw/pci-host/aspeed_pcie.c +0 -57
99 lines not on this page · raw message
Signature · 1 line
2.52.0
[PULL 07/45] hw/arm/aspeed: catalina: use pca9535
In reply to Cédric Le GoaterFrom: Patrick Williams <[email protected]>
A few entries in the catalina model were using the PCA9552 chip because it was "close enough" in function. Since there is a PCA9535 model now, switch to use it.
--- hw/arm/aspeed_ast2600_catalina.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/arm/aspeed_ast2600_catalina.c +2 -2
@@ -480,7 +480,7 @@ static void catalina_bmc_i2c_init(AspeedMachineState *bmc)/* i2c0mux1ch1 */ /* io_expander7 - pca9535@20 */ i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,1 ), -TYPE_PCA9552 ,0x20 ); +TYPE_PCA9535 ,0x20 );/* eeprom@50 */ at24c_eeprom_init_rom (pca954x_i2c_get_bus (i2c_mux,1 ),0x50 ,8 * KiB, gb200io_eeprom, gb200io_eeprom_len);
@@ -497,7 +497,7 @@ static void catalina_bmc_i2c_init(AspeedMachineState *bmc)/* i2c0mux4ch1 */ /* io_expander8 - pca9535@21 */ i2c_slave_create_simple (pca954x_i2c_get_bus (i2c_mux,1 ), -TYPE_PCA9552 ,0x21 ); +TYPE_PCA9535 ,0x21 );/* eeprom@50 */ at24c_eeprom_init_rom (pca954x_i2c_get_bus (i2c_mux,1 ),0x50 ,8 * KiB, gb200io_eeprom, gb200io_eeprom_len);
Signature · 1 line
2.52.0
[PULL 06/45] hw/gpio/pca9552: add pca9535 support
In reply to Cédric Le GoaterFrom: Patrick Williams <[email protected]>
Extend the 16-bit PCA9552 model to support non-LED devices such as the PCA9535[1].
[1]: https://www.ti.com/lit/ds/symlink/pca9535.pdf
--- include/hw/gpio/pca9552.h | 1 + include/hw/gpio/pca9552_regs.h | 10 ++ hw/gpio/pca9552.c | 176 +++++++++++++++++++++++---------- 3 files changed, 133 insertions(+), 54 deletions(-)
include/hw/gpio/pca9552.h +1 -0
@@ -14,6 +14,7 @@#define TYPE_PCA9552 "pca9552"#define TYPE_PCA955X "pca955x" +#define TYPE_PCA9535 "pca9535"typedef struct PCA955xState PCA955xState ;DECLARE_INSTANCE_CHECKER (PCA955xState,PCA955X ,TYPE_PCA955X )
include/hw/gpio/pca9552_regs.h +10 -0
@@ -29,4 +29,14 @@*/ #define PCA9552_AUTOINC (1 << 4) +/* PCA9535 Registers (same addresses, different semantics) */ +#define PCA9535_INPUT0 0/* read only input register 0 */ +#define PCA9535_INPUT1 1/* read only input register 1 */ +#define PCA9535_OUTPUT0 2/* read/write output register 0 */ +#define PCA9535_OUTPUT1 3/* read/write output register 1 */ +#define PCA9535_POLARITY0 4/* read/write polarity inversion register 0 */ +#define PCA9535_POLARITY1 5/* read/write polarity inversion register 1 */ +#define PCA9535_CONFIG0 6/* read/write configuration register 0 */ +#define PCA9535_CONFIG1 7/* read/write configuration register 1 */ +#endif
hw/gpio/pca9552.c +122 -54
234 lines not on this page · raw message
Signature · 1 line
2.52.0
[PULL 19/45] hw/i2c/aspeed_i2c: Fix DMA moving data into incorrect address
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
In the previous design, the I2C model updated dma_dram_offset only when firmware programmed the RX/TX DMA buffer address registers. The firmware used to rewrite these registers before issuing each DMA command.
The firmware driver behavior has changed to program the DMA address registers only once during I2C initialization. As a result, the I2C model no longer refreshes dma_dram_offset, causing DMA to move data into an incorrect DRAM address.
Fix this by introducing helper functions to update dma_dram_offset from the DMA address registers, and invoke them right before handling TX/RX DMA operations. This guarantees DMA always uses the correct buffer address even if the registers are programmed only once.
--- hw/i2c/aspeed_i2c.c | 87 +++++++++++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 26 deletions(-)
hw/i2c/aspeed_i2c.c +61 -26
@@ -116,8 +116,6 @@ static uint64_t aspeed_i2c_bus_old_read(AspeedI2CBus *bus, hwaddr offset, value =-1 ;break ; } - - value =extract64 (bus->dma_dram_offset,0 ,32 );break ;case A_I2CD_DMA_LEN :if (!aic->has_dma) {
@@ -221,6 +219,64 @@ static uint8_t aspeed_i2c_get_state(AspeedI2CBus *bus)return SHARED_ARRAY_FIELD_EX32 (bus->regs,R_I2CD_CMD ,TX_STATE ); } +/* +* The AST2700 support the maximum DRAM size is 8 GB. +* The DRAM offset range is from 0x0_0000_0000 to +* 0x1_FFFF_FFFF and it is enough to use bits [33:0] +* saving the dram offset. +* Therefore, save the high part physical address bit[1:0] +* of Tx/Rx buffer address as dma_dram_offset bit[33:32]. +*/ +static void aspeed_i2c_set_tx_dma_dram_offset (AspeedI2CBus *bus) +{ +AspeedI2CClass *aic =ASPEED_I2C_GET_CLASS (bus->controller); +uint32_t value; + +assert (aic->has_dma); + +if (aspeed_i2c_is_new_mode (bus->controller)) { + value = bus->regs[R_I2CM_DMA_TX_ADDR ]; + bus->dma_dram_offset = +deposit64 (bus->dma_dram_offset,0 ,32 , +FIELD_EX32 (value,I2CM_DMA_TX_ADDR ,ADDR )); +if (!aic->has_dma64) { + value = bus->regs[R_I2CM_DMA_TX_ADDR_HI ]; + bus->dma_dram_offset = +deposit64 (bus->dma_dram_offset,32 ,32 , +extract32 (value,0 ,2 )); + } + }else { + value = bus->regs[R_I2CD_DMA_ADDR ]; + bus->dma_dram_offset =deposit64 (bus->dma_dram_offset,0 ,32 , + value &0x3ffffffc ); + } +} + +static void aspeed_i2c_set_rx_dma_dram_offset (AspeedI2CBus *bus) +{ +AspeedI2CClass *aic =ASPEED_I2C_GET_CLASS (bus->controller); +uint32_t value; + +assert (aic->has_dma); + +if (aspeed_i2c_is_new_mode (bus->controller)) { + value = bus->regs[R_I2CM_DMA_RX_ADDR ]; + bus->dma_dram_offset = +deposit64 (bus->dma_dram_offset,0 ,32 , +FIELD_EX32 (value,I2CM_DMA_RX_ADDR ,ADDR )); +if (!aic->has_dma64) { + value = bus->regs[R_I2CM_DMA_RX_ADDR_HI ]; + bus->dma_dram_offset = +deposit64 (bus->dma_dram_offset,32 ,32 , +extract32 (value,0 ,2 )); + } + }else { + value = bus->regs[R_I2CD_DMA_ADDR ]; + bus->dma_dram_offset =deposit64 (bus->dma_dram_offset,0 ,32 , + value &0x3ffffffc ); + } +} +static int aspeed_i2c_dma_read (AspeedI2CBus *bus,uint8_t *data) {MemTxResult result;
@@ -270,6 +326,7 @@ static int aspeed_i2c_bus_send(AspeedI2CBus *bus)if (aspeed_i2c_is_new_mode (bus->controller)) {ARRAY_FIELD_DP32 (bus->regs,I2CM_DMA_LEN_STS ,TX_LEN ,0 ); } +aspeed_i2c_set_tx_dma_dram_offset (bus);while (bus->regs[reg_dma_len]) {uint8_t data; ret =aspeed_i2c_dma_read (bus, &data);
@@ -335,6 +392,7 @@ static void aspeed_i2c_bus_recv(AspeedI2CBus *bus)ARRAY_FIELD_DP32 (bus->regs,I2CM_DMA_LEN_STS ,RX_LEN ,0 ); } +aspeed_i2c_set_rx_dma_dram_offset (bus);while (bus->regs[reg_dma_len]) {MemTxResult result;
@@ -401,6 +459,7 @@ static uint8_t aspeed_i2c_get_addr(AspeedI2CBus *bus) }else if (SHARED_ARRAY_FIELD_EX32 (bus->regs, reg_cmd,TX_DMA_EN )) {uint8_t data; +aspeed_i2c_set_tx_dma_dram_offset (bus);aspeed_i2c_dma_read (bus, &data);return data; }else {
@@ -657,16 +716,10 @@ static void aspeed_i2c_bus_new_write(AspeedI2CBus *bus, hwaddr offset,case A_I2CM_DMA_TX_ADDR : bus->regs[R_I2CM_DMA_TX_ADDR ] =FIELD_EX32 (value,I2CM_DMA_TX_ADDR ,ADDR ); - bus->dma_dram_offset = -deposit64 (bus->dma_dram_offset,0 ,32 , -FIELD_EX32 (value,I2CM_DMA_TX_ADDR ,ADDR ));break ;case A_I2CM_DMA_RX_ADDR : bus->regs[R_I2CM_DMA_RX_ADDR ] =FIELD_EX32 (value,I2CM_DMA_RX_ADDR ,ADDR ); - bus->dma_dram_offset = -deposit64 (bus->dma_dram_offset,0 ,32 , -FIELD_EX32 (value,I2CM_DMA_RX_ADDR ,ADDR ));break ;case A_I2CM_DMA_LEN : w1t = FIELD_EX32(value, I2CM_DMA_LEN, RX_BUF_LEN_W1T) ||
@@ -748,15 +801,6 @@ static void aspeed_i2c_bus_new_write(AspeedI2CBus *bus, hwaddr offset,qemu_log_mask (LOG_UNIMP ,"%s: Slave mode DMA TX is not implemented\n" , __func__);break ; - -/* -* The AST2700 support the maximum DRAM size is 8 GB. -* The DRAM offset range is from 0x0_0000_0000 to -* 0x1_FFFF_FFFF and it is enough to use bits [33:0] -* saving the dram offset. -* Therefore, save the high part physical address bit[1:0] -* of Tx/Rx buffer address as dma_dram_offset bit[33:32]. -*/ case A_I2CM_DMA_TX_ADDR_HI :if (!aic->has_dma64) { qemu_log_mask(LOG_GUEST_ERROR, "%s: No DMA 64 bits support\n",
@@ -766,8 +810,6 @@ static void aspeed_i2c_bus_new_write(AspeedI2CBus *bus, hwaddr offset, bus->regs[R_I2CM_DMA_TX_ADDR_HI ] =FIELD_EX32 (value,I2CM_DMA_TX_ADDR_HI ,ADDR_HI ); - bus->dma_dram_offset =deposit64 (bus->dma_dram_offset,32 ,32 , -extract32 (value,0 ,2 ));break ;case A_I2CM_DMA_RX_ADDR_HI :if (!aic->has_dma64) {
@@ -778,8 +820,6 @@ static void aspeed_i2c_bus_new_write(AspeedI2CBus *bus, hwaddr offset, bus->regs[R_I2CM_DMA_RX_ADDR_HI ] =FIELD_EX32 (value,I2CM_DMA_RX_ADDR_HI ,ADDR_HI ); - bus->dma_dram_offset =deposit64 (bus->dma_dram_offset,32 ,32 , -extract32 (value,0 ,2 ));break ;case A_I2CS_DMA_TX_ADDR_HI : qemu_log_mask(LOG_UNIMP,
@@ -795,8 +835,6 @@ static void aspeed_i2c_bus_new_write(AspeedI2CBus *bus, hwaddr offset, bus->regs[R_I2CS_DMA_RX_ADDR_HI ] =FIELD_EX32 (value,I2CS_DMA_RX_ADDR_HI ,ADDR_HI ); - bus->dma_dram_offset =deposit64 (bus->dma_dram_offset,32 ,32 , -extract32 (value,0 ,2 ));break ;default : qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIx "\n",
@@ -887,9 +925,6 @@ static void aspeed_i2c_bus_old_write(AspeedI2CBus *bus, hwaddr offset,qemu_log_mask (LOG_GUEST_ERROR ,"%s: No DMA support\n" , __func__);break ; } - - bus->dma_dram_offset =deposit64 (bus->dma_dram_offset,0 ,32 , - value &0x3ffffffc );break ;case A_I2CD_DMA_LEN :
Signature · 1 line
2.52.0
[PULL 21/45] tests/functional/aarch64/test_aspeed_ast2700: Update test ASPEED SDK v11.00 for A1
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
--- .../functional/aarch64/test_aspeed_ast2700.py | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-)
tests/functional/aarch64/test_aspeed_ast2700.py +29 -31
@@ -26,15 +26,23 @@ def do_test_aarch64_aspeed_sdk_start(self, image): self.vm.launch() def verify_vbootrom_firmware_flow(self): - wait_for_console_pattern(self, 'Found valid FIT image') - wait_for_console_pattern(self, '[uboot] loading') - wait_for_console_pattern(self, 'done') - wait_for_console_pattern(self, '[fdt] loading') - wait_for_console_pattern(self, 'done') - wait_for_console_pattern(self, '[tee] loading') - wait_for_console_pattern(self, 'done') - wait_for_console_pattern(self, '[atf] loading') - wait_for_console_pattern(self, 'done') + wait_for_console_pattern(self, 'Found valid caliptra flash image') + wait_for_console_pattern(self, 'Check flash image checksum') + wait_for_console_pattern(self, 'pass') + wait_for_console_pattern(self, 'Read abb header') + wait_for_console_pattern(self, 'pass') + wait_for_console_pattern(self, 'Read soc manifest') + wait_for_console_pattern(self, 'pass') + wait_for_console_pattern(self, 'Load atf image') + wait_for_console_pattern(self, 'pass') + wait_for_console_pattern(self, 'Load optee image') + wait_for_console_pattern(self, 'pass') + wait_for_console_pattern(self, 'Load uboot image') + wait_for_console_pattern(self, 'pass') + wait_for_console_pattern(self, 'Load ssp image') + wait_for_console_pattern(self, 'pass') + wait_for_console_pattern(self, 'Load tsp image') + wait_for_console_pattern(self, 'pass') wait_for_console_pattern(self, 'Jumping to BL31 (Trusted Firmware-A)') def enable_ast2700_pcie2(self):
@@ -63,9 +71,9 @@ def verify_openbmc_boot_and_login(self, name): exec_command_and_wait_for_pattern(self, 'root', 'Password:') exec_command_and_wait_for_pattern(self, '0penBmc', f'root@{name}:~#') - ASSET_SDK_V908_AST2700A1 = Asset( - 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.08/ast2700-default-obmc.tar.gz', - 'eac3dc409b7ea3cd4b03d4792d3cebd469792ad893cb51e1d15f0fc20bd1e2cd') + ASSET_SDK_V1100_AST2700A1 = Asset( + 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.00/ast2700-a1-obmc.tar.gz', + 'd5ceed511cd0dfefbb102fff2d731159e0472948a28066dc0d90bcd54be76525') def do_ast2700_i2c_test(self): exec_command_and_wait_for_pattern(self,
@@ -93,19 +101,10 @@ def do_ast2700_pcie_test(self): def start_ast2700_test(self, name): num_cpu = 4 - uboot_size = os.path.getsize(self.scratch_file(name, - 'u-boot-nodtb.bin')) - uboot_dtb_load_addr = hex(0x400000000 + uboot_size) - load_images_list = [ { 'addr': '0x400000000', - 'file': self.scratch_file(name, - 'u-boot-nodtb.bin') - }, - { - 'addr': str(uboot_dtb_load_addr), - 'file': self.scratch_file(name, 'u-boot.dtb') + 'file': self.scratch_file(name, 'u-boot.bin') }, { 'addr': '0x430000000',
@@ -113,8 +112,7 @@ def start_ast2700_test(self, name): }, { 'addr': '0x430080000', - 'file': self.scratch_file(name, 'optee', - 'tee-raw.bin') + 'file': self.scratch_file(name, 'optee', 'tee-raw.bin') } ]
@@ -137,26 +135,26 @@ def start_ast2700_test_vbootrom(self, name): self.do_test_aarch64_aspeed_sdk_start( self.scratch_file(name, 'image-bmc')) - def test_aarch64_ast2700a1_evb_sdk_v09_08(self): + def test_aarch64_ast2700a1_evb_sdk_v11_00(self): self.set_machine('ast2700a1-evb') self.require_netdev('user') - self.archive_extract(self.ASSET_SDK_V908_AST2700A1) + self.archive_extract(self.ASSET_SDK_V1100_AST2700A1) self.vm.add_args('-device', 'e1000e,netdev=net1,bus=pcie.2') self.vm.add_args('-netdev', 'user,id=net1') - self.start_ast2700_test('ast2700-default') - self.verify_openbmc_boot_and_login('ast2700-default') + self.start_ast2700_test('ast2700-a1') + self.verify_openbmc_boot_and_login('ast2700-a1') self.do_ast2700_i2c_test() self.do_ast2700_pcie_test() - def test_aarch64_ast2700a1_evb_sdk_vbootrom_v09_08(self): + def test_aarch64_ast2700a1_evb_sdk_vbootrom_v11_00(self): self.set_machine('ast2700a1-evb') self.require_netdev('user') - self.archive_extract(self.ASSET_SDK_V908_AST2700A1) + self.archive_extract(self.ASSET_SDK_V1100_AST2700A1) self.vm.add_args('-device', 'e1000e,netdev=net1,bus=pcie.2') self.vm.add_args('-netdev', 'user,id=net1') - self.start_ast2700_test_vbootrom('ast2700-default') + self.start_ast2700_test_vbootrom('ast2700-a1') self.verify_vbootrom_firmware_flow() self.verify_openbmc_boot_start()
Signature · 1 line
2.52.0
[PULL 34/45] hw/arm/aspeed: Attach ADC device to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the ADC device to AST1700 model.
--- include/hw/arm/aspeed_ast1700.h | 2 ++ hw/arm/aspeed_ast1700.c | 14 ++++++++++++++ hw/arm/aspeed_ast27x0.c | 5 +++++ 3 files changed, 21 insertions(+)
include/hw/arm/aspeed_ast1700.h +2 -0
@@ -9,6 +9,7 @@#define ASPEED_AST1700_H #include "hw/core/sysbus.h" +#include "hw/adc/aspeed_adc.h" #include "hw/misc/aspeed_ltpi.h" #include "hw/ssi/aspeed_smc.h" #include "hw/char/serial-mm.h"
@@ -28,6 +29,7 @@ struct AspeedAST1700SoCState {SerialMM uart;MemoryRegion sram;AspeedSMCState spi; + AspeedADCState adc; };#endif /* ASPEED_AST1700_H */
hw/arm/aspeed_ast1700.c +14 -0
@@ -19,6 +19,7 @@enum {ASPEED_AST1700_DEV_SPI0 ,ASPEED_AST1700_DEV_SRAM , +ASPEED_AST1700_DEV_ADC ,ASPEED_AST1700_DEV_UART12 ,ASPEED_AST1700_DEV_LTPI_CTRL ,ASPEED_AST1700_DEV_SPI0_MEM ,
@@ -27,6 +28,7 @@ enum {static const hwaddr aspeed_ast1700_io_memmap[] = { [ASPEED_AST1700_DEV_SPI0 ] =0x00030000 , [ASPEED_AST1700_DEV_SRAM ] =0x00BC0000 , + [ASPEED_AST1700_DEV_ADC ] =0x00C00000 , [ASPEED_AST1700_DEV_UART12 ] =0x00C33B00 , [ASPEED_AST1700_DEV_LTPI_CTRL ] =0x00C34000 , [ASPEED_AST1700_DEV_SPI0_MEM ] =0x04000000 ,
@@ -81,6 +83,14 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SPI0_MEM ], sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->spi), 1)); +/* ADC */ +if (!sysbus_realize (SYS_BUS_DEVICE (&s->adc), errp)) { +return ; + } +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_ADC ], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->adc),0 )); +/* LTPI controller */ if (!sysbus_realize (SYS_BUS_DEVICE (&s->ltpi), errp)) {return ;
@@ -102,6 +112,10 @@ static void aspeed_ast1700_instance_init(Object *obj)object_initialize_child (obj,"ioexp-spi" , &s->spi,"aspeed.spi0-ast2700" ); +/* ADC */ +object_initialize_child (obj,"ioexp-adc" , &s->adc, +"aspeed.adc-ast2700" ); +/* LTPI controller */ object_initialize_child (obj,"ltpi-ctrl" , &s->ltpi,TYPE_ASPEED_LTPI );
hw/arm/aspeed_ast27x0.c +5 -0
@@ -1046,6 +1046,11 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)sysbus_connect_irq (SYS_BUS_DEVICE (&a->intcioexp[i]), j, irq); } + +/* ADC */ +sysbus_connect_irq (SYS_BUS_DEVICE (&s->ioexp[i].adc),0 , +aspeed_soc_ast2700_get_irq (s,ASPEED_DEV_ADC )); + } aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->dpmcu),
Signature · 1 line
2.52.0
[PULL 35/45] hw/arm/aspeed: Attach SCU device to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the SCU device to AST1700 model.
--- include/hw/arm/aspeed_ast1700.h | 3 +++ hw/arm/aspeed_ast1700.c | 17 +++++++++++++++++ hw/arm/aspeed_ast27x0.c | 2 ++ 3 files changed, 22 insertions(+)
include/hw/arm/aspeed_ast1700.h +3 -0
@@ -9,6 +9,7 @@#define ASPEED_AST1700_H #include "hw/core/sysbus.h" +#include "hw/misc/aspeed_scu.h" #include "hw/adc/aspeed_adc.h" #include "hw/misc/aspeed_ltpi.h" #include "hw/ssi/aspeed_smc.h"
@@ -24,12 +25,14 @@ struct AspeedAST1700SoCState {MemoryRegion iomem;MemoryRegion *dram_mr;uint8_t board_idx; +uint32_t silicon_rev;AspeedLTPIState ltpi;SerialMM uart;MemoryRegion sram;AspeedSMCState spi;AspeedADCState adc; + AspeedSCUState scu; };#endif /* ASPEED_AST1700_H */
hw/arm/aspeed_ast1700.c +17 -0
@@ -20,6 +20,7 @@ enum {ASPEED_AST1700_DEV_SPI0 ,ASPEED_AST1700_DEV_SRAM ,ASPEED_AST1700_DEV_ADC , +ASPEED_AST1700_DEV_SCU ,ASPEED_AST1700_DEV_UART12 ,ASPEED_AST1700_DEV_LTPI_CTRL , ASPEED_AST1700_DEV_SPI0_MEM,
@@ -29,6 +30,7 @@ static const hwaddr aspeed_ast1700_io_memmap[] = { [ASPEED_AST1700_DEV_SPI0] = 0x00030000, [ASPEED_AST1700_DEV_SRAM] = 0x00BC0000, [ASPEED_AST1700_DEV_ADC] = 0x00C00000, + [ASPEED_AST1700_DEV_SCU] = 0x00C02000, [ASPEED_AST1700_DEV_UART12] = 0x00C33B00, [ASPEED_AST1700_DEV_LTPI_CTRL] = 0x00C34000, [ASPEED_AST1700_DEV_SPI0_MEM] = 0x04000000,
@@ -91,6 +93,16 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_ADC ], sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->adc), 0)); +/* SCU */ +qdev_prop_set_uint32 (DEVICE (&s->scu),"silicon-rev" , + s->silicon_rev); +if (!sysbus_realize (SYS_BUS_DEVICE (&s->scu), errp)) { +return ; + } +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SCU ], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->scu),0 )); +/* LTPI controller */ if (!sysbus_realize (SYS_BUS_DEVICE (&s->ltpi), errp)) {return ;
@@ -116,6 +128,10 @@ static void aspeed_ast1700_instance_init(Object *obj)object_initialize_child (obj,"ioexp-adc" , &s->adc,"aspeed.adc-ast2700" ); +/* SCU */ +object_initialize_child (obj,"ioexp-scu" , &s->scu, +TYPE_ASPEED_2700_SCU ); +/* LTPI controller */ object_initialize_child (obj,"ltpi-ctrl" , &s->ltpi,TYPE_ASPEED_LTPI );
@@ -125,6 +141,7 @@ static void aspeed_ast1700_instance_init(Object *obj)static const Property aspeed_ast1700_props[] = {DEFINE_PROP_UINT8 ("board-idx" , AspeedAST1700SoCState, board_idx,0 ), +DEFINE_PROP_UINT32 ("silicon-rev" , AspeedAST1700SoCState, silicon_rev,0 ),DEFINE_PROP_LINK ("dram" , AspeedAST1700SoCState, dram_mr, TYPE_MEMORY_REGION, MemoryRegion *), };
hw/arm/aspeed_ast27x0.c +2 -0
@@ -508,6 +508,8 @@ static void aspeed_soc_ast2700_init(Object *obj)/* AST1700 IOEXP */ object_initialize_child (obj,"ioexp[*]" , &s->ioexp[i],TYPE_ASPEED_AST1700 ); +qdev_prop_set_uint32 (DEVICE (&s->ioexp[i]),"silicon-rev" , + sc->silicon_rev); } object_initialize_child(obj, "dpmcu", &s->dpmcu,
Signature · 1 line
2.52.0
[PULL 33/45] hw/arm/aspeed: Attach SPI device to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the SPI device to AST1700 model.
--- include/hw/arm/aspeed_ast1700.h | 3 +++ hw/arm/aspeed_ast1700.c | 30 ++++++++++++++++++++++++++++++ hw/arm/aspeed_ast27x0.c | 2 ++ 3 files changed, 35 insertions(+)
include/hw/arm/aspeed_ast1700.h +3 -0
@@ -10,6 +10,7 @@#include "hw/core/sysbus.h" #include "hw/misc/aspeed_ltpi.h" +#include "hw/ssi/aspeed_smc.h" #include "hw/char/serial-mm.h" #define TYPE_ASPEED_AST1700 "aspeed.ast1700"
@@ -20,11 +21,13 @@ struct AspeedAST1700SoCState {SysBusDevice parent_obj;MemoryRegion iomem; +MemoryRegion *dram_mr;uint8_t board_idx;AspeedLTPIState ltpi;SerialMM uart;MemoryRegion sram; + AspeedSMCState spi; };#endif /* ASPEED_AST1700_H */
hw/arm/aspeed_ast1700.c +30 -0
@@ -9,6 +9,7 @@#include "qemu/osdep.h" #include "hw/core/boards.h" #include "qom/object.h" +#include "qapi/error.h" #include "hw/core/qdev-properties.h" #include "hw/arm/aspeed_ast1700.h"
@@ -16,15 +17,19 @@#define AST1700_SOC_SRAM_SIZE 0x00040000enum { +ASPEED_AST1700_DEV_SPI0 ,ASPEED_AST1700_DEV_SRAM ,ASPEED_AST1700_DEV_UART12 ,ASPEED_AST1700_DEV_LTPI_CTRL , +ASPEED_AST1700_DEV_SPI0_MEM , };static const hwaddr aspeed_ast1700_io_memmap[] = { + [ASPEED_AST1700_DEV_SPI0 ] =0x00030000 , [ASPEED_AST1700_DEV_SRAM ] =0x00BC0000 , [ASPEED_AST1700_DEV_UART12 ] =0x00C33B00 , [ASPEED_AST1700_DEV_LTPI_CTRL ] =0x00C34000 , + [ASPEED_AST1700_DEV_SPI0_MEM ] =0x04000000 , };static void aspeed_ast1700_realize (DeviceState *dev,Error **errp)
@@ -33,6 +38,11 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)SysBusDevice *sbd =SYS_BUS_DEVICE (dev);char dev_name[32 ]; +if (!s->dram_mr) { +error_setg (errp,TYPE_ASPEED_AST1700 ": 'dram' link not set" ); +return ; + } +/* Occupy memory space for all controllers in AST1700 */ memory_region_init (&s->iomem,OBJECT (s),TYPE_ASPEED_AST1700 ,AST2700_SOC_LTPI_SIZE );
@@ -57,6 +67,20 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_UART12 ], sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->uart), 0)); +/* SPI */ +object_property_set_link (OBJECT (&s->spi),"dram" , +OBJECT (s->dram_mr), errp); +if (!sysbus_realize (SYS_BUS_DEVICE (&s->spi), errp)) { +return ; + } +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SPI0 ], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->spi),0 )); + +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SPI0_MEM ], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->spi),1 )); +/* LTPI controller */ if (!sysbus_realize (SYS_BUS_DEVICE (&s->ltpi), errp)) {return ;
@@ -74,6 +98,10 @@ static void aspeed_ast1700_instance_init(Object *obj)object_initialize_child (obj,"uart" , &s->uart,TYPE_SERIAL_MM ); +/* SPI */ +object_initialize_child (obj,"ioexp-spi" , &s->spi, +"aspeed.spi0-ast2700" ); +/* LTPI controller */ object_initialize_child (obj,"ltpi-ctrl" , &s->ltpi,TYPE_ASPEED_LTPI );
@@ -83,6 +111,8 @@ static void aspeed_ast1700_instance_init(Object *obj)static const Property aspeed_ast1700_props[] = {DEFINE_PROP_UINT8 ("board-idx" , AspeedAST1700SoCState, board_idx,0 ), +DEFINE_PROP_LINK ("dram" , AspeedAST1700SoCState, dram_mr, + TYPE_MEMORY_REGION, MemoryRegion *), };static void aspeed_ast1700_class_init (ObjectClass *klass,const void *data)
hw/arm/aspeed_ast27x0.c +2 -0
@@ -1024,6 +1024,8 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)/* IO Expander */ for (i =0 ; i < sc->ioexp_num; i++) {qdev_prop_set_uint8 (DEVICE (&s->ioexp[i]),"board-idx" , i); +object_property_set_link (OBJECT (&s->ioexp[i]),"dram" , +OBJECT (s->dram_mr), &error_abort);if (!sysbus_realize (SYS_BUS_DEVICE (&s->ioexp[i]), errp)) {return ; }
Signature · 1 line
2.52.0
[PULL 38/45] hw/arm/aspeed: Attach WDT device to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the WDT device to AST1700 model.
--- include/hw/arm/aspeed_ast1700.h | 4 ++++ hw/arm/aspeed_ast1700.c | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
include/hw/arm/aspeed_ast1700.h +4 -0
@@ -15,8 +15,11 @@#include "hw/i2c/aspeed_i2c.h" #include "hw/misc/aspeed_ltpi.h" #include "hw/ssi/aspeed_smc.h" +#include "hw/watchdog/wdt_aspeed.h" #include "hw/char/serial-mm.h" +#define AST1700_WDT_NUM 9 +#define TYPE_ASPEED_AST1700 "aspeed.ast1700"OBJECT_DECLARE_SIMPLE_TYPE (AspeedAST1700SoCState,ASPEED_AST1700 )
@@ -37,6 +40,7 @@ struct AspeedAST1700SoCState {AspeedSCUState scu;AspeedGPIOState gpio;AspeedI2CState i2c; + AspeedWDTState wdt[AST1700_WDT_NUM]; };#endif /* ASPEED_AST1700_H */
hw/arm/aspeed_ast1700.c +24 -0
@@ -25,6 +25,7 @@ enum {ASPEED_AST1700_DEV_I2C ,ASPEED_AST1700_DEV_UART12 ,ASPEED_AST1700_DEV_LTPI_CTRL , +ASPEED_AST1700_DEV_WDT , ASPEED_AST1700_DEV_SPI0_MEM, };
@@ -37,6 +38,7 @@ static const hwaddr aspeed_ast1700_io_memmap[] = { [ASPEED_AST1700_DEV_I2C] = 0x00C0F000, [ASPEED_AST1700_DEV_UART12] = 0x00C33B00, [ASPEED_AST1700_DEV_LTPI_CTRL] = 0x00C34000, + [ASPEED_AST1700_DEV_WDT] = 0x00C37000, [ASPEED_AST1700_DEV_SPI0_MEM] = 0x04000000, };
@@ -135,6 +137,22 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)memory_region_add_subregion (&s->iomem, aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_LTPI_CTRL ],sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->ltpi),0 )); +/* WDT */ +for (int i =0 ; i <AST1700_WDT_NUM ; i++) { +AspeedWDTClass *awc =ASPEED_WDT_GET_CLASS (&s->wdt[i]); +hwaddr wdt_offset = aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_WDT ] + + i * awc->iosize; + +object_property_set_link (OBJECT (&s->wdt[i]),"scu" ,OBJECT (&s->scu), + errp); +if (!sysbus_realize (SYS_BUS_DEVICE (&s->wdt[i]), errp)) { +return ; + } +memory_region_add_subregion (&s->iomem, + wdt_offset, +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->wdt[i]),0 )); + } + }static void aspeed_ast1700_instance_init (Object *obj)
@@ -169,6 +187,12 @@ static void aspeed_ast1700_instance_init(Object *obj)object_initialize_child (obj,"ltpi-ctrl" , &s->ltpi,TYPE_ASPEED_LTPI ); +/* WDT */ +for (int i =0 ; i <AST1700_WDT_NUM ; i++) { +object_initialize_child (obj,"ioexp-wdt[*]" , + &s->wdt[i],"aspeed.wdt-ast2700" ); + } +return ; }
Signature · 1 line
2.52.0
[PULL 40/45] hw/arm/aspeed: Attach SGPIOM device to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the SGPIOM device to AST1700 model.
--- include/hw/arm/aspeed_ast1700.h | 3 +++ hw/arm/aspeed_ast1700.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+)
include/hw/arm/aspeed_ast1700.h +3 -0
@@ -12,6 +12,7 @@#include "hw/misc/aspeed_scu.h" #include "hw/adc/aspeed_adc.h" #include "hw/gpio/aspeed_gpio.h" +#include "hw/gpio/aspeed_sgpio.h" #include "hw/i2c/aspeed_i2c.h" #include "hw/misc/aspeed_ltpi.h" #include "hw/misc/aspeed_pwm.h"
@@ -19,6 +20,7 @@#include "hw/watchdog/wdt_aspeed.h" #include "hw/char/serial-mm.h" +#define AST1700_SGPIO_NUM 2#define AST1700_WDT_NUM 9#define TYPE_ASPEED_AST1700 "aspeed.ast1700"
@@ -40,6 +42,7 @@ struct AspeedAST1700SoCState {AspeedADCState adc;AspeedSCUState scu;AspeedGPIOState gpio; +AspeedSGPIOState sgpiom[AST1700_SGPIO_NUM ];AspeedI2CState i2c;AspeedPWMState pwm;AspeedWDTState wdt[AST1700_WDT_NUM ];
hw/arm/aspeed_ast1700.c +21 -0
@@ -23,6 +23,8 @@ enum {ASPEED_AST1700_DEV_ADC ,ASPEED_AST1700_DEV_SCU ,ASPEED_AST1700_DEV_GPIO , +ASPEED_AST1700_DEV_SGPIOM0 , +ASPEED_AST1700_DEV_SGPIOM1 ,ASPEED_AST1700_DEV_I2C ,ASPEED_AST1700_DEV_UART12 , ASPEED_AST1700_DEV_LTPI_CTRL,
@@ -37,6 +39,8 @@ static const hwaddr aspeed_ast1700_io_memmap[] = { [ASPEED_AST1700_DEV_ADC] = 0x00C00000, [ASPEED_AST1700_DEV_SCU] = 0x00C02000, [ASPEED_AST1700_DEV_GPIO] = 0x00C0B000, + [ASPEED_AST1700_DEV_SGPIOM0] = 0x00C0C000, + [ASPEED_AST1700_DEV_SGPIOM1] = 0x00C0D000, [ASPEED_AST1700_DEV_I2C] = 0x00C0F000, [ASPEED_AST1700_DEV_UART12] = 0x00C33B00, [ASPEED_AST1700_DEV_LTPI_CTRL] = 0x00C34000,
@@ -147,6 +151,17 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)memory_region_add_subregion (&s->iomem, aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_LTPI_CTRL ],sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->ltpi),0 )); + +/* SGPIOM */ +for (int i =0 ; i <AST1700_SGPIO_NUM ; i++) { +if (!sysbus_realize (SYS_BUS_DEVICE (&s->sgpiom[i]), errp)) { +return ; + } +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SGPIOM0 + i], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->sgpiom[i]),0 )); + } +/* WDT */ for (int i =0 ; i <AST1700_WDT_NUM ; i++) {AspeedWDTClass *awc =ASPEED_WDT_GET_CLASS (&s->wdt[i]);
@@ -200,6 +215,12 @@ static void aspeed_ast1700_instance_init(Object *obj)object_initialize_child (obj,"ltpi-ctrl" , &s->ltpi,TYPE_ASPEED_LTPI ); +/* SGPIOM */ +for (int i =0 ; i <AST1700_SGPIO_NUM ; i++) { +object_initialize_child (obj,"ioexp-sgpiom[*]" , &s->sgpiom[i], +"aspeed.sgpio-ast2700" ); + } +/* WDT */ for (int i =0 ; i <AST1700_WDT_NUM ; i++) { object_initialize_child(obj, "ioexp-wdt[*]",
Signature · 1 line
2.52.0
[PULL 42/45] hw/arm/aspeed: Enable AST1700 IO expander support
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Set ioexp_num to 2 to enable AST1700 IO expander support.
--- hw/arm/aspeed_ast27x0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/aspeed_ast27x0.c +1 -1
@@ -1160,7 +1160,7 @@ static void aspeed_soc_ast2700a1_class_init(ObjectClass *oc, const void *data) sc->macs_num =3 ; sc->uarts_num =13 ; sc->num_cpus =4 ; - sc->ioexp_num =0 ; + sc->ioexp_num =2 ; sc->uarts_base =ASPEED_DEV_UART0 ; sc->irqmap = aspeed_soc_ast2700a1_irqmap; sc->memmap = aspeed_soc_ast2700_memmap;
Signature · 1 line
2.52.0
[PULL 31/45] hw/arm/aspeed: Attach UART device to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the UART controller to the AST1700 model by mapping its MMIO region.
--- include/hw/arm/aspeed_ast1700.h | 2 ++ hw/arm/aspeed_ast1700.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+)
include/hw/arm/aspeed_ast1700.h +2 -0
@@ -10,6 +10,7 @@#include "hw/core/sysbus.h" #include "hw/misc/aspeed_ltpi.h" +#include "hw/char/serial-mm.h" #define TYPE_ASPEED_AST1700 "aspeed.ast1700"
@@ -21,6 +22,7 @@ struct AspeedAST1700SoCState {MemoryRegion iomem;AspeedLTPIState ltpi; + SerialMM uart; };#endif /* ASPEED_AST1700_H */
hw/arm/aspeed_ast1700.c +18 -0
@@ -9,15 +9,18 @@#include "qemu/osdep.h" #include "hw/core/boards.h" #include "qom/object.h" +#include "hw/core/qdev-properties.h" #include "hw/arm/aspeed_ast1700.h" #define AST2700_SOC_LTPI_SIZE 0x01000000enum { +ASPEED_AST1700_DEV_UART12 ,ASPEED_AST1700_DEV_LTPI_CTRL , };static const hwaddr aspeed_ast1700_io_memmap[] = { + [ASPEED_AST1700_DEV_UART12 ] =0x00C33B00 , [ASPEED_AST1700_DEV_LTPI_CTRL ] =0x00C34000 , };
@@ -31,6 +34,17 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) AST2700_SOC_LTPI_SIZE);sysbus_init_mmio (sbd, &s->iomem); +/* UART */ +qdev_prop_set_uint8 (DEVICE (&s->uart),"regshift" ,2 ); +qdev_prop_set_uint32 (DEVICE (&s->uart),"baudbase" ,38400 ); +qdev_prop_set_uint8 (DEVICE (&s->uart),"endianness" ,DEVICE_LITTLE_ENDIAN ); +if (!sysbus_realize (SYS_BUS_DEVICE (&s->uart), errp)) { +return ; + } +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_UART12 ], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->uart),0 )); +/* LTPI controller */ if (!sysbus_realize (SYS_BUS_DEVICE (&s->ltpi), errp)) {return ;
@@ -44,6 +58,10 @@ static void aspeed_ast1700_instance_init(Object *obj) {AspeedAST1700SoCState *s =ASPEED_AST1700 (obj); +/* UART */ +object_initialize_child (obj,"uart" , &s->uart, +TYPE_SERIAL_MM ); +/* LTPI controller */ object_initialize_child (obj,"ltpi-ctrl" , &s->ltpi,TYPE_ASPEED_LTPI );
Signature · 1 line
2.52.0
[PULL 36/45] hw/arm/aspeed: Attach GPIO device to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the GPIO controller to the AST1700 model by mapping its MMIO region and wiring its interrupt line.
--- include/hw/arm/aspeed_ast1700.h | 2 ++ hw/arm/aspeed_ast1700.c | 14 ++++++++++++++ hw/arm/aspeed_ast27x0.c | 4 ++++ 3 files changed, 20 insertions(+)
include/hw/arm/aspeed_ast1700.h +2 -0
@@ -11,6 +11,7 @@#include "hw/core/sysbus.h" #include "hw/misc/aspeed_scu.h" #include "hw/adc/aspeed_adc.h" +#include "hw/gpio/aspeed_gpio.h" #include "hw/misc/aspeed_ltpi.h" #include "hw/ssi/aspeed_smc.h" #include "hw/char/serial-mm.h"
@@ -33,6 +34,7 @@ struct AspeedAST1700SoCState {AspeedSMCState spi;AspeedADCState adc;AspeedSCUState scu; + AspeedGPIOState gpio; };#endif /* ASPEED_AST1700_H */
hw/arm/aspeed_ast1700.c +14 -0
@@ -21,6 +21,7 @@ enum {ASPEED_AST1700_DEV_SRAM ,ASPEED_AST1700_DEV_ADC ,ASPEED_AST1700_DEV_SCU , +ASPEED_AST1700_DEV_GPIO ,ASPEED_AST1700_DEV_UART12 ,ASPEED_AST1700_DEV_LTPI_CTRL , ASPEED_AST1700_DEV_SPI0_MEM,
@@ -31,6 +32,7 @@ static const hwaddr aspeed_ast1700_io_memmap[] = { [ASPEED_AST1700_DEV_SRAM] = 0x00BC0000, [ASPEED_AST1700_DEV_ADC] = 0x00C00000, [ASPEED_AST1700_DEV_SCU] = 0x00C02000, + [ASPEED_AST1700_DEV_GPIO] = 0x00C0B000, [ASPEED_AST1700_DEV_UART12] = 0x00C33B00, [ASPEED_AST1700_DEV_LTPI_CTRL] = 0x00C34000, [ASPEED_AST1700_DEV_SPI0_MEM] = 0x04000000,
@@ -103,6 +105,14 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SCU ], sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->scu), 0)); +/* GPIO */ +if (!sysbus_realize (SYS_BUS_DEVICE (&s->gpio), errp)) { +return ; + } +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_GPIO ], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->gpio),0 )); +/* LTPI controller */ if (!sysbus_realize (SYS_BUS_DEVICE (&s->ltpi), errp)) {return ;
@@ -132,6 +142,10 @@ static void aspeed_ast1700_instance_init(Object *obj)object_initialize_child (obj,"ioexp-scu" , &s->scu,TYPE_ASPEED_2700_SCU ); +/* GPIO */ +object_initialize_child (obj,"ioexp-gpio" , &s->gpio, +"aspeed.gpio-ast2700" ); +/* LTPI controller */ object_initialize_child (obj,"ltpi-ctrl" , &s->ltpi,TYPE_ASPEED_LTPI );
hw/arm/aspeed_ast27x0.c +4 -0
@@ -1053,6 +1053,10 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)sysbus_connect_irq (SYS_BUS_DEVICE (&s->ioexp[i].adc),0 ,aspeed_soc_ast2700_get_irq (s,ASPEED_DEV_ADC )); +/* GPIO */ +sysbus_connect_irq (SYS_BUS_DEVICE (&s->ioexp[i].gpio),0 , +aspeed_soc_ast2700_get_irq (s,ASPEED_DEV_GPIO )); + } aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->dpmcu),
Signature · 1 line
2.52.0
[PULL 45/45] tests/functional/aarch64: Add I2C test for AST1700 IO expanders
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Extend the AST2700 test suite to verify I2C connectivity on AST1700 IO expanders using the DCSCM image. This validates the new bus-label naming scheme by testing communication on both primary and expander-attached I2C buses.
--- tests/functional/aarch64/test_aspeed_ast2700.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
tests/functional/aarch64/test_aspeed_ast2700.py +17 -0
@@ -82,6 +82,10 @@ def verify_openbmc_boot_and_login(self, name, enable_pcie=True): 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.00/ast2700-a1-obmc.tar.gz', 'd5ceed511cd0dfefbb102fff2d731159e0472948a28066dc0d90bcd54be76525') + ASSET_SDK_V1100_AST2700A1_DCSCM = Asset( + 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.00/ast2700-a1-dcscm-obmc.tar.gz', + '4f8778be176ece1b57d33c4aee13bb989be114c3e4703150eaeb6f996bd5587f') + def do_ast2700_i2c_test(self, bus_id): bus_str = str(bus_id) exec_command_and_wait_for_pattern(self,
@@ -166,5 +170,18 @@ def test_aarch64_ast2700a1_evb_sdk_vbootrom_v11_00(self): self.verify_vbootrom_firmware_flow() self.verify_openbmc_boot_start() + def test_aarch64_ast2700a1_evb_ioexp_v11_00(self): + self.set_machine('ast2700a1-evb') + self.require_netdev('user') + + self.archive_extract(self.ASSET_SDK_V1100_AST2700A1_DCSCM) + self.vm.set_machine('ast2700a1-evb,fmc-model=w25q512jv') + self.vm.add_args('-device', + 'tmp105,bus=ioexp0.0,address=0x4d,id=tmp-test-16') + self.start_ast2700_test('ast2700-a1-dcscm', 8) + self.verify_openbmc_boot_and_login('ast2700-a1-dcscm', False) + self.do_ast2700_i2c_test(8) + self.do_ast2700_i2c_test(16) + if __name__ == '__main__': QemuSystemTest.main()
Signature · 1 line
2.52.0
[PULL 11/45] hw/pci-host/aspeed_pcie: Drop AST2600 RC_H root-bus remap and bus-nr property
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
The original AST2600 PCIe design supported both RC_L and RC_H, using root bus number 0 for RC_L and 0x80 for RC_H. In that model, the root port appeared as 80:08.0 and QEMU carried a "bus-nr" property plus a config-space bus remap to translate bus 0x80 to bus 0x00 for PCI enumeration.
Linux mainline has since dropped RC_L support and updated the RC_H root bus number to start at 0. The root port is now enumerated as 00:08.0, matching the default QEMU PCIe subsystem root bus numbering.
Remove the bus number setting and the AST2600 bus remap logic, and drop the corresponding "bus-nr"/rc_bus_nr fields and property plumbing. QEMU now relies on the default root bus 0 behavior.
--- include/hw/pci-host/aspeed_pcie.h | 2 -- hw/pci-host/aspeed_pcie.c | 19 +------------------ 2 files changed, 1 insertion(+), 20 deletions(-)
include/hw/pci-host/aspeed_pcie.h +0 -2
@@ -69,7 +69,6 @@ struct AspeedPCIERcState {uint64_t dram_base;uint32_t msi_addr;uint32_t rp_addr; -uint32_t bus_nr;char name[16 ];qemu_irq irq;
@@ -102,7 +101,6 @@ struct AspeedPCIECfgClass {uint32_t rc_msi_addr;uint32_t rc_rp_addr; -uint64_t rc_bus_nr;uint64_t nr_regs;bool rc_has_rd; };
hw/pci-host/aspeed_pcie.c +1 -18
@@ -268,7 +268,7 @@ static const char *aspeed_pcie_rc_root_bus_path(PCIHostState *host_bridge,AspeedPCIECfgState *cfg =container_of (rc, AspeedPCIECfgState, rc); -snprintf (rc->name,sizeof (rc->name),"%04x:%02x" , cfg->id, rc->bus_nr); +snprintf (rc->name,sizeof (rc->name),"%04x:00" , cfg->id);return rc->name; }
@@ -283,7 +283,6 @@ static void aspeed_pcie_rc_instance_init(Object *obj) }static const Property aspeed_pcie_rc_props[] = { -DEFINE_PROP_UINT32 ("bus-nr" , AspeedPCIERcState, bus_nr,0 ),DEFINE_PROP_UINT32 ("rp-addr" , AspeedPCIERcState, rp_addr,0 ),DEFINE_PROP_UINT32 ("msi-addr" , AspeedPCIERcState, msi_addr,0 ),DEFINE_PROP_UINT64 ("dram-base" , AspeedPCIERcState, dram_base,0 ),
@@ -490,17 +489,6 @@ static void aspeed_pcie_cfg_readwrite(AspeedPCIECfgState *s, offset = cfg_addr &0xffc ; pci =PCI_HOST_BRIDGE (rc); - -/* -* On the AST2600, the RC_H bus number range from 0x80 to 0xFF, with the -* root device and root port assigned to bus 0x80 instead of the standard -* 0x00. To allow the PCI subsystem to correctly discover devices on the -* root bus, bus 0x80 is remapped to 0x00. -*/ -if (bus == rc->bus_nr) { - bus =0 ; - } - pdev =pci_find_device (pci->bus, bus, devfn);if (!pdev) { s->regs[desc->rdata_reg] = ~0 ;
@@ -650,9 +638,6 @@ static void aspeed_pcie_cfg_realize(DeviceState *dev, Error **errp) apc->nr_regs << 2);sysbus_init_mmio (sbd, &s->mmio); -object_property_set_int (OBJECT (&s->rc),"bus-nr" , - apc->rc_bus_nr, - &error_abort);object_property_set_int (OBJECT (&s->rc),"rp-addr" , apc->rc_rp_addr, &error_abort);
@@ -691,7 +676,6 @@ static void aspeed_pcie_cfg_class_init(ObjectClass *klass, const void *data) apc->reg_map = &aspeed_regmap; apc->nr_regs =0x100 >>2 ; apc->rc_msi_addr =0x1e77005C ; - apc->rc_bus_nr =0x80 ; apc->rc_rp_addr =PCI_DEVFN (8 ,0 ); }
@@ -811,7 +795,6 @@ static void aspeed_2700_pcie_cfg_class_init(ObjectClass *klass, apc->reg_map = &aspeed_2700_regmap; apc->nr_regs =0x100 >>2 ; apc->rc_msi_addr =0x000000F0 ; - apc->rc_bus_nr =0 ; apc->rc_rp_addr =PCI_DEVFN (0 ,0 ); }
Signature · 1 line
2.52.0
[PULL 37/45] hw/arm/aspeed: attach I2C device to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the I2C controller to the AST1700 model by mapping its MMIO region and wiring its interrupt line.
--- include/hw/arm/aspeed_ast1700.h | 2 ++ include/hw/arm/aspeed_soc.h | 2 ++ hw/arm/aspeed_ast1700.c | 19 ++++++++++++ hw/arm/aspeed_ast27x0.c | 51 +++++++++++++++++++++++++++++++-- 4 files changed, 71 insertions(+), 3 deletions(-)
include/hw/arm/aspeed_ast1700.h +2 -0
@@ -12,6 +12,7 @@#include "hw/misc/aspeed_scu.h" #include "hw/adc/aspeed_adc.h" #include "hw/gpio/aspeed_gpio.h" +#include "hw/i2c/aspeed_i2c.h" #include "hw/misc/aspeed_ltpi.h" #include "hw/ssi/aspeed_smc.h" #include "hw/char/serial-mm.h"
@@ -35,6 +36,7 @@ struct AspeedAST1700SoCState {AspeedADCState adc;AspeedSCUState scu;AspeedGPIOState gpio; + AspeedI2CState i2c; };#endif /* ASPEED_AST1700_H */
include/hw/arm/aspeed_soc.h +2 -0
@@ -290,6 +290,8 @@ enum {ASPEED_DEV_LTPI_CTRL2 ,ASPEED_DEV_LTPI_IO0 ,ASPEED_DEV_LTPI_IO1 , +ASPEED_DEV_IOEXP0_I2C , +ASPEED_DEV_IOEXP1_I2C ,ASPEED_DEV_IOEXP0_INTCIO , ASPEED_DEV_IOEXP1_INTCIO, };
hw/arm/aspeed_ast1700.c +19 -0
@@ -22,6 +22,7 @@ enum {ASPEED_AST1700_DEV_ADC ,ASPEED_AST1700_DEV_SCU ,ASPEED_AST1700_DEV_GPIO , +ASPEED_AST1700_DEV_I2C ,ASPEED_AST1700_DEV_UART12 ,ASPEED_AST1700_DEV_LTPI_CTRL , ASPEED_AST1700_DEV_SPI0_MEM,
@@ -33,6 +34,7 @@ static const hwaddr aspeed_ast1700_io_memmap[] = { [ASPEED_AST1700_DEV_ADC] = 0x00C00000, [ASPEED_AST1700_DEV_SCU] = 0x00C02000, [ASPEED_AST1700_DEV_GPIO] = 0x00C0B000, + [ASPEED_AST1700_DEV_I2C] = 0x00C0F000, [ASPEED_AST1700_DEV_UART12] = 0x00C33B00, [ASPEED_AST1700_DEV_LTPI_CTRL] = 0x00C34000, [ASPEED_AST1700_DEV_SPI0_MEM] = 0x04000000,
@@ -113,6 +115,19 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_GPIO ], sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->gpio), 0)); +/* I2C */ +snprintf (dev_name,sizeof (dev_name),"ioexp%d" , s->board_idx); +qdev_prop_set_string (DEVICE (&s->i2c),"bus-label" , dev_name); + +object_property_set_link (OBJECT (&s->i2c),"dram" , +OBJECT (s->dram_mr), errp); +if (!sysbus_realize (SYS_BUS_DEVICE (&s->i2c), errp)) { +return ; + } +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_I2C ], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->i2c),0 )); +/* LTPI controller */ if (!sysbus_realize (SYS_BUS_DEVICE (&s->ltpi), errp)) {return ;
@@ -146,6 +161,10 @@ static void aspeed_ast1700_instance_init(Object *obj)object_initialize_child (obj,"ioexp-gpio" , &s->gpio,"aspeed.gpio-ast2700" ); +/* I2C */ +object_initialize_child (obj,"ioexp-i2c" , &s->i2c, +"aspeed.i2c-ast2700" ); +/* LTPI controller */ object_initialize_child (obj,"ltpi-ctrl" , &s->ltpi,TYPE_ASPEED_LTPI );
hw/arm/aspeed_ast27x0.c +48 -3
95 lines not on this page · raw message
Signature · 1 line
2.52.0
[PULL 22/45] tests/functional/aarch64/test_aspeed_ast2700fc: Update test ASPEED SDK v11.00 for A1
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
--- .../aarch64/test_aspeed_ast2700fc.py | 36 +++++++------------ 1 file changed, 13 insertions(+), 23 deletions(-)
tests/functional/aarch64/test_aspeed_ast2700fc.py +13 -23
@@ -61,9 +61,9 @@ def load_ast2700fc_coprocessor(self, name): self.vm.add_args('-device', f'loader,file={file},cpu-num={cpu_num}') - ASSET_SDK_V908_AST2700 = Asset( - 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.08/ast2700-default-obmc.tar.gz', - 'eac3dc409b7ea3cd4b03d4792d3cebd469792ad893cb51e1d15f0fc20bd1e2cd') + ASSET_SDK_V1100_AST2700 = Asset( + 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.00/ast2700-a1-obmc.tar.gz', + 'd5ceed511cd0dfefbb102fff2d731159e0472948a28066dc0d90bcd54be76525') def do_ast2700_i2c_test(self): exec_command_and_wait_for_pattern(self,
@@ -113,19 +113,10 @@ def do_ast2700fc_tsp_test(self): def start_ast2700fc_test(self, name): ca35_core = 4 - uboot_size = os.path.getsize(self.scratch_file(name, - 'u-boot-nodtb.bin')) - uboot_dtb_load_addr = hex(0x400000000 + uboot_size) - load_images_list = [ { 'addr': '0x400000000', - 'file': self.scratch_file(name, - 'u-boot-nodtb.bin') - }, - { - 'addr': str(uboot_dtb_load_addr), - 'file': self.scratch_file(name, 'u-boot.dtb') + 'file': self.scratch_file(name, 'u-boot.bin') }, { 'addr': '0x430000000',
@@ -133,8 +124,7 @@ def start_ast2700fc_test(self, name): }, { 'addr': '0x430080000', - 'file': self.scratch_file(name, 'optee', - 'tee-raw.bin') + 'file': self.scratch_file(name, 'optee', 'tee-raw.bin') } ]
@@ -158,24 +148,24 @@ def start_ast2700fc_test_vbootrom(self, name): self.do_test_aarch64_aspeed_sdk_start( self.scratch_file(name, 'image-bmc')) - def test_aarch64_ast2700fc_sdk_v09_08(self): + def test_aarch64_ast2700fc_sdk_v11_00(self): self.set_machine('ast2700fc') self.require_netdev('user') - self.archive_extract(self.ASSET_SDK_V908_AST2700) - self.start_ast2700fc_test('ast2700-default') - self.verify_openbmc_boot_and_login('ast2700-default') + self.archive_extract(self.ASSET_SDK_V1100_AST2700) + self.start_ast2700fc_test('ast2700-a1') + self.verify_openbmc_boot_and_login('ast2700-a1') self.do_ast2700_i2c_test() self.do_ast2700_pcie_test() self.do_ast2700fc_ssp_test() self.do_ast2700fc_tsp_test() - def test_aarch64_ast2700fc_sdk_vbootrom_v09_08(self): + def test_aarch64_ast2700fc_sdk_vbootrom_v11_00(self): self.set_machine('ast2700fc') - self.archive_extract(self.ASSET_SDK_V908_AST2700) - self.start_ast2700fc_test_vbootrom('ast2700-default') - self.verify_openbmc_boot_and_login('ast2700-default') + self.archive_extract(self.ASSET_SDK_V1100_AST2700) + self.start_ast2700fc_test_vbootrom('ast2700-a1') + self.verify_openbmc_boot_and_login('ast2700-a1') self.do_ast2700fc_ssp_test() self.do_ast2700fc_tsp_test()
Signature · 1 line
2.52.0
[PULL 17/45] hw/arm/aspeed_ast27x0: Sort SSP and TSP memmap tables by address
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
Sort the SSP and TSP memmap tables to improve readability and make the definitions easier to maintain.
No functional change.
--- hw/arm/aspeed_ast27x0-ssp.c | 10 +++++----- hw/arm/aspeed_ast27x0-tsp.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-)
hw/arm/aspeed_ast27x0-ssp.c +5 -5
@@ -23,15 +23,15 @@ static const hwaddr aspeed_soc_ast27x0ssp_memmap[] = { [ASPEED_DEV_SRAM] = 0x70000000, [ASPEED_DEV_INTC] = 0x72100000, [ASPEED_DEV_SCU] = 0x72C02000, + [ASPEED_DEV_TIMER1] = 0x72C10000, + [ASPEED_DEV_UART4] = 0x72C1A000, + [ASPEED_DEV_IPC0] = 0x72C1C000, [ASPEED_DEV_SCUIO] = 0x74C02000, + [ASPEED_DEV_INTCIO] = 0x74C18000, [ASPEED_DEV_UART0] = 0x74C33000, [ASPEED_DEV_UART1] = 0x74C33100, [ASPEED_DEV_UART2] = 0x74C33200, [ASPEED_DEV_UART3] = 0x74C33300, - [ASPEED_DEV_UART4] = 0x72C1A000, - [ASPEED_DEV_INTCIO] = 0x74C18000, - [ASPEED_DEV_IPC0] = 0x72C1C000, - [ASPEED_DEV_IPC1] = 0x74C39000, [ASPEED_DEV_UART5] = 0x74C33400, [ASPEED_DEV_UART6] = 0x74C33500, [ASPEED_DEV_UART7] = 0x74C33600,
@@ -40,7 +40,7 @@ static const hwaddr aspeed_soc_ast27x0ssp_memmap[] = { [ASPEED_DEV_UART10] = 0x74C33900, [ASPEED_DEV_UART11] = 0x74C33A00, [ASPEED_DEV_UART12] = 0x74C33B00, - [ASPEED_DEV_TIMER1] = 0x72C10000, + [ASPEED_DEV_IPC1] = 0x74C39000, };static const int aspeed_soc_ast27x0ssp_irqmap[] = {
hw/arm/aspeed_ast27x0-tsp.c +5 -5
@@ -23,15 +23,15 @@ static const hwaddr aspeed_soc_ast27x0tsp_memmap[] = { [ASPEED_DEV_SRAM] = 0x70000000, [ASPEED_DEV_INTC] = 0x72100000, [ASPEED_DEV_SCU] = 0x72C02000, + [ASPEED_DEV_TIMER1] = 0x72C10000, + [ASPEED_DEV_UART4] = 0x72C1A000, + [ASPEED_DEV_IPC0] = 0x72C1C000, [ASPEED_DEV_SCUIO] = 0x74C02000, + [ASPEED_DEV_INTCIO] = 0x74C18000, [ASPEED_DEV_UART0] = 0x74C33000, [ASPEED_DEV_UART1] = 0x74C33100, [ASPEED_DEV_UART2] = 0x74C33200, [ASPEED_DEV_UART3] = 0x74C33300, - [ASPEED_DEV_UART4] = 0x72C1A000, - [ASPEED_DEV_INTCIO] = 0x74C18000, - [ASPEED_DEV_IPC0] = 0x72C1C000, - [ASPEED_DEV_IPC1] = 0x74C39000, [ASPEED_DEV_UART5] = 0x74C33400, [ASPEED_DEV_UART6] = 0x74C33500, [ASPEED_DEV_UART7] = 0x74C33600,
@@ -40,7 +40,7 @@ static const hwaddr aspeed_soc_ast27x0tsp_memmap[] = { [ASPEED_DEV_UART10] = 0x74C33900, [ASPEED_DEV_UART11] = 0x74C33A00, [ASPEED_DEV_UART12] = 0x74C33B00, - [ASPEED_DEV_TIMER1] = 0x72C10000, + [ASPEED_DEV_IPC1] = 0x74C39000, };static const int aspeed_soc_ast27x0tsp_irqmap[] = {
Signature · 1 line
2.52.0
[PULL 32/45] hw/arm/aspeed: Attach SRAM device to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Map the SRAM device to AST1700 model
--- include/hw/arm/aspeed_ast1700.h | 2 ++ hw/arm/aspeed_ast1700.c | 17 +++++++++++++++++ hw/arm/aspeed_ast27x0.c | 1 + 3 files changed, 20 insertions(+)
include/hw/arm/aspeed_ast1700.h +2 -0
@@ -20,9 +20,11 @@ struct AspeedAST1700SoCState {SysBusDevice parent_obj;MemoryRegion iomem; +uint8_t board_idx;AspeedLTPIState ltpi;SerialMM uart; + MemoryRegion sram; };#endif /* ASPEED_AST1700_H */
hw/arm/aspeed_ast1700.c +17 -0
@@ -13,13 +13,16 @@#include "hw/arm/aspeed_ast1700.h" #define AST2700_SOC_LTPI_SIZE 0x01000000 +#define AST1700_SOC_SRAM_SIZE 0x00040000enum { +ASPEED_AST1700_DEV_SRAM ,ASPEED_AST1700_DEV_UART12 ,ASPEED_AST1700_DEV_LTPI_CTRL , };static const hwaddr aspeed_ast1700_io_memmap[] = { + [ASPEED_AST1700_DEV_SRAM ] =0x00BC0000 , [ASPEED_AST1700_DEV_UART12 ] =0x00C33B00 , [ASPEED_AST1700_DEV_LTPI_CTRL ] =0x00C34000 , };
@@ -28,12 +31,21 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) {AspeedAST1700SoCState *s =ASPEED_AST1700 (dev);SysBusDevice *sbd =SYS_BUS_DEVICE (dev); +char dev_name[32 ];/* Occupy memory space for all controllers in AST1700 */ memory_region_init (&s->iomem,OBJECT (s),TYPE_ASPEED_AST1700 ,AST2700_SOC_LTPI_SIZE );sysbus_init_mmio (sbd, &s->iomem); +/* SRAM */ +snprintf (dev_name,sizeof (dev_name),"aspeed.ioexp-sram.%d" , s->board_idx); +memory_region_init_ram (&s->sram,OBJECT (s), dev_name, +AST1700_SOC_SRAM_SIZE , errp); +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SRAM ], + &s->sram); +/* UART */ qdev_prop_set_uint8 (DEVICE (&s->uart),"regshift" ,2 );qdev_prop_set_uint32 (DEVICE (&s->uart),"baudbase" ,38400 );
@@ -69,11 +81,16 @@ static void aspeed_ast1700_instance_init(Object *obj)return ; } +static const Property aspeed_ast1700_props[] = { +DEFINE_PROP_UINT8 ("board-idx" , AspeedAST1700SoCState, board_idx,0 ), +}; +static void aspeed_ast1700_class_init (ObjectClass *klass,const void *data) {DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = aspeed_ast1700_realize; +device_class_set_props (dc, aspeed_ast1700_props); }static const TypeInfo aspeed_ast1700_info = {
hw/arm/aspeed_ast27x0.c +1 -0
@@ -1023,6 +1023,7 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)/* IO Expander */ for (i =0 ; i < sc->ioexp_num; i++) { +qdev_prop_set_uint8 (DEVICE (&s->ioexp[i]),"board-idx" , i);if (!sysbus_realize (SYS_BUS_DEVICE (&s->ioexp[i]), errp)) {return ; }
Signature · 1 line
2.52.0
[PULL 41/45] hw/arm/aspeed: Model AST1700 I3C block as unimplemented device
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
AST1700 exposes more I3C buses than the current dummy I3C model provides. When Linux probes the I3C devices on AST1700 this mismatch can trigger a kernel panic. Model the I3C block as an unimplemented device to make the missing functionality explicit and avoid unexpected side effects.
This wires up the I3C interrupt lines for the IO expanders and adds the corresponding device entries for the AST1700 model.
No functional I3C emulation is provided yet; this only prevents crashes and documents the missing piece.
--- include/hw/arm/aspeed_ast1700.h | 3 +++ include/hw/arm/aspeed_soc.h | 2 ++ hw/arm/aspeed_ast1700.c | 15 +++++++++++++++ hw/arm/aspeed_ast27x0.c | 18 ++++++++++++++++-- 4 files changed, 36 insertions(+), 2 deletions(-)
include/hw/arm/aspeed_ast1700.h +3 -0
@@ -19,6 +19,7 @@#include "hw/ssi/aspeed_smc.h" #include "hw/watchdog/wdt_aspeed.h" #include "hw/char/serial-mm.h" +#include "hw/misc/unimp.h" #define AST1700_SGPIO_NUM 2#define AST1700_WDT_NUM 9
@@ -46,6 +47,8 @@ struct AspeedAST1700SoCState {AspeedI2CState i2c;AspeedPWMState pwm;AspeedWDTState wdt[AST1700_WDT_NUM ]; + + UnimplementedDeviceState i3c; };#endif /* ASPEED_AST1700_H */
include/hw/arm/aspeed_soc.h +2 -0
@@ -294,6 +294,8 @@ enum {ASPEED_DEV_IOEXP1_I2C ,ASPEED_DEV_IOEXP0_INTCIO ,ASPEED_DEV_IOEXP1_INTCIO , +ASPEED_DEV_IOEXP0_I3C , + ASPEED_DEV_IOEXP1_I3C, };const char *aspeed_soc_cpu_type (const char *const *valid_cpu_types);
hw/arm/aspeed_ast1700.c +15 -0
@@ -15,6 +15,7 @@#define AST2700_SOC_LTPI_SIZE 0x01000000#define AST1700_SOC_SRAM_SIZE 0x00040000 +#define AST1700_SOC_I3C_SIZE 0x00010000enum {ASPEED_AST1700_DEV_SPI0 ,
@@ -26,6 +27,7 @@ enum {ASPEED_AST1700_DEV_SGPIOM0 ,ASPEED_AST1700_DEV_SGPIOM1 ,ASPEED_AST1700_DEV_I2C , +ASPEED_AST1700_DEV_I3C ,ASPEED_AST1700_DEV_UART12 ,ASPEED_AST1700_DEV_LTPI_CTRL , ASPEED_AST1700_DEV_WDT,
@@ -42,6 +44,7 @@ static const hwaddr aspeed_ast1700_io_memmap[] = { [ASPEED_AST1700_DEV_SGPIOM0] = 0x00C0C000, [ASPEED_AST1700_DEV_SGPIOM1] = 0x00C0D000, [ASPEED_AST1700_DEV_I2C] = 0x00C0F000, + [ASPEED_AST1700_DEV_I3C] = 0x00C20000, [ASPEED_AST1700_DEV_UART12] = 0x00C33B00, [ASPEED_AST1700_DEV_LTPI_CTRL] = 0x00C34000, [ASPEED_AST1700_DEV_WDT] = 0x00C37000,
@@ -178,6 +181,14 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->wdt[i]), 0)); } +/* I3C */ +qdev_prop_set_string (DEVICE (&s->i3c),"name" ,"ioexp-i3c" ); +qdev_prop_set_uint64 (DEVICE (&s->i3c),"size" ,AST1700_SOC_I3C_SIZE ); +sysbus_realize (SYS_BUS_DEVICE (&s->i3c), errp); +memory_region_add_subregion_overlap (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_I3C ], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->i3c),0 ), +-1000 ); }static void aspeed_ast1700_instance_init (Object *obj)
@@ -227,6 +238,10 @@ static void aspeed_ast1700_instance_init(Object *obj) &s->wdt[i], "aspeed.wdt-ast2700"); } +/* I3C */ +object_initialize_child (obj,"ioexp-i3c" , &s->i3c, +TYPE_UNIMPLEMENTED_DEVICE ); +return ; }
hw/arm/aspeed_ast27x0.c +16 -2
@@ -158,7 +158,9 @@ static const int aspeed_soc_ast2700a1_irqmap[] = { [ASPEED_DEV_PECI] = 197, [ASPEED_DEV_SDHCI] = 197, [ASPEED_DEV_IOEXP0_I2C] = 198, + [ASPEED_DEV_IOEXP0_I3C] = 199, [ASPEED_DEV_IOEXP1_I2C] = 200, + [ASPEED_DEV_IOEXP1_I3C] = 201, };/* GICINT 192 */
@@ -221,12 +223,24 @@ static const int ast2700_gic198_intcmap[] = { [ASPEED_DEV_IOEXP0_I2C] = 0, /* 0 - 15 */ }; +/* Primary AST1700 Interrupts */ +/* A1: GINTC 199 */ +static const int ast2700_gic199_intcmap[] = { + [ASPEED_DEV_IOEXP0_I3C ] =0 ,/* 0 - 15 */ +}; +/* Secondary AST1700 Interrupts */ /* A1: GINTC 200 */ static const int ast2700_gic200_intcmap[] = { [ASPEED_DEV_IOEXP1_I2C ] =0 ,/* 0 - 15 */ }; +/* Secondary AST1700 Interrupts */ +/* A1: GINTC 201 */ +static const int ast2700_gic201_intcmap[] = { + [ASPEED_DEV_IOEXP1_I3C ] =0 ,/* 0 - 15 */ +}; +/* GICINT 192 ~ 201 */ struct gic_intc_irq_info {int irq;
@@ -243,9 +257,9 @@ static const struct gic_intc_irq_info ast2700_gic_intcmap[] = { {196, 1, 4, ast2700_gic196_intcmap}, {197, 1, 5, ast2700_gic197_intcmap}, {198, 2, 0, ast2700_gic198_intcmap}, - {199, 1, 7, NULL}, + {199, 2, 1, ast2700_gic199_intcmap}, {200, 3, 0, ast2700_gic200_intcmap}, - {201, 1, 9, NULL}, + {201, 3, 1, ast2700_gic201_intcmap}, };static qemu_irq aspeed_soc_ast2700_get_irq (AspeedSoCState *s,int dev)
Signature · 1 line
2.52.0
[PULL 27/45] hw/arm/aspeed: Add AST1700 LTPI expander device model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Introduce a minimal QEMU device model for the ASPEED AST1700, an MCU-less I/O expander used in the LTPI topology defined by the DC-SCM 2.0 specification (see figure 2):
https://www.opencompute.org/documents/ocp-dc-scm-2-0-ltpi-ver-1-0-pdf
This initial implementation includes:
* Definition of aspeed.ast1700 as a SysBusDevice
* Setup of a basic memory region to reserve I/O space for future peripheral modeling
This stub establishes the foundation for LTPI-related device emulation, without implementing any functional peripherals at this stage.
--- include/hw/arm/aspeed_ast1700.h | 23 +++++++++++++++++ hw/arm/aspeed_ast1700.c | 46 +++++++++++++++++++++++++++++++++ hw/arm/meson.build | 1 + 3 files changed, 70 insertions(+) create mode 100644 include/hw/arm/aspeed_ast1700.h create mode 100644 hw/arm/aspeed_ast1700.c
include/hw/arm/aspeed_ast1700.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* ASPEED AST1700 IO Expander +* +* Copyright (C) 2025 ASPEED Technology Inc. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ +#ifndef ASPEED_AST1700_H +#define ASPEED_AST1700_H + +#include "hw/core/sysbus.h" + +#define TYPE_ASPEED_AST1700 "aspeed.ast1700" + +OBJECT_DECLARE_SIMPLE_TYPE(AspeedAST1700SoCState, ASPEED_AST1700) + +struct AspeedAST1700SoCState { +SysBusDevice parent_obj; + +MemoryRegion iomem; +}; + +#endif /* ASPEED_AST1700_H */
hw/arm/aspeed_ast1700.c new file +46 -0
46 lines not on this page · raw message
hw/arm/meson.build +1 -0
@@ -70,6 +70,7 @@ arm_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files( 'aspeed_ast10x0_evb.c', 'fby35.c')) arm_common_ss.add(when: ['CONFIG_ASPEED_SOC', 'TARGET_AARCH64'], if_true: files( + 'aspeed_ast1700.c', 'aspeed_ast27x0.c', 'aspeed_ast27x0_evb.c', 'aspeed_ast27x0-fc.c',
Signature · 1 line
2.52.0
[PULL 16/45] hw/arm/aspeed_ast27x0: Fix EHCI3/4 IRQ routing to GIC
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
EHCI3 and EHCI4 were missing entries in aspeed_soc_ast2700a1_irqmap, so their source IRQs were never routed through the INTC OR-gates.
As a result, EHCI3/4 interrupts were not propagated to the GIC, causing incorrect interrupt behavior for these controllers.
Add EHCI3 and EHCI4 to the IRQ map and route them to the same INTC group as other shared peripherals, ensuring their interrupts are properly connected to the GIC.
--- hw/arm/aspeed_ast27x0.c | 2 ++ 1 file changed, 2 insertions(+)
hw/arm/aspeed_ast27x0.c +2 -0
@@ -149,6 +149,8 @@ static const int aspeed_soc_ast2700a1_irqmap[] = { [ASPEED_DEV_ETH1] = 196, [ASPEED_DEV_ETH2] = 196, [ASPEED_DEV_ETH3] = 196, + [ASPEED_DEV_EHCI3] = 196, + [ASPEED_DEV_EHCI4] = 196, [ASPEED_DEV_PECI] = 197, [ASPEED_DEV_SDHCI] = 197, };
Signature · 1 line
2.52.0
[PULL 09/45] tests/functional/arm/test_aspeed_ast2500: Update test ASPEED SDK v10.00
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
--- tests/functional/arm/test_aspeed_ast2500.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tests/functional/arm/test_aspeed_ast2500.py +4 -4
@@ -37,14 +37,14 @@ def test_arm_ast2500_evb_buildroot(self): self.do_test_arm_aspeed_buildroot_poweroff() - ASSET_SDK_V908_AST2500 = Asset( - 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.08/ast2500-default-obmc.tar.gz', - 'c0a2ba169efd19be5eb77c50ec2a6afd9d826e196a0be3432f969fc72d4b7c0e') + ASSET_SDK_V1000_AST2500 = Asset( + 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v10.00/ast2500-default-obmc.tar.gz', + '7d71a3f71d5f4d9f3451f59a73bf9baf8fd9f6a24107eb504a3216151a8b2b5b') def test_arm_ast2500_evb_sdk(self): self.set_machine('ast2500-evb') - self.archive_extract(self.ASSET_SDK_V908_AST2500) + self.archive_extract(self.ASSET_SDK_V1000_AST2500) self.do_test_arm_aspeed_sdk_start( self.scratch_file("ast2500-default", "image-bmc"))
Signature · 1 line
2.52.0
[PULL 01/45] pc-bios: Update vbootrom image to commit 1c8e9510b22c
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
Full changelog since last update (183c9ff8056b) :
Joe Komlodi (1):
npcm8xx: Fix u-boot copy size
Jamin Lin (3):
ast27x0: refactor FIT boot loader into fmc_image.c for future Caliptra Manifest support
ast27x0: Add Caliptra Manifest boot support and MCU runtime loader framework
ast27x0: Fix compilation issues on Ubuntu 22.04
Compiled with gcc version 13.3.0
--- pc-bios/ast27x0_bootrom.bin | Bin 16408 -> 28564 bytes pc-bios/npcm7xx_bootrom.bin | Bin 672 -> 736 bytes pc-bios/npcm8xx_bootrom.bin | Bin 672 -> 672 bytes roms/vbootrom | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-)
pc-bios/ast27x0_bootrom.bin binary +0 -0
pc-bios/npcm7xx_bootrom.bin binary +0 -0
pc-bios/npcm8xx_bootrom.bin binary +0 -0
roms/vbootrom +1 -1
@@ -1 +1 @@ -Subproject commit 183c9ff8056b7946db1ae49cc23e8980ac413174 +Subproject commit 1c8e9510b22c5b0fd7d7753f08042a4bcbd2939d
Signature · 1 line
2.52.0
[PULL 30/45] hw/arm/aspeed: Attach LTPI controller to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the LTPI controller to the AST1700 model by mapping its MMIO region.
--- include/hw/arm/aspeed_ast1700.h | 3 +++ hw/arm/aspeed_ast1700.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+)
include/hw/arm/aspeed_ast1700.h +3 -0
@@ -9,6 +9,7 @@#define ASPEED_AST1700_H #include "hw/core/sysbus.h" +#include "hw/misc/aspeed_ltpi.h" #define TYPE_ASPEED_AST1700 "aspeed.ast1700"
@@ -18,6 +19,8 @@ struct AspeedAST1700SoCState {SysBusDevice parent_obj;MemoryRegion iomem; + + AspeedLTPIState ltpi; };#endif /* ASPEED_AST1700_H */
hw/arm/aspeed_ast1700.c +28 -0
@@ -13,6 +13,14 @@#define AST2700_SOC_LTPI_SIZE 0x01000000 +enum { +ASPEED_AST1700_DEV_LTPI_CTRL , +}; + +static const hwaddr aspeed_ast1700_io_memmap[] = { + [ASPEED_AST1700_DEV_LTPI_CTRL ] =0x00C34000 , +}; +static void aspeed_ast1700_realize (DeviceState *dev,Error **errp) {AspeedAST1700SoCState *s =ASPEED_AST1700 (dev);
@@ -22,6 +30,25 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)memory_region_init (&s->iomem,OBJECT (s),TYPE_ASPEED_AST1700 ,AST2700_SOC_LTPI_SIZE );sysbus_init_mmio (sbd, &s->iomem); + +/* LTPI controller */ +if (!sysbus_realize (SYS_BUS_DEVICE (&s->ltpi), errp)) { +return ; + } +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_LTPI_CTRL ], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->ltpi),0 )); +} + +static void aspeed_ast1700_instance_init (Object *obj) +{ +AspeedAST1700SoCState *s =ASPEED_AST1700 (obj); + +/* LTPI controller */ +object_initialize_child (obj,"ltpi-ctrl" , + &s->ltpi,TYPE_ASPEED_LTPI ); + +return ; }static void aspeed_ast1700_class_init (ObjectClass *klass,const void *data)
@@ -36,6 +63,7 @@ static const TypeInfo aspeed_ast1700_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(AspeedAST1700SoCState), .class_init = aspeed_ast1700_class_init, + .instance_init = aspeed_ast1700_instance_init, };static void aspeed_ast1700_register_types (void )
Signature · 1 line
2.52.0
[PULL 28/45] hw/arm/aspeed: Integrate AST1700 device into AST27X0
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the AST1700 device as a child of the AST27X0 model to reflect its role in DC-SCM 2.0 LTPI-based architectures. This patch wires the AST1700 device into the platform without introducing functional peripherals.
This forms the base for LTPI expander emulation in QEMU using AST27X0 as the host controller.
Note: ioexp_num is set to 0 at this stage. Once all related devices and interrupts are fully implemented, ioexp_num will be updated to its expected value. This ensures the machine remains functional at every commit and avoids potential compiler or build issues.
--- include/hw/arm/aspeed_soc.h | 7 +++++-- hw/arm/aspeed_ast27x0.c | 26 ++++++++++++++++++-------- 2 files changed, 23 insertions(+), 10 deletions(-)
include/hw/arm/aspeed_soc.h +5 -2
@@ -45,6 +45,7 @@#include "hw/char/serial-mm.h" #include "hw/intc/arm_gicv3.h" #include "hw/misc/aspeed_ltpi.h" +#include "hw/arm/aspeed_ast1700.h" #define VBOOTROM_FILE_NAME "ast27x0_bootrom.bin"
@@ -112,10 +113,10 @@ struct AspeedSoCState {UnimplementedDeviceState dpmcu;UnimplementedDeviceState espi;UnimplementedDeviceState udc; -UnimplementedDeviceState ltpi;UnimplementedDeviceState jtag[ASPEED_JTAG_NUM ];AspeedAPB2OPBState fsi[2 ];AspeedLTPIState ltpi_ctrl[ASPEED_IOEXP_NUM ]; +AspeedAST1700SoCState ioexp[ASPEED_IOEXP_NUM ]; };#define TYPE_ASPEED_SOC "aspeed-soc"
@@ -178,6 +179,7 @@ struct AspeedSoCClass {int macs_num;int uarts_num;int uarts_base; +int ioexp_num;const int *irqmap;const hwaddr *memmap;uint32_t num_cpus;
@@ -190,7 +192,6 @@ enum {ASPEED_DEV_IOMEM ,ASPEED_DEV_IOMEM0 ,ASPEED_DEV_IOMEM1 , -ASPEED_DEV_LTPI ,ASPEED_DEV_UART0 ,ASPEED_DEV_UART1 , ASPEED_DEV_UART2,
@@ -285,6 +286,8 @@ enum {ASPEED_DEV_IPC1 ,ASPEED_DEV_LTPI_CTRL1 ,ASPEED_DEV_LTPI_CTRL2 , +ASPEED_DEV_LTPI_IO0 , + ASPEED_DEV_LTPI_IO1, };const char *aspeed_soc_cpu_type (const char *const *valid_cpu_types);
hw/arm/aspeed_ast27x0.c +18 -8
@@ -26,7 +26,6 @@#define AST2700_SOC_IO_SIZE 0x00FE0000#define AST2700_SOC_IOMEM_SIZE 0x01000000#define AST2700_SOC_DPMCU_SIZE 0x00040000 -#define AST2700_SOC_LTPI_SIZE 0x01000000static const hwaddr aspeed_soc_ast2700_memmap[] = { [ASPEED_DEV_VBOOTROM ] =0x00000000 ,
@@ -91,7 +90,8 @@ static const hwaddr aspeed_soc_ast2700_memmap[] = { [ASPEED_DEV_LTPI_CTRL1] = 0x14C34000, [ASPEED_DEV_LTPI_CTRL2] = 0x14C35000, [ASPEED_DEV_WDT] = 0x14C37000, - [ASPEED_DEV_LTPI] = 0x30000000, + [ASPEED_DEV_LTPI_IO0] = 0x30000000, + [ASPEED_DEV_LTPI_IO1] = 0x50000000, [ASPEED_DEV_PCIE_MMIO0] = 0x60000000, [ASPEED_DEV_PCIE_MMIO1] = 0x80000000, [ASPEED_DEV_PCIE_MMIO2] = 0xA0000000,
@@ -498,10 +498,14 @@ static void aspeed_soc_ast2700_init(Object *obj) &s->ltpi_ctrl[i], TYPE_ASPEED_LTPI); } +for (i =0 ; i < sc->ioexp_num; i++) { +/* AST1700 IOEXP */ +object_initialize_child (obj,"ioexp[*]" , &s->ioexp[i], +TYPE_ASPEED_AST1700 ); + } +object_initialize_child (obj,"dpmcu" , &s->dpmcu,TYPE_UNIMPLEMENTED_DEVICE ); -object_initialize_child (obj,"ltpi" , &s->ltpi, -TYPE_UNIMPLEMENTED_DEVICE );object_initialize_child (obj,"iomem" , &s->iomem,TYPE_UNIMPLEMENTED_DEVICE ); object_initialize_child(obj, "iomem0", &s->iomem0,
@@ -995,14 +999,19 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)aspeed_mmio_map (s->memory,SYS_BUS_DEVICE (ltpi_ctrl),0 , ltpi_base); } +/* IO Expander */ +for (i =0 ; i < sc->ioexp_num; i++) { +if (!sysbus_realize (SYS_BUS_DEVICE (&s->ioexp[i]), errp)) { +return ; + } +sysbus_mmio_map (SYS_BUS_DEVICE (&s->ioexp[i]),0 , + sc->memmap[ASPEED_DEV_LTPI_IO0 + i]); + } +aspeed_mmio_map_unimplemented (s->memory,SYS_BUS_DEVICE (&s->dpmcu),"aspeed.dpmcu" , sc->memmap[ASPEED_DEV_DPMCU ],AST2700_SOC_DPMCU_SIZE ); -aspeed_mmio_map_unimplemented (s->memory,SYS_BUS_DEVICE (&s->ltpi), -"aspeed.ltpi" , - sc->memmap[ASPEED_DEV_LTPI ], -AST2700_SOC_LTPI_SIZE ); aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->iomem), "aspeed.io", sc->memmap[ASPEED_DEV_IOMEM],
@@ -1041,6 +1050,7 @@ static void aspeed_soc_ast2700a1_class_init(ObjectClass *oc, const void *data) sc->macs_num =3 ; sc->uarts_num =13 ; sc->num_cpus =4 ; + sc->ioexp_num =0 ; sc->uarts_base =ASPEED_DEV_UART0 ; sc->irqmap = aspeed_soc_ast2700a1_irqmap; sc->memmap = aspeed_soc_ast2700_memmap;
Signature · 1 line
2.52.0
[PULL 15/45] tests/functional/arm/test_aspeed_ast1030: Update test ASPEED Zephyr SDK v03.05
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
--- tests/functional/arm/test_aspeed_ast1030.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
tests/functional/arm/test_aspeed_ast1030.py +6 -6
@@ -12,17 +12,17 @@ class AST1030Machine(AspeedTest): - ASSET_ZEPHYR_3_03 = Asset( + ASSET_ZEPHYR_3_05 = Asset( ('https://github.com/AspeedTech-BMC' - '/zephyr/releases/download/v00.03.03/ast1030-evb-demo.zip'), - '27cd73cdee6374bceb4ee58b3ace87989fa3f0684f4e612510804b588b24d4e0') + '/zephyr/releases/download/v00.03.05/ast1030-evb-demo.zip'), + '057528d343490b1fbb5a721e91084b4f04fec60dc114bd65e724554f9c217f4b') - def test_arm_ast1030_zephyros_3_03(self): + def test_arm_ast1030_zephyros_3_05(self): self.set_machine('ast1030-evb') kernel_name = "ast1030-evb-demo/zephyr.elf" kernel_file = self.archive_extract( - self.ASSET_ZEPHYR_3_03, member=kernel_name) + self.ASSET_ZEPHYR_3_05, member=kernel_name) self.vm.set_console() self.vm.add_args('-kernel', kernel_file, '-nographic')
@@ -72,7 +72,7 @@ def test_arm_ast1030_otp_blockdev_device(self): self.vm.set_machine("ast1030-evb") kernel_name = "ast1030-evb-demo/zephyr.elf" - kernel_file = self.archive_extract(self.ASSET_ZEPHYR_3_03, + kernel_file = self.archive_extract(self.ASSET_ZEPHYR_3_05, member=kernel_name) otp_img = self.generate_otpmem_image()
Signature · 1 line
2.52.0
[PULL 13/45] tests/functional/arm/test_aspeed_ast2600_sdk: Update test ASPEED SDK v11.00
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
Drop root device and set root bus number to 0.
--- .../functional/arm/test_aspeed_ast2600_sdk.py | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-)
tests/functional/arm/test_aspeed_ast2600_sdk.py +9 -13
@@ -14,22 +14,18 @@ class AST2600Machine(AspeedTest): - ASSET_SDK_V908_AST2600 = Asset( - 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.08/ast2600-default-obmc.tar.gz', - 'a0414f14ad696550efe083c2156dbeda855c08cc9ae7f40fe1b41bf292295f82') + ASSET_SDK_V1100_AST2600 = Asset( + 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.00/ast2600-default-obmc.tar.gz', + '64d8926a7d01b649168be96c986603b5690f06391286c438a3a772c8c7039e93') def do_ast2600_pcie_test(self): exec_command_and_wait_for_pattern(self, - 'lspci -s 80:00.0', - '80:00.0 Host bridge: ' - 'ASPEED Technology, Inc. Device 2600') - exec_command_and_wait_for_pattern(self, - 'lspci -s 80:08.0', - '80:08.0 PCI bridge: ' + 'lspci -s 00:08.0', + '00:08.0 PCI bridge: ' 'ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge') exec_command_and_wait_for_pattern(self, - 'lspci -s 81:00.0', - '81:00.0 Ethernet controller: ' + 'lspci -s 01:00.0', + '01:00.0 Ethernet controller: ' 'Intel Corporation 82574L Gigabit Network Connection') exec_command_and_wait_for_pattern(self, 'ip addr show dev eth4',
@@ -39,7 +35,7 @@ def test_arm_ast2600_evb_sdk(self): self.set_machine('ast2600-evb') self.require_netdev('user') - self.archive_extract(self.ASSET_SDK_V908_AST2600) + self.archive_extract(self.ASSET_SDK_V1100_AST2600) self.vm.add_args('-device', 'tmp105,bus=aspeed.i2c.bus.5,address=0x4d,id=tmp-test')
@@ -77,7 +73,7 @@ def test_arm_ast2600_evb_sdk(self): def test_arm_ast2600_otp_blockdev_device(self): self.vm.set_machine("ast2600-evb") - image_path = self.archive_extract(self.ASSET_SDK_V908_AST2600) + image_path = self.archive_extract(self.ASSET_SDK_V1100_AST2600) otp_img = self.generate_otpmem_image() self.vm.set_console()
Signature · 1 line
2.52.0
[PULL 14/45] tests/functional/arm/test_aspeed_ast1060: Update test aspeed-zephyr-project v03.04
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
--- tests/functional/arm/test_aspeed_ast1060.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
tests/functional/arm/test_aspeed_ast1060.py +7 -7
@@ -11,18 +11,18 @@ class AST1060Machine(AspeedTest): - ASSET_ASPEED_AST1060_PROT_3_02 = Asset( + ASSET_ASPEED_AST1060_PROT_3_04 = Asset( ('https://github.com/AspeedTech-BMC' - '/aspeed-zephyr-project/releases/download/v03.02' - '/ast1060_prot_v03.02.tgz'), - 'dd5f1adc935316ddd1906506a02e15567bd7290657b52320f1a225564cc175bd') + '/aspeed-zephyr-project/releases/download/v03.04' + '/ast1060_prot_v03.04.tgz'), + 'c0319df55f5b7a547efefc5a6ba374b881223d5fe1a776bfdd36f97fd1f31d50') - def test_arm_ast1060_prot_3_02(self): + def test_arm_ast1060_prot_3_04(self): self.set_machine('ast1060-evb') kernel_name = "ast1060_prot/zephyr.bin" kernel_file = self.archive_extract( - self.ASSET_ASPEED_AST1060_PROT_3_02, member=kernel_name) + self.ASSET_ASPEED_AST1060_PROT_3_04, member=kernel_name) self.vm.set_console() self.vm.add_args('-kernel', kernel_file, '-nographic')
@@ -35,7 +35,7 @@ def test_arm_ast1060_otp_blockdev_device(self): self.vm.set_machine("ast1060-evb") kernel_name = "ast1060_prot/zephyr.bin" - kernel_file = self.archive_extract(self.ASSET_ASPEED_AST1060_PROT_3_02, + kernel_file = self.archive_extract(self.ASSET_ASPEED_AST1060_PROT_3_04, member=kernel_name) otp_img = self.generate_otpmem_image()
Signature · 1 line
2.52.0
[PULL 18/45] hw/arm/aspeed_ast27x0: Sort SSP and TSP IRQ maps
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
Sort the SSP and TSP IRQ map tables to improve readability and make the definitions easier to maintain.
No functional change.
--- hw/arm/aspeed_ast27x0-ssp.c | 4 ++-- hw/arm/aspeed_ast27x0-tsp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
hw/arm/aspeed_ast27x0-ssp.c +2 -2
@@ -44,12 +44,13 @@ static const hwaddr aspeed_soc_ast27x0ssp_memmap[] = { };static const int aspeed_soc_ast27x0ssp_irqmap[] = { + [ASPEED_DEV_UART4 ] =8 , [ASPEED_DEV_SCU ] =12 , + [ASPEED_DEV_TIMER1 ] =16 , [ASPEED_DEV_UART0 ] =164 , [ASPEED_DEV_UART1 ] =164 , [ASPEED_DEV_UART2 ] =164 , [ASPEED_DEV_UART3 ] =164 , - [ASPEED_DEV_UART4 ] =8 , [ASPEED_DEV_UART5 ] =164 , [ASPEED_DEV_UART6 ] =164 , [ASPEED_DEV_UART7 ] =164 ,
@@ -58,7 +59,6 @@ static const int aspeed_soc_ast27x0ssp_irqmap[] = { [ASPEED_DEV_UART10] = 164, [ASPEED_DEV_UART11] = 164, [ASPEED_DEV_UART12] = 164, - [ASPEED_DEV_TIMER1] = 16, };/* SSPINT 164 */
hw/arm/aspeed_ast27x0-tsp.c +2 -2
@@ -44,12 +44,13 @@ static const hwaddr aspeed_soc_ast27x0tsp_memmap[] = { };static const int aspeed_soc_ast27x0tsp_irqmap[] = { + [ASPEED_DEV_UART4 ] =8 , [ASPEED_DEV_SCU ] =12 , + [ASPEED_DEV_TIMER1 ] =16 , [ASPEED_DEV_UART0 ] =164 , [ASPEED_DEV_UART1 ] =164 , [ASPEED_DEV_UART2 ] =164 , [ASPEED_DEV_UART3 ] =164 , - [ASPEED_DEV_UART4 ] =8 , [ASPEED_DEV_UART5 ] =164 , [ASPEED_DEV_UART6 ] =164 , [ASPEED_DEV_UART7 ] =164 ,
@@ -58,7 +59,6 @@ static const int aspeed_soc_ast27x0tsp_irqmap[] = { [ASPEED_DEV_UART10] = 164, [ASPEED_DEV_UART11] = 164, [ASPEED_DEV_UART12] = 164, - [ASPEED_DEV_TIMER1] = 16, };/* TSPINT 164 */
Signature · 1 line
2.52.0
[PULL 26/45] hw/misc: Add basic Aspeed PWM model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Add an initial PWM model for Aspeed SoCs, including device state, register definitions, and basic initialization as a sysbus device.
--- include/hw/arm/aspeed_soc.h | 3 +- include/hw/misc/aspeed_pwm.h | 30 +++++++++ hw/misc/aspeed_pwm.c | 120 +++++++++++++++++++++++++++++++++++ hw/misc/meson.build | 1 + hw/misc/trace-events | 4 ++ 5 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 include/hw/misc/aspeed_pwm.h create mode 100644 hw/misc/aspeed_pwm.c
include/hw/arm/aspeed_soc.h +2 -1
@@ -28,6 +28,7 @@#include "hw/misc/aspeed_hace.h" #include "hw/misc/aspeed_sbc.h" #include "hw/misc/aspeed_sli.h" +#include "hw/misc/aspeed_pwm.h" #include "hw/watchdog/wdt_aspeed.h" #include "hw/net/ftgmac100.h" #include "target/arm/cpu.h"
@@ -88,6 +89,7 @@ struct AspeedSoCState {MemoryRegion secsram;UnimplementedDeviceState sbc_unimplemented;AspeedSDMCState sdmc; +AspeedPWMState pwm;AspeedWDTState wdt[ASPEED_WDTS_NUM ];FTGMAC100State ftgmac100[ASPEED_MACS_NUM ];AspeedMiiState mii[ASPEED_MACS_NUM ];
@@ -108,7 +110,6 @@ struct AspeedSoCState {UnimplementedDeviceState video;UnimplementedDeviceState emmc_boot_controller;UnimplementedDeviceState dpmcu; -UnimplementedDeviceState pwm;UnimplementedDeviceState espi;UnimplementedDeviceState udc;UnimplementedDeviceState ltpi;
include/hw/misc/aspeed_pwm.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* ASPEED PWM Controller +* +* Copyright (C) 2017-2021 IBM Corp. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef ASPEED_PWM_H +#define ASPEED_PWM_H + +#include "hw/core/sysbus.h" + +#define TYPE_ASPEED_PWM "aspeed.pwm" +#define ASPEED_PWM (obj) OBJECT_CHECK(AspeedPWMState, (obj), TYPE_ASPEED_PWM) + +#define ASPEED_PWM_NR_REGS (0x10C >> 2) + +typedef struct AspeedPWMState { +/* <private> */ +SysBusDevice parent; + +/*< public >*/ +MemoryRegion iomem; +qemu_irq irq; + +uint32_t regs[ASPEED_PWM_NR_REGS ]; +}AspeedPWMState ; + +#endif /* _ASPEED_PWM_H_ */
hw/misc/aspeed_pwm.c new file +120 -0
120 lines not on this page · raw message
hw/misc/meson.build +1 -0
@@ -138,6 +138,7 @@ system_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files( 'aspeed_i3c.c', 'aspeed_lpc.c', 'aspeed_ltpi.c', + 'aspeed_pwm.c', 'aspeed_scu.c', 'aspeed_sbc.c', 'aspeed_sdmc.c',
hw/misc/trace-events +4 -0
@@ -299,6 +299,10 @@ aspeed_i3c_write(uint64_t offset, uint64_t data) "I3C write: offset 0x%" PRIx64 aspeed_i3c_device_read(uint32_t deviceid, uint64_t offset, uint64_t data) "I3C Dev[%u] read: offset 0x%" PRIx64 " data 0x%" PRIx64 aspeed_i3c_device_write(uint32_t deviceid, uint64_t offset, uint64_t data) "I3C Dev[%u] write: offset 0x%" PRIx64 " data 0x%" PRIx64 +# aspeed_pwm.c +aspeed_pwm_read(uint64_t offset, uint64_t data) "read: offset 0x%" PRIx64 " data 0x%" PRIx64 +aspeed_pwm_write(uint64_t offset, uint64_t data) "write: offset 0x%" PRIx64 " data 0x%" PRIx64 + # aspeed_sdmc.c aspeed_sdmc_write(uint64_t reg, uint64_t data) "reg @0x%" PRIx64 " data: 0x%" PRIx64 aspeed_sdmc_read(uint64_t reg, uint64_t data) "reg @0x%" PRIx64 " data: 0x%" PRIx64
Signature · 1 line
2.52.0
Re: [PULL 26/45] hw/misc: Add basic Aspeed PWM model
Hi Kane,
Quoted 21 lines · Cédric Le Goater
From: Kane Chen <[email protected]>
Add an initial PWM model for Aspeed SoCs, including device state, register definitions, and basic initialization as a sysbus device.
Signed-off-by Cédric Le Goater <[email protected]>Signed-off-by Kane-Chen-AS <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>--- include/hw/arm/aspeed_soc.h | 3 +- include/hw/misc/aspeed_pwm.h | 30 +++++++++ hw/misc/aspeed_pwm.c | 120 +++++++++++++++++++++++++++++++++++ hw/misc/meson.build | 1 + hw/misc/trace-events | 4 ++ 5 files changed, 157 insertions(+), 1 deletion(-)create mode 100644
include/hw/misc/aspeed_pwm.h
create mode 100644hw/misc/aspeed_pwm.c
hw/misc/aspeed_pwm.c line 103
Quoted 8 lines
hw/misc/aspeed_pwm.c +6
-0+static void aspeed_pwm_class_init (ObjectClass *klass,const void *data) +{ +DeviceClass *dc =DEVICE_CLASS (klass); + + dc->realize = aspeed_pwm_realize; +device_class_set_legacy_reset (dc, aspeed_pwm_reset);
Also please do not use the legacy API. See for example this commit to convert to the newer API:
https://gitlab.com/qemu-project/qemu/-/commit/ce788d3740f
Quoted 3 lines
hw/misc/aspeed_pwm.c +3
-0+ dc->desc ="Aspeed PWM Controller" ; + dc->vmsd = &vmstate_aspeed_pwm; +}
Re: [PULL 26/45] hw/misc: Add basic Aspeed PWM model
Quoted 26 lines · Philippe Mathieu-Daudé
Hi Kane,
Quoted 21 lines · Cédric Le Goater
From: Kane Chen <[email protected]>
Add an initial PWM model for Aspeed SoCs, including device state, register definitions, and basic initialization as a sysbus device.
Signed-off-by Cédric Le Goater <[email protected]>Signed-off-by Kane-Chen-AS <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>---
include/hw/arm/aspeed_soc.h | 3 +-include/hw/misc/aspeed_pwm.h| 30 +++++++++ hw/misc/aspeed_pwm.c | 120 +++++++++++++++++++++++++++++++++++ hw/misc/meson.build | 1 +
hw/misc/trace-events | 4 ++5 files changed, 157 insertions(+), 1 deletion(-)create mode 100644
include/hw/misc/aspeed_pwm.h
create mode 100644hw/misc/aspeed_pwm.chw/misc/aspeed_pwm.c +0
-0
Quoted 10 lines
hw/misc/aspeed_pwm.c line 103
Quoted 6 lines
hw/misc/aspeed_pwm.c +6
-0+static void aspeed_pwm_class_init (ObjectClass *klass,const void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->realize = aspeed_pwm_realize; + device_class_set_legacy_reset(dc, aspeed_pwm_reset);Also please do not use the legacy API. See for example this commit to convert to the newer API:
https://gitlab.com/qemu-project/qemu/-/commit/ce788d3740f
Oh ! I think this patch is from 2017 and we didn't refresh it when it was sent :/
So, yes, Kane, if you have time for this QEMU cycle, that would be nice.
Thanks,
C.
Quoted 5 lines
Quoted 4 lines
+
dc->desc= "Aspeed PWM Controller";
+dc->vmsd=&vmstate_aspeed_pwm;
+}
RE: [PULL 26/45] hw/misc: Add basic Aspeed PWM model
Quoted 49 lines
-----Original Message-----
From: Cédric Le Goater <[email protected]>
Sent: Thursday, May 21, 2026 12:44 AM
To: Philippe Mathieu-Daudé <[email protected]>; Cédric Le Goater <[email protected]>; [email protected]; [email protected]
Cc: Kane Chen <[email protected]>
Subject: Re: [PULL 26/45] hw/misc: Add basic Aspeed PWM modelQuoted 29 lines · Philippe Mathieu-Daudé
Hi Kane,
Quoted 24 lines · Cédric Le Goater
From: Kane Chen <[email protected]>
Add an initial PWM model for Aspeed SoCs, including device state, register definitions, and basic initialization as a sysbus device.
Signed-off-by Cédric Le Goater <[email protected]>Signed-off-by Kane-Chen-AS <[email protected]>Link:
https://lore.kernel.org/qemu-devel/20260204082113.3955407-4-kane_chen
@aspeedtech.comSigned-off-by Cédric Le Goater <[email protected]>---
include/hw/arm/aspeed_soc.h | 3 +-
include/hw/misc/aspeed_pwm.h| 30 +++++++++
hw/misc/aspeed_pwm.c | 120
+++++++++++++++++++++++++++++++++++
hw/misc/meson.build | 1 +
hw/misc/trace-events | 4 ++5 files changed, 157 insertions(+), 1 deletion(-)create mode 100644
include/hw/misc/aspeed_pwm.h
create mode 100644hw/misc/aspeed_pwm.chw/misc/aspeed_pwm.c +0
-0Quoted 10 lines
hw/misc/aspeed_pwm.c line 103
Quoted 6 lines
hw/misc/aspeed_pwm.c +6
-0+static void aspeed_pwm_class_init (ObjectClass *klass,const void +*data) { + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->realize = aspeed_pwm_realize; + device_class_set_legacy_reset(dc, aspeed_pwm_reset);Also please do not use the legacy API. See for example this commit to convert to the newer API:
https://gitlab.com/qemu-project/qemu/-/commit/ce788d3740f
Quoted 7 lines
Oh ! I think this patch is from 2017 and we didn't refresh it when it was sent :/
So, yes, Kane, if you have time for this QEMU cycle, that would be nice.
Thanks,
C.
Hi Philippe,
Thanks for pointing this out.
Hi Cédric,
I currently have a few tasks on hand. Once I finish them, I will submit a code change to use the new API.
Best Regards,
Kane
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
+
dc->desc= "Aspeed PWM Controller";
+dc->vmsd=&vmstate_aspeed_pwm;
+}
[PULL 43/45] tests/functional/aarch64: Parameterize I2C bus ID in AST2700 test
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
The current Aspeed AST2700 functional test case strictly uses I2C bus 1 for its sensor tests. This hard-coded approach prevents the test logic from being reused for other machine types or configurations where I2C bus 1 might be disabled or where a different bus needs to be verified (e.g., I2C expanders).
This refactoring allows the same I2C verification logic to be shared across different test scenarios by simply passing the target bus number.
--- .../functional/aarch64/test_aspeed_ast2700.py | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-)
tests/functional/aarch64/test_aspeed_ast2700.py +23 -16
@@ -15,11 +15,17 @@ class AST2x00MachineSDK(QemuSystemTest): - def do_test_aarch64_aspeed_sdk_start(self, image): + def do_test_aarch64_aspeed_sdk_start(self, image, bus_id): + bus_str = str(bus_id) self.require_netdev('user') self.vm.set_console() - self.vm.add_args('-device', - 'tmp105,bus=aspeed.i2c.bus.1,address=0x4d,id=tmp-test') + self.vm.add_args( + '-device', + f'tmp105,' + f'bus=aspeed.i2c.bus.{bus_str},' + f'address=0x4d,' + f'id=tmp-test-{bus_str}' + ) self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw', '-net', 'nic', '-net', 'user', '-snapshot')
@@ -75,16 +81,17 @@ def verify_openbmc_boot_and_login(self, name): 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.00/ast2700-a1-obmc.tar.gz', 'd5ceed511cd0dfefbb102fff2d731159e0472948a28066dc0d90bcd54be76525') - def do_ast2700_i2c_test(self): + def do_ast2700_i2c_test(self, bus_id): + bus_str = str(bus_id) exec_command_and_wait_for_pattern(self, - 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-1/device/new_device ', - 'i2c i2c-1: new_device: Instantiated device lm75 at 0x4d') + f'echo lm75 0x4d > /sys/class/i2c-dev/i2c-{bus_str}/device/new_device ', + f'i2c i2c-{bus_str}: new_device: Instantiated device lm75 at 0x4d') exec_command_and_wait_for_pattern(self, - 'cat /sys/bus/i2c/devices/1-004d/hwmon/hwmon*/temp1_input', '0') - self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', + f'cat /sys/bus/i2c/devices/{bus_str}-004d/hwmon/hwmon*/temp1_input', '0') + self.vm.cmd('qom-set', path=f'/machine/peripheral/tmp-test-{bus_str}', property='temperature', value=18000) exec_command_and_wait_for_pattern(self, - 'cat /sys/bus/i2c/devices/1-004d/hwmon/hwmon*/temp1_input', '18000') + f'cat /sys/bus/i2c/devices/{bus_str}-004d/hwmon/hwmon*/temp1_input', '18000') def do_ast2700_pcie_test(self): exec_command_and_wait_for_pattern(self,
@@ -99,7 +106,7 @@ def do_ast2700_pcie_test(self): 'ip addr show dev eth2', 'inet 10.0.2.15/24') - def start_ast2700_test(self, name): + def start_ast2700_test(self, name, bus_id): num_cpu = 4 load_images_list = [ {
@@ -128,12 +135,12 @@ def start_ast2700_test(self, name): self.vm.add_args('-smp', str(num_cpu)) self.do_test_aarch64_aspeed_sdk_start( - self.scratch_file(name, 'image-bmc')) + self.scratch_file(name, 'image-bmc'), bus_id) - def start_ast2700_test_vbootrom(self, name): + def start_ast2700_test_vbootrom(self, name, bus_id): self.vm.add_args('-bios', 'ast27x0_bootrom.bin') self.do_test_aarch64_aspeed_sdk_start( - self.scratch_file(name, 'image-bmc')) + self.scratch_file(name, 'image-bmc'), bus_id) def test_aarch64_ast2700a1_evb_sdk_v11_00(self): self.set_machine('ast2700a1-evb')
@@ -142,9 +149,9 @@ def test_aarch64_ast2700a1_evb_sdk_v11_00(self): self.archive_extract(self.ASSET_SDK_V1100_AST2700A1) self.vm.add_args('-device', 'e1000e,netdev=net1,bus=pcie.2') self.vm.add_args('-netdev', 'user,id=net1') - self.start_ast2700_test('ast2700-a1') + self.start_ast2700_test('ast2700-a1', 1) self.verify_openbmc_boot_and_login('ast2700-a1') - self.do_ast2700_i2c_test() + self.do_ast2700_i2c_test(1) self.do_ast2700_pcie_test() def test_aarch64_ast2700a1_evb_sdk_vbootrom_v11_00(self):
@@ -154,7 +161,7 @@ def test_aarch64_ast2700a1_evb_sdk_vbootrom_v11_00(self): self.archive_extract(self.ASSET_SDK_V1100_AST2700A1) self.vm.add_args('-device', 'e1000e,netdev=net1,bus=pcie.2') self.vm.add_args('-netdev', 'user,id=net1') - self.start_ast2700_test_vbootrom('ast2700-a1') + self.start_ast2700_test_vbootrom('ast2700-a1', 1) self.verify_vbootrom_firmware_flow() self.verify_openbmc_boot_start()
Signature · 1 line
2.52.0
[PULL 44/45] tests/functional/aarch64: Parameterize PCIe2 initialization in AST2700
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
The current AST2700 functional test forces PCIe2 enablement by manually manipulating U-Boot env and FDT via the console. This sequence interferes with test cases that rely on the default boot flow of the image.
Introduce a 'enable_pcie' parameter (defaulting to True) to both 'verify_openbmc_boot_start' and 'verify_openbmc_boot_and_login' methods. This allow test cases to toggle the PCIe2 initialization sequence based on their specific requirements without breaking standard boot tests.
--- tests/functional/aarch64/test_aspeed_ast2700.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
tests/functional/aarch64/test_aspeed_ast2700.py +5 -4
@@ -65,13 +65,14 @@ def enable_ast2700_pcie2(self): 'fdt set /soc@14000000/pcie@140d0000 status "okay"', '=>') exec_command(self, 'bootm go') - def verify_openbmc_boot_start(self): + def verify_openbmc_boot_start(self, enable_pcie=True): wait_for_console_pattern(self, 'U-Boot 2023.10') - self.enable_ast2700_pcie2() + if enable_pcie: + self.enable_ast2700_pcie2() wait_for_console_pattern(self, 'Linux version ') - def verify_openbmc_boot_and_login(self, name): - self.verify_openbmc_boot_start() + def verify_openbmc_boot_and_login(self, name, enable_pcie=True): + self.verify_openbmc_boot_start(enable_pcie) wait_for_console_pattern(self, f'{name} login:') exec_command_and_wait_for_pattern(self, 'root', 'Password:')
Signature · 1 line
2.52.0
[PULL 24/45] hw/misc: Add LTPI controller
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
LTPI (LVDS Tunneling Protocol & Interface) is defined in the OCP DC-SCM 2.0 specification:
https://www.opencompute.org/documents/ocp-dc-scm-2-0-ltpi-ver-1-0-pdf
LTPI is a protocol and physical interface for tunneling various low-speed signals between the HPM and SCM. As shown in Figure 2, the AST27x0 (left) integrates two LTPI controllers, allowing it to connect to up to two extended boards.
This commit introduces a simple device model for the ASPEED LTPI controller in QEMU.
The model includes basic MMIO read/write operations and sets default register values during reset to emulate a link-up state.
Implements register space with read/write callbacks.
--- include/hw/misc/aspeed_ltpi.h | 33 ++++++ hw/misc/aspeed_ltpi.c | 193 ++++++++++++++++++++++++++++++++++ hw/misc/meson.build | 1 + 3 files changed, 227 insertions(+) create mode 100644 include/hw/misc/aspeed_ltpi.h create mode 100644 hw/misc/aspeed_ltpi.c
include/hw/misc/aspeed_ltpi.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* ASPEED LTPI Controller +* +* Copyright (C) 2025 ASPEED Technology Inc. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ +#ifndef ASPEED_LTPI_H +#define ASPEED_LTPI_H + +#include "hw/core/sysbus.h" + +#define TYPE_ASPEED_LTPI "aspeed.ltpi-ctrl" +OBJECT_DECLARE_SIMPLE_TYPE(AspeedLTPIState, ASPEED_LTPI) + +#define ASPEED_LTPI_TOTAL_SIZE 0x900 +#define ASPEED_LTPI_CTRL_SIZE 0x200 +#define ASPEED_LTPI_PHY_SIZE 0x100 +#define ASPEED_LTPI_TOP_SIZE 0x100 + +struct AspeedLTPIState { +SysBusDevice parent; +MemoryRegion mmio; +MemoryRegion mmio_ctrl; +MemoryRegion mmio_phy; +MemoryRegion mmio_top; + +uint32_t ctrl_regs[ASPEED_LTPI_CTRL_SIZE >>2 ]; +uint32_t phy_regs[ASPEED_LTPI_PHY_SIZE >>2 ]; +uint32_t top_regs[ASPEED_LTPI_TOP_SIZE >>2 ]; +}; + +#endif /* ASPEED_LTPI_H */
hw/misc/aspeed_ltpi.c new file +193 -0
193 lines not on this page · raw message
hw/misc/meson.build +1 -0
@@ -137,6 +137,7 @@ system_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files( 'aspeed_hace.c', 'aspeed_i3c.c', 'aspeed_lpc.c', + 'aspeed_ltpi.c', 'aspeed_scu.c', 'aspeed_sbc.c', 'aspeed_sdmc.c',
Signature · 1 line
2.52.0
[PULL 08/45] hw/adc: Fix out-of-bounds write in Aspeed ADC model
In reply to Cédric Le GoaterThe 'regs' array has ASPEED_ADC_NR_REGS (52) elements, while the memory region covers offsets 0x00-0xFC. The aspeed_adc_engine_write() function has an out-of-bounds write vulnerability when accessing unimplemented registers.
Fix this by using 'return' instead of 'break' in the default case, which prevents execution from reaching the s->regs[reg] assignment for unimplemented registers.
--- hw/adc/aspeed_adc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/adc/aspeed_adc.c +2 -1
@@ -228,7 +228,8 @@ static void aspeed_adc_engine_write(void *opaque, hwaddr addr, uint64_t value,qemu_log_mask (LOG_UNIMP ,"%s: engine[%u]: " "0x%" HWADDR_PRIx" 0x%" PRIx64"\n" , __func__, s->engine_id, addr, value); -break ; +/* Do not update the regs[] array */ +return ; } s->regs[reg] = value;
Signature · 1 line
2.52.0
[PULL 39/45] hw/arm/aspeed: Attach PWM device to AST1700 model
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the PWM device to AST1700 model.
--- include/hw/arm/aspeed_ast1700.h | 2 ++ hw/arm/aspeed_ast1700.c | 13 +++++++++++++ 2 files changed, 15 insertions(+)
include/hw/arm/aspeed_ast1700.h +2 -0
@@ -14,6 +14,7 @@#include "hw/gpio/aspeed_gpio.h" #include "hw/i2c/aspeed_i2c.h" #include "hw/misc/aspeed_ltpi.h" +#include "hw/misc/aspeed_pwm.h" #include "hw/ssi/aspeed_smc.h" #include "hw/watchdog/wdt_aspeed.h" #include "hw/char/serial-mm.h"
@@ -40,6 +41,7 @@ struct AspeedAST1700SoCState {AspeedSCUState scu;AspeedGPIOState gpio;AspeedI2CState i2c; +AspeedPWMState pwm;AspeedWDTState wdt[AST1700_WDT_NUM ]; };
hw/arm/aspeed_ast1700.c +13 -0
@@ -18,6 +18,7 @@enum {ASPEED_AST1700_DEV_SPI0 , +ASPEED_AST1700_DEV_PWM ,ASPEED_AST1700_DEV_SRAM ,ASPEED_AST1700_DEV_ADC ,ASPEED_AST1700_DEV_SCU ,
@@ -31,6 +32,7 @@ enum {static const hwaddr aspeed_ast1700_io_memmap[] = { [ASPEED_AST1700_DEV_SPI0 ] =0x00030000 , + [ASPEED_AST1700_DEV_PWM ] =0x000C0000 , [ASPEED_AST1700_DEV_SRAM ] =0x00BC0000 , [ASPEED_AST1700_DEV_ADC ] =0x00C00000 , [ASPEED_AST1700_DEV_SCU ] =0x00C02000 ,
@@ -130,6 +132,14 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_I2C ], sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->i2c), 0)); +/* PWM */ +if (!sysbus_realize (SYS_BUS_DEVICE (&s->pwm), errp)) { +return ; + } +memory_region_add_subregion (&s->iomem, + aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_PWM ], +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->pwm),0 )); +/* LTPI controller */ if (!sysbus_realize (SYS_BUS_DEVICE (&s->ltpi), errp)) {return ;
@@ -183,6 +193,9 @@ static void aspeed_ast1700_instance_init(Object *obj)object_initialize_child (obj,"ioexp-i2c" , &s->i2c,"aspeed.i2c-ast2700" ); +/* PWM */ +object_initialize_child (obj,"pwm" , &s->pwm,TYPE_ASPEED_PWM ); +/* LTPI controller */ object_initialize_child (obj,"ltpi-ctrl" , &s->ltpi,TYPE_ASPEED_LTPI );
Signature · 1 line
2.52.0
[PULL 20/45] tests/functional/aarch64/test_aspeed_ast2700: Enable PCIe2 DTS status for AST2700 tests
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
PCIe2 is disabled by default starting from SDK v10.00.
Add a helper function to stop U-Boot autoboot and update the device tree at runtime, setting the PCIe2 node status to "okay" before booting Linux. This allows the AST2700 functional test to verify the PCIe2 root complex behavior correctly.
--- .../functional/aarch64/test_aspeed_ast2700.py | 18 ++++++++++++++++-- .../aarch64/test_aspeed_ast2700fc.py | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-)
tests/functional/aarch64/test_aspeed_ast2700.py +16 -2
@@ -9,7 +9,7 @@ import os from qemu_test import QemuSystemTest, Asset -from qemu_test import wait_for_console_pattern +from qemu_test import wait_for_console_pattern, exec_command from qemu_test import exec_command_and_wait_for_pattern
@@ -37,9 +37,23 @@ def verify_vbootrom_firmware_flow(self): wait_for_console_pattern(self, 'done') wait_for_console_pattern(self, 'Jumping to BL31 (Trusted Firmware-A)') + def enable_ast2700_pcie2(self): + wait_for_console_pattern(self, 'Hit any key to stop autoboot') + exec_command_and_wait_for_pattern(self, '\012', '=>') + exec_command_and_wait_for_pattern(self, + 'cp 100420000 403000000 900000', '=>') + exec_command_and_wait_for_pattern(self, + 'bootm start 403000000', '=>') + exec_command_and_wait_for_pattern(self, 'bootm loados', '=>') + exec_command_and_wait_for_pattern(self, 'bootm ramdisk', '=>') + exec_command_and_wait_for_pattern(self, 'bootm prep', '=>') + exec_command_and_wait_for_pattern(self, + 'fdt set /soc@14000000/pcie@140d0000 status "okay"', '=>') + exec_command(self, 'bootm go') + def verify_openbmc_boot_start(self): wait_for_console_pattern(self, 'U-Boot 2023.10') - wait_for_console_pattern(self, '## Loading kernel from FIT Image') + self.enable_ast2700_pcie2() wait_for_console_pattern(self, 'Linux version ') def verify_openbmc_boot_and_login(self, name):
tests/functional/aarch64/test_aspeed_ast2700fc.py +16 -2
@@ -9,7 +9,7 @@ import os from qemu_test import QemuSystemTest, Asset -from qemu_test import wait_for_console_pattern +from qemu_test import wait_for_console_pattern, exec_command from qemu_test import exec_command_and_wait_for_pattern
@@ -27,9 +27,23 @@ def do_test_aarch64_aspeed_sdk_start(self, image): self.vm.launch() + def enable_ast2700_pcie2(self): + wait_for_console_pattern(self, 'Hit any key to stop autoboot') + exec_command_and_wait_for_pattern(self, '\012', '=>') + exec_command_and_wait_for_pattern(self, + 'cp 100420000 403000000 900000', '=>') + exec_command_and_wait_for_pattern(self, + 'bootm start 403000000', '=>') + exec_command_and_wait_for_pattern(self, 'bootm loados', '=>') + exec_command_and_wait_for_pattern(self, 'bootm ramdisk', '=>') + exec_command_and_wait_for_pattern(self, 'bootm prep', '=>') + exec_command_and_wait_for_pattern(self, + 'fdt set /soc@14000000/pcie@140d0000 status "okay"', '=>') + exec_command(self, 'bootm go') + def verify_openbmc_boot_and_login(self, name): wait_for_console_pattern(self, 'U-Boot 2023.10') - wait_for_console_pattern(self, '## Loading kernel from FIT Image') + self.enable_ast2700_pcie2() wait_for_console_pattern(self, 'Starting kernel ...') wait_for_console_pattern(self, f'{name} login:')
Signature · 1 line
2.52.0
[PULL 23/45] docs/system/arm/aspeed: Load raw U-Boot image in AST2700 boot example
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
Recent SDK versions no longer provide a U-Boot FIT image, and U-Boot is now built as a single raw binary. Update the documentation to load the raw u-boot.bin image directly.
--- docs/system/arm/aspeed.rst | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
docs/system/arm/aspeed.rst +2 -6
@@ -350,11 +350,9 @@ corresponds to the BL31 image load address. .. code-block:: bash IMGDIR=ast2700-default - UBOOT_SIZE=$(stat --format=%s -L ${IMGDIR}/u-boot-nodtb.bin) $ qemu-system-aarch64 -M ast2700-evb \ - -device loader,force-raw=on,addr=0x400000000,file=${IMGDIR}/u-boot-nodtb.bin \ - -device loader,force-raw=on,addr=$((0x400000000 + ${UBOOT_SIZE})),file=${IMGDIR}/u-boot.dtb \ + -device loader,force-raw=on,addr=0x400000000,file=${IMGDIR}/u-boot.bin \ -device loader,force-raw=on,addr=0x430000000,file=${IMGDIR}/bl31.bin \ -device loader,force-raw=on,addr=0x430080000,file=${IMGDIR}/optee/tee-raw.bin \ -device loader,cpu-num=0,addr=0x430000000 \
@@ -409,11 +407,9 @@ Steps to boot the AST2700fc machine: .. code-block:: bash IMGDIR=ast2700-default - UBOOT_SIZE=$(stat --format=%s -L ${IMGDIR}/u-boot-nodtb.bin) $ qemu-system-aarch64 -M ast2700fc \ - -device loader,force-raw=on,addr=0x400000000,file=${IMGDIR}/u-boot-nodtb.bin \ - -device loader,force-raw=on,addr=$((0x400000000 + ${UBOOT_SIZE})),file=${IMGDIR}/u-boot.dtb \ + -device loader,force-raw=on,addr=0x400000000,file=${IMGDIR}/u-boot.bin \ -device loader,force-raw=on,addr=0x430000000,file=${IMGDIR}/bl31.bin \ -device loader,force-raw=on,addr=0x430080000,file=${IMGDIR}/optee/tee-raw.bin \ -device loader,cpu-num=0,addr=0x430000000 \
Signature · 1 line
2.52.0
[PULL 25/45] hw/arm/aspeed: Attach LTPI controller to AST27X0 platform
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the LTPI controller device (representing the AST1700 I/O expander) to the AST27X0 SoC model. This patch sets up the memory mapping and device registration according to the AST2700 SoC design, where the LTPI controller is exposed at fixed MMIO regions.
This change only handles device instantiation and integration, without implementing the controller's internal logic.
--- include/hw/arm/aspeed_soc.h | 5 +++++ hw/arm/aspeed_ast27x0.c | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+)
include/hw/arm/aspeed_soc.h +5 -0
@@ -43,6 +43,7 @@#include "hw/fsi/aspeed_apb2opb.h" #include "hw/char/serial-mm.h" #include "hw/intc/arm_gicv3.h" +#include "hw/misc/aspeed_ltpi.h" #define VBOOTROM_FILE_NAME "ast27x0_bootrom.bin"
@@ -55,6 +56,7 @@#define ASPEED_UARTS_NUM 13#define ASPEED_JTAG_NUM 2#define ASPEED_PCIE_NUM 3 +#define ASPEED_IOEXP_NUM 2struct AspeedSoCState {DeviceState parent;
@@ -112,6 +114,7 @@ struct AspeedSoCState {UnimplementedDeviceState ltpi;UnimplementedDeviceState jtag[ASPEED_JTAG_NUM ];AspeedAPB2OPBState fsi[2 ]; +AspeedLTPIState ltpi_ctrl[ASPEED_IOEXP_NUM ]; };#define TYPE_ASPEED_SOC "aspeed-soc"
@@ -279,6 +282,8 @@ enum {ASPEED_GIC_REDIST ,ASPEED_DEV_IPC0 ,ASPEED_DEV_IPC1 , +ASPEED_DEV_LTPI_CTRL1 , + ASPEED_DEV_LTPI_CTRL2, };const char *aspeed_soc_cpu_type (const char *const *valid_cpu_types);
hw/arm/aspeed_ast27x0.c +21 -0
@@ -88,6 +88,8 @@ static const hwaddr aspeed_soc_ast2700_memmap[] = { [ASPEED_DEV_UART10] = 0x14C33900, [ASPEED_DEV_UART11] = 0x14C33A00, [ASPEED_DEV_UART12] = 0x14C33B00, + [ASPEED_DEV_LTPI_CTRL1] = 0x14C34000, + [ASPEED_DEV_LTPI_CTRL2] = 0x14C35000, [ASPEED_DEV_WDT] = 0x14C37000, [ASPEED_DEV_LTPI] = 0x30000000, [ASPEED_DEV_PCIE_MMIO0] = 0x60000000,
@@ -491,6 +493,11 @@ static void aspeed_soc_ast2700_init(Object *obj)object_property_set_int (OBJECT (&s->pcie[i]),"id" , i, &error_abort); } +for (i =0 ; i <ASPEED_IOEXP_NUM ; i++) { +object_initialize_child (obj,"ltpi-ctrl[*]" , + &s->ltpi_ctrl[i],TYPE_ASPEED_LTPI ); + } +object_initialize_child (obj,"dpmcu" , &s->dpmcu,TYPE_UNIMPLEMENTED_DEVICE ); object_initialize_child(obj, "ltpi", &s->ltpi,
@@ -974,6 +981,20 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)return ; } +/* LTPI controller */ +for (i =0 ; i <ASPEED_IOEXP_NUM ; i++) { +AspeedLTPIState *ltpi_ctrl; +hwaddr ltpi_base; + + ltpi_ctrl =ASPEED_LTPI (&s->ltpi_ctrl[i]); + ltpi_base = sc->memmap[ASPEED_DEV_LTPI_CTRL1 + i]; + +if (!sysbus_realize (SYS_BUS_DEVICE (ltpi_ctrl), errp)) { +return ; + } +aspeed_mmio_map (s->memory,SYS_BUS_DEVICE (ltpi_ctrl),0 , ltpi_base); + } + aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->dpmcu), "aspeed.dpmcu", sc->memmap[ASPEED_DEV_DPMCU],
Signature · 1 line
2.52.0
[PULL 29/45] hw/arm/aspeed: Integrate interrupt controller for AST1700
In reply to Cédric Le GoaterFrom: Kane Chen <[email protected]>
Connect the AST1700 interrupt lines to the GIC in AST27X0, enabling the propagation of AST1700-originated interrupts to the host SoC.
This patch does not implement interrupt sources in AST1700 itself, only the wiring into AST27X0.
--- include/hw/arm/aspeed_soc.h | 6 +++- include/hw/intc/aspeed_intc.h | 2 ++ hw/arm/aspeed_ast27x0.c | 37 +++++++++++++++++++++ hw/intc/aspeed_intc.c | 60 +++++++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+), 1 deletion(-)
include/hw/arm/aspeed_soc.h +5 -1
@@ -58,6 +58,7 @@#define ASPEED_UARTS_NUM 13#define ASPEED_JTAG_NUM 2#define ASPEED_PCIE_NUM 3 +#define ASPEED_INTC_NUM 2#define ASPEED_IOEXP_NUM 2struct AspeedSoCState {
@@ -146,7 +147,8 @@ struct Aspeed27x0SoCState {AspeedSoCState parent;ARMCPU cpu[ASPEED_CPUS_NUM ]; -AspeedINTCState intc[2 ]; +AspeedINTCState intc[ASPEED_INTC_NUM ]; +AspeedINTCState intcioexp[ASPEED_IOEXP_NUM ];GICv3State gic;MemoryRegion dram_empty; };
@@ -288,6 +290,8 @@ enum {ASPEED_DEV_LTPI_CTRL2 ,ASPEED_DEV_LTPI_IO0 ,ASPEED_DEV_LTPI_IO1 , +ASPEED_DEV_IOEXP0_INTCIO , + ASPEED_DEV_IOEXP1_INTCIO, };const char *aspeed_soc_cpu_type (const char *const *valid_cpu_types);
include/hw/intc/aspeed_intc.h +2 -0
@@ -15,6 +15,8 @@#define TYPE_ASPEED_INTC "aspeed.intc"#define TYPE_ASPEED_2700_INTC TYPE_ASPEED_INTC "-ast2700"#define TYPE_ASPEED_2700_INTCIO TYPE_ASPEED_INTC "io-ast2700" +#define TYPE_ASPEED_2700_INTCIOEXP1 TYPE_ASPEED_INTC "-ast2700-ioexp1" +#define TYPE_ASPEED_2700_INTCIOEXP2 TYPE_ASPEED_INTC "-ast2700-ioexp2"#define TYPE_ASPEED_2700SSP_INTC TYPE_ASPEED_INTC "-ast2700ssp"#define TYPE_ASPEED_2700SSP_INTCIO TYPE_ASPEED_INTC "io-ast2700ssp"#define TYPE_ASPEED_2700TSP_INTC TYPE_ASPEED_INTC "-ast2700tsp"
hw/arm/aspeed_ast27x0.c +37 -0
@@ -91,7 +91,9 @@ static const hwaddr aspeed_soc_ast2700_memmap[] = { [ASPEED_DEV_LTPI_CTRL2] = 0x14C35000, [ASPEED_DEV_WDT] = 0x14C37000, [ASPEED_DEV_LTPI_IO0] = 0x30000000, + [ASPEED_DEV_IOEXP0_INTCIO] = 0x30C18000, [ASPEED_DEV_LTPI_IO1] = 0x50000000, + [ASPEED_DEV_IOEXP1_INTCIO] = 0x50C18000, [ASPEED_DEV_PCIE_MMIO0] = 0x60000000, [ASPEED_DEV_PCIE_MMIO1] = 0x80000000, [ASPEED_DEV_PCIE_MMIO2] = 0xA0000000,
@@ -446,6 +448,10 @@ static void aspeed_soc_ast2700_init(Object *obj)object_initialize_child (obj,"intc" , &a->intc[0 ],TYPE_ASPEED_2700_INTC );object_initialize_child (obj,"intcio" , &a->intc[1 ],TYPE_ASPEED_2700_INTCIO ); +object_initialize_child (obj,"intc-ioexp0" , &a->intcioexp[0 ], +TYPE_ASPEED_2700_INTCIOEXP1 ); +object_initialize_child (obj,"intc-ioexp1" , &a->intcioexp[1 ], +TYPE_ASPEED_2700_INTCIOEXP2 );snprintf (typename,sizeof (typename),"aspeed.adc-%s" , socname);object_initialize_child (obj,"adc" , &s->adc, typename);
@@ -690,6 +696,22 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)aspeed_mmio_map (s->memory,SYS_BUS_DEVICE (&a->intc[1 ]),0 , sc->memmap[ASPEED_DEV_INTCIO ]); +/* INTCIOEXP0 */ +if (!sysbus_realize (SYS_BUS_DEVICE (&a->intcioexp[0 ]), errp)) { +return ; + } + +aspeed_mmio_map (s->memory,SYS_BUS_DEVICE (&a->intcioexp[0 ]),0 , + sc->memmap[ASPEED_DEV_IOEXP0_INTCIO ]); + +/* INTCIOEXP1 */ +if (!sysbus_realize (SYS_BUS_DEVICE (&a->intcioexp[1 ]), errp)) { +return ; + } + +aspeed_mmio_map (s->memory,SYS_BUS_DEVICE (&a->intcioexp[1 ]),0 , + sc->memmap[ASPEED_DEV_IOEXP1_INTCIO ]); +/* irq sources -> orgates -> INTC */ for (i =0 ; i < ic->num_inpins; i++) { qdev_connect_gpio_out(DEVICE(&a->intc[0].orgates[i]), 0,
@@ -1006,6 +1028,21 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp) }sysbus_mmio_map (SYS_BUS_DEVICE (&s->ioexp[i]),0 , sc->memmap[ASPEED_DEV_LTPI_IO0 + i]); + + icio =ASPEED_INTC_GET_CLASS (&a->intcioexp[i]); +/* INTC_IOEXP internal: orgate[i] -> input[i] */ +for (int j =0 ; j < icio->num_inpins; j++) { + irq =qdev_get_gpio_in (DEVICE (&a->intcioexp[i]), j); +qdev_connect_gpio_out (DEVICE (&a->intcioexp[i].orgates[j]),0 , + irq); + } + +/* INTC_IOEXP output[i] -> INTC0.orgate[0].input[i] */ +for (int j =0 ; j < icio->num_outpins; j++) { + irq =qdev_get_gpio_in (DEVICE (&a->intc[0 ].orgates[0 ]), j); +sysbus_connect_irq (SYS_BUS_DEVICE (&a->intcioexp[i]), j, + irq); + } } aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->dpmcu),
hw/intc/aspeed_intc.c +60 -0
72 lines not on this page · raw message
Signature · 1 line
2.52.0
[PULL 12/45] hw/arm/aspeed_ast2600: Expand RC_H PCIe MMIO window to 0x60000000 - 0x80000000
In reply to Cédric Le GoaterFrom: Jamin Lin <[email protected]>
Historically, the ASPEED PCIe driver supported both RC_L and RC_H, with RC_L using MMIO window 0x60000000 - 0x70000000 and RC_H using 0x70000000 - 0x80000000.
Mainline Linux has dropped RC_L support and now supports RC_H only, updating RC_H to use a single combined MMIO window 0x60000000 - 0x80000000.
Update the AST2600 QEMU model accordingly by moving PCIE_MMIO1 base to 0x60000000 and increasing the aliased MMIO size to 0x20000000.
--- hw/arm/aspeed_ast2600.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/arm/aspeed_ast2600.c +4 -4
@@ -81,7 +81,7 @@ static const hwaddr aspeed_soc_ast2600_memmap[] = { [ASPEED_DEV_FSI1] = 0x1E79B000, [ASPEED_DEV_FSI2] = 0x1E79B100, [ASPEED_DEV_I3C] = 0x1E7A0000, - [ASPEED_DEV_PCIE_MMIO1] = 0x70000000, + [ASPEED_DEV_PCIE_MMIO1] = 0x60000000, [ASPEED_DEV_SDRAM] = 0x80000000, };
@@ -303,14 +303,14 @@ static uint64_t aspeed_calc_affinity(int cpu)* * Model scope / limitations: * - Firmware supports RC_H only; this QEMU model does not support RC_L. -* - RC_H uses PHY1 and the MMIO window [0x70000000, 0x80000000] +* - RC_H uses PHY1 and the MMIO window [0x60000000, 0x80000000] * (aka MMIO1). * * Indexing convention (this model): * - Expose a single logical instance at index 0. * - pcie[0] -> hardware RC_H (PCIe1) * - phy[0] -> hardware PHY1 -* - mmio.0 -> guest address range MMIO1: 0x70000000-0x80000000 +* - mmio.0 -> guest address range MMIO1: 0x60000000-0x80000000 * - RC_L / PCIe0 is not created and mapped. */ static bool aspeed_soc_ast2600_pcie_realize (DeviceState *dev,Error **errp)
@@ -346,7 +346,7 @@ static bool aspeed_soc_ast2600_pcie_realize(DeviceState *dev, Error **errp)memory_region_init_alias (&s->pcie_mmio_alias[0 ],OBJECT (&s->pcie[0 ].rc),"aspeed.pcie-mmio" , mmio_mr, sc->memmap[ASPEED_DEV_PCIE_MMIO1 ], -0x10000000 ); +0x20000000 );memory_region_add_subregion (s->memory, sc->memmap[ASPEED_DEV_PCIE_MMIO1 ], &s->pcie_mmio_alias[0 ]);
Signature · 1 line
2.52.0
[PULL 03/45] hw/i2c/aspeed: Introduce 'bus-label' to customize bus naming
In reply to Cédric Le GoaterFrom: Kane-Chen-AS <[email protected]>
On some Aspeed-based machines, multiple I2C controllers may exist across different components, such as the primary SoC and an external IO expander or co-processor (e.g., AST1700). Using the current static naming convention results in object name conflicts when multiple controllers attempt to instantiate buses with the same ID.
This patch introduces a 'bus-label' property for the Aspeed I2C controller. This allows higher-level layers, such as the SoC realize function, to provide a unique identifier for the buses. The I2C bus object name is then constructed using this label (e.g., "ioexp0.0" instead of the default "aspeed.i2c.bus.0").
This enhancement ensures unique bus identifiers across the system and resolves naming conflicts in multi-controller configurations.
--- include/hw/i2c/aspeed_i2c.h | 2 ++ hw/i2c/aspeed_i2c.c | 27 +++++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-)
include/hw/i2c/aspeed_i2c.h +2 -0
@@ -252,6 +252,7 @@ struct AspeedI2CBus {MemoryRegion mr_pool;I2CBus *bus; +char *name;uint8_t id;qemu_irq irq;
@@ -269,6 +270,7 @@ struct AspeedI2CState {uint32_t intr_status;uint32_t ctrl_global;uint32_t new_clk_divider; +char *bus_label;MemoryRegion pool_iomem;uint8_t share_pool[ASPEED_I2C_SHARE_POOL_SIZE ];
hw/i2c/aspeed_i2c.c +21 -6
@@ -1215,9 +1215,16 @@ static void aspeed_i2c_realize(DeviceState *dev, Error **errp) "aspeed.i2c", aic->mem_size);sysbus_init_mmio (sbd, &s->iomem); +/* default value */ +if (!s->bus_label) { + s->bus_label =g_strdup (TYPE_ASPEED_I2C_BUS ); + } +for (i =0 ; i < aic->num_busses; i++) {Object *bus =OBJECT (&s->busses[i]);int offset = i < aic->gap ?1 :5 ; + g_autofree char *name = g_strdup_printf("%s.%d", + s->bus_label, i);if (!object_property_set_link (bus,"controller" ,OBJECT (s), errp)) {return ;
@@ -1227,6 +1234,10 @@ static void aspeed_i2c_realize(DeviceState *dev, Error **errp)return ; } +if (!object_property_set_str (bus,"bus-name" , name, errp)) { +return ; + } +if (!sysbus_realize (SYS_BUS_DEVICE (bus), errp)) {return ; }
@@ -1263,6 +1274,7 @@ static void aspeed_i2c_realize(DeviceState *dev, Error **errp)static const Property aspeed_i2c_properties[] = {DEFINE_PROP_LINK ("dram" , AspeedI2CState, dram_mr, TYPE_MEMORY_REGION, MemoryRegion *), +DEFINE_PROP_STRING ("bus-label" , AspeedI2CState, bus_label), };static void aspeed_i2c_class_init (ObjectClass *klass,const void *data)
@@ -1423,24 +1435,26 @@ static void aspeed_i2c_bus_realize(DeviceState *dev, Error **errp) {AspeedI2CBus *s =ASPEED_I2C_BUS (dev);AspeedI2CClass *aic; - g_autofree char *name = g_strdup_printf(TYPE_ASPEED_I2C_BUS ".%d", s->id); - g_autofree char *pool_name = g_strdup_printf("%s.pool", name); + g_autofree char *pool_name = NULL; -if (!s->controller) { -error_setg (errp,TYPE_ASPEED_I2C_BUS ": 'controller' link not set" ); +if (!s->controller || !s->name) { +error_setg (errp,TYPE_ASPEED_I2C_BUS +": 'controller' or 'bus-name' not set" );return ; } + pool_name =g_strdup_printf ("%s.pool" , s->name); + aic =ASPEED_I2C_GET_CLASS (s->controller);sysbus_init_irq (SYS_BUS_DEVICE (dev), &s->irq); - s->bus =i2c_init_bus (dev, name); + s->bus =i2c_init_bus (dev, s->name); s->slave =i2c_slave_create_simple (s->bus,TYPE_ASPEED_I2C_BUS_SLAVE ,0xff );memory_region_init_io (&s->mr,OBJECT (s), &aspeed_i2c_bus_ops, - s, name, aic->reg_size); + s, s->name, aic->reg_size);sysbus_init_mmio (SYS_BUS_DEVICE (dev), &s->mr); memory_region_init_io(&s->mr_pool, OBJECT(s), &aspeed_i2c_bus_pool_ops,
@@ -1452,6 +1466,7 @@ static const Property aspeed_i2c_bus_properties[] = {DEFINE_PROP_UINT8 ("bus-id" , AspeedI2CBus, id,0 ),DEFINE_PROP_LINK ("controller" , AspeedI2CBus, controller,TYPE_ASPEED_I2C , AspeedI2CState *), + DEFINE_PROP_STRING("bus-name", AspeedI2CBus, name), };static void aspeed_i2c_bus_class_init (ObjectClass *klass,const void *data)
Signature · 1 line
2.52.0
Peter Maydell
AppliedQuoted 25 lines · Cédric Le Goater
The following changes since commit
28a6ca268c2cd3718b5bf24c2d97e3d1e95fc604:Merge tag 'single-binary-20260203' of https://github.com/philmd/qemu into staging (2026-02-04 01:57:26 +1000)
are available in the Git repository at:
https://github.com/legoater/qemu/ tags/pull-aspeed-20260204
for you to fetch changes up to
e56e45d5bdc808ed52f943d1a785e4d885b6f18f:tests/functional/aarch64: Add I2C test for AST1700 IO expanders (2026-02-04 10:10:57 +0100)
----------------------------------------------------------------
aspeed queue:* Added support for the new AST1700 IO expander, including several device models (LTPI, PWM, I2C, GPIO, etc.).
* Updated the AST2700 SoC with LTPI support, EHCI IRQ fixes, and other improvements.
* Updated test images and test cases for various Aspeed platforms.
* Fixed issues in the Aspeed I2C and ADC models.
* Added support for pca9535 GPIO expander.
* Updated documentation for Aspeed boards.
Quoted 1 line
----------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/11.0
for any user-visible changes.
-- PMM
Quoted 5 lines · Cédric Le Goater
The following changes since commit
28a6ca268c2cd3718b5bf24c2d97e3d1e95fc604:Merge tag 'single-binary-20260203' of https://github.com/philmd/qemu into staging (2026-02-04 01:57:26 +1000)
Quoted 7 lines
are available in the Git repository at:
https://github.com/legoater/qemu/ tags/pull-aspeed-20260204
for you to fetch changes up to
e56e45d5bdc808ed52f943d1a785e4d885b6f18f:tests/functional/aarch64: Add I2C test for AST1700 IO expanders (2026-02-04 10:10:57 +0100)
I noticed this a bit late, but:
Quoted 3 lines
----------------------------------------------------------------
Cédric Le Goater (3):Merge tag 'pull-vbootrom-20260116-v3' into aspeed-next
could you not include merge commits in your pull requests, please? We don't generally do that (the last one I think where we had it was back in 2023), and it will definitely cause you problems if I ever bounce a pullreq back to you with "please rebase"...
thanks
-- PMM
Quoted 14 lines · Peter Maydell
Quoted 5 lines · Cédric Le Goater
The following changes since commit
28a6ca268c2cd3718b5bf24c2d97e3d1e95fc604:Merge tag 'single-binary-20260203' of https://github.com/philmd/qemu into staging (2026-02-04 01:57:26 +1000)Quoted 7 lines
are available in the Git repository at:
https://github.com/legoater/qemu/ tags/pull-aspeed-20260204for you to fetch changes up to
e56e45d5bdc808ed52f943d1a785e4d885b6f18f:tests/functional/aarch64: Add I2C test for AST1700 IO expanders (2026-02-04 10:10:57 +0100)
Quoted 7 lines
I noticed this a bit late, but:
Quoted 3 lines
----------------------------------------------------------------
Cédric Le Goater (3):Merge tag 'pull-vbootrom-20260116-v3' into aspeed-nextcould you not include merge commits in your pull requests, please?
Ok. I don't do that often. I will remember.
Quoted 3 lines
We don't generally do that (the last one I think where we had it was back in 2023), and it will definitely cause you problems if I ever bounce a pullreq back to you with "please rebase"...
Sure ...
Thanks,
C.