oweals/u-boot.git
8 years agoboard: dra7: fit: add support for selecting dtb dynamically
Lokesh Vutla [Mon, 16 May 2016 05:21:23 +0000 (10:51 +0530)]
board: dra7: fit: add support for selecting dtb dynamically

FIT allows for a multiple dtb in a single image. SPL needs a way to
detect the right dtb to be used. Adding support for the same.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agoRemove unused BOOTFLAG definitions
Chris Packham [Fri, 13 May 2016 01:08:56 +0000 (13:08 +1200)]
Remove unused BOOTFLAG definitions

This follows on from commit d98b052 ("powerpc: Cleanup BOOTFLAG_*
references") and commit fc3d297 ("Drop bogus BOOTFLAG_* definitions").
Remove the definitions that have crept in since.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
8 years agospl: Add an option to load a FIT containing U-Boot from UART
Lokesh Vutla [Tue, 24 May 2016 05:04:44 +0000 (10:34 +0530)]
spl: Add an option to load a FIT containing U-Boot from UART

This provides a way to load a FIT containing U-Boot and a selection of device
tree files from UART.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agospl: fit: Do not print selected dtb during fit load
Lokesh Vutla [Tue, 24 May 2016 05:04:43 +0000 (10:34 +0530)]
spl: fit: Do not print selected dtb during fit load

No prints should be allowed during UART load.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agospl: Support loading a FIT from NAND
Lokesh Vutla [Tue, 24 May 2016 05:04:42 +0000 (10:34 +0530)]
spl: Support loading a FIT from NAND

Detect a FIT when loading from NAND and handle it using the
new FIT SPL support.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
[trini: Make sure we continue to use (void *)(unsigned long) for
load_addr].
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agomtd: nand: am335x: spl: Fix copying of image
Lokesh Vutla [Tue, 24 May 2016 05:04:41 +0000 (10:34 +0530)]
mtd: nand: am335x: spl: Fix copying of image

When offset is not aligned to page address, it is possible that extra offset
will be read from nand. Adjust the image such that first byte of the image
is at load address after the first page is read.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agospl: Support loading a FIT from SPI
Lokesh Vutla [Tue, 24 May 2016 05:04:40 +0000 (10:34 +0530)]
spl: Support loading a FIT from SPI

Detect a FIT when loading from SPI and handle it using the
new FIT SPL support.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agospl: Support loading a FIT from FAT FS
Lokesh Vutla [Tue, 24 May 2016 05:04:39 +0000 (10:34 +0530)]
spl: Support loading a FIT from FAT FS

Detect a FIT when loading from a FAT File system and handle it using the
new FIT SPL support.

Tested-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agospl: Allow to load a FIT containing U-Boot from FS
Lokesh Vutla [Tue, 24 May 2016 05:04:38 +0000 (10:34 +0530)]
spl: Allow to load a FIT containing U-Boot from FS

This provides a way to load a FIT containing U-Boot and a selection of device
tree files from a File system. Making sure that all the reads and writes
are aligned to their respective needs.

Tested-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
[trini: Make this still apply with Michal's alignment change for 'fit']
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agospl: fit: Fix the number of bytes read when reading fdt from fit
Lokesh Vutla [Tue, 24 May 2016 05:04:37 +0000 (10:34 +0530)]
spl: fit: Fix the number of bytes read when reading fdt from fit

sectors field is not being updated when reading fdt from fit image. Because of
this size_of(u-boot.bin) is being read when reading fdt. Fixing it by updating
the sectors field properly.

Tested-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agodefconfig: ti: Add configs for OMAP5-class secure parts
Daniel Allred [Fri, 20 May 2016 00:10:55 +0000 (19:10 -0500)]
defconfig: ti: Add configs for OMAP5-class secure parts

Adds new defconfig files for DRA7xx and AM57xx secure devices.
These are the same as the non-secure parts, but with the addition
of the CONFIG_TI_SECURE_DEVICE option set to 'y'.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Madan Srinivas <madans@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: omap5: add ft_board_setup for dra7xx/am57xx
Daniel Allred [Fri, 20 May 2016 00:10:54 +0000 (19:10 -0500)]
ARM: omap5: add ft_board_setup for dra7xx/am57xx

Adds the board specific ft_board_setup() functions that
are called when CONFIG_OF_BOARD_SETUP is defined. These functions
will currently just call the ft_cpu_setup() function.

Adds CONFIG_OF_BOARD_SETUP to the defconfig files
for dra72_evm, dra74_evm, and am57xx_evm.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Madan Srinivas <madans@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: omap5: add hooks for cpu/SoC fdt fixups
Daniel Allred [Fri, 20 May 2016 00:10:53 +0000 (19:10 -0500)]
ARM: omap5: add hooks for cpu/SoC fdt fixups

Adds an fdt.c file in that defines the ft_cpu_setup() function,
which should be called from a board-specific ft_board_setup()).
This ft_cpu_setup() will currently do nothing for non-secure (GP)
devices but contains pertinent updates for booting on secure (HS)
devices.

Update the omap5 Makefile to include the fdt.c in the build.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Madan Srinivas <madans@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: omap-common: Add device type to CPU string
Daniel Allred [Fri, 20 May 2016 00:10:52 +0000 (19:10 -0500)]
ARM: omap-common: Add device type to CPU string

Update the CPU string output so that the device
type is now included as part of the CPU string that
is printed as the SPL or u-boot comes up. This update
adds a suffix of the form "-GP" or "-HS" for production
devices, so that general purpose (GP) and high security
(HS) can be distiguished. Applies to all OMAP5 variants.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Madan Srinivas <madans@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agospl: build: ti: add support for secure boot images
Daniel Allred [Fri, 20 May 2016 00:10:51 +0000 (19:10 -0500)]
spl: build: ti: add support for secure boot images

Updates the SPL build so that when CONFIG_TI_SECURE_DEVICE
is in use (which it should be when building for secure parts),
the TI secure development package is used to create a valid
secure boot image. The u-boot SPL build processes is NOT aware
of the details of creating the boot image - all of that information
is encapsulated in the TI secure development package, which is
available from TI. More info can be found in README.ti-secure

Right now, two image types are generated, MLO and X-LOADER. The types
are important, as certain boot modes implemented by the device's ROM
boot loader require one or the other (they are not equivalent). The
output filenames are u-boot-spl_HS_MLO and u-boot-spl_HS_X-LOADER. The
u-boot-spl_HS_MLO image is also copied to a file named MLO, which is
the name that the device ROM bootloader requires for loading from the
FAT partition of an SD card (same as on non-secure devices).

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Madan Srinivas <madans@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoti_omap5_common: Update SPL start address on secure parts
Daniel Allred [Fri, 20 May 2016 00:10:50 +0000 (19:10 -0500)]
ti_omap5_common: Update SPL start address on secure parts

Updated the CONFIG_SPL_TEXT_BASE to support secure parts (moving
the start address past secure reserved memory and the size of the
security certificate that precedes the boot image on secure devices).
Updated the related CONFIG_SPL_MAX_SIZE to properly reflect the
internal memory actually available on the various device flavors
(Common minimum internal RAM guaranteed for various flavors of
DRA7xx/AM57xx is 512KB).

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Madan Srinivas <madans@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agodefconfig: Add a config for AM43xx secure part
Madan Srinivas [Fri, 20 May 2016 00:10:49 +0000 (19:10 -0500)]
defconfig: Add a config for AM43xx secure part

Adds a new defconfig file for the AM43xx secure device.
This is the same as for the non-secure part, except for:
CONFIG_TI_SECURE_DEVICE option set to 'y'
CONFIG_ISW_ENTRY_ADDR updated for secure images.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Madan Srinivas <madans@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoti: AM43xx: board: Detect AM43xx HS EVM
Madan Srinivas [Fri, 20 May 2016 00:10:48 +0000 (19:10 -0500)]
ti: AM43xx: board: Detect AM43xx HS EVM

Adds code to detect AM43xx HS EVMS - the string in the
I2C EEPROM for HS EVMs differs from GP EVMs. Adds code to
for evm detection, regardless of whether the evm is for
GP or HS parts, and updates board init to use that.

Modifies findfdt command to pick up am437x-gp-evm.dtb for
the HS EVMs also, as the boards are similar except for
some security specific changes around power supply and
enclosure protection.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoti: AM43xx: Use CONFIG options from SOC Kconfig
Madan Srinivas [Fri, 20 May 2016 00:10:47 +0000 (19:10 -0500)]
ti: AM43xx: Use CONFIG options from SOC Kconfig

Updates configs/am43xx_evm.h to use CONFIG options from
SOC specific Kconfig file for various calculations.

On AM43x devices, the address of SPL entry point  depends on
the device type, i.e. whether it is secure or non-secure.

Further, for non-secure devices, the SPL entry point is different
between  USB HOST boot mode, other "memory" boot modes (MMC, NAND)
and "peripheral" boot modes (UART, USB)

To add to the complexity, on secure devices, in addition to the
above differences, the SPL entry point can change because of the
space occupied by other components (other than u-boot or spl)
that go into a secure boot image.

To prevent the user from having to modify source files every time
any component of the secure image changes, the value of
CONFIG_SPL_TEXT_BASE has been set using a Kconfig option that
is supplied in the am43xx_*_defconfig files

Using the CONFIG options also enables us to do away with some
compile time flags that were used to specify CONFIG_SPL_TEXT_BASE
for different boot modes.

On QSPI devices, the same problem described above occurs w.r.t. the
address of the u-boot entry point in flash, when booting secure
devices. To handle this, CONFIG_SYS_TEXT_BASE is also setup via
a Kconfig option and the defconfig files.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Daniel Allred <d-allred@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoti: AM43xx: config.mk: Add support for generating secure boot images
Daniel Allred [Fri, 20 May 2016 00:10:46 +0000 (19:10 -0500)]
ti: AM43xx: config.mk: Add support for generating secure boot images

Modifies the config.mk to build secure images when building
the SPL for secure devices.

Depending on the boot media, different images are needed
for secure devices. The build generates u-boot*_HS_* files
as appropriate for the different boot modes. The same u-boot
binary file is processed slightly differently to produce a
different boot image, depending on whether the user wants to
boot off SPI, QSPI or other boot media.

Refer to README.ti-secure for more information.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Daniel Allred <d-allred@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoti: omap-common: Add commands for generating secure SPL images
Daniel Allred [Fri, 20 May 2016 00:10:45 +0000 (19:10 -0500)]
ti: omap-common: Add commands for generating secure SPL images

Adds a centralized config_secure.mk in omap-common for
OMAP-style TI secure devices to use for boot image generation

Depending on the boot media, different images are needed for
secure devices. These commands generates u-boot*_HS_* files that
need to be used to boot secure devices.

Please refer to README.ti-secure for more information.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Madan Srinivas <madans@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoti: omap-common: Add Kconfig file for secure device support
Madan Srinivas [Fri, 20 May 2016 00:10:44 +0000 (19:10 -0500)]
ti: omap-common: Add Kconfig file for secure device support

Defines CONFIG_TI_SECURE_DEVICE which needs to be turned on
when building images for secure devices. This flag is used
to invoke the secure image creation tools for creating a
boot image that can be used on secure devices. This flag
may also be used to conditionally compile code specific
to secure devices.

This terminology will be used by all OMAP architecture devices,
hence introducing to a common location.

With the creation of Kconfig for omap-common, moved the
sourcing of the Kconfig files for the omap3/4/5 and am33xx
devices from arch/arm/KConfig to the omap-common one.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Daniel Allred <d-allred@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoarm: Kconfig: Add support for AM43xx SoC specific Kconfig
Madan Srinivas [Fri, 20 May 2016 00:10:43 +0000 (19:10 -0500)]
arm: Kconfig: Add support for AM43xx SoC specific Kconfig

Adding support for AM43xx secure devices require the addition
of some SOC specific config options like the amount of memory
used by public ROM and the address of the entry point of u-boot
or SPL, as seen by the ROM code, for the image to be built
correctly.

This mandates the addition of am AM43xx CONFIG option and the
ARM Kconfig file has been modified to source this SOC Kconfig
file. Moving the TARGET_AM43XX_EVM config option to the SOC
KConfig and out of the arch/arm/Kconfig.

Updating defconfigs to add the CONFIG_AM43XX=y statement and
removing the #define CONFIG_AM43XX from the header file.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Daniel Allred <d-allred@ti.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoarm: am33xx: Kconfig: Add secure device definitions
Madan Srinivas [Fri, 20 May 2016 00:10:42 +0000 (19:10 -0500)]
arm: am33xx: Kconfig: Add secure device definitions

Adds a new Kconfig file for AM33xx class devices. We
need a common place to define CONFIG parameters
for these SOCs, especially for adding support
for secure devices.

a) Adds a definition for ISW_ENTRY_ADDR. This is the
address to which the ROM branches when the SOC
ROM hands off execution to the boot loader.
CONFIG_SYS_TEXT_BASE and CONFIG_SPL_TEXT_BASE are set
to this value for AM43xx devices.

