From patchwork Tue Sep 12 20:02:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 813042 X-Patchwork-Delegate: jagannadh.teki@gmail.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=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xsG461vtvz9s7f for ; Wed, 13 Sep 2017 06:05:10 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 95995C2224E; Tue, 12 Sep 2017 20:03:01 +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 91F6FC22194; Tue, 12 Sep 2017 20:02:33 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 00779C22159; Tue, 12 Sep 2017 20:02:30 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id BBEEBC21FDC for ; Tue, 12 Sep 2017 20:02:28 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 8AD9A20848; Tue, 12 Sep 2017 22:02:28 +0200 (CEST) Received: from localhost (LFbn-TOU-1-209-191.w86-201.abo.wanadoo.fr [86.201.56.191]) by mail.free-electrons.com (Postfix) with ESMTPSA id 628BA20834; Tue, 12 Sep 2017 22:02:28 +0200 (CEST) From: Maxime Ripard To: Tom Rini Date: Tue, 12 Sep 2017 22:02:23 +0200 Message-Id: X-Mailer: git-send-email 2.13.5 In-Reply-To: References: In-Reply-To: References: Cc: u-boot@lists.denx.de, Jagan Teki , Maxime Ripard Subject: [U-Boot] [PATCH v2 2/3] sunxi: Use sunxi_get_boot_device 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Our current board code duplicates a bit the sunxi_get_boot_device logic. Now that we can use that function in the full-flavoured U-Boot, remove that duplication and call the function instead. Signed-off-by: Maxime Ripard --- board/sunxi/board.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 70e01437c4f4..9c7fc4168894 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -720,11 +721,14 @@ static void setup_environment(const void *fdt) int misc_init_r(void) { __maybe_unused int ret; + uint boot; env_set("fel_booted", NULL); env_set("fel_scriptaddr", NULL); + + boot = sunxi_get_boot_device(); /* determine if we are running in FEL mode */ - if (!is_boot0_magic(SPL_ADDR + 4)) { /* eGON.BT0 */ + if (boot == BOOT_DEVICE_BOARD) { env_set("fel_booted", "1"); parse_spl_header(SPL_ADDR); }