summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* fdt: remove unaligned access in fdt_fixup_ethernet()Stephen Warren2013-06-07-1/+2
| | | | | | | | | | | | | | | Some ARM compilers may emit code that makes unaligned accesses when faced with constructs such as: char mac[16] = "ethaddr"; Replace this with a strcpy() call instead to avoid this. strcpy() is used here, rather than replacing all usage of the mac variable with the string itself, since the loop itself sprintf()s to the variable each iteration, so strcpy() is doing basically the same thing. Reported-by: Florian Meier Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
* generic_board: reduce the redundancy of gd_t struct membersMasahiro Yamada2013-06-07-58/+55
| | | | | | | | | | | | | | | | | | | | | | This commit refactors common/board_f.c and common/board_r.c in order to delete the dest_addr and dest_addr_sp from gd_t struct. As mentioned as follows in include/asm-generic/global_data.h, /* TODO: is this the same as relocaddr, or something else? */ unsigned long dest_addr; /* Post-relocation address of U-Boot */ dest_addr is the same as relocaddr. Likewise, dest_addr_sp is the same as start_addr_sp. It seemed dest_addr/dest_addr_sp was used only as a scratch variable to calculate relocaddr/start_addr_sp, respectively. With a little refactoring, we can delete dest_addr and dest_addr_sp. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org>
* am335x: enable falcon boot mode for mmc (raw and fat) and nandPeter Korsgaard2013-06-07-3/+36
| | | | | | | | | | | | | | | | Jump into full u-boot mode if a 'c' character is received on the uart. We need to adjust the spl bss/malloc area to not overlap with the loadaddr of the kernel (sdram + 32k), so move it past u-boot instead. For raw mmc, we store the kernel parameter area in the free space after the MBR (if used). For nand, we use the last sector of the partition reserved for u-boot. This also enables the spl command in the full u-boot so the kernel parameter area snapshot can be created. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
* spl_mmc: add Falcon mode support for raw variantPeter Korsgaard2013-06-07-0/+28
| | | | | | | | | | If Falcon mode support is enabled (and the system isn't directed into booting u-boot), it will instead try to load kernel from sector CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR and CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS of kernel argument parameters starting from sector CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
* spl_mmc: mmc_load_image_raw(): Add sector argumentPeter Korsgaard2013-06-07-9/+6
| | | | | | So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
* spl_mmc: add Falcon mode support for FAT variantPeter Korsgaard2013-06-07-0/+29
| | | | | | | | | If Falcon mode support is enabled (and the system isn't directed into booting u-boot), it will instead try to load kernel from CONFIG_SPL_FAT_LOAD_KERNEL_NAME file and kernel argument parameters from CONFIG_SPL_FAT_LOAD_ARGS_NAME, both from the same partition as u-boot. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
* devkit8000: Add SPL_OS for MMC supportTom Rini2013-06-07-0/+8
| | | | Signed-off-by: Tom Rini <trini@ti.com>
* spl_mmc: mmc_load_image_fat(): Add filename argument and move fat init outPeter Korsgaard2013-06-07-14/+13
| | | | | | So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
* spl_mmc: return error from mmc_load_image_{raw, fat} rather than hangingPeter Korsgaard2013-06-07-10/+14
| | | | | | So we can instead fallback to doing something else on errors. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
* Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini2013-06-07-7/+139
|\
| * ARM: bcm2835: add simplefb DT node during bootz/mStephen Warren2013-06-05-1/+15
| | | | | | | | | | | | | | | | | | | | Add a DT simple-framebuffer node to DT when booting the Linux kernel. This will allow the kernel to inherit the framebuffer configuration from U-Boot, and display a graphical boot console, and even run a full SW- rendered X server. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Simon Glass <sjg@chromium.org>
| * lcd: add functions to set up simplefb device treeStephen Warren2013-06-05-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | simple-framebuffer is a new device tree binding that describes a pre- configured frame-buffer memory region and its format. The Linux kernel contains a driver that supports this binding. Implement functions to create a DT node (or fill in an existing node) with parameters that describe the framebuffer format that U-Boot is using. This will be immediately used by the Raspberry Pi board in U-Boot, and likely will be used by the Samsung ARM ChromeBook support soon too. It could well be used by many other boards (e.g. Tegra boards with built-in LCD panels, which aren't yet supported by the Linux kernel). Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Simon Glass <sjg@chromium.org>
| * cfb_console: flush FB cache at end of public functionsEric Nelson2013-05-06-6/+9
| | | | | | | | | | | | | | | | Removed internal cache_flush operations and placed a flush of the entire frame-buffer at the end of each public function. Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com> Signed-off-by: Anatolij Gustschin <agust@denx.de>
* | Merge branch 'master' of git://git.denx.de/u-boot-nand-flashTom Rini2013-06-07-0/+2
|\ \
| * | bug, nand, am33xx: nand->ecc.strength not set in board_nand_init()Sergey Lapin2013-06-04-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit dfe64e2c89731a3f9950d7acd8681b68df2bae03 Author: Sergey Lapin <slapin@ossfans.org> Date: Mon Jan 14 03:46:50 2013 +0000 mtd: resync with Linux-3.7.1 Introduced runtime bug: U-Boot 2013.04-00499-g46567df-dirty (Jun 04 2013 - 08:17:08) I2C: ready DRAM: 512 MiB WARNING: Caches not enabled NAND: BUG: failure at nand_base.c:3214/nand_scan_tail()! BUG! resetting ... on boards using drivers/mtd/nand/omap_gpmc.c as in board_nand_init() nand->ecc.strength is not set. Fix this! Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Sergey Lapin <slapin@ossfans.org> Cc: Scott Wood <scottwood@freescale.com> Cc: Tom Rini <trini@ti.com>
* | | input: Finish simplifing key_matrix_decode_fdt()Stephen Warren2013-06-06-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | [trini: Applied v1 of the series rather than v2, this commit is the delta from v1 to v2] Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Rini <trini@ti.com>
* | | checkpatch.pl: Add 'printf' to logFunctionsTom Rini2013-06-06-0/+1
| | | | | | | | | | | | Signed-off-by: Tom Rini <trini@ti.com>
* | | am33xx/omap4+: Move SRAM_SCRATCH_SPACE_ADDR to <asm/arch/omap.h>Tom Rini2013-06-06-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The location of valid scratch space is dependent on SoC, so move that there. On OMAP4+ we continue to use SRAM_SCRATCH_SPACE_ADDR. On am33xx/ti814x we want to use what the ROM defines as "public stack" which is the area after our defined download image space. Correct the comment about and location of CONFIG_SPL_TEXT_BASE. Signed-off-by: Tom Rini <trini@ti.com>
* | | Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2013-06-05-45/+105
|\ \ \
| * | | am33xx/omap: Move save_omap_boot_params to omap-common/boot-common.cTom Rini2013-06-05-36/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to call the save_omap_boot_params function on am33xx/ti81xx and other newer TI SoCs, so move the function to boot-common. Only OMAP4+ has the omap_hw_init_context function so add ifdefs to not call it on am33xx/ti81xx. Call save_omap_boot_params from s_init on am33xx/ti81xx boards. Reviewed-by: R Sricharan <r.sricharan@ti.com> Signed-off-by: Tom Rini <trini@ti.com>
| * | | am33xx: Correct NON_SECURE_SRAM_START/ENDTom Rini2013-06-04-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to Sricharan's cleanup of the boot parameter saving code, we did not make use of NON_SECURE_SRAM_START on am33xx, so it wasn't a problem that the address was pointing to the middle of our running SPL. Correct to point to the base location of the download image area. Increase CONFIG_SPL_TEXT_BASE to account for this scratch area being used. As part of correcting these tests, make use of the fact that we've always been placing our stack outside of the download image area (which is fine, once the downloaded image is run, ROM is gone) so correct the max size test to be the ROM defined top of the download area to where we link/load at. Signed-off-by: Tom Rini <trini@ti.com> --- Changes in v2: - Fix typo noted by Peter Korsgaard
| * | | omap-common/hwinit-common.c: Mark omap_rev_string as staticTom Rini2013-06-04-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Only called in this file, mark as static. Signed-off-by: Tom Rini <trini@ti.com>
* | | | Merge branch 'tpm' of git://git.denx.de/u-boot-x86Tom Rini2013-06-05-285/+486
|\ \ \ \
| * | | | tpm: Reorganize the I2C TPM driverTom Wai-Hong Tam2013-06-03-271/+399
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does a similar code reogranzation from http://patchwork.ozlabs.org/patch/132179/ which is based on an old version of code (fdt support and bus selection still not in). It merges this tidy-up on top of the recent code. It does not make any logical change. tpm.c implements the interface defined in tpm.h based on underlying LPC or I2C TPM driver. tpm.c and the underlying driver communicate throught tpm_private.h. Note: Merging the LPC driver with tpm.c is left to future patches. Change-Id: Ie1384f5f9e3935d3bc9a44adf8de80c5a70a5f2b Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | | tpm: Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C)Vincent Palatin2013-06-03-23/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for Infineon's new SLB 9645 TT 1.2 I2C TPMs, which supports clockstretching, combined reads and a bus speed of up to 400khz. The device also has a new device id. This is based on the kernel patch provided by Infineon : https://gerrit.chromium.org/gerrit/42332 Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Luigi Semenzato <semenzato@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Tom Wai-Hong Tam <waihong@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
| * | | | x86: config: Reflect the name changes of LPC TPM configsTom Wai-Hong Tam2013-06-03-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new name is more aligned with Linux kernel's naming of TPM driver. Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | | tpm: Rename generic_lpc_tpm to tpm_tis_lpcChe-liang Chiou2013-06-03-2/+5
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new name is more aligned with Linux kernel's naming of TPM driver. Signed-off-by: Peter Huewe <peter.huewe@infineon.com> Signed-off-by: Che-Liang Chiou <clchiou@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
* | | | fdt: allow bootdelay to be specified via device treeStephen Warren2013-06-04-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be useful to force bootcmd to execute as soon as U-Boot has started. My use-case is: An SoC-specific tool pushes U-Boot into RAM, along with an image to be written to device boot flash, with the DT config property "bootcmd" set to contain a command to write that image to flash. In this scenario, we don't want to allow any stale bootdelay value taken from the current flash content to affect how long it takes before the flashing process starts. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Gerald Van Baren <vanbaren@cideas.com>
* | | | input: simplify key_matrix_decode_fdt()Stephen Warren2013-06-04-40/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We know the exact property names that the code wants to process. Look these up directly with fdt_get_property(), rather than iterating over all properties within the node, and checking each property's name, in a convoluted fashion, against the expected name. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | | | input: fix unaligned access in key_matrix_decode_fdt()Stephen Warren2013-06-04-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialized character arrays on the stack can cause gcc to emit code that performs unaligned accessess. Make the data static to avoid this. Note that the unaligned accesses are made when copying data to prefix[] on the stack from .rodata. By making the data static, the copy is completely avoided. All explicitly written code treats the data as u8[], so will never cause any unaligned accesses. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
* | | | common: board_f: Do not call board_postclk_init twiceMasahiro Yamada2013-06-04-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The generic-board board_init_f function called board_postclk_init twice. The first one came from arch/arm/lib/board.c, while the second one from arch/powerpc/lib/board.c. This commit deletes the first occurrence. In addition, the second get_clocks call is moved after board_postclk_init in order to keep the function call order both for ARM and PowerPC. ARM board calles get_clocks function after board_postclk_init. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | | | disk: Fix possible out-of-bounds access in part_efi.cMarek Vasut2013-06-04-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure to never access beyond bounds of either EFI partition name or DOS partition name. This situation is happening: part.h: disk_partition_t->name is 32-byte long part_efi.h: gpt_entry->partition_name is 36-bytes long The loop in part_efi.c copies over 36 bytes and thus accesses beyond the disk_partition_t->name . Fix this by picking the shortest of source and destination arrays and make sure the destination array is cleared so the trailing bytes are zeroed-out and don't cause issues with string manipulation. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@ti.com> Cc: Simon Glass <sjg@chromium.org>
* | | | sandbox: image: Create a test for loading FIT imagesSimon Glass2013-06-04-0/+422
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The image code is fairly complex with various different options. It would be useful to have comprehensive tests for this. As a start, create a script which tries out loading a kernel/ramdisk/fdt from a FIT and checks that the images appear in the right place in memory. This uses sandbox which now supports bootm and related features. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | bootstage: Remove unused entries related to kernel/ramdisk/fdt loadSimon Glass2013-06-04-26/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the code for loading these three images from a FIT is common, we don't need individual boostage IDs for each of them. Note: there are some minor changes in the bootstage numbering, particuarly for kernel loading. I don't believe this matters. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | sandbox: image: Adjust FIT image printing to work with sandboxSimon Glass2013-06-04-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use map_sysmem() to convert from address to pointer, so that sandbox can print FIT information without crashing. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | image: Use fit_image_load() to load kernelSimon Glass2013-06-04-153/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new common code to load a kernel. The functionality should not change. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | sandbox: Adjust bootm command to work with sandboxSimon Glass2013-06-04-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use map_sysmem() when converting from addresses to pointers, so that bootm can be used with sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | image: Use fit_image_load() to load FDTSimon Glass2013-06-04-202/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new common code to load a flat device tree. Also fix up a few casts so that this code works with sandbox. Other than that the functionality should not change. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | image: Use fit_image_load() to load ramdiskSimon Glass2013-06-04-169/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new common code to load a ramdisk. The functionality should not change. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | image: Introduce fit_image_load() to load images from FITsSimon Glass2013-06-04-2/+326
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present code to load an image from a FIT is duplicated in the three places where it is needed (kernel, fdt, ramdisk). The differences between these different code copies is fairly minor. Create a new function in the fit code which can handle any of the requirements of those cases. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | mkimage: Add map_sysmem() and IH_ARCH_DEFAULT to simplfy buildingSimon Glass2013-06-04-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are not actually used in mkimage itself, but the image code (which is common with mkimage) does use them. To avoid #ifdefs in the image code just for mkimage, define dummy version of these here. The compiler will eliminate the dead code anyway. A better way to handle this might be to split out more things from common.h so that mkimage can include them. At present any file that mkimage uses has to be very careful what headers it includes. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | bootstage: Introduce sub-IDs for use with image loadingSimon Glass2013-06-04-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loading a ramdisk, kernel or FDT goes through similar stages. Create a block of IDs for each task, and define a consistent numbering within the block. This will allow use of common code for image loading. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | main: Add debug_bootkeys to avoid #ifdefsSimon Glass2013-06-04-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define a simple debug condition at the top of the file, to avoid using lots of #ifdefs later on. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* | | | main: Add debug_parser() to avoid #ifdefsSimon Glass2013-06-04-35/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define a simple debug condition at the top of the file, to avoid using lots of #ifdefs later on. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* | | | main: Correct header orderSimon Glass2013-06-04-15/+4
| | | | | | | | | | | | | | | | | | | | | | | | The headers are a bit out of order, so fix them. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | main: Fix typos and checkpatch warnings in command line readingSimon Glass2013-06-04-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a few over-long lines and other checkpatch problems in this area of the code. Prepare the ground for the next patch by tidying these up. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* | | | main: Use get/setenv_ulong()Simon Glass2013-06-04-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions are now available, so use them to avoid extra code here. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* | | | main: Move boot_delay code into its own functionSimon Glass2013-06-04-67/+70
| | | | | | | | | | | | | | | | | | | | | | | | Move this code into its own function, since it clutters up main_loop(). Signed-off-by: Simon Glass <sjg@chromium.org>
* | | | main: Separate out the two abortboot() functionsSimon Glass2013-06-04-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two implementations of abortboot(). Turn these into two separate functions, and create a single abortboot() which calls either one or the other. Also it seems that nothing uses abortboot() outside main, so make it static. At this point there is no further use of CONFIG_MENU in main.c. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* | | | net: Add prototype for update_tftpSimon Glass2013-06-04-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This function should be declared in net.h. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>