summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2015-01-30Merge branch 'master' of git://git.denx.de/u-boot-dmTom Rini
2015-01-30fpga: Extend dump descriptionMichal Simek
There are missing parameters in help which fpga dump command requires. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-01-30cmd: Fix gettime command helpBin Meng
Remove the additional ',' and '\n' from the gettime command help. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2015-01-29rsa: Use checksum algorithms from struct hash_algoRuchika Gupta
Currently the hash functions used in RSA are called directly from the sha1 and sha256 libraries. Change the RSA checksum library to use the progressive hash API's registered with struct hash_algo. This will allow the checksum library to use the hardware accelerated progressive hash API's once available. Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com> CC: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> (Fixed build error in am335x_boneblack_vboot due to duplicate CONFIG_DM) Change-Id: Ic44279432f88d4e8594c6e94feb1cfcae2443a54
2015-01-29Use hash.c in mkimageRuchika Gupta
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com> CC: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
2015-01-29hash: Add function to find hash_algo struct with progressive hashRuchika Gupta
The hash_algo structure has some implementations in which progressive hash API's are not defined. These are basically the hardware based implementations of SHA. An API is added to find the algo which has progressive hash API's defined. This can then be integrated with RSA checksum library which uses Progressive Hash API's. Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com> CC: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
2015-01-29Export redesignMartin Dorwig
this is an atempt to make the export of functions typesafe. I replaced the jumptable void ** by a struct (jt_funcs) with function pointers. The EXPORT_FUNC macro now has 3 fixed parameters and one variadic parameter The first is the name of the exported function, the rest of the parameters are used to format a functionpointer in the jumptable, the EXPORT_FUNC macros are expanded three times, 1. to declare the members of the struct 2. to initialize the structmember pointers 3. to call the functions in stubs.c Signed-off-by: Martin Dorwig <dorwig@tetronik.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> (resending to the list since my tweaks are not quite trivial)
2015-01-29dm: i2c: Provide an offset length parameter where neededSimon Glass
Rather than assuming that the chip offset length is 1, allow it to be provided. This allows chips that don't use the default offset length to be used (at present they are only supported by the command line 'i2c' command which sets the offset length explicitly). Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
2015-01-29dm: i2c: Rename driver model I2C functions to permit compatibilitySimon Glass
Add a dm_ prefix to driver model I2C functions so that we can keep the old ones around. This is a little unfortunate, but on reflection it is too difficult to change the API. We can undo this rename when most boards and drivers are converted to use driver model for I2C. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-29dm: demo: Add a simple GPIO demonstrationSimon Glass
Add a new 'demo light' command which uses GPIOs to control imaginary lights. Each light is assigned a bit number in the overall value. This provides an example driver for using the new GPIO API. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-29generic-board: show model name in board_init_f() tooMasahiro Yamada
The common/board_r.c has show_model_r() to display the model name if the DTB has a "model" property. It sounds useful to have a similar function in common/board_f.c too because most of the boards show their board name before relocation. Instead of implementing the same function in both common/board_f.c and common/board_r.c, let's split it up into common/show_board_info.c. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-01-29cmd_i2c: change variable type for 10bit addressing supportMasahiro Yamada
To store 10bit chip address, the variable type should not be uchar, but uint. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher<hs@denx.de>
2015-01-29common: bootm: Document fake bootm sub-commandMichal Simek
Fake option is enabled only when CONFIG_TRACE is enabled in common/bootm.c:do_boot_states(). Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-01-29dumpimage: fit: extract FIT imagesGuilherme Maciel Ferreira
The dumpimage is able to extract components contained in a FIT image: $ ./dumpimage -T flat_dt -i CONTAINER.ITB -p INDEX FILE The CONTAINER.ITB is a regular FIT container file. The INDEX is the poisition of the sub-image to be retrieved, and FILE is the file (path+name) to save the extracted sub-image. For example, given the following kernel.its to build a kernel.itb: /dts-v1/; / { ... images { kernel@1 { description = "Kernel 2.6.32-34"; data = /incbin/("/boot/vmlinuz-2.6.32-34-generic"); type = "kernel"; arch = "ppc"; os = "linux"; compression = "gzip"; load = <00000000>; entry = <00000000>; hash@1 { algo = "md5"; }; }; ... }; ... }; The dumpimage can extract the 'kernel@1' node through the following command: $ ./dumpimage -T flat_dt -i kernel.itb -p 0 kernel Extracted: Image 0 (kernel@1) Description: Kernel 2.6.32-34 Created: Wed Oct 22 15:50:26 2014 Type: Kernel Image Compression: gzip compressed Data Size: 4040128 Bytes = 3945.44 kB = 3.85 MB Architecture: PowerPC OS: Linux Load Address: 0x00000000 Entry Point: 0x00000000 Hash algo: md5 Hash value: 22352ad39bdc03e2e50f9cc28c1c3652 Which results in the file 'kernel' being exactly the same as '/boot/vmlinuz-2.6.32-34-generic'. Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2015-01-29imagetool: make the image_save_datafile() available to all image typesGuilherme Maciel Ferreira
Move the image_save_datafile() function from an U-Multi specific file (default_image.c) to a file common to all image types (image.c). And rename it to genimg_save_datafile(), to make clear it is useful for any image type. Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2015-01-29common: add cache flush to imxtract functionPieter Voorthuijsen
A cache flush is required when an image is extracted that is required on another core. Signed-off-by: Pieter Voorthuijsen <pieter.voorthuijsen@prodrive-technologies.com>
2015-01-29part: let list put the list in an environment variableSjoerd Simons
Add an optional third argument to the "part list" command which puts a space seperated list of valid partitions into the given environment variable. This is useful for allowing boot scripts to iterate of all partitions of a device. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Reviewed-by: Stephen Warren <swarren@nvidia.com>
2015-01-29fs: Add command to retrieve the filesystem typeSjoerd Simons
New command to determine the filesystem type of a given partition. Optionally stores the filesystem type in a environment variable. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Reviewed-by: Stephen Warren <swarren@nvidia.com>
2015-01-28lcd: fix console address is not initializedBo Shen
This commit 904672e (lcd: refactor lcd console stuff into its own file), which cause lcd console address is not initialized. This patch initialize the lcd console use the default value, will be update when splash screen is enabled. Signed-off-by: Bo Shen <voice.shen@atmel.com>
2015-01-28spl: Change printf to puts for "Unsupported boot-device"Stefan Roese
Microblaze currently doesn't use printf in SPL. So this one line was the only reference to it and resulted in the printf functionality to be pulled in. Exceeding the 4k size limit. Lets change the printf back to puts so that Microblaze is fixed again. The only drawback is that the detected boot-device number will not be printed. But this message alone should be helpful enough to get an idea where the boot process is broken. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Tom Rini <trini@ti.com> Cc: Michal Simek <michal.simek@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
2015-01-24Allow architecture-specific memory reservationSimon Glass
All memory to be reserved for use after relocation by adding a new call to perform this reservation. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-22Merge branch 'fpga' of git://www.denx.de/git/u-boot-microblazeTom Rini
2015-01-21fpga: Protect GZIP usage when LOADMK is enabledMichal Simek
For case where CMD_FPGA_LOADMK is enabled and GZIP disable. Warning log: common/built-in.o: In function `do_fpga': /mnt/disk/u-boot/common/cmd_fpga.c:218: undefined reference to `gunzip' Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-01-20Merge branch 'master' of git://git.denx.de/u-boot-mmcTom Rini
2015-01-19mmc: extend mmcinfo output to show partition write reliability settingsDiego Santa Cruz
This extends the mmcinfo hardware partition info output to show partitions with write reliability enabled with the "WRREL" string. If the partition does not have write reliability enabled the "WRREL" string is omitted; this is analogous to the ehhanced attribute. Example output: Device: OMAP SD/MMC Manufacturer ID: fe OEM: 14e Name: MMC16 Tran Speed: 52000000 Rd Block Len: 512 MMC version 4.41 High Capacity: Yes Capacity: 13.8 GiB Bus Width: 4-bit Erase Group Size: 8 MiB HC WP Group Size: 16 MiB User Capacity: 13.8 GiB ENH WRREL User Enhanced Start: 0 Bytes User Enhanced Size: 512 MiB Boot Capacity: 16 MiB ENH RPMB Capacity: 128 KiB ENH GP1 Capacity: 64 MiB ENH WRREL GP2 Capacity: 64 MiB ENH WRREL Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
2015-01-19mmc: extend the mmc hwpartition sub-command to change write reliabilityDiego Santa Cruz
This change extends the mmc hwpartition sub-command to change the per-partition write reliability settings. It also changes the syntax used for the enhanced user data area slightly to better accomodate the write reliability option. Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
2015-01-19mmc: add mmc hwpartition sub-command to do eMMC hardware partitioningDiego Santa Cruz
Adds the mmc hwpartition sub-command to perform eMMC hardware partitioning on an mmc device. The number of arguments can be large for a complex partitioning, but as the partitioning has to be done in one go it is difficult to make it simpler. Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
2015-01-19mmc: show the erase group size and HC WP group size in mmcinfo outputDiego Santa Cruz
This adds the erase group size and high-capacity WP group size to mmcinfo's output. The erase group size is necessary to properly align erase requests on eMMC. The high-capacity WP group size is necessary to properly align partitions on eMMC. Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
2015-01-19mmc: display size and start of eMMC enhanced user data area in mmcinfoDiego Santa Cruz
This adds output to show the eMMC enhanced user data area size and offset along with the partition sizes in mmcinfo's output. Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
2015-01-19mmc: skip mmcinfo partition info processing for eMMC < 4.41Diego Santa Cruz
eMMC partitions are defined as of eMMC 4.41, but mmcinfo process partition info for eMMC >= 4.0, change it to do it for >= 4.41 Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
2015-01-19mmc: make eMMC general purpose partition numbering match specDiego Santa Cruz
The eMMC spec numbers general purpose partitions starting at 1, but the mmcinfo output follows the internal numbering which starts at 0. Make the mmcinfo command output number partitions as in the eMMC spec to avoid confusion. Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
2015-01-19mmc: extend mmcinfo to show enhanced partition attributeDiego Santa Cruz
This extends the mmcinfo command's output to show which eMMC partitions have the enhanced attribute set. Note that the eMMC spec says that if the enhanced attribute is supported then the boot and RPMB partitions are of the enhanced type. The output of mmcinfo becomes: Device: OMAP SD/MMC Manufacturer ID: fe OEM: 14e Name: MMC16 Tran Speed: 52000000 Rd Block Len: 512 MMC version 4.41 High Capacity: Yes Capacity: 13.8 GiB Bus Width: 4-bit User Capacity: 13.8 GiB ENH Boot Capacity: 16 MiB ENH RPMB Capacity: 128 KiB ENH GP1 Capacity: 64 MiB ENH GP2 Capacity: 64 MiB ENH Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
2015-01-19mmc: show hardware partition sizes in mmcinfo outputDiego Santa Cruz
There is currently no command that will provide an overview of the hardware partitions present on an eMMC device, one has to switch to every partition via "mmc dev" and run mmcinfo for each to get the partition's capacity. This commit adds a few lines of output to mmcinfo with the sizes of the present partitions, like this: Device: OMAP SD/MMC Manufacturer ID: fe OEM: 14e Name: MMC16 Tran Speed: 52000000 Rd Block Len: 512 MMC version 4.41 High Capacity: Yes Capacity: 13.8 GiB Bus Width: 4-bit User Capacity: 13.8 GiB Boot Capacity: 16 MiB RPMB Capacity: 128 KiB GP1 Capacity: 64 MiB GP2 Capacity: 64 MiB panto: Minor edit removing superfluous parentheses. Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
2015-01-18musb-new: Fix reset sequence when in host modeHans de Goede
This commit fixes a number of issues with the reset sequence of musb-new in host mode: 1) Our usb device probe relies on a second device reset being done after the first descriptors read. Factor the musb reset code into a usb_reset_root_port function (and add this as an empty define for other controllers), and call this when a device has no parent. 2) Just like with normal usb controllers there needs to be a delay after reset, for normal usb controllers, this is handled in hub_port_reset, add a delay to usb_reset_root_port. 3) Sync the musb reset sequence with the upstream kernel, clear all bits of power except bits 4-7, and increase the time reset is asserted to 50 ms. With these fixes an usb keyboard I have now always enumerates properly, where as earlier it would only enumerare properly once every 5 tries. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-18usb: Do not log an error when no devices is plugged into a root-hub-less hcdHans de Goede
Before this commit u-boot would print the following on boot with musb and no usb device plugged in: starting USB... USB0: Port not available. USB error: all controllers failed lowlevel init This commit changes this to: starting USB... USB0: Port not available. Which is the correct thing to do since the low-level init went fine. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-18usb: Fix usb_kbd_deregister when console-muxing is usedHans de Goede
When iomuxing is used we must not only deregister the device with stdio.c, but also remove the reference to the device in the console_devices array used by console-muxing. Add a call to iomux_doenv to usb_kbd_deregister to update console_devices, which will drop the reference. This fixes the console filling with "Failed to enqueue URB to controller" messages after a "usb stop force", or when the USB keyboard is gone after a "usb reset". Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-18usb: Add an interval parameter to create_int_queueHans de Goede
Currently create_int_queue is only implemented by the ehci code, and that does not honor interrupt intervals, but other drivers which might also want to implement create_int_queue may honor intervals, so add an interval param. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-18USB: make "usb start" start usb only onceHans de Goede
Currently we've this magic in include/config_distro_bootcmd.h to avoid scanning the usb bus multiple times. And it does not work when also using an usb keyboard because then the preboot command has already scanned the bus, so we're still scanning it twice. This commit makes "usb start" only start usb if it is no already started, allowing us to remove all the magic for it from include/config_distro_bootcmd.h and just call it unconditionally. This also causes "usb start" and "usb reset" to actually do what their different names suggest, rather then both of them doing exactly the same. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-14Merge branch 'next' of git://git.denx.de/u-boot-videoTom Rini
2015-01-14spl: spl_nor: surround Linux-load code with #ifdef CONFIG_SPL_OS_BOOTMasahiro Yamada
If CONFIG_SPL_NOR_SUPPORT is defined, spl_nor_load_image() requires spl_start_uboot(), CONFIG_SYS_OS_BASE, CONFIG_SYS_SPL_ARGS_ADDR, CONFIG_SYS_FDT_BASE to be defined even if users just want to run U-Boot, not Linux. This is inconvenient. This patch is following the codying style of common/spl/spl_nand.c. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-01-14image: Enable OpenRTOS booting via fitImageMarek Vasut
Allow booting the OpenRTOS payloads via fitImage image type. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-01-14image: bootm: Add OpenRTOS image typeMarek Vasut
Add separate image type for the Wittenstein OpenRTOS . Signed-off-by: Marek Vasut <marex@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-01-14bootm: Factor out common parts of image decompression codeSimon Glass
Adjust the code so that the error reporting can all be done at the end, and is the same for each decompression method. Try to detect when decompression fails due to lack of space. Keep the behaviour of resetting on failure even though there should be no memory corruption now. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14bootm: Use print_decomp_msg() in all casesSimon Glass
Refactor to allow this function to be used to announce the image being loaded regardless of compression type and even when there is no decompression. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14bootm: Export bootm_decomp_image()Simon Glass
Export this function for testing. Also add a parameter so that values other than CONFIG_SYS_BOOTM_LEN can be used for the maximum uncompressed size. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14sandbox: Correct ordering of 'sb save' commandsSimon Glass
Prior to commit d455d87 there was an inconsistency between the position of the 'address' parameter in 'sb load' and 'sb save'. This was corrected but it broke some tests. Fix the tests and also the help for 'sb save'. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14bootm: Move compression progress/error messages into a functionSimon Glass
This code is repeated in several places, and does not detect a common fault where the image is too large. Move it into its own function and provide a more helpful messages in this case, for compression schemes which support this. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14common/memsize.c: Coding style cleanupWolfgang Denk
Prepare code to make later modifications checkpatch-clean. Signed-off-by: Wolfgang Denk <wd@denx.de>
2015-01-14console: Use pre-console buffer to get complete log on all consolesSiarhei Siamashka
Currently the pre-console buffer can accumulate early log messages and flush them to the serial console as soon as it becomes available. This patch just adds one more pre-console buffer flushing point and does all the same for the other consoles too. This is particularly useful for the vga/hdmi/lcd console, where we can see all the older messages now (except for the log messages from SPL). Naturally, we don't want to get an extra copy of the log messages on the serial console again at the second flushing point, so the serial console has to be explicitly filtered out. Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Tom Rini <trini@ti.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-14edid: Add an edid_check_checksum() helper functionHans de Goede
Add a helper function to check the checksum of an EDID data block. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Anatolij Gustschin <agust@denx.de>