Skip to contentSkip to conversation

abstract debug card setup (smc, leds)

PATCH In review David Brownell 2 participants 2 messages Nov 3, 2006 – Nov 9, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 abstract debug card setup (smc, leds)

Additional cleanup for debug boards on H2/P2/H3/H4: move the init code that's not board-specific into a new file where it can be easily shared between all the different boards (avoiding code duplication, and making it easier to support more devices). Make H4 use that.

This should be easy to drop in to the OMAP1 boards using these debug cards; the only difference seems to be that the p2 does an extra reset of the smc using the fpga (probably all boards could do that, if it's necessary) and doesn't use the gpio mux or request APIs.

arch/arm/plat-omap/Kconfig +7 -2
Index: h4/arch/arm/plat-omap/Kconfig
===================================================================
@@ -19,10 +19,15 @@ endchoice
 
 comment "OMAP Feature Selections"
 
-config OMAP_DEBUG_LEDS
+config OMAP_DEBUG_DEVICES
 	bool
 	help
-	  For debug card leds on TI reference boards.
+	  For debug cards on TI reference boards.
+
+config OMAP_DEBUG_LEDS
+	bool
+	depends on OMAP_DEBUG_DEVICES
+	default y if LEDS || LEDS_OMAP_DEBUG
 
 config OMAP_RESET_CLOCKS
 	bool "Reset unused clocks during boot"
arch/arm/mach-omap2/Kconfig +1 -1
Index: h4/arch/arm/mach-omap2/Kconfig
===================================================================
@@ -25,7 +25,7 @@ config MACH_OMAP2_TUSB6010
 config MACH_OMAP_H4
 	bool "OMAP 2420 H4 board"
 	depends on ARCH_OMAP2 && ARCH_OMAP24XX
-	select OMAP_DEBUG_LEDS if LEDS || LEDS_OMAP_DEBUG
+	select OMAP_DEBUG_DEVICES
 	select GPIOEXPANDER_OMAP
 
 config MACH_OMAP_H4_TUSB
include/asm-arm/arch-omap/board.h +4 -0
Index: h4/include/asm-arm/arch-omap/board.h
===================================================================
@@ -179,4 +179,8 @@ extern const void *omap_get_var_config(u
 extern struct omap_board_config_kernel *omap_board_config;
 extern int omap_board_config_size;
 
+
+/* for TI reference platforms sharing the same debug card */
+extern int debug_card_init(u32 addr, unsigned gpio);
+
 #endif
arch/arm/plat-omap/Makefile +1 -0
Index: h4/arch/arm/plat-omap/Makefile
===================================================================
@@ -24,6 +24,7 @@ obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
 obj-$(CONFIG_OMAP_BOOT_REASON) += bootreason.o
 obj-$(CONFIG_OMAP_COMPONENT_VERSION) += component-version.o
 obj-$(CONFIG_OMAP_GPIO_SWITCH) += gpio-switch.o
+obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
 obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
 
 # DSP subsystem
arch/arm/plat-omap/debug-devices.c new file +86 -0

86 lines not on this page · raw message

arch/arm/mach-omap2/board-h4.c +5 -48

98 lines not on this page · raw message

maintainer
#1 lore raw
Quoted 9 lines · David Brownell

Additional cleanup for debug boards on H2/P2/H3/H4: move the init code that's not board-specific into a new file where it can be easily shared between all the different boards (avoiding code duplication, and making it easier to support more devices). Make H4 use that.

This should be easy to drop in to the OMAP1 boards using these debug cards; the only difference seems to be that the p2 does an extra reset of the smc using the fpga (probably all boards could do that, if it's necessary) and doesn't use the gpio mux or request APIs.

Pushing today.

Tony