@@ -48,10 +48,8 @@ int fit_find_config_node(const void *fdt)
node = fdt_next_subnode(fdt, node)) {
name = fdt_getprop(fdt, node, "description", &len);
if (!name) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: Missing FDT description in DTB\n",
__func__);
-#endif
return -EINVAL;
}
@@ -577,12 +577,10 @@ static int boot_from_devices(struct spl_image_info *spl_image,
struct spl_image_loader *loader;
loader = spl_ll_find_loader(spl_boot_list[i]);
-#if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
if (loader)
printf("Trying to boot from %s\n", loader->name);
else
puts(SPL_TPL_PROMPT "Unsupported Boot Device!\n");
-#endif
if (loader && !spl_load_image(spl_image, loader)) {
spl_image->boot_device = spl_boot_list[i];
return 0;
@@ -28,9 +28,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
err = ext4fs_mount(0);
if (!err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: ext4fs mount err - %d\n", __func__, err);
-#endif
goto end;
}
@@ -54,11 +52,9 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
err = ext4fs_read((char *)spl_image->load_addr, 0, filelen, &actlen);
end:
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
if (err < 0)
printf("%s: error reading image %s, err - %d\n",
__func__, filename, err);
-#endif
return err < 0;
}
@@ -81,9 +77,7 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image,
err = ext4fs_mount(0);
if (!err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: ext4fs mount err - %d\n", __func__, err);
-#endif
return -1;
}
#if defined(CONFIG_SPL_ENV_SUPPORT)
@@ -126,10 +120,8 @@ defaults:
err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, 0, filelen, &actlen);
if (err < 0) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: error reading image %s, err - %d\n",
__func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
-#endif
return -1;
}
@@ -28,9 +28,7 @@ static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
err = fat_register_device(block_dev, partition);
if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: fat register err - %d\n", __func__, err);
-#endif
return err;
}
@@ -102,11 +100,9 @@ int spl_load_image_fat(struct spl_image_info *spl_image,
}
end:
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
if (err <= 0)
printf("%s: error reading image %s, err - %d\n",
__func__, filename, err);
-#endif
return (err <= 0);
}
@@ -152,10 +148,8 @@ defaults:
err = file_fat_read(CONFIG_SPL_FS_LOAD_ARGS_NAME,
(void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
if (err <= 0) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: error reading image %s, err - %d\n",
__func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
-#endif
return -1;
}
@@ -95,9 +95,7 @@ int mmc_load_image_raw_sector(struct spl_image_info *spl_image,
end:
if (ret) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
puts("mmc_load_image_raw_sector: mmc block read error\n");
-#endif
return -1;
}
@@ -114,9 +112,7 @@ static int spl_mmc_get_device_index(u32 boot_device)
return 1;
}
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("spl: unsupported mmc boot device.\n");
-#endif
return -ENODEV;
}
@@ -135,18 +131,14 @@ static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
err = mmc_initialize(NULL);
#endif /* DM_MMC */
if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("spl: could not initialize mmc. error: %d\n", err);
-#endif
return err;
}
*mmcp = find_mmc_device(mmc_dev);
err = *mmcp ? 0 : -ENODEV;
if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("spl: could not find mmc device %d. error: %d\n",
mmc_dev, err);
-#endif
return err;
}
@@ -178,9 +170,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
err = part_get_info(mmc_get_blk_desc(mmc), partition, &info);
if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
puts("spl: partition error\n");
-#endif
return -1;
}
@@ -206,9 +196,7 @@ static int mmc_load_image_raw_os(struct spl_image_info *spl_image,
CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
(void *) CONFIG_SYS_SPL_ARGS_ADDR);
if (count != CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
puts("mmc_load_image_raw_os: mmc block read error\n");
-#endif
return -1;
}
#endif /* CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR */
@@ -336,9 +324,7 @@ int spl_mmc_load(struct spl_image_info *spl_image,
err = mmc_init(mmc);
if (err) {
mmc = NULL;
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("spl: mmc init failed with error: %d\n", err);
-#endif
return err;
}
}
@@ -367,9 +353,7 @@ int spl_mmc_load(struct spl_image_info *spl_image,
err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part);
if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
puts("spl: mmc partition switch failed\n");
-#endif
return err;
}
/* Fall through */
@@ -404,10 +388,8 @@ int spl_mmc_load(struct spl_image_info *spl_image,
return err;
break;
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
default:
puts("spl: mmc: wrong boot mode\n");
-#endif
}
return err;
@@ -66,9 +66,7 @@ static int spl_sata_load_image(struct spl_image_info *spl_image,
err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
#endif
if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("spl: sata init failed: err - %d\n", err);
-#endif
return err;
} else {
/* try to recognize storage devices immediately */
@@ -26,9 +26,7 @@ static int spl_usb_load_image(struct spl_image_info *spl_image,
usb_stop();
err = usb_init();
if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: usb init failed: err - %d\n", __func__, err);
-#endif
return err;
}
@@ -225,9 +225,7 @@ struct mmc *find_mmc_device(int dev_num)
ret = blk_find_device(IF_TYPE_MMC, dev_num, &dev);
if (ret) {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
printf("MMC Device %d not found\n", dev_num);
-#endif
return NULL;
}
@@ -250,9 +250,7 @@ int mmc_poll_for_busy(struct mmc *mmc, int timeout_ms)
break;
if (status & MMC_STATUS_MASK) {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
pr_err("Status Error: 0x%08x\n", status);
-#endif
return -ECOMM;
}
@@ -263,9 +261,7 @@ int mmc_poll_for_busy(struct mmc *mmc, int timeout_ms)
}
if (timeout_ms <= 0) {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
pr_err("Timeout waiting card ready\n");
-#endif
return -ETIMEDOUT;
}
@@ -405,9 +401,7 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,
cmd.cmdarg = 0;
cmd.resp_type = MMC_RSP_R1b;
if (mmc_send_cmd(mmc, &cmd, NULL)) {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
pr_err("mmc fail to send stop cmd\n");
-#endif
return 0;
}
}
@@ -445,10 +439,8 @@ ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
return 0;
if ((start + blkcnt) > block_dev->lba) {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
pr_err("MMC: block number 0x" LBAF " exceeds max(0x" LBAF ")\n",
start + blkcnt, block_dev->lba);
-#endif
return 0;
}
@@ -2811,9 +2803,7 @@ retry:
err = mmc_send_op_cond(mmc);
if (err) {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
pr_err("Card did not respond to voltage select!\n");
-#endif
return -EOPNOTSUPP;
}
}
@@ -2844,9 +2834,7 @@ int mmc_start_init(struct mmc *mmc)
#endif
if (no_card) {
mmc->has_init = 0;
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
pr_err("MMC: no card present\n");
-#endif
return -ENOMEDIUM;
}
@@ -46,9 +46,7 @@ struct mmc *find_mmc_device(int dev_num)
return m;
}
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
printf("MMC Device %d not found\n", dev_num);
-#endif
return NULL;
}
@@ -10,9 +10,8 @@ int tstc(void);
/* stdout */
#if !defined(CONFIG_SPL_BUILD) || \
- (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL_SUPPORT)) || \
- (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \
- defined(CONFIG_SPL_SERIAL_SUPPORT))
+ (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL_SUPPORT) && defined(CONFIG_TPL_LIBCOMMON_SUPPORT)) || \
+ (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT) && !defined(CONFIG_TPL_BUILD))
void putc(const char c);
void puts(const char *s);
int __printf(1, 2) printf(const char *fmt, ...);