platform/kernel/u-boot.git
8 years agoConvert CONFIG_SYS_STDIO_DEREGISTER to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:13:02 +0000 (20:13 -0600)]
Convert CONFIG_SYS_STDIO_DEREGISTER to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_STDIO_DEREGISTER

This option should never be enabled in SPL, so use
CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) when checking the option.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Re-sync]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_USB_KEYBOARD to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:13:01 +0000 (20:13 -0600)]
Convert CONFIG_USB_KEYBOARD to Kconfig

This converts the following to Kconfig:
   CONFIG_USB_KEYBOARD

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Fixup MPC86* configs]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_SYS_CONSOLE_INFO_QUIET to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:13:00 +0000 (20:13 -0600)]
Convert CONFIG_SYS_CONSOLE_INFO_QUIET to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_INFO_QUIET

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Make this default n, re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:59 +0000 (20:12 -0600)]
Convert CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_SYS_CONSOLE_ENV_OVERWRITE to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:58 +0000 (20:12 -0600)]
Convert CONFIG_SYS_CONSOLE_ENV_OVERWRITE to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_ENV_OVERWRITE

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_CONSOLE_SCROLL_LINES to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:57 +0000 (20:12 -0600)]
Convert CONFIG_CONSOLE_SCROLL_LINES to Kconfig

This converts the following to Kconfig:
   CONFIG_CONSOLE_SCROLL_LINES

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agovideo: Drop CONFIG_CONSOLE_INFO_QUIET
Simon Glass [Tue, 18 Oct 2016 02:12:55 +0000 (20:12 -0600)]
video: Drop CONFIG_CONSOLE_INFO_QUIET

This is not used in U-Boot. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agovideo: Move video_get_info_str() prototype to a header file
Simon Glass [Tue, 18 Oct 2016 02:12:54 +0000 (20:12 -0600)]
video: Move video_get_info_str() prototype to a header file

This should be defined in a header file so that arguments are checked.
Move it to video.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_CONSOLE_EXTRA_INFO to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:53 +0000 (20:12 -0600)]
Convert CONFIG_CONSOLE_EXTRA_INFO to Kconfig

This converts the following to Kconfig:
   CONFIG_CONSOLE_EXTRA_INFO

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_VIDEO_SW_CURSOR to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:51 +0000 (20:12 -0600)]
Convert CONFIG_VIDEO_SW_CURSOR to Kconfig

This converts the following to Kconfig:
   CONFIG_VIDEO_SW_CURSOR

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Re-convert, find all the cases where this is off]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agovideo: Drop CONFIG_VIDEO_HW_CURSOR
Simon Glass [Tue, 18 Oct 2016 02:12:50 +0000 (20:12 -0600)]
video: Drop CONFIG_VIDEO_HW_CURSOR

This is not used in U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_VGA_AS_SINGLE_DEVICE to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:49 +0000 (20:12 -0600)]
Convert CONFIG_VGA_AS_SINGLE_DEVICE to Kconfig

This converts the following to Kconfig:
   CONFIG_VGA_AS_SINGLE_DEVICE

Once we migrate to driver model for video, we should be able to drop this
option.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agovideo: Drop the sed13806 driver
Simon Glass [Tue, 18 Oct 2016 02:12:48 +0000 (20:12 -0600)]
video: Drop the sed13806 driver

This is not used in U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agovideo: Drop the s3c-fb driver
Simon Glass [Tue, 18 Oct 2016 02:12:47 +0000 (20:12 -0600)]
video: Drop the s3c-fb driver

This is not used in U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Minkyu Kang <mk7.kang@samsung.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agovideo: Drop the imx25lcdc driver
Simon Glass [Tue, 18 Oct 2016 02:12:46 +0000 (20:12 -0600)]
video: Drop the imx25lcdc driver

This is not used anywhere in U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agovideo: Drop the smiLynxEM driver
Simon Glass [Tue, 18 Oct 2016 02:12:45 +0000 (20:12 -0600)]
video: Drop the smiLynxEM driver

This is not used in U-Boot anymore.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_SYS_CONSOLE_BG_COL et al to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:44 +0000 (20:12 -0600)]
Convert CONFIG_SYS_CONSOLE_BG_COL et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_BG_COL
   CONFIG_SYS_CONSOLE_FG_COL

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_VIDEO_CT69000 to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:43 +0000 (20:12 -0600)]
Convert CONFIG_VIDEO_CT69000 to Kconfig

This converts the following to Kconfig:
   CONFIG_VIDEO_CT69000

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_CFB_CONSOLE_ANSI to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:42 +0000 (20:12 -0600)]
Convert CONFIG_CFB_CONSOLE_ANSI to Kconfig

This converts the following to Kconfig:
   CONFIG_CFB_CONSOLE_ANSI

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_CFB_CONSOLE to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:41 +0000 (20:12 -0600)]
Convert CONFIG_CFB_CONSOLE to Kconfig

This converts the following to Kconfig:
   CONFIG_CFB_CONSOLE

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoconfig: Drop CONFIG_CONSOLE_DEV
Simon Glass [Tue, 18 Oct 2016 02:12:39 +0000 (20:12 -0600)]
config: Drop CONFIG_CONSOLE_DEV

This is not really a config. Rename it to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoconfig: Drop CONFIG_CONSOLE
Simon Glass [Tue, 18 Oct 2016 02:12:38 +0000 (20:12 -0600)]
config: Drop CONFIG_CONSOLE

This is not really a config. Rename it to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoConvert CONFIG_SYS_CONSOLE_IS_IN_ENV and CONFIG_CONSOLE_MUX to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:37 +0000 (20:12 -0600)]
Convert CONFIG_SYS_CONSOLE_IS_IN_ENV and CONFIG_CONSOLE_MUX to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_IS_IN_ENV
   CONFIG_CONSOLE_MUX

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Re-order, re-migrate]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_LCD to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:56 +0000 (20:12 -0600)]
Convert CONFIG_LCD to Kconfig

This converts the following to Kconfig:
   CONFIG_LCD

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoConvert CONFIG_VIDEO to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:40 +0000 (20:12 -0600)]
Convert CONFIG_VIDEO to Kconfig

This converts the following to Kconfig:
   CONFIG_VIDEO

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoConvert CONSOLE_PRE_CONSOLE_BUFFER options to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:36 +0000 (20:12 -0600)]
Convert CONSOLE_PRE_CONSOLE_BUFFER options to Kconfig

Move these option to Kconfig and tidy up existing uses.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoConvert SILENT_CONSOLE options to Kconfig
Simon Glass [Tue, 18 Oct 2016 02:12:35 +0000 (20:12 -0600)]
Convert SILENT_CONSOLE options to Kconfig

Move these option to Kconfig and tidy up existing uses.

The Power PC boards don't have a suitable common element: the common header
files don't appear to line up with the Kconfig files as far as I can tell.
This results in a lot of defconfig changes.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jteki@openedev.com>
[trini: Re-migrate, update common/console.c logic]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoRemove some merge markers
Simon Glass [Tue, 18 Oct 2016 02:12:34 +0000 (20:12 -0600)]
Remove some merge markers

These two files have patch merge markers in them, within comments or
strings. Remove then, so that a search for merge markers does not show up
matches in these files.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agotest/py: ensure a log section exists for skipped tests
Stephen Warren [Mon, 17 Oct 2016 23:25:52 +0000 (17:25 -0600)]
test/py: ensure a log section exists for skipped tests

In pytest 3, runtestprotocol() may not call pytest_runtest_setup() if
the test is skipped. That call is required to create a section for the
test in the log file. If this is skipped, the call to log.end_section()
at the tail of pytest_runtest_protocol() will throw an exception. This
patch ensures that a log section always exists, both to avoid the
exception and to ensure that a consistently structured log file is
always created.

Cc: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reported-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Tom Rini <trini@konsulko.com>
8 years agoMerge tag 'signed-efi-next' of git://github.com/agraf/u-boot
Tom Rini [Wed, 19 Oct 2016 11:48:16 +0000 (07:48 -0400)]
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot

Patch queue for efi - 2016-10-19

Highlights this time around:

  - Add run time service (power control) support for PSCI (fixed in v3)
  - Add efi gop pointer exposure
  - SMBIOS support for EFI (on ARM)
  - efi pool memory unmap support (needed for 4.8)
  - initial x86 efi payload support (fixed up in v2)
  - various bug fixes

Signed-off-by: Tom Rini <trini@konsulko.com>
Conflicts:
include/tables_csum.h

8 years agoefi_loader: Revert device_handle to disk after net boot
Alexander Graf [Tue, 18 Oct 2016 13:49:40 +0000 (15:49 +0200)]
efi_loader: Revert device_handle to disk after net boot

When you boot an efi payload from network, then exit that payload
and load another payload from disk afterwords, the disk payload will
currently see the network device as its boot path.

This breaks grub2 for example which tries to find its modules based
on the path it was loaded from.

This patch fixes that issue by always reverting to disk paths if we're
not in the network boot. That way the data structures after a network
boot look the same as before.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Rename EFI_RUNTIME_{TEXT, DATA} to __efi_runtime{, _data}
Alexander Graf [Fri, 14 Oct 2016 11:45:30 +0000 (13:45 +0200)]
efi_loader: Rename EFI_RUNTIME_{TEXT, DATA} to __efi_runtime{, _data}

Compiler attributes are more commonly __foo style tags rather than big
upper case eye sores like EFI_RUNTIME_TEXT.

Simon Glass felt quite strongly about this, so this patch converts our
existing defines over to more eye friendly ones.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: efi: Add EFI loader support for x86
Simon Glass [Sun, 25 Sep 2016 21:27:35 +0000 (15:27 -0600)]
x86: efi: Add EFI loader support for x86

Add the required pieces to support the EFI loader on x86.

Since U-Boot only builds for 32-bit on x86, only a 32-bit EFI application
is supported. If a 64-bit kernel must be booted, U-Boot supports this
directly using FIT (see doc/uImage.FIT/kernel.its). U-Boot can act as a
payload for both 32-bit and 64-bit EFI.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi: Fix missing EFIAPI specifiers
Simon Glass [Sun, 25 Sep 2016 21:27:32 +0000 (15:27 -0600)]
efi: Fix missing EFIAPI specifiers

These are missing in some functions. Add them to keep things consistent.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi: Use asmlinkage for EFIAPI
Simon Glass [Sun, 25 Sep 2016 21:27:31 +0000 (15:27 -0600)]
efi: Use asmlinkage for EFIAPI

This is required for x86 and is also correct for ARM (since it is empty).

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agosmbios: Provide serial number
Alexander Graf [Thu, 18 Aug 2016 23:23:31 +0000 (01:23 +0200)]
smbios: Provide serial number

If the system has a valid "serial#" environment variable set (which boards that
can find it out programatically set automatically), use that as input for the
serial number and UUID fields in the SMBIOS tables.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoefi_loader: Fix efi_install_configuration_table
Alexander Graf [Thu, 18 Aug 2016 23:23:30 +0000 (01:23 +0200)]
efi_loader: Fix efi_install_configuration_table

So far we were only installing the FDT table and didn't have space
to store any other. Hence nobody realized that our efi table allocation
was broken in that it didn't set the indicator for the number of tables
plus one.

This patch fixes it, allowing code to allocate new efi tables.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agosmbios: Expose in efi_loader as table
Alexander Graf [Thu, 18 Aug 2016 23:23:29 +0000 (01:23 +0200)]
smbios: Expose in efi_loader as table

We can pass SMBIOS easily as EFI configuration table to an EFI payload. This
patch adds enablement for that case.

While at it, we also enable SMBIOS generation for ARM systems, since they support
EFI_LOADER.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agosmbios: Generate type 4 on non-x86 systems
Alexander Graf [Thu, 18 Aug 2016 23:23:28 +0000 (01:23 +0200)]
smbios: Generate type 4 on non-x86 systems

The type 4 table generation code is very x86 centric today. Refactor things
out into the device model cpu class to allow the tables to get generated for
other architectures as well.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agocpu: Add get_vendor callback
Alexander Graf [Thu, 18 Aug 2016 23:23:27 +0000 (01:23 +0200)]
cpu: Add get_vendor callback

The CPU udevice already has a few callbacks to retreive information
about the currently running CPUs. This patch adds a new get_vendor()
call that returns the vendor of the main CPUs.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agocpu: Add DMTF id and family fields
Alexander Graf [Thu, 18 Aug 2016 23:23:26 +0000 (01:23 +0200)]
cpu: Add DMTF id and family fields

For SMBIOS tables we need to know the CPU family as well as CPU IDs. This
patches allocates some space for them in the cpu device and populates it
on x86.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agosmbios: Allow compilation on 64bit systems
Alexander Graf [Thu, 18 Aug 2016 23:23:25 +0000 (01:23 +0200)]
smbios: Allow compilation on 64bit systems

The SMBIOS generation code passes pointers as u32. That causes the compiler
to warn on casts to pointers. This patch moves all address pointers to
uintptr_t instead.

Technically u32 would be enough for the current SMBIOS2 style tables, but
we may want to extend the code to SMBIOS3 in the future which is 64bit
address capable.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoefi_loader: Expose efi_install_configuration_table
Alexander Graf [Thu, 18 Aug 2016 23:23:24 +0000 (01:23 +0200)]
efi_loader: Expose efi_install_configuration_table

We want to be able to add configuration table entries from our own code as
well as from EFI payload code. Export the boot service function internally
too, so that we can reuse it.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: Move smbios generation into arch independent directory
Alexander Graf [Thu, 18 Aug 2016 23:23:23 +0000 (01:23 +0200)]
x86: Move smbios generation into arch independent directory

We will need the SMBIOS generation function on ARM as well going forward,
so let's move it into a non arch specific location.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: Move table csum into separate file
Alexander Graf [Thu, 18 Aug 2016 23:23:21 +0000 (01:23 +0200)]
x86: Move table csum into separate file

We need the checksum function without all the other table functionality
soon, so let's split it out into its own C file.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agoefi_loader: gop: Expose fb when 32bpp
Alexander Graf [Mon, 6 Jun 2016 22:57:05 +0000 (00:57 +0200)]
efi_loader: gop: Expose fb when 32bpp

When we're running in 32bpp mode, expose the frame buffer address
to our payloads so that Linux efifb can pick it up.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Allow bouncing for network
Alexander Graf [Tue, 6 Sep 2016 12:26:27 +0000 (14:26 +0200)]
efi_loader: Allow bouncing for network

So far bounce buffers were only used for disk I/O, but network I/O
may suffer from the same problem.

On platforms that have problems doing DMA on high addresses, let's
also bounce outgoing network packets. Incoming ones always already
get bounced.

This patch fixes EFI PXE boot on ZynqMP for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Add generic PSCI RTS
Alexander Graf [Tue, 16 Aug 2016 19:08:49 +0000 (21:08 +0200)]
efi_loader: Add generic PSCI RTS

Now that we have generic PSCI reset and shutdown support in place, we can
advertise those as EFI Run Time Services, allowing efi applications and
OSs to reset and shut down systems.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoarm: Provide common PSCI based reset handler
Alexander Graf [Tue, 16 Aug 2016 19:08:48 +0000 (21:08 +0200)]
arm: Provide common PSCI based reset handler

Most armv8 systems have PSCI support enabled in EL3, either through
ARM Trusted Firmware or other firmware.

On these systems, we do not need to implement system reset manually,
but can instead rely on higher level firmware to deal with it.

The exclude list seems excessive right now, but NXP is working on
providing an in-tree PSCI implementation, so that all NXP systems
can eventually use PSCI as well.

Signed-off-by: Alexander Graf <agraf@suse.de>
[agraf: fix meson]
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-uniphier
Tom Rini [Tue, 18 Oct 2016 22:48:04 +0000 (18:48 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-uniphier

8 years agoMerge git://git.denx.de/u-boot-x86
Tom Rini [Tue, 18 Oct 2016 14:20:26 +0000 (10:20 -0400)]
Merge git://git.denx.de/u-boot-x86

8 years agox86: Add implementations of setjmp() and longjmp()
Simon Glass [Tue, 18 Oct 2016 02:29:07 +0000 (20:29 -0600)]
x86: Add implementations of setjmp() and longjmp()

Bring in these functions from Linux v4.4. They will be needed for EFI loader
support.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Move table csum into separate header
Alexander Graf [Thu, 18 Aug 2016 23:23:22 +0000 (01:23 +0200)]
x86: Move table csum into separate header

We need the checksum function without all the other table functionality
soon, so let's split it out into its own header file.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoarm: Add PSCI shutdown function
Alexander Graf [Tue, 16 Aug 2016 19:08:47 +0000 (21:08 +0200)]
arm: Add PSCI shutdown function

Using PSCI you can not only reset the system, you can also shut it down!
This patch exposes a function to do exactly that to whatever code wants
to make use of it.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoarm: Disable HVC PSCI calls by default
Alexander Graf [Tue, 16 Aug 2016 19:08:46 +0000 (21:08 +0200)]
arm: Disable HVC PSCI calls by default

All systems that are running on armv8 are running bare metal with firmware
that implements PSCI running in EL3. That means we don't really need to expose
the hypercall variants of them.

This patch leaves the code in, but makes the code explicit enough to have the
compiler optimize it out. With this we don't need to worry about hvc vs smc
calling convention when calling psci helper functions.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoefi_loader: Allow boards to implement get_time and reset_system
Alexander Graf [Tue, 16 Aug 2016 19:08:45 +0000 (21:08 +0200)]
efi_loader: Allow boards to implement get_time and reset_system

EFI allows an OS to leverage firmware drivers while the OS is running. In the
generic code we so far had to stub those implementations out, because we would
need board specific knowledge about MMIO setups for it.

However, boards can easily implement those themselves. This patch provides the
framework so that a board can implement its own versions of get_time and
reset_system which would actually do something useful.

While at it we also introduce a simple way for code to reserve MMIO pointers
as runtime available.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Do not leak memory when unlinking a mapping
Stefan Brüns [Sat, 1 Oct 2016 21:32:29 +0000 (23:32 +0200)]
efi_loader: Do not leak memory when unlinking a mapping

As soon as a mapping is unlinked from the list, there are no further
references to it, so it should be freed. If it not unlinked,
update the start address and length.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Keep memory mapping sorted when splitting an entry
Stefan Brüns [Sat, 1 Oct 2016 21:32:28 +0000 (23:32 +0200)]
efi_loader: Keep memory mapping sorted when splitting an entry

The code assumes sorted mappings in descending address order. When
splitting a mapping, insert the new part next to the current mapping.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Readd freed pages to memory pool
Stefan Brüns [Sat, 1 Oct 2016 21:32:27 +0000 (23:32 +0200)]
efi_loader: Readd freed pages to memory pool

Currently each allocation creates a new mapping. Readding the mapping
as free memory (EFI_CONVENTIONAL_MEMORY) potentially allows to hand out
an existing mapping, thus limiting the number of mapping descriptors in
the memory map.

Mitigates a problem with current (4.8rc7) linux kernels when doing an
efi_get_memory map, resulting in an infinite loop. Space for the memory
map is reserved with allocate_pool (implicitly creating a new mapping) and
filled. If there is insufficient slack space (8 entries) in the map, the
space is freed and a new round is started, with space for one more entry.
As each round increases requirement and allocation by exactly one, there
is never enough slack space. (At least 32 entries are allocated, so as
long as there are less than 24 entries, there is enough slack).
Earlier kernels reserved no slack, and did less allocations, so this
problem was not visible.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Track size of pool allocations to allow freeing
Stefan Brüns [Sun, 9 Oct 2016 20:17:26 +0000 (22:17 +0200)]
efi_loader: Track size of pool allocations to allow freeing

We need a functional free_pool implementation, as otherwise each
allocate_pool causes growth of the memory descriptor table.

Different to free_pages, free_pool does not provide the size for the
to be freed allocation, thus we have to track the size ourselves.

As the only EFI requirement for pool allocation is an alignment of
8 bytes, we can keep allocating a range using the page allocator,
reserve the first 8 bytes for our bookkeeping and hand out the
remainder to the caller. This saves us from having to use any
independent data structures for tracking.

To simplify the conversion between pool allocations and the corresponding
page allocation, we create an auxiliary struct efi_pool_allocation.

Given the allocation size free_pool size can handoff freeing the page
range, which was indirectly allocated by a call to allocate_pool,
to free_pages.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Move efi_allocate_pool implementation to efi_memory.c
Stefan Brüns [Sun, 9 Oct 2016 20:17:18 +0000 (22:17 +0200)]
efi_loader: Move efi_allocate_pool implementation to efi_memory.c

We currently handle efi_allocate_pool() in our boot time service
file. In the following patch, pool allocation will receive additional
internal semantics that we should preserve inside efi_memory.c instead.

As foundation for those changes, split the function into an externally
facing efi_allocate_pool_ext() for use by payloads and an internal helper
efi_allocate_pool() in efi_memory.c that handles the actual allocation.

While at it, change the magic 0xfff / 12 constants to the more obvious
EFI_PAGE_MASK/SHIFT defines.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Fix crash on 32-bit systems
Robin Randhawa [Tue, 13 Sep 2016 17:36:53 +0000 (18:36 +0100)]
efi_loader: Fix crash on 32-bit systems

A type mismatch in the efi_allocate_pool boot service flow causes
hazardous memory scribbling on 32-bit systems.

This is efi_allocate_pool's prototype:

static efi_status_t EFIAPI efi_allocate_pool(int pool_type,
    unsigned long size,
    void **buffer);

Internally, it invokes efi_allocate_pages as follows:

efi_allocate_pages(0, pool_type, (size + 0xfff) >> 12,
    (void*)buffer);

This is efi_allocate_pages' prototype:

efi_status_t efi_allocate_pages(int type, int memory_type,
unsigned long pages,
uint64_t *memory);

The problem: efi_allocate_pages does this internally:

    *memory = addr;

This fix in efi_allocate_pool uses a transitional uintptr_t cast to
ensure the correct outcome, irrespective of the system's native word
size.

This was observed when bootefi'ing the EFI instance of FreeBSD's first
stage bootstrap (boot1.efi) on a 32-bit ARM platform (Qemu VExpress +
Cortex-a9).

Signed-off-by: Robin Randhawa <robin.randhawa@arm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Fix memory map size check to avoid out-of-bounds access
Stefan Brüns [Sun, 9 Oct 2016 20:17:07 +0000 (22:17 +0200)]
efi_loader: Fix memory map size check to avoid out-of-bounds access

The current efi_get_memory_map() function overwrites the map_size
property before reading its value. That way the sanity check whether our
memory map fits into the given array always succeeds, potentially
overwriting arbitrary payload memory.

This patch moves the property update write after its sanity check, so
that the check actually verifies the correct value.

So far this has not triggered any known bugs, but we're better off safe
than sorry.

If the buffer is to small, the returned memory_map_size indicates the
required size to the caller.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoefi_loader: Update description of internal efi_mem_carve_out
Stefan Brüns [Sat, 1 Oct 2016 21:32:23 +0000 (23:32 +0200)]
efi_loader: Update description of internal efi_mem_carve_out

In 74c16acce30bb882ad5951829d8dafef8eea564c the return values where
changed, but the description was kept.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoARM: uniphier: update doc/README.uniphier
Masahiro Yamada [Mon, 17 Oct 2016 13:20:16 +0000 (22:20 +0900)]
ARM: uniphier: update doc/README.uniphier

 - Rephrase the toolchains section.  Leave only Linaro toolchains
   since it is the most tested these days.

 - Add build instruction for ARMv8 SoC boards

 - Add information about "ddrmphy" command

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: remove unnecessary EHCI reset deassertion
Masahiro Yamada [Mon, 17 Oct 2016 13:18:03 +0000 (22:18 +0900)]
ARM: uniphier: remove unnecessary EHCI reset deassertion

It is now deasserted by the reset controller driver.  Drop the
ad-hoc code.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: dts: uniphier: sync DT with latest Linux
Masahiro Yamada [Fri, 7 Oct 2016 07:43:00 +0000 (16:43 +0900)]
ARM: dts: uniphier: sync DT with latest Linux

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoclk: uniphier: rework UniPhier clk driver
Masahiro Yamada [Mon, 17 Oct 2016 13:18:01 +0000 (22:18 +0900)]
clk: uniphier: rework UniPhier clk driver

The initial design of the UniPhier clk driver for U-Boot was not
very nice.  Here is a re-work to sync it with Linux's clk and reset
drivers, maximizing the code reuse from Linux's clk data.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: remove unneeded CONFIG_USB_MAX_CONTROLLER_COUNT define
Masahiro Yamada [Thu, 13 Oct 2016 15:39:59 +0000 (00:39 +0900)]
ARM: uniphier: remove unneeded CONFIG_USB_MAX_CONTROLLER_COUNT define

ARCH_UNIPHIER selects DM_USB, where CONFIG_USB_MAX_CONTROLLER_COUNT
is not used.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoARM: uniphier: fix addresses of Cortex-A72 gear setting macros
Masahiro Yamada [Wed, 12 Oct 2016 12:14:38 +0000 (21:14 +0900)]
ARM: uniphier: fix addresses of Cortex-A72 gear setting macros

My mistake during copy-paste work.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agopinctrl: uniphier: fix unused-const-variable warnings for GCC 6.x
Masahiro Yamada [Sun, 9 Oct 2016 14:52:57 +0000 (23:52 +0900)]
pinctrl: uniphier: fix unused-const-variable warnings for GCC 6.x

Marek reports warnings in UniPhier pinctrl drivers when compiled by
GCC 6.x, like:

  drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c:58:18: warning:
  'usb3_muxvals' defined but not used [-Wunused-const-variable=]
   static const int usb3_muxvals[] = {0, 0};
                    ^~~~~~~~~~~~

My intention here is to compile minimum set of pin data for SPL to
save memory footprint, but GCC these days is clever enough to notice
unused data arrays.

We can fix it by sprinkling around __maybe_unused on those arrays,
but I did not do that because they are counterparts of the pinctrl
drivers in Linux.  All the pin data were just copy-pasted from Linux
and are kept in sync for maintainability.

I chose a bit tricky way to fix the issue; calculate ARRAY_SIZE of
*_pins and *_muxvals and set their sum to an unused struct member.
This trick will satisfy GCC because the data arrays are used anyway,
but such data arrays will be dropped from the final binary because
the pointers to them are not used.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reported-by: Marek Vasut <marex@denx.de>
8 years agowatchdog: Fix Watchdog Reset while in U-Boot Prompt
Andreas J. Reichel [Wed, 13 Jul 2016 10:56:51 +0000 (12:56 +0200)]
watchdog: Fix Watchdog Reset while in U-Boot Prompt

Hardware: CM-FX6 Module from Compulab

This patch fixes unwanted watchdog resets while the user enters
a command at the U-Boot prompt.

As found on the CM-FX6 board from Compulab, when having enabled the
watchdog, a missing WATCHDOG_RESET call in common/console.c causes
this and alike boards to reset when the watchdog's timeout has
elapsed while waiting at the U-Boot prompt.

Despite the user could press several keys within the watchdog
timeout limit, the while loop in cli_readline.c, line 261, does only
call WATCHDOG_RESET if first == 1, which gets set to 0 in the 1st
loop iteration. This leads to a watchdog timeout no matter if the
user presses keys or not.

Although, this affects other boards as well as it touches
common/console.c, the macro WATCHDOG_RESET expands to {} if watchdog
support isn't configured. Hence, there's no harm caused and no need to
surround it by #ifdef in this case.

 * Symptom:
   U-Boot resets after watchdog times out when in commandline prompt
   and watchdog is enabled.

 * Reasoning:
   When U-Boot shows the commandline prompt, the following function
   call stack is executed while waiting for a keypress:

   common/main.c:
                    main_loop          => common/cli.c: cli_loop() =>
   common/cli_hush.c:
                    parse_file_outer   => parse_stream_outer       =>
                    parse_stream       => b_getch(i)               =>
                    i->get(i)          => file_get                 =>
                    get_user_input     => cmdedit_read_input       =>
                    uboot_cli_readline =>
   common/cli_readline.c:
                    cli_readline       => cli_readline_into_buffer =>
                    cread_line         => getcmd_getch (== getc)   =>
   common/console.c:
                    fgetc              => console_tstc

   common/console.c:
   (with CONFIG_CONSOLE_MUX is set)

   - in console_tstc line 181:
   If dev->tstc(dev) returns 0, the global tstcdev variable doesn't get
   set. This is the case if no character is in the serial buffer.

   - in fgetc(int file), line 297:
   Program flow keeps looping because tstcdev does not get set.
   Therefore WATCHDOG_RESET is not called, as mx_serial_tstc from
   drivers/serial/serial_mxc.c does not call it.

 * Solution:
   Add WATCHDOG_RESET into the loop of console_tstc.

   Note: Macro expands to {} if not configured, so no #ifdef is needed.

 * Comment:

Signed-off-by: Christian Storm <christian.storm@tngtech.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andreas J. Reichel <Andreas.Reichel@tngtech.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agoPrepare v2016.11-rc2 v2016.11-rc2
Tom Rini [Tue, 18 Oct 2016 00:09:33 +0000 (20:09 -0400)]
Prepare v2016.11-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoMerge git://git.denx.de/u-boot-mpc85xx
Tom Rini [Sat, 15 Oct 2016 17:03:19 +0000 (13:03 -0400)]
Merge git://git.denx.de/u-boot-mpc85xx

8 years agospl: move FDT_FIXUP_PARTITIONS to Kconfig
Heiko Schocher [Thu, 6 Oct 2016 05:31:45 +0000 (07:31 +0200)]
spl: move FDT_FIXUP_PARTITIONS to Kconfig

Move FDT_FIXUP_PARTITIONS to Kconfig and cleanup existing
uses.

Signed-off-by: Heiko Schocher <hs@denx.de>
8 years agospl: move SYS_OS_BASE to Kconfig
Heiko Schocher [Thu, 6 Oct 2016 05:55:16 +0000 (07:55 +0200)]
spl: move SYS_OS_BASE to Kconfig

Move SYS_OS_BASE to Kconfig and cleanup existing
uses.

Signed-off-by: Heiko Schocher <hs@denx.de>
[trini: Also migrate a4m2k]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agospl: move SPL_OS_BOOT to Kconfig
Heiko Schocher [Thu, 6 Oct 2016 05:55:15 +0000 (07:55 +0200)]
spl: move SPL_OS_BOOT to Kconfig

Move SPL_OS_BOOT to Kconfig and cleanup existing
uses.

Signed-off-by: Heiko Schocher <hs@denx.de>
8 years agotest/py/tests/test_sleep.py: Add check for CONFIG_CMD_MISC
Tom Rini [Fri, 14 Oct 2016 23:12:31 +0000 (19:12 -0400)]
test/py/tests/test_sleep.py: Add check for CONFIG_CMD_MISC

We can only run this command if the sleep command is enabled and that
depends on CONFIG_CMD_MISC

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoARM: create .secure_stack section only for PSCI
Masahiro Yamada [Mon, 26 Sep 2016 05:21:30 +0000 (14:21 +0900)]
ARM: create .secure_stack section only for PSCI

Jon Master reports that QEMU refuses to load a U-Boot image built
with CONFIG_ARMV7_NONSEC, but without CONFIG_ARMV7_PSCI since
commit 5a3aae68c74e ("ARM: armv7: guard memory reserve for PSCI
with #ifdef CONFIG_ARMV7_PSCI").

It looks like only PSCI that needs the Secure stack, so move
the #ifdef to guard the whole of .secure_stack allocation in order
not to create the empty section.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reported-by: Jon Masters <jcm@redhat.com>
Link: http://patchwork.ozlabs.org/patch/664025/
8 years agoarch: powerpc: Remove unused dts frequency fixup for lbc_clk
Prabhakar Kushwaha [Fri, 30 Sep 2016 08:57:15 +0000 (14:27 +0530)]
arch: powerpc: Remove unused dts frequency fixup for lbc_clk

lbc_clk is used to fixup dts as "bus frequency".
It is not being used by Linux IFC and eLBC driver.

So remove unused "bus frqeuency" fix-up of devicre tree.

Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
8 years agopbl: use "wait" command instead of "flush" command
Zhao Qiang [Thu, 8 Sep 2016 04:55:33 +0000 (12:55 +0800)]
pbl: use "wait" command instead of "flush" command

PBL flush command is restricted to CCSR memory space. So use WAIT
PBI command to provide enough time for data to get flush in
target memory.

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
[York Sun: rewrap commit message]
Reviewed-by: York Sun <york.sun@nxp.com>
8 years agoTxxx/RCW: Split unified RCW to RCWs for sd, spi and nand.
Zhao Qiang [Thu, 8 Sep 2016 04:55:32 +0000 (12:55 +0800)]
Txxx/RCW: Split unified RCW to RCWs for sd, spi and nand.

T series boards use unified RCW for sd, spi and nand boot.
Now split txxx_rcw.cfg to txxx_sd_rcw.cfg, txxx_spi_rcw.cfg
and txxx_nand_rcw.cfg for SPI/NAND/SD boot.
And modify RCW[PBI_SRC] for them:
PBI_SRC=5            for SPI 24-bit addressing
PBI_SRC=6            for SD boot
PBI_SRC=14           for IFC NAND boot

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
8 years agoMerge git://git.denx.de/u-boot-fdt
Tom Rini [Fri, 14 Oct 2016 00:03:33 +0000 (20:03 -0400)]
Merge git://git.denx.de/u-boot-fdt

8 years agolibfdt: Drop inlining of fdt_path_offset()
Simon Glass [Sun, 2 Oct 2016 23:59:30 +0000 (17:59 -0600)]
libfdt: Drop inlining of fdt_path_offset()

The fdt_path_offset() function is not inlined in upstream libfdt. Adjust
U-Boot's version to match.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agolibfdt: Sync fdt_for_each_subnode() with upstream
Simon Glass [Sun, 2 Oct 2016 23:59:29 +0000 (17:59 -0600)]
libfdt: Sync fdt_for_each_subnode() with upstream

The signature for this macro has changed. Bring in the upstream version and
adjust U-Boot's usages to suit.

Signed-off-by: Simon Glass <sjg@chromium.org>
Update to drivers/power/pmic/palmas.c:
Signed-off-by: Keerthy <j-keerthy@ti.com>
Change-Id: I6cc9021339bfe686f9df21d61a1095ca2b3776e8

8 years agolibfdt: Bring in upstream stringlist functions
Simon Glass [Sun, 2 Oct 2016 23:59:28 +0000 (17:59 -0600)]
libfdt: Bring in upstream stringlist functions

These have now landed upstream. The naming is different and in one case the
function signature has changed. Update the code to match.

This applies the following upstream commits by
Thierry Reding <treding@nvidia.com> :

   604e61e fdt: Add functions to retrieve strings
   8702bd1 fdt: Add a function to get the index of a string
   2218387 fdt: Add a function to count strings

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agolibfdt: Sync up with upstream
Simon Glass [Sun, 2 Oct 2016 23:59:27 +0000 (17:59 -0600)]
libfdt: Sync up with upstream

This includes small changes to the following functions, from upstream
commit 6d1832c:

- fdt_get_max_phandle() (upstream commit 84e0e134)
- fdt_node_check_compatible (upstream commit 53bf130b)
- fdt_setprop_inplace_namelen_partial() to remove useless brackets and
     use idx instead of index
- _fdt_resize_property() to use idx instead of index
- _fdt_splice() (upstream commit d4c7c25c)

It also includes various typo fixes in libfdt.h

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agolibfdt: Fix undefined behaviour in fdt_offset_ptr()
David Gibson [Sun, 2 Oct 2016 23:59:26 +0000 (17:59 -0600)]
libfdt: Fix undefined behaviour in fdt_offset_ptr()

Using pointer arithmetic to generate a pointer outside a known object is,
technically, undefined behaviour in C.  Unfortunately, we were using that
in fdt_offset_ptr() to detect overflows.

To fix this we need to do our bounds / overflow checking on the offsets
before constructing pointers from them.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agocmd/fdt: add possibilty to have 'extrasize' on fdt resize
Hannes Schmelzer [Tue, 20 Sep 2016 16:10:43 +0000 (18:10 +0200)]
cmd/fdt: add possibilty to have 'extrasize' on fdt resize

Sometimes devicetree nodes and or properties are added out of the u-boot
console, maybe through some script or manual interaction.

The devicetree as loaded or embedded is quite small, so the devicetree
has to be resized to take up those new nodes/properties.

In original the devicetree was only extended by effective
4 * add_mem_rsv.

With this commit we can add an argument to the "fdt resize" command,
which takes the extrasize to be added.

Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-net
Tom Rini [Thu, 13 Oct 2016 17:38:49 +0000 (13:38 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-net

8 years agonet: smsc95xx: fix DM MAC address reading
Stephen Warren [Thu, 15 Sep 2016 18:53:22 +0000 (12:53 -0600)]
net: smsc95xx: fix DM MAC address reading

eth-uclass.c expects DM-capable Ethernet adapters to implement ops->
read_rom_hwaddr(), or for some other mechanism to set pdata->enetaddr, or
for the user to set environment variable $usbethaddr. Without any of
these, it will refuse to initialize the device since no valid MAC address
is known. Implement this function for the smsc95xx driver.

With this feature implemented, there is no point smsc95xx_init_common()
re-reading the MAC address from ROM, so ifdef out this code when DM_ETH
is enabled.

This allows (at least) the built-in Ethernet on the NVIDIA Harmony board
to operate again.

Fixes: 0990fcb77219 ("net: smsc95xx: Add driver-model support")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agotest: add NFS download test
Guillaume GARDET [Wed, 14 Sep 2016 08:29:12 +0000 (10:29 +0200)]
test: add NFS download test

Add a NFS download test, based on TFTP test.
Tested on i.MX6 SabreLite board.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@konsulko.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: Fix cache misalignment message after network load operations
Peter Chubb [Wed, 14 Sep 2016 03:49:22 +0000 (03:49 +0000)]
net: Fix cache misalignment message after network load operations

After any operation that downloads a file (e.g., pxe get, or dhcp), the
buffer containing the downloaded data is flushed.  This is unnecessary
and annoying.  Unnecessary, because
the network driver should already have fliushed the cache for the DMAed area,
and annoying because it generates a cache misalignment message.

Signed-off-by: Peter Chubb <peter.chubb@data61.csiro.au>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agortl8169: fix cache misalignment message on transmit.
Peter Chubb [Wed, 14 Sep 2016 01:29:03 +0000 (01:29 +0000)]
rtl8169: fix cache misalignment message on transmit.

The call to flush cache on the transmit buffer was misplaced (for very
short packets) and asked to flush less than a cacheline.

Move the flush cache call to after a short packet has been padded
to minimum length (so the padding is flushed too), and round the size
up to a cacheline.

Signed-off-by: Peter Chubb <peter.chubb@data61.csiro.au>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: write enetaddr down to hardware on env_callback
Hannes Schmelzer [Fri, 2 Sep 2016 12:48:17 +0000 (14:48 +0200)]
net: write enetaddr down to hardware on env_callback

If mac-address is changed using "setenv ethaddr ...." command the new
mac-adress also must be written into the responsible ethernet driver.

Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: mvneta: fix typo in comment
Chris Packham [Mon, 29 Aug 2016 08:54:02 +0000 (20:54 +1200)]
net: mvneta: fix typo in comment

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: mv88e61xx: Add support for fixed links
Chris Packham [Fri, 26 Aug 2016 05:30:26 +0000 (17:30 +1200)]
net: mv88e61xx: Add support for fixed links

On some boards these switches are wired directly into a SERDES
interface on another Ethernet MAC. Add the ability to specify
these kinds of boards using CONFIG_MV88E61XX_FIXED_PORTS which defines
a bit mask of these fixed ports.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: Add support for mv88e609x switches
Chris Packham [Fri, 26 Aug 2016 05:30:25 +0000 (17:30 +1200)]
net: Add support for mv88e609x switches

The Marvell Link Street mv88e60xx is a series of FastEthernet switch
chips, some of which also support Gigabit ports. It is similar to the
mv88e61xx series which support Gigabit on all ports.

The main difference is the number of ports. Which affects the
PORT_COUNT define and the size of the mask passed to
mv88e61xx_port_set_vlan().

Other than that it's just a matter of adding the appropriate chip
IDs.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Cc: Joshua Scott <joshua.scott@alliedtelesis.co.nz>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agoboard: am335x: Always set eth/eth1addr environment variable
Roger Quadros [Wed, 24 Aug 2016 12:35:51 +0000 (15:35 +0300)]
board: am335x: Always set eth/eth1addr environment variable

Ethernet ports might be used in the kernel even if CPSW driver
is disabled at u-boot. So always set ethaddr and eth1addr
environment variable from efuse.

Retain usbnet_devaddr as it is required for SPL USB eth boot.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agoboard: am335x-icev2: add ethernet phy mode detection logic
Roger Quadros [Wed, 24 Aug 2016 12:35:50 +0000 (15:35 +0300)]
board: am335x-icev2: add ethernet phy mode detection logic

Both ethernet ports can be used as CPSW ethernet (RMII mode)
or PRU ethernet (MII mode) by setting the jumper near the port.
Read the jumper value and set the pinmux, external mux and
PHY clock accordingly.

As jumper line is overridden by PHY RX_DV pin immediately
after bootstrap (power-up/reset), we have to use GPIO edge
detection to capture the jumper line status.

As u-boot doesn't provide any infrastructure for GPIO edge
detection, we directly access the GPIO registers.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>