Skip to contentSkip to conversation

FSL: Convert board/freescale/common/Makefile to use CONFIG_

PATCH New Jon Loeliger 3 participants 7 messages Jan 15, 2008 – Jan 16, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 FSL: Convert board/freescale/common/Makefile to use CONFIG_

Convert the board/freescale/common/Makefile to use CONFIG_* options to select which files to conditionally compile into the board/freescale/common library rather than conditionally compiling entire files.

Supports CONFIG_FSL_PIXIS and CONFIG_FSL_DIU_FB. CONFIG_ID_EEPROM is introduced until CFG_ID_EEPROM is gone.

---
 board/freescale/common/Makefile      |   12 +++++++-----
 board/freescale/common/fsl_diu_fb.c  |    3 ---
 board/freescale/common/pixis.c       |    4 +---
 board/freescale/common/sys_eeprom.c  |    2 --
 board/freescale/mpc8610hpcd/Makefile |   12 ++++++------
 include/configs/MPC8610HPCD.h        |    3 +++
 include/configs/MPC8641HPCN.h        |    3 +++
 7 files changed, 20 insertions(+), 19 deletions(-)
board/freescale/common/Makefile +7 -5
index 9cee9f1..a060957 100644
@@ -29,11 +29,13 @@ endif
 
 LIB	= $(obj)lib$(VENDOR).a
 
-COBJS	:= sys_eeprom.o	\
-	   pixis.o	\
-	   pq-mds-pib.o \
-	   fsl_logo_bmp.o \
-	   fsl_diu_fb.o
+COBJS	:= pq-mds-pib.o
+
+COBJS-${CONFIG_ID_EEPROM}	+= sys_eeprom.o
+COBJS-${CONFIG_FSL_DIU_FB}	+= fsl_diu_fb.o fsl_logo_bmp.o
+COBJS-${CONFIG_FSL_PIXIS}	+= pixis.o
+
+COBJS	+= ${COBJS-y}
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
board/freescale/common/fsl_diu_fb.c +0 -3
index 5a8576e..2336f6b 100644
@@ -27,8 +27,6 @@
 #include <i2c.h>
 #include <malloc.h>
 
-#ifdef CONFIG_FSL_DIU_FB
-
 #include "fsl_diu_fb.h"
 
 #ifdef DEBUG
@@ -615,4 +613,3 @@ void fsl_diu_clear_screen(void)
 
 	memset(info->screen_base, 0, info->smem_len);
 }
-#endif /* CONFIG_FSL_DIU_FB */
board/freescale/common/pixis.c +1 -3
index 45dcf4d..00eb4a0 100644
@@ -25,9 +25,8 @@
 #include <common.h>
 #include <command.h>
 #include <watchdog.h>
-
-#ifdef CONFIG_FSL_PIXIS
 #include <asm/cache.h>
+
 #include "pixis.h"
 
 
@@ -474,4 +473,3 @@ 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/sys_eeprom.c +0 -2
index 7bc663b..bb91e67 100644
@@ -27,7 +27,6 @@
 #include <i2c.h>
 #include <linux/ctype.h>
 
-#ifdef CFG_ID_EEPROM
 typedef struct {
 	unsigned char id[4];		/* 0x0000 - 0x0003 */
 	unsigned char sn[12];		/* 0x0004 - 0x000F */
@@ -253,4 +252,3 @@ int mac_read_from_eeprom(void)
 	}
 	return 0;
 }
-#endif /* CFG_ID_EEPROM */
board/freescale/mpc8610hpcd/Makefile +6 -6
index 76087c1..12a92ae 100644
@@ -27,14 +27,14 @@ endif
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= $(BOARD).o \
-	../common/sys_eeprom.o \
-	../common/pixis.o \
-	mpc8610hpcd_diu.o \
-	../common/fsl_diu_fb.o
-
 SOBJS	:= init.o
 
