platform/kernel/u-boot.git
8 years agox86: Add ENABLE_MRC_CACHE Kconfig option
Bin Meng [Mon, 12 Oct 2015 04:37:35 +0000 (21:37 -0700)]
x86: Add ENABLE_MRC_CACHE Kconfig option

Create a Kconfig option for enabling MRC cache.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agox86: fsp: Add a hdr sub-command to show header information
Bin Meng [Sat, 10 Oct 2015 08:47:59 +0000 (01:47 -0700)]
x86: fsp: Add a hdr sub-command to show header information

It would be helpful to have a command to show FSP header. So far
it only supports FSP header which conforms to FSP spec 1.0.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agox86: fsp: Make hob command a sub-command to fsp
Bin Meng [Sat, 10 Oct 2015 08:47:58 +0000 (01:47 -0700)]
x86: fsp: Make hob command a sub-command to fsp

Introduce a new fsp command and make the existing hob command a
sub-command to fsp for future extension. Also move cmd_hob.c to
the dedicated fsp sub-directory in arch/x86/lib.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agox86: fsp: Print GUID whenever applicable in the hob command output
Bin Meng [Sat, 10 Oct 2015 08:47:57 +0000 (01:47 -0700)]
x86: fsp: Print GUID whenever applicable in the hob command output

When examining a HOB, it's useful to see which GUID this HOB
belongs to. Add GUID output in the hob command to aid this.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agox86: fsp: Compact the output of hob command
Bin Meng [Sat, 10 Oct 2015 08:47:56 +0000 (01:47 -0700)]
x86: fsp: Compact the output of hob command

Compact hob command output, especially by making hob type string a
little bit shorter so that we can leave room for future extension.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agox86: Add SMBIOS table support
Bin Meng [Mon, 12 Oct 2015 12:23:41 +0000 (05:23 -0700)]
x86: Add SMBIOS table support

System Management BIOS (SMBIOS) is a specification for how
motherboard and system vendors present management information
about their products in a standard format by extending the BIOS
interface on Intel architecture systems. As of today the latest
spec is 3.0 and can be downloaded from DMTF website. This commit
adds a simple and minimum required implementation.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agoMakefile: Generate U_BOOT_DMI_DATE for SMBIOS
Bin Meng [Mon, 12 Oct 2015 12:23:40 +0000 (05:23 -0700)]
Makefile: Generate U_BOOT_DMI_DATE for SMBIOS

Add U_BOOT_DMI_DATE (format mm/dd/yyyy) generation to be used by
SMBIOS tables, as required by SMBIOS spec 3.0 [1]. See chapter 7.1,
BIOS information structure offset 08h for details.

[1] http://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.0.0.pdf

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agodoc: Complement document about booting VxWorks
Bin Meng [Thu, 8 Oct 2015 03:19:20 +0000 (20:19 -0700)]
doc: Complement document about booting VxWorks

Current document about how to boot VxWorks is limited.
Add several chapters in README.vxworks to document this.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agocmd: bootvx: Add asmlinkage to the VxWorks x86 entry
Bin Meng [Thu, 8 Oct 2015 03:19:19 +0000 (20:19 -0700)]
cmd: bootvx: Add asmlinkage to the VxWorks x86 entry

VxWorks on x86 uses stack to pass parameters.

Reported-by: Jian Luo <jian.luo4@boschrexroth.de>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agocmd: bootvx: Pass E820 information to an x86 VxWorks kernel
Bin Meng [Thu, 8 Oct 2015 03:19:18 +0000 (20:19 -0700)]
cmd: bootvx: Pass E820 information to an x86 VxWorks kernel

E820 is critical to the kernel as it provides system memory map
information. Pass it to an x86 VxWorks kernel.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Jian Luo <jian.luo4@boschrexroth.de>
8 years agocmd: bootvx: Always get VxWorks bootline from env
Bin Meng [Thu, 8 Oct 2015 03:19:17 +0000 (20:19 -0700)]
cmd: bootvx: Always get VxWorks bootline from env

So far VxWorks bootline can be contructed from various environment
variables, but when these variables do not exist we get these from
corresponding config macros. This is not helpful as it requires
rebuilding U-Boot, and to make sure these config macros take effect
we should not have these environment variables. This is a little
bit complex and confusing.

Now we change the logic to always contruct the bootline from
environments (the only single source), by adding two new variables
"bootdev" and "othbootargs", and adding some comments about network
related settings mentioning they are optional. The doc about the
bootline handling is also updated.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
8 years agocmd: bootvx: Pass netmask and gatewayip to VxWorks bootline
Bin Meng [Thu, 8 Oct 2015 03:19:16 +0000 (20:19 -0700)]
cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline

There are fields in VxWorks bootline for netmask and gatewayip.
We can get these from U-Boot environment variables and pass them
to VxWorks, just like ipaddr and serverip.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agocmd: bootvx: Avoid strlen() calls when constructing VxWorks bootline
Bin Meng [Thu, 8 Oct 2015 03:19:15 +0000 (20:19 -0700)]
cmd: bootvx: Avoid strlen() calls when constructing VxWorks bootline

Remember the position in the VxWorks bootline buffer to avoid the call
to strlen() each time.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agocmd: elf: Reorder load_elf_image_phdr() and load_elf_image_shdr()
Bin Meng [Thu, 8 Oct 2015 03:19:14 +0000 (20:19 -0700)]
cmd: elf: Reorder load_elf_image_phdr() and load_elf_image_shdr()

Move load_elf_image_phdr() and load_elf_image_shdr() to the beginning
of the cmd_elf.c so that forward declaration is not needed.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agocmd: Clean up cmd_elf a little bit
Bin Meng [Thu, 8 Oct 2015 03:19:13 +0000 (20:19 -0700)]
cmd: Clean up cmd_elf a little bit

