summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/ahci.c8
-rw-r--r--drivers/clk/Kconfig1
-rw-r--r--drivers/core/Kconfig2
-rw-r--r--drivers/i2c/muxes/i2c-mux-gpio.c2
-rw-r--r--drivers/i2c/mxc_i2c.c7
-rw-r--r--drivers/misc/Kconfig2
-rw-r--r--drivers/misc/i2c_eeprom.c8
-rw-r--r--drivers/nvme/nvme.c29
-rw-r--r--drivers/phy/Kconfig2
-rw-r--r--drivers/serial/Kconfig4
10 files changed, 43 insertions, 22 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index e3135bb75f..9a08575053 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1167,6 +1167,14 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
if (ret)
return ret;
+ /*
+ * scsi_scan_dev() scans devices up-to the number of max_id.
+ * Update max_id if the number of detected ports exceeds max_id.
+ * This allows SCSI to scan all detected ports.
+ */
+ uc_plat->max_id = max_t(unsigned long, uc_priv->n_ports,
+ uc_plat->max_id);
+
return 0;
}
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 82cd8f623c..95fe0aea2c 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -48,6 +48,7 @@ config CLK_BOSTON
config SPL_CLK_CCF
bool "SPL Common Clock Framework [CCF] support "
+ depends on SPL
help
Enable this option if you want to (re-)use the Linux kernel's Common
Clock Framework [CCF] code in U-Boot's SPL.
diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig
index 2d195ae35e..3b95b5387b 100644
--- a/drivers/core/Kconfig
+++ b/drivers/core/Kconfig
@@ -92,7 +92,7 @@ config DM_SEQ_ALIAS
config SPL_DM_SEQ_ALIAS
bool "Support numbered aliases in device tree in SPL"
- depends on DM
+ depends on SPL_DM
default n
help
Most boards will have a '/aliases' node containing the path to
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
index 28f640042f..e8b124f4f5 100644
--- a/drivers/i2c/muxes/i2c-mux-gpio.c
+++ b/drivers/i2c/muxes/i2c-mux-gpio.c
@@ -106,7 +106,7 @@ static int i2c_mux_gpio_probe(struct udevice *dev)
}
ret = gpio_request_list_by_name(dev, "mux-gpios", gpios, mux->n_gpios,
- GPIOD_IS_OUT_ACTIVE);
+ GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
if (ret <= 0) {
dev_err(dev, "Failed to request mux-gpios\n");
return ret;
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 73b9807598..20f6dc4ecb 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -917,13 +917,6 @@ static int mxc_i2c_probe(struct udevice *bus)
}
}
- ret = i2c_idle_bus(i2c_bus);
- if (ret < 0) {
- /* Disable clk */
- enable_i2c_clk(0, bus->seq);
- return ret;
- }
-
/*
* Pinmux settings are in board file now, until pinmux is supported,
* we can set pinmux here in probe function.
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index cb8b5c04db..8037b6ee2d 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -88,6 +88,7 @@ config CROS_EC
config SPL_CROS_EC
bool "Enable Chrome OS EC in SPL"
+ depends on SPL
help
Enable access to the Chrome OS EC in SPL. This is a separate
microcontroller typically available on a SPI bus on Chromebooks. It
@@ -97,6 +98,7 @@ config SPL_CROS_EC
config TPL_CROS_EC
bool "Enable Chrome OS EC in TPL"
+ depends on TPL
help
Enable access to the Chrome OS EC in TPL. This is a separate
microcontroller typically available on a SPI bus on Chromebooks. It
diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c
index f25d054007..8f2349ad5a 100644
--- a/drivers/misc/i2c_eeprom.c
+++ b/drivers/misc/i2c_eeprom.c
@@ -84,6 +84,14 @@ static int i2c_eeprom_std_ofdata_to_platdata(struct udevice *dev)
static int i2c_eeprom_std_probe(struct udevice *dev)
{
+ u8 test_byte;
+ int ret;
+
+ /* Verify that the chip is functional */
+ ret = i2c_eeprom_read(dev, 0, &test_byte, 1);
+ if (ret)
+ return -ENODEV;
+
return 0;
}
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index d4965e2ef6..47f101e280 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -73,6 +73,9 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2,
u64 *prp_pool;
int length = total_len;
int i, nprps;
+ u32 prps_per_page = (page_size >> 3) - 1;
+ u32 num_pages;
+
length -= (page_size - offset);
if (length <= 0) {
@@ -89,15 +92,20 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2,
}
nprps = DIV_ROUND_UP(length, page_size);
+ num_pages = DIV_ROUND_UP(nprps, prps_per_page);
if (nprps > dev->prp_entry_num) {
free(dev->prp_pool);
- dev->prp_pool = malloc(nprps << 3);
+ /*
+ * Always increase in increments of pages. It doesn't waste
+ * much memory and reduces the number of allocations.
+ */
+ dev->prp_pool = memalign(page_size, num_pages * page_size);
if (!dev->prp_pool) {
printf("Error: malloc prp_pool fail\n");
return -ENOMEM;
}
- dev->prp_entry_num = nprps;
+ dev->prp_entry_num = prps_per_page * num_pages;
}
prp_pool = dev->prp_pool;
@@ -788,14 +796,6 @@ static int nvme_probe(struct udevice *udev)
}
memset(ndev->queues, 0, NVME_Q_NUM * sizeof(struct nvme_queue *));
- ndev->prp_pool = malloc(MAX_PRP_POOL);
- if (!ndev->prp_pool) {
- ret = -ENOMEM;
- printf("Error: %s: Out of memory!\n", udev->name);
- goto free_nvme;
- }
- ndev->prp_entry_num = MAX_PRP_POOL >> 3;
-
ndev->cap = nvme_readq(&ndev->bar->cap);
ndev->q_depth = min_t(int, NVME_CAP_MQES(ndev->cap) + 1, NVME_Q_DEPTH);
ndev->db_stride = 1 << NVME_CAP_STRIDE(ndev->cap);
@@ -805,6 +805,15 @@ static int nvme_probe(struct udevice *udev)
if (ret)
goto free_queue;
+ /* Allocate after the page size is known */
+ ndev->prp_pool = memalign(ndev->page_size, MAX_PRP_POOL);
+ if (!ndev->prp_pool) {
+ ret = -ENOMEM;
+ printf("Error: %s: Out of memory!\n", udev->name);
+ goto free_nvme;
+ }
+ ndev->prp_entry_num = MAX_PRP_POOL >> 3;
+
ret = nvme_setup_io_queues(ndev);
if (ret)
goto free_queue;
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 3942f035eb..02312273e2 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -19,7 +19,7 @@ config PHY
config SPL_PHY
bool "PHY Core in SPL"
- depends on DM
+ depends on DM && SPL
help
PHY support in SPL.
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 8a447fd6e3..ae2d819ba9 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -45,7 +45,7 @@ config SERIAL_PRESENT
config SPL_SERIAL_PRESENT
bool "Provide a serial driver in SPL"
- depends on DM_SERIAL
+ depends on DM_SERIAL && SPL
default y
help
In very space-constrained devices even the full UART driver is too
@@ -55,7 +55,7 @@ config SPL_SERIAL_PRESENT
config TPL_SERIAL_PRESENT
bool "Provide a serial driver in TPL"
- depends on DM_SERIAL
+ depends on DM_SERIAL && TPL
default y
help
In very space-constrained devices even the full UART driver is too