public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V2] arm: omap3: Enable clocks for peripherals only if they are used
@ 2013-11-30  6:59 Michael Trimarchi
  2013-12-01 11:21 ` Igor Grinberg
  2013-12-04 22:05 ` [U-Boot] [U-Boot, " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Trimarchi @ 2013-11-30  6:59 UTC (permalink / raw)
  To: u-boot

This patch change the per_clocks_enable() function used in OMAP3
code to enable peripherals clocks. Only required clock should be
activated. So if the board use the uart(x) as a console we need
to activate it. The Board's config should include define to enable
every subsystem that the board use. For a complete list
of affected peripherals, registers CM_FCLKEN_PER and CM_ICLKEN_PER
should be checked.
Right now the bootloader can enable and disable clocks for:
uart(x) using CONFIG_SYS_NS16550
gpio bank (x) using CONFIG_OMAP3_GPIO_X with X = { 2, 3, 4, 5, 6 }
i2c bus using CONFIG_DRIVER_OMAP34XX_I2C.

Not required gptimer(x) and mcbsp(x) for booting are disabled by default and
are not supported by any define.
Their activation need to included in the per_clocks_enable if the
peripheral is included. Not booting board should enable the peripheral
clock connected to their driver

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Tom Rini <trini@ti.com>
---
Changes in V2:
	add a better comment for describe the problems that could
	be raised on some boards

 arch/arm/cpu/armv7/omap3/clock.c        | 2 --
 arch/arm/include/asm/arch-omap3/clock.h | 2 --
 2 files changed, 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap3/clock.c b/arch/arm/cpu/armv7/omap3/clock.c
index 14fc7e8..1bc27bd 100644
--- a/arch/arm/cpu/armv7/omap3/clock.c
+++ b/arch/arm/cpu/armv7/omap3/clock.c
@@ -730,8 +730,6 @@ void per_clocks_enable(void)
 		sr32(&prcm_base->fclken_cam, 0, 32, FCK_CAM_ON);
 		sr32(&prcm_base->iclken_cam, 0, 32, ICK_CAM_ON);
 	}
-	sr32(&prcm_base->fclken_per, 0, 32, FCK_PER_ON);
-	sr32(&prcm_base->iclken_per, 0, 32, ICK_PER_ON);
 
 	sdelay(1000);
 }
diff --git a/arch/arm/include/asm/arch-omap3/clock.h b/arch/arm/include/asm/arch-omap3/clock.h
index be669c1..1912cc9 100644
--- a/arch/arm/include/asm/arch-omap3/clock.h
+++ b/arch/arm/include/asm/arch-omap3/clock.h
@@ -27,8 +27,6 @@
 #define ICK_DSS_ON	0x00000001
 #define FCK_CAM_ON	0x00000001
 #define ICK_CAM_ON	0x00000001
