From mboxrd@z Thu Jan 1 00:00:00 1970 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 1AE28C433F5 for ; Fri, 15 Apr 2022 05:23:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9E1E882A53; Fri, 15 Apr 2022 07:23:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="o5F7bfWV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1870683879; Fri, 15 Apr 2022 07:23:54 +0200 (CEST) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 82D2182A3A for ; Fri, 15 Apr 2022 07:23:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@amarulasolutions.com Received: by mail-wr1-x42f.google.com with SMTP id w4so9413641wrg.12 for ; Thu, 14 Apr 2022 22:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RfzjuzVczfnRVu58mvU0iCEZX3m1WuTflyKsgJyYzPw=; b=o5F7bfWVgVYKJVbyPmGawBWaaQ5KoRLRBMtVCfT+makxT44BpgLp34A11WpkLu5QSJ 4tpoq2xqACK5pKEN5497qrEqNgmaASwcbqet/jmph1cVVjXDYZ9V73f1VjtvkevtD+wK F03UfjQgcm7lO/nqMouhmqxe0nJAHCx0s7Ij4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RfzjuzVczfnRVu58mvU0iCEZX3m1WuTflyKsgJyYzPw=; b=dth2p8NOIqtY1nI4mVG4WcNCVFFzZ6LxYYxh+aIWJZ8T8SlQvd33v9c+c4LZOKSpti 5UgyS0cz7GsA/qPlMoyqsOcU+OfPbdngFq0Ac49vWVhnJzWaLxNmO5D2tA1LNhetuFGT 7NDqQvlijmxAFF1oHwUQVNzYHJoYEZHoDpRr6KTfOaGGixzwVLI6UM2fg5OKe+SKYTQ/ 17FzvyXaVCBIo8p4HyTysRyzBe1xsgRA1aOOdbglE7j+Kv7tEwUADW397euTGTW4UYwA 6wv2Akkg4+vGPiu791f1L3A2SE3fnv+iqAz1t1CLoBtTl0XhTmVHFnPsEibHi7sWKHCC xTJA== X-Gm-Message-State: AOAM532F+4/3VEiCIjQgnLidu2NZPyKfyee38cySEbSQ8liQxCh5BXmM lXivVJBYtpbj4efscjflXuR4cw== X-Google-Smtp-Source: ABdhPJxveHy3fZ26riTZaU5T1N49szXL3ulkhRI/Vx7BnFFoKYaRutqBXwXK5FQYOfLTGpdW49g0Eg== X-Received: by 2002:a5d:6b4f:0:b0:204:48d5:7930 with SMTP id x15-20020a5d6b4f000000b0020448d57930mr4278671wrw.354.1650000230927; Thu, 14 Apr 2022 22:23:50 -0700 (PDT) Received: from panicking.amarulasolutions.com ([2.198.243.233]) by smtp.gmail.com with ESMTPSA id v14-20020a7bcb4e000000b0034492fa24c6sm4016750wmj.34.2022.04.14.22.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Apr 2022 22:23:50 -0700 (PDT) From: Michael Trimarchi To: Stefano Babic , Ariel D'Alessandro Cc: Fabio Estevam , u-boot , Tim Harvey Subject: [PATCH V2] board: bsh: imx8mn_bsh_smm_s2/s2pro: enable DM_SERIAL Date: Fri, 15 Apr 2022 07:23:48 +0200 Message-Id: <20220415052348.300768-1-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.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 Enable DM_SERIAL for both U_Boot and the SPL. The uart2 and its pinmux are already marked with u-boot,dm-spl but we need to move the call to preloader_console_init() after spl_init() to avoid a board hang as dm can't be used until after spl_init(). Remove the manual config of the UART pinmux now that it is no longer needed. Signed-off-by: Michael Trimarchi Cc: Tim Harvey --- V1->V2: - Follow Tim Harvery suggestion on Peng change - Adjust the commit message as Tim --- board/bsh/imx8mn_smm_s2/spl.c | 11 ++--------- configs/imx8mn_bsh_smm_s2_defconfig | 1 + configs/imx8mn_bsh_smm_s2pro_defconfig | 1 + 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/board/bsh/imx8mn_smm_s2/spl.c b/board/bsh/imx8mn_smm_s2/spl.c index 5f04731d72..0f61acc630 100644 --- a/board/bsh/imx8mn_smm_s2/spl.c +++ b/board/bsh/imx8mn_smm_s2/spl.c @@ -40,14 +40,8 @@ void spl_board_init(void) puts("Failed to find clock node. Check device tree\n"); } -#define UART_PAD_CTRL (PAD_CTL_DSE6 | PAD_CTL_FSEL1) #define WDOG_PAD_CTRL (PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE) -static const iomux_v3_cfg_t uart_pads[] = { - IMX8MN_PAD_UART4_RXD__UART4_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL), - IMX8MN_PAD_UART4_TXD__UART4_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL), -}; - static const iomux_v3_cfg_t wdog_pads[] = { IMX8MN_PAD_GPIO1_IO02__WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL), }; @@ -59,7 +53,6 @@ int board_early_init_f(void) 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)); init_uart_clk(3); if (IS_ENABLED(CONFIG_NAND_MXS)) { @@ -82,14 +75,14 @@ void board_init_f(ulong dummy) timer_init(); - preloader_console_init(); - ret = spl_init(); if (ret) { debug("spl_init() failed: %d\n", ret); hang(); } + preloader_console_init(); + /* DDR initialization */ spl_dram_init(); diff --git a/configs/imx8mn_bsh_smm_s2_defconfig b/configs/imx8mn_bsh_smm_s2_defconfig index 3d67079a46..e864685a62 100644 --- a/configs/imx8mn_bsh_smm_s2_defconfig +++ b/configs/imx8mn_bsh_smm_s2_defconfig @@ -80,6 +80,7 @@ CONFIG_SPL_DM_PMIC_BD71837=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y +CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y CONFIG_SYSRESET=y CONFIG_SYSRESET_PSCI=y diff --git a/configs/imx8mn_bsh_smm_s2pro_defconfig b/configs/imx8mn_bsh_smm_s2pro_defconfig index c5809f5d4b..dfc9c93809 100644 --- a/configs/imx8mn_bsh_smm_s2pro_defconfig +++ b/configs/imx8mn_bsh_smm_s2pro_defconfig @@ -77,6 +77,7 @@ CONFIG_SPL_DM_PMIC_BD71837=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y +CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y CONFIG_SYSRESET=y CONFIG_SYSRESET_PSCI=y -- 2.25.1