mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-19 08:28:51 +09:00
Merge branch '2020-08-07-misc-improvements'
- SquashFS support - Assorted bugfixes
This commit is contained in:
commit
626b2df302
@ -51,6 +51,7 @@ addons:
|
|||||||
- sbsigntool
|
- sbsigntool
|
||||||
- fakeroot
|
- fakeroot
|
||||||
- mtd-utils
|
- mtd-utils
|
||||||
|
- squashfs-tools
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# Clone uboot-test-hooks
|
# Clone uboot-test-hooks
|
||||||
|
12
MAINTAINERS
12
MAINTAINERS
@ -181,6 +181,7 @@ F: board/cortina/common/
|
|||||||
F: drivers/gpio/cortina_gpio.c
|
F: drivers/gpio/cortina_gpio.c
|
||||||
F: drivers/watchdog/cortina_wdt.c
|
F: drivers/watchdog/cortina_wdt.c
|
||||||
F: drivers/serial/serial_cortina.c
|
F: drivers/serial/serial_cortina.c
|
||||||
|
F: drivers/led/led_cortina.c
|
||||||
F: drivers/mmc/ca_dw_mmc.c
|
F: drivers/mmc/ca_dw_mmc.c
|
||||||
F: drivers/i2c/i2c-cortina.c
|
F: drivers/i2c/i2c-cortina.c
|
||||||
F: drivers/i2c/i2c-cortina.h
|
F: drivers/i2c/i2c-cortina.h
|
||||||
@ -766,6 +767,7 @@ F: board/cortina/common/
|
|||||||
F: drivers/gpio/cortina_gpio.c
|
F: drivers/gpio/cortina_gpio.c
|
||||||
F: drivers/watchdog/cortina_wdt.c
|
F: drivers/watchdog/cortina_wdt.c
|
||||||
F: drivers/serial/serial_cortina.c
|
F: drivers/serial/serial_cortina.c
|
||||||
|
F: drivers/led/led_cortina.c
|
||||||
F: drivers/mmc/ca_dw_mmc.c
|
F: drivers/mmc/ca_dw_mmc.c
|
||||||
F: drivers/i2c/i2c-cortina.c
|
F: drivers/i2c/i2c-cortina.c
|
||||||
F: drivers/i2c/i2c-cortina.h
|
F: drivers/i2c/i2c-cortina.h
|
||||||
@ -868,7 +870,7 @@ S: Maintained
|
|||||||
F: arch/powerpc/
|
F: arch/powerpc/
|
||||||
|
|
||||||
POWERPC MPC8XX
|
POWERPC MPC8XX
|
||||||
M: Christophe Leroy <christophe.leroy@csgroup.eu>
|
M: Christophe Leroy <christophe.leroy@c-s.fr>
|
||||||
S: Maintained
|
S: Maintained
|
||||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-mpc8xx.git
|
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-mpc8xx.git
|
||||||
F: arch/powerpc/cpu/mpc8xx/
|
F: arch/powerpc/cpu/mpc8xx/
|
||||||
@ -969,6 +971,14 @@ S: Maintained
|
|||||||
F: drivers/spmi/
|
F: drivers/spmi/
|
||||||
F: include/spmi/
|
F: include/spmi/
|
||||||
|
|
||||||
|
SQUASHFS
|
||||||
|
M: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
|
||||||
|
S: Maintained
|
||||||
|
F: fs/squashfs/
|
||||||
|
F: include/sqfs.h
|
||||||
|
F: cmd/sqfs.c
|
||||||
|
F: test/py/tests/test_fs/test_squashfs/
|
||||||
|
|
||||||
TARGET_BCMNS3
|
TARGET_BCMNS3
|
||||||
M: Bharat Gooty <bharat.gooty@broadcom.com>
|
M: Bharat Gooty <bharat.gooty@broadcom.com>
|
||||||
M: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
|
M: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
|
||||||
|
@ -64,4 +64,35 @@
|
|||||||
spi-max-frequency = <108000000>;
|
spi-max-frequency = <108000000>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
leds: led-controller@f43200f0 {
|
||||||
|
compatible = "cortina,ca-leds";
|
||||||
|
reg = <0x0 0xf43200f0 0x40>;
|
||||||
|
|
||||||
|
cortina,blink-rate1 = <256>;
|
||||||
|
cortina,blink-rate2 = <512>;
|
||||||
|
|
||||||
|
led@0 {
|
||||||
|
pin = <0>;
|
||||||
|
active-low;
|
||||||
|
blink-sel =<0>;
|
||||||
|
port = <0>;
|
||||||
|
off-event = <0>;
|
||||||
|
label = "led0";
|
||||||
|
};
|
||||||
|
|
||||||
|
led@1 {
|
||||||
|
pin = <1>;
|
||||||
|
active-low;
|
||||||
|
blink-sel =<1>;
|
||||||
|
label = "led1";
|
||||||
|
};
|
||||||
|
|
||||||
|
led@2 {
|
||||||
|
pin = <2>;
|
||||||
|
active-low;
|
||||||
|
label = "led2";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -724,7 +724,7 @@ config CMD_MEMORY
|
|||||||
base - print or set address offset
|
base - print or set address offset
|
||||||
loop - initialize loop on address range
|
loop - initialize loop on address range
|
||||||
|
|
||||||
config MEM_SEARCH
|
config CMD_MEM_SEARCH
|
||||||
bool "ms - Memory search"
|
bool "ms - Memory search"
|
||||||
help
|
help
|
||||||
Memory-search command
|
Memory-search command
|
||||||
@ -2090,6 +2090,12 @@ config CMD_FAT
|
|||||||
help
|
help
|
||||||
Support for the FAT fs
|
Support for the FAT fs
|
||||||
|
|
||||||
|
config CMD_SQUASHFS
|
||||||
|
bool "SquashFS command support"
|
||||||
|
select FS_SQUASHFS
|
||||||
|
help
|
||||||
|
Enables SquashFS filesystem commands (e.g. load, ls).
|
||||||
|
|
||||||
config CMD_FS_GENERIC
|
config CMD_FS_GENERIC
|
||||||
bool "filesystem commands"
|
bool "filesystem commands"
|
||||||
help
|
help
|
||||||
|
@ -63,6 +63,7 @@ obj-$(CONFIG_CMD_EXT4) += ext4.o
|
|||||||
obj-$(CONFIG_CMD_EXT2) += ext2.o
|
obj-$(CONFIG_CMD_EXT2) += ext2.o
|
||||||
obj-$(CONFIG_CMD_FAT) += fat.o
|
obj-$(CONFIG_CMD_FAT) += fat.o
|
||||||
obj-$(CONFIG_CMD_FDT) += fdt.o
|
obj-$(CONFIG_CMD_FDT) += fdt.o
|
||||||
|
obj-$(CONFIG_CMD_SQUASHFS) += sqfs.o
|
||||||
obj-$(CONFIG_CMD_FLASH) += flash.o
|
obj-$(CONFIG_CMD_FLASH) += flash.o
|
||||||
obj-$(CONFIG_CMD_FPGA) += fpga.o
|
obj-$(CONFIG_CMD_FPGA) += fpga.o
|
||||||
obj-$(CONFIG_CMD_FPGAD) += fpgad.o
|
obj-$(CONFIG_CMD_FPGAD) += fpgad.o
|
||||||
|
30
cmd/mem.c
30
cmd/mem.c
@ -53,7 +53,8 @@ static ulong dp_last_length = 0x40;
|
|||||||
static ulong mm_last_addr, mm_last_size;
|
static ulong mm_last_addr, mm_last_size;
|
||||||
|
|
||||||
static ulong base_address = 0;
|
static ulong base_address = 0;
|
||||||
#ifdef CONFIG_MEM_SEARCH
|
#ifdef CONFIG_CMD_MEM_SEARCH
|
||||||
|
static ulong dp_last_ms_length;
|
||||||
static u8 search_buf[64];
|
static u8 search_buf[64];
|
||||||
static uint search_len;
|
static uint search_len;
|
||||||
#endif
|
#endif
|
||||||
@ -367,7 +368,7 @@ static int do_mem_cp(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MEM_SEARCH
|
#ifdef CONFIG_CMD_MEM_SEARCH
|
||||||
static int do_mem_search(struct cmd_tbl *cmdtp, int flag, int argc,
|
static int do_mem_search(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
char *const argv[])
|
char *const argv[])
|
||||||
{
|
{
|
||||||
@ -377,6 +378,7 @@ static int do_mem_search(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
ulong last_pos; /* Offset of last match in 'size' units*/
|
ulong last_pos; /* Offset of last match in 'size' units*/
|
||||||
ulong last_addr; /* Address of last displayed line */
|
ulong last_addr; /* Address of last displayed line */
|
||||||
int limit = 10;
|
int limit = 10;
|
||||||
|
int used_len;
|
||||||
int count;
|
int count;
|
||||||
int size;
|
int size;
|
||||||
int i;
|
int i;
|
||||||
@ -384,12 +386,12 @@ static int do_mem_search(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
/* We use the last specified parameters, unless new ones are entered */
|
/* We use the last specified parameters, unless new ones are entered */
|
||||||
addr = dp_last_addr;
|
addr = dp_last_addr;
|
||||||
size = dp_last_size;
|
size = dp_last_size;
|
||||||
length = dp_last_length;
|
length = dp_last_ms_length;
|
||||||
|
|
||||||
if (argc < 3)
|
if (argc < 3)
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
|
|
||||||
if ((!flag & CMD_FLAG_REPEAT)) {
|
if (!(flag & CMD_FLAG_REPEAT)) {
|
||||||
/*
|
/*
|
||||||
* Check for a size specification.
|
* Check for a size specification.
|
||||||
* Defaults to long if no or incorrect specification.
|
* Defaults to long if no or incorrect specification.
|
||||||
@ -398,7 +400,8 @@ static int do_mem_search(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
if (size < 0 && size != -2 /* string */)
|
if (size < 0 && size != -2 /* string */)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
argc--; argv++;
|
argc--;
|
||||||
|
argv++;
|
||||||
while (argc && *argv[0] == '-') {
|
while (argc && *argv[0] == '-') {
|
||||||
int ch = argv[0][1];
|
int ch = argv[0][1];
|
||||||
|
|
||||||
@ -408,7 +411,8 @@ static int do_mem_search(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
limit = simple_strtoul(argv[0] + 2, NULL, 16);
|
limit = simple_strtoul(argv[0] + 2, NULL, 16);
|
||||||
else
|
else
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
argc--; argv++;
|
argc--;
|
||||||
|
argv++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Address is specified since argc > 1 */
|
/* Address is specified since argc > 1 */
|
||||||
@ -421,7 +425,7 @@ static int do_mem_search(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
/* Read the bytes to search for */
|
/* Read the bytes to search for */
|
||||||
end = search_buf + sizeof(search_buf);
|
end = search_buf + sizeof(search_buf);
|
||||||
for (i = 2, ptr = search_buf; i < argc && ptr < end; i++) {
|
for (i = 2, ptr = search_buf; i < argc && ptr < end; i++) {
|
||||||
if (SUPPORT_64BIT_DATA && size == 8) {
|
if (MEM_SUPPORT_64BIT_DATA && size == 8) {
|
||||||
u64 val = simple_strtoull(argv[i], NULL, 16);
|
u64 val = simple_strtoull(argv[i], NULL, 16);
|
||||||
|
|
||||||
*(u64 *)ptr = val;
|
*(u64 *)ptr = val;
|
||||||
@ -460,7 +464,8 @@ static int do_mem_search(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
last_pos = 0;
|
last_pos = 0;
|
||||||
last_addr = 0;
|
last_addr = 0;
|
||||||
count = 0;
|
count = 0;
|
||||||
for (offset = 0; offset <= bytes - search_len && count < limit;
|
for (offset = 0;
|
||||||
|
offset < bytes && offset <= bytes - search_len && count < limit;
|
||||||
offset += size) {
|
offset += size) {
|
||||||
void *ptr = buf + offset;
|
void *ptr = buf + offset;
|
||||||
|
|
||||||
@ -495,9 +500,10 @@ static int do_mem_search(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
|
|
||||||
unmap_sysmem(buf);
|
unmap_sysmem(buf);
|
||||||
|
|
||||||
dp_last_addr = addr + offset / size;
|
used_len = offset / size;
|
||||||
|
dp_last_addr = addr + used_len;
|
||||||
dp_last_size = size;
|
dp_last_size = size;
|
||||||
dp_last_length = length - offset / size;
|
dp_last_ms_length = length < used_len ? 0 : length - used_len;
|
||||||
|
|
||||||
return count ? 0 : CMD_RET_FAILURE;
|
return count ? 0 : CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
@ -1337,13 +1343,13 @@ U_BOOT_CMD(
|
|||||||
"[.b, .w, .l" HELP_Q "] addr1 addr2 count"
|
"[.b, .w, .l" HELP_Q "] addr1 addr2 count"
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef CONFIG_MEM_SEARCH
|
#ifdef CONFIG_CMD_MEM_SEARCH
|
||||||
/**************************************************/
|
/**************************************************/
|
||||||
U_BOOT_CMD(
|
U_BOOT_CMD(
|
||||||
ms, 255, 1, do_mem_search,
|
ms, 255, 1, do_mem_search,
|
||||||
"memory search",
|
"memory search",
|
||||||
"[.b, .w, .l" HELP_Q ", .s] [-q | -<n>] address #-of-objects <value>..."
|
"[.b, .w, .l" HELP_Q ", .s] [-q | -<n>] address #-of-objects <value>..."
|
||||||
" -q = quiet, -l<val> = match limit" :
|
" -q = quiet, -l<val> = match limit"
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
42
cmd/sqfs.c
Normal file
42
cmd/sqfs.c
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Bootlin
|
||||||
|
*
|
||||||
|
* Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
|
||||||
|
*
|
||||||
|
* squashfs.c: implements SquashFS related commands
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <command.h>
|
||||||
|
#include <fs.h>
|
||||||
|
#include <squashfs.h>
|
||||||
|
|
||||||
|
static int do_sqfs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
|
||||||
|
{
|
||||||
|
return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SQUASHFS);
|
||||||
|
}
|
||||||
|
|
||||||
|
U_BOOT_CMD(sqfsls, 4, 1, do_sqfs_ls,
|
||||||
|
"List files in directory. Default: root (/).",
|
||||||
|
"<interface> [<dev[:part]>] [directory]\n"
|
||||||
|
" - list files from 'dev' on 'interface' in 'directory'\n"
|
||||||
|
);
|
||||||
|
|
||||||
|
static int do_sqfs_load(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
|
||||||
|
{
|
||||||
|
return do_load(cmdtp, flag, argc, argv, FS_TYPE_SQUASHFS);
|
||||||
|
}
|
||||||
|
|
||||||
|
U_BOOT_CMD(sqfsload, 7, 0, do_sqfs_load,
|
||||||
|
"load binary file from a SquashFS filesystem",
|
||||||
|
"<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n"
|
||||||
|
" - Load binary file 'filename' from 'dev' on 'interface'\n"
|
||||||
|
" to address 'addr' from SquashFS filesystem.\n"
|
||||||
|
" 'pos' gives the file position to start loading from.\n"
|
||||||
|
" If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n"
|
||||||
|
" 'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n"
|
||||||
|
" the load stops on end of file.\n"
|
||||||
|
" If either 'pos' or 'bytes' are not aligned to\n"
|
||||||
|
" ARCH_DMA_MINALIGN then a misaligned buffer warning will\n"
|
||||||
|
" be printed and performance will suffer for the load."
|
||||||
|
);
|
@ -635,10 +635,12 @@ void console_record_reset(void)
|
|||||||
membuff_purge((struct membuff *)&gd->console_in);
|
membuff_purge((struct membuff *)&gd->console_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
void console_record_reset_enable(void)
|
int console_record_reset_enable(void)
|
||||||
{
|
{
|
||||||
console_record_reset();
|
console_record_reset();
|
||||||
gd->flags |= GD_FLG_RECORD;
|
gd->flags |= GD_FLG_RECORD;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int console_record_readline(char *str, int maxlen)
|
int console_record_readline(char *str, int maxlen)
|
||||||
|
@ -577,6 +577,15 @@ config SPL_FS_EXT4
|
|||||||
filesystem from within SPL. Support for the underlying block
|
filesystem from within SPL. Support for the underlying block
|
||||||
device (e.g. MMC or USB) must be enabled separately.
|
device (e.g. MMC or USB) must be enabled separately.
|
||||||
|
|
||||||
|
config SPL_FS_SQUASHFS
|
||||||
|
bool "Support SquashFS filesystems"
|
||||||
|
select FS_SQUASHFS
|
||||||
|
help
|
||||||
|
Enable support for SquashFS filesystems with SPL. This permits
|
||||||
|
U-Boot (or Linux in Falcon mode) to be loaded from a SquashFS
|
||||||
|
filesystem from within SPL. Support for the underlying block
|
||||||
|
device (e.g. MMC or USB) must be enabled separately.
|
||||||
|
|
||||||
config SPL_FS_FAT
|
config SPL_FS_FAT
|
||||||
bool "Support FAT filesystems"
|
bool "Support FAT filesystems"
|
||||||
select FS_FAT
|
select FS_FAT
|
||||||
|
@ -42,6 +42,7 @@ CONFIG_CMD_NVEDIT_SELECT=y
|
|||||||
CONFIG_LOOPW=y
|
CONFIG_LOOPW=y
|
||||||
CONFIG_CMD_MD5SUM=y
|
CONFIG_CMD_MD5SUM=y
|
||||||
CONFIG_CMD_MEMINFO=y
|
CONFIG_CMD_MEMINFO=y
|
||||||
|
CONFIG_CMD_MEM_SEARCH=y
|
||||||
CONFIG_CMD_MX_CYCLIC=y
|
CONFIG_CMD_MX_CYCLIC=y
|
||||||
CONFIG_CMD_MEMTEST=y
|
CONFIG_CMD_MEMTEST=y
|
||||||
CONFIG_SYS_MEMTEST_START=0x00100000
|
CONFIG_SYS_MEMTEST_START=0x00100000
|
||||||
@ -88,6 +89,7 @@ CONFIG_CMD_TPM=y
|
|||||||
CONFIG_CMD_TPM_TEST=y
|
CONFIG_CMD_TPM_TEST=y
|
||||||
CONFIG_CMD_BTRFS=y
|
CONFIG_CMD_BTRFS=y
|
||||||
CONFIG_CMD_CBFS=y
|
CONFIG_CMD_CBFS=y
|
||||||
|
CONFIG_CMD_SQUASHFS=y
|
||||||
CONFIG_CMD_CRAMFS=y
|
CONFIG_CMD_CRAMFS=y
|
||||||
CONFIG_CMD_EXT4_WRITE=y
|
CONFIG_CMD_EXT4_WRITE=y
|
||||||
CONFIG_CMD_MTDPARTS=y
|
CONFIG_CMD_MTDPARTS=y
|
||||||
|
@ -183,4 +183,4 @@ static int dm_test_acpi_cmd_items(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_cmd_items, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_cmd_items, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -35,6 +35,14 @@ config LED_BCM6858
|
|||||||
This option enables support for LEDs connected to the BCM6858
|
This option enables support for LEDs connected to the BCM6858
|
||||||
HW has blinking capabilities and up to 32 LEDs can be controlled.
|
HW has blinking capabilities and up to 32 LEDs can be controlled.
|
||||||
|
|
||||||
|
config LED_CORTINA
|
||||||
|
bool "LED Support for Cortina Access CAxxxx SoCs"
|
||||||
|
depends on LED && (CORTINA_PLATFORM)
|
||||||
|
help
|
||||||
|
This option enables support for LEDs connected to the Cortina
|
||||||
|
Access CAxxxx SOCs.
|
||||||
|
|
||||||
|
|
||||||
config LED_BLINK
|
config LED_BLINK
|
||||||
bool "Support LED blinking"
|
bool "Support LED blinking"
|
||||||
depends on LED
|
depends on LED
|
||||||
|
@ -8,3 +8,4 @@ obj-$(CONFIG_LED_BCM6328) += led_bcm6328.o
|
|||||||
obj-$(CONFIG_LED_BCM6358) += led_bcm6358.o
|
obj-$(CONFIG_LED_BCM6358) += led_bcm6358.o
|
||||||
obj-$(CONFIG_LED_BCM6858) += led_bcm6858.o
|
obj-$(CONFIG_LED_BCM6858) += led_bcm6858.o
|
||||||
obj-$(CONFIG_$(SPL_)LED_GPIO) += led_gpio.o
|
obj-$(CONFIG_$(SPL_)LED_GPIO) += led_gpio.o
|
||||||
|
obj-$(CONFIG_LED_CORTINA) += led_cortina.o
|
||||||
|
298
drivers/led/led_cortina.c
Normal file
298
drivers/led/led_cortina.c
Normal file
@ -0,0 +1,298 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0+
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Cortina-Access
|
||||||
|
* Author: Jway Lin <jway.lin@cortina-access.com>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <dm.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <led.h>
|
||||||
|
#include <log.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
#include <dm/lists.h>
|
||||||
|
#include <linux/bitops.h>
|
||||||
|
|
||||||
|
#define LED_MAX_HW_BLINK 127
|
||||||
|
#define LED_MAX_COUNT 16
|
||||||
|
|
||||||
|
/* LED_CONTROL fields */
|
||||||
|
#define LED_BLINK_RATE1_SHIFT 0
|
||||||
|
#define LED_BLINK_RATE1_MASK 0xff
|
||||||
|
#define LED_BLINK_RATE2_SHIFT 8
|
||||||
|
#define LED_BLINK_RATE2_MASK 0xff
|
||||||
|
#define LED_CLK_TEST BIT(16)
|
||||||
|
#define LED_CLK_POLARITY BIT(17)
|
||||||
|
#define LED_CLK_TEST_MODE BIT(16)
|
||||||
|
#define LED_CLK_TEST_RX_TEST BIT(30)
|
||||||
|
#define LED_CLK_TEST_TX_TEST BIT(31)
|
||||||
|
|
||||||
|
/* LED_CONFIG fields */
|
||||||
|
#define LED_EVENT_ON_SHIFT 0
|
||||||
|
#define LED_EVENT_ON_MASK 0x7
|
||||||
|
#define LED_EVENT_BLINK_SHIFT 3
|
||||||
|
#define LED_EVENT_BLINK_MASK 0x7
|
||||||
|
#define LED_EVENT_OFF_SHIFT 6
|
||||||
|
#define LED_EVENT_OFF_MASK 0x7
|
||||||
|
#define LED_OFF_ON_SHIFT 9
|
||||||
|
#define LED_OFF_ON_MASK 0x3
|
||||||
|
#define LED_PORT_SHIFT 11
|
||||||
|
#define LED_PORT_MASK 0x7
|
||||||
|
#define LED_OFF_VAL BIT(14)
|
||||||
|
#define LED_SW_EVENT BIT(15)
|
||||||
|
#define LED_BLINK_SEL BIT(16)
|
||||||
|
|
||||||
|
/* LED_CONFIG structures */
|
||||||
|
struct cortina_led_cfg {
|
||||||
|
void __iomem *regs;
|
||||||
|
u32 pin; /* LED pin nubmer */
|
||||||
|
bool active_low; /*Active-High or Active-Low*/
|
||||||
|
u32 off_event; /* set led off event (RX,TX,SW)*/
|
||||||
|
u32 blink_event; /* set led blink event (RX,TX,SW)*/
|
||||||
|
u32 on_event; /* set led on event (RX,TX,SW)*/
|
||||||
|
u32 port; /* corresponding ethernet port */
|
||||||
|
int blink_sel; /* select blink-rate1 or blink-rate2 */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* LED_control structures */
|
||||||
|
struct cortina_led_platdata {
|
||||||
|
void __iomem *ctrl_regs;
|
||||||
|
u16 rate1; /* blink rate setting 0 */
|
||||||
|
u16 rate2; /* blink rate setting 1 */
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ca_led_state_t {
|
||||||
|
CA_EVENT_MODE = 0,
|
||||||
|
CA_LED_ON = 1,
|
||||||
|
CA_LED_OFF,
|
||||||
|
};
|
||||||
|
|
||||||
|
static void cortina_led_write(void __iomem *reg, unsigned long data)
|
||||||
|
{
|
||||||
|
writel(data, reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static unsigned long cortina_led_read(void __iomem *reg)
|
||||||
|
{
|
||||||
|
return readl(reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static enum led_state_t cortina_led_get_state(struct udevice *dev)
|
||||||
|
{
|
||||||
|
struct cortina_led_cfg *priv = dev_get_priv(dev);
|
||||||
|
enum led_state_t state = LEDST_OFF;
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
val = readl(priv->regs);
|
||||||
|
|
||||||
|
if (val & LED_SW_EVENT)
|
||||||
|
state = LEDST_ON;
|
||||||
|
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cortina_led_set_state(struct udevice *dev, enum led_state_t state)
|
||||||
|
{
|
||||||
|
u32 val;
|
||||||
|
struct cortina_led_cfg *priv = dev_get_priv(dev);
|
||||||
|
|
||||||
|
val = readl(priv->regs);
|
||||||
|
val &= ~(LED_OFF_ON_MASK << LED_OFF_ON_SHIFT);
|
||||||
|
|
||||||
|
switch (state) {
|
||||||
|
case LEDST_OFF:
|
||||||
|
val &= ~LED_SW_EVENT;
|
||||||
|
val |= CA_LED_OFF << LED_OFF_ON_SHIFT;
|
||||||
|
cortina_led_write(priv->regs, val);
|
||||||
|
break;
|
||||||
|
case LEDST_ON:
|
||||||
|
val |= LED_SW_EVENT;
|
||||||
|
val |= CA_LED_ON << LED_OFF_ON_SHIFT;
|
||||||
|
cortina_led_write(priv->regs, val);
|
||||||
|
break;
|
||||||
|
case LEDST_TOGGLE:
|
||||||
|
if (cortina_led_get_state(dev) == LEDST_OFF)
|
||||||
|
return cortina_led_set_state(dev, LEDST_ON);
|
||||||
|
else
|
||||||
|
return cortina_led_set_state(dev, LEDST_OFF);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct led_ops cortina_led_ops = {
|
||||||
|
.get_state = cortina_led_get_state,
|
||||||
|
.set_state = cortina_led_set_state,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int ca_led_ofdata_to_platdata(struct udevice *dev)
|
||||||
|
{
|
||||||
|
struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
|
||||||
|
|
||||||
|
/* Top-level LED node */
|
||||||
|
if (!uc_plat->label) {
|
||||||
|
struct cortina_led_platdata *plt = dev_get_platdata(dev);
|
||||||
|
|
||||||
|
plt->rate1 =
|
||||||
|
dev_read_u32_default(dev, "Cortina,blink-rate1", 256);
|
||||||
|
plt->rate2 =
|
||||||
|
dev_read_u32_default(dev, "Cortina,blink-rate2", 512);
|
||||||
|
plt->ctrl_regs = dev_remap_addr(dev);
|
||||||
|
} else {
|
||||||
|
struct cortina_led_cfg *priv = dev_get_priv(dev);
|
||||||
|
|
||||||
|
priv->regs = dev_remap_addr(dev_get_parent(dev));
|
||||||
|
priv->pin = dev_read_u32_default(dev, "pin", LED_MAX_COUNT);
|
||||||
|
priv->blink_sel = dev_read_u32_default(dev, "blink-sel", 0);
|
||||||
|
priv->off_event = dev_read_u32_default(dev, "off-event", 0);
|
||||||
|
priv->blink_event = dev_read_u32_default(dev, "blink-event", 0);
|
||||||
|
priv->on_event = dev_read_u32_default(dev, "on-event", 0);
|
||||||
|
priv->port = dev_read_u32_default(dev, "port", 0);
|
||||||
|
|
||||||
|
if (dev_read_bool(dev, "active-low"))
|
||||||
|
priv->active_low = true;
|
||||||
|
else
|
||||||
|
priv->active_low = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cortina_led_probe(struct udevice *dev)
|
||||||
|
{
|
||||||
|
struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
|
||||||
|
|
||||||
|
/* Top-level LED node */
|
||||||
|
if (!uc_plat->label) {
|
||||||
|
struct cortina_led_platdata *platdata = dev_get_platdata(dev);
|
||||||
|
u32 reg_value, val;
|
||||||
|
u16 rate1, rate2;
|
||||||
|
|
||||||
|
if (!platdata->ctrl_regs)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
reg_value = 0;
|
||||||
|
reg_value |= LED_CLK_POLARITY;
|
||||||
|
|
||||||
|
rate1 = platdata->rate1;
|
||||||
|
rate2 = platdata->rate2;
|
||||||
|
|
||||||
|
val = rate1 / 16 - 1;
|
||||||
|
rate1 = val > LED_MAX_HW_BLINK ?
|
||||||
|
LED_MAX_HW_BLINK : val;
|
||||||
|
reg_value |= (rate1 & LED_BLINK_RATE1_MASK) <<
|
||||||
|
LED_BLINK_RATE1_SHIFT;
|
||||||
|
|
||||||
|
val = rate2 / 16 - 1;
|
||||||
|
rate2 = val > LED_MAX_HW_BLINK ?
|
||||||
|
LED_MAX_HW_BLINK : val;
|
||||||
|
reg_value |= (rate2 & LED_BLINK_RATE2_MASK) <<
|
||||||
|
LED_BLINK_RATE2_SHIFT;
|
||||||
|
|
||||||
|
cortina_led_write(platdata->ctrl_regs, reg_value);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
struct cortina_led_cfg *priv = dev_get_priv(dev);
|
||||||
|
void __iomem *regs;
|
||||||
|
u32 val, port, off_event, blink_event, on_event;
|
||||||
|
|
||||||
|
regs = priv->regs;
|
||||||
|
if (!regs)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (priv->pin >= LED_MAX_COUNT)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
priv->regs = regs + 4 + priv->pin * 4;
|
||||||
|
|
||||||
|
val = cortina_led_read(priv->regs);
|
||||||
|
|
||||||
|
if (priv->active_low)
|
||||||
|
val |= LED_OFF_VAL;
|
||||||
|
else
|
||||||
|
val &= ~LED_OFF_VAL;
|
||||||
|
|
||||||
|
if (priv->blink_sel == 0)
|
||||||
|
val &= ~LED_BLINK_SEL;
|
||||||
|
else if (priv->blink_sel == 1)
|
||||||
|
val |= LED_BLINK_SEL;
|
||||||
|
|
||||||
|
off_event = priv->off_event;
|
||||||
|
val &= ~(LED_EVENT_OFF_MASK << LED_EVENT_OFF_SHIFT);
|
||||||
|
if (off_event != 0)
|
||||||
|
val |= BIT(off_event) << LED_EVENT_OFF_SHIFT;
|
||||||
|
|
||||||
|
blink_event = priv->blink_event;
|
||||||
|
val &= ~(LED_EVENT_BLINK_MASK << LED_EVENT_BLINK_SHIFT);
|
||||||
|
if (blink_event != 0)
|
||||||
|
val |= BIT(blink_event) << LED_EVENT_BLINK_SHIFT;
|
||||||
|
|
||||||
|
on_event = priv->on_event;
|
||||||
|
val &= ~(LED_EVENT_ON_MASK << LED_EVENT_ON_SHIFT);
|
||||||
|
if (on_event != 0)
|
||||||
|
val |= BIT(on_event) << LED_EVENT_ON_SHIFT;
|
||||||
|
|
||||||
|
port = priv->port;
|
||||||
|
val &= ~(LED_PORT_MASK << LED_PORT_SHIFT);
|
||||||
|
val |= port << LED_PORT_SHIFT;
|
||||||
|
|
||||||
|
/* force off */
|
||||||
|
val &= ~(LED_OFF_ON_MASK << LED_OFF_ON_SHIFT);
|
||||||
|
val |= CA_LED_OFF << LED_OFF_ON_SHIFT;
|
||||||
|
|
||||||
|
cortina_led_write(priv->regs, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cortina_led_bind(struct udevice *parent)
|
||||||
|
{
|
||||||
|
ofnode node;
|
||||||
|
|
||||||
|
dev_for_each_subnode(node, parent) {
|
||||||
|
struct led_uc_plat *uc_plat;
|
||||||
|
struct udevice *dev;
|
||||||
|
const char *label;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
label = ofnode_read_string(node, "label");
|
||||||
|
if (!label) {
|
||||||
|
debug("%s: node %s has no label\n", __func__,
|
||||||
|
ofnode_get_name(node));
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = device_bind_driver_to_node(parent, "ca-leds",
|
||||||
|
ofnode_get_name(node),
|
||||||
|
node, &dev);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
uc_plat = dev_get_uclass_platdata(dev);
|
||||||
|
uc_plat->label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct udevice_id ca_led_ids[] = {
|
||||||
|
{ .compatible = "cortina,ca-leds" },
|
||||||
|
{ /* sentinel */ }
|
||||||
|
};
|
||||||
|
|
||||||
|
U_BOOT_DRIVER(cortina_led) = {
|
||||||
|
.name = "ca-leds",
|
||||||
|
.id = UCLASS_LED,
|
||||||
|
.of_match = ca_led_ids,
|
||||||
|
.ofdata_to_platdata = ca_led_ofdata_to_platdata,
|
||||||
|
.bind = cortina_led_bind,
|
||||||
|
.probe = cortina_led_probe,
|
||||||
|
.platdata_auto_alloc_size = sizeof(struct cortina_led_platdata),
|
||||||
|
.priv_auto_alloc_size = sizeof(struct cortina_led_cfg),
|
||||||
|
.ops = &cortina_led_ops,
|
||||||
|
};
|
@ -22,4 +22,6 @@ source "fs/cramfs/Kconfig"
|
|||||||
|
|
||||||
source "fs/yaffs2/Kconfig"
|
source "fs/yaffs2/Kconfig"
|
||||||
|
|
||||||
|
source "fs/squashfs/Kconfig"
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@ -9,6 +9,7 @@ obj-$(CONFIG_FS_LOADER) += fs.o
|
|||||||
obj-$(CONFIG_SPL_FS_FAT) += fat/
|
obj-$(CONFIG_SPL_FS_FAT) += fat/
|
||||||
obj-$(CONFIG_SPL_FS_EXT4) += ext4/
|
obj-$(CONFIG_SPL_FS_EXT4) += ext4/
|
||||||
obj-$(CONFIG_SPL_FS_CBFS) += cbfs/
|
obj-$(CONFIG_SPL_FS_CBFS) += cbfs/
|
||||||
|
obj-$(CONFIG_SPL_FS_SQUASHFS) += squashfs/
|
||||||
else
|
else
|
||||||
obj-y += fs.o
|
obj-y += fs.o
|
||||||
|
|
||||||
@ -23,5 +24,6 @@ obj-$(CONFIG_SANDBOX) += sandbox/
|
|||||||
obj-$(CONFIG_CMD_UBIFS) += ubifs/
|
obj-$(CONFIG_CMD_UBIFS) += ubifs/
|
||||||
obj-$(CONFIG_YAFFS2) += yaffs2/
|
obj-$(CONFIG_YAFFS2) += yaffs2/
|
||||||
obj-$(CONFIG_CMD_ZFS) += zfs/
|
obj-$(CONFIG_CMD_ZFS) += zfs/
|
||||||
|
obj-$(CONFIG_FS_SQUASHFS) += squashfs/
|
||||||
endif
|
endif
|
||||||
obj-y += fs_internal.o
|
obj-y += fs_internal.o
|
||||||
|
18
fs/fs.c
18
fs/fs.c
@ -22,6 +22,7 @@
|
|||||||
#include <div64.h>
|
#include <div64.h>
|
||||||
#include <linux/math64.h>
|
#include <linux/math64.h>
|
||||||
#include <efi_loader.h>
|
#include <efi_loader.h>
|
||||||
|
#include <squashfs.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
@ -58,6 +59,9 @@ static int fs_ls_generic(const char *dirname)
|
|||||||
if (dent->type == FS_DT_DIR) {
|
if (dent->type == FS_DT_DIR) {
|
||||||
printf(" %s/\n", dent->name);
|
printf(" %s/\n", dent->name);
|
||||||
ndirs++;
|
ndirs++;
|
||||||
|
} else if (dent->type == FS_DT_LNK) {
|
||||||
|
printf(" <SYM> %s\n", dent->name);
|
||||||
|
nfiles++;
|
||||||
} else {
|
} else {
|
||||||
printf(" %8lld %s\n", dent->size, dent->name);
|
printf(" %8lld %s\n", dent->size, dent->name);
|
||||||
nfiles++;
|
nfiles++;
|
||||||
@ -276,6 +280,20 @@ static struct fstype_info fstypes[] = {
|
|||||||
.mkdir = fs_mkdir_unsupported,
|
.mkdir = fs_mkdir_unsupported,
|
||||||
.ln = fs_ln_unsupported,
|
.ln = fs_ln_unsupported,
|
||||||
},
|
},
|
||||||
|
#endif
|
||||||
|
#if IS_ENABLED(CONFIG_FS_SQUASHFS)
|
||||||
|
{
|
||||||
|
.fstype = FS_TYPE_SQUASHFS,
|
||||||
|
.name = "squashfs",
|
||||||
|
.probe = sqfs_probe,
|
||||||
|
.opendir = sqfs_opendir,
|
||||||
|
.readdir = sqfs_readdir,
|
||||||
|
.ls = fs_ls_generic,
|
||||||
|
.read = sqfs_read,
|
||||||
|
.size = sqfs_size,
|
||||||
|
.close = sqfs_close,
|
||||||
|
.closedir = sqfs_closedir,
|
||||||
|
},
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
.fstype = FS_TYPE_ANY,
|
.fstype = FS_TYPE_ANY,
|
||||||
|
11
fs/squashfs/Kconfig
Normal file
11
fs/squashfs/Kconfig
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
config FS_SQUASHFS
|
||||||
|
bool "Enable SquashFS filesystem support"
|
||||||
|
select ZLIB_UNCOMPRESS
|
||||||
|
help
|
||||||
|
This provides support for reading images from SquashFS filesystem.
|
||||||
|
Squashfs is a compressed read-only filesystem for Linux.
|
||||||
|
It uses zlib, lz4, lzo, or xz compression to compress files, inodes
|
||||||
|
and directories. Squashfs is intended for general read-only
|
||||||
|
filesystem use, for archival use (i.e. in cases where a .tar.gz file
|
||||||
|
may be used), and in constrained block device/memory systems (e.g.
|
||||||
|
embedded systems) where low overhead is needed.
|
7
fs/squashfs/Makefile
Normal file
7
fs/squashfs/Makefile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# SPDX-License-Identifier: GPL-2.0+
|
||||||
|
#
|
||||||
|
|
||||||
|
obj-$(CONFIG_$(SPL_)FS_SQUASHFS) = sqfs.o \
|
||||||
|
sqfs_inode.o \
|
||||||
|
sqfs_dir.o \
|
||||||
|
sqfs_decompressor.o
|
1538
fs/squashfs/sqfs.c
Normal file
1538
fs/squashfs/sqfs.c
Normal file
File diff suppressed because it is too large
Load Diff
59
fs/squashfs/sqfs_decompressor.c
Normal file
59
fs/squashfs/sqfs_decompressor.c
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Bootlin
|
||||||
|
*
|
||||||
|
* Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#if IS_ENABLED(CONFIG_ZLIB)
|
||||||
|
#include <u-boot/zlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "sqfs_decompressor.h"
|
||||||
|
#include "sqfs_filesystem.h"
|
||||||
|
#include "sqfs_utils.h"
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_ZLIB)
|
||||||
|
static void zlib_decompression_status(int ret)
|
||||||
|
{
|
||||||
|
switch (ret) {
|
||||||
|
case Z_BUF_ERROR:
|
||||||
|
printf("Error: 'dest' buffer is not large enough.\n");
|
||||||
|
break;
|
||||||
|
case Z_DATA_ERROR:
|
||||||
|
printf("Error: corrupted compressed data.\n");
|
||||||
|
break;
|
||||||
|
case Z_MEM_ERROR:
|
||||||
|
printf("Error: insufficient memory.\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int sqfs_decompress(u16 comp_type, void *dest, unsigned long *dest_len,
|
||||||
|
void *source, u32 lenp)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
switch (comp_type) {
|
||||||
|
#if IS_ENABLED(CONFIG_ZLIB)
|
||||||
|
case SQFS_COMP_ZLIB:
|
||||||
|
ret = uncompress(dest, dest_len, source, lenp);
|
||||||
|
if (ret) {
|
||||||
|
zlib_decompression_status(ret);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
printf("Error: unknown compression type.\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
58
fs/squashfs/sqfs_decompressor.h
Normal file
58
fs/squashfs/sqfs_decompressor.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Bootlin
|
||||||
|
*
|
||||||
|
* Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SQFS_DECOMPRESSOR_H
|
||||||
|
#define SQFS_DECOMPRESSOR_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define SQFS_COMP_ZLIB 1
|
||||||
|
#define SQFS_COMP_LZMA 2
|
||||||
|
#define SQFS_COMP_LZO 3
|
||||||
|
#define SQFS_COMP_XZ 4
|
||||||
|
#define SQFS_COMP_LZ4 5
|
||||||
|
#define SQFS_COMP_ZSTD 6
|
||||||
|
|
||||||
|
/* LZMA does not support any compression options */
|
||||||
|
|
||||||
|
struct squashfs_gzip_opts {
|
||||||
|
u32 compression_level;
|
||||||
|
u16 window_size;
|
||||||
|
u16 strategies;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_xz_opts {
|
||||||
|
u32 dictionary_size;
|
||||||
|
u32 executable_filters;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_lz4_opts {
|
||||||
|
u32 version;
|
||||||
|
u32 flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_zstd_opts {
|
||||||
|
u32 compression_level;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_lzo_opts {
|
||||||
|
u32 algorithm;
|
||||||
|
u32 level;
|
||||||
|
};
|
||||||
|
|
||||||
|
union squashfs_compression_opts {
|
||||||
|
struct squashfs_gzip_opts *gzip;
|
||||||
|
struct squashfs_xz_opts *xz;
|
||||||
|
struct squashfs_lz4_opts *lz4;
|
||||||
|
struct squashfs_zstd_opts *zstd;
|
||||||
|
struct squashfs_lzo_opts *lzo;
|
||||||
|
};
|
||||||
|
|
||||||
|
int sqfs_decompress(u16 comp_type, void *dest, unsigned long *dest_len,
|
||||||
|
void *source, u32 lenp);
|
||||||
|
|
||||||
|
#endif /* SQFS_DECOMPRESSOR_H */
|
91
fs/squashfs/sqfs_dir.c
Normal file
91
fs/squashfs/sqfs_dir.c
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Bootlin
|
||||||
|
*
|
||||||
|
* Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <linux/byteorder/little_endian.h>
|
||||||
|
#include <linux/byteorder/generic.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "sqfs_filesystem.h"
|
||||||
|
#include "sqfs_utils.h"
|
||||||
|
|
||||||
|
bool sqfs_is_dir(u16 type)
|
||||||
|
{
|
||||||
|
return type == SQFS_DIR_TYPE || type == SQFS_LDIR_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Receives a pointer (void *) to a position in the inode table containing the
|
||||||
|
* directory's inode. Returns directory inode offset into the directory table.
|
||||||
|
* m_list contains each metadata block's position, and m_count is the number of
|
||||||
|
* elements of m_list. Those metadata blocks come from the compressed directory
|
||||||
|
* table.
|
||||||
|
*/
|
||||||
|
int sqfs_dir_offset(void *dir_i, u32 *m_list, int m_count)
|
||||||
|
{
|
||||||
|
struct squashfs_base_inode *base = dir_i;
|
||||||
|
struct squashfs_ldir_inode *ldir;
|
||||||
|
struct squashfs_dir_inode *dir;
|
||||||
|
u32 start_block;
|
||||||
|
u16 offset;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
switch (get_unaligned_le16(&base->inode_type)) {
|
||||||
|
case SQFS_DIR_TYPE:
|
||||||
|
dir = (struct squashfs_dir_inode *)base;
|
||||||
|
start_block = get_unaligned_le32(&dir->start_block);
|
||||||
|
offset = get_unaligned_le16(&dir->offset);
|
||||||
|
break;
|
||||||
|
case SQFS_LDIR_TYPE:
|
||||||
|
ldir = (struct squashfs_ldir_inode *)base;
|
||||||
|
start_block = get_unaligned_le32(&ldir->start_block);
|
||||||
|
offset = get_unaligned_le16(&ldir->offset);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
printf("Error: this is not a directory.\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < m_count; j++) {
|
||||||
|
if (m_list[j] == start_block)
|
||||||
|
return (++j * SQFS_METADATA_BLOCK_SIZE) + offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (start_block == 0)
|
||||||
|
return offset;
|
||||||
|
|
||||||
|
printf("Error: invalid inode reference to directory table.\n");
|
||||||
|
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool sqfs_is_empty_dir(void *dir_i)
|
||||||
|
{
|
||||||
|
struct squashfs_base_inode *base = dir_i;
|
||||||
|
struct squashfs_ldir_inode *ldir;
|
||||||
|
struct squashfs_dir_inode *dir;
|
||||||
|
u32 file_size;
|
||||||
|
|
||||||
|
switch (get_unaligned_le16(&base->inode_type)) {
|
||||||
|
case SQFS_DIR_TYPE:
|
||||||
|
dir = (struct squashfs_dir_inode *)base;
|
||||||
|
file_size = get_unaligned_le16(&dir->file_size);
|
||||||
|
break;
|
||||||
|
case SQFS_LDIR_TYPE:
|
||||||
|
ldir = (struct squashfs_ldir_inode *)base;
|
||||||
|
file_size = get_unaligned_le16(&ldir->file_size);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
printf("Error: this is not a directory.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return file_size == SQFS_EMPTY_FILE_SIZE;
|
||||||
|
}
|
300
fs/squashfs/sqfs_filesystem.h
Normal file
300
fs/squashfs/sqfs_filesystem.h
Normal file
@ -0,0 +1,300 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Bootlin
|
||||||
|
*
|
||||||
|
* Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SQFS_FILESYSTEM_H
|
||||||
|
#define SQFS_FILESYSTEM_H
|
||||||
|
|
||||||
|
#include <asm/unaligned.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <fs.h>
|
||||||
|
|
||||||
|
#define SQFS_UNCOMPRESSED_DATA 0x0002
|
||||||
|
#define SQFS_MAGIC_NUMBER 0x73717368
|
||||||
|
/* The three first members of squashfs_dir_index make a total of 12 bytes */
|
||||||
|
#define SQFS_DIR_INDEX_BASE_LENGTH 12
|
||||||
|
/* size of metadata (inode and directory) blocks */
|
||||||
|
#define SQFS_METADATA_BLOCK_SIZE 8192
|
||||||
|
/* Max. number of fragment entries in a metadata block is 512 */
|
||||||
|
#define SQFS_MAX_ENTRIES 512
|
||||||
|
/* Metadata blocks start by a 2-byte length header */
|
||||||
|
#define SQFS_HEADER_SIZE 2
|
||||||
|
#define SQFS_LREG_INODE_MIN_SIZE 56
|
||||||
|
#define SQFS_DIR_HEADER_SIZE 12
|
||||||
|
#define SQFS_MISC_ENTRY_TYPE -1
|
||||||
|
#define SQFS_EMPTY_FILE_SIZE 3
|
||||||
|
#define SQFS_STOP_READDIR 1
|
||||||
|
#define SQFS_EMPTY_DIR -1
|
||||||
|
/*
|
||||||
|
* A directory entry object has a fixed length of 8 bytes, corresponding to its
|
||||||
|
* first four members, plus the size of the entry name, which is equal to
|
||||||
|
* 'entry_name' + 1 bytes.
|
||||||
|
*/
|
||||||
|
#define SQFS_ENTRY_BASE_LENGTH 8
|
||||||
|
/* Inode types */
|
||||||
|
#define SQFS_DIR_TYPE 1
|
||||||
|
#define SQFS_REG_TYPE 2
|
||||||
|
#define SQFS_SYMLINK_TYPE 3
|
||||||
|
#define SQFS_BLKDEV_TYPE 4
|
||||||
|
#define SQFS_CHRDEV_TYPE 5
|
||||||
|
#define SQFS_FIFO_TYPE 6
|
||||||
|
#define SQFS_SOCKET_TYPE 7
|
||||||
|
#define SQFS_LDIR_TYPE 8
|
||||||
|
#define SQFS_LREG_TYPE 9
|
||||||
|
#define SQFS_LSYMLINK_TYPE 10
|
||||||
|
#define SQFS_LBLKDEV_TYPE 11
|
||||||
|
#define SQFS_LCHRDEV_TYPE 12
|
||||||
|
#define SQFS_LFIFO_TYPE 13
|
||||||
|
#define SQFS_LSOCKET_TYPE 14
|
||||||
|
|
||||||
|
struct squashfs_super_block {
|
||||||
|
__le32 s_magic;
|
||||||
|
__le32 inodes;
|
||||||
|
__le32 mkfs_time;
|
||||||
|
__le32 block_size;
|
||||||
|
__le32 fragments;
|
||||||
|
__le16 compression;
|
||||||
|
__le16 block_log;
|
||||||
|
__le16 flags;
|
||||||
|
__le16 no_ids;
|
||||||
|
__le16 s_major;
|
||||||
|
__le16 s_minor;
|
||||||
|
__le64 root_inode;
|
||||||
|
__le64 bytes_used;
|
||||||
|
__le64 id_table_start;
|
||||||
|
__le64 xattr_id_table_start;
|
||||||
|
__le64 inode_table_start;
|
||||||
|
__le64 directory_table_start;
|
||||||
|
__le64 fragment_table_start;
|
||||||
|
__le64 export_table_start;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_directory_index {
|
||||||
|
u32 index;
|
||||||
|
u32 start;
|
||||||
|
u32 size;
|
||||||
|
char name[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_base_inode {
|
||||||
|
__le16 inode_type;
|
||||||
|
__le16 mode;
|
||||||
|
__le16 uid;
|
||||||
|
__le16 guid;
|
||||||
|
__le32 mtime;
|
||||||
|
__le32 inode_number;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_ipc_inode {
|
||||||
|
__le16 inode_type;
|
||||||
|
__le16 mode;
|
||||||
|
__le16 uid;
|
||||||
|
__le16 guid;
|
||||||
|
__le32 mtime;
|
||||||
|
__le32 inode_number;
|
||||||
|
__le32 nlink;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_lipc_inode {
|
||||||
|
__le16 inode_type;
|
||||||
|
__le16 mode;
|
||||||
|
__le16 uid;
|
||||||
|
__le16 guid;
|
||||||
|
__le32 mtime;
|
||||||
|
__le32 inode_number;
|
||||||
|
__le32 nlink;
|
||||||
|
__le32 xattr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_dev_inode {
|
||||||
|
__le16 inode_type;
|
||||||
|
__le16 mode;
|
||||||
|
__le16 uid;
|
||||||
|
__le16 guid;
|
||||||
|
__le32 mtime;
|
||||||
|
__le32 inode_number;
|
||||||
|
__le32 nlink;
|
||||||
|
__le32 rdev;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_ldev_inode {
|
||||||
|
__le16 inode_type;
|
||||||
|
__le16 mode;
|
||||||
|
__le16 uid;
|
||||||
|
__le16 guid;
|
||||||
|
__le32 mtime;
|
||||||
|
__le32 inode_number;
|
||||||
|
__le32 nlink;
|
||||||
|
__le32 rdev;
|
||||||
|
__le32 xattr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_symlink_inode {
|
||||||
|
__le16 inode_type;
|
||||||
|
__le16 mode;
|
||||||
|
__le16 uid;
|
||||||
|
__le16 guid;
|
||||||
|
__le32 mtime;
|
||||||
|
__le32 inode_number;
|
||||||
|
__le32 nlink;
|
||||||
|
__le32 symlink_size;
|
||||||
|
char symlink[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_reg_inode {
|
||||||
|
__le16 inode_type;
|
||||||
|
__le16 mode;
|
||||||
|
__le16 uid;
|
||||||
|
__le16 guid;
|
||||||
|
__le32 mtime;
|
||||||
|
__le32 inode_number;
|
||||||
|
__le32 start_block;
|
||||||
|
__le32 fragment;
|
||||||
|
__le32 offset;
|
||||||
|
__le32 file_size;
|
||||||
|
__le32 block_list[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_lreg_inode {
|
||||||
|
__le16 inode_type;
|
||||||
|
__le16 mode;
|
||||||
|
__le16 uid;
|
||||||
|
__le16 guid;
|
||||||
|
__le32 mtime;
|
||||||
|
__le32 inode_number;
|
||||||
|
__le64 start_block;
|
||||||
|
__le64 file_size;
|
||||||
|
__le64 sparse;
|
||||||
|
__le32 nlink;
|
||||||
|
__le32 fragment;
|
||||||
|
__le32 offset;
|
||||||
|
__le32 xattr;
|
||||||
|
__le32 block_list[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_dir_inode {
|
||||||
|
__le16 inode_type;
|
||||||
|
__le16 mode;
|
||||||
|
__le16 uid;
|
||||||
|
__le16 guid;
|
||||||
|
__le32 mtime;
|
||||||
|
__le32 inode_number;
|
||||||
|
__le32 start_block;
|
||||||
|
__le32 nlink;
|
||||||
|
__le16 file_size;
|
||||||
|
__le16 offset;
|
||||||
|
__le32 parent_inode;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_ldir_inode {
|
||||||
|
__le16 inode_type;
|
||||||
|
__le16 mode;
|
||||||
|
__le16 uid;
|
||||||
|
__le16 guid;
|
||||||
|
__le32 mtime;
|
||||||
|
__le32 inode_number;
|
||||||
|
__le32 nlink;
|
||||||
|
__le32 file_size;
|
||||||
|
__le32 start_block;
|
||||||
|
__le32 parent_inode;
|
||||||
|
__le16 i_count;
|
||||||
|
__le16 offset;
|
||||||
|
__le32 xattr;
|
||||||
|
struct squashfs_directory_index index[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
union squashfs_inode {
|
||||||
|
struct squashfs_base_inode *base;
|
||||||
|
struct squashfs_dev_inode *dev;
|
||||||
|
struct squashfs_ldev_inode *ldev;
|
||||||
|
struct squashfs_symlink_inode *symlink;
|
||||||
|
struct squashfs_reg_inode *reg;
|
||||||
|
struct squashfs_lreg_inode *lreg;
|
||||||
|
struct squashfs_dir_inode *dir;
|
||||||
|
struct squashfs_ldir_inode *ldir;
|
||||||
|
struct squashfs_ipc_inode *ipc;
|
||||||
|
struct squashfs_lipc_inode *lipc;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_directory_entry {
|
||||||
|
u16 offset;
|
||||||
|
u16 inode_offset;
|
||||||
|
u16 type;
|
||||||
|
u16 name_size;
|
||||||
|
char name[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_directory_header {
|
||||||
|
u32 count;
|
||||||
|
u32 start;
|
||||||
|
u32 inode_number;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_fragment_block_entry {
|
||||||
|
u64 start;
|
||||||
|
u32 size;
|
||||||
|
u32 _unused;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_dir_stream {
|
||||||
|
struct fs_dir_stream fs_dirs;
|
||||||
|
struct fs_dirent dentp;
|
||||||
|
/*
|
||||||
|
* 'size' is the uncompressed size of the entire listing, including
|
||||||
|
* headers. 'entry_count' is the number of entries following a
|
||||||
|
* specific header. Both variables are decremented in sqfs_readdir() so
|
||||||
|
* the function knows when the end of the directory is reached.
|
||||||
|
*/
|
||||||
|
size_t size;
|
||||||
|
int entry_count;
|
||||||
|
/* SquashFS structures */
|
||||||
|
struct squashfs_directory_header *dir_header;
|
||||||
|
struct squashfs_directory_entry *entry;
|
||||||
|
/*
|
||||||
|
* 'table' points to a position into the directory table. Both 'table'
|
||||||
|
* and 'inode' are defined for the first time in sqfs_opendir().
|
||||||
|
* 'table's value changes in sqfs_readdir().
|
||||||
|
*/
|
||||||
|
unsigned char *table;
|
||||||
|
union squashfs_inode i;
|
||||||
|
struct squashfs_dir_inode i_dir;
|
||||||
|
struct squashfs_ldir_inode i_ldir;
|
||||||
|
/*
|
||||||
|
* References to the tables' beginnings. They are assigned in
|
||||||
|
* sqfs_opendir() and freed in sqfs_closedir().
|
||||||
|
*/
|
||||||
|
unsigned char *inode_table;
|
||||||
|
unsigned char *dir_table;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct squashfs_file_info {
|
||||||
|
/* File size in bytes (uncompressed) */
|
||||||
|
size_t size;
|
||||||
|
/* Reference to list of data blocks's sizes */
|
||||||
|
u32 *blk_sizes;
|
||||||
|
/* Offset into the fragment block */
|
||||||
|
u32 offset;
|
||||||
|
/* Offset in which the data blocks begin */
|
||||||
|
u64 start;
|
||||||
|
/* Is file fragmented? */
|
||||||
|
bool frag;
|
||||||
|
/* Compressed fragment */
|
||||||
|
bool comp;
|
||||||
|
};
|
||||||
|
|
||||||
|
void *sqfs_find_inode(void *inode_table, int inode_number, __le32 inode_count,
|
||||||
|
__le32 block_size);
|
||||||
|
|
||||||
|
int sqfs_dir_offset(void *dir_i, u32 *m_list, int m_count);
|
||||||
|
|
||||||
|
int sqfs_read_metablock(unsigned char *file_mapping, int offset,
|
||||||
|
bool *compressed, u32 *data_size);
|
||||||
|
|
||||||
|
bool sqfs_is_empty_dir(void *dir_i);
|
||||||
|
|
||||||
|
bool sqfs_is_dir(u16 type);
|
||||||
|
|
||||||
|
#endif /* SQFS_FILESYSTEM_H */
|
155
fs/squashfs/sqfs_inode.c
Normal file
155
fs/squashfs/sqfs_inode.c
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Bootlin
|
||||||
|
*
|
||||||
|
* Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <asm/unaligned.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "sqfs_decompressor.h"
|
||||||
|
#include "sqfs_filesystem.h"
|
||||||
|
#include "sqfs_utils.h"
|
||||||
|
|
||||||
|
int sqfs_inode_size(struct squashfs_base_inode *inode, u32 blk_size)
|
||||||
|
{
|
||||||
|
switch (get_unaligned_le16(&inode->inode_type)) {
|
||||||
|
case SQFS_DIR_TYPE:
|
||||||
|
return sizeof(struct squashfs_dir_inode);
|
||||||
|
|
||||||
|
case SQFS_REG_TYPE: {
|
||||||
|
struct squashfs_reg_inode *reg =
|
||||||
|
(struct squashfs_reg_inode *)inode;
|
||||||
|
u32 fragment = get_unaligned_le32(®->fragment);
|
||||||
|
u32 file_size = get_unaligned_le32(®->file_size);
|
||||||
|
unsigned int blk_list_size;
|
||||||
|
|
||||||
|
if (SQFS_IS_FRAGMENTED(fragment))
|
||||||
|
blk_list_size = file_size / blk_size;
|
||||||
|
else
|
||||||
|
blk_list_size = DIV_ROUND_UP(file_size, blk_size);
|
||||||
|
|
||||||
|
return sizeof(*reg) + blk_list_size * sizeof(u32);
|
||||||
|
}
|
||||||
|
|
||||||
|
case SQFS_LDIR_TYPE: {
|
||||||
|
struct squashfs_ldir_inode *ldir =
|
||||||
|
(struct squashfs_ldir_inode *)inode;
|
||||||
|
u16 i_count = get_unaligned_le16(&ldir->i_count);
|
||||||
|
unsigned int index_list_size = 0, l = 0;
|
||||||
|
struct squashfs_directory_index *di;
|
||||||
|
u32 sz;
|
||||||
|
|
||||||
|
if (i_count == 0)
|
||||||
|
return sizeof(*ldir);
|
||||||
|
|
||||||
|
di = ldir->index;
|
||||||
|
while (l < i_count + 1) {
|
||||||
|
sz = get_unaligned_le32(&di->size) + 1;
|
||||||
|
index_list_size += sz;
|
||||||
|
di = (void *)di + sizeof(*di) + sz;
|
||||||
|
l++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return sizeof(*ldir) + index_list_size +
|
||||||
|
(i_count + 1) * SQFS_DIR_INDEX_BASE_LENGTH;
|
||||||
|
}
|
||||||
|
|
||||||
|
case SQFS_LREG_TYPE: {
|
||||||
|
struct squashfs_lreg_inode *lreg =
|
||||||
|
(struct squashfs_lreg_inode *)inode;
|
||||||
|
u32 fragment = get_unaligned_le32(&lreg->fragment);
|
||||||
|
u64 file_size = get_unaligned_le64(&lreg->file_size);
|
||||||
|
unsigned int blk_list_size;
|
||||||
|
|
||||||
|
if (fragment == 0xFFFFFFFF)
|
||||||
|
blk_list_size = DIV_ROUND_UP(file_size, blk_size);
|
||||||
|
else
|
||||||
|
blk_list_size = file_size / blk_size;
|
||||||
|
|
||||||
|
return sizeof(*lreg) + blk_list_size * sizeof(u32);
|
||||||
|
}
|
||||||
|
|
||||||
|
case SQFS_SYMLINK_TYPE:
|
||||||
|
case SQFS_LSYMLINK_TYPE: {
|
||||||
|
struct squashfs_symlink_inode *symlink =
|
||||||
|
(struct squashfs_symlink_inode *)inode;
|
||||||
|
|
||||||
|
return sizeof(*symlink) +
|
||||||
|
get_unaligned_le32(&symlink->symlink_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
case SQFS_BLKDEV_TYPE:
|
||||||
|
case SQFS_CHRDEV_TYPE:
|
||||||
|
return sizeof(struct squashfs_dev_inode);
|
||||||
|
case SQFS_LBLKDEV_TYPE:
|
||||||
|
case SQFS_LCHRDEV_TYPE:
|
||||||
|
return sizeof(struct squashfs_ldev_inode);
|
||||||
|
case SQFS_FIFO_TYPE:
|
||||||
|
case SQFS_SOCKET_TYPE:
|
||||||
|
return sizeof(struct squashfs_ipc_inode);
|
||||||
|
case SQFS_LFIFO_TYPE:
|
||||||
|
case SQFS_LSOCKET_TYPE:
|
||||||
|
return sizeof(struct squashfs_lipc_inode);
|
||||||
|
default:
|
||||||
|
printf("Error while searching inode: unknown type.\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Given the uncompressed inode table, the inode to be found and the number of
|
||||||
|
* inodes in the table, return inode position in case of success.
|
||||||
|
*/
|
||||||
|
void *sqfs_find_inode(void *inode_table, int inode_number, __le32 inode_count,
|
||||||
|
__le32 block_size)
|
||||||
|
{
|
||||||
|
struct squashfs_base_inode *base;
|
||||||
|
unsigned int offset = 0, k;
|
||||||
|
int sz;
|
||||||
|
|
||||||
|
if (!inode_table) {
|
||||||
|
printf("%s: Invalid pointer to inode table.\n", __func__);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (k = 0; k < le32_to_cpu(inode_count); k++) {
|
||||||
|
base = inode_table + offset;
|
||||||
|
if (get_unaligned_le32(&base->inode_number) == inode_number)
|
||||||
|
return inode_table + offset;
|
||||||
|
|
||||||
|
sz = sqfs_inode_size(base, le32_to_cpu(block_size));
|
||||||
|
if (sz < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
offset += sz;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Inode not found.\n");
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sqfs_read_metablock(unsigned char *file_mapping, int offset,
|
||||||
|
bool *compressed, u32 *data_size)
|
||||||
|
{
|
||||||
|
unsigned char *data;
|
||||||
|
u16 header;
|
||||||
|
|
||||||
|
data = file_mapping + offset;
|
||||||
|
header = get_unaligned((u16 *)data);
|
||||||
|
*compressed = SQFS_COMPRESSED_METADATA(header);
|
||||||
|
*data_size = SQFS_METADATA_SIZE(header);
|
||||||
|
|
||||||
|
if (*data_size > SQFS_METADATA_BLOCK_SIZE) {
|
||||||
|
printf("Invalid metatada block size: %d bytes.\n", *data_size);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
49
fs/squashfs/sqfs_utils.h
Normal file
49
fs/squashfs/sqfs_utils.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Bootlin
|
||||||
|
*
|
||||||
|
* Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SQFS_UTILS_H
|
||||||
|
#define SQFS_UTILS_H
|
||||||
|
|
||||||
|
#include <linux/bitops.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#define SQFS_FRAGMENT_INDEX_OFFSET(A) ((A) % SQFS_MAX_ENTRIES)
|
||||||
|
#define SQFS_FRAGMENT_INDEX(A) ((A) / SQFS_MAX_ENTRIES)
|
||||||
|
#define SQFS_BLOCK_SIZE(A) ((A) & GENMASK(23, 0))
|
||||||
|
#define SQFS_CHECK_FLAG(flag, bit) (((flag) >> (bit)) & 1)
|
||||||
|
/* Useful for both fragment and data blocks */
|
||||||
|
#define SQFS_COMPRESSED_BLOCK(A) (!((A) & BIT(24)))
|
||||||
|
/* SQFS_COMPRESSED_DATA strictly used with super block's 'flags' member */
|
||||||
|
#define SQFS_COMPRESSED_DATA(A) (!((A) & 0x0002))
|
||||||
|
#define SQFS_IS_FRAGMENTED(A) ((A) != 0xFFFFFFFF)
|
||||||
|
/*
|
||||||
|
* These two macros work as getters for a metada block header, retrieving the
|
||||||
|
* data size and if it is compressed/uncompressed
|
||||||
|
*/
|
||||||
|
#define SQFS_COMPRESSED_METADATA(A) (!((A) & BIT(15)))
|
||||||
|
#define SQFS_METADATA_SIZE(A) ((A) & GENMASK(14, 0))
|
||||||
|
|
||||||
|
struct squashfs_super_block_flags {
|
||||||
|
/* check: unused
|
||||||
|
* uncompressed_ids: not supported
|
||||||
|
*/
|
||||||
|
bool uncompressed_inodes;
|
||||||
|
bool uncompressed_data;
|
||||||
|
bool check;
|
||||||
|
bool uncompressed_frags;
|
||||||
|
bool no_frags;
|
||||||
|
bool always_frags;
|
||||||
|
bool duplicates;
|
||||||
|
bool exportable;
|
||||||
|
bool uncompressed_xattrs;
|
||||||
|
bool no_xattrs;
|
||||||
|
bool compressor_options;
|
||||||
|
bool uncompressed_ids;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* SQFS_UTILS_H */
|
@ -8,6 +8,7 @@
|
|||||||
#define __CONSOLE_H
|
#define __CONSOLE_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <linux/errno.h>
|
||||||
|
|
||||||
extern char console_buffer[];
|
extern char console_buffer[];
|
||||||
|
|
||||||
@ -21,11 +22,14 @@ void clear_ctrlc(void); /* clear the Control-C condition */
|
|||||||
int disable_ctrlc(int); /* 1 to disable, 0 to enable Control-C detect */
|
int disable_ctrlc(int); /* 1 to disable, 0 to enable Control-C detect */
|
||||||
int confirm_yesno(void); /* 1 if input is "y", "Y", "yes" or "YES" */
|
int confirm_yesno(void); /* 1 if input is "y", "Y", "yes" or "YES" */
|
||||||
|
|
||||||
|
#ifdef CONFIG_CONSOLE_RECORD
|
||||||
/**
|
/**
|
||||||
* console_record_init() - set up the console recording buffers
|
* console_record_init() - set up the console recording buffers
|
||||||
*
|
*
|
||||||
* This should be called as soon as malloc() is available so that the maximum
|
* This should be called as soon as malloc() is available so that the maximum
|
||||||
* amount of console output can be recorded.
|
* amount of console output can be recorded.
|
||||||
|
*
|
||||||
|
* @return 0 if OK, -ENOMEM if out of memory
|
||||||
*/
|
*/
|
||||||
int console_record_init(void);
|
int console_record_init(void);
|
||||||
|
|
||||||
@ -40,8 +44,10 @@ void console_record_reset(void);
|
|||||||
* console_record_reset_enable() - reset and enable the console buffers
|
* console_record_reset_enable() - reset and enable the console buffers
|
||||||
*
|
*
|
||||||
* This should be called to enable the console buffer.
|
* This should be called to enable the console buffer.
|
||||||
|
*
|
||||||
|
* @return 0 (always)
|
||||||
*/
|
*/
|
||||||
void console_record_reset_enable(void);
|
int console_record_reset_enable(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* console_record_readline() - Read a line from the console output
|
* console_record_readline() - Read a line from the console output
|
||||||
@ -61,6 +67,38 @@ int console_record_readline(char *str, int maxlen);
|
|||||||
* @return available bytes (0 if empty)
|
* @return available bytes (0 if empty)
|
||||||
*/
|
*/
|
||||||
int console_record_avail(void);
|
int console_record_avail(void);
|
||||||
|
#else
|
||||||
|
static inline int console_record_init(void)
|
||||||
|
{
|
||||||
|
/* Always succeed, since it is not enabled */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void console_record_reset(void)
|
||||||
|
{
|
||||||
|
/* Nothing to do here */
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int console_record_reset_enable(void)
|
||||||
|
{
|
||||||
|
/* Cannot enable it as it is not supported */
|
||||||
|
return -ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int console_record_readline(char *str, int maxlen)
|
||||||
|
{
|
||||||
|
/* Nothing to read */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int console_record_avail(void)
|
||||||
|
{
|
||||||
|
/* There is never anything available */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* !CONFIG_CONSOLE_RECORD */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* console_announce_r() - print a U-Boot console on non-serial consoles
|
* console_announce_r() - print a U-Boot console on non-serial consoles
|
||||||
|
@ -144,15 +144,6 @@ struct dm_test_state {
|
|||||||
struct udevice *removed;
|
struct udevice *removed;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Test flags for each test */
|
|
||||||
enum {
|
|
||||||
DM_TESTF_SCAN_PDATA = 1 << 0, /* test needs platform data */
|
|
||||||
DM_TESTF_PROBE_TEST = 1 << 1, /* probe test uclass */
|
|
||||||
DM_TESTF_SCAN_FDT = 1 << 2, /* scan device tree */
|
|
||||||
DM_TESTF_FLAT_TREE = 1 << 3, /* test needs flat DT */
|
|
||||||
DM_TESTF_LIVE_TREE = 1 << 4, /* needs live device tree */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Declare a new driver model test */
|
/* Declare a new driver model test */
|
||||||
#define DM_TEST(_name, _flags) UNIT_TEST(_name, _flags, dm_test)
|
#define DM_TEST(_name, _flags) UNIT_TEST(_name, _flags, dm_test)
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ struct cmd_tbl;
|
|||||||
#define FS_TYPE_SANDBOX 3
|
#define FS_TYPE_SANDBOX 3
|
||||||
#define FS_TYPE_UBIFS 4
|
#define FS_TYPE_UBIFS 4
|
||||||
#define FS_TYPE_BTRFS 5
|
#define FS_TYPE_BTRFS 5
|
||||||
|
#define FS_TYPE_SQUASHFS 6
|
||||||
|
|
||||||
struct blk_desc;
|
struct blk_desc;
|
||||||
|
|
||||||
|
25
include/squashfs.h
Normal file
25
include/squashfs.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Bootlin
|
||||||
|
*
|
||||||
|
* Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
|
||||||
|
*
|
||||||
|
* squashfs.h: SquashFS filesystem implementation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _SQFS_H_
|
||||||
|
#define _SQFS_H_
|
||||||
|
|
||||||
|
struct disk_partition;
|
||||||
|
|
||||||
|
int sqfs_opendir(const char *filename, struct fs_dir_stream **dirsp);
|
||||||
|
int sqfs_readdir(struct fs_dir_stream *dirs, struct fs_dirent **dentp);
|
||||||
|
int sqfs_probe(struct blk_desc *fs_dev_desc,
|
||||||
|
struct disk_partition *fs_partition);
|
||||||
|
int sqfs_read(const char *filename, void *buf, loff_t offset,
|
||||||
|
loff_t len, loff_t *actread);
|
||||||
|
int sqfs_size(const char *filename, loff_t *size);
|
||||||
|
void sqfs_close(void);
|
||||||
|
void sqfs_closedir(struct fs_dir_stream *dirs);
|
||||||
|
|
||||||
|
#endif /* SQFS_H */
|
@ -34,6 +34,7 @@ int do_ut_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
|||||||
int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
||||||
int do_ut_lib(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
int do_ut_lib(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
||||||
int do_ut_log(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
|
int do_ut_log(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
|
||||||
|
int do_ut_mem(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
||||||
int do_ut_optee(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
int do_ut_optee(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
||||||
int do_ut_overlay(struct cmd_tbl *cmdtp, int flag, int argc,
|
int do_ut_overlay(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
char *const argv[]);
|
char *const argv[]);
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#define __TEST_TEST_H
|
#define __TEST_TEST_H
|
||||||
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#include <linux/bitops.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* struct unit_test_state - Entire state of test system
|
* struct unit_test_state - Entire state of test system
|
||||||
@ -27,6 +28,16 @@ struct unit_test_state {
|
|||||||
char actual_str[256];
|
char actual_str[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Test flags for each test */
|
||||||
|
enum {
|
||||||
|
UT_TESTF_SCAN_PDATA = BIT(0), /* test needs platform data */
|
||||||
|
UT_TESTF_PROBE_TEST = BIT(1), /* probe test uclass */
|
||||||
|
UT_TESTF_SCAN_FDT = BIT(2), /* scan device tree */
|
||||||
|
UT_TESTF_FLAT_TREE = BIT(3), /* test needs flat DT */
|
||||||
|
UT_TESTF_LIVE_TREE = BIT(4), /* needs live device tree */
|
||||||
|
UT_TESTF_CONSOLE_REC = BIT(5), /* needs console recording */
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct unit_test - Information about a unit test
|
* struct unit_test - Information about a unit test
|
||||||
*
|
*
|
||||||
|
@ -57,6 +57,31 @@ void ut_failf(struct unit_test_state *uts, const char *fname, int line,
|
|||||||
int ut_check_console_line(struct unit_test_state *uts, const char *fmt, ...)
|
int ut_check_console_line(struct unit_test_state *uts, const char *fmt, ...)
|
||||||
__attribute__ ((format (__printf__, 2, 3)));
|
__attribute__ ((format (__printf__, 2, 3)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ut_check_console_linen() - Check part of the next console line
|
||||||
|
*
|
||||||
|
* This creates a string and then checks it against the next line of console
|
||||||
|
* output obtained with console_record_readline(). Only the length of the
|
||||||
|
* string is checked
|
||||||
|
*
|
||||||
|
* After the function returns, uts->expect_str holds the expected string and
|
||||||
|
* uts->actual_str holds the actual string read from the console.
|
||||||
|
*
|
||||||
|
* @uts: Test state
|
||||||
|
* @fmt: printf() format string for the error, followed by args
|
||||||
|
* @return 0 if OK, other value on error
|
||||||
|
*/
|
||||||
|
int ut_check_console_linen(struct unit_test_state *uts, const char *fmt, ...)
|
||||||
|
__attribute__ ((format (__printf__, 2, 3)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ut_check_skipline() - Check that the next console line exists and skip it
|
||||||
|
*
|
||||||
|
* @uts: Test state
|
||||||
|
* @return 0 if OK, other value on error
|
||||||
|
*/
|
||||||
|
int ut_check_skipline(struct unit_test_state *uts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ut_check_console_end() - Check there is no more console output
|
* ut_check_console_end() - Check there is no more console output
|
||||||
*
|
*
|
||||||
@ -152,6 +177,23 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Assert that two string expressions are equal, up to length of the
|
||||||
|
* first
|
||||||
|
*/
|
||||||
|
#define ut_asserteq_strn(expr1, expr2) { \
|
||||||
|
const char *_val1 = (expr1), *_val2 = (expr2); \
|
||||||
|
int _len = strlen(_val1); \
|
||||||
|
\
|
||||||
|
if (memcmp(_val1, _val2, _len)) { \
|
||||||
|
ut_failf(uts, __FILE__, __LINE__, __func__, \
|
||||||
|
#expr1 " = " #expr2, \
|
||||||
|
"Expected \"%.*s\", got \"%.*s\"", \
|
||||||
|
_len, _val1, _len, _val2); \
|
||||||
|
return CMD_RET_FAILURE; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
/* Assert that two memory areas are equal */
|
/* Assert that two memory areas are equal */
|
||||||
#define ut_asserteq_mem(expr1, expr2, len) { \
|
#define ut_asserteq_mem(expr1, expr2, len) { \
|
||||||
const u8 *_val1 = (u8 *)(expr1), *_val2 = (u8 *)(expr2); \
|
const u8 *_val1 = (u8 *)(expr1), *_val2 = (u8 *)(expr2); \
|
||||||
@ -231,6 +273,23 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
|
|||||||
return CMD_RET_FAILURE; \
|
return CMD_RET_FAILURE; \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
|
/* Assert that the next console output line matches up to the length */
|
||||||
|
#define ut_assert_nextlinen(fmt, args...) \
|
||||||
|
if (ut_check_console_linen(uts, fmt, ##args)) { \
|
||||||
|
ut_failf(uts, __FILE__, __LINE__, __func__, \
|
||||||
|
"console", "\nExpected '%s',\n got '%s'", \
|
||||||
|
uts->expect_str, uts->actual_str); \
|
||||||
|
return CMD_RET_FAILURE; \
|
||||||
|
} \
|
||||||
|
|
||||||
|
/* Assert that there is a 'next' console output line, and skip it */
|
||||||
|
#define ut_assert_skipline() \
|
||||||
|
if (ut_check_skipline(uts)) { \
|
||||||
|
ut_failf(uts, __FILE__, __LINE__, __func__, \
|
||||||
|
"console", "\nExpected a line, got end"); \
|
||||||
|
return CMD_RET_FAILURE; \
|
||||||
|
} \
|
||||||
|
|
||||||
/* Assert that there is no more console output */
|
/* Assert that there is no more console output */
|
||||||
#define ut_assert_console_end() \
|
#define ut_assert_console_end() \
|
||||||
if (ut_check_console_end(uts)) { \
|
if (ut_check_console_end(uts)) { \
|
||||||
|
@ -110,6 +110,12 @@ extern "C" {
|
|||||||
# define voidp z_voidp
|
# define voidp z_voidp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ZLIB_CONST) && !defined(z_const)
|
||||||
|
# define z_const const
|
||||||
|
#else
|
||||||
|
# define z_const
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__MSDOS__) && !defined(MSDOS)
|
#if defined(__MSDOS__) && !defined(MSDOS)
|
||||||
# define MSDOS
|
# define MSDOS
|
||||||
#endif
|
#endif
|
||||||
@ -710,6 +716,32 @@ ZEXTERN uInt ZEXPORT crc32 OF((uInt crc, const Bytef *buf, uInt len));
|
|||||||
if (crc != original_crc) error();
|
if (crc != original_crc) error();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
|
||||||
|
const Bytef *source, uLong sourceLen));
|
||||||
|
/*
|
||||||
|
Decompresses the source buffer into the destination buffer. sourceLen is
|
||||||
|
the byte length of the source buffer. Upon entry, destLen is the total size
|
||||||
|
of the destination buffer, which must be large enough to hold the entire
|
||||||
|
uncompressed data. (The size of the uncompressed data must have been saved
|
||||||
|
previously by the compressor and transmitted to the decompressor by some
|
||||||
|
mechanism outside the scope of this compression library.) Upon exit, destLen
|
||||||
|
is the actual size of the uncompressed data.
|
||||||
|
|
||||||
|
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
|
||||||
|
enough memory, Z_BUF_ERROR if there was not enough room in the output
|
||||||
|
buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In
|
||||||
|
the case where there is not enough room, uncompress() will fill the output
|
||||||
|
buffer with the uncompressed data up to that point.
|
||||||
|
*/
|
||||||
|
|
||||||
|
ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen,
|
||||||
|
const Bytef *source, uLong *sourceLen));
|
||||||
|
/*
|
||||||
|
Same as uncompress, except that sourceLen is a pointer, where the
|
||||||
|
length of the source is *sourceLen. On return, *sourceLen is the number of
|
||||||
|
source bytes consumed.
|
||||||
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
|
ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
|
||||||
const char *version, int stream_size));
|
const char *version, int stream_size));
|
||||||
#define inflateInit(strm) \
|
#define inflateInit(strm) \
|
||||||
|
@ -460,6 +460,13 @@ config GZIP
|
|||||||
help
|
help
|
||||||
This enables support for GZIP compression algorithm.
|
This enables support for GZIP compression algorithm.
|
||||||
|
|
||||||
|
config ZLIB_UNCOMPRESS
|
||||||
|
bool "Enables zlib's uncompress() functionality"
|
||||||
|
help
|
||||||
|
This enables an extra zlib functionality: the uncompress() function,
|
||||||
|
which decompresses data from a buffer into another, knowing their
|
||||||
|
sizes. Unlike gunzip(), there is no header parsing.
|
||||||
|
|
||||||
config GZIP_COMPRESSED
|
config GZIP_COMPRESSED
|
||||||
bool
|
bool
|
||||||
select ZLIB
|
select ZLIB
|
||||||
|
97
lib/zlib/uncompr.c
Normal file
97
lib/zlib/uncompr.c
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/* uncompr.c -- decompress a memory buffer
|
||||||
|
* Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler
|
||||||
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* @(#) $Id$ */
|
||||||
|
|
||||||
|
#define ZLIB_INTERNAL
|
||||||
|
#include "zlib.h"
|
||||||
|
|
||||||
|
/* ===========================================================================
|
||||||
|
Decompresses the source buffer into the destination buffer. *sourceLen is
|
||||||
|
the byte length of the source buffer. Upon entry, *destLen is the total size
|
||||||
|
of the destination buffer, which must be large enough to hold the entire
|
||||||
|
uncompressed data. (The size of the uncompressed data must have been saved
|
||||||
|
previously by the compressor and transmitted to the decompressor by some
|
||||||
|
mechanism outside the scope of this compression library.) Upon exit,
|
||||||
|
*destLen is the size of the decompressed data and *sourceLen is the number
|
||||||
|
of source bytes consumed. Upon return, source + *sourceLen points to the
|
||||||
|
first unused input byte.
|
||||||
|
|
||||||
|
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||||
|
memory, Z_BUF_ERROR if there was not enough room in the output buffer, or
|
||||||
|
Z_DATA_ERROR if the input data was corrupted, including if the input data is
|
||||||
|
an incomplete zlib stream.
|
||||||
|
*/
|
||||||
|
int ZEXPORT uncompress2(dest, destLen, source, sourceLen)
|
||||||
|
Bytef *dest;
|
||||||
|
uLongf *destLen;
|
||||||
|
const Bytef *source;
|
||||||
|
uLong *sourceLen;
|
||||||
|
|
||||||
|
{
|
||||||
|
z_stream stream;
|
||||||
|
int err;
|
||||||
|
const uInt max = (uInt)-1;
|
||||||
|
uLong len, left;
|
||||||
|
/* for detection of incomplete stream when *destLen == 0 */
|
||||||
|
Byte buf[1];
|
||||||
|
|
||||||
|
len = *sourceLen;
|
||||||
|
if (*destLen) {
|
||||||
|
left = *destLen;
|
||||||
|
*destLen = 0;
|
||||||
|
} else {
|
||||||
|
left = 1;
|
||||||
|
dest = buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.next_in = (z_const Bytef *)source;
|
||||||
|
stream.avail_in = 0;
|
||||||
|
stream.zalloc = (alloc_func)0;
|
||||||
|
stream.zfree = (free_func)0;
|
||||||
|
stream.opaque = (voidpf)0;
|
||||||
|
|
||||||
|
err = inflateInit(&stream);
|
||||||
|
if (err != Z_OK)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
stream.next_out = dest;
|
||||||
|
stream.avail_out = 0;
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (stream.avail_out == 0) {
|
||||||
|
stream.avail_out = left > (uLong)max ? max : (uInt)left;
|
||||||
|
left -= stream.avail_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stream.avail_in == 0) {
|
||||||
|
stream.avail_in = len > (uLong)max ? max : (uInt)len;
|
||||||
|
len -= stream.avail_in;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = inflate(&stream, Z_NO_FLUSH);
|
||||||
|
} while (err == Z_OK);
|
||||||
|
|
||||||
|
*sourceLen -= len + stream.avail_in;
|
||||||
|
if (dest != buf)
|
||||||
|
*destLen = stream.total_out;
|
||||||
|
else if (stream.total_out && err == Z_BUF_ERROR)
|
||||||
|
left = 1;
|
||||||
|
|
||||||
|
inflateEnd(&stream);
|
||||||
|
return err == Z_STREAM_END ? Z_OK :
|
||||||
|
err == Z_NEED_DICT ? Z_DATA_ERROR :
|
||||||
|
err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR :
|
||||||
|
err;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ZEXPORT uncompress(dest, destLen, source, sourceLen)
|
||||||
|
Bytef *dest;
|
||||||
|
uLongf *destLen;
|
||||||
|
const Bytef *source;
|
||||||
|
uLong sourceLen;
|
||||||
|
{
|
||||||
|
return uncompress2(dest, destLen, source, &sourceLen);
|
||||||
|
}
|
@ -30,3 +30,6 @@
|
|||||||
#include "inflate.c"
|
#include "inflate.c"
|
||||||
#include "zutil.c"
|
#include "zutil.c"
|
||||||
#include "adler32.c"
|
#include "adler32.c"
|
||||||
|
#if IS_ENABLED(CONFIG_ZLIB_UNCOMPRESS)
|
||||||
|
#include "uncompr.c"
|
||||||
|
#endif
|
||||||
|
@ -2,4 +2,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2013 Google, Inc
|
# Copyright (c) 2013 Google, Inc
|
||||||
|
|
||||||
obj-$(CONFIG_MEM_SEARCH) += mem_search.o
|
obj-y += mem.o
|
||||||
|
obj-$(CONFIG_CMD_MEM_SEARCH) += mem_search.o
|
||||||
|
20
test/cmd/mem.c
Normal file
20
test/cmd/mem.c
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0+
|
||||||
|
/*
|
||||||
|
* Executes tests for memory-related commands
|
||||||
|
*
|
||||||
|
* Copyright 2020 Google LLC
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <command.h>
|
||||||
|
#include <test/suites.h>
|
||||||
|
#include <test/test.h>
|
||||||
|
|
||||||
|
int do_ut_mem(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
|
{
|
||||||
|
struct unit_test *tests = ll_entry_start(struct unit_test, mem_test);
|
||||||
|
const int n_ents = ll_entry_count(struct unit_test, mem_test);
|
||||||
|
|
||||||
|
return cmd_ut_category("cmd_mem", "cmd_mem_", tests, n_ents, argc,
|
||||||
|
argv);
|
||||||
|
}
|
@ -14,8 +14,11 @@
|
|||||||
|
|
||||||
#define BUF_SIZE 0x100
|
#define BUF_SIZE 0x100
|
||||||
|
|
||||||
|
/* Declare a new mem test */
|
||||||
|
#define MEM_TEST(_name, _flags) UNIT_TEST(_name, _flags, mem_test)
|
||||||
|
|
||||||
/* Test 'ms' command with bytes */
|
/* Test 'ms' command with bytes */
|
||||||
static int dm_test_ms_b(struct unit_test_state *uts)
|
static int mem_test_ms_b(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
u8 *buf;
|
u8 *buf;
|
||||||
|
|
||||||
@ -25,7 +28,7 @@ static int dm_test_ms_b(struct unit_test_state *uts)
|
|||||||
buf[0x31] = 0x12;
|
buf[0x31] = 0x12;
|
||||||
buf[0xff] = 0x12;
|
buf[0xff] = 0x12;
|
||||||
buf[0x100] = 0x12;
|
buf[0x100] = 0x12;
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
run_command("ms.b 1 ff 12", 0);
|
run_command("ms.b 1 ff 12", 0);
|
||||||
ut_assert_nextline("00000030: 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................");
|
ut_assert_nextline("00000030: 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................");
|
||||||
ut_assert_nextline("--");
|
ut_assert_nextline("--");
|
||||||
@ -41,10 +44,10 @@ static int dm_test_ms_b(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ms_b, 0);
|
MEM_TEST(mem_test_ms_b, UT_TESTF_CONSOLE_REC);
|
||||||
|
|
||||||
/* Test 'ms' command with 16-bit values */
|
/* Test 'ms' command with 16-bit values */
|
||||||
static int dm_test_ms_w(struct unit_test_state *uts)
|
static int mem_test_ms_w(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
u16 *buf;
|
u16 *buf;
|
||||||
|
|
||||||
@ -52,7 +55,7 @@ static int dm_test_ms_w(struct unit_test_state *uts)
|
|||||||
memset(buf, '\0', BUF_SIZE);
|
memset(buf, '\0', BUF_SIZE);
|
||||||
buf[0x34 / 2] = 0x1234;
|
buf[0x34 / 2] = 0x1234;
|
||||||
buf[BUF_SIZE / 2] = 0x1234;
|
buf[BUF_SIZE / 2] = 0x1234;
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
run_command("ms.w 0 80 1234", 0);
|
run_command("ms.w 0 80 1234", 0);
|
||||||
ut_assert_nextline("00000030: 0000 0000 1234 0000 0000 0000 0000 0000 ....4...........");
|
ut_assert_nextline("00000030: 0000 0000 1234 0000 0000 0000 0000 0000 ....4...........");
|
||||||
ut_assert_nextline("1 match");
|
ut_assert_nextline("1 match");
|
||||||
@ -66,10 +69,10 @@ static int dm_test_ms_w(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ms_w, 0);
|
MEM_TEST(mem_test_ms_w, UT_TESTF_CONSOLE_REC);
|
||||||
|
|
||||||
/* Test 'ms' command with 32-bit values */
|
/* Test 'ms' command with 32-bit values */
|
||||||
static int dm_test_ms_l(struct unit_test_state *uts)
|
static int mem_test_ms_l(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
u32 *buf;
|
u32 *buf;
|
||||||
|
|
||||||
@ -77,7 +80,7 @@ static int dm_test_ms_l(struct unit_test_state *uts)
|
|||||||
memset(buf, '\0', BUF_SIZE);
|
memset(buf, '\0', BUF_SIZE);
|
||||||
buf[0x38 / 4] = 0x12345678;
|
buf[0x38 / 4] = 0x12345678;
|
||||||
buf[BUF_SIZE / 4] = 0x12345678;
|
buf[BUF_SIZE / 4] = 0x12345678;
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
run_command("ms 0 40 12345678", 0);
|
run_command("ms 0 40 12345678", 0);
|
||||||
ut_assert_nextline("00000030: 00000000 00000000 12345678 00000000 ........xV4.....");
|
ut_assert_nextline("00000030: 00000000 00000000 12345678 00000000 ........xV4.....");
|
||||||
ut_assert_nextline("1 match");
|
ut_assert_nextline("1 match");
|
||||||
@ -87,7 +90,7 @@ static int dm_test_ms_l(struct unit_test_state *uts)
|
|||||||
ut_asserteq(0x38, env_get_hex("memaddr", 0));
|
ut_asserteq(0x38, env_get_hex("memaddr", 0));
|
||||||
ut_asserteq(0x38 / 4, env_get_hex("mempos", 0));
|
ut_asserteq(0x38 / 4, env_get_hex("mempos", 0));
|
||||||
|
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
run_command("ms 0 80 12345679", 0);
|
run_command("ms 0 80 12345679", 0);
|
||||||
ut_assert_nextline("0 matches");
|
ut_assert_nextline("0 matches");
|
||||||
ut_assert_console_end();
|
ut_assert_console_end();
|
||||||
@ -100,10 +103,10 @@ static int dm_test_ms_l(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ms_l, 0);
|
MEM_TEST(mem_test_ms_l, UT_TESTF_CONSOLE_REC);
|
||||||
|
|
||||||
/* Test 'ms' command with continuation */
|
/* Test 'ms' command with continuation */
|
||||||
static int dm_test_ms_cont(struct unit_test_state *uts)
|
static int mem_test_ms_cont(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
char *const args[] = {"ms.b", "0", "100", "34"};
|
char *const args[] = {"ms.b", "0", "100", "34"};
|
||||||
int repeatable;
|
int repeatable;
|
||||||
@ -114,7 +117,7 @@ static int dm_test_ms_cont(struct unit_test_state *uts)
|
|||||||
memset(buf, '\0', BUF_SIZE);
|
memset(buf, '\0', BUF_SIZE);
|
||||||
for (i = 5; i < 0x33; i += 3)
|
for (i = 5; i < 0x33; i += 3)
|
||||||
buf[i] = 0x34;
|
buf[i] = 0x34;
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
run_command("ms.b 0 100 34", 0);
|
run_command("ms.b 0 100 34", 0);
|
||||||
ut_assert_nextlinen("00000000: 00 00 00 00 00 34 00 00 34 00 00 34 00 00 34 00");
|
ut_assert_nextlinen("00000000: 00 00 00 00 00 34 00 00 34 00 00 34 00 00 34 00");
|
||||||
ut_assert_nextline("--");
|
ut_assert_nextline("--");
|
||||||
@ -132,7 +135,7 @@ static int dm_test_ms_cont(struct unit_test_state *uts)
|
|||||||
* run_command() ignoes the repeatable flag when using hush, so call
|
* run_command() ignoes the repeatable flag when using hush, so call
|
||||||
* cmd_process() directly
|
* cmd_process() directly
|
||||||
*/
|
*/
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
cmd_process(CMD_FLAG_REPEAT, 4, args, &repeatable, NULL);
|
cmd_process(CMD_FLAG_REPEAT, 4, args, &repeatable, NULL);
|
||||||
ut_assert_nextlinen("00000020: 34 00 00 34 00 00 34 00 00 34 00 00 34 00 00 34");
|
ut_assert_nextlinen("00000020: 34 00 00 34 00 00 34 00 00 34 00 00 34 00 00 34");
|
||||||
ut_assert_nextline("--");
|
ut_assert_nextline("--");
|
||||||
@ -150,10 +153,54 @@ static int dm_test_ms_cont(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ms_cont, 0);
|
MEM_TEST(mem_test_ms_cont, UT_TESTF_CONSOLE_REC);
|
||||||
|
|
||||||
|
/* Test that an 'ms' command with continuation stops at the end of the range */
|
||||||
|
static int mem_test_ms_cont_end(struct unit_test_state *uts)
|
||||||
|
{
|
||||||
|
char *const args[] = {"ms.b", "1", "ff", "12"};
|
||||||
|
int repeatable;
|
||||||
|
u8 *buf;
|
||||||
|
|
||||||
|
buf = map_sysmem(0, BUF_SIZE);
|
||||||
|
memset(buf, '\0', BUF_SIZE);
|
||||||
|
buf[0x0] = 0x12;
|
||||||
|
buf[0x31] = 0x12;
|
||||||
|
buf[0xff] = 0x12;
|
||||||
|
buf[0x100] = 0x12;
|
||||||
|
ut_assertok(console_record_reset_enable());
|
||||||
|
run_command("ms.b 1 ff 12", 0);
|
||||||
|
ut_assert_nextlinen("00000030");
|
||||||
|
ut_assert_nextlinen("--");
|
||||||
|
ut_assert_nextlinen("000000f0");
|
||||||
|
ut_assert_nextlinen("2 matches");
|
||||||
|
ut_assert_console_end();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* run_command() ignoes the repeatable flag when using hush, so call
|
||||||
|
* cmd_process() directly.
|
||||||
|
*
|
||||||
|
* This should produce no matches.
|
||||||
|
*/
|
||||||
|
ut_assertok(console_record_reset_enable());
|
||||||
|
cmd_process(CMD_FLAG_REPEAT, 4, args, &repeatable, NULL);
|
||||||
|
ut_assert_nextlinen("0 matches");
|
||||||
|
ut_assert_console_end();
|
||||||
|
|
||||||
|
/* One more time */
|
||||||
|
ut_assertok(console_record_reset_enable());
|
||||||
|
cmd_process(CMD_FLAG_REPEAT, 4, args, &repeatable, NULL);
|
||||||
|
ut_assert_nextlinen("0 matches");
|
||||||
|
ut_assert_console_end();
|
||||||
|
|
||||||
|
unmap_sysmem(buf);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
MEM_TEST(mem_test_ms_cont_end, UT_TESTF_CONSOLE_REC);
|
||||||
|
|
||||||
/* Test 'ms' command with multiple values */
|
/* Test 'ms' command with multiple values */
|
||||||
static int dm_test_ms_mult(struct unit_test_state *uts)
|
static int mem_test_ms_mult(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
static const char str[] = "hello";
|
static const char str[] = "hello";
|
||||||
char *buf;
|
char *buf;
|
||||||
@ -163,7 +210,7 @@ static int dm_test_ms_mult(struct unit_test_state *uts)
|
|||||||
strcpy(buf + 0x1e, str);
|
strcpy(buf + 0x1e, str);
|
||||||
strcpy(buf + 0x63, str);
|
strcpy(buf + 0x63, str);
|
||||||
strcpy(buf + BUF_SIZE - strlen(str) + 1, str);
|
strcpy(buf + BUF_SIZE - strlen(str) + 1, str);
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
run_command("ms.b 0 100 68 65 6c 6c 6f", 0);
|
run_command("ms.b 0 100 68 65 6c 6c 6f", 0);
|
||||||
ut_assert_nextline("00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 65 ..............he");
|
ut_assert_nextline("00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 65 ..............he");
|
||||||
ut_assert_nextline("00000020: 6c 6c 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 llo.............");
|
ut_assert_nextline("00000020: 6c 6c 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 llo.............");
|
||||||
@ -179,10 +226,10 @@ static int dm_test_ms_mult(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ms_mult, 0);
|
MEM_TEST(mem_test_ms_mult, UT_TESTF_CONSOLE_REC);
|
||||||
|
|
||||||
/* Test 'ms' command with string */
|
/* Test 'ms' command with string */
|
||||||
static int dm_test_ms_s(struct unit_test_state *uts)
|
static int mem_test_ms_s(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
static const char str[] = "hello";
|
static const char str[] = "hello";
|
||||||
static const char str2[] = "hellothere";
|
static const char str2[] = "hellothere";
|
||||||
@ -193,7 +240,7 @@ static int dm_test_ms_s(struct unit_test_state *uts)
|
|||||||
strcpy(buf + 0x1e, str);
|
strcpy(buf + 0x1e, str);
|
||||||
strcpy(buf + 0x63, str);
|
strcpy(buf + 0x63, str);
|
||||||
strcpy(buf + 0xa1, str2);
|
strcpy(buf + 0xa1, str2);
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
run_command("ms.s 0 100 hello", 0);
|
run_command("ms.s 0 100 hello", 0);
|
||||||
ut_assert_nextline("00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 65 ..............he");
|
ut_assert_nextline("00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 65 ..............he");
|
||||||
ut_assert_nextline("00000020: 6c 6c 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 llo.............");
|
ut_assert_nextline("00000020: 6c 6c 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 llo.............");
|
||||||
@ -208,7 +255,7 @@ static int dm_test_ms_s(struct unit_test_state *uts)
|
|||||||
ut_asserteq(0xa1, env_get_hex("memaddr", 0));
|
ut_asserteq(0xa1, env_get_hex("memaddr", 0));
|
||||||
ut_asserteq(0xa1, env_get_hex("mempos", 0));
|
ut_asserteq(0xa1, env_get_hex("mempos", 0));
|
||||||
|
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
run_command("ms.s 0 100 hello there", 0);
|
run_command("ms.s 0 100 hello there", 0);
|
||||||
ut_assert_nextline("000000a0: 00 68 65 6c 6c 6f 74 68 65 72 65 00 00 00 00 00 .hellothere.....");
|
ut_assert_nextline("000000a0: 00 68 65 6c 6c 6f 74 68 65 72 65 00 00 00 00 00 .hellothere.....");
|
||||||
ut_assert_nextline("1 match");
|
ut_assert_nextline("1 match");
|
||||||
@ -222,10 +269,10 @@ static int dm_test_ms_s(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ms_s, 0);
|
MEM_TEST(mem_test_ms_s, UT_TESTF_CONSOLE_REC);
|
||||||
|
|
||||||
/* Test 'ms' command with limit */
|
/* Test 'ms' command with limit */
|
||||||
static int dm_test_ms_limit(struct unit_test_state *uts)
|
static int mem_test_ms_limit(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
u8 *buf;
|
u8 *buf;
|
||||||
|
|
||||||
@ -235,7 +282,7 @@ static int dm_test_ms_limit(struct unit_test_state *uts)
|
|||||||
buf[0x31] = 0x12;
|
buf[0x31] = 0x12;
|
||||||
buf[0x62] = 0x12;
|
buf[0x62] = 0x12;
|
||||||
buf[0x76] = 0x12;
|
buf[0x76] = 0x12;
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
run_command("ms.b -l2 1 ff 12", 0);
|
run_command("ms.b -l2 1 ff 12", 0);
|
||||||
ut_assert_nextline("00000030: 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................");
|
ut_assert_nextline("00000030: 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................");
|
||||||
ut_assert_nextline("--");
|
ut_assert_nextline("--");
|
||||||
@ -251,10 +298,10 @@ static int dm_test_ms_limit(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ms_limit, 0);
|
MEM_TEST(mem_test_ms_limit, UT_TESTF_CONSOLE_REC);
|
||||||
|
|
||||||
/* Test 'ms' command in quiet mode */
|
/* Test 'ms' command in quiet mode */
|
||||||
static int dm_test_ms_quiet(struct unit_test_state *uts)
|
static int mem_test_ms_quiet(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
u8 *buf;
|
u8 *buf;
|
||||||
|
|
||||||
@ -264,12 +311,15 @@ static int dm_test_ms_quiet(struct unit_test_state *uts)
|
|||||||
buf[0x31] = 0x12;
|
buf[0x31] = 0x12;
|
||||||
buf[0x62] = 0x12;
|
buf[0x62] = 0x12;
|
||||||
buf[0x76] = 0x12;
|
buf[0x76] = 0x12;
|
||||||
console_record_reset();
|
ut_assertok(console_record_reset_enable());
|
||||||
run_command("ms.b -l2 1 ff 12", 0);
|
run_command("ms.b -q -l2 1 ff 12", 0);
|
||||||
ut_assert_console_end();
|
ut_assert_console_end();
|
||||||
unmap_sysmem(buf);
|
unmap_sysmem(buf);
|
||||||
|
|
||||||
|
ut_asserteq(2, env_get_hex("memmatches", 0));
|
||||||
|
ut_asserteq(0x62, env_get_hex("memaddr", 0));
|
||||||
|
ut_asserteq(0x61, env_get_hex("mempos", 0));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ms_quiet, 0);
|
MEM_TEST(mem_test_ms_quiet, UT_TESTF_CONSOLE_REC);
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <command.h>
|
#include <command.h>
|
||||||
|
#include <console.h>
|
||||||
#include <test/suites.h>
|
#include <test/suites.h>
|
||||||
#include <test/test.h>
|
#include <test/test.h>
|
||||||
|
|
||||||
@ -34,6 +35,15 @@ int cmd_ut_category(const char *name, const char *prefix,
|
|||||||
continue;
|
continue;
|
||||||
printf("Test: %s\n", test->name);
|
printf("Test: %s\n", test->name);
|
||||||
|
|
||||||
|
if (test->flags & UT_TESTF_CONSOLE_REC) {
|
||||||
|
int ret = console_record_reset_enable();
|
||||||
|
|
||||||
|
if (ret) {
|
||||||
|
printf("Skipping: Console recording disabled\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uts.start = mallinfo();
|
uts.start = mallinfo();
|
||||||
|
|
||||||
test->func(&uts);
|
test->func(&uts);
|
||||||
@ -64,6 +74,7 @@ static struct cmd_tbl cmd_ut_sub[] = {
|
|||||||
#ifdef CONFIG_UT_LOG
|
#ifdef CONFIG_UT_LOG
|
||||||
U_BOOT_CMD_MKENT(log, CONFIG_SYS_MAXARGS, 1, do_ut_log, "", ""),
|
U_BOOT_CMD_MKENT(log, CONFIG_SYS_MAXARGS, 1, do_ut_log, "", ""),
|
||||||
#endif
|
#endif
|
||||||
|
U_BOOT_CMD_MKENT(mem, CONFIG_SYS_MAXARGS, 1, do_ut_mem, "", ""),
|
||||||
#ifdef CONFIG_UT_TIME
|
#ifdef CONFIG_UT_TIME
|
||||||
U_BOOT_CMD_MKENT(time, CONFIG_SYS_MAXARGS, 1, do_ut_time, "", ""),
|
U_BOOT_CMD_MKENT(time, CONFIG_SYS_MAXARGS, 1, do_ut_time, "", ""),
|
||||||
#endif
|
#endif
|
||||||
@ -135,6 +146,7 @@ static char ut_help_text[] =
|
|||||||
#ifdef CONFIG_UT_LOG
|
#ifdef CONFIG_UT_LOG
|
||||||
"ut log [test-name] - test logging functions\n"
|
"ut log [test-name] - test logging functions\n"
|
||||||
#endif
|
#endif
|
||||||
|
"ut mem [test-name] - test memory-related commands\n"
|
||||||
#ifdef CONFIG_UT_OPTEE
|
#ifdef CONFIG_UT_OPTEE
|
||||||
"ut optee [test-name]\n"
|
"ut optee [test-name]\n"
|
||||||
#endif
|
#endif
|
||||||
|
@ -171,7 +171,7 @@ static int dm_test_acpi_get_name(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_get_name, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_get_name, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test acpi_get_table_revision() */
|
/* Test acpi_get_table_revision() */
|
||||||
static int dm_test_acpi_get_table_revision(struct unit_test_state *uts)
|
static int dm_test_acpi_get_table_revision(struct unit_test_state *uts)
|
||||||
@ -184,7 +184,7 @@ static int dm_test_acpi_get_table_revision(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_get_table_revision,
|
DM_TEST(dm_test_acpi_get_table_revision,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test acpi_create_dmar() */
|
/* Test acpi_create_dmar() */
|
||||||
static int dm_test_acpi_create_dmar(struct unit_test_state *uts)
|
static int dm_test_acpi_create_dmar(struct unit_test_state *uts)
|
||||||
@ -200,7 +200,7 @@ static int dm_test_acpi_create_dmar(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_create_dmar, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_create_dmar, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test acpi_fill_header() */
|
/* Test acpi_fill_header() */
|
||||||
static int dm_test_acpi_fill_header(struct unit_test_state *uts)
|
static int dm_test_acpi_fill_header(struct unit_test_state *uts)
|
||||||
@ -227,7 +227,7 @@ static int dm_test_acpi_fill_header(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_fill_header, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_fill_header, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test ACPI write_tables() */
|
/* Test ACPI write_tables() */
|
||||||
static int dm_test_acpi_write_tables(struct unit_test_state *uts)
|
static int dm_test_acpi_write_tables(struct unit_test_state *uts)
|
||||||
@ -268,7 +268,7 @@ static int dm_test_acpi_write_tables(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_write_tables, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_write_tables, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test basic ACPI functions */
|
/* Test basic ACPI functions */
|
||||||
static int dm_test_acpi_basic(struct unit_test_state *uts)
|
static int dm_test_acpi_basic(struct unit_test_state *uts)
|
||||||
@ -296,7 +296,7 @@ static int dm_test_acpi_basic(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_basic, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_basic, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test acpi_setup_base_tables */
|
/* Test acpi_setup_base_tables */
|
||||||
static int dm_test_acpi_setup_base_tables(struct unit_test_state *uts)
|
static int dm_test_acpi_setup_base_tables(struct unit_test_state *uts)
|
||||||
@ -344,7 +344,7 @@ static int dm_test_acpi_setup_base_tables(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_setup_base_tables,
|
DM_TEST(dm_test_acpi_setup_base_tables,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test 'acpi list' command */
|
/* Test 'acpi list' command */
|
||||||
static int dm_test_acpi_cmd_list(struct unit_test_state *uts)
|
static int dm_test_acpi_cmd_list(struct unit_test_state *uts)
|
||||||
@ -386,7 +386,7 @@ static int dm_test_acpi_cmd_list(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_cmd_list, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_cmd_list, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test 'acpi dump' command */
|
/* Test 'acpi dump' command */
|
||||||
static int dm_test_acpi_cmd_dump(struct unit_test_state *uts)
|
static int dm_test_acpi_cmd_dump(struct unit_test_state *uts)
|
||||||
@ -417,7 +417,7 @@ static int dm_test_acpi_cmd_dump(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_cmd_dump, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_cmd_dump, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test acpi_device_path() */
|
/* Test acpi_device_path() */
|
||||||
static int dm_test_acpi_device_path(struct unit_test_state *uts)
|
static int dm_test_acpi_device_path(struct unit_test_state *uts)
|
||||||
@ -454,7 +454,7 @@ static int dm_test_acpi_device_path(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_device_path, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_device_path, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test acpi_device_status() */
|
/* Test acpi_device_status() */
|
||||||
static int dm_test_acpi_device_status(struct unit_test_state *uts)
|
static int dm_test_acpi_device_status(struct unit_test_state *uts)
|
||||||
@ -466,7 +466,7 @@ static int dm_test_acpi_device_status(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_device_status, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_device_status, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test acpi_fill_ssdt() */
|
/* Test acpi_fill_ssdt() */
|
||||||
static int dm_test_acpi_fill_ssdt(struct unit_test_state *uts)
|
static int dm_test_acpi_fill_ssdt(struct unit_test_state *uts)
|
||||||
@ -496,7 +496,7 @@ static int dm_test_acpi_fill_ssdt(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_fill_ssdt, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_fill_ssdt, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test acpi_inject_dsdt() */
|
/* Test acpi_inject_dsdt() */
|
||||||
static int dm_test_acpi_inject_dsdt(struct unit_test_state *uts)
|
static int dm_test_acpi_inject_dsdt(struct unit_test_state *uts)
|
||||||
@ -526,7 +526,7 @@ static int dm_test_acpi_inject_dsdt(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_inject_dsdt, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_inject_dsdt, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test 'acpi items' command */
|
/* Test 'acpi items' command */
|
||||||
static int dm_test_acpi_cmd_items(struct unit_test_state *uts)
|
static int dm_test_acpi_cmd_items(struct unit_test_state *uts)
|
||||||
@ -565,4 +565,4 @@ static int dm_test_acpi_cmd_items(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_cmd_items, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_cmd_items, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -489,4 +489,4 @@ static int dm_test_acpi_dp_copy(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_dp_copy, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_dp_copy, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -167,7 +167,7 @@ static int dm_test_acpi_interrupt(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_interrupt, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_interrupt, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test emitting a GPIO descriptor */
|
/* Test emitting a GPIO descriptor */
|
||||||
static int dm_test_acpi_gpio(struct unit_test_state *uts)
|
static int dm_test_acpi_gpio(struct unit_test_state *uts)
|
||||||
@ -212,7 +212,7 @@ static int dm_test_acpi_gpio(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_gpio, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_gpio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test emitting a GPIO descriptor with an interrupt */
|
/* Test emitting a GPIO descriptor with an interrupt */
|
||||||
static int dm_test_acpi_gpio_irq(struct unit_test_state *uts)
|
static int dm_test_acpi_gpio_irq(struct unit_test_state *uts)
|
||||||
@ -257,7 +257,7 @@ static int dm_test_acpi_gpio_irq(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_gpio_irq, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_gpio_irq, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test emitting either a GPIO or interrupt descriptor */
|
/* Test emitting either a GPIO or interrupt descriptor */
|
||||||
static int dm_test_acpi_interrupt_or_gpio(struct unit_test_state *uts)
|
static int dm_test_acpi_interrupt_or_gpio(struct unit_test_state *uts)
|
||||||
@ -297,7 +297,7 @@ static int dm_test_acpi_interrupt_or_gpio(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_interrupt_or_gpio,
|
DM_TEST(dm_test_acpi_interrupt_or_gpio,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test emitting an I2C descriptor */
|
/* Test emitting an I2C descriptor */
|
||||||
static int dm_test_acpi_i2c(struct unit_test_state *uts)
|
static int dm_test_acpi_i2c(struct unit_test_state *uts)
|
||||||
@ -329,7 +329,7 @@ static int dm_test_acpi_i2c(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_i2c, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_i2c, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test emitting a SPI descriptor */
|
/* Test emitting a SPI descriptor */
|
||||||
static int dm_test_acpi_spi(struct unit_test_state *uts)
|
static int dm_test_acpi_spi(struct unit_test_state *uts)
|
||||||
@ -365,7 +365,7 @@ static int dm_test_acpi_spi(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_spi, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_spi, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test emitting a length */
|
/* Test emitting a length */
|
||||||
static int dm_test_acpi_len(struct unit_test_state *uts)
|
static int dm_test_acpi_len(struct unit_test_state *uts)
|
||||||
@ -806,7 +806,7 @@ static int dm_test_acpi_gpio_toggle(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_gpio_toggle, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_gpio_toggle, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test writing ACPI code to output power-sequence info */
|
/* Test writing ACPI code to output power-sequence info */
|
||||||
static int dm_test_acpi_power_seq(struct unit_test_state *uts)
|
static int dm_test_acpi_power_seq(struct unit_test_state *uts)
|
||||||
@ -873,7 +873,7 @@ static int dm_test_acpi_power_seq(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_power_seq, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_power_seq, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test writing values */
|
/* Test writing values */
|
||||||
static int dm_test_acpi_write_values(struct unit_test_state *uts)
|
static int dm_test_acpi_write_values(struct unit_test_state *uts)
|
||||||
@ -947,7 +947,7 @@ static int dm_test_acpi_scope(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_acpi_scope, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_acpi_scope, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test writing a resource template */
|
/* Test writing a resource template */
|
||||||
static int dm_test_acpi_resource_template(struct unit_test_state *uts)
|
static int dm_test_acpi_resource_template(struct unit_test_state *uts)
|
||||||
|
@ -33,7 +33,7 @@ static int dm_test_adc_bind(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_adc_bind, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_adc_bind, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_adc_wrong_channel_selection(struct unit_test_state *uts)
|
static int dm_test_adc_wrong_channel_selection(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -44,7 +44,7 @@ static int dm_test_adc_wrong_channel_selection(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_adc_wrong_channel_selection, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_adc_wrong_channel_selection, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_adc_supply(struct unit_test_state *uts)
|
static int dm_test_adc_supply(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -80,7 +80,7 @@ static int dm_test_adc_supply(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_adc_supply, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_adc_supply, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
struct adc_channel adc_channel_test_data[] = {
|
struct adc_channel adc_channel_test_data[] = {
|
||||||
{ 0, SANDBOX_ADC_CHANNEL0_DATA },
|
{ 0, SANDBOX_ADC_CHANNEL0_DATA },
|
||||||
@ -105,7 +105,7 @@ static int dm_test_adc_single_channel_conversion(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_adc_single_channel_conversion, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_adc_single_channel_conversion, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_adc_multi_channel_conversion(struct unit_test_state *uts)
|
static int dm_test_adc_multi_channel_conversion(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -128,7 +128,7 @@ static int dm_test_adc_multi_channel_conversion(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_adc_multi_channel_conversion, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_adc_multi_channel_conversion, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_adc_single_channel_shot(struct unit_test_state *uts)
|
static int dm_test_adc_single_channel_shot(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -144,7 +144,7 @@ static int dm_test_adc_single_channel_shot(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_adc_single_channel_shot, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_adc_single_channel_shot, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_adc_multi_channel_shot(struct unit_test_state *uts)
|
static int dm_test_adc_multi_channel_shot(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -164,7 +164,7 @@ static int dm_test_adc_multi_channel_shot(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_adc_multi_channel_shot, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_adc_multi_channel_shot, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static const int dm_test_adc_uV_data[SANDBOX_ADC_CHANNELS] = {
|
static const int dm_test_adc_uV_data[SANDBOX_ADC_CHANNELS] = {
|
||||||
((u64)SANDBOX_ADC_CHANNEL0_DATA * SANDBOX_BUCK2_INITIAL_EXPECTED_UV) /
|
((u64)SANDBOX_ADC_CHANNEL0_DATA * SANDBOX_BUCK2_INITIAL_EXPECTED_UV) /
|
||||||
@ -195,4 +195,4 @@ static int dm_test_adc_raw_to_uV(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_adc_raw_to_uV, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_adc_raw_to_uV, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -32,4 +32,4 @@ static int dm_test_audio(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_audio, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_audio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -23,7 +23,7 @@ static int dm_test_axi_base(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_axi_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_axi_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that sandbox PCI bus numbering works correctly */
|
/* Test that sandbox PCI bus numbering works correctly */
|
||||||
static int dm_test_axi_busnum(struct unit_test_state *uts)
|
static int dm_test_axi_busnum(struct unit_test_state *uts)
|
||||||
@ -35,7 +35,7 @@ static int dm_test_axi_busnum(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_axi_busnum, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_axi_busnum, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that we can use the store device correctly */
|
/* Test that we can use the store device correctly */
|
||||||
static int dm_test_axi_store(struct unit_test_state *uts)
|
static int dm_test_axi_store(struct unit_test_state *uts)
|
||||||
@ -76,4 +76,4 @@ static int dm_test_axi_store(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_axi_store, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_axi_store, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -43,7 +43,7 @@ static int dm_test_blk_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_blk_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_blk_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int count_blk_devices(void)
|
static int count_blk_devices(void)
|
||||||
{
|
{
|
||||||
@ -89,7 +89,7 @@ static int dm_test_blk_usb(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_blk_usb, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_blk_usb, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that we can find block devices without probing them */
|
/* Test that we can find block devices without probing them */
|
||||||
static int dm_test_blk_find(struct unit_test_state *uts)
|
static int dm_test_blk_find(struct unit_test_state *uts)
|
||||||
@ -110,7 +110,7 @@ static int dm_test_blk_find(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_blk_find, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_blk_find, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that block device numbering works as expected */
|
/* Test that block device numbering works as expected */
|
||||||
static int dm_test_blk_devnum(struct unit_test_state *uts)
|
static int dm_test_blk_devnum(struct unit_test_state *uts)
|
||||||
@ -145,7 +145,7 @@ static int dm_test_blk_devnum(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_blk_devnum, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_blk_devnum, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that we can get a block from its parent */
|
/* Test that we can get a block from its parent */
|
||||||
static int dm_test_blk_get_from_parent(struct unit_test_state *uts)
|
static int dm_test_blk_get_from_parent(struct unit_test_state *uts)
|
||||||
@ -163,4 +163,4 @@ static int dm_test_blk_get_from_parent(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_blk_get_from_parent, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_blk_get_from_parent, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -56,4 +56,4 @@ static int dm_test_board(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_board, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_board, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -28,5 +28,5 @@ static int dm_test_bootcount(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_bootcount, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_bootcount, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ static int dm_test_bus_children(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_children, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_bus_children, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test our functions for accessing children */
|
/* Test our functions for accessing children */
|
||||||
static int dm_test_bus_children_funcs(struct unit_test_state *uts)
|
static int dm_test_bus_children_funcs(struct unit_test_state *uts)
|
||||||
@ -177,7 +177,7 @@ static int dm_test_bus_children_funcs(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_children_funcs, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_bus_children_funcs, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_bus_children_of_offset(struct unit_test_state *uts)
|
static int dm_test_bus_children_of_offset(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -201,7 +201,7 @@ static int dm_test_bus_children_of_offset(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_children_of_offset,
|
DM_TEST(dm_test_bus_children_of_offset,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT | DM_TESTF_FLAT_TREE);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE);
|
||||||
|
|
||||||
/* Test that we can iterate through children */
|
/* Test that we can iterate through children */
|
||||||
static int dm_test_bus_children_iterators(struct unit_test_state *uts)
|
static int dm_test_bus_children_iterators(struct unit_test_state *uts)
|
||||||
@ -232,7 +232,7 @@ static int dm_test_bus_children_iterators(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_children_iterators,
|
DM_TEST(dm_test_bus_children_iterators,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that the bus can store data about each child */
|
/* Test that the bus can store data about each child */
|
||||||
static int test_bus_parent_data(struct unit_test_state *uts)
|
static int test_bus_parent_data(struct unit_test_state *uts)
|
||||||
@ -299,7 +299,7 @@ static int dm_test_bus_parent_data(struct unit_test_state *uts)
|
|||||||
{
|
{
|
||||||
return test_bus_parent_data(uts);
|
return test_bus_parent_data(uts);
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_parent_data, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_bus_parent_data, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* As above but the size is controlled by the uclass */
|
/* As above but the size is controlled by the uclass */
|
||||||
static int dm_test_bus_parent_data_uclass(struct unit_test_state *uts)
|
static int dm_test_bus_parent_data_uclass(struct unit_test_state *uts)
|
||||||
@ -329,7 +329,7 @@ static int dm_test_bus_parent_data_uclass(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_parent_data_uclass,
|
DM_TEST(dm_test_bus_parent_data_uclass,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that the bus ops are called when a child is probed/removed */
|
/* Test that the bus ops are called when a child is probed/removed */
|
||||||
static int dm_test_bus_parent_ops(struct unit_test_state *uts)
|
static int dm_test_bus_parent_ops(struct unit_test_state *uts)
|
||||||
@ -368,7 +368,7 @@ static int dm_test_bus_parent_ops(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_parent_ops, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_bus_parent_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int test_bus_parent_platdata(struct unit_test_state *uts)
|
static int test_bus_parent_platdata(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -443,7 +443,7 @@ static int dm_test_bus_parent_platdata(struct unit_test_state *uts)
|
|||||||
{
|
{
|
||||||
return test_bus_parent_platdata(uts);
|
return test_bus_parent_platdata(uts);
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_parent_platdata, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_bus_parent_platdata, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* As above but the size is controlled by the uclass */
|
/* As above but the size is controlled by the uclass */
|
||||||
static int dm_test_bus_parent_platdata_uclass(struct unit_test_state *uts)
|
static int dm_test_bus_parent_platdata_uclass(struct unit_test_state *uts)
|
||||||
@ -472,7 +472,7 @@ static int dm_test_bus_parent_platdata_uclass(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_parent_platdata_uclass,
|
DM_TEST(dm_test_bus_parent_platdata_uclass,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that the child post_bind method is called */
|
/* Test that the child post_bind method is called */
|
||||||
static int dm_test_bus_child_post_bind(struct unit_test_state *uts)
|
static int dm_test_bus_child_post_bind(struct unit_test_state *uts)
|
||||||
@ -493,7 +493,7 @@ static int dm_test_bus_child_post_bind(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_child_post_bind, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_bus_child_post_bind, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that the child post_bind method is called */
|
/* Test that the child post_bind method is called */
|
||||||
static int dm_test_bus_child_post_bind_uclass(struct unit_test_state *uts)
|
static int dm_test_bus_child_post_bind_uclass(struct unit_test_state *uts)
|
||||||
@ -515,7 +515,7 @@ static int dm_test_bus_child_post_bind_uclass(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_child_post_bind_uclass,
|
DM_TEST(dm_test_bus_child_post_bind_uclass,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test that the bus' uclass' child_pre_probe() is called before the
|
* Test that the bus' uclass' child_pre_probe() is called before the
|
||||||
@ -549,7 +549,7 @@ static int dm_test_bus_child_pre_probe_uclass(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_child_pre_probe_uclass,
|
DM_TEST(dm_test_bus_child_pre_probe_uclass,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test that the bus' uclass' child_post_probe() is called after the
|
* Test that the bus' uclass' child_post_probe() is called after the
|
||||||
@ -582,4 +582,4 @@ static int dm_test_bus_child_post_probe_uclass(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_bus_child_post_probe_uclass,
|
DM_TEST(dm_test_bus_child_post_probe_uclass,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -25,7 +25,7 @@ static int dm_test_button_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_button_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_button_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test of the button uclass using the button_gpio driver */
|
/* Test of the button uclass using the button_gpio driver */
|
||||||
static int dm_test_button_gpio(struct unit_test_state *uts)
|
static int dm_test_button_gpio(struct unit_test_state *uts)
|
||||||
@ -50,7 +50,7 @@ static int dm_test_button_gpio(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_button_gpio, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_button_gpio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test obtaining an BUTTON by label */
|
/* Test obtaining an BUTTON by label */
|
||||||
static int dm_test_button_label(struct unit_test_state *uts)
|
static int dm_test_button_label(struct unit_test_state *uts)
|
||||||
@ -71,4 +71,4 @@ static int dm_test_button_label(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_button_label, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_button_label, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -19,4 +19,4 @@ static int dm_test_reset(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_reset, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_reset, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -34,7 +34,7 @@ static int dm_test_clk_base(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_clk_base, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_clk_base, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_clk(struct unit_test_state *uts)
|
static int dm_test_clk(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -161,7 +161,7 @@ static int dm_test_clk(struct unit_test_state *uts)
|
|||||||
SANDBOX_CLK_ID_UART1));
|
SANDBOX_CLK_ID_UART1));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_clk, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_clk, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_clk_bulk(struct unit_test_state *uts)
|
static int dm_test_clk_bulk(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -199,4 +199,4 @@ static int dm_test_clk_bulk(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_clk_bulk, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_clk_bulk, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -96,4 +96,4 @@ static int dm_test_clk_ccf(struct unit_test_state *uts)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_clk_ccf, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_clk_ccf, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -167,7 +167,7 @@ static int dm_test_autobind_uclass_pdata_alloc(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_autobind_uclass_pdata_alloc, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_autobind_uclass_pdata_alloc, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
/* Test that binding with uclass platdata setting occurs correctly */
|
/* Test that binding with uclass platdata setting occurs correctly */
|
||||||
static int dm_test_autobind_uclass_pdata_valid(struct unit_test_state *uts)
|
static int dm_test_autobind_uclass_pdata_valid(struct unit_test_state *uts)
|
||||||
@ -193,7 +193,7 @@ static int dm_test_autobind_uclass_pdata_valid(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_autobind_uclass_pdata_valid, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_autobind_uclass_pdata_valid, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
/* Test that autoprobe finds all the expected devices */
|
/* Test that autoprobe finds all the expected devices */
|
||||||
static int dm_test_autoprobe(struct unit_test_state *uts)
|
static int dm_test_autoprobe(struct unit_test_state *uts)
|
||||||
@ -261,7 +261,7 @@ static int dm_test_autoprobe(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_autoprobe, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_autoprobe, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
/* Check that we see the correct platdata in each device */
|
/* Check that we see the correct platdata in each device */
|
||||||
static int dm_test_platdata(struct unit_test_state *uts)
|
static int dm_test_platdata(struct unit_test_state *uts)
|
||||||
@ -279,7 +279,7 @@ static int dm_test_platdata(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_platdata, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_platdata, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
/* Test that we can bind, probe, remove, unbind a driver */
|
/* Test that we can bind, probe, remove, unbind a driver */
|
||||||
static int dm_test_lifecycle(struct unit_test_state *uts)
|
static int dm_test_lifecycle(struct unit_test_state *uts)
|
||||||
@ -335,7 +335,7 @@ static int dm_test_lifecycle(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_lifecycle, DM_TESTF_SCAN_PDATA | DM_TESTF_PROBE_TEST);
|
DM_TEST(dm_test_lifecycle, UT_TESTF_SCAN_PDATA | UT_TESTF_PROBE_TEST);
|
||||||
|
|
||||||
/* Test that we can bind/unbind and the lists update correctly */
|
/* Test that we can bind/unbind and the lists update correctly */
|
||||||
static int dm_test_ordering(struct unit_test_state *uts)
|
static int dm_test_ordering(struct unit_test_state *uts)
|
||||||
@ -391,7 +391,7 @@ static int dm_test_ordering(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ordering, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_ordering, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
/* Check that we can perform operations on a device (do a ping) */
|
/* Check that we can perform operations on a device (do a ping) */
|
||||||
int dm_check_operations(struct unit_test_state *uts, struct udevice *dev,
|
int dm_check_operations(struct unit_test_state *uts, struct udevice *dev,
|
||||||
@ -449,7 +449,7 @@ static int dm_test_operations(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_operations, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_operations, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
/* Remove all drivers and check that things work */
|
/* Remove all drivers and check that things work */
|
||||||
static int dm_test_remove(struct unit_test_state *uts)
|
static int dm_test_remove(struct unit_test_state *uts)
|
||||||
@ -471,7 +471,7 @@ static int dm_test_remove(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_remove, DM_TESTF_SCAN_PDATA | DM_TESTF_PROBE_TEST);
|
DM_TEST(dm_test_remove, UT_TESTF_SCAN_PDATA | UT_TESTF_PROBE_TEST);
|
||||||
|
|
||||||
/* Remove and recreate everything, check for memory leaks */
|
/* Remove and recreate everything, check for memory leaks */
|
||||||
static int dm_test_leak(struct unit_test_state *uts)
|
static int dm_test_leak(struct unit_test_state *uts)
|
||||||
@ -756,7 +756,7 @@ static int dm_test_uclass_devices_find(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_uclass_devices_find, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_uclass_devices_find, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
static int dm_test_uclass_devices_find_by_name(struct unit_test_state *uts)
|
static int dm_test_uclass_devices_find_by_name(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -793,7 +793,7 @@ static int dm_test_uclass_devices_find_by_name(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_uclass_devices_find_by_name, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_uclass_devices_find_by_name, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_uclass_devices_get(struct unit_test_state *uts)
|
static int dm_test_uclass_devices_get(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -810,7 +810,7 @@ static int dm_test_uclass_devices_get(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_uclass_devices_get, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_uclass_devices_get, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
static int dm_test_uclass_devices_get_by_name(struct unit_test_state *uts)
|
static int dm_test_uclass_devices_get_by_name(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -854,7 +854,7 @@ static int dm_test_uclass_devices_get_by_name(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_uclass_devices_get_by_name, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_uclass_devices_get_by_name, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_device_get_uclass_id(struct unit_test_state *uts)
|
static int dm_test_device_get_uclass_id(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -865,7 +865,7 @@ static int dm_test_device_get_uclass_id(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_device_get_uclass_id, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_device_get_uclass_id, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
static int dm_test_uclass_names(struct unit_test_state *uts)
|
static int dm_test_uclass_names(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -874,7 +874,7 @@ static int dm_test_uclass_names(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_uclass_names, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_uclass_names, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
static int dm_test_inactive_child(struct unit_test_state *uts)
|
static int dm_test_inactive_child(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -905,4 +905,4 @@ static int dm_test_inactive_child(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_inactive_child, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_inactive_child, UT_TESTF_SCAN_PDATA);
|
||||||
|
@ -47,4 +47,4 @@ static int dm_test_cpu(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_cpu, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_cpu, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -40,7 +40,7 @@ static int dm_test_devres_alloc(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_devres_alloc, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_devres_alloc, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
/* Test devm_kfree() can be used to free memory too */
|
/* Test devm_kfree() can be used to free memory too */
|
||||||
static int dm_test_devres_free(struct unit_test_state *uts)
|
static int dm_test_devres_free(struct unit_test_state *uts)
|
||||||
@ -68,7 +68,7 @@ static int dm_test_devres_free(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_devres_free, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_devres_free, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
|
|
||||||
/* Test that kzalloc() returns memory that is zeroed */
|
/* Test that kzalloc() returns memory that is zeroed */
|
||||||
@ -88,7 +88,7 @@ static int dm_test_devres_kzalloc(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_devres_kzalloc, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_devres_kzalloc, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
/* Test that devm_kmalloc_array() allocates an array that can be set */
|
/* Test that devm_kmalloc_array() allocates an array that can be set */
|
||||||
static int dm_test_devres_kmalloc_array(struct unit_test_state *uts)
|
static int dm_test_devres_kmalloc_array(struct unit_test_state *uts)
|
||||||
@ -111,7 +111,7 @@ static int dm_test_devres_kmalloc_array(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_devres_kmalloc_array, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_devres_kmalloc_array, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
/* Test that devm_kcalloc() allocates a zeroed array */
|
/* Test that devm_kcalloc() allocates a zeroed array */
|
||||||
static int dm_test_devres_kcalloc(struct unit_test_state *uts)
|
static int dm_test_devres_kcalloc(struct unit_test_state *uts)
|
||||||
@ -140,7 +140,7 @@ static int dm_test_devres_kcalloc(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_devres_kcalloc, DM_TESTF_SCAN_PDATA);
|
DM_TEST(dm_test_devres_kcalloc, UT_TESTF_SCAN_PDATA);
|
||||||
|
|
||||||
/* Test devres releases resources automatically as expected */
|
/* Test devres releases resources automatically as expected */
|
||||||
static int dm_test_devres_phase(struct unit_test_state *uts)
|
static int dm_test_devres_phase(struct unit_test_state *uts)
|
||||||
@ -186,4 +186,4 @@ static int dm_test_devres_phase(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_devres_phase, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_devres_phase, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -35,7 +35,7 @@ static int dm_test_dma_m2m(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_dma_m2m, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_dma_m2m, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_dma(struct unit_test_state *uts)
|
static int dm_test_dma(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -77,7 +77,7 @@ static int dm_test_dma(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_dma, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_dma, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_dma_rx(struct unit_test_state *uts)
|
static int dm_test_dma_rx(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -122,4 +122,4 @@ static int dm_test_dma_rx(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_dma_rx, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_dma_rx, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -56,4 +56,4 @@ static int dm_test_dsi_host(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_dsi_host, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_dsi_host, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -40,7 +40,7 @@ static int dm_test_eth(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_eth, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_eth, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_eth_alias(struct unit_test_state *uts)
|
static int dm_test_eth_alias(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -64,7 +64,7 @@ static int dm_test_eth_alias(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_eth_alias, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_eth_alias, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_eth_prime(struct unit_test_state *uts)
|
static int dm_test_eth_prime(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -84,7 +84,7 @@ static int dm_test_eth_prime(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_eth_prime, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_eth_prime, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test case is trying to test the following scenario:
|
* This test case is trying to test the following scenario:
|
||||||
@ -145,7 +145,7 @@ static int dm_test_eth_act(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_eth_act, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_eth_act, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* The asserts include a return on fail; cleanup in the caller */
|
/* The asserts include a return on fail; cleanup in the caller */
|
||||||
static int _dm_test_eth_rotate1(struct unit_test_state *uts)
|
static int _dm_test_eth_rotate1(struct unit_test_state *uts)
|
||||||
@ -217,7 +217,7 @@ static int dm_test_eth_rotate(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_eth_rotate, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_eth_rotate, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* The asserts include a return on fail; cleanup in the caller */
|
/* The asserts include a return on fail; cleanup in the caller */
|
||||||
static int _dm_test_net_retry(struct unit_test_state *uts)
|
static int _dm_test_net_retry(struct unit_test_state *uts)
|
||||||
@ -260,7 +260,7 @@ static int dm_test_net_retry(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_net_retry, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_net_retry, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int sb_check_arp_reply(struct udevice *dev, void *packet,
|
static int sb_check_arp_reply(struct udevice *dev, void *packet,
|
||||||
unsigned int len)
|
unsigned int len)
|
||||||
@ -345,7 +345,7 @@ static int dm_test_eth_async_arp_reply(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_eth_async_arp_reply, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_eth_async_arp_reply, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int sb_check_ping_reply(struct udevice *dev, void *packet,
|
static int sb_check_ping_reply(struct udevice *dev, void *packet,
|
||||||
unsigned int len)
|
unsigned int len)
|
||||||
@ -430,4 +430,4 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_eth_async_ping_reply, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_eth_async_ping_reply, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -58,7 +58,7 @@ static int dm_test_fdtdec_set_carveout(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_fdtdec_set_carveout,
|
DM_TEST(dm_test_fdtdec_set_carveout,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT | DM_TESTF_FLAT_TREE);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE);
|
||||||
|
|
||||||
static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
|
static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -127,4 +127,4 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_fdtdec_add_reserved_memory,
|
DM_TEST(dm_test_fdtdec_add_reserved_memory,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT | DM_TESTF_FLAT_TREE);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE);
|
||||||
|
@ -20,4 +20,4 @@ static int dm_test_firmware_probe(struct unit_test_state *uts)
|
|||||||
"sandbox-firmware", &dev));
|
"sandbox-firmware", &dev));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_firmware_probe, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_firmware_probe, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -145,7 +145,7 @@ static int dm_test_gpio(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_gpio, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_gpio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that GPIO open-drain/open-source emulation works correctly */
|
/* Test that GPIO open-drain/open-source emulation works correctly */
|
||||||
static int dm_test_gpio_opendrain_opensource(struct unit_test_state *uts)
|
static int dm_test_gpio_opendrain_opensource(struct unit_test_state *uts)
|
||||||
@ -234,7 +234,7 @@ static int dm_test_gpio_opendrain_opensource(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_gpio_opendrain_opensource,
|
DM_TEST(dm_test_gpio_opendrain_opensource,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that sandbox anonymous GPIOs work correctly */
|
/* Test that sandbox anonymous GPIOs work correctly */
|
||||||
static int dm_test_gpio_anon(struct unit_test_state *uts)
|
static int dm_test_gpio_anon(struct unit_test_state *uts)
|
||||||
@ -256,7 +256,7 @@ static int dm_test_gpio_anon(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_gpio_anon, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_gpio_anon, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that gpio_requestf() works as expected */
|
/* Test that gpio_requestf() works as expected */
|
||||||
static int dm_test_gpio_requestf(struct unit_test_state *uts)
|
static int dm_test_gpio_requestf(struct unit_test_state *uts)
|
||||||
@ -274,7 +274,7 @@ static int dm_test_gpio_requestf(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_gpio_requestf, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_gpio_requestf, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that gpio_request() copies its string */
|
/* Test that gpio_request() copies its string */
|
||||||
static int dm_test_gpio_copy(struct unit_test_state *uts)
|
static int dm_test_gpio_copy(struct unit_test_state *uts)
|
||||||
@ -296,7 +296,7 @@ static int dm_test_gpio_copy(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_gpio_copy, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_gpio_copy, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that we don't leak memory with GPIOs */
|
/* Test that we don't leak memory with GPIOs */
|
||||||
static int dm_test_gpio_leak(struct unit_test_state *uts)
|
static int dm_test_gpio_leak(struct unit_test_state *uts)
|
||||||
@ -308,7 +308,7 @@ static int dm_test_gpio_leak(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_gpio_leak, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_gpio_leak, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that we can find GPIOs using phandles */
|
/* Test that we can find GPIOs using phandles */
|
||||||
static int dm_test_gpio_phandles(struct unit_test_state *uts)
|
static int dm_test_gpio_phandles(struct unit_test_state *uts)
|
||||||
@ -382,7 +382,7 @@ static int dm_test_gpio_phandles(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_gpio_phandles, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_gpio_phandles, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Check the gpio pin configuration get from device tree information */
|
/* Check the gpio pin configuration get from device tree information */
|
||||||
static int dm_test_gpio_get_dir_flags(struct unit_test_state *uts)
|
static int dm_test_gpio_get_dir_flags(struct unit_test_state *uts)
|
||||||
@ -418,7 +418,7 @@ static int dm_test_gpio_get_dir_flags(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_gpio_get_dir_flags, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_gpio_get_dir_flags, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test of gpio_get_acpi() */
|
/* Test of gpio_get_acpi() */
|
||||||
static int dm_test_gpio_get_acpi(struct unit_test_state *uts)
|
static int dm_test_gpio_get_acpi(struct unit_test_state *uts)
|
||||||
@ -447,7 +447,7 @@ static int dm_test_gpio_get_acpi(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_gpio_get_acpi, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_gpio_get_acpi, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test of gpio_get_acpi() with an interrupt GPIO */
|
/* Test of gpio_get_acpi() with an interrupt GPIO */
|
||||||
static int dm_test_gpio_get_acpi_irq(struct unit_test_state *uts)
|
static int dm_test_gpio_get_acpi_irq(struct unit_test_state *uts)
|
||||||
@ -479,4 +479,4 @@ static int dm_test_gpio_get_acpi_irq(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_gpio_get_acpi_irq, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_gpio_get_acpi_irq, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -38,4 +38,4 @@ static int dm_test_hwspinlock_base(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_hwspinlock_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_hwspinlock_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -42,7 +42,7 @@ static int dm_test_i2c_find(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_i2c_find, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_i2c_find, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_i2c_read_write(struct unit_test_state *uts)
|
static int dm_test_i2c_read_write(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -59,7 +59,7 @@ static int dm_test_i2c_read_write(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_i2c_read_write, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_i2c_read_write, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_i2c_speed(struct unit_test_state *uts)
|
static int dm_test_i2c_speed(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -81,7 +81,7 @@ static int dm_test_i2c_speed(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_i2c_speed, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_i2c_speed, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_i2c_offset_len(struct unit_test_state *uts)
|
static int dm_test_i2c_offset_len(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -98,7 +98,7 @@ static int dm_test_i2c_offset_len(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_i2c_offset_len, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_i2c_offset_len, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_i2c_probe_empty(struct unit_test_state *uts)
|
static int dm_test_i2c_probe_empty(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -113,7 +113,7 @@ static int dm_test_i2c_probe_empty(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_i2c_probe_empty, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_i2c_probe_empty, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_i2c_bytewise(struct unit_test_state *uts)
|
static int dm_test_i2c_bytewise(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -168,7 +168,7 @@ static int dm_test_i2c_bytewise(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_i2c_bytewise, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_i2c_bytewise, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_i2c_offset(struct unit_test_state *uts)
|
static int dm_test_i2c_offset(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -241,7 +241,7 @@ static int dm_test_i2c_offset(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_i2c_offset, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_i2c_offset, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_i2c_addr_offset(struct unit_test_state *uts)
|
static int dm_test_i2c_addr_offset(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -306,4 +306,4 @@ static int dm_test_i2c_addr_offset(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_i2c_addr_offset, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_i2c_addr_offset, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -30,4 +30,4 @@ static int dm_test_i2s(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_i2s, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_i2s, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -31,7 +31,7 @@ static int dm_test_irq_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_irq_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_irq_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test of irq_first_device_type() */
|
/* Test of irq_first_device_type() */
|
||||||
static int dm_test_irq_type(struct unit_test_state *uts)
|
static int dm_test_irq_type(struct unit_test_state *uts)
|
||||||
@ -43,7 +43,7 @@ static int dm_test_irq_type(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_irq_type, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_irq_type, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test of irq_read_and_clear() */
|
/* Test of irq_read_and_clear() */
|
||||||
static int dm_test_read_and_clear(struct unit_test_state *uts)
|
static int dm_test_read_and_clear(struct unit_test_state *uts)
|
||||||
@ -60,7 +60,7 @@ static int dm_test_read_and_clear(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_read_and_clear, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_read_and_clear, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test of irq_request() */
|
/* Test of irq_request() */
|
||||||
static int dm_test_request(struct unit_test_state *uts)
|
static int dm_test_request(struct unit_test_state *uts)
|
||||||
@ -75,7 +75,7 @@ static int dm_test_request(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_request, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_request, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test of irq_get_acpi() */
|
/* Test of irq_get_acpi() */
|
||||||
static int dm_test_irq_get_acpi(struct unit_test_state *uts)
|
static int dm_test_irq_get_acpi(struct unit_test_state *uts)
|
||||||
@ -97,4 +97,4 @@ static int dm_test_irq_get_acpi(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_irq_get_acpi, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_irq_get_acpi, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -26,7 +26,7 @@ static int dm_test_led_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_led_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_led_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test of the LED 'default-state' device tree property */
|
/* Test of the LED 'default-state' device tree property */
|
||||||
static int dm_test_led_default_state(struct unit_test_state *uts)
|
static int dm_test_led_default_state(struct unit_test_state *uts)
|
||||||
@ -45,7 +45,7 @@ static int dm_test_led_default_state(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_led_default_state, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_led_default_state, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test of the led uclass using the led_gpio driver */
|
/* Test of the led uclass using the led_gpio driver */
|
||||||
static int dm_test_led_gpio(struct unit_test_state *uts)
|
static int dm_test_led_gpio(struct unit_test_state *uts)
|
||||||
@ -70,7 +70,7 @@ static int dm_test_led_gpio(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_led_gpio, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_led_gpio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that we can toggle LEDs */
|
/* Test that we can toggle LEDs */
|
||||||
static int dm_test_led_toggle(struct unit_test_state *uts)
|
static int dm_test_led_toggle(struct unit_test_state *uts)
|
||||||
@ -95,7 +95,7 @@ static int dm_test_led_toggle(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_led_toggle, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_led_toggle, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test obtaining an LED by label */
|
/* Test obtaining an LED by label */
|
||||||
static int dm_test_led_label(struct unit_test_state *uts)
|
static int dm_test_led_label(struct unit_test_state *uts)
|
||||||
@ -116,7 +116,7 @@ static int dm_test_led_label(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_led_label, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_led_label, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test LED blinking */
|
/* Test LED blinking */
|
||||||
#ifdef CONFIG_LED_BLINK
|
#ifdef CONFIG_LED_BLINK
|
||||||
@ -139,5 +139,5 @@ static int dm_test_led_blink(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_led_blink, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_led_blink, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,4 +29,4 @@ static int dm_test_mailbox(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_mailbox, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_mailbox, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -55,4 +55,4 @@ static int dm_test_mdio(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_mdio, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_mdio, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -78,4 +78,4 @@ static int dm_test_mdio_mux(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_mdio_mux, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_mdio_mux, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -81,4 +81,4 @@ static int dm_test_misc(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_misc, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_misc, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -23,7 +23,7 @@ static int dm_test_mmc_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_mmc_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_mmc_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_mmc_blk(struct unit_test_state *uts)
|
static int dm_test_mmc_blk(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -42,4 +42,4 @@ static int dm_test_mmc_blk(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_mmc_blk, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_mmc_blk, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -71,4 +71,4 @@ static int dm_test_nop(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_nop, DM_TESTF_FLAT_TREE | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_nop, UT_TESTF_FLAT_TREE | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -17,7 +17,7 @@ static int dm_test_ofnode_compatible(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ofnode_compatible, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_ofnode_compatible, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_ofnode_by_prop_value(struct unit_test_state *uts)
|
static int dm_test_ofnode_by_prop_value(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -44,7 +44,7 @@ static int dm_test_ofnode_by_prop_value(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ofnode_by_prop_value, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_ofnode_by_prop_value, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_ofnode_fmap(struct unit_test_state *uts)
|
static int dm_test_ofnode_fmap(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -59,7 +59,7 @@ static int dm_test_ofnode_fmap(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ofnode_fmap, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_ofnode_fmap, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_ofnode_read(struct unit_test_state *uts)
|
static int dm_test_ofnode_read(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -85,7 +85,7 @@ static int dm_test_ofnode_read(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ofnode_read, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_ofnode_read, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_ofnode_read_chosen(struct unit_test_state *uts)
|
static int dm_test_ofnode_read_chosen(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -114,7 +114,7 @@ static int dm_test_ofnode_read_chosen(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ofnode_read_chosen, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_ofnode_read_chosen, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_ofnode_get_child_count(struct unit_test_state *uts)
|
static int dm_test_ofnode_get_child_count(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -135,4 +135,4 @@ static int dm_test_ofnode_get_child_count(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ofnode_get_child_count,
|
DM_TEST(dm_test_ofnode_get_child_count,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -47,4 +47,4 @@ static int dm_test_ofnode_get_property_by_prop(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ofnode_get_property_by_prop,
|
DM_TEST(dm_test_ofnode_get_property_by_prop,
|
||||||
DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -132,7 +132,7 @@ static int dm_test_osd_basics(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_osd_basics, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_osd_basics, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_osd_extended(struct unit_test_state *uts)
|
static int dm_test_osd_extended(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -216,4 +216,4 @@ static int dm_test_osd_extended(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_osd_extended, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_osd_extended, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -25,4 +25,4 @@ static int dm_test_p2sb_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_p2sb_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_p2sb_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -77,4 +77,4 @@ static int dm_test_panel(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_panel, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_panel, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -34,7 +34,7 @@ static int dm_test_pch_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pch_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pch_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test sandbox PCH ioctl */
|
/* Test sandbox PCH ioctl */
|
||||||
static int dm_test_pch_ioctl(struct unit_test_state *uts)
|
static int dm_test_pch_ioctl(struct unit_test_state *uts)
|
||||||
@ -53,4 +53,4 @@ static int dm_test_pch_ioctl(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pch_ioctl, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pch_ioctl, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -20,7 +20,7 @@ static int dm_test_pci_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pci_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pci_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that sandbox PCI bus numbering and device works correctly */
|
/* Test that sandbox PCI bus numbering and device works correctly */
|
||||||
static int dm_test_pci_busdev(struct unit_test_state *uts)
|
static int dm_test_pci_busdev(struct unit_test_state *uts)
|
||||||
@ -55,7 +55,7 @@ static int dm_test_pci_busdev(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pci_busdev, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pci_busdev, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that we can use the swapcase device correctly */
|
/* Test that we can use the swapcase device correctly */
|
||||||
static int dm_test_pci_swapcase(struct unit_test_state *uts)
|
static int dm_test_pci_swapcase(struct unit_test_state *uts)
|
||||||
@ -108,7 +108,7 @@ static int dm_test_pci_swapcase(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pci_swapcase, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pci_swapcase, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that we can dynamically bind the device driver correctly */
|
/* Test that we can dynamically bind the device driver correctly */
|
||||||
static int dm_test_pci_drvdata(struct unit_test_state *uts)
|
static int dm_test_pci_drvdata(struct unit_test_state *uts)
|
||||||
@ -130,7 +130,7 @@ static int dm_test_pci_drvdata(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pci_drvdata, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pci_drvdata, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test that devices on PCI bus#2 can be accessed correctly */
|
/* Test that devices on PCI bus#2 can be accessed correctly */
|
||||||
static int dm_test_pci_mixed(struct unit_test_state *uts)
|
static int dm_test_pci_mixed(struct unit_test_state *uts)
|
||||||
@ -193,7 +193,7 @@ static int dm_test_pci_mixed(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pci_mixed, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pci_mixed, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test looking up PCI capability and extended capability */
|
/* Test looking up PCI capability and extended capability */
|
||||||
static int dm_test_pci_cap(struct unit_test_state *uts)
|
static int dm_test_pci_cap(struct unit_test_state *uts)
|
||||||
@ -245,7 +245,7 @@ static int dm_test_pci_cap(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pci_cap, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pci_cap, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test looking up BARs in EA capability structure */
|
/* Test looking up BARs in EA capability structure */
|
||||||
static int dm_test_pci_ea(struct unit_test_state *uts)
|
static int dm_test_pci_ea(struct unit_test_state *uts)
|
||||||
@ -294,7 +294,7 @@ static int dm_test_pci_ea(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pci_ea, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pci_ea, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test the dev_read_addr_pci() function */
|
/* Test the dev_read_addr_pci() function */
|
||||||
static int dm_test_pci_addr_flat(struct unit_test_state *uts)
|
static int dm_test_pci_addr_flat(struct unit_test_state *uts)
|
||||||
@ -316,14 +316,14 @@ static int dm_test_pci_addr_flat(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pci_addr_flat, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT |
|
DM_TEST(dm_test_pci_addr_flat, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT |
|
||||||
DM_TESTF_FLAT_TREE);
|
UT_TESTF_FLAT_TREE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test the dev_read_addr_pci() function with livetree. That function is
|
* Test the dev_read_addr_pci() function with livetree. That function is
|
||||||
* not currently fully implemented, in that it fails to return the BAR address.
|
* not currently fully implemented, in that it fails to return the BAR address.
|
||||||
* Once that is implemented this test can be removed and dm_test_pci_addr_flat()
|
* Once that is implemented this test can be removed and dm_test_pci_addr_flat()
|
||||||
* can be used for both flattree and livetree by removing the DM_TESTF_FLAT_TREE
|
* can be used for both flattree and livetree by removing the UT_TESTF_FLAT_TREE
|
||||||
* flag above.
|
* flag above.
|
||||||
*/
|
*/
|
||||||
static int dm_test_pci_addr_live(struct unit_test_state *uts)
|
static int dm_test_pci_addr_live(struct unit_test_state *uts)
|
||||||
@ -338,8 +338,8 @@ static int dm_test_pci_addr_live(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pci_addr_live, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT |
|
DM_TEST(dm_test_pci_addr_live, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT |
|
||||||
DM_TESTF_LIVE_TREE);
|
UT_TESTF_LIVE_TREE);
|
||||||
|
|
||||||
/* Test device_is_on_pci_bus() */
|
/* Test device_is_on_pci_bus() */
|
||||||
static int dm_test_pci_on_bus(struct unit_test_state *uts)
|
static int dm_test_pci_on_bus(struct unit_test_state *uts)
|
||||||
@ -353,4 +353,4 @@ static int dm_test_pci_on_bus(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pci_on_bus, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pci_on_bus, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -61,5 +61,5 @@ static int dm_test_pci_ep_base(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_pci_ep_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pci_ep_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ static int dm_test_phy_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_phy_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_phy_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test of the phy uclass using the sandbox phy driver operations */
|
/* Test of the phy uclass using the sandbox phy driver operations */
|
||||||
static int dm_test_phy_ops(struct unit_test_state *uts)
|
static int dm_test_phy_ops(struct unit_test_state *uts)
|
||||||
@ -111,7 +111,7 @@ static int dm_test_phy_ops(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_phy_ops, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_phy_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_phy_bulk(struct unit_test_state *uts)
|
static int dm_test_phy_bulk(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -144,4 +144,4 @@ static int dm_test_phy_bulk(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_phy_bulk, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_phy_bulk, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -30,4 +30,4 @@ static int dm_test_pmc_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pmc_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pmc_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -44,7 +44,7 @@ static int dm_test_power_pmic_get(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_pmic_get, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_pmic_get, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* PMIC get method - MC34708 - for 3 bytes transmission */
|
/* PMIC get method - MC34708 - for 3 bytes transmission */
|
||||||
static int dm_test_power_pmic_mc34708_get(struct unit_test_state *uts)
|
static int dm_test_power_pmic_mc34708_get(struct unit_test_state *uts)
|
||||||
@ -54,7 +54,7 @@ static int dm_test_power_pmic_mc34708_get(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_power_pmic_mc34708_get, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_pmic_mc34708_get, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test PMIC I/O */
|
/* Test PMIC I/O */
|
||||||
static int dm_test_power_pmic_io(struct unit_test_state *uts)
|
static int dm_test_power_pmic_io(struct unit_test_state *uts)
|
||||||
@ -83,7 +83,7 @@ static int dm_test_power_pmic_io(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_pmic_io, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_pmic_io, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
#define MC34708_PMIC_REG_COUNT 64
|
#define MC34708_PMIC_REG_COUNT 64
|
||||||
#define MC34708_PMIC_TEST_VAL 0x125534
|
#define MC34708_PMIC_TEST_VAL 0x125534
|
||||||
@ -101,7 +101,7 @@ static int dm_test_power_pmic_mc34708_regs_check(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_power_pmic_mc34708_regs_check, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_pmic_mc34708_regs_check, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_power_pmic_mc34708_rw_val(struct unit_test_state *uts)
|
static int dm_test_power_pmic_mc34708_rw_val(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -128,4 +128,4 @@ static int dm_test_power_pmic_mc34708_rw_val(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_power_pmic_mc34708_rw_val, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_pmic_mc34708_rw_val, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -46,4 +46,4 @@ static int dm_test_power_domain(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_domain, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_domain, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -29,4 +29,4 @@ static int dm_test_pwm_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_pwm_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_pwm_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -25,4 +25,4 @@ static int dm_test_ram_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_ram_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_ram_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -67,7 +67,7 @@ static int dm_test_regmap_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_regmap_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_regmap_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test we can access a regmap through syscon */
|
/* Test we can access a regmap through syscon */
|
||||||
static int dm_test_regmap_syscon(struct unit_test_state *uts)
|
static int dm_test_regmap_syscon(struct unit_test_state *uts)
|
||||||
@ -93,7 +93,7 @@ static int dm_test_regmap_syscon(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_regmap_syscon, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_regmap_syscon, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Read/Write/Modify test */
|
/* Read/Write/Modify test */
|
||||||
static int dm_test_regmap_rw(struct unit_test_state *uts)
|
static int dm_test_regmap_rw(struct unit_test_state *uts)
|
||||||
@ -127,7 +127,7 @@ static int dm_test_regmap_rw(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_regmap_rw, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_regmap_rw, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Get/Set test */
|
/* Get/Set test */
|
||||||
static int dm_test_regmap_getset(struct unit_test_state *uts)
|
static int dm_test_regmap_getset(struct unit_test_state *uts)
|
||||||
@ -158,7 +158,7 @@ static int dm_test_regmap_getset(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_regmap_getset, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_regmap_getset, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Read polling test */
|
/* Read polling test */
|
||||||
static int dm_test_regmap_poll(struct unit_test_state *uts)
|
static int dm_test_regmap_poll(struct unit_test_state *uts)
|
||||||
@ -186,4 +186,4 @@ static int dm_test_regmap_poll(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_regmap_poll, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_regmap_poll, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -90,7 +90,7 @@ static int dm_test_power_regulator_get(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_regulator_get, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_regulator_get, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test regulator set and get Voltage method */
|
/* Test regulator set and get Voltage method */
|
||||||
static int dm_test_power_regulator_set_get_voltage(struct unit_test_state *uts)
|
static int dm_test_power_regulator_set_get_voltage(struct unit_test_state *uts)
|
||||||
@ -117,7 +117,7 @@ static int dm_test_power_regulator_set_get_voltage(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_regulator_set_get_voltage, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_regulator_set_get_voltage, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test regulator set and get Current method */
|
/* Test regulator set and get Current method */
|
||||||
static int dm_test_power_regulator_set_get_current(struct unit_test_state *uts)
|
static int dm_test_power_regulator_set_get_current(struct unit_test_state *uts)
|
||||||
@ -156,7 +156,7 @@ static int dm_test_power_regulator_set_get_current(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_regulator_set_get_current, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_regulator_set_get_current, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test regulator set and get Enable method */
|
/* Test regulator set and get Enable method */
|
||||||
static int dm_test_power_regulator_set_get_enable(struct unit_test_state *uts)
|
static int dm_test_power_regulator_set_get_enable(struct unit_test_state *uts)
|
||||||
@ -175,7 +175,7 @@ static int dm_test_power_regulator_set_get_enable(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_regulator_set_get_enable, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_regulator_set_get_enable, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test regulator set and get enable if allowed method */
|
/* Test regulator set and get enable if allowed method */
|
||||||
static
|
static
|
||||||
@ -196,7 +196,7 @@ int dm_test_power_regulator_set_enable_if_allowed(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_regulator_set_enable_if_allowed, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_regulator_set_enable_if_allowed, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test regulator set and get mode method */
|
/* Test regulator set and get mode method */
|
||||||
static int dm_test_power_regulator_set_get_mode(struct unit_test_state *uts)
|
static int dm_test_power_regulator_set_get_mode(struct unit_test_state *uts)
|
||||||
@ -215,7 +215,7 @@ static int dm_test_power_regulator_set_get_mode(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_regulator_set_get_mode, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_regulator_set_get_mode, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test regulator set and get suspend Voltage method */
|
/* Test regulator set and get suspend Voltage method */
|
||||||
static int dm_test_power_regulator_set_get_suspend_voltage(struct unit_test_state *uts)
|
static int dm_test_power_regulator_set_get_suspend_voltage(struct unit_test_state *uts)
|
||||||
@ -245,7 +245,7 @@ static int dm_test_power_regulator_set_get_suspend_voltage(struct unit_test_stat
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_regulator_set_get_suspend_voltage, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_regulator_set_get_suspend_voltage, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test regulator set and get suspend Enable method */
|
/* Test regulator set and get suspend Enable method */
|
||||||
static int dm_test_power_regulator_set_get_suspend_enable(struct unit_test_state *uts)
|
static int dm_test_power_regulator_set_get_suspend_enable(struct unit_test_state *uts)
|
||||||
@ -272,7 +272,7 @@ static int dm_test_power_regulator_set_get_suspend_enable(struct unit_test_state
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_regulator_set_get_suspend_enable, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_regulator_set_get_suspend_enable, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test regulator autoset method */
|
/* Test regulator autoset method */
|
||||||
static int dm_test_power_regulator_autoset(struct unit_test_state *uts)
|
static int dm_test_power_regulator_autoset(struct unit_test_state *uts)
|
||||||
@ -305,7 +305,7 @@ static int dm_test_power_regulator_autoset(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_regulator_autoset, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_regulator_autoset, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Struct setting: to keep the expected output settings.
|
* Struct setting: to keep the expected output settings.
|
||||||
@ -401,4 +401,4 @@ static int dm_test_power_regulator_autoset_list(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_power_regulator_autoset_list, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_power_regulator_autoset_list, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -68,7 +68,7 @@ static int dm_test_remoteproc_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_remoteproc_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_remoteproc_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
#define DEVICE_TO_PHYSICAL_OFFSET 0x1000
|
#define DEVICE_TO_PHYSICAL_OFFSET 0x1000
|
||||||
/**
|
/**
|
||||||
@ -256,4 +256,4 @@ static int dm_test_remoteproc_elf(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_remoteproc_elf, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_remoteproc_elf, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -39,7 +39,7 @@ static int dm_test_reset_base(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_reset_base, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_reset_base, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_reset(struct unit_test_state *uts)
|
static int dm_test_reset(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -64,7 +64,7 @@ static int dm_test_reset(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_reset, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_reset, UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_reset_bulk(struct unit_test_state *uts)
|
static int dm_test_reset_bulk(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -94,4 +94,4 @@ static int dm_test_reset_bulk(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_reset_bulk, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_reset_bulk, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -24,4 +24,4 @@ static int dm_test_rng_read(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_rng_read, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_rng_read, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -28,7 +28,7 @@ static int dm_test_rtc_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_rtc_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_rtc_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static void show_time(const char *msg, struct rtc_time *time)
|
static void show_time(const char *msg, struct rtc_time *time)
|
||||||
{
|
{
|
||||||
@ -131,7 +131,7 @@ static int dm_test_rtc_set_get(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_rtc_set_get, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_rtc_set_get, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
static int dm_test_rtc_read_write(struct unit_test_state *uts)
|
static int dm_test_rtc_read_write(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
@ -175,7 +175,7 @@ static int dm_test_rtc_read_write(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_rtc_read_write, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_rtc_read_write, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test 'rtc list' command */
|
/* Test 'rtc list' command */
|
||||||
static int dm_test_rtc_cmd_list(struct unit_test_state *uts)
|
static int dm_test_rtc_cmd_list(struct unit_test_state *uts)
|
||||||
@ -189,7 +189,7 @@ static int dm_test_rtc_cmd_list(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_rtc_cmd_list, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_rtc_cmd_list, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Test 'rtc read' and 'rtc write' commands */
|
/* Test 'rtc read' and 'rtc write' commands */
|
||||||
static int dm_test_rtc_cmd_rw(struct unit_test_state *uts)
|
static int dm_test_rtc_cmd_rw(struct unit_test_state *uts)
|
||||||
@ -232,7 +232,7 @@ static int dm_test_rtc_cmd_rw(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_rtc_cmd_rw, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_rtc_cmd_rw, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Reset the time */
|
/* Reset the time */
|
||||||
static int dm_test_rtc_reset(struct unit_test_state *uts)
|
static int dm_test_rtc_reset(struct unit_test_state *uts)
|
||||||
@ -258,7 +258,7 @@ static int dm_test_rtc_reset(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_rtc_reset, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_rtc_reset, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Check that two RTC devices can be used independently */
|
/* Check that two RTC devices can be used independently */
|
||||||
static int dm_test_rtc_dual(struct unit_test_state *uts)
|
static int dm_test_rtc_dual(struct unit_test_state *uts)
|
||||||
@ -290,4 +290,4 @@ static int dm_test_rtc_dual(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_rtc_dual, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_rtc_dual, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -69,4 +69,4 @@ static int dm_test_serial(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_serial, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_serial, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -65,7 +65,7 @@ static int dm_test_spi_flash(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_spi_flash, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_spi_flash, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
/* Functional test that sandbox SPI flash works correctly */
|
/* Functional test that sandbox SPI flash works correctly */
|
||||||
static int dm_test_spi_flash_func(struct unit_test_state *uts)
|
static int dm_test_spi_flash_func(struct unit_test_state *uts)
|
||||||
@ -93,4 +93,4 @@ static int dm_test_spi_flash_func(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_spi_flash_func, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_spi_flash_func, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
@ -42,4 +42,4 @@ static int dm_test_simple_pm_bus(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_simple_pm_bus, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_simple_pm_bus, UT_TESTF_SCAN_FDT);
|
||||||
|
@ -24,5 +24,5 @@ static int dm_test_smem_base(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DM_TEST(dm_test_smem_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_smem_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||||
|
|
||||||
|
@ -117,4 +117,4 @@ static int dm_test_soc(struct unit_test_state *uts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DM_TEST(dm_test_soc, DM_TESTF_SCAN_FDT);
|
DM_TEST(dm_test_soc, UT_TESTF_SCAN_FDT);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user