profile/common/platform/kernel/u-boot-artik.git
9 years agoRevert "board: samsung: configure emmc_dev environment"
Chanho Park [Wed, 2 Dec 2015 05:02:21 +0000 (14:02 +0900)]
Revert "board: samsung: configure emmc_dev environment"

This reverts commit 895ce33b05292ee7309c7cd75f2b22eaa554ab22.
When board is initialized, setenv will cause "Signal #8".

Change-Id: Icddfd03e5b0a84bf7d73da65275245033a23b51b
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoarm: exynos: fix gpio map of exynos3
Chanho Park [Wed, 2 Dec 2015 04:33:27 +0000 (13:33 +0900)]
arm: exynos: fix gpio map of exynos3

The gpio part2 map of exynos3 was incorrect. The gpio part2 is
started from 0x11000000 and the register map of gpk0 is
0x11000040. Thus, two gpio pads should be before gpk0.
The gpx0 is started from 0x11000c00 so we should fix the count
of res5 pad from 0x4a to 0x48.

Change-Id: I8ceae5009227daf0e4cff4d3d73aeb2318c640de
Reported-by: Jaeyoung Lee <jaeyoung2.lee@samsung.com>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik: common: enable factory_info command
Chanho Park [Tue, 1 Dec 2015 12:21:19 +0000 (21:21 +0900)]
artik: common: enable factory_info command

This patch enables the factory_info command which is to
retrieve some factory information such as board S/N.
The default location to store the data is early offset of eMMC
because we don't use the location for any other purpose.

"run factory_load" command will load the information from eMMC
and configure them into environment variables.
"ethaddr" is ethernet mac address and it will be passed to kernel.
"bd_addr" is bluetooth address and it also be passed to kernel.

Change-Id: Ifa5660c3e765be84d00732593ca2005a5fc9f749
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoboard: samsung: configure emmc_dev environment
Chanho Park [Tue, 1 Dec 2015 12:18:17 +0000 (21:18 +0900)]
board: samsung: configure emmc_dev environment

This patch enable to set the emmc_dev number because it's
varied by boot order. If the board is booted from sdcard,
the emmc device number will be 1 not default 0. Thus, I
set a "emmc_dev" environment to retrieve the number anywhere.

Change-Id: I9324f855151bcfee85e351749ae91cab51ec4a22
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: introduce factory_info command
Chanho Park [Tue, 1 Dec 2015 10:39:02 +0000 (19:39 +0900)]
common: introduce factory_info command

This patch introduces factory_info command to save/load
the factory information such as s/n, mac address.
The command supports mmc interface to save/load data into
mmc device. Please refer below command usage.

"Factory Information commands",
"list - List factory information\n"
"factory_info load <interface> <device> <offset> <cnt>\n"
"        - Load factory information from the interface\n"
"factory_info save <interface> <device> <offset> <cnt>\n"
"        - Save factory information to the interface\n"
"factory_info read <entity name> - Read a value of entity name\n"
"factory_info write <entity name> <val> - Write a value of entity name\n"
"factory_info clean - Clean factioy information\n"

Change-Id: Ia1f4cebf264f6f573000d001fe24a6cc88c5a8e8
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: movi: remove unnecessary partition
Chanho Park [Thu, 26 Nov 2015 04:28:32 +0000 (13:28 +0900)]
common: movi: remove unnecessary partition

This patch removes unnecessary emmc boot partition because they
are not used anymore.

Change-Id: I4f15db025d2756007aa89d5ec3c15142df2b7ce5
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik: configs: support tizen partition tables
Chanho Park [Thu, 19 Nov 2015 06:43:53 +0000 (15:43 +0900)]
artik: configs: support tizen partition tables

This patch supports tizen partition tables. The partition tables
of the tizen are consisted three partition, such as rootfs,
system-data and user partition.

Change-Id: I66ce9678405b97cb57adf049256d1832bc812aae
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik: configs: support modules partition
Chanho Park [Thu, 22 Oct 2015 07:02:14 +0000 (16:02 +0900)]
artik: configs: support modules partition

This patch adds a modules partition which contains kernel modules.
The size of partition is 32MB and located in second partition.

Change-Id: Id4178f90f769b8f1ab1dfe135669f911f24a4a99
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocmd: fastboot: support module flashing
Chanho Park [Thu, 22 Oct 2015 07:00:35 +0000 (16:00 +0900)]
cmd: fastboot: support module flashing

This patch supports flashing of modules partition which contains
kernel modules. The partition is second partion of total partitions.

Change-Id: I16f3f1848d630e8dcb2f66d98d1b23a4c9157640
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik: configs: set ramfsboot to default boot method
Chanho Park [Mon, 19 Oct 2015 00:55:41 +0000 (09:55 +0900)]
artik: configs: set ramfsboot to default boot method

This patch changes the default boot method from mmcboot to
ramfsboot which is booted from initrd.

Change-Id: I01cfc644dc059c01fd873f48f2c529f99d64d6e0
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoboard: artik5: change pmic wrstbi pin to GPE2_0
Chanho Park [Wed, 16 Sep 2015 10:38:38 +0000 (19:38 +0900)]
board: artik5: change pmic wrstbi pin to GPE2_0

This patch changes the wrstbi pin of pmic from GPE1_2 to GPE2_0.
The pin was changed since artik5 board ver3.0.

Change-Id: I6a56c31995bdffa04bfeb7e6396112cd707a5e9b
Signed-off-by: nermy <nermy@insignal.co.kr>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: support fatfs for sdfuse
Chanho Park [Wed, 2 Sep 2015 02:48:06 +0000 (11:48 +0900)]
common: fastboot: support fatfs for sdfuse

This patch allows fat file system for sd_fuse. When ext4 is not
available of the partition, sdfuse will fall back to fat file system.

For example, fatfs is in the first partition:

sdfuse flash 1 kernel zImage
sdfuse flash 1 dtb exynos5422-artik10.dtb

Change-Id: If66e64ab3b7529469dc2902b90470a6a575ececb
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik: config: support android partition and booting
Chanho Park [Thu, 20 Aug 2015 05:53:38 +0000 (14:53 +0900)]
artik: config: support android partition and booting

This patch supports android partition tables and booting to android. The
system partition is 1GB and cache partiton is 128MB and userdata
partition is remained size.

1. Generate uInitrd from ramdisk.img
 mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n uInitrd -d ramdisk.img uInitrd

2. Create a android partition from the u-boot shell
run android_format

3. flash android images
fastboot flash ramdisk uInitrd
fastboot flash system system.img
fastboot flash cache cache.img
fastboot flash userdata userdata.img

4. Build android kernel and flash the kernel
ARCH=arm ./scripts/kconfig/merge_config.sh \
arch/arm/configs/artik10_defconfig android/configs/android-base.cfg \
android/configs/android-recommended.cfg \
android/configs/artik10-android-graphic.cfg
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- exynos5422-artik10.dtb

fastboot flash kernel arch/arm/boot/zImage
fastboot flash dtb arch/arm/boot/dts/exynos5422-artik10.dtb

5. Set up androidboot.hardware from the u-boot shell
setenv opts loglevel=4 androidboot.hardware=odroidxu3
saveenv
run android_boot

Change-Id: Ic55fa4925b5ae9586bc2c9733e2f1f36df5d04d1
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommmon: fastboot: cast 64bit when converting sectors to bytes
Chanho Park [Thu, 20 Aug 2015 04:30:33 +0000 (13:30 +0900)]
commmon: fastboot: cast 64bit when converting sectors to bytes

This patch fixes a cast error when converting sectors to bytes. The
start and size types of the disk_partition_t are 32bit until the
SYS_64BIT_LBA is defined. To prevent the converting error, we should
cast the value to 64bit values.

Change-Id: Ibc71207642aba2d78091123f311b8a30f33e78c7
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agousb: gadget: fastboot: ignore call if not fastboot mode
Chanho Park [Wed, 12 Aug 2015 09:26:56 +0000 (18:26 +0900)]
usb: gadget: fastboot: ignore call if not fastboot mode

This patch adds return code if it is not in the fastboot mode.
On sdfuse recovery mode which is using fastboot function, it doesn't
need to reply a message through usb interface.

Change-Id: I3007c3f12579dc95a5e108e5a6afa1563638dd20
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agogpt: Fix the protective MBR partition size
Maxime Ripard [Thu, 8 Jan 2015 11:26:44 +0000 (12:26 +0100)]
gpt: Fix the protective MBR partition size

According to the UEFI Spec (Table 16, section 5.2.3 of the version 2.4 Errata
B), the protective MBR partition record size must be set to the size of the
disk minus one, in LBAs.

However, the current code was setting the size as the total number of LBAs on
the disk, resulting in an off-by-one error.

This confused the AM335x ROM code, and will probably confuse other tools as
well.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
9 years agodisk: part_efi: add get_partition_info_efi_by_name()
Steve Rae [Mon, 26 May 2014 18:52:24 +0000 (11:52 -0700)]
disk: part_efi: add get_partition_info_efi_by_name()

Add function to find a GPT table entry by name.

Tested on little endian ARMv7 and ARMv8 configurations

Signed-off-by: Steve Rae <srae@broadcom.com>
9 years agodisk: part_efi: clarify lbaint_t usage
Steve Rae [Mon, 26 May 2014 18:52:23 +0000 (11:52 -0700)]
disk: part_efi: clarify lbaint_t usage

- update the comments regarding lbaint_t usage
- cleanup casting of values related to the lbaint_t type
- cleanup of a type that requires a u64

Tested on little endian ARMv7 and ARMv8 configurations

Signed-off-by: Steve Rae <srae@broadcom.com>
9 years agodisk: part_efi: resolve endianness issues
Steve Rae [Mon, 26 May 2014 18:52:22 +0000 (11:52 -0700)]
disk: part_efi: resolve endianness issues

Tested on little endian ARMv7 and ARMv8 configurations

Signed-off-by: Steve Rae <srae@broadcom.com>
9 years agodisk: part_efi: add support for the Backup GPT
Steve Rae [Mon, 5 May 2014 20:00:08 +0000 (13:00 -0700)]
disk: part_efi: add support for the Backup GPT

Check the Backup GPT table if the Primary GPT table is invalid.
Renamed "Secondary GPT" to "Backup GPT" as per:
  UEFI Specification (Version 2.3.1, Errata A)

Signed-off-by: Steve Rae <srae@broadcom.com>
9 years agopart_efi: fix protective mbr struct allocation
Hector Palacios [Thu, 13 Feb 2014 08:48:24 +0000 (09:48 +0100)]
part_efi: fix protective mbr struct allocation

The calloc() call was allocating space for the sizeof the struct
pointer rather than for the struct contents.
Besides, since this buffer is passed to mmc for writing and some
platforms may use cache, the legacy_mbr struct should be cache-aligned.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agoartik: configs: disable data partition
Chanho Park [Tue, 11 Aug 2015 11:57:07 +0000 (20:57 +0900)]
artik: configs: disable data partition

Until we support a data partition for rw, the partition is disabled.

Change-Id: I68673de0ff7dcf6c1a90131ab1451b9a74e0be04
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik: config: do not specify initrd addr for mmcboot
Chanho Park [Tue, 11 Aug 2015 09:45:56 +0000 (18:45 +0900)]
artik: config: do not specify initrd addr for mmcboot

This patch prevents loading initrd addr in case of mmc booting. When
warm resetting, the initrd address is filled invalid data until power
off. Thus, we should not pass the initrd address if mmc_boot.

Change-Id: I2fee8c6ac7df28a9aa83b6bd69aff27ce2522100
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik: config: enable sdfuse recovery
Chanho Park [Tue, 11 Aug 2015 05:48:29 +0000 (14:48 +0900)]
artik: config: enable sdfuse recovery

This patch enables sdfuse recovery which is recovered the bootloader and
boot partition from sdcard. The action of sd_recovery will do
repartitioning rootfs and fuse binaries from second ext4 partition.

Change-Id: I1320401709abe1843ee793f685aa89b8cc1f2646
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: force to use emmc device
Chanho Park [Tue, 11 Aug 2015 05:45:36 +0000 (14:45 +0900)]
common: fastboot: force to use emmc device

This patch forces to use emmc device for fastboot and sdfuse command.
The fastboot command is for writing a data to emmc device through
external device like usb or sdcard. Thus, we should use eMMC device even
the board is booted from sdcard.

Change-Id: Ib91a9f6c1bde2e140f5b336bbe26ee5fd7e3f330
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik: configs: split initrd boot command
Chanho Park [Fri, 7 Aug 2015 07:38:38 +0000 (16:38 +0900)]
artik: configs: split initrd boot command

This patch splits initrd boot command from normal command to avoid
loading ramdisk during mmc booting.

Change-Id: Ie6cba2008dec9b6c4e9953b171468c810fbe684a
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agofs: implement size/fatsize/ext4size
Stephen Warren [Wed, 11 Jun 2014 18:47:26 +0000 (12:47 -0600)]
fs: implement size/fatsize/ext4size

These commands may be used to determine the size of a file without
actually reading the whole file content into memory. This may be used
to determine if the file will fit into the memory buffer that will
contain it. In particular, the DFU code will use it for this purpose
in the next commit.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Conflicts:
common/cmd_fs.c

Change-Id: I2dc81095d94901aa604f970a5578b342b0009390

9 years agosandbox: implement exists() function
Stephen Warren [Mon, 3 Feb 2014 20:21:07 +0000 (13:21 -0700)]
sandbox: implement exists() function

This hooks into the generic "file exists" support added in an earlier
patch, and provides an implementation for the sandbox test environment.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoartik: config: use uInitrd instead of initrd
Chanho Park [Thu, 6 Aug 2015 11:04:02 +0000 (20:04 +0900)]
artik: config: use uInitrd instead of initrd

This patch changes the default initrd file to uInitrd. The uInitrd is
the default initrd format of u-boot. It don't need to pass initrd size
because the size is calculated during making the uInitrd.

Change-Id: I11743df10f12ebf7ad9f662174290ca4c57c7bfa
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: support sdfuse command
Chanho Park [Thu, 6 Aug 2015 06:47:32 +0000 (15:47 +0900)]
common: fastboot: support sdfuse command

This patch implements sdfuse command which is a variant version of
fastboot to use sdcard images. The sdfuse command consists of three simple
commands.

flashall: flash whole image files from the first ext4 partition of
sdcards
flash: flash a image file which is specified from command line
format: format eMMC partition to gpt partition

All commands use facilities of fastboot commands to implement easily.

Change-Id: I5eb316ee0f852fe7e74dacb7ff8c17eec7dd83ca
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agopart/dev_desc: Add log2 of blocksize to block_dev_desc data struct
Egbert Eich [Tue, 9 Apr 2013 21:11:56 +0000 (21:11 +0000)]
part/dev_desc: Add log2 of blocksize to block_dev_desc data struct

log2 of the device block size serves as the shift value used to calculate
the block number to read in file systems when implementing avaiable block
sizes.
It is needed quite often in file systems thus it is pre-calculated and
stored in the block device descriptor.

Signed-off-by: Egbert Eich <eich@suse.com>
9 years agodisk/gpt: Fix GPT partition handling for blocksize != 512
Egbert Eich [Tue, 9 Apr 2013 06:03:36 +0000 (06:03 +0000)]
disk/gpt: Fix GPT partition handling for blocksize != 512

Disks beyond 2T in size use blocksizes of 4096 bytes. However a lot of
code in u-boot  still assumes a 512 byte blocksize.
This patch fixes the handling of GPTs.

Signed-off-by: Egbert Eich <eich@suse.com>
9 years agofs: fatwrite: use map_sysmem before use file_fat_write
Wu, Josh [Wed, 4 Jun 2014 03:01:24 +0000 (11:01 +0800)]
fs: fatwrite: use map_sysmem before use file_fat_write

When the map_sysmem, then the fatwrite command can support sandbox.
Following command will show how to use it:
  => sb bind 0 sd.img
  => fatls host 0
  => fatwrite host 0 $memaddr filename $filesize

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agofs/fat: correct FAT16/12 file finding in root dir
Wu, Josh [Thu, 8 May 2014 08:14:07 +0000 (16:14 +0800)]
fs/fat: correct FAT16/12 file finding in root dir

When write a file into FAT file system, it will search a match file in
root dir. So the find_directory_entry() will get the first cluster of
root dir content and search the directory item one by one. If the file
is not found, we will call get_fatent_value() to get next cluster of root
dir via lookup the FAT table and continue the search.

The issue is in FAT16/12 system, we cannot get root dir's next clust
from FAT table. The FAT table only be use to find the clust of data
aera in FAT16/12.

In FAT16/12 if the clust is in root dir, the clust number is a negative
number or 0, 1. Since root dir is located in front of the data area.
Data area start clust #2. So the root dir clust number should < 2.

This patch will check above situation before call get_fatenv_value().
If curclust is < 2, include minus number, we just increase one on the
curclust since root dir is in continous cluster.

The patch also add a sanity check for entry in get_fatenv_value().

Signed-off-by: Josh Wu <josh.wu@atmel.com>
9 years agofs: fat_write: fix the incorrect last cluster checking
Wu, Josh [Thu, 8 May 2014 08:14:06 +0000 (16:14 +0800)]
fs: fat_write: fix the incorrect last cluster checking

In fat_write.c, the last clust condition check is incorrect:

  if ((curclust >= 0xffffff8) || (curclust >= 0xfff8)) {
   ... ...
  }

For example, in FAT32 if curclust is 0x11000. It is a valid clust.
But on above condition check, it will be think as a last clust.

So the correct last clust check should be:
  in fat32, curclust >= 0xffffff8
  in fat16, curclust >= 0xfff8
  in fat12, curclust >= 0xff8

This patch correct the last clust check.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
9 years agofs: fat: Fix cache align error message in fatwrite
Nobuhiro Iwamatsu [Tue, 8 Apr 2014 02:12:46 +0000 (11:12 +0900)]
fs: fat: Fix cache align error message in fatwrite

Use of malloc of do_fat_write() causes cache error on ARM v7 platforms.
Perhaps, the same problem will occur at any other CPUs.
This replaces malloc with memalign to fix cache buffer alignment.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Yoshiyuki Ito <yoshiyuki.ito.ub@renesas.com>
Tested-by: Hector Palacios <hector.palacios@digi.com>
9 years agofat: implement exists() for FAT fs
Stephen Warren [Mon, 3 Feb 2014 20:21:10 +0000 (13:21 -0700)]
fat: implement exists() for FAT fs

This hooks into the generic "file exists" support added in an earlier
patch, and provides an implementation for the FAT filesystem.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoext4: implement exists() for ext4fs
Stephen Warren [Mon, 3 Feb 2014 20:21:09 +0000 (13:21 -0700)]
ext4: implement exists() for ext4fs

This hooks into the generic "file exists" support added in an earlier
patch, and provides an implementation for the ext4 filesystem.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agofs: don't pass NULL dev_desc to most filesystems
Stephen Warren [Mon, 3 Feb 2014 20:21:01 +0000 (13:21 -0700)]
fs: don't pass NULL dev_desc to most filesystems

FAT and ext4 expect that the passed in block device descriptor not be
NULL. This causes problems on sandbox, where get_device_and_partition()
succeeds for the "host" device, yet passes back a NULL device descriptor.
Add special handling for this situation, so that the generic filesystem
commands operate as expected on sandbox.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agofs: implement infrastructure for an 'exists' function
Stephen Warren [Mon, 3 Feb 2014 20:21:00 +0000 (13:21 -0700)]
fs: implement infrastructure for an 'exists' function

This could be used in scripts such as:

if test -e mmc 0:1 /boot/boot.scr; then
    load mmc 0:1 ${scriptaddr} /boot/boot.scr
    source ${scriptaddr}
fi

rather than:

if load mmc 0:1 ${scriptaddr} /boot/boot.scr; then
    source ${scriptaddr}
fi

This prevents errors being printed by attempts to load non-existent
files, which can be important when checking for a large set of files,
such as /boot/boot.scr.uimg, /boot/boot.scr, /boot/extlinux.conf,
/boot.scr.uimg, /boot.scr, /extlinux.conf.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agofs: fix generic save command implementation
Stephen Warren [Mon, 3 Feb 2014 20:20:59 +0000 (13:20 -0700)]
fs: fix generic save command implementation

Fix a few issues with the generic "save" shell command, and fs_write()
function.

1) fstypes[].write wasn't filled in for some file-systems, and isn't
   checked when used, which could cause crashes/... if executing save
   on e.g. fat/ext filesystems.

2) fs_write() requires the length argument to be non-zero, since it needs
   to know exactly how many bytes to write. Adjust the comments and code
   according to this.

3) fs_write() wasn't prototyped in <fs.h> like other generic functions;
   other code should be able to call this directly rather than invoking
   the "save" shell command.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agofs/fat: Don't multiply fatsize with sector size
Egbert Eich [Tue, 9 Apr 2013 21:11:55 +0000 (21:11 +0000)]
fs/fat: Don't multiply fatsize with sector size

Bugfix:
Here at this place we need the fat size in sectors not bytes.
This was found during code review when adding support for storage
devices with blocksizes != 512.

Signed-off-by: Egbert Eich <eich@suse.com>
9 years agofs: ext4: fix writing zero-length files
Stephen Warren [Wed, 11 Jun 2014 18:46:16 +0000 (12:46 -0600)]
fs: ext4: fix writing zero-length files

ext4fs_allocate_blocks() always allocates at least one block for a file.
If the file size is zero, this causes total_remaining_blocks to
underflow, which then causes an apparent hang while 2^32 blocks are
allocated.

To solve this, check that total_remaining_blocks is non-zero as part of
the loop condition (i.e. before each loop) rather than at the end of
the loop.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agoext4: correctly zero filename
Jeroen Hofstee [Mon, 9 Jun 2014 13:29:00 +0000 (15:29 +0200)]
ext4: correctly zero filename

Since ALLOC_CACHE_ALIGN_BUFFER declares a char* for filename
sizeof(filename) is not the size of the buffer. Use the already
known length instead.

cc: Uma Shankar <uma.shankar@samsung.com>
cc: Manjunatha C Achar <a.manjunatha@samsung.com>
cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Acked-by: Marek Vasut <marex@denx.de>
9 years agofs:ext4:write:fix: Reinitialize global variables after updating a file
Łukasz Majewski [Tue, 6 May 2014 07:36:05 +0000 (09:36 +0200)]
fs:ext4:write:fix: Reinitialize global variables after updating a file

This bug shows up when file stored on the ext4 file system is updated.

The ext4fs_delete_file() is responsible for deleting file's (e.g. uImage)
data.
However some global data (especially ext4fs_indir2_block), which is used
during file deletion are left unchanged.

The ext4fs_indir2_block pointer stores reference to old ext4 double
indirect allocated blocks. When it is unchanged, after file deletion,
ext4fs_write_file() uses the same pointer (since it is already initialized
- i.e. not NULL) to return number of blocks to write. This trunks larger
file when previous one was smaller.

Lets consider following scenario:

1. Flash target with ext4 formatted boot.img (which has uImage [*] on itself)
2. Developer wants to upload their custom uImage [**]
- When new uImage [**] is smaller than the [*] - everything works
correctly - we are able to store the whole smaller file with corrupted
ext4fs_indir2_block pointer
- When new uImage [**] is larger than the [*] - theCRC is corrupted,
since truncation on data stored at eMMC was done.
3. When uImage CRC error appears, then reboot and LTHOR/DFU reflashing causes
proper setting of ext4fs_indir2_block() and after that uImage[**]
is successfully stored (correct uImage [*] metadata is stored at an
eMMC on the first flashing).

Due to above the bug was very difficult to reproduce.
This patch sets default values for all ext4fs_indir* pointers/variables.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agofs:ext4:cleanup: Remove superfluous code
Łukasz Majewski [Tue, 6 May 2014 07:36:04 +0000 (09:36 +0200)]
fs:ext4:cleanup: Remove superfluous code

Code responsible for handling situation when ext4 has block size of 1024B
can be ordered to take less space.

This patch does that for ext4 common and write files.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agoext4fs: fix "invalid extent block" error
Ionut Nicu [Mon, 13 Jan 2014 11:00:08 +0000 (12:00 +0100)]
ext4fs: fix "invalid extent block" error

For files where we actually have extent indexes following
an extent header (ext_block->eh_depth != 0), the do/while
loop from ext4fs_get_extent_block() does not select the
proper extent index structure.

For example, if we have:

ext_block->eh_depth = 1
ext_block->eh_entries = 1
fileblock = 0
index[0].ei_block = 0

the do/while loop will exit with i set to 0 and the
ext4fs_get_extent_block() function will return 0, even if
there was a valid extent index structure following the
header.

Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
Signed-off-by: Mathias Rulf <mathias.rulf@nsn.com>
9 years agoext4fs: use EXT2_BLOCK_SIZE instead of fs->blksz
Ionut Nicu [Mon, 13 Jan 2014 10:59:24 +0000 (11:59 +0100)]
ext4fs: use EXT2_BLOCK_SIZE instead of fs->blksz

Using fs->blksz in ext4fs_get_extent_block() is not
correct since fs->blksz is not initialized on the
read path. Use EXT2_BLOCK_SIZE() instead which will
produce the desired output.

Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
Signed-off-by: Mathias Rulf <mathias.rulf@nsn.com>
9 years agofs/ext4: fix calling put_ext4 with truncated offset
Ma Haijun [Wed, 8 Jan 2014 00:15:33 +0000 (08:15 +0800)]
fs/ext4: fix calling put_ext4 with truncated offset

Curently, we are using 32 bit multiplication to calculate the offset,
so the result will always be 32 bit.
This can silently cause file system corruption when performing a write
operation on partition larger than 4 GiB.

This patch address the issue by simply promoting the terms to 64 bit,
and let compilers decide how to do the multiplication efficiently.

Signed-off-by: Ma Haijun <mahaijuns@gmail.com>
9 years agofs/ext4: fix partition size get truncated in calculation
Ma Haijun [Tue, 7 Jan 2014 22:49:43 +0000 (06:49 +0800)]
fs/ext4: fix partition size get truncated in calculation

It may cause file system corruption when do a write operation.
This issue only affects boards that use 32 bit lbaint_t.

Signed-off-by: Ma Haijun <mahaijuns@gmail.com>
9 years agoFix ext2/ext4 filesystem accesses beyond 2TiB
Frederic Leroy [Wed, 26 Jun 2013 16:11:25 +0000 (18:11 +0200)]
Fix ext2/ext4 filesystem accesses beyond 2TiB

With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type,
which is required to represent block numbers for storage devices that
exceed 2TiB (the block size usually is 512B), e.g. recent hard drives

We now use lbaint_t for partition offset to reflect the lbaint_t change,
and access partitions beyond or crossing the 2.1TiB limit.
This required changes to signature of ext4fs_devread(), and type of all
variables relatives to block sector.

ext2/ext4 fs uses logical block represented by a 32 bit value. Logical
block is a multiple of device block sector. To avoid overflow problem
when calling ext4fs_devread(), we need to cast the sector parameter.

Signed-off-by: Frédéric Leroy <fredo@starox.org>
9 years agoext4: assign get_fs()->dev_desc before using it
Stephen Warren [Thu, 23 May 2013 10:22:10 +0000 (10:22 +0000)]
ext4: assign get_fs()->dev_desc before using it

Commit 50ce4c0 "fs/ext4: Support device block sizes != 512 bytes"
modified ext4fs_set_blk_dev() to calculate total_sect based on
get_fs()->dev_desc->log2blksz rather than SECTOR_SIZE. However, this
value wasn't yet assigned. Move the assignment earlier so the code
doesn't crash or hang.

Cc: Egbert Eich <eich@suse.com>
Tested-by: Tom Rini <trini@ti.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
9 years agofs/ext4: Support device block sizes != 512 bytes
Egbert Eich [Wed, 1 May 2013 01:13:19 +0000 (01:13 +0000)]
fs/ext4: Support device block sizes != 512 bytes

The 512 byte block size was hard coded in the ext4 file systems.
Large harddisks today support bigger block sizes typically 4096
bytes.
This patch removes this limitation.

Signed-off-by: Egbert Eich <eich@suse.com>
9 years agocommon: fastboot: determine emmc and sdcard order
Chanho Park [Wed, 5 Aug 2015 10:45:50 +0000 (19:45 +0900)]
common: fastboot: determine emmc and sdcard order

This patch allows to determine eMMC and microSD order. If Ompin is 0x3,
the first mmc device is microSD. In that case, mmc1 is eMMC and mmc0 is
sdcard.

Change-Id: I1b35aff4bfd0d8020037d1a387a1f3aa0508e2fc
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik: enable fat boot partition
Chanho Park [Wed, 5 Aug 2015 10:12:49 +0000 (19:12 +0900)]
artik: enable fat boot partition

This patch enables boot partition is fat file system. The kernel, dtb
and initrd will be in the boot partition. The only difference between
artik5 and artik10 is dtb file name.

Change-Id: I2be882a1a8da79326ba94802a096a290d6194c03
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: support fat boot partition
Chanho Park [Wed, 5 Aug 2015 10:11:14 +0000 (19:11 +0900)]
common: fastboot: support fat boot partition

This patch supports a boot partition which is formatted to fat file
system. The boot partition contains a kernel, dtb and initrd image. The
file can be retrived from u-boot environment variables. To avoid
conflict android's boot partition, just disables the android boot
partition.

Change-Id: I5c275ce61b211aef8e39701daabaa79527ac865d
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik: configs: unify common configurations
Chanho Park [Wed, 5 Aug 2015 05:26:48 +0000 (14:26 +0900)]
artik: configs: unify common configurations

This patch adds a artik_common.h configuration file to unify common
features between artik5 and artik10. This will reduce overhead of
changing common features both files.

Change-Id: Ied70bf479b4157f42e22efd913e67d0955aa4d97
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoboard: samsung: clean up exynos5422 board
Chanho Park [Wed, 5 Aug 2015 05:18:58 +0000 (14:18 +0900)]
board: samsung: clean up exynos5422 board

If the definitions are not defined in the config file, build error will
be occurred. This patch corrects compile errors.

Change-Id: I5511c5f464a27d644b3ae12fdf7f5782bd19d785
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoboard: samsung: clean up exynos3250 board
Chanho Park [Wed, 5 Aug 2015 05:16:33 +0000 (14:16 +0900)]
board: samsung: clean up exynos3250 board

This patch clean up exynos3250 board file only to be compiled the source with
macro definition.

Change-Id: I34c95aecd05be0161a45b4cda15ccedc3e21c0bc
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: support oem format command
Chanho Park [Wed, 5 Aug 2015 03:27:31 +0000 (12:27 +0900)]
common: fastboot: support oem format command

This patch implements fastboot's oem format command. The default
partition format is gpt and dos partition will be supported later.

The "fastboot oem format" executes "gpt write mmc $partitions" command.
Thus, you should define the "$partitions" environment variable. After
creating gpt partition, the board will be rebooted automatically and
enter fastboot again.

Change-Id: Ia05194d150e3ccd7ea3ee68f2d67cbc6b5414d09
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik5: configs: enable FASTBOOT_AUTO_REBOOT
Chanho Park [Wed, 5 Aug 2015 02:41:47 +0000 (11:41 +0900)]
artik5: configs: enable FASTBOOT_AUTO_REBOOT

To enter fastboot automatically during reboot, we'll check a inform4
register and it has FASTBOOT_AUTO_REBOOT_MODE.

Change-Id: I8df0a89879f5845613fb16b99751999c7fab7b77
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik5: configs: enable FASTBOOT_AUTO_REBOOT
Chanho Park [Wed, 5 Aug 2015 02:36:48 +0000 (11:36 +0900)]
artik5: configs: enable FASTBOOT_AUTO_REBOOT

To enter fastboot automatically during reboot, we'll check a inform4
register and it has FASTBOOT_AUTO_REBOOT_MODE.

Change-Id: I623695ae8ff12f187f1b69f7732b24c8f03164b4
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoboard: samsung: auto reboot fastboot mode for exynos5422
Chanho Park [Wed, 5 Aug 2015 02:34:25 +0000 (11:34 +0900)]
board: samsung: auto reboot fastboot mode for exynos5422

This patch allow entering fastboot mode during reboot for exynos5422. If
sysip_dat0 register is set, fastboot is executed automatically during
boot.

Change-Id: If47647c9bd6c9da4a16b92acf7ebf65ab39a0dc8
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoboard: samsung: support auto reboot fastboot for exynos3
Chanho Park [Wed, 5 Aug 2015 02:24:57 +0000 (11:24 +0900)]
board: samsung: support auto reboot fastboot for exynos3

This patch allow entering fastboot mode if inform4 register is set.

Change-Id: I704fda8b030db37a87f7d3fa287164016544b88b
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: support reboot-bootloader command
Chanho Park [Wed, 5 Aug 2015 02:22:27 +0000 (11:22 +0900)]
common: fastboot: support reboot-bootloader command

This patch supports reboot-bootloader command of fastboot. To enter
fastboot mode during reboot, we use INFORM4 register which is used for
FACTORY_RESET_MODE.

Change-Id: Ic3e28774ca128296deebd0ca184ed11f849301ad
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik5: config: enable fastboot chunk download
Chanho Park [Tue, 4 Aug 2015 09:30:05 +0000 (18:30 +0900)]
artik5: config: enable fastboot chunk download

This patch enables a chunk download feature of fastboot to download huge
size of file system image.

Change-Id: I1e2636de69e71db9afd73e5dafc0bcbd38b4eee6
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik10: config: enable fastboot chunk download
Chanho Park [Tue, 4 Aug 2015 09:28:27 +0000 (18:28 +0900)]
artik10: config: enable fastboot chunk download

This patch enables a chunk download feature of fastboot to download huge
size of file system image.

Change-Id: I8487aa0b6c402bd7231a8d99c4f1c68ba1de1483
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: support chunk download
Chanho Park [Tue, 4 Aug 2015 08:28:59 +0000 (17:28 +0900)]
common: fastboot: support chunk download

The original policy of the fastboot is first download and after flash.
We can't flash a huge size image because some boards don't have enough
size of ram buffer. Thus, we need to split the image into small size
buffer. Unfortunately, we can't get the partition information in normal
way. But, we could get the info through partition-type command of
fastboot. The partition information should be stored during
partition-type command and use them when download stage. If download
bytes reach chunk size for example 64MB, we could flash the buffer into
storage.

|--------------------192MB------------------|
|-----64MB-----|-----64MB-----|-----64MB----|
|=======A======|=======B======|======C======|

If 'A' chunk is downloaded, the 'A' will be flashed into mmc partition.
After B and C will be downloaded and flashed, the whole download will be
done.

Change-Id: If1321b8660103b7a18fa60ae6631b09e8e171464
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: decompress_ext4: support multiple chain downloads
Chanho Park [Tue, 4 Aug 2015 04:51:27 +0000 (13:51 +0900)]
common: decompress_ext4: support multiple chain downloads

This patch supports multiple chain downloads which splits a large buffer to
small buffers. The sparse image of android consists of file header,
chunk header and raw data. The file header is the first 28 bytes of the
buffer and it indicates meta information like total size, total chunk
count. Following the file header, there is multiple chunks which has a
chunk header and raw data. The types of the chunks are RAW, FILL and
NONE. The RAW type has raw data in the chunk and the FILL type means
there is no raw data thus we could skip the sectors.

The original scheme of fastboot is flashing after we download the whole
data. However, there is no way to store a huge image if we don't have
sufficient ram buffers. Thus, we need to flash the image into small size
buffers. To support chain download, we need to keep meta information
like current sector position.

|------------------------80MB---------------------|
|-----32MB---------|-------32MB-----|----16MB-----|
|FH|CH|----RAW------|CH|FILL|CH|-------RAW--------|

For example, there is 80MB image to download and flash, we could split
them into three chunks which the max is 32MB or predefined size. We
should consider residue bytes in boundary of chunks. The residue bytes
should be stored a buffer and flash them when next chunks will be
flashed.

Change-Id: Idabb738fa1c2fac1b1e2c561e3cbdb7fa5d5ac8f
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik10: configs: support boot environment
Chanho Park [Thu, 30 Jul 2015 04:53:17 +0000 (13:53 +0900)]
artik10: configs: support boot environment

This patch updates the artik10 config to support boot environment. This
also includes gpt table configurations for future works. You could
convert and change boot mode easily from u-boot shell.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik5: config: disable static kernel offset
Chanho Park [Tue, 28 Jul 2015 07:18:28 +0000 (16:18 +0900)]
artik5: config: disable static kernel offset

This patch disables static position of kernel offset because the flash
program should be changed.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoartik5: config: support bootcmd environment variable
Chanho Park [Tue, 28 Jul 2015 06:11:07 +0000 (15:11 +0900)]
artik5: config: support bootcmd environment variable

This patch arranges bootcmd environment variables to change them from
u-boot shell.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: support flash environment partition
Chanho Park [Tue, 28 Jul 2015 05:40:07 +0000 (14:40 +0900)]
common: fastboot: support flash environment partition

This patch allow to flash the environment partition through 'fastboot
flash env params.bin'.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: movi: support environment partition
Chanho Park [Tue, 28 Jul 2015 05:37:07 +0000 (14:37 +0900)]
common: movi: support environment partition

This patch supports to read and write the environment partition of movi
command. The u-boot environment variables are stored in the partition
and u-boot load the values from the partition

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: free dynamic allocated memory
Chanho Park [Mon, 27 Jul 2015 13:56:45 +0000 (22:56 +0900)]
common: fastboot: free dynamic allocated memory

This patch fixes missing free of dynamic allocated memory.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: factor out write_buffer_sdmmc
Chanho Park [Mon, 27 Jul 2015 12:48:16 +0000 (21:48 +0900)]
common: fastboot: factor out write_buffer_sdmmc

This patch factors out write_buffer_sdmmc to allow writing specific
buffer to the offset of mmc device because the original
write_to_ptn_sdmmc could write the whole partition.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: store partition name from getvar command
Chanho Park [Mon, 27 Jul 2015 10:07:16 +0000 (19:07 +0900)]
common: fastboot: store partition name from getvar command

This patch allows to a partition entry from getvar fastboot command.
The partition name is required when we try to download chunk bytes and flash
them to mmc immediately.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: factor out process command
Chanho Park [Mon, 27 Jul 2015 08:11:11 +0000 (17:11 +0900)]
common: fastboot: factor out process command

This patch factor out process command from the rx_handler functin
because the rx_handler function is too long to modify as flavour.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: factor out download_data from rx_handler
Chanho Park [Mon, 27 Jul 2015 06:21:53 +0000 (15:21 +0900)]
common: fastboot: factor out download_data from rx_handler

This patch is the first trial for refactoring cmd_fastboot because it's too
complex to modify the codes.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: retrieve partition tables from mmc
Chanho Park [Mon, 27 Jul 2015 04:43:54 +0000 (13:43 +0900)]
common: fastboot: retrieve partition tables from mmc

This patch allow to retrieve partition tables from mmc device. It reads
the tables through get_partition_info function and appends the
partitions the end of the static partitions.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agocommon: fastboot: correct print format of partition size
Chanho Park [Mon, 27 Jul 2015 02:41:11 +0000 (11:41 +0900)]
common: fastboot: correct print format of partition size

This patch corrects print-out of the partition sizes because the partition
sizes are 64 bit sizes. Thus, we should change the format from %X to %llx.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoarm: exynos: skip area by kernel start offset
Chanho Park [Mon, 27 Jul 2015 02:33:15 +0000 (11:33 +0900)]
arm: exynos: skip area by kernel start offset

This patch allows same kernel offset even we use different tzsw offset.
We could start same location for kernel start offset.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoarm: exynos: retrieve kernel/ramdisk partition sizes
Chanho Park [Mon, 27 Jul 2015 02:31:01 +0000 (11:31 +0900)]
arm: exynos: retrieve kernel/ramdisk partition sizes

This patch retrieves kernel and ramdisk sizes from configurations. The
CONFIG_KERNEL_PART_SIZE represents the kernel size and CONFIG_RAMDISK_PART_SIZE
also represents ramdisk size. The unit of size is MB.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoRefactor linker-generated arrays
Albert ARIBAUD [Mon, 25 Feb 2013 00:59:00 +0000 (00:59 +0000)]
Refactor linker-generated arrays

Refactor linker-generated array code so that symbols
which were previously linker-generated are now compiler-
generated. This causes relocation records of type
R_ARM_ABS32 to become R_ARM_RELATIVE, which makes
code which uses LGA able to run before relocation as
well as after.

Note: this affects more than ARM targets, as linker-
lists span possibly all target architectures, notably
PowerPC.

Conflicts:
arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
board/ait/cam_enc_4xx/u-boot-spl.lds
board/davinci/da8xxevm/u-boot-spl-da850evm.lds
board/davinci/da8xxevm/u-boot-spl-hawk.lds
board/vpac270/u-boot-spl.lds

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
Conflicts:
.gitignore
Makefile
arch/arm/cpu/arm920t/ep93xx/u-boot.lds
arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
arch/arm/cpu/ixp/u-boot.lds
arch/arm/cpu/u-boot.lds
arch/avr32/cpu/u-boot.lds
arch/blackfin/cpu/u-boot.lds
arch/mips/cpu/u-boot.lds
arch/nds32/cpu/n1213/u-boot.lds
arch/nios2/cpu/u-boot.lds
arch/powerpc/cpu/74xx_7xx/u-boot.lds
arch/powerpc/cpu/mpc512x/u-boot.lds
arch/powerpc/cpu/mpc5xx/u-boot.lds
arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds
arch/powerpc/cpu/mpc5xxx/u-boot.lds
arch/powerpc/cpu/mpc8220/u-boot.lds
arch/powerpc/cpu/mpc824x/u-boot.lds
arch/powerpc/cpu/mpc8260/u-boot.lds
arch/powerpc/cpu/mpc83xx/u-boot.lds
arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds
arch/powerpc/cpu/mpc85xx/u-boot.lds
arch/powerpc/cpu/mpc86xx/u-boot.lds
arch/powerpc/cpu/ppc4xx/u-boot.lds
arch/sandbox/cpu/u-boot.lds
arch/sh/cpu/sh2/u-boot.lds
arch/sh/cpu/sh3/u-boot.lds
arch/sh/cpu/sh4/u-boot.lds
arch/x86/cpu/u-boot.lds
board/BuS/EB+MCF-EV123/u-boot.lds
board/LEOX/elpt860/u-boot.lds
board/RPXClassic/u-boot.lds
board/RPXClassic/u-boot.lds.debug
board/RPXlite/u-boot.lds
board/RPXlite/u-boot.lds.debug
board/RPXlite_dw/u-boot.lds
board/RPXlite_dw/u-boot.lds.debug
board/RRvision/u-boot.lds
board/actux1/u-boot.lds
board/actux2/u-boot.lds
board/actux3/u-boot.lds
board/adder/u-boot.lds
board/altera/nios2-generic/u-boot.lds
board/amcc/acadia/u-boot-nand.lds
board/amcc/bamboo/u-boot-nand.lds
board/amcc/canyonlands/u-boot-nand.lds
board/amcc/kilauea/u-boot-nand.lds
board/amcc/sequoia/u-boot-nand.lds
board/amcc/sequoia/u-boot-ram.lds
board/astro/mcf5373l/u-boot.lds
board/cobra5272/u-boot.lds
board/cogent/u-boot.lds
board/cogent/u-boot.lds.debug
board/cray/L1/u-boot.lds.debug
board/dave/PPChameleonEVB/u-boot.lds
board/dvlhost/u-boot.lds
board/eltec/mhpc/u-boot.lds
board/eltec/mhpc/u-boot.lds.debug
board/emk/top860/u-boot.lds
board/ep88x/u-boot.lds
board/esd/dasa_sim/u-boot.lds
board/esd/pmc440/u-boot-nand.lds
board/esd/tasreg/u-boot.lds
board/esteem192e/u-boot.lds
board/evb64260/u-boot.lds
board/fads/u-boot.lds
board/flagadm/u-boot.lds
board/flagadm/u-boot.lds.debug
board/freescale/m5208evbe/u-boot.lds
board/freescale/m52277evb/u-boot.lds
board/freescale/m5235evb/u-boot.lds
board/freescale/m5249evb/u-boot.lds
board/freescale/m5253demo/u-boot.lds
board/freescale/m5253evbe/u-boot.lds
board/freescale/m5271evb/u-boot.lds
board/freescale/m5272c3/u-boot.lds
board/freescale/m5275evb/u-boot.lds
board/freescale/m5282evb/u-boot.lds
board/freescale/m53017evb/u-boot.lds
board/freescale/m5329evb/u-boot.lds
board/freescale/m5373evb/u-boot.lds
board/freescale/m54451evb/u-boot.lds
board/freescale/m54455evb/u-boot.lds
board/freescale/m547xevb/u-boot.lds
board/freescale/m548xevb/u-boot.lds
board/freescale/mx31ads/u-boot.lds
board/gaisler/gr_cpci_ax2000/u-boot.lds
board/gaisler/gr_ep2s60/u-boot.lds
board/gaisler/gr_xc3s_1500/u-boot.lds
board/gaisler/grsim/u-boot.lds
board/gaisler/grsim_leon2/u-boot.lds
board/gen860t/u-boot-flashenv.lds
board/gen860t/u-boot.lds
board/genietv/u-boot.lds
board/genietv/u-boot.lds.debug
board/hermes/u-boot.lds
board/hermes/u-boot.lds.debug
board/hymod/u-boot.lds
board/hymod/u-boot.lds.debug
board/icu862/u-boot.lds
board/icu862/u-boot.lds.debug
board/idmr/u-boot.lds
board/ip860/u-boot.lds
board/ip860/u-boot.lds.debug
board/ivm/u-boot.lds
board/ivm/u-boot.lds.debug
board/korat/u-boot-F7FC.lds
board/kup/kup4k/u-boot.lds
board/kup/kup4k/u-boot.lds.debug
board/kup/kup4x/u-boot.lds
board/kup/kup4x/u-boot.lds.debug
board/lwmon/u-boot.lds
board/lwmon/u-boot.lds.debug
board/manroland/uc100/u-boot.lds
board/matrix_vision/mvsmr/u-boot.lds
board/mbx8xx/u-boot.lds
board/mbx8xx/u-boot.lds.debug
board/ml2/u-boot.lds
board/mousse/u-boot.lds
board/mpl/pip405/u-boot.lds.debug
board/mvblue/u-boot.lds
board/netphone/u-boot.lds
board/netphone/u-boot.lds.debug
board/netta/u-boot.lds
board/netta/u-boot.lds.debug
board/netta2/u-boot.lds
board/netta2/u-boot.lds.debug
board/netvia/u-boot.lds
board/netvia/u-boot.lds.debug
board/nx823/u-boot.lds
board/nx823/u-boot.lds.debug
board/openrisc/openrisc-generic/u-boot.lds
board/quantum/u-boot.lds
board/r360mpi/u-boot.lds
board/rbc823/u-boot.lds
board/renesas/sh7752evb/u-boot.lds
board/renesas/sh7757lcr/u-boot.lds
board/rsdproto/u-boot.lds
board/samsung/smdk5250/smdk5250-uboot-spl.lds
board/samsung/smdk6400/u-boot-nand.lds
board/sandburst/karef/u-boot.lds.debug
board/sandburst/metrobox/u-boot.lds.debug
board/sandpoint/u-boot.lds
board/sixnet/u-boot.lds
board/snmc/qs850/u-boot.lds
board/snmc/qs860t/u-boot.lds
board/spc1920/u-boot.lds
board/spd8xx/u-boot.lds
board/spd8xx/u-boot.lds.debug
board/stx/stxxtc/u-boot.lds
board/stx/stxxtc/u-boot.lds.debug
board/svm_sc8xx/u-boot.lds
board/tqc/tqm8xx/u-boot.lds
board/v37/u-boot.lds
board/w7o/u-boot.lds.debug
board/xes/xpedite1000/u-boot.lds.debug
board/xilinx/microblaze-generic/u-boot.lds
common/cmd_help.c
doc/README.commands
include/command.h
include/env_callback.h
nand_spl/board/freescale/mpc8536ds/Makefile
nand_spl/board/freescale/mpc8569mds/Makefile
nand_spl/board/freescale/mpc8572ds/Makefile
nand_spl/board/freescale/mx31pdk/Makefile
nand_spl/board/freescale/mx31pdk/u-boot.lds
nand_spl/board/freescale/p1010rdb/Makefile
nand_spl/board/freescale/p1023rds/Makefile
nand_spl/board/freescale/p1_p2_rdb/Makefile
nand_spl/board/karo/tx25/Makefile
nand_spl/board/karo/tx25/u-boot.lds
nand_spl/board/samsung/smdk6400/u-boot.lds

9 years agoConsolidate bool type
York Sun [Mon, 1 Apr 2013 18:29:11 +0000 (11:29 -0700)]
Consolidate bool type

'bool' is defined in random places. This patch consolidates them into a
single header file include/linux/types.h, using stdbool.h introduced in C99.

All other #define, typedef and enum are removed. They are all consistent with
true = 1, false = 0.

Replace FALSE, False with false. Replace TRUE, True with true.
Skip *.py, *.php, lib/* files.

Signed-off-by: York Sun <yorksun@freescale.com>
Conflicts:
board/spear/x600/fpga.c
common/cmd_scsi.c
drivers/fpga/cyclon2.c
drivers/mtd/nand/mxc_nand.c
drivers/spi/ich.c
drivers/usb/musb-new/linux-compat.h
include/linux/usb/gadget.h

9 years agogen: Add progressive hash API
Hung-ying Tyan [Mon, 3 Mar 2014 11:19:28 +0000 (12:19 +0100)]
gen: Add progressive hash API

Add hash_init(), hash_update() and hash_finish() to the
hash_algo struct. Add hash_lookup_algo() to look up the
struct given an algorithm name.

Signed-off-by: Hung-ying Tyan <tyanh@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agohash.c: Correct non-hash subcommand crc32 addr-save support
Tom Rini [Thu, 7 Nov 2013 12:39:48 +0000 (07:39 -0500)]
hash.c: Correct non-hash subcommand crc32 addr-save support

In the case of not having CONFIG_CMD_HASH but having CONFIG_CMD_CRC32
enabled (and not CONFIG_CRC32_VERIFY), we end up in this part of the
code path on hash_command().  However, we will only have exactly 3 args
here, and 3 > 3 is false, and we will not try and store the hash at the
address given as arg #3.  The next problem however is that we've been
moving argv around so the third value is now in argv[0] not argv[3].

Confirmed on AM335x Beaglebone White.

Signed-off-by: Tom Rini <trini@ti.com>
9 years agohash: Add a way to calculate a hash for any algortihm
Simon Glass [Tue, 7 May 2013 06:11:47 +0000 (06:11 +0000)]
hash: Add a way to calculate a hash for any algortihm

Rather than needing to call one of many hashing algorithms in U-Boot,
provide a function hash_block() which handles this, and can support all
available hash algorithms.

Once we have md5 supported within hashing, we can use this function in
the FIT image code.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agogen: Add sha h/w acceleration to hash
Akshay Saraswat [Wed, 20 Mar 2013 21:00:58 +0000 (21:00 +0000)]
gen: Add sha h/w acceleration to hash

Adding H/W acceleration support to hash which can be used
to test SHA 256 hash algorithm.

Signed-off-by: ARUN MANKUZHI <arun.m@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agocmd_mem.c: Fix warning when CONFIG_CMD_MEMTEST is not set
Tom Rini [Tue, 12 Mar 2013 14:07:19 +0000 (10:07 -0400)]
cmd_mem.c: Fix warning when CONFIG_CMD_MEMTEST is not set

mem_test_quick and mem_test_alt functions are only called by
do_mem_mtest, so move them under the #ifdef

Signed-off-by: Tom Rini <trini@ti.com>
9 years agoFeature Removal: disable "mtest" command by default
Wolfgang Denk [Fri, 8 Mar 2013 10:51:32 +0000 (10:51 +0000)]
Feature Removal: disable "mtest" command by default

The "mtest" command is of little practical use (if any), and
experience has shown that a large number of board configurations
define useless or even dangerous start and end addresses.  If not even
the board maintainers are able to figure out which memory range can be
reliably tested, how can we expect such from the end users?  As this
problem comes up repeatedly, we rather do not enable this command by
default, so only people who know what they are doing will be
confronted with it.

As this changes the user interface, we allow for a grace period
before this change takes effect. For now, we make "mtest"
configurable through the CONFIG_CMD_MEMTEST variable, which is defined
in include/config_cmd_default.h;  we also add an entry to
doc/feature-removal-schedule.txt which announces the removal of this
default setting in two releases from now, i. e. with v2013.07.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>
9 years agohash: Use lower case for hash algorithm names
Simon Glass [Sun, 24 Feb 2013 17:33:32 +0000 (17:33 +0000)]
hash: Use lower case for hash algorithm names

Rather than use strcasecmp() in the hash algorithm search, require the
caller to do this first. Most of U-Boot can use lower case anyway, and
the hash command can convert to lower case before calling hash_command().
This saves needing strcasecmp() for boards that use hashing but not
the hash command.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agosandbox: Allow hash functions to work correctly
Simon Glass [Sun, 24 Feb 2013 17:33:31 +0000 (17:33 +0000)]
sandbox: Allow hash functions to work correctly

Use map_sysmem() so that hashing is possible on sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agosandbox: Update mtest to fix crashes
Simon Glass [Thu, 28 Feb 2013 17:47:14 +0000 (17:47 +0000)]
sandbox: Update mtest to fix crashes

Use map_sysmem() in the memory tester so that it works as expected on
sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoMove CONFIG_SYS_MEMTEST_SCRATCH #ifdef to top of file
Simon Glass [Sun, 24 Feb 2013 17:33:29 +0000 (17:33 +0000)]
Move CONFIG_SYS_MEMTEST_SCRATCH #ifdef to top of file

This config effectively has a default value of 0, so add this setting
at the top of the code to remove an #ifdef in the C function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Conflicts:
common/cmd_mem.c

9 years agoRoll crc32 into hash infrastructure
Simon Glass [Sun, 24 Feb 2013 20:30:22 +0000 (20:30 +0000)]
Roll crc32 into hash infrastructure

Add the CRC32 algorithm to the list of available hashes, and make
the crc32 command use hash_command(). Add a new crc32_wd_buf() to
make this possible, which puts its result in a buffer rather than
returning it as a 32-bit value.

Note: For some boards the hash command is not enabled, neither
are sha1, sha256 or the verify option. In this case the full
hash implementation adds about 500 bytes of overhead. So as a
special case, we use #ifdef to select very simple bahaviour in
that case. The justification for this is that it is currently
a very common case (virtually all boards enable crc32 but only
some enable more advanced features).

Signed-off-by: Simon Glass <sjg@chromium.org>
Conflicts:
common/cmd_mem.c

9 years agoReduce casting in mtest
Simon Glass [Sun, 24 Feb 2013 17:33:20 +0000 (17:33 +0000)]
Reduce casting in mtest

Use a ulong for the command arguments, and only cast to an address when
needed. This fixes warnings in sandbox where pointers are typically 64 bits
long.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoBring mtest putc() into common code
Simon Glass [Sun, 24 Feb 2013 17:33:19 +0000 (17:33 +0000)]
Bring mtest putc() into common code

If we get a Ctrl-C abort, we always print a newline. Move this repeated
code out of the functions and into a single place in the caller.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoFix mtest indenting
Simon Glass [Sun, 24 Feb 2013 17:33:18 +0000 (17:33 +0000)]
Fix mtest indenting

Some of the inner loops are not indented correctly. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoUse common mtest iteration counting
Simon Glass [Sun, 24 Feb 2013 17:33:17 +0000 (17:33 +0000)]
Use common mtest iteration counting

The iteration code is the same for each version of the memory test, so
pull it out into the common function.

Signed-off-by: Simon Glass <sjg@chromium.org>