Skip to contentSkip to conversation

MTD update

PATCH New William Juul 4 participants 8 messages Nov 7, 2007 – Nov 9, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MTD update

Update MTD to that of Linux 2.6.22.1

A lot changed in the Linux MTD code, since it was last ported from Linux to U-Boot. This patch takes U-Boot NAND support to the level of Linux 2.6.22.1 and will enable support for very large NAND devices (4KB pages) and ease the compatibility between U-Boot and Linux filesystems and drivers.

This patch is tested on two custom boards with PPC and ARM processors running YAFFS in U-Boot and Linux using gcc-4.1.2 cross compilers.

MAKEALL ppc/arm has some issues:
* DOC/OneNand/nand_spl is not building (I have not tried porting these parts, and since I do not have any HW and I am not familiar with this code/HW I think its best left to someone else.)

Except for the issues mentioned above, I have ported all drivers necessary to run MAKEALL ppc/arm without errors and warnings. Many drivers were trivial to port, but some were not so trivial. The following drivers must be examined carefully and maybe rewritten to some degree:
cpu/ppc4xx/ndfc.c
cpu/arm926ejs/davinci/nand.c
board/delta/nand.c
board/zylonite/nand.c

----

We have set up a git repository were you can pull the patch:
http://git.tandberg.com/tandberg/u-boot.git

The master branch is tracking the official u-boot.git master branch. The branch mtd-update-1.3.0-rc3 is based on tag v1.3.0-rc3 The branch mtd-update will (eventually) continue to track u-boot updates and then spin off mtd-update-1.3.0 when v1.3.0 is released.

The file drivers/nand/nand_base.c contains the struct nand_oob_128 which is not (yet) part of Linux mtd. I will try to figure out if this implementation is valid by asking on the linux-mtd mailing list.

Best regards
William Juul

Summary of changes between current head on branch
mtd-update-1.3.0-rc3 and u-boot tag v1.3.0-rc3:

 board/bf537-stamp/nand.c         |   43 +-
 board/dave/PPChameleonEVB/nand.c |   49 +-
 board/delta/nand.c               |   41 +-
 board/esd/common/esd405ep_nand.c |   42 +-
 board/freescale/m5329evb/nand.c  |   42 +-
 board/nc650/nand.c               |   78 +-
 board/netstar/nand.c             |   20 +-
 board/prodrive/alpr/nand.c       |   59 +-
 board/prodrive/pdnb3/nand.c      |   53 +-
 board/sc3/sc3nand.c              |   44 +-
 board/tqm8272/tqm8272.c          |   34 +-
 board/zylonite/nand.c            |   39 +-
 common/cmd_doc.c                 |    5 +-
 common/cmd_nand.c                | 1516 +++++++++---------
 cpu/arm926ejs/davinci/nand.c     |   41 +-
 cpu/ppc4xx/ndfc.c                |   57 +-
 drivers/nand/diskonchip.c        |  567 ++++----
 drivers/nand/nand_base.c         | 3449 ++++++++++++++++++++------------------
 drivers/nand/nand_bbt.c          |  552 ++++--
 drivers/nand/nand_ecc.c          |   21 +-
 drivers/nand/nand_ids.c          |  169 ++-
 drivers/nand/nand_util.c         |  359 +++--
 include/common.h                 |    2 +
 include/linux/err.h              |   45 +
 include/linux/mtd/blktrans.h     |   81 +
 include/linux/mtd/compat.h       |    7 +-
 include/linux/mtd/doc2000.h      |  217 ++--
 include/linux/mtd/inftl-user.h   |   91 +
 include/linux/mtd/jffs2-user.h   |   35 +
 include/linux/mtd/mtd-abi.h      |  137 ++-
 include/linux/mtd/mtd.h          |  154 ++-
 include/linux/mtd/nand.h         |  450 ++++--
 include/linux/mtd/nftl-user.h    |   76 +
 include/linux/mtd/nftl.h         |   93 +-
 include/linux/mtd/ubi-header.h   |  360 ++++
 include/linux/mtd/ubi-user.h     |  161 ++
 include/nand.h                   |    3 +-
 37 files changed, 5314 insertions(+), 3878 deletions(-)
 create mode 100644 include/linux/err.h
 create mode 100644 include/linux/mtd/blktrans.h
 create mode 100644 include/linux/mtd/inftl-user.h
 create mode 100644 include/linux/mtd/jffs2-user.h
 create mode 100644 include/linux/mtd/nftl-user.h
 create mode 100644 include/linux/mtd/ubi-header.h
 create mode 100644 include/linux/mtd/ubi-user.h

-------------------------------------------------
William Juul, Senior Development Engineer
Data Respons Norge AS
Sandviksveien 26
P.O. Box 489
NO-1323 H?vik, Norway

www.datarespons.no
-------------------------------------------------

#1 lore raw

PATCH 1/1 MTD update

Quoted 4 lines · In message <[email protected]> you…

Update MTD to that of Linux 2.6.22.1

A lot changed in the Linux MTD code, since it was last ported from Linux to U-Boot. This patch takes U-Boot NAND support to the level

Can you please change the subject? U-Boot has no MTD layer, and your patch deals with NAND stuff. So please change the SUbject and description to make clear it's all about NAND.

Thanks.

Quoted 3 lines

This patch is tested on two custom boards with PPC and ARM processors running YAFFS in U-Boot and Linux using gcc-4.1.2 cross compilers.

We don't have YAFFS support in U-Boot ???

Quoted 2 lines

We have set up a git repository were you can pull the patch:
http://git.tandberg.com/tandberg/u-boot.git

This is nice, but it is nevertheless mandatory to post the patches here on the list for review.

Best regards,

Wolfgang Denk

Signature · 5 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
Gods don't like people not doing much work. People  who  aren't  busy
all the time might start to _think_.  - Terry Pratchett, _Small Gods_
#2 lore raw

PATCH 1/1 MTD update

Quoted 6 lines · Wolfgang Denk

Can you please change the subject? U-Boot has no MTD layer, and your patch deals with NAND stuff. So please change the SUbject and description to make clear it's all about NAND.

Thanks.

I will change the subject and resubmit.

Quoted 6 lines
Quoted 4 lines

This patch is tested on two custom boards with PPC and ARM processors running YAFFS in U-Boot and Linux using gcc-4.1.2 cross compilers.

We don't have YAFFS support in U-Boot ???

My intent is to submit a patch for this as well. A YAFFS patch will build on this patch but is logically distinct so I kept it out for now as this patch is more than large enough as it is. I should have made that clear.

Quoted 6 lines
Quoted 3 lines

We have set up a git repository were you can pull the patch:
http://git.tandberg.com/tandberg/u-boot.git

This is nice, but it is nevertheless mandatory to post the patches here on the list for review.

As I mentioned in my previous post, some of the changes are very big and will not fit under the size-limit unless I split single-file patches. Stefan Roese kindly suggested that we could set up a git server and put the changes there. I can of-course send all the small file-patches to the mailing-list and keep the big changes on the git server, but since this logically is all one big patch I thought it would be better to keep the whole change together on the git-server.

As I see it, the patch can be reviewed from the git-server and comments/snippets can be discussed on the mailing-list. Further, as partly stated in my post, I consider this to be work in progress, but I need help from the community to finish this off. I would then think that I (or the maintainer, if he prefers to run this from a branch in his git-tree) can incorporate comments and that the maintainer can pull this into his tree when/if he and the community feels that this is mature enough.

Best regards
William

#3 lore raw

PATCH 1/1 MTD update

Quoted 3 lines · In message <[email protected]> you…

As I mentioned in my previous post, some of the changes are very big and will not fit under the size-limit unless I split single-file

The rules for big patches are clearly documented. Please see
http://www.denx.de/wiki/UBoot/Patches

Quoted 2 lines

patches. Stefan Roese kindly suggested that we could set up a git server and put the changes there. I can of-course send all the small

As I mentioned, this is nice to have and makes some parts of the work easier, but the rules still apply.

Quoted 2 lines

As I see it, the patch can be reviewed from the git-server and comments/snippets can be discussed on the mailing-list. Further, as

Sorry, please see above.

Best regards,

Wolfgang Denk

Signature · 6 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
PLEASE NOTE: Some Quantum Physics Theories Suggest That When the Con-
sumer Is Not Directly Observing This Product, It May Cease  to  Exist
or Will Exist Only in a Vague and Undetermined State.
#4 lore raw

