Skip to contentSkip to conversation

Please pull u-boot-ti/next

U-Boot New s-paulraj at ti.com 6 participants 21 messages Sep 18, 2011 – Sep 28, 2011

Subsystems (11)
lore
Share & tools
lore
#0 lore raw

Please pull u-boot-ti/next.
I checked all the patches for checkpatch errors.
Also all OMAP3 and OMAP4 built with no issues.

Thanks,
Sandeep

The following changes since commit 3522ad62864669b335b85f5abcd136a84bbb7519:
Ajay Bhargav (1):
Armada100: Enable 88E3015 PHY support for GplugD

are available in the git repository at:

git://git.denx.de/u-boot-ti.git next

Philip Balister (2):
OMAP3: Overo: Update GPMC timing for ethernet chip
overo: Set IEN on GPMC_CLK to support synchronous clocking.

Sandeep Paulraj (1):
devkit8000: Fix build break

Simon Schwarz (9):
omap-common/omap4: relocate early UART clock setup
omap3: Configure RAM bank 0 if in SPL
omap-common: add nand spl support
spl: add NAND Library to new SPL
spl: Add POWER library to new spl
omap3: new SPL structure support
devkit8000: Add nand-spl support for new SPL
omap3: implement boot parameter saving
omap-common: reorganize spl.c

 arch/arm/cpu/armv7/omap-common/Makefile     |    6 +
 arch/arm/cpu/armv7/omap-common/spl.c        |  165 +++---------------
 arch/arm/cpu/armv7/omap-common/spl_mmc.c    |  150 ++++++++++++++++
 arch/arm/cpu/armv7/omap-common/spl_nand.c   |   71 ++++++++
 arch/arm/cpu/armv7/omap3/board.c            |   50 ++++++-
 arch/arm/cpu/armv7/omap3/config.mk          |   30 ++++
 arch/arm/cpu/armv7/omap3/lowlevel_init.S    |   10 +
 arch/arm/cpu/armv7/omap3/sdrc.c             |   32 ++++-
 arch/arm/cpu/armv7/omap4/board.c            |    1 +
 arch/arm/include/asm/arch-omap3/mem.h       |   36 ++++
 arch/arm/include/asm/arch-omap3/omap_gpmc.h |    9 +
 arch/arm/include/asm/arch-omap3/sys_proto.h |    1 +
 arch/arm/include/asm/omap_common.h          |   31 ++++
 board/isee/igep0020/igep0020.c              |    1 +
 board/isee/igep0020/igep0020.h              |    9 -
 board/overo/overo.c                         |    1 +
 board/overo/overo.h                         |   11 +-
 board/timll/devkit8000/devkit8000.c         |    2 +-
 doc/README.SPL                              |    2 +
 drivers/mtd/nand/Makefile                   |   10 +-
 drivers/mtd/nand/nand_base.c                |    4 +-
 drivers/mtd/nand/nand_spl_simple.c          |  245 +++++++++++++++++++++++++++
 drivers/mtd/nand/omap_gpmc.c                |   27 +++
 include/configs/devkit8000.h                |   46 +++++
 include/nand.h                              |    6 +
 spl/Makefile                                |    2 +
 26 files changed, 794 insertions(+), 164 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl_mmc.c
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl_nand.c
 create mode 100644 arch/arm/cpu/armv7/omap3/config.mk
 create mode 100644 drivers/mtd/nand/nand_spl_simple.c
#1 lore raw

Hi Sandeep,

Le 19/09/2011 01:39, s-paulraj at ti.com a ?crit :

Quoted 6 lines

Please pull u-boot-ti/next.
I checked all the patches for checkpatch errors.
Also all OMAP3 and OMAP4 built with no issues.

Thanks,
Sandeep

As this is your 'next' branch, there is an ambiguity: can you please indicate if you want me to pull this into my 'next' or 'master' branch?

If on master, I assume you want me to also send out a pull request to Wolfgang, but I am not sure Wolfgang will allow it at this time.

Amicalement,

Signature · 1 line
Albert.
#2 lore raw

Dear Albert ARIBAUD,

Quoted 6 lines · In message <[email protected]> you wrote:

As this is your 'next' branch, there is an ambiguity: can you please indicate if you want me to pull this into my 'next' or 'master' branch?

If on master, I assume you want me to also send out a pull request to Wolfgang, but I am not sure Wolfgang will allow it at this time.

If I understand correctly this is mostly fixes, so I'd take it.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If it has syntax, it isn't user friendly.
#3 lore raw

Hi Wofgang,

Le 19/09/2011 09:47, Wolfgang Denk a ?crit :

Quoted 11 lines

Dear Albert ARIBAUD,

Quoted 6 lines · In message<[email protected]> you wrote:

As this is your 'next' branch, there is an ambiguity: can you please indicate if you want me to pull this into my 'next' or 'master' branch?

If on master, I assume you want me to also send out a pull request to Wolfgang, but I am not sure Wolfgang will allow it at this time.

If I understand correctly this is mostly fixes, so I'd take it.

Sandeep's 'next' branch is based on my 'next', not on my 'master', hence my question -- there would have to be a rebase if Sandeep expected me to pull into my master.

Sandeep, can you confirm what you want exactly? Meanwhile, I am launching regression builds on u-boot-ti/next, just in case.

Quoted 3 lines

Best regards,

Wolfgang Denk

Amicalement,

Signature · 1 line
Albert.
#4 lore raw
Quoted 16 lines

Hi Wofgang,

Le 19/09/2011 09:47, Wolfgang Denk a ?crit :

Quoted 10 lines

Dear Albert ARIBAUD,

Quoted 6 lines · In message<[email protected]> you wrote:

As this is your 'next' branch, there is an ambiguity: can you please indicate if you want me to pull this into my 'next' or 'master' branch?

If on master, I assume you want me to also send out a pull request to Wolfgang, but I am not sure Wolfgang will allow it at this time.

Quoted 9 lines
Quoted 1 line

If I understand correctly this is mostly fixes, so I'd take it.

Sandeep's 'next' branch is based on my 'next', not on my 'master', hence my question -- there would have to be a rebase if Sandeep expected me to pull into my master.

Sandeep, can you confirm what you want exactly? Meanwhile, I am launching regression builds on u-boot-ti/next, just in case.

Albert,

The pull request if for your next branch.

Thanks,
Sandeep

#5 lore raw

[U-Boot] SMDK6400 regression (was: Please pull u-boot-ti/next)

Le 19/09/2011 16:21, Paulraj, Sandeep a ?crit :

Quoted 22 lines
Quoted 22 lines

Hi Wofgang,

Le 19/09/2011 09:47, Wolfgang Denk a ?crit :

Quoted 11 lines

Dear Albert ARIBAUD,

Quoted 6 lines · In message<[email protected]> you wrote:

As this is your 'next' branch, there is an ambiguity: can you please indicate if you want me to pull this into my 'next' or 'master' branch?

If on master, I assume you want me to also send out a pull request to Wolfgang, but I am not sure Wolfgang will allow it at this time.

