summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-10-30 15:24:30 -0400
committerTom Rini <trini@konsulko.com>2020-10-30 15:24:30 -0400
commit63d4607e03e5f1f7ab9a18bc640e31f7d28874b4 (patch)
treebdea1f28ad176fcd44f209bf943d25c8bddbe8d2 /arch
parent096912b5fe9bb2fd90599d86a714001df6924198 (diff)
parent2424057b2ad0eacdd2d81e35e7bea5df97802b8f (diff)
Merge tag 'dm-pull-30oct20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
of-platdata and dtoc improvements sandbox SPL tests binman support for compressed sections
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/mx6/soc.c2
-rw-r--r--arch/sandbox/cpu/sdl.c3
-rw-r--r--arch/sandbox/cpu/spl.c18
-rw-r--r--arch/sandbox/cpu/start.c15
-rw-r--r--arch/sandbox/dts/sandbox.dts1
-rw-r--r--arch/sandbox/dts/sandbox.dtsi27
-rw-r--r--arch/sandbox/include/asm/state.h3
-rw-r--r--arch/x86/cpu/apollolake/Kconfig2
-rw-r--r--arch/x86/cpu/apollolake/spl.c3
9 files changed, 56 insertions, 18 deletions
diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index e1292860656..a636107410e 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -34,7 +34,7 @@ struct scu_regs {
u32 fpga_rev;
};
-#if defined(CONFIG_IMX_THERMAL)
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_IMX_THERMAL)
static const struct imx_thermal_plat imx6_thermal_plat = {
.regs = (void *)ANATOP_BASE_ADDR,
.fuse_bank = 1,
diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c
index 7dc3dab32ef..d4dab369816 100644
--- a/arch/sandbox/cpu/sdl.c
+++ b/arch/sandbox/cpu/sdl.c
@@ -127,7 +127,8 @@ int sandbox_sdl_init_display(int width, int height, int log2_bpp,
sdl.pitch = sdl.width * sdl.depth / 8;
SDL_Window *screen = SDL_CreateWindow("U-Boot", SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
- sdl.vis_width, sdl.vis_height, 0);
+ sdl.vis_width, sdl.vis_height,
+ SDL_WINDOW_RESIZABLE);
if (!screen) {
printf("Unable to initialise SDL screen: %s\n",
SDL_GetError());
diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c
index 7ab8919eb90..9a77da15619 100644
--- a/arch/sandbox/cpu/spl.c
+++ b/arch/sandbox/cpu/spl.c
@@ -12,6 +12,7 @@
#include <spl.h>
#include <asm/spl.h>
#include <asm/state.h>
+#include <test/test.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -53,19 +54,14 @@ SPL_LOAD_IMAGE_METHOD("sandbox", 9, BOOT_DEVICE_BOARD, spl_board_load_image);
void spl_board_init(void)
{
struct sandbox_state *state = state_get_current();
- struct udevice *dev;
preloader_console_init();
- if (state->show_of_platdata) {
- /*
- * Scan all the devices so that we can output their platform
- * data. See sandbox_spl_probe().
- */
- printf("Scanning misc devices\n");
- for (uclass_first_device(UCLASS_MISC, &dev);
- dev;
- uclass_next_device(&dev))
- ;
+
+ if (state->run_unittests) {
+ int ret;
+
+ ret = dm_test_main(state->select_unittests);
+ /* continue execution into U-Boot */
}
}
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index c6a2bbe4689..58ada13fba5 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -365,14 +365,23 @@ static int sandbox_cmdline_cb_log_level(struct sandbox_state *state,
SANDBOX_CMDLINE_OPT_SHORT(log_level, 'L', 1,
"Set log level (0=panic, 7=debug)");
-static int sandbox_cmdline_cb_show_of_platdata(struct sandbox_state *state,
+static int sandbox_cmdline_cb_unittests(struct sandbox_state *state,
+ const char *arg)
+{
+ state->run_unittests = true;
+
+ return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(unittests, 'u', 0, "Run unit tests");
+
+static int sandbox_cmdline_cb_select_unittests(struct sandbox_state *state,
const char *arg)
{
- state->show_of_platdata = true;
+ state->select_unittests = arg;
return 0;
}
-SANDBOX_CMDLINE_OPT(show_of_platdata, 0, "Show of-platdata in SPL");
+SANDBOX_CMDLINE_OPT_SHORT(select_unittests, 'k', 1, "Select unit tests to run");
static void setup_ram_buf(struct sandbox_state *state)
{
diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
index 20f68938297..8b50a402898 100644
--- a/arch/sandbox/dts/sandbox.dts
+++ b/arch/sandbox/dts/sandbox.dts
@@ -69,6 +69,7 @@
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c0>;
+ u-boot,dm-pre-reloc;
};
pcic: pci@0 {
diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi
index 0faad3f3195..81cdc55b0d4 100644
--- a/arch/sandbox/dts/sandbox.dtsi
+++ b/arch/sandbox/dts/sandbox.dtsi
@@ -29,6 +29,32 @@
};
};
+ clk_fixed: clk-fixed {
+ u-boot,dm-pre-reloc;
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <1234>;
+ };
+
+ clk_sandbox: clk-sbox {
+ u-boot,dm-pre-reloc;
+ compatible = "sandbox,clk";
+ #clock-cells = <1>;
+ assigned-clocks = <&clk_sandbox 3>;
+ assigned-clock-rates = <321>;
+ };
+
+ clk-test {
+ u-boot,dm-pre-reloc;
+ compatible = "sandbox,clk-test";
+ clocks = <&clk_fixed>,
+ <&clk_sandbox 1>,
+ <&clk_sandbox 0>,
+ <&clk_sandbox 3>,
+ <&clk_sandbox 2>;
+ clock-names = "fixed", "i2c", "spi", "uart2", "uart1";
+ };
+
gpio_a: gpios@0 {
u-boot,dm-pre-reloc;
gpio-controller;
@@ -64,6 +90,7 @@
reg = <0x43>;
compatible = "sandbox-rtc";
sandbox,emul = <&emul0>;
+ u-boot,dm-pre-reloc;
};
sandbox_pmic: sandbox_pmic {
reg = <0x40>;
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index 1bfad305f1a..bca13069824 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -90,8 +90,9 @@ struct sandbox_state {
bool skip_delays; /* Ignore any time delays (for test) */
bool show_test_output; /* Don't suppress stdout in tests */
int default_log_level; /* Default log level for sandbox */
- bool show_of_platdata; /* Show of-platdata in SPL */
bool ram_buf_read; /* true if we read the RAM buffer */
+ bool run_unittests; /* Run unit tests */
+ const char *select_unittests; /* Unit test to run */
/* Pointer to information for each SPI bus/cs */
struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]
diff --git a/arch/x86/cpu/apollolake/Kconfig b/arch/x86/cpu/apollolake/Kconfig
index 35a425cd1bc..c6c1350f4f0 100644
--- a/arch/x86/cpu/apollolake/Kconfig
+++ b/arch/x86/cpu/apollolake/Kconfig
@@ -85,6 +85,8 @@ config APL_SPI_FLASH_BOOT
bool "Support booting with SPI-flash driver instead memory-mapped SPI"
select TPL_SPI_FLASH_SUPPORT
select TPL_SPI_SUPPORT
+ select TPL_DM_SPI
+ select TPL_DM_SPI_FLASH
help
This enables SPI and SPI flash in TPL. Without the this only
available boot method is to use memory-mapped SPI. Since this is
diff --git a/arch/x86/cpu/apollolake/spl.c b/arch/x86/cpu/apollolake/spl.c
index 5a53831dc6a..089b37c59f8 100644
--- a/arch/x86/cpu/apollolake/spl.c
+++ b/arch/x86/cpu/apollolake/spl.c
@@ -90,7 +90,8 @@ static int apl_flash_probe(struct udevice *dev)
*/
static int apl_flash_bind(struct udevice *dev)
{
- if (CONFIG_IS_ENABLED(OF_PLATDATA)) {
+ if (CONFIG_IS_ENABLED(OF_PLATDATA) &&
+ !CONFIG_IS_ENABLED(OF_PLATDATA_PARENT)) {
struct dm_spi_slave_platdata *plat;
struct udevice *spi;
int ret;