-#define FCK_PER_ON	0x0003ffff
-#define ICK_PER_ON	0x0003ffff
 
 /* Used to index into DPLL parameter tables */
 typedef struct {
-- 
1.8.1.2

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

* [U-Boot] [PATCH V2] arm: omap3: Enable clocks for peripherals only if they are used
  2013-11-30  6:59 [U-Boot] [PATCH V2] arm: omap3: Enable clocks for peripherals only if they are used Michael Trimarchi
@ 2013-12-01 11:21 ` Igor Grinberg
  2013-12-04 22:05 ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Igor Grinberg @ 2013-12-01 11:21 UTC (permalink / raw)
  To: u-boot

On 11/30/13 08:59, Michael Trimarchi wrote:
> This patch change the per_clocks_enable() function used in OMAP3
> code to enable peripherals clocks. Only required clock should be
> activated. So if the board use the uart(x) as a console we need
> to activate it. The Board's config should include define to enable
> every subsystem that the board use. For a complete list
> of affected peripherals, registers CM_FCLKEN_PER and CM_ICLKEN_PER
> should be checked.
> Right now the bootloader can enable and disable clocks for:
> uart(x) using CONFIG_SYS_NS16550
> gpio bank (x) using CONFIG_OMAP3_GPIO_X with X = { 2, 3, 4, 5, 6 }
> i2c bus using CONFIG_DRIVER_OMAP34XX_I2C.
> 
> Not required gptimer(x) and mcbsp(x) for booting are disabled by default and
> are not supported by any define.
> Their activation need to included in the per_clocks_enable if the
> peripheral is included. Not booting board should enable the peripheral
> clock connected to their driver
> 
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Tom Rini <trini@ti.com>

Thanks!

Acked-by: Igor Grinberg <grinberg@compulab.co.il>

> ---
> Changes in V2:
> 	add a better comment for describe the problems that could
> 	be raised on some boards
> 
>  arch/arm/cpu/armv7/omap3/clock.c        | 2 --
>  arch/arm/include/asm/arch-omap3/clock.h | 2 --
>  2 files changed, 4 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/omap3/clock.c b/arch/arm/cpu/armv7/omap3/clock.c
> index 14fc7e8..1bc27bd 100644
> --- a/arch/arm/cpu/armv7/omap3/clock.c
> +++ b/arch/arm/cpu/armv7/omap3/clock.c
> @@ -730,8 +730,6 @@ void per_clocks_enable(void)
>  		sr32(&prcm_base->fclken_cam, 0, 32, FCK_CAM_ON);
>  		sr32(&prcm_base->iclken_cam, 0, 32, ICK_CAM_ON);
>  	}
> -	sr32(&prcm_base->fclken_per, 0, 32, FCK_PER_ON);
> -	sr32(&prcm_base->iclken_per, 0, 32, ICK_PER_ON);
>  
>  	sdelay(1000);
>  }
> diff --git a/arch/arm/include/asm/arch-omap3/clock.h b/arch/arm/include/asm/arch-omap3/clock.h
> index be669c1..1912cc9 100644
> --- a/arch/arm/include/asm/arch-omap3/clock.h
> +++ b/arch/arm/include/asm/arch-omap3/clock.h
> @@ -27,8 +27,6 @@
>  #define ICK_DSS_ON	0x00000001
>  #define FCK_CAM_ON	0x00000001
>  #define ICK_CAM_ON	0x00000001
> -#define FCK_PER_ON	0x0003ffff
> -#define ICK_PER_ON	0x0003ffff
>  
>  /* Used to index into DPLL parameter tables */
>  typedef struct {
> 

-- 
Regards,
Igor.

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

* [U-Boot] [U-Boot, V2] arm: omap3: Enable clocks for peripherals only if they are used
  2013-11-30  6:59 [U-Boot] [PATCH V2] arm: omap3: Enable clocks for peripherals only if they are used Michael Trimarchi
  2013-12-01 11:21 ` Igor Grinberg
@ 2013-12-04 22:05 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2013-12-04 22:05 UTC (permalink / raw)
  To: u-boot

On Sat, Nov 30, 2013 at 07:59:58AM +0100, Michael Trimarchi wrote:

> This patch change the per_clocks_enable() function used in OMAP3
> code to enable peripherals clocks. Only required clock should be
> activated. So if the board use the uart(x) as a console we need
> to activate it. The Board's config should include define to enable
> every subsystem that the board use. For a complete list
> of affected peripherals, registers CM_FCLKEN_PER and CM_ICLKEN_PER
> should be checked.
> Right now the bootloader can enable and disable clocks for:
> uart(x) using CONFIG_SYS_NS16550
> gpio bank (x) using CONFIG_OMAP3_GPIO_X with X = { 2, 3, 4, 5, 6 }
> i2c bus using CONFIG_DRIVER_OMAP34XX_I2C.
> 
> Not required gptimer(x) and mcbsp(x) for booting are disabled by default and
> are not supported by any define.
> Their activation need to included in the per_clocks_enable if the
> peripheral is included. Not booting board should enable the peripheral
> clock connected to their driver
> 
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Tom Rini <trini@ti.com>
> Acked-by: Igor Grinberg <grinberg@compulab.co.il>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131204/5448b095/attachment.pgp>

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

end of thread, other threads:[~2013-12-04 22:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-30  6:59 [U-Boot] [PATCH V2] arm: omap3: Enable clocks for peripherals only if they are used Michael Trimarchi
2013-12-01 11:21 ` Igor Grinberg
2013-12-04 22:05 ` [U-Boot] [U-Boot, " Tom Rini

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