[PATCH v2 06/18] hw/arm/aspeed: Correct fmc_model w25q80bl for ast1030-a1 EVB

2024-10-22 Thread Jamin Lin via
Currently, the default fmc_model was "sst25vf032b" whose size was 4MB for ast1030-a1 EVB. However, according to the schematic of ast1030-a1 EVB, ASPEED shipped default flash of fmc_cs0 and fmc_cs1 were "w25q80bl" and "w25q256", respectively. The size of w25q80bl is 1MB and the size of w25q256 is 32

[PATCH v2 18/18] test/qtest/ast2700-smc-test: Support to test AST2700

2024-10-22 Thread Jamin Lin via
Add test_ast2700_evb function and reused testcases which are from aspeed_smc-test.c for AST2700 testing. The base address, flash base address and ce index of fmc_cs0 are 0x1400, 0x1 and 0, respectively. The default flash model of fmc_cs0 is "w25q01jvq" whose size is 128MB, so set jedec_

[PATCH v2 11/18] test/qtest/aspeed_smc-test: Support to test all CE pins

2024-10-22 Thread Jamin Lin via
Currently, these test cases only support to test CE0. To test all CE pins, introduces new ce and node members in TestData structure. The ce member is used for saving the ce index and node member is used for saving the node path, respectively. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater

[PATCH v1 2/8] hw/timer/aspeed: Fix coding style

2024-10-29 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin --- hw/timer/aspeed_timer.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c index b1f860ecfb..5af268ea9e 100644 --- a/hw/timer/aspeed_timer.c ++

[PATCH v2 10/18] test/qtest/aspeed_smc-test: Introduce a new TestData to test different BMC SOCs

2024-10-22 Thread Jamin Lin via
Currently, these test cases are only used for testing fmc_cs0 for AST2400. To test others BMC SOCs, introduces a new TestData structure. Users can set the spi base address, flash base address, jedesc id and so on for different BMC SOCs and flash model testing. Introduce new helper functions to mak

[PATCH v2 05/18] hw/arm/aspeed: Correct spi_model w25q256 for ast1030-a1 EVB.

2024-10-22 Thread Jamin Lin via
Currently, the default spi_model was "sst25vf032b" whose size was 4MB for ast1030-a1 EVB. However, according to the schematic of ast1030-a1 EVB, ASPEED shipped default flash of spi1 and spi2 were w25q256 whose size was 32MB. Correct spi_model default flash to w25q256 for ast1030-a1 EVB. Signed-of

[PATCH v2 00/18] Fix write incorrect data into flash in user mode

2024-10-22 Thread Jamin Lin via
change from v1: 1. Fix write incorrect data into flash in user mode. 2. Refactor aspeed smc qtest testcases to support AST2600, AST2500 and AST1030. 3. Add ast2700 smc qtest testcase to support AST2700. change from v2: 1. Introduce a new aspeed-smc-utils.c to place common testcases. 2. Fix hard

[PATCH v2 13/18] test/qtest/aspeed_smc-test: Support to test AST2500

2024-10-22 Thread Jamin Lin via
Add test_ast2500_evb function and reused testcases for AST2500 testing. The spi base address, flash base address and ce index of fmc_cs0 are 0x1E62, 0x2000 and 0, respectively. The default flash model of fmc_cs0 is "mx25l25635e" whose size is 32MB, so set jedec_id 0xc22019. Signed-off-by:

[PATCH v2 15/18] test/qtest/aspeed_smc-test: Support to test AST1030

2024-10-22 Thread Jamin Lin via
Add test_ast1030_evb function and reused testcases for AST1030 testing. The base address, flash base address and ce index of fmc_cs0 are 0x7E62, 0x8000 and 0, respectively. The default flash model of fmc_cs0 is "w25q80bl" whose size is 1MB, so set jedec_id 0xef4014. Signed-off-by: Jamin Li

[PATCH v2 01/18] aspeed/smc: Fix write incorrect data into flash in user mode

2024-10-22 Thread Jamin Lin via
According to the design of ASPEED SPI controllers user mode, users write the data to flash, the SPI drivers set the Control Register(0x10) bit 0 and 1 enter user mode. Then, SPI drivers send flash commands for writing data. Finally, SPI drivers set the Control Register (0x10) bit 2 to stop active c

[PATCH v2 03/18] hw/block:m25p80: Support write status register 2 command (0x31) for w25q01jvq

2024-10-22 Thread Jamin Lin via
According to the w25q01jv datasheet at page 16, it is required to set QE bit in "Status Register 2" to enable quad mode. Currently, m25p80 support users utilize "Write Status Register 1(0x01)" command to set QE bit in "Status Register 2" and utilize "Read Status Register 2(0x35)" command to get th

[PATCH v2 09/18] test/qtest/aspeed_smc-test: Move testcases to test_palmetto_bmc function

