Commit Graph

42779 Commits

Author SHA1 Message Date
Simon Glass
8f4b612333 dm: led: Add support for getting the state of an LED
It is useful to be able to read the LED as well as write it. Add this to
the uclass and update the GPIO driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
2017-04-14 19:38:57 -06:00
Simon Glass
ddae9fcddc dm: led: Adjust the LED uclass
At present this is very simple, supporting only on and off. We want to
also support toggling and blinking. As a first step, change the name of
the main method and use an enum to indicate the state.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
2017-04-14 19:38:57 -06:00
Simon Glass
56e19871dc dm: led: Rename struct led_uclass_plat
These structures are normally named with 'uc' instead of 'uclass'. Change
this one for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
2017-04-14 19:38:57 -06:00
Simon Glass
9b36f74816 dm: led: Add a missing blank line in the Kconfig file
There should be a blank line between each option. Add one before LED_GPIO.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
2017-04-14 19:38:57 -06:00
Simon Glass
a89c3a04bc sandbox: Add some test LEDs
Add some LEDs to the standard sandbox device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
2017-04-14 19:38:57 -06:00
Jean-Jacques Hiblot
4e27b9a584 dm: scsi: fix divide-by-0 error in scsi_scan()
With DM_SCSI enabled, blk_create_devicef() is called with blkz = 0, leading
to a divide-by-0 exception.
scsi_detect_dev() can be used to get the required parameters (block size
and number of blocks) from the drive before calling blk_create_devicef().

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-14 19:38:57 -06:00
Jean-Jacques Hiblot
1330a726ff scsi: move the partition initialization out of the scsi detection
We might want to get information about the scsi device without initializing the partition.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-14 19:38:57 -06:00
Jean-Jacques Hiblot
e39cecfdaf scsi: make the LUN a parameter of scsi_detect_dev()
This is a cosmetic change. target and LUN have kind of the same role in
this function. One of them was passed as a parameter and the other was
embedded in a structure. For consistency, pass both of them as parameters.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-14 19:38:57 -06:00
Jean-Jacques Hiblot
fd138ca1bd arm: omap: sata: compile out board-level sata code when CONFIG_DM_SCSI is defined
When CONFIG_DM_SCSI is defined, the SATA initialization will be implemented
in the scsi-uclass driver.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-04-14 19:38:57 -06:00
Mugunthan V N
01a072c6cf arm: omap: sata: move enable sata clocks to enable_basic_clocks()
All the clocks which has to be enabled has to be done in
enable_basic_clocks(), so moving enable sata clock to common
clocks enable function.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-04-14 19:38:57 -06:00
Tom Rini
fbeb337529 buildman: Translate more strings to latin-1
When writing out some of our results we may now have UTF-8 characters
in there as well.  Translate these to latin-1 and ignore any errors (as
this is for diagnostic and given the githash anything else can be
reconstructed by the user.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-14 12:21:48 -04:00
Tom Rini
bdf1ea11c8 Merge branch 'master' of git://git.denx.de/u-boot-usb 2017-04-14 10:58:49 -04:00
Troy Kisky
1e5eca7d42 usb: return 0 from usb_stor_get_info even if removable media
This fixes a regression caused by

commit 07b2b78ce4
    dm: usb: Convert USB storage to use driver-model for block devs

which caused part_init to be called when it was not previously.
Without this patch, the following happens when a USB sd card reader is used.

=> usb start
starting USB...
USB0:   Port not available.
USB1:   USB EHCI 1.00
scanning bus 1 for devices... 3 USB Device(s) found
       scanning usb for storage devices... Device NOT ready
   Request Sense returned 02 3A 00
 ### ERROR ### Please RESET the board ###

This happens because dev_desc->blksz is 0.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2017-04-14 16:44:17 +02:00
Eddie Cai
57ca63b86e usb: dwc2: invalidate the dcache before starting the DMA
We should invalidate the dcache before starting the DMA. In case there are
any dirty lines from the DMA buffer in the cache, subsequent cache-line
replacements may corrupt the buffer in memory while the DMA is still going on.
Cache-line replacement can happen if the CPU tries to bring some other memory
locations into the cache while the DMA is going on.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Reviewed-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2017-04-14 16:44:16 +02:00
Philipp Tomsich
889239d6b5 usb: dwc3: gadget: make cache-maintenance on event buffers more robust
Merely using dma_alloc_coherent does not ensure that there is no stale
data left in the caches for the allocated DMA buffer (i.e. that the
affected cacheline may still be dirty).

The original code was doing the following (on AArch64, which
translates a 'flush' into a 'clean + invalidate'):
  # during initialisation:
      1. allocate buffers via memalign
      	 => buffers may still be modified (cached, dirty)
  # during interrupt processing
      2. clean + invalidate buffers
      	 => may commit stale data from a modified cacheline
      3. read from buffers

This could lead to garbage info being written to buffers before
reading them during even-processing.

To make the event processing more robust, we use the following sequence
for the cache-maintenance:
  # during initialisation:
      1. allocate buffers via memalign
      2. clean + invalidate buffers
      	 (we only need the 'invalidate' part, but dwc3_flush_cache()
	  always performs a 'clean + invalidate')
  # during interrupt processing
      3. read the buffers
      	 (we know these lines are not cached, due to the previous
	  invalidation and no other code touching them in-between)
      4. clean + invalidate buffers
      	 => writes back any modification we may have made during event
	    processing and ensures that the lines are not in the cache
	    the next time we enter interrupt processing

Note that with the original sequence, we observe reproducible
(depending on the cache state: i.e. running dhcp/usb start before will
upset caches to get us around this) issues in the event processing (a
fatal synchronous abort in dwc3_gadget_uboot_handle_interrupt on the
first time interrupt handling is invoked) when running USB mass
storage emulation on our RK3399-Q7 with data-caches on.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-04-14 16:44:16 +02:00
Philipp Tomsich
b7bf4a9592 usb: dwc3: ensure consistent types for dwc3_flush_cache
The dwc3_flush_cache() call was declared and used inconsistently:
 * The declaration assumed 'int' for addresses (a potential issue
   when running in a LP64 memory model).
 * The invocation cast the address to 'long'.

This change ensures that both the declaration and usage of this
function consistently uses 'uintptr_t' for correct behaviour even
when the allocated buffers (to be flushed) reside outside of the
lower 32bits of memory.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-04-14 16:44:16 +02:00
Felipe Balbi
207835b13f usb: gadget: g_dnl: don't set iProduct nor iSerialNumber
Both these numbers are calculated in runtime and dynamically assigned
to the device descriptor during bind().

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-04-14 16:44:16 +02:00
Felipe Balbi
842778a091 usb: gadget: g_dnl: only set iSerialNumber if we have a serial#
We don't want to claim that we support a serial number string and
later return nothing. Because of that, if g_dnl_serial is an empty
string, let's skip setting iSerialNumber to a valid number.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-04-14 16:44:16 +02:00
Felipe Balbi
12d0b8f5f0 usb: gadget: g_dnl: hold maximum string descriptor
A USB String descriptor can be up to 255 characters long and it's not
NULL terminated according to the USB spec. This means our
MAX_STRING_SERIAL should be 256 (to cope with NULL terminator).

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-04-14 16:44:16 +02:00
Tom Rini
c1a16c3ab5 Merge branch 'master' of git://git.denx.de/u-boot-socfpga 2017-04-14 09:05:57 -04:00
Tom Rini
af1b7286d8 Merge branch 'master' of git://git.denx.de/u-boot-mmc 2017-04-14 09:05:46 -04:00
Kever Yang
5c73536738 usb: dwc2: add support for external vbus supply
Some board do not use the dwc2 internal VBUS_DRV signal, but
use a gpio pin to enable the 5.0V VBUS power, add interface to
enable the power in dwc2 driver.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-14 14:07:46 +02:00
Dalon Westergreen
09397d99ed arm: socfpga: sr1500 use environment in common header
This removes the default environment from the sr1500 header
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

This board has no upstream devicetree in the kernel source,
so set to socfpga_cyclone5_sr1500.dtb.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>

--
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE
 - set devicetree name to match socfpga_{fpga model}_{board model}.dts
   pattern
2017-04-14 14:07:13 +02:00
Dalon Westergreen
19a8fed57c arm: socfpga: Socrates use environment in common header
This removes the default environment from the socrates headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

Change default devicetree name to match devicetree name in
upstream kernel source.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>

--
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE
2017-04-14 14:07:11 +02:00
Dalon Westergreen
b52acd8f97 arm: socfpga: SoCKit use environment in common header
This removes the default environment from the SoCKit headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

Change default devicetree name to match devicetree name in
upstream kernel source.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>

--
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE
2017-04-14 14:07:09 +02:00
Dalon Westergreen
9e41d225ca arm: socfpga: DE1 use environment in common header
This removes the default environment from the de1 headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

This board does not have a devicetree in the upstream kernel
source so set devicetree to socfpga_cyclone5_de1_soc.dtb.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>

--
Changes in V2:
 - Remove unneeded CONFIG_BOOTFILE
 - set devicetree name to match socfpga_{fpga model}_{board model}.dts
   pattern
2017-04-14 14:07:07 +02:00
Dalon Westergreen
5e7ae1afb2 arm: socfpga: C5 SoCDK use environment in common header
This removes the default environment from the C5 SoCDK headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

In addition to the above, add support to boot from the custom
a2 type partition.

Change default devicetree name to match devicetree name in
upstream kernel source.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>

--
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE
2017-04-14 14:07:05 +02:00
Dalon Westergreen
57b6b62f56 arm: socfpga: A5 SoCDK use environment in common header
This removes the default environment from the A5 socdk headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

Add support to boot from the custom a2 type partition.

Change default devicetree name to match devicetree name in
upstream kernel source.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>

--
Changes in v3:
 - Fix small typo in defconfig, missing "C"
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE
 - Fix dtb name

a5config test

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
2017-04-14 14:07:03 +02:00
Dalon Westergreen
29c0655173 arm: socfpga: DE0 use environment in common header
This removes the default environment from the de0 headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

In addition to the above, add support to boot from the custom
a2 type partition

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>

--
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE
2017-04-14 14:07:01 +02:00
Dalon Westergreen
451e824125 arm: socfpga: Add distro boot to socfpga common header
This adds a common environment and support for distro boot
in the common socfpga header.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>

--
Changes in v5:
 - Per Frank, to support OpenSuse the ENV must be after the GPT
Changes in v4:
 - Move env back to being right after the MBR
Changes in v3:
 - fix spacing between asterix
 - remove verify=n as a default setting

Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE and fdt_addr
 - cleanup spacing in MMC env size

common

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
2017-04-14 14:06:59 +02:00
Ley Foon Tan
707cd012e2 arm: socfpga: Convert Altera DDR SDRAM driver to use Kconfig
Convert Altera DDR SDRAM driver to use Kconfig method.
Enable ALTERA_SDRAM by default if it is on Gen5 target.
Arria 10 will have different driver.

Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2017-04-14 14:06:57 +02:00
Ley Foon Tan
e11b5e8d6e fdt: Add compatible strings for Arria 10
Add compatible strings for Intel Arria 10 SoCFPGA device.

Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2017-04-14 14:06:55 +02:00
Marek Vasut
cc62ac7578 ARM: socfpga: Disable OC on MCVEVK
Disable the OC test on MCVEVK as the old PHY version does not provide
this information. This fixes the USB OTG operation.

Signed-off-by: Marek Vasut <marex@denx.de>
2017-04-14 14:06:53 +02:00
Marek Vasut
d70b338ec6 ARM: socfpga: mcvevk: Add default dfu_alt_info
Add default DFU altinfo for eMMC.

Signed-off-by: Marek Vasut <marex@denx.de>
2017-04-14 14:06:52 +02:00
Marek Vasut
55ce55faaa ARM: socfpga: Reduce the DFU buffer size
There is no point in having such gargantuan buffer, it only requires
huge malloc area. Reduce the DFU buffer size.

Signed-off-by: Marek Vasut <marex@denx.de>
2017-04-14 14:06:49 +02:00
Marek Vasut
a548bc511f ARM: socfpga: Rename MCVEVK
The board is now manufactured by Aries Embedded GmbH , rename it.

Signed-off-by: Marek Vasut <marex@denx.de>
2017-04-14 14:06:44 +02:00
Chee, Tien Fong
4c0f3e7f7b ARM: socfpga: boot0 hook: remove macro from boot0 header file
Commit ce62e57fc5 ("ARM: boot0 hook: remove macro, include whole
header file") miss out cleaning macro in this header file, and this
has broken implementation of a boot header capability in socfpga
SPL. Remove the macro in this file, and recovering it back
to proper functioning.

Fixes: ce62e57fc5 ("ARM: boot0 hook: remove macro, include whole
header file")

Signed-off-by: Chee, Tien Fong <tien.fong.chee@intel.com>
2017-04-14 14:06:42 +02:00
Georges Savoundararadj
45fa6f1dd5 ARM: socfpga: cyclone5-socdk: Enable ports A & C
With the port C enabled, we can read the GPI input state of:
* the DIP switches (USER_DIPSW_HPS[3:0]/HPS_GPI[7:4])
* the push buttons (USER_PB_HPS[3:0]/HPS_GPI[11:8])

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
Signed-off by: Sid-Ali Teir <git.syedelec@gmail.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Marek Vasut <marex@denx.de>
2017-04-14 14:06:40 +02:00
Stephen Arnold
8baa17832f ARM: socfpga: add fpga build and bsp handoff instructions to readme
This patch adds the steps to manually (re)build a Quartus FPGA project,
generate the required BSP glue, and update u-boot handoff files for
mainline SPL support. Requires Quartus toolchain and current U-Boot.

Signed-off-by: Steve Arnold <stephen.arnold42@gmail.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Stefan Roese <sr@denx.de>
Cc: Marek Vasut <marex@denx.de>
2017-04-14 14:06:38 +02:00
Alex Deymo
7dde50d707 mmc: sdhci: Wait for SDHCI_INT_DATA_END when transferring.
sdhci_transfer_data() function transfers the blocks passed up to the
number of blocks defined in mmc_data, but returns immediately once all
the blocks are transferred, even if the loop exit condition is not met
(bit SDHCI_INT_DATA_END set in the STATUS word).

When doing multiple writes to mmc, returning right after the last block
is transferred can cause the write to fail when sending the
MMC_CMD_STOP_TRANSMISSION command right after the
MMC_CMD_WRITE_MULTIPLE_BLOCK command, leaving the mmc driver in an
unconsistent state until reboot. This error was observed in the rpi3
board.

This patch waits for the SDHCI_INT_DATA_END bit to be set even after
sending all the blocks.

Test: Reliably wrote 2GiB of data to mmc in a rpi3.

Signed-off-by: Alex Deymo <deymo@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-14 15:23:14 +09:00
Jocelyn Bohr
4db2b61fcf mmc: bcm2835_sdhci: Speed up mmc writes.
The linux kernel driver for this module does not use a delay when
writing to the SDHCI_BUFFER register. This patch mimics that behavior
in order to speed up the mmc writes on the Raspberry Pi.

Signed-off-by: Alex Deymo <deymo@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-14 15:23:03 +09:00
Wenyou Yang
c86c0155dc mmc: gen_atmel_mci: add driver model support for mci
Add the driver model support for Atmel mci while retaining the
existing legacy code. This allows the driver to support boards
that have converted to driver model as well as those that have not.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-14 15:19:57 +09:00
Heiner Kallweit
d0c5c8d529 odroid-c2: enable new Meson GX MMC driver in board defconfig
Enable new Meson GX MMC driver in Odroid C2 defconfig.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
2017-04-14 15:16:06 +09:00
Carlo Caione
937386204d mmc: meson: add MMC driver for Meson GX (S905)
This driver implements MMC support on Meson GX (S905) based systems.
It's based on Carlo Caione's work, changes:
- BLK support added
- general refactoring

Signed-off-by: Carlo Caione <carlo@caione.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Tested-by: Vagrant Cascadian <vagrant@debian.org>
2017-04-14 15:16:06 +09:00
Heiner Kallweit
a3b02a1d49 arm: dts: update Meson GXBB / Odroid-C2 DT with recent Linux version
As a prerequisite for adding a Meson GX MMC driver update the
Meson GXBB / Odroid-C2 device tree in Uboot with the latest
version from Linux.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
2017-04-14 15:16:06 +09:00
Tom Rini
b7b24a7a3c Merge git://git.denx.de/u-boot-dm
Here with some DM changes as well as the long-standing AT91 DM/DT
conversion patches which I have picked up via dm.
2017-04-13 17:31:06 -04:00
Wenyou Yang
22e10be456 board: sama5d4ek: enable early debug UART
Enable the early debug UART to debug problems when an ICE or other
debug mechanism is not available.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
2017-04-13 14:44:53 -06:00
Wenyou Yang
33034a77a5 board: sama5d4ek: clean up code
Due to the introduction of the pinctrl and clk driver, and using
device tree files, remove the unneeded hardcoded pin configuration
and clock enabling code from the board file.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
2017-04-13 14:44:52 -06:00
Wenyou Yang
ef33aa3dca board: sama5d4ek: update to support DM/DT
Update the configuration files to support the device tree and driver
model, so do SPL. The device clock and pins configuration are handled
by the clock and the pinctrl drivers respectively.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
2017-04-13 14:44:52 -06:00
Wenyou Yang
334794f584 board: sama5d4_xplained: enable early debug UART
Enable the early debug UART to debug problems when an ICE or other
debug mechanism is not available.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
2017-04-13 14:44:52 -06:00