From patchwork Wed Dec 7 17:17:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 2515 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id E13523F042 for ; Wed, 7 Dec 2022 18:18:01 +0100 (CET) Received: by mail-ed1-f71.google.com with SMTP id r12-20020a05640251cc00b00463699c95aesf10440091edd.18 for ; Wed, 07 Dec 2022 09:18:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670433481; cv=pass; d=google.com; s=arc-20160816; b=BV4yPR3Y0MylNLHitvkEO1g3LScZHdkEx5+EJoSDMFTD/ilBpO+2HATk8OqeCOCrVd 0gucfmEqUeGSzFswzzuARrtlk0vDR1yacWvYrKkZHAM++b0fSTJGckyAOuSGUeior/hl vKZ/tHjY/6vdOpM3BqnaEXE8EvwYxs7yOysyMJmWUxeXsMX9/14AoehbCb0GD30swJ/o BPcAxcH/egVy8VLiyp+9WdTEGXItAGwnsM4LWRzKleOPl1L8sxjBLI1H1o6hppT4E3vB azq6cdY24YX4ILrBvVAfKQ7r5+smrn9rIb7vzeW581PHkaEdmtALXKbGip8E/lbuR+ED 0KHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=d6MM1IxQgQ/8tSF2+NgHgH9pM3o7PNaVv03jvzsst4U=; b=gX2uA9+WIgKIo/tubSk2+4F7/wcxZ8QRbdjees4A5kjIvxasoIXpXblrbaThUJ1BBO T+EDJnpRLB1CBQnJK1rzscLmzloCFe0m+lQrPgXP2fleyPgIe/rrmBAAK8IuPUQ4E4Om 1WDXqnN4iUMLkoJkeKkeTW3T3IN0Y7n3ZZQVOeqFoO8G4Vhxnmtvue1G/R9KKlrPNErb oHEblBwh+VxE2l+llYrcU4sNRODZAsstJpOEXvayMvLpKbNqn3GIi+Bc48eUN5IN6tZx 3GPBO/NrpLUWLrMOJY1apR7C5vebfJ1UHf55zCFliBAyiE9jdm8YnA/8lEbcM3AfUOct 8HcA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RjBadDdI; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=d6MM1IxQgQ/8tSF2+NgHgH9pM3o7PNaVv03jvzsst4U=; b=iHFu2il23NsXTovcWhV9uq9EudaWiTUKLF7l3EuoVSUE9Lt+5idX+cMlX9z+0oRrUf UEWXrdTKgzdwbXkCsgKcVrJBe/AenOubk7uprbv2Ti59RUeG9YvNZ8fMvOJHzG4qx+ZV nRTQACjosDLOMe3XodmsjIiGtMHyUoaayZxKA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d6MM1IxQgQ/8tSF2+NgHgH9pM3o7PNaVv03jvzsst4U=; b=AFQ5kcBkdISREx8FWjq8deO9kqQqxBJ0FJQPRECzx0UF9H7euS1zAXh/NvMsdGVRkr 9jiG6vHlQK/Rmv2YcAlMSli044kqtbErQoBUJscJpjLNdIqlrn+PLT82MXvuY3NfotuS DvbbDEv3HGlh3I+Jl5bNKdlIxbJ0yfEh5rBjd+W1fKD9/qB8RlALwrroX8qR8Jcrk3km TcLDI35ATRNZTe0BHUmaEKe4VJyDvFe4D2bFP5ae2jf9KfAws/XfLoPlfZ3wN2zzmhNZ cZIKdUd1894KCSDxNhOIrkVDhUAo96mF3dRgabHLak9fakTVzJY0WQQdBGcIhEwYKFHt /K0A== X-Gm-Message-State: ANoB5pmaPSiJ4TyhjnOOxffYJ83+T7l5kdl7eiUrNaE5bmWsUyWZ0uCd K/lKTBSGCoRfGqYY11PyoaECJZkj X-Google-Smtp-Source: AA0mqf7MfnNDrZtEUvvMhzI/G6mT3SUxh9zsOEbLngS4JDhrAWij9mDs/JBXz5qAnakw7vIJvkzTXA== X-Received: by 2002:a05:6402:25c5:b0:46c:211:f9b8 with SMTP id x5-20020a05640225c500b0046c0211f9b8mr17463392edb.199.1670433481494; Wed, 07 Dec 2022 09:18:01 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:40d5:b0:461:bb4b:90b1 with SMTP id z21-20020a05640240d500b00461bb4b90b1ls3121535edb.1.-pod-prod-gmail; Wed, 07 Dec 2022 09:18:00 -0800 (PST) X-Received: by 2002:a50:fd9a:0:b0:46c:9976:8f53 with SMTP id o26-20020a50fd9a000000b0046c99768f53mr14230559edt.180.1670433480083; Wed, 07 Dec 2022 09:18:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670433480; cv=none; d=google.com; s=arc-20160816; b=qvL7jXe5GCNs1uN0350B9p/CZPGERUWL7hYhgjC0PFNLHWPCrBJFxG9Om0Q/ppj8AN xVlWVFdphTYBF77CdXQPABBWA1VCZd1UxthBr+Se3SFVaWF3IADWWpKO7HNdczEjAq8O Jho1G+OcLqEA8ZeoHpIzLZMuOC9p/JfBQJ5m8yYDmts/doN7gdoWWMfQpFtmCV0+VIQk WcvQ7dm+jyCFi3l5b1bsq97WmQJdLRM+gBsUBLocoQfbmmmmjjcoqMaHFIiBYLcfqxyu ONFxkxxWuecnoKKGyfqGcIbKUvGWpePmMFZS+lkEuw9AjBr6yWFVHxwOtcRbiXXArJWJ FUcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=0X2LbQK47lrZ1t99pgd5z+fkb3betyd9Q/qtySeFoNQ=; b=wF1TNqj18xPtF4Kgjc2V88Ou9v4N71KD0lwsUscFASmimeYtiS0zLXtDMdqHiDb7/S /+zYIDFsBDC7D15lacj26VZrsrryCIfB0WIlOj8MTn1beH6NFHd21J+QbJluF+qlNoog z3lgHzL6F1ltu8Ummksvmr1iTEPeV2/C2YijkHW3wx7rNJHSorBfrUFM+w3YoG9SDPXo ICXzpFpHmvFIja0+BH24gcGURCKkfIeZtS7FJglXwHcIYkC+Rry53+4rNTR2r3mJGyLw wIOk7m3iIKT/SLWd5c7fnuLjPAYak4G0Vrffbwk0QAzwezzslLBbTZBQ4o3nsTNZ3pjt Xhxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RjBadDdI; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id qf34-20020a1709077f2200b00780b1e5a362sor10433253ejc.8.2022.12.07.09.18.00 for (Google Transport Security); Wed, 07 Dec 2022 09:18:00 -0800 (PST) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:906:da06:b0:7c1:1fd1:8a87 with SMTP id fi6-20020a170906da0600b007c11fd18a87mr2703690ejb.674.1670433479729; Wed, 07 Dec 2022 09:17:59 -0800 (PST) Received: from panicking.amarulasolutions.com (mob-37-180-13-63.net.vodafone.it. [37.180.13.63]) by smtp.gmail.com with ESMTPSA id vs19-20020a170907139300b007bee745759bsm8726704ejb.20.2022.12.07.09.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 09:17:59 -0800 (PST) From: Michael Trimarchi To: Dario Binacchi Cc: linux-amarula@amarulasolutions.com, abbaraju.manojsai@amarulasolutions.com, sunil@amarulasolutions.com Subject: [PATCH] engicam: imx6: migrate to DM_SERIAL Date: Wed, 7 Dec 2022 18:17:57 +0100 Message-Id: <20221207171757.341833-1-michael@amarulasolutions.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RjBadDdI; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add the needed DT overrides and configs to enable UART in SPL. Cc: Fabio Estevam Signed-off-by: Michael Trimarchi --- arch/arm/dts/imx6qdl-icore-u-boot.dtsi | 16 ++++++++++++++++ arch/arm/dts/imx6ul-isiot-u-boot.dtsi | 16 ++++++++++++++++ board/engicam/common/spl.c | 20 +++----------------- configs/imx6dl_icore_nand_defconfig | 1 + configs/imx6q_icore_nand_defconfig | 1 + configs/imx6qdl_icore_mipi_defconfig | 1 + configs/imx6qdl_icore_mmc_defconfig | 1 + configs/imx6qdl_icore_nand_defconfig | 1 + configs/imx6qdl_icore_rqs_defconfig | 1 + 9 files changed, 41 insertions(+), 17 deletions(-) diff --git a/arch/arm/dts/imx6qdl-icore-u-boot.dtsi b/arch/arm/dts/imx6qdl-icore-u-boot.dtsi index f95d49d00d..12e46e38f6 100644 --- a/arch/arm/dts/imx6qdl-icore-u-boot.dtsi +++ b/arch/arm/dts/imx6qdl-icore-u-boot.dtsi @@ -5,6 +5,22 @@ #include "imx6qdl-u-boot.dtsi" +&soc { + u-boot,dm-pre-reloc; +}; + +&aips1 { + u-boot,dm-pre-reloc; +}; + +&pinctrl_uart4 { + u-boot,dm-pre-reloc; +}; + +&uart4 { + u-boot,dm-pre-reloc; +}; + &usdhc1 { u-boot,dm-spl; }; diff --git a/arch/arm/dts/imx6ul-isiot-u-boot.dtsi b/arch/arm/dts/imx6ul-isiot-u-boot.dtsi index aa8e9804bf..7213e71989 100644 --- a/arch/arm/dts/imx6ul-isiot-u-boot.dtsi +++ b/arch/arm/dts/imx6ul-isiot-u-boot.dtsi @@ -5,6 +5,22 @@ #include "imx6ul-u-boot.dtsi" +&soc { + u-boot,dm-pre-reloc; +}; + +&aips1 { + u-boot,dm-pre-reloc; +}; + +&pinctrl_uart1 { + u-boot,dm-pre-reloc; +}; + +&uart1 { + u-boot,dm-pre-reloc; +}; + &usdhc1 { u-boot,dm-spl; }; diff --git a/board/engicam/common/spl.c b/board/engicam/common/spl.c index 6a0612481a..f1ccdc3343 100644 --- a/board/engicam/common/spl.c +++ b/board/engicam/common/spl.c @@ -26,20 +26,6 @@ #include #include -#define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ - PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ - PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS) - -static iomux_v3_cfg_t const uart_pads[] = { -#ifdef CONFIG_MX6QDL - IOMUX_PADS(PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)), - IOMUX_PADS(PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)), -#elif CONFIG_MX6UL - IOMUX_PADS(PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL)), - IOMUX_PADS(PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL)), -#endif -}; - #ifdef CONFIG_SPL_LOAD_FIT int board_fit_config_name_match(const char *name) { @@ -421,12 +407,12 @@ void board_init_f(ulong dummy) if (!(is_mx6ul())) gpr_init(); - /* iomux */ - SETUP_IOMUX_PADS(uart_pads); - /* setup GP timer */ timer_init(); + /* Enable device tree and early DM support*/ + spl_early_init(); + /* UART clocks enabled and gd valid - init serial console */ preloader_console_init(); diff --git a/configs/imx6dl_icore_nand_defconfig b/configs/imx6dl_icore_nand_defconfig index fe4866e2f5..af5873a784 100644 --- a/configs/imx6dl_icore_nand_defconfig +++ b/configs/imx6dl_icore_nand_defconfig @@ -66,6 +66,7 @@ CONFIG_FEC_MXC=y CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y +CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_VIDEO=y diff --git a/configs/imx6q_icore_nand_defconfig b/configs/imx6q_icore_nand_defconfig index 2cb995e7ae..8535627049 100644 --- a/configs/imx6q_icore_nand_defconfig +++ b/configs/imx6q_icore_nand_defconfig @@ -67,6 +67,7 @@ CONFIG_FEC_MXC=y CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y +CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_VIDEO=y diff --git a/configs/imx6qdl_icore_mipi_defconfig b/configs/imx6qdl_icore_mipi_defconfig index 90eb153c45..8dd5e89511 100644 --- a/configs/imx6qdl_icore_mipi_defconfig +++ b/configs/imx6qdl_icore_mipi_defconfig @@ -74,5 +74,6 @@ CONFIG_FEC_MXC=y CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y +CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig index 9f6d29a268..46497fbde1 100644 --- a/configs/imx6qdl_icore_mmc_defconfig +++ b/configs/imx6qdl_icore_mmc_defconfig @@ -90,6 +90,7 @@ CONFIG_FEC_MXC=y CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y +CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_VIDEO=y diff --git a/configs/imx6qdl_icore_nand_defconfig b/configs/imx6qdl_icore_nand_defconfig index 2cb995e7ae..8535627049 100644 --- a/configs/imx6qdl_icore_nand_defconfig +++ b/configs/imx6qdl_icore_nand_defconfig @@ -67,6 +67,7 @@ CONFIG_FEC_MXC=y CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y +CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_VIDEO=y diff --git a/configs/imx6qdl_icore_rqs_defconfig b/configs/imx6qdl_icore_rqs_defconfig index ee2c597bcb..3bab6739d0 100644 --- a/configs/imx6qdl_icore_rqs_defconfig +++ b/configs/imx6qdl_icore_rqs_defconfig @@ -72,4 +72,5 @@ CONFIG_FEC_MXC=y CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y +CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y