2024-10-22 Thread Jamin Lin via
So far, the test cases are used for testing SMC model with AST2400 BMC. However, AST2400 is end off live and ASPEED is no longer support this SOC. To test SMC model for AST2500, AST2600 and AST1030, move the test cases from main to test_palmetto_bmc function. Signed-off-by: Jamin Lin Reviewed-by:

[PATCH v1 7/8] hw/arm/aspeed: Invert sdhci write protected pin for AST2600 and AST2500 EVBs

2024-10-29 Thread Jamin Lin via
The Write Protect pin of SDHCI model is default active low to match the SDHCI spec. So, write enable the bit 19 should be 1 and write protected the bit 19 should be 0 at the Present State Register (0x24). According to the design of AST2500 and AST2600 EVBs, the Write Protected pin is active high b

[PATCH v1 5/8] hw/sd/sdhci: Introduce a new Write Protected pin inverted property

2024-10-29 Thread Jamin Lin via
The Write Protect pin of SDHCI model is default active low to match the SDHCI spec. So, write enable the bit 19 should be 1 and write protected the bit 19 should be 0 at the Present State Register (0x24). However, some board are design Write Protected pin active high. In other words, write enable t

[PATCH v1 4/8] hw/sd/sdhci: Fix coding style

2024-10-29 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin --- hw/sd/sdhci.c | 64 +-- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index ed01499391..db7d547156 100644 --- a/hw/sd/sdhci.c ++

[PATCH v1 8/8] aspeed: Support create flash devices via command line for AST1030

2024-10-29 Thread Jamin Lin via
Add a "if-statement" in aspeed_minibmc_machine_init function. If users add "-nodefaults" in command line, the flash devices should be created by users setting. Otherwise, the flash devices are created at machine init. Signed-off-by: Jamin Lin --- hw/arm/aspeed.c | 22 -- 1 fi

[PATCH v1 1/8] aspeed/soc: Support RTC for AST2700

2024-10-29 Thread Jamin Lin via
The RTC controller between AST2600 and AST2700 are identical. Add RTC model for AST2700 RTC support. The RTC controller registers base address is start at 0x12C0_F000 and its alarm interrupt is connected to GICINT13. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 11 +++ 1 file c

[PATCH v1 3/8] hw/timer/aspeed: Fix interrupt status does not be cleared for AST2600

2024-10-29 Thread Jamin Lin via
According to the datasheet of AST2600 description, interrupt status set by HW and clear to "0" by software writing "1" on the specific bit. Therefore, if firmware set the specific bit "1" in the interrupt status register(0x34), the specific bit of "s->irq_sts" should be cleared 0. Signed-off-by:

[PATCH v1 0/8] Support RTC for AST2700

2024-10-29 Thread Jamin Lin via
change from v1: 1. Support RTC for AST2700. 2. Support SDHCI write protected pin inverted for AST2500 and AST2600. 3. Introduce Capabilities Register 2 for SD slot 0 and 1. 4. Support create flash devices via command line for AST1030. Jamin Lin (8): aspeed/soc: Support RTC for AST2700 hw/timer

[PATCH v1 6/8] hw/sd/aspeed_sdhci: Introduce Capabilities Register 2 for SD slot 0 and 1

2024-10-29 Thread Jamin Lin via
The size of SDHCI capabilities register is 64bits, so introduces new Capabilities Register 2 for SD slot 0 (0x144) and SD slot1 (0x244). Signed-off-by: Jamin Lin --- hw/sd/aspeed_sdhci.c | 40 +--- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git

[PATCH v2 2/3] hw/sd/sdhci: Introduce a new Write Protected pin inverted property

2024-11-03 Thread Jamin Lin via
The Write Protect pin of SDHCI model is default active low to match the SDHCI spec. So, write enable the bit 19 should be 1 and write protected the bit 19 should be 0 at the Present State Register (0x24). However, some boards are design Write Protected pin active high. In other words, write enable

[PATCH v2 3/3] hw/arm/aspeed: Invert sdhci write protected pin for AST2600 and AST2500 EVBs

2024-11-03 Thread Jamin Lin via
The Write Protect pin of SDHCI model is default active low to match the SDHCI spec. So, write enable the bit 19 should be 1 and write protected the bit 19 should be 0 at the Present State Register (0x24). According to the design of AST2500 and AST2600 EVBs, the Write Protected pin is active high b

[PATCH v2 1/3] hw/sd/sdhci: Fix coding style

2024-11-03 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/sd/sdhci.c | 64 +-- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index ed01499391..db7d54715

[PATCH v2 0/3] Introduce a new Write Protected pin inverted property

2024-11-03 Thread Jamin Lin via
change from v1: 1. Support RTC for AST2700. 2. Support SDHCI write protected pin inverted for AST2500 and AST2600. 3. Introduce Capabilities Register 2 for SD slot 0 and 1. 4. Support create flash devices via command line for AST1030. change from v2: replace wp-invert with wp-inverted and fix revi

[PATCH 4/5] hw/gpio/aspeed: Add AST2700 support

2024-09-23 Thread Jamin Lin via
AST2700 integrates two set of Parallel GPIO Controller with maximum 212 control pins, which are 27 groups. (H, exclude pin: H7 H6 H5 H4) In the previous design of ASPEED SOCs, one register is used for setting one function for one set which are 32 pins and 4 groups. ex: GPIO000 is used for setting

[PATCH 3/5] hw/gpio/aspeed: Support different memory region ops

2024-09-23 Thread Jamin Lin via
It set "aspeed_gpio_ops" struct which containing read and write callbacks to be used when I/O is performed on the GPIO region. Besides, in the previous design of ASPEED SOCs, one register is used for setting one function for 32 GPIO pins. ex: GPIO000 is used for setting data value for GPIO A, B, C

[PATCH 2/5] hw/gpio/aspeed: Support to set the different memory size

2024-09-23 Thread Jamin Lin via
According to the datasheet of ASPEED SOCs, a GPIO controller owns 4KB of register space for AST2700, AST2500, AST2400 and AST1030; owns 2KB of register space for AST2600 1.8v and owns 2KB of register space for AST2600 3.3v. It set the memory region size 2KB by default and it does not compatible re

[PATCH 0/5] Support GPIO for AST2700

2024-09-23 Thread Jamin Lin via
v1: support GPIO for AST2700 Jamin Lin (5): hw/gpio/aspeed: Fix coding style hw/gpio/aspeed: Support to set the different memory size hw/gpio/aspeed: Support different memory region ops hw/gpio/aspeed: Add AST2700 support aspeed/soc: Support GPIO for AST2700 hw/arm/aspeed_ast27x0.c

[PATCH 5/5] aspeed/soc: Support GPIO for AST2700

2024-09-23 Thread Jamin Lin via
Add GPIO model for AST2700 GPIO support. The GPIO controller registers base address is start at 0x14C0_B000 and its address space is 0x1000. The AST2700 GPIO controller interrupt is connected to GICINT130_INTC at bit 18. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 18 +++-

[PATCH 1/5] hw/gpio/aspeed: Fix coding style

2024-09-23 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin --- hw/gpio/aspeed_gpio.c | 3 ++- include/hw/gpio/aspeed_gpio.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 71756664dd..901b576144 100644 --

[PATCH v2 0/6] Support GPIO for AST2700

2024-09-24 Thread Jamin Lin via
v1: Support GPIO for AST2700 v2: Fix clear incorrect interrupt status and adds reviewer suggestion Jamin Lin (6): hw/gpio/aspeed: Fix coding style hw/gpio/aspeed: Support to set the different memory size hw/gpio/aspeed: Support different memory region ops hw/gpio/aspeed: Fix clear incorrec

[PATCH v2 5/6] hw/gpio/aspeed: Add AST2700 support

2024-09-24 Thread Jamin Lin via
AST2700 integrates two set of Parallel GPIO Controller with maximum 212 control pins, which are 27 groups. (H, exclude pin: H7 H6 H5 H4) In the previous design of ASPEED SOCs, one register is used for setting one function for one set which are 32 pins and 4 groups. ex: GPIO000 is used for setting

[PATCH v2 3/6] hw/gpio/aspeed: Support different memory region ops

2024-09-24 Thread Jamin Lin via
It set "aspeed_gpio_ops" struct which containing read and write callbacks to be used when I/O is performed on the GPIO region. Besides, in the previous design of ASPEED SOCs, one register is used for setting one function for 32 GPIO pins. ex: GPIO000 is used for setting data value for GPIO A, B, C

[PATCH v2 4/6] hw/gpio/aspeed: Fix clear incorrect interrupt status for GPIO index mode

2024-09-24 Thread Jamin Lin via
The interrupt status field is W1C, where a set bit on read indicates an interrupt is pending. If the bit extracted from data is set it should clear the corresponding bit in group_value. However, if the extracted bit is clear then the value of the corresponding bit in group_value should be unchanged

[PATCH v2 6/6] aspeed/soc: Support GPIO for AST2700

2024-09-24 Thread Jamin Lin via
Add GPIO model for AST2700 GPIO support. The GPIO controller registers base address is start at 0x14C0_B000 and its address space is 0x1000. The AST2700 GPIO controller interrupt is connected to GICINT130_INTC at bit 18. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 18 +++-

[PATCH v2 1/6] hw/gpio/aspeed: Fix coding style

2024-09-24 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin --- hw/gpio/aspeed_gpio.c | 5 +++-- include/hw/gpio/aspeed_gpio.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 71756664dd..a5886ffa43 100644

[PATCH v2 2/6] hw/gpio/aspeed: Support to set the different memory size

2024-09-24 Thread Jamin Lin via
According to the datasheet of ASPEED SOCs, a GPIO controller owns 4KB of register space for AST2700, AST2500, AST2400 and AST1030; owns 2KB of register space for AST2600 1.8v and owns 2KB of register space for AST2600 3.3v. It set the memory region size 2KB by default and it does not compatible re

