]> git.sur5r.net Git - u-boot/log
u-boot
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 agor2dplus: fixup CONFIG_SYS_TEXT_BASE to account arch/sh changes
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:36 +0000 (00:15 +0200)]
r2dplus: fixup CONFIG_SYS_TEXT_BASE to account arch/sh changes

This change allows to reserve enough space at the end of board SDRAM
to store two copies of U-Boot and malloc heap.

Due to selection of the CONFIG_SYS_TEXT_BASE the second code/data
copying is not avoided, first of all this may depend on a used
toolchain, secondly at this point some level of volatility is wanted
to do more platform changes and do not care about probably changed
calculated in runtime relocation offset.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agosh: generate position independent code for all platforms
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:35 +0000 (00:15 +0200)]
sh: generate position independent code for all platforms

Finally add fpic compilation option to produce relocatable code.
Note that this requires to define CONFIG_NEEDS_MANUAL_RELOC for all
board files, also relocation support still has some limitations
(e.g. a developer should care not to overwrite the executing code or
memset() with zeroes not yet relocated data on malloc init etc.),
which may be fixed while switching to PIE.

Due to short investigation the architecture code is not ready for PIE
linking, this will require some manipulations with .dyn* sections.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agosh: share the correct version of start.S among all cpus
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:34 +0000 (00:15 +0200)]
sh: share the correct version of start.S among all cpus

It is easy to note that SH2/SH3/SH4 start.S code is practically
the same with a minor difference for SH2 where a short data header is
present. To avoid unwanted code duplication and to automatically
convert SH2 and SH3 platforms to generic board support move fixed SH4
start.S into arch/sh/lib/start.S and share it among all platforms.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh4: fix start.S by calling board_init_f() after first code relocation
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:33 +0000 (00:15 +0200)]
sh4: fix start.S by calling board_init_f() after first code relocation

Like on ARM platform keep the first code relocation from a U-boot
image storage to RAM at CONFIG_SYS_TEXT_BASE, then pass execution to a
generic board_init_f() with empty GD flags. If CONFIG_SYS_TEXT_BASE is
equal to a calculated by board_init_f() relocation address there will
be no more code and data copy, however it's worth to mention that the
first copy happens even if $pc on _start is the same as
CONFIG_SYS_TEXT_BASE, on practice this works without a problem.

Also note that _sh_start is renamed back to _start to correct
gd->mon_len calculation by setup_mon_len(), the opposite rename was
done in pre-generic board commit 2024b968ee9 ("sh: Fix build in start.S").

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: add shared relocate_code() function and call board_init_r()
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:32 +0000 (00:15 +0200)]
sh: add shared relocate_code() function and call board_init_r()

Commits b61e90e6fd83 ("sh: Drop the arch-specific board init") and
f41e6088eb1a ("sh: Fix build errors for generic board") left code and
data relocation done in start.S, however further actual U-boot
configuration is not started anymore. Practically SH boards with the
code relocated into the expected position by start.S still can be
booted, so the change adds this option and provides an option how to
relocate code for board_init_r() execution.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: add common dram_init() function for all boards
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:31 +0000 (00:15 +0200)]
sh: add common dram_init() function for all boards

Generic board support assumes a different method of specifying
DRAM size on board, also it can be shared among all boards, notably
only sh7763rdp board has a custom legacy dram_init(), however
the difference is only in printing some additional information,
this feature can be removed.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: define CONFIG_DISPLAY_BOARDINFO to print board information
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:30 +0000 (00:15 +0200)]
sh: define CONFIG_DISPLAY_BOARDINFO to print board information

All SH boards define a checkboard() function which outputs basic board
information on boot, however generic board support requires to define
CONFIG_DISPLAY_BOARDINFO to do that, so define it for the boards.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: remove undefined DEBUG preprocessor token from board config files
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:29 +0000 (00:15 +0200)]
sh: remove undefined DEBUG preprocessor token from board config files

By default this undef is a noop, moreover at this point when the
platform support is broken is prevents debugging of U-boot by manual
insertion of #define DEBUG into common files, so it makes sense to
remove the option from all SH boards as a harmful one.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: add MEMORY command to a shared linker script
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:28 +0000 (00:15 +0200)]
sh: add MEMORY command to a shared linker script

At the moment in runtime all defined sections are copied into or
created in RAM, specify this explicitly to assert potential out of RAM
placements of the sections.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: define entry point and reloc_dst inside a linker script
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:27 +0000 (00:15 +0200)]
sh: define entry point and reloc_dst inside a linker script

No functional change, concentrate linker script commands in one
place for convenience. Entry point is set to CONFIG_SYS_TEXT_BASE by
default on build, so this option can be omitted from being added to
the linker script.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: place board lowlevel_init code in the beginning of .text
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:26 +0000 (00:15 +0200)]
sh: place board lowlevel_init code in the beginning of .text

Reference lowlevel_init of all supported SH2A/SH3/SH4/SH4A boards
from a shared linker script, the lowlevel_init function will be called
by a relative address.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh4: use single u-boot linker script for all boards
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:25 +0000 (00:15 +0200)]
sh4: use single u-boot linker script for all boards

Three supported SH4/SH4A boards with the bootloader image stored on
SPI flash have own flavour of a linker script, in turn they are equal
among each other. The only difference is that the text from
lowlevel_init.o is placed right after start.o, which makes sense.

Note that .bss section is not marked as NOLOAD, because for about
10 years this is a default option of a GNU linker, either the
attribute is found or not the resulting image file is the same.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agocommon: sh: add necessary define bits to board_f
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:24 +0000 (00:15 +0200)]
common: sh: add necessary define bits to board_f

Since a platform conversion to generic board support has not been
accomplished some architecture specific bits are missing from board_f
init sequence, the change adds a number of basic expected callbacks
into early init sequence.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agor2dplus: select rtl8139 driver in defconfig
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:23 +0000 (00:15 +0200)]
r2dplus: select rtl8139 driver in defconfig

CONFIG_RTL8139 was moved to a board defconfig by a commit 86e9dc86b1a2
("net: Move CONFIG_RTL8139 to Kconfig"), however it was done
incorrectly due to a missing CONFIG_NETDEVICES selection, thus
virtually it was just a removal of the driver compilation.

As an unlucky consequence the option was completely removed by a purge
commit adad96e60d0e ("configs: Re-sync HUSH options"), restore the
driver inclusion back.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agor2dplus: use P1 area space for text base and PCI system memory
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:22 +0000 (00:15 +0200)]
r2dplus: use P1 area space for text base and PCI system memory

While both options are acceptable use P1 area physical addresses
instead of external memory space of text base and PCI system memory
for unification purposes, all other supported superh boards have the
same selection.

This allows to easily ensure that CONFIG_SYS_TEXT_BASE is located
within available DRAM.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh4: remove __io config options from r2dplus and r7780mp boards
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:21 +0000 (00:15 +0200)]
sh4: remove __io config options from r2dplus and r7780mp boards

Defined __io is no-op for the SH architecture and it can be removed
from board files without any functional change.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agopci: sh7751: map PCI memory space into SDRAM
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:20 +0000 (00:15 +0200)]
pci: sh7751: map PCI memory space into SDRAM

For ease of use and accounting a condition that on SH4
pci_phys_to_bus() and pci_bus_to_phys() are one in one mappings due to
unimplemented __iomem() conversion, this change fixes access to SDRAM
memory by PCI devices.

This change also generalizes PCI system memory configuration, which is
taken from board specific defines rather than hardcoded in the PCI
host driver.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agopci: sh7751: fix up PCI I/O space address
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:19 +0000 (00:15 +0200)]
pci: sh7751: fix up PCI I/O space address

The change actually maps PCI I/O window to the same address on PCI bus
as it is stated by a comment, before the change transfers to the PCI I/O
space are failed due to misconfiguration of the most significant 14 bits
of the PCI address in PCIIOBR (note that it is set to 0x0).

Most probably the problem remained unnoticed, because communcation
to all tested PCI devices is done over PCI memory space only.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agosh4: cache: move exported cache manipulation functions into cache.c
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:18 +0000 (00:15 +0200)]
sh4: cache: move exported cache manipulation functions into cache.c

No functional change, moving cache manipulation functions into cache.c
allows to collect all of them in a single location and as a pleasant
side effect cache_control() function can be unexported now.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: cache: don't modify CCR from P1 area
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:17 +0000 (00:15 +0200)]
sh: cache: don't modify CCR from P1 area

cache_wback_all() is a local function and it is called from
cache_control() only, which is in turn jumps to P2 area.

The change fixes an issue when cache_wback_all() returns from P2 to
P1, however cache_control() continues to manipulate with CCR
register, according to the User's Manual this is restricted.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agosh: cache use jump_to_P2() and back_to_P1() from asm/system.h
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:16 +0000 (00:15 +0200)]
sh: cache use jump_to_P2() and back_to_P1() from asm/system.h