This commit cleans up cmd_elf.c per U-Boot coding convention,
and removes the unnecessary DECLARE_GLOBAL_DATA_PTR and out-of-date
powerpc comments (it actually supports not only powerpc targets).

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agocmd: Convert CONFIG_CMD_ELF to Kconfig
Bin Meng [Thu, 8 Oct 2015 03:19:12 +0000 (20:19 -0700)]
cmd: Convert CONFIG_CMD_ELF to Kconfig

Convert CONFIG_CMD_ELF to Kconfig and tidy up affected boards.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Remove quotation mark in CONFIG_HOSTNAME
Bin Meng [Thu, 8 Oct 2015 03:19:11 +0000 (20:19 -0700)]
x86: Remove quotation mark in CONFIG_HOSTNAME

CONFIG_HOSTNAME is an environment varible, so that quotation mark
is not needed.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agox86: Move install_e820_map() out of zimage.c
Bin Meng [Thu, 8 Oct 2015 03:19:10 +0000 (20:19 -0700)]
x86: Move install_e820_map() out of zimage.c

install_e820_map() has nothing to do with zimage related codes.
Move it to a dedicated place.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agox86: Initialize GDT entry 1 to be the 32-bit CS as well
Bin Meng [Thu, 8 Oct 2015 03:19:09 +0000 (20:19 -0700)]
x86: Initialize GDT entry 1 to be the 32-bit CS as well

Some OS (like VxWorks) requires GDT entry 1 to be the 32-bit CS.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Jian Luo <jian.luo4@boschrexroth.de>
8 years agox86: Allow disabling IGD on Intel Queensbay
Bin Meng [Thu, 1 Oct 2015 07:36:04 +0000 (00:36 -0700)]
x86: Allow disabling IGD on Intel Queensbay

Add a Kconfig option to disable the Integrated Graphics Device (IGD)
so that it does not show in the PCI configuration space as a VGA
disaplay controller. This gives a chance for U-Boot to run PCI/PCIe
based graphics card's VGA BIOS and use that for the graphics console.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agox86: ivybridge: Remove the dead codes that programs pci bridge
Bin Meng [Thu, 1 Oct 2015 07:36:03 +0000 (00:36 -0700)]
x86: ivybridge: Remove the dead codes that programs pci bridge

Remove bd82x6x_pci_bus_enable_resources() that is not called anywhere.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agodm: pci: Enable VGA address forwarding on bridges
Bin Meng [Thu, 1 Oct 2015 07:36:02 +0000 (00:36 -0700)]
dm: pci: Enable VGA address forwarding on bridges

To support graphics card behind a PCI bridge, the bridge control
register (offset 0x3e) in the configuration space must turn on
VGA address forwarding.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agodm: pci: Fix pci_last_busno() to return the real last bus no
Bin Meng [Thu, 1 Oct 2015 07:36:01 +0000 (00:36 -0700)]
dm: pci: Fix pci_last_busno() to return the real last bus no

Currently pci_last_busno() only checks the last bridge device
under the first UCLASS_PCI device. This is not the case when
there are multiple bridge devices.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agovideo: vesa_fb: Fix wrong return value check of pci_find_class()
Bin Meng [Thu, 1 Oct 2015 07:36:00 +0000 (00:36 -0700)]
video: vesa_fb: Fix wrong return value check of pci_find_class()

When pci_find_class() fails to find a device, it returns -ENODEV.
But now we check the return value against -1. Fix it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
8 years agopci: Set PCI_COMMAND_IO bit for VGA device
Bin Meng [Thu, 1 Oct 2015 07:35:59 +0000 (00:35 -0700)]
pci: Set PCI_COMMAND_IO bit for VGA device

PCI_COMMAND_IO bit must be set for VGA device as it needs to respond
to legacy VGA IO address.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agodm: pci: Adjust pci_find_and_bind_driver() to return -EPERM
Simon Glass [Tue, 8 Sep 2015 23:52:49 +0000 (17:52 -0600)]
dm: pci: Adjust pci_find_and_bind_driver() to return -EPERM

The current code returns 0 even if it failed to find or bind a driver. The
caller then has to check the returned device to see if it is NULL. It is
better to return an error code in this case so that it is clear what
happened.

Adjust the code to return -EPERM, indicating that the device was not bound
because it is not needed for pre-relocation use. Add comments so that the
return value is clear.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: pci: Correct a few debug() statements
Simon Glass [Tue, 8 Sep 2015 23:52:48 +0000 (17:52 -0600)]
dm: pci: Correct a few debug() statements

One debug() statement is missing a newline. The other has a repeated word.
Fix these.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: pci: Tidy up auto-config error handling
Simon Glass [Tue, 8 Sep 2015 23:52:47 +0000 (17:52 -0600)]
dm: pci: Tidy up auto-config error handling

When the auto-configuration process fails for a device (generally due to
lack of memory) we should return the error correctly so that we don't
continue to try memory allocations which will fail.

Adjust the code to check for errors and abort if something goes wrong.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agomalloc_simple: Add debug() information
Simon Glass [Tue, 8 Sep 2015 23:52:46 +0000 (17:52 -0600)]
malloc_simple: Add debug() information

It's useful to get a a trace of memory allocations in early init. Add a
debug() call to provide that. It can be enabled by adding '#define DEBUG'
to the top of the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agolinux/bitops.h: GENMASK copy from linux
Jagan Teki [Wed, 21 Oct 2015 11:16:51 +0000 (16:46 +0530)]
linux/bitops.h: GENMASK copy from linux

GENMASK is used to create a contiguous bitmask([hi:lo]).

This patch is a copy from Linux, with below commit details
"bitops: Fix shift overflow in GENMASK macros"
(sha1: 00b4d9a14125f1e51874def2b9de6092e007412d)

Cc: Tom Rini <trini@konsulko.com>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Jagan Teki <jteki@openedev.com>
8 years agolinux/bitops: Move BIT definitions at top
Jagan Teki [Wed, 21 Oct 2015 12:00:34 +0000 (17:30 +0530)]
linux/bitops: Move BIT definitions at top

Since it's a copy from Linux, this patch moved all
BIT definitions to top so-that it looks same as Linux file.

Cc: Tom Rini <trini@konsulko.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Signed-off-by: Jagan Teki <jteki@openedev.com>
8 years agoMerge git://git.denx.de/u-boot-marvell
Tom Rini [Wed, 21 Oct 2015 01:59:40 +0000 (21:59 -0400)]
Merge git://git.denx.de/u-boot-marvell

8 years agommc: mv_sdhci: Configure the SDHCI MBUS bridge windows
Stefan Roese [Thu, 1 Oct 2015 15:34:41 +0000 (17:34 +0200)]
mmc: mv_sdhci: Configure the SDHCI MBUS bridge windows

This driver did not yet configure the SDHCI MBUS bridge registers.
Without this and with CONFIG_MMC_SDMA enabled, mmc hangs at random
times. As DMA cannot complete correctly.

Tested on db-88f6820-gp eval board.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Dirk Eibach <eibach@gdsys.cc>
Tested-by: Kevin Smith <kevin.smith@elecsyscorp.com>
8 years agoarm: mvebu: Enable DM_SERIAL on AXP / A38x boards
Stefan Roese [Wed, 2 Sep 2015 06:41:41 +0000 (08:41 +0200)]
arm: mvebu: Enable DM_SERIAL on AXP / A38x boards

This patch enables DM_SERIAL for all ARCH_MVEBU boards (AXP & A38x).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Enable DM_USB on AXP / A38x boards
Stefan Roese [Tue, 1 Sep 2015 11:05:09 +0000 (13:05 +0200)]
arm: mvebu: Enable DM_USB on AXP / A38x boards

This patch enables DM_USB on the Marvell AXP / A38x eval boards.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agousb: ehci-marvell.c: Add DM support
Stefan Roese [Tue, 1 Sep 2015 09:39:44 +0000 (11:39 +0200)]
usb: ehci-marvell.c: Add DM support

This patch adds driver model (DM) support to the Marvell EHCI driver.
This will be used by the MVEBU SoC's, currently Armada XP and 38x.

Tested on Marvell Armada XP and 38x eval boards.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Add DM (driver model) support
Stefan Roese [Tue, 1 Sep 2015 09:27:52 +0000 (11:27 +0200)]
arm: mvebu: Add DM (driver model) support

This patch adds driver model support for some Marvell MVEBU SoC's. Including
Armada XP and 38x. All 3 currently mainlined boards are converted. DM is now
selected automatically for MVEBU platforms.

With this DM support now available for MVEBU, hardcoding the base addresses
and other information is not necessary any more. Probing should be done
by using the values provided via the device tree now instead. For this
the driver also need to be converted to DM. Patches for some of the drivers
will follow.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Add basic Armada XP / 38x dtsi/dts files
Stefan Roese [Mon, 31 Aug 2015 05:33:57 +0000 (07:33 +0200)]
arm: mvebu: Add basic Armada XP / 38x dtsi/dts files

These will be needed by the upcoming DM (driver model) support for
the Armada XP / 38x SoC's. This will provide DT based probing.

The dts files are copied 1:1 from the Linux kernel release v4.2.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Do not call board_init_r() from board_init_f()
Stefan Roese [Mon, 31 Aug 2015 05:20:12 +0000 (07:20 +0200)]
arm: mvebu: Do not call board_init_r() from board_init_f()

Instead of calling board_init_r() directly from board_init_f(), just
return from board_init_f(). This will make the code continue executing
in crt0.S _main(), from which the board_init_r() is called. This patch
aligns the MVEBU SPL with the correct SPL design as well as reduces
the stack utilisation slightly.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agokwbimage: Align payload size to 4 bytes
Stefan Roese [Tue, 1 Sep 2015 11:46:35 +0000 (13:46 +0200)]
kwbimage: Align payload size to 4 bytes

The MVEBU BootROM does not allow non word aligned payloads.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agodm: core: Enable optional use of fdt_translate_address()
Stefan Roese [Wed, 2 Sep 2015 05:41:12 +0000 (07:41 +0200)]
dm: core: Enable optional use of fdt_translate_address()

The current "simple" address translation simple_bus_translate() is not
working on some platforms (e.g. MVEBU). As here more complex "ranges"
properties are used in many nodes (multiple tuples etc). This patch
enables the optional use of the common fdt_translate_address() function
which handles this translation correctly.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoarm: mvebu: Only set CONFIG_SKIP_LOWLEVEL_INIT for SPL
Stefan Roese [Tue, 25 Aug 2015 12:09:12 +0000 (14:09 +0200)]
arm: mvebu: Only set CONFIG_SKIP_LOWLEVEL_INIT for SPL

When running on the AXP I sometimes noticed a strange behavior. As some
characters are not echoed on the U-Boot prompt. Not disabling the
lowlevel_init code, especially calling cpu_init_cp15() in the main
U-Boot seems to solve this issue.

Signed-off-by: Stefan Roese <sr@denx.de>
8 years agoarm: mvebu: Add option to use UART xmodem protocol via kwboot
Stefan Roese [Tue, 25 Aug 2015 11:49:41 +0000 (13:49 +0200)]
arm: mvebu: Add option to use UART xmodem protocol via kwboot