[PATCH v3 4/6] hw/gpio/aspeed: Fix clear incorrect interrupt status for GPIO index mode

2024-09-26 Thread Jamin Lin via
The interrupt status field is W1C, where a set bit on read indicates an interrupt is pending. If the bit extracted from data is set it should clear the corresponding bit in group_value. However, if the extracted bit is clear then the value of the corresponding bit in group_value should be unchanged

[PATCH v3 5/6] hw/gpio/aspeed: Add AST2700 support

2024-09-26 Thread Jamin Lin via
AST2700 integrates two set of Parallel GPIO Controller with maximum 212 control pins, which are 27 groups. (H, exclude pin: H7 H6 H5 H4) In the previous design of ASPEED SOCs, one register is used for setting one function for one set which are 32 pins and 4 groups. ex: GPIO000 is used for setting

[PATCH v3 2/6] hw/gpio/aspeed: Support to set the different memory size

2024-09-26 Thread Jamin Lin via
According to the datasheet of ASPEED SOCs, a GPIO controller owns 4KB of register space for AST2700, AST2500, AST2400 and AST1030; owns 2KB of register space for AST2600 1.8v and owns 2KB of register space for AST2600 3.3v. It set the memory region size 2KB by default and it does not compatible re

[PATCH v3 1/6] hw/gpio/aspeed: Fix coding style

2024-09-26 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin --- hw/gpio/aspeed_gpio.c | 6 +++--- include/hw/gpio/aspeed_gpio.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 71756664dd..00fb72a509 100644

[PATCH v3 3/6] hw/gpio/aspeed: Support different memory region ops

2024-09-26 Thread Jamin Lin via
It set "aspeed_gpio_ops" struct which containing read and write callbacks to be used when I/O is performed on the GPIO region. Besides, in the previous design of ASPEED SOCs, one register is used for setting one function for 32 GPIO pins. ex: GPIO000 is used for setting data value for GPIO A, B, C

[PATCH v3 0/6] Support GPIO for AST2700

2024-09-26 Thread Jamin Lin via
v1: Support GPIO for AST2700 v2: Fix clear incorrect interrupt status and adds reviewer suggestions v3: remove nested conditionals and adds reviewer suggestions Jamin Lin (6): hw/gpio/aspeed: Fix coding style hw/gpio/aspeed: Support to set the different memory size hw/gpio/aspeed: Support di

[PATCH v3 6/6] aspeed/soc: Support GPIO for AST2700

2024-09-26 Thread Jamin Lin via
Add GPIO model for AST2700 GPIO support. The GPIO controller registers base address is start at 0x14C0_B000 and its address space is 0x1000. The AST2700 GPIO controller interrupt is connected to GICINT130_INTC at bit 18. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 18 +++-

[PATCH v4 1/7] hw/gpio/aspeed: Fix coding style

2024-09-27 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/gpio/aspeed_gpio.c | 6 +++--- include/hw/gpio/aspeed_gpio.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c inde

[PATCH v4 4/7] hw/gpio/aspeed: Fix clear incorrect interrupt status for GPIO index mode

2024-09-27 Thread Jamin Lin via
The interrupt status field is W1C, where a set bit on read indicates an interrupt is pending. If the bit extracted from data is set it should clear the corresponding bit in reg_value. However, if the extracted bit is clear then the value of the corresponding bit in reg_value should be unchanged. S

[PATCH v4 5/7] hw/gpio/aspeed: Add AST2700 support

2024-09-27 Thread Jamin Lin via
AST2700 integrates two set of Parallel GPIO Controller with maximum 212 control pins, which are 27 groups. (H, exclude pin: H7 H6 H5 H4) In the previous design of ASPEED SOCs, one register is used for setting one function for one set which are 32 pins and 4 groups. ex: GPIO000 is used for setting

[PATCH v4 7/7] hw/gpio/aspeed: Add test case for AST2700

2024-09-27 Thread Jamin Lin via
Add test case to test GPIO output and input pins from A0 to D7 for AST2700. Signed-off-by: Jamin Lin --- tests/qtest/aspeed_gpio-test.c | 64 ++ 1 file changed, 64 insertions(+) diff --git a/tests/qtest/aspeed_gpio-test.c b/tests/qtest/aspeed_gpio-test.c index d3

[PATCH v4 3/7] hw/gpio/aspeed: Support different memory region ops

2024-09-27 Thread Jamin Lin via
It set "aspeed_gpio_ops" struct which containing read and write callbacks to be used when I/O is performed on the GPIO region. Besides, in the previous design of ASPEED SOCs, one register is used for setting one function for 32 GPIO pins. ex: GPIO000 is used for setting data value for GPIO A, B, C

[PATCH v4 0/7] Support GPIO for AST2700

