summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Implement generalised RSA public exponents for verified bootMichael van der Westhuizen2014-08-095-10/+158
| | | | | | | | | | | | | | | | | | | | | | | | Remove the verified boot limitation that only allows a single RSA public exponent of 65537 (F4). This change allows use with existing PKI infrastructure and has been tested with HSM-based PKI. Change the configuration OF tree format to store the RSA public exponent as a 64 bit integer and implement backward compatibility for verified boot configuration trees without this extra field. Parameterise vboot_test.sh to test different public exponents. Mathematics and other hard work by Andrew Bott. Tested with the following public exponents: 3, 5, 17, 257, 39981, 50457, 65537 and 4294967297. Signed-off-by: Andrew Bott <Andrew.Bott@ipaccess.com> Signed-off-by: Andrew Wishart <Andrew.Wishart@ipaccess.com> Signed-off-by: Neil Piercy <Neil.Piercy@ipaccess.com> Signed-off-by: Michael van der Westhuizen <michael@smart-africa.com> Cc: Simon Glass <sjg@chromium.org>
* serial: sh: Add support External Clock modeNobuhiro Iwamatsu2014-08-092-3/+9
| | | | | | | | | R8A7780 and R7A7791 of rmobile supports External Clock mode, and these uses different from Internal Clock mode registers and calculations to the baud rate setting. This adds function for External Clock mode. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* serial: sh: Add support DL and CKS register for R8A7794Nobuhiro Iwamatsu2014-08-091-1/+2
| | | | | | | | R8A7794 has DL and CKS register, and these registers are used in external clock mode. This adds support these for R8A7794. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* usb: ehci: rmobile: Remove xHCI addressNobuhiro Iwamatsu2014-08-093-5/+2
| | | | | | | | echi-rmobile does not support xHCI. This removes xHCI address from address table. And this revise a value of CONFIG_USB_MAX_CONTROLLER_COUNT for lager board and koelsh board. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
* usb: ehci: rmobile: Add support R8A7794Nobuhiro Iwamatsu2014-08-091-0/+6
| | | | | | | R8A7794 has same IP of USB controller as R8A7790 and R8A7791. This addes support for R8A7794. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
* dfu: fix readback buffer overflow testStephen Warren2014-08-091-1/+1
| | | | | | | The buffer is too small if it's < size to read, not if it's <= the size. This fixes the 1MB test case on Tegra, which has a 1MB buffer. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* test: dfu: add some more test casesStephen Warren2014-08-091-1/+1
| | | | | | | | On Tegra, the DFU buffer size is 1M. Consequently, the 8M test always fails. Add tests for the 1M size, and one byte less as a corner case, so that some large tests are executed and expected to pass. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* test: dfu: cleanup before executionStephen Warren2014-08-091-0/+1
| | | | | | | | | Call cleanup() before running tests too. If a previous test was CTRL-C'd some stale files may have been left around. dfu-util refuses to receive a file to a filename that already exists, which results in false test failures if the files aren't cleaned up first. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* thor: defer parsing of device string to IO backendLukasz Majewski2014-08-091-3/+3
| | | | | | | | | | | | | Commit d4f5ef59cc7 "dfu: defer parsing of device string to IO backend" changed the function signature of dfu_init_env_entities(). Adjust cmd_thordown.c to match that change. Also, apply the same change as commit d6d37d737b58e "dfu: free entities when parsing fails" to cmd_thordown.c. Fixes: d4f5ef59cc7 ("dfu: defer parsing of device string to IO backend") Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* test:dfu: README file updateLukasz Majewski2014-08-091-3/+8
| | | | Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
* test: dfu: script enhancementsStephen Warren2014-08-093-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Various misc enhancements to dfu_gadget_test.sh: * After every write (download), perform a write to a different file with different data. This ensures that the DFU buffer's content is replaced, so that if the read (upload) succeeds, we know that the correct data was actually read from the storage device, rather than simply being left over in the DFU buffer. This requires two alt setting names to be passed to the script, and a dummy data file to be generated by dfu_gadget_test_init.sh. * Fix the assumption that dfu_gadget_test.sh is run from the directory that contains it, by cd'ing to that directory before invoking ./dfu_gadget_test_init.sh. * Use $DIR$RCV_DIR consistently, rather than using plain $RCV_DIR in some places. * Add 959, 961 test file sizes, to be consistent with having one more than and one less than all the other "round" sizes 64, 128, and 4096. * Remove references to $BKP_DIR from dfu_gadget_test_init.sh, since it isn't used. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* test:dfu: Add test scripts for testing DFU regressionLukasz Majewski2014-08-093-0/+152
| | | | | | | | | | This commit adds test scripts for testing if any commit has introduced regression to the DFU subsystem. It uses md5 to test if sent and received file is correct. The test detailed description is available at README file. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
* dfu: add SF backendStephen Warren2014-08-094-0/+165
| | | | | | This allows SPI Flash to be programmed using DFU. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* dfu: add free_entity() to struct dfu_entityStephen Warren2014-08-092-0/+5
| | | | | | | | This allows the backend to free any resources allocated during the relevant dfu_fill_entity_*() call. This will soon be used by the SF backend. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* dfu: allow backend to specify a maximum buffer sizeStephen Warren2014-08-093-8/+13
| | | | | | | | | | | | CONFIG_SYS_DFU_DATA_BUF_SIZE may be large to allow for FAT/ext layouts to transfer large files. However, this means that individual write operations will take a long time. Allow backends to specify a maximum buffer size, so that each write operation is limited to a smaller data block. This prevents the DFU protocol from timing out when e.g. writing to SPI flash. I would guess that NAND might benefit from setting this value too, but I can't test that. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* dfu: defer parsing of device string to IO backendStephen Warren2014-08-096-32/+38
| | | | | | | | | | | | | | Devices are not all identified by a single integer. To support this, defer the parsing of the device string to the IO backed, so that it can apply the appropriate rules. SPI devices are specified as controller:chip_select. SPI/SF support will be added soon. MMC devices can also be specified as controller[.hwpart][:partition] in many commands, although we don't support that syntax in DFU. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* dfu: add write error handlingStephen Warren2014-08-092-22/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix calls to dfu_write() and dfu_flush() to detect errors in the I/O itself. This could happen due to problems with the storage medium, or simply when trying to write a FAT/ext file that is larger than the buffer dfu_mmc.c maintains for this purpose. Signal the error by switching the DFU state/status. This will be picked up by the DFU client when it sends the next DFU request. Note that errors can't simply be returned from e.g. dnload_request_complete(), since that function has no way to pass errors back to the DFU client; a call to dnload_request_complete() simply means that a USB OUT completed. This error state/status needs to be cleared when the next DFU client connects. While there is a DFU_CLRSTATUS request, no DFU client seems to send this. Hence, clear this when selecting the USB alternate setting on the USB interface. Finally, dfu.c relies on a call to dfu_flush() to clear up the internal state of the write transaction. Now that errors in dfu_write() are detected, dfu_flush() may no longer be called for every transaction. Separate out the cleanup code into a new function, and call it whenever dfu_write() fails, as well as from any call to dfu_flush(). Signed-off-by: Stephen Warren <swarren@nvidia.com>
* dfu: fix some issues with reads/uploadsStephen Warren2014-08-095-21/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DFU read support appears to rely upon dfu->read_medium() updating the passed-by-reference len parameter to indicate the remaining size available for reading. dfu_read_medium_mmc() never does this, and the implementation of dfu_read_medium_nand() will only work if called just once; it hard-codes the value to the total size of the NAND device irrespective of read offset. I believe that overloading dfu->read_medium() is confusing. As such, this patch introduces a new function dfu->get_medium_size() which can be used to explicitly find out the medium size, and nothing else. dfu_read() is modified to use this function to set the initial value for dfu->r_left, rather than attempting to use the side-effects of dfu->read_medium() for this purpose. Due to this change, dfu_read() must initially set dfu->b_left to 0, since no data has been read. dfu_read_buffer_fill() must also be modified not to adjust dfu->r_left when simply copying data from dfu->i_buf_start to the upload request buffer. r_left represents the amount of data left to be read from HW. That value is not affected by the memcpy(), but only by calls to dfu->read_medium(). After this change, I can read from either a 4MB or 1.5MB chunk of a 4MB eMMC boot partion with CONFIG_SYS_DFU_DATA_BUF_SIZE==1MB. Without this change, attempting to do that would result in DFU read returning no data at all due to r_left never being set. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* fs: implement size/fatsize/ext4sizeStephen Warren2014-08-0911-0/+110
| | | | | | | | | | 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>
* Prepare v2014.10-rc1Tom Rini2014-08-061-2/+2
| | | | Signed-off-by: Tom Rini <trini@ti.com>
* Change Andy Fleming's email addressAndy Fleming2014-08-065-5/+5
| | | | | | | Messages to afleming@freescale.com now bounce, and should be directed to my personal address at afleming@gmail.com Signed-off-by: Andy Fleming <afleming@gmail.com>
* The _config target is not present anymore, mention _defconfig insteadHolger Freyther2014-08-061-11/+11
| | | | | The _config part is gone for sure, the _defconfig target could at least work. I have not verified this for all targets though.
* git-mailrc: add a kconfig aliasStephen Warren2014-08-061-0/+2
| | | | | | | | It's easier to Cc Masahiro on Kconfig-related changes with a git-mailrc alias. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* doc: README.SPL: adjust for Kbuild and KconfigMasahiro Yamada2014-08-061-22/+6
| | | | | | Reflect the latest build system to doc/README.SPL. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* doc: delete README.ARM-SoCMasahiro Yamada2014-08-061-31/+0
| | | | | | This document is too old and useless. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2014-08-067-8/+31
|\
| * spi, spi_mxc: do not hang in spi_xchg_singleHeiko Schocher2014-08-062-2/+19
| | | | | | | | | | | | | | | | | | if status register do never set MXC_CSPICTRL_TC, spi_xchg_single endless loops. Add a timeout here to prevent endless hang. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Dirk Behme <dirk.behme@gmail.com> Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
| * spi: Support half-duplex mode in FDT decodeSimon Glass2014-08-062-0/+4
| | | | | | | | | | | | | | | | This parameter should also be supported. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Ajay Kumar <ajaykumar.rs@samsung.com> Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
| * exynos: spi: Fix calculation of SPI transaction start timeSimon Glass2014-08-061-4/+5
| | | | | | | | | | | | | | | | | | | | The SPI transaction delay is supposed to be measured from the end of one transaction to the start of the next. The code does not work that way, so fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Ajay Kumar <ajaykumar.rs@samsung.com> Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
| * cros_ec: Fix two bugs in the SPI implementationSimon Glass2014-08-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | An incorrect message version is passed to the EC in some cases and the parameters of one function are switched. Fix these problems. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Ajay Kumar <ajaykumar.rs@samsung.com> Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
| * sf: sf_ops: Stop leaking memoryMarek Vasut2014-08-061-0/+1
| | | | | | | | | | | | | | | | | | It's usually a common pattern to free() the memory that we allocated. Implement this here to stop leaking memory. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxTom Rini2014-08-069-1/+83
|\ \
| * | kmp204x: prepare to use CPU watchdogBoschung, Rainer2014-08-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch configures the qrio to trigger a core reset on a CPU reset request. Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> Reviewed-by: York Sun <yorksun@freescale.com>
| * | kmp204x/qrio: support for setting the CPU reset request modeBoschung, Rainer2014-08-012-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | To acheive this, the qrio_uprstreq() function that sets the UPRSTREQN flag in the qrio RESCNF reg is added. Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> Reviewed-by: York Sun <yorksun@freescale.com>
| * | kmp204x: set CPU watchdog reset reason flagBoschung, Rainer2014-08-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check the core timer status register (TSR) for watchdog reset, and and set the QRIO's reset reason flag REASON1[0] accordingly. This allows the appliction SW to identify the cpu watchdog as a reset reason, by setting the REASON1[0] flag in the QRIO. Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> Reviewed-by: York Sun <yorksun@freescale.com>
| * | kmp204x/qrio: prepare support for the CPU watchdog reset reasonBoschung, Rainer2014-08-012-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | To achieve this, the qrio_cpuwd_flag() function that sets the CPU watchdog flag in the REASON1 reg is added. Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> Reviewed-by: York Sun <yorksun@freescale.com>
| * | kmp204x: CPU watchdog enabledBoschung, Rainer2014-08-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | The booting of the board is now protected by the CPU watchdog. A failure during the boot phase will end up in board reset. Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> Reviewed-by: York Sun <yorksun@freescale.com>
| * | powerpc: mpc85xx watchdog init added to init_funcBoschung, Rainer2014-08-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_WATCHDOG is defined the board initialization just performs a WATCHDOG_RESET, an initialization of the watchdog is not done. This has been modified fot the MPC85xx, the board initialization calls its watchdog initialitzation allowing for full watchdog configuration very early in the boot phase. Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> Reviewed-by: York Sun <yorksun@freescale.com>
| * | mpc85xx: watchdog initialisation addedBoschung, Rainer2014-08-012-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | Function to inititialize the cpu watchdog added. Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> [York Sun: Add prototype in watchdog.h] Reviewed-by: York Sun <yorksun@freescale.com>
| * | powerpc: macros for e500mc timer regs addedBoschung, Rainer2014-08-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For e500mc cores the watchdog timer period has to be set by means of a 6bit value, that defines the bit of the timebase counter used to signal a watchdog timer exception on its 0 to 1 transition. The macro used to set the watchdog period TCR_WP, was redefined for e500mc to support 6 WP setting. The parameter (x) given to the macro specifies the prescaling factor of the time base clock (fTB): watchdog_period = 1/fTB * 2^x Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> Reviewed-by: York Sun <yorksun@freescale.com>
| * | mpc85xx: fix interrupt init to not affect watchdogBoschung, Rainer2014-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | TCR watchdog bit are overwritten when dec interrupt is enabled. This has been fixed with this patch. Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com> Reviewed-by: York Sun <yorksun@freescale.com>
* | | Merge http://git.denx.de/u-boot-dmTom Rini2014-08-043-0/+17
|\ \ \
| * | | arm: Support pre-relocation malloc()Simon Glass2014-08-042-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | Add support for re-relocation malloc() in arm's start-up code. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | arm: Set up global data before board_init_f()Simon Glass2014-08-042-0/+11
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present arm defines CONFIG_SYS_GENERIC_GLOBAL_DATA, meaning that the global_data pointer is set up in board_init_f(). However it is actually set up before this, it just isn't zeroed. If we zero the global data before calling board_init_f() then we don't need to define CONFIG_SYS_GENERIC_GLOBAL_DATA. Make this change (on arm32 only) to simplify the init process. I don't have the ability to test aarch64 yet. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Tom Rini <trini@ti.com>
* | | env_mmc: support env partition setup in runtimeDmitry Lifshitz2014-08-012-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add callback with __weak annotation to allow setup of environment partition number in runtime from a board file. Propagate mmc_switch_part() return value into init_mmc_for_env() instead of -1 in case of failure. Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
* | | env_mmc: add mmc_get_env_addr() prototypeDmitry Lifshitz2014-08-011-0/+6
| | | | | | | | | | | | | | | | | | | | | Add missing mmc_get_env_addr() prototype in environment.h Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
* | | MMC: atmel_mci: enable high speed mode supportBo Shen2014-08-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | If the MCI IP version >= 0x300, it supports hight speed mode option, this patch enable it. Signed-off-by: Bo Shen <voice.shen@atmel.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
* | | MMC: atmel_mci: add configuration register definitionBo Shen2014-08-011-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | Add configuration register definition, this register only exists on MCI IP version >= 0x300. Signed-off-by: Bo Shen <voice.shen@atmel.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
* | | MMC: atmel_mci: refactor setting the mode registerBo Shen2014-08-012-14/+46
| | | | | | | | | | | | | | | | | | | | | | | | The mode register is different between MCI IP version. So, according to MCI IP version to set the mode register. Signed-off-by: Bo Shen <voice.shen@atmel.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
* | | mmc/dw_mmc: Fix clock divider calculation error for bypass modeChin Liang See2014-08-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To fix the clock divider calculation error when the controller clock same as the operating frequency. This is known as bypass mode. In this mode, the divider should be 0. Signed-off-by: Chin Liang See <clsee@altera.com> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Rajeshwari Shinde <rajeshwari.s@samsung.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Mischa Jonker <mjonker@synopsys.com>
OpenPOWER on IntegriCloud