1
0
Fork 0
Commit Graph

17653 Commits (c57b953da923c6402afc1c890c21fdc7d5a2cc4a)

Author SHA1 Message Date
Pavel Machek c57b953da9 SPL: Add support for loading image from ram in SPL.
Signed-off-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 11:20:28 -07:00
Tom Rini 4212098181 SPL: Rework how we inform about un-headered images
First, remove the puts from the case where we don't have an mkimage
header as this is somewhat common and intentional for no-arg target
images.  Second, rework the final switch statement in board_init_r to,
in the case of !CONFIG_SPL_OS_BOOT be only about doing debug prints
about if we know what the magic is or not (the CONFIG_SPL_OS_BOOT case
is unchanged).  Then we call jump_to_image_no_args().  This gives us the
same behavior as before but with slightly smaller code.

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 11:20:28 -07:00
Tom Rini 1292eaf353 SPL: Make un-supported boot device puts a debug instead
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 11:20:27 -07:00
Stefan Roese 3c6f8a0d19 SPL: Enable use of custom defined U-Boot entry point
By setting CONFIG_SYS_UBOOT_START boards can now use a different entry
point for their U-Boot image. So the U-Boot entry point is not fixed
to CONFIG_SYS_TEXT_BASE any more.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 11:20:27 -07:00
Tom Rini a4cc1c4877 SPL: SPI: Enhance spi_spl_load to match the other load functions
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 11:20:27 -07:00
Stefan Roese 022b4975c8 SPL: Add option to skip copying of the mkimage header
On some system (e.g. powerpc), the load-address and entry-point is
located at address 0. So the current approach to load the image
(payload) including the header to the address "load-address - 64"
can't work here.

This patch adds an flag to skip this copying including header to
the SPL framework. By setting SPL_COPY_PAYLOAD_ONLY, only the
playload will be copied. This will be used by the SPL NOR flash
driver on powerpc.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 11:20:27 -07:00
Stefan Roese 33d346464a SPL: Add NOR flash booting support
SPL NOR flash booting support is quite simple. Only copying of the
images is needed.

On MPC5xxx we need to make sure to only use the standard memcpy()
implementation and not the MPC5xxx specific one. As the MPC5xxx
version has some complexity which is not needed for this SPL
booting.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 11:20:27 -07:00
Tom Rini 95a372b836 da850: Add README.da850
This file documents when to build for da850evm and when to build for
da850_am18xxevm.  It also documents how to write the u-boot.ais file to
persistent storage (such as SPI), in some cases as well as how to write
a recovery image.

Signed-off-by: Tom Rini <trini@ti.com>
Acked-by: Christian Riesch <christian.riesch@omicron.at>
Acked-by: Prabhakar Lad <prabhakar.lad@ti.com>
2012-09-27 11:20:27 -07:00
Sughosh Ganu d79f3a6860 hawkboard: Update config file to work with common spl framework
The common spl framework expects the u-boot payload size through
CONFIG_SYS_MONITOR_LEN. Define the macro with the u-boot's size. With
this change, CONFIG_SYS_NAND_U_BOOT_SIZE is no longer required. Delete
the same.

Signed-off-by: Tom Rini <trini@ti.com>
Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
2012-09-27 11:20:26 -07:00
Tom Rini 3f7f2414ef ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK
- Convert the non-relocation part of board_init_f to spl_board_init, turn on CONFIG_SPL_BOARD_INIT in the configs.
- Remove duplicated code.
- Add spl_boot_device() that returns the statically chosen boot device.

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 11:20:10 -07:00
Tom Rini d97b4ce805 SPL: NAND: Move arch/arm/cpu/armv7/omap-common/spl_nand.c to common/spl
We move the spl_nand_load_image function to common/spl.  This will allow
for easier integration of SPL-boots-Linux code on other arches.

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:50:00 -07:00
Stefan Roese 77552b0633 SPL: Use image_get_xxx() functions to access header values
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:50:00 -07:00
Stefano Babic ae83d882f5 SPL: do not use fix value for u-boot size
If an u-boot image is not found, SPL thinks to load a bare
u-boot.bin image with a maximum size of 200KB.
Use CONFIG_SYS_MONITOR_LEN instead.

Signed-off-by: Stefan Roese <stefan.roese@gmail.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:49:59 -07:00
Tom Rini 6507f133f3 SPL: Create arch/arm/lib/spl.c for board_init_f and jump_to_image_linux
In SPL (CONFIG_SPL_FRAMEWORK) board_init_f must setup the stack pointer,
clear the BSS and call board_init_r.  We mark this as weak as some
platforms may need to perform additional initalization at this point.
We provide a gd that we know will be in a usable location, once the BSS
has been cleared to help with this as well.  Finally, we no longer call
relocate_code so remove that from the armv7 version.

Next, both board_init_f and jump_to_image_linux are going to be
inherently arch-specific, so move these versions to arch/arm/lib/spl.c

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:49:59 -07:00
Tom Rini 47f7bcae8c SPL: Move the omap SPL framework to common/spl
Add a new flag, CONFIG_SPL_FRAMEWORK to opt into the common/spl SPL
framework, enable on all of the previously using boards.  We move the
spl_ymodem.c portion to common/ and spl_mmc.c to drivers/mmc/.  We leave
the NAND one in-place as we plan to replace it later in this series.

We use common/spl to avoid linker problems with respect to merging
constant strings in objects.   Otherwise all strings in common/ will be
linked in and kept which grows SPL in size too much.

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:49:59 -07:00
Tom Rini d7cb93b28a ARM: SPL: Move gpmc_init() to spl_board_init()
This is an OMAP/related-specific function, move calling it to
spl_board_init() and turn on CONFIG_SPL_BOARD_INIT on the boards that
enabled NAND and didn't enable this already.

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:49:59 -07:00
Tom Rini d4c4e0e117 ARM: SPL: Start hooking in the current SPI SPL support
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:49:58 -07:00
Tom Rini 026b2fe32c ARM: SPL: Clean up spl.c / spl_nand.c slightly
- Remove includes we don't need
- Switch some printf statements to puts
- Convert some printf statements to debug, introduce new puts statements
  - In most cases saying just "No mkimage signature, assuming
    u-boot.bin" or similar is sufficient.  This also means the non-DEBUG
    case doesn't need printf, in the core of SPL.
  - The other case here is that PLAIN_VERSION provided what we wanted
    already, so just use it.

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:49:58 -07:00
Tom Rini f0881250f9 ARM: SPL: Make spl_mmc.c more generic
Move the default omap/related-centric board_mmc_init to
arch/arm/cpu/armv7/omap-common/boot-common.c and move the type defines
to <asm/spl.h>.  Also use mmc->read_bl_len rather than MMCSD_SECTOR_SIZE

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:49:58 -07:00
Tom Rini 55cdbb8d4e ARM: SPL: Add <asm/spl.h> and <asm/arch/spl.h>
Move the SPL prototypes from <asm/omap_common.h> into <asm/spl.h> and
add <asm/arch/spl.h> for arch specific portions of CONFIG_SPL_FRAMEWORK.

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:49:57 -07:00
Tom Rini 24dafad5c4 ARM: SPL: Only call mem_malloc_init if configured
We can only attempt to setup a malloc pool if
CONFIG_SYS_SPL_MALLOC_START is defined, and not all boards require it.
Make the call depend on the define.

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:48:39 -07:00
Tom Rini 8082fda9fc ARM: SPL: Remove NAND_MODE_HW_ECC from spl_nand.c
This detection code doesn't (and can't) do anything currently, so
remove.

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:48:39 -07:00
Tom Rini 37189a1958 ARM: SPL: Rename omap_boot_mode to spl_boot_mode()
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:48:39 -07:00
Tom Rini 8e1b836ec5 ARM: SPL: Rename omap_boot_device to spl_boot_device
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:48:38 -07:00
Pavel Machek 9f8a6e7ae7 omap-common: SPL: Fix whitespace in omap-common/u-boot-spl.lds.
Signed-off-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:48:38 -07:00
Tom Rini 6abbe744d2 omap-common: Fix typo in save_boot_params() in lowlevel_init.S
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:48:38 -07:00
Tom Rini 861a86f460 omap-common: SPL: Add CONFIG_SPL_DISPLAY_PRINT / spl_display_print()
Only omap4/5 currently have a meaningful set of display text and overo
had been adding a function to display nothing.  Change how this works to
be opt-in and only turned on for omap4/5 now.

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:48:38 -07:00
Tom Rini 0da113e9fd spl_mmc: Make FAT checks / calls guarded with CONFIG_SPL_FAT_SUPPORT
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:48:37 -07:00
Tom Rini 659e559d55 Makefile: Move SPL files to clobber, remove from clean
The 'clean' target has been removing all of spl but not u-boot itself.
For consistency and ease of testing, only remove SPL binaries / maps in
the clobber target, just like for full U-Boot

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-27 09:48:37 -07:00
Benoît Thébaudeau 1170e634dd FAT: Make it possible to read from any file position
When storage devices contain files larger than the embedded RAM, it is
useful to be able to read these files by chunks, e.g. for a software
update to the embedded NAND Flash from an external storage device (USB
stick, SD card, etc.).

Hence, this patch makes it possible by adding a new FAT API to read
files from a given position. This patch also adds this feature to the
fatload command.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-26 11:11:32 -07:00
Igor Grinberg 9aa90c1df0 env: checkpatch clean env_fat
env_fat has several checkpatch warnings - clean those up.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-09-26 11:08:32 -07:00
Igor Grinberg 3bb89e5bd5 env: remove duplicated env_get_char_spec()
env_fat and env_remote have an implementation of env_get_char_spec()
function that is not different than the default.
Remove the duplicated code.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-09-26 11:08:32 -07:00
Tom Rini 2d1d65838e README.commands: Document what UNDEF_SYM does
Changes in v2:
- Reword a bit more

Signed-off-by: Tom Rini <trini@ti.com>
2012-09-26 11:08:32 -07:00
Otavio Salvador 244e6f9705 patman: Use reverse order for changelog
Specially when many revisions are need for a patchset, the most
interesting information is about the last set of changes so we output
the changelog in reverse order to easy identification of most recent
change set.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Acked-by: Simon Glass <sjg@chromium.org>
2012-09-26 11:08:32 -07:00
Daniel Schwierzeck 00d0d2ad4e malloc: remove extern declarations of malloc_bin_reloc() in board.c files
Declare malloc_bin_reloc() in malloc.h and remove all extern declarations
in various board.c files to get rid of one checkpatch.pl warning.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Andreas Bießmann <andreas.devel@gmail.com>
Cc: Jason Jin <Jason.jin@freescale.com>
Cc: Macpaul Lin <macpaul@andestech.com>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Acked-by: Andreas Bießmann <andreas.devel@gmail.com>
2012-09-26 11:08:32 -07:00
Tom Rini b3873d3f4c Merge branch 'master' of git://git.denx.de/u-boot-video 2012-09-25 16:18:22 -07:00
Stephen Warren 5cf41dccff cmd_part: add partition-related command
This implements the following:

part uuid mmc 0:1
  -> print partition UUID
part uuid mmc 0:1 uuid
  -> set environment variable to partition UUID
part list mmc 0
  -> list the partitions on the specified device

"part uuid" can be useful when writing a bootcmd which searches all
known devices for something bootable, and then wants the kernel to
use the same partition as the root device, e.g.:

part uuid ${devtype} ${devnum}:${rootpart} uuid
setenv bootargs root=PARTUUID=${uuid} ...

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2012-09-25 15:05:47 -07:00
Stephen Warren d27b5f9398 disk: part_msdos: parse and store partition UUID
The MSDOS/MBR partition table includes a 32-bit unique ID, often referred
to as the NT disk signature. When combined with a partition number within
the table, this can form a unique ID similar in concept to EFI/GPT's
partition UUID.

This patch generates UUIDs in the format 0002dd75-01, which matches the
format expected by the Linux kernel.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2012-09-25 15:05:45 -07:00
Stephen Warren 894bfbbfb7 disk: part_efi: parse and store partition UUID
Each EFI partition table entry contains a UUID. Extend U-Boot's struct
disk_partition to be able to store this information, and modify
get_partition_info_efi() to fill it in.