If I understand correctly this is mostly fixes, so I'd take it.

Sandeep's 'next' branch is based on my 'next', not on my 'master', hence my question -- there would have to be a rebase if Sandeep expected me to pull into my master.

Quoted 6 lines
Quoted 3 lines

Sandeep, can you confirm what you want exactly? Meanwhile, I am launching regression builds on u-boot-ti/next, just in case.

Albert,

The pull request if for your next branch.

Thanks a lot.

There is a regression in u-boot-ti/next with respect to u-boot-arm/next, on board smdk6400, causing the following build failure:

s3c64xx.c:80: error: static declaration of 'nand_read_buf' follows non-static declaration /home/uboot/src/u-boot-arm/include/nand.h:139: error: previous declaration of 'nand_read_buf' was here

Git bisect finds commit 55f429bb39614a16b1bacc9a8bea9ac01a60bfc8 is the cause of the regression.

Copying Simon as the author of the commit, in order to confirm that the issue is in smdk6400.

If so, as MAINTAINERS has smdk marked orphaned and its former maintainer resigned, I take the ti/next branch in as it is, and if no one steps in as a maintainer for SMDK6400 before end of the 2011-12 relea?se merge window, I will then apply a board removal patch for it.

Quoted 2 lines

Thanks,
Sandeep

Amicalement,

Signature · 1 line
Albert.
#6 lore raw

[U-Boot] SMDK6400 regression

On 09/20/2011 08:47 AM, Albert ARIBAUD wrote:
[SNIP]

Quoted 20 lines

There is a regression in u-boot-ti/next with respect to u-boot-arm/next, on board smdk6400, causing the following build failure:

s3c64xx.c:80: error: static declaration of 'nand_read_buf' follows non-static declaration /home/uboot/src/u-boot-arm/include/nand.h:139: error: previous declaration of 'nand_read_buf' was here

Git bisect finds commit 55f429bb39614a16b1bacc9a8bea9ac01a60bfc8 is the cause of the regression.

Copying Simon as the author of the commit, in order to confirm that the issue is in smdk6400.

If so, as MAINTAINERS has smdk marked orphaned and its former maintainer resigned, I take the ti/next branch in as it is, and if no one steps in as a maintainer for SMDK6400 before end of the 2011-12 relea?se merge window, I will then apply a board removal patch for it.

Quoted 4 lines
Quoted 2 lines

Thanks,
Sandeep

Amicalement,

Hi Albert,

will have a look at it.

Regards
Simon

#7 lore raw

[U-Boot] SMDK6400 regression

In reply to Albert ARIBAUD
Quoted 2 lines · Albert ARIBAUD

Copying Simon as the author of the commit, in order to confirm that the issue is in smdk6400.

The problem is that I added a nand_read_buf prototype in nand.h this was defined static in nand_base.c - I removed the static declaration. smdk6400 is defining the exact same functions in its SPL but they are static.

Dublicated code like this was the reason for my changes.

I can provide a quickfix by just remove the static from the smdk6400-functions. But IMHO it is more sensible to write a proper header for most of the functions in nand_base.c and remove the static modifier. Then they can be used in SPLs and no one tries to redo/copy them again. Scott what's your opinion on that?

Regards
Simon

#8 lore raw

[U-Boot] SMDK6400 regression

Quoted 5 lines · Simon Schwarz

I can provide a quickfix by just remove the static from the smdk6400-functions. But IMHO it is more sensible to write a proper header for most of the functions in nand_base.c and remove the static modifier. Then they can be used in SPLs and no one tries to redo/copy them again. Scott what's your opinion on that?

Sounds good.

-Scott

#9 lore raw

RFC PATCH 1/1 Add general nand functions

Added a nand_base.h header that defines all prototypes of nand_base.c functions. This is necessary because these functions were often copied in SPLs. This patch also removes the static definition of these functions in nand_base.c

It was necessary to also add nand_interface.c. This now defines static inline functions former defined in nand.h - theses functions had name conflicts with these in nand_base.c/h.

Files former included nand.h now include also nand_interface.h

Cc scottwood at freescale.com
Cc albert.u.boot at aribaud.net

---

 arch/arm/cpu/armv7/omap-common/spl.c            |    1 +
 arch/arm/cpu/armv7/omap-common/spl_nand.c       |    1 +
 arch/arm/lib/board.c                            |    1 +
 arch/blackfin/lib/board.c                       |    3 +-
 arch/m68k/lib/board.c                           |    1 +
 arch/mips/lib/board.c                           |    1 +
 arch/nios2/lib/board.c                          |    3 +-
 arch/powerpc/cpu/mpc85xx/cpu_init.c             |    1 +
 arch/powerpc/lib/board.c                        |    1 +
 board/BuS/eb_cpux9k2/cpux9k2.c                  |    1 +
 board/atmel/at91sam9261ek/at91sam9261ek.c       |    1 +
 board/atmel/at91sam9263ek/at91sam9263ek.c       |    1 +
 board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c |    1 +
 board/atmel/at91sam9rlek/at91sam9rlek.c         |    1 +
 board/dave/PPChameleonEVB/nand.c                |    1 +
 board/davedenx/qong/qong.c                      |    1 +
 board/davinci/da8xxevm/hawkboard_nand_spl.c     |    1 +
 board/davinci/dm355evm/dm355evm.c               |    1 +
 board/davinci/dm355leopard/dm355leopard.c       |    1 +
 board/davinci/dm365evm/dm365evm.c               |    1 +
 board/davinci/dm6467evm/dm6467evm.c             |    1 +
 board/davinci/sonata/sonata.c                   |    1 +
 board/esd/common/esd405ep_nand.c                |    1 +
 board/freescale/m5329evb/nand.c                 |    1 +
 board/freescale/m5373evb/nand.c                 |    1 +
 board/freescale/mpc8313erdb/mpc8313erdb.c       |    1 +
 board/freescale/mpc8315erdb/mpc8315erdb.c       |    1 +
 board/freescale/mpc8360erdk/nand.c              |    1 +
 board/ids8247/ids8247.c                         |    1 +
 board/keymile/km_arm/km_arm.c                   |    1 +
 board/prodrive/alpr/nand.c                      |    1 +
 board/prodrive/pdnb3/nand.c                     |    1 +
 board/quad100hd/nand.c                          |    1 +
 board/ronetix/pm9261/pm9261.c                   |    1 +
 board/ronetix/pm9263/pm9263.c                   |    1 +
 board/sc3/sc3nand.c                             |    1 +
 board/sheldon/simpc8313/simpc8313.c             |    1 +
 board/socrates/nand.c                           |    1 +
 board/spear/spear300/spear300.c                 |    1 +
 board/spear/spear310/spear310.c                 |    1 +
 board/spear/spear320/spear320.c                 |    1 +
 board/spear/spear600/spear600.c                 |    1 +
 board/tqc/tqm8272/nand.c                        |    1 +
 board/tqc/tqm85xx/nand.c                        |    1 +
 board/ve8313/ve8313.c                           |    1 +
 board/xes/common/actl_nand.c                    |    1 +
 common/cmd_jffs2.c                              |    1 +
 common/cmd_mtdparts.c                           |    1 +
 common/cmd_nand.c                               |    1 +
 common/cmd_ubi.c                                |    1 +
 common/env_nand.c                               |    1 +
 drivers/mtd/nand/atmel_nand.c                   |    1 +
 drivers/mtd/nand/bfin_nand.c                    |    1 +
 drivers/mtd/nand/davinci_nand.c                 |    1 +
 drivers/mtd/nand/fsl_upm.c                      |    1 +
 drivers/mtd/nand/kb9202_nand.c                  |    1 +
 drivers/mtd/nand/kirkwood_nand.c                |    1 +
 drivers/mtd/nand/kmeter1_nand.c                 |    1 +
 drivers/mtd/nand/mpc5121_nfc.c                  |    1 +
 drivers/mtd/nand/mxc_nand.c                     |    1 +
 drivers/mtd/nand/nand.c                         |    1 +
 drivers/mtd/nand/nand_base.c                    |  142 +++++++++++------------
 drivers/mtd/nand/nand_plat.c                    |    1 +
 drivers/mtd/nand/nand_spl_simple.c              |    1 +
 drivers/mtd/nand/nand_util.c                    |    1 +
 drivers/mtd/nand/ndfc.c                         |    1 +
 drivers/mtd/nand/nomadik.c                      |    1 +
 drivers/mtd/nand/omap_gpmc.c                    |    1 +
 drivers/mtd/nand/s3c2410_nand.c                 |    1 +
 drivers/mtd/nand/s3c64xx.c                      |   27 +----
 drivers/mtd/nand/spr_nand.c                     |    1 +
 fs/jffs2/jffs2_1pass.c                          |    1 +
 fs/jffs2/jffs2_nand_1pass.c                     |    1 +
 include/nand.h                                  |  132 ++++++++++++++++-----
 include/nand_base.h                             |  127 ++++++++++++++++++++
 include/nand_interface.h                        |   32 +++++
 nand_spl/board/freescale/mpc8536ds/nand_boot.c  |    1 +
 nand_spl/board/freescale/mpc8569mds/nand_boot.c |    1 +
 nand_spl/board/freescale/mpc8572ds/nand_boot.c  |    1 +
 nand_spl/board/freescale/p1023rds/nand_boot.c   |    1 +
 nand_spl/board/freescale/p1_p2_rdb/nand_boot.c  |    1 +
 nand_spl/board/samsung/smdk6400/Makefile        |   10 +-
 nand_spl/nand_boot.c                            |    1 +
 nand_spl/nand_boot_fsl_nfc.c                    |    1 +
 84 files changed, 419 insertions(+), 133 deletions(-)
 create mode 100644 include/nand_base.h
 create mode 100644 include/nand_interface.h
arch/arm/cpu/armv7/omap-common/spl.c +1 -0
index c76fea6..0d42dcd 100644
@@ -27,6 +27,7 @@
 #include <asm/utils.h>
 #include <asm/arch/sys_proto.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <mmc.h>
 #include <fat.h>
 #include <timestamp_autogenerated.h>
arch/arm/cpu/armv7/omap-common/spl_nand.c +1 -0
index af02a59..31ce5b1 100644
@@ -25,6 +25,7 @@
 #include <asm/utils.h>
 #include <asm/arch/sys_proto.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <timestamp_autogenerated.h>
 #include <version_autogenerated.h>
 #include <asm/omap_common.h>
arch/arm/lib/board.c +1 -0
index 85320bc..c73d26a 100644
@@ -46,6 +46,7 @@
 #include <net.h>
 #include <serial.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <onenand_uboot.h>
 #include <mmc.h>
 
arch/blackfin/lib/board.c +2 -1
index bfdb586..4568820 100644
@@ -25,7 +25,8 @@
 #include <kgdb.h>
 
 #ifdef CONFIG_CMD_NAND
-#include <nand.h>	/* cannot even include nand.h if it isnt configured */
+#include <nand.h>
+#include <nand_interface.h>	/* cannot even include nand.h if it isnt configured */
 #endif
 
 #ifdef CONFIG_BITBANGMII
arch/m68k/lib/board.c +1 -0
index 1df50f1..b08a490 100644
@@ -68,6 +68,7 @@
 #endif
 
 #include <nand.h>
+#include <nand_interface.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/mips/lib/board.c +1 -0
index 4f85bbd..2b722d9 100644
@@ -29,6 +29,7 @@
 #include <net.h>
 #include <environment.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <onenand_uboot.h>
 #include <spi.h>
 
arch/nios2/lib/board.c +2 -1
index f6c6bc1..1b21814 100644
@@ -37,7 +37,8 @@
 #include <nios2-epcs.h>
 #endif
 #ifdef CONFIG_CMD_NAND
-#include <nand.h>	/* cannot even include nand.h if it isnt configured */
+#include <nand.h>
+#include <nand_interface.h>	/* cannot even include nand.h if it isnt configured */
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
arch/powerpc/cpu/mpc85xx/cpu_init.c +1 -0
index 6aca166..fe65e7f 100644
@@ -39,6 +39,7 @@
 #include "mp.h"
 #ifdef CONFIG_SYS_QE_FW_IN_NAND
 #include <nand.h>
+#include <nand_interface.h>
 #include <errno.h>
 #endif
 
arch/powerpc/lib/board.c +1 -0
index 9885b14..bcc1cf2 100644
@@ -104,6 +104,7 @@ void doc_init (void);
 #endif
 #include <spi.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 static char *failed = "*** failed ***\n";
 
board/BuS/eb_cpux9k2/cpux9k2.c +1 -0
index 856d798..abff1c0 100644
@@ -27,6 +27,7 @@
 #include <net.h>
 #include <netdev.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
board/atmel/at91sam9261ek/at91sam9261ek.c +1 -0
index b6c7d9e..0dd3eb0 100644
@@ -212,6 +212,7 @@ static void at91sam9261ek_lcd_hw_init(void)
 
 #ifdef CONFIG_LCD_INFO
 #include <nand.h>
+#include <nand_interface.h>
 #include <version.h>
 
 void lcd_show_board_info(void)
board/atmel/at91sam9263ek/at91sam9263ek.c +1 -0
index 4d2937d..44f1db6 100644
@@ -200,6 +200,7 @@ static void at91sam9263ek_lcd_hw_init(void)
 
 #ifdef CONFIG_LCD_INFO
 #include <nand.h>
+#include <nand_interface.h>
 #include <version.h>
 
 #ifndef CONFIG_SYS_NO_FLASH
board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c +1 -0
index 24a8606..771769b 100644
@@ -222,6 +222,7 @@ static void at91sam9m10g45ek_lcd_hw_init(void)
 
 #ifdef CONFIG_LCD_INFO
 #include <nand.h>
+#include <nand_interface.h>
 #include <version.h>
 
 void lcd_show_board_info(void)
board/atmel/at91sam9rlek/at91sam9rlek.c +1 -0
index e559084..c7b5033 100644
@@ -150,6 +150,7 @@ static void at91sam9rlek_lcd_hw_init(void)
 
 #ifdef CONFIG_LCD_INFO
 #include <nand.h>
+#include <nand_interface.h>
 #include <version.h>
 
 void lcd_show_board_info(void)
board/dave/PPChameleonEVB/nand.c +1 -0
index 14b61a4..36f88a9 100644
@@ -26,6 +26,7 @@
 #if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
+#include <nand_interface.h>
 
 /*
  * hardware specific access to control-lines
board/davedenx/qong/qong.c +1 -0
index 99432ed..9cec15f 100644
@@ -27,6 +27,7 @@
 #include <asm/arch/imx-regs.h>
 #include <asm/io.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <fsl_pmic.h>
 #include <asm/gpio.h>
 #include "qong_fpga.h"
board/davinci/da8xxevm/hawkboard_nand_spl.c +1 -0
index e5e65e5..bc6e0fd 100644
@@ -29,6 +29,7 @@
 #include <asm/arch/davinci_misc.h>
 #include <ns16550.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
board/davinci/dm355evm/dm355evm.c +1 -0
index 112851a..ab00cc8 100644
@@ -18,6 +18,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/emif_defs.h>
board/davinci/dm355leopard/dm355leopard.c +1 -0
index 0ad5678..f1c5c10 100644
@@ -18,6 +18,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/gpio.h>
board/davinci/dm365evm/dm365evm.c +1 -0
index ac54106..50666a6 100644
@@ -18,6 +18,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/emif_defs.h>
board/davinci/dm6467evm/dm6467evm.c +1 -0
index 1a01c3c..6230c21 100644
@@ -20,6 +20,7 @@
 #include <netdev.h>
 #include <asm/io.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/arch/nand_defs.h>
 
 DECLARE_GLOBAL_DATA_PTR;
board/davinci/sonata/sonata.c +1 -0
index c194290..7696646 100644
@@ -26,6 +26,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/arch/nand_defs.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/davinci_misc.h>
board/esd/common/esd405ep_nand.c +1 -0
index 736176f..cf466b4 100644
@@ -26,6 +26,7 @@
 #if defined(CONFIG_CMD_NAND)
 #include <asm/io.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 /*
  * hardware specific access to control-lines
board/freescale/m5329evb/nand.c +1 -0
index 16025f9..056eca4 100644
@@ -33,6 +33,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_CMD_NAND)
 #include <nand.h>
+#include <nand_interface.h>
 #include <linux/mtd/mtd.h>
 
 #define SET_CLE		0x10
board/freescale/m5373evb/nand.c +1 -0
index df8c03b..0cd052f 100644
@@ -33,6 +33,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_CMD_NAND)
 #include <nand.h>
+#include <nand_interface.h>
 #include <linux/mtd/mtd.h>
 
 #define SET_CLE		0x10
board/freescale/mpc8313erdb/mpc8313erdb.c +1 -0
index 08f873d..0bf75a5 100644
@@ -31,6 +31,7 @@
 #include <vsc7385.h>
 #include <ns16550.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
board/freescale/mpc8315erdb/mpc8315erdb.c +1 -0
index 5dc558a..3f05326 100644
@@ -34,6 +34,7 @@
 #include <asm/io.h>
 #include <ns16550.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
board/freescale/mpc8360erdk/nand.c +1 -0
index 92d56a3..6ac994b 100644
@@ -17,6 +17,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/fsl_upm.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 static struct immap *im = (struct immap *)CONFIG_SYS_IMMR;
 
board/ids8247/ids8247.c +1 -0
index d621833..8edb57c 100644
@@ -309,6 +309,7 @@ int misc_init_r (void)
 
 #if defined(CONFIG_CMD_NAND)
 #include <nand.h>
+#include <nand_interface.h>
 #include <linux/mtd/mtd.h>
 #include <asm/io.h>
 
board/keymile/km_arm/km_arm.c +1 -0
index a8f2b23..9dbd8c1 100644
@@ -31,6 +31,7 @@
 #include <common.h>
 #include <i2c.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <netdev.h>
 #include <miiphy.h>
 #include <asm/io.h>
board/prodrive/alpr/nand.c +1 -0
index b18c96b..e99a920 100644
@@ -30,6 +30,7 @@
 
 #include <asm/processor.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 struct alpr_ndfc_regs {
 	u8 cmd[4];
board/prodrive/pdnb3/nand.c +1 -0
index 2efe027..470df66 100644
@@ -26,6 +26,7 @@
 #if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
+#include <nand_interface.h>
 
 struct pdnb3_ndfc_regs {
 	uchar cmd;
board/quad100hd/nand.c +1 -0
index a222099..e86aa8a 100644
@@ -27,6 +27,7 @@
 #include <asm/ppc4xx-gpio.h>
 #include <asm/io.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 /*
  *	hardware specific access to control-lines
board/ronetix/pm9261/pm9261.c +1 -0
index 871b94a..2c96c33 100644
@@ -192,6 +192,7 @@ static void pm9261_lcd_hw_init(void)
 
 #ifdef CONFIG_LCD_INFO
 #include <nand.h>
+#include <nand_interface.h>
 #include <version.h>
 
 extern flash_info_t flash_info[];
board/ronetix/pm9263/pm9263.c +1 -0
index cfc9847..3e11152 100644
@@ -292,6 +292,7 @@ static void pm9263_lcd_hw_init(void)
 
 #ifdef CONFIG_LCD_INFO
 #include <nand.h>
+#include <nand_interface.h>
 #include <version.h>
 
 extern flash_info_t flash_info[];
board/sc3/sc3nand.c +1 -0
index 62b40f1..0f06b30 100644
@@ -26,6 +26,7 @@
 #if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/processor.h>
 
 #define readb(addr)	*(volatile u_char *)(addr)
board/sheldon/simpc8313/simpc8313.c +1 -0
index 9126c42..caafdcb 100644
@@ -29,6 +29,7 @@
 #include <mpc83xx.h>
 #include <ns16550.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
board/socrates/nand.c +1 -0
index 7d76f42..3722e0e 100644
@@ -25,6 +25,7 @@
 
 #if defined(CONFIG_SYS_NAND_BASE)
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/errno.h>
 #include <asm/io.h>
 
board/spear/spear300/spear300.c +1 -0
index 60ee544..14f96fc 100644
@@ -23,6 +23,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
board/spear/spear310/spear310.c +1 -0
index 03dfe16..ea160bd 100644
@@ -24,6 +24,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
board/spear/spear320/spear320.c +1 -0
index 2ba2dbb..be65c12 100644
@@ -24,6 +24,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
board/spear/spear600/spear600.c +1 -0
index eef9a37..a6ad096 100644
@@ -23,6 +23,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
board/tqc/tqm8272/nand.c +1 -0
index 8c8341b..f771d2a 100644
@@ -134,6 +134,7 @@ static int	chipsel = 0;
 #if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
+#include <nand_interface.h>
 #include <linux/mtd/mtd.h>
 
 static u8 hwctl = 0;
board/tqc/tqm85xx/nand.c +1 -0
index 4b16c31..da137be 100644
@@ -35,6 +35,7 @@
 #include <ioports.h>
 
 #include <nand.h>
+#include <nand_interface.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
board/ve8313/ve8313.c +1 -0
index 166e459..c611c14 100644
@@ -31,6 +31,7 @@
 #include <mpc83xx.h>
 #include <ns16550.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 #include <asm/bitops.h>
 #include <asm/io.h>
board/xes/common/actl_nand.c +1 -0
index 465aeb0..2a3467b 100644
@@ -25,6 +25,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 
 /*
common/cmd_jffs2.c +1 -0
index 27296dd..b4f0f15 100644
@@ -98,6 +98,7 @@
 #if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand.h>
 #include <nand.h>
+#include <nand_interface.h>
 #endif
 
 #if defined(CONFIG_CMD_ONENAND)
common/cmd_mtdparts.c +1 -0
index 5481c88..ed7171b 100644
@@ -99,6 +99,7 @@
 #if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand.h>
 #include <nand.h>
+#include <nand_interface.h>
 #endif
 
 #if defined(CONFIG_CMD_ONENAND)
common/cmd_nand.c +1 -0
index 66e06a5..cca8754 100644
@@ -27,6 +27,7 @@
 #include <asm/byteorder.h>
 #include <jffs2/jffs2.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 #if defined(CONFIG_CMD_MTDPARTS)
 
common/cmd_ubi.c +1 -0
index 629758f..09aceee 100644
@@ -16,6 +16,7 @@
 #include <exports.h>
 
 #include <nand.h>
+#include <nand_interface.h>
 #include <onenand_uboot.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
common/env_nand.c +1 -0
index 14446a6..2197431 100644
@@ -38,6 +38,7 @@
 #include <linux/stddef.h>
 #include <malloc.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <search.h>
 #include <errno.h>
 
drivers/mtd/nand/atmel_nand.c +1 -0
index 818d362..4a1eab2 100644
@@ -30,6 +30,7 @@
 #include <asm/arch/at91_pio.h>
 
 #include <nand.h>
+#include <nand_interface.h>
 
 #ifdef CONFIG_ATMEL_NAND_HWECC
 
drivers/mtd/nand/bfin_nand.c +1 -0
index 3ee060f..8623eef 100644
@@ -24,6 +24,7 @@
 #endif
 
 #include <nand.h>
+#include <nand_interface.h>
 
 #include <asm/blackfin.h>
 #include <asm/portmux.h>
drivers/mtd/nand/davinci_nand.c +1 -0
index d41579c..a4ba354 100644
@@ -44,6 +44,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/arch/nand_defs.h>
 #include <asm/arch/emif_defs.h>
 
drivers/mtd/nand/fsl_upm.c +1 -0
index c33e278..8a99269 100644
@@ -17,6 +17,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/fsl_upm.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 static void fsl_upm_start_pattern(struct fsl_upm *upm, u32 pat_offset)
 {
drivers/mtd/nand/kb9202_nand.c +1 -0
index b8f46fa..7a48cd5 100644
@@ -30,6 +30,7 @@
 #include <asm/arch/hardware.h>
 
 #include <nand.h>
+#include <nand_interface.h>
 
 /*
  *      hardware specific access to control-lines
drivers/mtd/nand/kirkwood_nand.c +1 -0
index 376378e..aad3a41 100644
@@ -26,6 +26,7 @@
 #include <asm/io.h>
 #include <asm/arch/kirkwood.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 /* NAND Flash Soc registers */
 struct kwnandf_registers {
drivers/mtd/nand/kmeter1_nand.c +1 -0
index e8e5b7b..5bd6ff5 100644
@@ -23,6 +23,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 
 #define CONFIG_NAND_MODE_REG	(void *)(CONFIG_SYS_NAND_BASE + 0x20000)
drivers/mtd/nand/mpc5121_nfc.c +1 -0
index 7fd8a35..11a419c 100644
@@ -35,6 +35,7 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 #define DRV_NAME		"mpc5121_nfc"
 
drivers/mtd/nand/mxc_nand.c +1 -0
index 2a8dd7e..d70bcb5 100644
@@ -20,6 +20,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <linux/err.h>
 #include <asm/io.h>
 #if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX35)
drivers/mtd/nand/nand.c +1 -0
index d987f4c..82675a6 100644
@@ -23,6 +23,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 #ifndef CONFIG_SYS_NAND_BASE_LIST
 #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
drivers/mtd/nand/nand_base.c +70 -72

518 lines not on this page · raw message

drivers/mtd/nand/nand_plat.c +1 -0
index 37a0206..d0e22a4 100644
@@ -22,6 +22,7 @@
 #endif
 
 #include <nand.h>
+#include <nand_interface.h>
 
 static void plat_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
 {
drivers/mtd/nand/nand_spl_simple.c +1 -0
index 71491d4..5025491 100644
@@ -20,6 +20,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 
 static int nand_ecc_pos[] = CONFIG_SYS_NAND_ECCPOS;
drivers/mtd/nand/nand_util.c +1 -0
index 81bf366..d59dc4e 100644
@@ -48,6 +48,7 @@
 #include <asm/errno.h>
 #include <linux/mtd/mtd.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <jffs2/jffs2.h>
 
 typedef struct erase_info erase_info_t;
drivers/mtd/nand/ndfc.c +1 -0
index 6ebbb5e..510d755 100644
@@ -31,6 +31,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <linux/mtd/ndfc.h>
 #include <linux/mtd/nand_ecc.h>
 #include <asm/processor.h>
drivers/mtd/nand/nomadik.c +1 -0
index b76f4cb..8f7a9da 100644
@@ -23,6 +23,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 
 static inline int parity(int b) /* b is really a byte; returns 0 or ~0 */
drivers/mtd/nand/omap_gpmc.c +1 -0
index 5bbec48..2cde42b 100644
@@ -28,6 +28,7 @@
 #include <asm/arch/omap_gpmc.h>
 #include <linux/mtd/nand_ecc.h>
 #include <nand.h>
+#include <nand_base.h>
 
 static uint8_t cs;
 static struct nand_ecclayout hw_nand_oob = GPMC_NAND_HW_ECC_LAYOUT;
drivers/mtd/nand/s3c2410_nand.c +1 -0
index 27351fb..8e9c69e 100644
@@ -21,6 +21,7 @@
 #include <common.h>
 
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/arch/s3c24x0_cpu.h>
 #include <asm/io.h>
 
drivers/mtd/nand/s3c64xx.c +1 -26
index 084e475..c833ecf 100644
@@ -28,6 +28,7 @@
 #include <common.h>
 
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/arch/s3c6400.h>
 
 #include <asm/io.h>
@@ -60,32 +61,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);
drivers/mtd/nand/spr_nand.c +1 -0
index 097d0c6..93d7f84 100644
@@ -23,6 +23,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <linux/mtd/nand_ecc.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
fs/jffs2/jffs2_1pass.c +1 -0
index 5ddc2b9..a604265 100644
@@ -148,6 +148,7 @@ static struct part_info *current_part;
 #if (defined(CONFIG_JFFS2_NAND) && \
      defined(CONFIG_CMD_NAND) )
 #include <nand.h>
+#include <nand_interface.h>
 /*
  * Support for jffs2 on top of NAND-flash
  *
fs/jffs2/jffs2_nand_1pass.c +1 -0
index 740f787..084d1a9 100644
@@ -7,6 +7,7 @@
 #include <jffs2/jffs2.h>
 #include <jffs2/jffs2_1pass.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 #include "jffs2_nand_private.h"
 
include/nand.h +102 -30

148 lines not on this page · raw message

include/nand_base.h new file +127 -0

127 lines not on this page · raw message

include/nand_interface.h new file +32 -0
new file mode 100644
index 0000000..f5caab3
@@ -0,0 +1,32 @@
+#ifndef NAND_INTERFACE_H
+#define NAND_INTERFACE_H
+static  inline int nand_read(nand_info_t *info, loff_t ofs, size_t *len,
+		u_char *buf)
+{
+        return info->read(info, ofs, *len, (size_t *)len, buf);
+}
+
+static inline int nand_write(nand_info_t *info, loff_t ofs, size_t *len,
+		u_char *buf)
+{
+        return info->write(info, ofs, *len, (size_t *)len, buf);
+}
+
+static inline int nand_block_isbad(nand_info_t *info, loff_t ofs)
+{
+        return info->block_isbad(info, ofs);
+}
+
+static inline int nand_erase(nand_info_t *info, loff_t off,
+		size_t size)
+{
+        struct erase_info instr;
+
+        instr.mtd = info;
+        instr.addr = off;
+        instr.len = size;
+        instr.callback = 0;
+
+        return info->erase(info, &instr);
+}
+#endif /* NAND_INTERFACE_H */
nand_spl/board/freescale/mpc8536ds/nand_boot.c +1 -0
index 5a0a0c7..51d6738 100644
@@ -23,6 +23,7 @@
 #include <ns16550.h>
 #include <asm/io.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 u32 sysclk_tbl[] = {
 	33333000, 39999600, 49999500, 66666000,
nand_spl/board/freescale/mpc8569mds/nand_boot.c +1 -0
index 047da34..6efbf22 100644
@@ -23,6 +23,7 @@
 #include <asm/io.h>
 #include <ns16550.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/mmu.h>
 #include <asm/immap_85xx.h>
 #include <asm/fsl_ddr_sdram.h>
nand_spl/board/freescale/mpc8572ds/nand_boot.c +1 -0
index 7ca4d4d..2b785fa 100644
@@ -23,6 +23,7 @@
 #include <ns16550.h>
 #include <asm/io.h>
 #include <nand.h>
+#include <nand_interface.h>
 
 u32 sysclk_tbl[] = {
 	33333000, 39999600, 49999500, 66666000,
nand_spl/board/freescale/p1023rds/nand_boot.c +1 -0
index 0065c87..9eac83f 100644
@@ -24,6 +24,7 @@
 #include <ns16550.h>
 #include <asm/io.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/fsl_law.h>
 
 /* Fixed sdram init -- doesn't use serial presence detect. */
nand_spl/board/freescale/p1_p2_rdb/nand_boot.c +1 -0
index 16a756c..fbfe31e 100644
@@ -23,6 +23,7 @@
 #include <asm/io.h>
 #include <ns16550.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/mmu.h>
 #include <asm/immap_85xx.h>
 #include <asm/fsl_ddr_sdram.h>
nand_spl/board/samsung/smdk6400/Makefile +7 -3
index 2f9c307..32ea116 100644
@@ -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,10 @@ $(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
nand_spl/nand_boot.c +1 -0
index 4683c7c..af1235e 100644
@@ -20,6 +20,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/io.h>
 
 static int nand_ecc_pos[] = CONFIG_SYS_NAND_ECCPOS;
nand_spl/nand_boot_fsl_nfc.c +1 -0
index d6b0d9b..04e3ded 100644
@@ -26,6 +26,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <nand_interface.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/io.h>
 #include <fsl_nfc.h>
Signature · 1 line
1.7.4.1
#10 lore raw

RFC PATCH 1/1 Add general nand functions

RFC-Patch to solve this problem.

I had to modify many files because of a name conflict.

I will do BUILDALL for arm over the weekend...

What are the opinions for this solution? Scott?

Regards and have a nice weekend
Simon

On 09/23/2011 06:36 PM, Simon Schwarz wrote:
[SNIP]

#11 lore raw

RFC PATCH 1/1 Add general nand functions

In reply to Simon Schwarz
Quoted 2 lines · Simon Schwarz

Added a nand_base.h header that defines all prototypes of nand_base.c functions.

Just add the new prototypes to include/linux/mtd/nand.h (which gets included by nand.h), that's the header that goes with drivers/mtd/nand/nand_base.c.

Quoted 2 lines

This is necessary because these functions were often copied in SPLs.

You'd rather add new #includes to dozens of files, and keep duplicated code around, than fix a few SPLs? NACK.

Quoted 1 line

It was necessary to also add nand_interface.c.

You maen nand_interface.h?

Quoted 3 lines

This now defines static
inline functions former defined in nand.h - theses functions had name conflicts with these in nand_base.c/h.

If we have two functions with the same name that do different things, change the name of the one in nand.h.

arch/blackfin/lib/board.c line 29

Quoted 11 lines
arch/blackfin/lib/board.c +2 -1
index bfdb586..4568820 100644
@@ -25,7 +25,8 @@
 #include <kgdb.h>
 
 #ifdef CONFIG_CMD_NAND
-#include <nand.h>	/* cannot even include nand.h if it isnt configured */
+#include <nand.h>
+#include <nand_interface.h>	/* cannot even include nand.h if it isnt configured */

I don't think it's still true that you can't include nand.h if it isn't configured, BTW.

drivers/mtd/nand/nand_base.c line 54

Quoted 9 lines
drivers/mtd/nand/nand_base.c +1 -0
index e7dfcb1..3fe0935 100644
@@ -51,6 +51,8 @@
 #include <asm/io.h>
 #include <asm/errno.h>
 
+#include <nand_base.h>

Wait, there's *two* new headers?

Quoted 90 lines
drivers/mtd/nand/nand_base.c +90 -0
+/* nand_base.c Standard implementation of nand functions */
+void nand_release_device (struct mtd_info *mtd);
+uint8_t nand_read_byte(struct mtd_info *mtd);
+uint8_t nand_read_byte16(struct mtd_info *mtd);
+u16 nand_read_word(struct mtd_info *mtd);
+void nand_select_chip(struct mtd_info *mtd, int chipnr);
+void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len);
+void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len);
+int nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len);
+void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len);
+void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len);
+int nand_verify_buf16(struct mtd_info *mtd, const uint8_t *buf, int len);
+int nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip);
+int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs);
+int nand_check_wp(struct mtd_info *mtd);
+int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int getchip,
+		int allowbbt);
+void nand_wait_ready(struct mtd_info *mtd);
+void nand_command(struct mtd_info *mtd, unsigned int command, int column,
+		int page_addr);
+void nand_command_lp(struct mtd_info *mtd, unsigned int command, int column,
+		 int page_addr);
+int nand_get_device (struct nand_chip *this, struct mtd_info *mtd,
+		int new_state);
+int nand_wait(struct mtd_info *mtd, struct nand_chip *this);
+int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
+		uint8_t *buf, int page);
+static int nand_read_page_raw_syndrome(struct mtd_info *mtd,
+		struct nand_chip *chip, uint8_t *buf, int page);
+int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+		uint32_t data_offs, uint32_t readlen, uint8_t *bufpoi);
+int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
+		uint8_t *buf, int page);
+int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+		uint32_t data_offs, uint32_t readlen, uint8_t *bufpoi);
+int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
+		uint8_t *buf, int page);
+int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
+		struct nand_chip *chip, uint8_t *buf, int page);
+int nand_read_page_syndrome(struct mtd_info *mtd,
+		struct nand_chip *chip, uint8_t *buf, int page);
+uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob,
+		struct mtd_oob_ops *ops, size_t len);
+int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
+		struct mtd_oob_ops *ops);
+int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
+		int page, int sndcmd);
+int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
+		int page, int sndcmd);
+int nand_write_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
+		int page);
+int nand_write_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
+		int page);
+int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
+		struct mtd_oob_ops *ops);
+int nand_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);
+void nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
+		const uint8_t *buf);
+void nand_write_page_raw_syndrome(struct mtd_info *mtd,
+		struct nand_chip *chip, const uint8_t *buf);
+void nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
+		const uint8_t *buf);
+void nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
+		const uint8_t *buf);
+void nand_write_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
+		const uint8_t *buf);
+int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
+		const uint8_t *buf, int page, int cached, int raw);
+uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob,
+		struct mtd_oob_ops *ops);
+int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
+		struct mtd_oob_ops *ops);
+int nand_do_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops);
+int nand_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops);
+void single_erase_cmd(struct mtd_info *mtd, int page);
+void multi_erase_cmd(struct mtd_info *mtd, int page);
+int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
+		int allowbbt);
+int nand_read(struct mtd_info *mtd, loff_t from, size_t len,
+		size_t *retlen, uint8_t *buf);
+int nand_write(struct mtd_info *mtd, loff_t to, size_t len,
+		size_t *retlen, const uint8_t *buf);
+int nand_erase(struct mtd_info *mtd, struct erase_info *instr);
+void nand_sync(struct mtd_info *mtd);
+int nand_block_isbad(struct mtd_info *mtd, loff_t offs);
+int nand_block_markbad(struct mtd_info *mtd, loff_t ofs);
+void nand_set_defaults(struct nand_chip *chip, int busw);
+u16 onfi_crc16(u16 crc, u8 const *p, size_t len);
+int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
+		int *busw);

drivers/mtd/nand/nand_base.c

Quoted 10 lines
drivers/mtd/nand/nand_base.c +10 -0
+void nand_flash_detect_non_onfi(struct mtd_info *mtd, struct nand_chip *chip,
+		const struct nand_flash_dev *type, int *busw);
+const struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
+		struct nand_chip *chip, int busw, int *maf_id, int *dev_id,
+		const struct nand_flash_dev *type);
+int nand_scan_ident(struct mtd_info *mtd, int maxchips,
+		const struct nand_flash_dev *table);
+int nand_scan_tail(struct mtd_info *mtd);
+int nand_scan(struct mtd_info *mtd, int maxchips);
+void nand_release(struct mtd_info *mtd);

Can we limit the scope of this to functions (or classes thereof -- if we export one buffer function might as well export all the variants) that we actually need from a current SPL?

nand_spl/board/samsung/smdk6400/Makefile nandobj := $(OBJTREE)/nand_spl/ · line 38

Quoted 13 lines
nand_spl/board/samsung/smdk6400/Makefile +2 -2
index 2f9c307..32ea116 100644
@@ -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 

Are gc-sections/function-sections not already being set?

nand_spl/board/samsung/smdk6400/Makefile $(obj)smdk6400_nand_spl.c: · line 103

Quoted 13 lines
nand_spl/board/samsung/smdk6400/Makefile +4 -1
 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,10 @@ $(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 $@

This is a separate (albeit dependent) change from the NAND function exporting, BTW.

-Scott

#12 lore raw

RFC PATCH 1/1 Add general nand functions

Quoted 8 lines · Scott Wood
Quoted 2 lines · Simon Schwarz

Added a nand_base.h header that defines all prototypes of nand_base.c functions.

Just add the new prototypes to include/linux/mtd/nand.h (which gets included by nand.h), that's the header that goes with drivers/mtd/nand/nand_base.c.

That was my first intention. I changed my mind because of the name collisions.

Quoted 6 lines
Quoted 2 lines

This is necessary because these functions were often copied in SPLs.

You'd rather add new #includes to dozens of files, and keep duplicated code around, than fix a few SPLs? NACK.

Where do you see duplicated code? The additional include?

Quoted 4 lines
Quoted 1 line

It was necessary to also add nand_interface.c.

You maen nand_interface.h?

Yes sorry.

Quoted 14 lines
Quoted 3 lines

This now defines static
inline functions former defined in nand.h - theses functions had name conflicts with these in nand_base.c/h.

If we have two functions with the same name that do different things, change the name of the one in nand.h.

Quoted 7 lines
arch/blackfin/lib/board.c +0 -0
index bfdb586..4568820 100644
@@ -25,7 +25,8 @@
  #include<kgdb.h>
 
Quoted 9 lines

arch/blackfin/lib/board.c line 29

Quoted 4 lines
arch/blackfin/lib/board.c +2 -1
  #ifdef CONFIG_CMD_NAND
-#include<nand.h>	/* cannot even include nand.h if it isnt configured */
+#include<nand.h>
+#include<nand_interface.h>	/* cannot even include nand.h if it isnt configured */

I don't think it's still true that you can't include nand.h if it isn't configured, BTW.

Auto search and replace.

[SNIP]

so in essence I will:
- rename the inline functions
- just add the functions used in SPL now
- make better patch-splitting

objections?

Regards
Simon

#13 lore raw

RFC PATCH 1/1 Add general nand functions

Quoted 12 lines · Simon Schwarz
Quoted 8 lines · Scott Wood
Quoted 2 lines · Simon Schwarz

Added a nand_base.h header that defines all prototypes of nand_base.c functions.

Just add the new prototypes to include/linux/mtd/nand.h (which gets included by nand.h), that's the header that goes with drivers/mtd/nand/nand_base.c.

That was my first intention. I changed my mind because of the name collisions.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

This is necessary because these functions were often copied in SPLs.

You'd rather add new #includes to dozens of files, and keep duplicated code around, than fix a few SPLs? NACK.

Where do you see duplicated code? The additional include?

Sorry, I misparsed what was meant by the "this" in "this is necessary because these functions were often copied...".

Quoted 6 lines

so in essence I will:
- rename the inline functions
- just add the functions used in SPL now
- make better patch-splitting

objections?

Sounds good.

-Scott

#14 lore raw

RFC PATCH 1/3 nand: Remove static modifier from common functions

Removed static modifiers from functions that were often duplicated in SPL implementations.

---
 drivers/mtd/nand/nand_base.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mtd/nand/nand_base.c +3 -3
index e7dfcb1..109d2cf 100644
@@ -133,7 +133,7 @@ static void nand_release_device (struct mtd_info *mtd)
  *
  * Default read function for 8bit buswith
  */
-static uint8_t nand_read_byte(struct mtd_info *mtd)
+uint8_t nand_read_byte(struct mtd_info *mtd)
 {
 	struct nand_chip *chip = mtd->priv;
 	return readb(chip->IO_ADDR_R);
@@ -196,7 +196,7 @@ static void nand_select_chip(struct mtd_info *mtd, int chipnr)
  *
  * Default write function for 8bit buswith
  */
-static void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
+void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
 {
 	int i;
 	struct nand_chip *chip = mtd->priv;
@@ -249,7 +249,7 @@ static int nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
  *
  * Default write function for 16bit buswith
  */
-static void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
+void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
 {
 	int i;
 	struct nand_chip *chip = mtd->priv;
Signature · 1 line
1.7.4.1
#15 lore raw

RFC PATCH 2/3 nand: Add common functions to nand.h

Functions often used in SPL are now part of nand.h.

---
 include/nand.h |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
include/nand.h +7 -3
index b4140794..980408a 100644
@@ -135,9 +135,6 @@ int nand_get_lock_status(nand_info_t *meminfo, loff_t offset);
 int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst);
 void nand_deselect(void);
 
-void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len);
-void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len);
-
 #ifdef CONFIG_SYS_NAND_SELECT_DEVICE
 void board_nand_select_device(struct nand_chip *nand, int chip);
 #endif
@@ -154,3 +151,10 @@ __attribute__((noreturn)) void nand_boot(void);
 #define ENV_OFFSET_SIZE 8
 int get_nand_env_oob(nand_info_t *nand, unsigned long *result);
 #endif
+
+/* Standard NAND functions from nand_base.c */
+void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len);
+void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len);
+void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len);
+void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len);
+uint8_t nand_read_byte(struct mtd_info *mtd);
Signature · 1 line
1.7.4.1
#16 lore raw

RFC PATCH 3/3 Fix regression in SMDK6400

In reply to Simon Schwarz

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 comilation flags.

Description of the regression:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/108873

---
 drivers/mtd/nand/s3c64xx.c               |   26 --------------------------
 nand_spl/board/samsung/smdk6400/Makefile |    9 ++++++---
 2 files changed, 6 insertions(+), 29 deletions(-)
drivers/mtd/nand/s3c64xx.c +0 -26
index 084e475..7260537 100644
@@ -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);
nand_spl/board/samsung/smdk6400/Makefile +6 -3
index 2f9c307..c9e75ba 100644
@@ -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
Signature · 1 line
1.7.4.1
#17 lore raw

RFC PATCH 1/1 Add general nand functions

In reply to Scott Wood
Quoted 29 lines · Scott Wood
Quoted 12 lines · Simon Schwarz
Quoted 8 lines · Scott Wood
Quoted 2 lines · Simon Schwarz

Added a nand_base.h header that defines all prototypes of nand_base.c functions.

Just add the new prototypes to include/linux/mtd/nand.h (which gets included by nand.h), that's the header that goes with drivers/mtd/nand/nand_base.c.

That was my first intention. I changed my mind because of the name collisions.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

This is necessary because these functions were often copied in SPLs.

You'd rather add new #includes to dozens of files, and keep duplicated code around, than fix a few SPLs? NACK.

Where do you see duplicated code? The additional include?

Sorry, I misparsed what was meant by the "this" in "this is necessary because these functions were often copied...".

Quoted 5 lines

so in essence I will:
- rename the inline functions
- just add the functions used in SPL now
- make better patch-splitting

Quoted 6 lines
Quoted 1 line

objections?

Sounds good.

-Scott

Ok, new patch RFC is out. I didn't rename the inline functions because none of the duplicated names are used in an SPL.

Comments?

Regards
Simon

#18 lore raw

RFC PATCH 1/1 Add general nand functions

Quoted 11 lines · Simon Schwarz
Quoted 10 lines · Scott Wood
Quoted 6 lines · Simon Schwarz

so in essence I will:
- rename the inline functions
- just add the functions used in SPL now
- make better patch-splitting

objections?

Sounds good.

Quoted 7 lines
Quoted 2 lines

-Scott

Ok, new patch RFC is out. I didn't rename the inline functions because none of the duplicated names are used in an SPL.

Comments?

Looks much better, thanks.

-Scott

#19 lore raw

RFC PATCH 1/1 Add general nand functions

Quoted 15 lines · Scott Wood
Quoted 14 lines · Simon Schwarz
Quoted 12 lines · Scott Wood
Quoted 6 lines · Simon Schwarz

so in essence I will:
- rename the inline functions
- just add the functions used in SPL now
- make better patch-splitting

objections?

Sounds good.

-Scott

Quoted 9 lines
Quoted 4 lines

Ok, new patch RFC is out. I didn't rename the inline functions because none of the duplicated names are used in an SPL.

Comments?

Looks much better, thanks.

-Scott

Great. Will do MAKEALL for arm and post it later this day.

Regards
Simon

#20 lore raw
In reply to s-paulraj at ti.com

Le 19/09/2011 01:39, s-paulraj at ti.com a ?crit :

Quoted 22 lines

Please pull u-boot-ti/next.
I checked all the patches for checkpatch errors.
Also all OMAP3 and OMAP4 built with no issues.

Thanks,
Sandeep

The following changes since commit 3522ad62864669b335b85f5abcd136a84bbb7519:
Ajay Bhargav (1):
Armada100: Enable 88E3015 PHY support for GplugD

are available in the git repository at:

git://git.denx.de/u-boot-ti.git next

Philip Balister (2):
OMAP3: Overo: Update GPMC timing for ethernet chip
overo: Set IEN on GPMC_CLK to support synchronous clocking.

Sandeep Paulraj (1):
devkit8000: Fix build break

Quoted 10 lines

Simon Schwarz (9):
omap-common/omap4: relocate early UART clock setup
omap3: Configure RAM bank 0 if in SPL
omap-common: add nand spl support
spl: add NAND Library to new SPL
spl: Add POWER library to new spl
omap3: new SPL structure support
devkit8000: Add nand-spl support for new SPL
omap3: implement boot parameter saving
omap-common: reorganize spl.c

Applied to u-boot-arm/next (and then rebased above current u-boot/master), thanks!

(reminder: this causes a regression in orphan board smdk6400. If no new board maintainer steps in and fixes it before 2011-12 release, the board will be removed)

Amicalement,

Signature · 1 line
Albert.