Skip to content

Commit

Permalink
Adding upstream kernel support
Browse files Browse the repository at this point in the history
	- Updating SRCREV for cryptodev as needed
	- Upstream kernel can be built by adding
		ADSP_KERNEL_TYPE="upstream"

NOTE: Upstream kernel is only applicable for sc598 boards

NOTE: Currently perf reports a compilation error with kenrel 6.9
As a result, it is disabled for now to allow full image
compilation.

Signed-off-by: UtsavAgarwalADI <[email protected]>
  • Loading branch information
UtsavAgarwalADI committed Apr 11, 2024
1 parent 60b90cb commit ba5ae22
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 22 deletions.
2 changes: 1 addition & 1 deletion meta-adi-adsp-sc5xx/recipes-adi/crypto-tests/crc-tests.bb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ do_install(){
FILES:${PN} += " \
/crypto/adi-crc \
/crypto/adi-crc.sh \
"
"
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ FILES:${PN} += " \
/crypto/adi-hash \
/crypto/adi-hash.sh \
/crypto/adi-skcipher.sh \
"
"
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
require cryptodev.inc
require cryptodev.inc


7 changes: 6 additions & 1 deletion meta-adi-adsp-sc5xx/recipes-adi/crypto-tests/cryptodev.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/cryptodev-linux:"


SCARTHGAP_SRCREV = "bb8bc7cf60d2c0b097c8b3b0e807f805b577a53f"
UPSTREAM_COMPAT = "${@ True if ('adsp-sc598-som' in d.getVar('MACHINE')) else False}"
UPSTREAM = "${@bb.utils.contains('ADSP_KERNEL_TYPE','upstream', d.getVar('UPSTREAM_COMPAT'), False ,d)}"
SRCREV = "${@ d.getVar('AUTOREV') if bb.utils.to_boolean(d.getVar('UPSTREAM')) else d.getVar('SCARTHGAP_SRCREV')}"

SRC_URI += " \
file://0001-Add-in-CRC32_HMAC-for-ADI-driver.patch \
file://0001-Add-in-CRC32_HMAC-for-ADI-driver.patch \
"
3 changes: 2 additions & 1 deletion meta-adi-adsp-sc5xx/recipes-adi/images/adsp-sc5xx-full.bb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ SOUND = " \

UTILS = " \
iperf3 \
perf \
netperf \
cpufrequtils \
uftrace \
Expand All @@ -35,6 +34,8 @@ UTILS = " \
bonnie++ \
"

UTILS += "${@'' if (bb.utils.to_boolean(d.getVar('ADSP_KERNEL_TYPE') == 'upstream')) else ' perf '}"

IMAGE_INSTALL += " \
${UTILS} \
${FILE_SYSTEM_TOOLS} \
Expand Down
3 changes: 1 addition & 2 deletions meta-adi-adsp-sc5xx/recipes-kernel/linux/linux-adi.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ inherit adsp-sc5xx-compatible

require recipes-kernel/linux/linux-yocto.inc

KERNEL_GIT_URI ?= "git://github.com/analogdevicesinc/lnxdsp-linux.git"
KERNEL_GIT_URI ?= "${@bb.utils.contains('PV', 'upstream', 'git://github.com/analogdevicesinc/linux.git' ,'git://github.com/analogdevicesinc/lnxdsp-linux.git', d)}"
KERNEL_GIT_PROTOCOL ?= "https"

SRC_URI += " \
${KERNEL_GIT_URI};protocol=${KERNEL_GIT_PROTOCOL};branch=${KERNEL_BRANCH} \
"
Expand Down
40 changes: 25 additions & 15 deletions meta-adi-adsp-sc5xx/recipes-kernel/linux/linux-adi_5.15.bb
Original file line number Diff line number Diff line change
@@ -1,40 +1,50 @@
USB_AUDIO = " \
USB_AUDIO="\
${@bb.utils.contains('DISTRO_FEATURES', 'adi_usb_gadget_audio', 'adi_usb_gadget_audio.inc', '', d)} \
"

require linux-adi.inc sharc_audio.inc ${USB_AUDIO}

LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
LICENSE="GPL-2.0-only"
LIC_FILES_CHKSUM="file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"

DEPENDS += "u-boot-mkimage-native dtc-native"

PV = "5.15.148"

LINUX_VERSION = "${PV}"

KERNEL_BRANCH ?= "main"
SRCREV = "c4403f406eff867723e10acf414afdfe8132102f"

# Include kernel configuration fragments
SRC_URI:append = " \
SRC_URI:append="\
file://feature/cfg/nfs.cfg \
file://feature/cfg/wireless.cfg \
file://feature/cfg/cpufreq.cfg \
file://feature/cfg/crypto.cfg \
file://feature/cfg/tracepoints.cfg \
"

python () {
if ((d.getVar('ADSP_KERNEL_TYPE') == 'upstream') and ("adsp-sc598" in d.getVar('MACHINE'))):
print("Building with upstream kernel")
d.setVar("PV","upstream")
d.setVar("KERNEL_VERSION_SANITY_SKIP","1")
d.setVar("KERNEL_BRANCH","adsp-main")
d.setVar("SRCREV","${AUTOREV}")
else:
d.setVar("PV","5.15.148")
d.setVar("KERNEL_BRANCH","main")
d.setVar("SRCREV","c4403f406eff867723e10acf414afdfe8132102f")

d.setVar("LINUX_VERSION",d.getVar("PV"))
}


SRC_URI:append:adsp-sc594-som-ezkit = " file://feature/cfg/snd_ezkit.scc"
SRC_URI:append:adsp-sc589-ezkit = " file://feature/cfg/snd_ezkit.scc"
SRC_URI:append:adsp-sc584-ezkit = " file://feature/cfg/snd_ezkit.scc"
SRC_URI:append:adsp-sc573-ezkit = " file://feature/cfg/snd_ezkit.scc"
SRC_URI:append:adsp-sc589-mini = " file://feature/cfg/snd_mini.scc"

SRC_URI:append:adsp-sc598-som-ezkit = "${@' file://0001-sc598-som-enable-SDcard.patch' if bb.utils.to_boolean(d.getVar('ADSP_SC598_SDCARD')) else ''}"
# Only SC598 can trigger upstream builds

SRC_URI:append:adsp-sc598-som-ezkit = "${@' file://0001-sc598-som-enable-SDcard.patch' if (bb.utils.to_boolean(d.getVar('ADSP_SC598_SDCARD')) and (d.getVar('ADSP_KERNEL_TYPE') != 'upstream')) else ''}"

SRC_URI:append:adsp-sc598-som-ezkit = " file://0001-SC598-fix-stmmac-dma-split-header-crash.patch"
SRC_URI:append:adsp-sc598-som-ezkit = ' file://0001-SC598-fix-stmmac-dma-split-header-crash.patch'

do_install:append(){
rm -rf ${D}/lib/modules/5.15.148-yocto-standard/modules.builtin.modinfo
rm -rf ${D}/lib/modules/*-yocto-standard/modules.builtin.modinfo
}

0 comments on commit ba5ae22

Please sign in to comment.