Skip to contentSkip to conversation

support board vendor-common makefiles

PATCH New Kim Phillips 2 participants 2 messages Aug 21, 2007 – Aug 29, 2007 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support board vendor-common makefiles

if a board/$(VENDOR)/common/Makefile exists, build it.

also add the first such case, board/freescale/common/Makefile, to handle building board-shared EEPROM, PIXIS, and MDS-PIB code, as dictated by board configuration.

thusly get rid of alternate build dir errors such as:

FATAL: can't create /work/wd/tmp/u-boot-ppc/board/freescale/mpc8360emds/../common/pq-mds-pib.o: No such file or directory

by putting the common/ mkdir command in its proper place (the common Makefile). Common bits from existing individual board Makefiles have been removed.

---
 Makefile                             |    2 +
 board/freescale/common/Makefile      |   56 ++++++++++++++++++++++++++++++++++
 board/freescale/common/pixis.c       |    3 ++
 board/freescale/common/pq-mds-pib.c  |    3 ++
 board/freescale/mpc832xemds/Makefile |    2 +-
 board/freescale/mpc8360emds/Makefile |    2 +-
 board/freescale/mpc8544ds/Makefile   |    7 +----
 board/freescale/mpc8641hpcn/Makefile |    8 +----
 include/configs/MPC8544DS.h          |    1 +
 include/configs/MPC8641HPCN.h        |    1 +
 10 files changed, 70 insertions(+), 15 deletions(-)
 create mode 100644 board/freescale/common/Makefile
Makefile +2 -0
index 2e15cea..0477cd3 100644
@@ -190,6 +190,8 @@ endif
 OBJS := $(addprefix $(obj),$(OBJS))
 
 LIBS  = lib_generic/libgeneric.a
+LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
+	"board/$(VENDOR)/common/lib$(VENDOR).a"; fi)
 LIBS += board/$(BOARDDIR)/lib$(BOARD).a
 LIBS += cpu/$(CPU)/lib$(CPU).a
 ifdef SOC
board/freescale/common/Makefile new file +56 -0

56 lines not on this page · raw message

board/freescale/common/pixis.c +3 -0
index 99cc2ee..ae4bef1 100644
@@ -27,6 +27,8 @@
 #include <watchdog.h>
 #include <asm/cache.h>
 
+#ifdef CONFIG_FSL_PIXIS
+
 #include "pixis.h"
 
 
@@ -470,3 +472,4 @@ U_BOOT_CMD(
 	"    pixis_reset altbank cf <SYSCLK freq> <COREPLL ratio> <MPXPLL ratio>\n"
 	"    pixis_reset cf <SYSCLK freq> <COREPLL ratio> <MPXPLL ratio>\n"
 	);
+#endif /* CONFIG_FSL_PIXIS */
board/freescale/common/pq-mds-pib.c +3 -0
index 8c013c7..d79f2eb 100644
@@ -12,6 +12,8 @@
 #include <i2c.h>
 #include <asm/io.h>
 
+#ifdef CONFIG_PQ_MDS_PIB
+
 #include "pq-mds-pib.h"
 
 int pib_init(void)
@@ -100,3 +102,4 @@ int pib_init(void)
 	i2c_set_bus_num(orig_i2c_bus);
 	return 0;
 }
+#endif /* CONFIG_PQ_MDS_PIB */
board/freescale/mpc832xemds/Makefile +1 -1
index ea52484..5ec7a87 100644
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= $(BOARD).o pci.o ../common/pq-mds-pib.o
+COBJS	:= $(BOARD).o pci.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
board/freescale/mpc8360emds/Makefile +1 -1
index ea52484..5ec7a87 100644
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= $(BOARD).o pci.o ../common/pq-mds-pib.o
+COBJS	:= $(BOARD).o pci.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
board/freescale/mpc8544ds/Makefile +1 -6
index 308f707..006fdc9 100644
@@ -24,14 +24,9 @@
 
 include $(TOPDIR)/config.mk
 
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)../common)
-endif
-
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= $(BOARD).o \
-	   ../common/pixis.o
+COBJS	:= $(BOARD).o
 
 SOBJS	:= init.o
 
board/freescale/mpc8641hpcn/Makefile +1 -7
index 93b015d..201da3e 100644
@@ -23,15 +23,9 @@
 
 include $(TOPDIR)/config.mk
 
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)../common)
-endif
-
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= $(BOARD).o \
-		../common/sys_eeprom.o \
-		../common/pixis.o
+COBJS	:= $(BOARD).o
 
 SOBJS	:= init.o
 
include/configs/MPC8544DS.h +1 -0
index 746f360..7b70254 100644
@@ -181,6 +181,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CFG_BR3_PRELIM		0xf8100801	/* port size 8bit */
 #define CFG_OR3_PRELIM		0xfff06ff7	/* 1MB PIXIS area*/
 
+#define CONFIG_FSL_PIXIS	1	/* use common PIXIS code */
 #define PIXIS_BASE	0xf8100000	/* PIXIS registers */
 #define PIXIS_ID		0x0	/* Board ID at offset 0 */
 #define PIXIS_VER		0x1	/* Board version at offset 1 */
include/configs/MPC8641HPCN.h +1 -0
index 03e815d..ade4f3a 100644
@@ -185,6 +185,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CFG_OR3_PRELIM		0xfff06ff7	/* 1MB PIXIS area*/
 
 
+#define CONFIG_FSL_PIXIS	1	/* use common PIXIS code */
 #define PIXIS_BASE	0xf8100000      /* PIXIS registers */
 #define PIXIS_ID		0x0	/* Board ID at offset 0 */
 #define PIXIS_VER		0x1	/* Board version at offset 1 */
Signature · 1 line
1.5.2.2
#1 lore raw

PATCH 1/1 support board vendor-common makefiles

Quoted 8 lines · In message <[email protected]> you wrote:

if a board/$(VENDOR)/common/Makefile exists, build it.

also add the first such case, board/freescale/common/Makefile, to handle building board-shared EEPROM, PIXIS, and MDS-PIB code, as dictated by board configuration.

thusly get rid of alternate build dir errors such as:

Quoted 7 lines

FATAL: can't create /work/wd/tmp/u-boot-ppc/board/freescale/mpc8360emds/../common/pq-mds-pib.o: No such file or directory

by putting the common/ mkdir command in its proper place (the common Makefile). Common bits from existing individual board Makefiles have been removed.

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
News is what a chap who doesn't care much  about  anything  wants  to
read. And it's only news until he's read it. After that it's dead.
                           - Evelyn Waugh _Scoop_ (1938) bk. 1, ch. 5