Compare commits

...

8 Commits

Author SHA1 Message Date
Simon Glass
8c9ed25419 CI: Drop broken boards from sjg lab
Some of the boards have developed problems since the last passing run.

Disable these while diagnosis is ongoing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-01 06:29:26 -07:00
Simon Glass
7fb94e9524 Revert "global_data: Drop spl_handoff"
This breaks chromebook_coral which says:

   Video: No video mode configured in FSP!

This reverts commit 2e9313179a.
2024-12-01 06:29:26 -07:00
Simon Glass
288a5c6802 binman: Avoid skipping binman_init()
A recent lwip change stopped binman's init from working, so it is not
possible to read nodes from the image description anymore.

Correct this by dropping the offending line.

Fixes: 4d4d783812 net: lwip: add TFTP support and tftpboot command

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-01 06:29:26 -07:00
Simon Glass
f44128934e fdt: Allow the devicetree to come from a bloblist
Standard passage provides for a bloblist to be passed from one firmware
phase to the next. That can be used to pass the devicetree along as well.
Add an option to support this.

Tests for this will be added as part of the Universal Payload work.

Note: This is the correct way to deal with bloblist, since it allows
boards to choose whether they want to use the devicetree from there, or
not.

Link: https://patchwork.ozlabs.org/project/uboot/patch/20231226094625.221671-1-sjg@chromium.org/
Link: https://patchwork.ozlabs.org/project/uboot/patch/20231228133654.2356023-1-sjg@chromium.org/
Link: https://patchwork.ozlabs.org/project/uboot/patch/20231228194725.2482268-1-sjg@chromium.org/
Link: https://patchwork.ozlabs.org/project/uboot/patch/20240104014919.413568-1-sjg@chromium.org/
Link: https://patchwork.ozlabs.org/project/uboot/patch/20230921015730.1511373-31-sjg@chromium.org/
Link: https://patchwork.ozlabs.org/project/uboot/patch/20230830180524.315916-31-sjg@chromium.org/

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-01 06:29:26 -07:00
Simon Glass
97344b18e7 Revert "fdt: Allow the devicetree to come from a bloblist"
This stops coral, bob and kevin from booting.

This implementation was never correct and it was only on the insistence
of others that I relented and provided this patch.

The correct way to do this was always to use a Kconfig option, so let's
first revert this broken idea.

This reverts commit 70fe238594.
2024-12-01 06:29:26 -07:00
Simon Glass
66ca67a04f Revert "fdt: Correct condition for bloblist existing"
This was a work-around and it isn't effective, since bob and kevin are
still broken. Drop it.

This reverts commit cafde93ec0.
2024-12-01 06:29:26 -07:00
Simon Glass
d8a97112e7 Revert "power: regulator: Trigger probe of regulators which are always-on or boot-on"
Unfortunately this commit causes a problem on nyan-big:

   U-Boot SPL 2024.10-rc6-00632-g51c4679d2f84 (Nov 30 2024 - 13:28:40 -0700)
   Trying to boot from RAM

   U-Boot 2024.10-rc6-00632-g51c4679d2f84 (Nov 30 2024 - 13:28:40 -0700)

   SoC: tegra124
   Reset cause: POR
   Model: Acer Chromebook 13 CB5-311
   Board: Google/NVIDIA Nyan-big, ID: -2
   DRAM:  2 GiB
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   Unknown PLL id 14
   failed to read ID1 register: -121
   failed to read ID: -121
   initcall failed at call 810029c8 (err=-121: Remote I/O error)
   ### ERROR ### Please RESET the board ###

This reverts commit 51c4679d2f.

Tweak a few tests also, so they pass.

Patch-cc: Marek Vasut <marex@denx.de>
Patch-cc: Svyatoslav Ryhel <clamor95@gmail.com>
2024-12-01 06:29:03 -07:00
Simon Glass
8e24ff9568 CI: Drop extra condition for sjg lab
The rules part of the template makes sure that this doesn't run until
specifically requested. Drop the check in the script itself, so it is
possible to trigger a run manually without re-pushing the tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-01 06:19:08 -07:00
17 changed files with 90 additions and 103 deletions

View File

