diff mbox series

[meta-rockchip] machine include files use weak defaults

Message ID 20231003023429.195167-1-anthony.t.davies@gmail.com
State New
Headers show
Series [meta-rockchip] machine include files use weak defaults | expand

Commit Message

Anthony Davies Oct. 3, 2023, 2:34 a.m. UTC
From: Anthony Davies <anthony.t.davies@gmail.com>

This allows defaults to be set per machine.conf but also allows 
overrides in local.conf.

Signed-off-by: Anthony Davies <anthony.t.davies@gmail.com>
---
 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(-)

Comments

Quentin Schulz Oct. 3, 2023, 10:29 a.m. UTC | #1
Hi Anthony,

On 10/3/23 04:34, Anthony Davies via lists.yoctoproject.org wrote:
> From: Anthony Davies <anthony.t.davies@gmail.com>
> 
> 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
diff mbox series

Patch

diff --git a/conf/machine/include/px30.inc b/conf/machine/include/px30.inc
index a3727fb..8b94c9d 100644
--- a/conf/machine/include/px30.inc
+++ b/conf/machine/include/px30.inc
@@ -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"
diff --git a/conf/machine/include/rk3288.inc b/conf/machine/include/rk3288.inc
index b4c559d..978a2ab 100644
--- a/conf/machine/include/rk3288.inc
+++ b/conf/machine/include/rk3288.inc
@@ -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"
diff --git a/conf/machine/include/rk3328.inc b/conf/machine/include/rk3328.inc
index f9f8792..69ec7bc 100644
--- a/conf/machine/include/rk3328.inc
+++ b/conf/machine/include/rk3328.inc
@@ -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"
diff --git a/conf/machine/include/rk3399.inc b/conf/machine/include/rk3399.inc
index 88c87af..491bc3d 100644
--- a/conf/machine/include/rk3399.inc
+++ b/conf/machine/include/rk3399.inc
@@ -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"
diff --git a/conf/machine/include/rk3588s.inc b/conf/machine/include/rk3588s.inc
index 7bfc947..f8292aa 100644
--- a/conf/machine/include/rk3588s.inc
+++ b/conf/machine/include/rk3588s.inc
@@ -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"
diff --git a/conf/machine/include/rockchip-defaults.inc b/conf/machine/include/rockchip-defaults.inc
index 3ce2e24..11d0fc7 100644
--- a/conf/machine/include/rockchip-defaults.inc
+++ b/conf/machine/include/rockchip-defaults.inc
@@ -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"
diff --git a/conf/machine/include/rockchip-wic.inc b/conf/machine/include/rockchip-wic.inc
index 635288c..883fcef 100644
--- a/conf/machine/include/rockchip-wic.inc
+++ b/conf/machine/include/rockchip-wic.inc
@@ -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 \