+COBJS	:= $(BOARD).o
+
+COBJS-${CONFIG_FSL_DIU_FB}	+= mpc8610hpcd_diu.o
+
+COBJS	+= ${COBJS-y}
+
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 SOBJS	:= $(addprefix $(obj),$(SOBJS))
include/configs/MPC8610HPCD.h +3 -0
index f77c29d..ac4b3e1 100644
@@ -141,6 +141,9 @@
 #endif
 
 #define CFG_ID_EEPROM
+#ifdef CFG_ID_EEPROM
+#define CONFIG_ID_EEPROM
+#endif
 #define ID_EEPROM_ADDR		0x57
 
 
include/configs/MPC8641HPCN.h +3 -0
index 7f485c6..ab875f0 100644
@@ -152,6 +152,9 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #endif
 
 #define CFG_ID_EEPROM	1
+#ifdef CFG_ID_EEPROM
+#define CONFIG_ID_EEPROM
+#endif
 #define ID_EEPROM_ADDR 0x57
 
 /*
Signature · 1 line
1.5.2.1.126.g6abd0
#1 lore raw

PATCH 1/1 FSL: Convert board/freescale/common/Makefile to use CONFIG_

On Tue, 15 Jan 2008 15:21:09 -0600
Jon Loeliger <[email protected]> wrote:

<snip>

board/freescale/common/Makefile endif · line 38

Quoted 13 lines
board/freescale/common/Makefile +7 -5
-COBJS	:= sys_eeprom.o	\
-	   pixis.o	\
-	   pq-mds-pib.o \
-	   fsl_logo_bmp.o \
-	   fsl_diu_fb.o
+COBJS	:= pq-mds-pib.o
+
+COBJS-${CONFIG_ID_EEPROM}	+= sys_eeprom.o
+COBJS-${CONFIG_FSL_DIU_FB}	+= fsl_diu_fb.o fsl_logo_bmp.o
+COBJS-${CONFIG_FSL_PIXIS}	+= pixis.o
+
+COBJS	+= ${COBJS-y}

what, no love for pq-mds-pib.o (CONFIG_PQ_MDS_PIB)?

Kim

#2 lore raw

PATCH 1/1 FSL: Convert board/freescale/common/Makefile to use CONFIG_

Quoted 4 lines · Kim Phillips

On Tue, 15 Jan 2008 15:21:09 -0600
Jon Loeliger <[email protected]> wrote:

<snip>

Quoted 12 lines

board/freescale/common/Makefile endif · line 38

Quoted 12 lines
board/freescale/common/Makefile +7 -5
-COBJS        := sys_eeprom.o \
-        pixis.o      \
-        pq-mds-pib.o \
-        fsl_logo_bmp.o \
-        fsl_diu_fb.o
+COBJS        := pq-mds-pib.o
+
+COBJS-${CONFIG_ID_EEPROM}    += sys_eeprom.o
+COBJS-${CONFIG_FSL_DIU_FB}   += fsl_diu_fb.o fsl_logo_bmp.o
+COBJS-${CONFIG_FSL_PIXIS}    += pixis.o
+
+COBJS        += ${COBJS-y}

Nit: Don't do it this way; do this instead (to match the style used in other Makefiles):

+COBJS-y := pq-mds-pib.o

+COBJS-${CONFIG_ID_EEPROM}    += sys_eeprom.o
+COBJS-${CONFIG_FSL_DIU_FB}   += fsl_diu_fb.o fsl_logo_bmp.o
+COBJS-${CONFIG_FSL_PIXIS}    += pixis.o

-SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)

Quoted 15 lines
Quoted 1 line

what, no love for pq-mds-pib.o (CONFIG_PQ_MDS_PIB)?

Kim

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#3 lore raw

PATCH 1/1 FSL: Convert board/freescale/common/Makefile to use CONFIG_

board/freescale/common/Makefile endif

Quoted 10 lines · Grant Likely

Nit: Don't do it this way; do this instead (to match the style used in other Makefiles):

board/freescale/common/Makefile +5 -1
+COBJS-y        := pq-mds-pib.o
+COBJS-${CONFIG_ID_EEPROM}    += sys_eeprom.o
+COBJS-${CONFIG_FSL_DIU_FB}   += fsl_diu_fb.o fsl_logo_bmp.o
+COBJS-${CONFIG_FSL_PIXIS}    += pixis.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)

So, are you going to submit a patch to convert them all to be like that then?

I looked at this one in drivers/net:

        COBJS-y += tsec.o
        COBJS-y += tsi108_eth.o
        COBJS-y += uli526x.o
         
        COBJS   := $(COBJS-y)
        SRCS    := $(COBJS:.o=.c)
        OBJS    := $(addprefix $(obj),$(COBJS))

which clearly left COBJS around and set it up based on COBJS-y contents. So I guess my question boils down to "future intent" here. Should all the files end up on COBJS or on COBJS-y really?

Thanks,
jdl

#4 lore raw

PATCH 1/1 FSL: Convert board/freescale/common/Makefile to use CONFIG_

Quoted 10 lines · Jon Loeliger
Quoted 8 lines · Grant Likely

Nit: Don't do it this way; do this instead (to match the style used in other Makefiles):

board/freescale/common/Makefile +4 -0
+COBJS-y        := pq-mds-pib.o
+COBJS-${CONFIG_ID_EEPROM}    += sys_eeprom.o
+COBJS-${CONFIG_FSL_DIU_FB}   += fsl_diu_fb.o fsl_logo_bmp.o
+COBJS-${CONFIG_FSL_PIXIS}    += pixis.o
Quoted 8 lines

Review

Quoted 2 lines
(quoted diff) +1 -1
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)

So, are you going to submit a patch to convert
them all to be like that then?

I looked at this one in drivers/net:

Hmm, I missed that when drivers/Makefile was split up into the subdirectories. When I first split up the COBJS, I eliminated COBJS entirely in favor of COBJS-y. It's not a big deal though.

However, I would at the very least change this:

COBJS := pq-mds-pib.o

to this:

COBJS=y += pq-mds-pib.o

So that all obj files are added in the same way.

Cheers,
g.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#5 lore raw

PATCH 1/1 FSL: Convert board/freescale/common/Makefile to use CONFIG_

In reply to Grant Likely

Review

Quoted 5 lines · Grant Likely

Nit: Don't do it this way; do this instead (to match the style used in other Makefiles):

(quoted diff) +1 -1
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)

Double nit-nit: You actually have to cover OBJS
as well as SRCS here. :-)

SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))

otherwise nothing gets built at all...

[singing]
O-ho, the swell shiny new patch
Is a-coming' down the 'net,
Oh please let be for me!
[nuff]

jdl

#6 lore raw

PATCH 1/1 FSL: Convert board/freescale/common/Makefile to use CONFIG_

In reply to Kim Phillips
Quoted 20 lines · Kim Phillips

On Tue, 15 Jan 2008 15:21:09 -0600
Jon Loeliger <[email protected]> wrote:

<snip>

board/freescale/common/Makefile endif · line 38

Quoted 13 lines
board/freescale/common/Makefile +7 -5
-COBJS	:= sys_eeprom.o	\
-	   pixis.o	\
-	   pq-mds-pib.o \
-	   fsl_logo_bmp.o \
-	   fsl_diu_fb.o
+COBJS	:= pq-mds-pib.o
+
+COBJS-${CONFIG_ID_EEPROM}	+= sys_eeprom.o
+COBJS-${CONFIG_FSL_DIU_FB}	+= fsl_diu_fb.o fsl_logo_bmp.o
+COBJS-${CONFIG_FSL_PIXIS}	+= pixis.o
+
+COBJS	+= ${COBJS-y}

what, no love for pq-mds-pib.o (CONFIG_PQ_MDS_PIB)?

Quoted 1 line

Kim

Well, I was hitting the stuff that I nominally had some degree of Custodian-ship over directly.

I will take this as direct "permission" that I'll be submitting non-86xx stuff through my repository.

New patch coming!

jdl