Jerome Brunet [Tue, 12 Dec 2017 15:03:55 +0000 (16:03 +0100)]
net: phy: meson-gxl: detect LPA corruption
This patch is ported from the Linux patch posted at [1] and applied to
net tree as commit f1e2400a80ff.
The purpose of this change is to fix the incorrect detection of the link
partner (LP) advertised capabilities which sometimes happens with this PHY
(roughly 1 time in a dozen)
This issue may cause the link to be negotiated at 10Mbps/Full or
10Mbps/Half when 100MBps/Full is actually possible. In some case, the link
is even completely broken and no communication is possible.
To detect the corruption, we must look for a magic undocumented bit in the
WOL bank (hint given by the SoC vendor kernel) but this is not enough to
cover all cases. We also have to look at the LPA ack. If the LP supports
Aneg but did not ack our base code when aneg is completed, we assume
something went wrong.
The detection of a corrupted LPA triggers a restart of the aneg process.
This solves the problem but may take up to 6 retries to complete.
Tom Rini [Mon, 18 Dec 2017 17:23:27 +0000 (12:23 -0500)]
Merge tag 'xilinx-for-v2018.01-rc2-v2' of git://www.denx.de/git/u-boot-microblaze
Xilinx changes for v2018.01-rc2-v2
fpga:
- Enable loading bitstream via fit image for !xilinx platforms
zynq:
- Fix SPL SD boot mode
zynqmp:
- Not not reset in panic
- Do not use simple allocator because of fat changes
- Various dt chagnes
- modeboot variable setup
- Fix fpga loading on automotive devices
- Fix coverity issues
test:
- Fix env test for !hush case - Stephen's patch
York Sun [Mon, 11 Dec 2017 16:39:05 +0000 (08:39 -0800)]
armv8: ls1046aqds: Adjust IFC timing for NOR flash
Increase setup, assertion and hold time related to chip-select signal.
Additional delay is needed for the signal to propogate through FPGA.
This adjustment slightly increase the read and write cycle but has no
impact on burst read or write.
arm64: zynqmp: Access timestamp_ref_ctrl register only if running in el3
Access the timestamp ref ctrl register only if runinng
at el3 level otherwise just return. This change fixes
the issue when CRL APB is marked as secure and accessing
when not in el3 causes exception.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arm64: zynqmp: Dont use 4K sector erase by default for spi-flashes
Dont use 4K sector erase by default, Disabling this
would use 64K sector erase and decreases erase time.
Also disabled by the fact that UBIFS and JFFS2 won't work
with 4K sector erase.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Tom Rini [Sun, 17 Dec 2017 20:37:29 +0000 (15:37 -0500)]
Merge tag 'signed-efi-v2018.01' of git://github.com/agraf/u-boot
Patch queue for efi - 2017-12-17
A few fixes for 2018.01:
- Compile fix with helloworld example
- DP match fix (fixes FreeBSD loader and grub on block storage)
- More DP fixes for SD, block
- Fix use-after-free
If a failure occurs when trying to load an image, it is insufficient
to free() the EFI object. We must remove it from the object list,
too. Otherwise a use after free will occur the next time we
iterate over the object list.
Furthermore errors in setting up the image should be handled.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
When calling efi_dp_find_obj(), we usually want to find the *exact* match
of an object for a given device path. However, I ran into a nasty corner case
where I had the following objects with paths available:
because that path is a full substring of the path we were searching for.
So this patch adapts the device path search logic to always look for exact
matches first. The way we distinguish between those cases is by looking at
whether our caller actually deals with remainders.
As a side effect, the code as is from all I can tell now never does a
substring match anymore, because it always gets called with rem=NULL, so
we always only do exact matches now.
Reported-by: Jonathan Gray <jsg@jsg.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Mon, 11 Dec 2017 08:40:47 +0000 (09:40 +0100)]
efi_loader: helloworld.c: Explicitly use .rodata for loaded_image_guid
Commit bbf75dd9345d0b ("efi_loader: output load options in helloworld")
introduced a const variable in efi_main() called loaded_image_guid which
got populated from a constant struct.
While you would usually expect a compiler to realize that this variable
should really just be a global pointer to .rodata, gcc disagrees and instead
puts it on the stack. Unfortunately in some implementations of gcc it does
so my calling memcpy() which we do not implement in our hello world
environment.
So let's explicitly move it to a global variable which in turn puts it in
.rodata reliably and gets rid of the memcpy().
Fixes: bbf75dd9345d0b ("efi_loader: output load options in helloworld") Reported-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Yangbo Lu [Fri, 8 Dec 2017 07:35:37 +0000 (15:35 +0800)]
armv8: ls1012ardb: support hwconfig for eSDHC1 enabling
I2C reading for DIP switch setting is not reliable for LS1012ARDB
RevD and later versions. This patch is to add hwconfig support to
enable/disable eSDHC1 manually for these boards. Also drop 'status'
fix-up for eSDHC0 and leave it as it is. It shouldn't always be
fixed up with 'okay'.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
Yogesh Gaur [Thu, 7 Dec 2017 05:40:14 +0000 (11:10 +0530)]
board/ls2080a, ls1088a: Add check for mc-dpl applied in fdt
Function fdt_fixup_board_enet() performs fdt fixup. Only return
fdt_status_okay() when both MC is applied and DPL is deployed, else
return fdt_status_fail().
This check is added to LS1088A/LS2080A/LS2088A boards.
Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
Michal Simek [Wed, 6 Dec 2017 07:33:50 +0000 (08:33 +0100)]
arm64: zynqmp: Add support for zynqmp automotive silicons
Remove silicon prefix. Automotive grade devices are using xazu instead
of xczu prefix.
The patch "fpga: xilinx: Check for substring in device ID validation"
(sha1: f72132673a01216e760864e442f168977cce2bd2)
enables this functionality for zynq devices that only substrings are
checked.
Unfortunately there is no way how to detect device grade that's why
this change is reasonable.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Mon, 27 Feb 2017 07:11:38 +0000 (08:11 +0100)]
arm64: zynqmp: Use only earlycon bootargs instead of full one
This is the same patch as was done earlier.
Please look at Linux patch:
"arm64: zynqmp: Use only earlycon bootargs instead of full one"
(sha1: f3609c8d4af28b9cc22ca49bf8e529b582ec188c)
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arm64: zynqmp: Add generic compatible string for I2C EEPROM
The at24 driver allows to register I2C EEPROM chips using different vendor
and devices, but the I2C subsystem does not take the vendor into account
when matching using the I2C table since it only has device entries.
But when matching using an OF table, both the vendor and device has to be
taken into account so the driver defines only a set of compatible strings
using the "atmel" vendor as a generic fallback for compatible I2C devices.
So add this generic fallback to the device node compatible string to make
the device to match the driver using the OF device ID table.
Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org> Acked-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 1 Dec 2017 13:34:03 +0000 (14:34 +0100)]
arm64: zynqmp: Do not use SPL_SYS_MALLOC_SIMPLE allocator
This was caused by: "fs/fat: Reduce stack usage"
(sha1:2460098cffacd18729262e3ed36656e6943783ed) which converted
fat code to use malloc. But simple malloc is not freeing space
that's why full malloc implementation is needed.
Malloc space is added to RAM.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Mon, 6 Feb 2017 13:34:01 +0000 (14:34 +0100)]
arm64: zynqmp: Do not perform reset in case of panic
Do not perform reset when panic happens because in the next reset
panic happens again and logs are overflood by the same errors.
This can be enabled by default and reset can be performed via watchdog.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
fpga: allow programming fpga from FIT image for all FPGA drivers
This drops the limit that fpga is only loaded from FIT images for Xilinx.
This is done by moving the 'partial' check from 'common/image.c' to
'drivers/fpga/xilinx.c' (the only driver supporting partial images yet)
and supplies a weak default implementation in 'drivers/fpga/fpga.c'.
Signed-off-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com> Tested-by: Michal Simek <michal.simek@xilinx.com> (On zcu102) Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Wenbin song [Mon, 4 Dec 2017 04:18:28 +0000 (12:18 +0800)]
armv8: ls1043a/ls2080a: check SoC by device ID
Check LS1043A/LS2080a by device ID without using personality ID to
determine revision number. This check applies to all various
personalities of the same SoC family.
Signed-off-by: Wenbin Song <wenbin.song@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
Rajesh Bhagat [Thu, 30 Nov 2017 11:14:45 +0000 (16:44 +0530)]
arm64: ls1012afrdm: Add distro boot support
Include common config_distro_defaults.h and config_distro_bootcmd.h
for u-boot enviroments to support automatical distro boot which
scan boot.scr from external storage devices(e.g. SD and USB)
and execute autoboot script.
Signed-off-by: Bhaskar Upadhaya <Bhaskar.Upadhaya@nxp.com> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
Rajesh Bhagat [Thu, 30 Nov 2017 11:14:38 +0000 (16:44 +0530)]
arm64: ls1012ardb: Add distro boot support
Include common config_distro_defaults.h and config_distro_bootcmd.h
for u-boot enviroments to support automatical distro boot which
scan boot.scr from external storage devices(e.g. SD and USB)
and execute autoboot script.
Signed-off-by: Bhaskar Upadhaya <Bhaskar.Upadhaya@nxp.com> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
Yangbo Lu [Mon, 27 Nov 2017 07:40:17 +0000 (15:40 +0800)]
armv8: ls1088ardb: support force SDHC mode by hwconfig
The BRDCFG5[SPISDHC] register field of Qixis device is used
to control SPI and SDHC signal routing.
10 = Force SDHC Mode
- SPI_CS[0] is routed to CPLD for SDHC_VS use.
- SPI_CS[1] is unused.
- SPI_CS[2:3] are routed to the TDMRiser slot.
11 = Force eMMC Mode
- SPI_CS[0:3] are routed to the eMMC card.
0X = Auto Mode
- If SDHC_CS_B=0 (SDHC card installed): Use SDHC mode
described above.
- Else SDHC_CS_B=1 (no SDHC card installed): Use eMMC
mode described above.
In default the hardware uses auto mode, but sometimes we need
to use force SDHC mode to support SD card hotplug, or SD sleep
waking up in kernel. This patch is to support force SDHC mode
by hwconfig.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
Felix Brack [Thu, 30 Nov 2017 12:52:37 +0000 (13:52 +0100)]
power: pmic/regulator: Add basic support for TPS65910
Texas Instrument's TPS65910 PMIC contains 3 buck DC-DC converts, one
boost DC-DC converter and 8 LDOs. This patch implements driver model
support for the TPS65910 PMIC and its regulators making the get/set
API for regulator value/enable available.
This patch depends on the patch "am33xx: Add a function to query MPU
voltage in uV" to build correctly. For boards relying on the DT
include file tps65910.dtsi the v3 patch "power: extend prefix match
to regulator-name property" and an appropriate regulator naming is
also required.
Signed-off-by: Felix Brack <fb@ltec.ch> Reviewed-by: Simon Glass <sjg@chromium.org>
Stefan Roese [Wed, 29 Nov 2017 15:46:42 +0000 (16:46 +0100)]
dm: blk: Use uclass_find_first/next_device() in blk_first/next_device()
This patch changes the calls to uclass_first/next_device() in blk_first/
next_device() to use uclass_find_first/next_device() instead. These functions
don't prepare the devices, which is correct in this case.
With this patch applied, the "usb storage" command now works again as
expected:
=> usb storage
Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
Type: Removable Hard Disk
Capacity: 58656.0 MB = 57.2 GB (120127488 x 512)
Without this patch, it used to generate this buggy output:
=> usb storage
Card did not respond to voltage select!
mmc_init: -95, time 26
No storage devices, perhaps not 'usb start'ed..?
Signed-off-by: Stefan Roese <sr@denx.de> Suggested-by: Simon Glass <sjg@chromium.org> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Felix Brack [Mon, 27 Nov 2017 08:14:16 +0000 (09:14 +0100)]
power: extend prefix match to regulator-name property
This patch extends pmic_bind_children prefix matching. In addition to
the node name the property regulator-name is used while trying to match
prefixes. This allows assigning different drivers to regulator nodes
named regulator@1 and regulator@10 for example.
I have discarded the idea of using other properties then regulator-name
as I do not see any benefit in using property compatible or even
regulator-compatible. Of course I am open to change this if there are
good reasons to do so.
Signed-off-by: Felix Brack <fb@ltec.ch> Reviewed-by: Simon Glass <sjg@chromium.org>
Philipp Tomsich [Fri, 24 Nov 2017 17:37:58 +0000 (18:37 +0100)]
dm: reset: have the reset-command perform a COLD reset
The DM version of do_reset has been issuing a warm-reset, which (on
some platforms keeps GPIOs and other parts of the platform active).
This may cause unintended behaviour, as calling do_reset usually
indicates a desire to reset the board/platform and not just the CPU.
This changes do_reset to always request a COLD reset.
Note that programmatic uses can still invoke a WARM reset through
reset_cpu() or using sysreset_walk().
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 14 Nov 2017 01:55:06 +0000 (18:55 -0700)]
binman: tegra: Convert to use binman
Update tegra to use binman for image creation. This still includes the
current Makefile logic, but a later patch will remove this. Three output
files are created, all of which combine
SPL and U-Boot:
u-boot-tegra.bin - standard image
u-boot-dtb-tegra.bin - same as u-boot-tegra.bin
u-boot-nodtb-target.bin - includes U-Boot without the appended device tree
The latter is useful for build systems where the device is appended later,
perhaps after being modified.
Simon Glass [Tue, 14 Nov 2017 01:55:04 +0000 (18:55 -0700)]
binman: Add binman support to spl_ram.c
SPL supports reading U-Boot from a RAM location. At present this is
hard-coded to the U-Boot text base address. Use binman to allow this to
come from the image file, if binman is used.
Simon Glass [Tue, 14 Nov 2017 01:55:03 +0000 (18:55 -0700)]
binman: Add binman symbol support to SPL
Allow SPL to access binman symbols and use this to get the address of
U-Boot. This falls back to CONFIG_SYS_TEXT_BASE if the binman symbol
is not available.
Simon Glass [Tue, 14 Nov 2017 01:55:01 +0000 (18:55 -0700)]
binman: Support accessing binman tables at run time
Binman construct images consisting of multiple binary files. These files
sometimes need to know (at run timme) where their peers are located. For
example, SPL may want to know where U-Boot is located in the image, so
that it can jump to U-Boot correctly on boot.
In general the positions where the binaries end up after binman has
finished packing them cannot be known at compile time. One reason for
this is that binman does not know the size of the binaries until
everything is compiled, linked and converted to binaries with objcopy.
To make this work, we add a feature to binman which checks each binary
for symbol names starting with '_binman'. These are then decoded to figure
out which entry and property they refer to. Then binman writes the value
of this symbol into the appropriate binary. With this, the symbol will
have the correct value at run time.
Macros are used to make this easier to use. As an example, this declares
a symbol that will access the 'u-boot-spl' entry to find the 'pos' value
(i.e. the position of SPL in the image):
This converts to a symbol called '_binman_u_boot_spl_prop_pos' in any
binary that includes it. Binman then updates the value in that binary,
ensuring that it can be accessed at runtime with:
Simon Glass [Tue, 14 Nov 2017 01:55:00 +0000 (18:55 -0700)]
binman: Support enabling debug in tests
The elf module can provide some debugging information to assist with
figuring out what is going wrong. This is also useful in tests. Update the
-D option so that it is passed through to tests as well.
Simon Glass [Tue, 14 Nov 2017 01:54:58 +0000 (18:54 -0700)]
binman: Add tests binaries with binman symbols
For testing we need to build some ELF files containing binman symbols. Add
these to the Makefile and check in the binaries:
u_boot_binman_syms - normal, valid ELF file
u_boot_binman_syms_bad - missing the __image_copy_start symbol
u_boot_binman_syms_size - has a binman symbol with an invalid size
These ifdefs are protecting #include statements for files that have
never existed. AFAICT this hardware.h has been copied from the kernel
and the ifdefs have never served a role in U-Boot, so delete them.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Michal Simek [Fri, 8 Dec 2017 14:47:18 +0000 (15:47 +0100)]
test: py: Add an option to skip sleep test
Some QEMUs have a problem with time setup that's why
sleep test is failing. Introduce env__sleep_accurate
boardenv variable to have an option to skip sleep test.
Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
- avoid disturbing 0MiB partition size (in fact < 1MiB)
- test overlap limit between part1 and part2
- test gpt write with data with modifier 'M' for MiB
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
Peng Fan [Tue, 5 Dec 2017 05:20:59 +0000 (13:20 +0800)]
SPL: Add FIT data-position property support
For external data, FIT has a optional property "data-position" which
can set the external data to a fixed offset to FIT beginning.
Add the support for this property in SPL FIT.
Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tomas Melin <tomas.melin@vaisala.com> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: "Andrew F. Davis" <afd@ti.com> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: "tomas.melin@vaisala.com" <tomas.melin@vaisala.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Andre Przywara <andre.przywara@arm.com> Cc: York Sun <york.sun@nxp.com> Cc: Lokesh Vutla <lokeshvutla@ti.com> Cc: "Cooper Jr., Franklin" <fcooper@ti.com> Cc: George McCollister <george.mccollister@gmail.com> Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Cc: Rick Altherr <raltherr@google.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: York Sun <york.sun@nxp.com>
Adam Ford [Mon, 4 Dec 2017 23:54:50 +0000 (17:54 -0600)]
ARM: omap3_logic: Enable NAND unlocking during Falcon mode
Falcon mode was already working with SD card. This enables the
unlocking of NAND to allow the NAND read & write. This also
expands the README file based on the am335x describing how to
setup Falcon mode.
This symbol enables some library code used by various SATA drivers,
so make this a non-user-visible symbol select'ed by the respective
drivers, and let moveconfig handle the rest.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Alexey Brodkin [Sun, 10 Dec 2017 17:55:44 +0000 (20:55 +0300)]
gpio/hsdk: Depend on DM_GPIO instead of simple DM
This driver really is DM GPIO one and so we need to have a correct
dependency, because DM alone doesn't provide required for CMD_GPIO
call and we're seeing build failures like this:
---------------------->8---------------------
cmd/built-in.o: In function 'do_gpio':
.../cmd/gpio.c:188: undefined reference to 'gpio_request'
...
---------------------->8---------------------
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Eugeniy Paltsev <paltsev@synopsys.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Wed, 6 Dec 2017 05:16:34 +0000 (14:16 +0900)]
ARM: uniphier: use FIELD_PREP for PLL settings
It is tedious to define both mask and bit-shift. <linux/bitfield.h>
provides a convenient way to get access to register fields with a
single shifted mask.