gator: Add config for building the module in-tree
authorJon Medhurst <tixy@linaro.org>
Thu, 10 May 2012 16:35:03 +0000 (17:35 +0100)
committerJon Medhurst <tixy@linaro.org>
Tue, 8 Oct 2013 13:57:45 +0000 (14:57 +0100)
Signed-off-by: Jon Medhurst <tixy@linaro.org>
drivers/Kconfig
drivers/Makefile
drivers/gator/Kconfig [new file with mode: 0644]
drivers/gator/Makefile

index 9953a42809ec85f3782cb980bfea739bbeed448f..d27feb5460f342522fdbd98fa2891c0001587587 100644 (file)
@@ -166,4 +166,6 @@ source "drivers/ipack/Kconfig"
 
 source "drivers/reset/Kconfig"
 
+source "drivers/gator/Kconfig"
+
 endmenu
index 130abc1dfd65419688ec4195e2925c302a5d673f..092a62e79688da9b1a7466da63e52b9788f86ea0 100644 (file)
@@ -152,3 +152,5 @@ obj-$(CONFIG_IIO)           += iio/
 obj-$(CONFIG_VME_BUS)          += vme/
 obj-$(CONFIG_IPACK_BUS)                += ipack/
 obj-$(CONFIG_NTB)              += ntb/
+
+obj-$(CONFIG_GATOR)            += gator/
diff --git a/drivers/gator/Kconfig b/drivers/gator/Kconfig
new file mode 100644 (file)
index 0000000..7ea0fcc
--- /dev/null
@@ -0,0 +1,33 @@
+config GATOR
+       tristate "Gator module for ARM's Streamline Performance Analyzer"
+       default m if (ARM || ARM64)
+       depends on PROFILING
+       depends on HIGH_RES_TIMERS
+       depends on LOCAL_TIMERS || !(ARM && SMP)
+       select TRACING
+
+config GATOR_WITH_MALI_SUPPORT
+       bool
+
+choice
+       prompt "Enable Mali GPU support in Gator"
+       depends on GATOR
+       optional
+
+config GATOR_MALI_400MP
+       bool "Mali-400MP"
+       select GATOR_WITH_MALI_SUPPORT
+
+config GATOR_MALI_T6XX
+       bool "Mali-T604 or Mali-T658"
+       select GATOR_WITH_MALI_SUPPORT
+
+endchoice
+
+config GATOR_MALI_PATH
+       string "Path to Mali driver"
+       depends on GATOR_WITH_MALI_SUPPORT
+       default "drivers/gpu/arm/mali400mp"
+       help
+         The gator code adds this to its include path so it can get the Mali
+         trace headers with: #include "linux/mali_linux_trace.h"
index 3af8b8d80f2040f28184fe11d75a60f117f2daf4..b5393fbbc5d289abc98acefff511f57d8913275f 100644 (file)
@@ -3,7 +3,7 @@ ifneq ($(KERNELRELEASE),)
 # Uncomment the following line to enable kernel stack unwinding within gator, or update gator_backtrace.c
 # EXTRA_CFLAGS +=      -DGATOR_KERNEL_STACK_UNWINDING
 
-obj-m := gator.o
+obj-$(CONFIG_GATOR) := gator.o
 
 gator-y :=     gator_main.o \
                gator_events_irq.o \
@@ -15,8 +15,9 @@ gator-y :=    gator_main.o \
 
 gator-y +=     gator_events_mmaped.o
 
-ifneq ($(GATOR_WITH_MALI_SUPPORT),)
-ifeq ($(GATOR_WITH_MALI_SUPPORT),MALI_T6xx)
+ifeq ($(CONFIG_GATOR_WITH_MALI_SUPPORT),y)
+
+ifeq ($(CONFIG_GATOR_MALI_T6XX),y)
 gator-y +=     gator_events_mali_t6xx.o \
                gator_events_mali_t6xx_hw.o
 include $(M)/mali_t6xx.mk
@@ -24,7 +25,10 @@ else
 gator-y +=     gator_events_mali_400.o
 endif
 gator-y +=     gator_events_mali_common.o
-EXTRA_CFLAGS +=        -DMALI_SUPPORT=$(GATOR_WITH_MALI_SUPPORT)
+
+ccflags-y += -I$(CONFIG_GATOR_MALI_PATH)
+ccflags-$(CONFIG_GATOR_MALI_400MP) += -DMALI_SUPPORT=MALI_400
+ccflags-$(CONFIG_GATOR_MALI_T6XX) += -DMALI_SUPPORT=MALI_T6xx
 endif
 
 # GATOR_TEST controls whether to include (=1) or exclude (=0) test code. 
@@ -45,7 +49,7 @@ clean-files := gator_events.h
 silent_chk_events.h = :
 gator_events.h: FORCE
        @$($(quiet)chk_events.h)
-       $(Q)cd $(obj) ; $(CONFIG_SHELL) $(obj)/gator_events.sh $@
+       $(Q)cd $(srctree)/$(src) ; $(CONFIG_SHELL) gator_events.sh $(objtree)/$(obj)/$@
 
 else