From ff547a6bc2ddbdd9fceaf2fe7be8524fc0233d95 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 02:15:53 +0200 Subject: [PATCH 01/11] configs: sandbox64: Enable SF bootdev Align the sandbox64 defconfig with sandbox defconfig. Enable missing SPI NOT bootdev. This fixes ut_bootstd_bootdev_test_cmd_hunt test . Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 69e5efe8748..55a2b9aa17b 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -165,6 +165,7 @@ CONFIG_I2C_EEPROM=y CONFIG_MMC_SANDBOX=y CONFIG_MTD=y CONFIG_SPI_FLASH_SANDBOX=y +CONFIG_BOOTDEV_SPI_FLASH=y CONFIG_SPI_FLASH_ATMEL=y CONFIG_SPI_FLASH_EON=y CONFIG_SPI_FLASH_GIGADEVICE=y From 49147a0b0d21e7ee902edfbb01aa61cf90c5946a Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 03:17:54 +0200 Subject: [PATCH 02/11] configs: sandbox64: Increase console record size to 0x6000 Align the sandbox64 defconfig with sandbox defconfig. Increase the console record size. This fixes ut_bootstd_bootflow_cmd_scan_e . Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 55a2b9aa17b..0a694a57a09 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -21,7 +21,7 @@ CONFIG_BOOTSTAGE_FDT=y CONFIG_BOOTSTAGE_STASH=y CONFIG_BOOTSTAGE_STASH_SIZE=0x4096 CONFIG_CONSOLE_RECORD=y -CONFIG_CONSOLE_RECORD_OUT_SIZE=0x1000 +CONFIG_CONSOLE_RECORD_OUT_SIZE=0x6000 CONFIG_PRE_CONSOLE_BUFFER=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_CMD_CPU=y From 226ddc0dccdb19fc2f66a6e4bde10a421da9160f Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 04:57:01 +0200 Subject: [PATCH 03/11] configs: sandbox64: Enable MC34708 driver Align the sandbox64 defconfig with sandbox defconfig. Enable missing MC34708 PMIC driver. This fixes ut_dm_dm_test_power_pmic_mc34708_get test . Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 0a694a57a09..28badf60ce5 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -188,6 +188,7 @@ CONFIG_DM_PMIC=y CONFIG_PMIC_ACT8846=y CONFIG_DM_PMIC_PFUZE100=y CONFIG_DM_PMIC_MAX77686=y +CONFIG_DM_PMIC_MC34708=y CONFIG_PMIC_QCOM=y CONFIG_PMIC_RK8XX=y CONFIG_PMIC_S2MPS11=y From 09c0b2e71243b4640d05670402ad3b8802ac15dd Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 05:05:52 +0200 Subject: [PATCH 04/11] configs: sandbox64: Enable BUTTON_ADC driver Align the sandbox64 defconfig with sandbox defconfig. Enable missing BUTTON ADC driver. This fixes ut_dm_dm_test_button_keys_adc test . Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 28badf60ce5..b15b2cf099f 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -124,6 +124,7 @@ CONFIG_SYS_ATA_REG_OFFSET=1 CONFIG_SYS_ATA_ALT_OFFSET=2 CONFIG_SYS_ATA_IDE0_OFFSET=0 CONFIG_BUTTON=y +CONFIG_BUTTON_ADC=y CONFIG_BUTTON_GPIO=y CONFIG_CLK=y CONFIG_CLK_K210=y From 2fff2881c89d2488564572d4bfb8651d47f8555e Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 05:32:08 +0200 Subject: [PATCH 05/11] test: dm: pinmux: Handle %pa in pinctrl-single mux output The pinctrl-single driver uses %pa to print register value in its single_get_pin_muxing() output. Handle this properly in the test based on CONFIG_PHYS_64BIT . Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- test/dm/pinmux.c | 92 +++++++++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 41 deletions(-) diff --git a/test/dm/pinmux.c b/test/dm/pinmux.c index 265df4ccb97..6880b2d2cd9 100644 --- a/test/dm/pinmux.c +++ b/test/dm/pinmux.c @@ -15,6 +15,16 @@ static char buf[64]; ut_asserteq_str(expected, (char *)&buf); \ } while (0) +#define test_muxing_regaddr(selector, regaddr, expected) do { \ + char estr[64] = { 0 }; \ + if (IS_ENABLED(CONFIG_PHYS_64BIT)) \ + snprintf(estr, sizeof(estr), "0x%016llx %s", (u64)regaddr, expected); \ + else \ + snprintf(estr, sizeof(estr), "0x%08x %s", (u32)regaddr, expected); \ + ut_assertok(pinctrl_get_pin_muxing(dev, selector, buf, sizeof(buf))); \ + ut_asserteq_str(estr, (char *)&buf); \ +} while (0) + #define test_name(selector, expected) do { \ ut_assertok(pinctrl_get_pin_name(dev, selector, buf, sizeof(buf))); \ ut_asserteq_str(expected, (char *)&buf); \ @@ -79,14 +89,14 @@ static int dm_test_pinctrl_single(struct unit_test_state *uts) test_name(0, "PIN0"); test_name(141, "PIN141"); test_name(142, "Error"); - test_muxing(0, "0x00000000 0x00000000 UNCLAIMED"); - test_muxing(18, "0x00000048 0x00000006 pinmux_pwm_pins"); - test_muxing(28, "0x00000070 0x00000030 pinmux_uart0_pins"); - test_muxing(29, "0x00000074 0x00000000 pinmux_uart0_pins"); - test_muxing(100, "0x00000190 0x0000000c pinmux_spi0_pins"); - test_muxing(101, "0x00000194 0x0000000c pinmux_spi0_pins"); - test_muxing(102, "0x00000198 0x00000023 pinmux_spi0_pins"); - test_muxing(103, "0x0000019c 0x0000000c pinmux_spi0_pins"); + test_muxing_regaddr(0, 0x0, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(18, 0x48, "0x00000006 pinmux_pwm_pins"); + test_muxing_regaddr(28, 0x70, "0x00000030 pinmux_uart0_pins"); + test_muxing_regaddr(29, 0x74, "0x00000000 pinmux_uart0_pins"); + test_muxing_regaddr(100, 0x190, "0x0000000c pinmux_spi0_pins"); + test_muxing_regaddr(101, 0x194, "0x0000000c pinmux_spi0_pins"); + test_muxing_regaddr(102, 0x198, "0x00000023 pinmux_spi0_pins"); + test_muxing_regaddr(103, 0x19c, "0x0000000c pinmux_spi0_pins"); ret = pinctrl_get_pin_muxing(dev, 142, buf, sizeof(buf)); ut_asserteq(-EINVAL, ret); ut_assertok(uclass_get_device_by_name(UCLASS_I2C, "i2c@0", &dev)); @@ -97,39 +107,39 @@ static int dm_test_pinctrl_single(struct unit_test_state *uts) test_name(0, "PIN0"); test_name(159, "PIN159"); test_name(160, "Error"); - test_muxing(0, "0x00000000 0x00000000 UNCLAIMED"); - test_muxing(34, "0x00000010 0x00000200 pinmux_i2c0_pins"); - test_muxing(35, "0x00000010 0x00002000 pinmux_i2c0_pins"); - test_muxing(130, "0x00000040 0x00000200 pinmux_lcd_pins"); - test_muxing(131, "0x00000040 0x00002000 pinmux_lcd_pins"); - test_muxing(132, "0x00000040 0x00020000 pinmux_lcd_pins"); - test_muxing(133, "0x00000040 0x00200000 pinmux_lcd_pins"); - test_muxing(134, "0x00000040 0x02000000 pinmux_lcd_pins"); - test_muxing(135, "0x00000040 0x20000000 pinmux_lcd_pins"); - test_muxing(136, "0x00000044 0x00000002 pinmux_lcd_pins"); - test_muxing(137, "0x00000044 0x00000020 pinmux_lcd_pins"); - test_muxing(138, "0x00000044 0x00000200 pinmux_lcd_pins"); - test_muxing(139, "0x00000044 0x00002000 pinmux_lcd_pins"); - test_muxing(140, "0x00000044 0x00020000 pinmux_lcd_pins"); - test_muxing(141, "0x00000044 0x00200000 pinmux_lcd_pins"); - test_muxing(142, "0x00000044 0x02000000 pinmux_lcd_pins"); - test_muxing(143, "0x00000044 0x20000000 pinmux_lcd_pins"); - test_muxing(144, "0x00000048 0x00000002 pinmux_lcd_pins"); - test_muxing(145, "0x00000048 0x00000020 pinmux_lcd_pins"); - test_muxing(146, "0x00000048 0x00000000 UNCLAIMED"); - test_muxing(147, "0x00000048 0x00000000 UNCLAIMED"); - test_muxing(148, "0x00000048 0x00000000 UNCLAIMED"); - test_muxing(149, "0x00000048 0x00000000 UNCLAIMED"); - test_muxing(150, "0x00000048 0x02000000 pinmux_lcd_pins"); - test_muxing(151, "0x00000048 0x00000000 UNCLAIMED"); - test_muxing(152, "0x0000004c 0x00000002 pinmux_lcd_pins"); - test_muxing(153, "0x0000004c 0x00000020 pinmux_lcd_pins"); - test_muxing(154, "0x0000004c 0x00000000 UNCLAIMED"); - test_muxing(155, "0x0000004c 0x00000000 UNCLAIMED"); - test_muxing(156, "0x0000004c 0x00000000 UNCLAIMED"); - test_muxing(157, "0x0000004c 0x00000000 UNCLAIMED"); - test_muxing(158, "0x0000004c 0x02000000 pinmux_lcd_pins"); - test_muxing(159, "0x0000004c 0x00000000 UNCLAIMED"); + test_muxing_regaddr(0, 0x0, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(34, 0x10, "0x00000200 pinmux_i2c0_pins"); + test_muxing_regaddr(35, 0x10, "0x00002000 pinmux_i2c0_pins"); + test_muxing_regaddr(130, 0x40, "0x00000200 pinmux_lcd_pins"); + test_muxing_regaddr(131, 0x40, "0x00002000 pinmux_lcd_pins"); + test_muxing_regaddr(132, 0x40, "0x00020000 pinmux_lcd_pins"); + test_muxing_regaddr(133, 0x40, "0x00200000 pinmux_lcd_pins"); + test_muxing_regaddr(134, 0x40, "0x02000000 pinmux_lcd_pins"); + test_muxing_regaddr(135, 0x40, "0x20000000 pinmux_lcd_pins"); + test_muxing_regaddr(136, 0x44, "0x00000002 pinmux_lcd_pins"); + test_muxing_regaddr(137, 0x44, "0x00000020 pinmux_lcd_pins"); + test_muxing_regaddr(138, 0x44, "0x00000200 pinmux_lcd_pins"); + test_muxing_regaddr(139, 0x44, "0x00002000 pinmux_lcd_pins"); + test_muxing_regaddr(140, 0x44, "0x00020000 pinmux_lcd_pins"); + test_muxing_regaddr(141, 0x44, "0x00200000 pinmux_lcd_pins"); + test_muxing_regaddr(142, 0x44, "0x02000000 pinmux_lcd_pins"); + test_muxing_regaddr(143, 0x44, "0x20000000 pinmux_lcd_pins"); + test_muxing_regaddr(144, 0x48, "0x00000002 pinmux_lcd_pins"); + test_muxing_regaddr(145, 0x48, "0x00000020 pinmux_lcd_pins"); + test_muxing_regaddr(146, 0x48, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(147, 0x48, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(148, 0x48, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(149, 0x48, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(150, 0x48, "0x02000000 pinmux_lcd_pins"); + test_muxing_regaddr(151, 0x48, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(152, 0x4c, "0x00000002 pinmux_lcd_pins"); + test_muxing_regaddr(153, 0x4c, "0x00000020 pinmux_lcd_pins"); + test_muxing_regaddr(154, 0x4c, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(155, 0x4c, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(156, 0x4c, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(157, 0x4c, "0x00000000 UNCLAIMED"); + test_muxing_regaddr(158, 0x4c, "0x02000000 pinmux_lcd_pins"); + test_muxing_regaddr(159, 0x4c, "0x00000000 UNCLAIMED"); ret = pinctrl_get_pin_muxing(dev, 160, buf, sizeof(buf)); ut_asserteq(-EINVAL, ret); return 0; From d54c44b474874f1d91b77a76dfad77e7c771d390 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 05:32:09 +0200 Subject: [PATCH 06/11] configs: sandbox64: Enable PINCTRL_SINGLE driver Align the sandbox64 defconfig with sandbox defconfig. Enable missing PINCTRL single driver. This fixes ut_dm_dm_test_pinctrl_single test . Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index b15b2cf099f..4612d4fc4d7 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -183,6 +183,7 @@ CONFIG_PHY_SANDBOX=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_PINCTRL_SANDBOX=y +CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_SANDBOX_POWER_DOMAIN=y CONFIG_DM_PMIC=y From 539485fd9ebd3611fcab2ef4cc50c5cdf77f87ae Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 07:15:05 +0200 Subject: [PATCH 07/11] configs: sandbox64: Enable video 16bpp and 24bpp support Align the sandbox64 defconfig with sandbox defconfig. Enable missing 16bpp and 24bpp video support. This fixes ut_dm_dm_test_video_bmp16 and ut_dm_dm_test_video_bmp24 tests . Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 4612d4fc4d7..7d00282f2c8 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -244,6 +244,8 @@ CONFIG_I2C_EDID=y CONFIG_VIDEO_SANDBOX_SDL=y CONFIG_OSD=y CONFIG_SANDBOX_OSD=y +CONFIG_BMP_16BPP=y +CONFIG_BMP_24BPP=y # CONFIG_WATCHDOG_AUTOSTART is not set CONFIG_WDT=y CONFIG_WDT_GPIO=y From 5d5d7e225d25de222bad16bc4c3a8a1618c934f8 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 07:15:06 +0200 Subject: [PATCH 08/11] configs: sandbox64: Enable video 12x22 font support Align the sandbox64 defconfig with sandbox defconfig. Enable missing 12x22 font support. This fixes ut_dm_dm_test_video_text_12x22 test . Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 7d00282f2c8..1db69ec65c7 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -237,6 +237,7 @@ CONFIG_USB=y CONFIG_USB_EMUL=y CONFIG_USB_KEYBOARD=y CONFIG_VIDEO=y +CONFIG_VIDEO_FONT_SUN12X22=y CONFIG_CONSOLE_ROTATION=y CONFIG_CONSOLE_TRUETYPE=y CONFIG_CONSOLE_TRUETYPE_CANTORAONE=y From eaa5b5d7d2c7df82079848f39b8cccd64310e9f2 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 21:50:29 +0200 Subject: [PATCH 09/11] configs: sandbox64: Enable clock CCF driver Align the sandbox64 defconfig with sandbox defconfig. Enable missing CCF and Sandbox CCF drivers. This fixes ut_dm_dm_test_clk_ccf test . Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 1db69ec65c7..933c9e95810 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -127,8 +127,10 @@ CONFIG_BUTTON=y CONFIG_BUTTON_ADC=y CONFIG_BUTTON_GPIO=y CONFIG_CLK=y +CONFIG_CLK_COMPOSITE_CCF=y CONFIG_CLK_K210=y CONFIG_CLK_K210_SET_RATE=y +CONFIG_SANDBOX_CLK_CCF=y CONFIG_CPU=y CONFIG_DM_DEMO=y CONFIG_DM_DEMO_SIMPLE=y From ddfda552e7f700d748aa46ab91ec6c661b018710 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 21:51:50 +0200 Subject: [PATCH 10/11] configs: sandbox64: Enable PCI register multi-entry support Align the sandbox64 defconfig with sandbox defconfig. Enable missing PCI register multi-entry support. This fixes ut_dm_dm_test_pci_bus_to_phys test . Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 933c9e95810..14c9d1b04cb 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -179,6 +179,7 @@ CONFIG_SPI_FLASH_SST=y CONFIG_SPI_FLASH_WINBOND=y CONFIG_NVMXIP_QSPI=y CONFIG_NVME_PCI=y +CONFIG_PCI_REGION_MULTI_ENTRY=y CONFIG_PCI_SANDBOX=y CONFIG_PHY=y CONFIG_PHY_SANDBOX=y From 25a9be71ec1ca779aac8bcb1d8a363725ff0ac7f Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 13 Aug 2023 21:52:19 +0200 Subject: [PATCH 11/11] test: cpu: Handle both 32bit and 64bit CPUs Handle both 32bit and 64bit systems, i.e. sandbox and sandbox64 the same way drivers/cpu/cpu_sandbox.c does, that is in case CONFIG_PHYS_64BIT is enabled, assume 64bit address width, else assume 32bit address width. This fixes ut_dm_dm_test_cpu test failure on sandbox64. Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- test/dm/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dm/cpu.c b/test/dm/cpu.c index d7e596ee396..5734cd0a92d 100644 --- a/test/dm/cpu.c +++ b/test/dm/cpu.c @@ -37,7 +37,7 @@ static int dm_test_cpu(struct unit_test_state *uts) ut_assertok(cpu_get_info(dev, &info)); ut_asserteq(info.cpu_freq, 42 * 42 * 42 * 42 * 42); ut_asserteq(info.features, 0x42424242); - ut_asserteq(info.address_width, 32); + ut_asserteq(info.address_width, IS_ENABLED(CONFIG_PHYS_64BIT) ? 64 : 32); ut_asserteq(cpu_get_count(dev), 42);