summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/firmware-imx/firmware-imx_8.25.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/firmware-imx/firmware-imx_8.25.bb')
-rw-r--r--recipes-bsp/firmware-imx/firmware-imx_8.25.bb171
1 files changed, 171 insertions, 0 deletions
diff --git a/recipes-bsp/firmware-imx/firmware-imx_8.25.bb b/recipes-bsp/firmware-imx/firmware-imx_8.25.bb
new file mode 100644
index 00000000..a4e17c99
--- /dev/null
+++ b/recipes-bsp/firmware-imx/firmware-imx_8.25.bb
@@ -0,0 +1,171 @@
1# Copyright (C) 2012-2016 Freescale Semiconductor
2# Copyright 2017-2021,2024 NXP
3# Copyright (C) 2018 O.S. Systems Software LTDA.
4SUMMARY = "Freescale i.MX firmware"
5DESCRIPTION = "Freescale i.MX firmware such as for the VPU"
6
7require ${BP}.inc
8
9PE = "1"
10
11inherit allarch
12
13IMX_USE_LINUX_FIRMWARE_SDMA ?= "1"
14
15do_install() {
16 install -d ${D}${nonarch_base_libdir}/firmware/imx
17
18 # SDMA Firmware section
19 install -d ${D}${nonarch_base_libdir}/firmware/imx/sdma
20 install -m 0644 ${S}/firmware/sdma/* ${D}${nonarch_base_libdir}/firmware/imx/sdma
21 # Define IMX_USE_LINUX_FIRMWARE_SDMA = "0" in layer.conf, machine.conf, local.conf
22 # or in .bbappend to use sdma-imx6q/7d.bin from here and not linux-firmware
23 if [ ${IMX_USE_LINUX_FIRMWARE_SDMA} -gt 0 ]
24 then
25 rm -f ${D}${nonarch_base_libdir}/firmware/imx/sdma/sdma-imx6q.bin
26 rm -f ${D}${nonarch_base_libdir}/firmware/imx/sdma/sdma-imx7d.bin
27 fi
28
29 # EASRC Firmware section
30 install -d ${D}${nonarch_base_libdir}/firmware/imx/easrc
31 install -m 0644 ${S}/firmware/easrc/* ${D}${nonarch_base_libdir}/firmware/imx/easrc/
32
33 # XCVR Firmware section
34 install -d ${D}${nonarch_base_libdir}/firmware/imx/xcvr
35 install -m 0644 ${S}/firmware/xcvr/* ${D}${nonarch_base_libdir}/firmware/imx/xcvr/
36
37 # XUVI Firmware section
38 install -d ${D}${nonarch_base_libdir}/firmware/imx/xuvi
39 install -m 0644 ${S}/firmware/xuvi/* ${D}${nonarch_base_libdir}/firmware/imx/xuvi/
40
41 # EPDC Firmware section
42 # NOTE:
43 # epdc_ED060XH2C1.fw file has .nonrestricted suffix in the source archive, hence it should
44 # be installed with a different name
45 install -d ${D}${nonarch_base_libdir}/firmware/imx/epdc
46 install -m 0644 ${S}/firmware/epdc/*.fw ${D}${nonarch_base_libdir}/firmware/imx/epdc/
47 install -m 0644 ${S}/firmware/epdc/epdc_ED060XH2C1.fw.nonrestricted ${D}${nonarch_base_libdir}/firmware/imx/epdc/epdc_ED060XH2C1.fw
48
49 # HDMI Firmware section
50 # NOTE:
51 # Only install pre-defined list of firmware files, since the source archive contains
52 # also HDMI binary files for imx8m derivatives, which are taken care of by another recipe
53 install -m 0644 ${S}/firmware/hdmi/cadence/hdmitxfw.bin ${D}${nonarch_base_libdir}/firmware
54 install -m 0644 ${S}/firmware/hdmi/cadence/hdmirxfw.bin ${D}${nonarch_base_libdir}/firmware
55 install -m 0644 ${S}/firmware/hdmi/cadence/dpfw.bin ${D}${nonarch_base_libdir}/firmware
56
57 # VPU Firmware section
58 # NOTE:
59 # Do the same thing as above for HDMI - only install a pre-defined list of firmware files,
60 # as some of other files are provided by packages from other recipes.
61 install -d ${D}${nonarch_base_libdir}/firmware/vpu
62 install -m 0644 ${S}/firmware/vpu/vpu_fw_imx*.bin ${D}${nonarch_base_libdir}/firmware/vpu
63 # Update i.MX8 vpu firmware path to align with kernel6.5+
64 install -d ${D}${nonarch_base_libdir}/firmware/amphion/vpu/
65 mv ${D}${nonarch_base_libdir}/firmware/vpu/vpu_fw_imx8* ${D}${nonarch_base_libdir}/firmware/amphion/vpu/
66 # Install i.MX 95 VPU firmware
67 install -m 0644 ${S}/firmware/vpu/wave633c_codec_fw.bin ${D}${nonarch_base_libdir}/firmware
68}
69
70#
71# This prepend is here to produce separate packages containing firmware,
72# which could be included separately based on the machine definition.
73#
74# It operates similar to the FILES mechanism by travesing through
75# ${D} + folder supplied as a first parameter, matches the regexp supplied
76# as second one, and for every file match - it creates a separate package,
77# which contains only files that matches the pattern.
78#
79python populate_packages:prepend() {
80 # CODA driver tries to locate VPU firmwares directly in ${nonarch_base_libdir}/firmware, to
81 # avoid fallback loading which is usually 40-60 seconds later after system boots up, let's
82 # create symbolic links in ${nonarch_base_libdir}/firmware for VPU firmwares.
83 def coda_vpu_links(file, pkg, pattern, format, basename):
84 # Only CODA VPU firmwares need this procedure
85 if 'imx8' in basename:
86 return
87
88 dir = os.path.dirname(file)
89 dir = os.path.abspath(os.path.join(dir, os.pardir))
90 cwd = os.getcwd()
91
92 os.chdir(dir)
93
94 name = os.path.basename(file)
95 os.symlink(os.path.join("vpu", name), name)
96
97 oldfiles = d.getVar('FILES:' + pkg)
98 newfile = os.path.join(d.getVar('nonarch_base_libdir'), "firmware", name)
99 d.setVar('FILES:' + pkg, oldfiles + " " + newfile)
100
101 os.chdir(cwd)
102
103
104 easrcdir = bb.data.expand('${nonarch_base_libdir}/firmware/imx/easrc', d)
105 do_split_packages(d, easrcdir, '^easrc-([^_]*).*\.bin',
106 output_pattern='firmware-imx-easrc-%s',
107 description='Freescale IMX EASRC Firmware [%s]',
108 extra_depends='',
109 prepend=True)
110
111 vpudir = bb.data.expand('${nonarch_base_libdir}/firmware/vpu', d)
112 do_split_packages(d, vpudir, '^vpu_fw_([^_]*).*\.bin',
113 output_pattern='firmware-imx-vpu-%s',
114 description='Freescale IMX VPU Firmware [%s]',
115 hook=coda_vpu_links,
116 extra_depends='',
117 prepend=True)
118
119 sdmadir = bb.data.expand('${nonarch_base_libdir}/firmware/imx/sdma', d)
120 do_split_packages(d, sdmadir, '^sdma-([^-]*).*\.bin',
121 output_pattern='firmware-imx-sdma-%s',
122 description='Freescale IMX SDMA Firmware [%s]',
123 extra_depends='',
124 prepend=True)
125
126 xcvrdir = bb.data.expand('${nonarch_base_libdir}/firmware/imx/xcvr', d)
127 do_split_packages(d, xcvrdir, '^xcvr-([^_]*).*\.bin',
128 output_pattern='firmware-imx-xcvr-%s',
129 description='Freescale IMX XCVR Firmware [%s]',
130 extra_depends='',
131 prepend=True)
132
133 xuvidir = bb.data.expand('${nonarch_base_libdir}/firmware/imx/xuvi', d)
134 do_split_packages(d, xuvidir, '^vpu_fw_([^_]*).*\.bin',
135 output_pattern='firmware-imx-xuvi-%s',
136 description='Freescale IMX XUVI Firmware [%s]',
137 extra_depends='',
138 prepend=True)
139}
140
141# Declare a contract that we would provide packages produced by prepend above
142PACKAGES_DYNAMIC = "${PN}-vpu-* ${PN}-sdma-* ${PN}-easrc-* ${PN}-xcvr-* ${PN}-xuvi-*"
143
144#
145# Deal with the rest of Firmware packages here
146#
147# Provide EPDC and HDMI Firmware in common packages as they tend to be special in
148# terms of the content.
149#
150# NOTE: PACKAGES are defined explicitly here in order to remove the auto-generated
151# complimentary packages (-dev and -dbg).
152# This is done in order to be able to keep the main package empty and fail when
153# somebody tries to install it in the image.
154# If -dev package is present in that setup, and dev-pkgs is enabled in
155# IMAGE_FEATURES - this leads to a failure during do_rootfs() while all -dev
156# packages would be installed, and -dev package would fail because the main one
157# is empty.
158# Therefore, we opt-out from producing -dev package here, since also for firmware
159# files it makes no sense.
160PACKAGES = "${PN} ${PN}-epdc ${PN}-hdmi ${PN}-vpu-amphion ${PN}-vpu-wave"
161
162FILES:${PN}-epdc = "${nonarch_base_libdir}/firmware/imx/epdc/"
163FILES:${PN}-hdmi = " \
164 ${nonarch_base_libdir}/firmware/hdmitxfw.bin \
165 ${nonarch_base_libdir}/firmware/hdmirxfw.bin \
166 ${nonarch_base_libdir}/firmware/dpfw.bin \
167"
168FILES:${PN}-vpu-amphion = "${nonarch_base_libdir}/firmware/amphion/vpu/*"
169FILES:${PN}-vpu-wave = "${nonarch_base_libdir}/firmware/wave633c_codec_fw.bin"
170
171COMPATIBLE_MACHINE = "(imx-generic-bsp)"