From patchwork Fri Nov 24 13:44:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 841041 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3yjyBy46QVz9s4q for ; Sat, 25 Nov 2017 00:46:02 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 51BE3C21DB2; Fri, 24 Nov 2017 13:45:31 +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=RCVD_IN_DNSWL_BLOCKED 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 6C85EC21DA9; Fri, 24 Nov 2017 13:45:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F1A4DC21D72; Fri, 24 Nov 2017 13:45:10 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id B62A5C21C4A for ; Fri, 24 Nov 2017 13:45:10 +0000 (UTC) Received: from [86.59.122.178] (port=59465 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1eIEHy-00081w-6k; Fri, 24 Nov 2017 14:45:06 +0100 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Fri, 24 Nov 2017 14:44:58 +0100 Message-Id: <1511531099-53117-1-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 Cc: Andy Yan Subject: [U-Boot] [PATCH 1/2] rockchip: fix turning off boot-mode via Kconfig 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" The ROCKCHIP_BOOT_MODE_REG option defaults to a hex value, so 0 will show as 0x0. Consequently, the "is set to something other than 0" test in a Makefile needs to be an ifneq($(CONFIG_ROCKCHIP_BOOT_MODE_REG), 0x0). This commit fixes mach-rockchip/Makefile and also resulting link issues (if boot_mode.o is not included) by defining a stub function (in case the functionality is not built in) for setup_boot_mode in boot_mode.h. Fixes: e306779 (rockchip: make boot_mode related codes reused across all platforms) Signed-off-by: Philipp Tomsich --- arch/arm/include/asm/arch-rockchip/boot_mode.h | 6 ++++++ arch/arm/mach-rockchip/Makefile | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-rockchip/boot_mode.h b/arch/arm/include/asm/arch-rockchip/boot_mode.h index 6b2a610..f3f62ee 100644 --- a/arch/arm/include/asm/arch-rockchip/boot_mode.h +++ b/arch/arm/include/asm/arch-rockchip/boot_mode.h @@ -19,7 +19,13 @@ #define BOOT_BROM_DOWNLOAD 0xEF08A53C #ifndef __ASSEMBLY__ + +#if (CONFIG_ROCKCHIP_BOOT_MODE_REG == 0) +static inline int setup_boot_mode(void) { return 0; }; +#else int setup_boot_mode(void); #endif #endif + +#endif diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 2127f2b..051d2a3 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -23,7 +23,7 @@ obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) -ifneq ($(CONFIG_ROCKCHIP_BOOT_MODE_REG),0) +ifneq ($(CONFIG_ROCKCHIP_BOOT_MODE_REG),0x0) obj-y += boot_mode.o endif