Commit Graph

3453 Commits

Author SHA1 Message Date
Przemyslaw Marczak e09b2a02d3 common: cmd regulator: command cleanup
This commit cleanups the regulator command.
The first change, is adjusting "regulator dev" command to use
"regulator-name" constraint, for setting the operating device.
Thanks to this, the regulator_get() function is removed.

This also updates do_list() function, with loop over uclass_find_*
function calls, to prevent probe of all listed regulators.

This also cleanups the printing in command.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
2015-05-14 19:58:34 -06:00
Przemyslaw Marczak 493cdec7ac common: cmd pmic: command cleanup
This commit cleanups the use of function: failed().
The new function name is: failure(), and it is used
for print errno and the errno-related message only.

The second change is choosing PMIC device by it's name,
instead of seq number. Thanks to this change, for set
the current device, call of pmic_get() is enough.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
2015-05-14 19:58:34 -06:00
Przemyslaw Marczak 6262b72b8b dm: regulator: add regulator command
This command is based on driver model regulator's API.
The user interface provides:
- list UCLASS regulator devices
- show or [set] operating regulator device
- print constraints info
- print operating status
- print/[set] voltage value [uV] (force)
- print/[set] current value [uA]
- print/[set] operating mode id
- enable the regulator output
- disable the regulator output

The 'force' option can be used for setting the value which exceeds
the constraints min/max limits.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-05-14 18:49:37 -06:00
Przemyslaw Marczak d89fdcf9cf dm: pmic: add pmic command
This is new command for the PMIC devices based on driver model PMIC API.
Command features are unchanged:
- list UCLASS pmic devices
- show or [set] operating pmic device (NEW)
- dump registers
- read byte of register at address
- write byte to register at address

The only one change for this command is 'dev' subcommand.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-05-14 18:49:37 -06:00
Simon Glass 59aa9df383 dm: i2c: Implement 'i2c bus' command for driver model
This command was missed in the conversion. Add it back for driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Heiko Schocher <hs@denx.de>
2015-05-14 18:49:33 -06:00
Vincent Palatin 08f3bb0bcd usb: add device connection/disconnection detection
Provide a function to detect USB device insertion/removal in order to
avoid having to do USB enumeration in a tight loop when trying to detect
peripheral hotplugging.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-05-14 18:49:33 -06:00
Hans de Goede 45b9ea1da2 usb: Stop reset procedure when a dev is handed over to a companion hcd
Short circuit the retry loop in legacy_hub_port_reset() by returning an
error from usb_control_msg() when a device was handed over to a companion
by the ehci code. This avoids trying to reset low / fullspeed devices 5
times needlessly. Also do not print an error when a device has been handed
over.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-05-14 18:49:31 -06:00
Hans de Goede ad84a42fc5 usb: legacy_hub_port_reset() check and propagate usb_set_port_feature() errors
Actually check for usb_set_port_feature() errors and propagate these if they
happen.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-05-14 18:49:30 -06:00
Hans de Goede 651d95c8eb usb: usb_control_msg() propagate controller error code
Propagate the error returned by submit_control_msg() rather then always
returning -EIO when the hcd code indicates an error.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-05-14 18:49:30 -06:00
Joe Hershberger 2068cea173 Use map_sysmem when accessing memory in setexpr
The setexpr command used to segfault when accessing memory in sandbox.
The pointer accesses should be mapped.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-05-14 07:03:15 -04:00
Tom Rini 9597494ebf Merge branch 'master' of git://git.denx.de/u-boot-tegra 2015-05-14 07:01:11 -04:00
Simon Glass ce49e79450 spl: Correct address in spl_relocate_stack_gd()
During the Kconfig conversion one of the changes was missed.
CONFIG_SPL_STACK_R should be CONFIG_SPL_STACK_R_ADDR since we want the
address.