2024-09-27 Thread Jamin Lin via
v1: Support GPIO for AST2700 v2: Fix clear incorrect interrupt status and adds reviewer suggestions v3: remove nested conditionals and adds reviewer suggestions v4: add test cases to test GPIO for AST2700 and update commit messages Jamin Lin (7): hw/gpio/aspeed: Fix coding style hw/gpio/aspeed

[PATCH v4 2/7] hw/gpio/aspeed: Support to set the different memory size

2024-09-27 Thread Jamin Lin via
According to the datasheet of ASPEED SOCs, a GPIO controller owns 4KB of register space for AST2700, AST2500, AST2400 and AST1030; owns 2KB of register space for AST2600 1.8v and owns 2KB of register space for AST2600 3.3v. It set the memory region size 2KB by default and it does not compatible re

[PATCH v4 6/7] aspeed/soc: Support GPIO for AST2700 and correct irq 130

2024-09-27 Thread Jamin Lin via
The register set of GPIO have a significant change since AST2700. Each GPIO pin has their own individual control register and users are able to set one GPIO pin’s direction, interrupt enable, input mask and so on in the same one control register. AST2700 does not have GPIO18_XXX registers for GPIO

[PATCH v5 7/7] hw/gpio/aspeed: Add test case for AST2700

2024-09-27 Thread Jamin Lin via
Add test case to test GPIO output and input pins from A0 to D7 for AST2700. Signed-off-by: Jamin Lin --- tests/qtest/aspeed_gpio-test.c | 68 ++ 1 file changed, 68 insertions(+) diff --git a/tests/qtest/aspeed_gpio-test.c b/tests/qtest/aspeed_gpio-test.c index d3

[PATCH v5 5/7] hw/gpio/aspeed: Add AST2700 support

2024-09-27 Thread Jamin Lin via
AST2700 integrates two set of Parallel GPIO Controller with maximum 212 control pins, which are 27 groups. (H, exclude pin: H7 H6 H5 H4) In the previous design of ASPEED SOCs, one register is used for setting one function for one set which are 32 pins and 4 groups. ex: GPIO000 is used for setting

[PATCH v5 0/7] Support GPIO for AST2700

2024-09-27 Thread Jamin Lin via
v1: Support GPIO for AST2700 v2: Fix clear incorrect interrupt status and adds reviewer suggestions v3: remove nested conditionals and adds reviewer suggestions v4: add test cases to test GPIO for AST2700 and update commit messages v5: fix aspeed_gpio-test test failed if arch is arm Jamin Lin (7):

[PATCH v5 6/7] aspeed/soc: Support GPIO for AST2700 and correct irq 130

2024-09-27 Thread Jamin Lin via
The register set of GPIO have a significant change since AST2700. Each GPIO pin has their own individual control register and users are able to set one GPIO pin’s direction, interrupt enable, input mask and so on in the same one control register. AST2700 does not have GPIO18_XXX registers for GPIO

[PATCH v5 1/7] hw/gpio/aspeed: Fix coding style

2024-09-27 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/gpio/aspeed_gpio.c | 6 +++--- include/hw/gpio/aspeed_gpio.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c inde

[PATCH v5 2/7] hw/gpio/aspeed: Support to set the different memory size

2024-09-27 Thread Jamin Lin via
According to the datasheet of ASPEED SOCs, a GPIO controller owns 4KB of register space for AST2700, AST2500, AST2400 and AST1030; owns 2KB of register space for AST2600 1.8v and owns 2KB of register space for AST2600 3.3v. It set the memory region size 2KB by default and it does not compatible re

[PATCH v5 3/7] hw/gpio/aspeed: Support different memory region ops

2024-09-27 Thread Jamin Lin via
It set "aspeed_gpio_ops" struct which containing read and write callbacks to be used when I/O is performed on the GPIO region. Besides, in the previous design of ASPEED SOCs, one register is used for setting one function for 32 GPIO pins. ex: GPIO000 is used for setting data value for GPIO A, B, C

[PATCH v5 4/7] hw/gpio/aspeed: Fix clear incorrect interrupt status for GPIO index mode

2024-09-27 Thread Jamin Lin via
The interrupt status field is W1C, where a set bit on read indicates an interrupt is pending. If the bit extracted from data is set it should clear the corresponding bit in reg_value. However, if the extracted bit is clear then the value of the corresponding bit in reg_value should be unchanged. S

[PATCH v7 2/8] hw/gpio/aspeed: Support to set the different memory size

2024-10-01 Thread Jamin Lin via
According to the datasheet of ASPEED SOCs, a GPIO controller owns 4KB of register space for AST2700, AST2500, AST2400 and AST1030; owns 2KB of register space for AST2600 1.8v and owns 2KB of register space for AST2600 3.3v. It set the memory region size 2KB by default and it does not compatible re

[PATCH v7 3/8] hw/gpio/aspeed: Support different memory region ops

2024-10-01 Thread Jamin Lin via
It set "aspeed_gpio_ops" struct which containing read and write callbacks to be used when I/O is performed on the GPIO region. Besides, in the previous design of ASPEED SOCs, one register is used for setting one function for 32 GPIO pins. ex: GPIO000 is used for setting data value for GPIO A, B, C