This patch enables the use of the kwboot tool, to boot mainline U-Boot
on the Marvell Armada XP/38x SoC's. This is done by returning to the
SoC's BootROM after SPL has initialized the SDRAM. We need to make sure
to not reconfigure the internal register space and MBARs. Otherwise
the BootROM will not be able to continue after SPL jumps back to it.

To use this feature, please don't forget to change the BOOT_FROM line
in your board specfic kwbimage.cfg file this way:

    BOOT_FROM uart

Tested on these Marvell eval boards:
DB-MV784MP-GP - Armada XP
DB-88F6820-GP - Armada 38x

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Dirk Eibach <eibach@gdsys.de>
Cc: Kevin Smith <kevin.smith@elecsyscorp.com>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agosunxi: Add CHIP support
Maxime Ripard [Thu, 15 Oct 2015 20:04:10 +0000 (22:04 +0200)]
sunxi: Add CHIP support

The C.H.I.P. is a small SBC with an Allwinner R8, 8GB of NAND, 512MB of
RAM, USB host and OTG, a wifi / bluetooth combo chip, an audio/video jack
and two connectors to plug additional boards on top of it.

The DT is identical to the DT submitted to the upstream kernel.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agoaxp209: Sync the DTSI with the kernel
Maxime Ripard [Thu, 15 Oct 2015 20:04:09 +0000 (22:04 +0200)]
axp209: Sync the DTSI with the kernel

Linux had a number of changes to the AXP209 DTSI. Sync ours.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosun5i: Sync the DTSI with the kernel
Maxime Ripard [Thu, 15 Oct 2015 20:04:08 +0000 (22:04 +0200)]
sun5i: Sync the DTSI with the kernel

Add the latest kernel changes to the sun5i family DTSI.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Use Kconfig CONFIG_MMC
Maxime Ripard [Thu, 15 Oct 2015 20:04:07 +0000 (22:04 +0200)]
sunxi: Use Kconfig CONFIG_MMC

Not all sunxi boards have an MMC embedded. Switching to the Kconfig option
will allow to enable or disable the support in each boards' defconfig.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: board: Only try to use the MMC related functions if enabled
Maxime Ripard [Thu, 15 Oct 2015 20:04:06 +0000 (22:04 +0200)]
sunxi: board: Only try to use the MMC related functions if enabled

So far, even if CONFIG_MMC was not enabled the board code was trying to use
the MMC-related functions, resulting in linker errors.

Protect those calls by an ifdef.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agommc: Add generic Kconfig option
Maxime Ripard [Thu, 15 Oct 2015 20:04:05 +0000 (22:04 +0200)]
mmc: Add generic Kconfig option

Add a generic Kconfig option for the CONFIG_MMC option that was used before
in the configuration headers.

Since all the architectures need to be converted to that first, depend on
an non-existent config option that will be extended with architectures that
use that option.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agofastboot: Implement OEM format only when we have MMC support
Maxime Ripard [Thu, 15 Oct 2015 20:04:04 +0000 (22:04 +0200)]
fastboot: Implement OEM format only when we have MMC support

The current fastboot support assumes that CONFIG_FASTBOOT_FLASH implies
that we have an MMC in our system, which might not be the case if we have
some other storage device.

Change the configuration option protecting that call to
FASTBOOT_FLASH_MMC_DEV, that makes much more sense.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Add support for android boot image
Maxime Ripard [Thu, 15 Oct 2015 12:34:20 +0000 (14:34 +0200)]
sunxi: Add support for android boot image

When using the fastboot boot command, the image sent to U-Boot will be an
Android boot image. If the support is missing, that obviously won't work,
so we need it in our configuration.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agosunxi: Add defconfig for the Sinovoip BPI-M2 board
Hans de Goede [Tue, 13 Oct 2015 21:57:03 +0000 (23:57 +0200)]
sunxi: Add defconfig for the Sinovoip BPI-M2 board

The Sinovoip BPI-M2 is a SBC board based on the A31s SoC it features
1G RAM, a microsd slot, Gbit ethernet, 4 usb-a USB-2 ports, ir receiver,
stereo headphone jack and hdmi video output.

The dts changes are identical to the dts files submitted upstream.

A few notes on the use if dldo and aldo regulators. DLDO1 is used
for Vdd for the ethernet phy, ALDO2 is used for AVdd for the ethernet
phy. ALDO1 is used to power the sdio wifi module.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: Fix sorting of boards in MAINTAINERS
Hans de Goede [Wed, 14 Oct 2015 14:35:51 +0000 (16:35 +0200)]
sunxi: Fix sorting of boards in MAINTAINERS

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: Add a bootcmd_sunxi_compat to the default environment to boot old kernels
Hans de Goede [Fri, 9 Oct 2015 16:11:15 +0000 (17:11 +0100)]
sunxi: Add a bootcmd_sunxi_compat to the default environment to boot old kernels

Add a bootcmd_sunxi_compat value to the default environment when building
with CONFIG_OLD_SUNXI_KERNEL_COMPAT, this way people who occasionally want
to boot an old kernel can do so by simply typing "run bootcmd_sunxi_compat"
rather then needing to have 2 separate setups / sdcards for old and
new kernels.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: power: Columbus: only enable ELDO3 when necessary
Hans de Goede [Sat, 10 Oct 2015 12:25:10 +0000 (14:25 +0200)]
sunxi: power: Columbus: only enable ELDO3 when necessary

ELDO3 is only necessary when using the lcd-panel, and not when using hdmi,
the display code already takes care of enabling ELDO3 when necessary,
so there is no need to permanently enable it in the deconfig.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: power: Change axp209 LDO3 and LDO4 default to disabled
Hans de Goede [Sat, 3 Oct 2015 13:29:24 +0000 (15:29 +0200)]
sunxi: power: Change axp209 LDO3 and LDO4 default to disabled