Both jump_to_P2() and back_to_P1() functions are found in asm/system.h
header file and functionally they are the same, don't redefine them.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh3: remove unused cache.c file from being built
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:15 +0000 (00:15 +0200)]
sh3: remove unused cache.c file from being built

The change is similar to commit 994b56616bae ("sh: delete an unused
source file") for SH2, however here the removed cache.c file was
built and included into an image as a dead code.

If it is needed in future the contents can be reused from a similar
arch/sh/cpu/sh4/cache.c file, which is in turn will be moved to
a shared among all core flavours location at arch/sh/lib/cache.c.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh4: cache: correct flush_cache() to writeback and invalidate
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:14 +0000 (00:15 +0200)]
sh4: cache: correct flush_cache() to writeback and invalidate

In common usecases flush_cache() assumes both cache invalidation and
write-back to memory, instead of doing cache invalidation only with
the wrapped 'ocbi' instruction pin flush_cache() to cache invalidation
with memory write-back done by 'ocbp'.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh4: cache: correct dcache flush to invalidate with write-back
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:13 +0000 (00:15 +0200)]
sh4: cache: correct dcache flush to invalidate with write-back

In common usecases flush_cache() assumes both cache invalidation and
write-back to memory, thus in flush_dcache_range() implementation
change SH4 cache write-back only instruction 'ocbwb' with cache purge
instruction 'ocbp', according to the User's Manual there should be no
performance penalty for that.

Note that under circumstances only cache invalidation is expected from
flush_cache() call, in these occasional cases the current version of
flush_cache() works, which is a wrapper over invalidate_dcache_range()
at the moment, this will be fixed in the following change.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agocompiler.h: use u-boot endian macros on OpenBSD
Jonathan Gray [Sat, 26 Nov 2016 04:18:00 +0000 (15:18 +1100)]
compiler.h: use u-boot endian macros on OpenBSD

When building u-boot on sparc64 and powerpc hosts it became clear that
u-boot expects endian conversion defines to be macros:

lib/crc32.c:87: error: braced-group within expression allowed only inside a function

For OpenBSD switch from using system definitions equivalent to the u-boot ones
and define glibc __BYTE_ORDER __BIG_ENDIAN __LITTLE_ENDIAN names, as at least
some parts of the non-cross build assumes those names are present (ie crc32.c).

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
7 years agoARM: am57xx_evm: enable DFU support
Sekhar Nori [Fri, 25 Nov 2016 08:55:55 +0000 (14:25 +0530)]
ARM: am57xx_evm: enable DFU support

AM57xx GP EVM has USB2 port of the SoC exposed as
USB client port.

It is useful to be able to use this port for USB
DFU downloads.

Enable USB DFU support. Tested on AM57x GP EVM Rev
A3 using DFU to download to connected SD card.

configs for HS version of the AM57x EVM are
included in the patch but not really tested.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoARM: ti: consolidate dfu environment variables
Sekhar Nori [Fri, 25 Nov 2016 08:55:54 +0000 (14:25 +0530)]
ARM: ti: consolidate dfu environment variables

Introduce include/environment/ti/dfu.h that
consolidates environment variable definitions
for various TI boards that support DFU today.

Tested on AM335x EVM, AM437x SK EVM and DRA74x
EVM by using DFU to write to SD card.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agopowerpc: mpc85xx: Convert CONFIG_SYS_FSL_NUM_LAWS to Kconfig option
York Sun [Thu, 1 Dec 2016 22:05:02 +0000 (14:05 -0800)]
powerpc: mpc85xx: Convert CONFIG_SYS_FSL_NUM_LAWS to Kconfig option

Move the macro to Kconfig SYS_FSL_NUM_LAWS.

Signed-off-by: York Sun <york.sun@nxp.com>
7 years agopowerpc: mpc86xx: Move CONFIG_FSL_LAW to Kconfig
York Sun [Fri, 2 Dec 2016 18:45:23 +0000 (10:45 -0800)]
powerpc: mpc86xx: Move CONFIG_FSL_LAW to Kconfig

Clean up existing definitions and drop from white list.

Signed-off-by: York Sun <york.sun@nxp.com>
7 years agopowerpc: mpc85xx: Move CONFIG_FSL_LAW to Kconfig
York Sun [Fri, 2 Dec 2016 18:44:34 +0000 (10:44 -0800)]
powerpc: mpc85xx: Move CONFIG_FSL_LAW to Kconfig

Some header files have this macro defined conditionally and
redefined unconditionally. Remove all existing definitions.

Signed-off-by: York Sun <york.sun@nxp.com>
7 years agopowerpc: mpc85xx: Move SECURE_BOOT to Kconfig
York Sun [Fri, 2 Dec 2016 17:33:14 +0000 (09:33 -0800)]
powerpc: mpc85xx: Move SECURE_BOOT to Kconfig

Move from CONFIG_SYS_EXTRA_OPTIONS to Kconfig option.

Signed-off-by: York Sun <york.sun@nxp.com>
7 years agoarmv8: fsl-layerscape: Move SECURE_BOOT to Kconfig
York Sun [Fri, 2 Dec 2016 17:32:35 +0000 (09:32 -0800)]
armv8: fsl-layerscape: Move SECURE_BOOT to Kconfig

Move from CONFIG_SYS_EXTRA_OPTIONS to Kconfig option.

Signed-off-by: York Sun <york.sun@nxp.com>
7 years agoarmv7: ls1021a: Move SECURE_BOOT option to Kconfig
York Sun [Fri, 2 Dec 2016 17:31:43 +0000 (09:31 -0800)]
armv7: ls1021a: Move SECURE_BOOT option to Kconfig

Move from CONFIG_SYS_EXTRA_OPTIONS to Kconfig option.

Signed-off-by: York Sun <york.sun@nxp.com>
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 agoscript: remove CONFIG_SYS_CCSRBAR_DEFAULT from white list
York Sun [Thu, 1 Dec 2016 21:43:06 +0000 (13:43 -0800)]
script: remove CONFIG_SYS_CCSRBAR_DEFAULT from white list

Now all mpc85xx and mpc86xx have converted to use SYS_CCSRBAR_DEFAULT
in Kconfig. Drop this macro for LSCH2 and remove from white list.

Signed-off-by: York Sun <york.sun@nxp.com>
7 years agopowerpc: mpc86xx: Convert CONFIG_SYS_CCSRBAR_DEFAULT to Kconfig option
York Sun [Thu, 1 Dec 2016 21:32:46 +0000 (13:32 -0800)]
powerpc: mpc86xx: Convert CONFIG_SYS_CCSRBAR_DEFAULT to Kconfig option

Move default value definitions to Kconfig SYS_CCSRBAR_DEFAULT.

Signed-off-by: York Sun <york.sun@nxp.com>
7 years agopowerpc: mpc85xx: Convert CONFIG_SYS_CCSRBAR_DEFAULT to Kconfig option
York Sun [Thu, 1 Dec 2016 21:26:06 +0000 (13:26 -0800)]
powerpc: mpc85xx: Convert CONFIG_SYS_CCSRBAR_DEFAULT to Kconfig option

Move default value definitions to to Kconfig SYS_CCSRBAR_DEFAULT.

Signed-off-by: York Sun <york.sun@nxp.com>
7 years agopowerpc: cyrus: Separate P5020/P5040 config options
York Sun [Fri, 2 Dec 2016 02:37:55 +0000 (18:37 -0800)]
powerpc: cyrus: Separate P5020/P5040 config options

Instead of using EXTRA options in defconfig, use two targets
in Kconfig to select correct SoC.

Signed-off-by: York Sun <york.sun@nxp.com>
7 years agocmd: scsi: Make private functions static
Michal Simek [Wed, 30 Nov 2016 11:18:36 +0000 (12:18 +0100)]
cmd: scsi: Make private functions static

Two functions should be static because they are not exported to any
other file.
Warnings were reported by sparse C=1.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Separate SCSI private block description initialization
Michal Simek [Wed, 30 Nov 2016 11:50:58 +0000 (12:50 +0100)]
scsi: Separate SCSI private block description initialization

When blk_create_device() is called some parameters in blk_desc are
automatically filled. Separate SCSI private initialization and SCSI full
block device initialization not to rewrite already prepared data.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Change scsi_scan() to be able to return value
Michal Simek [Wed, 30 Nov 2016 11:12:31 +0000 (12:12 +0100)]
scsi: Change scsi_scan() to be able to return value

With DM_SCSI this function will return more than one return value to
cover errors.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Make private functions static
Michal Simek [Wed, 30 Nov 2016 10:53:43 +0000 (11:53 +0100)]
scsi: Make private functions static

Several functions should be static because they are not exported to any
other file.
Warnings were reported by sparse C=1.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Remove completely unused functions
Michal Simek [Wed, 30 Nov 2016 10:54:52 +0000 (11:54 +0100)]
scsi: Remove completely unused functions

