From: Simon Schwarz <simonschwarzcor@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] Fix regression in SMDK6400
Date: Thu, 29 Sep 2011 09:44:03 +0200 [thread overview]
Message-ID: <1317282243-14848-4-git-send-email-simonschwarzcor@gmail.com> (raw)
In-Reply-To: <1317282243-14848-1-git-send-email-simonschwarzcor@gmail.com>
s3c64xx.c implemented its own nand_read_byte, nand_write_buf and
nand_read_buf functions. This provoked a regression when these functions
were made public by patch 55f429bb39614a16b1bacc9a8bea9ac01a60bfc8.
This deletes these duplicated functions from s3c64xx.c and adds the generic
implementations in nand_base.c to the spl Makefile. It also adds
-ffcuntion-sections and -gc-sections to the compilation flags of the SPL to
avoid errors originating from unused functions in nand_base.c.
Description of the regression:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/108873
Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
---
drivers/mtd/nand/s3c64xx.c | 26 --------------------------
nand_spl/board/samsung/smdk6400/Makefile | 9 ++++++---
2 files changed, 6 insertions(+), 29 deletions(-)
diff --git a/drivers/mtd/nand/s3c64xx.c b/drivers/mtd/nand/s3c64xx.c
index 084e475..7260537 100644
--- a/drivers/mtd/nand/s3c64xx.c
+++ b/drivers/mtd/nand/s3c64xx.c
@@ -60,32 +60,6 @@ static void print_oob(const char *header, struct mtd_info *mtd)
}
#endif /* S3C_NAND_DEBUG */
-#ifdef CONFIG_NAND_SPL
-static u_char nand_read_byte(struct mtd_info *mtd)
-{
- struct nand_chip *this = mtd->priv;
- return readb(this->IO_ADDR_R);
-}
-
-static void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
-{
- int i;
- struct nand_chip *this = mtd->priv;
-
- for (i = 0; i < len; i++)
- writeb(buf[i], this->IO_ADDR_W);
-}
-
-static void nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
-{
- int i;
- struct nand_chip *this = mtd->priv;
-
- for (i = 0; i < len; i++)
- buf[i] = readb(this->IO_ADDR_R);
-}
-#endif
-
static void s3c_nand_select_chip(struct mtd_info *mtd, int chip)
{
int ctrl = readl(NFCONT);
diff --git a/nand_spl/board/samsung/smdk6400/Makefile b/nand_spl/board/samsung/smdk6400/Makefile
index 2f9c307..c9e75ba 100644
--- a/nand_spl/board/samsung/smdk6400/Makefile
+++ b/nand_spl/board/samsung/smdk6400/Makefile
@@ -33,12 +33,12 @@ nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
- $(LDFLAGS_FINAL)
+ $(LDFLAGS_FINAL) -gc-sections
AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+CFLAGS += -DCONFIG_NAND_SPL -ffunction-sections
SOBJS = start.o cpu_init.o lowlevel_init.o
-COBJS = nand_boot.o nand_ecc.o s3c64xx.o smdk6400_nand_spl.o
+COBJS = nand_boot.o nand_ecc.o s3c64xx.o smdk6400_nand_spl.o nand_base.o
SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
@@ -98,6 +98,9 @@ $(obj)smdk6400_nand_spl.c:
@rm -f $@
@ln -s $(TOPDIR)/board/samsung/smdk6400/smdk6400_nand_spl.c $@
+$(obj)nand_base.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/mtd/nand/nand_base.c $@
#########################################################################
$(obj)%.o: $(obj)%.S
--
1.7.4.1
next prev parent reply other threads:[~2011-09-29 7:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-29 7:44 [U-Boot] [PATCH 0/3] fix: regression in SMDK6400 Simon Schwarz
2011-09-29 7:44 ` [U-Boot] [PATCH 1/3] nand: Remove static modifier from common functions Simon Schwarz
2011-09-29 7:44 ` [U-Boot] [PATCH 2/3] nand: Add common functions to nand.h Simon Schwarz
2011-10-03 23:54 ` Scott Wood
[not found] ` <CAA5zgp_P9LtYraPUPQSM1PPDg_eGHAJ0F-qXHwiF-B+69NS1oQ@mail.gmail.com>
2011-10-14 18:09 ` Simon Schwarz
2011-09-29 7:44 ` Simon Schwarz [this message]
2011-09-29 16:07 ` [U-Boot] [PATCH 0/3] fix: regression in SMDK6400 Scott Wood
2011-10-16 10:50 ` Simon Schwarz
2011-10-16 10:50 ` [U-Boot] [PATCH 1/3] nand: Remove static modifier from common functions Simon Schwarz
2011-10-28 20:45 ` Scott Wood
2011-10-16 10:50 ` [U-Boot] [PATCH 2/3] nand: Add common functions to linux/mtd/nand.h Simon Schwarz
2011-10-28 20:46 ` Scott Wood
2011-10-16 10:50 ` [U-Boot] [PATCH 3/3] Fix regression in SMDK6400 Simon Schwarz
2011-10-31 16:34 ` [U-Boot] [PATCH V3 0/2] fix: " Simon Schwarz
2011-10-31 16:34 ` [U-Boot] [PATCH V3 1/2] nand: Add common functions to linux/mtd/nand.h Simon Schwarz
2011-10-31 17:52 ` Scott Wood
2011-11-25 19:05 ` Albert ARIBAUD
2011-11-25 19:12 ` Albert ARIBAUD
2011-10-31 16:34 ` [U-Boot] [PATCH V3 2/2] Fix regression in SMDK6400 Simon Schwarz
2011-11-25 19:40 ` [U-Boot] [PATCH V3 0/2] fix: " Albert ARIBAUD
2011-11-29 8:32 ` Simon Schwarz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1317282243-14848-4-git-send-email-simonschwarzcor@gmail.com \
--to=simonschwarzcor@googlemail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox