Commit Graph

6071 Commits

Author SHA1 Message Date
Paul Kocialkowski
95de9ab201 mmc: Board-specific MMC power initializations
Some devices may use non-standard combinations of regulators to power MMC:
this allows these devices to provide a board-specific MMC power init function
to set everything up in their own way.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@ti.com>
2014-12-04 11:04:40 -05:00
Felipe Balbi
d11ac4b56d arm: omap: add support for am57xx devices
just add a few ifdefs around because this
device is very similar to dra7xxx.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Tom Rini <trini@ti.com>
2014-12-04 11:04:14 -05:00
Felipe Balbi
7a294c5c0a usb: phy: omap_usb_phy: fix build breakage
there's no such function usb3_phy_power(),
it's likely that author meant to call,
usb_phy_power() instead, but that's already
called properly from xhci-omap.c.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Tom Rini <trini@ti.com>
2014-12-04 11:04:13 -05:00
Tom Rini
88342103cc Merge git://git.denx.de/u-boot-fdt 2014-12-01 15:24:26 -05:00
Tom Rini
f4e7e2d121 Merge git://git.denx.de/u-boot-x86 2014-12-01 15:24:07 -05:00
Soeren Moch
dd1c8f1b5f sata: fix reset_sata for dwc_ahsata
- fix crash when sata device is not initialized
- remove disable_sata_clock() since it is not clear which clock for which
  device should be disabled here
- call disable_sata_clock() for mx6 in preboot_os instead

Signed-off-by: Soeren Moch <smoch@web.de>
Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
Tested-by: Nikita Kiryanov <nikita@compulab.co.il>
2014-12-01 10:20:19 +01:00
Fabio Estevam
a847fff11c mxc_ocotp: Do not disable the OCOTP clock after every access
Leave the OCOTP turned on, so that we subsequent access do not fail.

After enabling the thermal driver on a mx6sxsabresd board:

U-Boot 2015.01-rc1-18267-g99d4189-dirty (Nov 24 2014 - 12:59:01)

CPU:   Freescale i.MX6SX rev1.0 at 792 MHz
CPU:   Temperature 48 C
Reset cause: POR
Board: MX6SX SABRE SDB
I2C:   ready
DRAM:  1 GiB
PMIC:  PFUZE100 ID=0x10
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
  00:01.0     - 16c3:abcd - Bridge device
   01:00.0    - 8086:08b1 - Network controller
In:    serial
Out:   serial
Err:   serial
Net:
(hang)

As the thermal driver accesses the ocotp registers, its clock will be disabled
afterwards.

Then when the MAC address is read (also from ocotp registers) it will cause a
hang.

Do not disable the ocotp clock to prevent this problem.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2014-12-01 10:20:19 +01:00
Fabio Estevam
7267c925b3 thermal: imx_thermal: Do not display calibration data
Printing the calibration data on every boot does not provide really useful
information:

U-Boot 2015.01-rc1-18266-ge7eb277 (Nov 24 2014 - 11:29:51)

CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
CPU:   Thermal calibration data: 0x5d85067d
CPU:   Temperature 33 C
Reset cause: POR
Board: MX6-SabreSD

Do not display the calibration data in order to have a cleaner boot log.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-12-01 10:20:18 +01:00
Hector Palacios
3d99fcbc15 mxs_ocotp: clear the error flag before initiating write operation
A previous operation may have set the error flag, which must be cleared
before a new write operation can be issued.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2014-12-01 10:19:42 +01:00
Hector Palacios
ad5dd7ae4b mxs_ocotp: check for errors from the OTP controller after writing
The write operation may fail when trying to write to a locked area. In
this case the ERROR bit is set in the CTRL register. Check for that
condition and return an error.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-12-01 10:19:41 +01:00
Hector Palacios
d8d160e420 mxs_ocotp: prevent error path from returning success
The code may goto 'fail' upon error with 'ret' variable set to an error
code, but this variable was being overwritten by a final preparation
function to restore the HCLK, so success was (in general) returned even
after an error was hit previously.

With this change, the function may now return success even if the final
preparation function fails, but it's probably enough to print a message
because (if successful) the real programming of the fuses has already
completed.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2014-12-01 10:19:41 +01:00
Tom Rini
e17e998d7f Merge branch 'master' of git://git.denx.de/u-boot-uniphier 2014-11-27 13:10:04 -05:00
Masahiro Yamada
149c751dc7 usb: UniPhier: support OF configuration
If CONFIG_OF_CONTROL is defined, search device tree nodes that are
compatible with "panasonic,uniphier-ehci" and take the base address
from their "reg" property.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Marek Vasut <marex@denx.de>
2014-11-28 02:21:01 +09:00
Masahiro Yamada
625177d27e serial: UniPhier: support OF configuration
This commit implements the ofdata_to_platdata handler for the UniPhier
serial driver and adds serial device nodes to the device tree sources.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-28 02:21:01 +09:00
Masahiro Yamada
0bd4e39d2b fdt: remove fdtdec_get_alias_node() function
The fdt_path_offset() checks an alias too.

fdtdec_get_alias_node(blob, "foo") is equivalent to
fdt_path_offset(blob, "foo").

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-27 09:12:30 -07:00
Marek Vasut
b19157bf3f mtd: nand: s3c: Unify the register definition and naming
Merge struct s3c2410_nand and struct s3c2440_nand into one unified
struct s3c24x0_nand. While at it, fix up and rename the functions
to retrieve the NAND base address and fix up the s3c NAND driver to
reflect this change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Vladimir Zapolskiy <vz@mleia.com>
2014-11-26 23:21:43 -06:00
Sanchayan Maity
2260457341 mtd/nand/vf610_nfc: Disable subpage writes
This patch disables subpage writes for vf610_nfc nand
driver. This is required, as without this fix, writing
unaligned u-boot images with DFU results in a hang.
Trying to write unalgined binary images also results
in a hang, without disabling subpage writes.

Patch has been tested on a Colibri VF61 module.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2014-11-26 19:53:49 -06:00
Masahiro Yamada
f09eb52b3f mtd: denali: set some registers after nand_scan_ident()
Some but not all of implementations of the Denali NAND controller
have hardware circuits to detect the device parameters such as
page_size, erase_size, etc.  Even on those SoCs with such hardware
supported, the hardware is known to detect wrong parameters for some
nasty (almost buggy) NAND devices.  The device parameters detected
during nand_scan_ident() are more trustworthy.

This commit sets some hardware registers to mtd->pagesize,
mtd->oobsize, etc. in the code between nand_scan_ident() and
nand_scan_tail().

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Chin Liang See <clsee@altera.com>
2014-11-26 19:53:22 -06:00
Masahiro Yamada
65e4145a20 mtd: denali: use CONFIG_SYS_NAND_SELF_INIT
Some variants of the Denali NAND controller need some registers
set up based on the device information that has been detected during
nand_scan_ident().

CONFIG_SYS_NAND_SELF_INIT has to be defined to insert code between
nand_scan_ident() and nand_scan_tail().  It is also helpful to reduce
the difference between this driver and its Linux counterpart because
this driver was ported from Linux.  Moreover, doc/README.nand recommends
to use CONFIG_SYS_NAND_SELF_INIT.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Chin Liang See <clsee@altera.com>
2014-11-26 19:53:19 -06:00
Rostislav Lisovy
35c204d8a9 nand: reinstate lazy bad block scanning
Commit ff94bc40af
("mtd, ubi, ubifs: resync with Linux-3.14")
accidentally reverted part of the commit
13f0fd94e3
("NAND: Scan bad blocks lazily.").

Reinstate the change as by commit
fb49454b1b
("nand: reinstate lazy bad block scanning")

Signed-off-by: Rostislav Lisovy <lisovy@merica.cz>
Acked-by: Heiko Schocher <hs@denx.de>
2014-11-26 19:51:51 -06:00
Tom Rini
85bafb6da4 Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq 2014-11-26 11:23:26 -05:00
Tom Rini
21008ad638 Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
Conflicts:
	drivers/mmc/fsl_esdhc.c

Signed-off-by: Tom Rini <trini@ti.com>
2014-11-26 11:22:29 -05:00
Tom Rini
878cd63e02 Merge branch 'master' of http://git.denx.de/u-boot-samsung 2014-11-26 11:21:16 -05:00
Simon Glass
8c6ec412b4 bios_emulator: Always print errors when opcode decode fails
This is a rare event and should not happen. When it does it is confusing to
work out why. At least we should print a message.

Adjust the emulator to always print decode errors to the console.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-25 07:11:17 -07:00
Simon Glass
b3521f2e49 bios_emulator: Add an option to enable debugging
At present there are DEBUG options spread around the place. If you enable
one and not another you can end up with an emulator that does not work,
since each file can have a different view of what the registers look like.
To fix this, create a global CONFIG_X86EMU_DEBUG option that keeps
everything consistent.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-25 07:11:17 -07:00
Simon Glass
a3c700ec76 bios_emulator: Allow a custom interrupt handler to be installed
Sometime we want to provide an interrupt handler for the ROM, Add a
function to allow this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-25 07:11:17 -07:00
Simon Glass
4c59f95327 bios_emulator: Add vesa support and allow ROMs to be passed in as data
As well as locating the ROM on the PCI bus, allow the ROM to be supplied to
the emulator. Split the init up a little so that callers can supply their
own interrupt routines. Also allow a vesa mode to be provided, to be
selected once the BIOS run is complete.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-25 07:11:17 -07:00
Simon Glass
ad6edca379 bios_emulator: Allow x86 to use the emulator
There is an implicit assumption that x86 machines want to use raw I/O in the
BIOS emulator, but this should be selectable. Add an CONFIG_X86EMU_RAW_IO
option to control it instead.

Also fix a few bugs which cause warnings on x86 and adjust the Makefile to
remove the assumption that only PowerPC uses the emulator.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-25 07:11:16 -07:00
Simon Glass
998110241b x86: video: Add video driver for bare x86 boards
Add a very simple driver which uses vesa to discover the video mode and
then provides a frame buffer for use by U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
2014-11-25 07:11:16 -07:00
Simon Glass
6854f87cbc pci: Add general support for execution of video ROMs
Some platforms don't have native code for dealing with their video
hardware. In some cases they use a binary blob to set it up and perform
required actions like setting the video mode. This approach is a hangover
from the old PC days where a ROM was provided and executed during startup.

Even now, these ROMs are supplied as a way to set up video. It avoids the
code for every video chip needing to be provided in the boot loader. But
it makes the video much less flexible - e.g. it is not possible to do
anything else while the video init is happening (including waiting hundreds
of milliseconds for display panels to start up).

In any case, to deal with this sad state of affairs, provide an API for
execution of x86 video ROMs, either natively or through emulation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-25 07:11:14 -07:00
Simon Glass
176bf4ce0c Introduce a header file for the BIOS emulator
We should have a public header so that users can avoid defining functions
themselves.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-25 06:34:14 -07:00
Simon Glass
e8a552eb62 pci: Add functions to read and write a BAR address
Some PCI functions cannot be auto-configured. Add a function to set up a
fixed BAR which can be used in these situations. Also add a function to read
the current address of a BAR.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-11-25 06:34:00 -07:00
Simon Glass
c6577f7219 rtc: mc146818: Set up RTC at start of day
Provide a function to set up the RTC ready for use.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-11-25 06:33:59 -07:00
Luc Verhaegen
2d7a084ba0 sunxi: video: Add simplefb support
Add simplefb support, note this depends on the kernel having support for
the clocks property which has recently been added to the simplefb devicetree
binding.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
[hdegoede@redhat.com: Use pre-populated simplefb node under /chosen as
 disussed on the devicetree list]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>.
2014-11-25 13:38:46 +01:00
Hans de Goede
211717a463 sunxi: video: Add sun6i support
Besided needing the usual sun6i specific ahb1_reset bits poking, it turns out
that sun6i also needs the drc to be taken out of reset and clocked even though
it is in pass-through mode.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
2014-11-25 13:38:46 +01:00
Luc Verhaegen
7f2c521f90 sunxi: video: Add cfb console driver for sunxi
This adds a fixed mode hdmi driver for the sunxi platform. The fixed
mode is a relatively safe 1024x768, more complete EDID handling is
currently not provided. Only HDMI is supported today.

This code is enabled when HPD detects an attached monitor.

Current config is such that 8MB is shaved off at the top of the RAM.
This avoids several memory handling issues, most significant is the fact
that on linux on ARM you are not allowed to remap known RAM as IO. A
clued in display driver will be able to recycle this reserved RAM in
future though.

cfbconsole was chosen as it provides the most important functionality: a
working u-boot console, allowing for the debugging of certain issues
without the need for a UART.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
[hdegoede@redhat.com: Major cleanups and some small bugfixes]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2014-11-25 13:38:46 +01:00
Nikhil Badola
f3dff695e1 drivers : usb: fsl: Implement usb Erratum A007798 workaround
Set TXFIFOTHRESH to adjust ddr pipeline delay for successful large
usb writes

Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
2014-11-24 09:27:04 -08:00
Tom Rini
dee332ffb7 Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2014-11-24 12:02:12 -05:00
Tom Rini
1739564e75 Merge git://git.denx.de/u-boot-dm
Conflicts:
	drivers/serial/serial-uclass.c

Signed-off-by: Tom Rini <trini@ti.com>
2014-11-24 12:01:48 -05:00
Tom Rini
746667f1e5 Merge git://git.denx.de/u-boot-x86
Conflicts:
	arch/x86/cpu/Makefile

Signed-off-by: Tom Rini <trini@ti.com>
2014-11-24 12:00:00 -05:00
Nikita Kiryanov
10ee8ecafb sata: implement reset_sata for dwc_ahsata
Add reset_sata() to the sata driver interface and implement it
for dwc_ahsata. This function cleans up after sata_init(), and
therefore accepts a device number like sata_init() does.
A dummy implementation is provided for the rest of the drivers.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
2014-11-24 11:59:59 +01:00
Suriyan Ramasami
d455d8789d fs: API changes enabling extra parameter to return size of type loff_t
The sandbox/ext4/fat/generic fs commands do not gracefully deal with files
greater than 2GB. Negative values are returned in such cases.

To handle this, the fs functions have been modified to take an additional
parameter of type "* loff_t" which is then populated. The return value
of the fs functions are used only for error conditions.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Update board/gdsys/p1022/controlcenterd-id.c,
drivers/fpga/zynqpl.c for changes]
Signed-off-by: Tom Rini <trini@ti.com>
2014-11-23 06:49:04 -05:00
Thierry Reding
4efe52bf23 pci: Honour pci_skip_dev()
When enumerating devices, honour the pci_skip_dev() function. This can
be used by PCI controller drivers to restrict which devices will be
probed.

This is required by the NVIDIA Tegra PCIe controller driver, which will
fail with a data abort exception if an access is attempted to a device
number larger than 0 outside of bus 0. pci_skip_dev() is therefore
implemented to prevent any such accesses.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-23 06:49:01 -05:00
li pengbo
1b51d32c0f sata: fix a bug in init_sata() for pci-sata card
Except the first loop, init_sata() should return 0 instead of 1
in the others.

This patch fix the issue of the 2nd sata port not workable on pci-sata card.

Signed-off-by: Pengbo Li <Pengbo.Li@freescale.com>
2014-11-23 06:49:01 -05:00
Masahiro Yamada
b41411954d linux/kernel.h: sync min, max, min3, max3 macros with Linux
U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does.  This commit gets min, max, min3, max3
macros synced with the kernel introducing type checks.

Many of references of those macros must be fixed to suppress warnings.
We have two options:
 - Use min, max, min3, max3 only when the arguments have the same type
   (or add casts to the arguments)
 - Use min_t/max_t instead with the appropriate type for the first
   argument

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Pavel Machek <pavel@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
[trini: Fixup arch/blackfin/lib/string.c]
Signed-off-by: Tom Rini <trini@ti.com>
2014-11-23 06:48:30 -05:00
Masahiro Yamada
17b28edb37 dm: core: remove unnecessary return condition in uclass lookup
These conditions never happen.
 - There is no real uclass with UCLASS_INVALID id.
 - uclass never becomes NULL because ll_entry_start() always returns
   a valid pointer.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-22 10:16:49 +01:00
Masahiro Yamada
f724e0bba2 dm: core: remove unnecessary return condition in driver lookup
The variable "drv" never becomes NULL because ll_entry_start()
always returns a valid pointer even if there are no entries.

The case "n_ents == 0" is covered by the following "for" loop.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-22 10:16:49 +01:00
Masahiro Yamada
84a7153733 dm: core: remove meaningless if conditional
If the variable "ret" is equal to "-ENOENT", it is trapped at [1] and
never reaches [2].  At [3], the condition "ret != -ENOENT" is always
true.

  if (ret == -ENOENT) {                       <------------------ [1]
          continue;
  } else if (ret == -ENODEV) {
          dm_dbg("Device '%s' has no compatible string\n", name);
          break;
  } else if (ret) {                           <------------------ [2]
          dm_warn("Device tree error at offset %d\n", offset);
          if (!result || ret != -ENOENT)      <------------------ [3]
                  result = ret;
          break;
  }

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-22 10:16:48 +01:00
Masahiro Yamada
cbf86d7198 dm: core: a trivial clean up
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-22 10:16:48 +01:00
Simon Glass
d11e8fd86e cros_ec: Fix uninitialised variable in cros_ec.c
This fixes this cppcheck report:

[drivers/misc/cros_ec.c:704]: (error) Uninitialized variable: req

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Wolfgang Denk <wd@denx.de>
2014-11-22 10:16:48 +01:00
Simon Glass
6b18656aff dm: spi: Use device_bind_driver() instead of our own function
The SPI function does the same thing, so we may as well just use the new
generic function. The 'cs' parameter was not actually used, so can be
dropped.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
2014-11-22 10:16:48 +01:00
Simon Glass
ff56bba2d6 dm: spi: Correct handling of SPI chip selects in sandbox
This code was not updated when the chip select handling was adjusted. Fix
it to call the correct function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
2014-11-22 10:16:47 +01:00
Simon Glass
e33dc221f4 dm: Add a function to bind a device by driver name
In some cases we need to manually bind a device to a particular driver.
Add a function to do this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
2014-11-22 10:16:47 +01:00
Simon Glass
479728cb0c dm: core: Add functions to find parent and OF data
Add dev_get_parent() as a convenience to obtain the parent of a device.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
2014-11-22 10:16:47 +01:00
Simon Glass
2ef249b442 dm: core: Allow access to the device's driver_id data
When the device is created from a device tree node, it matches a compatible
string. Allow access to that string and the associated data.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
2014-11-22 10:16:45 +01:00
Nikhil Badola
c26c80a1a4 drivers: usb: fsl: Move USB Errata checking code
Move USB Errata checking code from "arch/powerpc" to architecture independent
file "fsl_usb.h" so that errata(s) become independent of the architecture.
For each erratum checking function for PPC arch, define a nop function for
non PPC arch for successful compilation in either case

Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
2014-11-21 09:28:28 -08:00
Ye.Li
e3568d2eca DM: thermal: Add imx thermal DM driver
Add a new thermal uclass for thermal sensor and implement the imx
thermal driver basing on this uclass.

Signed-off-by: Ye.Li <B37916@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2014-11-21 15:30:01 +01:00
Simon Glass
bc0b28427a dm: tegra: Add platform data for the SPL uart
Since we currently don't have device tree available in SPL, add platform
data so the uart works.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 08:14:02 +01:00
Simon Glass
236f2bd302 dm: Allow stdio registration to be dropped
Provide a CONFIG_DM_STDIO option to enable registering a serial device
with the stdio library. This is seldom useful in SPL, so disable it by
default when building for SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 08:13:14 +01:00
Simon Glass
3ac435d33a dm: Allow device removal features to be dropped
For SPL we don't expect to need to remove a device. Save some code space
by dropping this feature. The board config can define
CONFIG_DM_DEVICE_REMOVE if this is in fact needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 08:13:02 +01:00
Simon Glass
ad1b81c880 dm: serial: Support changing the baud rate
Implement this feature in the uclass so that the baudrate can be changed
with 'setenv baudrate <rate>'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 08:10:16 +01:00
Simon Glass
0f65f48b64 dm: at91: Add driver model support for the serial driver
Add driver model support 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: Simon Glass <sjg@chromium.org>
2014-11-21 08:09:58 +01:00
Simon Glass
62137fc0ab dm: at91: Refactor serial driver slightly for driver model
Before adding driver model support, split out a few of the functions so
that they can be used by the driver model code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-11-21 08:09:55 +01:00
Simon Glass
918354b18e dm: at91: Add driver model support for atmel GPIO driver
Modify this driver to support driver model, with platform data required to
determine the GPIOs that it controls.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 08:08:19 +01:00
Simon Glass
1b4f25ff8e x86: ivybridge: Add support for early GPIO init
When not relying on Coreboot for GPIO init the GPIOs must be set up
correctly. This is currently done statically through a rather ugly method.
As the GPIOs are figured out they can be moved to the device tree and set
up as needed rather than all at the start.

In this implementation, board files should call ich_gpio_set_gpio_map()
before the GPIO driver is used in order to provide the GPIO information.
We use the early PCI interface so that this driver can now be used before
relocation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 07:34:14 +01:00
Simon Glass
e5901c94e3 dm: gpio: Add a function to read an ID from a list of GPIOs
For board IDs a common approach is to set aside several GPIOs for use in
determining the board ID. This can provide information about board features
and the revision.

Add a function that turns a list of GPIOs into an integer by assigning
each GPIO to a single bit.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 07:24:11 +01:00
Simon Glass
469a579df2 dm: serial: Move current serial port pointer to global_data
In general we can't store things in the data section until we have inited
SDRAM. Some platforms allow this (e.g. those with SPL) but some don't. Move
the pointer to global_data so that it will work on all platforms.

Without this fix the serial port will not work prior to relocation with
driver model on some platforms.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 07:24:11 +01:00
Masahiro Yamada
cba1da495d include: move various macros to include/linux/kernel.h
U-Boot has imported various utility macros from Linux
scattering them to various places without consistency.

In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN,
container_of, DIV_ROUND_UP, etc.
In include/linux/compat.h are min_t, max_t, round_up, round_down,
etc.
We also have duplicated defines of min_t in some *.c files.

Moreover, we are suffering from too cluttered include/common.h.

This commit moves various macros that originate in
include/linux/kernel.h of Linux to their original position.

Note:
This commit simply moves the macros; the macros roundup,
min, max, min2, max3, ARRAY_SIZE are different
from those of Linux at this point.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
4515992fc7 replace DIV_ROUND with DIV_ROUND_CLOSEST
The Linux-compatible macro DIV_ROUND_CLOSEST is a bit more flexible
and safer than DIV_ROUND.

For example,
  foo = DIV_ROUND_CLOSEST(x, y++)
works expectedly, but
  foo = DIV_ROUND(x, y++)
does not. (y is incremented twice.)

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
f2168440de ARM: remove CONFIG_ARM920T defines
CONFIG_CPU_ARM920T was introduced into Kconfig by commit 2e07c249a6
(kconfig: arm: introduce symbol for ARM CPUs).

This commit removes all the defines of CONFIG_ARM920T and replaces the
only reference in drivers/usb/host/ohci-hcd.c with CONFIG_CPU_ARM920T.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Ye.Li
a3d6e38617 mmc: fsl_esdhc: Update esdhc driver for iMX6SX
The reset value of "uSDHCx_INT_STATUS_EN" register is changed to 0
on iMX6SX. So the fsl_esdhc driver must update to set the register,
otherwise no state can be detected.

Signed-off-by: Ye.Li <B37916@freescale.com>
2014-11-20 10:44:42 +01:00
Tom Rini
4d70b34d7f Merge branch 'master' of git://git.denx.de/u-boot-ubi 2014-11-19 23:18:29 -05:00
Tom Rini
c44d3cd1c4 Merge branch 'master' of git://git.denx.de/u-boot-i2c 2014-11-19 23:18:19 -05:00
Markus Niebel
3b4b9a3377 mmc: fsl_esdhc: fix f_max retrieval during init
for multi instance API we use struct fsl_esdhc_cfg to
pass the clock rate. Do not set f_max from global data,
since this is wrong for multi instance case.

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Tested-by: Eric Nelson <eric.nelson@boundarydevices.com>
Reviewed-by: York Sun <yorksun@freescale.com>
2014-11-19 18:17:12 -08:00
Shengzhou Liu
c35f869394 net/fm: add 2.5G SGMII support
As auto-negotiation is not supported for 2.5G SGMII, we need
to add a new type PHY_INTERFACE_MODE_SGMII_2500 to differentiate
SGMII-1G and SGMII-2.5G with different setting for auto-negotiation.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
2014-11-19 18:17:12 -08:00
Masahiro Yamada
0c6de8853b usb: ehci: do not set the LSB of Current qTD pointer
According to EHCI specification, the LSB of DWORD 3 of Queue Head
(Current qTD Pointer) is not T-bit, but always zero.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-19 23:31:54 +01:00
Zhao Qiang
5632d15cf4 u_qe: add u_qe_upload_firmware for u_qe
Signed-off-by: Zhao Qiang <B45475@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
2014-11-19 12:56:19 -08:00
Zhao Qiang
93d3320417 qe: add u-qe support to arm board
ls1021 is arm-core and support qe which is u-qe.
add u-qe init for arm board.

Signed-off-by: Zhao Qiang <B45475@freescale.com>
[York Sun: Fix compiling error caused by u_qe_init()]
Reviewed-by: York Sun <yorksun@freescale.com>
2014-11-19 12:55:45 -08:00
Dirk Eibach
f3c89d9228 mtd: Handle 29LV800BT
The device id makes u-boot think that this chip needs
cfi_reverse_geometry(), which is not the case.
Add it to jedec_flash, so it is handled properly.

Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
2014-11-19 08:48:41 +01:00
Heiko Schocher
65e5cb54d0 mtd, cfi, ubi: add missing writebufsize initialization
ff94bc40af "mtd, ubi, ubifs: resync with Linux-3.14"
introduced the writebufsize field in struct mtd_info, which
is not initialized in the cfi_flash driver, which leads in
not working ubi on cfi flashes. Fix it

Signed-off-by: Heiko Schocher <hs@denx.de>
Reported-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
2014-11-19 07:54:04 +01:00
Bo Shen
cabf61ce4b net: macb: enable GMAC IP without GE feature support
The User Register in GMAC IP is used to select interface type.
When with GE feature, it is used to select interface between
RGMII and GMII. If without GE feature, it is used to select
interface between MII and RMII.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-11-17 08:47:18 -05:00
Josh Wu
7df4486d04 mtd: atmel_nand: runtime to build gf table for pmecc
As in SAMA5D4 SoC, the gf table in ROM code can not be seen.
So, when we try to use PMECC, we need to build it when do
initialization.
Add a macro NO_GALOIS_TABLE_IN_ROM in soc header file. If it
is defined we will build gf table runtime.

The PMECC use the BCH algorithm, so based on the build_gf_tables()
function in lib/bch.c, we can build the Galois Field lookup table.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-11-17 08:47:18 -05:00
Heiko Schocher
667af36905 spl, mtd, nand, atmel_nand: invert device ready pin logic
device ready pin is signalling that the device is ready on state 1
not on 0. Simmiliar as it is in drivers/mtd/nand/nand_spl_simple.c

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Reviewed-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-11-17 08:47:17 -05:00
Heiko Schocher
4dfd360589 spl, nand, atmel_nand: add erase one block function
erase one nand block in spl code. keep it simple, as size matters
This is used on the upcoming taurus spl support.

Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Scott Wood <scottwood@freescale.com>
Reviewed-by: Bo Shen <voice.shen@atmel.com>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-11-17 08:47:17 -05:00
Heiko Schocher
c1ec406282 mtd: atmel_nand: add missing include
using this driver in SPL code with CONFIG_SPL_NAND_ECC
configured leads in an compileerror. Fix this.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Reviewed-by: Bo Shen <voice.shen@atmel.com>
[fix subject]
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-11-17 08:47:17 -05:00
Heiko Schocher
f11dea4f3d spi, atmel: move CONFIG_SYS_SPI_WRITE_TOUT into common header
move CONFIG_SYS_SPI_WRITE_TOUT into drivers/spi/atmel_spi.h
and define a default value. Delete this define in the board
config files, where it is possible (all boards use currently
the same value).

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-11-17 08:47:16 -05:00
Bo Shen
b2eff08869 net: macb: write mac address when initialization
When boot up without mac address setting, it will give the warning
message like: "Warning: failed to set MAC address", however when
execute network related command, it still execute them without any
warning information.

With this patch, it will exit directly with following information:
"gmac0: mac address is not valid"

It also solve the problem after bootup then set mac address and the
mac address won't set to net device issue.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-11-17 08:47:15 -05:00
Tom Rini
bdf790fabc Merge branch 'master' of git://git.denx.de/u-boot-sh 2014-11-17 08:43:40 -05:00
Suriyan Ramasami
6a23c6533c arm: odroid: usb: add support for usb host including ethernet
This change adds support for enabling the USB host features of the board.
This includes the USB3503A hub and the SMC LAN9730 ethernet controller
as well.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2014-11-17 19:33:22 +09:00
Suriyan Ramasami
7e46be8aed arm: odroid: pmic77686: allow buck voltage settings
Allow to set the buck voltage for the max77686.
This will be used to reset the SMC LAN9730 ethernet on the odroids.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2014-11-17 19:33:21 +09:00
Scott Jiang
c469703ba0 blackfin: convert to use CONFIG_SYS_I2C framework
Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
2014-11-17 08:10:37 +01:00
Scott Jiang
a6be70f7ec adi_i2c: convert to use general io accessors.
Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
2014-11-17 08:10:15 +01:00
Scott Jiang
fea9b69acd blackfin: rename bfin-twi_i2c driver to adi_i2c
Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
2014-11-17 08:10:04 +01:00
Tom Rini
2086e388d5 Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx 2014-11-14 16:39:32 -05:00
Lukasz Majewski
5610b05789 dfu: thor: fix: Modify dfu_get_alt() function to support absolute paths
Recently the ext4 file system imposed passing absolute path with its file
name parameter.
As a result dfu_alt_info env variable has been modified to provide absolute
path when ext4 file system is accessed (e.g. /uImage ext4 0 2;).

Unfortunately, lthor flashing program provides plain file name (like uImage)
and hence those two file names do not match anymore.

Presented commit also allows lthor to write files to sub directories (like
/boot/bin/uImage).

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2014-11-14 21:09:06 +01:00
Tom Rini
6393c43c18 Merge branch 'master' of git://git.denx.de/u-boot-video 2014-11-14 15:05:53 -05:00
Peng Fan
229dbba9b1 usb:ehci-mx6 add phy mode query function
usb_phy_enable should return status bit, but not phy mode bit, thus
add a new function usb_phy_mode to query the PHY for it's mode and
make usb_phy_enable just return 0 but not 'phy_ctrl & USBPHY_CTRL_OTG_ID'.

Include a new board weak function board_usb_phy_mode. If board code
does not reimplement this function, it just call usb_phy_mode and return
usb_phy_mode's return value. The reason to include such a weak function
is: " SOC OTG core <--connect--> board HOST port, but no pin id for
the board host port, so board can not use usb_phy_mode to return the
phy mode, but define it's own rule."

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Signed-off-by: Ye Li <B37916@freescale.com>
2014-11-14 20:56:54 +01:00
Shaohui Xie
ae6b458306 driver/net/fm/memac_phy: set NEG bit for external MDIOs
NEG bit default is '1' for external MDIOs as per FMAN-v3 RM, but on some
platforms, e.g. T2080QDS, this bit is '0', which leads to MDIO failure
on XAUI PHY, so set this bit definitely to align with the RM.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: York Sun <yorksun@freescale.com>
2014-11-14 11:12:13 -08:00
Shaohui Xie
ff5fb2a36d Fman/mEMAC: mEMAC fix for 10G MAC and PHY
1. use Payload length check disable when enable MAC;
2. add XGMII support for setting MAC interface mode;
3. only enable auto negotiation for Non-XGMII mode;
4. return 0xffff if clause 22 is used to read 10G phy_id;

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Acked-By: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: York Sun <yorksun@freescale.com>
2014-11-14 11:12:13 -08:00
Tom Rini
0d485b9095 Merge branch 'master' of git://git.denx.de/u-boot-sunxi 2014-11-13 10:35:13 -05:00
Hans de Goede
76946dfe69 sun6i: ehci: Add sun6i ehci support
Add support for the 2 ehci controllers found on the sun6i (A31) soc.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Acked-by: Marek Vasut <marex@denx.de>
2014-11-13 14:49:02 +01:00
Hans de Goede
115200ceb0 sunxi: ehci: Add proper Kconfig options to select the usb Vbus gpio-s
Add proper Kconfig options to select the usb Vbus gpio-s, besides moving to
Kconfig being the right thing to do, an added advantage of this is that it
allows for boards without Vbus gpio-s.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2014-11-13 14:49:02 +01:00
Oliver Schinagl
5c7f10fda3 sun6i: Add basic axp221 driver
The A31 uses the AXP221 pmic for various voltages.

Signed-off-by: Oliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
--
Changes in v2:
-Rebase
Changes in v3:
-Add support for all dldo and aldo-s
-Add Kconfig option to select building AXP221 and to select voltage of
 dldo and aldo-s
Changes in v4:
-Add axp221_setbits helper function
-Use symbolic names for enabled bits in CTRL1 - CTRL3 registers
2014-11-13 14:49:01 +01:00
Masahiro Yamada
7d2366627e sh: move CONFIG_{SH2, SH2A, SH3, SH4} to Kconfig
This commit moves CONFIG_SH2, CONFIG_SH2A, CONFIG_SH3, CONFIG_SH4
to Kconfig renaming into CONFIG_CPU_SH2, CONFIG_CPU_SH2A,
CONFIG_CPU_SH3, CONFIG_CPU_SH4, respectively because
arch/sh/Kconfig of Linux uses CONFIG_CPU_SH* convention.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2014-11-13 08:47:58 +09:00
Tom Rini
6841deb620 Merge branch 'master' of git://git.denx.de/u-boot-usb 2014-11-11 16:59:25 -05:00
Masahiro Yamada
048899ba8c usb: UniPhier: add UniPhier on-chip EHCI host driver support
Support EHCI host driver used on Panasonic UniPhier platform.
Since Device Tree is not supported on UniPhier yet, the base address
of USB cores are passed from board files (platdevice.c).

TODO for me:
Move the base address to device trees.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Marek Vasut <marex@denx.de>
2014-11-12 00:21:28 +09:00
Masahiro Yamada
6e7e9294d3 usb: add basic USB configs in Kconfig
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Marek Vasut <marex@denx.de>
2014-11-12 00:21:18 +09:00
Masahiro Yamada
325b708a61 serial: UniPhier: borrow macros from linux/serial_reg.h
The same bit-field macros are defined in include/linux/serial_reg.h
so let's include it and delete duplicated defines.

Also, remove unnecessary inclusion of <common.h>.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-12 00:14:30 +09:00
Tom Rini
1e4b45c8f7 Merge branch 'master' of git://git.denx.de/u-boot-i2c 2014-11-10 16:25:29 -05:00
Nobuhiro Iwamatsu
cd818a381d i2c: rcar_i2c: Fix order of restart and clear status
In case of repeated START condition, the restart has to be kicked
before clear status (MSR register). If it is kicked after clear status,
R-Car I2C may transfer data (TXD register) or receive data (RXD register)
instead of transferring slave address (MAR register).

Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2014-11-10 06:47:37 +01:00
Shaveta Leekha
6dd38cc352 drivers/i2c/fsl_i2c: Change CONFIG_I2C_TIMEOUT to 100ms
Some slow I2C devices like Power Monitor(ZM7304) at times
do not work well with low timeout value, so I2C bus get stuck
during read cycle with this device, changing it to 100ms from
10ms works fine

A lot of other i2c drivers like mxc and i2c drivers of BOOTROM
also use relax timeouts to give sufficient ticks to work well
with slower devices

Signed-off-by: Shaveta Leekha <shaveta@freescale.com>
Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
2014-11-10 06:47:36 +01:00
Dirk Eibach
b97cd6814e ppc4xx: Handle i2c stuck on combined xfer
ppc4xx i2c master gets stuck on errors while repeated start is
active. Can be easily reproduced by "i2c md" on an unpopulated
i2c address. There is not stop condition given, scl remains
pulled low.
The only way out seems to be doing a stop manually and then a
soft reset.

Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
2014-11-10 06:44:30 +01:00
Dirk Eibach
7e78f7ad7f ppc4xx: Fix i2c repeated start
Debugging some i2c trouble I saw on my scope that repeated
start is not working properply. The 4xx even held clock pulled down
after transfers. Having a look in the driver I realized
that IIC_CNTL_RPST is set on that part of the transfer that should
begin with a repeated start. But repeated start is about not sending a
stop condition, so IIC_CNTL_RPST has to be set on the last transfer
before the repeated start happens.

Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
2014-11-10 06:44:15 +01:00
Wolfgang Denk
1779dc0fe4 drivers/net/uli526x.c: fix syntax error
Fix error detected by cppcheck:

[drivers/net/uli526x.c:551]: (error) printf format string requires 3
parameters but only 2 are given.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Roy Zang <tie-fei.zang@freescale.com>
2014-11-07 16:27:07 -05:00
Tom Rini
5b471dee99 power_spi.c: Rewrite pmic_reg function
The pmic_spi_free function isn't ever used, and as the frameworks stand
today, cannot be, so remove it.  Integrate the probe function into
pmic_reg as it's not really a "probe" today.  Finally, add an err label
for the common failure cases.

Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2014-11-07 16:27:05 -05:00
Marek Vasut
99dd6ab405 net: smc911x: Keep MAC programmed
Make sure to keep the MAC address programmed in the SMC911x ADDRH
and ADDRL registers. Linux can read those registers to determine
the MAC address on EEPROM-less configurations.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Tom Rini <trini@ti.com>
2014-11-07 16:27:04 -05:00
Pavel Machek
389b89c70f sort drivers/mmc/Makefile
Sort drivers/mmc makefile, as requested by wd.

Signed-off-by: Pavel Machek <pavel@denx.de>
Acked-by: Chin Liang See <clsee@altera.com>
2014-11-07 16:27:04 -05:00
Tom Rini
cfa1bd0774 Merge git://git.denx.de/u-boot-ti 2014-11-07 16:18:35 -05:00
Rene Griessl
3908f16f85 usb: eth: fix Makefile
fix obj-y term

Signed-off-by: Rene Griessl <rgriessl@cit-ec.uni-bielefeld.de>
2014-11-07 22:03:44 +01:00
Nobuhiro Iwamatsu
865ed5eae4 usb: rmobile: Use ARRAY_SIZE(usb_base_address) instead of CONFIG_USB_MAX_CONTROLLER_COUNT
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
CC: Marek Vasut <marex@denx.de>
2014-11-07 16:32:02 +01:00
Masahiro Yamada
c02bf4582f usb: ehci: fix Interrupt on Doorbell flag of USBCMD
CMD_IAAD (Interrupt on Async Advance Doorbell) is bit 6, not bit 5.
While we are here, sort the flags.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-07 16:32:02 +01:00
Marek Vasut
481a11c552 usb: s3c-otg: Allow custom gusbcfg
Allow passing in a custom configuration of the gusbcfg register
via platform data.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Vince Bridgers <vbridger@altera.com>
Acked-by: Pavel Machek <pavel@denx.de>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-07 16:32:02 +01:00
Marek Vasut
d1b6c77e1f usb: s3c-otg: Split out PHY control
Split the Samsung specific PHY control into a separate file
and compile this into the S3C OTG driver only if used on a
Samsung system.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Vince Bridgers <vbridger@altera.com>
Acked-by: Pavel Machek <pavel@denx.de>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-07 16:32:02 +01:00
Marek Vasut
40ff06b958 usb: s3c-otg: Encapsulate PHY control
Encapsulate the Samsung PHY control and its register accesses
into the otg_phy_init() and otg_phy_off() functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Vince Bridgers <vbridger@altera.com>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-06 21:05:54 +01:00
Marek Vasut
2cc157b0cd usb: s3c-otg: Remove useless include
Remove the useless inclusion of arch/arm/gpio.h , which is completely
bogus in this driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Vince Bridgers <vbridger@altera.com>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-06 21:04:20 +01:00
Igor Grinberg
0b03a931ab omap: hsmmc: assume cd gpio is active low
Switch the default CD GPIO polarity to active low.

The current hsmmc driver assumption that the CD GPIO is active high, but
in the real hardware, usually the opposite holds.
The usual SD card socket has a mechanical switch which is grounded as
soon as a card is inserted.
Of course there might be some board logic which inverts the signal, but
as far as current users are concerned, there is no such logic.

Current U-Boot users either not using the CD functionality, or have a
different way (e.g. external to SoC GPIO controller) for checking the
card presence.

This patch also brings the polarity assumption in line with the Linux
kernel and adds appropriate comments.

This patch also might spare issues once the TWL GPIO driver will be
converted to the DM.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Dmitry Lifshitz <lifshitz@compulab.co.il>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-06 11:04:41 -05:00
Khoronzhuk, Ivan
75d7c0b04c dma: keystone_nav: remove spurious qm_cfg verification
The verification qm_cfg existence is done at ksnav_init().
So, there is no need to verify it after initialization.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-06 11:04:39 -05:00
Hao Zhang
35fa0dda0c net: phy: marvell: add errata w/a for 88E151* chips
As per Marvell Release Notes - Alaska 88E1510/88E1518/88E1512/88E1514
Rev A0, Errata Section 3.1 Marvell PHY has an errata which requires
that certain registers get written in order to restart
autonegotiation.

Signed-off-by: Hao Zhang <hzhang@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2014-11-06 11:04:38 -05:00
Khoronzhuk, Ivan
6c0fb41a0a net: keystone_net: add Keystone2 K2L SoC support
The Keystone2 Lamar SoC uses the same keystone net driver.
This patch adds opportunity to use it by K2L SoCs.

Acked-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-11-05 13:09:42 -05:00
Khoronzhuk, Ivan
87ac27bd5b net: keystone_serdes: add keystone K2L SoC support
Keystone2 Lamar SoC uses the same keystone SerDes driver.
All Keystone2 EVM boards currently use SerDes driver, so move
CONFIG_TI_KEYSTONE_SERDES to common configuration file.

Acked-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-11-05 13:09:42 -05:00
Tom Rini
625509ab0e Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2014-11-05 12:48:09 -05:00
Tom Rini
d5325eff10 Merge git://www.denx.de/git/u-boot-sunxi 2014-11-05 07:23:32 -05:00
Hans de Goede
44fd5914fb dm: sunxi: Request USB vbus gpio
This is necessary for the device-model enabled builds to work properly.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-05 13:10:22 +01:00
Hans de Goede
967325feb2 dm: sunxi: Request card detect gpio
This is necessary for the device-model enabled builds to work properly.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-05 13:10:13 +01:00
Simon Glass
1a81cf8399 dm: sunxi: Add support for serial using driver model
Add a driver for the designware serial UART used on sunxi. This just
redirects to the normal ns16550 driver.

Add a stdout-path to the device tree so that the correct UART is chosen.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-05 13:09:58 +01:00
Simon Glass
7aa9748584 dm: sunxi: Modify the GPIO driver to support driver model
This adds driver model support to the sunxi GPIO driver, using the device
tree to trigger binding of the driver. The driver will still operate
without driver model too.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-05 13:09:58 +01:00
Ian Campbell
ed41e62f51 sunxi: Use CONFIG_MACH_SUN?I from Kconfig instead of CONFIG_SUN?I
Mostly automatic with:
    sed -i -e 's/CONFIG_\(SUN[45678]I\)/CONFIG_MACH_\1/g' $(git grep -l CONFIG_SUN[45678]I)
followed by removing the relevant #defines from include/configs/sun?i.h by
hand.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-05 13:09:58 +01:00
Tom Rini
2dbbda08b9 Merge git://git.denx.de/u-boot-sh 2014-11-04 18:24:44 -05:00
Jeroen Hofstee
94a255dfbb serial: add prototypes for init functions
While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-11-04 15:01:11 -05:00
Jeroen Hofstee
13a8b7ae71 i2c: use __weak
Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-11-04 15:00:55 -05:00
Tom Rini
0798082442 Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging 2014-11-04 10:46:45 -05:00
Nobuhiro Iwamatsu
4dc949266d usb: ehci: rmobile: Collect up address data
R8A7791, R8A7793 and R8A7794 have same IP of USB controller.
This collect up address data of each SoCs.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2014-11-04 06:04:01 +01:00
Nobuhiro Iwamatsu
a3058c08d9 usb: ehci: rmobile: Add support R8A7793
R8A7793 has same IP of USB controller as R8A7791 and R8A7794 of rmobile
ARM SoCs. This adds support R8A7793 to EHCI HCD of rmobile.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2014-11-04 06:04:01 +01:00
Hans de Goede
8460b89a6d usb: Make pollable int support available outside of ehci-hcd.c
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:04:00 +01:00
Hans de Goede
8aa26b8e48 usb: ehci: Move cache invalidation to poll_int_queue
Preperation patch to use poll_int_queue outside of ehci-hcd.c .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:04:00 +01:00
Hans de Goede
bd818d81d8 usb: ehci: Move interrupt packet length check to create_int_queue
Preperation patch to use create_int_queue outside of ehci-hcd.c .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:04:00 +01:00
Hans de Goede
32f2eac1e0 usb: ehci: Do not disable an already disabled periodic schedule
When periodic_schedules == 0, the schedule is disabled and there is no reason
to disable it again.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:04:00 +01:00
Nobuhiro Iwamatsu
f7ca1f76fd net: sh-eth: Add cache writeback control after setting bit of DMA descriptor
A bit field of DMA descriptor is on memory area of DMA. If we set data
to bit of DMA descriptor, we must be writeback data of DMA descriptor.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2014-11-04 09:28:47 +09:00
Nobuhiro Iwamatsu
000889cdb9 net: sh-eth: Use memalign instead of orignal memroy alignment function
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2014-11-04 09:27:40 +09:00
Nobuhiro Iwamatsu
703949e495 net: sh-eth: Remove definition of RX_DESC_SIZE and TX_DESC_SIZE
RX_DESC_SIZE and TX_DESC_SIZE mean the size of the data descriptor for sh-eth.
We can acquire this in sizeof. It is not necessary to define these in define.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2014-11-04 09:26:57 +09:00
Nobuhiro Iwamatsu
a3cc41b42d serial: sh: r8a7794: Add support external clock
The baud rate setting of external clock is enabled.

Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2014-11-04 09:26:09 +09:00
Nobuhiro Iwamatsu
a341b7e0dd net: sh-eth: Add support R8A7793
R8A7793 has the same sh-ether IP core as other SH/rmobile.
This patch adds support of R8A7793.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2014-11-04 09:25:38 +09:00
Nobuhiro Iwamatsu
04dba864c3 serial: sh: Add support R8A7793
This adds the preset value to register for R8A7793.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2014-11-04 09:25:16 +09:00
Tom Rini
a8b972bfa8 Merge branch 'master' of git://git.denx.de/u-boot-uniphier 2014-11-03 12:43:42 -05:00
Tom Rini
130aec779a Merge branch 'master' of git://git.denx.de/u-boot-spi 2014-11-03 12:42:58 -05:00
Paul Kocialkowski
2ed8c878eb twl4030: VMMC2 3.2V enable on MMC init
This enables the VMMC2 LDO, which powers the MMC2 device.
When the device starts from MMC2, this has already been enabled by the BootROM,
but when starting from peripheral boot (USB, UART), it is not the case.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-10-31 00:29:39 +01:00
Soeren Moch
d37e96ecb9 video: speedup writing strings to fb console
With enabled framebuffer console the printenv command can take several
seconds to complete. This patch temporarily disables cache flush when
writing strings to fb console. Then there is no noticable delay anymore.

Tested with imx6 hdmi framebuffer.

Signed-off-by: Soeren Moch <smoch@web.de>
Acked-by: Stefano Babic <sbabic@denx.de>
2014-10-30 21:45:25 +01:00
Marek Vasut
f9cfe17b3d mtd: nand: mxs: Add ECC geometry for 2048b/112b NAND
Add ECC geometry for NAND which has 2048b pagesize and 112b OOB
size. This is for example Macronix MX30LF2G28AB chip.

Signed-off-by: Marek Vasut <marex@denx.de>
2014-10-30 11:02:23 +01:00
Masahiro Yamada
d9bc8fd1cb serial: UniPhier: add static to locally used functions
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-10-29 22:53:42 +09:00
Masahiro Yamada
bb72148b2b serial: UniPhier: add .pending handler
Without .pending handler, tstc() function always returns 1.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-10-29 22:53:42 +09:00
Stefan Roese
678398b19e i2c: designware: Convert driver to multibus/multiadapter framework
In preparation for the SoCFPGA support of the designware I2C driver,
convert this driver to the common CONFIG_SYS_I2C framework.

This patch converts all users of this driver, this is:

- ST spearxxx boards
- AXS101 (ARC700 platform)

I couldn't test this patch on those boards. Only compile tested for all
spear boards. And tested on SoCFPGA.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Tested-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Vipin Kumar <vk.vipin@gmail.com>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-29 08:56:23 +01:00
Marek Vasut
318a9cea49 i2c: mxs: Add support for I2C 1 on i.MX28
Add support for I2C bus 1 on the i.MX28.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Heiko Schocher <hs@denx.de>
2014-10-29 08:56:07 +01:00
Marek Vasut
58a7d1c12c i2c: mxs: Pass the i2c_adapter around
This patch permeates the struct i2c_adapter throughout the driver,
so that it can be used to determine which adapter should be used.
Note that the driver still supports only one adapter. Note that
the patch does shuffle mxs_i2c_set_bus_speed() to the top of the
driver, but the function remains unchanged.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Heiko Schocher <hs@denx.de>
2014-10-29 08:55:58 +01:00
Marek Vasut
1fa96e80ec i2c: mxs: Add basic support for i2c framework
This patch just converts the function prototypes used throughout
this driver to match those of the i2c framework. There is so far
no functional change. This patch does not do the deeper integration
of the framework bits.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Heiko Schocher <hs@denx.de>
2014-10-29 08:55:46 +01:00
Marek Vasut
9536099d50 i2c: mxs: Consolidate hard-coded bus address
This patch prepares the MXS I2C driver for the conversion to the
new I2C driver framework by pulling out the hard-coded I2C0 address
from all the places.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Heiko Schocher <hs@denx.de>
2014-10-29 08:55:37 +01:00
Nikita Kiryanov
0029d6c1de dwc_ahsata: use bitwise operator in sata_port_status
The logic of the return statement in sata_port_status() calls for a
bitwise 'AND' operator, not logical 'AND'. Fix the typo.

Reported-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
2014-10-28 12:39:59 -04:00
Tom Rini
93575c30ac Merge git://git.denx.de/u-boot-dm 2014-10-28 12:39:26 -04:00
Marcel Ziswiler
6c499abe05 e1000: add i211 and unprogrammed i210/i211 support
This patch adds support for i211 as well as unprogrammed aka tools only
i210/i211 chip support.

Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
2014-10-28 07:13:56 -04:00
Przemyslaw Marczak
3f3c13a513 mmc: s5p: set SD detection pin as input
The SD Card slot detection pin should be configured as input.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-10-27 19:20:51 -06:00
Marcel Ziswiler
17da712024 e1000: fix sw fw sync on igb i210/i211
I finally had a look at the datasheet and spotted an additional
register address difference between regular E1000 and i210/i211 chips.
This patch fixes this and now successfully works on programmed
i210/i211 as well as unprogrammed i211.

Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
2014-10-27 17:54:10 -04:00
York Sun
76f8cdb203 net/e1000: Fix EEPROM access error
Commit 951860634f may have changed
the logic unintentially from "if (!(swfw_sync & (fwmask | swmask)))"
to "if ((swfw_sync & swmask) && !(swfw_sync & fwmask))". This change
breaks some e1000 NIC with a message "ERROR: Unable to read EEPROM!".

Signed-off-by: York Sun <yorksun@freescale.com>
CC: Marek Vasut <marex@denx.de>
CC: Tim Harvey <tharvey@gateworks.com>
Acked-by: Marcel Ziswiler <marcel@ziswiler.com>
2014-10-27 17:54:09 -04:00
Markus Niebel
027a9a0024 SPI: mxc_spi: delay initialisation until claim bus
it is not correct to init for a specific slave in spi_setup_slave.
instead buffer the values and delay init until spi_claim_bus.

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2014-10-27 22:37:03 +05:30
Markus Niebel
ba3451d3d8 SPI: mxc_spi: remove second reset from ECSPI config handler
the second reset prevents other registers to be written.
This will prevent to have the correct signal levels for
SCLK before writing to the config reg in spi_xchg_single.

Tested with GPIO based chipselect and SPI_MODE_3 on i.MX6S

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2014-10-27 22:37:03 +05:30
Marek Vasut
cdcdad851f spi: altera: Move the config options to the top
Just move the configuration options scattered all over the driver
to the top of the source file. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2014-10-27 22:37:03 +05:30
Marek Vasut
bc76b821f0 spi: altera: Clean up the use of variable d
The variable d is used in rather questionable way. Rework the code
a bit so it's clearer what it does. Also, rename the variable from
d to data to make it's name less mysterious. Finally, change it's
data type to uint32_t , since it's accessed as a 32bit number.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2014-10-27 22:37:03 +05:30
Marek Vasut
80d7333808 spi: altera: Zap endless loop
The driver contained an endless loop when waiting for TX completion,
this is a bad idea since if the hardware fails, the loop might spin
forever. Add timeout and handle it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2014-10-27 22:37:03 +05:30
Marek Vasut
37dcc130e0 spi: altera: Clean up most checkpatch issues
This patch just zaps most of the checkpatch cries present in the
driver. There is one more left, which will be addressed separately.
There is no functional change.

This patch also adds a bunch of newlines all around the place, this
is to make the code much more readable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2014-10-27 22:37:03 +05:30
Marek Vasut
2e13da13a9 spi: altera: Clean up bit definitions
Clean up the definitions of bits in the Altera SPI driver, there
is no need to put braces around numbers afterall. No functional
change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2014-10-27 22:37:02 +05:30
Marek Vasut
eef67029d6 spi: altera: Use struct-based register access
Zap the offset-based register access and use the struct-based one
as this is the preferred method.

No functional change, but there are some line-over-80 problems in
the driver, which will be addressed later.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2014-10-27 22:37:02 +05:30
Tom Rini
0cf8761549 Merge branch 'master' of git://git.denx.de/u-boot-mpc5xxx 2014-10-27 11:03:00 -04:00
Wolfgang Denk
03b004074f PowerPC: drop some 74xx_7xx boards and related code
The file  board/Marvell/include/mv_gen_reg.h  is incompatible with
the GPL (see for example the "MARVELL RESERVES THE RIGHT AT ITS SOLE
DISCRETION TO REQUEST THAT THIS CODE BE IMMEDIATELY RETURNED TO
MARVELL" clause).  As this cannot be fixed, we remove the file and all
code that depends on it.  Fortunately this only affects some very old
boards that have long reached EOL:
	CPCI750
	DB64360
	DB64460
	p3m750
	p3m7448

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Roger Meier <r.meier@siemens.com>
2014-10-27 14:35:55 +01:00
Tom Rini
0ce4af99c0 Merge branch 'master' of git://git.denx.de/u-boot-imx 2014-10-27 09:08:42 -04:00
Tom Rini
5aa7bece10 Merge branch 'master' of git://git.denx.de/u-boot-ti 2014-10-27 09:05:43 -04:00
Tom Rini
d0796defbe Merge http://git.denx.de/u-boot-sunxi 2014-10-26 14:13:24 -04:00
Tom Rini
1fba907f9a Merge branch 'master' of git://git.denx.de/u-boot-usb 2014-10-26 14:12:18 -04:00
Tom Rini
84a6df09c7 Merge git://git.denx.de/u-boot-dm
Fix a trivial conflict over adding <dm.h>

Conflicts:
	arch/arm/cpu/armv7/omap3/board.c

Signed-off-by: Tom Rini <trini@ti.com>
2014-10-26 14:03:08 -04:00
Jeroen Hofstee
c69ecd9722 i2c: designware: add an implement i2c protos
Include the i2c header and change the non confirming
functions to do so.

Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Acked-by: Heiko Schocher <hs@denx.de>
[trini: Fix i2c_get_bus_num prototype]
Signed-off-by: Tom Rini <trini@ti.com>
2014-10-25 15:27:37 -04:00
Jeroen Hofstee
ee3fad8769 net: davince: add missing include
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 15:27:35 -04:00
Jeroen Hofstee
74321944e6 mmc: bcm2835_sdhci: add missing include
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 15:27:35 -04:00
Jeroen Hofstee
c5fe2532ac video: ipu: prevent warnings with W=1
- make local functions static
- remove unused is_interlaced function

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:27:37 -04:00
Jeroen Hofstee
19d7bf3d86 tegra: make local functions static
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:27:37 -04:00
Jeroen Hofstee
654f8d0f3d serial: make local functions static
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:02:02 -04:00
Jeroen Hofstee
6588c78bf3 sdhci: make local functions static
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:02:02 -04:00
Jeroen Hofstee
441529795c omap_gpmc: fix warnigs with W=1
- make omap_spl_dev_ready static
- make omap_reverse_list static, move to under CONFIG_NAND_OMAP_ELM

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Signed-off-by: Tom Rini <trini@ti.com>
2014-10-25 07:02:02 -04:00
Jeroen Hofstee
84f64c8bbe net: fec_mxc: make local functions static
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:02:02 -04:00
Jeroen Hofstee
2115d89db8 gpio: make local functions static
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:02:01 -04:00
Jeroen Hofstee
2d17b48911 ehci-hcd.c: make local functions static
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:02:00 -04:00
Jeroen Hofstee
69d2754588 video: use __weak
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:02:00 -04:00
Jeroen Hofstee
3dd80aae3a usb: use __weak
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:02:00 -04:00
Jeroen Hofstee
7b19fd6d9f pci: use __weak
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:01:59 -04:00
Jeroen Hofstee
3c6928fd7b net: phy: fix warnings with W=1
get_phy_id is marked weak but has no protype nor a
strong version, just make it static. Use __weak for
board_phy_config.

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-10-25 07:01:59 -04:00
Jeroen Hofstee
00dcb07c54 cti_flash.c: use __weak when requested for flash_(read|write){8,16,32,64}
For various reasons (design, errata) boards may need to implement their
own versions of these accessors.  So in the case of
CONFIG_CFI_FLASH_USE_WEAK_ACCESSOR mark the functions as weak.  In the
normal case mark them as static to allow for better optimization.

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
[trini: Reword commit message]
Signed-off-by: Tom Rini <trini@ti.com>
2014-10-25 06:58:51 -04:00
Chen-Yu Tsai
e637b30b9c mmc: sunxi: Add support for sun8i (A23)
The Allwinner A23 SoC has reset controls like the A31 (sun6i).
The FIFO address is also the same as sun6i.

Re-use code added for sun6i.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2014-10-24 09:35:39 +02:00
Hans de Goede
e79c7c8810 sunxi: When we've both mmc0 and mmc2, detect from which one we're booting
sunxi SOCs can boot from both mmc0 and mmc2, detect from which one we're
booting, and make that one "mmc dev 0" so that a single u-boot binary can
be used for both the onboard eMMC and for external sdcards.

When we're booting from mmc2, we make it dev 0 because that is where the SPL
will load the tertiary payload (the actual u-boot binary in our case) from,
see: common/spl/spl_mmc.c, which has dev 0 hardcoded everywhere.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2014-10-24 09:35:38 +02:00
Hans de Goede
cd82113a98 sunxi: Add mmc card-detect functionality
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2014-10-24 09:35:38 +02:00
Hans de Goede
1d1bd42eb0 ARM: sunxi-mmc: Add mmc support for sun6i / A31
The mmc hardware on sun6i has an extra reset control that needs to
be de-asserted prior to usage. Also the FIFO address is different.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[wens@csie.org: use setbits_le32 for reset control, drop obsolete changes,
		rewrite different FIFO address handling, add commit message]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2014-10-24 09:35:37 +02:00
Wills Wang
a3e8c22011 mmc: sunxi: add SDHC support for sun6i/sun7i/sun8i
Allwinner A20/A23/A31's SD/MMC host support SDHC High Capacity feature.

Signed-off-by: Wills Wang <wills.wang.open@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-10-24 09:35:37 +02:00
Masahiro Yamada
c2ded962d4 serial: remove uniphier_serial_initialize() call
The UniPhier serial driver has been converted to driver model.
Let's remove uniphier_serial_initialize() call from the old
serial driver framework.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-10-23 21:43:09 -06:00
Masahiro Yamada
ff247b7a0d serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-10-23 21:43:09 -06:00
Masahiro Yamada
d064cbffff dm: serial: use Driver Model for UniPhier serial driver
This commit converts UniPhier on-chip serial driver to driver model.

Since UniPhier SoCs do not have Device Tree support, some board files
should be added under arch/arm/cpu/armv7/uniphier/ph1-*/ directories.
(Device Tree support for UniPhier platform is still under way.)

Now the base address and master clock frequency are passed from
platform data, so CONFIG_SYS_UNIPHIER_SERIAL_BASE* and
CONFIG_SYS_UNIPHIER_UART_CLK should be removed.

Tested on UniPhier PH1-LD4 ref board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-10-23 21:43:09 -06:00
Masahiro Yamada
da333ae73c dm: add entries to Kconfig
Create entries of CONFIG_DM, CONFIG_DM_SERIAL, CONFIG_DM_GPIO
and CONFIG_DM_SPI.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-10-23 21:43:09 -06:00
Masahiro Yamada
eea5a4cc1b dm: serial: consolidate common code more
Commit b8893327e9 (dm: serial: Put common code into separate functions)
consolidated getc() and putc().  This commit does more puts() and tsts().

Also rename locally used functions to _serial_*() for clarification
because we have similar functions names here are there in this file.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-10-23 21:43:09 -06:00
Masahiro Yamada
52a0a6f0dc dm: serial: remove unnecessary casting
The type (void *) can be directly passed to a function that
takes a specific pointer type.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-10-23 21:43:08 -06:00
Masahiro Yamada
bac644675a dm: serial: fix console putc
Commit b8893327e9 (dm: serial: Put common code into separate functions)
consolidated getc() correctly, but introduced another bug to putc();
serial_stub_putc() passes sdev->priv to serial_putc_dev(), but
serial_putc_dev() uses cur_dev instead of the given argument.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-10-23 21:43:08 -06:00
Masahiro Yamada
3fdd0bb2b0 serial: add static directive to local functions
The functions _serial_putc, _serial_putc_raw, _serial_puts,
_serial_getc, _serial_tstc, _serial_setbrg are defined and used
locally in each of serial_ns16550.c and serial_s3c24x0.c.

Add static directive to them and remove declarations from
include/common.h.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-10-23 21:43:08 -06:00
Masahiro Yamada
86256b796e dm: move platform data headers to include/dm/platform_data
The platform_data definitions are generally referenced from both
drivers and board files.  That is why header files defining
platform_data sturectures are placed in "include" directory,
but our top level "include" directory is already too cluttered.

Let's collect platform_data definitions under the directory
"include/dm/platform_data" like Linux gathers ones around under
"include/linux/platform_data".

This commit moves two header files:

  include/serial_mxc.h -> include/dm/platform_data/serial_mxc.h
  include/serial_pl01x.h -> include/dm/platform_data/serial_pl01x.h

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-10-23 21:43:07 -06:00
Simon Glass
e98a03ca68 dm: x86: Convert coreboot serial to use driver model
This makes use of the existing device tree node to use driver model
for the serial console.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:45:45 -06:00
Simon Glass
7414112d70 dm: x86: Convert Intel ICH6 GPIO driver to use driver model
Convert over this driver, using device tree to pass in the required
information. The peripheral is still probed, just the number of GPIO banks
and their offsets is in the device tree (previously this was a table in
the driver).

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:45:28 -06:00
Simon Glass
1f77690e16 dm: serial: ns16550: Add a cast to the I/O operations
This generates a warning when driver model is enabled, so fix it by adding
a cast.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:45:28 -06:00
Simon Glass
c65dd445c9 dm: gpio: imx: Drop request()/free() in the driver
Now that the uclass supports gpio_request/free() there is no need for the
driver to implement it too. Drop this unnecessary code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:30:51 -06:00
Simon Glass
6227fb87c4 dm: gpio: exynos: Drop request()/free() in the driver
Now that the uclass supports gpio_request/free() there is no need for the
driver to implement it too. Drop this unnecessary code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:30:51 -06:00
Simon Glass
3dd2d48055 dm: gpio: rpi_b: Drop request()/free() in the driver
Now that the uclass supports gpio_request/free() there is no need for the
driver to implement it too. Drop this unnecessary code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:30:51 -06:00
Simon Glass
5aff3acdb7 dm: gpio: omap3: Drop request()/free() in the driver
Now that the uclass supports gpio_request/free() there is no need for the
driver to implement it too. Drop this unnecessary code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:30:50 -06:00
Simon Glass
57d99d368e dm: gpio: tegra: Drop request()/free() in the driver
Now that the uclass supports gpio_request/free() there is no need for the
driver to implement it too. Drop this unnecessary code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:29:53 -06:00
Simon Glass
d44f597b12 dm: gpio: Add gpio_requestf() helper for printf() strings
Add a helper which permits a printf()-style format string for the requester
string.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:29:52 -06:00
Simon Glass
5e0bbd61df dm: gpio: sandbox: Drop request()/free() in the driver
Now that the uclass supports gpio_request/free() there is no need for the
driver to implement it too. Drop this unnecessary code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:29:52 -06:00
Simon Glass
62cb89d5eb dm: gpio: sandbox: Implement the remove() method
This method frees memory so we must make sure to implement it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:29:52 -06:00
Simon Glass
699ea9606c dm: gpio: sandbox: Implement the get_function() method
Implement this method so that the 'gpio' command can do its job correctly.
For sandbox we only support input and output states for a gpio.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:29:52 -06:00
Simon Glass
0757535a7e dm: Move the function for getting GPIO status into the uclass
This function can be more easily tested if it is in the uclass.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:29:52 -06:00
Simon Glass
6449a506d6 dm: gpio: Add gpio_get_function() and friends
Add helpers to the uclass to allow finding out the pin function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:29:52 -06:00
Simon Glass
b892d127ff dm: gpio: Implement GPIO reservation in the uclass
We have several GPIO drivers now and all are doing similar things to record
which GPIOs are reserved.

Move this logic into the uclass to make the drivers similar.

We retain the request()/free() methods since currently one driver does use
these for setting up the pin.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-23 19:29:51 -06:00
Simon Glass
0bf249511f dm: omap: serial: Add driver model support
Add driver model support to this driver, while retaining support for the
legacy system. Driver model serial support is enabled with CONFIG_DM_SERIAL
as usual.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-10-23 19:29:07 -06:00
Simon Glass
5915a2ad0d dm: omap: gpio: Support driver model
Add driver model support to this driver, while retaining support for the
legacy system. Driver model GPIO support is enabled with CONFIG_DM_GPIO
as usual.

Since gpio_is_valid() no longer exists, we can use the -EINVAL error
returned from gpio_request().

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-10-23 19:29:07 -06:00
Simon Glass
d57b61143d dm: omap: gpio: Put _get_gpio_value() logic into its own function
Add a separate internal helper function to get a GPIO value, so that we
will be able to call it with the driver model version and avoid code
duplication.

Also move gpio_get_bank() and check_gpio() down below the helper functions
as these won't be needed with driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-10-23 19:29:07 -06:00
Simon Glass
91155c6560 dm: serial: Support CONFIG_CONS_INDEX if available
Try to use this option to select the correct uart for the console. This
mimics the behaviour of drivers/serial.c.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-10-23 19:29:07 -06:00
Simon Glass
11c1a87893 dm: ns16550: Correct the probe logic for platform data
The probe logic sets up the pointer to the platform data in the device
tree decode method. It should be done in the probe() method, and anyway
the device tree decode method can't be used when CONFIG_OF_CONTROL is
not enabled.

Fix these two problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-10-23 19:29:07 -06:00
Simon Glass
167efe01bc dm: ns16550: Use an address instead of a pointer for the uart base
It is inconvenient to have to use casts when specifying platform data. Also
it is not strictly correct, since we should use map_sysmem() to convert an
address to a pointer.

Adjust the platform data to use an address.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-10-23 19:29:07 -06:00
Simon Glass
aea2be2012 dm: serial: ns16550: Correct logic for checking for character
There is a bug in the logic which checks for an available character. This
can cause invalid characters to be received - this was noticed on
beaglebone. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-10-23 19:29:07 -06:00
Simon Glass
c487fd476c dm: serial: Reset the watchdog while waiting in getc()
We have moved the busy-wait loop out of drivers and into the uclass. This
means that we must reset the watchdog when busy-waiting.

Note: some drivers may still have a busy-wait even with driver model, as
a transition mechanism. Driver model will tolerate this, and is can be
cleaned up when all users of the driver use driver model. An example is
ns16550.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-10-23 19:29:07 -06:00
Simon Glass
fe1ef50338 dm: gpio: Support numbered GPIOs
At present banks must be named and it is not possible to refer to GPIOs by
number in driver model. Some boards use numbering - e.g. OMAP. It is fairly
easy to support by detecting the absense of a bank name (which starts with
a letter).

Add support for numbered GPIOs in addition to the existing bank support.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-10-23 19:29:07 -06:00
Tom Rini
03a3536c7b Merge branch 'master' of git://git.denx.de/u-boot-tegra 2014-10-23 14:05:34 -04:00
Khoronzhuk, Ivan
e165b1d34c dma: ti-edma3: introduce edma3 driver
The EDMA3 controller’s primary purpose is to service data transfers
that you program between two memory-mapped slave endpoints on the device.

Typical usage includes, but is not limited to the following:
- Servicing software-driven paging transfers (e.g., transfers from external
  memory, such as SDRAM to internal device memory, such as DSP L2 SRAM)
- Servicing event-driven peripherals, such as a serial port
- Performing sorting or sub-frame extraction of various data structures
- Offloading data transfers from the main device DSP(s)
- See the device-specific data manual for specific peripherals that are
  accessible via the EDMA3 controller

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-10-23 11:27:29 -04:00
Khoronzhuk, Ivan
c05d05e720 net: keystone_net: increase PHY auto negotiate time
The new Marvel PHY (88E1514) used on K2L/K2E EVM requires longer time
to auto negotiate with SoC's SGMII port.

It can take about 3 sec to up the PHY after reset, so add code to
expose sgmii auto negotiation waiting process.

Acked-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-10-23 11:27:29 -04:00
Khoronzhuk, Ivan
ff11c7697c net: keystone_net: add Keystone2 K2E SoC support
The Keystone2 Edison SoC uses the same keystone net driver.
This patch adds opportunity to use it by K2E SoCs.

Acked-by: Vitaly Andrianov <vitalya@ti.com>
Acked-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-10-23 11:27:29 -04:00
Khoronzhuk, Ivan
3c61502aad net: keystone_serdes: add keystone K2E SoC support
Keystone2 Edison SoC uses the same keystone SerDes driver.
This patch adds support for K2E SoCs.

Acked-by: Vitaly Andrianov <vitalya@ti.com>
Acked-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-10-23 11:27:29 -04:00
Khoronzhuk, Ivan
a4d2adee11 net: keystone_net: use general get link function
The phy framework has function to get link, so use it
instead of own implementation.

There is no reason to check SGMII link while sending each
packet, phy link is enough. Check SGMII link only while
ethernet open.

Acked-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-10-23 11:27:28 -04:00
Khoronzhuk, Ivan
3fe93623cc net: keystone_net: register eth PHYs on MDIO bus
As MDIO bus has been added we can register PHYs with it.
After registration, the PHY driver will be probed according to the
hardware on board.

Startup PHY at the ethernet open.

Use phy_startup() instead of keystone_get_link_status() when eth open,
as it verifies PHY link inside and SGMII link is checked before.

For K2HK evm PHY configuration at init was absent, so don't enable
phy config at init for k2hk evm.

Acked-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-10-23 11:27:28 -04:00
Khoronzhuk, Ivan
550c5ce6f5 net: keystone_net: register MDIO bus
Currently MDIO framework is not used to configure Ethernet PHY.
As result some of already implemented functions are duplicated.
So register MDIO bus in order to use it. On that stage it's just
registered, it'll be used as we start to use PHY framework.

Use mdio bus read/write/reset functions in the driver.

Acked-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-10-23 11:27:28 -04:00
Khoronzhuk, Ivan
1920e905ef net: keystone_net: use mdio_reset function
Don't use mdio_enable twice while eth open. Also rename it to
keystone2_mdio_reset as more appropriate name.

Acked-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-10-23 11:27:28 -04:00
Khoronzhuk, Ivan
adc9a79f3f net: phy: print a number of phy that is not found
In case when several Ethernet ports are supported it's
convenient to see the number of phy that is not found.

Acked-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
2014-10-23 11:27:28 -04:00