this is for the next basic version .
we will base on uboot v2011.03 

git-svn-id: https://svn-bj.amlogic.com/svn/model_ae/u-boot-arm/branches/next@1813 c34226c9-b5fa-4f31-a305-e87a1ebe7a46
AMLogic's patchset of 'amlogic-20140823'

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
disk/part.c: Make features optional

If we don't want to build support for any partition types we can now
add #undef CONFIG_PARTITIONS in a board config file to keep this from
being compiled in. Otherwise boards assume this is compiled in by
default

Signed-off-by: Matthew McClintock <msm@freescale.com>
PARTITION/BLOCK DEVICE: Add partition erase/read/write functions

To make accessing partitions easier and more reliable, this
change adds functions for finding, erasing, reading and writing
partitions.  A few notes:

1) Some partitions may need commands executed before and/or after
accessing them.  These functions will fetch an environment
variable of the form (pre|post)_<operation>.<partition_name> and
then hand it off to the command interpreter at the appropriate
time.  For example, if you have a partition "xloader" that
requires using hardware ECC, but all your other partitions need
software ECC, setting "pre_write.xloader=nandecc hw" and
"post_write.xloader=nandecc sw" will flip the ECC to hardware
before writing to the xloader partition and back to software when
finished.

2) The functions will silently round up the passed lengths to
meet the needs of the underlying block device.  This means that
if you call one of the functions to read or write and tell it to
only do one byte, you'll need to ensure that the passed buffer is
actually big enough to get an entire blocks worth of data.  In
the case of writing, if you want to prevent "random" data being
written after your one byte, you'll need to fill the buffer with
data of your choice.

Change-Id: Ibc4441c3c24a3f47549ae4b1ffad359a3d63a83d
Signed-off-by: Scott Anderson <saa@google.com>

Conflicts:

	disk/part.c
	include/part.h
PARTITION/BLOCK DEVICE: Add pre/post functions

Some code can't read/write the entire partition in one shot.  To
make it easier for them to run the pre/post operation environment
variables, wrapper functions have been added.

Change-Id: I7e4960ab8ec76336886c8c80c165fa7278aa0970
Signed-off-by: Scott Anderson <saa@google.com>
Add an implementation of snprintf to UBoot.

Any good code base with its own pseudo libc needs an snprintf, so I am adding
one here.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: Ie3b9fc7ee2b9056a9abc27e0d4f7d6fc5a9ee5ab
lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
EFI PARTITION: Fix print_part_efi() and test_part_efi().

The functions suffered from passing parameters to_gpt_valid() and
is_pte_valid() incorrectly.  They should be passed a pointer to a
pointer that is written by the function.  Instead, they passing
the value of a pointer to a pointer.

In addition, neither of the functions was using the name of the
partition.  I added a simple function to generate an ASCII name
from the unicode partition name so that the name was usable.

I also cleaned up some compiler warnings, a little optimization,
and added error checking to ensure that accesses beyond the end
of the pgpt_pte array were not done,

Change-Id: I4ec22dbab24966c2ad8b919d239b95cdf914919d
Signed-off-by: Scott Anderson <saa@google.com>
BACKPORT: usb:gadget:composite USB composite gadget support

USB Composite gadget implementation for u-boot. It builds on top
of USB UDC drivers.

This commit is based on following files from Linux Kernel v2.6.36:

./include/linux/usb/composite.h
./drivers/usb/gadget/composite.c

SHA1: d187abb9a83e6c6b6e9f2ca17962bdeafb4bc903

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>

Change-Id: Ifcb1e671a21e91bd2de1c0ad328a59ae8c6205af
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
BACKPORT: dfu:usb: Support for g_dnl composite download gadget.

Composite USB download gadget support (g_dnl) for download functions.
This code works on top of composite gadget.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>

Change-Id: Ib15797f927b9fa95fc6cbffbe322f863d0916500
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
BACKPORT: usb/gadget: add the fastboot gadget

This patch contains an implementation of the fastboot protocol on the
device side and documentation. This is based on USB download gadget
infrastructure. The fastboot function implements the getvar, reboot,
download and reboot commands. What is missing is the flash handling i.e.
writting the image to media.

v3 (Rob Herring):
This is based on http://patchwork.ozlabs.org/patch/126798/ with the
following changes:
- Rebase to current mainline and updates for current gadget API
- Use SPDX identifiers for licenses
- Traced the history and added missing copyright to cmd_fastboot.c
- Use load_addr/load_size for transfer buffer
- Allow vendor strings to be optional
- Set vendor/product ID from config defines
- Allow Ctrl-C to exit fastboot mode
v4:
- Major re-write to use the USB download gadget. Consolidated function
code to a single file.
- Moved globals into single struct.
- Use puts and putc as appropriate.
- Added CONFIG_USB_FASTBOOT_BUF_ADDR and CONFIG_USB_FASTBOOT_BUF_SIZE to
set the fastboot transfer buffer.
v5:
- Add CONFIG option documentation to README
- Rebase using new downloader registration

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Rob Herring <robh@kernel.org>

Change-Id: I79fc501991ceac495f74e74f2b1ddcd21be61fb7
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
usb:gadget: FASTBOOT Gadget support

This patch adds the FASTBOOT Gadget to u-boot and to work on top of the USB
Gadget framework.

Change-Id: I1f3d6cef158121199f092c4c7b535535ea6c9d02
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
usb:gadget:ep: Reduce wMaxPacketSize only on USB FS

This patch is to change the maximum packet size only on USB FullSpeed
connection.

Change-Id: Ic5767e7bb297498ff32649dbd7686d08812f69c4
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
board:ODROIDC: Add new board files for ODROID-C

Change-Id: Ibf546f6ccf8e36cf7c87489a0400b15022b370a9
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
board:ODROIDC: Add USBPHY clk control

This patch adds a function to control USBPHY's clk to start, this will be
called before starting particular USB gadget function.

Change-Id: I2eaae34f586159080411da34853dca712ace7878
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
config:ODROIDC: Add system cacheline size (=64Bytes)

Change-Id: Idf5e363d3caf4f667c45fc79c11f39ea7e001c2f
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
FASTBOOT:ODROIDC: Increase packet size of input endpoint

Change-Id: I1cdf5b9fda0c8791153ff791425e1166710e0029
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
BACKPORT: FASTBOOT: Add fastboot to improve partition support

These files are ported from git://git.denx.de/u-boot.git,
HEAD commit was [7e9d844 ARMV7: tungsten: Cleanup build_server.sh].

Change-Id: I0c7a3333b39a9365d50a909dd1d56fb711a48f7c
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
EFI PARTITON: Add 'efi_block_read(...)' to read efi partition

The function 'efi_block_read(...)' is added to access EFI partiton which is
not at regular sector, 0,  on particual embedded system. Certain SoC request
put a bootload at 0 offset on boot device, this does not allow to support
other partition types. Hence map the partition table to other sectors
available, just after boot loader, and define CONFIG_CUSTOM_MBR_LBA where the
partition information start.

Change-Id: I73c815c2fe00e75a545defb15ca4c5f0223d9b5c
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
FASTBOOT: Add fastboot debug log macro

Change-Id: I89a26bf5f669322f8471d465756a268621b88e9f
Signed-off-by: Dongjin Kim <tobetter@gmail.com>