Commit Graph

254 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 64b07727fb sysmobts-v2: Allow to remove the WP of the NAND flash
Starting from revision F we need to set nWP before writing to
flash. Create a new NAND command that can be used for that and
use it for fwup, booting and recovery mode. We assume that the
payload runs a RW filesystem so we set the GPIO before booting
the system.

sysmobts: ubifsmount might already write to the nand...

Remove the write protect a lot earlier as ubifsmount might already
try to grow the freshly flashed UBIFS and allocate UBIs for it.

sysmobts: Add a huge sleep to wait for the pin to be driven

Add some margin and wait for the pin to get high and such. I
can't easily measure if we sleep at all or if it is really 100ms
but it can't hurt and we don't optimize for boot times yet.

sysmobts: Toggle nWP on RevG and later as well

sysmobts-v2: ubi part appears to write as well

The ubi part command will write for the same reason. Move the
command line to the front.

(untested)
2017-03-28 15:59:47 +02:00
Holger Hans Peter Freyther 7fa3734927 sysmobts_v2: Add RevisionD for the sysmoBTSv2 hardware
The only ARM/kernel visible change is the change of the EEPROM. U-Boot
sadly does not support to select EEPROM with different page sizes and
address length. This is why we need to patch the common epprom code.

Introduce a new command to allow dynamic configuration of the EEPROM,
move the eeprom parameters into variables and change the code. This sadly
copies the SPI_X code as well. The address creation could be moved to
a different variable.

This code has been tested on RevC and RevD hardware and an IP address
could be obtained in both cases.

Re-worked for eeprom.c changes and only patched the address code
2017-03-28 15:41:46 +02:00
Vincent Tinelli 9da52f8f67 gpt: Fix uuid string format
Change GPT UUID string format from UUID to GUID per specification.

Signed-off-by: Vincent Tinelli <vincent.tinelli@intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-03-17 14:15:10 -04:00
Sebastien Colleur 2c79fd4019 cmd: itest: correct calculus for long format
itest shell command doesn't work correctly in long format when
doing comparaison due to wrong mask value calculus that overflow
on 32 bits values.

Signed-off-by: Sebastien Colleur <sebastienx.colleur@intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-03-17 14:15:10 -04:00
Andre Przywara bea79d7d3f Kconfig: introduce md5sum command selection
So far CONFIG_MD5SUM would need to be set by a board's include file.
Since the command is really generic, move it over to Kconfig to allow
it to be defined by either a board's defconfig, menuconfig or some
config snippet merged via mergeconfig.sh.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-03-17 09:09:39 -04:00
Tom Rini ce38ebb6f7 Merge git://git.denx.de/u-boot-fsl-qoriq 2017-03-16 16:43:32 -04:00
Masahiro Yamada 2808576491 arm64: booti: allow to place kernel image anywhere in physical memory
At first, the ARM64 Linux booting requirement recommended that the
kernel image be placed text_offset bytes from 2MB aligned base near
the start of usable system RAM because memory below that base address
was unusable at that time.

