machine include files use weak defaults
PATCH 1/1 machine include files use weak defaults
From: Anthony Davies <[email protected]>
This allows defaults to be set per machine.conf but also allows overrides in local.conf.
--- conf/machine/include/px30.inc | 8 ++++---- conf/machine/include/rk3288.inc | 4 ++-- conf/machine/include/rk3328.inc | 8 ++++---- conf/machine/include/rk3399.inc | 8 ++++---- conf/machine/include/rk3588s.inc | 8 ++++---- conf/machine/include/rockchip-defaults.inc | 6 +++--- conf/machine/include/rockchip-wic.inc | 8 ++++---- 7 files changed, 25 insertions(+), 25 deletions(-)
conf/machine/include/px30.inc +4 -4
@@ -3,19 +3,19 @@ SOC_FAMILY = "px30" -DEFAULTTUNE ?= "cortexa35-crypto" +DEFAULTTUNE ??= "cortexa35-crypto" require conf/machine/include/soc-family.inc require conf/machine/include/arm/armv8a/tune-cortexa35.inc require conf/machine/include/rockchip-defaults.inc require conf/machine/include/rockchip-wic.inc -KBUILD_DEFCONFIG ?= "defconfig" +KBUILD_DEFCONFIG ??= "defconfig" KERNEL_CLASSES = "kernel-fitimage" KERNEL_IMAGETYPE = "fitImage" TFA_PLATFORM = "px30" TFA_BUILD_TARGET = "bl31" -UBOOT_SUFFIX ?= "itb" -UBOOT_ENTRYPOINT ?= "0x06000000" +UBOOT_SUFFIX ??= "itb" +UBOOT_ENTRYPOINT ??= "0x06000000"
conf/machine/include/rk3288.inc +2 -2
@@ -9,8 +9,8 @@ require conf/machine/include/rockchip-defaults.inc SERIAL_CONSOLES = "115200;ttyS2" -KBUILD_DEFCONFIG ?= "multi_v7_defconfig" +KBUILD_DEFCONFIG ??= "multi_v7_defconfig" KERNEL_FEATURES:append:rk3288 = " bsp/rockchip/remove-non-rockchip-arch-arm.scc" KERNEL_IMAGETYPE = "zImage" -UBOOT_SUFFIX ?= "bin" +UBOOT_SUFFIX ??= "bin"
conf/machine/include/rk3328.inc +4 -4
@@ -3,14 +3,14 @@ SOC_FAMILY = "rk3328" -DEFAULTTUNE ?= "cortexa53-crypto" +DEFAULTTUNE ??= "cortexa53-crypto" require conf/machine/include/soc-family.inc require conf/machine/include/arm/armv8a/tune-cortexa53.inc require conf/machine/include/rockchip-defaults.inc require conf/machine/include/rockchip-wic.inc -KBUILD_DEFCONFIG ?= "defconfig" +KBUILD_DEFCONFIG ??= "defconfig" KERNEL_FEATURES:append:rk3328 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc" KERNEL_CLASSES = "kernel-fitimage" KERNEL_IMAGETYPE = "fitImage"
@@ -18,5 +18,5 @@ KERNEL_IMAGETYPE = "fitImage" TFA_PLATFORM = "rk3328" TFA_BUILD_TARGET = "bl31" -UBOOT_SUFFIX ?= "itb" -UBOOT_ENTRYPOINT ?= "0x06000000" +UBOOT_SUFFIX ??= "itb" +UBOOT_ENTRYPOINT ??= "0x06000000"
conf/machine/include/rk3399.inc +4 -4
@@ -3,14 +3,14 @@ SOC_FAMILY = "rk3399" -DEFAULTTUNE ?= "cortexa72-cortexa53-crypto" +DEFAULTTUNE ??= "cortexa72-cortexa53-crypto" require conf/machine/include/soc-family.inc require conf/machine/include/arm/armv8a/tune-cortexa72-cortexa53.inc require conf/machine/include/rockchip-defaults.inc require conf/machine/include/rockchip-wic.inc -KBUILD_DEFCONFIG ?= "defconfig" +KBUILD_DEFCONFIG ??= "defconfig" KERNEL_FEATURES:append:rk3399 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc" KERNEL_CLASSES = "kernel-fitimage" KERNEL_IMAGETYPE = "fitImage"
@@ -18,5 +18,5 @@ KERNEL_IMAGETYPE = "fitImage" TFA_PLATFORM = "rk3399" TFA_BUILD_TARGET = "bl31" -UBOOT_SUFFIX ?= "itb" -UBOOT_ENTRYPOINT ?= "0x06000000" +UBOOT_SUFFIX ??= "itb" +UBOOT_ENTRYPOINT ??= "0x06000000"
conf/machine/include/rk3588s.inc +4 -4
@@ -1,11 +1,11 @@ MACHINEOVERRIDES =. "rk3588s:" -DEFAULTTUNE ?= "cortexa76-cortexa55-crypto" +DEFAULTTUNE ??= "cortexa76-cortexa55-crypto" require conf/machine/include/arm/armv8-2a/tune-cortexa76-cortexa55.inc require conf/machine/include/rockchip-defaults.inc require conf/machine/include/rockchip-wic.inc -KBUILD_DEFCONFIG ?= "defconfig" +KBUILD_DEFCONFIG ??= "defconfig" KERNEL_FEATURES:append:rk3588s = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc" KERNEL_CLASSES = "kernel-fitimage" KERNEL_IMAGETYPE = "fitImage"
@@ -13,5 +13,5 @@ KERNEL_IMAGETYPE = "fitImage" PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin" PREFERRED_PROVIDER_optee-os = "rockchip-rkbin" -UBOOT_SUFFIX ?= "itb" -UBOOT_ENTRYPOINT ?= "0x06000000" +UBOOT_SUFFIX ??= "itb" +UBOOT_ENTRYPOINT ??= "0x06000000"
conf/machine/include/rockchip-defaults.inc +3 -3
@@ -1,8 +1,8 @@ # meta-rockchip default settings # kernel -PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" -KCONFIG_MODE ?= "alldefconfig" +PREFERRED_PROVIDER_virtual/kernel ??= "linux-yocto" +KCONFIG_MODE ??= "alldefconfig" # xserver XSERVER = " \
@@ -18,4 +18,4 @@ XSERVER = " \ " # misc -SERIAL_CONSOLES ?= "1500000;ttyS2" +SERIAL_CONSOLES ??= "1500000;ttyS2"
conf/machine/include/rockchip-wic.inc +4 -4
@@ -1,10 +1,10 @@ # common meta-rockchip wic/wks items -SPL_BINARY ?= "idbloader.img" +SPL_BINARY ??= "idbloader.img" IMAGE_FSTYPES += "wic wic.bmap" WKS_FILE = "rockchip.wks" -WKS_FILE_DEPENDS ?= " \ +WKS_FILE_DEPENDS ??= " \ mtools-native \ dosfstools-native \ e2fsprogs-native \
@@ -18,8 +18,8 @@ IMAGE_BOOT_FILES = " \ # use the first-defined <baud>;<device> pair in SERIAL_CONSOLES # for the console parameter in the wks files -RK_CONSOLE_BAUD ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[0]}" -RK_CONSOLE_DEVICE ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[1].split()[0]}" +RK_CONSOLE_BAUD ??= "${@d.getVar('SERIAL_CONSOLES').split(';')[0]}" +RK_CONSOLE_DEVICE ??= "${@d.getVar('SERIAL_CONSOLES').split(';')[1].split()[0]}" WICVARS:append = " \ RK_CONSOLE_BAUD \
Signature · 1 line
2.34.1
Hi Anthony,
Quoted 5 lines · Anthony Davies via lists.yoctoproject.org
From: Anthony Davies <[email protected]>
This allows defaults to be set per machine.conf but also allows overrides in local.conf.
NACK to the whole patch.
??= has a very different behavior than ?= and is weaker than ?=. c.f. https://elinux.org/images/3/33/YPS2022.05_d1s02_overrides.pdf slides 15 to 20.
DEFAULTTUNE is already weakly set in the tune include files so this would basically result in a no-op.
I don't understand what your needs are frankly.
local.conf shouldn't be used for changing those things except for debugging purposes. What I recommend if you need to change those is to create your own machine configuration file in your own layer which require the "base" SoC configuration file from meta-rockchip.
e.g.
my-rk3588-device.conf
"""
DEFAULTTUNE = "cortexa76-cortexa55"
require conf/machine/include/rk3588.inc
"""
If you want to reuse an existing machine conf file but only override a few things, you can also do the same trick:
my-rock-5b-device.conf
"""
DEFAULTTUNE = "cortexa76-cortexa55"
require conf/machine/rock-5b.conf
"""
Finally, if you REALLY have to change it from local.conf, you can use OVERRIDES, e.g.:
DEFAULTTUNE:rk3588 = "cortexa76-cortexa55"
But I would really recommend against using this.
Can you tell us more about your needs?
Cheers,
Quentin