@@ -534,9 +534,6 @@ coreboot test.py:
allow_failure: true
tags: [ 'lab' ]
script:
- if [[ -z "${SJG_LAB}" ]]; then
exit 0;
fi
# Environment:
# SRC - source tree
# OUT - output directory for builds
@@ -579,10 +576,11 @@ pcduino3_nano:
ROLE: pcduino3_nano
<<: *lab_dfn
samus:
variables:
ROLE: samus
<<: *lab_dfn
# samus has a hardware failure 30-Nov-24
#samus:
# variables:
# ROLE: samus
# <<: *lab_dfn
link:
variables:
@@ -634,25 +632,28 @@ rpi3z:
ROLE: rpi3z
<<: *lab_dfn
bbb:
variables:
ROLE: bbb
<<: *lab_dfn
# bbb has a hardware failure 30-Nov-24
#bbb:
# variables:
# ROLE: bbb
# <<: *lab_dfn
kevin:
variables:
ROLE: kevin
<<: *lab_dfn
pine64:
variables:
ROLE: pine64
<<: *lab_dfn
# pine64 has a hardware failure 30-Nov-24
#pine64:
# variables:
# ROLE: pine64
# <<: *lab_dfn
c4:
variables:
ROLE: c4
<<: *lab_dfn
# c4 needs binman supported added, so signing works
#c4:
# variables:
# ROLE: c4
# <<: *lab_dfn
rpi4:
variables:

View File

@@ -24,7 +24,9 @@ int arch_cpu_init(void)
int ret;
#if CONFIG_IS_ENABLED(HANDOFF) && IS_ENABLED(CONFIG_USE_HOB)
gd->arch.hob_list = handoff_get();
struct spl_handoff *ho = gd->spl_handoff;
gd->arch.hob_list = ho->arch.hob_list;
#endif
ret = x86_cpu_reinit_f();

View File