PATCH 1/1 MTD update

Quoted 1 line · Wolfgang Denk

In message <[email protected]> you

Quoted 11 lines · wrote:
Quoted 2 lines

As I mentioned in my previous post, some of the changes are very big and will not fit under the size-limit unless I split single-file

The rules for big patches are clearly documented. Please see
http://www.denx.de/wiki/UBoot/Patches

Quoted 2 lines

patches. Stefan Roese kindly suggested that we could set up a git server and put the changes there. I can of-course send all the small

As I mentioned, this is nice to have and makes some parts of the work easier, but the rules still apply.

Sorry for creating this confusion. I thought it would be better not to split up those bigger files.

I'm reviewing and testing this new NAND driver right now. Comments will follow soon.

Thanks.

BTW: I still think increasing the list size limit to 100k (as on most other lists) would be a good idea. (/me ducks)

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#5 lore raw

PATCH 1/1 MTD update

In reply to William Juul

Hi William,

Quoted 5 lines · William Juul
Quoted 1 line

We don't have YAFFS support in U-Boot ???

My intent is to submit a patch for this as well. A YAFFS patch will build on this patch but is logically distinct so I kept it out for now as this patch is more than large enough as it is.

Good.

Quoted 14 lines
Quoted 5 lines
Quoted 2 lines

We have set up a git repository were you can pull the patch:
http://git.tandberg.com/tandberg/u-boot.git

This is nice, but it is nevertheless mandatory to post the patches here on the list for review.

As I mentioned in my previous post, some of the changes are very big and will not fit under the size-limit unless I split single-file patches. Stefan Roese kindly suggested that we could set up a git server and put the changes there. I can of-course send all the small file-patches to the mailing-list and keep the big changes on the git server, but since this logically is all one big patch I thought it would be better to keep the whole change together on the git-server.

Quoted 8 lines

As I see it, the patch can be reviewed from the git-server and comments/snippets can be discussed on the mailing-list. Further, as partly stated in my post, I consider this to be work in progress, but I need help from the community to finish this off. I would then think that I (or the maintainer, if he prefers to run this from a branch in his git-tree) can incorporate comments and that the maintainer can pull this into his tree when/if he and the community feels that this is mature enough.

I think it will be best, that I add this new NAND driver code into a branch of the u-boot-nand-flash custodian repository. But only after the first issues are solved. For example I found quite a lot of coding style issues in your patch:

- Leading white spaces
- Trailing white spaces
- Indentation seems to be sometimes with 4 spaces instead of using a tab
- C++ comments (//)

Please clean this up. I'll send a more detailed review soon.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#6 lore raw

PATCH 1/1 MTD update

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

I think it will be best, that I add this new NAND driver code into a branch of the u-boot-nand-flash custodian repository. But only after the first issues are solved. For example I found quite a lot of coding style issues in your patch:

Please do this only after the patch has been reviewed here on the list.

Best regards,

Wolfgang Denk

Signature · 5 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
I'm a soldier, not a diplomat.  I can only tell the truth.
	-- Kirk, "Errand of Mercy", stardate 3198.9
#7 lore raw

PATCH 1/1 MTD update

In reply to Stefan Roese
Quoted 5 lines

I think it will be best, that I add this new NAND driver code into a branch of the u-boot-nand-flash custodian repository. But only after the first issues are solved. For example I found quite a lot of coding style issues in your patch:

Quoted 7 lines

- Leading white spaces
- Trailing white spaces
- Indentation seems to be sometimes with 4 spaces instead of using a tab
- C++ comments (//)

Please clean this up. I'll send a more detailed review soon.

I will clean up and then update the branches on the git server. I will also send patches to the mailing list containing all the small files. For the big files, I will point to the git server (with a reference to each changed file) as they are too big to fit under the current size limit. Is this OK? Or must I put a patch file as a pure text file on the web server?

Note that this is one big patch and splitting the patch per file when emailing it to the list will render each (sub-)patch broken. But as Jerry Van Baren recently suggested (in another thread), the patch can be pulled as a whole from the git server and using the list will preserve the review concept.

In my next thread I will also change the subject as Wolfgang suggested.

Best regards,
William