All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Ford <aford173@gmail.com>
To: Marek Vasut <marex@denx.de>
Cc: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	Stefano Babic <sbabic@denx.de>,
	 Fabio Estevam <festevam@gmail.com>,
	Olaf Mandel <o.mandel@menlosystems.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH 03/15] imx: imx8mm_mx8menlo: Enable DM_SERIAL
Date: Sat, 30 Apr 2022 13:40:41 -0500	[thread overview]
Message-ID: <CAHCN7xLh9bvS-qJFbXdst+v8PEzx0Cdap9mhT+ESGfwbOFZSNA@mail.gmail.com> (raw)
In-Reply-To: <930a599e-52c6-3d8b-ea86-70dd3bdcc9c8@denx.de>

On Sat, Apr 30, 2022 at 1:04 PM Marek Vasut <marex@denx.de> wrote:
>
> On 4/30/22 19:32, Adam Ford wrote:
> > On Sat, Apr 30, 2022 at 12:00 PM Marek Vasut <marex@denx.de> wrote:
> >>
> >> On 4/30/22 14:43, Peng Fan (OSS) wrote:
> >>> From: Peng Fan <peng.fan@nxp.com>
> >>>
> >>> Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already
> >>> marked with u-boot,dm-spl.
> >>>
> >>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> >>> ---
> >>>    board/menlo/mx8menlo/mx8menlo.c   | 9 ---------
> >>>    configs/imx8mm-mx8menlo_defconfig | 1 +
> >>>    include/configs/imx8mm-mx8menlo.h | 3 ---
> >>>    3 files changed, 1 insertion(+), 12 deletions(-)
> >>>
> >>> diff --git a/board/menlo/mx8menlo/mx8menlo.c b/board/menlo/mx8menlo/mx8menlo.c
> >>> index a4d0becdcc8..95ff95ad360 100644
> >>> --- a/board/menlo/mx8menlo/mx8menlo.c
> >>> +++ b/board/menlo/mx8menlo/mx8menlo.c
> >>> @@ -12,15 +12,8 @@
> >>>    #include <asm/mach-imx/iomux-v3.h>
> >>>    #include <spl.h>
> >>>
> >>> -#define UART_PAD_CTRL        (PAD_CTL_PUE | PAD_CTL_PE | PAD_CTL_DSE4)
> >>>    #define WDOG_PAD_CTRL       (PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
> >>>
> >>> -/* Verdin UART_3, Console/Debug UART */
> >>> -static iomux_v3_cfg_t const uart_pads[] = {
> >>> -     IMX8MM_PAD_SAI3_TXFS_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
> >>> -     IMX8MM_PAD_SAI3_TXC_UART2_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
> >>> -};
> >>> -
> >>>    static iomux_v3_cfg_t const wdog_pads[] = {
> >>>        IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
> >>>    };
> >>> @@ -48,8 +41,6 @@ void board_early_init(void)
> >>>
> >>>        set_wdog_reset(wdog);
> >>>
> >>> -     imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
> >>> -
> >>>        init_uart_clk(1);
> >>
> >> But that means the UART is available much later in SPL ?
> >>
> >> Also, init_uart_clk(1) still hard-codes UART number , can the UART
> >> driver init those UART clock instead too ?
> >
> > I just submitted an RFC to address that [1].  The RTC is based on the
> > work Peng did.
> >
> > If people are OK with my proposal or changing the serial driver, I can
> > work on porting the 8mn and 8mp clocks to let the drivers enable the
> > clocks.
> >
> > [1] - https://patchwork.ozlabs.org/project/uboot/patch/20220430161422.558361-2-aford173@gmail.com/
>
> That still works only after spl_early_init() is called, right ?

As far as I can tell, we need spl init to run to get the device tree
stuff functional in order to enable either the clocks or the serial
port.  However, I have noticed the README states that board_init_f
should not call board_init_r directly and BSS isn't not available.  It
seems like there might be more work to do on cleaning up the various
board_init_f functions.  It seems like everyone clears BSS and calls
board_init_r directly.

I wonder if we could consolidate all these boards files into a
platform specific startup function and let people who have
board-specific stuff they need done to do it in early init or
something.

adam

  reply	other threads:[~2022-04-30 18:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-30 12:43 [PATCH 00/15] imx8m: convert to DM_SERIAL Peng Fan (OSS)
2022-04-30 12:12 ` Fabio Estevam
2022-04-30 12:43 ` [PATCH 01/15] imx: imx8mp_rsb3720a1: " Peng Fan (OSS)
2022-04-30 12:43 ` [PATCH 02/15] imx: imx8m[m/n/p]_venice: Enable SPL_DM_SERIAL Peng Fan (OSS)
2022-05-02 16:59   ` Tim Harvey
2022-05-03  3:43     ` Peng Fan (OSS)
2022-04-30 12:43 ` [PATCH 03/15] imx: imx8mm_mx8menlo: Enable DM_SERIAL Peng Fan (OSS)
2022-04-30 17:00   ` Marek Vasut
2022-04-30 17:32     ` Adam Ford
2022-04-30 18:04       ` Marek Vasut
2022-04-30 18:40         ` Adam Ford [this message]
2022-04-30 12:43 ` [PATCH 04/15] imx: imx8m[m/n]_beacon: Enable SPL_DM_SERIAL Peng Fan (OSS)
2022-04-30 15:12   ` Adam Ford
2022-04-30 12:43 ` [PATCH 05/15] imx: imx8mm-cl-iot-gate: Enable DM_SERIAL Peng Fan (OSS)
2022-04-30 12:43 ` [PATCH 06/15] imx: imx8mm_icore: Enable SPL_DM_SERIAL Peng Fan (OSS)
2022-04-30 12:43 ` [PATCH 07/15] imx: imx8m[m/p]_phycore: Enable DM_SERIAL Peng Fan (OSS)
2022-05-02  6:48   ` Teresa Remmet
2022-04-30 12:43 ` [PATCH 08/15] imx: imx8mn_var_som: enable DM_SERIAL Peng Fan (OSS)
2022-05-02 18:58   ` Ariel D'Alessandro
2022-04-30 12:43 ` [PATCH 09/15] imx: imx8mm_edm_sbc: Enable SPL_DM_SERIAL Peng Fan (OSS)
2022-04-30 12:43 ` [PATCH 10/15] imx: kontron-sl-mx8mm: enable DM_SERIAL Peng Fan (OSS)
2022-05-03  6:31   ` Frieder Schrempf
2022-04-30 12:43 ` [PATCH 11/15] imx: imx8mn_bsh_smm_s2: drop CONFIG_MXC_UART_BASE Peng Fan (OSS)
2022-04-30 13:22   ` Michael Nazzareno Trimarchi
2022-05-03  4:20   ` Peng Fan (OSS)
2022-04-30 12:43 ` [PATCH 12/15] imx: dts: move common changes to imx8mq-u-boot.dtsi Peng Fan (OSS)
2022-04-30 12:43 ` [PATCH 13/15] imx: imx8mq-cm: enable CONFIG_DM_SERIAL Peng Fan (OSS)
2022-04-30 12:43 ` [PATCH 14/15] imx: imx8mq-pico: " Peng Fan (OSS)
2022-04-30 12:43 ` [PATCH 15/15] imx: imx8mq-phandle: " Peng Fan (OSS)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHCN7xLh9bvS-qJFbXdst+v8PEzx0Cdap9mhT+ESGfwbOFZSNA@mail.gmail.com \
    --to=aford173@gmail.com \
    --cc=festevam@gmail.com \
    --cc=marex@denx.de \
    --cc=o.mandel@menlosystems.com \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.