diff options
author | Simon Glass <sjg@chromium.org> | 2016-02-24 16:14:54 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-02-26 15:53:10 (GMT) |
commit | 20f655da11cdddfeb0814197f9b3c71d4d297061 (patch) | |
tree | e4ac8dc490d48ce39131a36282eb04bace040735 /drivers | |
parent | 651490212a43645434db17c1afc1831048e03800 (diff) | |
download | u-boot-20f655da11cdddfeb0814197f9b3c71d4d297061.tar.xz |
sandbox: spi: Add more debugging to SPI emulation
Add a little more debugging to help when things go wrong.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jteki@openedev.com>
Tested-by: Jagan Teki <jteki@openedev.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/spi/sandbox.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c index 895604d..ec07be7 100644 --- a/drivers/mtd/spi/sandbox.c +++ b/drivers/mtd/spi/sandbox.c @@ -142,13 +142,15 @@ static int sandbox_sf_probe(struct udevice *dev) if (bus->seq < CONFIG_SANDBOX_SPI_MAX_BUS) spec = state->spi[bus->seq][cs].spec; if (!spec) { + debug("%s: No spec found for bus %d, cs %d\n", + __func__, bus->seq, cs); ret = -ENOENT; goto error; } file = strchr(spec, ':'); if (!file) { - printf("sandbox_sf: unable to parse file\n"); + printf("%s: unable to parse file\n", __func__); ret = -EINVAL; goto error; } @@ -174,7 +176,7 @@ static int sandbox_sf_probe(struct udevice *dev) break; } if (!data->name) { - printf("sandbox_sf: unknown flash '%*s'\n", (int)idname_len, + printf("%s: unknown flash '%*s'\n", __func__, (int)idname_len, spec); ret = -EINVAL; goto error; @@ -186,7 +188,7 @@ static int sandbox_sf_probe(struct udevice *dev) sbsf->fd = os_open(pdata->filename, 02); if (sbsf->fd == -1) { free(sbsf); - printf("sandbox_sf: unable to open file '%s'\n", + printf("%s: unable to open file '%s'\n", __func__, pdata->filename); ret = -EIO; goto error; @@ -553,6 +555,9 @@ static int sandbox_cmdline_cb_spi_sf(struct sandbox_state *state, * yet. Perhaps we can figure something out. */ state->spi[bus][cs].spec = spec; + debug("%s: Setting up spec '%s' for bus %ld, cs %ld\n", __func__, + spec, bus, cs); + return 0; } SANDBOX_CMDLINE_OPT(spi_sf, 1, "connect a SPI flash: <bus>:<cs>:<id>:<file>"); @@ -671,6 +676,8 @@ int dm_scan_other(bool pre_reloc_only) __func__, busnum, cs); return ret; } + debug("%s: Setting up spec '%s' for bus %d, cs %d\n", + __func__, spec, busnum, cs); } } } |