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: 112387 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp37353qgf; Tue, 12 Sep 2017 13:05:01 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5ZGNkRt2V05LOP9cVQxrEWZhR+IItrb393wrFw5Wqhl5TPT2KtAEIllKq/EMlDORxhOl5h X-Received: by 10.80.146.35 with SMTP id i32mr9727009eda.10.1505246701288; Tue, 12 Sep 2017 13:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505246701; cv=none; d=google.com; s=arc-20160816; b=h910JaSOj1UE6ZWvfIYB8DI0WlYlIqDOxm8HrJOUG9MNGMW730cUMVnHNOMfIwnofw OgP0LI8WCSgk/EcS0xiS5GS4qPkATGhRYBZvribpC1XTy4bB6HsAyVROvS4UjtDtrLd3 5iOFJkwlC1VPR06DzNFQrRJf53hs3OR/whEdEGlYnS15yUGgLQtzzMUrCE3tc1zTAN+W mcdzvp1M81xYRWHTV0+tb1ANx9ca7M7Mxs+RsDoyXKSAyMx1ZFbcGjPyLjgVql4ThHRU h1q6QIn30OkS3MPsDmOWJ9kLe555G0w0e71aQzfGsrr/qUqfaWA5GgbZZF0JjZIBaDLt kNzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:arc-authentication-results; bh=Z3Uz5omP6zSB2vYp6SGohRO4kKA5XVsJYTzbLPUWTyw=; b=sdfEwAz/5fMnGG+KQTcKTeZhWBhE6+YTuimJ0jy61hj/yhbIMuoBeQ2+4ZiS7nJ9tE fsNf8hVvp2lkucDSqsfLGkz055fMuTnymPdqxHJz2wIQ41eqxT9vdURhzvEylNrkThJg aFM+l0cNwHOmigQde9XCw/1OghB8uEeRHjud3jVs6gPTdCjq7owcjwiWRXaDGSC94Ajp 84E68pFVYbH0dnGPoKAvuobv5RAhU6DNK4u4G9l8HBlGxIzjPz5E59QbQeFPy136Z1Ms xq0QSRDxG0MVksNPKFENW9fOWVXwQlnrG7rLY150d3xqhaTEAQXDDsHs/54R5F5xXMJA XreQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id f13si12373927edl.233.2017.09.12.13.05.00; Tue, 12 Sep 2017 13:05:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 4353EC2222D; Tue, 12 Sep 2017 20:03:00 +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); }