These functions are not called for any location.
This patch removes them scsi_trim_trail(), scsi_get_disk_count()
and scsi_setup_read6().

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Simplify scsi_read/scsi_write()
Michal Simek [Fri, 18 Nov 2016 15:22:42 +0000 (16:22 +0100)]
scsi: Simplify scsi_read/scsi_write()

There is no reason to directly point to static allocated array
when we have proper block_dev pointer available via parameter
in !CONFIG_BLK. For CONFIG_BLK this is read directly from uclass
platdata.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Move pccb buffer initalization directly to scsi_detect_dev
Michal Simek [Fri, 18 Nov 2016 15:14:24 +0000 (16:14 +0100)]
scsi: Move pccb buffer initalization directly to scsi_detect_dev

pccb is pointer to temporary buffer which is used only for sending
command. Make it local as is done in scsi_read/scsi_write.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Take lun from device block description
Michal Simek [Fri, 18 Nov 2016 14:52:51 +0000 (15:52 +0100)]
scsi: Take lun from device block description

Prepare LUN(Logical unit number) directly in block description structure
and reuse it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Extract device detection algorithm
Michal Simek [Fri, 18 Nov 2016 14:42:13 +0000 (15:42 +0100)]
scsi: Extract device detection algorithm

The patch enables running detection algorithm on block device
description structure.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Extract block device initialization
Michal Simek [Fri, 18 Nov 2016 14:27:00 +0000 (15:27 +0100)]
scsi: Extract block device initialization

Extract block device initialization to specific function.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agocommon: miiphyutil: Work and report phy address in hex in mdio cmd
Michal Simek [Wed, 16 Nov 2016 07:41:01 +0000 (08:41 +0100)]
common: miiphyutil: Work and report phy address in hex in mdio cmd

It is confusing that mdio commands work and report phy id as
decimal value when mii is working with hex values.

For example:
ZynqMP> mdio list
gem:
21 - TI DP83867 <--> ethernet@ff0e0000
ZynqMP> mdio read ethernet@ff0e0000 0
Reading from bus gem
PHY at address 21:
0 - 0x1140
ZynqMP> mii dump 21 0
Incorrect PHY address. Range should be 0-31
...
ZynqMP> mii dump 15
0.     (1140)                 -- PHY control register --
  (8000:0000) 0.15    =     0    reset

U-Boot normally takes hex values that's why this patch is changing mdio
command to handle hex instead of changing mii command to handle decimal
values.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agoARM: zynq: Enable SD1 and qspi for picozed board
Siva Durga Prasad Paladugu [Fri, 7 Oct 2016 05:41:52 +0000 (11:11 +0530)]
ARM: zynq: Enable SD1 and qspi for picozed board

Enable SD1 and qspi for picozed board.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
7 years agoARM: zynq(mp): remove unneeded CONFIG_USB_MAX_CONTROLLER_COUNT defines
Masahiro Yamada [Thu, 13 Oct 2016 15:40:00 +0000 (00:40 +0900)]
ARM: zynq(mp): remove unneeded CONFIG_USB_MAX_CONTROLLER_COUNT defines

ARCH_ZYNQ(MP) selects DM_USB, where CONFIG_USB_MAX_CONTROLLER_COUNT
is not used.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Moritz Fischer <moritz.fischer@ettus.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
7 years agoARM64: zynqmp: List secondary software boot modes
Michal Simek [Wed, 26 Oct 2016 07:24:32 +0000 (09:24 +0200)]
ARM64: zynqmp: List secondary software boot modes

Using alternative bootmode field to support automatic secondary boot
modes. It is purely software setting where SW modes are using free
bootmode combinations.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
7 years agoARM64: zynqmp: Use DTS name for different psu_init_gpl* files in SPL
Michal Simek [Tue, 29 Nov 2016 11:03:51 +0000 (12:03 +0100)]
ARM64: zynqmp: Use DTS name for different psu_init_gpl* files in SPL

CONFIG_SYS_CONFIG_NAME is not proper config option for different low
level init files because different board revisions requires different
psu_init_gpl* files.

Also at the end of moving drivers to DM all board specific configuration
files should be removed.

The same changes was done for Zynq.
"ARM: zynq: Simplify zynq configuration"
(sha1: ad5b5801264e573bfbf17a20b04c546985c5bfc1)

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
7 years agoARM64: zynqmp: Force certain bootmode for SPL
Michal Simek [Tue, 30 Aug 2016 14:17:27 +0000 (16:17 +0200)]
ARM64: zynqmp: Force certain bootmode for SPL

ZynqMP provides an option to overwrite bootmode setting which
can change SPL behavior.
For example: boot SPL via JTAG and then SPL loads images from SD.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
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>