ajout de messages de debug

This commit is contained in:
2023-04-11 16:31:36 +00:00
parent 8aea1eb7b9
commit 1586f6939b
4 changed files with 248 additions and 42 deletions

View File

@@ -45,7 +45,7 @@ UBOOT_DTB_LOADADDRESS = "0x80F80000"
UBOOT_SIGN_KEYDIR = "${PWD}/scle_keys"
# keys name in keydir (eg. "dev.crt", "dev.key")
UBOOT_SIGN_KEYNAME = "scle"
UBOOT_SIGN_ENABLE = "0"
UBOOT_SIGN_ENABLE = "1"
# Localtion of the directory containing the RSA key and certificate used for signing bootloader
SPL_SIGN_KEYDIR = "${PWD}/scle_keys"
@@ -59,7 +59,7 @@ SPL_SIGN_ENABLE = "0"
##########################################################
# Enable use of a U-Boot fitImage
UBOOT_FITIMAGE_ENABLE = "0"
UBOOT_FITIMAGE_ENABLE = "1"
# U-Boot fitImage Hash Algo
UBOOT_FIT_HASH_ALG = "sha256"
# U-Boot fitImage Signature Algo

View File

@@ -9,7 +9,7 @@
endif
--- a/arch/arm/mach-omap2/am33xx/Kconfig
+++ b/arch/arm/mach-omap2/am33xx/Kconfig
@@ -105,6 +105,33 @@ config TARGET_AM335X_SL50
@@ -105,6 +105,29 @@ config TARGET_AM335X_SL50
select DM_SERIAL
imply CMD_DM
@@ -25,20 +25,16 @@
+ imply SPL_ENV_SUPPORT
+ imply SPL_FS_EXT4
+ imply SPL_FS_FAT
+ imply SPL_GPIO
+ imply SPL_I2C
+ imply SPL_LIBCOMMON_SUPPORT
+ imply SPL_LIBDISK_SUPPORT
+ imply SPL_LIBGENERIC_SUPPORT
+ imply SPL_MMC
+ imply SPL_NAND_SUPPORT
+ imply SPL_OF_LIBFDT
+ imply SPL_POWER
+ imply SPL_SEPARATE_BSS
+ imply SPL_SERIAL
+ imply SPL_SYS_MALLOC_SIMPLE
+ imply SPL_WATCHDOG
+ imply SPL_YMODEM_SUPPORT
+
config TARGET_BRXRE1
bool "Support BRXRE1"

View File