@@ -59,7 +59,7 @@ int dram_init(void)
#endif
} else {
#if CONFIG_IS_ENABLED(HANDOFF)
struct spl_handoff *ho = handoff_get();
struct spl_handoff *ho = gd->spl_handoff;
if (!ho) {
log_debug("No SPL handoff found\n");
@@ -82,7 +82,7 @@ phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
return gd->ram_size;
#if CONFIG_IS_ENABLED(HANDOFF)
struct spl_handoff *ho = handoff_get();
struct spl_handoff *ho = gd->spl_handoff;
log_debug("usable_ram_top = %lx\n", ho->arch.usable_ram_top);

View File

@@ -15,10 +15,8 @@ static int do_sb_handoff(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
#if CONFIG_IS_ENABLED(HANDOFF)
struct spl_handoff *handoff = handoff_get();
if (handoff)
printf("SPL handoff magic %lx\n", handoff->arch.magic);
if (gd->spl_handoff)
printf("SPL handoff magic %lx\n", gd->spl_handoff->arch.magic);
else
printf("SPL handoff info not received\n");

View File

@@ -56,6 +56,7 @@ static struct tag_name {
{ BLOBLISTT_INTEL_VBT, "Intel Video-BIOS table" },
{ BLOBLISTT_SMBIOS_TABLES, "SMBIOS tables for x86" },
{ BLOBLISTT_VBOOT_CTX, "Chrome OS vboot context" },
{ BLOBLISTT_CONTROL_FDT, "Control FDT" },
/* BLOBLISTT_PROJECT_AREA */
{ BLOBLISTT_U_BOOT_SPL_HANDOFF, "SPL hand-off" },

View File

@@ -305,6 +305,17 @@ static int setup_mon_len(void)
return 0;
}
static int setup_spl_handoff(void)
{
#if CONFIG_IS_ENABLED(HANDOFF)
gd->spl_handoff = bloblist_find(BLOBLISTT_U_BOOT_SPL_HANDOFF,
sizeof(struct spl_handoff));
debug("Found SPL hand-off info %p\n", gd->spl_handoff);
#endif
return 0;
}
__weak int arch_cpu_init(void)
{
return 0;
@@ -880,6 +891,7 @@ static const init_fnc_t init_sequence_f[] = {
initf_bootstage, /* uses its own timer, so does not need DM */
event_init,
bloblist_maybe_init,
setup_spl_handoff,
#if defined(CONFIG_CONSOLE_RECORD_INIT_F)
console_record_init,
#endif

View File

@@ -5,7 +5,6 @@
* Copyright 2018 Google, Inc
*/
#include <bloblist.h>
#include <handoff.h>
#include <asm/global_data.h>
@@ -39,14 +38,3 @@ void handoff_load_dram_banks(struct spl_handoff *ho)
bd->bi_dram[i].size = ho->ram_bank[i].size;
}
}
struct spl_handoff *handoff_get(void)
{
struct spl_handoff *handoff;
handoff = bloblist_find(BLOBLISTT_U_BOOT_SPL_HANDOFF,
sizeof(struct spl_handoff));
debug("Found SPL hand-off info %p\n", handoff);
return handoff;
}

View File

@@ -137,10 +137,10 @@ If `OF_BOARD` is selected by Kconfig, a board-specific routine will provide the
devicetree at runtime, for example if an earlier bootloader stage creates
it and passes it to U-Boot.
If `BLOBLIST` is selected by Kconfig, the devicetree may come from a bloblist
passed from a previous stage, if present.
If CONFIG_OF_BLOBLIST is defined, the devicetree comes from a bloblist passed
from a previous stage.
If `SANDBOX` is selected by Kconfig, then it will be read from a file on
If CONFIG_SANDBOX is defined, then it will be read from a file on
startup. Use the -d flag to U-Boot to specify the file to read, -D for the
default and -T for the test devicetree, used to run sandbox unit tests.

View File

@@ -8,7 +8,6 @@
#include <dm.h>
#include <dt-structs.h>
#include <errno.h>
#include <handoff.h>
#include <log.h>
#include <malloc.h>
#include <mapmem.h>
@@ -1468,7 +1467,7 @@ static int rk3399_clk_probe(struct udevice *dev)
init_clocks = true;
#elif CONFIG_IS_ENABLED(HANDOFF)
if (!(gd->flags & GD_FLG_RELOC)) {
if (!handoff_get())
if (!(gd->spl_handoff))
init_clocks = true;
}
#endif

View File

@@ -433,8 +433,6 @@ static int regulator_post_bind(struct udevice *dev)
const char *property = "regulator-name";
uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->always_on = dev_read_bool(dev, "regulator-always-on");
uc_pdata->boot_on = dev_read_bool(dev, "regulator-boot-on");
/* Regulator's mandatory constraint */
uc_pdata->name = dev_read_string(dev, property);
@@ -446,21 +444,13 @@ static int regulator_post_bind(struct udevice *dev)
return -EINVAL;
}
if (!regulator_name_is_unique(dev, uc_pdata->name)) {
debug("'%s' of dev: '%s', has nonunique value: '%s\n",
property, dev->name, uc_pdata->name);
return -EINVAL;
}
if (regulator_name_is_unique(dev, uc_pdata->name))
return 0;
/*
* In case the regulator has regulator-always-on or
* regulator-boot-on DT property, trigger probe() to
* configure its default state during startup.
*/
if (uc_pdata->always_on || uc_pdata->boot_on)
dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND);
debug("'%s' of dev: '%s', has nonunique value: '%s\n",
property, dev->name, uc_pdata->name);
return 0;
return -EINVAL;
}
static int regulator_pre_probe(struct udevice *dev)
@@ -483,6 +473,8 @@ static int regulator_pre_probe(struct udevice *dev)
-ENODATA);
uc_pdata->max_uA = dev_read_u32_default(dev, "regulator-max-microamp",
-ENODATA);
uc_pdata->always_on = dev_read_bool(dev, "regulator-always-on");
uc_pdata->boot_on = dev_read_bool(dev, "regulator-boot-on");
uc_pdata->ramp_delay = dev_read_u32_default(dev, "regulator-ramp-delay",
0);
uc_pdata->force_off = dev_read_bool(dev, "regulator-force-boot-off");

View File

@@ -167,6 +167,14 @@ config OF_INITIAL_DTB_READONLY
If initial DTB for DT control is read-only (e.g. points to
memory-mapped flash memory), then set this option.
config OF_BLOBLIST
bool "DTB is provided by a bloblist"
help
Select this to read the devicetree from the bloblist. This allows
using a bloblist to transfer the devicetree between U-Boot phases.
The devicetree is stored in the bloblist by an early phase so that
U-Boot can read it.
config OF_BOARD
bool "Provided by the board (e.g a previous loader) at runtime"
default y if SANDBOX || OF_HAS_PRIOR_STAGE

View File