b) Adds CONFIG_PUB_ROM_DATA_SIZE which is used to
calculate CONFIG_SPL_MAX_SIZE. This value indicates the
amount of memory needed by the ROM to store data during
the boot process.

Currently, these CONFIG options are used only by AM43xx,
but in future other AM33xx class SOCs will also use them.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Daniel Allred <d-allred@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agodoc: Add info on using secure devices from TI
Daniel Allred [Fri, 20 May 2016 00:10:41 +0000 (19:10 -0500)]
doc: Add info on using secure devices from TI

Adds doc/README.ti-secure file to explain in generic terms
how boot images need to be created for secure devices from
Texas Instruments.

Specific details for creating secure boot images for the
AM43xx, DRA7xx and AM57xx secure devices from Texas
Instruments are also provided in the README file.

Secure devices require a security development package (SECDEV)
package that can be downloaded from:

http://www.ti.com/mysecuresoftware

Login is required and access is granted under appropriate NDA
and export control restrictions.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Daniel Allred <d-allred@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoDelete tests of CONFIG_OF_LIBFDT when testing CONFIG_OF_BOARD_SETUP
Robert P. J. Day [Thu, 19 May 2016 19:23:12 +0000 (15:23 -0400)]
Delete tests of CONFIG_OF_LIBFDT when testing CONFIG_OF_BOARD_SETUP

Since CONFIG_OF_BOARD_SETUP depends on CONFIG_OF_LIBFDT:

  config OF_BOARD_SETUP
          bool "Set up board-specific details in device tree before boot"
          depends on OF_LIBFDT
          ...

remove superfluous tests of CONFIG_OF_LIBFDT when testing for
CONFIG_OF_BOARD_SETUP.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
[trini: Typo fix: s/ifdefi/ifdef/]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agotest/py: Support setting up specific timeout
Michal Simek [Thu, 19 May 2016 05:57:41 +0000 (07:57 +0200)]
test/py: Support setting up specific timeout

Large file transfers, flash erasing and more complicated tests
requires more time to finish. Provide a way to setup specific
timeout directly in test.

For example description for 50s test:
timeout = 50000
with u_boot_console.temporary_timeout(timeout):
  u_boot_console.run_command(...)

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
8 years agoefi_loader: gop: Don't expose fb address
Alexander Graf [Wed, 18 May 2016 00:04:24 +0000 (02:04 +0200)]
efi_loader: gop: Don't expose fb address

Recently Linux is gaining support for efifb on AArch64 and that support actually
tries to make use of the frame buffer address we expose to it via gop.

While this wouldn't be bad in theory, in practice it means a few bad things

  1) We expose 16bit frame buffers as 32bit today
  2) Linux can't deal with overlapping non-PCI regions between efifb and
     a different frame buffer driver

For now, let's just disable exposure of the frame buffer address. Most OSs that
get booted will have a native driver for the GPU anyway.

Signed-off-by: Alexander Graf <agraf@suse.de>
[trini: Remove line_len entirely]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoefi_loader: Clean up system table on exit
Alexander Graf [Tue, 17 May 2016 22:54:47 +0000 (00:54 +0200)]
efi_loader: Clean up system table on exit

We put the system table into our runtime services data section so that
payloads may still access it after exit_boot_services. However, most fields
in it are quite useless once we're in that state, so let's just patch them
out.

With this patch we don't get spurious warnings when running EFI binaries
anymore.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agotools/env: no global variable sharing between application and library
Andreas Fenkart [Tue, 5 Apr 2016 21:13:42 +0000 (23:13 +0200)]
tools/env: no global variable sharing between application and library

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
8 years agoMARVELL: Delete now-superfluous board/Marvell/{common, include} dirs.
Robert P. J. Day [Sun, 15 May 2016 16:12:07 +0000 (12:12 -0400)]
MARVELL: Delete now-superfluous board/Marvell/{common, include} dirs.

With dropping support for some boards and the deletion of some source
files, it appears that both of these directories are now superfluous.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
8 years agoDrop HAVE_GENERIC_BOARD and SYS_GENERIC_BOARD options
Simon Glass [Sun, 15 May 2016 00:49:37 +0000 (18:49 -0600)]
Drop HAVE_GENERIC_BOARD and SYS_GENERIC_BOARD options