This requirement was relaxed by Linux commit a7f8de168ace ("arm64:
allow kernel Image to be loaded anywhere in physical memory").
Since then, the bit 3 of the flags field indicates the tolerance
of the kernel physical placement.  If this bit is set, the 2MB
aligned base may be anywhere in physical memory.  For details, see
Documentation/arm64/booting.txt of Linux.

The booti command should be also relaxed.  If the bit 3 is set,
images->ep is respected, and the image is placed at the nearest
bootable location.  Otherwise, it is relocated to the start of the
system RAM to keep the original behavior.

Another wrinkle we need to take care of is the unknown endianness of
text_offset for a kernel older than commit a2c1d73b94ed (i.e. v3.16).
We can detect this based on the image_size field.  If the field is
zero, just use a fixed offset 0x80000.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-03-14 20:40:23 -04:00
York Sun f2ccf7f7aa armv8: Add global variable resv_ram
Use gd->arch.resv_ram to track reserved memory allocation.

Signed-off-by: York Sun <york.sun@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-03-14 08:44:03 -07:00
Masahiro Yamada e856bdcfb4 flash: complete CONFIG_SYS_NO_FLASH move with renaming
We repeated partial moves for CONFIG_SYS_NO_FLASH, but this is
not completed. Finish this work by the tool.

During this move, let's rename it to CONFIG_MTD_NOR_FLASH.
Actually, we have more instances of "#ifndef CONFIG_SYS_NO_FLASH"
than those of "#ifdef CONFIG_SYS_NO_FLASH".  Flipping the logic will
make the code more readable.  Besides, negative meaning symbols do
not fit in obj-$(CONFIG_...) style Makefiles.

This commit was created as follows:

[1] Edit "default n" to "default y" in the config entry in
    common/Kconfig.

[2] Run "tools/moveconfig.py -y -r HEAD SYS_NO_FLASH"

[3] Rename the instances in defconfigs by the following:
  find . -path './configs/*_defconfig' | xargs sed -i \
  -e '/CONFIG_SYS_NO_FLASH=y/d' \
  -e 's/# CONFIG_SYS_NO_FLASH is not set/CONFIG_MTD_NOR_FLASH=y/'

[4] Change the conditionals by the following:
  find . -name '*.[ch]' | xargs sed -i \
  -e 's/ifndef CONFIG_SYS_NO_FLASH/ifdef CONFIG_MTD_NOR_FLASH/' \
  -e 's/ifdef CONFIG_SYS_NO_FLASH/ifndef CONFIG_MTD_NOR_FLASH/' \
  -e 's/!defined(CONFIG_SYS_NO_FLASH)/defined(CONFIG_MTD_NOR_FLASH)/' \
  -e 's/defined(CONFIG_SYS_NO_FLASH)/!defined(CONFIG_MTD_NOR_FLASH)/'

[5] Modify the following manually
  - Rename the rest of instances
  - Remove the description from README
  - Create the new Kconfig entry in drivers/mtd/Kconfig
  - Remove the old Kconfig entry from common/Kconfig
  - Remove the garbage comments from include/configs/*.h

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-02-12 14:30:25 -05:00
Masahiro Yamada e9d33e7326 cmd: move CONFIG_CMD_UNZIP and CONFIG_CMD_ZIP to Kconfig
CONFIG_CMD_ZIP is not defined by any board.  I am moving
CONFIG_CMD_UNZIP to defconfig files except UniPhier SoC family.

I am the maintainer of UniPhier platform, so I know "select CMD_UNZIP"
is better for this platform.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Ryan Harkin <ryan.harkin@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
2017-02-08 16:24:28 -05:00
Grygorii Strashko dbe7881de0 cmd: bootm: fix build when CONFIG_CMD_IMLS_NAND
Now when CONFIG_CMD_IMLS_NAND is enabled the u-boot build will fail,
because nand_read_skip_bad() function has been changed to accept more
parameters, hence fix it.

 CC      cmd/bootm.o
cmd/bootm.c: In function 'nand_imls_legacyimage':
cmd/bootm.c:390:8: error: too few arguments to function 'nand_read_skip_bad'
  ret = nand_read_skip_bad(mtd, off, &len, imgdata);
        ^
In file included from cmd/bootm.c:18:0:
include/nand.h:101:5: note: declared here
 int nand_read_skip_bad(struct mtd_info *mtd, loff_t offset, size_t *length,
     ^
 LD      drivers/block/built-in.o

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-02-08 15:56:32 -05:00
Masahiro Yamada d726f225f5 cmd: rework "license" command
The previous commit ("add a new command to show .config contents")
improves the basic infrastructure of "embed a compressed file into
the U-Boot image, and print it by a command".  The same pattern for
the "license" command.

This commit reworks the command to improve the following:

[1] Improve log style

Kbuild style log

  GZIP    cmd/license_data.gz
  CHK     cmd/license_data_gz.h
  UPD     cmd/license_data_gz.h
  CHK     cmd/license_data_size.h
  UPD     cmd/license_data_size.h

instead of the bare Make log:

cat ./Licenses/gpl-2.0.txt | gzip -9 -c | \
		tools/bin2header license_gzip > ./include/license.h

[2] Collect related code into the "cmd" directory

Prior to this commit, the license.h was created by tools/Makefile,
placed under the "include" directory, included from cmd/license.c,
and deleted by the top-level Makefile.  It is not a good idea to
scatter related code.

[3] Drop the fixed-malloc size LICENSE_MAX

Just allocate the minimum required size of buffer because we know
the size of the original gpl-2.0.txt.

[4] Fix more issues

Terminate the buffer with zero to prevent puts() from over-running.
Add "static" to do_license.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-02-08 15:56:28 -05:00
Masahiro Yamada 61304dbec3 cmd: add a new command "config" to show .config contents
This feature is inspired by /proc/config.gz of Linux.  In Linux,
if CONFIG_IKCONFIG is enabled, the ".config" file contents are
embedded in the kernel image.  If CONFIG_IKCONFIG_PROC is also
enabled, the ".config" contents are exposed to /proc/config.gz.
Users can do "zcat /proc/config.gz" to check which config options
are enabled on the running kernel image.

The idea is almost the same here; if CONFIG_CMD_CONFIG is enabled,
the ".config" contents are compressed and saved in the U-Boot image,
then printed by the new command "config".

The usage is quite simple.  Enable CONFIG_CMD_CONFIG, then run
 > config
from the command line interface.  The ".config" contents will be
printed on the console.

This feature increases the U-Boot image size by about 4KB (this is
mostly due to the gzip-compressed .config file).  By default, it is
enabled only for Sandbox because we do not care about the memory
footprint on it.  Of course, this feature is architecture agnostic,
so you can enable it on any board if the image size increase is
acceptable for you.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-02-08 15:56:26 -05:00
Mario Six 7690be35de lib: tpm: Add command to flush resources
This patch adds a function to the TPM library, which allows U-Boot to
flush resources, e.g. keys, from the TPM.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Stefan Roese <sr@denx.de>
2017-02-01 09:02:57 +01:00
Scott Wood 0fff19a678 booti: Set images.os.arch
Commit ec6617c397 ("armv8: Support loading 32-bit OS in AArch32
execution state") broke SMP boot by assuming that an image is 32-bit if
the arch field in the spin table != IH_ARCH_DEFAULT (i.e.
IH_ARCH_ARM64), even if the arch field also does not match IH_ARCH_ARM,
even though nothing actually set the arch field in the spin table.

Commit e2c18e40b1 ("armv8: fsl-layerscape: SMP support for loading
32-bit OS") fixed this for bootm by setting the arch field of the spin
table based on images.os.arch, but booti remaineed broken because it did
not set images.os.arch.

Fixes: ec6617c397 ("armv8: Support loading 32-bit OS in AArch32 execution state")
Fixes: e2c18e40b1 ("armv8: fsl-layerscape: SMP support for loading 32-bit OS")
Cc: Alison Wang <alison.wang@nxp.com>
Cc: Chenhui Zhao <chenhui.zhao@nxp.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Scott Wood <oss@buserror.net>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-01-28 14:04:51 -05:00
Patrick Delaunay b331cd6204 cmd, disk: convert CONFIG_PARTITION_UUIDS, CMD_PART and CMD_GPT
We convert CONFIG_PARTITION_UUIDS to Kconfig first.  But in order to cleanly
update all of the config files we must also update CMD_PART and CMD_GPT to also
be in Kconfig in order to avoid complex logic elsewhere to update all of the
config files.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-01-28 08:48:03 -05:00
Patrick Delaunay bd42a94268 disk: convert CONFIG_EFI_PARTITION to Kconfig
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
2017-01-28 08:47:42 -05:00
Patrick Delaunay 1acc008787 disk: convert CONFIG_ISO_PARTITION to Kconfig
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
2017-01-28 08:47:35 -05:00
Patrick Delaunay b0cf733933 disk: convert CONFIG_DOS_PARTITION to Kconfig
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
2017-01-28 08:47:34 -05:00
Tom Rini cf4128e53c Merge git://www.denx.de/git/u-boot-marvell 2017-01-26 12:26:24 -05:00
Ladislav Michl f59f07ece5 cmd: ubi: allow '-' to specify maximum volume size
Currently maximum volume size can be specified only if no other
arguments are used. Use '-' placeholder as volume size to allow
maximum volume size to be specified together with volume id and
type.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2017-01-26 07:00:25 +01:00
Konstantin Porotchkin e559ef1ae8 arm64: mvebu: Update bubt command MMC block device access
Update the MMC block device access code in bubt command
implementation according to the latest MMC driver changes.

Change-Id: Ie852ceefa0b040ffe1362bdb7815fcea9b2d923b
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Neta Zur Hershkovits <neta@marvell.com>
Cc: Omri Itach <omrii@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
2017-01-25 07:04:22 +01:00
Cédric Schieli 4943dc2f19 bootz/booti: relocate ramdisk if CONFIG_SYS_BOOT_RAMDISK_HIGH set
In commit c2e7e72, the ramdisk relocation code was moved from
image_setup_linux to do_bootm, leaving the bootz and booti cases broken.

This patch fixes both by adding the BOOTM_STATE_RAMDISK state in their
call to do_bootm_states if CONFIG_SYS_BOOT_RAMDISK_HIGH is set.

Signed-off-by: Cédric Schieli <cschieli@gmail.com>
Reviewed-by: Rick Altherr <raltherr@google.com>
Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-01-24 10:35:55 -05:00
Uri Mashiach 2d8d190c83 status_led: Kconfig migration
Move all of the status LED feature to drivers/led/Kconfig.
The LED status definitions were moved from the board configuration
files to the defconfig files.

TBD: Move all of the definitions in the include/status_led.h to the
relevant board's defconfig files.

Tested boards: CL-SOM-AM57x, CM-T335

Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
2017-01-21 15:12:33 -05:00
Emmanuel Vadot 995eab8b5b bootm: qnx: Disable data cache before booting QNX image
Instead of disabling the data cache in the bootelf command, disabling
it in the do_bootm_qnxelf function.
Some ELF binary might want the cache enabled.

Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
2017-01-20 15:38:05 -05:00
Sébastien Szymanski 6baa692f90 cmd/host: add missing \n in help text
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
2017-01-20 09:15:24 -05:00
Rick Altherr c2e7e72bb9 bootm: relocate ramdisk if CONFIG_SYS_BOOT_RAMDISK_HIGH set
In 35fc84f, bootm was refactored so plain 'bootm' and
'bootm <subcommand>' shared a common implementation.
The 'bootm ramdisk' command implementation is now part of the common
implementation but not invoke by plain 'bootm' since the original
implementation never did ramdisk relocation.  Instead, ramdisk
relocation happened in image_setup_linux() which is typically called
during the OS portion of 'bootm'.

On ARM, parameters to the Linux kernel can either be passed by FDT or
ATAGS. When using FDT, image_setup_linux() is called which also triggers
ramdisk relocation.  When using ATAGS, image_setup_linux() is _not_
called because it mostly does FDT setup.

Instead of calling image_setup_linux() in both FDT and ATAGS cases,
include BOOTM_STATE_RAMDISK in the requested states during a plain
'bootm' if CONFIG_SYS_BOOT_RAMDISK_HIGH is set and remove the ramdisk
relocation from image_setup_linux().  This causes ramdisk relocation to
happen on any system where CONFIG_SYS_BOOT_RAMDISK_HIGH regardless of
the OS being booted. Also remove IMAGE_ENABLE_RAMDISK_HIGH as it was
only used by the now-removed code from image_setup_linux().

Signed-off-by: Rick Altherr <raltherr@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
2017-01-20 09:15:20 -05:00
Tom Rini 0675f992db Merge git://git.denx.de/u-boot-fsl-qoriq 2017-01-19 12:22:23 -05:00
Alison Wang 7c5e1feb1d armv8: aarch64: Fix the warning about x1-x3 nonzero issue
For 64-bit kernel, there is a warning about x1-x3 nonzero in violation
of boot protocol. To fix this issue, input argument 4 is added for
armv8_switch_to_el2 and armv8_switch_to_el1. The input argument 4 will
be set to the right value, such as zero.

Signed-off-by: Alison Wang <alison.wang@nxp.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Tested-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-01-18 09:29:33 -08:00
Michal Simek b984700ca4 usb: storage: Show number of storage devices detected for DM_USB
By enabling DM_USB information about number of storage devices
was lost.
Get this information back simply by printing number of devices detected
via BLK uclass.

For example:
scanning bus 0 for devices... 7 USB Device(s) found
       scanning usb for storage devices... 3 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2017-01-17 10:26:21 +01:00
Gary Bisson 8547f45bc5 cmd: sata: fix init command return value
Since commit aa6ab905b2, sata_initialize returns -1 if init_sata or
scan_sata fails. But this return value becomes the do_sata return
value which is equivalent to CMD_RET_USAGE.

In case one issues 'sata init' and that the hardware fails to
initialize, there's no need to display the command usage. Instead
the command shoud just return the CMD_RET_FAILURE value.

Fixes: aa6ab905b2 (sata: fix sata command can not being executed bug)

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Reviewed-by: Eric Nelson <eric@nelint.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-14 16:46:23 -05:00
Andreas Färber b05bf6c75d cmd/fdt: Make fdt get value endian-safe for single-cell properties
On a Raspberry Pi 2 disagreements on cell endianness can be observed:

  U-Boot> fdt print /soc/gpio@7e200000 phandle
  phandle = <0x0000000d>
  U-Boot> fdt get value myvar /soc/gpio@7e200000 phandle; printenv myvar
  myvar=0x0D000000

Fix this by always treating the pointer as BE and converting it in
fdt_value_setenv(), like its counterpart fdt_parse_prop() already does.

Consistently use fdt32_t, fdt32_to_cpu() and cpu_to_fdt32().

Fixes: bc80295 ("fdt: Add get commands to fdt")
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Gerald Van Baren <gvb@unssw.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Simon Glass <sjg@chromium.org>
2017-01-14 10:09:46 -07:00
Stefan Agner 082b1414e8 cmd: fdt: Print error message when fdt application fails
There are lots of reason why a FDT application might fail, the
error code might give an indication. Let the error code translate
in a error string so users can try to understand what went wrong.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-01-13 18:19:45 -07:00
Fabio Estevam c2538421b2 cmd: mem: Use memcpy for 'cp' command
Simplify the 'cp' command implementation by using the memcpy() function,
which brings the additional benefit of performance gain for those who have
CONFIG_USE_ARCH_MEMCPY selected.

Tested on a mx6qsabreauto board where a 5x gain in performance is seen
when reading 10MB from the parallel NOR memory.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
2017-01-12 13:16:26 -05:00
Michal Simek 5cf22289ae fpga: Use enum for bitstream command types
Using enum simplify handling of different bitstream command
types.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2017-01-10 10:21:59 +01:00
Baruch Siach ff78ad284a cmd: net: fix function name in comment
In commit 7044c6bb6 (net: cosmetic: Clean up DHCP variables and functions)
BootpCopyNetParams() was renamed to store_net_params(). Update the reference in
comment.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2016-12-27 11:24:18 -05:00
Fabio Estevam c99d1b3ccf cmd/Kconfig: Fix typo in CMD_MEMORY help text
Fix "Memory" and "initialize" typos in the CMD_MEMORY help text.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-12-27 11:24:13 -05:00
Tom Rini b591730c35 Merge git://www.denx.de/git/u-boot-marvell 2016-12-12 07:19:28 -05:00
Konstantin Porotchkin fa61ef6b49 arm64: mvebu: Add bubt command for flash image burn
Add support for mvebu bubt command for flash image
load, check and burn on boot device.

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Neta Zur Hershkovits <neta@marvell.com>
Cc: Omri Itach <omrii@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2016-12-12 09:04:52 +01:00
Yehuda Yitschak e5f96a872b cmd: pci: add option to parse and display BAR information
Currently the PCI command only allows to see the BAR register
values but not the size and actual base address.
This little extension parses the BAR registers and displays
the base, size and type of each BAR.

Signed-off-by: Yehuda Yitschak <yehuday@marvell.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-12-09 08:40:18 -05:00
Tom Rini 73eed452b9 Merge branch 'master' of git://www.denx.de/git/u-boot-dm 2016-12-03 19:43:51 -05:00
Yann E. MORIN bfb380b30a cmd: move CMD_PXE to Kconfig
Currently, CMD_PXE is forcibly enabled in config_distro_defaults.h, so
that general purpose distributions can rely on it being defined. This
header is included, under conditions or not, by various archs or
famillies of archs / SoCs.

However, it is very possible that boards based on those SoCs will not
have a physical ethernet connector at all, even if the have a MAC; for
example, the Nanopi Neo AIR (sunxi H3) does not. It is also possible
that network booting is absolutely not necessary for a device.

However, it is not possible to disable the PXE command, as it is
forcibly enabled and is non-configurable.

But it turns out we already have a config option to build a distro-ready
image, in the name of DISTRO_DEFAULTS.

Move CMD_PXE out of the hard-coded config_distro_defaults.h into a
Kconfig option, that gets selected by DISTRO_DEFAULTS when it is set.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Joe Hershberger <joe.hershberger@ni.com>
[trini: Make it select MENU, run moveconfig.py]
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-12-03 13:21:24 -05:00
Tom Rini 4880b026ec cmd: Convert CMD_BOOTMENU
Also convert MENU while we're in here.

Signed-off-by: Tom Rini <trini@konsulko.com>
2016-12-03 13:21:23 -05:00
Moritz Fischer a2558e8729 cmd: crosec: Move cros_ec_decode_region helper to cmd/cros_ec.c
The cros_ec_decode_region() function is only used in combination
with the crosec cmds. Move the function to the correct place.

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: u-boot@lists.denx.de
Acked-by: Simon Glass <sjg@chromium.org>
2016-12-02 21:04:48 -07:00
Fabien Parent f7f191ee41 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>
2016-12-02 20:53:20 -07:00
Stefan Brüns 0427b9c525 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>
2016-12-02 10:37:47 -07:00
Michal Simek 861fe6503e 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>
2016-12-02 14:37:32 +01:00
Michal Simek c002e39ae6 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>
2016-12-02 14:37:26 +01:00
Michal Simek 15a2acdf85 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>
2016-12-02 14:36:02 +01:00
Tomas Melin cd3d48807d 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>
2016-12-01 11:09:44 +09:00