aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3
diff options
context:
space:
mode:
Diffstat (limited to 'meta-rcar-gen3')
-rw-r--r--meta-rcar-gen3/include/cas-control.inc17
-rw-r--r--meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb3
2 files changed, 19 insertions, 1 deletions
diff --git a/meta-rcar-gen3/include/cas-control.inc b/meta-rcar-gen3/include/cas-control.inc
new file mode 100644
index 0000000..18ccc74
--- /dev/null
+++ b/meta-rcar-gen3/include/cas-control.inc
@@ -0,0 +1,17 @@
+SOC="${@d.getVar('SOC_FAMILY').split(':')[1]}"
+CAS="${@'1' if 'cas' in '${MACHINE_FEATURES}' else '0'}"
+
+# USE_CAS for H3 (SoC: r8a7795) or M3 (SoC: r8a7796)
+USE_CAS="${@'1' if '${CAS}' == '1' and ('${SOC}' == 'r8a7795' or '${SOC}' == 'r8a7796') else '0'}"
+
+# Trap incorrect CAS setting for M3N/E3
+WARN="${@'1' if '${CAS}' == '1' and '${USE_CAS}' == '0' else '0'}"
+
+# This function is to show a warning message when enabling CAS feature on M3N/E3
+python do_cas_checking() {
+ warn=d.getVar('WARN')
+ if warn == "1" :
+ bb.warn("CAS only supports H3 (SoC: r8a7795), M3 (SoC: r8a7796), this feature will be disabled automatically")
+}
+
+addtask cas_checking before do_configure after do_patch
diff --git a/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb b/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb
index 5cce5ba..29039b9 100644
--- a/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb
+++ b/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb
@@ -3,6 +3,7 @@ DESCRIPTION = "Linux kernel for the R-Car Generation 3 based board"
require include/avb-control.inc
require include/iccom-control.inc
require recipes-kernel/linux/linux-yocto.inc
+require include/cas-control.inc
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}/:"
COMPATIBLE_MACHINE = "salvator-x|h3ulcb|m3ulcb|ebisu"
@@ -35,7 +36,7 @@ SRC_URI_append = " \
# Add SCHED_DEBUG config fragment to support CAS
SRC_URI_append = " \
- ${@bb.utils.contains('MACHINE_FEATURES','cas','file://capacity_aware_migration_strategy.cfg','',d)} \
+ ${@base_conditional("USE_CAS", "1", " file://capacity_aware_migration_strategy.cfg", "",d)} \
"
# Install USB3.0 firmware to rootfs