oweals/u-boot.git
7 years agodrivers: usb: musb: adopt musb backend driver to driver model
Mugunthan V N [Thu, 17 Nov 2016 09:08:10 +0000 (14:38 +0530)]
drivers: usb: musb: adopt musb backend driver to driver model

Currently all backend driver ops uses hard coded physical
address, so to adopt the driver to DM, add device pointer to ops
call backs so that drivers can get physical addresses from the
usb driver priv/plat data.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoam33xx: board: probe misc drivers to register musb devices
Mugunthan V N [Thu, 17 Nov 2016 09:08:09 +0000 (14:38 +0530)]
am33xx: board: probe misc drivers to register musb devices

MUSB wrapper driver is bound as MISC device and underlying usb
devices are bind to usb drivers based on dr_mode, so probing the
MISC wrapper driver to register musb devices.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodrivers: usb: musb: add ti musb misc driver for wrapper
Mugunthan V N [Thu, 17 Nov 2016 09:08:08 +0000 (14:38 +0530)]
drivers: usb: musb: add ti musb misc driver for wrapper

Add a misc driver for MUSB wrapper, so that based on dr_mode the
USB devices can bind to USB host or USB device drivers.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoam33xx: board: do not register usb devices when CONFIG_DM_USB is defined
Mugunthan V N [Thu, 17 Nov 2016 09:08:07 +0000 (14:38 +0530)]
am33xx: board: do not register usb devices when CONFIG_DM_USB is defined

Do not register usb devices when CONFIG_DM_USB is define.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoconfigs: am335x: usb: do not define CONFIG_DM_USB for spl
Mugunthan V N [Thu, 17 Nov 2016 09:08:06 +0000 (14:38 +0530)]
configs: am335x: usb: do not define CONFIG_DM_USB for spl

Since OMAP's spl doesn't support DM currently, do not define
CONFIG_DM_USB for spl build.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agortc: Add RTC chip pcf2127 support
Meng Yi [Wed, 30 Nov 2016 07:47:31 +0000 (15:47 +0800)]
rtc: Add RTC chip pcf2127 support

This driver compatible with pcf2127 and pcf2129

Signed-off-by: Meng Yi <meng.yi@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agodm: core: Add dev_get_addr_size_index() to retrieve addr and size
Stefan Roese [Wed, 30 Nov 2016 06:24:47 +0000 (07:24 +0100)]
dm: core: Add dev_get_addr_size_index() to retrieve addr and size

The currently available functions accessing the 'reg' property of a
device only retrieve the address. Sometimes its also necessary to
retrieve the size described by the 'reg' property. This patch adds
the new function dev_get_addr_size_index() which retrieves both,
the address and the size described by the 'reg' property.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agolibfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY
Masahiro Yamada [Sat, 26 Nov 2016 02:02:10 +0000 (11:02 +0900)]
libfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY

Commit e2f88dfd2d96 ("libfdt: Introduce new ARCH_FIXUP_FDT option")
allows us to skip memory setup of DTB, but a problem for ARM is that
spin_table_update_dt() and psci_update_dt() are skipped as well if
CONFIG_ARCH_FIXUP_FDT is disabled.

This commit allows us to skip only fdt_fixup_memory_banks() instead
of the whole of arch_fixup_fdt().  It will be useful when we want to
use a memory node from a kernel DTB as is, but need some fixups for
Spin-Table/PSCI.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Simon Glass <sjg@chromium.org>
Fixed build error for x86:
Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agocmd/fdt: fix uncallable systemsetup command
Fabien Parent [Thu, 24 Nov 2016 14:02:18 +0000 (15:02 +0100)]
cmd/fdt: fix uncallable systemsetup command

The function that is processing the 'fdt' parameters is one big
if-else if. In order to be able to type command faster only the first
few letter are checked to know which block of code to execute. For
systemsetup, the block of code that was executed was always the wrong
one and ended up in a failure.

} else if (argv[1][0] == 's') {
    process "fdt set" command
} else if (strncmp(argv[1], "sys", 3) == 0) {
    process "fdt systemsetup" command.
}

When typing "fdt systemsetup", the code that was executed was the code
for "fdt set".

This commit fix this issue by moving the "else if" for systemsetup
before the else if for "fdt set". This allow us to keep compatibility
with any script that make use of "fdt s" to set node values.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agodrivers: usb: gadget: ether: prepare driver for driver model migration
Mugunthan V N [Fri, 18 Nov 2016 05:38:27 +0000 (11:08 +0530)]
drivers: usb: gadget: ether: prepare driver for driver model migration

prepare driver for driver model migration

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agodrivers: usb: gadget: ether: use net device priv to pass usb ether priv
Mugunthan V N [Fri, 18 Nov 2016 05:37:18 +0000 (11:07 +0530)]
drivers: usb: gadget: ether: use net device priv to pass usb ether priv

Use net device priv to pass usb ether priv and use it in
net device ops callback.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agodrivers: usb: gadget: ether: consolidate global devices to single struct
Mugunthan V N [Fri, 18 Nov 2016 05:36:13 +0000 (11:06 +0530)]
drivers: usb: gadget: ether: consolidate global devices to single struct

Consolidate the net device, usb eth device and gadget device
struct to single struct and a single global variable so that the
same can be passed as priv of ethernet driver.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agodrivers: usb: gadget: ether: adopt to usb driver model
Mugunthan V N [Fri, 18 Nov 2016 05:19:12 +0000 (10:49 +0530)]
drivers: usb: gadget: ether: adopt to usb driver model

Convert usb ether gadget to adopt usb driver model

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agodrivers: usb: gadget: ether: access network_started using local variable
Mugunthan V N [Fri, 18 Nov 2016 05:19:13 +0000 (10:49 +0530)]
drivers: usb: gadget: ether: access network_started using local variable

network_started of struct eth_dev can be accessed using local
variable dev and no reason to access it with the global struct.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agodm: blk: Fix get_desc to return block device descriptor
Michal Simek [Wed, 16 Nov 2016 16:37:42 +0000 (17:37 +0100)]
dm: blk: Fix get_desc to return block device descriptor

Current get_desc() implementation is not able to succesfully
finish and return pointer to block device descriptor.

Also function always return non zero value even device is found.

The patch fills block device descriptor and return 0 if device is found.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agodm: core: Handle global_data moving in SPL
Simon Glass [Sun, 13 Nov 2016 21:21:58 +0000 (14:21 -0700)]
dm: core: Handle global_data moving in SPL

When CONFIG_SPL_STACK_R is enabled, and spl_init() is called before
board_init_r(), spl_relocate_stack_gd() will move global_data to a new
place in memory. This affects driver model since it uses a list for the
uclasses. Unless this is updated the list will become invalid. When
looking for a non-existent uclass, such as when adding a new one, the loop
in uclass_find() may continue forever, thus causing a hang.

Add a function to correct this rather obscure bug.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agobuildman: Rename do_build to config_only
Simon Glass [Wed, 16 Nov 2016 21:09:25 +0000 (14:09 -0700)]
buildman: Rename do_build to config_only

This variable name is needlessly confusion. Adjust it to use a 'positive'
name instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agobuildman: Clean up odd characters on the terminal
Simon Glass [Tue, 15 Nov 2016 22:32:59 +0000 (15:32 -0700)]
buildman: Clean up odd characters on the terminal

At present buildman leaves behind a few characters during its progress
updates, which looks odd. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agobuildman: Squash useless output from -K
Simon Glass [Sun, 13 Nov 2016 21:25:53 +0000 (14:25 -0700)]
buildman: Squash useless output from -K

When using #define CONFIG_SOME_OPTION, the value it set to '1'. When using
defconfig (i.e. CONFIG_SOME_OPTION=y) the value is set to 'y'. This results
in differences showing up with -K. These differences are seldom useful.

Adjust buildman to suppress these differences by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agobuildman: Add documentation for CONFIG checking
Simon Glass [Sun, 13 Nov 2016 21:25:52 +0000 (14:25 -0700)]
buildman: Add documentation for CONFIG checking

The -K option is not mentioned in the README at present. Add some notes
to describe how this is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agobuildman: Add an option to just create the config
Simon Glass [Sun, 13 Nov 2016 21:25:51 +0000 (14:25 -0700)]
buildman: Add an option to just create the config

Normally buildman does a full build of a board. This includes creating the
u-boot.cfg file which contains all the configuration options. Buildman uses
this file with the -K option, to show differences in effective configuration
for each commit.

Doing a full build of U-Boot just to create the u-boot.cfg file is wasteful.
Add a -D option which causes buildman to only create the configuration. This
is enough to support use of -K and can be done much more quickly (typically
5-10 times faster).

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoMakefile: Add a target to create the .cfg files
Simon Glass [Sun, 13 Nov 2016 21:25:50 +0000 (14:25 -0700)]
Makefile: Add a target to create the .cfg files

A common requirement when converting CONFIG options to Kconfig is to check
that the effective configuration has not changed due to the conversion. Add
a target which creates this configuration (in the form of u-boot.cfg) but
does not build U-Boot. This speeds up the checking.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agosandboxfs: Fix resource leak
Tom Rini [Tue, 18 Oct 2016 01:09:32 +0000 (21:09 -0400)]
sandboxfs: Fix resource leak

Now that we free resources in sandbox_fs_ls Coverity is letting us know
that in some cases we might leak.  So in case of error we should still
let os_dirent_free free anything that was allocated.

Fixes: 86167089b71c ("sandbox/fs: Free memory allocated by os_dirent_ls")
Reported-by: Coverity (CID: 153450)
Cc: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agotpm: tpm_tis_lpc: Add support for AT97SC3204
George McCollister [Mon, 17 Oct 2016 14:24:32 +0000 (09:24 -0500)]
tpm: tpm_tis_lpc: Add support for AT97SC3204

The Atmel AT97SC3204 is also TIS compliant.
Modify the tpm_tis_lpc driver to check for the vid/did used by the
Atmel AT97SC3204 and report an appropriate description.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agocmd/tpm_test: Fix misleading code indentation
Stefan Brüns [Sun, 16 Oct 2016 15:13:55 +0000 (17:13 +0200)]
cmd/tpm_test: Fix misleading code indentation

GCC 6.2 reasonably complains about the current code:

../cmd/tpm_test.c: In function ‘do_tpmtest’:
../cmd/tpm_test.c:540:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
   for (i = 0; i < argc; i++)
   ^~~
../cmd/tpm_test.c:542:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
    printf("\n------\n");
    ^~~~~~

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Updated to remove C99 variable decl:
Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoMerge git://www.denx.de/git/u-boot-marvell
Tom Rini [Thu, 1 Dec 2016 14:24:02 +0000 (09:24 -0500)]
Merge git://www.denx.de/git/u-boot-marvell

7 years agotools/kwbimage: add DEBUG option
Chris Packham [Wed, 9 Nov 2016 09:21:45 +0000 (22:21 +1300)]
tools/kwbimage: add DEBUG option

Offset 0x1 in the generated kwb image file is a set of flags, bit 0
enables debug output from the BootROM firmware.  Allow a DEBUG option in
the kwb configuration to request debug output from the BootROM firmware.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
7 years agotools/kwbimage: add BAUDRATE option
Chris Packham [Wed, 9 Nov 2016 09:07:45 +0000 (22:07 +1300)]
tools/kwbimage: add BAUDRATE option

Offset 0x18 in some Marvell datasheets this field is redacted as
"reserved". This offset is actually a set of options and bits 2:0 allow
the selection of the UART baudrate.

Allow a BAUDRATE option to set the UART baudrate for any messages coming
from the BootROM firmware.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
7 years agoarm: mvebu: move SYS_MVEBU_PLL_CLOCK to Kconfig
Chris Packham [Wed, 26 Oct 2016 01:08:30 +0000 (14:08 +1300)]
arm: mvebu: move SYS_MVEBU_PLL_CLOCK to Kconfig

The main PLL frequency is 2GHz for Armada-XP and 1GHZ for Armada 375,
38x and 39x.

