]> git.karo-electronics.de Git - karo-tx-uboot.git/log
karo-tx-uboot.git
9 years agomtd: vf610_nfc: add Freescale NFC controller configs to Kconfig
Stefan Agner [Fri, 8 May 2015 17:07:11 +0000 (19:07 +0200)]
mtd: vf610_nfc: add Freescale NFC controller configs to Kconfig

This commit allows users to enable/disable the Freescale NFC
controller found in systems like Vybrid (VF610), MPC5125, MCF54418
or Kinetis K70 via Kconfig with more detailed help docs.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Stefano Babic <sbabic@denx.de>
[scottwood: updated vf610twr_nand_defconfig]
Signed-off-by: Scott Wood <scottwood@freescale.com>
9 years agomtd: vf610_nfc: use in-band bad block table
Stefan Agner [Fri, 8 May 2015 17:07:10 +0000 (19:07 +0200)]
mtd: vf610_nfc: use in-band bad block table

Use in-band bad block table (NAND_BBT_NO_OOB) which allows to
use the full OOB for hardare ECC purposes. Since there is no
ECC correction on the OOB it is also safer to use in-band area
to store the bad block table marker.

Signed-off-by: Stefan Agner <stefan@agner.ch>
9 years agomtd: vf610_nfc: implement OOB only read
Stefan Agner [Fri, 8 May 2015 17:07:09 +0000 (19:07 +0200)]
mtd: vf610_nfc: implement OOB only read

Implement read of OOB area only. When using column and sector size
properties, only parts of the page can be read. However, this works
only when hardware ECC is disabled, otherwise the ECC engine would
ruin the data in the buffer. To allow OOB only reads, three points
had to be addressed:
- Set ECC mode per command.
- Handle NAND_CMD_READOOB seperate. Make sure column and sector
  size is correctly set up, while disabling ECC.
- Now, the OOB data end up at the beginning of the buffer. Remove
  the special handling of OOB (spareonly).

Especially bad block scans benefit from this change. On a 512MiB
SLC NAND device, the bad block scan took 1.5s less than before.

Signed-off-by: Stefan Agner <stefan@agner.ch>
9 years agomtd: vf610_nfc: allow bitflips in an empty page
Stefan Agner [Fri, 8 May 2015 17:07:08 +0000 (19:07 +0200)]
mtd: vf610_nfc: allow bitflips in an empty page

Allow bit flips in a empty page up to half of the recoverable
bits (strength / 2).

Signed-off-by: Stefan Agner <stefan@agner.ch>
9 years agomtd: vf610_nfc: remove read on SEQIN
Stefan Agner [Fri, 8 May 2015 17:07:07 +0000 (19:07 +0200)]
mtd: vf610_nfc: remove read on SEQIN

Since we do not support sub-page writes anyway, reading the page
back to the controller on SEQIN command is not required. Remove
the page read on SEQIN.

However, the column/page values relevant to the SEQIN command, hence
set the column/row address on SEQIN command.

Signed-off-by: Stefan Agner <stefan@agner.ch>
9 years agomtd: vf610_nfc: remove caching of page in buffer
Stefan Agner [Fri, 8 May 2015 17:07:06 +0000 (19:07 +0200)]
mtd: vf610_nfc: remove caching of page in buffer

To improve performance we remember the current page in the buffer
and avoid reading it twice. This implicit page cache increases
complexity while does not increase performance in real world cases.
This patch removes that feature.

Acked-by: Bill Pringlemeir <bpringlemeir@nbsps.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
9 years agotools: mxsboot: Calculate ECC strength dynamically
Jörg Krause [Wed, 15 Apr 2015 07:27:23 +0000 (09:27 +0200)]
tools: mxsboot: Calculate ECC strength dynamically

Calculating the ECC strength dynamically to be aligned with the mxs NAND
driver and the Linux Kernel.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Reviewed-by: Marek Vasut <marex@denx.de>
9 years agomtd: nand: mxs: Replace magic number for bits per ECC level with macro
Jörg Krause [Wed, 15 Apr 2015 07:27:22 +0000 (09:27 +0200)]
mtd: nand: mxs: Replace magic number for bits per ECC level with macro

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Reviewed-by: Marek Vasut <marex@denx.de>
9 years agomtd:mxs:nand calculate ecc strength dynamically
Peng Fan [Wed, 15 Apr 2015 07:27:21 +0000 (09:27 +0200)]
mtd:mxs:nand calculate ecc strength dynamically

Calculate ecc strength according oobsize, but not hardcoded
which is not aligned with kernel driver

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Signed-off-by: Ye.Li <b37916@freescale.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
9 years agonand/elbc: Memory leak fix
Raghav Dogra [Wed, 20 May 2015 09:24:58 +0000 (14:54 +0530)]
nand/elbc: Memory leak fix

Freeing allocated memory to priv before returning
from the function

Signed-off-by: Raghav Dogra <raghav@freescale.com>
[scottwood: removed unnecessary cast]
Signed-off-by: Scott Wood <scottwood@freescale.com>
9 years agonand: fix buffer alignment in new verification feature
Stephen Warren [Tue, 14 Apr 2015 14:59:00 +0000 (08:59 -0600)]
nand: fix buffer alignment in new verification feature

On systems with caches enabled, NAND I/O may need to flush/invalidate
the cache during read/write operations. For this to work correctly, all
buffers must be cache-aligned. Fix nand_verify*() to allocate aligned
buffers.

This prevents cache alignment warnings from being spewed when using
U-Boot to write an updated version of itself to flash on NVIDIA Tegra
Seaboard (after perturbation of stack/data layout in current
u-boot-dm/next branch).

