summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* efi_loader: Call fdt preparation functionsAlexander Graf2016-03-152-3/+13
| | | | | | | | | | | We have a nice framework around image fils to prepare a device tree for OS execution. That one patches in missing device tree nodes and fixes up the memory range bits. We need to call that one from the EFI boot path too to get all those nice fixups. This patch adds the call. Signed-off-by: Alexander Graf <agraf@suse.de>
* arm: Allow EFI payload code to take exceptionsAlexander Graf2016-03-151-0/+8
| | | | | | | | | | | | | | | There are 2 ways an EFI payload could return into u-boot: - Callback function - Exception While in EFI payload mode, r9 is owned by the payload and may not contain a valid pointer to gd, so we need to fix it up. We do that properly for the payload to callback path already. This patch also adds gd pointer restoral for the exception path. Signed-off-by: Alexander Graf <agraf@suse.de>
* arm64: Replace fdt_name env variables with fdtfileAlexander Graf2016-03-153-8/+8
| | | | | | | | The commonly defined environment variable to determine the device tree file name is called fdtfile rather than fdt_name. Replace all occurences of fdt_name with fdtfile. Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Add MAINTAINERS entryAlexander Graf2016-03-151-0/+7
| | | | | | | | Now that everything's in place, let's add myself as the maintainer for the efi payload support. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* efi_loader: Add README section in README.efiAlexander Graf2016-03-151-1/+82
| | | | | | | | | | | | To preserve all cover letter knowledge of the status on UEFI payload support, let's add some sections to README.efi. Signed-off-by: Alexander Graf <agraf@suse.de> v3 -> v4: - Add section about config options - s/10kb/10KB/
* efi_loader: Add distro boot script for removable mediaAlexander Graf2016-03-151-1/+46
| | | | | | | | | | | | | | | | | | UEFI defines a simple boot protocol for removable media. There we should look at the EFI (first GPT FAT) partition and search for /efi/boot/bootXXX.efi with XXX being different between different platforms (x86, x64, arm, aa64, ...). This patch implements a simple version of that protocol for the default distro boot script. With this we can automatically boot from valid UEFI enabled removable media. Because from all I could see U-Boot by default doesn't deliver device tree blobs with its firmware, we also need to load the dtb from somewhere. Traverse the same EFI partition for an fdt file that fits our current board so that an OS receives a valid device tree when booted automatically. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* efi_loader: hook up in build environmentAlexander Graf2016-03-156-0/+25
| | | | | | | | | | | Now that we have all the bits and pieces ready for EFI payload loading support, hook them up in Makefiles and KConfigs so that we can build. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> [trini: Enable only when we of OF_LIBFDT, disable on kwb and colibri_pxa270] Signed-off-by: Tom Rini <trini@konsulko.com>
* arm64: Allow EFI payload code to take exceptionsAlexander Graf2016-03-151-0/+9
| | | | | | | | | | | | | | | There are 2 ways an EFI payload could return into u-boot: - Callback function - Exception While in EFI payload mode, x18 is owned by the payload and may not contain a valid pointer to gd, so we need to fix it up. We do that properly for the payload to callback path already. This patch also adds gd pointer restoral for the exception path. Signed-off-by: Alexander Graf <agraf@suse.de>
* arm64: Allow exceptions to returnAlexander Graf2016-03-151-0/+34
| | | | | | | | | | | | | | Our current arm64 exception handlers all panic and never return to the exception triggering code. But if any handler wanted to continue execution after fixups, it would need help from the exception handling code to restore all registers. This patch implements that help. With this code, exception handlers on aarch64 can successfully return to the place the exception happened (or somewhere else if they modify elr). Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Implement memory allocation and mapAlexander Graf2016-03-153-0/+341
| | | | | | | | | | | | | | | | | | | The EFI loader needs to maintain views of memory - general system memory windows as well as used locations inside those and potential runtime service MMIO windows. To manage all of these, add a few helpers that maintain an internal representation of the map the similar to how the EFI API later on reports it to the application. For allocations, the scheme is very simple. We basically allow allocations to replace chunks of previously done maps, so that a new LOADER_DATA allocation for example can remove a piece of the RAM map. When no specific address is given, we just take the highest possible address in the lowest RAM map that fits the allocation size. Signed-off-by: Alexander Graf <agraf@suse.de> Tested-by: Simon Glass <sjg@chromium.org>
* efi_loader: Add "bootefi" commandAlexander Graf2016-03-153-0/+190
| | | | | | | | | | | | | | | | | | | | | | In order to execute an EFI application, we need to bridge the gap between U-Boot's notion of executing images and EFI's notion of doing the same. The best path forward IMHO here is to stick completely to the way U-Boot deals with payloads. You manually load them using whatever method to RAM and then have a simple boot command to execute them. So in our case, you would do # load mmc 0:1 $loadaddr grub.efi # bootefi $loadaddr which then gets you into a grub shell. Fdt information known to U-boot via the fdt addr command is also passed to the EFI payload. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> [trini: Guard help text with CONFIG_SYS_LONGHELP] Signed-off-by: Tom Rini <trini@konsulko.com>
* efi_loader: Add disk interfacesAlexander Graf2016-03-152-0/+220
| | | | | | | | | | | | | | | A EFI applications usually want to access storage devices to load data from. This patch adds support for EFI disk interfaces. It loops through all block storage interfaces known to U-Boot and creates an EFI object for each existing one. EFI applications can then through these objects call U-Boot's read and write functions. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> [trini: Update for various DM changes since posting] Signed-off-by: Tom Rini <trini@konsulko.com>
* efi_loader: Add runtime servicesAlexander Graf2016-03-159-3/+398
| | | | | | | | | | | | | | | | | After booting has finished, EFI allows firmware to still interact with the OS using the "runtime services". These callbacks live in a separate address space, since they are available long after U-Boot has been overwritten by the OS. This patch adds enough framework for arbitrary code inside of U-Boot to become a runtime service with the right section attributes set. For now, we don't make use of it yet though. We could maybe in the future map U-boot environment variables to EFI variables here. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* efi_loader: Add console interfaceAlexander Graf2016-03-152-0/+365
| | | | | | | | | | | | | | One of the basic EFI interfaces is the console interface. Using it an EFI application can interface with the user. This patch implements an EFI console interface using getc() and putc(). Today, we only implement text based consoles. We also convert the EFI Unicode characters to UTF-8 on the fly, hoping that everyone managed to jump on the train by now. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* efi_loader: Add boot time servicesAlexander Graf2016-03-152-0/+866
| | | | | | | | | | | | | | When an EFI application runs, it has access to a few descriptor and callback tables to instruct the EFI compliant firmware to do things for it. The bulk of those interfaces are "boot time services". They handle all object management, and memory allocation. This patch adds support for the boot time services and also exposes a system table, which is the point of entry descriptor table for EFI payloads. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* efi_loader: Add PE image loaderAlexander Graf2016-03-153-0/+471
| | | | | | | | | EFI uses the PE binary format for its application images. Add support to EFI PE binaries as well as all necessary bits for the "EFI image loader" interfaces. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* include/efi_api.h: Add more detailed API definitionsAlexander Graf2016-03-152-37/+163
| | | | | | | | | | | | The EFI API header is great, but missing a good chunk of function prototype, GUID defines and enum declarations. This patch extends it to cover more of the EFI API. It's still not 100% complete, but sufficient enough for our EFI payload interface. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* disk/part.c: Expose list of available block driversAlexander Graf2016-03-152-7/+8
| | | | | | | | | | | | | | We have a pretty nice and generic interface to ask for a specific block device. However, that one is still based around the magic notion that we know the driver name. In order to be able to write fully generic disk access code, expose the currently internal list to other source files so that they can scan through all available block drivers. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* arm64: Only allow dcache disabled in SPL buildsAlexander Graf2016-03-151-0/+9
| | | | | | | | | Now that we have an easy way to describe memory regions and enable the MMU, there really shouldn't be anything holding people back from running with caches enabled on AArch64. To make sure people catch early if they're missing on the caching fun, give them a compile error. Signed-off-by: Alexander Graf <agraf@suse.de>
* arm64: Remove non-full-va map codeAlexander Graf2016-03-1512-256/+85
| | | | | | | | | | | By now the code to only have a single page table level with 64k page size and 42 bit address space is no longer used by any board in tree, so we can safely remove it. To clean up code, move the layerscape mmu code to the new defines, removing redundant field definitions. Signed-off-by: Alexander Graf <agraf@suse.de>
* hikey: Add MMU tablesAlexander Graf2016-03-152-2/+24
| | | | | | | | The hikey runs with dcache disabled today. There really should be no reason not to use caches on AArch64, so let's add MMU definitions and enable the dcache. Signed-off-by: Alexander Graf <agraf@suse.de>
* dwmmc: Increase retry timeoutAlexander Graf2016-03-151-1/+1
| | | | | | | | | | | | | | When enable dcache on HiKey, we're running into MMC command timeouts because our retry loop is now faster than the eMMC (or an external SD card) can answer. Increase the retry count to the same as the timeout value for status reports. The real fix is obviously to not base this whole thing on a cycle counter but on real wall time, but that would be slightly more intrusive. Signed-off-by: Alexander Graf <agraf@suse.de>
* vexpress64: Add MMU tablesAlexander Graf2016-03-152-3/+24
| | | | | | | | There's no good excuse for running with caches disabled on AArch64, so let's just move the vexpress64 target to enable the MMU and run with caches on. Signed-off-by: Alexander Graf <agraf@suse.de>
* tegra: Replace home grown mmu code with generic table approachAlexander Graf2016-03-152-115/+19
| | | | | | | Now that we have nice table driven page table creating code that gives us everything we need, move to that. Signed-off-by: Alexander Graf <agraf@suse.de>
* zymqmp: Replace home grown mmu code with generic table approachAlexander Graf2016-03-152-169/+50
| | | | | | | Now that we have nice table driven page table creating code that gives us everything we need, move to that. Signed-off-by: Alexander Graf <agraf@suse.de>
* thunderx: Move mmu table into board fileAlexander Graf2016-03-154-16/+29
| | | | | | | | | The MMU range table can vary depending on things we may only find out at runtime. While the very simple ThunderX variant does not change, other boards will, so move the definition from a static entry in a header file to the board file. Signed-off-by: Alexander Graf <agraf@suse.de>
* arm64: Make full va map code more dynamicAlexander Graf2016-03-156-108/+500
| | | | | | | | | | | | | | | | | | | The idea to generate our pages tables from an array of memory ranges is very sound. However, instead of hard coding the code to create up to 2 levels of 64k granule page tables, we really should just create normal 4k page tables that allow us to set caching attributes on 2M or 4k level later on. So this patch moves the full_va mapping code to 4k page size and makes it fully flexible to dynamically create as many levels as necessary for a map (including dynamic 1G/2M pages). It also adds support to dynamically split a large map into smaller ones when some code wants to set dcache attributes. With all this in place, there is very little reason to create your own page tables in board specific files. Signed-off-by: Alexander Graf <agraf@suse.de>
* arm64: Disable TTBR1 maps in EL1Alexander Graf2016-03-152-1/+2
| | | | | | | | | | | | When running in EL1, AArch64 knows two page table maps. One with addresses that start with all zeros (TTBR0) and one with addresses that start with all ones (TTBR1). In U-Boot we don't care about the high up maps, so just disable them to ensure we don't walk an invalid page table by accident. Reported-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* thunderx: Calculate TCR dynamicallyAlexander Graf2016-03-153-9/+59
| | | | | | | | Based on the memory map we can determine a lot of hard coded fields of TCR, like the maximum VA and max PA we want to support. Calculate those dynamically to reduce the chance for pit falls. Signed-off-by: Alexander Graf <agraf@suse.de>
* kc1: Clear reboot mode garbage on cold resetPaul Kocialkowski2016-03-151-0/+3
| | | | | | | Reboot mode garbage is found on cold reset and might be seen as valid on the next warm reset, thus it has to be cleared on cold reset. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* kc1: Power off when the power on reason is not a valid onePaul Kocialkowski2016-03-152-0/+22
| | | | | | | Some power on reasons are not desirable (e.g. too short press on the power button), battery plug. Thus, power off the device when one of those occurs. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* input: TWL6030 input support for power button, USB and chargerPaul Kocialkowski2016-03-153-0/+70
| | | | | | | This adds support for detecting a few inputs exported by the TWL6030. Currently-supported inputs are the power button, USB and charger presence. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* power: twl6030: Power off supportPaul Kocialkowski2016-03-152-0/+15
| | | | | | This adds support for powering off (the omap SoC) from the twl6030. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* power: twl6030: Remove ifdef around the codePaul Kocialkowski2016-03-151-2/+0
| | | | | | | The TWL6030 power driver is only built when CONFIG_TWL6030_POWER is selected, thus there is no reason to wrap the code with ifdef. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* kc1: Boot to bootloader (fastboot) on ID pin pull-upPaul Kocialkowski2016-03-151-0/+9
| | | | | | USB ID pin pull-up indicates factory (fastboot) cable detection. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* kc1: OMAP4 reboot mode supportPaul Kocialkowski2016-03-153-0/+24
| | | | | | | | This adds support for the omap4 reboot mode mechanism and exports the reboot mode via an environment variable, that is used in the boot command to make it possible to boot from the recovery partition or fastboot. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* omap4: Check warm reset for reboot mode validityPaul Kocialkowski2016-03-151-0/+4
| | | | | | | Since the SAR registers are filled with garbage on cold reset, this checks for a warm reset to assert the validity of reboot mode. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* omap4: Reboot mode supportPaul Kocialkowski2016-03-152-0/+49
| | | | | | | | | | Reboot mode is written to SAR memory before reboot in the form of a string. This mechanism is supported on OMAP4 by various TI kernels. It is up to each board to make use of this mechanism or not. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* kc1: MUSB USB controller and fastboot USB gadget supportPaul Kocialkowski2016-03-154-0/+68
| | | | | | | | | This adds support for the MUSB USB dual-role controller in peripheral mode, with configuration options for the fastboot USB gadget. At this point, flashing the internal eMMC is support. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* usb: musb-new: omap2430: OMAP4 MUSB USB controller supportPaul Kocialkowski2016-03-153-0/+25
| | | | | | | This adds support for the OMAP4 MUSB USB controller, with a matching Linux compat definition, TWL6030 USB device setup and USBOTGHS register setup. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* power: twl6030: Clear VUSB_IN_PMID bit on USB device setupPaul Kocialkowski2016-03-152-0/+2
| | | | | | | | | | | | When booting from USB, the bootrom sets the VUSB_IN_PMID bit of the MISC2 register of the TWL6030. However, U-Boot sets the VUSB_IN_VSYS bit to enable VBUS input. As both bits are contradictory, enabling both disables the input, according to the TWL6030 TRM. Thus, we need to clear the VUSB_IN_PMID bit in case of an USB boot (which could just as well be a memory boot after USB timed out). Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* power: twl6030: Configure VUSB voltage on USB device setupPaul Kocialkowski2016-03-152-0/+6
| | | | | | This explicitly sets VUSB voltage to 3.3V when enabling USB. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* omap4: Properly enable USB PHY clocksPaul Kocialkowski2016-03-153-1/+9
| | | | | | | This correctly enables the USB PHY clocks, by enabling CM_ALWON_USBPHY_CLKCTRL and correctly setting CM_L3INIT_USBPHY_CLKCTRL's value. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* omap-common: clocks-common: Setup USB DPLL when MUSB is in usePaul Kocialkowski2016-03-151-2/+4
| | | | | | | | On (at least) OMAP4, the USB DPLL is required to be setup for the internal PHY to work properly. The internal PHY is used by default with the MUSB USB OTG controller. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Amazon Kindle Fire (first generation) codename kc1 supportPaul Kocialkowski2016-03-158-0/+474
| | | | | | | | | | The Amazon Kindle Fire (first generation) codename kc1 is a tablet that was released by Amazon back in 2011. It is using an OMAP4430 SoC GP version, which allows running U-Boot and the U-Boot SPL from the ground up. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* omap4: Move i2c clocks enable to enable_basic_clocksPaul Kocialkowski2016-03-151-4/+4
| | | | | | | I2C is often enabled withing the U-Boot SPL, thus those clocks are required to be enabled early (especially when the bootrom doesn't enable them for us). Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* omap4: Remove duplicate CM_L3INIT_USBPHY_CLKCTRL reference and whitespacePaul Kocialkowski2016-03-151-2/+1
| | | | | | | This removes a duplicate reference to CM_L3INIT_USBPHY_CLKCTRLin enable_basic_uboot_clocks. Also, a doubled whitespace is removed. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* omap-common: Remove deprecated arch_cpu_init codePaul Kocialkowski2016-03-153-15/+0
| | | | | | | save_omap_boot_params is called from spl_board_init in the SPL context. Thus, there is no reason to duplicate that call on arch_cpu_init. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* omap-common: Rename set_muxconf_regs_essential to set_muxconf_regsPaul Kocialkowski2016-03-1511-13/+13
| | | | | | | There is no distinction between essential and non-essential mux configuration, so it doesn't make sense to have an "essential" prefix. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* omap4: Export jedec sdram timingsPaul Kocialkowski2016-03-152-2/+4
| | | | | | | Individual boards might provide their own emif_get_device_timings function and use the jedec timings in their own way, hence those have to be exported. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
OpenPOWER on IntegriCloud