From patchwork Fri Oct 28 00:25:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 687994 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3t4l1l4y6nz9t0J for ; Fri, 28 Oct 2016 11:26:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=agner.ch header.i=@agner.ch header.b=FGsg13ph; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 49B784B9F9; Fri, 28 Oct 2016 02:26:48 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6i5Bvx-E3V1K; Fri, 28 Oct 2016 02:26:48 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 48690A7549; Fri, 28 Oct 2016 02:26:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AD1424BA29 for ; Fri, 28 Oct 2016 02:26:25 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dWkq5yGY0hw4 for ; Fri, 28 Oct 2016 02:26:23 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109]) by theia.denx.de (Postfix) with ESMTPS id 40A154B99D for ; Fri, 28 Oct 2016 02:26:18 +0200 (CEST) Received: from trochilidae.toradex.int (75-146-58-181-Washington.hfc.comcastbusiness.net [75.146.58.181]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 06DBA5C1E22; Fri, 28 Oct 2016 02:19:45 +0200 (CEST) From: Stefan Agner To: u-boot@lists.denx.de Date: Thu, 27 Oct 2016 17:25:45 -0700 Message-Id: <20161028002548.23891-2-stefan@agner.ch> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161028002548.23891-1-stefan@agner.ch> References: <20161028002548.23891-1-stefan@agner.ch> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1477613987; bh=ODdQ6VwgHD8EFrZGzf7p0MBZlUIzR/k9IxoK7AhfD00=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=FGsg13phcDSWHD5Y5fwDmMEXkwmAaSNJHL5tDkKU9k5DDhbSHfzMcPG0vG/TqygKCUk5VD9kpt1zozNwWPFikuExVd105iW98Bou9SKg/Ok2m6kh+VXwYn+Tk0MqoOk0QOMewcg6jOsZdQW1wVhbk9fuBoqCC7zCPRph/aMyj4Q= Cc: Marcel Ziswiler , Lucas Stach , Stefan Agner , Max Krummenacher Subject: [U-Boot] [PATCH 1/4] toradex: allow custom fdt board setup in board file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Stefan Agner The config block support currently uses the ft_board_setup function to patch the device tree with config block information. However, this does not allow to patch the device tree with board specific information. Rename the common setup function to ft_common_board_setup and use the call it from the board files directly. Signed-off-by: Stefan Agner --- board/toradex/apalis_t30/apalis_t30.c | 8 ++++++++ board/toradex/colibri_imx7/colibri_imx7.c | 8 ++++++++ board/toradex/colibri_pxa270/colibri_pxa270.c | 8 ++++++++ board/toradex/colibri_t20/colibri_t20.c | 8 ++++++++ board/toradex/colibri_t30/colibri_t30.c | 8 ++++++++ board/toradex/colibri_vf/colibri_vf.c | 8 ++++++++ board/toradex/common/tdx-common.c | 8 +++----- board/toradex/common/tdx-common.h | 2 ++ 8 files changed, 53 insertions(+), 5 deletions(-) diff --git a/board/toradex/apalis_t30/apalis_t30.c b/board/toradex/apalis_t30/apalis_t30.c index 3d83491..827eefd 100644 --- a/board/toradex/apalis_t30/apalis_t30.c +++ b/board/toradex/apalis_t30/apalis_t30.c @@ -14,6 +14,7 @@ #include #include #include +#include "../common/tdx-common.h" #include "pinmux-config-apalis_t30.h" @@ -39,6 +40,13 @@ int checkboard(void) return 0; } +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +int ft_board_setup(void *blob, bd_t *bd) +{ + return ft_common_board_setup(blob, bd); +} +#endif + /* * Routine: pinmux_init * Description: Do individual peripheral pinmux configs diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index c64e31e..e1340c3 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -24,6 +24,7 @@ #include #include #include +#include "../common/tdx-common.h" DECLARE_GLOBAL_DATA_PTR; @@ -387,6 +388,13 @@ int checkboard(void) return 0; } +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +int ft_board_setup(void *blob, bd_t *bd) +{ + return ft_common_board_setup(blob, bd); +} +#endif + #ifdef CONFIG_USB_EHCI_MX7 static iomux_v3_cfg_t const usb_otg2_pads[] = { MX7D_PAD_UART3_CTS_B__USB_OTG2_PWR | MUX_PAD_CTRL(NO_PAD_CTRL), diff --git a/board/toradex/colibri_pxa270/colibri_pxa270.c b/board/toradex/colibri_pxa270/colibri_pxa270.c index de8cb28..9809db5 100644 --- a/board/toradex/colibri_pxa270/colibri_pxa270.c +++ b/board/toradex/colibri_pxa270/colibri_pxa270.c @@ -15,6 +15,7 @@ #include #include #include +#include "../common/tdx-common.h" DECLARE_GLOBAL_DATA_PTR; @@ -40,6 +41,13 @@ int checkboard(void) return 0; } +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +int ft_board_setup(void *blob, bd_t *bd) +{ + return ft_common_board_setup(blob, bd); +} +#endif + int dram_init(void) { pxa2xx_dram_init(); diff --git a/board/toradex/colibri_t20/colibri_t20.c b/board/toradex/colibri_t20/colibri_t20.c index 01b55be..4d298e6 100644 --- a/board/toradex/colibri_t20/colibri_t20.c +++ b/board/toradex/colibri_t20/colibri_t20.c @@ -15,6 +15,7 @@ #include #include #include +#include "../common/tdx-common.h" DECLARE_GLOBAL_DATA_PTR; @@ -74,6 +75,13 @@ int checkboard(void) return 0; } +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +int ft_board_setup(void *blob, bd_t *bd) +{ + return ft_common_board_setup(blob, bd); +} +#endif + #ifdef CONFIG_TEGRA_MMC /* * Routine: pin_mux_mmc diff --git a/board/toradex/colibri_t30/colibri_t30.c b/board/toradex/colibri_t30/colibri_t30.c index 707d07e..b68d3ca 100644 --- a/board/toradex/colibri_t30/colibri_t30.c +++ b/board/toradex/colibri_t30/colibri_t30.c @@ -14,6 +14,7 @@ #include #include #include "pinmux-config-colibri_t30.h" +#include "../common/tdx-common.h" int arch_misc_init(void) { @@ -31,6 +32,13 @@ int checkboard(void) return 0; } +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +int ft_board_setup(void *blob, bd_t *bd) +{ + return ft_common_board_setup(blob, bd); +} +#endif + /* * Routine: pinmux_init * Description: Do individual peripheral pinmux configs diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c index e65d9c3..86f52c5 100644 --- a/board/toradex/colibri_vf/colibri_vf.c +++ b/board/toradex/colibri_vf/colibri_vf.c @@ -22,6 +22,7 @@ #include #include #include +#include "../common/tdx-common.h" DECLARE_GLOBAL_DATA_PTR; @@ -528,6 +529,13 @@ int checkboard(void) return 0; } +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +int ft_board_setup(void *blob, bd_t *bd) +{ + return ft_common_board_setup(blob, bd); +} +#endif + #ifdef CONFIG_USB_EHCI_VF int board_ehci_hcd_init(int port) { diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c index f1ab794..775412a 100644 --- a/board/toradex/common/tdx-common.c +++ b/board/toradex/common/tdx-common.c @@ -120,8 +120,8 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) } #endif /* CONFIG_USBDOWNLOAD_GADGET */ -#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +#if defined(CONFIG_OF_LIBFDT) +int ft_common_board_setup(void *blob, bd_t *bd) { if (tdx_serial) { fdt_setprop(blob, 0, "serial-number", tdx_serial_str, @@ -158,11 +158,9 @@ u32 get_board_serial(void) } #endif /* CONFIG_SERIAL_TAG */ -#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_common_board_setup(void *blob, bd_t *bd) { return 0; } -#endif #endif /* CONFIG_TDX_CFG_BLOCK */ diff --git a/board/toradex/common/tdx-common.h b/board/toradex/common/tdx-common.h index f308ebd..f8d78f0 100644 --- a/board/toradex/common/tdx-common.h +++ b/board/toradex/common/tdx-common.h @@ -10,4 +10,6 @@ #define TORADEX_USB_PRODUCT_NUM_OFFSET 0x4000 #define TDX_USB_VID 0x1B67 +int ft_common_board_setup(void *blob, bd_t *bd); + #endif /* _TDX_COMMON_H */