Skip to contentSkip to conversation

arm: spear: enable GPIO3 and 4 clocks when the GPIO controller driver is built

PATCH In review Quentin Schulz 2 participants 2 messages Aug 31, 2018 – Sep 11, 2018 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: spear: enable GPIO3 and 4 clocks when the GPIO controller driver is built

There are multiple GPIOs that can be used with the same driver depending on the CONFIG_GPIO_BASE defined in the controller driver.

GPIO3 and 4 require a clock to be enabled so let's enable them when the driver is built.

---
 arch/arm/cpu/arm926ejs/spear/cpu.c         | 3 +++
 arch/arm/include/asm/arch-spear/spr_misc.h | 1 +
 2 files changed, 4 insertions(+)
arch/arm/cpu/arm926ejs/spear/cpu.c +3 -0
index 0970aca2ef..6fc29e77ff 100644
@@ -49,6 +49,9 @@ int arch_cpu_init(void)
 #if defined(CONFIG_USB_EHCI_SPEAR)
 	periph1_clken |= PERIPH_USBH1 | PERIPH_USBH2;
 #endif
+#if defined(CONFIG_SPEAR_GPIO)
+	periph1_clken |= MISC_GPIO3ENB | MISC_GPIO4ENB;
+#endif
 
 	writel(periph1_clken, &misc_p->periph1_clken);
 
arch/arm/include/asm/arch-spear/spr_misc.h +1 -0
index c906730699..65063fca51 100644
@@ -144,6 +144,7 @@ struct misc_regs {
 #define MISC_USBDENB			0x01000000
 #define MISC_ETHENB			0x00800000
 #define MISC_SMIENB			0x00200000
+#define MISC_GPIO3ENB			0x00040000
 #define MISC_GPT3ENB			0x00010000
 #define MISC_GPIO4ENB			0x00002000
 #define MISC_GPT2ENB			0x00000800
Signature · 1 line
2.17.1
#1 lore raw
Quoted 7 lines · Quentin Schulz

There are multiple GPIOs that can be used with the same driver depending on the CONFIG_GPIO_BASE defined in the controller driver.

GPIO3 and 4 require a clock to be enabled so let's enable them when the driver is built.

Applied to u-boot/master, thanks!

Signature · 8 lines
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/20180911/e36d43e5/attachment.sig>