mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v4] ARM: i.MX8M: separate function call for clock_init
@ 2023-01-11 11:37 Johannes Schneider
  2023-01-11 11:43 ` Ahmad Fatoum
  2023-01-12 15:01 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Schneider @ 2023-01-11 11:37 UTC (permalink / raw)
  To: barebox; +Cc: Johannes Schneider

Add a separate function call for imx8mp_early_clock_init, to avoid
confusion with imx8mm.

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
---
 arch/arm/boards/nxp-imx8mp-evk/lowlevel.c       |  2 +-
 arch/arm/boards/tqma8mpxl/lowlevel.c            |  2 +-
 arch/arm/mach-imx/imx8m.c                       | 12 +++++++++---
 arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h |  1 +
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
index 4f24dd4cd4..3cb24df1ca 100644
--- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
@@ -72,7 +72,7 @@ static void power_init_board(void)
 	imx8mp_setup_pad(MX8MP_PAD_I2C1_SCL__I2C1_SCL | I2C_PAD_CTRL);
 	imx8mp_setup_pad(MX8MP_PAD_I2C1_SDA__I2C1_SDA | I2C_PAD_CTRL);
 
-	imx8mm_early_clock_init();
+	imx8mp_early_clock_init();
 	imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_I2C1);
 
 	i2c = imx8m_i2c_early_init(IOMEM(MX8MP_I2C1_BASE_ADDR));
diff --git a/arch/arm/boards/tqma8mpxl/lowlevel.c b/arch/arm/boards/tqma8mpxl/lowlevel.c
index 0ce0e7a73b..037c7abf4b 100644
--- a/arch/arm/boards/tqma8mpxl/lowlevel.c
+++ b/arch/arm/boards/tqma8mpxl/lowlevel.c
@@ -73,7 +73,7 @@ static void power_init_board(void)
 	imx8mp_setup_pad(MX8MP_PAD_I2C1_SCL__I2C1_SCL | I2C_PAD_CTRL);
 	imx8mp_setup_pad(MX8MP_PAD_I2C1_SDA__I2C1_SDA | I2C_PAD_CTRL);
 
-	imx8mm_early_clock_init();
+	imx8mp_early_clock_init();
 	imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_I2C1);
 
 	i2c = imx8m_i2c_early_init(IOMEM(MX8MP_I2C1_BASE_ADDR));
diff --git a/arch/arm/mach-imx/imx8m.c b/arch/arm/mach-imx/imx8m.c
index 9758525b54..7f3856e545 100644
--- a/arch/arm/mach-imx/imx8m.c
+++ b/arch/arm/mach-imx/imx8m.c
@@ -182,7 +182,7 @@ int imx8mq_init(void)
 #define IMX8MM_CCM_ANALOG_SYS_PLL2_GEN_CTRL	0x104
 #define IMX8MM_CCM_ANALOG_SYS_PLL3_GEN_CTRL	0x114
 
-static void __imx8mm_early_clock_init(unsigned long pll3_freq) /* and later */
+static void __imx8m_early_clock_init(unsigned long pll3_freq) /* and later */
 {
 	void __iomem *ana = IOMEM(MX8M_ANATOP_BASE_ADDR);
 	void __iomem *ccm = IOMEM(MX8M_CCM_BASE_ADDR);
@@ -252,14 +252,20 @@ static void __imx8mm_early_clock_init(unsigned long pll3_freq) /* and later */
 
 void imx8mm_early_clock_init(void)
 {
-	__imx8mm_early_clock_init(750000000UL);
+	__imx8m_early_clock_init(750000000UL);
 }
 
 void imx8mn_early_clock_init(void)
 {
-	__imx8mm_early_clock_init(600000000UL);
+	__imx8m_early_clock_init(600000000UL);
 }
 
+void imx8mp_early_clock_init(void)
+{
+	__imx8m_early_clock_init(750000000UL);
+}
+
+
 #define KEEP_ALIVE			0x18
 #define VER_L				0x1c
 #define VER_H				0x20
diff --git a/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h b/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h
index eeb15f4dd0..659615e1cc 100644
--- a/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h
@@ -53,6 +53,7 @@
 void imx8m_early_setup_uart_clock(void);
 void imx8mm_early_clock_init(void);
 void imx8mn_early_clock_init(void);
+void imx8mp_early_clock_init(void);
 void imx8m_clock_set_target_val(int clock_id, u32 val);
 void imx8m_ccgr_clock_enable(int index);
 void imx8m_ccgr_clock_disable(int index);
-- 
2.25.1




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] ARM: i.MX8M: separate function call for clock_init
  2023-01-11 11:37 [PATCH v4] ARM: i.MX8M: separate function call for clock_init Johannes Schneider
@ 2023-01-11 11:43 ` Ahmad Fatoum
  2023-01-12 15:01 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-01-11 11:43 UTC (permalink / raw)
  To: Johannes Schneider, barebox

On 11.01.23 12:37, Johannes Schneider wrote:
> Add a separate function call for imx8mp_early_clock_init, to avoid
> confusion with imx8mm.
> 
> Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---

Tip: You can add --- at the end of your git commit message to include
changelog information in your git history. When you send out the patch,
the information will be sent out as well, but if you apply it, the changelog
will be discarded. I find this very convenient to keep track of changes.

Cheers,
Ahmad

>  arch/arm/boards/nxp-imx8mp-evk/lowlevel.c       |  2 +-
>  arch/arm/boards/tqma8mpxl/lowlevel.c            |  2 +-
>  arch/arm/mach-imx/imx8m.c                       | 12 +++++++++---
>  arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h |  1 +
>  4 files changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> index 4f24dd4cd4..3cb24df1ca 100644
> --- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> +++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> @@ -72,7 +72,7 @@ static void power_init_board(void)
>  	imx8mp_setup_pad(MX8MP_PAD_I2C1_SCL__I2C1_SCL | I2C_PAD_CTRL);
>  	imx8mp_setup_pad(MX8MP_PAD_I2C1_SDA__I2C1_SDA | I2C_PAD_CTRL);
>  
> -	imx8mm_early_clock_init();
> +	imx8mp_early_clock_init();
>  	imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_I2C1);
>  
>  	i2c = imx8m_i2c_early_init(IOMEM(MX8MP_I2C1_BASE_ADDR));
> diff --git a/arch/arm/boards/tqma8mpxl/lowlevel.c b/arch/arm/boards/tqma8mpxl/lowlevel.c
> index 0ce0e7a73b..037c7abf4b 100644
> --- a/arch/arm/boards/tqma8mpxl/lowlevel.c
> +++ b/arch/arm/boards/tqma8mpxl/lowlevel.c
> @@ -73,7 +73,7 @@ static void power_init_board(void)
>  	imx8mp_setup_pad(MX8MP_PAD_I2C1_SCL__I2C1_SCL | I2C_PAD_CTRL);
>  	imx8mp_setup_pad(MX8MP_PAD_I2C1_SDA__I2C1_SDA | I2C_PAD_CTRL);
>  
> -	imx8mm_early_clock_init();
> +	imx8mp_early_clock_init();
>  	imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_I2C1);
>  
>  	i2c = imx8m_i2c_early_init(IOMEM(MX8MP_I2C1_BASE_ADDR));
> diff --git a/arch/arm/mach-imx/imx8m.c b/arch/arm/mach-imx/imx8m.c
> index 9758525b54..7f3856e545 100644
> --- a/arch/arm/mach-imx/imx8m.c
> +++ b/arch/arm/mach-imx/imx8m.c
> @@ -182,7 +182,7 @@ int imx8mq_init(void)
>  #define IMX8MM_CCM_ANALOG_SYS_PLL2_GEN_CTRL	0x104
>  #define IMX8MM_CCM_ANALOG_SYS_PLL3_GEN_CTRL	0x114
>  
> -static void __imx8mm_early_clock_init(unsigned long pll3_freq) /* and later */
> +static void __imx8m_early_clock_init(unsigned long pll3_freq) /* and later */
>  {
>  	void __iomem *ana = IOMEM(MX8M_ANATOP_BASE_ADDR);
>  	void __iomem *ccm = IOMEM(MX8M_CCM_BASE_ADDR);
> @@ -252,14 +252,20 @@ static void __imx8mm_early_clock_init(unsigned long pll3_freq) /* and later */
>  
>  void imx8mm_early_clock_init(void)
>  {
> -	__imx8mm_early_clock_init(750000000UL);
> +	__imx8m_early_clock_init(750000000UL);
>  }
>  
>  void imx8mn_early_clock_init(void)
>  {
> -	__imx8mm_early_clock_init(600000000UL);
> +	__imx8m_early_clock_init(600000000UL);
>  }
>  
> +void imx8mp_early_clock_init(void)
> +{
> +	__imx8m_early_clock_init(750000000UL);
> +}
> +
> +
>  #define KEEP_ALIVE			0x18
>  #define VER_L				0x1c
>  #define VER_H				0x20
> diff --git a/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h b/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h
> index eeb15f4dd0..659615e1cc 100644
> --- a/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h
> +++ b/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h
> @@ -53,6 +53,7 @@
>  void imx8m_early_setup_uart_clock(void);
>  void imx8mm_early_clock_init(void);
>  void imx8mn_early_clock_init(void);
> +void imx8mp_early_clock_init(void);
>  void imx8m_clock_set_target_val(int clock_id, u32 val);
>  void imx8m_ccgr_clock_enable(int index);
>  void imx8m_ccgr_clock_disable(int index);

-- 
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 |




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] ARM: i.MX8M: separate function call for clock_init
  2023-01-11 11:37 [PATCH v4] ARM: i.MX8M: separate function call for clock_init Johannes Schneider
  2023-01-11 11:43 ` Ahmad Fatoum
@ 2023-01-12 15:01 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2023-01-12 15:01 UTC (permalink / raw)
  To: Johannes Schneider; +Cc: barebox

On Wed, Jan 11, 2023 at 12:37:29PM +0100, Johannes Schneider wrote:
> Add a separate function call for imx8mp_early_clock_init, to avoid
> confusion with imx8mm.
> 
> Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
> ---
>  arch/arm/boards/nxp-imx8mp-evk/lowlevel.c       |  2 +-
>  arch/arm/boards/tqma8mpxl/lowlevel.c            |  2 +-
>  arch/arm/mach-imx/imx8m.c                       | 12 +++++++++---
>  arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h |  1 +
>  4 files changed, 12 insertions(+), 5 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> index 4f24dd4cd4..3cb24df1ca 100644
> --- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> +++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
> @@ -72,7 +72,7 @@ static void power_init_board(void)
>  	imx8mp_setup_pad(MX8MP_PAD_I2C1_SCL__I2C1_SCL | I2C_PAD_CTRL);
>  	imx8mp_setup_pad(MX8MP_PAD_I2C1_SDA__I2C1_SDA | I2C_PAD_CTRL);
>  
> -	imx8mm_early_clock_init();
> +	imx8mp_early_clock_init();
>  	imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_I2C1);
>  
>  	i2c = imx8m_i2c_early_init(IOMEM(MX8MP_I2C1_BASE_ADDR));
> diff --git a/arch/arm/boards/tqma8mpxl/lowlevel.c b/arch/arm/boards/tqma8mpxl/lowlevel.c
> index 0ce0e7a73b..037c7abf4b 100644
> --- a/arch/arm/boards/tqma8mpxl/lowlevel.c
> +++ b/arch/arm/boards/tqma8mpxl/lowlevel.c
> @@ -73,7 +73,7 @@ static void power_init_board(void)
>  	imx8mp_setup_pad(MX8MP_PAD_I2C1_SCL__I2C1_SCL | I2C_PAD_CTRL);
>  	imx8mp_setup_pad(MX8MP_PAD_I2C1_SDA__I2C1_SDA | I2C_PAD_CTRL);
>  
> -	imx8mm_early_clock_init();
> +	imx8mp_early_clock_init();
>  	imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_I2C1);
>  
>  	i2c = imx8m_i2c_early_init(IOMEM(MX8MP_I2C1_BASE_ADDR));
> diff --git a/arch/arm/mach-imx/imx8m.c b/arch/arm/mach-imx/imx8m.c
> index 9758525b54..7f3856e545 100644
> --- a/arch/arm/mach-imx/imx8m.c
> +++ b/arch/arm/mach-imx/imx8m.c
> @@ -182,7 +182,7 @@ int imx8mq_init(void)
>  #define IMX8MM_CCM_ANALOG_SYS_PLL2_GEN_CTRL	0x104
>  #define IMX8MM_CCM_ANALOG_SYS_PLL3_GEN_CTRL	0x114
>  
> -static void __imx8mm_early_clock_init(unsigned long pll3_freq) /* and later */
> +static void __imx8m_early_clock_init(unsigned long pll3_freq) /* and later */
>  {
>  	void __iomem *ana = IOMEM(MX8M_ANATOP_BASE_ADDR);
>  	void __iomem *ccm = IOMEM(MX8M_CCM_BASE_ADDR);
> @@ -252,14 +252,20 @@ static void __imx8mm_early_clock_init(unsigned long pll3_freq) /* and later */
>  
>  void imx8mm_early_clock_init(void)
>  {
> -	__imx8mm_early_clock_init(750000000UL);
> +	__imx8m_early_clock_init(750000000UL);
>  }
>  
>  void imx8mn_early_clock_init(void)
>  {
> -	__imx8mm_early_clock_init(600000000UL);
> +	__imx8m_early_clock_init(600000000UL);
>  }
>  
> +void imx8mp_early_clock_init(void)
> +{
> +	__imx8m_early_clock_init(750000000UL);
> +}
> +
> +
>  #define KEEP_ALIVE			0x18
>  #define VER_L				0x1c
>  #define VER_H				0x20
> diff --git a/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h b/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h
> index eeb15f4dd0..659615e1cc 100644
> --- a/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h
> +++ b/arch/arm/mach-imx/include/mach/imx8m-ccm-regs.h
> @@ -53,6 +53,7 @@
>  void imx8m_early_setup_uart_clock(void);
>  void imx8mm_early_clock_init(void);
>  void imx8mn_early_clock_init(void);
> +void imx8mp_early_clock_init(void);
>  void imx8m_clock_set_target_val(int clock_id, u32 val);
>  void imx8m_ccgr_clock_enable(int index);
>  void imx8m_ccgr_clock_disable(int index);
> -- 
> 2.25.1
> 
> 
> 

-- 
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 |



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-12 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11 11:37 [PATCH v4] ARM: i.MX8M: separate function call for clock_init Johannes Schneider
2023-01-11 11:43 ` Ahmad Fatoum
2023-01-12 15:01 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox