All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Schwarz <simonschwarzcor@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V3 2/2] Fix regression in SMDK6400
Date: Mon, 31 Oct 2011 17:34:45 +0100	[thread overview]
Message-ID: <1320078885-383-3-git-send-email-simonschwarzcor@gmail.com> (raw)
In-Reply-To: <1320078885-383-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>
Cc: scottwood at freescale.com
Cc: s-paulraj at ti.com
Cc: albert.u.boot at aribaud.net
---
Changes V2:
CHG include linux/mtd/nand.h because of:
  http://article.gmane.org/gmane.comp.boot-loaders.u-boot/110219

Changes V3:
none
---
 drivers/mtd/nand/s3c64xx.c               |   28 ++--------------------------
 nand_spl/board/samsung/smdk6400/Makefile |    9 ++++++---
 2 files changed, 8 insertions(+), 29 deletions(-)

diff --git a/drivers/mtd/nand/s3c64xx.c b/drivers/mtd/nand/s3c64xx.c
index 084e475..87f0341 100644
--- a/drivers/mtd/nand/s3c64xx.c
+++ b/drivers/mtd/nand/s3c64xx.c
@@ -28,6 +28,8 @@
 #include <common.h>
 
 #include <nand.h>
+#include <linux/mtd/nand.h>
+
 #include <asm/arch/s3c6400.h>
 
 #include <asm/io.h>
@@ -60,32 +62,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

  parent reply	other threads:[~2011-10-31 16:34 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 ` [U-Boot] [PATCH 3/3] Fix regression in SMDK6400 Simon Schwarz
2011-09-29 16:07 ` [U-Boot] [PATCH 0/3] fix: " 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     ` Simon Schwarz [this message]
2011-11-25 19:40     ` [U-Boot] [PATCH V3 0/2] fix: regression in SMDK6400 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=1320078885-383-3-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.