U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Adam Ford <aford173@gmail.com>
Cc: Tom Rini <trini@konsulko.com>,  Simon Glass <sjg@chromium.org>,
	 Jaehoon Chung <jh80.chung@samsung.com>,
	 Lukasz Majewski <lukma@denx.de>,
	 Sean Anderson <seanga2@gmail.com>,
	 Anatolij Gustschin <agust@denx.de>,
	 Fabio Estevm <festevam@gmail.com>,  Peng Fan <peng.fan@nxp.com>,
	 Mario Six <mario.six@gdsys.cc>,
	 Svyatoslav Ryhel <clamor95@gmail.com>,
	 Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 u-boot@lists.denx.de,  Ian Ray <ian.ray@gehealthcare.com>,
	 Michael Nazzareno Trimarchi <michael@amarulasolutions.com>,
	 Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	 Marek Vasut <marex@denx.de>
Subject: Re: [PATCH v6 09/12] imx: power-domain: Add support for the MEDIAMIX control block
Date: Fri, 04 Apr 2025 08:30:21 +0200	[thread overview]
Message-ID: <87plhszbeq.fsf@bootlin.com> (raw)
In-Reply-To: <CAHCN7xKD8AODyDNSz21aO5kDJD1FygKUcsfXsCXV+K59VdgWDw@mail.gmail.com> (Adam Ford's message of "Thu, 3 Apr 2025 07:57:53 -0500")

Hi Adam,

>> +       /* Enable upstream clocks */
>> +       ret = clk_enable(&priv->clk_apb);
>> +       if (ret)
>> +               goto dis_bus_pd;
>> +
>> +       ret = clk_enable(&priv->clk_axi);
>> +       if (ret)
>> +               goto dis_apb_clk;
>> +
>> +       /* Enable blk-ctrl clock to allow reset to propagate */
>> +       ret = clk_enable(clk);
>
> I am only offering a suggestion if you ever need to push another rev.
> It appears that all the clocks are either on or off and if any fail,
> you immediately turn off any clocks that were enabled.  There are some
> bulk clock options where you can basically tell the driver to turn
> them all on or all off.
>
> clk_get_bulk, clk_enable_bulk, clk_disable_bulk, and clk_release_all
> are the functions I am thinking of.  Your imx8mp_mediamix_priv
> structure could then replace all the individual clocks with struct
> clk_bulk.
>
> That might shrink the overall code and simplify the readability.

These bulk functions only work if you get all clocks from a list. We
currently do not want all the clocks (simply because some are useless in
this case and also because they have not yet been defined). The clks
property define all these:
"apb", "axi", "cam1", "cam2", "disp1", "disp2", "isp", "phy";

>> +       if (ret)
>> +               goto dis_axi_clk;
>> +       setbits_le32(priv->base + BLK_CLK_EN, reset);
>> +
>> +       /* Power up upstream GPC domain */
>> +       ret = power_domain_on(domain);
>> +       if (ret)
>> +               goto dis_lcdif_clk;
>> +
>> +       /* Wait for reset to propagate */
>> +       udelay(5);
>
> On Linux, the GPCv2 driver was updated to increase a delay from 5 to
> 10 uSeconds [1] .  I don't know if that's needed here, but it's
> something to consider.

Thanks a lot for the pointer, I will integrate this change, even if it
is experimental, let's spare ourselves a round of ghost bug hunting.

> adam
>
> [1] -
> https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/pmdomain/imx?h=next-20250403&id=2379fb937de5333991c567eefd7d11b98977d059

Thanks!
Miquèl

  reply	other threads:[~2025-04-04 12:35 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03  7:39 [PATCH v6 00/12] Add imx8mp video support Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 01/12] core: ofnode_graph: Fix a comment Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 02/12] dm: doc: Fix example Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 03/12] dm: core: Add a helper to retrieve devices through graph endpoints Miquel Raynal
2025-04-03  8:08   ` Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 04/12] test: dm: test-fdt: Add checks for uclass_get_device_by_endpoint() Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 05/12] power-domain: Add refcounting Miquel Raynal
2025-04-14 17:36   ` Francis, Neha
2025-04-14 18:07     ` Nishanth Menon
2025-04-14 20:06       ` Tom Rini
2025-04-14 21:00         ` Francesco Dolcini
2025-04-15  5:20           ` Neha Malcom Francis
2025-04-15  6:51             ` Francesco Dolcini
2025-04-15  8:15               ` Miquel Raynal
2025-04-15  8:59                 ` Neha Malcom Francis
2025-04-15  9:50                   ` Miquel Raynal
2025-04-15  9:59                     ` Neha Malcom Francis
2025-04-15 10:47                       ` Francesco Dolcini
2025-04-15 12:43                       ` Miquel Raynal
2025-04-16  7:46                         ` Neha Malcom Francis
2025-04-16  1:14   ` Samuel Holland
2025-04-16  8:36     ` Neha Malcom Francis
2025-04-16  9:06       ` Miquel Raynal
2025-04-16  9:50         ` Neha Malcom Francis
2025-04-16 13:20           ` Wadim Egorov
2025-04-16 15:49             ` Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 06/12] clk: Ensure the parent clocks are enabled while reparenting Miquel Raynal
2025-04-03 13:03   ` Adam Ford
2025-04-03  7:39 ` [PATCH v6 07/12] clk: imx8mp: Add media related clocks Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 08/12] imx: power-domain: Describe the i.MX8 MEDIAMIX domain Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 09/12] imx: power-domain: Add support for the MEDIAMIX control block Miquel Raynal
2025-04-03 12:57   ` Adam Ford
2025-04-04  6:30     ` Miquel Raynal [this message]
2025-04-03  7:39 ` [PATCH v6 10/12] video: imx: Fix Makefile in order to be able to add other imx drivers Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 11/12] video: imx: Add LDB driver Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 12/12] video: imx: Add LCDIF driver Miquel Raynal
2025-04-03 13:01   ` Adam Ford
2025-04-04  6:22     ` Miquel Raynal
2025-04-11 14:15 ` [PATCH v6 00/12] Add imx8mp video support Fabio Estevam

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=87plhszbeq.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=aford173@gmail.com \
    --cc=agust@denx.de \
    --cc=clamor95@gmail.com \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=festevam@gmail.com \
    --cc=ian.ray@gehealthcare.com \
    --cc=jh80.chung@samsung.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=mario.six@gdsys.cc \
    --cc=michael@amarulasolutions.com \
    --cc=peng.fan@nxp.com \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=trini@konsulko.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox