Commit Graph

15 Commits

Author SHA1 Message Date
Tom Rini
83d290c56f SPDX: Convert all of our single license tags to Linux Kernel style
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from.  So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry.  Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents.  There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-07 09:34:12 -04:00
Andreas Bießmann
3964311473 mxsboot: remove unused include
Commit 276d3ebb88 removed htole32() but missed
to remove the corresponding header. This is annoying, since BSD systems do not
have endian.h.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Michael Heimpold <mhei@heimpold.de>
2016-02-21 11:09:19 +01:00
Bin Meng
276d3ebb88 tools: mxsboot: Use more portable cpu_to_le32()
Currently when building mxsboot on certain machines it reports:

  HOSTCC  tools/mxsboot
  tools/mxsboot.c: In function 'mx28_create_sd_image':
  tools/mxsboot.c:560: warning: implicit declaration of function 'htole32'
  /tmp/cchLIV6q.o: In function 'main':
  mxsboot.c:(.text+0x6d8): undefined reference to 'htole32'
  mxsboot.c:(.text+0x6e7): undefined reference to 'htole32'
  mxsboot.c:(.text+0x6f6): undefined reference to 'htole32'
  mxsboot.c:(.text+0x705): undefined reference to 'htole32'
  mxsboot.c:(.text+0x711): undefined reference to 'htole32'
  /tmp/cchLIV6q.o:mxsboot.c:(.text+0x71d): more undefined references to
  'htole32' follow
  collect2: ld returned 1 exit status
  make[1]: *** [tools/mxsboot] Error 1
  make: *** [tools] Error 2

The solution is to use cpu_to_le32() instead which is more portable,
just like other U-Boot tools [1] do.

[1] http://lists.denx.de/pipermail/u-boot/2014-October/192919.html

Suggested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
2016-02-02 21:01:17 +01:00
Michael Heimpold
b5e7586a73 mxs: mxsboot: fix endianess for sd boot images
Running mxsboot on a big-endian system produces a sd image which
cannot be started by the i.MX28 ROM. It complains on the debug
uart as following:
0x8020a009
          0x80502008
0x8020a009
          0x80502008
...

Enforcing all fields within the BCB to little-endian make
the image bootable again.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Acked-by: Stefano Babic <sbabic@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
2015-09-13 10:19:40 +02:00
Jörg Krause
cef9f020c1 tools: mxsboot: calculate ECC block level dynamically
For pages of 2048 bytes the current setting of the ECC Error Correction Level
is only true for an oob size of 64 bytes and wrong for all others.

Instead of hard-coding every possible combination of page size and oob size use
the dynamic calculation of the ECC strength introduced in commit
6121560d77.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Stefano Babic <sbabic@denx.de>
2015-09-02 15:26:11 +02:00
Jörg Krause
6121560d77 tools: mxsboot: Calculate ECC strength dynamically
Calculating the ECC strength dynamically to be aligned with the mxs NAND
driver and the Linux Kernel.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Reviewed-by: Marek Vasut <marex@denx.de>
2015-05-24 14:26:54 -05:00
Jörg Krause
1fbdb70610 mtd: nand: mxs: Replace magic number for bits per ECC level with macro
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Reviewed-by: Marek Vasut <marex@denx.de>
2015-05-24 14:26:54 -05:00
Alexandre Coffignal
ca6dc4f81c mxsboot : Support of 224-bytes OOB area length
Add support for the NAND Flash chip with page size of 4096+224-bytes OOB area length

For example Micron MT29F4G08 NAND flash device defines a OOB area which is
224 bytes long (oobsize).

Signed-off-by: Alexandre Coffignal <acoffignal@geral.com>
2015-01-19 09:10:52 +01:00
Marek Vasut
93d520ff7d tools: mxsboot: Mark the FCB pages as valid
Without this marker, Linux will complain that the NAND pages with
FCB are invalid.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
2013-09-10 19:12:54 +02:00
Marek Vasut
62d40d14c4 tools: mxsboot: Staticize functions
Make remaining non-static functions static and the same for vars.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
2013-08-31 15:28:11 +02:00
Wolfgang Denk
1a4596601f Add GPL-2.0+ SPDX-License-Identifier to source files
Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>
2013-07-24 09:44:38 -04:00
Otavio Salvador
8de16794a0 mxs: mxsboot: Move sdcard BCB header to 4 sectors offset
The MX23 Boot ROM does blindly load from 2048 offset while the MX28
does parse the BCB header to known where to load the image from. We
move the BCB header to 4 sectors offset so same code can be used by
both SoCs avoiding code duplication.

This idea was given by Marek Vasut <marex@denx.de>

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Marek Vasut <marex@denx.de>
2013-04-26 09:16:48 +02:00
Otavio Salvador
993d30de99 mxsboot: fix tool name in usage message
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-03-17 21:38:03 +01:00
Marek Vasut
e364daf925 MX28: Fix MXSBOOT segfault if no params specified
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
2012-01-16 08:40:09 +01:00
Marek Vasut
f29f7e02ce iMX28: Add image header generator tool
This tool can now generate proper image for "BootStream" files.

NOTE: This tool now works only for NAND.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
2011-11-11 11:36:57 +01:00