From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Thu, 8 Apr 2021 10:43:09 +0800 Subject: [PATCH 10/17] x86: coral: Allow booting from coreboot In-Reply-To: <20210407043228.2268429-9-sjg@chromium.org> References: <20210407043228.2268429-1-sjg@chromium.org> <20210407043228.2268429-9-sjg@chromium.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On Wed, Apr 7, 2021 at 12:33 PM Simon Glass wrote: > > Set up coral so that it can boot from coreboot, even though it is a > bare-metal build. This helps with testing since the same image can be used > in both cases. > > Signed-off-by: Simon Glass > --- > > board/google/chromebook_coral/coral.c | 28 +++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/board/google/chromebook_coral/coral.c b/board/google/chromebook_coral/coral.c > index 3f9235c903b..b16252d2a8b 100644 > --- a/board/google/chromebook_coral/coral.c > +++ b/board/google/chromebook_coral/coral.c > @@ -10,17 +10,21 @@ > #include > #include > #include > +#include > #include > #include > #include > #include > #include > +#include > #include > #include > #include > #include > #include "variant_gpio.h" > > +DECLARE_GLOBAL_DATA_PTR; > + > struct cros_gpio_info { > const char *linux_name; > enum cros_gpio_t type; > @@ -28,6 +32,30 @@ struct cros_gpio_info { > int flags; > }; > > +int misc_init_f(void) > +{ > + if (!ll_boot_init()) { > + printf("Running as secondary loader"); > + if (gd->arch.coreboot_table) { > + int ret; > + > + printf(" (found coreboot table at %lx)", > + gd->arch.coreboot_table); Missing an ending '\n', if the following get_coreboot_info() fails > + > + ret = get_coreboot_info(&lib_sysinfo); > + if (ret != 0) { > + printf("Failed to parse coreboot tables (err=%d)\n", > + ret); > + return ret; > + } > + } > + > + printf("\n"); > + } > + > + return 0; > +} > + > int arch_misc_init(void) > { > return 0; > -- Otherwise, Reviewed-by: Bin Meng Regards, Bin