diff mbox series

[v2,03/21] arm: socfpga: Add function for checking description from FIT image

Message ID 1582115146-28658-4-git-send-email-chee.hong.ang@intel.com
State Superseded
Headers show
Series Enable ARM Trusted Firmware for U-Boot | expand

Commit Message

Ang, Chee Hong Feb. 19, 2020, 12:25 p.m. UTC
From: Chee Hong Ang <chee.hong.ang at intel.com>

Add board_fit_config_name_match() for matching board name with
device tree files in FIT image. This will ensure correct DTB
file is loaded for different board type. Currently, we are not
supporting multiple device tree files in FIT image therefore this
function basically do nothing for now.

Signed-off-by: Chee Hong Ang <chee.hong.ang at intel.com>
---
 arch/arm/mach-socfpga/board.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Marek Vasut Feb. 19, 2020, 5:11 p.m. UTC | #1
On 2/19/20 1:25 PM, chee.hong.ang at intel.com wrote:
> From: Chee Hong Ang <chee.hong.ang at intel.com>
> 
> Add board_fit_config_name_match() for matching board name with
> device tree files in FIT image. This will ensure correct DTB
> file is loaded for different board type. Currently, we are not
> supporting multiple device tree files in FIT image therefore this
> function basically do nothing for now.
> 
> Signed-off-by: Chee Hong Ang <chee.hong.ang at intel.com>
> ---
>  arch/arm/mach-socfpga/board.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
> index 7c8c05c..5757041 100644
> --- a/arch/arm/mach-socfpga/board.c
> +++ b/arch/arm/mach-socfpga/board.c
> @@ -86,3 +86,13 @@ int g_dnl_board_usb_cable_connected(void)
>  	return 1;
>  }
>  #endif
> +
> +#ifdef CONFIG_SPL_BUILD
> +__weak int board_fit_config_name_match(const char *name)

Why is this __weak ?

[...]
Dalon L Westergreen Feb. 19, 2020, 5:31 p.m. UTC | #2
On Wed, 2020-02-19 at 18:11 +0100, Marek Vasut wrote:
> On 2/19/20 1:25 PM, chee.hong.ang at intel.com wrote:
> > From: Chee Hong Ang <chee.hong.ang at intel.com>
> > Add board_fit_config_name_match() for matching board name withdevice tree
> > files in FIT image. This will ensure correct DTBfile is loaded for different
> > board type. Currently, we are notsupporting multiple device tree files in
> > FIT image therefore thisfunction basically do nothing for now.
> > Signed-off-by: Chee Hong Ang <chee.hong.ang at intel.com>--- arch/arm/mach-
> > socfpga/board.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
> > diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-
> > socfpga/board.cindex 7c8c05c..5757041 100644--- a/arch/arm/mach-
> > socfpga/board.c+++ b/arch/arm/mach-socfpga/board.c@@ -86,3 +86,13 @@ int
> > g_dnl_board_usb_cable_connected(void) 	return 1; } #endif++#ifdef
> > CONFIG_SPL_BUILD+__weak int board_fit_config_name_match(const char *name)
> 
> Why is this __weak ?

The intent is to allow users to override this in their specific board
implementation.


> 
> [...]
Marek Vasut Feb. 19, 2020, 5:32 p.m. UTC | #3
On 2/19/20 6:31 PM, Dalon L Westergreen wrote:
> 
> 
> On Wed, 2020-02-19 at 18:11 +0100, Marek Vasut wrote:
>> On 2/19/20 1:25 PM, chee.hong.ang at intel.com wrote:
>>> From: Chee Hong Ang <chee.hong.ang at intel.com>
>>> Add board_fit_config_name_match() for matching board name withdevice tree
>>> files in FIT image. This will ensure correct DTBfile is loaded for different
>>> board type. Currently, we are notsupporting multiple device tree files in
>>> FIT image therefore thisfunction basically do nothing for now.
>>> Signed-off-by: Chee Hong Ang <chee.hong.ang at intel.com>--- arch/arm/mach-
>>> socfpga/board.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
>>> diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-
>>> socfpga/board.cindex 7c8c05c..5757041 100644--- a/arch/arm/mach-
>>> socfpga/board.c+++ b/arch/arm/mach-socfpga/board.c@@ -86,3 +86,13 @@ int
>>> g_dnl_board_usb_cable_connected(void) 	return 1; } #endif++#ifdef
>>> CONFIG_SPL_BUILD+__weak int board_fit_config_name_match(const char *name)
>>
>> Why is this __weak ?
> 
> The intent is to allow users to override this in their specific board
> implementation.

OK. Please add that into the commit message.
diff mbox series

Patch

diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
index 7c8c05c..5757041 100644
--- a/arch/arm/mach-socfpga/board.c
+++ b/arch/arm/mach-socfpga/board.c
@@ -86,3 +86,13 @@  int g_dnl_board_usb_cable_connected(void)
 	return 1;
 }
 #endif
+
+#ifdef CONFIG_SPL_BUILD
+__weak int board_fit_config_name_match(const char *name)
+{
+	/* Just empty function now - can't decide what to choose */
+	debug("%s: %s\n", __func__, name);
+
+	return 0;
+}
+#endif