* [PATCH master] clk: imx6: fix PLL exception for i.MX6DQ revision 1.0
@ 2022-02-02 19:55 Ahmad Fatoum
2022-02-03 10:14 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2022-02-02 19:55 UTC (permalink / raw)
To: barebox; +Cc: ore, uol, Ahmad Fatoum
cpu_is_mx6* and imx_silicon_revision access static variables only
initialized in imx_init(). Use the alternative functions instead, that
will always consult the hardware to determine the version.
This requires us to know beforehand that we run on an i.MX6, but this
is a given when probing the imx6-ccm driver.
Other instances of this issue were removed in 37bc313add40 ("clk: imx6:
fix use of cpu_is_mx6* before they are initialized"), but this instance
was reintroduced as part of b534f79112f0 ("clk: imx6: Fix procedure to
switch the parent of LDB_DI_CLK").
This change only affects i.MX6D/Q SoCs with exactly revision 1.0 and
aligns their behavior to that of the Linux clock driver.
Fixes: b534f79112f0 ("clk: imx6: Fix procedure to switch the parent of LDB_DI_CLK")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/clk/imx/clk-imx6.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/imx/clk-imx6.c b/drivers/clk/imx/clk-imx6.c
index 6935a8e85292..e3afcf7858bb 100644
--- a/drivers/clk/imx/clk-imx6.c
+++ b/drivers/clk/imx/clk-imx6.c
@@ -60,8 +60,8 @@ static inline int cpu_mx6_is_plus(void)
/* Audio/Video PLL post dividers don't work on i.MX6q revision 1.0 */
static inline int cpu_has_working_video_pll_post_div(void) {
- return !((cpu_is_mx6q() || cpu_is_mx6d()) &&
- imx_silicon_revision() == IMX_CHIP_REV_1_0);
+ return !((cpu_mx6_is_mx6q() || cpu_mx6_is_mx6d()) &&
+ __imx6_cpu_revision() == IMX_CHIP_REV_1_0);
}
/* i.MX6 Quad/Dual/DualLite/Solo are all affected */
--
2.30.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH master] clk: imx6: fix PLL exception for i.MX6DQ revision 1.0
2022-02-02 19:55 [PATCH master] clk: imx6: fix PLL exception for i.MX6DQ revision 1.0 Ahmad Fatoum
@ 2022-02-03 10:14 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2022-02-03 10:14 UTC (permalink / raw)
To: Ahmad Fatoum; +Cc: barebox, ore, uol
On Wed, Feb 02, 2022 at 08:55:24PM +0100, Ahmad Fatoum wrote:
> cpu_is_mx6* and imx_silicon_revision access static variables only
> initialized in imx_init(). Use the alternative functions instead, that
> will always consult the hardware to determine the version.
> This requires us to know beforehand that we run on an i.MX6, but this
> is a given when probing the imx6-ccm driver.
>
> Other instances of this issue were removed in 37bc313add40 ("clk: imx6:
> fix use of cpu_is_mx6* before they are initialized"), but this instance
> was reintroduced as part of b534f79112f0 ("clk: imx6: Fix procedure to
> switch the parent of LDB_DI_CLK").
>
> This change only affects i.MX6D/Q SoCs with exactly revision 1.0 and
> aligns their behavior to that of the Linux clock driver.
>
> Fixes: b534f79112f0 ("clk: imx6: Fix procedure to switch the parent of LDB_DI_CLK")
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> drivers/clk/imx/clk-imx6.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/drivers/clk/imx/clk-imx6.c b/drivers/clk/imx/clk-imx6.c
> index 6935a8e85292..e3afcf7858bb 100644
> --- a/drivers/clk/imx/clk-imx6.c
> +++ b/drivers/clk/imx/clk-imx6.c
> @@ -60,8 +60,8 @@ static inline int cpu_mx6_is_plus(void)
>
> /* Audio/Video PLL post dividers don't work on i.MX6q revision 1.0 */
> static inline int cpu_has_working_video_pll_post_div(void) {
> - return !((cpu_is_mx6q() || cpu_is_mx6d()) &&
> - imx_silicon_revision() == IMX_CHIP_REV_1_0);
> + return !((cpu_mx6_is_mx6q() || cpu_mx6_is_mx6d()) &&
> + __imx6_cpu_revision() == IMX_CHIP_REV_1_0);
> }
>
> /* i.MX6 Quad/Dual/DualLite/Solo are all affected */
> --
> 2.30.2
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-03 10:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 19:55 [PATCH master] clk: imx6: fix PLL exception for i.MX6DQ revision 1.0 Ahmad Fatoum
2022-02-03 10:14 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox