added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1 @@
ALTERNATIVE_PRIORITY = "40"

View File

@@ -0,0 +1,20 @@
SUMMARY = "Writes build information to target filesystem on /etc/build"
LICENSE = "MIT"
PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit image-buildinfo
IMAGE_BUILDINFO_FILE = "${sysconfdir}/build"
do_install(){
install -d ${D}/$(dirname "${IMAGE_BUILDINFO_FILE}")
}
BUILDINFODEST = "${D}"
# Configure buildinfo() from image-buildinfo class to generate expected info
IMAGE_BUILDINFO_VARS = "${BUILDCFG_VARS}"
# Set path to output build info file on image dir
IMAGE_ROOTFS = "${D}"
# Generate build info file
do_install[postfuncs] += "buildinfo"
# Always rebuild that recipe to avoid cache issue
do_install[nostamp] = "1"

View File

@@ -0,0 +1,22 @@
SUMMARY = "Information for support"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-or-later;md5=fed54355545ffd980b814dab4a3b312c"
PACKAGE_ARCH = "${MACHINE_ARCH}"
PV = "1.1"
do_install() {
if [ "${TARGET_ARCH}" = "arm" ]; then
mkdir -p ${D}${sysconfdir}/st-info.d
touch ${D}${sysconfdir}/st-info.d/graphics-${PV}
printf "LIBGLES1=${PREFERRED_PROVIDER_virtual/libgles1}\n" > ${D}${sysconfdir}/st-info.d/graphics-${PV}
fi
}
# Make sure to update package as soon as EULA is accepted or not
do_install[vardeps] += "${@d.getVar('ACCEPT_EULA_'+d.getVar('MACHINE'))}"
FILES:${PN} = "${sysconfdir}/st-info.d"
ALLOW_EMPTY:${PN} = "1"

View File

@@ -0,0 +1,4 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
PACKAGECONFIG:remove:stm32mpcommon = "mozjs"
PACKAGECONFIG:append:stm32mpcommon = "duktape"

View File

@@ -0,0 +1,60 @@
#!/usr/bin/python3
import getopt
import re
import sys
with open('/proc/device-tree/compatible', 'r') as compatible:
if 'stm32mp15' in compatible.read():
word_length = 4 # Bytes
else:
word_length = 2 # Bytes
burst_length = 8 # Words
def usage():
print("Usage:")
print(" python stm32_ddr_pmu.py [-d <ddr_freq>] -f <perf_file>")
print(" -d ddr_freq: DDR frequency in MHz (533 MHz by default)")
print(" -f perf_file: text file containing the output of")
print(" perf stat -e stm32_ddr_pmu/read_cnt/,stm32_ddr_pmu/time_cnt/,stm32_ddr_pmu/write_cnt/ -a -o <perf_file> <command>")
print("The script considers bursts of %s words with %s bytes per word." % (burst_length, word_length))
sys.exit(2)
ddr_freq = 533
perf_file = None
dic = {}
try:
opts, args = getopt.getopt(sys.argv[1:], "d:f:")
except getopt.GetoptError:
print("Error: invalid option !")
usage()
for opt,arg in opts:
if opt == '-d':
ddr_freq = int(arg)
elif opt == '-f':
perf_file = arg
else:
usage()
if perf_file == None:
print("Error: no perf file !")
usage()
with open(perf_file) as file:
lines = file.readlines()
for line in lines:
a = re.match(".* ([0-9]+).*stm32_ddr_pmu\/(.*)\/.*", line)
try:
dic[a.groups()[1]] = a.groups()[0]
except:
continue
constant = word_length * burst_length * ddr_freq * 1000000 / int(dic['time_cnt']) / (1024 * 1024)
read_bw = int(dic['read_cnt']) * constant
write_bw = int(dic['write_cnt']) * constant
print("R = %s MB/s, W = %s MB/s, R&W = %s MB/s (DDR @ %s MHz)" % (read_bw.__round__(),
write_bw.__round__(), (read_bw + write_bw).__round__(), ddr_freq))

View File

@@ -0,0 +1,16 @@
SUMMARY = "STM32 tool to convert the 'perf' tool counters into understandable MB/s"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
RDEPENDS:${PN} += " python3-core "
SRC_URI += " \
file://stm32_ddr_pmu.py \
"
do_install() {
install -d ${D}/${bindir}
install -m 0755 ${WORKDIR}/stm32_ddr_pmu.py ${D}/${bindir}
}
FILES:${PN} = "${bindir}/stm32_ddr_pmu.py"