]> git.karo-electronics.de Git - karo-tx-uboot.git/log
karo-tx-uboot.git
8 years agoARM: AM43xx: Enable clocks for USB OTGSS and USB PHY
Kishon Vijay Abraham I [Mon, 23 Feb 2015 13:09:45 +0000 (18:39 +0530)]
ARM: AM43xx: Enable clocks for USB OTGSS and USB PHY

Enabled clocks for dwc3 controller and USB PHY present in AM43xx.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoARM: DRA7: Enable clocks for USB OTGSS and USB PHY
Kishon Vijay Abraham I [Mon, 23 Feb 2015 13:09:44 +0000 (18:39 +0530)]
ARM: DRA7: Enable clocks for USB OTGSS and USB PHY

Enabled clocks for dwc3 controller and USB PHY present in DRA7.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agousb: dwc2: retry NAK'd interrupt transfers
Stephen Warren [Sun, 12 Apr 2015 03:52:02 +0000 (21:52 -0600)]
usb: dwc2: retry NAK'd interrupt transfers

IIUC, interrupt transfers are NAK'd by devices until they wish to trigger
an interrupt, and e.g. EHCI controllers retry these in HW until they are
ACK'd. However, DWC2 doesn't seem to retry, so we need to do this in SW.
In practice, I've seen DWC2_HCINT_FRMOVRUN happen too. I'm not quite sure
what this error implies; perhaps it's related to how near the end of a
USB frame we're at when the interrupt transfer is initiated? Anyway,
retrying this temporary error seems to be necessary too.

With all these commits applied, both my USB keyboards (one LS Lenovo and
one FS Dell) work correctly when there is no USB hub between the SoC and
the keyboard; We still need split transactions to be implemented for hubs
to work.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: implement interrupt transfers
Stephen Warren [Sat, 11 Apr 2015 03:05:22 +0000 (21:05 -0600)]
usb: dwc2: implement interrupt transfers

As best I can tell, there's no difference between bulk and interrupt
transfers in terms of how the HW should be programmed, at least given
that we're executing one transaction at a time rather than scheduling
them into frames for maximum throughput.

This patch ends up sharing the toggle bit state between bulk and
interrupt transfers on a particular EP. However I believe this is fine;
AFAIK a given EP either uses bulk or interrupt transfers and doesn't mix
them.

This patch doesn't do anything with the "interval" parameter for
interrupt transfers, but then most other USB controller drivers in U-Boot
don't either.

It turns out that one of my keyboards is happy to work using control
transfers but the other only gives non-zero "HID reports" via interrupt
transfers.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: correctly program hcchar for LS devices
Stephen Warren [Sat, 11 Apr 2015 03:05:21 +0000 (21:05 -0600)]
usb: dwc2: correctly program hcchar for LS devices

A bit must be set in HCCHAR when communicating with low-speed devices.
I have no idea why there's no corresponding bit to distinguish between
full-speed and high-speed devices, but no matter; they all work now!

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agoARM: bcm2835: use phys_to_bus() for mbox
Stephen Warren [Tue, 7 Apr 2015 02:28:39 +0000 (20:28 -0600)]
ARM: bcm2835: use phys_to_bus() for mbox

When we communicate with the VideoCore to perform property mailbox
transactions, that is a DMA operation as far as the property buffer
is concerned. Use phys_to_bus() on that buffer.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: detect device speed correctly
Stephen Warren [Sat, 28 Mar 2015 03:55:38 +0000 (21:55 -0600)]
usb: dwc2: detect device speed correctly

This doesn't make my LS keyboard work any better, but it does at least
report the correct speed in "usb tree".

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: use phys_to_bus/bus_to_phys
Stephen Warren [Wed, 25 Mar 2015 02:07:35 +0000 (20:07 -0600)]
usb: dwc2: use phys_to_bus/bus_to_phys

Use of these APIs is required on the Raspberry Pi. With this change, USB
on RPi1 should be more reliable, and USB on the RPi2 will start working.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agoARM: bcm2835: implement phys_to_bus/bus_to_phys
Stephen Warren [Wed, 25 Mar 2015 02:07:34 +0000 (20:07 -0600)]
ARM: bcm2835: implement phys_to_bus/bus_to_phys

The BCM283[56] contain both a L1 and L2 cache between the GPU (a/k/a
VideoCore CPU?) and DRAM. DMA-capable peripherals can also optionally
access DRAM via this same  L2 cache (although they always bypass the L1
cache). Peripherals select whether to use or bypass the cache via the
top two bits of the bus address.

An IOMMU exists between the ARM CPU and the rest of the system. This
controls whether the ARM CPU's accesses use or bypass the L1 and/or L2
cache. This IOMMU is configured/controlled exclusively by the VideoCore
CPU.

In order for DRAM accesses made by the ARM core to be coherent with
accesses made by other DMA peripherals, we must program a bus address
into those peripherals that causes the peripheral's accesses to use the
same set of caches that the ARM core's accesses will use.

On the RPi1, the VideoCore firmware sets up the IOMMU to enable use of
the L2 cache. This corresponds to addresses based at 0x40000000.

On the RPi2, the VideoCore firmware sets up the IOMMU to disable use of
the L2 cache. This corresponds to addresses based at 0xc0000000.

This patch implements U-Boot's phys_to_bus/bus_to_phys APIs according
to those rules.

For full details of this setup, please see Dom Cobley's description at:
http://lists.denx.de/pipermail/u-boot/2015-March/208201.html
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/215038
https://www.mail-archive.com/u-boot@lists.denx.de/msg166568.html

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agoCreate API to map between CPU physical and bus addresses
Stephen Warren [Wed, 25 Mar 2015 02:07:33 +0000 (20:07 -0600)]
Create API to map between CPU physical and bus addresses

On some SoCs, DMA-capable peripherals see a different address space to
the CPU's physical address space. Create an API to allow platform-agnostic
drivers to convert between the two address spaces when programming DMA
operations.

This API will exist on all platforms, but will have a dummy implementation
when this feature is not required. Other platforms will enable
CONFIG_PHYS_TO_BUS and provide the required implementation.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: fix bulk transfers
Stephen Warren [Tue, 24 Mar 2015 05:01:01 +0000 (23:01 -0600)]
usb: dwc2: fix bulk transfers

When I created wait_for_chhltd(), I noticed that some instances of the
code it replaced expected the ACK bit to be set and others didn't. I
assumed this was an accidental inconsistency in the code, so wrote
wait_for_chhltd() to always expect ACK to be set. This code appeared to
work correctly for both enumeration of USB keyboards and operation of
USB Ethernet devices. However, this change broke USB Mass Storage (at
least my USB SD card reader). This change reverts to exactly the
original behaviour. I'm not sure why the ACK bit isn't always set
(perhaps a quirk in the USB HW or DWC2 controller), but the code works
this way!

Fixes: 5be4ca7d6ac8 ("usb: dwc2: unify waiting for transfer completion")
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: remove restriction on buffer length
Stephen Warren [Sun, 8 Mar 2015 17:08:14 +0000 (11:08 -0600)]
usb: dwc2: remove restriction on buffer length

Each USB transfer is split up into chunks that are held in an aligned
buffer. This imposes a limit on the size of each chunk, but no limit on
the total size of transferred data. Fix the logic in chunk_msg() not to
reject large transfers, but simply take the size of the aligned buffer
into account when calculating the chunk size.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: fix aligned buffer usage
Stephen Warren [Sun, 8 Mar 2015 17:08:13 +0000 (11:08 -0600)]
usb: dwc2: fix aligned buffer usage

The original aligned_buffer usage:
a) Uselessly copied data into the aligned buffer even for IN
   transactions. Fix this my making the copy conditional.
b) Always programmed the HW to transfer to/from the start of the aligned
   buffer. This worked fine for OUT transactions since the memcpy copied
   the OUT data to this location too. However, for large IN transactions,
   since the copy from the aligned buffer to the "client" buffer was
   deferred until after all chunks were transferred. it resulted in each
   chunk's transfer over-writing the data for the first transfer. Fix
   this by copying IN data as soon as it's received.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: simplify wait_for_chhltd
Stephen Warren [Sun, 8 Mar 2015 05:48:55 +0000 (22:48 -0700)]
usb: dwc2: simplify wait_for_chhltd

toggle is never NULL. Simplify the code by removing handling of when it
is NULL.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: remove control_data_toggle[]
Stephen Warren [Sun, 8 Mar 2015 05:48:54 +0000 (22:48 -0700)]
usb: dwc2: remove control_data_toggle[]

The control data toggle resets to DATA1 at the start of the data phase
of every setup transaction. We don't need a global variable to store
the value; we can just store it on the stack.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: usb chunk_msg() for control transfers too
Stephen Warren [Sun, 8 Mar 2015 05:48:53 +0000 (22:48 -0700)]
usb: dwc2: usb chunk_msg() for control transfers too

This removes duplicated code.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: refactor submit_bulk_msg to be common
Stephen Warren [Sun, 8 Mar 2015 05:48:52 +0000 (22:48 -0700)]
usb: dwc2: refactor submit_bulk_msg to be common

Move the body of submit_bulk_msg() into new function chunk_msg(). This
can be shared with submit_control_msg() to reduce code duplication, and
allow control messages larger than maxpacket.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: unify waiting for transfer completion
Stephen Warren [Sun, 8 Mar 2015 05:48:51 +0000 (22:48 -0700)]
usb: dwc2: unify waiting for transfer completion

Lift common code out of submit_bulk_msg() and submit_control_msg().

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: hub: allow pgood_delay to be specified via env
Tim Harvey [Wed, 8 Apr 2015 19:21:12 +0000 (12:21 -0700)]
usb: hub: allow pgood_delay to be specified via env

Some USB devices break the spec and require longer warm-up times. Allow
the usb_pgood_delay env variable to override the calculated time.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agousb: fix first descriptor fetch error handling
Stephen Warren [Thu, 9 Apr 2015 03:27:49 +0000 (21:27 -0600)]
usb: fix first descriptor fetch error handling

When fetching the first descriptor from a new device, only validate that
we received at least 8 bytes, not that we received the entire descriptor.
The reasoning is:
- The code only uses fields in the first 8 bytes, so that's all we need
  to have fetched at this stage.
- The smallest maxpacket size is 8 bytes. Before we know the actual
  maxpacket the device uses, the USB controller may only accept a single
  packet (see the DWC2 note in the comment added in the commit).
  Consequently we are only guaranteed to receive 1 packet (at least 8
  bytes) even in a non-error case.

Fixes: 1a7758044b04 ("usb: Early failure when the first descriptor read
fails or is invalid")
Cc: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: Early failure when the first descriptor read fails or is invalid
Paul Kocialkowski [Sat, 4 Apr 2015 13:12:29 +0000 (15:12 +0200)]
usb: Early failure when the first descriptor read fails or is invalid

This may happen when using an USB1 device on a controller that only supports
USB2 (e.g. EHCI). Reading the first descriptor will fail (read 0 byte), so we
can abort the process at this point instead of failing later and wasting time.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agousb: Check usb_new_device for failure
Paul Kocialkowski [Sat, 4 Apr 2015 13:12:28 +0000 (15:12 +0200)]
usb: Check usb_new_device for failure

This checks that a new USB device is correctly initialized and frees it if not.
In addition, this doesn't report that USB was started when no device was found.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agousb: usb_new_device return codes consistency
Paul Kocialkowski [Sat, 4 Apr 2015 13:12:27 +0000 (15:12 +0200)]
usb: usb_new_device return codes consistency

This makes use of errno return codes for representing error codes in a unified
way.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agousb_storage:Fix USB storage capacity detection on 64 bit architectures
Sergey Temerkhanov [Wed, 1 Apr 2015 14:18:46 +0000 (17:18 +0300)]
usb_storage:Fix USB storage capacity detection on 64 bit architectures

This patch fixes USB storage capacity detection breakage on 64-bit systems
which arises due to 'unsigned long' length difference. Old code assumes that
to be 32 bit and breaks because of inappropriate response buffer layout.
Also this fixes a number of build warnings and changes big-endian values
treatment style to be architecture-independent

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
8 years agousb: 64-bit architectures support for xHCI
Sergey Temerkhanov [Wed, 1 Apr 2015 14:18:45 +0000 (17:18 +0300)]
usb: 64-bit architectures support for xHCI

This commit allows xHCI to use both 64 and 32 bit memory
physical addresses depending on architecture it's being built for.
Also it makes use of readq()/writeq() on 64-bit systems

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
8 years agousb: Convert protocol header structures to use explicitly sized variables
Sergey Temerkhanov [Wed, 1 Apr 2015 14:18:44 +0000 (17:18 +0300)]
usb: Convert protocol header structures to use explicitly sized variables

This patch converts USB protocol headers to use explicitly sized
fields like the rest of the code

Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
8 years agousb: mass-storage: Build warning fixes for 64-bit
Thierry Reding [Fri, 20 Mar 2015 11:41:25 +0000 (12:41 +0100)]
usb: mass-storage: Build warning fixes for 64-bit

Fix a printf format mismatch warning seen on 64-bit builds.

Cc: Łukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agousb: ehci-tegra: Build warning fixes for 64-bit
Thierry Reding [Fri, 20 Mar 2015 11:41:27 +0000 (12:41 +0100)]
usb: ehci-tegra: Build warning fixes for 64-bit

Cast pointers to unsigned long instead of a sized 32-bit type to avoid
pointer to integer cast size mismatch warnings.

Cc: Tom Warren <twarren@nvidia.com>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
8 years agoehci-hcd: fix warnings on 64-bit builds
Rob Herring [Tue, 17 Mar 2015 20:46:37 +0000 (15:46 -0500)]
ehci-hcd: fix warnings on 64-bit builds

Change addresses to unsigned long to be compatible with 64-bit builds.
Regardless of fixing warnings, the device is still only 32-bit capable.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Marek Vasut <marex@denx.de>
8 years agousb: ci_udc: fix warnings on 64-bit builds
Rob Herring [Tue, 17 Mar 2015 20:46:35 +0000 (15:46 -0500)]
usb: ci_udc: fix warnings on 64-bit builds

Change addresses to unsigned long to be compatible with 64-bit builds.
Regardless of fixing warnings, the device is still only 32-bit capable.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: "Łukasz Majewski" <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agousb: eth: asix: Build warning fixes for 64-bit
Thierry Reding [Fri, 20 Mar 2015 11:41:23 +0000 (12:41 +0100)]
usb: eth: asix: Build warning fixes for 64-bit

Fix a type mismatch in a printf format string.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
8 years agousb_storage : scan all interfaces to find a storage device
Franck Jullien [Wed, 4 Mar 2015 20:07:00 +0000 (21:07 +0100)]
usb_storage : scan all interfaces to find a storage device

Mass storage is not necessary present on interface 0. This
patch allow usb_stor_scan to look in every available interface.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
8 years agogeneric-board: select SYS_GENERIC_BOARD for some architectures
Masahiro Yamada [Thu, 19 Mar 2015 10:42:52 +0000 (19:42 +0900)]
generic-board: select SYS_GENERIC_BOARD for some architectures

We have done with the generic board conversion for all the boards
of ARC, Blackfin, M68000, MicroBlaze, MIPS, NIOS2, Sandbox, X86.

Let's select SYS_GENERIC_BOARD for those architectures, so we can
tell which architecture has finished the conversion at a glance.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexey Brodkin <abrodkin@synopsys.com>
8 years agoARM: Introduce erratum workaround for 798870
Nishanth Menon [Mon, 9 Mar 2015 22:11:59 +0000 (17:11 -0500)]
ARM: Introduce erratum workaround for 798870

Add workaround for Cortex-A15 ARM erratum 798870 which says
"If back-to-back speculative cache line fills (fill A and fill B) are
issued from the L1 data cache of a CPU to the L2 cache, the second
request (fill B) is then cancelled, and the second request would have
detected a hazard against a recent write or eviction (write B) to the
same cache line as fill B then the L2 logic might deadlock."

Implementations for SoC families such as Exynos, OMAP5/DRA7 etc
will be widely different.

Every SoC has slightly different manner of setting up access to L2ACLR
and similar registers since the Secure Monitor handling of Secure
Monitor Call(smc) is diverse. Hence an weak function is introduced
which may be overriden to implement SoC specific accessor implementation.

Based on ARM errata Document revision 18.0 (22 Nov 2013)

Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Matt Porter <mporter@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoREADME: remove description about driver model configuration options
Masahiro Yamada [Wed, 25 Feb 2015 07:54:57 +0000 (16:54 +0900)]
README: remove description about driver model configuration options

All the DM-related configuration options are described in Kconfig
helps.  They should not be duplicated in README.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agom68k: add generic-board support
angelo@sysam.it [Thu, 12 Feb 2015 00:40:17 +0000 (01:40 +0100)]
m68k: add generic-board support

Add generic-board support for the m68k architecture.

Signed-off-by: Angelo Dureghello <angelo@sysam.it>
8 years agoarm64: Add Xilinx ZynqMP support
Michal Simek [Thu, 15 Jan 2015 09:01:51 +0000 (10:01 +0100)]
arm64: Add Xilinx ZynqMP support

Add basic Xilinx ZynqMP arm64 support.
Serial and SD is supported.
It supports emulation platfrom ep108 and QEMU.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: UniPhier: move SoC sources to mach-uniphier
Masahiro Yamada [Thu, 26 Feb 2015 17:26:42 +0000 (02:26 +0900)]
ARM: UniPhier: move SoC sources to mach-uniphier

Move
arch/arm/cpu/armv7/uniphier/* -> arch/arm/mach-uniphier/*

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
8 years agomx31ads: Convert to generic board
Fabio Estevam [Mon, 23 Feb 2015 11:51:36 +0000 (08:51 -0300)]
mx31ads: Convert to generic board

Boards need to select CONFIG_SYS_GENERIC_BOARD in order to prevent removal
from the project.

Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
8 years agoARM: davinci: remove hawkboard support
Masahiro Yamada [Tue, 24 Feb 2015 02:45:10 +0000 (11:45 +0900)]
ARM: davinci: remove hawkboard support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Sughosh Ganu <urwithsughosh@gmail.com>
Cc: Syed Mohammed Khasim <sm.khasim@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
8 years agoARM: remove tnetv107x board support
Masahiro Yamada [Tue, 24 Feb 2015 02:45:09 +0000 (11:45 +0900)]
ARM: remove tnetv107x board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Chan-Taek Park <c-park@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
8 years agoARM: remove dkb board support
Masahiro Yamada [Tue, 24 Feb 2015 02:45:06 +0000 (11:45 +0900)]
ARM: remove dkb board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Lei Wen <leiwen@marvell.com>
Acked-by: Marek Vasut <marex@denx.de>
8 years agoARM: remove jadecpu board support
Masahiro Yamada [Tue, 24 Feb 2015 02:45:05 +0000 (11:45 +0900)]
ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>
8 years agokconfig: remove unneeded dependency on !SPL_BUILD
Masahiro Yamada [Tue, 24 Feb 2015 13:26:21 +0000 (22:26 +0900)]
kconfig: remove unneeded dependency on !SPL_BUILD

Now CONFIG_SPL_BUILD is not defined in Kconfig, so
"!depends on SPL_BUILD" and "if !SPL_BUILD" are redundant.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
8 years agokconfig: switch to single .config configuration
Masahiro Yamada [Tue, 24 Feb 2015 13:26:20 +0000 (22:26 +0900)]
kconfig: switch to single .config configuration

When Kconfig for U-boot was examined, one of the biggest issues was
how to support multiple images (Normal, SPL, TPL).  There were
actually two options, "single .config" and "multiple .config".
After some discussions and thought experiments, I chose the latter,
i.e. to create ".config", "spl/.config", "tpl/.config" for Normal,
SPL, TPL, respectively.

It is true that the "multiple .config" strategy provided us the
maximum flexibility and helped to avoid duplicating CONFIGs among
Normal, SPL, TPL, but I have noticed some fatal problems:

[1] It is impossible to share CONFIG options across the images.
  If you change the configuration of Main image, you often have to
  adjust some SPL configurations correspondingly.  Currently, we
  cannot handle the dependencies between them.  It means one of the
  biggest advantages of Kconfig is lost.

[2] It is too painful to change both ".config" and "spl/.config".
  Sunxi guys started to work around this problem by creating a new
  configuration target.  Commit cbdd9a9737cc (sunxi: kconfig: Add
  %_felconfig rule to enable FEL build of sunxi platforms.) added
  "make *_felconfig" to enable CONFIG_SPL_FEL on both images.
  Changing the configuration of multiple images in one command is a
  generic demand.  The current implementation cannot propose any
  good solution about this.

[3] Kconfig files are getting ugly and difficult to understand.
  Commit b724bd7d6349 (dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to
  Kconfig) has sprinkled "if !SPL_BUILD" over the Kconfig files.

[4] The build system got more complicated than it should be.
  To adjust Linux-originated Kconfig to U-Boot, the helper script
  "scripts/multiconfig.sh" was introduced.  Writing a complicated
  text processor is a shell script sometimes caused problems.

Now I believe the "single .config" will serve us better.  With it,
all the problems above would go away.  Instead, we will have to add
some CONFIG_SPL_* (and CONFIG_TPL_*) options such as CONFIG_SPL_DM,
but we will not have much.  Anyway, this is what we do now in
scripts/Makefile.spl.

I admit my mistake with my apology and this commit switches to the
single .config configuration.

It is not so difficult to do that:

 - Remove unnecessary processings from scripts/multiconfig.sh
  This file will remain for a while to support the current defconfig
  format.  It will be removed after more cleanups are done.

 - Adjust some makefiles and Kconfigs

 - Add some entries to include/config_uncmd_spl.h and the new file
   scripts/Makefile.uncmd_spl.  Some CONFIG options that are not
   supported on SPL must be disabled because one .config is shared
   between SPL and U-Boot proper going forward.  I know this is not
   a beautiful solution and I think we can do better, but let's see
   how much we will have to describe them.

 - update doc/README.kconfig

More cleaning up patches will follow this.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agokconfig: Adjust ordering so that defaults work as expected
Simon Glass [Tue, 24 Feb 2015 13:26:19 +0000 (22:26 +0900)]
kconfig: Adjust ordering so that defaults work as expected

At present defaults in arch-specific Kconfig files are ignored if the
top-level item comes ahead of it in include order. This means that it is
not possible to have a U-Boot default that architectures and boards can
override. This does not seem very useful.

Move the include earlier to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
8 years agommc: fsl_esdhc: Add support for DDR mode
Volodymyr Riazantsev [Tue, 20 Jan 2015 15:16:44 +0000 (10:16 -0500)]
mmc: fsl_esdhc: Add support for DDR mode

Add support of the DDR mode for eSDHC driver.
Enable it for i.MX6 SoC family only.

Signed-off-by: Volodymyr Riazantsev <volodymyr.riazantsev@globallogic.com>
Reviewed-by: York Sun <yorksun@freescale.com>
8 years agoARM: keystone: move SoC sources to mach-keystone
Masahiro Yamada [Fri, 20 Feb 2015 08:04:11 +0000 (17:04 +0900)]
ARM: keystone: move SoC sources to mach-keystone

Move
arch/arm/cpu/armv7/keystone/* -> arch/arm/mach-keystone/*

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Rini <trini@ti.com>
8 years agoARM: orion5x: move SoC sources to mach-orion5x
Masahiro Yamada [Fri, 20 Feb 2015 08:04:09 +0000 (17:04 +0900)]
ARM: orion5x: move SoC sources to mach-orion5x

Move
arch/arm/cpu/arm926ejs/orion5x/* -> arch/arm/mach-orion5x/*

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
8 years agoARM: nomadik: move SoC sources to mach-nomadik
Masahiro Yamada [Fri, 20 Feb 2015 08:04:07 +0000 (17:04 +0900)]
ARM: nomadik: move SoC sources to mach-nomadik

Move
arch/arm/cpu/arm926ejs/nomadik/* -> arch/arm/mach-nomadik/*

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Nomadik Linux Team <STN_WMM_nomadik_linux@list.st.com>
Cc: Alessandro Rubini <rubini@unipv.it>
8 years agoARM: kirkwood: move SOC sources to mach-kirkwood
Masahiro Yamada [Fri, 20 Feb 2015 08:04:06 +0000 (17:04 +0900)]
ARM: kirkwood: move SOC sources to mach-kirkwood

Move
arch/arm/cpu/arm926ejs/kirkwood/* -> arch/arm/mach-kirkwood/*

Note:
 Perhaps, can we merge arch/arm/mach-kirkwood and
 arch/arm/mvebu-common into arch/arm/mach-mvebu, like Linux?

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Stefan Roese <sr@denx.de>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoARM: tegra: collect SoC sources into mach-tegra
Masahiro Yamada [Fri, 20 Feb 2015 08:04:04 +0000 (17:04 +0900)]
ARM: tegra: collect SoC sources into mach-tegra

This commit moves files as follows:

 arch/arm/cpu/arm720t/tegra20/*      -> arch/arm/mach-tegra/tegra20/*
 arch/arm/cpu/arm720t/tegra30/*      -> arch/arm/mach-tegra/tegra30/*
 arch/arm/cpu/arm720t/tegra114/*     -> arch/arm/mach-tegra/tegra114/*
 arch/arm/cpu/arm720t/tegra124*      -> arch/arm/mach-tegra/tegra124/*
 arch/arm/cpu/arm720t/tegra-common/* -> arch/arm/mach-tegra/*
 arch/arm/cpu/armv7/tegra20/*        -> arch/arm/mach-tegra/tegra20/*
 arch/arm/cpu/armv7/tegra30/*        -> arch/arm/mach-tegra/tegra30/*
 arch/arm/cpu/armv7/tegra114/*       -> arch/arm/mach-tegra/tegra114/*
 arch/arm/cpu/armv7/tegra124/*       -> arch/arm/mach-tegra/tegra124/*
 arch/arm/cpu/armv7/tegra-common/*   -> arch/arm/mach-tegra/*
 arch/arm/cpu/tegra20-common/*       -> arch/arm/mach-tegra/tegra20/*
 arch/arm/cpu/tegra30-common/*       -> arch/arm/mach-tegra/tegra30/*
 arch/arm/cpu/tegra114-common/*      -> arch/arm/mach-tegra/tegra114/*
 arch/arm/cpu/tegra124-common/*      -> arch/arm/mach-tegra/tegra124/*
 arch/arm/cpu/tegra-common/*         -> arch/arm/mach-tegra/*

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Simon Glass <sjg@chromium.org> [ on nyan-big ]
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Tom Warren <twarren@nvidia.com>
8 years agodm: cros_ec: Convert to Kconfig
Simon Glass [Fri, 13 Feb 2015 19:20:47 +0000 (12:20 -0700)]
dm: cros_ec: Convert to Kconfig

Since both I2C and SPI are converted to Kconfig, we can convert cros_ec
to Kconfig for these buses.

LPC will need to wait until driver mode PCI is available.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoARM: imx6: disable bandgap self-bias after boot
Peng Fan [Thu, 15 Jan 2015 06:22:32 +0000 (14:22 +0800)]
ARM: imx6: disable bandgap self-bias after boot

The self-bias circuit is used by the bandgap during startup.
Once the bandgap has stabilized, the self-bias circuit should
be disabled for best noise performance of analog blocks.
Also this bit should be disabled before the chip enters STOP mode or
when ever the regular bandgap is disabled.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com>
8 years agodm:gpio:mxc add DT support
Peng Fan [Tue, 10 Feb 2015 06:46:34 +0000 (14:46 +0800)]
dm:gpio:mxc add DT support

This patch add DT support for mxc gpio driver.

There are one place using CONFIG_OF_CONTROL macro.
1. The U_BOOT_DEVICES and mxc_plat array are complied out. To DT,
   platdata is alloced using calloc, so there is no need to use mxc_plat.

The following situations are tested, and all work fine:
1. with DM, without DT
2. with DM and DT
3. without DM
Since device tree has not been upstreamed, if want to test this patch.
The followings need to be done.
 + pieces of code does not gpio_request when using gpio_direction_xxx and
   etc, need to request gpio.
 + move the gpio settings from board_early_init_f to board_init
 + define CONFIG_DM ,CONFIG_DM_GPIO and CONFIG_OF_CONTROL
 + Add device tree file and do related configuration in
   `make ARCH=arm menuconfig`
These will be done in future patches by step.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agodm:gpio:mxc add a bank_index entry in platdata
Peng Fan [Tue, 10 Feb 2015 06:46:33 +0000 (14:46 +0800)]
dm:gpio:mxc add a bank_index entry in platdata

Add a new entry in platdata structure and intialize
bank_index in mxc_plat array.
This new entry can avoid using `plat - mxc_plat` by using
`plat->bank_index`.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agolcd: split configuration_get_cmap
Nikita Kiryanov [Tue, 3 Feb 2015 11:32:21 +0000 (13:32 +0200)]
lcd: split configuration_get_cmap

configuration_get_cmap() is multiple platform-specific functions stuffed into
one function. Split it into multiple versions, and move each version to the
appropriate driver to reduce the #ifdef complexity.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Bo Shen <voice.shen@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
8 years agoarm: mxs: Add debug outputs and comments to mxs SPL source files
Graeme Russ [Sun, 25 Jan 2015 01:07:51 +0000 (12:07 +1100)]
arm: mxs: Add debug outputs and comments to mxs SPL source files

It is difficult to track down fail to boot issues in the mxs SPL.
Implement the following to make it easier:
 - Add debug outputs to allow tracing of SPL progress in order to track
where failure to boot occurs. DEUBUG and CONFIG_SPL_SERIAL_SUPPORT must
be defined to enable debug output in SPL
 - Add TODO comments where it is not clear if the code is doing what it
is meant to be doing, even tough the board boots properly (these comments
refer to existing code, not to any code added by this patch)

Signed-off-by: Graeme Russ <gruss@tss-engineering.com>
8 years agofdt_support: add missing #ifdef after merge
Lothar Waßmann [Wed, 2 Sep 2015 08:42:45 +0000 (10:42 +0200)]
fdt_support: add missing #ifdef after merge

8 years agocommon/board_f: add missing #endif after merge
Lothar Waßmann [Wed, 2 Sep 2015 08:41:48 +0000 (10:41 +0200)]
common/board_f: add missing #endif after merge

8 years agoKconfig: define missing symbol SPI and make DM_SPI depend on it
Lothar Waßmann [Wed, 2 Sep 2015 08:22:54 +0000 (10:22 +0200)]
Kconfig: define missing symbol SPI and make DM_SPI depend on it

8 years agoKconfig: change CONFIG_MX* to CONFIG_SOC_MX*
Lothar Waßmann [Wed, 2 Sep 2015 08:22:00 +0000 (10:22 +0200)]
Kconfig: change CONFIG_MX* to CONFIG_SOC_MX*

8 years agomx6sabresd: Enable video interfaces in bootargs
Nikolay Dimitrov [Tue, 2 Jun 2015 15:59:34 +0000 (18:59 +0300)]
mx6sabresd: Enable video interfaces in bootargs

Generate kernel video bootargs for sabresd, based on a list of needed video
interfaces ("video_interfaces" U-Boot env-var). The order of initialization
and video settings can be fully customized.

Signed-off-by: Nikolay Dimitrov <picmaster@mail.bg>
8 years agothermal: imx_thermal: use CPU temperature grade for trip points
Tim Harvey [Mon, 18 May 2015 13:56:47 +0000 (06:56 -0700)]
thermal: imx_thermal: use CPU temperature grade for trip points

Replace the hard-coded values for min/max/passive with values derived from
the CPU temperature grade.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: mx6: add display of CPU temperature grade in print_cpuinfo()
Tim Harvey [Mon, 18 May 2015 13:56:46 +0000 (06:56 -0700)]
imx: mx6: add display of CPU temperature grade in print_cpuinfo()

When CONFIG_IMX6_THERMAL is defined print the CPU temperature grade info
along with the current temperature.

Before:
 CPU:   Temperature 42 C

After:
 CPU:   Automotive temperature grade (-40C to 125C) at 42C
 CPU:   Industrial temperature grade (-40C to 105C) at 42C
 CPU:   Extended Commercial temperature grade (-20C to 105C) at 42C

Cc: Stefan Roese <sr@denx.de>
Cc: Eric Nelson <eric.nelson@boundarydevices.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Jon Nettleton <jon.nettleton@gmail.com>
Cc: Jason Liu <r64343@freescale.com>
Cc: Ye Li <b37916@freescale.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Markus Niebel <Markus.Niebel@tq-group.com>
Cc: Peng Fan <b51431@freescale.com>
Tested-by: Nikolay Dimitrov <picmaster@mail.bg>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: mx6: add get_cpu_temp_grade to obtain cpu temperature grade from OTP
Tim Harvey [Mon, 18 May 2015 13:56:45 +0000 (06:56 -0700)]
imx: mx6: add get_cpu_temp_grade to obtain cpu temperature grade from OTP

The MX6 has a temperature grade defined by OCOTP_MEM0[7:6] which is at 0x480
in the Fusemap Description Table in the reference manual. Return this value
as well as min/max temperature based on the value.

Note that the IMX6SDLRM and the IMX6SXRM do not indicate this in the
their Fusemap Description Table however Freescale has confirmed that these
eFUSE bits match the description within the IMX6DQRM and that they will
be added to the next revision of the respective reference manuals.

This has been tested with IMX6 Automative and Industrial parts.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: mx6: display max cpu frequency in print_cpuinfo()
Tim Harvey [Mon, 18 May 2015 14:02:25 +0000 (07:02 -0700)]
imx: mx6: display max cpu frequency in print_cpuinfo()

Display the max CPU frequency as well as the current running CPU frequency
if the max CPU frequency is available and differs from the current CPU
frequency.

Before:
CPU:   Freescale i.MX6Q rev1.2 at 792 MHz

After - using an 800MHz IMX6DL (running at its max)
CPU:   Freescale i.MX6DL rev1.1 at 792 MHz

After - using a 1GHz IMX6Q (not running at its max):
CPU:   Freescale i.MX6Q rev1.2 996 MHz (running at 792 MHz)

Cc: Stefan Roese <sr@denx.de>
Cc: Eric Nelson <eric.nelson@boundarydevices.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Jon Nettleton <jon.nettleton@gmail.com>
Cc: Jason Liu <r64343@freescale.com>
Cc: Ye Li <b37916@freescale.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Markus Niebel <Markus.Niebel@tq-group.com>
Cc: Peng Fan <b51431@freescale.com>
Tested-by: Nikolay Dimitrov <picmaster@mail.bg>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: mx6: add get_cpu_speed_grade_hz func to return MHz speed grade from OTP
Tim Harvey [Mon, 18 May 2015 14:02:24 +0000 (07:02 -0700)]
imx: mx6: add get_cpu_speed_grade_hz func to return MHz speed grade from OTP

The IMX6 has four different speed grades determined by eFUSE SPEED_GRADING
indicated by OCOTP_CFG3[17:16] which is at 0x440 in the Fusemap Description
Table. Return this frequency so that it can be used elsewhere.

Note that the IMX6SDLRM and the IMX6SXRM do not indicate this in the
their Fusemap Description Table however Freescale has confirmed that these
eFUSE bits match the description within the IMX6DQRM and that they will
be added to the next revision of the respective reference manuals.

These have been tested with IMX6 Quad/Solo/Dual-light 800Mhz and 1GHz grades.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agomx6: add OTP bank1 registers
Tim Harvey [Mon, 18 May 2015 13:56:44 +0000 (06:56 -0700)]
mx6: add OTP bank1 registers

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoarm: mx6: ddr: set fast-exit on DDR3 if pd_fast_exit specified
Tim Harvey [Mon, 18 May 2015 14:07:02 +0000 (07:07 -0700)]
arm: mx6: ddr: set fast-exit on DDR3 if pd_fast_exit specified

Commit fa8b7d66f49f0c7bd41467fe78f6488d8af6976a introduced fast-exit support
to the MMDC however enabling it on the DDR3 got missed. Make sure we enable
it on the DDR3 as well.

Gateworks uses Micron memory as well as Winbond in MX6. We have found in
testing that we need to enable fast-exit for Winbond stability. Gateworks
boards are currently the only boards using the MX6 SPL and enabling
fast-exit mode.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoarm/imx-common: Fix warning 'get_reset_cause' defined but not used
Prabhakar Kushwaha [Mon, 18 May 2015 11:43:52 +0000 (17:13 +0530)]
arm/imx-common: Fix warning 'get_reset_cause' defined but not used

Fix below warning
arch/arm/imx-common/cpu.c:29:14: warning: ‘get_reset_cause’ defined but
not used
 static char *get_reset_cause(void)

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Reviewed-by: Eric Nelson <eric.nelson@boundarydevices.com>
Acked-by: Stefano Babic <sbabic@denx.de>
8 years agopmic: pfuze100 fix typo
Peng Fan [Mon, 18 May 2015 05:37:26 +0000 (13:37 +0800)]
pmic: pfuze100 fix typo

Change PUZE_100_SW1ABCONF to PFUZE100_SW1ABCONF

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
8 years agoimx: mx6sx enable SION for i2c pin mux
Peng Fan [Mon, 18 May 2015 05:37:25 +0000 (13:37 +0800)]
imx: mx6sx enable SION for i2c pin mux

Enable IOMUX_CONFIG_SION for all I2C pin mux settings, otherwise
we will get erros when doing i2c operations.
error log like the following:
"
wait_for_sr_state: failed sr=81 cr=a0 state=2020
i2c_init_transfer: failed for chip 0xb retry=1
"

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
8 years agoimx: marsboard: Enable thermal DM support
Nikolay Dimitrov [Sun, 17 May 2015 23:10:47 +0000 (02:10 +0300)]
imx: marsboard: Enable thermal DM support

Signed-off-by: Nikolay Dimitrov <picmaster@mail.bg>
Conflicts:
configs/marsboard_defconfig

8 years agoimx: riotboard: Enable thermal DM support
Nikolay Dimitrov [Sun, 17 May 2015 23:10:46 +0000 (02:10 +0300)]
imx: riotboard: Enable thermal DM support

Signed-off-by: Nikolay Dimitrov <picmaster@mail.bg>
Conflicts:
configs/riotboard_defconfig

8 years agoimx: riotboard, marsboard: Enable thermal support
Nikolay Dimitrov [Sun, 17 May 2015 23:10:45 +0000 (02:10 +0300)]
imx: riotboard, marsboard: Enable thermal support

Signed-off-by: Nikolay Dimitrov <picmaster@mail.bg>
8 years agohummingboard: Remove unused directory
Fabio Estevam [Fri, 15 May 2015 19:10:47 +0000 (16:10 -0300)]
hummingboard: Remove unused directory

The 'mx6-microsom' directory was only used for the previous mx6solo
hummingboard support, which has been removed in favour of the SPL
version.

Remove the remaining piece of the old mx6solo hummingboard support.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
8 years agoimx: ventana: add pmic_setup to SPL
Tim Harvey [Fri, 15 May 2015 16:18:31 +0000 (09:18 -0700)]
imx: ventana: add pmic_setup to SPL

We need to do any PMIC setup in the SPL if we are to bypass U-Boot for
falcon mode.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: (cosmetic) clean up size defines for improved readability
Tim Harvey [Fri, 15 May 2015 16:17:09 +0000 (09:17 -0700)]
imx: ventana: (cosmetic) clean up size defines for improved readability

Use the SZ_1M and SZ_1K macros from linuz/sizes.h for improved readability

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: config: use MMC SPL RAW support
Tim Harvey [Fri, 15 May 2015 16:14:49 +0000 (09:14 -0700)]
imx: ventana: config: use MMC SPL RAW support

Switch to MMC RAW support for SPL. We will place the uboot.img at 69KB.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoenv_nand: use nand_spl_load_image for readenv if SPL
Tim Harvey [Thu, 14 May 2015 18:48:04 +0000 (11:48 -0700)]
env_nand: use nand_spl_load_image for readenv if SPL

The readenv() implementation of env_nand uses the mtd layer which is
unnecessary overhead in SPL when we already have a nand_spl_load_image()
function that doesn't need it. Using this instead eliminates the need
to provide a mtd_read for SPL env as well as reduces code (4KB savings in IMX6
SPL).

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Scott Wood <scottwood@freescale.com>
8 years agoimx: ventana: use stack relocation
Tim Harvey [Thu, 14 May 2015 13:22:07 +0000 (06:22 -0700)]
imx: ventana: use stack relocation

Certain features we desire require a larger stack than is available by using
iRAM (most notably for us, env_mmc). Relocate the stack to DRAM so that
we can use these features.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoimx: ventana: add GSC boot watchdog disable to SPL
Tim Harvey [Sat, 9 May 2015 01:28:41 +0000 (18:28 -0700)]
imx: ventana: add GSC boot watchdog disable to SPL

If the SPL is to be used for Falcon mode then we need to make sure the SPL
disable the GSC boot watchdog.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: add gpio setup to SPL
Tim Harvey [Sat, 9 May 2015 01:28:39 +0000 (18:28 -0700)]
imx: ventana: add gpio setup to SPL

If the SPL is to be used for Falcon mode then we need to make sure it
configures basic GPIO (iomux, padconf, and default output levels).

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: use common uart and i2c setup functions in SPL
Tim Harvey [Sat, 9 May 2015 01:28:38 +0000 (18:28 -0700)]
imx: ventana: use common uart and i2c setup functions in SPL

Now that uart and i2c setup functions have been moved to common.c we can
use these and remove code duplication.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: detect pmic using i2c probe instead of board model
Tim Harvey [Sat, 9 May 2015 01:28:37 +0000 (18:28 -0700)]
imx: ventana: detect pmic using i2c probe instead of board model

Avoid requiring board-model and probe pmic by its i2c address.
This is in preparation for being able to call pmic_setup() from SPL
and not need board type.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: move GSC boot watchdog disable function to gsc.c
Tim Harvey [Sat, 9 May 2015 01:28:36 +0000 (18:28 -0700)]
imx: ventana: move GSC boot watchdog disable function to gsc.c

Move the code that disables the GSC boot watchdog into gsc.c

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: split out common functions between SPL and uboot
Tim Harvey [Sat, 9 May 2015 01:28:35 +0000 (18:28 -0700)]
imx: ventana: split out common functions between SPL and uboot

Move shared functions used by both SPL and U-Boot to common.c:
 - setup_iomux_uart() and uart pad config
 - gpio pad config

In the process also moved the following to common.c in preparation for
calling it from the SPL:
 - split i2c setup into a shared function
 - move pmic init to setup_pmic() function to call directly from
   power_init_board()
 - split gpio setup into early (iomux and default pin config)
   and late (output configuration based on env)

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: default msata/pci mux to pci before PCI enumeration
Tim Harvey [Sat, 9 May 2015 01:28:34 +0000 (18:28 -0700)]
imx: ventana: default msata/pci mux to pci before PCI enumeration

PCI enumeration occurs early, before we fully configure our GPIO's. Make
sure we steer the MSATA/PCI mux to PCI in board_init to ensure PCI is
selected before enumeration.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: fix pcie reset for GW522x
Tim Harvey [Sat, 9 May 2015 01:28:33 +0000 (18:28 -0700)]
imx: ventana: fix pcie reset for GW522x

The re-assignment of pcie_rst gpio for GW522x needs to occur earlier, before
the PCI subsystem calls the toggle funciton.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: config: enable Thermal support
Tim Harvey [Sat, 9 May 2015 01:28:30 +0000 (18:28 -0700)]
imx: ventana: config: enable Thermal support

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: enable DM_SERIAL
Tim Harvey [Sat, 9 May 2015 01:28:29 +0000 (18:28 -0700)]
imx: ventana: enable DM_SERIAL

mxc_serial supports DM so lets use it.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: register gpio's with gpio_request
Tim Harvey [Sat, 9 May 2015 01:28:28 +0000 (18:28 -0700)]
imx: ventana: register gpio's with gpio_request

Prior to using a gpio a call to gpio_request() should be called to register
it with the gpio subsystem.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: config: enable driver model
Tim Harvey [Sat, 9 May 2015 01:28:27 +0000 (18:28 -0700)]
imx: ventana: config: enable driver model

Enable U-Boot Driver Model (DM).

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: config: enable gpio command
Tim Harvey [Sat, 9 May 2015 01:28:26 +0000 (18:28 -0700)]
imx: ventana: config: enable gpio command

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: display SPL boot device
Tim Harvey [Sat, 9 May 2015 01:28:25 +0000 (18:28 -0700)]
imx: ventana: display SPL boot device

Display what device the SPL will fetch uboot.img from

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoimx: ventana: set dtype env var to boot media
Tim Harvey [Sat, 9 May 2015 01:28:24 +0000 (18:28 -0700)]
imx: ventana: set dtype env var to boot media

Bootscripts for some distro's such as Android can benefit from knowing
what boot media its script was loaded from.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years agoarm: mx6: ddr3: Remove dead code
Nikolay Dimitrov [Fri, 8 May 2015 10:06:50 +0000 (13:06 +0300)]
arm: mx6: ddr3: Remove dead code

imx6 mmdc supports data rates up to 1066 MT/s, so remove the code handling
higher data rates.

Signed-off-by: Nikolay Dimitrov <picmaster@mail.bg>
8 years agoi2c, mxc: rework i2c base address names for different SoCs
Heiko Schocher [Wed, 13 May 2015 05:53:20 +0000 (07:53 +0200)]
i2c, mxc: rework i2c base address names for different SoCs

rework and unify i2c address names for different SoCs, which
use the mxc_i2c driver.

Signed-off-by: Heiko Schocher <hs@denx.de>
8 years agoarm, imx6, i2c: add I2C4 for MX6DL
Heiko Schocher [Wed, 13 May 2015 05:50:47 +0000 (07:50 +0200)]
arm, imx6, i2c: add I2C4 for MX6DL

add I2C4 modul for MX6DL based boards.

Signed-off-by: Heiko Schocher <hs@denx.de>