From patchwork Sat Feb 3 06:51:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wu X-Patchwork-Id: 868846 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 3zYPhv3L9Pz9t0m for ; Sat, 3 Feb 2018 17:54:07 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 1634CC21DD9; Sat, 3 Feb 2018 06:53:18 +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 548ADC21E13; Sat, 3 Feb 2018 06:52:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 52030C21E3B; Sat, 3 Feb 2018 06:52:09 +0000 (UTC) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.99.137]) by lists.denx.de (Postfix) with ESMTPS id CB511C21DE5 for ; Sat, 3 Feb 2018 06:52:05 +0000 (UTC) Received: from david.wu?rock-chips.com (unknown [192.168.167.73]) by regular1.263xmail.com (Postfix) with ESMTP id 37F24DA96; Sat, 3 Feb 2018 14:52:01 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 00EA039F; Sat, 3 Feb 2018 14:52:00 +0800 (CST) X-RL-SENDER: david.wu@rock-chips.com X-FST-TO: philipp.tomsich@theobroma-systems.com X-SENDER-IP: 220.200.40.59 X-LOGIN-NAME: david.wu@rock-chips.com X-UNIQUE-TAG: <9c3a411bcfa8fe7b2381b8c4536ee199> X-ATTACHMENT-NUM: 0 X-SENDER: wdc@rock-chips.com X-DNS-TYPE: 0 Received: from unknown (unknown [220.200.40.59]) by smtp.263.net (Postfix) whith SMTP id 194245IED9W; Sat, 03 Feb 2018 14:52:02 +0800 (CST) From: David Wu To: philipp.tomsich@theobroma-systems.com Date: Sat, 3 Feb 2018 14:51:28 +0800 Message-Id: <1517640695-30221-3-git-send-email-david.wu@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517640695-30221-1-git-send-email-david.wu@rock-chips.com> References: <1517640695-30221-1-git-send-email-david.wu@rock-chips.com> Cc: u-boot@lists.denx.de, David Wu Subject: [U-Boot] [PATCH 2/9] ARM: rockchip: rk3188: Remove the pinctrl setup and enable uart at SPL 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" When the boot ROM sets up MMC we don't need to do it again. Remove the MMC setup code entirely, but we also need to enable uart for debug message. Signed-off-by: David Wu Acked-by: Philipp Tomsich --- arch/arm/mach-rockchip/rk3188-board-spl.c | 42 +++---------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c index 8e3b8ae..8371a31 100644 --- a/arch/arm/mach-rockchip/rk3188-board-spl.c +++ b/arch/arm/mach-rockchip/rk3188-board-spl.c @@ -100,10 +100,11 @@ static int setup_arm_clock(void) void board_init_f(ulong dummy) { - struct udevice *pinctrl, *dev; + struct udevice *dev; int ret; /* Example code showing how to enable the debug UART on RK3188 */ +#define EARLY_UART #ifdef EARLY_UART #include /* Enable early UART on the RK3188 */ @@ -124,10 +125,7 @@ void board_init_f(ulong dummy) * printascii("string"); */ debug_uart_init(); - printch('s'); - printch('p'); - printch('l'); - printch('\n'); + printascii("U-Boot SPL board init"); #endif ret = spl_early_init(); @@ -144,12 +142,6 @@ void board_init_f(ulong dummy) return; } - ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl); - if (ret) { - debug("Pinctrl init failed: %d\n", ret); - return; - } - ret = uclass_get_device(UCLASS_RAM, 0, &dev); if (ret) { debug("DRAM init failed: %d\n", ret); @@ -187,7 +179,6 @@ static int setup_led(void) void spl_board_init(void) { - struct udevice *pinctrl; int ret; ret = setup_led(); @@ -196,36 +187,9 @@ void spl_board_init(void) hang(); } - ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl); - if (ret) { - debug("%s: Cannot find pinctrl device\n", __func__); - goto err; - } - -#ifdef CONFIG_SPL_MMC_SUPPORT - ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD); - if (ret) { - debug("%s: Failed to set up SD card\n", __func__); - goto err; - } -#endif - - /* Enable debug UART */ - ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG); - if (ret) { - debug("%s: Failed to set up console UART\n", __func__); - goto err; - } - preloader_console_init(); #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) back_to_bootrom(BROM_BOOT_NEXTSTAGE); #endif return; - -err: - printf("spl_board_init: Error %d\n", ret); - - /* No way to report error here */ - hang(); }