I have validatd (executed) nand_verify(), but I don't think I've executed
nand_verify_page_oob(); testing of that would be useful.

Cc: Peter Tyser <ptyser@xes-inc.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Fixes: 59b5a2ad83df ("nand: Add verification functions")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Scott Wood <scottwood@freescale.com>
9 years agoimx: ventana: config: enable Falcon mode
Tim Harvey [Sat, 9 May 2015 01:28:42 +0000 (18:28 -0700)]
imx: ventana: config: enable Falcon mode

Falcon mode entails the SPL booting the OS directly instead of U-Boot.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
9 years agowandboard: Switch to SPL support
Fabio Estevam [Mon, 11 May 2015 23:50:22 +0000 (20:50 -0300)]
wandboard: Switch to SPL support

Currently we need to build one U-boot image for each of the wandboard
variants: quad, dual-lite and solo.

By switching to SPL we can support all these variants with a single binary,
which is very convenient.

Based on the work from Richard Hu.

Tested kernel booting on the three boards.

Signed-off-by: Richard Hu <hakahu@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Vagrant Cascadian <vagrant@aikidev.net>
Reviewed-by: Stefano Babic <sbabic@denx.de>
9 years agosandbox: Enable env unit tests
Joe Hershberger [Wed, 20 May 2015 19:27:39 +0000 (14:27 -0500)]
sandbox: Enable env unit tests

Enable the new env unit tests on sandbox.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agotest: env: Add a test of the new regex behavior for attrs
Joe Hershberger [Wed, 20 May 2015 19:27:38 +0000 (14:27 -0500)]
test: env: Add a test of the new regex behavior for attrs

The behavior of the env attrs depends on CONFIG_REGEX. Add an additional
test if that variable is set.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agotest: env: Add test for verifying env attrs
Joe Hershberger [Wed, 20 May 2015 19:27:37 +0000 (14:27 -0500)]
test: env: Add test for verifying env attrs

Add a test of the env_attr_lookup() function.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agotest: env: Add test framework for env
Joe Hershberger [Wed, 20 May 2015 19:27:36 +0000 (14:27 -0500)]
test: env: Add test framework for env

Add a new "env" subcommand to the ut command.

This will run unit tests on the env code. This should be targetable to
any device that supports the env features needed for the tests.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agotest: dm: Recover the driver model tree after tests
Joe Hershberger [Wed, 20 May 2015 19:27:35 +0000 (14:27 -0500)]
test: dm: Recover the driver model tree after tests

Put the driver model for the system back into a good state after
completing the DM testing.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agotest: Return values from the asserts compatible with cmds
Joe Hershberger [Wed, 20 May 2015 19:27:34 +0000 (14:27 -0500)]
test: Return values from the asserts compatible with cmds

The asserts are sometimes called from the context of the test command
itself so make sure that a return that happens as a result of a failure
is compatible with that command return. When called within a test, the
return value is ignored.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agotest: dm: eth: Handle failed test env cleanup
Joe Hershberger [Wed, 20 May 2015 19:27:33 +0000 (14:27 -0500)]
test: dm: eth: Handle failed test env cleanup

Make sure that the env gets cleaned up after a test fails so that other
tests aren't affected.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agotest: dm: Don't bail on all tests if one test fails
Joe Hershberger [Wed, 20 May 2015 19:27:32 +0000 (14:27 -0500)]
test: dm: Don't bail on all tests if one test fails

There's not much point in having a failure count if we always give up on
the first failure. Also stop clearing the entire state between tests.

Make sure that any failures are still passed out to the command line.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agotest: Move the unit tests to their own menu
Joe Hershberger [Wed, 20 May 2015 19:27:31 +0000 (14:27 -0500)]
test: Move the unit tests to their own menu

Make all unit tests selectable as a menu of test suites instead of just
sitting in the top-level menu individually.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agotest: dm: Move the time test over to the ut command
Joe Hershberger [Wed, 20 May 2015 19:27:30 +0000 (14:27 -0500)]
test: dm: Move the time test over to the ut command

Unify the command for running unit tests further by moving the "ut_time"
command over to "ut time".

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agotest: dm: Move the dm tests over to the ut command
Joe Hershberger [Wed, 20 May 2015 19:27:29 +0000 (14:27 -0500)]
test: dm: Move the dm tests over to the ut command

Unify the command for running unit tests further by moving the "dm test"
command over to "ut dm".

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agotest: Add a common unit test command
Joe Hershberger [Wed, 20 May 2015 19:27:28 +0000 (14:27 -0500)]
test: Add a common unit test command

Add a command that all other unit tests should be a sub-command of.
Also include a command that will run all tests.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agotest: Generalize the unit test framework
Joe Hershberger [Wed, 20 May 2015 19:27:27 +0000 (14:27 -0500)]
test: Generalize the unit test framework

Separate the ability to define tests and assert status of test functions
from the dm tests so they can be used more consistently throughout all
tests.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agonet: Handle ethaddr changes as an env callback
Joe Hershberger [Wed, 20 May 2015 19:27:26 +0000 (14:27 -0500)]
net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agonet: Remove duplicate bootfile syncing functionality
Joe Hershberger [Wed, 20 May 2015 19:27:25 +0000 (14:27 -0500)]
net: Remove duplicate bootfile syncing functionality

The bootfile env var is already kept up to date by the callback in net.c
so there is no need to poll it too.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agonet: Add default flags for common net env vars
Joe Hershberger [Wed, 20 May 2015 19:27:24 +0000 (14:27 -0500)]
net: Add default flags for common net env vars

Check that the common network stack's env vars conform to the proper
format for IP addresses.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agonet: Use env callbacks for net variables
Joe Hershberger [Wed, 20 May 2015 19:27:23 +0000 (14:27 -0500)]
net: Use env callbacks for net variables

Instead of checking for changes to the env each time we enter the
net_loop, use the env callbacks to update the values of the variables.
Don't update the variables when the source was programmatic, since the
variables were the source of the new value.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agonet: Apply default format rules to all ethaddr
Joe Hershberger [Wed, 20 May 2015 19:27:22 +0000 (14:27 -0500)]
net: Apply default format rules to all ethaddr

Use a regular expression to apply the default formatting flags for all
ethaddr env vars.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agoenv: Distinguish finer between source of env change
Joe Hershberger [Wed, 20 May 2015 19:27:21 +0000 (14:27 -0500)]
env: Distinguish finer between source of env change

We already could tell the difference in the callback between an import
and "other" which we called interactive. Now add further distinction
between interactive (i.e. running env set / env edit / env ask / etc.
from the U-Boot command line) and programmatic (i.e. when u-boot source
calls any variant of setenv() ).

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agoenv: Add regex support to env_attrs
Joe Hershberger [Wed, 20 May 2015 19:27:20 +0000 (14:27 -0500)]
env: Add regex support to env_attrs

Allow the features that use env_attrs to specify regexs for the name

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agoenv: Allow env_attr_walk to pass a priv * to callback
Joe Hershberger [Wed, 20 May 2015 19:27:19 +0000 (14:27 -0500)]
env: Allow env_attr_walk to pass a priv * to callback

In some cases it can be helpful to have context in the callback about
the calling situation. This is needed for following patches.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agoenv: Simplify the reverse_strstr() interface
Joe Hershberger [Wed, 20 May 2015 19:27:18 +0000 (14:27 -0500)]
env: Simplify the reverse_strstr() interface

The logic to find the whole matching name was split needlessly between
the reverse_strstr function and its caller. Fully contain it to make the
interface for calling it more consistent.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agoenv: Fix return values in env_attr_lookup()
Joe Hershberger [Wed, 20 May 2015 19:27:17 +0000 (14:27 -0500)]
env: Fix return values in env_attr_lookup()

This function returned numbers for error codes. Change them to error
codes.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agosandbox: Enable some ENV commands
Joe Hershberger [Wed, 20 May 2015 19:27:16 +0000 (14:27 -0500)]
sandbox: Enable some ENV commands

Enable some additional ENV commands in sandbox to aid in build testing
and run testing.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agosandbox: Use defconfig to enable features
Joe Hershberger [Wed, 20 May 2015 19:27:15 +0000 (14:27 -0500)]
sandbox: Use defconfig to enable features

Stop using the sandbox arch Kconfig to override defaults for config
options. This is a bit of abuse and may be causing build problems.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agosandbox: Cleanup order and extra defines in defconfig
Joe Hershberger [Wed, 20 May 2015 19:27:14 +0000 (14:27 -0500)]
sandbox: Cleanup order and extra defines in defconfig

The defconfigs should not be edited directly. They should be generated
by editing the .config (through menuconfig or whatever) and then run
make savedefconfig to have the Kconfig system generate a clean defconfig

I did this for sandbox here with no actual changes.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agoREADME.scrapyard: add entries for dead board, T4240EMU and sc3
Masahiro Yamada [Fri, 15 May 2015 02:51:32 +0000 (11:51 +0900)]
README.scrapyard: add entries for dead board, T4240EMU and sc3

Follow-up commit 7fc63cca611b (mpc85xx/T4240EMU: Remove T4240EMU
board), and commit 27e721564591 (ppc4xx: Remove sc3 board),
filling the blank fields.

Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
9 years agoarm/ls1021a: Remove ccsr_ddr from immap_ls102xa.h
York Sun [Wed, 29 Apr 2015 17:35:35 +0000 (10:35 -0700)]
arm/ls1021a: Remove ccsr_ddr from immap_ls102xa.h

ccsr_ddr structure is already defined in fsl_immap.h. Remove
this duplicated define. Move fixed timing into ls1021atwr.h.

Signed-off-by: York Sun <yorksun@freescale.com>
CC: Alison Wang <alison.wang@freescale.com>
Acked-by: Alison Wang <alison.wang@freescale.com>
9 years agodriver/ddr/fsl: Remove deskew_cntrl register
York Sun [Tue, 28 Apr 2015 21:23:14 +0000 (14:23 -0700)]
driver/ddr/fsl: Remove deskew_cntrl register

This register is reserved and shouldn't have been exposed.
Accessing it may have unexpected result on different SoCs.

Signed-off-by: York Sun <yorksun@freescale.com>
9 years agoarm: ls102xa: Adjust the load address of U-Boot for NOR boot
Alison Wang [Tue, 21 Apr 2015 08:04:38 +0000 (16:04 +0800)]
arm: ls102xa: Adjust the load address of U-Boot for NOR boot

The original load address of U-Boot is 0x67f80000. The address
space of NOR flash is 0x60000000 to 0x67ffffff. It will cause
the size of u-boot couldn't be larger than 512K. As more features
are supported in u-boot, the size of u-boot is larger than 512K.

To fix this issue, the load address of U-Boot for NOR boot is
adjusted to 0x60100000.

In RCW, the PBI command needs to change as follows:
 .pbi
-write 0xee0200, 0x67f80000
+write 0xee0200, 0x60100000
 .end

Signed-off-by: Alison Wang <alison.wang@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
9 years agonet: Remove all calls to net_random_ethaddr()
Joe Hershberger [Mon, 4 May 2015 19:55:15 +0000 (14:55 -0500)]
net: Remove all calls to net_random_ethaddr()

Remove the calls to net_random_ethaddr() that some boards and some
drivers are calling. This is now implemented inside of net/eth.c

Enable the feature for all boards that previously enabled it.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-By: Michael Walle <michael@walle.cc> (for the lsxl board part)
Series-changes: 2
-Fixed bfin build errors

9 years agonet: Remove all references to CONFIG_ETHADDR and friends
Joe Hershberger [Mon, 4 May 2015 19:55:14 +0000 (14:55 -0500)]
net: Remove all references to CONFIG_ETHADDR and friends

We really don't want boards defining fixed MAC addresses in their config
so we just remove the option to set it in a fixed way. If you must have
a MAC address that was not provisioned, then use the random MAC address
functionality.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agonet: Implement random ethaddr fallback in eth.c
Joe Hershberger [Mon, 4 May 2015 19:55:13 +0000 (14:55 -0500)]
net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agonet: phy: Add support for all targets which requires MANUAL_RELOC
Michal Simek [Wed, 13 May 2015 11:40:40 +0000 (13:40 +0200)]
net: phy: Add support for all targets which requires MANUAL_RELOC

Targets with CONFIG_NEEDS_MANUAL_RELOC do not use REL/RELA
relocation (mostly only GOT) where functions aray are not
updated. This patch is fixing function pointers passed to phy_register
function.
This patch was tested on Microblaze architecture.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agonet/phy: refactor RTL8211F initialization
Shengzhou Liu [Fri, 24 Apr 2015 08:57:17 +0000 (16:57 +0800)]
net/phy: refactor RTL8211F initialization

RTL8211F needs to enalbe TXDLY for RGMII during
phy initialization, so move it to rtl8211f_config
for early initialization.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
cc: Joe Hershberger <joe.hershberger@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agonet: Update hardware MAC address if it changes in env
Joe Hershberger [Tue, 24 Mar 2015 07:41:49 +0000 (02:41 -0500)]
net: Update hardware MAC address if it changes in env

When the ethaddr changes in the env, the hardware should also be updated
so that MAC filtering will work properly without resetting U-Boot.

Also remove the manual calls to set the hwaddr that was included in a
few drivers as a result of the framework not doing it.

Reported-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Tested-by: Michal Simek <michal.simek@xilinx.com>
9 years agonet/phy: Add support for realtek RTL8211F
Shengzhou Liu [Thu, 12 Mar 2015 10:54:59 +0000 (18:54 +0800)]
net/phy: Add support for realtek RTL8211F

RTL8211F has different registers from RTL8211E.
This patch adds support for RTL8211F PHY which
can be found on Freescale's T1023 RDB board.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agosunxi: Cache line size definition
Paul Kocialkowski [Sat, 16 May 2015 17:52:11 +0000 (19:52 +0200)]
sunxi: Cache line size definition

Sunxi platforms use ARM Cortex A8, A7 and A15 (unsupported yet) CPU cores,
which all have 64 bytes cache line size.

This is required to e.g. enable USB gadget.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: VBUS detection function fixup in g_dnl_board_usb_cable_connected
Paul Kocialkowski [Sat, 16 May 2015 17:52:10 +0000 (19:52 +0200)]
sunxi: VBUS detection function fixup in g_dnl_board_usb_cable_connected

sunxi_usbc_vbus_detect was renamed to sunxi_usb_phy_vbus_detect but
g_dnl_board_usb_cable_connected was still using the old name, breaking the build
when USB gadget is enabled.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: Add ga10h v1.1 defconfig
Hans de Goede [Thu, 14 May 2015 17:01:40 +0000 (19:01 +0200)]
sunxi: Add ga10h v1.1 defconfig

The ga10h is an 10" tablet with an A33 or A23 soc, 1G RAM, 8G or 16G nand,
sdio wifi, 2 micro usb ports, 1 otg and 1 host and 1 micro sd slot.

This commit adds a defconfig for the v1.1 pcb with an a33 soc.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Fix lvds panel support for sun6i+
Hans de Goede [Thu, 14 May 2015 16:52:54 +0000 (18:52 +0200)]
sunxi: video: Fix lvds panel support for sun6i+

We've never tested the lvds panel support on sun6i+ SoCs until now, and
unsurprisingly the lvds code needed some fixes to work on my ga10h A33
tablet with lvds panel. This makes the panel on that tablet actually work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Make DRAM_ODT_EN Kconfig setting a bool
Hans de Goede [Wed, 13 May 2015 13:00:46 +0000 (15:00 +0200)]
sunxi: Make DRAM_ODT_EN Kconfig setting a bool

Make DRAM_ODT_EN Kconfig setting a bool, add a separate DRAM_ODT_CORRECTION
setting for A23 SoCs and use DRAM_ODT_EN Kconfig everywhere instead of
only in dram_sun4i.c and hardcoding odt_en elsewhere.

Note this commit makes no functional changes for existing boards,
its purpose is to allow changing the odt_en value on future A33 boards.

For sun4i/sun5i/sun7i boards which set DRAM_ODT_EN=y (which no defconfigs
currently do) this patch turns on odt for both the DQ and the DQS lines,
whereas previously it was possibly (but not desirable) to turn odt on only
for one of them by setting the in DRAM_ODT_EN option to 1 or 2 instead of 3.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
9 years agosunxi: Fix dram initialization not working on some a33 devices
Hans de Goede [Wed, 13 May 2015 12:54:16 +0000 (14:54 +0200)]
sunxi: Fix dram initialization not working on some a33 devices

When porting the allwinner dram init code to u-boot we missed some code
setting an extra bit when doing auto dram config.

This commits add this bit, fixing dram init not working on the ga10h
10" a33 tablet which I'm bringing up atm.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: add support for UART2 on A23/A33
Laurent Itti [Wed, 6 May 2015 00:02:00 +0000 (17:02 -0700)]
sunxi: add support for UART2 on A23/A33

Add support for UART2 (2-pin version but note that RTS/CTS pins are available
pn that port for possible future use), can be selected in config
by using CONFIG_CONS_INDEX=3

Signed-off-by: Laurent Itti <laurentitti@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agoconsole: Fix pre-console flushing via cfb_console being very slow
Hans de Goede [Tue, 5 May 2015 11:13:36 +0000 (13:13 +0200)]
console: Fix pre-console flushing via cfb_console being very slow

On my A10 OlinuxIno Lime I noticed a huge (5+ seconds) delay coming from
console_init_r. This turns out to be caused by the preconsole buffer flushing
to the cfb_console. The Lime only has a 16 bit memory bus and that is already
heavy used to scan out the 1920x1080 framebuffer.

The problem is that print_pre_console_buffer() was printing the buffer once
character at a time and the cfb_console code then ends up doing a cache-flush
for touched display lines for each character.

This commit fixes this by first building a 0 terminated buffer and then
printing it in one puts() call, avoiding unnecessary cache flushes.

This changes the time for the flush from 5+ seconds to not noticable.

The downside of this approach is that the pre-console buffer needs to fit
on the stack, this is not that much to ask since we are talking about plain
text here. This commit also adjusts the sunxi CONFIG_PRE_CON_BUF_SZ to
actually fit on the stack. Sunxi currently is the only user of the pre-console
code so no other boards need to be adjusted.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 years agosunxi: Set SYS_MALLOC_CLEAR_ON_INIT to n
Hans de Goede [Tue, 5 May 2015 10:49:36 +0000 (12:49 +0200)]
sunxi: Set SYS_MALLOC_CLEAR_ON_INIT to n

We don't need this on sunxi, as we always use calloc or memset when
initialised memory is required. Clearing this shaves some time of our
boot time.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Pass serial number through ATAG
Paul Kocialkowski [Sat, 28 Mar 2015 17:35:36 +0000 (18:35 +0100)]
sunxi: Pass serial number through ATAG

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 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>
9 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>
9 years agoexynos: clock: clean up checkpatch issues
Minkyu Kang [Mon, 11 May 2015 07:27:07 +0000 (16:27 +0900)]
exynos: clock: clean up checkpatch issues

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
9 years agoarc: gitignore: ignore ARC DTBs
Masahiro Yamada [Thu, 14 May 2015 09:59:28 +0000 (18:59 +0900)]
arc: gitignore: ignore ARC DTBs

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
9 years agoMAINTAINERS, git-mailrc: Update Jagan's name and e-mail
Jagan Teki [Fri, 15 May 2015 19:27:02 +0000 (00:57 +0530)]
MAINTAINERS, git-mailrc: Update Jagan's name and e-mail

Signed-off-by: Jagan Teki <jteki@openedev.com>
9 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>
9 years agohummingboard: Remove mx6solo specific support
Fabio Estevam [Mon, 27 Apr 2015 12:20:52 +0000 (09:20 -0300)]
hummingboard: Remove mx6solo specific support

Hummingboard dual, dual-lite and solo are now supported via SPL mechanism.

Remove the previous hummingboard support, which does not use SPL and supported
only the solo variant.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 years agoarm: mx6: tqma6: Update to optionally configure an alternative SPI setup
Stefan Roese [Thu, 12 Mar 2015 12:34:30 +0000 (13:34 +0100)]
arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

By making the tqma6_iomuxc_spi() weak, this patch adds the possibility to
add a different function for this SPI configuration. This can be used
by other baseboards, that might have a different SPI setup.

This patch will be used by the upcoming WRU-IV board support which also
uses the TQMa6 SoM.

Signed-off-by: Stefan Roese <sr@denx.de>
9 years agoarm: mx6: tqma6: Fix USB and add other filesystems
Stefan Roese [Thu, 12 Mar 2015 12:34:29 +0000 (13:34 +0100)]
arm: mx6: tqma6: Fix USB and add other filesystems

This patch fixes the USB EHCI support on the TQMa6 SoM. Additionally
some filesystems are added, included the generic FS commands (e.g.
ls...).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Markus Niebel <Markus.Niebel@tq-group.com>
Cc: Stefano Babic <sbabic@denx.de>
Acked-By: Markus Niebel <Markus.Niebel@tq-group.com>
9 years agosandbox: defconfig: enable support of sandbox PMIC drivers
Przemyslaw Marczak [Wed, 13 May 2015 11:38:36 +0000 (13:38 +0200)]
sandbox: defconfig: enable support of sandbox PMIC drivers

This commit enables:
- emulated i2c PMIC driver
- sandbox PMIC I/O driver
- sandbox PMIC's regulator driver

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agosandbox: dts: add sandbox_pmic.dtsi and include it to sandbox.dts and test.dts
Przemyslaw Marczak [Wed, 13 May 2015 11:38:35 +0000 (13:38 +0200)]
sandbox: dts: add sandbox_pmic.dtsi and include it to sandbox.dts and test.dts

This commit adds dtsi file for Sandbox PMIC.
It fully describes the PMIC by:
- i2c emul node - with a default settings of 16 registers
- 2x buck regulator nodes
- 2x ldo regulator nodes

The default register settings are set with preprocessor macros:
- VAL2REG(min[uV/uA], step[uV/uA], val[uV/uA])
- VAL2OMREG(mode id)
Both defined in file:
- include/dt-bindings/pmic/sandbox_pmic.h

The Voltage ranges of each regulator can be found in:
- include/power/sandbox_pmic.h

The new file is included into:
- sandbox.dts
- test.dts

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agotest: dm: test.dts - move to sandbox dts directory
Przemyslaw Marczak [Wed, 13 May 2015 11:38:34 +0000 (13:38 +0200)]
test: dm: test.dts - move to sandbox dts directory

The file test.dts from driver model test directory,
was compiled by call dtc in script: test/dm/test-dm.sh.

This doesn't allow for including of dtsi files and using
of C preprocessor routines in this dts file.

Since the mentioned script builds U-Boot before tests,
then moving the test.dts file into sandbox dts directory
is reasonable.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agotest: dm: add sandbox PMIC framework tests
Przemyslaw Marczak [Wed, 13 May 2015 11:38:33 +0000 (13:38 +0200)]
test: dm: add sandbox PMIC framework tests

This change adds new file to sandbox driver model test environment.
The file is: test/dm/power.c, and it includes tests for PMIC framework,
which includes PMIC uclass and REGULATOR uclass.

All tests are based od Sandbox PMIC emulated device. Some test constants for
this device are defined in the header: include/power/sandbox_pmic.h

PMIC tests includes:
- pmic get - tests, that pmic_get() returns the requested device
- pmic I/O - tests I/O by writing and reading some values to PMIC's registers
             and then compares, that the write/read values are equal.

The regulator tests includes:
- Regulator get by devname/platname
- Voltage set/get
- Current set/get
- Enable set/get
- Mode set/get
- Autoset
- List autoset

For the regulator 'get' test, the returned device pointers are compared,
and their names are also compared to the requested one.
Every other test, first sets the given attribute and next try to get it.
The test pass, when the set/get values are equal.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agosandbox: add: sandbox PMIC device drivers: I2C emul, pmic, regulator
Przemyslaw Marczak [Wed, 13 May 2015 11:38:32 +0000 (13:38 +0200)]
sandbox: add: sandbox PMIC device drivers: I2C emul, pmic, regulator

This commit adds emulation of sandbox PMIC device, which includes:
- PMIC I2C emulation driver
- PMIC I/O driver (UCLASS_PMIC)
- PMIC regulator driver (UCLASS_REGULATOR)

The sandbox PMIC has 12 significant registers and 4 as padding to 16 bytes,
which allows using 'i2c md' command with the default count (16).

The sandbox PMIC provides regulators:
- 2x BUCK
- 2x LDO

Each, with adjustable output:
- Enable state
- Voltage
- Current limit (LDO1/BUCK1 only)
- Operation mode (different for BUCK and LDO)

Each attribute has it's own register, beside the enable state, which depends
on operation mode.

The header file: sandbox_pmic.h includes PMIC's default register values,
which are set on i2c pmic emul driver's probe() method.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agosandbox: i2c: search child emul dev and check its uclass id
Przemyslaw Marczak [Wed, 13 May 2015 11:38:31 +0000 (13:38 +0200)]
sandbox: i2c: search child emul dev and check its uclass id

The function get_emul() in sandbox i2c bus driver, always returns
first child as i2c emul device. This may only work for i2c devices
with a single child, which is an only i2c emul device.

In case when i2c device has more than one child (e.g. PMIC), and
one is i2c emul, then the function should search it by check uclass
id for each child. This patch add this change to the get_emul().

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agodoc: driver-model: pmic-framework.txt - cleanup
Przemyslaw Marczak [Wed, 13 May 2015 11:38:30 +0000 (13:38 +0200)]
doc: driver-model: pmic-framework.txt - cleanup

This commit cleanups the PMIC framework documentation.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agocommon: cmd regulator: command cleanup
Przemyslaw Marczak [Wed, 13 May 2015 11:38:29 +0000 (13:38 +0200)]
common: cmd regulator: command cleanup

This commit cleanups the regulator command.
The first change, is adjusting "regulator dev" command to use
"regulator-name" constraint, for setting the operating device.
Thanks to this, the regulator_get() function is removed.

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

This also cleanups the printing in command.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agocommon: cmd pmic: command cleanup
Przemyslaw Marczak [Wed, 13 May 2015 11:38:28 +0000 (13:38 +0200)]
common: cmd pmic: command cleanup

This commit cleanups the use of function: failed().
The new function name is: failure(), and it is used
for print errno and the errno-related message only.

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

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agodm: regulator: uclass driver code cleanup
Przemyslaw Marczak [Wed, 13 May 2015 11:38:27 +0000 (13:38 +0200)]
dm: regulator: uclass driver code cleanup

This cleanup includes:
- remove of the preprocessor macros which pointed to long name functions
- update of the names of some regulator uclass driver functions
- cleanup of the function regulator_autoset()
- reword of some comments of regulator uclass header file
- regulator_get_by_platname: check error for uclass_find_* function calls
- add function: regulator_name_is_unique
- regulator post_bind(): check regulator name uniqueness
- fix mistakes in: regulator/Kconfig
- regulator.h: update comments
- odroid u3: cleanup the regulator calls

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agodm: pmic: code cleanup of PMIC uclass driver
Przemyslaw Marczak [Wed, 13 May 2015 11:38:26 +0000 (13:38 +0200)]
dm: pmic: code cleanup of PMIC uclass driver