@@ -400,6 +400,12 @@ struct global_data {
*/
struct bloblist_hdr *bloblist;
#endif
#if CONFIG_IS_ENABLED(HANDOFF)
/**
* @spl_handoff: SPL hand-off information
*/
struct spl_handoff *spl_handoff;
#endif
#if defined(CONFIG_TRANSLATION_OFFSET)
/**
* @translation_offset: optional translation offset

View File

@@ -1191,8 +1191,7 @@ int fdtdec_resetup(int *rescan);
*
* The existing devicetree is available at gd->fdt_blob
*
* @err: 0 on success, -EEXIST if the devicetree is already correct, or other
* internal error code if we fail to setup a DTB
* @err internal error code if we fail to setup a DTB
* @returns new devicetree blob pointer
*/
void *board_fdt_blob_setup(int *err);

View File

@@ -31,13 +31,6 @@ void handoff_save_dram(struct spl_handoff *ho);
void handoff_load_dram_size(struct spl_handoff *ho);
void handoff_load_dram_banks(struct spl_handoff *ho);
/**
* handoff_get() - Get the SPL handoff information
*
* Return: Pointer to SPL handoff if received, else NULL
*/
struct spl_handoff *handoff_get(void);
/**
* handoff_arch_save() - Save arch-specific info into the handoff area
*

View File

@@ -137,7 +137,6 @@ int binman_init(void)
{
int ret;
return 0;
binman = malloc(sizeof(struct binman_info));
if (!binman)
return log_msg_ret("space for binman", -ENOMEM);

View File

@@ -1666,35 +1666,23 @@ static void setup_multi_dtb_fit(void)
int fdtdec_setup(void)
{
int ret = -ENOENT;
int ret;
/*
* If allowing a bloblist, check that first. There was discussion about
* adding an OF_BLOBLIST Kconfig, but this was rejected.
*
* The necessary test is whether the previous phase passed a bloblist,
* not whether this phase creates one.
*/
if (CONFIG_IS_ENABLED(BLOBLIST) &&
(xpl_prev_phase() != PHASE_TPL ||
!IS_ENABLED(CONFIG_TPL_BLOBLIST))) {
/* The devicetree is typically appended to U-Boot */
if (CONFIG_IS_ENABLED(OF_BLOBLIST)) {
ret = bloblist_maybe_init();
if (!ret) {
gd->fdt_blob = bloblist_find(BLOBLISTT_CONTROL_FDT, 0);
if (gd->fdt_blob) {
gd->fdt_src = FDTSRC_BLOBLIST;
log_debug("Devicetree is in bloblist at %p\n",
gd->fdt_blob);
ret = 0;
} else {
log_debug("No FDT found in bloblist\n");
ret = -ENOENT;
}
if (ret)
return ret;
gd->fdt_blob = bloblist_find(BLOBLISTT_CONTROL_FDT, 0);
if (!gd->fdt_blob) {
printf("Not FDT found in bloblist\n");
bloblist_show_list();
return -ENOENT;
}
}
/* Otherwise, the devicetree is typically appended to U-Boot */
if (ret) {
gd->fdt_src = FDTSRC_BLOBLIST;
bloblist_show_list();
log_debug("Devicetree is in bloblist at %p\n", gd->fdt_blob);
} else {
if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
gd->fdt_blob = fdt_find_separate();
gd->fdt_src = FDTSRC_SEPARATE;
@@ -1702,15 +1690,14 @@ int fdtdec_setup(void)
gd->fdt_blob = dtb_dt_embedded();
gd->fdt_src = FDTSRC_EMBED;
}
}
/* Allow the board to override the fdt address. */
if (IS_ENABLED(CONFIG_OF_BOARD)) {
gd->fdt_blob = board_fdt_blob_setup(&ret);
if (!ret)
/* Allow the board to override the fdt address. */
if (IS_ENABLED(CONFIG_OF_BOARD)) {
gd->fdt_blob = board_fdt_blob_setup(&ret);
if (ret)
return ret;
gd->fdt_src = FDTSRC_BOARD;
else if (ret != -EEXIST)
return ret;
}
}
/* Allow the early environment to override the fdt address */

View File

@@ -186,7 +186,8 @@ int dm_test_power_regulator_set_enable_if_allowed(struct unit_test_state *uts)
/* Get BUCK1 - always on regulator */
platname = regulator_names[BUCK1][PLATNAME];
ut_asserteq(-EALREADY, regulator_autoset_by_name(platname, &dev_autoset));
ut_asserteq(-EALREADY,
regulator_autoset_by_name(platname, &dev_autoset));
ut_assertok(regulator_get_by_platname(platname, &dev));
/* Try disabling always-on regulator */
@@ -288,7 +289,8 @@ static int dm_test_power_regulator_autoset(struct unit_test_state *uts)
* Expected output state: uV=1200000; uA=200000; output enabled
*/
platname = regulator_names[BUCK1][PLATNAME];
ut_asserteq(-EALREADY, regulator_autoset_by_name(platname, &dev_autoset));
ut_asserteq(-EALREADY,
regulator_autoset_by_name(platname, &dev_autoset));
/* Check, that the returned device is proper */
ut_assertok(regulator_get_by_platname(platname, &dev));