Skip to contentSkip to conversation

PATCH: CFG_GPIO0_OR and CFG_GPIO0_ODR to setup GPIO completely

U-Boot-Users Tolunay Orkun 1 participant 1 message Apr 7, 2006

lore
Share & tools
lore
#0 lore raw

Re: http://sf.net/mailarchive/forum.php?thread_id=10122605&forum_id=12898

CHANGELOG:

* (ppc4xx) Add CFG_GPIO0_OR, CFG_GPIO0_ODR to setup GPIO completely.
- Add configuration of Open Drain GPIO Output selection
- Add configuration of initial value of GPIO output pins

cpu/ppc4xx/cpu_init.c +6 -0
index 1a139d7..761fcf7 100644
@@ -115,6 +115,12 @@ cpu_init_f (void)
  	/*
  	 * GPIO0 setup (select GPIO or alternate function)
  	 */
+#if defined(CFG_GPIO0_OR)
+	out32(GPIO0_OR, CFG_GPIO0_OR);       /* set initial state of output pins */
+#endif
+#if defined(CFG_GPIO0_ODR)
+	out32(GPIO0_ODR, CFG_GPIO0_ODR);     /* open-drain select */
+#endif
  	out32(GPIO0_OSRH, CFG_GPIO0_OSRH);   /* output select */
  	out32(GPIO0_OSRL, CFG_GPIO0_OSRL);
  	out32(GPIO0_ISR1H, CFG_GPIO0_ISR1H); /* input select */