These are no longer used. The migration is complete. Drop these options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Angelo Dureghello <angelo@sysam.it>
Acked-by: Andreas Bießmann <andreas@biessmann.org>
8 years agoDrop references to CONFIG_SYS_GENERIC_BOARD in config files
Simon Glass [Sun, 15 May 2016 00:49:36 +0000 (18:49 -0600)]
Drop references to CONFIG_SYS_GENERIC_BOARD in config files

This option is no longer used so need not be enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoDrop use of CONFIG_SYS_GENERIC_BOARD in U-Boot
Simon Glass [Sun, 15 May 2016 00:49:35 +0000 (18:49 -0600)]
Drop use of CONFIG_SYS_GENERIC_BOARD in U-Boot

This option is always enabled and is about to be removed. Drop references
to it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
8 years agopowerpc: Drop unused code related to generic board
Simon Glass [Sun, 15 May 2016 00:49:34 +0000 (18:49 -0600)]
powerpc: Drop unused code related to generic board

Since generic board init is enabled, this is not used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agomips: Drop unused code in u-boot.h
Simon Glass [Sun, 15 May 2016 00:49:33 +0000 (18:49 -0600)]
mips: Drop unused code in u-boot.h

Since generic board init is enabled, this is not used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
8 years agom68k: Drop unused code in u-boot.h
Simon Glass [Sun, 15 May 2016 00:49:32 +0000 (18:49 -0600)]
m68k: Drop unused code in u-boot.h

Since generic board init is enabled, this is not used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Angelo Dureghello <angelo@sysam.it>
8 years agoavr32: Drop unused code in u-boot.h
Simon Glass [Sun, 15 May 2016 00:49:31 +0000 (18:49 -0600)]
avr32: Drop unused code in u-boot.h

Since generic board init is enabled, this is not used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andreas Bießmann <andreas@biessmann.org>
8 years agosh: Drop the arch-specific board init
Simon Glass [Sun, 15 May 2016 00:49:30 +0000 (18:49 -0600)]
sh: Drop the arch-specific board init

It is well past the deadline for conversion to generic board init. Remove
the old code.

Please test this and perhaps send a follow-up patch if needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosh: Fix build errors for generic board
Simon Glass [Sun, 15 May 2016 00:49:29 +0000 (18:49 -0600)]
sh: Fix build errors for generic board

This includes the following fixes:
- Define needed __init_end symbol - see initr_reloc_global_data()
- Drop SH-specific struct bd_info
- Add an empty relocate_code() function

This prevents build errors with generic board, but the code will still need
work. Perhaps this is a better alternative than deleting the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoboard_f: Don't require CONFIG_SYS_MONITOR_BASE
Simon Glass [Sun, 15 May 2016 00:49:28 +0000 (18:49 -0600)]
board_f: Don't require CONFIG_SYS_MONITOR_BASE

Allow this to be unset, such that gd->mon_len is invalid. This seems to be
what the sh architecture does.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoRemove/update old generic-board documentation and warning
Simon Glass [Sun, 15 May 2016 00:49:27 +0000 (18:49 -0600)]
Remove/update old generic-board documentation and warning

Remove the warning from the Makefile, since boards that do not use generic
board will no longer build. Also update documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
8 years agoopenrisc: Drop the arch-specific board init
Simon Glass [Sun, 15 May 2016 00:49:26 +0000 (18:49 -0600)]
openrisc: Drop the arch-specific board init

It is well past the deadline for conversion to generic board init. Remove
the old code.

Stefan, can you test this please and perhaps send a follow-up patch if needed?

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agousb: dwc3: Makefile: Don't build gadget code if USB_GADGET is disabled
Roger Quadros [Fri, 13 May 2016 12:17:52 +0000 (15:17 +0300)]
usb: dwc3: Makefile: Don't build gadget code if USB_GADGET is disabled

It is pointless to build gadget driver if USB_GADGET is disabled.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
8 years agonet: Optionally use pxe client arch from variable
Alexander Graf [Thu, 12 May 2016 13:51:45 +0000 (15:51 +0200)]
net: Optionally use pxe client arch from variable

The client architecture that we pass to a dhcp server depends on the target
payload that we want to execute. An EFI binary has a different client arch
than a legacy binary or a u-boot binary.

So let's parameterize the pxe client arch field to allow an override via
the distro script, so that our efi boot path can tell the dhcp server that
it's actually an efi firmware.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Select bounce buffers for known-bad boards
Alexander Graf [Wed, 11 May 2016 16:25:49 +0000 (18:25 +0200)]
efi_loader: Select bounce buffers for known-bad boards

We know for certain that we have 32bit DMA hardware, but 64bit addresses
on LS2085A and ZynqMP, so let's enable EFI bounce buffers for all defconfigs
on these SoCs.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Add bounce buffer support
Alexander Graf [Wed, 11 May 2016 16:25:48 +0000 (18:25 +0200)]
efi_loader: Add bounce buffer support

Some hardware that is supported by U-Boot can not handle DMA above 32bits.
For these systems, we need to come up with a way to expose the disk interface
in a safe way.

This patch implements EFI specific bounce buffers. For non-EFI cases, this
apparently was no issue so far, since we can just define our environment
variables conveniently.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agocosmetic: debug: Replace #ifdef DEBUG with debug() macro
Lukasz Majewski [Sun, 8 May 2016 06:52:21 +0000 (08:52 +0200)]
cosmetic: debug: Replace #ifdef DEBUG with debug() macro

Replace #ifdef DEBUG with dedicated debug() macro.

Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
8 years agoarm: meson: implement calls to secure monitor
Beniamino Galvani [Sun, 8 May 2016 06:30:17 +0000 (08:30 +0200)]
arm: meson: implement calls to secure monitor

