From patchwork Thu Aug 9 13:54:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 955667 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=microchip.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41mVlb275Mz9s0n for ; Fri, 10 Aug 2018 00:20:27 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 0CFC4C21E49; Thu, 9 Aug 2018 14:06:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B0D68C21F06; Thu, 9 Aug 2018 14:00:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 19EFBC21EE3; Thu, 9 Aug 2018 14:00:00 +0000 (UTC) Received: from esa2.microchip.iphmx.com (esa2.microchip.iphmx.com [68.232.149.84]) by lists.denx.de (Postfix) with ESMTPS id B66B9C21E2F for ; Thu, 9 Aug 2018 13:59:49 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.53,215,1531810800"; d="scan'208";a="17647567" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Aug 2018 06:59:49 -0700 Received: from eh-station.mchp-main.com (10.10.76.4) by chn-sv-exch07.mchp-main.com (10.10.76.108) with Microsoft SMTP Server id 14.3.352.0; Thu, 9 Aug 2018 06:59:48 -0700 From: Eugen Hristev To: Date: Thu, 9 Aug 2018 16:54:06 +0300 Message-ID: <1533822854-4349-23-git-send-email-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533822854-4349-1-git-send-email-eugen.hristev@microchip.com> References: <1533822854-4349-1-git-send-email-eugen.hristev@microchip.com> MIME-Version: 1.0 Cc: nicolas.ferre@microchip.com Subject: [U-Boot] [PATCH v2 22/30] board: sama5d2_ptc_ek: add pda detect call at init time X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Call the PDA detection mechanism at boot time so we can have the pda environment variable ready for use. Signed-off-by: Eugen Hristev --- arch/arm/mach-at91/Kconfig | 1 + board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 6fe701a..983d9b9 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -149,6 +149,7 @@ config TARGET_SAMA5D2_PTC_EK bool "SAMA5D2 PTC EK board" select SAMA5D2 select BOARD_EARLY_INIT_F + select BOARD_LATE_INIT config TARGET_SAMA5D2_XPLAINED bool "SAMA5D2 Xplained board" diff --git a/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c b/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c index 789841e..17e08fa 100644 --- a/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c +++ b/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c @@ -20,6 +20,8 @@ #include #include +extern void at91_pda_detect(void); + DECLARE_GLOBAL_DATA_PTR; #ifdef CONFIG_NAND_ATMEL @@ -65,6 +67,14 @@ static void board_nand_hw_init(void) } #endif +#ifdef CONFIG_BOARD_LATE_INIT +int board_late_init(void) +{ + at91_pda_detect(); + return 0; +} +#endif + static void board_usb_hw_init(void) { atmel_pio4_set_pio_output(AT91_PIO_PORTB, 12, ATMEL_PIO_PUEN_MASK);