summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2022-05-23 13:52:53 -0400
committerTom Rini <[email protected]>2022-05-23 13:52:53 -0400
commitc04a418d520005d2cbad5d5f9e3d52dfe58f0e00 (patch)
treefba72973e7f91d3375c42c5e854dc0c90cf1583f /cmd
parent004d30c786056d443d40428c4b1c11e2f8f0bc32 (diff)
parentfaa6ce6061a03617785310ccbc5436a56cce4ab4 (diff)
Merge branch '2022-05-23-regression-fixes'
- Fix PowerPC NOR booting, important SPI uclass fixes/updates, gic_v2 fix when CPU is not in EL3, fsl_esdhc_spl fix, and squashfs fix for linking on some architectures, and fix phy_string_for_interface
Diffstat (limited to 'cmd')
-rw-r--r--cmd/sf.c15
-rw-r--r--cmd/spi.c4
2 files changed, 13 insertions, 6 deletions
diff --git a/cmd/sf.c b/cmd/sf.c
index 8bdebd9fd8f..8713736b2a3 100644
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -91,6 +91,7 @@ static int do_spi_flash_probe(int argc, char *const argv[])
unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
unsigned int mode = CONFIG_SF_DEFAULT_MODE;
char *endp;
+ bool use_dt = true;
#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
struct udevice *new, *bus_dev;
int ret;
@@ -117,11 +118,13 @@ static int do_spi_flash_probe(int argc, char *const argv[])
speed = simple_strtoul(argv[2], &endp, 0);
if (*argv[2] == 0 || *endp != 0)
return -1;
+ use_dt = false;
}
if (argc >= 4) {
mode = hextoul(argv[3], &endp);
if (*argv[3] == 0 || *endp != 0)
return -1;
+ use_dt = false;
}
#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
@@ -131,14 +134,18 @@ static int do_spi_flash_probe(int argc, char *const argv[])
device_remove(new, DM_REMOVE_NORMAL);
}
flash = NULL;
- ret = spi_flash_probe_bus_cs(bus, cs, speed, mode, &new);
- if (ret) {
+ if (use_dt) {
+ spi_flash_probe_bus_cs(bus, cs, &new);
+ flash = dev_get_uclass_priv(new);
+ } else {
+ flash = spi_flash_probe(bus, cs, speed, mode);
+ }
+
+ if (!flash) {
printf("Failed to initialize SPI flash at %u:%u (error %d)\n",
bus, cs, ret);
return 1;
}
-
- flash = dev_get_uclass_priv(new);
#else
if (flash)
spi_flash_free(flash);
diff --git a/cmd/spi.c b/cmd/spi.c
index 6dc32678da1..454ebe37d75 100644
--- a/cmd/spi.c
+++ b/cmd/spi.c
@@ -46,8 +46,8 @@ static int do_spi_xfer(int bus, int cs)
str = strdup(name);
if (!str)
return -ENOMEM;
- ret = spi_get_bus_and_cs(bus, cs, freq, mode, "spi_generic_drv",
- str, &dev, &slave);
+ ret = _spi_get_bus_and_cs(bus, cs, freq, mode, "spi_generic_drv",
+ str, &dev, &slave);
if (ret)
return ret;
#else