[U-Boot-Users] [PATCH] 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
Signed-off-by: William Juul william.juul@datarespons.no Signed-off-by: Stig Olsen stig.olsen@tandberg.com ----
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 -------------------------------------------------

In message 2563ac9e0711070329q26216281pd8da90acef57743d@mail.gmail.com you wrote:
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.
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 ???
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

On Nov 7, 2007 2:30 PM, Wolfgang Denk wd@denx.de wrote:
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.
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.
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

In message 2563ac9e0711070614y1a7032e6y351c9b8da1197fa@mail.gmail.com you wrote:
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
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.
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

On Wednesday 07 November 2007, Wolfgang Denk wrote:
In message 2563ac9e0711070614y1a7032e6y351c9b8da1197fa@mail.gmail.com you
wrote:
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
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@denx.de =====================================================================

Hi William,
On Wednesday 07 November 2007, William Juul wrote:
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.
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.
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@denx.de =====================================================================

In message 200711081431.31194.sr@denx.de 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

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.
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
participants (4)
-
Stefan Roese
-
William Juul
-
William Juul
-
Wolfgang Denk