diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2019-08-02 15:07:20 +0200 |
---|---|---|
committer | Patrice Chotard <patrice.chotard@st.com> | 2019-08-27 11:19:23 +0200 |
commit | a68ae8dceb1e82ffdfdbfb1d2c23603124c8e70a (patch) | |
tree | db386cd5cb650b6a07552bf901dc59805dee74f7 /board/st | |
parent | e7fabe75aec1380f7e2bd440a8477f0f15db528b (diff) | |
download | u-boot-a68ae8dceb1e82ffdfdbfb1d2c23603124c8e70a.zip u-boot-a68ae8dceb1e82ffdfdbfb1d2c23603124c8e70a.tar.gz u-boot-a68ae8dceb1e82ffdfdbfb1d2c23603124c8e70a.tar.bz2 |
stm32mp1: Add copro image support for M4 firmware
Implements copro image loading with FIT.
Once image is loaded with remoteproc,
the M4 coprocessor is automatically started.
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'board/st')
-rw-r--r-- | board/st/stm32mp1/stm32mp1.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 95e6078..fc14ad3 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -18,6 +18,7 @@ #include <mtd.h> #include <mtd_node.h> #include <phy.h> +#include <remoteproc.h> #include <reset.h> #include <syscon.h> #include <usb.h> @@ -891,3 +892,26 @@ int ft_board_setup(void *blob, bd_t *bd) return 0; } #endif + +static void board_copro_image_process(ulong fw_image, size_t fw_size) +{ + int ret, id = 0; /* Copro id fixed to 0 as only one coproc on mp1 */ + + if (!rproc_is_initialized()) + if (rproc_init()) { + printf("Remote Processor %d initialization failed\n", + id); + return; + } + + ret = rproc_load(id, fw_image, fw_size); + printf("Load Remote Processor %d with data@addr=0x%08lx %u bytes:%s\n", + id, fw_image, fw_size, ret ? " Failed!" : " Success!"); + + if (!ret) { + rproc_start(id); + env_set("copro_state", "booted"); + } +} + +U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_COPRO, board_copro_image_process); |