public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] ARM: k2g: Add FIT image handler for PMMC firmware
Date: Mon, 31 Jul 2017 10:58:21 -0500	[thread overview]
Message-ID: <20170731155822.6794-2-afd@ti.com> (raw)
In-Reply-To: <20170731155822.6794-1-afd@ti.com>

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 at 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
-- 
2.13.0

  reply	other threads:[~2017-07-31 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31 15:58 [U-Boot] [PATCH 1/3] image: Add TI PMMC image type Andrew F. Davis
2017-07-31 15:58 ` Andrew F. Davis [this message]
2017-09-13  2:28   ` [U-Boot] [U-Boot, 2/3] ARM: k2g: Add FIT image handler for PMMC firmware Tom Rini
2017-07-31 15:58 ` [U-Boot] [PATCH 3/3] configs: k2g_evm: Remove PMMC loading environment commands Andrew F. Davis
2017-09-13  2:28   ` [U-Boot] [U-Boot, " Tom Rini
2017-09-13  2:28 ` [U-Boot] [U-Boot,1/3] image: Add TI PMMC image type Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170731155822.6794-2-afd@ti.com \
    --to=afd@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox