summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi/loader/arch
Commit message (Collapse)AuthorAgeFilesLines
* Use the UEFI event timer to update the time on arm and arm64. The currentandrew2016-06-044-4/+16
| | | | | | | | | code uses the GetTime function from the Runtime Service, however this has been shown to not return a useable time on many arm64 UEFI implementations. Reviewed by: jhb, smh Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D6709
* Deprecate using hints.acpi.0.rsdp to communicate the RSDP to theimp2016-04-141-0/+17
| | | | | | | | | | | | | | | | | system. This uses the hints mechnanism. This mostly works today because when there's no static hints (the default), this value can be fetched from the hint. When there is a static hints file, the hint passed from the boot loader to the kernel is ignored, but for the BIOS case we're able to find it anyway. However, with UEFI, the fallback doesn't work, so we get a panic instead. Switch to acpi.rsdp and use TUNABLE_ULONG_FETCH instead. Continue to generate the old values to allow for transitions. In addition, fall back to the old method if the new method isn't present. Add comments about all this. Differential Revision: https://reviews.freebsd.org/D5866
* Add a missing call to dev_cleanup from the arm64 loader.efi.andrew2016-02-201-0/+2
| | | | Sponsored by: ABT Systems Ltd
* Ensure the bss is aligned to a 4-byte address as we use 4-byte alignedandrew2016-02-091-1/+3
| | | | | | | | | stores to clear it. While here reduce the alignment of the data from 4k to 16 byte aligned. This should be more than enough, without wasting too much space. Sponsored by: ABT Systems Ltd
* Enable warnings in EFI boot codesmh2016-01-124-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Set WARNS if not set for EFI boot code and fix the issues highlighted by setting it. Most components are set to WARNS level 6 with few being left at lower levels due to the amount of changes needed to fix at higher levels. Error types fixed: * Missing / invalid casts * Missing inner structs * Unused vars * Missing static for internal only funcs * Missing prototypes * Alignment changes * Use of uninitialised vars * Unknown pragma (intrinsic) * Missing types etc due to missing includes * printf formatting types Reviewed by: emaste (in part) MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4839
* Introduce and use new EFI_ERROR_CODE macro for EFI errorsemaste2016-01-061-4/+4
| | | | | Submitted by: smh MFC after: 1 week
* loader.efi: strip trailing whitespaceemaste2015-12-211-1/+1
| | | | Sponsored by: The FreeBSD Foundation
* UEFI: combine GetMemoryMap and ExitBootServices and retry on erroremaste2015-12-163-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The EFI memory map may change before or during the first ExitBootServices call. In that case ExitBootServices returns an error, and GetMemoryMap and ExitBootServices must be retried. Glue together calls to GetMemoryMap(), ExitBootServices() and storage of (now up-to-date) MODINFOMD_EFI_MAP metadata within a single function. That new function - bi_add_efi_data_and_exit() - uses space previously allocated in bi_load_efi_data() to store the memory map (it will fail if that space is too short). It handles re-calling GetMemoryMap() once to update the map key if necessary. Finally, if ExitBootServices() is successful, it stores the memory map and its header as MODINFOMD_EFI_MAP metadata. ExitBootServices() calls are now done earlier, from within arch- independent bi_load() code. PR: 202455 Submitted by: Ganael LAPLANCHE Reviewed by: kib MFC after: 2 weeks Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D4296
* As expected, things aren't as simple as hoped. Consequently, we havemarcel2015-09-071-22/+76
| | | | | | | | | | | | | | | | | | | | | | no option but to use the smbios information to fill in the blanks. It's a good thing UGA is a protocol of the past and GOP has all the info we need. Anyway, the logic has been tweaked a little to get the easier bits of information up front. This includes the resolution and the frame buffer address. Then we look at the smbios information and define expected values as well as the missing bits (frame buffer offset and stride). If the values obtained match the expect values, we fill in the blanks and return. Otherwise we use the existing detection logic to figure it out. Rename the environment variables from uga_framebuffer abd uga_stride to hw.efifb.address and hw.efifb.stride. The latter names are more in line with other variable names. We currently have hardcoded settings for: 1. Mid-2007 iMac (iMac7,1) 2. Late-2007 MacBook (MacBook3,1)
* Auto-detect the UGA frame buffer and stride on a MacBook. We'remarcel2015-09-051-47/+88
| | | | | | | | striking a delicate balance between exhaustive searching and banking on assumptions. The environment variables can be used as a fall-back anyway. With this change, all known and tested Macs with only UGA should have a working console out of the box... for now...
* My MacBook has UGA only, but we fail to detect any changesmarcel2015-09-051-24/+50
| | | | | | | | | in the frame buffer when we flip pixels. Allow the detection to be bypassed by setting the uga_framebuffer and uga_stride variables. The kernel console works fine even when we can't detect pixel changes in the frame buffer, which indicates that the problem could be with reading from the frame buffer and not writing to it.
* For UGA, the frame buffer address obtained by scanning themarcel2015-09-031-52/+175
| | | | | | | | | | | | PCI BARs does not necessarily correspond to the upper-left most pixel. Scan the frame buffer for which byte changed when changing the pixel at (0,0). Use the same technique to determine the stride. Except for changing the pixel at (0,0), we change the pixel at (0,1). PR: 202730 Tested by: hartzell (at) alerce.com
* Install the forth bits on arm64. For now limit it to just arm64 as on x86andrew2015-09-011-0/+13
| | | | these should have been installed as part of the regular loader.
* Add support for the UGA draw protocol. This includes adding amarcel2015-08-301-56/+196
| | | | | | | | | | | | | | | | | command called 'uga' to show whether UGA is implemented by the firmware and what the settings are. It also includes filling the efi_fb structure from the UGA information when GOP isn't implemented by the firmware. Since UGA does not provide information about the stride, we set the stride to the horizontal resolution. This is likely not correct and we should determine the stride by trial and error. For now, this should show something on the console rather than nothing. Refactor this file to maximize code reuse. PR: 202730
* Add a gop command to help diagnose VT efifb problems. The gopmarcel2015-08-301-0/+95
| | | | | | | command has the following sub-commands: list - list all possible modes (paged) get - return the current mode set <mode> - set the current mode to <mode>
* Pass the ACPI table pointer to the arm64 kernel from loader.efi.andrew2015-06-111-1/+39
| | | | Sponsored by: The FreeBSD Foundation
* Remove OUTPUT_FORMAT from theARM EFI linker script, it breaks buildingandrew2015-05-141-2/+0
| | | | for big-endian arm.
* Don't check the return value from self_reloc(), it can't fail and doesn'tian2015-05-101-2/+0
| | | | | | | | return a value. Despite what I said in my prior commit, it turns out this one platform was checking the return value from the old self-reloc code (which returned a hard-coded 0).
* The self-relocation code is not efi-specific, move it to boot/common.ian2015-05-104-4/+4
| | | | | | | | | | | | | | | | The function was defined as taking 4 parameters and returning EFI_STATUS, but all existing callers (in asm code) passed only two parameters and don't use the return value. The function signature now matches that usage, and doesn't refer to efi-specific types. Parameters and variables now use the cannonical typenames set up by elf.h (Elf_Word, Elf_Addr, etc) instead of raw C types. Hopefully this will prevent suprises as new platforms come along and use this code. The function was renamed from _reloc() to self_reloc() to emphasize its difference from the other elf relocation code found in boot/common. Differential Revision: https://reviews.freebsd.org/D2490
* Disable the use of floating-point and vector registers in the loader. Theyandrew2015-05-051-0/+2
| | | | need the vfp unit to be enabled which may not be the case.
* * Remove the wfi when the efi loader returns, it's unneeded and is notandrew2015-04-141-2/+1
| | | | | available on older designs. * Enable the efi loader on arm
* Add support for arm64 to loader.efi and boot1.efiandrew2015-04-144-0/+363
| | | | | Reviewed by: emaste Sponsored by: The FreeBSD Foundation
* Add fdt support to the arm loader.efiandrew2015-04-111-0/+2
|
* Only add -fPIC to CFLAGS and -Wl,-znocombreloc to LDFLAGS on x86, theyandrew2015-04-112-0/+6
| | | | shouldn't be used on arm.
* Move reloc.c to the top level Makefile as it has become generic.andrew2015-04-113-6/+3
|
* Update the arm efi ldscript to generate a valid efi binaryandrew2015-04-111-44/+20
|
* Add build support for i386 loader.efiemaste2015-04-102-0/+17
| | | | | | | Kernel changes are required for this to be useful but this will allow others to experiment. Differential Revision: https://reviews.freebsd.org/D2276
* Remove EOL whitespace from i386 EFI loader sourceemaste2015-04-094-5/+5
|
* EFI: use common reloc.c for all architecturesemaste2015-04-072-190/+0
| | | | | | | | | Much of this file is common to the architectures we support, so share an implementation by adding a little #ifdef-ery. Differential Revision: https://reviews.freebsd.org/D2241 Reviewed by: imp Sponsored by: The FreeBSD Foundation
* Add support to the efi boot1 and loader for 32-bit ARM. This will be usedandrew2015-04-065-0/+471
| | | | | | | by the future qemu virt support. Differential Revision: https://reviews.freebsd.org/D2238 Reviewed by: emaste
* Move i386/efi files to new home in efi/loader/arch/i386emaste2015-04-027-0/+751
| | | | | | This was not (and still is not) connected to the build, but the EFI loader is in the process of being built for other than amd64 so these files ought to live in their eventual MD location.
* Move the efi loaders to be under sys/boot/efi. This will help us addandrew2015-04-018-0/+642
support for booting arm and arm64 from UEFI. Differential Revision: https://reviews.freebsd.org/D2164 Reviewed by: emaste, imp (previous version) Sponsored by: The FreeBSD Foundation
OpenPOWER on IntegriCloud