[ Linux commit ae142bd9976532aa5232ab0b00e621690d8bfe6a ]

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
7 years agomvebu: db-88f6820-amc: Enable FIT support
Chris Packham [Mon, 24 Oct 2016 22:40:55 +0000 (11:40 +1300)]
mvebu: db-88f6820-amc: Enable FIT support

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
7 years agoSPL: mmc: Make spl_mmc_load_image available
Marek Vasut [Thu, 1 Dec 2016 01:06:35 +0000 (02:06 +0100)]
SPL: mmc: Make spl_mmc_load_image available

Make the spl_mmc_load_image() available globally, so it can be
invoked directly by SPL on extremely space-constrained systems.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
7 years agommc: Tinification of the mmc code
Marek Vasut [Thu, 1 Dec 2016 01:06:33 +0000 (02:06 +0100)]
mmc: Tinification of the mmc code

Add new configuration option CONFIG_MMC_TINY which strips away all
memory allocation within the MMC code and code for handling multiple
cards. This allows extremely space-constrained SPL code use the MMC
framework.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
7 years agommc: Fix warning if debug() is not used
Marek Vasut [Thu, 1 Dec 2016 01:06:32 +0000 (02:06 +0100)]
mmc: Fix warning if debug() is not used

If debug() is not used, then the whole content of debug(...) will
be removed by the preprocessor, which will result in the following
warning. This patch adds __maybe_unused annotation to fix this.

drivers/mmc/mmc.c: In function ‘mmc_init’:
drivers/mmc/mmc.c:1685:11: warning: variable ‘start’ set but not used [-Wunused-but-set-variable]
  unsigned start;

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
7 years agommc: add bkops-enable command
Tomas Melin [Fri, 25 Nov 2016 09:01:03 +0000 (11:01 +0200)]
mmc: add bkops-enable command

Add new command that provides possibility to enable the
background operations handshake functionality
(BKOPS_EN, EXT_CSD byte [163]) on eMMC devices.

This is an optional feature of eMMCs, the setting is write-once.
The command must be explicitly taken into use with
CONFIG_CMD_BKOPS_ENABLE.

Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
7 years agommc: s5p_sdhci: fix to check proper pinmux id
Seung-Woo Kim [Thu, 24 Nov 2016 06:05:51 +0000 (15:05 +0900)]
mmc: s5p_sdhci: fix to check proper pinmux id

At sdhci_get_config(), there was wrong condition to check pimux
id, so this patch fixes to check proper pinmux id.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agots4600: Disable CONFIG_DISPLAY_CPUINFO
Tom Rini [Wed, 30 Nov 2016 19:14:47 +0000 (14:14 -0500)]
ts4600: Disable CONFIG_DISPLAY_CPUINFO

Without this change we see:
../arch/arm/cpu/arm926ejs/mxs/mxs.c: In function ‘print_cpuinfo’:
../arch/arm/cpu/arm926ejs/mxs/mxs.c:181:23: warning: unused variable ‘data’ [-Wunused-variable]
../arch/arm/cpu/arm926ejs/mxs/mxs.c:180:6: warning: variable ‘cpurev’ set but not used [-Wunused-but-set-variable]

So the easy solution is to disable CONFIG_DISPLAY_CPUINFO

Reviewed-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoMerge branch 'master' of git://git.denx.de/u-boot-mips
Tom Rini [Wed, 30 Nov 2016 19:08:28 +0000 (14:08 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-mips

7 years agotravis.yml: Split Freescale ARM job up more
Tom Rini [Wed, 30 Nov 2016 19:05:08 +0000 (14:05 -0500)]
travis.yml: Split Freescale ARM job up more

In order to avoid running into the time limit, split the 32bit and 64bit
Freescale boards into separate jobs.  We could either pass
"freescale & armv8" to buildman or exclude all of the 32bit CPUs.  While
the former is shorter I fear the amount of possible escaping required
would make things less readable.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoMIPS: Fix map_physmem for cached mappings
Paul Burton [Mon, 26 Sep 2016 18:28:57 +0000 (19:28 +0100)]
MIPS: Fix map_physmem for cached mappings

map_physmem should return a pointer that can be used by the CPU to
access the given memory - on MIPS simply returning the physical address
as it does prior to this patch doesn't achieve that. Instead return a
pointer to the memory within (c)kseg0, which matches up consistently
with the (c)kseg1 pointer that uncached mappings return via ioremap.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
7 years agoMIPS: Use ram_top, not bi_memsize, in arch_lmb_reserve
Paul Burton [Mon, 26 Sep 2016 18:28:56 +0000 (19:28 +0100)]
MIPS: Use ram_top, not bi_memsize, in arch_lmb_reserve

When calculating the region to reserve for the stack in
arch_lmb_reserve, make use of ram_top instead of adding bi_memsize to
CONFIG_SYS_SDRAM_BASE. This avoids overflow if the system has enough
memory to reach the end of the address space.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
7 years agomips: Let cache.h be included from assembly source
Marek Vasut [Fri, 25 Nov 2016 22:32:22 +0000 (23:32 +0100)]
mips: Let cache.h be included from assembly source

Add ifdef __ASSEMBLY__ around the function prototype to let cache.h
be included from assembly code.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Paul Burton <paul.burton@imgtec.com>
7 years agocommon/board_f: enable initr_trap for MIPS
Daniel Schwierzeck [Sat, 9 Jan 2016 17:34:15 +0000 (18:34 +0100)]
common/board_f: enable initr_trap for MIPS

Enable initr_trap hook also for MIPS to install and enable
U-Boot's specific MIPS exception handlers.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoMIPS: add handling for generic and EJTAG exceptions
Daniel Schwierzeck [Sat, 9 Jan 2016 17:34:14 +0000 (18:34 +0100)]
MIPS: add handling for generic and EJTAG exceptions

Add exception handlers for generic and EJTAG exceptions. Most of
the assembly code is imported from Linux kernel and adapted to U-Boot.
The exception vector table will be reserved above the stack before
U-Boot is relocated. The exception handlers will be installed and
activated after relocation in the initr_traps hook function.

Generic exceptions are handled by showing a CPU register dump similar
to Linux kernel. For example:

malta # md 1
00000001:
Ooops:
$ 0   : 00000000 00000000 00000009 00000004
$ 4   : 8ff7e108 00000000 0000003a 00000000
$ 8   : 00000008 00000001 8ff7cd18 00000004
$12   : 00000002 00000000 00000005 0000003a
$16   : 00000004 00000040 00000001 00000001
$20   : 00000000 8fff53c0 00000008 00000004
$24   : ffffffff 8ffdea44
$28   : 90001650 8ff7cd00 00000004 8ffe6818
Hi    : 00000000
Lo    : 00000004
epc   : 8ffe6848 (text bfc28848)
ra    : 8ffe6818 (text bfc28818)
Status: 00000006
Cause : 00000410 (ExcCode 04)
BadVA : 8ff9e928
PrId  : 00019300
 ### ERROR ### Please RESET the board ###

EJTAG exceptions are checked for SDBBP and delegated to the SDBBP handler
if necessary. Otherwise the debug mode will simply be exited. The SDBBP
handler currently prints the contents of registers c0_depc and c0_debug.
This could be extended in the future to handle semi-hosting according to
the MIPS UHI specification.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Paul Burton <paul.burton@imgtec.com>
Tested-by: Paul Burton <paul.burton@imgtec.com>
7 years agoMIPS: reserve space for exception vectors
Daniel Schwierzeck [Sat, 9 Jan 2016 17:34:14 +0000 (18:34 +0100)]
MIPS: reserve space for exception vectors

In order to set own exception handlers, a table with the exception
vectors must be built in DRAM and the CPU EBase register must be
set to the base address of this table.

Reserve the space above the stack and use gd->irq_sp as storage
for the exception base address.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7 years agoMIPS: add asm-offsets for struct pt_regs
Daniel Schwierzeck [Sat, 9 Jan 2016 17:34:14 +0000 (18:34 +0100)]
MIPS: add asm-offsets for struct pt_regs

Import asm-offsets.c from kernel to generate offset for struct pt_regs
needed by exception handlers.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7 years agoMIPS: add possibility to setup initial stack and global data in SRAM
Daniel Schwierzeck [Sat, 4 Jun 2016 14:13:21 +0000 (16:13 +0200)]
MIPS: add possibility to setup initial stack and global data in SRAM

This adds a new Kconfig option CONFIG_MIPS_INIT_STACK_IN_SRAM which
a SoC can select if it supports some kind of SRAM. Together with
CONFIG_SYS_INIT_SP_ADDR the initial stack and global data can be
set up in that SRAM. This can be used to provide a C environment
also for lowlevel_init().

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7 years agoMIPS: factor out code for initial stack and global data
Daniel Schwierzeck [Sun, 25 Sep 2016 16:36:38 +0000 (18:36 +0200)]
MIPS: factor out code for initial stack and global data

Move the code for setting up the initial stack and global data
to a macro to be able to use it more than once.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7 years agoMIPS: fix iand optimize setup of CP0 registers
Daniel Schwierzeck [Sun, 7 Feb 2016 23:37:59 +0000 (00:37 +0100)]
MIPS: fix iand optimize setup of CP0 registers

Clear cp0 status while preserving implementation specific bits.
Set bits BEV and ERL as the arch specification requires after
a reset or soft-reset exception.

Extend and fix initialization of watch registers. Check if additional
watch register sets are implemented and initialize them too.

Initialize cp0 count as early as possible to get the most
accurate boot timing.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7 years agoMIPS: fix ROM exception vectors
Daniel Schwierzeck [Sun, 7 Feb 2016 18:39:58 +0000 (19:39 +0100)]
MIPS: fix ROM exception vectors

When booting from ROM, early exceptions can't be handled
properly. Instead of busy-looping give the developer the
possibilty to examine the situation. Invoke an UHI
exception operation which can be read as unhandled exception
by a hardware debugger if one is attached. If the debugger
doesn't support UHI, the exception is read as unexpected
breakpoint.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7 years agoMIPS: make inclusion of ROM exception vectors configurable
Daniel Schwierzeck [Sun, 14 Feb 2016 17:52:57 +0000 (18:52 +0100)]
MIPS: make inclusion of ROM exception vectors configurable

This adds a compile time option to include code for static
exception vectors. Static exception vectors are only needed,
when the U-Boot entry point is equal to the CPU reset exception
vector address. For instance this is the case when U-Boot is
used as ROM in Qemu or booted from parallel NOR flash. When
U-Boot is booted from RAM (e.g. loaded there by SPL), the
exception vectors need to be setup dynamically, which is done
in follow-up commits.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7 years agoMerge branch 'master' of git://www.denx.de/git/u-boot-imx
Tom Rini [Wed, 30 Nov 2016 14:57:52 +0000 (09:57 -0500)]
Merge branch 'master' of git://denx.de/git/u-boot-imx

7 years agoimx6: clock: Enable External Memory Interface [EIM] clock (eim_slow_clock)
Lukasz Majewski [Mon, 28 Nov 2016 06:18:14 +0000 (07:18 +0100)]
imx6: clock: Enable External Memory Interface [EIM] clock (eim_slow_clock)

This patch extends the imx6 clock code to enable or disable the EIM
slow clock, which in necessary when one wants to use EIM interface t
o read/write from external memory (e.g. NOR).

Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
7 years agomx6sx: Add initial support for Samtec VIN|ING 2000 board
Christoph Fritz [Tue, 29 Nov 2016 15:13:40 +0000 (16:13 +0100)]
mx6sx: Add initial support for Samtec VIN|ING 2000 board

This patch adds initial support for Samtec VIN|ING 2000 board.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
7 years agoMerge git://git.denx.de/u-boot-mpc85xx
Tom Rini [Wed, 30 Nov 2016 00:42:48 +0000 (19:42 -0500)]
Merge git://git.denx.de/u-boot-mpc85xx

7 years agotravis.yml: Add samsung and rockchip builds
Tom Rini [Tue, 29 Nov 2016 17:41:19 +0000 (12:41 -0500)]
travis.yml: Add samsung and rockchip builds

The catch-all job is failing due to time limits depending on factors out
of our control, so move Samsung and Rockchip boards into their own jobs
and then exclude them from the general ARM and AArch64 jobs.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoimx7: SPI: add suport for SPI flash in mikroBUS slot
Angus Ainslie [Fri, 11 Nov 2016 18:31:39 +0000 (11:31 -0700)]
imx7: SPI: add suport for SPI flash in mikroBUS slot

Enable the escpi3 nets attached to the mikroBUS slot
on the i.MX7 Sabre evalution board. Also enble the SPI flash
commands to work with the "flash click" board.

This is V2 of this patch with changes recommended by the maintainer

CC: Jagan Teki <jteki@openedev.com>
7 years agoarm: mx6: specify SPL padding
Stefan Agner [Tue, 15 Nov 2016 18:38:23 +0000 (10:38 -0800)]
arm: mx6: specify SPL padding

Specify standard padding for payload to 68KB. This is derived from
the maximum header size plus maximum SPL size. It matches the
already defined offset for SD/eMMC devices (69KB) too. This allows
to use the u-boot-with-spl.imx build target to generate a directly
flashable image which can be flashed using:

  dd if=u-boot-with-spl.imx of=/dev/mmcblk0 bs=512 skip=2

While the patch has been created with SD/eMMC in mind, this also
works with other boot media. The board file needs to configure the
media specific (absolute) payload offset accordingly. Especially
the IVT offset is boot media specific and can be retrieved from the
reference manual (Table 8-25. Image Vector Table Offset and Initial
Load Region Size). For NAND boot a define like this should do the
job:

 #define CONFIG_SYS_NAND_U_BOOT_OFFS (SPL_PAD_TO + 0x400)

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
7 years agomx6sx: Add initial support for UDOO Neo Board
Breno Lima [Fri, 25 Nov 2016 18:56:57 +0000 (16:56 -0200)]
mx6sx: Add initial support for UDOO Neo Board

UDOO Neo Board is a development board from Seco that has three models:
 - UDOO Neo Basic
 - UDOO Neo Basic Kick Starter
 - UDOO Neo Extended
 - UDOO Neo Full

All versions are based on the i.MX6 SoloX processor.

For more details about the UDOO Neo board, please refer to:
http://www.udoo.org/udoo-neo/

This work is based on a previous commit of Francesco Montefoschi
<francesco.monte@gmail.com>:
https://github.com/fmntf/u-boot/commit/877b71184a5105e708024f232d36aed574961844

Only tested on the UDOO Neo Full board.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
7 years agocolibri_vf: Read kernel and device tree from static UBI volumes
Sanchayan Maity [Fri, 25 Nov 2016 10:49:17 +0000 (16:19 +0530)]
colibri_vf: Read kernel and device tree from static UBI volumes

Our update scripts write the kernel and device tree in seperate
UBI volumes. This allows to use a lot less UBI/UBIFS support in
U-Boot, which should lower the risk of hitting bugs in this area.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
7 years agoARM: ts4600: add basic board support
Sebastien Bourdelin [Tue, 8 Nov 2016 17:18:07 +0000 (12:18 -0500)]
ARM: ts4600: add basic board support

This commit adds basic support including:
MMC, Serial console

Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
7 years agoboard: ge: bx50v3: add the PMIC configuration support
Ken Lin [Fri, 18 Nov 2016 17:20:54 +0000 (12:20 -0500)]
board: ge: bx50v3: add the PMIC configuration support

Change the PMIC bulk configuration from auto mode to sync mode to avoid
voltage dropout issue seen in auto mode.

Signed-off-by: Ken Lin <ken.lin@advantech.com.tw>
Signed-off-by: Akshay Bhat <akshay.bhat@timesys.com>
7 years agoARM: mx6: ddr: use Kconfig for inclusion of DDR calibration routines
Eric Nelson [Sun, 30 Oct 2016 23:33:50 +0000 (16:33 -0700)]
ARM: mx6: ddr: use Kconfig for inclusion of DDR calibration routines

The DDR calibration routines are gated by conditionals for the
i.MX6DQ SOCs, but with the use of the sysinfo parameter, these
are usable on at least i.MX6SDL and i.MX6SL variants with DDR3.

Also, since only the Novena board currently uses the dynamic
DDR calibration routines, these routines waste space on other
boards using SPL.

Add a KConfig entry to allow boards to selectively include the
DDR calibration routines.

Signed-off-by: Eric Nelson <eric@nelint.com>
7 years agomx6: ddr: add routine to return DDR calibration data
Eric Nelson [Sun, 30 Oct 2016 23:33:49 +0000 (16:33 -0700)]
mx6: ddr: add routine to return DDR calibration data

Add routine mmdc_read_calibration() to return the output of DDR
calibration. This can be used for debugging or to aid in construction
of static memory configuration.

This routine will be used in a subsequent patch set adding a virtual
"mx6memcal" board, but could also be useful when gathering statistics
during an initial production run.

Signed-off-by: Eric Nelson <eric@nelint.com>
7 years agomx6: ddr: pass mx6_ddr_sysinfo to calibration routines
Eric Nelson [Sun, 30 Oct 2016 23:33:48 +0000 (16:33 -0700)]
mx6: ddr: pass mx6_ddr_sysinfo to calibration routines

The DDR calibration routines have scattered support for bus
widths other than 64-bits:

-- The mmdc_do_write_level_calibration() routine assumes the
presence of PHY1, and
-- The mmdc_do_dqs_calibration() routine tries to determine
whether one or two DDR PHYs are active by reading MDCTL.

Since a caller of these routines must have a valid struct mx6_ddr_sysinfo
for use in calling mx6_dram_cfg(), and the bus width is available in the
"dsize" field, use this structure to inform the calibration routines which
PHYs are active.

This allows the use of the DDR calibration routines on CPU variants
like i.MX6SL that only have a single MMDC port.

Signed-off-by: Eric Nelson <eric@nelint.com>
Reviewed-by: Marek Vasut <marex@denx.de>
7 years agomx6: ddr: allow 32 cycles for DQS gating calibration
Eric Nelson [Sun, 30 Oct 2016 23:33:47 +0000 (16:33 -0700)]
mx6: ddr: allow 32 cycles for DQS gating calibration

The DDR calibration code is only setting flag DG_CMP_CYC (DQS gating sample
cycle) for the first PHY.

Set the 32-cycle flag for both PHYs and clear when done so the MPDGCTRL0
output value isn't polluted with calibration artifacts.

Signed-off-by: Eric Nelson <eric@nelint.com>
Reviewed-by: Marek Vasut <marex@denx.de>
7 years agoimx: mx6: ddr: add register MPZQLP2CTL for LPDDR2
Eric Nelson [Fri, 28 Oct 2016 17:13:57 +0000 (10:13 -0700)]
imx: mx6: ddr: add register MPZQLP2CTL for LPDDR2

Add constants for the MPZQLP2CTL DDR register for both
banks to allow setting the LPDDR2 timing values in
.cfg files using a named constant instead of hex addresses
as is currently done in mx6slevk and other board files.

Signed-off-by: Eric Nelson <eric@nelint.com>
7 years agotools: imximage: display DCD block offset, length
Eric Nelson [Thu, 17 Nov 2016 00:13:41 +0000 (17:13 -0700)]
tools: imximage: display DCD block offset, length

These values can be used to sign a U-Boot image for use when
loading an image through the Serial Download Protocol (SDP).

Note that the address of 0x910000 is usable with the stock
configuration of imx_usb_loader on i.MX6 and i.MX7 SOCs:

https://github.com/boundarydevices/imx_usb_loader/blob/master/mx6_usb_work.conf#L3

Refer to the section on imx_usb_loader in this post for more
details:

https://boundarydevices.com/high-assurance-boot-hab-dummies/

Signed-off-by: Eric Nelson <eric@nelint.com>
7 years agoarm: imx: wandboard: fix compile error if CONFIG_VIDEO is deactivated
Sven Ebenfeld [Fri, 25 Nov 2016 20:42:53 +0000 (21:42 +0100)]
arm: imx: wandboard: fix compile error if CONFIG_VIDEO is deactivated

When I tried to deactivate VIDEO support for the Wandboard, it still
tried to initialize the Framebuffer and so on. That is the reason for
the added ifdefs. CONFIG_VIDEO is enabled in the configuration as default
and therefore nothing changes for the default user.

The structs mx6dl_i2c2_pad_info and mx6q_i2c2_pad_info are only available
when CONFIG_IPUV3 are set and should not be tried to access, when that
define is not defined.

Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
7 years agopwm: imx: increase support up to PWM8 for i.MX6SX
Christoph Fritz [Tue, 22 Nov 2016 11:01:28 +0000 (12:01 +0100)]
pwm: imx: increase support up to PWM8 for i.MX6SX

This patch increases supported PWMs from previously PWM4 now up to PWM8
if i.MX6SX is in use.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
7 years agotbs2910: Make Ethernet functional again
Soeren Moch [Sun, 27 Nov 2016 15:02:19 +0000 (16:02 +0100)]
tbs2910: Make Ethernet functional again

Configure the PHY to output a 125MHz clk from CLK_25M and set tx clock delay.
This patch is similar to commit 4b6035da482cccda06aeb419634f99937c9fc783
("mx6sabresd: Make Ethernet functional again").

Signed-off-by: Soeren Moch <smoch@web.de>
7 years agoimx: make ipu's di configurable
Max Krummenacher [Tue, 1 Nov 2016 14:04:21 +0000 (15:04 +0100)]
imx: make ipu's di configurable

The ipu has two display interfaces. Make the used one a parameter
in struct display_info_t instead of using unconditionally DI0.
DI0 is the default setting.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Eric Nelson <eric@nelint.com>
7 years agospl: mmc: fix switch statement
Max Krummenacher [Tue, 1 Nov 2016 14:04:20 +0000 (15:04 +0100)]
spl: mmc: fix switch statement

If CONFIG_SPL_LIBCOMMON_SUPPORT is not defined there is a lone case statement
at the end of the switch leading to a compile error.
Remove the offending case statement.

| common/spl/spl_mmc.c:339:7: error: label at end of compound statement

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Marek Vasut <marex@denx.de>
7 years agoARM: mx6: add MMC2 boot device detection support in SPL
Marcin Niestroj [Fri, 21 Oct 2016 11:53:54 +0000 (13:53 +0200)]
ARM: mx6: add MMC2 boot device detection support in SPL

Check BOOT_CFG2[3:4] to determine which SD/MMC port is selected to boot
from. If MMC2 is selected return BOOT_DEVICE_MMC2. In all other cases
return BOOT_DEVICE_MMC1, as we do not have corresponding macro for MMC3
and MMC4.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
7 years agoMerge branch 'master' of git://git.denx.de/u-boot
Stefano Babic [Tue, 29 Nov 2016 15:28:28 +0000 (16:28 +0100)]
Merge branch 'master' of git://git.denx.de/u-boot

Signed-off-by: Stefano Babic <sbabic@denx.de>
7 years agoarmv7: psci: cpu_off: flush D-Cache before disable D-Cache
Peng Fan [Tue, 22 Nov 2016 11:41:09 +0000 (19:41 +0800)]
armv7: psci: cpu_off: flush D-Cache before disable D-Cache

Before disable cache, need to first flush cache.

There maybe dirty data in D-Cache before disable D-Cache.
After disable D-Cache, the first store instructions in
psci_v7_flush_dcache_all will directly store registers
{r4-r5, r7, r9-r11, lr} to memory.
If there is dirty data before disable D-Cache,
psci_v7_flush_dcache_all will flush data to memory,
and may overwrite the memory that hold the registers
{r4-r5, r7, r9-r11, lr}.

So before disable cache, first flush D-Cache.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Hongbo Zhang <hongbo.zhang@nxp.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Tom Rini <trini@konsulko.com>
7 years agovexpress64: Juno: Change PCI buss addresses for IO to start from zero.
Liviu Dudau [Tue, 22 Nov 2016 11:19:18 +0000 (11:19 +0000)]
vexpress64: Juno: Change PCI buss addresses for IO to start from zero.

Juno uses a 1:1 mapping between CPU and PCI addresses for IO. First,
that will trip devices that cannot use more than 16 bits of addresses
for IO, second it is un-necessary as the system can handle zero-based
PCI addresses just fine.

Change the mapping to start IO bus addresses from zero.

Signed-off-by: Liviu Dudau <Liviu.Dudau@foss.arm.com>
8 years agobcm2835: Reserve the spin table in efi memory map
Alexander Graf [Wed, 2 Nov 2016 09:36:20 +0000 (10:36 +0100)]
bcm2835: Reserve the spin table in efi memory map

Firmware provides a spin table on the raspberry pi. This table shouldn't
get overwritten by payloads, so we need to mark it as reserved.

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agobcm2835 video: Map frame buffer as 32bpp
Alexander Graf [Wed, 2 Nov 2016 09:36:19 +0000 (10:36 +0100)]
bcm2835 video: Map frame buffer as 32bpp

To enable working efifb support, let's map the frame buffer as 32bpp
instead of 16bpp.

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agoARM: bcm283x: Implement EFI RTS reset_system
Alexander Graf [Wed, 2 Nov 2016 09:36:18 +0000 (10:36 +0100)]
ARM: bcm283x: Implement EFI RTS reset_system

The rpi has a pretty simple way of resetting the whole system. All it takes
is to poke a few registers at a well defined location in MMIO space.

This patch adds support for the EFI loader implementation to allow an OS to
reset and power off the system when we're outside of boot time.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agodrivers: net: keystone_net: add rgmii link type support when parsing dt
Mugunthan V N [Thu, 11 Aug 2016 14:34:03 +0000 (20:04 +0530)]
drivers: net: keystone_net: add rgmii link type support when parsing dt

Add support to detect RGMII link interface from link-interface
device tree entry. Also rename the existing link type enums so
that it provides meaningful interface like SGMII.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reported-by: Sekhar Nori <nsekhar@ti.com>
Tested-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agoARM: bcm283x: use OF_CONTROL for bcm283x
Fabian Vogt [Mon, 26 Sep 2016 12:26:51 +0000 (14:26 +0200)]
ARM: bcm283x: use OF_CONTROL for bcm283x

This patch removes use of U_BOOT_DEVICE in board/raspberrypi/rpi/rpi.c,
enables OF_CONTROL in the config and adjusts the rpi_*defconfig configs.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoboard: rpi: move uart deactivation to board_init
Fabian Vogt [Mon, 26 Sep 2016 12:26:50 +0000 (14:26 +0200)]
board: rpi: move uart deactivation to board_init

When using OF_CONTROL, the disabled value of the mini UART platdata
gets reset after board_early_init_f. So move detection and disabling
to board_init and remove board_early_init_f.
This uses the first device using the mini uart driver, as this method
works reliably with different device trees or even no device tree at all.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoserial: bcm283x_mu: support disabling after initialization
Fabian Vogt [Mon, 26 Sep 2016 12:26:49 +0000 (14:26 +0200)]
serial: bcm283x_mu: support disabling after initialization

For the Raspberry Pi 3 it needs to be possible to disable the serial
device after initialization happens, as only after the GPIO device is available
it is known whether the mini uart is usable.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agofdt: adjust bcm283x device tree for u-boot
Fabian Vogt [Mon, 26 Sep 2016 12:26:48 +0000 (14:26 +0200)]
fdt: adjust bcm283x device tree for u-boot

The information currently set via platdata has to be represented in the
device tree now. bcm283x-uboot.dtsi adds the u-boot specific "skip-init"
property to the serial nodes and enables initialization in the pre-reloc phase.

Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agofdt: import bcm283x device tree sources from the linux kernel tree
Fabian Vogt [Mon, 26 Sep 2016 12:26:47 +0000 (14:26 +0200)]
fdt: import bcm283x device tree sources from the linux kernel tree

This patch adds device trees for the bcm283x platform to be used with
OF_CONTROL. The version 4.8-rc7 of the linux kernel was used as source.

Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agofdt: add dt-bindings for bcm2835
Fabian Vogt [Mon, 26 Sep 2016 12:26:46 +0000 (14:26 +0200)]
fdt: add dt-bindings for bcm2835

This patch adds dt-bindings as used by the linux kernel device trees
for the bcm283x family.

Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoserial: pl01x: expose skip_init platdata option in DT
Fabian Vogt [Mon, 26 Sep 2016 12:26:45 +0000 (14:26 +0200)]
serial: pl01x: expose skip_init platdata option in DT

To be able to represent the skip-init platdata element with OF_CONTROL,
it needs to be read from the device tree as well and put into the platform data.

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoserial: bcm283x_mu: add device tree support
Fabian Vogt [Mon, 26 Sep 2016 12:26:44 +0000 (14:26 +0200)]
serial: bcm283x_mu: add device tree support

This patch adds device tree support for the bcm283x mini-uart driver.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agogpio: bcm2835: add device tree support
Fabian Vogt [Mon, 26 Sep 2016 12:26:43 +0000 (14:26 +0200)]
gpio: bcm2835: add device tree support

This patch adds device tree support for the bcm2835 GPIO driver.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agofs/fat/fatwrite: Local variable as buffer to store dir_slot entries
Tien Fong Chee [Thu, 28 Jul 2016 06:08:56 +0000 (23:08 -0700)]
fs/fat/fatwrite: Local variable as buffer to store dir_slot entries

fill_dir_slot use get_contents_vfatname_block as a temporary buffer for
constructing a list of dir_slot entries. To save the memory and providing
correct type of memory for above usage, a local buffer with accurate size
declaration is introduced.

The local array size 640 is used because for long file name entry,
each entry use 32 bytes, one entry can store up to 13 characters.
The maximum number of entry possible is 20. So, total size is
32*20=640bytes.

Signed-off-by: Genevieve Chan <ccheauya@altera.com>
Signed-off-by: Tien Fong Chee <tfchee@altera.com>
8 years agospl: add USB Gadget config option
Stefan Agner [Mon, 21 Nov 2016 18:58:53 +0000 (10:58 -0800)]
spl: add USB Gadget config option

Introduce USB Gadget config option. This allows to combine Makefile
entries for SPL_USBETH_SUPPORT and SPL_DFU_SUPPORT.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Ravi Babu <ravibabu@ti.com>
8 years agospl: dfu: move DFU Kconfig to SPL Kconfig
Stefan Agner [Mon, 21 Nov 2016 18:58:52 +0000 (10:58 -0800)]
spl: dfu: move DFU Kconfig to SPL Kconfig

The DFU Kconfig menu entries should be part of the SPL
Kconfig file. Also avoid using the top level Makefile by
moving the config dependent build artifacts to the driver/
and driver/usb/gadget/ Makfiles.

With that, DFU can be built again in SPL if
CONFIG_SPL_DFU_SUPPORT is enabled.

Fixes: 6ad6102246d8 ("usb:gadget: Disallow DFU in SPL for now")

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agospl: add RAM boot device only if it is actually defined
Stefan Agner [Mon, 21 Nov 2016 18:58:51 +0000 (10:58 -0800)]
spl: add RAM boot device only if it is actually defined

Some devices (e.g. dra7xx) support loading to RAM using DFU without
having direct boot from RAM support. Make sure the linker list
does not contain BOOT_DEVICE_RAM if CONFIG_SPL_RAM_DEVICE is not
enabled.

Fixes: 98136b2f26fa ("spl: Convert spl_ram_load_image() to use linker list")

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoREADME: fix typo FAT_ENV_DEV_AND_PART
Nicolae Rosia [Mon, 21 Nov 2016 15:33:58 +0000 (17:33 +0200)]
README: fix typo FAT_ENV_DEV_AND_PART

The actual define symbol is FAT_ENV_DEVICE_AND_PART

Signed-off-by: Nicolae Rosia <Nicolae_Rosia@Mentor.com>
8 years agoxyz-modem: Change getc timeout loop waiting
tomas.melin@vaisala.com [Mon, 21 Nov 2016 08:18:51 +0000 (10:18 +0200)]
xyz-modem: Change getc timeout loop waiting

This fixes the loop delay when using a hw watchdog.

In case a watchdog is used that accesses CPU registers,
the defined delay of 20us in a tight loop will cause a
huge delay in the actual timeout seen. This is caused
by the fact that udelay will inheritantly call WATCHDOG_RESET.
Together with the omap wdt implementation, the seen timeout increases up to
around 30s. This makes the loop very slow and causes long
delays when using the modem.

Instead, implement the 2 sec loop by using the timer interface to know
when to break out of the timeout loop. Watchdog kicking is taken care of
by getc().

Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
8 years agosata: fix sata command can not being executed bug
Tang Yuantian [Mon, 21 Nov 2016 02:24:20 +0000 (10:24 +0800)]
sata: fix sata command can not being executed bug

Commit d97dc8a0 separated the non-command code into its own file
which caused variable sata_curr_device can not be set to a correct
value.

Before commit d97dc8a0, variable sata_curr_device can be set
correctly in sata_initialize().
After commit d97dc8a0, sata_initialize() is moved out to its own file.
Accordingly, variable sata_curr_device is removed from sata_initialize()
too. This caused sata_curr_device never gets a chance to be set properly
which prevent other commands from being executed.

This patch sets variable sata_curr_device properly.

Fixes: d97dc8a0 (dm: sata: Separate the non-command code into its
 own file)

Signed-off-by: Tang Yuantian <yuantian.tang@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agotools/env: fix environment alignment tests for block devices
Max Krummenacher [Sat, 19 Nov 2016 12:58:56 +0000 (13:58 +0100)]
tools/env: fix environment alignment tests for block devices

commit 183923d3e412500bdc597d1745e2fb6f7f679ec7 enforces that the
environment must start at an erase block boundary.

For block devices the sample fw_env.config does not mandate a erase block size
for block devices. A missing setting defaults to the full env size.

Depending on the environment location the alignment check now errors out for
perfectly legal settings.

Fix this by defaulting to the standard blocksize of 0x200 for environments
stored in a block device.
That keeps the fw_env.config files for block devices working even with that
new check.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
8 years agotools/Makefile: suppress "which swig" error output
Andre Przywara [Sat, 19 Nov 2016 12:04:59 +0000 (12:04 +0000)]
tools/Makefile: suppress "which swig" error output

The Makefile in tools/ tries to find the "swig" utility by calling "which".
If nothing is found in the path, some versions of which will print an error
message:
$ make clean
which: no swig in (/usr/local/bin:/usr/bin:/bin)

This does not apply to all version of "which", though:
$ echo $0
bash
$ type which
which is aliased to `type -path'
$ which foo <== this version is OK
$ /usr/bin/which foo <== this one is chatty
/usr/bin/which: no foo in (/usr/local/bin:/usr/bin:/bin)
$ sh <== make uses /bin/sh
sh-4.3$ which foo <== no alias here
which: no foo in (/usr/local/bin:/usr/bin:/bin)

This error message is rather pointless in our case, since we just have
this very check to care for this. So add stderr redirection to suppress
the message.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoti_armv7_keystone2: env: Add NFS loading support for PMMC and MON
Andrew F. Davis [Fri, 18 Nov 2016 17:56:16 +0000 (11:56 -0600)]
ti_armv7_keystone2: env: Add NFS loading support for PMMC and MON

NFS loading support has been added to the default environment for
most boot components, as PMMC and MON loading were added later they
did not originally get the NFS commands added, add these now.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agokeystone2: Move target selection to Kconfig
Andrew F. Davis [Fri, 18 Nov 2016 17:56:15 +0000 (11:56 -0600)]
keystone2: Move target selection to Kconfig

The config option TARGET_K2x_EVM is set by the k2x defconfigs to pick
a board target, but the header configs also set K2x_EVM. This config
is redundant, remove it and use TARGET_K2x_EVM everywhere in its place.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>