Reported-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-05-14 06:57:23 -04:00
Simon Glass 00cf1167bb edid: Add a function to read detailed monitor timings
For digital displays (such as EDP LCDs) we would like to read the EDID
information and use that to set display timings. Provide a function to do
this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2015-05-13 09:24:10 -07:00
Stefan Roese 27e7215645 ppc4xx: Remove sc3 board
As this board seems to be unmaintained for quite some time, and its
not moved to the generic board ingrastructure, lets remove it.

This will also enable us to remove the CONFIG_AUTOBOOT_DELAY_STR2
and CONFIG_AUTOBOOT_STOP_STR2 macros, as this sc3 board is the
only one using one of this macros. A removal patch will follow
soon.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Juergen Beisert <jbeisert@eurodsn.de>
Acked-by: Heiko Schocher <hs@denx.de>
2015-05-10 09:59:38 -04:00
Joe Hershberger a69bdba9c6 Fix broken verify functionality in crc32 command
Introduced in change d20a40de9d
"Roll crc32 into hash infrastructure"

The crc32 command with no -v expects an optional 3rd argument to be an
address to store the result in. With the -v switch, the last argument
is a crc, not an address. In the case where -v is set, we should set the
HASH_FLAG_ENV flag since that will first look for the value to be a
digest value, which matches the expected API for the crc32 command.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-05-10 09:59:37 -04:00
Joe Hershberger 849337bb22 Fix inconsistency of VERIFY defines in cmd_mem
Introduced in change d20a40de9d
"Roll crc32 into hash infrastructure"

Use a consistent define to enable the verify feature in crc32 command.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-05-10 09:59:37 -04:00
maxin.john@enea.com 8ca584ecfb cmd_part: fix usage text
Fix the usage info from:
part part uuid <interface> <dev>:<part>
to
part uuid <interface> <dev>:<part>

Signed-off-by: Maxin B. John <maxin.john@enea.com>
Reviewed-By: Sjoerd Simons <sjoerd.simons@collabora.co.uk
2015-05-10 07:29:38 -04:00
Paul Kocialkowski ecb301394b spl: spl_mmc: Partition raw boot mode for eMMC
This adds support for providing a partition number instead of a sector for eMMC.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-05-10 07:29:37 -04:00
Paul Kocialkowski 91199f4a5a spl: spl_mmc: Clearer structure in spl_mmc_load_image and cosmetics
This refactors spl_mmc_load_image to use a switch/case structure and easier
to understand spl_start_uboot checks. This also introduces some more automatic
fallback on the next mmc boot mode as long as it keeps failing.

Lines that go beyond 80 chars are also reduced by reducing the number of tabs.
Debug and error strings are refctored to match a common style.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
[trini: Fix a thinko in the SPL_EXT_SUPPORT + SPL_OS conversion, make part be
 __maybe_unused]
Signed-off-by: Tom Rini <trini@konsulko.com>
2015-05-10 07:27:19 -04:00
Maxime Ripard 87f02d5aee image: android: handle default kernel address
The two tools that create android boot images, mkbootimg and the fastboot
client, set the kernel address by default to 0x10008000.

U-boot always honors this field, and will try to relocate the kernel to
whatever value is set in the header, which won't be mapped to the actual RAM on
most platforms, resulting in the kernel obviously not booting.

All the targets in U-Boot right now will download the android boot image to
CONFIG_SYS_LOAD_ADDR, which means that it will already have been downloaded to
some location that is suitable for execution.

In order to have the kernel booting even with the default boot image kernel
address, if that address is used, just execute the kernel where it is.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-05-08 17:24:17 -04:00
Hans de Goede 2b338ef411 usb: Fix maxpacketsize for first descriptor read for low-speed usb devs
This fixes descriptor reading of lowspeed devices through ohci not working.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Marek Vasut <marex@denx.de>
2015-05-06 08:46:56 -06:00
Simon Glass f9951eadb6 dm: rtc: Convert 'date' command to support driver model
Adjust this command so that it supports using driver model for I2C, i.e.
CONFIG_DM_I2C. This will permit it to be used in sandbox also.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-05-05 20:58:40 -06:00
Simon Glass 9f9276c34c dm: rtc: Rename to_tm() to rtc_to_tm() and add error code
Rename this function so that it is clear that it is provided by the RTC.
Also return an error when it cannot function as expected. This is unlikely
to occur since it works for dates since 1752 and many RTCs do not support
such old dates. Still it is better to be accurate.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
2015-05-05 20:58:20 -06:00
Simon Glass 199e87c340 dm: rtc: Rename gregorian day function
Change this function name to something more descriptive. Also return a
failure code if it cannot calculate a correct value.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
2015-05-05 20:58:20 -06:00
Simon Glass c3ec646dde fdt: Correct warning in fdt_setup_simplefb_node()
Adjust the printf() string to avoid a warning on sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-05-05 20:58:19 -06:00
Simon Glass bcb0c61e1a x86: Allow CPUs to be set up after relocation
This permits init of additional CPU cores after relocation and when driver
model is ready.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-04-30 16:13:48 -06:00
Simon Glass 8e2fac051a Add a 'cpu' command to print CPU information
Add a simple command which provides access to a list of available CPUs along
with descriptions and basic information.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-04-29 21:02:33 -06:00
Simon Glass 4c509343ab Fix comment nits in board_f.c
Try to make it a little clearer.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-04-29 21:02:32 -06:00
Tom Rini e536ab8849 Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2015-04-28 12:15:13 -04:00
Tom Rini cc555bd4f4 Merge branch 'master' of git://git.denx.de/u-boot-spi 2015-04-28 07:28:43 -04:00
Tom Rini 3f6dcdb9cd Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq 2015-04-24 13:43:24 -04:00
Scott Wood b2d5ac5985 armv8/ls2085aqds: NAND boot support
This adds NAND boot support for LS2085AQDS, using SPL framework.
Details of forming NAND image can be found in README.

Signed-off-by: Scott Wood <scottwood@freescale.com>
[York Sun: Remove +S from defconfig after commit 252ed872]
Signed-off-by: York Sun <yorksun@freescale.com>
2015-04-23 16:46:50 -07:00
Tom Rini 5f757cdcc6 Merge branch 'master' of git://git.denx.de/u-boot-dm 2015-04-23 14:56:10 -04:00
Heiko Schocher 5db73feb1d cmd, nand: add more info to "nand info"
add subpagesize, nand options and bbt options to the
"nand info" output.

=> nand info

Device 0: nand0, sector size 256 KiB
  Page size       4096 b
  OOB size         256 b
  Erase size    262144 b
  subpagesize     4096 b
  options     0x     200
  bbt options 0x    8000

Signed-off-by: Heiko Schocher <hs@denx.de>
2015-04-23 14:56:08 -04:00
Marek Vasut 1a1fa24066 rtc: Set valid date after reset
Some RTC chips tend to set garbage date after reset.
This patch sets the date to 2000-01-01 00:00 immediatelly
after the RTC chip reset is issued using the "date reset"
command.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@konsulko.com>
2015-04-23 14:56:08 -04:00
York Sun 12eaf31c07 armv8/fsl-lsch3: Update early MMU table
During booting, IFC is mapped to low region. After booting up, IFC is
remapped to high region for larger space. The environmental variables are
also stored at high region. In order to read the variables during booting,
a virtual mapping is required.

Cache was enabled for entire IFC space before. Actually the first two
entries are big enough (4MB) to cover the boot code and environmental
variables. Remove extra entries. Move OCRAM entry out of ifdef.