@@ -26,32 +26,6 @@
}
m = mmc_get_mmc_dev(dev);
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -6,6 +6,8 @@
* Aneesh V <aneesh@ti.com>
*/
+#define DEBUG
+
#include <common.h>
#include <bloblist.h>
#include <binman_sym.h>
@@ -750,11 +752,13 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
debug(">>" SPL_TPL_PROMPT "board_init_r()\n");
+ debug("boot_init_r\n");
spl_set_bd();
#if defined(CONFIG_SYS_SPL_MALLOC)
mem_malloc_init(SYS_SPL_MALLOC_START, CONFIG_SYS_SPL_MALLOC_SIZE);
gd->flags |= GD_FLG_FULL_MALLOC_INIT;
+ debug("boot_init_r: SYS_SPL_MALLOC\n");
#endif
if (!(gd->flags & GD_FLG_SPL_INIT)) {
if (spl_init())
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -5,6 +5,9 @@
@@ -155,3 +129,237 @@
err = spl_parse_image_header(spl_image, bootdev, header);
if (err)
goto end;
--- a/boot/image-fit-sig.c
+++ b/boot/image-fit-sig.c
@@ -3,6 +3,8 @@
* Copyright (c) 2013, Google Inc.
*/
+#define DEBUG
+
#ifdef USE_HOSTCC
#include "mkimage.h"
#include <time.h>
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -6,6 +6,8 @@
* Aneesh V <aneesh@ti.com>
*/
+#define DEBUG
+
#include <common.h>
#include <bloblist.h>
#include <binman_sym.h>
@@ -272,6 +274,8 @@ static int spl_load_fit_image(struct spl_image_info *spl_image,
int idx, conf_noffset;
int ret;
+ printf("spl_load_fit_image ... starts\n");
+
#ifdef CONFIG_SPL_FIT_SIGNATURE
images.verify = 1;
#endif
@@ -299,6 +303,7 @@ static int spl_load_fit_image(struct spl_image_info *spl_image,
if (ret < 0)
return ret;
+ printf("spl_load_fit_image ... continues\n");
spl_image->size = fw_len;
spl_image->entry_point = fw_data;
spl_image->load_addr = fw_data;
@@ -373,6 +378,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
const struct spl_boot_device *bootdev,
const struct legacy_img_hdr *header)
{
+ debug("spl_parse_image_header ...\n");
#if CONFIG_IS_ENABLED(LOAD_FIT_FULL)
int ret = spl_load_fit_image(spl_image, header);
@@ -679,6 +685,7 @@ static int spl_load_image(struct spl_image_info *spl_image,
static int boot_from_devices(struct spl_image_info *spl_image,
u32 spl_boot_list[], int count)
{
+ debug("boot_from_devices ...\n");
struct spl_image_loader *drv =
ll_entry_start(struct spl_image_loader, spl_image_loader);
const int n_ents =
@@ -687,6 +694,7 @@ static int boot_from_devices(struct spl_image_info *spl_image,
int i;
for (i = 0; i < count && spl_boot_list[i] != BOOT_DEVICE_NONE; i++) {
+ debug("spl_boot_list: %d\n", i);
struct spl_image_loader *loader;
int bootdev = spl_boot_list[i];
@@ -750,11 +758,13 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
debug(">>" SPL_TPL_PROMPT "board_init_r()\n");
+ debug("boot_init_r\n");
spl_set_bd();
#if defined(CONFIG_SYS_SPL_MALLOC)
mem_malloc_init(SYS_SPL_MALLOC_START, CONFIG_SYS_SPL_MALLOC_SIZE);
gd->flags |= GD_FLG_FULL_MALLOC_INIT;
+ debug("boot_init_r: SYS_SPL_MALLOC\n");
#endif
if (!(gd->flags & GD_FLG_SPL_INIT)) {
if (spl_init())
@@ -885,6 +895,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
gd->malloc_ptr / 1024);
#endif
bootstage_mark_name(get_bootstage_id(false), "end phase");
+ debug("spl: scle1\n");
#ifdef CONFIG_BOOTSTAGE_STASH
ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
CONFIG_BOOTSTAGE_STASH_SIZE);
@@ -892,8 +903,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
debug("Failed to stash bootstage: err=%d\n", ret);
#endif
+ debug("spl: scle2\n");
spl_board_prepare_for_boot();
+ debug("spl: scle3 (%s)\n", spl_image.name);
jump_to_image_no_args(&spl_image);
+ debug("spl: scle4\n");
}
/*
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -8,6 +8,8 @@
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*/
+#define DEBUG
+
#define LOG_CATEGORY LOGC_BOOT
#ifdef USE_HOSTCC
@@ -380,8 +382,8 @@ void fit_print_contents(const void *fit)
const char *p;
time_t timestamp;
- if (!CONFIG_IS_ENABLED(FIT_PRINT))
- return;
+// if (!CONFIG_IS_ENABLED(FIT_PRINT))
+// return;
/* Indent string is defined in header image.h */
p = IMAGE_INDENT_STRING;
@@ -485,8 +487,8 @@ void fit_image_print(const void *fit, int image_noffset, const char *p)
int ndepth;
int ret;
- if (!CONFIG_IS_ENABLED(FIT_PRINT))
- return;
+// if (!CONFIG_IS_ENABLED(FIT_PRINT))
+// return;
/* Mandatory properties */
ret = fit_get_desc(fit, image_noffset, &desc);
@@ -659,6 +661,7 @@ int fit_image_get_node(const void *fit, const char *image_uname)
{
int noffset, images_noffset;
+ printf("fit_image_get_node ... starts (image_uname: %s)\n", image_uname);
images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
if (images_noffset < 0) {
debug("Can't find images parent node '%s' (%s)\n",
@@ -1829,6 +1832,7 @@ int fit_conf_get_node(const void *fit, const char *conf_uname)
const char *s;
char *conf_uname_copy = NULL;
+ debug("fit_conf_get_node ... starts\n");
confs_noffset = fdt_path_offset(fit, FIT_CONFS_PATH);
if (confs_noffset < 0) {
debug("Can't find configurations parent node '%s' (%s)\n",
@@ -1876,6 +1880,7 @@ int fit_conf_get_node(const void *fit, const char *conf_uname)
conf_uname, fdt_strerror(noffset));
}
+ debug("fit_conf_get_node ... noffset: %d\n", noffset);
free(conf_uname_copy);
return noffset;
@@ -1894,10 +1899,12 @@ int fit_conf_get_prop_node_index(const void *fit, int noffset,
int len;
/* get kernel image unit name from configuration kernel property */
+ printf("attributes => noffset: %d - index: %d - prop_name: %s\n", noffset, index, prop_name);
uname = fdt_stringlist_get(fit, noffset, prop_name, index, &len);
if (uname == NULL)
return len;
+ printf("ret uname: %s\n", uname);
return fit_image_get_node(fit, uname);
}
@@ -1905,22 +1912,28 @@ int fit_conf_get_prop_node(const void *fit, int noffset, const char *prop_name,
enum image_phase_t sel_phase)
{
int i, count;
-
- if (sel_phase == IH_PHASE_NONE)
+ printf("fit_conf_get_prop_node ... starts\n");
+ if (sel_phase == IH_PHASE_NONE) {
+ printf("fit_conf_get_prop_node ... sel_phase: %d\n", sel_phase);
return fit_conf_get_prop_node_index(fit, noffset, prop_name, 0);
+ }
count = fit_conf_get_prop_node_count(fit, noffset, prop_name);
- if (count < 0)
+ if (count < 0) {
+ printf("fit_conf_get_prop_node ... count: %d\n", count);
return count;
-
+ }
+ printf("fit_conf_get_prop_node - noffset: %d - count: %d - prop_name: %s\n", noffset, count, prop_name);
/* check each image in the list */
for (i = 0; i < count; i++) {
enum image_phase_t phase;
int ret, node;
+ printf("fit_conf_get_prop_node_index ... starts\n");
node = fit_conf_get_prop_node_index(fit, noffset, prop_name, i);
+ printf("fit_conf_get_prop_node_index ... ends && fit_conf_get_phase ... starts\n");
ret = fit_image_get_phase(fit, node, &phase);
-
+ printf("fit_image_get_phase ... ends && node: %d - ret: %d\n", node, ret);
/* if the image is for any phase, let's use it */
if (ret == -ENOENT)
return node;
@@ -2071,6 +2084,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
const char *prop_name;
int ret;
+ printf("fit_image_load (ph_type: %d - image_type: %d)...\n", ph_type, image_type);
fit = map_sysmem(addr, 0);
fit_uname = fit_unamep ? *fit_unamep : NULL;
fit_uname_config = fit_uname_configp ? *fit_uname_configp : NULL;
@@ -2104,6 +2118,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
} else {
cfg_noffset = fit_conf_get_node(fit, fit_uname_config);
}
+ printf("cfg_noffset : %d\n", cfg_noffset);
if (cfg_noffset < 0) {
puts("Could not find configuration node\n");
bootstage_error(bootstage_id +
@@ -2130,13 +2145,16 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
bootstage_mark(BOOTSTAGE_ID_FIT_CONFIG);
+ printf("attributes => cfg_noffset: %d - prop_name: %s\n", cfg_noffset, prop_name);
noffset = fit_conf_get_prop_node(fit, cfg_noffset, prop_name,
image_ph_phase(ph_type));
+ printf("attributes => noffset: %d\n", noffset);
fit_uname = fit_get_name(fit, noffset, NULL);
}
if (noffset < 0) {
printf("Could not find subimage node type '%s'\n", prop_name);
bootstage_error(bootstage_id + BOOTSTAGE_SUB_SUBNODE);
+ fit_print_contents(fit);
return -ENOENT;
}

View File

@@ -27,18 +27,19 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000
# CONFIG_SYS_SPL_MALLOC=y
# CONFIG_SYS_SPL_MALLOC_SIZE=0x800000
CONFIG_SPL_FIT_IMAGE_TINY=y
# CONFIG_SPL_FIT_IMAGE_TINY=y
CONFIG_SPL_ETH=y
# CONFIG_SPL_FS_EXT4 is not set
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img"
CONFIG_SPL_MTD_SUPPORT=y
# CONFIG_SPL_MTD_SUPPORT is not set
CONFIG_SPL_MUSB_NEW=n
CONFIG_SPL_NAND_DRIVERS=y
CONFIG_SPL_NAND_ECC=y
CONFIG_SPL_NAND_BASE=y
CONFIG_SPL_NET=y
# CONFIG_SPL_NAND_SUPPORT is not set
# CONFIG_SPL_NAND_DRIVERS is not set
# CONFIG_SPL_NAND_ECC is not set
# CONFIG_SPL_NAND_BASE is not set
# CONFIG_SPL_NET is not set
CONFIG_SPL_NET_VCI_STRING="AM335x U-Boot SPL"
CONFIG_SPL_OS_BOOT=n
# CONFIG_SPL_OS_BOOT is not set
CONFIG_SYS_NAND_SPL_KERNEL_OFFS=0x200000
CONFIG_SPL_FALCON_BOOT_MMCSD=n
CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700
@@ -152,5 +153,6 @@ CONFIG_SPL_SHA512=y
#CONFIG_FIT_SIGNATURE=y
#CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000
#CONFIG_SPL_FIT_FULL_CHECK=y
#CONFIG_SPL_FIT_SIGNATURE=y
#CONFIG_SPL_FIT_SIGNATURE_MAX_SIZE=0x10000000
CONFIG_SPL_FIT_SIGNATURE=y
CONFIG_SPL_FIT_SIGNATURE_MAX_SIZE=0x10000000
CONFIG_SPL_LOAD_FIT_FULL=y