The implementation of uuid_string() was derived from the Linux kernel,
tag v3.6-rc4 file lib/vsprintf.c function uuid_string().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2012-09-25 15:05:44 -07:00
Stephen Warren c04d68c694 disk: part_efi: range-check partition number
Enhance get_partition_info_efi() to range-check the partition number.
This prevents invalid partitions being accessed, and prevents access
beyond the end of the gpt_pte[] array.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2012-09-25 14:58:51 -07:00
Stephen Warren 10a37fd7a4 disk: get_device_and_partition() "auto" partition and cleanup
Rework get_device_and_partition() to:
a) Implement a new partition ID of "auto", which requests that U-Boot
   search for the first "bootable" partition, and fall back to the first
   valid partition if none is found. This way, users don't need to
   specify an explicit partition in their commands.
b) Make use of get_device().
c) Add parameter to indicate whether returning a whole device is
   acceptable, or whether a partition is mandatory.
d) Make error-checking of the user's device-/partition-specification
   more complete. In particular, if strtoul() doesn't convert all
   characters, it's an error rather than just ignored.

The resultant device/partition returned by the function will be as
follows, based on whether the disk has a partition table (ptable) or not,
and whether the calling command allows the whole device to be returned
or not.

(D and P are integers, P >= 1)

D
D:
  No ptable:
    !allow_whole_dev: error
    allow_whole_dev: device D
  ptable:
    device D partition 1
D:0
  !allow_whole_dev: error
  allow_whole_dev: device D
D:P
  No ptable: error
  ptable: device D partition P
D:auto
  No ptable:
    !allow_whole_dev: error
    allow_whole_dev: device D
  ptable:
    first partition in device D with bootable flag set.
    If none, first valid paratition in device D.

Note: In order to review this patch, it's probably easiest to simply
look at the file contents post-application, rather than reading the
patch itself.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
[swarren: Rob implemented scanning for bootable partitions. I fixed a
couple of issues there, switched the syntax to ":auto", added the
error-checking rework, and ":0" syntax for the whole device]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2012-09-25 14:58:48 -07:00
Stephen Warren 2023e60861 disk: introduce get_device()
This patch introduces function get_device(). This looks up a
block_dev_desc_t from an interface name (e.g. mmc) and device number
(e.g. 0). This function is essentially the non-partition-specific
prefix of get_device_and_partition().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2012-09-25 14:49:33 -07:00
Rob Herring 650f36641c cmd_reiser: use common get_device_and_partition function
Convert reiserload and reiserls to use common device and partition parsing
function. With the common function "dev:part" can come from the
environment and a '-' can be used in that case.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25 14:49:18 -07:00
Rob Herring 4120457044 cmd_zfs: use common get_device_and_partition function
Convert zfsload and zfsls to use common device and partition parsing
function. With the common function "dev:part" can come from the
environment and a '-' can be used in that case.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25 14:49:17 -07:00
Rob Herring 475c7970c1 cmd_disk: use common get_device_and_partition function
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25 14:49:05 -07:00
Rob Herring cfda5aeab8 cmd_fat: use common get_device_and_partition function
Convert fatload, fatls, and fatinfo to use common device and partition
parsing function. With the common function "dev:part" can come from the
environment and a '-' can be used in that case.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25 14:46:57 -07:00
Rob Herring 81180819b8 cmd_extX: use common get_device_and_partition function
Convert ext2/4 load, ls, and write functions to use common device and
partition parsing function. With the common function "dev:part" can come
from the environment and a '-' can be used in that case.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25 14:46:55 -07:00
Rob Herring 9450106296 ext4: remove init_fs/deinit_fs
There's no real need to expose this and it can be removed by using a static
allocation.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25 14:46:35 -07:00
Rob Herring 99d2c205d4 disk/part: introduce get_device_and_partition
All block device related commands (scsiboot, fatload, ext2ls, etc.) have
simliar duplicated device and partition parsing and selection code. This
adds a common function to replace various implementations.

The new function has an enhancement over current versions. If no device
or partition is specified on the command line, the bootdevice env variable
will be used (scsiboot does this).

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25 14:44:40 -07:00
Rob Herring 40e0e5686a disk/part: check bootable flag for DOS partitions
Determine which partitions are bootable/active. In the partition listing,
print "Boot" for partitions with the bootable/active flag set.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25 14:43:19 -07:00