LDO3 and LDO4 are normally either unused, or used to power csi
attached camera sensors, and as such do not need to be enabled at
boot time.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: power: Add support for disabling axp209 regulators
Hans de Goede [Sun, 4 Oct 2015 10:01:17 +0000 (12:01 +0200)]
sunxi: power: Add support for disabling axp209 regulators

Add support for disabling the regulators found on the axp209 pmic.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: power: Drop protection against multiple calls from axp221 axp_init()
Hans de Goede [Sat, 3 Oct 2015 14:13:19 +0000 (16:13 +0200)]
sunxi: power: Drop protection against multiple calls from axp221 axp_init()

The only thing axp221.c's axp_init() does which needs protection
against multiple calls is calling pmic_bus_init, and pmic_bus_init()
itself is already protected against being called multiple times.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: power: Use pmic_bus functions for axp152 / axp209 driver
Hans de Goede [Sat, 3 Oct 2015 14:12:27 +0000 (16:12 +0200)]
sunxi: power: Use pmic_bus functions for axp152 / axp209 driver

Use the generic pmic_bus helpers for the axp152 / axp209 drivers,
rather then having them define their own register read / write
functions.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: power: Change A23/A33 aldo1 default voltage to 3.0V
Hans de Goede [Sat, 3 Oct 2015 13:26:34 +0000 (15:26 +0200)]
sunxi: power: Change A23/A33 aldo1 default voltage to 3.0V

On A23 / A33 boards aldo1 is used for VCC-IO and should be 3.0V, make this
the default.

Note that this does not cause any functional changes since all sun8i
board defconfig-s already contained: CONFIG_AXP_ALDO1_VOLT=3000 .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: power: Change A23/A33 VDD-SYS default from 1.2V to 1.1V
Hans de Goede [Sat, 3 Oct 2015 13:21:53 +0000 (15:21 +0200)]
sunxi: power: Change A23/A33 VDD-SYS default from 1.2V to 1.1V

Change the axp223 dcdc2 / VDD-SYS default from 1.2V to 1.1V, 1.1V is the
value recommended by Allwinner and is what most fex files specify.

This has been tested on a number of A23/A33 tablets including on an
A23 Ippo-q8h-v1.2 PCB tablet which has a fex file which specifies 1.2V
(which is where our original 1.2V default comes from).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: power: Unify axp pmic function names
Hans de Goede [Sat, 3 Oct 2015 13:18:33 +0000 (15:18 +0200)]
sunxi: power: Unify axp pmic function names

Stop prefixing the axp functions for setting voltages, etc. with the
model number, there ever is only one pmic driver built into u-boot,
this allows simplifying the callers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: power: Make all voltages configurable through Kconfig
Hans de Goede [Wed, 30 Sep 2015 13:22:42 +0000 (15:22 +0200)]
sunxi: power: Make all voltages configurable through Kconfig

On boards with axp221/223 pmic-s we already allow configuring most
voltages. Make the Kconfig options for these also apply to boards with
axp152 / axp209 pmic-s and extend them to configure all voltages.

The Kconfig defaults are chosen so that this commit does not introduce any
functional changes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: Kconfig-ify CONFIG_AXP152_POWER and _AXP209_POWER
Hans de Goede [Wed, 30 Sep 2015 13:12:30 +0000 (15:12 +0200)]
sunxi: Kconfig-ify CONFIG_AXP152_POWER and _AXP209_POWER

Kconfig-ify CONFIG_AXP152_POWER and _AXP209_POWER settings, removing
them from CONFIG_SYS_EXTRA_OPTIONS.

Note that sun5i boards can have either an AXP209 or an AXP152 pmic, the
Kconfig default is AXP209, boards with an AXP152 must explicitly select
this. Likewise boards without a pmic must explicitly select SUNXI_NO_PMIC
in their defconfig.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: Remove board defconfig-s for specific Q8 tablet PCB-s
Hans de Goede [Tue, 29 Sep 2015 13:06:26 +0000 (15:06 +0200)]
sunxi: Remove board defconfig-s for specific Q8 tablet PCB-s

We now have generic q8_a?3_defconfig files for Q8 formfactor tablets with
an A13 / A23 / A33 SoC, there is no need for these PCB variant specific
defconfig-s and they only serve to confuse the user.

Note that in case of the forfun_q88db_defconfig and TZX-Q8-713B7_defconfig
for A13 based Q8 tablets there is not even a dts file for these in the
upstream kernel, which is all the more reason to remove them.

The generic q8_a?3_defconfig files have been tested on an Et_q8_v1_6,
Ippo_q8h_v1_2_a33_1024x600, Ippo_q8h_v1_2 and TZX-Q8-713B7 tablet, and the
forfun_q88db_defconfig is identical to q8_a13_tablet_defconfig.

This leaves only the Ippo_q8h_v5 untested with the new generic defconfigs
but there is no reason to assume that it will not work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
8 years agosunxi: Switch to using malloc_simple for the spl
Hans de Goede [Sun, 13 Sep 2015 10:31:24 +0000 (12:31 +0200)]
sunxi: Switch to using malloc_simple for the spl

common/dlmalloc.c is quite big, both in .text and .data usage. E.g. for a
Mele_M9 sun6i board build this reduces .text from 0x4214 to 0x3b94 bytes,
and .data from 0x54c to 0x144 bytes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agosunxi: Enable CONFIG_SPL_STACK_R
Hans de Goede [Sun, 13 Sep 2015 11:02:48 +0000 (13:02 +0200)]
sunxi: Enable CONFIG_SPL_STACK_R

Select CONFIG_SPL_STACK_R for sunxi boards, this gives us much more
room on the stack once we've the DRAM running.

Besides being a good change to have on itself, this also paves the
way for switching to using malloc_simple in the SPL which cuts of
close to 4KiB of the SPL size.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agomalloc_simple: Add support for switching to DRAM heap
Hans de Goede [Sun, 13 Sep 2015 13:04:17 +0000 (15:04 +0200)]
malloc_simple: Add support for switching to DRAM heap

malloc_simple uses a part of the stack as heap, initially it uses
SYS_MALLOC_F_LEN bytes which typically is quite small as the initial
stacks sits in SRAM and we do not have that much SRAM to work with.

When DRAM becomes available we may switch the stack from SRAM to DRAM
to give use more room. This commit adds support for also switching to
a new bigger malloc_simple heap located in the new stack.

Note that this requires spl_init to be called before spl_relocate_stack_gd
which in practice means that spl_init must be called from board_init_f.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agomalloc_simple: Add Kconfig option for using only malloc_simple in the SPL
Hans de Goede [Sun, 13 Sep 2015 12:45:15 +0000 (14:45 +0200)]
malloc_simple: Add Kconfig option for using only malloc_simple in the SPL

common/dlmalloc.c is quite big, both in .text and .data usage, therefor
on some boards the SPL is build to use only malloc_simple.c and not the
dlmalloc.c code. This is done in various include/configs/foo.h with the
following construct:

 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_MALLOC_SIMPLE
 #endif

This commit introduces a SPL_MALLOC_SIMPLE Kconfig bool which allows
selecting this functionality through Kconfig instead.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agospl: spl_relocate_stack_gd: Do not unnecessarily clear bss
Hans de Goede [Sun, 13 Sep 2015 13:36:18 +0000 (15:36 +0200)]
spl: spl_relocate_stack_gd: Do not unnecessarily clear bss

spl_relocate_stack_gd only gets called from arch/arm/lib/crt0.S which
clears the bss directly after calling it, so there is no need to clear
it from spl_relocate_stack_gd.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoarm: mvebu: Move Armada XP/38x Kconfig to mach specific Kconfig file
Stefan Roese [Tue, 25 Aug 2015 11:18:38 +0000 (13:18 +0200)]
arm: mvebu: Move Armada XP/38x Kconfig to mach specific Kconfig file

Introduce a mach-mvebu/Kconfig for all Armada based SoC's.

Signed-off-by: Stefan Roese <sr@denx.de>
8 years agoPrepare v2015.10 v2015.10
Tom Rini [Mon, 19 Oct 2015 22:46:28 +0000 (18:46 -0400)]
Prepare v2015.10

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agopowerpc: Drop old non-generic-board code
Simon Glass [Sat, 17 Oct 2015 18:58:50 +0000 (12:58 -0600)]
powerpc: Drop old non-generic-board code

This code is no-longer used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosbc8641d: enable and test CONFIG_SYS_GENERIC_BOARD
Paul Gortmaker [Sat, 17 Oct 2015 20:40:30 +0000 (16:40 -0400)]
sbc8641d: enable and test CONFIG_SYS_GENERIC_BOARD

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
8 years agosbc8641d: increase monitor size from 256k to 384k
Paul Gortmaker [Sat, 17 Oct 2015 20:40:31 +0000 (16:40 -0400)]
sbc8641d: increase monitor size from 256k to 384k

