[U-Boot] [PATCH 1/3] image: Add TI PMMC image type

Add a new image type representing TI Power Management Micro-Controller (PMMC) Firmware image type.
Signed-off-by: Andrew F. Davis afd@ti.com --- common/image.c | 1 + include/image.h | 1 + 2 files changed, 2 insertions(+)
diff --git a/common/image.c b/common/image.c index 0f88984f2d..1f6885cb85 100644 --- a/common/image.c +++ b/common/image.c @@ -167,6 +167,7 @@ static const table_entry_t uimage_type[] = { { IH_TYPE_FPGA, "fpga", "FPGA Image" }, { IH_TYPE_TEE, "tee", "Trusted Execution Environment Image",}, { IH_TYPE_FIRMWARE_IVT, "firmware_ivt", "Firmware with HABv4 IVT" }, + { IH_TYPE_PMMC, "pmmc", "TI Power Management Micro-Controller Firmware",}, { -1, "", "", }, };
diff --git a/include/image.h b/include/image.h index c6f1513220..a251faf8e3 100644 --- a/include/image.h +++ b/include/image.h @@ -269,6 +269,7 @@ enum { IH_TYPE_VYBRIDIMAGE, /* VYBRID .vyb Image */ IH_TYPE_TEE, /* Trusted Execution Environment OS Image */ IH_TYPE_FIRMWARE_IVT, /* Firmware Image with HABv4 IVT */ + IH_TYPE_PMMC, /* TI Power Management Micro-Controller Firmware */
IH_TYPE_COUNT, /* Number of image types */ };

The PMMC firmware should be bundled into a FIT image on HS devices to allow authentication/decryption, add a handler to process this PMMC firmware.
Signed-off-by: Andrew F. Davis afd@ti.com --- board/ti/ks2_evm/board_k2g.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c index 21605762ef..d4d582cb85 100644 --- a/board/ti/ks2_evm/board_k2g.c +++ b/board/ti/ks2_evm/board_k2g.c @@ -13,6 +13,7 @@ #include <asm/arch/mmc_host_def.h> #include <fdtdec.h> #include <i2c.h> +#include <remoteproc.h> #include "mux-k2g.h" #include "../common/board_detect.h"
@@ -353,3 +354,23 @@ int get_num_eth_ports(void) return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t); } #endif + +#ifdef CONFIG_TI_SECURE_DEVICE +void board_pmmc_image_process(ulong pmmc_image, size_t pmmc_size) +{ + int id = getenv_ulong("dev_pmmc", 10, 0); + int ret; + + if (!rproc_is_initialized()) + rproc_init(); + + ret = rproc_load(id, pmmc_image, pmmc_size); + printf("Load Remote Processor %d with data@addr=0x%08lx %u bytes:%s\n", + id, pmmc_image, pmmc_size, ret ? " Failed!" : " Success!"); + + if (!ret) + rproc_start(id); +} + +U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_PMMC, board_pmmc_image_process); +#endif

On Mon, Jul 31, 2017 at 10:58:21AM -0500, Andrew F. Davis wrote:
The PMMC firmware should be bundled into a FIT image on HS devices to allow authentication/decryption, add a handler to process this PMMC firmware.
Signed-off-by: Andrew F. Davis afd@ti.com
Applied to u-boot/master, thanks!

The PMMC firmware should be bundled with the FIT image for HS devices, remove the steps that load and install this firmware outside of FIT.
Signed-off-by: Andrew F. Davis afd@ti.com --- include/configs/k2g_evm.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/configs/k2g_evm.h b/include/configs/k2g_evm.h index 1117e5e5dd..9117cda24c 100644 --- a/include/configs/k2g_evm.h +++ b/include/configs/k2g_evm.h @@ -69,7 +69,6 @@ "run envboot; " \ "run run_mon_hs; " \ "run init_${boot}; " \ - "run set_name_pmmc get_pmmc_${boot} run_pmmc; " \ "run get_fit_${boot}; " \ "bootm ${fit_loadaddr}#${name_fdt}" #endif

On Mon, Jul 31, 2017 at 10:58:22AM -0500, Andrew F. Davis wrote:
The PMMC firmware should be bundled with the FIT image for HS devices, remove the steps that load and install this firmware outside of FIT.
Signed-off-by: Andrew F. Davis afd@ti.com
Applied to u-boot/master, thanks!

On Mon, Jul 31, 2017 at 10:58:20AM -0500, Andrew F. Davis wrote:
Add a new image type representing TI Power Management Micro-Controller (PMMC) Firmware image type.
Signed-off-by: Andrew F. Davis afd@ti.com
Applied to u-boot/master, thanks!
participants (2)
-
Andrew F. Davis
-
Tom Rini