diff options
author | Andrew Davis <afd@ti.com> | 2024-03-22 16:32:14 -0500 |
---|---|---|
committer | Ryan Eatmon <reatmon@ti.com> | 2024-03-22 21:05:02 -0500 |
commit | cae663c4ef35b6b13ead50d40c0432d2a3b13da3 (patch) | |
tree | ecd3b4782140879baf190338dedafcf46bb95175 | |
parent | 7b92b6efff5315a5d26eae4db1cae4d3193b6703 (diff) | |
download | meta-ti-cae663c4ef35b6b13ead50d40c0432d2a3b13da3.tar.gz |
meta-ti-bsp: Add Zephyr RTOS example firmware
Like the current TI-RTOS/MCU+ firmware, this is a prebuilt example
firmware for TI K3 remote cores. It is an alternative to the echo test
demo currently provided by "ti-rtos-firmware" recipe. In addition to
supporting rpmsg_client_sample just as the current firmware does, it
also provides:
* A serial console with shell on the MCU UART port
* A console over RPMSG at /dev/ttyRPMSG0
* Example usage of the MCU GPIO/I2C/SPI from this shell
* And many other Zephyr default enabled features..
It does all this using the Zephyr RTOS, a scalable real-time operating
system, optimized for resource constrained devices, and built with
security in mind. Zephyr is a Linux Foundation project. For more
info see here[0][1].
Zephyr firmware like this can also be built as part of the Yocto build
using meta-zephyr. Although this is a prebuilt currently, we intend
to build this from source to reduce meta-ti's dependence on firmware
blobs.
This currently works with the AM62 M4F. Support for additional SoCs
and cores is in progress.
[0] https://www.zephyrproject.org/
[1] https://docs.zephyrproject.org/latest/introduction/index.html
Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
-rw-r--r-- | meta-ti-bsp/recipes-bsp/zephyr-fw/zephyr-openamp-rsc-table-fw.bb | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-bsp/zephyr-fw/zephyr-openamp-rsc-table-fw.bb b/meta-ti-bsp/recipes-bsp/zephyr-fw/zephyr-openamp-rsc-table-fw.bb new file mode 100644 index 00000000..4efc99ac --- /dev/null +++ b/meta-ti-bsp/recipes-bsp/zephyr-fw/zephyr-openamp-rsc-table-fw.bb | |||
@@ -0,0 +1,83 @@ | |||
1 | SUMMARY = "Precompiled Zephyr OpenAMP example firmware for TI K3 devices" | ||
2 | |||
3 | # Name of this demo's firmware | ||
4 | FW_NAME = "zephyr_openamp_rsc_table.elf" | ||
5 | |||
6 | # List of cores for which this demo has a build | ||
7 | FW_CORES = "" | ||
8 | FW_CORES:am62xx = "mcu-m4f0_0" | ||
9 | |||
10 | # Note: Everything below is common to all our Zephyr firmwares and can be | ||
11 | # factored out to a common include file once we have more than one demo | ||
12 | |||
13 | LICENSE = "Apache-2.0" | ||
14 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | ||
15 | |||
16 | COMPATIBLE_MACHINE = "k3" | ||
17 | |||
18 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
19 | |||
20 | SRC_URI = "git://github.com/glneo/zephyr-firmware.git;protocol=https;branch=main" | ||
21 | SRCREV = "146d4f9b3930722d73685d600958f0b10ea97de2" | ||
22 | PV = "3.6.0" | ||
23 | #PR = "r1" | ||
24 | |||
25 | S = "${WORKDIR}/git" | ||
26 | |||
27 | FW_PLAT = "" | ||
28 | FW_PLAT:am62xx = "am62" | ||
29 | |||
30 | FW_INSTALL_DIR = "${nonarch_base_libdir}/firmware/zephyr/${FW_PLAT}" | ||
31 | |||
32 | do_install() { | ||
33 | for FW_CORE in ${FW_CORES} | ||
34 | do | ||
35 | install -d ${D}${FW_INSTALL_DIR}/${FW_CORE} | ||
36 | install -m 0644 ${S}/${FW_PLAT}/${FW_CORE}/${FW_NAME} ${D}${FW_INSTALL_DIR}/${FW_CORE} | ||
37 | done | ||
38 | } | ||
39 | |||
40 | # Make sure that lib/firmware, and all its contents are part of the package | ||
41 | FILES:${PN} = "${nonarch_base_libdir}/firmware" | ||
42 | |||
43 | # This is used to prevent the build system from stripping the firmwares | ||
44 | INHIBIT_PACKAGE_STRIP = "1" | ||
45 | INHIBIT_SYSROOT_STRIP = "1" | ||
46 | |||
47 | # This is used to prevent the build system from splitting out the firmware debug info into a separate file | ||
48 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||
49 | |||
50 | # This is a prebuilt with no external dependencies | ||
51 | INHIBIT_DEFAULT_DEPS = "1" | ||
52 | |||
53 | # Disable arch checking as firmware is likely to be a different arch from the Yocto build | ||
54 | INSANE_SKIP:${PN} += "arch" | ||
55 | |||
56 | # Zephyr-Firmware has no configure, compile, nor clean steps | ||
57 | do_configure[noexec] = "1" | ||
58 | do_compile[noexec] = "1" | ||
59 | CLEANBROKEN = "1" | ||
60 | |||
61 | inherit update-alternatives | ||
62 | |||
63 | python fw_generate_alternatives() { | ||
64 | for fw_core_name in d.getVar('FW_CORES').split(): | ||
65 | fw_plat = d.getVar('FW_PLAT') | ||
66 | fw_pkg_name = d.getVar('PN') | ||
67 | fw_core_name_full = (fw_plat + "-" + fw_core_name + "-fw") | ||
68 | |||
69 | # Create the firmware alternatives | ||
70 | d.appendVar('ALTERNATIVE:%s' % fw_pkg_name, (fw_core_name_full + " ")) | ||
71 | |||
72 | # Set up firmware alternatives link names | ||
73 | fw_alt_link = ("${nonarch_base_libdir}/firmware/" + fw_core_name_full) | ||
74 | d.setVarFlag('ALTERNATIVE_LINK_NAME', fw_core_name_full, fw_alt_link) | ||
75 | |||
76 | # Set up firmware alternatives link targets | ||
77 | fw_alt_target_rename = "${FW_INSTALL_DIR}/" + fw_core_name + "/${FW_NAME}" | ||
78 | d.setVarFlag('ALTERNATIVE_TARGET_%s' % fw_pkg_name, fw_core_name_full, fw_alt_target_rename) | ||
79 | } | ||
80 | |||
81 | do_package[prefuncs] += "fw_generate_alternatives" | ||
82 | |||
83 | ALTERNATIVE_PRIORITY = "20" | ||