From 323bfa8f436dc3bc57187c9b1488bc3146ff1522 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 23 Apr 2007 12:00:22 +0200 Subject: [PATCH 1/2] Remove BOARDLIBS usage completely Signed-off-by: Stefan Roese --- Makefile | 4 +++- board/ixdp425/config.mk | 3 --- board/mpc8360emds/config.mk | 5 ----- board/nc650/config.mk | 1 - board/prodrive/pdnb3/config.mk | 3 --- cpu/ixp/npe/Makefile | 2 +- doc/README.nand | 7 +------ include/configs/delta.h | 1 - include/configs/zylonite.h | 1 - 9 files changed, 5 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 9a27bc2f86..15dec1749c 100644 --- a/Makefile +++ b/Makefile @@ -197,6 +197,9 @@ LIBS += cpu/$(CPU)/lib$(CPU).a ifdef SOC LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a endif +ifeq ($(CPU),ixp) +LIBS += cpu/ixp/npe/libnpe.a +endif LIBS += lib_$(ARCH)/lib$(ARCH).a LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a \ fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a @@ -219,7 +222,6 @@ LIBS += $(shell if [ -d post/cpu/$(CPU) ]; then echo \ LIBS += $(shell if [ -d post/board/$(BOARDDIR) ]; then echo \ "post/board/$(BOARDDIR)/libpost$(BOARD).a"; fi) LIBS += common/libcommon.a -LIBS += $(BOARDLIBS) LIBS := $(addprefix $(obj),$(LIBS)) .PHONY : $(LIBS) diff --git a/board/ixdp425/config.mk b/board/ixdp425/config.mk index d49c0e7e6d..0436c5b785 100644 --- a/board/ixdp425/config.mk +++ b/board/ixdp425/config.mk @@ -1,4 +1 @@ TEXT_BASE = 0x00f80000 - -# include NPE ethernet driver -BOARDLIBS = $(obj)cpu/ixp/npe/libnpe.a diff --git a/board/mpc8360emds/config.mk b/board/mpc8360emds/config.mk index 5801a5f178..9ace8860cf 100644 --- a/board/mpc8360emds/config.mk +++ b/board/mpc8360emds/config.mk @@ -26,8 +26,3 @@ # TEXT_BASE = 0xFE000000 - -# -# Additional board-specific libraries -# -BOARDLIBS = libfdt/libfdt.a diff --git a/board/nc650/config.mk b/board/nc650/config.mk index 52c8ffe353..b5c9df2898 100644 --- a/board/nc650/config.mk +++ b/board/nc650/config.mk @@ -27,4 +27,3 @@ # TEXT_BASE = 0x40700000 -BOARDLIBS = $(obj)drivers/nand/libnand.a diff --git a/board/prodrive/pdnb3/config.mk b/board/prodrive/pdnb3/config.mk index 767075884a..2f7cc3b965 100644 --- a/board/prodrive/pdnb3/config.mk +++ b/board/prodrive/pdnb3/config.mk @@ -1,4 +1 @@ TEXT_BASE = 0x01f00000 - -# include NPE ethernet driver -BOARDLIBS = $(obj)cpu/ixp/npe/libnpe.a diff --git a/cpu/ixp/npe/Makefile b/cpu/ixp/npe/Makefile index 4de34fd5b9..7f020b5d57 100644 --- a/cpu/ixp/npe/Makefile +++ b/cpu/ixp/npe/Makefile @@ -87,7 +87,7 @@ START := $(addprefix $(obj),$(START)) all: $(LIB) -$(LIB): $(obj).depend $(OBJS) +$(LIB): $(OBJS) $(AR) $(ARFLAGS) $@ $(OBJS) ######################################################################### diff --git a/doc/README.nand b/doc/README.nand index b5171f4d40..5c31845a94 100644 --- a/doc/README.nand +++ b/doc/README.nand @@ -192,12 +192,7 @@ The old NAND handling code has been re-factored and is now confined to only board-specific files and - unfortunately - to the DoC code (see below). A new configuration variable has been introduced: CFG_NAND_LEGACY, which has to be defined in the board config file if -that board uses legacy code. If CFG_NAND_LEGACY is defined, the board -specific config.mk file should also have "BOARDLIBS = -drivers/nand_legacy/libnand_legacy.a". For boards using the new NAND -approach (PPChameleon and netstar at the moment) no variable is -necessary, but the config.mk should have "BOARDLIBS = -drivers/nand/libnand.a". +that board uses legacy code. The necessary changes have been made to all affected boards, and no build breakage has been introduced, except for NETTA and NETTA_ISDN diff --git a/include/configs/delta.h b/include/configs/delta.h index 91284fdace..15681208b6 100644 --- a/include/configs/delta.h +++ b/include/configs/delta.h @@ -188,7 +188,6 @@ /* * NAND Flash */ -/* Use the new NAND code. (BOARDLIBS = drivers/nand/libnand.a required) */ #undef CFG_NAND_LEGACY #define CFG_NAND0_BASE 0x0 /* 0x43100040 */ /* 0x10000000 */ diff --git a/include/configs/zylonite.h b/include/configs/zylonite.h index c6aa8ece5b..1e8ed7abdf 100644 --- a/include/configs/zylonite.h +++ b/include/configs/zylonite.h @@ -174,7 +174,6 @@ /* * NAND Flash */ -/* Use the new NAND code. (BOARDLIBS = drivers/nand/libnand.a required) */ #define CONFIG_NEW_NAND_CODE #define CFG_NAND0_BASE 0x0 #undef CFG_NAND1_BASE From a79886590593ba1d667c840caa4940c61639f18f Mon Sep 17 00:00:00 2001 From: Thomas Knobloch Date: Sat, 5 May 2007 07:04:42 +0200 Subject: [PATCH 2/2] NAND: Wrong calculation of page number in nand_block_bad() In case that there is no memory based bad block table available the function nand_block_checkbad() in drivers/mtd/nand/nand_base.c will call nand_block_bad() directly. When parameter 'getchip' is set to zero, nand_block_bad() will not right shift the offset to calculate the correct page number. Signed-off-by: Thomas Knobloch Signed-off-by: Stefan Roese --- drivers/nand/nand_base.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/nand/nand_base.c b/drivers/nand/nand_base.c index 8495829900..c6fee18222 100644 --- a/drivers/nand/nand_base.c +++ b/drivers/nand/nand_base.c @@ -427,8 +427,9 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip) struct nand_chip *this = mtd->priv; u16 bad; + page = (int)(ofs >> this->page_shift) & this->pagemask; + if (getchip) { - page = (int)(ofs >> this->page_shift); chipnr = (int)(ofs >> this->chip_shift); /* Grab the lock and see if the device is available */ @@ -436,18 +437,17 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip) /* Select the NAND device */ this->select_chip(mtd, chipnr); - } else - page = (int) ofs; + } if (this->options & NAND_BUSWIDTH_16) { - this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos & 0xFE, page & this->pagemask); + this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos & 0xFE, page); bad = cpu_to_le16(this->read_word(mtd)); if (this->badblockpos & 0x1) bad >>= 1; if ((bad & 0xFF) != 0xff) res = 1; } else { - this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos, page & this->pagemask); + this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos, page); if (this->read_byte(mtd) != 0xff) res = 1; }