[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/24] test/qtest/aspeed_smc-test: Introducing a "page_addr" data
From: |
Cédric Le Goater |
Subject: |
[PULL 18/24] test/qtest/aspeed_smc-test: Introducing a "page_addr" data field |
Date: |
Wed, 11 Dec 2024 07:30:52 +0100 |
From: Jamin Lin <jamin_lin@aspeedtech.com>
Currently, these test cases used the hardcode offset 0x1400000 (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 member in TestData
structure, so users can set the offset for flash page read/write command
testing.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link:
https://lore.kernel.org/r/20241127091543.1243114-5-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
tests/qtest/aspeed_smc-test.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/tests/qtest/aspeed_smc-test.c b/tests/qtest/aspeed_smc-test.c
index b8ab20b43dd6..6db18451d245 100644
--- a/tests/qtest/aspeed_smc-test.c
+++ b/tests/qtest/aspeed_smc-test.c
@@ -72,6 +72,7 @@ typedef struct TestData {
char *tmp_path;
uint8_t cs;
const char *node;
+ uint32_t page_addr;
} TestData;
/*
@@ -256,7 +257,7 @@ static void assert_page_mem(const TestData *data, uint32_t
addr,
static void test_erase_sector(const void *data)
{
const TestData *test_data = (const TestData *)data;
- uint32_t some_page_addr = 0x600 * FLASH_PAGE_SIZE;
+ uint32_t some_page_addr = test_data->page_addr;
uint32_t page[FLASH_PAGE_SIZE / 4];
int i;
@@ -308,7 +309,7 @@ static void test_erase_sector(const void *data)
static void test_erase_all(const void *data)
{
const TestData *test_data = (const TestData *)data;
- uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE;
+ uint32_t some_page_addr = test_data->page_addr;
uint32_t page[FLASH_PAGE_SIZE / 4];
int i;
@@ -358,8 +359,8 @@ static void test_erase_all(const void *data)
static void test_write_page(const void *data)
{
const TestData *test_data = (const TestData *)data;
- uint32_t my_page_addr = 0x14000 * FLASH_PAGE_SIZE; /* beyond 16MB */
- uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE;
+ uint32_t my_page_addr = test_data->page_addr;
+ uint32_t some_page_addr = my_page_addr + FLASH_PAGE_SIZE;
uint32_t page[FLASH_PAGE_SIZE / 4];
int i;
@@ -395,8 +396,8 @@ static void test_write_page(const void *data)
static void test_read_page_mem(const void *data)
{
const TestData *test_data = (const TestData *)data;
- uint32_t my_page_addr = 0x14000 * FLASH_PAGE_SIZE; /* beyond 16MB */
- uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE;
+ uint32_t my_page_addr = test_data->page_addr;
+ uint32_t some_page_addr = my_page_addr + FLASH_PAGE_SIZE;
uint32_t page[FLASH_PAGE_SIZE / 4];
int i;
@@ -438,7 +439,7 @@ static void test_read_page_mem(const void *data)
static void test_write_page_mem(const void *data)
{
const TestData *test_data = (const TestData *)data;
- uint32_t my_page_addr = 0x15000 * FLASH_PAGE_SIZE;
+ uint32_t my_page_addr = test_data->page_addr;
uint32_t page[FLASH_PAGE_SIZE / 4];
int i;
@@ -679,6 +680,8 @@ static void test_palmetto_bmc(TestData *data)
data->jedec_id = 0x20ba19;
data->cs = 0;
data->node = "/machine/soc/fmc/ssi.0/child[0]";
+ /* beyond 16MB */
+ data->page_addr = 0x14000 * FLASH_PAGE_SIZE;
qtest_add_data_func("/ast2400/smc/read_jedec", data, test_read_jedec);
qtest_add_data_func("/ast2400/smc/erase_sector", data, test_erase_sector);
--
2.47.1
- [PULL 17/24] test/qtest/aspeed_smc-test: Support to test all CE pins, (continued)
- [PULL 17/24] test/qtest/aspeed_smc-test: Support to test all CE pins, Cédric Le Goater, 2024/12/11
- [PULL 09/24] tests/functional: Introduce a specific test for palmetto-bmc machine, Cédric Le Goater, 2024/12/11
- [PULL 14/24] tests/functional: Move debian boot test from avocado, Cédric Le Goater, 2024/12/11
- [PULL 12/24] tests/functional: Introduce a specific test for ast2600 SoC, Cédric Le Goater, 2024/12/11
- [PULL 16/24] test/qtest/aspeed_smc-test: Introduce a new TestData to test different BMC SOCs, Cédric Le Goater, 2024/12/11
- [PULL 13/24] tests/functional: Introduce a specific test for rainier-bmc machine, Cédric Le Goater, 2024/12/11
- [PULL 21/24] test/qtest/aspeed_smc-test: Support to test AST1030, Cédric Le Goater, 2024/12/11
- [PULL 06/24] aspeed/soc: Support SDHCI for AST2700, Cédric Le Goater, 2024/12/11
- [PULL 15/24] test/qtest/aspeed_smc-test: Move testcases to test_palmetto_bmc function, Cédric Le Goater, 2024/12/11
- [PULL 19/24] test/qtest/aspeed_smc-test: Support to test AST2500, Cédric Le Goater, 2024/12/11
- [PULL 18/24] test/qtest/aspeed_smc-test: Introducing a "page_addr" data field,
Cédric Le Goater <=
- [PULL 08/24] tests/functional: Introduce a specific test for ast1030 SoC, Cédric Le Goater, 2024/12/11
- [PULL 11/24] tests/functional: Introduce a specific test for ast2500 SoC, Cédric Le Goater, 2024/12/11
- [PULL 23/24] test/qtest: Introduce a new aspeed-smc-utils.c to place common testcases, Cédric Le Goater, 2024/12/11
- [PULL 20/24] test/qtest/aspeed_smc-test: Support to test AST2600, Cédric Le Goater, 2024/12/11
- [PULL 22/24] test/qtest/aspeed_smc-test: Support write page command with QPI mode, Cédric Le Goater, 2024/12/11
- [PULL 24/24] test/qtest/ast2700-smc-test: Support to test AST2700, Cédric Le Goater, 2024/12/11
- Re: [PULL 00/24] aspeed queue, Peter Maydell, 2024/12/11