The cleanup includes:
- pmic.h - fix mistakes in a few comments
- pmic operations: value 'reg_count' - redefine as function call
- fix function name: pmic_bind_childs() -> pmic_bind_children()
- pmic_bind_children: change the 'while' loop with the 'for'
- add implementation of pmic_reg_count() method
- pmic_bind_children() - update function call name
- Kconfig: add new line at the end of file
- Update MAX77686 driver code

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
9 years agoodroid: enable driver model pmic/regulator API and MAX77686 drivers
Przemyslaw Marczak [Wed, 13 May 2015 11:38:25 +0000 (13:38 +0200)]
odroid: enable driver model pmic/regulator API and MAX77686 drivers

This change enables the configs required to init and setup max77686
regulator driver, using the new driver model pmic and regulator API.
And also changes the old pmic framework calls to the new ones.

This commits enables:
- CONFIG_ERRNO_STR
- CONFIG_DM_PMIC
- CONFIG_DM_PMIC_CMD
- CONFIG_DM_PMIC_MAX77686
- CONFIG_DM_REGULATOR
- CONFIG_DM_REGULATOR_CMD
- CONFIG_DM_REGULATOR_MAX77686

And removes the unused:
- CONFIG_DM_I2C_COMPAT
- CONFIG_POWER
- CONFIG_POWER_I2C
- CONFIG_POWER_MAX77686

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoodroid: dts: add 'voltage-regulators' description to max77686 node
Przemyslaw Marczak [Wed, 13 May 2015 11:38:24 +0000 (13:38 +0200)]
odroid: dts: add 'voltage-regulators' description to max77686 node

Adding regulators subnode to fdt max77686 node, allows properly init
regulators by the max77686 regulator driver. This enables the complete
functionality of the regulator command.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: board:samsung: power_init_board: add requirement of CONFIG_DM_PMIC
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:50 +0000 (20:07 +0200)]
dm: board:samsung: power_init_board: add requirement of CONFIG_DM_PMIC

In the power_init_board function call, regulator driver init is called,
so before compile, make sure that any power framework is defined.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodoc: driver-model: pmic and regulator uclass documentation
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:49 +0000 (20:07 +0200)]
doc: driver-model: pmic and regulator uclass documentation

Since this framework is still under the construction, the main
documentation is kept in the header files.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: regulator: add fixed voltage regulator driver
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:48 +0000 (20:07 +0200)]
dm: regulator: add fixed voltage regulator driver

This driver implements regulator operations for fixed Voltage/Current
value regulators. beside the standard regulator constraints, which are
put into the uclass platform data, a typical fixed regulator node provides
few additional properties like:
- gpio
- gpio-open-drain
- enable-active-high
- startup-delay-us
The only 'gpio' is used by this driver and is kept in structure of type
'fixed_regulator_platdata', as a device platform data (dev->platdata).

The driver implements:
- get_value
- get_current
- get_enable
- set_enable

The regulator calls and commands can be used for fixed-regulator devices,
and the proper error will be returned for prohibited.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: regulator: add max77686 regulator driver
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:47 +0000 (20:07 +0200)]
dm: regulator: add max77686 regulator driver

This commit adds support to MAX77686 regulator driver,
based on a driver model regulator's API. It implements
almost all regulator operations, beside those for setting
and geting the Current value.
For proper bind and operation it requires the MAX77686 PMIC driver.

New file: drivers/power/regulator/max77686.c
New config: CONFIG_DM_REGULATOR_MAX77686

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: pmic: add max77686 pmic driver
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:46 +0000 (20:07 +0200)]
dm: pmic: add max77686 pmic driver

This is the implementation of driver model PMIC driver.
The max77686 PMIC driver implements read/write operations and driver
bind method - to bind its childs.

This driver will try to bind the regulator devices by using it's child
info array with regulator prefixes and driver names. This should succeed
when compatible regulator driver is compiled. If no regulator driver found,
then the pmic can still provide read/write operations, and can be used with
PMIC function calls.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agopmic: max77686 set the same compatible as in the kernel
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:45 +0000 (20:07 +0200)]
pmic: max77686 set the same compatible as in the kernel

This commit also updates the proper dts files.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: regulator: add regulator command
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:44 +0000 (20:07 +0200)]
dm: regulator: add regulator command

This command is based on driver model regulator's API.
The user interface provides:
- list UCLASS regulator devices
- show or [set] operating regulator device
- print constraints info
- print operating status
- print/[set] voltage value [uV] (force)
- print/[set] current value [uA]
- print/[set] operating mode id
- enable the regulator output
- disable the regulator output

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

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: pmic: add pmic command
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:43 +0000 (20:07 +0200)]
dm: pmic: add pmic command

This is new command for the PMIC devices based on driver model PMIC API.
Command features are unchanged:
- list UCLASS pmic devices
- show or [set] operating pmic device (NEW)
- dump registers
- read byte of register at address
- write byte to register at address

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

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: regulator: add implementation of driver model regulator uclass
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:42 +0000 (20:07 +0200)]
dm: regulator: add implementation of driver model regulator uclass

This commit introduces the implementation of dm regulator API.
Device tree support allows for auto binding. And by the basic
uclass operations, it allows to driving the devices in a common
way. For detailed informations, please look into the header file.

Core files:
- drivers/power/regulator-uclass.c - provides regulator common functions api
- include/power/regulator.h - define all structures required by the regulator

Changes:
- new uclass-id: UCLASS_REGULATOR
- new config: CONFIG_DM_REGULATOR

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: pmic: add implementation of driver model pmic uclass
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:41 +0000 (20:07 +0200)]
dm: pmic: add implementation of driver model pmic uclass

This commit introduces the PMIC uclass implementation.
It allows providing the basic I/O interface for PMIC devices.
For the multi-function PMIC devices, this can be used as I/O
parent device, for each IC's interface. Then, each PMIC particular
function can be provided by the child device's operations, and the
child devices will use its parent for read/write by the common API.

Core files:
- 'include/power/pmic.h'
- 'drivers/power/pmic/pmic-uclass.c'

The old pmic framework is still kept and is independent.

For more detailed informations, please look into the header file.

Changes:
- new uclass-id: UCLASS_PMIC
- new config: CONFIG_DM_PMIC

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agolib: Kconfig: add entry for errno_str() function
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:40 +0000 (20:07 +0200)]
lib: Kconfig: add entry for errno_str() function

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoexynos4-common: remove the unsued CONFIG_CMD_PMIC
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:39 +0000 (20:07 +0200)]
exynos4-common: remove the unsued CONFIG_CMD_PMIC

This config name was never used, because the present pmic command
was precompiled for the CONFIG_POWER.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoexynos5: fix build break by adding CONFIG_POWER
Przemyslaw Marczak [Mon, 20 Apr 2015 18:07:38 +0000 (20:07 +0200)]
exynos5: fix build break by adding CONFIG_POWER

Move the configs listed below from exynos5-dt-common.h to exynos5-common.h:
- CONFIG_POWER
- CONFIG_POWER_I2C
fixes build break for Arndale and Smdk5250 boards.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoi2c: mxc: refactor i2c driver and support dm
Peng Fan [Thu, 14 May 2015 23:29:12 +0000 (07:29 +0800)]
i2c: mxc: refactor i2c driver and support dm

1. Introduce a new structure `struct mxc_i2c_bus`, this structure will
   used for non-DM and DM.
2. Remove `struct mxc_i2c_regs` structure, but use register offset to access
   registers based on `base` entry of `struct mxc_i2c_bus`.
3. Remove most `#ifdef I2C_QUIRK_REG`. Using driver_data to contain platform
   flags. A new flag is introduced, I2C_QUIRK_FLAG.
4. Most functions use `struct mxc_i2c_bus` as one of the parameters.
   Make most functions common to DM and non-DM, try to avoid duplicated code.
5. Support DM, but pinctrl is not included. Pinmux setting is still set
   by setup_i2c, but we do not need bus_i2c_init for DM.
6. struct i2c_parms and struct sram_data are removed.
7. Remove bus_i2c_read bus_i2c_write prototype in header file. The frist
   paramter of bus_i2c_init is modified to i2c index. Add new prototype
   i2c_idle_bus and force_bus_idle. Since bus_i2c_init is not good for
   DM I2C and pinctrl is missed, we use a weak function for i2c_idle_bus.
   Board file take the responsibility to implement this function, like this:
   "
   int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus)
   {
   if (i2c_bus->index == 0)
   force_bus_idle(i2c_pads_info0);
   else if (i2c_bus->index == 1)
   force_bus_idle(i2c_pads_info1);
   else
   xxxxxx
   }
   "
8. Introduce a weak function, enable_i2c_clk
9. Tested on an i.MX7 platform. Log info:
 => dm tree
 Class       Probed   Name
 ----------------------------------------
 root        [ + ]    root_driver
 simple_bus  [   ]    |-- soc
 simple_bus  [   ]    |   |-- aips-bus@30000000
 simple_bus  [   ]    |   |   |-- anatop@30360000
 simple_bus  [   ]    |   |   `-- snvs@30370000
 simple_bus  [   ]    |   |-- aips-bus@30400000
 simple_bus  [   ]    |   `-- aips-bus@30800000
 i2c         [   ]    |       |-- i2c@30a20000
 i2c         [   ]    |       `-- i2c@30a40000
 simple_bus  [   ]    `-- regulators
 => i2c dev 0
 Setting bus to 0
 => i2c probe
 Valid chip addresses: 08 50
 => i2c md 8 31
 0031: 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoimx: mx27 move GPIO_PORTx to gpio.h
Peng Fan [Thu, 14 May 2015 23:29:13 +0000 (07:29 +0800)]
imx: mx27 move GPIO_PORTx to gpio.h

These GPIO_PORTx macros should be in gpio.h, but not in imx-regs.h.

Also, imx-regs.h and iomux-v3.h has same macro defintion for
GPIO_PORTx, and both of them are included in mxc_i2c.c(include
mxc_i2c.h). This will incur build warnings with macro redefinition.

Since iomux-v3.h is not compatible with mx27, we can not simply
include iomux-v3.h for mx27, so move the GPIO_PORTx to gpio.h to
fix the build warning.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
9 years agosunxi: Change usb-kbd interrupt polling to use an usb interrupt queue
Hans de Goede [Wed, 13 May 2015 12:42:18 +0000 (14:42 +0200)]
sunxi: Change usb-kbd interrupt polling to use an usb interrupt queue

Now that the ohci code supports usb interrupt queues we can switch (back)
to using an usb interrupt queue for usb-kbd interrupt polling. This
greatly reduces u-boot's latency when dealing with usb keyboards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Reviewed-by: Marek Vasut <marex@denx.de>
9 years agousb: ohci: Add support for interrupt queues
Hans de Goede [Wed, 13 May 2015 12:42:17 +0000 (14:42 +0200)]
usb: ohci: Add support for interrupt queues

Add support for interrupt queues to the ohci hcd code, bringing it inline
with the ehci and musb-new(host) code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Marek Vasut <marex@denx.de>
9 years agousb: ohci: Add an ohci_alloc_urb() function
Hans de Goede [Wed, 13 May 2015 12:42:16 +0000 (14:42 +0200)]
usb: ohci: Add an ohci_alloc_urb() function

Add an ohci_alloc_urb() function, this is a preparation patch for adding
interrupt queue support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Marek Vasut <marex@denx.de>