MIPS: Introduce support for Platform definitions
authorSam Ravnborg <sam@ravnborg.org>
Sun, 30 May 2010 14:27:10 +0000 (16:27 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 5 Aug 2010 12:25:45 +0000 (13:25 +0100)
Move platform specific definitions to the platfrom directories.

Each platform shall do the following:
1) include an entry in arch/mips/Kbuild.platforms
2) add relevant definitions to arch/mips/<platform>/Platform

This commits changes ar7 to the new scheme as an example.

Introducing a platform speecific Platfrom file has following advantages:
1) decentralization of platfrom definitions
2) simplification af arch/mips/Makefile
3) force all platfrom to build with -Werror (done in arch/mips/Kbuild)

[Ralf: Remove forgotten -Werror from AR7 Makefile]

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
To: linux-mips <linux-mips@linux-mips.org>
To: Wu Zhangjin <wuzhangjin@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/1302/
Patchwork: http://patchwork.linux-mips.org/patch/1308/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/Kbuild
arch/mips/Kbuild.platforms [new file with mode: 0644]
arch/mips/Makefile
arch/mips/ar7/Makefile
arch/mips/ar7/Platform [new file with mode: 0644]

index 6ce938200bbdc6a2b69135642c86cf85f93ce678..e322d65f33a41e0085e5d352410ca0b5c3f37e26 100644 (file)
@@ -3,6 +3,9 @@
 # CFLAGS_<file.o> := -Wno-error
 subdir-ccflags-y := -Werror
 
+# platform specific definitions
+include arch/mips/Kbuild.platforms
+obj-y := $(platform-y)
 
 # mips object files
 # The object files are linked as core-y files would be linked
diff --git a/arch/mips/Kbuild.platforms b/arch/mips/Kbuild.platforms
new file mode 100644 (file)
index 0000000..681b2d4
--- /dev/null
@@ -0,0 +1,6 @@
+# All platforms listed in alphabetic order
+
+platforms += ar7
+
+# include the platform specific files
+include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))
index d39be4708289fe918f5069884d9434116545e5d6..b4ec8e9960b356ab009f5f73586b0f9915eaf757 100644 (file)
@@ -209,13 +209,7 @@ endif
 #
 # Board-dependent options and extra files
 #
-
-#
-# Texas Instruments AR7
-#
-core-$(CONFIG_AR7)             += arch/mips/ar7/
-cflags-$(CONFIG_AR7)           += -I$(srctree)/arch/mips/include/asm/mach-ar7
-load-$(CONFIG_AR7)             += 0xffffffff94100000
+include $(srctree)/arch/mips/Kbuild.platforms
 
 #
 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
index 26bc5da189971c1714174c82e0c4f8a72f6d4fa6..7435e44b396404b355fe60dc1bf7e9de96e33665 100644 (file)
@@ -8,4 +8,3 @@ obj-y := \
        platform.o \
        gpio.o \
        clock.o
-EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/ar7/Platform b/arch/mips/ar7/Platform
new file mode 100644 (file)
index 0000000..0bf85c4
--- /dev/null
@@ -0,0 +1,6 @@
+#
+# Texas Instruments AR7
+#
+platform-$(CONFIG_AR7)          += ar7/
+cflags-$(CONFIG_AR7)            += -I$(srctree)/arch/mips/include/asm/mach-ar7
+load-$(CONFIG_AR7)              += 0xffffffff94100000