Good afternoon,
I have a custom AM3351-based board and am able to successfully load and run SPL, and then U-boot using CCSv6 and SDK 3.00.00.04 following the guide here
http://processors.wiki.ti.com/index.php/Sitara_Linux_Training:_uboot_linux_debug_with_ccsv5
I've stepped through u-boot code and found that it is failing inside fdt_check_header, in particular, the function fdt_magic is not returning the expected value FDT_MAGIC. It seems this should be compiled into the ELF file during the build process. Do you have any suggestions as to why this would fail? I've tried specifying the standard EVM dts and also my own custom dts in the am335x_evm_defconfig configuration file, i.e.
CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
Here's a copy of fdt_check_header for reference:
if (fdt_magic(fdt) == FDT_MAGIC) {
/* Complete tree */
if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION)
return -FDT_ERR_BADVERSION;
if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION)
return -FDT_ERR_BADVERSION;
} else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
/* Unfinished sequential-write blob */
if (fdt_size_dt_struct(fdt) == 0)
return -FDT_ERR_BADSTATE;
} else {
return -FDT_ERR_BADMAGIC; // <-- RETURNING HERE
}
return 0;
}
int fdtdec_prepare_fdt(void) {
if (!gd->fdt_blob || ((uintptr_t)gd->fdt_blob & 3) ||
fdt_check_header(gd->fdt_blob)) {
...
puts("No valid device tree binary found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d <file.dtb>\n");
if (gd->fdt_blob) {
printf("fdt_blob=%p\n", gd->fdt_blob);
print_buffer((ulong)gd->fdt_blob, gd->fdt_blob, 4, 32, 0);
}
return -1;
}
return 0;
}
On a separate note, please help me enable the printf and puts functions to display to my console. It would be much faster debugging if I could see the console output. How can I enable logging to my UART0 console earlier in the u-boot program? I'm able to see the output from SPL so I know that my UART is configured properly during the SPL bootloader.
Thank you again for your support.
Best regards,
Chris