Implement calls to secure monitor to read the MAC address from e-fuse.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
8 years agoarm: add initial support for Amlogic Meson and ODROID-C2
Beniamino Galvani [Sun, 8 May 2016 06:30:16 +0000 (08:30 +0200)]
arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agonet: designware: fix descriptor layout and warnings on 64-bit archs
Beniamino Galvani [Sun, 8 May 2016 06:30:15 +0000 (08:30 +0200)]
net: designware: fix descriptor layout and warnings on 64-bit archs

All members of the DMA descriptor must be 32-bit, even on 64-bit
architectures: change the type to u32 to ensure this. Also, fix
other warnings.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Use phys_addr_t not unsigned long long to test that we're within
DMA'able memory]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoarm: implement generic PSCI reset call for armv8
Beniamino Galvani [Sun, 8 May 2016 06:30:14 +0000 (08:30 +0200)]
arm: implement generic PSCI reset call for armv8

Add a psci_system_reset() which calls the SYSTEM_RESET function of
PSCI 0.2 and can be used by boards that support it to implement
reset_cpu().

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodistro: Add efi pxe boot code
Alexander Graf [Fri, 6 May 2016 19:01:07 +0000 (21:01 +0200)]
distro: Add efi pxe boot code

Now that we can expose network functionality to EFI applications,
the logical next step is to load them via pxe to execute them as
well.

This patch adds the necessary bits to the distro script to automatically
load and execute EFI payloads. It identifies the dhcp client as a uEFI
capable PXE client, hoping the server returns a tftp path to a workable
EFI binary that we can then execute.

To enable boards that don't come with a working device tree preloaded,
this patch also adds support to load a device tree from the /dtb directory
on the remote tftp server.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agonet: Move CONFIG_SPL_NET_VCI_STRING into Kconfig
Alexander Graf [Fri, 6 May 2016 19:01:05 +0000 (21:01 +0200)]
net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agonet: Fix client identifiers for ARM
Alexander Graf [Fri, 6 May 2016 19:01:04 +0000 (21:01 +0200)]
net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agonet: Move the VCI and client arch values to Kconfig
Alexander Graf [Fri, 6 May 2016 19:01:03 +0000 (21:01 +0200)]
net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agobootp: Move vendor class identifier set to function
Alexander Graf [Fri, 6 May 2016 19:01:02 +0000 (21:01 +0200)]
bootp: Move vendor class identifier set to function

Both the dhcp as well as the bootp case add vendor class identifier
parameters into their packets. Let's move that into a separate function
to make overlaying easier.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoefi_loader: Add network access support
Alexander Graf [Fri, 6 May 2016 19:01:01 +0000 (21:01 +0200)]
efi_loader: Add network access support

We can now successfully boot EFI applications from disk, but users
may want to also run them from a PXE setup.

This patch implements rudimentary network support, allowing a payload
to send and receive network packets.

With this patch, I was able to successfully run grub2 with network
access inside of QEMU's -M xlnx-ep108.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agotest/py: fix NameError exception if bdi cmd is not supported
Heiko Schocher [Fri, 6 May 2016 05:33:51 +0000 (07:33 +0200)]
test/py: fix NameError exception if bdi cmd is not supported

test/py raises an error, if a board has not enabled bdi command

>           pytest.skip('bdinfo command not supported')
E           NameError: global name 'pytest' is not defined

import pytest in test/py/u_boot_utils.py fixes this.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
8 years agocmd: replace the cast of the memory access to a fixed bit type in itest
Kunihiko Hayashi [Wed, 4 May 2016 05:20:04 +0000 (14:20 +0900)]
cmd: replace the cast of the memory access to a fixed bit type in itest

This patch fixes a bug that long word(.l) memory access in 'itest'
command reads the 8bytes of the actual memory on 64-bit architecture.
The cast to the memory pointer should use a fixed bit type.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodisk: part_efi: fix check of the max partition size
Patrick Delaunay [Mon, 2 May 2016 12:43:33 +0000 (14:43 +0200)]
disk: part_efi: fix check of the max partition size

the last value acceptable value for offset is last_usable_lba + 1
and not last_usable_lba - 1

issue found with SDCARD partition commands on u-boot 2015.10
but this part of code don't change

1- create GPT partion on all the card
  > gpt write mmc 0 name=test,start=0,size=0
  > part list mmc 0

Partition Map for MMC device 0  --   Partition Type: EFI

Part      Start LBA          End LBA                       Name
            Attributes
            Type GUID
            Partition GUID
  1        0x00000022       0x003a9fde       "test"
            attrs:     0x0000000000000000
            type:     ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
            type:     data
            guid:     b710eb04-45b9-e94a-8d0b-21458d596f54

=> Start = 0x22*512 = 0x4400
=> Size = (0x003a9fde-0x22+1) * 512  = 0x753F7A00

2- try to recreate the same partition with the next command
   (block size:512 bytes = 0x200)

  > gpt write mmc 0 name=test,start=0x4400,size=0x753F7A00
    Writing GPT: Partitions layout exceds disk size

  > gpt write mmc 0 name=test,start=0x4400,size=0x753F7800
    Writing GPT: Partitions layout exceds disk size

  > gpt write mmc 0 name=test,start=0x4400,size=0x753F7600
    Writing GPT: success!

Partition Map for MMC device 0  --   Partition Type: EFI

Part      Start LBA          End LBA                       Name
            Attributes
            Type GUID
            Partition GUID
  1        0x00000022       0x003a9fdc       "test"
            attrs:     0x0000000000000000
            type:     ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
            type:     data
            guid:     36ec30ef-7ca4-cd48-97cd-ea9fb95185d0

the max LBA when the size is indicated (0x003a9fdc) is lower than
when u-boot compute the max allowed value with size=0 (0x003a9fde)

in the code :

     /* partition ending lba */
     if ((i == parts - 1) && (partitions[i].size == 0))
/* extend the last partition to maximuim */
gpt_e[i].ending_lba = gpt_h->last_usable_lba;
     else
gpt_e[i].ending_lba = cpu_to_le64(offset - 1);

so offset = gpt_h->last_usable_lba + 1 is acceptable !
but the test (offset >= last_usable_lba) cause the error

END

Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>disk: part_efi: fix check of the max partition size
the last value acceptable value for offset is (last_usable_lba + 1)
and not (last_usable_lba - 1)

issue found with SDCARD partition commands on u-boot 2015.10
but this part of code don't change

1- I create GPT partion on all the card (start and size undefined)

  > gpt write mmc 0 name=test,start=0,size=0
  > part list mmc 0

Partition Map for MMC device 0  --   Partition Type: EFI

Part      Start LBA          End LBA                       Name
            Attributes
            Type GUID
            Partition GUID
  1        0x00000022       0x003a9fde       "test"
            attrs:     0x0000000000000000
            type:     ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
            type:     data
            guid:     b710eb04-45b9-e94a-8d0b-21458d596f54

=> Start = 0x22*512 = 0x4400
=> Size = (0x003a9fde-0x22+1) * 512  = 0x753F7A00

2- I try to recreate the same partition with the command gpt write
   and with start and size values (block size:512 bytes = 0x200)

  > gpt write mmc 0 name=test,start=0x4400,size=0x753F7A00
    Writing GPT: Partitions layout exceds disk size

  > gpt write mmc 0 name=test,start=0x4400,size=0x753F7800
    Writing GPT: Partitions layout exceds disk size

  > gpt write mmc 0 name=test,start=0x4400,size=0x753F7600
    Writing GPT: success!

  I check the partition created :

  > part list mmc 0

Partition Map for MMC device 0  --   Partition Type: EFI

Part      Start LBA          End LBA                       Name
            Attributes
            Type GUID
            Partition GUID
  1        0x00000022       0x003a9fdc       "test"
            attrs:     0x0000000000000000
            type:     ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
            type:     data
            guid:     36ec30ef-7ca4-cd48-97cd-ea9fb95185d0

=> but the max LBA when the size is indicated (0x003a9fdc) is lower than
   when u-boot compute the max allowed value with size=0 (0x003a9fde)

3- in the code, just after my patch, line 446

     /* partition ending lba */
     if ((i == parts - 1) && (partitions[i].size == 0))
/* extend the last partition to maximuim */
gpt_e[i].ending_lba = gpt_h->last_usable_lba;
     else
gpt_e[i].ending_lba = cpu_to_le64(offset - 1);

  so offset = gpt_h->last_usable_lba + 1 is acceptable !
  (it the value used when size is 0)

  but today the test (offset >= last_usable_lba) cause the error
  my patch only solve this issue

END

Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
8 years agocmd: disk: Fix unused variable warning
Marek Vasut [Sat, 30 Apr 2016 22:35:54 +0000 (00:35 +0200)]
cmd: disk: Fix unused variable warning

If serial support is not compiled into U-Boot, which may be the case
for some SPL builds, the following warning will be generated in disk.c:

cmd/disk.c: In function 'common_diskboot':
cmd/disk.c:16:6: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
  int dev, part;
      ^
The warning is a result of printf() calls being optimized away, and
thus the whole dev variable becomes indeed unused. Mark the variable
as __maybe_unused .

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoSPL: FIT: Align loading address for header
Michal Simek [Thu, 28 Apr 2016 08:36:11 +0000 (10:36 +0200)]
SPL: FIT: Align loading address for header

If bl_len is not aligned it can caused a problem because another code
expects that start is aligned.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodm: gpio: pca953x: Support PCA953X with 40 GPIOs
mario.six@gdsys.cc [Mon, 25 Apr 2016 13:25:37 +0000 (15:25 +0200)]
dm: gpio: pca953x: Support PCA953X with 40 GPIOs

A DM driver for PCA953x was recently introduced by Peng Fan, which lacked
support for the 40 GPIO versions.

This patch adds support for these chips.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Reviewed-by: Peng Fan <van.freenix@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agotools/env: compute size of usable area only once
Andreas Fenkart [Tue, 19 Apr 2016 20:43:42 +0000 (22:43 +0200)]
tools/env: compute size of usable area only once

for double buffering to work, redundant buffers must have equal size

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
8 years agotools/env: fw_printenv pass value_only as argument
Andreas Fenkart [Tue, 19 Apr 2016 20:43:41 +0000 (22:43 +0200)]
tools/env: fw_printenv pass value_only as argument

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
8 years agotools/env: remove 'extern' from function prototype in fw_env.h
Andreas Fenkart [Tue, 19 Apr 2016 20:43:40 +0000 (22:43 +0200)]
tools/env: remove 'extern' from function prototype in fw_env.h

checkpatch complains about in succeding patch. Prefer to fix all
declarations in a dedicated patch.

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
8 years agotools/env: pass key as argument to env_aes_cbc_crypt
Andreas Fenkart [Tue, 19 Apr 2016 20:43:39 +0000 (22:43 +0200)]
tools/env: pass key as argument to env_aes_cbc_crypt

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-mips
Tom Rini [Thu, 26 May 2016 00:22:48 +0000 (20:22 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-mips

8 years agomips: ath79: ar933x: Avoid warning with gcc5
Wills Wang [Sun, 22 May 2016 03:59:49 +0000 (11:59 +0800)]
mips: ath79: ar933x: Avoid warning with gcc5

GCC 5.3 report a warning: 'upper' and 'lower' may be used
uninitialized in this function [-Wmaybe-uninitialized].
Compiler might need explicit initializer.

Signed-off-by: Wills Wang <wills.wang@live.com>
8 years agomips: ath79: ar933x: Fix ethernet PHY mismatch
Wills Wang [Sun, 22 May 2016 03:59:50 +0000 (11:59 +0800)]
mips: ath79: ar933x: Fix ethernet PHY mismatch

We need reset the Ethernet Switch analog part before operation,
or the build-in Ethernet PHY don't work.

Signed-off-by: Wills Wang <wills.wang@live.com>
Acked-by: Marek Vasut <marex@denx.de>
8 years agomips: Drop JZ4740 remnants
Marek Vasut [Wed, 25 May 2016 00:17:07 +0000 (02:17 +0200)]
mips: Drop JZ4740 remnants

Remove the remnants of JZ4740 support.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Paul Burton <paul.burton@imgtec.com>
8 years agomips: Allow overriding start.S in SPL
Marek Vasut [Wed, 25 May 2016 00:17:42 +0000 (02:17 +0200)]
mips: Allow overriding start.S in SPL

Certain chips, like the JZ47xx, have extreme size constraints on the
SPL size and require custom start.S . Allow overriding the start.S
the same way ARM MXS does it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Paul Burton <paul.burton@imgtec.com>
8 years agoMIPS: Move CONFIG_SYS_TEXT_BASE to Kconfig
Paul Burton [Tue, 17 May 2016 10:56:39 +0000 (11:56 +0100)]
MIPS: Move CONFIG_SYS_TEXT_BASE to Kconfig

Move CONFIG_SYS_TEXT_BASE to Kconfig, and add default values in board
Kconfig files matching what was present in their config headers. This
will make it cleaner to conditionalise the value for Malta based on 32
vs 64 bit builds.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
8 years agomalta: Use device model & tree for UART
Paul Burton [Tue, 17 May 2016 06:43:28 +0000 (07:43 +0100)]
malta: Use device model & tree for UART

Make use of device model & device tree to probe the UART driver. This is
the initial step in bringing Malta up to date with driver model, and
allows for cleaner handling of the different I/O addresses for different
system controllers by specifying the ISA bus address instead of a
translated memory address.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
8 years agomalta: Tidy up UART address selection
Paul Burton [Tue, 17 May 2016 06:43:27 +0000 (07:43 +0100)]
malta: Tidy up UART address selection

The address of the UART differs based upon the system controller because
it's actually within the I/O port region, which is in a different
location for each system controller. Rather than handling this as 2
UARTs with the correct one selected at runtime, use I/O port accessors
for the UART such that access to it gets translated into the I/O port
region automatically.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
8 years agodm: ns16550: Don't map_physmem for I/O ports
Paul Burton [Tue, 17 May 2016 06:43:26 +0000 (07:43 +0100)]
dm: ns16550: Don't map_physmem for I/O ports

If the UART is to be accessed using I/O port accessors (inb & outb) then
using map_physmem doesn't make sense, since it operates in a different
memory space. Remove the call to map_physmem when
CONFIG_SYS_NS16550_PORT_MAPPED is defined, allowing I/O port addresses
to not be mangled by the incorrect mapping.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
8 years agofdt: Document the rest of struct of_bus
Paul Burton [Tue, 17 May 2016 06:43:25 +0000 (07:43 +0100)]
fdt: Document the rest of struct of_bus

Provide some documentation for the fields of struct of_bus, for
consistency with that provided for the new match field.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agofdt: Support for ISA busses
Paul Burton [Tue, 17 May 2016 06:43:24 +0000 (07:43 +0100)]
fdt: Support for ISA busses

Support ISA busses in much the same way as Linux does. This allows for
ISA bus addresses to be translated, and only if CONFIG_OF_ISA_BUS is
selected in order to avoid including the code in builds which won't need
it.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoarm64: fix arm64 Linux boot image header field sizes
Andre Przywara [Wed, 25 May 2016 08:48:14 +0000 (09:48 +0100)]
arm64: fix arm64 Linux boot image header field sizes

The arm64 Linux boot protocol [1] describes the fields in the Image
header as being 64-bit little endian values.
So fix the endianess conversion to use 64-bit sized operations, for
both image_size and text_offset.
Also we use a local variable for the image_size to avoid both writing
to the header and also accessing it after we actually unmapped it.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm64/booting.txt

8 years agoMerge branch 'master' of http://git.denx.de/u-boot-sunxi
Tom Rini [Wed, 25 May 2016 16:32:56 +0000 (12:32 -0400)]
Merge branch 'master' of git.denx.de/u-boot-sunxi

8 years agoMerge branch 'master' of git://git.denx.de/u-boot-uniphier
Tom Rini [Wed, 25 May 2016 16:27:44 +0000 (12:27 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-uniphier

8 years agosunxi: Olimex A20 boards: Enable LDO3 and LDO4 regulators
Stefan Mavrodiev [Mon, 23 May 2016 06:49:47 +0000 (09:49 +0300)]
sunxi: Olimex A20 boards: Enable LDO3 and LDO4 regulators

Sets LDO3 and LDO4 regulators at 2.8V. In the current config
these are off. This causes kernel to hang during
axp209 initialization.

Signed-off-by: Stefan Mavrodiev <stefan.mavrodiev@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Enable a bunch of commands by default on sunxi
Hans de Goede [Sun, 15 May 2016 11:51:58 +0000 (13:51 +0200)]
sunxi: Enable a bunch of commands by default on sunxi

Recently a set of CONFIG_CMD_FOO defines was moved from being defined
in config_distro_defaults to Kconfig, and added to all sunxi defconfigs
to compensate.

Instead of explictly selecting these in all sunxi defconfigs,
simply always select these for sunxi boards. This makes the defconfigs
simpler and ensures a consistent set of available commands across all
sunxi boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agoarm64: Pine64: update FDT files
Andre Przywara [Wed, 4 May 2016 21:15:33 +0000 (22:15 +0100)]
arm64: Pine64: update FDT files

The originally committed .dts files for the Pine64 were from an early
proof-of-concept version and should have never been committed upstream.
Replace them with much more mature versions, which also use a different
naming scheme.
Please note that at this point there is at least one binding which has
not been agreed upon, so this is subject to change.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agoarm64: sunxi: adjust default load addresses
Andre Przywara [Wed, 4 May 2016 21:15:32 +0000 (22:15 +0100)]
arm64: sunxi: adjust default load addresses

As arm64 has slightly different expectations about load addresses, lets
use a different set of default addresses for things like the kernel.
As arm64 kernels don't come with a decompressor right now, reserve some
more space for really big uncompressed kernels.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agoRevert "sunxi: Reserve ATF memory space on A64"
Andre Przywara [Wed, 4 May 2016 21:15:30 +0000 (22:15 +0100)]
Revert "sunxi: Reserve ATF memory space on A64"

The ARM Trusted Firmware (ATF) code now lives in SRAM on the Pine64/A64,
so we can claim the whole of DRAM for OS use.

This reverts commit 3ffe39ed2b66af71c7271d0cef2a248b5bf7dfdb.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Properly announce BOOT_DEVICE_BOARD as "FEL"
Bernhard Nortmann [Sun, 3 Apr 2016 11:58:00 +0000 (13:58 +0200)]
sunxi: Properly announce BOOT_DEVICE_BOARD as "FEL"

This addresses a cosmetic issue when booting a sunxi device
over USB (FEL mode), where the SPL currently would just print
"Trying to boot from ". The patch fixes that to properly read
"Trying to boot from FEL".

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Increase SPL header size to 64 bytes to avoid code corruption
Siarhei Siamashka [Sat, 14 May 2016 01:13:26 +0000 (04:13 +0300)]
sunxi: Increase SPL header size to 64 bytes to avoid code corruption

The current SPL header, created by the 'mksunxiboot' tool, has size
32 bytes. But the code in the boot ROM stores the information about
the boot media at the offset 0x28 before passing control to the SPL.
For example, when booting from the SD card, the magic number written
by the boot ROM is 0. And when booting from the SPI flash, the magic
number is 3. NAND and eMMC probably have their own special magic
numbers too.

Currently the corrupted byte is a part of one of the instructions in
the reset vectors table:

    b     reset
    ldr   pc, _undefined_instruction
    ldr   pc, _software_interrupt      <- Corruption happens here
    ldr   pc, _prefetch_abort
    ldr   pc, _data_abort
    ldr   pc, _not_used
    ldr   pc, _irq
    ldr   pc, _fiq

In practice this does not cause any visible problems, but it's still
better to fix it. As a bonus, the reported boot media type can be
later used in the 'spl_boot_device' function, but this is out of
the scope of this patch.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: power: add AXP809 support
Chen-Yu Tsai [Mon, 2 May 2016 02:28:15 +0000 (10:28 +0800)]
sunxi: power: add AXP809 support

The A80 uses the AXP809 as its primary PMIC.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Implement poweroff support for axp818 pmic
Chen-Yu Tsai [Mon, 2 May 2016 02:28:14 +0000 (10:28 +0800)]
sunxi: Implement poweroff support for axp818 pmic

Adds poweroff support for axp818 pmic.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Enable AXP818 SW for Sinovoip BPI M3
Chen-Yu Tsai [Mon, 2 May 2016 02:28:13 +0000 (10:28 +0800)]
sunxi: Enable AXP818 SW for Sinovoip BPI M3

The SW output of the PMIC supplies the ethernet PHY with power.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: power: axp818: Add support for switch SW
Chen-Yu Tsai [Mon, 2 May 2016 02:28:12 +0000 (10:28 +0800)]
sunxi: power: axp818: Add support for switch SW

The AXP818 has a switchable output, SW. This is commonly used for
controlling power to the LCD backlight.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agopower: axp818: Fix typo for fldo2 Kconfig description
Chen-Yu Tsai [Mon, 2 May 2016 02:28:11 +0000 (10:28 +0800)]
power: axp818: Fix typo for fldo2 Kconfig description

Description said eldo2 instead of fldo2, a copy-paste error.

Fixes: 38491d9c6515 ("power: axp818: Add support for FLDOs")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agopower: axp221: Remove switch case to simplify axp_set_eldo
Chen-Yu Tsai [Mon, 2 May 2016 02:28:10 +0000 (10:28 +0800)]
power: axp221: Remove switch case to simplify axp_set_eldo

The ELDO enable bits and registers are contiguous for axp221. Instead
of a switch case testing against the index, just use the index to shift
the bit or register offset.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Disable VIDEO for SoCs without display support
Chen-Yu Tsai [Mon, 2 May 2016 02:28:09 +0000 (10:28 +0800)]
sunxi: Disable VIDEO for SoCs without display support

The newer chips use a newer display pipeline, which is not supported.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Add default MMC0 card detect pin for A83T, H3 and A64 SoCs
Chen-Yu Tsai [Mon, 2 May 2016 02:28:08 +0000 (10:28 +0800)]
sunxi: Add default MMC0 card detect pin for A83T, H3 and A64 SoCs

A83T, H3, and A64 have a dedicated pin for card detect on the PF
pingroup. This is used in all designs. Set it as the default.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Sort SoC variants by family (sunXi) first, chip name second
Chen-Yu Tsai [Mon, 2 May 2016 02:28:07 +0000 (10:28 +0800)]
sunxi: Sort SoC variants by family (sunXi) first, chip name second

In most other places, we sort SoC descriptions by family (sunXi) first,
then by the chip name (A20).

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: make SoC variant choice mandatory
Chen-Yu Tsai [Mon, 2 May 2016 02:28:06 +0000 (10:28 +0800)]
sunxi: make SoC variant choice mandatory

The user should always select an SoC variant to support. Not choosing
one doesn't make sense for a bootloader.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agoARM: uniphier: add EHCI nodes for PH1-LD11
Masahiro Yamada [Tue, 24 May 2016 12:14:03 +0000 (21:14 +0900)]
ARM: uniphier: add EHCI nodes for PH1-LD11

Make the USB feature really available.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>