From mboxrd@z Thu Jan  1 00:00:00 1970
Delivery-date: Tue, 08 Apr 2025 00:04:28 +0200
Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104])
	by lore.white.stw.pengutronix.de with esmtps  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
	(Exim 4.96)
	(envelope-from <ptxdist-bounces+lore=lore.pengutronix.de@pengutronix.de>)
	id 1u1uZw-009ior-1T
	for lore@lore.pengutronix.de;
	Tue, 08 Apr 2025 00:04:28 +0200
Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de)
	by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92)
	(envelope-from <ptxdist-bounces@pengutronix.de>)
	id 1u1uZw-0001Yl-3v; Tue, 08 Apr 2025 00:04:28 +0200
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.whiteo.stw.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <m.grzeschik@pengutronix.de>) id 1u1uZe-0001YT-UW
 for ptxdist@pengutronix.de; Tue, 08 Apr 2025 00:04:10 +0200
Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac])
 by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <m.grzeschik@pengutronix.de>) id 1u1uZe-003pGA-2R
 for ptxdist@pengutronix.de; Tue, 08 Apr 2025 00:04:10 +0200
Received: from localhost ([::1] helo=dude04.red.stw.pengutronix.de)
 by dude04.red.stw.pengutronix.de with esmtp (Exim 4.96)
 (envelope-from <m.grzeschik@pengutronix.de>) id 1u1uZe-009C1y-29
 for ptxdist@pengutronix.de; Tue, 08 Apr 2025 00:04:10 +0200
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: ptxdist@pengutronix.de
Date: Tue,  8 Apr 2025 00:04:09 +0200
Message-Id: <20250407220409.2190827-1-m.grzeschik@pengutronix.de>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [ptxdist] [PATCH] optee: switch optee cfg string to config file
X-BeenThere: ptxdist@pengutronix.de
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: PTXdist Development Mailing List <ptxdist.pengutronix.de>
List-Unsubscribe: <https://metis.pengutronix.de/mailman/options/ptxdist>,
 <mailto:ptxdist-request@pengutronix.de?subject=unsubscribe>
List-Archive: <https://metis.pengutronix.de/mailman/private/ptxdist/>
List-Post: <mailto:ptxdist@pengutronix.de>
List-Help: <mailto:ptxdist-request@pengutronix.de?subject=help>
List-Subscribe: <https://metis.pengutronix.de/mailman/listinfo/ptxdist>,
 <mailto:ptxdist-request@pengutronix.de?subject=subscribe>
Reply-To: ptxdist@pengutronix.de
Sender: "ptxdist" <ptxdist-bounces@pengutronix.de>
X-SA-Exim-Connect-IP: 127.0.0.1
X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de
X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false

The current situation of one string containing all config options in one
line is nearly impossible to handle inside of the BSPs platformconfig.
Every change in that line makes the diff heavy to parse for differences.

This patch is switching the rule to load one config file
that contains a list of set config variables instead of that
one bulky line.

Just like barebox and kernel the optee config will be located in the
platformdir and be named as optee.config as default.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 platforms/optee.in | 5 +++--
 rules/optee.make   | 5 ++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/platforms/optee.in b/platforms/optee.in
index 371f5b237..2c567b78a 100644
--- a/platforms/optee.in
+++ b/platforms/optee.in
@@ -34,9 +34,10 @@ config OPTEE_PLATFORM_FLAVOUR
 	  Platform Flavour for the selected platform, i.e. mx6qsabresd for the
 	  imx platform.
 
-config OPTEE_CFG
+config OPTEE_CONFIG
 	string
-	prompt "OP-TEE CFG Flags"
+	prompt "OP-TEE CFG File"
+	default "optee.config"
 	help
 	  Refer to the following file for the CFG_FLAGS:
 	  https://github.com/OP-TEE/optee_os/blob/master/mk/config.mk
diff --git a/rules/optee.make b/rules/optee.make
index 8ddff64ec..8c5b963fb 100644
--- a/rules/optee.make
+++ b/rules/optee.make
@@ -26,6 +26,9 @@ OPTEE_DIR	:= $(BUILDDIR)/$(OPTEE)
 OPTEE_LICENSE	:= BSD-2-Clause AND BSD-3-Clause
 OPTEE_DEVPKG	:= NO
 
+OPTEE_CONFIG	:= $(call ptx/in-platformconfigdir, \
+			$(call remove_quotes, $(PTXCONF_OPTEE_CONFIG)))
+
 # ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
@@ -43,7 +46,7 @@ OPTEE_MAKE_ENV += \
 	CROSS_COMPILE=$(COMPILER_PREFIX) \
 	$(call ptx/ifdef,PTXCONF_ARCH_ARM64,CFG_ARM64_core=y) \
 	PLATFORM=$(OPTEE_PLATFORM)$(OPTEE_PLATFORM_FLAVOUR) \
-	$(call remove_quotes,$(PTXCONF_OPTEE_CFG))
+	CFG_OPTEE_CONFIG=$(OPTEE_CONFIG)
 
 # ----------------------------------------------------------------------------
 # Install
-- 
2.39.5