mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-03 10:00:42 +09:00
Merge with /home/wd/git/u-boot/custodian/u-boot-nand-flash
This commit is contained in:
commit
55aee109ce
4
Makefile
4
Makefile
@ -197,6 +197,9 @@ LIBS += cpu/$(CPU)/lib$(CPU).a
|
|||||||
ifdef SOC
|
ifdef SOC
|
||||||
LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
|
LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(CPU),ixp)
|
||||||
|
LIBS += cpu/ixp/npe/libnpe.a
|
||||||
|
endif
|
||||||
LIBS += lib_$(ARCH)/lib$(ARCH).a
|
LIBS += lib_$(ARCH)/lib$(ARCH).a
|
||||||
LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.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
|
fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a
|
||||||
@ -220,7 +223,6 @@ LIBS += $(shell if [ -d post/board/$(BOARDDIR) ]; then echo \
|
|||||||
"post/board/$(BOARDDIR)/libpost$(BOARD).a"; fi)
|
"post/board/$(BOARDDIR)/libpost$(BOARD).a"; fi)
|
||||||
LIBS += common/libcommon.a
|
LIBS += common/libcommon.a
|
||||||
LIBS += libfdt/libfdt.a
|
LIBS += libfdt/libfdt.a
|
||||||
LIBS += $(BOARDLIBS)
|
|
||||||
|
|
||||||
LIBS := $(addprefix $(obj),$(LIBS))
|
LIBS := $(addprefix $(obj),$(LIBS))
|
||||||
.PHONY : $(LIBS)
|
.PHONY : $(LIBS)
|
||||||
|
@ -1,4 +1 @@
|
|||||||
TEXT_BASE = 0x00f80000
|
TEXT_BASE = 0x00f80000
|
||||||
|
|
||||||
# include NPE ethernet driver
|
|
||||||
BOARDLIBS = $(obj)cpu/ixp/npe/libnpe.a
|
|
||||||
|
@ -1,4 +1 @@
|
|||||||
TEXT_BASE = 0x01f00000
|
TEXT_BASE = 0x01f00000
|
||||||
|
|
||||||
# include NPE ethernet driver
|
|
||||||
BOARDLIBS = $(obj)cpu/ixp/npe/libnpe.a
|
|
||||||
|
@ -87,7 +87,7 @@ START := $(addprefix $(obj),$(START))
|
|||||||
|
|
||||||
all: $(LIB)
|
all: $(LIB)
|
||||||
|
|
||||||
$(LIB): $(obj).depend $(OBJS)
|
$(LIB): $(OBJS)
|
||||||
$(AR) $(ARFLAGS) $@ $(OBJS)
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
@ -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
|
to only board-specific files and - unfortunately - to the DoC code
|
||||||
(see below). A new configuration variable has been introduced:
|
(see below). A new configuration variable has been introduced:
|
||||||
CFG_NAND_LEGACY, which has to be defined in the board config file if
|
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
|
that board uses legacy code.
|
||||||
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".
|
|
||||||
|
|
||||||
The necessary changes have been made to all affected boards, and no
|
The necessary changes have been made to all affected boards, and no
|
||||||
build breakage has been introduced, except for NETTA and NETTA_ISDN
|
build breakage has been introduced, except for NETTA and NETTA_ISDN
|
||||||
|
@ -427,8 +427,9 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip)
|
|||||||
struct nand_chip *this = mtd->priv;
|
struct nand_chip *this = mtd->priv;
|
||||||
u16 bad;
|
u16 bad;
|
||||||
|
|
||||||
|
page = (int)(ofs >> this->page_shift) & this->pagemask;
|
||||||
|
|
||||||
if (getchip) {
|
if (getchip) {
|
||||||
page = (int)(ofs >> this->page_shift);
|
|
||||||
chipnr = (int)(ofs >> this->chip_shift);
|
chipnr = (int)(ofs >> this->chip_shift);
|
||||||
|
|
||||||
/* Grab the lock and see if the device is available */
|
/* 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 */
|
/* Select the NAND device */
|
||||||
this->select_chip(mtd, chipnr);
|
this->select_chip(mtd, chipnr);
|
||||||
} else
|
}
|
||||||
page = (int) ofs;
|
|
||||||
|
|
||||||
if (this->options & NAND_BUSWIDTH_16) {
|
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));
|
bad = cpu_to_le16(this->read_word(mtd));
|
||||||
if (this->badblockpos & 0x1)
|
if (this->badblockpos & 0x1)
|
||||||
bad >>= 1;
|
bad >>= 1;
|
||||||
if ((bad & 0xFF) != 0xff)
|
if ((bad & 0xFF) != 0xff)
|
||||||
res = 1;
|
res = 1;
|
||||||
} else {
|
} 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)
|
if (this->read_byte(mtd) != 0xff)
|
||||||
res = 1;
|
res = 1;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,6 @@
|
|||||||
/*
|
/*
|
||||||
* NAND Flash
|
* NAND Flash
|
||||||
*/
|
*/
|
||||||
/* Use the new NAND code. (BOARDLIBS = drivers/nand/libnand.a required) */
|
|
||||||
#undef CFG_NAND_LEGACY
|
#undef CFG_NAND_LEGACY
|
||||||
|
|
||||||
#define CFG_NAND0_BASE 0x0 /* 0x43100040 */ /* 0x10000000 */
|
#define CFG_NAND0_BASE 0x0 /* 0x43100040 */ /* 0x10000000 */
|
||||||
|
@ -174,7 +174,6 @@
|
|||||||
/*
|
/*
|
||||||
* NAND Flash
|
* NAND Flash
|
||||||
*/
|
*/
|
||||||
/* Use the new NAND code. (BOARDLIBS = drivers/nand/libnand.a required) */
|
|
||||||
#define CONFIG_NEW_NAND_CODE
|
#define CONFIG_NEW_NAND_CODE
|
||||||
#define CFG_NAND0_BASE 0x0
|
#define CFG_NAND0_BASE 0x0
|
||||||
#undef CFG_NAND1_BASE
|
#undef CFG_NAND1_BASE
|
||||||
|
Loading…
Reference in New Issue
Block a user