From a6cd597a78dd9b7fcaba6fe4891f29e86646541b Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Sun, 1 Dec 2019 17:45:18 +0100 Subject: drivers: pci: ignore disabled devices PCI devices may be disabled in the device tree. Devices which are probed by the device tree handle the "status" property and are skipped if disabled. Devices which are probed by the PCI enumeration don't check that property. Fix it. Signed-off-by: Michael Walle Reviewed-by: Alex Marginean Tested-by: Alex Marginean Reviewed-by: Bin Meng --- drivers/pci/pci-uclass.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers') diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 896cb6b23a1..fab20fc60e5 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -677,6 +677,11 @@ static int pci_find_and_bind_driver(struct udevice *parent, /* Determine optional OF node */ pci_dev_find_ofnode(parent, bdf, &node); + if (ofnode_valid(node) && !ofnode_is_available(node)) { + debug("%s: Ignoring disabled device\n", __func__); + return -EPERM; + } + start = ll_entry_start(struct pci_driver_entry, pci_driver_entry); n_ents = ll_entry_count(struct pci_driver_entry, pci_driver_entry); for (entry = start; entry != start + n_ents; entry++) { -- cgit v1.3.1 From 2464b229b5ab281d8698aa0f4d4de6d4d3fabf7d Mon Sep 17 00:00:00 2001 From: Jorge Ramirez-Ortiz Date: Tue, 26 Nov 2019 17:19:34 +0100 Subject: drivers: optee: rpmb: fix returning CID to TEE The mmc CID value is one of the input parameters used to provision the RPMB key. The trusted execution environment expects this value to be specified in big endian format. Before this fix, on little endian systems, the value returned by the linux kernel mmc driver differed from the one returned by u-boot. This meant that if linux provisioned the RPMB key, u-boot would not have access to the partition (and the other way around). Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Jens Wiklander --- drivers/tee/optee/rpmb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/tee/optee/rpmb.c b/drivers/tee/optee/rpmb.c index 955155b3f8b..cf1ce77e6e1 100644 --- a/drivers/tee/optee/rpmb.c +++ b/drivers/tee/optee/rpmb.c @@ -98,6 +98,7 @@ static struct mmc *get_mmc(struct optee_private *priv, int dev_id) static u32 rpmb_get_dev_info(u16 dev_id, struct rpmb_dev_info *info) { struct mmc *mmc = find_mmc_device(dev_id); + int i; if (!mmc) return TEE_ERROR_ITEM_NOT_FOUND; @@ -105,7 +106,9 @@ static u32 rpmb_get_dev_info(u16 dev_id, struct rpmb_dev_info *info) if (!mmc->ext_csd) return TEE_ERROR_GENERIC; - memcpy(info->cid, mmc->cid, sizeof(info->cid)); + for (i = 0; i < ARRAY_SIZE(mmc->cid); i++) + ((u32 *) info->cid)[i] = cpu_to_be32(mmc->cid[i]); + info->rel_wr_sec_c = mmc->ext_csd[222]; info->rpmb_size_mult = mmc->ext_csd[168]; info->ret_code = RPMB_CMD_GET_DEV_INFO_RET_OK; -- cgit v1.3.1 From 9f67b56772c2c25050fadf0766174c3c35a49995 Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Sun, 10 Nov 2019 08:23:15 -0800 Subject: Fix typo in macros, "FIRMEWARE" -> "FIRMWARE" Signed-off-by: Thomas Hebb --- arch/arm/cpu/armv8/Kconfig | 2 +- arch/arm/cpu/armv8/sec_firmware.c | 8 ++++---- drivers/net/pfe_eth/pfe_firmware.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig index 92a2b58ed46..16c83e86149 100644 --- a/arch/arm/cpu/armv8/Kconfig +++ b/arch/arm/cpu/armv8/Kconfig @@ -65,7 +65,7 @@ config ARMV8_SEC_FIRMWARE_SUPPORT - Address of secure firmware. - Address to hold the return address from secure firmware. - Secure firmware FIT image related information. - Such as: SEC_FIRMWARE_FIT_IMAGE and SEC_FIRMEWARE_FIT_CNF_NAME + Such as: SEC_FIRMWARE_FIT_IMAGE and SEC_FIRMWARE_FIT_CNF_NAME - The target exception level that secure monitor firmware will return to. diff --git a/arch/arm/cpu/armv8/sec_firmware.c b/arch/arm/cpu/armv8/sec_firmware.c index 4dcda70b914..95ea57d571b 100644 --- a/arch/arm/cpu/armv8/sec_firmware.c +++ b/arch/arm/cpu/armv8/sec_firmware.c @@ -29,8 +29,8 @@ phys_addr_t sec_firmware_addr; #ifndef SEC_FIRMWARE_FIT_IMAGE #define SEC_FIRMWARE_FIT_IMAGE "firmware" #endif -#ifndef SEC_FIRMEWARE_FIT_CNF_NAME -#define SEC_FIRMEWARE_FIT_CNF_NAME "config-1" +#ifndef SEC_FIRMWARE_FIT_CNF_NAME +#define SEC_FIRMWARE_FIT_CNF_NAME "config-1" #endif #ifndef SEC_FIRMWARE_TARGET_EL #define SEC_FIRMWARE_TARGET_EL 2 @@ -44,7 +44,7 @@ static int sec_firmware_get_data(const void *sec_firmware_img, char *desc; int ret; - conf_node_name = SEC_FIRMEWARE_FIT_CNF_NAME; + conf_node_name = SEC_FIRMWARE_FIT_CNF_NAME; conf_node_off = fit_conf_get_node(sec_firmware_img, conf_node_name); if (conf_node_off < 0) { @@ -124,7 +124,7 @@ static int sec_firmware_check_copy_loadable(const void *sec_firmware_img, const char *name, *str, *type; int len; - conf_node_name = SEC_FIRMEWARE_FIT_CNF_NAME; + conf_node_name = SEC_FIRMWARE_FIT_CNF_NAME; conf_node_off = fit_conf_get_node(sec_firmware_img, conf_node_name); if (conf_node_off < 0) { diff --git a/drivers/net/pfe_eth/pfe_firmware.c b/drivers/net/pfe_eth/pfe_firmware.c index adb2d06010c..e4563f192bf 100644 --- a/drivers/net/pfe_eth/pfe_firmware.c +++ b/drivers/net/pfe_eth/pfe_firmware.c @@ -16,7 +16,7 @@ #include #endif -#define PFE_FIRMEWARE_FIT_CNF_NAME "config@1" +#define PFE_FIRMWARE_FIT_CNF_NAME "config@1" static const void *pfe_fit_addr = (void *)CONFIG_SYS_LS_PFE_FW_ADDR; @@ -99,7 +99,7 @@ static int pfe_get_fw(const void **data, char *desc; int ret = 0; - conf_node_name = PFE_FIRMEWARE_FIT_CNF_NAME; + conf_node_name = PFE_FIRMWARE_FIT_CNF_NAME; conf_node_off = fit_conf_get_node(pfe_fit_addr, conf_node_name); if (conf_node_off < 0) { -- cgit v1.3.1