summaryrefslogtreecommitdiff
path: root/arch/x86
Commit message (Collapse)AuthorAgeLines
* x86: Intel MID platforms has no microcode updateAndy Shevchenko2017-02-21-1/+2
| | | | | | | | | | | There is no microcode update available for SoCs used on Intel MID platforms. Use conditional to bypass it. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* x86: zImage: add Intel MID platforms supportVincent Tinelli2017-02-21-0/+4
| | | | | | | | | | | | Intel MID platform boards have special treatment, such as boot parameter setting. Assign hardware_subarch accordingly if CONFIG_INTEL_MID is set. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Vincent Tinelli <vincent.tinelli@intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* x86: Introduce INTEL_MID quirk optionAndy Shevchenko2017-02-21-0/+14
| | | | | | | | | | | | | | | | | | Intel Mobile Internet Device (MID) platforms have special treatment in some cases, such as CPU enumeration or boot parameters configuration. Besides that several drivers are specifically developed for the IP blocks found on Intel MID platforms. Those drivers will be dependent to this option. Here we introduce specific quirk option for such cases. It is supposed to be selected by Intel MID platform boards, for example, Intel Edison. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* x86: Force 32-bit jumps in interrupt handlersJ. Tang2017-02-21-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending upon the compiler used, IRQ entries could vary in sizes. With GCC 5.x, the code generator will use short jumps for some IRQ entries but near jumps for others. For example, GCC 5.4.0 generates the following: $ objdump -d interrupt.o <snip> 00000207 <irq_18>: 207: 6a 12 push $0x12 209: eb 85 jmp 190 <irq_common_entry> 0000020b <irq_19>: 20b: 6a 13 push $0x13 20d: eb 81 jmp 190 <irq_common_entry> 0000020f <irq_20>: 20f: 6a 14 push $0x14 211: e9 7a ff ff ff jmp 190 <irq_common_entry> 00000216 <irq_21>: 216: 6a 15 push $0x15 218: e9 73 ff ff ff jmp 190 <irq_common_entry> This causes a problem in cpu_init_interrupts(), because the IDT setup assumed same sizes for all IRQ entries. GCC 4.x always generated 32-bit jumps, so this previously was not a problem. The fix is to force 32-bit near jumps for all entries within the inline assembly. This works for GCC 5.x, and 4.x was already using that form of jumping. Signed-off-by: Jason Tang <tang@jtang.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: core: Replace of_offset with accessorSimon Glass2017-02-08-24/+26
| | | | | | | | | At present devices use a simple integer offset to record the device tree node associated with the device. In preparation for supporting a live device tree, which uses a node pointer instead, refactor existing code to access this field through an inline function. Signed-off-by: Simon Glass <sjg@chromium.org>
* x86: make LOAD_FROM_32_BIT visible for platformsAndy Shevchenko2017-02-07-10/+10
| | | | | | | | | | | This option is useful not only for development, but for the platforms where U-Boot is run from custom ROM bootloader. For example, Intel Edison is that board. Make this option visible that platforms can select it if needed. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: qemu: Mark ucode as optional for SPL in u-boot.dtsiBin Meng2017-02-07-0/+6
| | | | | | | | QEMU does not need ucode and this is indicated in u-boot.dtsi for U-Boot proper. Now add the same for SPL. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: qemu: Set up device tree for SPLBin Meng2017-02-07-0/+8
| | | | | | | | Add the correct pre-relocation tag so that the required device tree nodes are present in the SPL device tree. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: qemu: Fix compiler warnings for 64-bitBin Meng2017-02-07-4/+4
| | | | | | | This fixes compiler warnings for QEMU in 64-bit. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: qemu: Hide arch_cpu_init() and print_cpuinfo() for U-Boot properBin Meng2017-02-07-1/+4
| | | | | | | | arch_cpu_init() and print_cpuinfo() should be only available in SPL build. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: Compile irq.c for 64-bitBin Meng2017-02-07-1/+1
| | | | | | | There is no reason not to compile irq.c for 64-bit. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: spl: Add weak arch_cpu_init_dm()Bin Meng2017-02-07-0/+5
| | | | | | | | arch_cpu_init_dm() might not be implemented by every platform. Implement a weak version for SPL. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: Wrap print_ch() with config optionBin Meng2017-02-07-0/+2
| | | | | | | print_ch() should not be used if DEBUG_UART is off. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: qemu: Add missing DECLARE_GLOBAL_DATA_PTR in e820.cBin Meng2017-02-07-0/+2
| | | | | | | DECLARE_GLOBAL_DATA_PTR is missing which causes 64-bit build error. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: Update compile/link flags to support 64-bit U-BootSimon Glass2017-02-07-4/+28
| | | | | | | Update config.mk settings to support both 32-bit and 64-bit U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: link: Set up device tree for SPLSimon Glass2017-02-07-1/+14
| | | | | | | | | | | | | Add the correct pre-relocation tag so that the required device tree nodes are present in the SPL device tree. On x86 it doesn't make a lot of sense to have a separate SPL device tree. Since everything is in the same ROM we might as well just use the main device tree in both SPL and U-Boot proper. But we haven't implemented that, so this is a good first step. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: link: Add SPL declarations to the binman imageSimon Glass2017-02-07-0/+19
| | | | | | | | When building for 64-bit we need to put an SPL binary into the image. Update the binman image description to reflect this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Add a dummy setjmp implementation for x86_64Simon Glass2017-02-07-1/+21
| | | | | | | | We don't have the code for this yet. Add a dummy version for now, so that EFI builds correctly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Move setjmp to the i386 directorySimon Glass2017-02-07-3/+1
| | | | | | | | This code is only used in 32-bit mode. Move it so that it does not get built with 64-bit U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Move call64 to the i386 directorySimon Glass2017-02-07-1/+2
| | | | | | | | This code is only used in 32-bit mode. Move it so that it does not get built with 64-bit U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Change irq_already_routed to a local variableSimon Glass2017-02-07-4/+6
| | | | | | | This avoids using BSS before SDRAM is set up in SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Move turbo_state to global_dataSimon Glass2017-02-07-4/+5
| | | | | | | | To avoid using BSS in SPL before SDRAM is set up, move this field to global_data. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Move pirq_routing_table to global_dataSimon Glass2017-02-07-7/+6
| | | | | | | | To avoid using BSS in SPL before SDRAM is set up, move this field to global_data. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Support jumping from SPL to U-BootSimon Glass2017-02-06-0/+76
| | | | | | | | Add a rough function to handle jumping from 32-bit SPL to 64-bit U-Boot. This still needs work to clean it up. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Drop interrupt support in 64-bit modeSimon Glass2017-02-06-0/+5
| | | | | | | This is not currently supported, so drop the code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Don't try to boot Linux from SPLSimon Glass2017-02-06-0/+4
| | | | | | | | | | | Booting into linux from 64-bit U-Boot is not yet supported. Avoid bringing in the bootm code until it is implemented. Of course 32-bit U-Boot still supports booting into both 32- and 64-bit kernels. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Don't build 32-bit efi files on x86_64Simon Glass2017-02-06-0/+4
| | | | | | | These cannot be built in this mode, so drop them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Don't build cpu files which are not supported on 64-bitSimon Glass2017-02-06-1/+8
| | | | | | | | Some files cannot be built with 64-bit and mostly don't make sense in that context. Disable them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Don't build call64 and setjmp on 64-bitSimon Glass2017-02-06-1/+12
| | | | | | | | | These are currently not supported. Calling 64-bit code from 64-bit U-Boot is much simpler, so this code is not needed. setjmp() is not yet implemented for 64-bit. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Don't try to run the VGA BIOS in 64-bit modeSimon Glass2017-02-06-0/+2
| | | | | | | This is not supported, so disable it for now. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: ivybridge: Provide a dummy SDRAM init for 64-bitSimon Glass2017-02-06-0/+31
| | | | | | | | | | We don't support SDRAM init in 64-bit mode since it is essentially impossible to get into that mode before SDRAM set up. Provide dummy functions for now. At some point we will need to pass the SDRAM parameters through from SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: ivybridge: Skip SATA init in SPLSimon Glass2017-02-06-0/+2
| | | | | | | This doesn't work at present. Disable it for now. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Fix up type sizes for 64-bitSimon Glass2017-02-06-0/+10
| | | | | | | Adjust types as needed to support 64-bit compilation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Drop flag_is_changable() on x86_64Simon Glass2017-02-06-0/+3
| | | | | | | | This doesn't build at present and is not used in a 64-bit build. Disable it for now. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Fix up byteorder.h for x86_64Simon Glass2017-02-06-8/+9
| | | | | | | Remove the very old x86 code and add support for 64-bit. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Add a link script for SPLSimon Glass2017-02-06-0/+74
| | | | | | | | If SPL is used it is always build in 32-bit mode. Add a link script to handle the correct placement of the sections. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Add a link script for 64-bit x86Simon Glass2017-02-06-0/+82
| | | | | | | | This needs a different image format from 32-bit x86, so add a new link script. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Fix up CONFIG_X86_64 checkSimon Glass2017-02-06-1/+1
| | | | | | | | When SPL and U-Boot proper have different settings for this flag, we need to use the correct one. Fix this up in the interrupt code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Support global_data on x86_64Simon Glass2017-02-06-1/+33
| | | | | | | | At present this is just an ordinary variable. We may consider making it a fixed register in the future. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Add cpu code for x86_64Simon Glass2017-02-06-1/+72
| | | | | | | | There is not much needed at present, but set up a separate directory to put this code as it grows. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Move the i386 code into its own directorySimon Glass2017-02-06-509/+549
| | | | | | | | Much of the cpu and interrupt code cannot be compiled on 64-bit x86. Move it into its own directory and build it only in 32-bit mode. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Add an SPL implementationSimon Glass2017-02-06-0/+163
| | | | | | | | SPL needs to set up the machine ready for loading 64-bit U-Boot and jumping to it. Call the existing init routines in order to accomplish this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Tidy up use of size_t in relocationSimon Glass2017-02-06-2/+2
| | | | | | | Addresses should not be cast to size_t. Use uintptr_t instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Add support for 64-bit relocationSimon Glass2017-02-06-0/+45
| | | | | | | | | Add a 64-bit relocation function. SPL loads U-Boot into RAM at a fixed address and runs it. U-Boot then relocates itself to the top of RAM using this relocation function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Refactor relocation to prepare for 64-bitSimon Glass2017-02-06-24/+31
| | | | | | | | Move the core relocation code into a separate function so that the checking code can be used for 64-bit relocation also. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Add 64-bit start-up codeSimon Glass2017-02-06-0/+37
| | | | | | | | Add code to start up U-Boot in 64-bit mode. It is fairly simple since we are running from RAM and SPL has done the low-level init. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: ivybridge: Allow 32-bit init to move to SPLSimon Glass2017-02-06-2/+2
| | | | | | | | Update the Makefile so that some 32-bit init can be built into SPL rather than U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Use X86_32BIT_INIT instead of X86_RESET_VECTORSimon Glass2017-02-06-5/+7
| | | | | | | | Use this new option to control the location of 32-bit init. This will allow us to place this in SPL if needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Use X86_16BIT_INIT instead of X86_RESET_VECTORSimon Glass2017-02-06-6/+4
| | | | | | | | Use this new option to control the location of 16-bit init. This will allow us to place this in SPL if needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Kconfig: Add location options for 16/32-bit initSimon Glass2017-02-06-0/+40
| | | | | | | | | | | | | | | | | | At present all 16/32-bit init is controlled by CONFIG_X86_RESET_VECTOR. If this is enabled, then U-Boot is the 'first' boot loader and handles execution from the reset vector through to U-Boot's command prompt. If it is not enabled then U-Boot starts at the 32-bit entry and skips most of its init, assuming that the previous boot loader has done this already. With the move to suport 64-bit operation, we have more cases to consider. The 16-bit and 32-bit init may be in SPL rather than in U-Boot proper. Add Kconfig options which control the location of the 16-bit and the 32-bit init. These are not intended to be user-setting except for experimentation. Their values should be determined by whether 64-bit U-Boot is used. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>