All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V2] ARM: mach-omap2: omap3: Fix GPIO clocking in SPL
@ 2018-12-14 22:28 Adam Ford
  2018-12-27 15:47 ` [U-Boot] [U-Boot, " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Ford @ 2018-12-14 22:28 UTC (permalink / raw)
  To: u-boot

OMAP3_GPIO_x is needed to enable each GPIO bank on the OMAP3
boards. At one point, the #ifdef's were replaced with
if CONFIG_IS_ENABLED but this won't work for people who need
OMAP3_GPIO_x in SPL since the SPL prefix for this option isn't
used in Kconfig.  This patch moves the check to #if defined and
also makes Kconfig select the banks if CMD_GPIO is used which
makes the checks in the code less cumbersome.

Fixes: bd8a9c14c91c ("arm: mach-omap2/omap3/clock.c: Enable
all GPIO with CMD_GPIO")

Reported-by: Liam O'Shaughnessy <liam.o.shaughnessy@gumstix.com>
Signed-off-by: Adam Ford <aford173@gmail.com>
---
V2:  change if defined(OMAP3_GPIO_x) to include the CONFIG_ prefix

diff --git a/arch/arm/mach-omap2/omap3/Kconfig b/arch/arm/mach-omap2/omap3/Kconfig
index e0d02fb4e5..0286b0daa3 100644
--- a/arch/arm/mach-omap2/omap3/Kconfig
+++ b/arch/arm/mach-omap2/omap3/Kconfig
@@ -3,18 +3,23 @@ if OMAP34XX
 # We only enable the clocks for the GPIO banks that a given board requies.
 config OMAP3_GPIO_2
 	bool
+	default y if CMD_GPIO
 
 config OMAP3_GPIO_3
 	bool
+	default y if CMD_GPIO
 
 config OMAP3_GPIO_4
 	bool
+	default y if CMD_GPIO
 
 config OMAP3_GPIO_5
 	bool
+	default y if CMD_GPIO
 
 config OMAP3_GPIO_6
 	bool
+	default y if CMD_GPIO
 
 choice
 	prompt "OMAP3 board select"
diff --git a/arch/arm/mach-omap2/omap3/clock.c b/arch/arm/mach-omap2/omap3/clock.c
index 9a03bfa9d3..cb9e91ebc3 100644
--- a/arch/arm/mach-omap2/omap3/clock.c
+++ b/arch/arm/mach-omap2/omap3/clock.c
@@ -750,23 +750,23 @@ void per_clocks_enable(void)
 	setbits_le32(&prcm_base->iclken_per, 0x00000800);
 #endif
 
-#if (CONFIG_IS_ENABLED(OMAP3_GPIO_2) || CONFIG_IS_ENABLED(CMD_GPIO))
+#if defined(CONFIG_OMAP3_GPIO_2)
 	setbits_le32(&prcm_base->fclken_per, 0x00002000);
 	setbits_le32(&prcm_base->iclken_per, 0x00002000);
 #endif
-#if (CONFIG_IS_ENABLED(OMAP3_GPIO_3) || CONFIG_IS_ENABLED(CMD_GPIO))
+#if defined(CONFIG_OMAP3_GPIO_3)
 	setbits_le32(&prcm_base->fclken_per, 0x00004000);
 	setbits_le32(&prcm_base->iclken_per, 0x00004000);
 #endif
-#if (CONFIG_IS_ENABLED(OMAP3_GPIO_4) || CONFIG_IS_ENABLED(CMD_GPIO))
+#if defined(CONFIG_OMAP3_GPIO_4)
 	setbits_le32(&prcm_base->fclken_per, 0x00008000);
 	setbits_le32(&prcm_base->iclken_per, 0x00008000);
 #endif
-#if (CONFIG_IS_ENABLED(OMAP3_GPIO_5) || CONFIG_IS_ENABLED(CMD_GPIO))
+#if defined(CONFIG_OMAP3_GPIO_5)
 	setbits_le32(&prcm_base->fclken_per, 0x00010000);
 	setbits_le32(&prcm_base->iclken_per, 0x00010000);
 #endif
-#if (CONFIG_IS_ENABLED(OMAP3_GPIO_6) || CONFIG_IS_ENABLED(CMD_GPIO))
+#if defined(CONFIG_OMAP3_GPIO_6)
 	setbits_le32(&prcm_base->fclken_per, 0x00020000);
 	setbits_le32(&prcm_base->iclken_per, 0x00020000);
 #endif
-- 
2.17.1

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

* [U-Boot] [U-Boot, V2] ARM: mach-omap2: omap3: Fix GPIO clocking in SPL
  2018-12-14 22:28 [U-Boot] [PATCH V2] ARM: mach-omap2: omap3: Fix GPIO clocking in SPL Adam Ford
@ 2018-12-27 15:47 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2018-12-27 15:47 UTC (permalink / raw)
  To: u-boot

On Fri, Dec 14, 2018 at 04:28:30PM -0600, Adam Ford wrote:

> OMAP3_GPIO_x is needed to enable each GPIO bank on the OMAP3
> boards. At one point, the #ifdef's were replaced with
> if CONFIG_IS_ENABLED but this won't work for people who need
> OMAP3_GPIO_x in SPL since the SPL prefix for this option isn't
> used in Kconfig.  This patch moves the check to #if defined and
> also makes Kconfig select the banks if CMD_GPIO is used which
> makes the checks in the code less cumbersome.
> 
> Fixes: bd8a9c14c91c ("arm: mach-omap2/omap3/clock.c: Enable
> all GPIO with CMD_GPIO")
> 
> Reported-by: Liam O'Shaughnessy <liam.o.shaughnessy@gumstix.com>
> Signed-off-by: Adam Ford <aford173@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181227/606a9ffa/attachment.sig>

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

end of thread, other threads:[~2018-12-27 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-14 22:28 [U-Boot] [PATCH V2] ARM: mach-omap2: omap3: Fix GPIO clocking in SPL Adam Ford
2018-12-27 15:47 ` [U-Boot] [U-Boot, " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.