summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-08-06dm: i2c: Add support for multiplexed I2C busesSimon Glass
Add a new I2C_MUX uclass. Devices in this class can multiplex between several I2C buses, selecting them one at a time for use by the system. The multiplexing mechanism is left to the driver to decide - it may be controlled by GPIOs, for example. The uclass supports only two methods: select() and deselect(). The current mux state is expected to be stored in the mux itself since it is the only thing that knows how to make things work. The mux can record the current state and then avoid switching unless it is necessary. So select() can be skipped if the mux is already in the correct state. Also deselect() can be made a nop if required. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-06dm: i2c: Add a function to transfer messagesSimon Glass
Sometimes it is useful to be able to transfer a raw I2C message. This happens when the chip address needs to be set manually, or when the data to be sent/received is in another buffer. Add a function to provide access to this. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
2015-08-06dm: i2c: Move definitions to the top of the header fileSimon Glass
Move the flags and struct definitions higher in the file so that we can reference them with functions declared in the driver model section. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
2015-08-06dm: i2c: Correct comment nits in dm_i2c_reg_read/write()Simon Glass
Add documentation for the @dev parameter. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
2015-08-06dm: i2c: Add a message debug functionSimon Glass
Add a way to dump the contents of an I2C message for debugging purposes. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
2015-08-06dm: core: Support finding a device by phandleSimon Glass
It is common for one node to reference another via a phandle. Add support for obtaining an attached device by this method. As an example, a node may have a 'power-supply' property which references a regulator, allowing the driver to turn on its power. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-06dm: 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-05configs: Remove CONFIG_SERIAL_MULTIStephen Warren
This config option isn't used anywhere at all. Remove all places that define/enable the option. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2015-08-05Merge git://git.denx.de/u-boot-x86Tom Rini
2015-08-05x86: Document how to write PIRQ information in the device treeBin Meng
Document the development flow on figuring out PIRQ information during the U-Boot porting. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-05pci: Remove DEBUG from pci_compat.cBin Meng
Remove DEBUG in drivers/pci/pci_compat.c. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
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-05net: asix: fix operation without eepromMarcel Ziswiler
This patch fixes operation of our on-board AX88772B chip without EEPROM but with a ethaddr coming from the regular U-Boot environment. This is a forward port of some remaining parts initially implemented by Antmicro. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Marek Vasut <marex@denx.de>
2015-08-05sunxi: Drop our own copy of the USB_KEYBOARD optionsHans de Goede
USB_KEYBOARD is now defined in drivers/usb/Kconfig, drop our own duplicate definition. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-08-05usb: USB storage-specific part ifdef in uclassPaul Kocialkowski
usb_stor_reset is only defined when USB storage support is enabled, thus the function is not declared when such support is missing. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-08-05sunxi: MUSB gadget config provisions, with fastboot and USB mass storage supportPaul Kocialkowski
This adds some config options to the sunxi-common config to enable the USB download gadget and the fastboot and USB mass storage functions. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-08-05musb: sunxi: Force EP0 on re-enableMaxime Ripard
Currently, the second use of a gadget will fail, while the first one works. Forcing the EP0 at every enable fix this issue. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-08-05sunxi: config update to stick with Kconfig changesPaul Kocialkowski
Now that some things were updated in Kconfig, they should be reflected on the sunxi-common config too. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-08-05sunxi: usb: USB_MUSB_SUNXI move to musb-new KconfigPaul Kocialkowski
Now that the musb-new driver has a Kconfig, we can move Kconfig options to enable controllers to it, so that it's easier in e.g. menuconfig. In addition, this allows declaring support for USB_MUSB_HOST/GADGET in defconfigs instead of the USB_MUSB_SUNXI controller, that will get selected automatically when needed. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-08-05usb: musb-new: Kconfig support for USB_MUSB_HOST and USB_MUSB_GADGETPaul Kocialkowski
Having MUSB_HOST and MUSB_GADGET in Kconfig allows more flexibility with regard to what Kconfig options to enable, such as USB_STORAGE or USB_KEYBOARD. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-08-05usb: musb-new: CONFIG_MUSB prefix replacement with CONFIG_USB_MUSBPaul Kocialkowski
USB-related options are usually prefixed with CONFIG_USB and platform-specific adaptation for the MUSB controller already have a CONFIG_USB_MUSB prefix, so this switches all MUSB-related options to a CONFIG_USB_MUSB prefix, for consistency. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-08-05usb: Generic USB Kconfig option, that fits both host and gadget and commentsPaul Kocialkowski
There is no particular reason why the USB Kconfig option should be specific to host mode. In prevision of adding MUSB host and gadget to Kconfig, this moves the title and help message of the USB Kconfig option to a more generic format. Adding comments to the usb Kconfig allows for a better separation and more readability in generated configs and in menuconfig. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-08-05usb: USB_ARCH_HAS_HCD Kconfig option removalPaul Kocialkowski
The USB_ARCH_HAS_HCD currently serves no purpose and adds some confusion to the required Kconfig options that are required to have USB support. Dropping it makes things easier and doesn't break anything, since it was unused anyways. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-08-05usb: dwc2: Call board_usb_init() from usb_lowlevel_init()Peter Griffin
This patch makes the dwc2 controller like ehci / ohci / xhci controllers by calling the board_usb_init() function from usb_lowlevel_init. This can then be implemented by specific platforms to initialise their USB hardware (phys / clocks etc). Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
2015-08-05efi: Add a README to explain how things workSimon Glass
Add some documentation on the EFI implementation in U-Boot. 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-05x86: Gracefully disable the vesa driver when running from EFISimon Glass
We cannot use this driver when running from EFI as we have no direct hardware access. In fact coreboot uses a different driver which uses tables provided by coreboot. So far it does not seem possible to use a normal video driver when booting from EFI. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: qemu: Support operation as an EFI payloadSimon Glass
Disable a few things which interfere with the EFI init. This allows QEMU to to boot into EFI, load a U-Boot payload then boot to the U-Boot prompt. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: baytrail: Support operation as an EFI payloadSimon Glass
Disable a few things which interfere with the EFI init. This allows the Minnowboard MAX to boot into EFI, load a U-Boot payload then boot to the U-Boot prompt. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Add helper code for running from EFISimon Glass
When U-Boot is running from EFI some of the x86 init is replaced with EFI-specific init. For example, since DRAM has already been set up, we only need to find it, not init it. Add these functions so that boards can easily allow booting from EFI if required. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Handle running as EFI payloadSimon Glass
When U-Boot runs as an EFI payload it needs to avoid setting up the CPU again. Also U-Boot currently does not handle interrupts for many devices, so run with interrupts disabled. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.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-05efi: Add functions for decoding the EFI tablesSimon Glass
The EFI stub can pass a table to U-Boot with information about the memory map Potentially other things will follow. Add a way to access this table. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Add support for passing tables into U-BootSimon Glass
The EFI stub provides information to U-Boot in a table. This includes the memory map which is needed to decide where to relocate U-Boot. Collect this information in the early init code and store it in global_data. Fix up the BIST code at the same time since we don't have it when booting from EFI and can assume it is 0. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05efi: Add 64-bit payload supportSimon Glass
Most EFI implementations use 64-bit. Add a way to build U-Boot as a 64-bit EFI payload. The payload unpacks a (32-bit) U-Boot and starts it. This can be enabled for x86 boards at present. Signed-off-by: Simon Glass <sjg@chromium.org> Improvements to how the payload is built: Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Add a way to call 32-bit code from 64-bit modeSimon Glass
The procedure to drop from 64-bit mode to 32-bit is a bit messy. Add a function to take care of it. It requires identity-mapped pages and that the calling code is running below 4GB. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Add an enum for some commonly-used GDT bitsSimon Glass
Rather than add these as open-coded values, create an enum with the commonly used flags. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Support building the EFI stubSimon Glass
Add support for building a 32/64-bit EFI stub for x86. This involves building the startup and relocation code for either i386 or x86_64. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05efi: Add support for loading U-Boot through an EFI stubSimon Glass
It is useful to be able to load U-Boot onto a board even if is it already running EFI. This can allow access to the U-Boot command interface, flexible booting options and easier development. The easiest way to do this is to build U-Boot as a binary blob and have an EFI stub copy it into RAM. Add support for this feature, targeting 32-bit initially. Also add a way to detect when U-Boot has been loaded via a stub. This goes in common.h since it needs to be widely available so that we avoid redoing initialisation that should be skipped. Signed-off-by: Simon Glass <sjg@chromium.org> Improvements to how the payload is built: Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Add relocation and link script for a 64-bit EFI applicationSimon Glass
Add a linker script and relocation code for building 64-bit EFI applications. This can be used for the EFI stub. Signed-off-by: Simon Glass <sjg@chromium.org> Improvements to how the payload is built: Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Add definitions for the x86-efi board and plumb it inBen Stoltz
Add configuration and Kconfig changes for this board. 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-05x86: Allow relocation code to build without text baseSimon Glass
This code currently requires CONFIG_SYS_TEXT_BASE but this should be unnecessary. As a first step, remove the build-time limitation and report an error instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: dts: Add a device tree file for EFISimon Glass
This contains just enough to bring up the serial UART. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Add EFI board codeBen Stoltz
Add support for the efi-x86 board, which supports running U-Boot as an EFI 32-bit application. Signed-off-by: Ben Stoltz <stoltz@google.com> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Add support for U-Boot as an EFI applicationBen Stoltz
Add the required x86 glue code. This includes the initial start-up, relocation and jumping to efi_main(). We also need to avoid fiddling with interrupts. 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-05x86: Add asm/elf.h for x86-specific ELF definitionsSimon Glass
Bring in this file from Linux 4.1. It supports relocation features specific to x86. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Support skipping relocation for EFISimon Glass
When running as an EFI application we must skip relocation. Add support for this in the x86 relocation code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05efi: Support building a u-boot-app.efi executableSimon Glass
Add support for building U-Boot as an EFI application with a .efi suffix. This can be loaded by EFI provided that EFI has the same bit width (32- or 64-bit) as U-Boot. This unfortunate limitation is imposed by EFI. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05x86: Set up toolchain flags for running as EFI applicationBen Stoltz
Adjust the toolchain flags to build U-Boot as a relocatable shared library, as required by EFI. Signed-off-by: Ben Stoltz <stoltz@google.com> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-05efi: Drop CONFIG_SYS_TEXT_BASE for EFIBen 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. Ensure that this CONFIG option is not set in this case. 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-05efi: Add a serial driverSimon Glass
Add a serial driver which makes use of EFI's console in/out service. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested on Intel Crown Bay and QEMU Tested-by: Bin Meng <bmeng.cn@gmail.com>