72 lines
2.7 KiB
Plaintext
72 lines
2.7 KiB
Plaintext
COMPATIBLE_MACHINE = "(stm32mp1|stm32mp157c-dcm)"
|
|
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
|
|
SRC_URI += "file://stm32mp157c-dcm-u-boot.dts"
|
|
SRC_URI += "file://stm32mp157c_dcm_defconfig"
|
|
|
|
# Setzen des DEVICE_TREE für dieses Board
|
|
DEVICE_TREE = "stm32mp157c-dcm"
|
|
UBOOT_DEVICE_TREE = "stm32mp157c-dcm"
|
|
UBOOT_DEFCONFIG = "stm32mp157c_dcm_defconfig"
|
|
|
|
# Konfiguriere UBOOT_CONFIG für die benötigten Konfigurationen
|
|
UBOOT_CONFIG = "default_stm32mp15 programmer_stm32mp15"
|
|
UBOOT_CONFIG[default_stm32mp15] = "stm32mp15_defconfig,,u-boot.dtb"
|
|
UBOOT_CONFIG[programmer_stm32mp15] = "stm32mp15_programmer_defconfig,,u-boot.dtb"
|
|
|
|
do_configure:prepend() {
|
|
# Debugging-Informationen
|
|
bbplain "U-Boot-Quellverzeichnis: ${S}"
|
|
bbplain "Verfügbare Konfigurationsdateien in configs:"
|
|
find ${S}/configs -name "*stm32mp*" | sort
|
|
|
|
# Kopiere unsere Konfigurationsdatei
|
|
cp ${WORKDIR}/stm32mp157c_dcm_defconfig ${S}/configs/
|
|
|
|
# Erstelle die erforderlichen Konfigurationsdateien
|
|
cp ${WORKDIR}/stm32mp157c_dcm_defconfig ${S}/configs/stm32mp15_defconfig
|
|
cp ${WORKDIR}/stm32mp157c_dcm_defconfig ${S}/configs/stm32mp15_programmer_defconfig
|
|
|
|
# Erstelle auch die arch/../configs/ Variante, die im Fehler erwähnt wird
|
|
mkdir -p ${S}/arch/arm/configs
|
|
cp ${WORKDIR}/stm32mp157c_dcm_defconfig ${S}/arch/arm/configs/stm32mp15_programmer_defconfig
|
|
|
|
# Bereinige möglicherweise fehlgeschlagene vorherige Builds
|
|
rm -f ${B}/.config
|
|
mkdir -p ${B}
|
|
}
|
|
|
|
# Kopiere DTS-Datei und aktualisiere Makefile
|
|
do_configure:append() {
|
|
cp ${WORKDIR}/stm32mp157c-dcm-u-boot.dts ${S}/arch/arm/dts/stm32mp157c-dcm.dts
|
|
|
|
# Aktualisiere Makefile
|
|
if [ -f ${S}/arch/arm/dts/Makefile ]; then
|
|
if ! grep -q "stm32mp157c-dcm.dtb" ${S}/arch/arm/dts/Makefile; then
|
|
sed -i 's/stm32mp157c-dk2.dtb \\/stm32mp157c-dk2.dtb \\\n\tstm32mp157c-dcm.dtb \\/g' ${S}/arch/arm/dts/Makefile
|
|
bbplain "stm32mp157c-dcm.dtb wurde zur Makefile hinzugefügt."
|
|
fi
|
|
fi
|
|
}
|
|
|
|
# Vorverarbeiten der DTS-Dateien
|
|
do_compile:prepend() {
|
|
DTS_FILE="${S}/arch/arm/dts/stm32mp157c-dcm.dts"
|
|
|
|
# Debug-Ausgabe
|
|
bbplain "do_compile:prepend - DTS-Datei: ${DTS_FILE}"
|
|
|
|
# Überprüfe, ob die Datei existiert
|
|
if [ -f "${DTS_FILE}" ]; then
|
|
# Erstelle Verzeichnis für vorprozessierte Dateien
|
|
mkdir -p ${B}/preprocessed_dts
|
|
|
|
bbplain "Vorverarbeiten von ${DTS_FILE} mit CPP..."
|
|
# Verwende eine einfache Vorverarbeitung
|
|
${CC} -E -P -nostdinc -undef -x assembler-with-cpp -I${S}/arch/arm/dts -I${S}/include \
|
|
-o ${B}/preprocessed_dts/stm32mp157c-dcm.dts ${DTS_FILE}
|
|
|
|
# Ersetze Original-DTS mit vorverarbeiteter DTS
|
|
cp ${B}/preprocessed_dts/stm32mp157c-dcm.dts ${DTS_FILE}
|
|
fi
|
|
}
|