*/
#include <common.h>
+#include <bootstage.h>
#include <command.h>
+#include <cpu_func.h>
+#include <image.h>
+#include <log.h>
#include <part.h>
-int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
+int common_diskboot(struct cmd_tbl *cmdtp, const char *intf, int argc,
char *const argv[])
{
__maybe_unused int dev;
int part;
ulong addr = CONFIG_SYS_LOAD_ADDR;
ulong cnt;
- disk_partition_t info;
+ struct disk_partition info;
#if defined(CONFIG_LEGACY_IMAGE_FORMAT)
- image_header_t *hdr;
+ struct legacy_img_hdr *hdr;
#endif
struct blk_desc *dev_desc;
bootstage_mark(BOOTSTAGE_ID_IDE_ADDR);
if (argc > 1)
- addr = simple_strtoul(argv[1], NULL, 16);
+ addr = hextoul(argv[1], NULL);
bootstage_mark(BOOTSTAGE_ID_IDE_BOOT_DEVICE);
switch (genimg_get_format((void *) addr)) {
#if defined(CONFIG_LEGACY_IMAGE_FORMAT)
case IMAGE_FORMAT_LEGACY:
- hdr = (image_header_t *) addr;
+ hdr = (struct legacy_img_hdr *)addr;
bootstage_mark(BOOTSTAGE_ID_IDE_FORMAT);
/* This cannot be done earlier,
* we need complete FIT image in RAM first */
if (genimg_get_format((void *) addr) == IMAGE_FORMAT_FIT) {
- if (!fit_check_format(fit_hdr)) {
+ if (fit_check_format(fit_hdr, IMAGE_SIZE_INVAL)) {
bootstage_error(BOOTSTAGE_ID_IDE_FIT_READ);
puts("** Bad FIT image format\n");
return 1;
}
bootstage_mark(BOOTSTAGE_ID_IDE_FIT_READ_OK);
- fit_print_contents(fit_hdr);
}
#endif
flush_cache(addr, (cnt+1)*info.blksz);
/* Loading ok, update default load address */
- load_addr = addr;
+ image_load_addr = addr;
return bootm_maybe_autostart(cmdtp, argv[0]);
}