[PATCH v7 1/8] hw/gpio/aspeed: Fix coding style

2024-10-01 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/gpio/aspeed_gpio.c | 6 +++--- include/hw/gpio/aspeed_gpio.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c inde

[PATCH v7 0/8] Support GPIO for AST2700

2024-10-01 Thread Jamin Lin via
v1: Support GPIO for AST2700 v2: Fix clear incorrect interrupt status and adds reviewer suggestions v3: Remove nested conditionals and adds reviewer suggestions v4: Add test cases to test GPIO for AST2700 and update commit messages v5: Fix aspeed_gpio-test test failed if arch is arm v6: Add to test

[PATCH v7 8/8] tests/qtest:ast2700-gpio-test: Add GPIO test case for AST2700

2024-10-01 Thread Jamin Lin via
Add GPIO test cases to test output and input pins from A0 to D7 for AST2700. Signed-off-by: Jamin Lin --- tests/qtest/ast2700-gpio-test.c | 95 + tests/qtest/meson.build | 3 ++ 2 files changed, 98 insertions(+) create mode 100644 tests/qtest/ast2700-gpi

[PATCH v7 4/8] hw/gpio/aspeed: Fix clear incorrect interrupt status for GPIO index mode

2024-10-01 Thread Jamin Lin via
The interrupt status field is W1C, where a set bit on read indicates an interrupt is pending. If the bit extracted from data is set it should clear the corresponding bit in reg_value. However, if the extracted bit is clear then the value of the corresponding bit in reg_value should be unchanged. S

[PATCH v7 5/8] hw/gpio/aspeed: Add AST2700 support

2024-10-01 Thread Jamin Lin via
AST2700 integrates two set of Parallel GPIO Controller with maximum 212 control pins, which are 27 groups. (H, exclude pin: H7 H6 H5 H4) In the previous design of ASPEED SOCs, one register is used for setting one function for one set which are 32 pins and 4 groups. ex: GPIO000 is used for setting

[PATCH v7 7/8] aspeed/soc: Support GPIO for AST2700

2024-10-01 Thread Jamin Lin via
Add GPIO model for AST2700 GPIO support. The GPIO controller registers base address is start at 0x14C0_B000 and its address space is 0x1000. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/arm/aspeed_ast27x0.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/a

[PATCH v7 6/8] aspeed/soc: Correct GPIO irq 130 for AST2700

2024-10-01 Thread Jamin Lin via
The register set of GPIO have a significant change since AST2700. Each GPIO pin has their own individual control register and users are able to set one GPIO pin’s direction, interrupt enable, input mask and so on in the same one control register. AST2700 does not have GPIO18_XXX registers for GPIO

[PATCH v3 00/10] Add smc qtest testcase to support AST2700

2024-11-27 Thread Jamin Lin via
change from v1: 1. Fix write incorrect data into flash in user mode. 2. Refactor aspeed smc qtest testcases to support AST2600, AST2500 and AST1030. 3. Add ast2700 smc qtest testcase to support AST2700. change from v2: 1. Introduce a new aspeed-smc-utils.c to place common testcases. 2. Fix hard

[PATCH v3 06/10] test/qtest/aspeed_smc-test: Support to test AST2600

2024-11-27 Thread Jamin Lin via
Add test_ast2600_evb function and reused testcases for AST2600 testing. The spi base address, flash base address and ce index of fmc_cs0 are 0x1E62, 0x2000 and 0, respectively. The default flash model of fmc_cs0 is "mx66u51235f" whose size is 64MB, so set jedec_id 0xc2253a. Signed-off-by:

[PATCH v3 04/10] test/qtest/aspeed_smc-test: Introducing a "page_addr" data field

2024-11-27 Thread Jamin Lin via
Currently, these test cases used the hardcode offset 0x140 (0x14000 * 256) which was beyond the 16MB flash size for flash page read/write command testing. However, the default fmc flash model of ast1030-a1 EVB is "w25q80bl" whose size is 1MB. To test SoC flash models, introduces a new page_addr

[PATCH v3 05/10] test/qtest/aspeed_smc-test: Support to test AST2500

2024-11-27 Thread Jamin Lin via
Add test_ast2500_evb function and reused testcases for AST2500 testing. The spi base address, flash base address and ce index of fmc_cs0 are 0x1E62, 0x2000 and 0, respectively. The default flash model of fmc_cs0 is "mx25l25635e" whose size is 32MB, so set jedec_id 0xc22019. Signed-off-by:

[PATCH v3 09/10] test/qtest: Introduce a new aspeed-smc-utils.c to place common testcases

2024-11-27 Thread Jamin Lin via
The testcases for ASPEED SMC model were placed in aspeed_smc-test.c. However, this test file only supports for ARM32. To support all ASPEED SOCs such as AST2700 whose CPU architecture is aarch64, introduces a new aspeed-smc-utils source file and move all common APIs and testcases from aspeed_smc-te

