Masahiro Yamada [Thu, 2 Feb 2017 07:04:11 +0000 (16:04 +0900)]
pwm: remove unneeded ifdef CONFIG_DM_PWM ... endif
Both CONFIG_PWM_TEGRA and CONFIG_PWM_EXYNOS depend on CONFIG_DM_PWM,
i.e. they are already guarded by Kconfig correctly. Remove unneeded
ifdef CONFIG_DM_PWM ... endif.
While we are here, let's tidy up alignment and sort the lines
alphabetically in Makefile.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Jean-Jacques Hiblot [Wed, 1 Feb 2017 13:51:47 +0000 (14:51 +0100)]
common: env_sf: Use CONFIG_SF_DEFAULT_xxx as the default value for CONFIG_ENV_SPI_xxx
The default values for the configuration defines CONFIG_ENV_SPI_xxx are
arbitrary values. It makes more sense to set them to the values used by
the sf command.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Albert ARIBAUD \(3ADEV\) [Wed, 1 Feb 2017 13:46:00 +0000 (14:46 +0100)]
pcm052: fix DDR initialization sequence
The sequence erroneously launched the DDR controller
initialization before the pad muxing was done, causing
DRAM size computation to hang.
Configuring the pads first then launching DDR controller
initialization prevents the DRAM hanging.
Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Lokesh Vutla [Wed, 1 Feb 2017 03:50:49 +0000 (09:20 +0530)]
drivers: net: cpsw: Fix reading of mac address for am43 SoCs
cpsw driver tries to get macid for am43xx SoCs using the compatible
ti,am4372. But not all variants of am43x uses this complatible like
epos evm uses ti,am438x. So use a generic compatible ti,am43 to get
macid for all am43 based platforms.
Tested-by: Aparna Balasubramanian <aparnab@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Grygorii Strashko [Tue, 31 Jan 2017 21:37:03 +0000 (15:37 -0600)]
cmd: bootm: fix build when CONFIG_CMD_IMLS_NAND
Now when CONFIG_CMD_IMLS_NAND is enabled the u-boot build will fail,
because nand_read_skip_bad() function has been changed to accept more
parameters, hence fix it.
CC cmd/bootm.o
cmd/bootm.c: In function 'nand_imls_legacyimage':
cmd/bootm.c:390:8: error: too few arguments to function 'nand_read_skip_bad'
ret = nand_read_skip_bad(mtd, off, &len, imgdata);
^
In file included from cmd/bootm.c:18:0:
include/nand.h:101:5: note: declared here
int nand_read_skip_bad(struct mtd_info *mtd, loff_t offset, size_t *length,
^
LD drivers/block/built-in.o
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Dan Murphy [Tue, 31 Jan 2017 20:15:53 +0000 (14:15 -0600)]
checkpatch: Port spelling to checkpatch
Pick commit
66b47b4a9dad0 checkpatch: look for common misspellings
from the Linux kernel for spelling check from Kees Cook
In addition pulled in additional changes
commit
ebfd7d6237531 checkpatch: add optional --codespell dictionary to find more typos
from the Linux kernel for codespell from Joe Perches
commit
f1a63678554f8 checkpatch: remove local from codespell path
from the Linux kernel for dictionary path from Maxim Uvarov
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Emmanuel Vadot [Tue, 31 Jan 2017 11:17:05 +0000 (12:17 +0100)]
api: Convert to Kconfig
Now that we have a Kconfig for the API, convert the two boards that
are using this to Kconfig and remove CONFIG_API from the whitelist.
Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Emmanuel Vadot [Tue, 31 Jan 2017 11:17:04 +0000 (12:17 +0100)]
kconfig: Add API kconfig file
Add kconfig file to enable API support
Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Tue, 31 Jan 2017 11:11:33 +0000 (20:11 +0900)]
kbuild: beautify the log of config whitelist check
Use the kbuild style log.
Prior to this commit:
./scripts/check-config.sh u-boot.cfg \
./scripts/config_whitelist.txt . 1>&2
With this commit:
CFGCHK u-boot.cfg
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Lokesh Vutla [Tue, 31 Jan 2017 04:02:57 +0000 (09:32 +0530)]
ARM: dts: k2*: Rename the k2* files to keystone-k2* files
As reported in [1], rename the k2* dts files to keystone-* files
this will force consistency throughout.
Script for the same (and hand modified for Makefile and config
files):
for i in arch/arm/dts/k2*
do
b=`basename $i`;
git mv $i arch/arm/dts/keystone-$b;
sed -i -e "s/$b/keystone-$b/g" arch/arm/dts/*[si]
done
This is similar to linux kernel commit
5edafc29829bc ("ARM: dts: k2*: Rename
the k2* files to keystone-k2* files")
[1] http://marc.info/?l=linux-arm-kernel&m=
145637407804754&w=2
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
maxims@google.com [Mon, 30 Jan 2017 19:35:04 +0000 (11:35 -0800)]
aspeed: ast2500: Fix H-PLL and M-PLL clock rate calculation
Fix H-PLL and M-PLL rate calculation in ast2500 clock driver.
Without this fix, valid setting can lead to division by zero
when requesting the rate of H-PLL or M-PLL clocks.
Signed-off-by: Maxim Sloyko <maxims@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Vincent Tinelli [Mon, 30 Jan 2017 12:46:07 +0000 (15:46 +0300)]
cmd: gpt: backup boot code before writing MBR
On some cases the first 440 bytes of MBR are used to keep an additional
information for ROM boot loader. 'gpt write' command doesn't preserve
that area and makes boot code gone.
Preserve boot code area when run 'gpt write' command.
Signed-off-by: Vincent Tinelli <vincent.tinelli@intel.com>
Signed-off-by: Brennan Ashton <brn@deako.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Mon, 30 Jan 2017 02:12:08 +0000 (11:12 +0900)]
cmd: rework "license" command
The previous commit ("add a new command to show .config contents")
improves the basic infrastructure of "embed a compressed file into
the U-Boot image, and print it by a command". The same pattern for
the "license" command.
This commit reworks the command to improve the following:
[1] Improve log style
Kbuild style log
GZIP cmd/license_data.gz
CHK cmd/license_data_gz.h
UPD cmd/license_data_gz.h
CHK cmd/license_data_size.h
UPD cmd/license_data_size.h
instead of the bare Make log:
cat ./Licenses/gpl-2.0.txt | gzip -9 -c | \
tools/bin2header license_gzip > ./include/license.h
[2] Collect related code into the "cmd" directory
Prior to this commit, the license.h was created by tools/Makefile,
placed under the "include" directory, included from cmd/license.c,
and deleted by the top-level Makefile. It is not a good idea to
scatter related code.
[3] Drop the fixed-malloc size LICENSE_MAX
Just allocate the minimum required size of buffer because we know
the size of the original gpl-2.0.txt.
[4] Fix more issues
Terminate the buffer with zero to prevent puts() from over-running.
Add "static" to do_license.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Mon, 30 Jan 2017 02:12:07 +0000 (11:12 +0900)]
cmd: add a new command "config" to show .config contents
This feature is inspired by /proc/config.gz of Linux. In Linux,
if CONFIG_IKCONFIG is enabled, the ".config" file contents are
embedded in the kernel image. If CONFIG_IKCONFIG_PROC is also
enabled, the ".config" contents are exposed to /proc/config.gz.
Users can do "zcat /proc/config.gz" to check which config options
are enabled on the running kernel image.
The idea is almost the same here; if CONFIG_CMD_CONFIG is enabled,
the ".config" contents are compressed and saved in the U-Boot image,
then printed by the new command "config".
The usage is quite simple. Enable CONFIG_CMD_CONFIG, then run
> config
from the command line interface. The ".config" contents will be
printed on the console.
This feature increases the U-Boot image size by about 4KB (this is
mostly due to the gzip-compressed .config file). By default, it is
enabled only for Sandbox because we do not care about the memory
footprint on it. Of course, this feature is architecture agnostic,
so you can enable it on any board if the image size increase is
acceptable for you.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Mon, 30 Jan 2017 02:12:06 +0000 (11:12 +0900)]
scripts: import bin2c.c from Linux 4.10-rc6
Import scripts/basic/bin2c.c of Linux.
In Linux Kernel, this file was moved to scripts/basic directory by
commit
8370edea81e3 ("bin2c: move bin2c in scripts/basic").
In U-Boot, we do not need to follow that commit. Just put it in the
original directory "scripts".
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Fri, 27 Jan 2017 07:15:30 +0000 (16:15 +0900)]
arm64: use store with auto-increment
Save one instruction.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Fri, 27 Jan 2017 07:15:29 +0000 (16:15 +0900)]
arm64: use xzr to zero-out the bss section
AArch64 has a zero register (xzr). Use it instead of x2.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Andy Shevchenko [Sun, 5 Feb 2017 13:52:00 +0000 (16:52 +0300)]
x86: make LOAD_FROM_32_BIT visible for platforms
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>
Bin Meng [Wed, 18 Jan 2017 11:33:04 +0000 (03:33 -0800)]
x86: qemu: Add a config for 64-bit U-Boot
Add a new board config which uses 64-bit U-Boot. Supported features
are the same as the other 64-bit board (Google Chromebook Link).
It is a start for us to test 64-bit U-Boot easily without the need
to access a real hardware.
Note CONFIG_SPL_ENV_SUPPORT is required for QEMU 64-bit as without
this the SPL build fails at the end. This is just a workaround as
CONFIG_SPL_ENV_SUPPORT is not needed at all.
common/built-in.o:(.data.env_htab+0xc): undefined reference to 'env_flags_validate'
lib/built-in.o: In function `hsearch_r':
lib/hashtable.c:380: undefined reference to 'env_callback_init'
lib/hashtable.c:382: undefined reference to 'env_flags_init'
make[1]: *** [spl/u-boot-spl] Error 1
Except those SPL options required by 64-bit, compared to 32-bit
config, the following options are different:
- CONFIG_SYS_MALLOC_F_LEN has to be increased to 0x1000 for SPL.
- CONFIG_DEBUG_UART has to be included due to the weird issue.
See TODO comments in arch/x86/cpu/x86_64/cpu.c:arch_setup_gd().
Once this issue gets fixed, debug uart can be optional.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng [Wed, 18 Jan 2017 11:33:03 +0000 (03:33 -0800)]
x86: qemu: Add build options for SPL
If SPL is used we want to use the generic SPL framework and boot
from SPI via a board-specific means. Add these options to the
board config file.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng [Wed, 18 Jan 2017 11:33:02 +0000 (03:33 -0800)]
x86: qemu: Add a text base for 64-bit U-Boot
Set up the 64-bit U-Boot text base if building for that target.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng [Wed, 18 Jan 2017 11:33:00 +0000 (03:33 -0800)]
tools: binman: Handle optional microcode case in SPL image
On platforms which do not require microcode in SPL, handle such
case like U-Boot proper.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng [Wed, 18 Jan 2017 11:32:59 +0000 (03:32 -0800)]
tools: binman: Call correct init for Entry_u_boot_spl_with_ucode_ptr
u_boot_spl_with_ucode_ptr is derived from u_boot_with_ucode_ptr,
hence it should call its parent's init.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng [Wed, 18 Jan 2017 11:32:58 +0000 (03:32 -0800)]
x86: qemu: Mark ucode as optional for SPL in u-boot.dtsi
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>
Bin Meng [Wed, 18 Jan 2017 11:32:57 +0000 (03:32 -0800)]
x86: qemu: Set up device tree for SPL
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>
Bin Meng [Wed, 18 Jan 2017 11:32:56 +0000 (03:32 -0800)]
x86: qemu: Fix compiler warnings for 64-bit
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>
Bin Meng [Wed, 18 Jan 2017 11:32:55 +0000 (03:32 -0800)]
x86: qemu: Hide arch_cpu_init() and print_cpuinfo() for U-Boot proper
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>
Bin Meng [Wed, 18 Jan 2017 11:32:54 +0000 (03:32 -0800)]
x86: Compile irq.c for 64-bit
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>
Bin Meng [Wed, 18 Jan 2017 11:32:53 +0000 (03:32 -0800)]
x86: spl: Add weak arch_cpu_init_dm()
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>
Bin Meng [Wed, 18 Jan 2017 11:32:52 +0000 (03:32 -0800)]
x86: Wrap print_ch() with config option
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>
Bin Meng [Wed, 18 Jan 2017 11:32:51 +0000 (03:32 -0800)]
x86: qemu: Add missing DECLARE_GLOBAL_DATA_PTR in e820.c
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>
Simon Glass [Mon, 16 Jan 2017 14:04:27 +0000 (07:04 -0700)]
x86: link: Add a config for 64-bit U-Boot
Add a new board config which uses 64-bit U-Boot. This is not fully
functional but is it a start. Missing features:
- SDRAM sizing
- Booting linux
- EFI support
- SCSI device init
(and others)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:04:26 +0000 (07:04 -0700)]
x86: Update compile/link flags to support 64-bit U-Boot
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>
Simon Glass [Mon, 16 Jan 2017 14:04:25 +0000 (07:04 -0700)]
x86: link: Add build options for SPL
If SPL is used we want to use the generic SPL framework and boot from SPI
via a board-specific means. Add these options to the board config file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:04:24 +0000 (07:04 -0700)]
x86: link: Set up device tree for SPL
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>
Simon Glass [Mon, 16 Jan 2017 14:04:23 +0000 (07:04 -0700)]
x86: link: Add SPL declarations to the binman image
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>
Simon Glass [Mon, 16 Jan 2017 14:04:22 +0000 (07:04 -0700)]
x86: link: Add a text base for 64-bit U-Boot
Set up the 64-bit U-Boot text base if building for that target.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:04:21 +0000 (07:04 -0700)]
x86: Add a dummy setjmp implementation for x86_64
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>
Simon Glass [Mon, 16 Jan 2017 14:04:20 +0000 (07:04 -0700)]
x86: Move setjmp to the i386 directory
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>
Simon Glass [Mon, 16 Jan 2017 14:04:19 +0000 (07:04 -0700)]
x86: Move call64 to the i386 directory
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>
Simon Glass [Mon, 16 Jan 2017 14:04:18 +0000 (07:04 -0700)]
x86: Change irq_already_routed to a local variable
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>
Simon Glass [Mon, 16 Jan 2017 14:04:17 +0000 (07:04 -0700)]
x86: Move turbo_state to global_data
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>
Simon Glass [Mon, 16 Jan 2017 14:04:16 +0000 (07:04 -0700)]
x86: Move pirq_routing_table to global_data
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>
Simon Glass [Mon, 16 Jan 2017 14:04:15 +0000 (07:04 -0700)]
x86: Support jumping from SPL to U-Boot
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>
Simon Glass [Mon, 16 Jan 2017 14:04:14 +0000 (07:04 -0700)]
x86: Drop interrupt support in 64-bit mode
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>
Simon Glass [Mon, 16 Jan 2017 14:04:13 +0000 (07:04 -0700)]
x86: Don't try to boot Linux from SPL
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>
Simon Glass [Mon, 16 Jan 2017 14:04:12 +0000 (07:04 -0700)]
x86: Don't build 32-bit efi files on x86_64
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>
Simon Glass [Mon, 16 Jan 2017 14:04:11 +0000 (07:04 -0700)]
x86: Don't build cpu files which are not supported on 64-bit
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>
Simon Glass [Mon, 16 Jan 2017 14:04:10 +0000 (07:04 -0700)]
x86: Don't build call64 and setjmp on 64-bit
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>
Simon Glass [Mon, 16 Jan 2017 14:04:09 +0000 (07:04 -0700)]
x86: Don't try to run the VGA BIOS in 64-bit mode
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>
Simon Glass [Mon, 16 Jan 2017 14:04:08 +0000 (07:04 -0700)]
x86: ivybridge: Provide a dummy SDRAM init for 64-bit
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>
Simon Glass [Mon, 16 Jan 2017 14:04:07 +0000 (07:04 -0700)]
x86: ivybridge: Skip SATA init in SPL
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>
Simon Glass [Mon, 16 Jan 2017 14:04:06 +0000 (07:04 -0700)]
x86: Fix up type sizes for 64-bit
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>
Simon Glass [Mon, 16 Jan 2017 14:04:05 +0000 (07:04 -0700)]
x86: Drop flag_is_changable() on x86_64
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>
Simon Glass [Mon, 16 Jan 2017 14:04:04 +0000 (07:04 -0700)]
x86: Fix up byteorder.h for x86_64
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>
Simon Glass [Mon, 16 Jan 2017 14:04:03 +0000 (07:04 -0700)]
x86: Add SPL build rules for start-up code
When SPL is used we need to build the 16-bit start-up code. Add Makefile
rules to handle this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:04:02 +0000 (07:04 -0700)]
x86: Add a link script for SPL
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>
Simon Glass [Mon, 16 Jan 2017 14:04:01 +0000 (07:04 -0700)]
x86: Add a link script for 64-bit x86
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>
Simon Glass [Mon, 16 Jan 2017 14:04:00 +0000 (07:04 -0700)]
x86: Fix up CONFIG_X86_64 check
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>
Simon Glass [Mon, 16 Jan 2017 14:03:59 +0000 (07:03 -0700)]
x86: Support global_data on x86_64
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>
Simon Glass [Mon, 16 Jan 2017 14:03:58 +0000 (07:03 -0700)]
x86: Add cpu code for x86_64
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>
Simon Glass [Mon, 16 Jan 2017 14:03:57 +0000 (07:03 -0700)]
x86: Move the i386 code into its own directory
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>
Simon Glass [Mon, 16 Jan 2017 14:03:56 +0000 (07:03 -0700)]
x86: Add an SPL implementation
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>
Simon Glass [Mon, 16 Jan 2017 14:03:55 +0000 (07:03 -0700)]
x86: Tidy up use of size_t in relocation
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>
Simon Glass [Mon, 16 Jan 2017 14:03:54 +0000 (07:03 -0700)]
x86: Add support for 64-bit relocation
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>
Simon Glass [Mon, 16 Jan 2017 14:03:53 +0000 (07:03 -0700)]
x86: Refactor relocation to prepare for 64-bit
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>
Simon Glass [Mon, 16 Jan 2017 14:03:52 +0000 (07:03 -0700)]
x86: Do relocation before clearing BSS
The BSS region may overlap with relocations. If we clear BSS we will
overwrite the start of the relocation area. This doesn't matter when running
from SPI flash, since it is read-only. But when relocating 64-bit U-Boot
from one place in RAM to another, relocation will fail because some of its
relocations have been zeroed.
To fix this, put the ELF fixup call before the BSS clearing call.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:51 +0000 (07:03 -0700)]
x86: board_r: Set the global data pointer after relocation
Since 'gd' is just a normal variable on 64-bit x86, it is relocated by the
time we get to board_init_r(). The old 'gd' variable is passed in as
parameter to board_init_r(), presumably for this situation.
Assign it on 64-bit x86 so that gd points to the correct data.
Options to improve this:
- Make gd a fixed register and remove the board_init_r() parameter
- Make all archs use this board_init_r() parameter
The second has a TODO in the code. The first has a TODO in a future commit
('x86: Support global_data on x86_64')
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:50 +0000 (07:03 -0700)]
board_f/r: Use static const for the init sequences
These tables should be declared static const. Unfortunately the table in
board_r is updated on machines with manual relocation.
Update them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:49 +0000 (07:03 -0700)]
x86: board_f: Update init sequence for 64-bit startup
Adjust the code so that 64-bit startup works. Since we don't need to do CAR
changes in U-Boot proper anymore (they are done in SPL) we can simplify the
flow and return normally from board_init_f().
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:48 +0000 (07:03 -0700)]
x86: Add 64-bit start-up code
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>
Simon Glass [Mon, 16 Jan 2017 14:03:47 +0000 (07:03 -0700)]
x86: ivybridge: Allow 32-bit init to move to SPL
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>
Simon Glass [Mon, 16 Jan 2017 14:03:46 +0000 (07:03 -0700)]
x86: Use X86_32BIT_INIT instead of X86_RESET_VECTOR
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>
Simon Glass [Mon, 16 Jan 2017 14:03:45 +0000 (07:03 -0700)]
x86: Use X86_16BIT_INIT instead of X86_RESET_VECTOR
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>
Simon Glass [Mon, 16 Jan 2017 14:03:44 +0000 (07:03 -0700)]
x86: Kconfig: Add location options for 16/32-bit init
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>
Simon Glass [Mon, 16 Jan 2017 14:03:43 +0000 (07:03 -0700)]
x86: Add Kconfig options to build 64-bit U-Boot
Add a new CONFIG_X86_64 option which will eventually cause U-Boot to be
built as a 64-bit application, with SPL doing the 16/32-bit init.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:42 +0000 (07:03 -0700)]
x86: lib: Fix types and casts for 64-bit compilation
Fix various compiler warnings in the x86 library code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:41 +0000 (07:03 -0700)]
x86: fsp: Fix cast for 64-bit compilation
Fix a cast in get_next_hob() that causes warnings on 64-bit machines.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:40 +0000 (07:03 -0700)]
x86: dts: Mark serial as needed before relocation
We almost always need the serial port before relocation, so mark it as such.
This will ensure that it appears in the device tree for SPL, if used.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:39 +0000 (07:03 -0700)]
x86: ivybridge: Fix types for 64-bit compilation
Fix a few types that causes warnings on 64-bit machines.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:38 +0000 (07:03 -0700)]
x86: ivybridge: Add more debugging for failures
Add various debug() messages in places where errors occur. This aids with
debugging.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:37 +0000 (07:03 -0700)]
x86: ivybridge: Declare global data where it is used
Some files are missing this declaration. Add it to avoid build errors when
we actually need the declaration.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:36 +0000 (07:03 -0700)]
x86: Update mpspec to build on 64-bit machines
At present this uses u32 to store an address. We should use unsigned long
and avoid special types in function return values and parameters unless
necessary. This makes the code more portable.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:35 +0000 (07:03 -0700)]
x86: Use unsigned long for address in table generation
We should use unsigned long rather than u32 for addresses. Update this so
that the table-generation code builds correctly on 64-bit machines.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:34 +0000 (07:03 -0700)]
spl: Don't create a BSS padding when it is separate
When BSS does not immediate follow the SPL image we don't need padding
before the device tree. Remove it in this case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:33 +0000 (07:03 -0700)]
spl: Allow PCH drivers to be used in SPL
Add an option for building Platorm Controller Hub drivers in SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:32 +0000 (07:03 -0700)]
spl: Allow timer drivers to be used in SPL
Add a new Kconfig option to allow timer drivers to be used in SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:31 +0000 (07:03 -0700)]
spl: Allow RTC drivers to be used in SPL
Add a new Kconfig option to allow RTC drivers to be used in SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:30 +0000 (07:03 -0700)]
spl: Allow PCI drivers to be used in SPL
Add a new Kconfig option to allow PCI drivers to be used in SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:29 +0000 (07:03 -0700)]
spl: Allow CPU drivers to be used in SPL
Add a new Kconfig option to allow CPU drivers to be used in SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:28 +0000 (07:03 -0700)]
spl: Makefile: Define SPL_ earlier
This Makefile variable can be used in the architecture's main Makefile but
at present it is not set up until later. Set it just before this Makefile is
included.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:27 +0000 (07:03 -0700)]
spl: spi: Add a debug message if loading fails
This currently fails silently. Add a debug message to aid debugging.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 16 Jan 2017 14:03:26 +0000 (07:03 -0700)]
console: Don't enable CONFIG-CONSOLE_MUX, etc. in SPL
CONFIG_CONSOLE_MUX and CONFIG_SYS_CONSOLE_IS_IN_ENV are not applicable
for SPL. Update the console code to use CONFIG_IS_ENABLED(), so that these
options will be inactive in SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Andy Shevchenko [Sun, 8 Jan 2017 20:51:04 +0000 (23:51 +0300)]
x86: Synchronize list of x86 subarchitectures (update bootparam.h)
Basically rename X86_SUBARCH_MRST to X86_SUBARCH_INTEL_MID to be more specific.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tom Rini [Sat, 4 Feb 2017 01:33:42 +0000 (20:33 -0500)]
Merge git://git.denx.de/u-boot-fsl-qoriq
Signed-off-by: Tom Rini <trini@konsulko.com>
Conflicts:
configs/ls1046aqds_defconfig
configs/ls1046aqds_nand_defconfig
configs/ls1046aqds_qspi_defconfig
configs/ls1046aqds_sdcard_ifc_defconfig
configs/ls1046aqds_sdcard_qspi_defconfig
configs/ls1046ardb_emmc_defconfig
configs/ls1046ardb_qspi_defconfig
configs/ls1046ardb_sdcard_defconfig
Prabhakar Kushwaha [Thu, 2 Feb 2017 09:32:00 +0000 (15:02 +0530)]
arch: powerpc: update the eLBC IP input clock
eLBC IP clock is always a constant divisor of platform clock
pre-defined per SoC. Clock ratio register (LCRR) used in
current implementation governs eLBC IP output cloc.
Update sys_info->freq_localbus to represent eLBC input clock with
value constant divisor of platform clock.
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Prabhakar Kushwaha [Thu, 2 Feb 2017 09:31:48 +0000 (15:01 +0530)]
arch: powerpc: Move CONFIG_FSL_ELBC to Kconfig
Enable ELBC from Kconfig.
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Prabhakar Kushwaha [Thu, 2 Feb 2017 09:31:37 +0000 (15:01 +0530)]
arch: arm: update the IFC IP input clock
IFC IP clock is always a constant divisor of platform clock
pre-defined per SoC. Clock control register (CCR) used in
current implementation governs IFC IP output clock.
Update sys_info->freq_localbus to represent IFC input clock with
value constant divisor of platform clock.
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Prabhakar Kushwaha [Thu, 2 Feb 2017 09:31:26 +0000 (15:01 +0530)]
arch: powerpc: update the IFC IP input clock
IFC IP clock is always a constant divisor of platform clock
pre-defined per SoC. Clock control register (CCR) used in
current implementation governs IFC IP output clock.
Update sys_info->freq_localbus to represent IFC input clock with
value constant divisor of platform clock.
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Prabhakar Kushwaha [Thu, 2 Feb 2017 09:31:13 +0000 (15:01 +0530)]
arch: powerpc: Move CONFIG_FSL_IFC to Kconfig
Enable IFC from Kconfig.
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>