Skip to contentSkip to conversation

arm: omap3: Enable clocks for peripherals only if they are used

PATCH New Michael Trimarchi 3 participants 3 messages Nov 30, 2013 – Dec 4, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm: omap3: Enable clocks for peripherals only if they are used

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

---
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(-)
arch/arm/cpu/armv7/omap3/clock.c +0 -2
index 14fc7e8..1bc27bd 100644
@@ -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);
 }
arch/arm/include/asm/arch-omap3/clock.h +0 -2
index be669c1..1912cc9 100644
@@ -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 {
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v2 1/1 arm: omap3: Enable clocks for peripherals only if they are used

Quoted 18 lines · Michael Trimarchi

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

Quoted 3 lines

Thanks!

Quoted 36 lines

---
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(-)
arch/arm/cpu/armv7/omap3/clock.c +0 -2
index 14fc7e8..1bc27bd 100644
@@ -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);
 }
arch/arm/include/asm/arch-omap3/clock.h +0 -2
index be669c1..1912cc9 100644
@@ -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 {
Signature · 2 lines
Regards,
Igor.
#2 lore raw

PATCH v2 1/1 arm: omap3: Enable clocks for peripherals only if they are used

In reply to Michael Trimarchi
Quoted 18 lines · Michael Trimarchi

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

Quoted 4 lines

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

Signature · 8 lines
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>