[PATCH v3 01/10] test/qtest/aspeed_smc-test: Move testcases to test_palmetto_bmc function

2024-11-27 Thread Jamin Lin via
So far, the test cases are used for testing SMC model with AST2400 BMC. However, AST2400 is end off live and ASPEED is no longer support this SOC. To test SMC model for AST2500, AST2600 and AST1030, move the test cases from main to test_palmetto_bmc function. Signed-off-by: Jamin Lin Reviewed-by:

[PATCH v3 08/10] test/qtest/aspeed_smc-test: Support write page command with QPI mode

2024-11-27 Thread Jamin Lin via
Add a new testcase for write page command with QPI mode testing. Currently, only run this testcase for AST2500, AST2600 and AST1030. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- tests/qtest/aspeed_smc-test.c | 74 +++ 1 file changed, 74 insertions(+

[PATCH v3 02/10] test/qtest/aspeed_smc-test: Introduce a new TestData to test different BMC SOCs

2024-11-27 Thread Jamin Lin via
Currently, these test cases are only used for testing fmc_cs0 for AST2400. To test others BMC SOCs, introduces a new TestData structure. Users can set the spi base address, flash base address, jedesc id and so on for different BMC SOCs and flash model testing. Introduce new helper functions to mak

[PATCH v3 03/10] test/qtest/aspeed_smc-test: Support to test all CE pins

2024-11-27 Thread Jamin Lin via
Currently, these test cases only support to test CE0. To test all CE pins, introduces new ce and node members in TestData structure. The ce member is used for saving the ce index and node member is used for saving the node path, respectively. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater

[PATCH v3 07/10] test/qtest/aspeed_smc-test: Support to test AST1030

2024-11-27 Thread Jamin Lin via
Add test_ast1030_evb function and reused testcases for AST1030 testing. The base address, flash base address and ce index of fmc_cs0 are 0x7E62, 0x8000 and 0, respectively. The default flash model of fmc_cs0 is "w25q80bl" whose size is 1MB, so set jedec_id 0xef4014. Signed-off-by: Jamin Li

[PATCH v3 10/10] test/qtest/ast2700-smc-test: Support to test AST2700

2024-11-27 Thread Jamin Lin via
Add test_ast2700_evb function and reused testcases which are from aspeed_smc-test.c for AST2700 testing. The base address, flash base address and ce index of fmc_cs0 are 0x1400, 0x1 and 0, respectively. The default flash model of fmc_cs0 is "w25q01jvq" whose size is 128MB, so set jedec_

[PATCH v3 0/3] Introduce a new Write Protected pin inverted property

2024-11-14 Thread Jamin Lin via
change from v1: 1. Support RTC for AST2700. 2. Support SDHCI write protected pin inverted for AST2500 and AST2600. 3. Introduce Capabilities Register 2 for SD slot 0 and 1. 4. Support create flash devices via command line for AST1030. change from v2: replace wp-invert with wp-inverted and fix revi

[PATCH v3 1/3] hw/sd/sdhci: Fix coding style

2024-11-14 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/sd/sdhci.c | 64 +-- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index dbe5c2340c..37875c02c

[PATCH v3 2/3] hw/sd/sdhci: Introduce a new Write Protected pin inverted property

2024-11-14 Thread Jamin Lin via
The Write Protect pin of SDHCI model is default active low to match the SDHCI spec. So, write enable the bit 19 should be 1 and write protected the bit 19 should be 0 at the Present State Register (0x24). However, some boards are design Write Protected pin active high. In other words, write enable

[PATCH v3 3/3] hw/arm/aspeed: Invert sdhci write protected pin for AST2600 EVB

2024-11-14 Thread Jamin Lin via
The Write Protect pin of SDHCI model is default active low to match the SDHCI spec. So, write enable the bit 19 should be 1 and write protected the bit 19 should be 0 at the Present State Register (0x24). According to the design of AST2600 EVB, the Write Protected pin is active high by default. To

[PATCH v1 5/5] aspeed/soc: Support eMMC for AST2700

2024-12-02 Thread Jamin Lin via
Add SDHCI model for AST2700 eMMC support. The eMMC controller only support 1 slot and registers base address is start at 0x1209_ and its interrupt is connected to GICINT 15. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 15 +++ 1 file changed, 15 insertions(+) diff --gi

[PATCH v1 2/5] hw:sdhci: Introduce a new "capareg" class member to set the different Capability Registers.

2024-12-02 Thread Jamin Lin via
Currently, it set the hardcode value of capability registers to all ASPEED SOCs However, the value of capability registers should be different for all ASPEED SOCs. For example: the bit 28 of the Capability Register 1 should be 1 for 64-bits System Bus support for AST2700. Introduce a new "capareg"

[PATCH v1 0/5] Support SDHCI and eMMC for ast2700

2024-12-02 Thread Jamin Lin via
change from v1: This patch series do not support boot from an eMMC. Only support eMMC and SD Slot 0 as storages. Jamin Lin (5): hw/arm/aspeed: Fix coding style hw:sdhci: Introduce a new "capareg" class member to set the different Capability Registers. hw/sd/aspeed_sdhci: Add AST2700 Supp

[PATCH v2 4/6] hw/sd/aspeed_sdhci: Add AST2700 Support

2024-12-02 Thread Jamin Lin via
Introduce a new ast2700 class to support AST2700. Add a new ast2700 SDHCI class init function and set the value of capability register to "0x000719f80080". Signed-off-by: Jamin Lin --- hw/sd/aspeed_sdhci.c | 16 include/hw/sd/aspeed_sdhci.h | 1 + 2 files changed, 1

[PATCH v2 0/6] Support SDHCI and eMMC for ast2700

2024-12-02 Thread Jamin Lin via
change from v1: This patch series do not support boot from an eMMC. Only support eMMC and SD Slot 0 as storages. change from v2: - Add hw/sd/aspeed_sdhci: Fix coding style patch Jamin Lin (6): hw/sd/aspeed_sdhci: Fix coding style hw/arm/aspeed: Fix coding style hw:sdhci: Introduce a new "ca

[PATCH v2 1/6] hw/sd/aspeed_sdhci: Fix coding style

2024-12-02 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin --- hw/sd/aspeed_sdhci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/sd/aspeed_sdhci.c b/hw/sd/aspeed_sdhci.c index 98d5460905..acd6538261 100644 --- a/hw/sd/aspeed_sdhci.c +++ b/hw/sd/aspeed_sd

[PATCH v2 6/6] aspeed/soc: Support eMMC for AST2700

2024-12-02 Thread Jamin Lin via
Add SDHCI model for AST2700 eMMC support. The eMMC controller only support 1 slot and registers base address is start at 0x1209_ and its interrupt is connected to GICINT 15. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 15 +++ 1 file changed, 15 insertions(+) diff --gi

[PATCH v2 2/6] hw/arm/aspeed: Fix coding style

2024-12-02 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast2600.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index be3eb70cdd..c40d3d8443 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/

[PATCH v2 3/6] hw:sdhci: Introduce a new "capareg" class member to set the different Capability Registers.

2024-12-02 Thread Jamin Lin via
Currently, it set the hardcode value of capability registers to all ASPEED SOCs However, the value of capability registers should be different for all ASPEED SOCs. For example: the bit 28 of the Capability Register 1 should be 1 for 64-bits System Bus support for AST2700. Introduce a new "capareg"

[PATCH v2 5/6] aspeed/soc: Support SDHCI for AST2700

2024-12-02 Thread Jamin Lin via
Add SDHCI model for AST2700 SDHCI support. The SDHCI controller only support 1 slot and registers base address is start at 0x1408_ and its interrupt is connected to GICINT133_INTC at bit 1. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 20 1 file changed, 20 ins

[PATCH v1 4/5] aspeed/soc: Support SDHCI for AST2700

2024-12-02 Thread Jamin Lin via
Add SDHCI model for AST2700 SDHCI support. The SDHCI controller only support 1 slot and registers base address is start at 0x1408_ and its interrupt is connected to GICINT133_INTC at bit 1. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 20 1 file changed, 20 ins

[PATCH v1 3/5] hw/sd/aspeed_sdhci: Add AST2700 Support

2024-12-02 Thread Jamin Lin via
Introduce a new ast2700 class to support AST2700. Add a new ast2700 SDHCI class init function and set the value of capability register to "0x000719f80080". Signed-off-by: Jamin Lin --- hw/sd/aspeed_sdhci.c | 16 include/hw/sd/aspeed_sdhci.h | 1 + 2 files changed, 1

[PATCH v1 1/5] hw/arm/aspeed: Fix coding style

2024-12-02 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast2600.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index be3eb70cdd..c40d3d8443 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/

[PATCH v4 2/6] hw/arm/aspeed: Fix coding style

2024-12-04 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/arm/aspeed_ast2600.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index be3eb70cdd..c40d3d8443 100644 --- a/hw/arm

[PATCH v4 0/6] Support SDHCI and eMMC for ast2700

2024-12-04 Thread Jamin Lin via
change from v1: This patch series do not support boot from an eMMC. Only support eMMC and SD Slot 0 as storages. change from v2: - Add hw/sd/aspeed_sdhci: Fix coding style patch change from v3: - Directly set capareg and sd_spec_version instead of property - Keep DEFINE_TYPES change from v4: - K

[PATCH v4 4/6] hw/sd/aspeed_sdhci: Add AST2700 Support

2024-12-04 Thread Jamin Lin via
Introduce a new ast2700 class to support AST2700. Add a new ast2700 SDHCI class init function and set the value of capability register to "0x000719f80080". Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/sd/aspeed_sdhci.c | 14 ++ include/hw/sd/aspeed_sdhci

<    1   2   3   4   5   6   7   >