summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2015-08-31dm: tpm: Add a 'tpmtest' commandSimon Glass
These tests come from Chrome OS code. They are not particularly tidy but can be useful for checking that the TPM is behaving correctly. Some knowledge of TPM operation is required to use these. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Christophe Ricard<christophe-h.ricard@st.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2015-08-31tpm: Add a 'tpm info' commandSimon Glass
Add a command to display basic information about a TPM such as the model and open/close state. This can be useful for debugging. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Christophe Ricard <christophe-h.ricard@st.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2015-08-31tpm: Check that parse_byte_string() has data to parseSimon Glass
Rather then crashing when there is no data, print an error. The error is printed by the caller to parse_byte_string(). Acked-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2015-08-31tpm: Report tpm errors on the command lineSimon Glass
When a 'tpm' command fails, we set the return code but give no indication of failure. This can be confusing. Add an error message when any tpm command fails. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Christophe Ricard<christophe-h.ricard@st.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2015-08-31dm: i2c: Add a command to adjust the offset lengthSimon Glass
I2C chips can support a register offset, with registers accessible by sending this offset as the first part of any read or write transaction. Most I2C chips have a single byte offset, thus the offset length is 1. This provides access for up 256 registers. However other offset lengths are supported, including 0. Add a command to provide access to the offset length from the command line. This allows the offset length to be read or written. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Christophe Ricard<christophe-h.ricard@st.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2015-08-31dm: tpm: Convert the TPM command and library to driver modelSimon Glass
Add driver model support to the TPM command and the TPM library. Both support only a single TPM at present. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Christophe Ricard<christophe-h.ricard@st.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2015-08-31tpm: Add Kconfig options for TPMsSimon Glass
Add new Kconfig options for TPMs in preparation for moving boards to use Kconfig for TPM configuration. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Christophe Ricard<christophe-h.ricard@st.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2015-08-28mtd/nand/ubi: assortment of alignment fixesMarcel Ziswiler
Various U-Boot adoptions/extensions to MTD/NAND/UBI did not take buffer alignment into account which led to failures of the following form: ERROR: v7_dcache_inval_range - start address is not aligned - 0x1f7f0108 ERROR: v7_dcache_inval_range - stop address is not aligned - 0x1f7f1108 Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Scott Wood <scottwood@freescale.com> [trini: Add __UBOOT__ hunk to lib/zlib/zutil.c due to malloc.h in common.h] Signed-off-by: Tom Rini <trini@konsulko.com>
2015-08-28env_mmc: Properly prefix mmc errors with '!'Hans de Goede
The set_default_env() function from env_common.c expects either a fully formatted error msg, e.g.: "## Resetting to default environment\n" or an error msg prefixed with an !, in which case it will format it. Fix the init_mmc_for_env() error messages to be prefixed with a ! this changes the bootup-log on sunxi when no mmc card is found from: MMC: SUNXI SD/MMC: 0 No MMC card foundIn: serial Out: serial To: MMC: SUNXI SD/MMC: 0 *** Warning - No MMC card found, using default environment In: serial Out: serial Which clearly is how things should look. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-08-28malloc_simple: Correct the alignment logic in memalign_simple()Simon Glass
This should use the align parameter, not bytes. Natural alignment is one use case but should not be the only one supported by this function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2015-08-28NDS32: Generic Board Support and UnsupportKun-Hua Huang
Add nds32 ag101p generic board support. Signed-off-by: Kun-Hua Huang <kunhua@andestech.com>
2015-08-28image: Fix loop condition to avoid warningThierry Reding
GCC 5.1 starts warning for comparisons such as !a > 0, assuming that the negation was meant to apply to the whole expression rather than just the left operand. Indeed the comparison in the FIT loadable code is confusingly written, though it does end up doing the right thing. Rewrite the condition to be more explicit, that is, iterate over strings until they're exhausted. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-08-26x86: fsp: Delay x86_fsp_init() call a little bitBin Meng
Move x86_fsp_init() call after initf_malloc() so that we can fix up the gd->malloc_limit later. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-18of: clean up OF_CONTROL ifdef conditionalsMasahiro Yamada
We have flipped CONFIG_SPL_DISABLE_OF_CONTROL. We have cleansing devices, $(SPL_) and CONFIG_IS_ENABLED(), so we are ready to clear away the ugly logic in include/fdtdec.h: #ifdef CONFIG_OF_CONTROL # if defined(CONFIG_SPL_BUILD) && !defined(SPL_OF_CONTROL) # define OF_CONTROL 0 # else # define OF_CONTROL 1 # endif #else # define OF_CONTROL 0 #endif Now CONFIG_IS_ENABLED(OF_CONTROL) is the substitute. It refers to CONFIG_OF_CONTROL for U-boot proper and CONFIG_SPL_OF_CONTROL for SPL. Also, we no longer have to cancel CONFIG_OF_CONTROL in include/config_uncmd_spl.h and scripts/Makefile.spl. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
2015-08-18of: flip CONFIG_SPL_DISABLE_OF_CONTROL into CONFIG_SPL_OF_CONTROLMasahiro Yamada
As we discussed a couple of times, negative CONFIG options make our life difficult; CONFIG_SYS_NO_FLASH, CONFIG_SYS_DCACHE_OFF, ... and here is another one. Now, there are three boards enabling OF_CONTROL on SPL: - socfpga_arria5_defconfig - socfpga_cyclone5_defconfig - socfpga_socrates_defconfig This commit adds CONFIG_SPL_OF_CONTROL for them and deletes CONFIG_SPL_DISABLE_OF_CONTROL from the other boards to invert the logic. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-08-18Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini
2015-08-17Revert "Align global_data to a 16-byte boundary"Simon Glass
This causes widespread breakage due to the operation of the low-level code in crt0.S and cro0_64.S for ARM at least. The fix is not complicated but it seems safer to revert this for now. This reverts commit 2afddae07523f23f77acd066ad1719f53d289f98. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-17env: use cache line aligned memory for flash readRavi Babu
Use memalign() with ARCH_DMA_MINALIGN to allocate read buffers. This is required because, flash drivers may use DMA for read operations and may have to invalidate the buffer before read. Signed-off-by: Ravi Babu <ravibabu@ti.com> Signed-off-by: Vignesh R <vigneshr@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Jagan Teki <jteki@openedev.com> Tested-by: Jagan Teki <jteki@openedev.com>
2015-08-17sf: allocate cache aligned buffers to copy from flashRavi Babu
Use memalign() with ARCH_DMA_MINALIGN to allocate read buffers. This is required because, flash drivers may use DMA for read operations and may have to invalidate the buffer before read. Signed-off-by: Ravi Babu <ravibabu@ti.com> Signed-off-by: Vignesh R <vigneshr@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Jagan Teki <jteki@openedev.com> Tested-by: Jagan Teki <jteki@openedev.com>
2015-08-14x86: Switch to using generic global_data setupSimon Glass
There is quite a bit of assembler code that can be removed if we use the generic global_data setup. Less arch-specific code makes it easier to add new features and maintain the start-up code. Drop the unneeded code and adjust the hooks in board_f.c to cope. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-14Allow arch-specific setting of global_data in board_init_f_mem()Simon Glass
At present we have a simple assignment to gd. With some archs this is implemented as a register or through some other means; a simple assignment does not suit in all cases. Change this to a function and add documentation to describe how this all works. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <yorksun@freescale.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-14Align global_data to a 16-byte boundarySimon Glass
Some archs like to have larger alignment for their global data. Use 16 bytes which suits all current archs. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-14common: Display >=4GiB memory bank sizeBin Meng
bd->bi_dram[] has both start address and size defined as 32-bit, which is not the case on some platforms where >=4GiB memory bank is used. Change them to support such memory banks. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-13image-fdt.c: store returned error valueMax Krummenacher
This fixes the following warning (and the runtime error reporting): ../common/image-fdt.c:491:4: warning: 'fdt_ret' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-13generic-board: allow showing custom board infoMarcel Ziswiler
Allow showing custom board info from a checkboard() function being implemented if CONFIG_CUSTOM_BOARDINFO is specified. Previously the device tree model was always displayed not taking any CONFIG_CUSTOM_BOARDINFO into account. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-08-13common/lcd_console: fix console/logo regressionMarcel Ziswiler
The following commit changed the order of the column vs. row parameter to the lcd_init_console() function but missed actually changing it as well the second time it is called from lcd_clear() which resulted in a garbled text console which this patch fixes. commit 604c7d4a5a3cf70949f6e6094bf0d52ee3b4804d common/lcd_console: introduce display/framebuffer rotation Tested on Colibri T20 with my latest assortment of tegra fixes/enhancements patch set. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-13kconfig: add config option for shell promptNikita Kiryanov
Add option to set shell prompt string from menuconfig and migrate boards globally. The migration is done as follows: - Boards that explicitly and unconditionally set CONFIG_SYS_PROMPT had the entry moved to their defconfig files. - Boards that defined some kind of #ifdef logic which selects the CONFIG_SYS_PROMPT (for example qemu-mips) got an #undef CONFIG_SYS_PROMPT right before the #ifdef logic and were left alone. - This change forces CONFIG_SYS_PROMPT to be a per board decision, and thus CONFIG_SYS_PROMPT was removed from all <soc>_common.h and <arch>_common.h files. This results in a streamlined default value across platforms, and includes the following files: spear-common, sunxi-common, mv-common, ti_armv7_common, tegra-common, at91-sama5_common, and zynq-common. - Boards that relied on <arch/soc>_common.h values of CONFIG_SYS_PROMPT were not updated in their respective defconfig files under the assumption that since they did not explicitly define a value, they're fine with whatever the default is. - On the other hand, boards that relied on a value defined in some <boards>_common.h file such as woodburn_common, rpi-common, bur_am335x_common, ls2085a_common, siemens_am33x_common, and omap3_evm_common, had their values moved to the respective defconfig files. - The define V_PROMPT was removed, since it is not used anywhere except for assigning a value for CONFIG_SYS_PROMPT. Cc: Tom Rini <trini@konsulko.com> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> [trini: Add spring, sniper, smartweb to conversion] Signed-off-by: Tom Rini <trini@konsulko.com>
2015-08-12common/cmd_source.c: Fix the source command failure under 64-bit platformGong Qianyu
Modify the data pointer type from ulong* to u32*. For arm64 type "ulong" could be 64-bit. Then in line 89 of common/cmd_source.c: "while (*data++);" data will point to the next 64 bits each time. As the uImage file generated by mkimage tool keeps the same data format in either 32-bit or 64-bit platform, the difference would cause failure in 64-bit platform. Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com>
2015-08-12spl: Fix compile warning for arm64Gong Qianyu
Make the cast explicit for "warning: cast to pointer from integer of different size". Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com>
2015-08-12image: fix Android ramdisk support when dtb is specifiedRob Herring
If a dtb is specified on the command-line, the Android boot image ramdisk will not be found. Fix this so that we can specify the ramdisk address and dtb address. The syntax is to enter the Android boot image address for both the kernel and ramdisk. Signed-off-by: Rob Herring <robh@kernel.org>
2015-08-12spl, common, serial: build SPL without serial supportHeiko Schocher
This patch enables building SPL without CONFIG_SPL_SERIAL_SUPPORT support. Signed-off-by: Heiko Schocher <hs@denx.de> [trini: Ensure we build arch/arm/imx-common on mx28] Signed-off-by: Tom Rini <trini@konsulko.com>
2015-08-05dm: pmic: Display the regulator limits on errorSimon Glass
When a regulator command cannot honour the requested voltage, display the limits to try to be helpful. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
2015-08-05dm: usb: fix USB Ethernet without CONFIG_DM_ETH regressionMarcel Ziswiler
The following commit enforces CONFIG_DM_ETH for USB Ethernet which breaks any board using CONFIG_USB_HOST_ETHER without CONFIG_DM_ETH which this patch fixes. commit 69559093f6173dcfcb041df0995063bdbd07d49b dm: usb: Avoid using USB ethernet with CONFIG_DM_USB and no DM_ETH Tested on Colibri T20/T30 as well as Apalis T30 with CONFIG_USB_HOST_ETHER and CONFIG_USB_ETHER_ASIX enabled and a LevelOne USB-0301 ASIX AX88772 dongle. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-05Merge git://git.denx.de/u-boot-x86Tom Rini
2015-08-05usb: Fix device detection codeMarek Vasut
The code in question polls an USB port status via USB_REQ_GET_STATUS to determine whether there is a device on the port or not. The way to figure that out is to check two bits. Those are wPortChange[0] and wPortStatus[0]. The wPortChange[0] indicates whether some kind of a connection status change happened on a port (a device was plugged or unplugged). The wPortStatus[0] bit indicates the status of the connection (plugged or unplugged). The current code tests whether wPortChange[0] == wPortStatus[0] and if that's the case, considers the loop polling for the presence of a USB device on port finished. This works for most USB sticks, since they come up really quickly and trigger the USB port change detection before the first iteration of the detection loop happens. Thus, both wPortChange[0] and wPortStatus[0] are set to 1 and thus equal. The loop is existed in it's first iteration and the stick is detected correctly. The problem is with some obscure USB sticks, which take some time before they pop up on the bus after the port was enabled. In this case, both the wPortChange[0] and wPortStatus[0] are 0. They are equal again, so the loop again exits in the first iteration, but this is incorrect, as such USB stick didn't have the opportunity to get detected on the bus. Rework the code such, that it checks for wPortChange[0] first to test if any connection change happened at all. If no change occured, keep polling. If a change did occur, test the wPortStatus[0] to see there is some device present on the port and only if this is the case, break out of the polling loop. This patch also trims down the duration of the polling loop from 10s per port to 1s per port. This is still annoyingly long, but there is no better option in case of U-Boot unfortunatelly. This change will most likely increase the duration of 'usb start' on some platforms, but this is needed to fix a bug. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Hans de Goede <hdegoede@redhat.com>
2015-08-05efi: Add a command to display the memory mapSimon Glass
The EFI memory map is passed from the stub to U-Boot in a table. Add a command to display it in a vaguely readable fashion. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested on QEMU Tested-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05Add a way to skip relocationSimon Glass
When running U-Boot as an EFI application we cannot relocate since we do not have relocation information. U-Boot has already been relocated to a suitable address. Add a global_data flag to control skipping relocation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05efi: Avoid using non-existent text baseBen Stoltz
When U-Boot runs as an EFI application is does not have a definition of CONFIG_SYS_TEXT_BASE. U-Boot is a relocatable application and the relocation is done by EFI. U-Boot can be loaded at any address. This is similar to how sandbox works. Adjust the early board init to deal with this. Signed-off-by: Ben Stoltz <stoltz@google.com> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05common: command add '\n' for debug msgPeng Fan
Add '\n' for debug msg. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Tom Rini <trini@konsulko.com> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-05common: Print nothing in the __weak checkboard()Bin Meng
Do not print confusing "Board: Unknown" during boot. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-07-29Merge branch 'master' of git://git.denx.de/u-boot-tegraTom Rini
2015-07-28Merge branch 'zynq' of git://www.denx.de/git/u-boot-microblazeTom Rini
2015-07-28cmd_mp: Add support for showing all CPU status by one commandMichal Simek
Use one command for showing overall CPU status than several without knowing how many cpus is available in the system. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2015-07-27pxe: add AArch64 image supportStephen Warren
The sysboot and pxe commands currently support either U-Boot formats or raw zImages. Add support for the AArch64 Linux port's native image format too. As with zImage support, there is no auto-detection of the native image format. Rather, if the image is auto-detected as a U-Boot format, U-Boot will try to interpret it as such. Otherwise, U-Boot will fall back to a raw/native image format, if one is enabled. My belief is that CONFIG_CMD_BOOTZ won't ever be enabled for any AArch64 port, hence there's never a need to differentiate between CONFIG_CMD_ _BOOTI and _BOOTZ at run-time; compile-time will do. Even if this isn't true, we want to prefer _BOOTI over _BOOTZ when defined, since _BOOTI is definitely the native format for AArch64. Change-Id: I83c5cc7566032afd72516de46f4e5eb7a780284a Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2015-07-27generic_board: Call "checkboard" even though the root node has a "model" ↵Haikun.Wang@freescale.com
property In case of enable CONFIG_OF_CONTROL and has a "model" property in the root node, the board special "checkboard" will not be called. Usually we show some useful version information in the function. This patch enable call "checkboard" in any case. It is not conflicting with showing "model" at the same time. For example on LS2085AQDS: Showing "model" only: Model: Freescale Layerscape 2085a QDS Board Showing "checkboard" only: Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4 Showing both: Model: Freescale Layerscape 2085a QDS Board Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4 Signed-off-by: Haikun Wang <haikun.wang@freescale.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-07-24Merge git://git.denx.de/u-boot-usbTom Rini
2015-07-24spl: spl_mmc: Add option to boot from a MMC partition with offsetStefan Roese
This patch introduces the option to boot from a MMC card parition with an offset. This can be done by using both defines together: define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 1 define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR ((160 << 10) / 512) The example above loads the main U-Boot at offset 160KiB from the MMC partition 1. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Luka Perkov <luka.perkov@sartura.hr> Cc: Dirk Eibach <eibach@gdsys.de> Cc: Tom Rini <trini@konsulko.com>
2015-07-22fastboot: Dynamic controller index for usb_gadget_handle_interruptsPaul Kocialkowski
Since we're now using a dynamic controller index for fastboot too, usb_gadget_handle_interrupts should be using it instead of 0 (despite the fact that it's currently not being used at all in the musb-new implementation). Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-07-22usb: board_usb_init and board_usb_cleanup calls in the fastboot commandPaul Kocialkowski
Each USB download function command calls board_usb_init before registering the USB gadget and board_usb_cleanup after de-registering it. On devices currently using fasboot, musb-new is usually initialized earlier, but some other boards might need the board_usb_init call to properly initialize musb-new. This requires adding an argument (the USB controller index) to the fastboot command, as it is currently done with other USB download gadget functions. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Test HW: Odroid_XU3 (Exynos5422), trats (Exynos4210)
2015-07-21dm: usb: Adjust the USB_DEVICE() macro namingSimon Glass
In Linux USB_DEVICE() is used to declare a USB device by vendor/device ID. We should follow the same convention in U-Boot. Rename the existing USB_DEVICE() macro to U_BOOT_USB_DEVICE() and bring in the USB_DEVICE() macro from Linux for use in U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>