Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EEC42C433EF for ; Fri, 8 Apr 2022 00:15:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8140783D0B; Fri, 8 Apr 2022 02:15:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1649376921; bh=NCMtD6QbE9PaPPO8fSlTE/2xDK1ZY+kuGaDL3nB/Z8Y=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=BCc+cS1lc4l6DQhWotDtS4umyRCvsZZSg8O0DxXOjrqFKnZIUTLVtdasuDvKgNdpe 49d15OVH7brO58POHSNpfRMC0bDog43lmgWnI1j4UUGAjuY+EuFwSpvitzU6hUJMXZ RID5sLKi7PsPLBn8KsF080D73BZaPQ2+T2sA380OFeJX43r+v1v0YpQQ5KXAR+SWfR 5KRLlgPUPzjch2EZMR80Ax7PpPs1CYXDLrzOMJ+LXkxSQTFsRT0uUSre2bcU+QhAGn 1KFMTu+N92CpJB1bGrrVxR/fu06rFM70K1MhbSwxPvndOk08gCOZYmZB1k3T5yEbw0 1cLbRPerDtBRg== Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz [89.176.112.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 760EF839A1; Fri, 8 Apr 2022 02:15:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1649376919; bh=NCMtD6QbE9PaPPO8fSlTE/2xDK1ZY+kuGaDL3nB/Z8Y=; h=From:To:Cc:Subject:Date:From; b=W5iFLzzdaRgBOC+zxbSofTbg6eWsN4M6vyX6+XzF936c54Y5Gy8LIEgTpupKa0xIp i+JQYOsnqnL0hix/aaI8fTOX70H3KMrZIeBy9oJyM22wUmj9oL6F+RFfbjUD4aH3od avQgBsKkprAiNL1BN/e6vrggjgoL06z/I7omcsJDx5sZpn4VP5aTbgHYPf4HIbTSR1 rgwq/5LcrdA+k6szOYYrDQHxpkQ+SzMFFt8/MKq1sG6FKms+NPC6G7WfsMDridOwAb Xa7x3ssFHfEUKy2lwtr9YeCa/o2YEEPg+mtoTlCMn24ouQ5l1JmI5Rizf5xpv6mwjw pR7i18WyN5XOg== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Fabio Estevam , Marcel Ziswiler , Max Krummenacher , Peng Fan , Stefano Babic Subject: [PATCH 1/2] ARM: imx8mm: verdin-imx8mm: Rework board_early_init() Date: Fri, 8 Apr 2022 02:15:00 +0200 Message-Id: <20220408001501.662956-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Rename board_early_init_f() to board_early_init(), since this function has nothing to do with actual board_early_init_f() as used throughout U-Boot. The board_early_init() is function local to this board used to configure UART and WDT pinmux. Wrap init_uart_clk() into this function so that early UART init would be all in one place. Turn the function into __weak one, so it could be overridden in case custom carrier board uses different UART or needs custom IOMUX settings. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Marcel Ziswiler Cc: Max Krummenacher Cc: Peng Fan Cc: Stefano Babic --- board/toradex/verdin-imx8mm/spl.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c index 97d6a31da15..4e6128c3314 100644 --- a/board/toradex/verdin-imx8mm/spl.c +++ b/board/toradex/verdin-imx8mm/spl.c @@ -88,17 +88,17 @@ static iomux_v3_cfg_t const wdog_pads[] = { IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL), }; -int board_early_init_f(void) +__weak void board_early_init(void) { struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR; + init_uart_clk(0); + imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads)); set_wdog_reset(wdog); imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads)); - - return 0; } int power_init_board(void) @@ -140,9 +140,7 @@ void board_init_f(ulong dummy) arch_cpu_init(); - init_uart_clk(0); - - board_early_init_f(); + board_early_init(); timer_init(); -- 2.35.1