Signed-off-by: York Sun <yorksun@freescale.com>
2015-04-23 08:55:56 -07:00
Scott Wood 581508bdfb cmd_mem: Store last address/size/etc as ulong
Otherwise the high 32 bits get truncated on 64-bit U-boot.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <yorksun@freescale.com>
2015-04-23 08:55:54 -07:00
Simon Glass f3d46bd658 dm: Init device tree as well as driver model in SPL
If enabled, make sure that the device tree is available in SPL before
setting up driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-23 09:05:55 -06:00
Simon Glass 293f16b1e7 Correct malloc_limit value for pre-relocation malloc()
The limit is measured from the start of the malloc() area and is not an
absolute address. Correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-23 09:05:53 -06:00
Simon Glass fb5cf7f16b Move initf_malloc() to a common place
To allow this function to be used from SPL, move it to the malloc()
code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-23 09:05:53 -06:00
Simon Glass 0879361fd3 fdt: Rename setup_fdt() and make it prepare also
There is little reason to split these two functions. Bring them together
which simplifies the init sequence.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-23 09:05:53 -06:00
Simon Glass b45122fdf5 fdt: sandbox: Move setup code from board_f to fdtdec
We want to be able to set up the device tree in SPL, so move this code
to a common place.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-23 09:05:53 -06:00
Stefan Roese a8eeaf2f7a cmd_led: Extend led command to support blinking and more leds
This patch extends the U-Boot "led" command to support automatic blinking
by setting a blink frequency in milliseconds. Additionally the number of
supported LEDs is increased to 6 (0...5).

This will be used by the PCA9551 LED driver.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-04-23 09:43:08 -04:00
tang yuantian 1a1cf6ee47 cmd_scsi: Enable SoC AHCI device on platforms with PCI
Current driver assumes the AHCI is connected to PCI, this is not
true on some SoCs, e.g. LS1021A, which has PCI but the AHCI is
in SoC. This patch will enable embedded AHCI devices on platforms
with PCI.
PCI AHCI devices still can be used by commenting CONFIG_SCSI_AHCI_PLAT
option in head file.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-04-22 12:14:56 -04:00
Eric Nelson 5d27223ea5 unzip: add gzwrite command to write compressed image to block device
Add gzwrite command to write gzip-compressed images to block devices.

Input must be gzip-compressed according to RFC1952, since the crc
and file size in the trailer will be confirmed during operation.
The decompressed file size must be specified on the command line
for images with decompressed sizes >= 4GiB because the trailer
only contains the low 32 bits of the original file size.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
2015-04-22 12:14:55 -04:00
Tim Harvey 08daa258e6 fdt: add new fdt_fixup_display function to configure display
Add 'fdt_fixup_display' function to fixup device-tree native-mode property
of display-timings node to select timings for a specific display.
This is useful if a device-tree has configurations for multiple
display timings for undetectable displays.

see kernel Documentation/devicetree/bindings/video/display-timing.txt

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-22 14:39:06 +02:00
Stefan Roese ed62756dcf cmd_sf: Fix problem with "sf update" and unaligned length
On SoCFPGA, using "sf update" with an non-4byte aligned length leads
to a hangup (and reboot via watchdog). This is because of the unaligned
access in the cadence QSPI driver which is hard to prevent since the
data is written into a 4-byte wide FIFO. This patch fixes this problem
by changing the behavior of the last sector write (not sector aligned).

The new code is even simpler and copies the source data into the temp
buffer and now uses the temp buffer to write the complete sector. So
only one SPI sector write is used now instead of 2 in the old version.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Gerlando Falauto <gerlando.falauto@keymile.com>
Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Cc: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2015-04-22 16:49:51 +05:30
Andrey Skvortsov a436d61279 kconfig: remove duplicated CMD_DNS option
two CMD_DNS options were added by commit 60296a835c ("commands: add more
command entries in Kconfig")

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-04-21 10:03:54 -04:00
Tim James a095f047eb mii: add read-modify-write option to mii command
When accessing PHY registers it is often desirable to only update
selected bits, so it is necessary to first read the current value
before writing back an modified value with the relevant bits
updated.

To simplify this and to allow such operations to be incorporated
into simple shell scripts propose adding a 'modify' option to the
existing mii command, which takes a mask indicating the bits to
be updated in addition to a data value containing the new bits,
ie, <updated> = (<data> & <mask>) | (<current> & ~<mask>).

Signed-off-by: Tim <tim.james@macltd.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
Cc: Tom Rini <trini@konsulko.com>
Cc: Tim <tim.james@macltd.com>
2015-04-20 17:57:12 -05:00
Tom Rini 1733259d25 Merge branch 'master' of git://git.denx.de/u-boot-video 2015-04-20 09:13:52 -04:00