Between v2015.07-rc1 and v2015.07-rc2 this board started
silent boot failure.  A bisect led to commit 6eed3786c68c8a49d
("net: Move the CMD_NET config to defconfigs").  This commit
looks harmless in itself, but it did implicitly add a feature
to the image which led to this:

 u-boot$git describe 6eed3786c68c8a49d
 v2015.07-rc1-412-g6eed3786c68c
              ^^^

 u-boot$ls -l ../41*/u-boot.bin
 -rwxrwxr-x 1 paul paul 261476 Oct 16 16:47 ../411/u-boot.bin
 -rwxrwxr-x 1 paul paul 266392 Oct 16 16:43 ../412/u-boot.bin
 u-boot$bc
 bc 1.06.95
 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
 This is free software with ABSOLUTELY NO WARRANTY.
 For details type `warranty'.
 256*1024
 262144

i.e. we finally broke through the 256k monitor size.  Jump it
up to 384k and fix the hard coded value used in the env offset
at the same time.

We were probably flirting with the 256k size issue without
knowing it when testing on different baselines in earlier
commits, but since this is all board specific, a rebase or
reorder to put this commit 1st is of little value.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
8 years agosbc8641d: add basic flash setup instructions to README file
Paul Gortmaker [Sat, 17 Oct 2015 20:40:29 +0000 (16:40 -0400)]
sbc8641d: add basic flash setup instructions to README file

...so that I don't have to go work them out from scratch again
by peering at the manual.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
8 years agosbc8641d: set proper environment sector size.
Paul Gortmaker [Sat, 17 Oct 2015 20:40:28 +0000 (16:40 -0400)]
sbc8641d: set proper environment sector size.

When debugging an env fail due to too small a malloc pool, it
was noted that the env write was 256k.  But the device sector
size is 1/2 that, as can be seen from "fli" output:

Bank # 1: CFI conformant flash (16 x 16)  Size: 16 MB in 131 Sectors
  Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x1888
  Erase timeout: 4096 ms, write timeout: 1 ms
  Buffer write timeout: 2 ms, buffer size: 64 bytes

  Sector Start Addresses:
  FF000000 E RO   FF020000 E RO   FF040000 E RO   FF060000 E RO   FF080000 E RO
  FF0A0000 E RO   FF0C0000 E RO   FF0E0000 E RO   FF100000 E RO   FF120000 E RO
  [...]
  FFF00000   RO   FFF20000   RO   FFF40000   RO   FFF60000   RO   FFF80000   RO
  FFFA0000   RO   FFFC0000   RO   FFFE0000 E RO   FFFE8000   RO   FFFF0000 E RO
  FFFF8000   RO
=>

The desired env sector is FFF40000->FFF60000, or 0x20000 in length,
just after the 256k u-boot image which starts @ FFF00000.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
8 years agosbc8641d: increase malloc pool size to a sane default
Paul Gortmaker [Sat, 17 Oct 2015 20:40:27 +0000 (16:40 -0400)]
sbc8641d: increase malloc pool size to a sane default

Currently the board fails to save its env, since the env size
is much smaller than the sector size, and the malloc fails for
the pad buffer, giving the user visible symptom of:

Unable to save the rest of sector (253952)

Allow for 1M malloc pool, the same as used on the sbc8548 board.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
8 years agosbc8641d: enable command line editing
Paul Gortmaker [Sat, 17 Oct 2015 20:40:26 +0000 (16:40 -0400)]
sbc8641d: enable command line editing

It is just too painful to use interactively without it.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
8 years agoimage-fit: Fix signature checking
Andrej Rosano [Wed, 14 Oct 2015 15:45:40 +0000 (17:45 +0200)]
image-fit: Fix signature checking

On signature verification failures fit_image_verify() should
exit with error.

Signed-off-by: Andrej Rosano <andrej@inversepath.com>
8 years agoigep00x0: Use BCH8 ECC
Ladislav Michl [Mon, 12 Oct 2015 16:09:14 +0000 (18:09 +0200)]
igep00x0: Use BCH8 ECC

Used NAND chips requires at least 4-bit error correction, so use BCH8
as it is what kernel uses.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Acked-by: Javier Martinez Canillas <javier@osg.samsung.com>
8 years agovexpress64: Juno: Add initialisation code for Juno R1 PCIe host bridge.
Liviu Dudau [Mon, 19 Oct 2015 10:08:32 +0000 (11:08 +0100)]
vexpress64: Juno: Add initialisation code for Juno R1 PCIe host bridge.

Juno R1 has an XpressRICH3 PCIe host bridge that needs to be initialised
in order for the Linux kernel to be able to enumerate the bus. Add
support code here that enables the host bridge, trains the links and
sets up the Address Translation Tables.

Signed-off-by: Liviu Dudau <Liviu.Dudau@foss.arm.com>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
[trini: Always declare vexpress64_pcie_init and continue handling logic
inside the function]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agovexpress64: Juno: Declare all 8GB of RAM and make them visible to the kernel.
Liviu Dudau [Mon, 19 Oct 2015 10:08:31 +0000 (11:08 +0100)]
vexpress64: Juno: Declare all 8GB of RAM and make them visible to the kernel.

Juno comes with 8GB RAM, but U-Boot only passes 2GB to the kernel.
Declare a secondary memory bank and set the sizes correctly.

Signed-off-by: Liviu Dudau <Liviu.Dudau@foss.arm.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
8 years agodfu: dfu_sf: Take the start address into account
Fabio Estevam [Wed, 23 Sep 2015 03:50:39 +0000 (00:50 -0300)]
dfu: dfu_sf: Take the start address into account

The dfu_alt_info_spl variable allows passing a starting point
for the binary to be flashed in the SPI NOR.

For example, if we have 'dfu_alt_info_spl=spl raw 0x400', this means
that we want to flash the binary starting at address 0x400.

In order to do so we need to erase the entire sector and write to
the the subsequent SPI NOR sectors taking such start address
into account for the address calculations.

Tested by succesfully writing SPL binary into 0x400 offset and
the u-boot.img at offset 64 kiB of a SPL NOR.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
[trini: Use lldiv for the math]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agodfu: dfu_sf: Use the erase sector size for erase operations
Fabio Estevam [Tue, 22 Sep 2015 03:55:00 +0000 (00:55 -0300)]
dfu: dfu_sf: Use the erase sector size for erase operations

SPI NOR flashes need to erase the entire sector size and we cannot pass
any arbitrary length for the erase operation.

To illustrate the problem:

Copying data from PC to DFU device
Download    [=========================] 100%       478208 bytes
Download done.
state(7) = dfuMANIFEST, status(0) = No error condition is present
state(10) = dfuERROR, status(14) = Something went wrong, but the
device does not know what it was
Done!

In this case, the binary has 478208 bytes and the M25P32 SPI NOR
has an erase sector of 64kB.

478208  = 7 entire sectors of 64kiB + 19456 bytes.

Erasing the first seven 64 kB sectors works fine, but when trying
to erase the remainding 19456 causes problem and the board hangs.

Fix the issue by always erasing with the erase sector size.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agodoc/README.scrapyard: Add more entries
Tom Rini [Mon, 19 Oct 2015 17:32:09 +0000 (13:32 -0400)]
doc/README.scrapyard: Add more entries

- Add deletions from August 30 2015.
- A few from Sept 12, one from Oct 2nd.

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoRevert "arm: Remove inetspace_v2_cmc board"
Tom Rini [Mon, 19 Oct 2015 16:24:52 +0000 (12:24 -0400)]
Revert "arm: Remove inetspace_v2_cmc board"

Upon further review when populating README.scrapyard, inetspace_v2_cmc
is a variant on netspace_v2 and not just an orphan config.

This reverts commit 653600a715db49859c06ba5dfb858c15c4108d54.

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-arm
Tom Rini [Mon, 19 Oct 2015 15:30:38 +0000 (11:30 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-arm

8 years agoRevert "arm: Remove d2net_v2 defconfig file"
Tom Rini [Mon, 19 Oct 2015 15:20:54 +0000 (11:20 -0400)]
Revert "arm: Remove d2net_v2 defconfig file"

Upon further review when populating README.scrapyard, d2net_v2 is a
variant on net2big_v2 and not just an orphan config.  To help in the
future also add this to board/LaCie/net2big_v2/MAINTAINERS which needed
a little consolidation anyhow.

This reverts commit 1363740e7948a8e4bee8d5adcdf0f63f7782879d.

Cc: Simon Guinot <simon.guinot@sequanux.org>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agodoc/README.scrapyard: Populate recent removals
Tom Rini [Mon, 19 Oct 2015 15:05:47 +0000 (11:05 -0400)]
doc/README.scrapyard: Populate recent removals

Add in the commit IDs / dates for boards removed on Sept 2nd.

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoARM: rpi: add another revision of Raspberry Pi A+
Lubomir Rintel [Wed, 14 Oct 2015 15:17:54 +0000 (17:17 +0200)]
ARM: rpi: add another revision of Raspberry Pi A+

Seen this one in the wild. Is labelled "Raspberry Pi Model A+ V1.1,
(C) Raspberry Pi 2014". A standard A+ board, much like the one with
version 0x12, didn't notice any differencies.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
8 years agoARM: dockstar: move start of environment area
Eric Cooper [Mon, 12 Oct 2015 23:18:52 +0000 (19:18 -0400)]
ARM: dockstar: move start of environment area

The default dockstar configuration for U-Boot currently causes it to
overrun the environment area, so that a "saveenv" command bricks the
device.  This patch moves the environment to a higher address to avoid
that.

Signed-off-by: Eric Cooper <ecc@cmu.edu>
8 years agoARM: k2e/l: Apply WA for selecting PA clock source
Lokesh Vutla [Thu, 8 Oct 2015 06:01:47 +0000 (11:31 +0530)]
ARM: k2e/l: Apply WA for selecting PA clock source

On keystone2 Lamarr and Edison platforms, the PA clocksource
mux in PLL REG1, can be changed only after enabling its clock
domain.
So selecting the output of PASS PLL as input to PA only after
enabling the clockdomain.
This is as per the debug done by "Vitaly Andrianov <vitalya@ti.com>"
and based on the previous work done by "Hao Zhang <hzhang@ti.com>"

Fixes: d634a0775bcf ("ARM: keystone2: Cleanup PLL init code")
Reported-by: Vitaly Andrianov <vitalya@ti.com>
Tested-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agoarch/powerpc/config.mk: Pass -fno-ira-hoist-pressure when possible
Tom Rini [Sat, 17 Oct 2015 12:04:11 +0000 (08:04 -0400)]
arch/powerpc/config.mk: Pass -fno-ira-hoist-pressure when possible

There are various toolchain issues that cause us to produce invalid
binaries with certain gcc 4.8.x and 4.9.x versions when we don't pass
this flag in.

Tested-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoMerge git://git.denx.de/u-boot-socfpga
Tom Rini [Sat, 17 Oct 2015 00:21:04 +0000 (20:21 -0400)]
Merge git://git.denx.de/u-boot-socfpga

8 years agoarm: dts: socfpga: add "u-boot,dm-pre-reloc" to socfpga_cyclone5_socdk dts
Dinh Nguyen [Mon, 12 Oct 2015 16:59:04 +0000 (11:59 -0500)]
arm: dts: socfpga: add "u-boot,dm-pre-reloc" to socfpga_cyclone5_socdk dts

We need "u-boot,dm-pre-reloc" in the socfpga_cyclone5_socdk.dts file in
order for the SPL to use SD/MMC.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
8 years agoarm: socfpga: enable data/inst prefetch and shared override in the L2
Dinh Nguyen [Thu, 15 Oct 2015 15:13:36 +0000 (10:13 -0500)]
arm: socfpga: enable data/inst prefetch and shared override in the L2

Update the L2 AUX CTRL settings for the SoCFPGA.

Enabling D and I prefetch bits helps improve SDRAM performance on the
platform.

Also, we need to enable bit 22 of the L2. By not having bit 22 set in the
PL310 Auxiliary Control register (shared attribute override enable) has the
side effect of transforming Normal Shared Non-cacheable reads into Cacheable
no-allocate reads.

Coherent DMA buffers in Linux always have a Cacheable alias via the
kernel linear mapping and the processor can speculatively load cache
lines into the PL310 controller. With bit 22 cleared, Non-cacheable
reads would unexpectedly hit such cache lines leading to buffer
corruption.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
8 years agovf610twr: Fix typo in DRAM init
Anthony Felice [Fri, 9 Oct 2015 20:38:39 +0000 (16:38 -0400)]
vf610twr: Fix typo in DRAM init

This commit fixes a typo in vf610twr DRAM init that was causing a hang in
U-Boot for the Vybrid Tower. This typo was introduced in commit 3f353cecc
(vf610: refactor DDRMC code).

Signed-off-by: Anthony Felice <tony.felice@timesys.com>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-samsung
Tom Rini [Fri, 16 Oct 2015 11:19:47 +0000 (07:19 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-samsung

8 years agovf610twr: Fix typo in DRAM init
Anthony Felice [Fri, 9 Oct 2015 20:38:39 +0000 (16:38 -0400)]
vf610twr: Fix typo in DRAM init

This commit fixes a typo in vf610twr DRAM init that was causing a hang in
U-Boot for the Vybrid Tower. This typo was introduced in commit 3f353cecc
(vf610: refactor DDRMC code).

Signed-off-by: Anthony Felice <tony.felice@timesys.com>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>