Tom Rini [Sat, 31 Jan 2015 17:40:26 +0000 (12:40 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-net
Alexey Brodkin [Tue, 13 Jan 2015 14:10:24 +0000 (17:10 +0300)]
net/designware: add error message on DMA reset timeout
If for some reason DMA module fails to reset user oserves only this:
--->---
# dhcp
Trying dwmac.
e0018000
FAIL
--->---
This message makes not much sense.
With proposed change error message will be more helpful:
--->---
# dhcp
Trying dwmac.
e0018000
DMA reset timeout
FAIL
--->---
For example user may do power toggle to recover board functionality.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Tom Rini <trini@ti.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Pavel Machek <pavel@denx.de>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Ian Campbell <ijc@hellion.org.uk>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
Acked-by: Pavel Machek <pavel@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Philippe De Muyter [Wed, 19 Feb 2014 16:21:59 +0000 (17:21 +0100)]
net: phy: micrel: add support for KSZ8895 switch in SMI mode
This patch adds a phy driver for the Micrel KSZ8895 switch. As the SoC MAC
is directly connected to the switch MAC the link to the switch is always up.
But the KSZ8895 switch can be hardwired in three configuration modes :
- not configurable with eventually an eeprom-stored configuration
- configurable by the mdio/mdc connection (SMI protocol)
- configurable by a SPI connection.
In not configurable mode, the switch starts automatically, but in the
other modes, it must be started programmatically, by writing 1 in
configuration register 1.
We only support the not configurable and mdio/mdc (aka SMI) modes here.
Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Yoshinori Sato [Thu, 13 Feb 2014 14:13:41 +0000 (23:13 +0900)]
Add MS7206SE ethernet support
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Claudiu Manoil [Tue, 10 Dec 2013 13:21:04 +0000 (15:21 +0200)]
net: tsec: Fix NULL access in case init_phy() fails
If the PHY is not recognized don't access phydev (NULL)
and return 0 to signal failure.
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Tom Rini [Fri, 30 Jan 2015 18:56:15 +0000 (13:56 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-mips
Tom Rini [Fri, 30 Jan 2015 14:24:42 +0000 (09:24 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-dm
Peng Fan [Thu, 29 Jan 2015 10:03:39 +0000 (18:03 +0800)]
ARM: armv7 fix spelling of SCTRL
SCTLR is the abbreviation of System Control Register, so we should
use SCTLR but not SCTRL.
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Michal Simek [Mon, 26 Jan 2015 07:52:27 +0000 (08:52 +0100)]
fpga: Extend dump description
There are missing parameters in help which fpga dump command
requires.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Linus Walleij [Fri, 23 Jan 2015 13:41:10 +0000 (14:41 +0100)]
vexpress64: support the Juno Development Platform
The Juno Development Platform is a physical Versatile Express
device with some differences from the emulated semihosting
models. The main difference is that the system is split in
a SoC and an FPGA where the SoC hosts the serial ports at
totally different adresses.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Fri, 23 Jan 2015 10:50:53 +0000 (11:50 +0100)]
vexpress64: get rid of CONFIG_SYS_EXTRA_OPTIONS
The Versatile Express ARMv8 semihosted FVP platform is still
using the legacy CONFIG_SYS_EXTRA_OPTIONS method to configure
some compile-time flags. Get rid of this and create a Kconfig
entry for the FVP model, and a selectable bool for the
semihosting library.
The FVP subboard is now modeled as a target choice so we can
eventually choose between different ARMv8 versatile express
boards (FVP, base model, Juno...) this way. All dependent
symbols are updated to reflect this.
The 64bit Versatile Express board symbols are renamed
VEXPRESS64 so we have some chance to see what is actually
going on. Tested on the FVP fast model.
Acked-by: Steve Rae <srae@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Dennis Gilmore [Thu, 22 Jan 2015 18:34:20 +0000 (11:34 -0700)]
add README.distro file
Add documentation on how to setup a system to use the generic distro
configs and boot commands. This spells out what is needed to make a
system conformant, but does not limit the board to only the defaults.
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
[swarren, added concept, user config, BOOT_TARGET_DEVICES sections.
edited the rest]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Minghuan Lian [Thu, 22 Jan 2015 05:21:55 +0000 (13:21 +0800)]
drivers/pci/pci_rom.c: fix compile warning under 64bit mode
Fix this:
drivers/pci/pci_rom.c:95:15: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]
rom_header = (struct pci_rom_header *)rom_address;
Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
Minghuan Lian [Thu, 22 Jan 2015 05:21:54 +0000 (13:21 +0800)]
drivers/net/e1000.c: fix compile warning under 64bit mode
Fix this:
warning: cast from pointer to integer of different size
Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
Chris Kuethe [Thu, 22 Jan 2015 04:52:33 +0000 (20:52 -0800)]
arm: switch armltd vexpress to GENERIC_BOARD
only tested tested under QEMU with vexpress_ca9x4 ("-M vexpress-a9") and
vexpress_ca15_tc2 ("-M vexpress-a15"). Makes the ugly warning go away.
Signed-off-by: Chris Kuethe <chris.kuethe+github@gmail.com>
Stephen Warren [Mon, 19 Jan 2015 23:39:11 +0000 (16:39 -0700)]
distro_bootcmd: read DHCP boot script name from a variable
Modify $bootcmd_dhcp to read the downloaded script filename from an
environment variable rather than hard-coding it. This allows the user
(or another script) to select a different script name if they want,
without editing the whole value of $bootcmd_dhcp.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Bin Meng [Mon, 19 Jan 2015 13:32:00 +0000 (21:32 +0800)]
cmd: Fix gettime command help
Remove the additional ',' and '\n' from the gettime command help.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Daniel Schwierzeck [Thu, 29 Jan 2015 13:56:20 +0000 (14:56 +0100)]
MIPS: unify CPU code in arch/mips/cpu/
Unify and move code in arch/mips/cpu/mips[32|64]/ to arch/mips/cpu/.
The CPU specific config.mk files need to remain until
CONFIG_STANDALONE_LOAD_ADDR is converted to a global Kconfig symbol.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Daniel Schwierzeck [Thu, 29 Jan 2015 13:47:01 +0000 (14:47 +0100)]
MIPS: move au1x00 SoC code to arch/mips/mach-au1x00
Move all au1x00 code out of arch/mips/cpu/mips32 to allow
unification of CPU code in a later patch. The reorganization
of the SoC specific header files will be done in a later patch
series.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Paul Burton [Thu, 29 Jan 2015 10:04:10 +0000 (10:04 +0000)]
MIPS: handle mips64 ST0_KX bit in mips32 start.S
In preparation for sharing a single copy of start.S between mips32 &
mips64, handle setting the KX bit of the cop0 Status register when the
mips32 start.S is built for mips64.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Paul Burton [Thu, 29 Jan 2015 10:04:09 +0000 (10:04 +0000)]
MIPS: handle mips64 relocs in mips32 start.S
In preparation for sharing a single copy of start.S between mips32 &
mips64, handle mips64 relocations in the mips32 start.S when built for
mips64.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Paul Burton [Thu, 29 Jan 2015 10:04:08 +0000 (10:04 +0000)]
MIPS: use asm.h macros in mips32 start.S
Where the mips32 & mips64 implementations of start.S differ in terms of
access sizes & offsets, use the appropriate macros from asm.h to
abstract those differences away. This is in preparation for sharing a
single copy of start.S between mips32 & mips64.
The exception to this is loads of immediates to be written to the cop0
Config register, which is a 32bit register on mips64 and therefore
constants written to it can be loaded as such.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Simon Glass [Tue, 27 Jan 2015 03:29:40 +0000 (20:29 -0700)]
dm: cros_ec: Convert cros_ec_i2c over to driver model
Move this driver to use driver model and update the snow configuration to
match.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 27 Jan 2015 03:29:39 +0000 (20:29 -0700)]
dm: i2c: Add two more I2C init functions to the compatibility layer
These functions are useful in case the board calls them. Also fix a missing
parameter caused by applying the wrong patch (actually I failed to send v2
and applied v1 by mistake).
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 27 Jan 2015 03:29:38 +0000 (20:29 -0700)]
dm: exynos: dts: Set the offset length for cros_ec
The EC has no concept of offset, so use a value of 0.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 27 Jan 2015 03:29:37 +0000 (20:29 -0700)]
dm: i2c: dts: Support an offset-len device tree property
Since U-Boot can support different offset lengths (0-4 bytes), add a device
tree property to specify this. This avoids hard-coding it in the driver.
Signed-off-by: Simon Glass <sjg@chromium.org>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:39 +0000 (13:36 +0100)]
exynos5: enable dm i2c
This patch enables CONFIG_DM_I2C and also CONFIG_DM_I2C_COMPAT.
The last one should be removed when all the i2c peripheral
drivers will use dm i2c framework.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Cc: Akshay Saraswat <akshay.s@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:38 +0000 (13:36 +0100)]
odroid u3: enable dm i2c support
This patch enables CONFIG_DM_I2C and also CONFIG_DM_I2C_COMPAT.
The last one should be removed when the dm pmic framework will
be finished.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:37 +0000 (13:36 +0100)]
odroid u3: dts: add missing i2c aliases
This change fixes i2c bus numbering for Odroid U3.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:36 +0000 (13:36 +0100)]
dm: i2c: s3c24x0: adjust to dm-i2c api
This commit adjusts the s3c24x0 driver to new i2c api
based on driver-model. The driver supports standard
and high-speed i2c as previous.
Tested on Trats2, Odroid U3, Arndale, Odroid XU3
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Tested-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Heiko Schocher <hs@denx.de>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:34 +0000 (13:36 +0100)]
exynos5: pinmux: check flag for i2c config
Some versions of Exynos5 supports High-Speed I2C,
on few interfaces, this change allows support this.
The new flag is: PINMUX_FLAG_HS_MODE
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Akshay Saraswat <akshay.s@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:33 +0000 (13:36 +0100)]
arndale: dts: add missing i2c aliases
Without this alias setting, the seq numbers
of the i2c devices are wrong.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:32 +0000 (13:36 +0100)]
exynos4: dts: add missing i2c properties
This patch modify i2c nodes in exynos4.dtsi with:
- adding proper interrupts arrays for each i2c node,
which allows to decode periph id
- add reg address for each i2c node for i2c driver internal use
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:31 +0000 (13:36 +0100)]
smdk5250: config: enable max77686 driver support
This commit enable support for the above driver,
which was disabled in common config.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:30 +0000 (13:36 +0100)]
exynos5250: config: disable max77686 driver
This PMIC is not common for all Exynos5250
based boards, so should be romoved from
common config.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:29 +0000 (13:36 +0100)]
arndale: config: disable max77686 support
There is no MAX77686 pmic on this board,
so the driver support should be removed.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Przemyslaw Marczak [Tue, 27 Jan 2015 12:36:28 +0000 (13:36 +0100)]
dm: i2c-uclass-compat: fix missed argument
This patch fixes build error for CONFIG_DM_I2C_COMPAT.
In i2c_get_chip_for_busnum() call, one of argument was missed,
which was offset_len. Now it is set to 'alen' as previous.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Ruchika Gupta [Fri, 23 Jan 2015 10:31:59 +0000 (16:01 +0530)]
rsa: Use checksum algorithms from struct hash_algo
Currently the hash functions used in RSA are called directly from the sha1
and sha256 libraries. Change the RSA checksum library to use the progressive
hash API's registered with struct hash_algo. This will allow the checksum
library to use the hardware accelerated progressive hash API's once available.
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
(Fixed build error in am335x_boneblack_vboot due to duplicate CONFIG_DM)
Change-Id: Ic44279432f88d4e8594c6e94feb1cfcae2443a54
Ruchika Gupta [Fri, 23 Jan 2015 10:31:58 +0000 (16:01 +0530)]
Use hash.c in mkimage
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Ruchika Gupta [Fri, 23 Jan 2015 10:31:57 +0000 (16:01 +0530)]
hash: Add function to find hash_algo struct with progressive hash
The hash_algo structure has some implementations in which progressive hash
API's are not defined. These are basically the hardware based implementations
of SHA. An API is added to find the algo which has progressive hash API's
defined. This can then be integrated with RSA checksum library which uses
Progressive Hash API's.
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Ruchika Gupta [Fri, 23 Jan 2015 10:31:56 +0000 (16:01 +0530)]
lib/rsa: Add Kconfig for devices supporting RSA Modular Exponentiation
Kconfig option added for devices which support RSA Verification.
1. RSA_SOFTWARE_EXP
Enables driver for supporting RSA Modular Exponentiation in Software
2. RSA_FREESCALE_EXP
Enables driver for supporting RSA Modular Exponentiation using Freescale specific
driver
The above drivers use RSA uclass
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
(Removed duplicate line in Kconfig comment)
Change-Id: I7663c4d5350e2bfc3dfa2696f70ef777d6ccc6f6
Ruchika Gupta [Fri, 23 Jan 2015 10:31:55 +0000 (16:01 +0530)]
DM: crypto/fsl - Add Freescale rsa DM driver
Driver added for RSA Modular Exponentiation using Freescale Hardware
Accelerator CAAM. The driver uses UCLASS_MOD_EXP
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Ruchika Gupta [Fri, 23 Jan 2015 10:31:54 +0000 (16:01 +0530)]
lib/rsa: Modify rsa to use DM driver
Modify rsa_verify to use the rsa driver of DM library .The tools
will continue to use the same RSA sw library.
CONFIG_RSA is now dependent on CONFIG_DM. All configurations which
enable FIT based signatures have been modified to enable CONFIG_DM
by default.
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Ruchika Gupta [Fri, 23 Jan 2015 10:31:53 +0000 (16:01 +0530)]
configs: Move CONFIG_FIT_SIGNATURE to defconfig
For the platforms which use,CONFIG_FIT_SIGNATURE, the required configs are
moved to the platform's defconfig file. Selecting CONFIG_FIT_SIGNATURE using
defconfig automatically resolves the dependencies for signature verification.
The RSA library gets automatically selected and user does not have to define
CONFIG_RSA manually.
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Ruchika Gupta [Fri, 23 Jan 2015 10:31:52 +0000 (16:01 +0530)]
DM: crypto/rsa_mod_exp: Add rsa Modular Exponentiation DM driver
Add a new rsa uclass for performing modular exponentiation and implement
the software driver basing on this uclass.
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Ruchika Gupta [Fri, 23 Jan 2015 10:31:51 +0000 (16:01 +0530)]
FIT: Modify option FIT_SIGNATURE in Kconfig
For FIT signature based approach to work, RSA library needs to be selected.
The FIT_SIGNATURE option in Kconfig is modified to automatically select RSA.
Selecting RSA compiles the RSA library required for image verification.
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Ruchika Gupta [Fri, 23 Jan 2015 10:31:50 +0000 (16:01 +0530)]
rsa: Split the rsa-verify to separate the modular exponentiation
Public exponentiation which is required in rsa verify functionality is
tightly integrated with verification code in rsa_verify.c. The patch
splits the file into twp separating the modular exponentiation.
1. rsa-verify.c
- The file parses device tree keys node to fill a keyprop structure.
The keyprop structure can then be converted to implementation specific
format.
(struct rsa_pub_key for sw implementation)
- The parsed device tree node is then passed to a generic rsa_mod_exp
function.
2. rsa-mod-exp.c
Move the software specific functions related to modular exponentiation
from rsa-verify.c to this file.
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Martin Dorwig [Mon, 26 Jan 2015 22:22:54 +0000 (15:22 -0700)]
Export redesign
this is an atempt to make the export of functions typesafe.
I replaced the jumptable void ** by a struct (jt_funcs) with function pointers.
The EXPORT_FUNC macro now has 3 fixed parameters and one
variadic parameter
The first is the name of the exported function,
the rest of the parameters are used to format a functionpointer
in the jumptable,
the EXPORT_FUNC macros are expanded three times,
1. to declare the members of the struct
2. to initialize the structmember pointers
3. to call the functions in stubs.c
Signed-off-by: Martin Dorwig <dorwig@tetronik.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
(resending to the list since my tweaks are not quite trivial)
Simon Glass [Sun, 25 Jan 2015 15:27:20 +0000 (08:27 -0700)]
dm: Update documentation for new bus features
Now that we have new bus features, update README.txt and the SPI docs to
explain these.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:27:19 +0000 (08:27 -0700)]
dm: cros_ec_spi: Remove old pre-driver-model code
This is no-longer needed since all platforms use SPI for cros_ec.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:27:17 +0000 (08:27 -0700)]
dm: cros_ec: Don't require protocol 3 support
I2C is now deprecated on ARM platforms and there are no devices that use it
with the v3 protocol. We can't require v3 support if we want to support I2C.
Adjust the error handling to suit.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:27:16 +0000 (08:27 -0700)]
dm: core: Ignore disabled devices when binding
We don't want to bind devices which should never be used.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:27:15 +0000 (08:27 -0700)]
dm: exynos: Drop unused COMPAT features for SPI
This has moved to driver model so we don't need the fdtdec support.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Minkyu Kang <mk7.kang@samsung.com>
Simon Glass [Sun, 25 Jan 2015 15:27:14 +0000 (08:27 -0700)]
dm: tegra: Drop unused COMPAT features for I2C, SPI
These have moved to driver model so we don't need the fdtdec support.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:27:13 +0000 (08:27 -0700)]
dm: i2c: Move slave details to child platdata
At present we go through various contortions to store the I2C's chip
address in its private data. This only exists when the chip is active so
must be set up when it is probed. Until the device is probed we don't
actually record what address it will appear on.
However, now that we can support per-child platform data, we can use that
instead. This allows us to set up the address when the child is bound,
and avoid the messy contortions.
Unfortunately this is a fairly large change and it seems to be difficult to
break it down further.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:27:12 +0000 (08:27 -0700)]
dm: spi: Move slave details to child platdata
At present we go through various contortions to store the SPI slave's chip
select in its private data. This only exists when the slave is active so
must be set up when it is probed. Until the device is probed we don't
actually know what chip select it will appear on.
However, now that we can support per-child platform data, we can use that
instead. This allows us to set up the chip select when the child is bound,
and avoid the messy contortions.
Unfortunately this is a fairly large change and it seems to be difficult to
break it down further.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:27:11 +0000 (08:27 -0700)]
dm: spi: Set up the spi_slave device pointer in child_pre_probe()
At present we use struct spi_slave as our device pointer in a lot of places
to avoid changing the old SPI API. At some point this will go away.
But for now, it is better if the SPI uclass sets up this pointer, rather
than relying on passing it into the device when it is probed. We can use the
new uclass child_pre_probe() method to do this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:27:10 +0000 (08:27 -0700)]
dm: core: Allow uclass to set up a device's child before it is probed
Some buses need to set up their devices before they can be used. This setup
may well be common to all buses in a particular uclass. Support a common
pre-probe method for the uclass, called before any bus devices are probed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:27:09 +0000 (08:27 -0700)]
dm: sandbox: sf: Tidy up the error handling in sandbox_sf_probe()
Use a single exit point when we have an error and add debugging there.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:27:08 +0000 (08:27 -0700)]
dm: core: Allow the uclass to set up a device's child after binding
For buses, after a child is bound, allow the uclass to perform some
processing. This can be used to figure out the address of the child (e.g.
the chip select for SPI slaves) so that it is ready to be probed.
This avoids bus drivers having to repeat the same process, which really
should be done by the uclass, since it is common.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:27:07 +0000 (08:27 -0700)]
dm: spi: Move the per-child data size to the uclass
This is common to all SPI drivers and specifies a structure used by the
uclass. It makes more sense to define it in the uclass.
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:27:06 +0000 (08:27 -0700)]
dm: core: Allow uclasses to specify private data for a device's children
In many cases the per-child private data for a device's children is defined
by the uclass rather than the individual driver. For example, a SPI bus
needs to store information about each of its children, but all SPI drivers
store the same information. It makes sense to allow the uclass to define
this data.
If the driver provides a size value for its per-child private data, then use
it. Failng that, fall back to that provided by the uclass.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:27:05 +0000 (08:27 -0700)]
dm: core: Add a flag to control sequence numbering
At present we try to use the 'reg' property and device tree aliases to give
devices a sequence number. The 'reg' property is often actually a memory
address, so the sequence numbers thus-obtained are not useful. It would be
better if the devices were just sequentially numbered in that case. In fact
neither I2C nor SPI use this feature, so drop it.
Some devices need us to look up an alias to number them within the uclass.
Add a flag to control this, so it is not done unless it is needed.
Adjust the tests to test this new behaviour.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:27:04 +0000 (08:27 -0700)]
dm: core: Add a function to get a device's uclass ID
This is useful to check which uclass a device is in.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:27:03 +0000 (08:27 -0700)]
dm: core: Add a post_bind method for parents
Allow parent drivers to be called when a new child is bound to them. This
allows a bus to set up information it needs for that child.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:27:02 +0000 (08:27 -0700)]
dm: core: Allow uclasses to specify platdata for a device's children
In many cases the child platform data for a device's children is defined by
the uclass rather than the individual devices. For example, a SPI bus needs
to know the chip select and speed for each of its children. It makes sense
to allow this information to be defined the SPI uclass rather than each
individual driver.
If the device provides a size value for its child platdata, then use it.
Failng that, fall back to that provided by the uclass.
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:27:01 +0000 (08:27 -0700)]
dm: core: Allow parents to have platform data for their children
For buses it is common for parents to need to know the address of the child
on the bus, the bus speed to use for that child, and other information. This
can be provided in platform data attached to each child.
Add driver model support for this, including auto-allocation which can be
requested using a new property to specify the size of the data.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:27:00 +0000 (08:27 -0700)]
dm: core: Allocate platform data when binding a device
When using allocated platform data, allocate it when we bind the device.
This makes it possible to fill in this information before the device is
probed.
This fits with the platform data model (when not using device tree),
since platform data exists at bind-time.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:26:59 +0000 (08:26 -0700)]
dm: core: Tidy up error handling in device_bind()
Make the error handling more standard to make it easier to build on top of
it. Also correct a bug in the error path where there is no parent.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Simon Glass [Sun, 25 Jan 2015 15:26:58 +0000 (08:26 -0700)]
dm: core: Set device tree node for root device
The root device corresponds to the root device tree node, so set this up.
Also add a few notes to the documentation.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:26:57 +0000 (08:26 -0700)]
dm: core: Improve comments for uclass_first/next_device()
Mention that the devices are probed ready for use.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:26:56 +0000 (08:26 -0700)]
dm: Don't run tests if U-Boot cannot be built
There is no point in running the tests if U-Boot cannot be built. Abort in
this case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 25 Jan 2015 15:26:55 +0000 (08:26 -0700)]
dm: i2c: Provide an offset length parameter where needed
Rather than assuming that the chip offset length is 1, allow it to be
provided. This allows chips that don't use the default offset length to
be used (at present they are only supported by the command line 'i2c'
command which sets the offset length explicitly).
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
Simon Glass [Tue, 13 Jan 2015 01:02:08 +0000 (18:02 -0700)]
dm: i2c: Add a compatbility layer
For boards which use multiple I2C devices, or for SOCs which support
multiple boards, we might want to convert these to driver model at different
times. At present this is difficult because we need to either use
CONFIG_DM_I2C for a board or not.
Add a compatibility layer which implements the old API, thus allowing a
board to move to driver model for I2C without requiring that everything it
uses is moved in the same commit.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 13 Jan 2015 01:02:07 +0000 (18:02 -0700)]
dm: i2c: Rename driver model I2C functions to permit compatibility
Add a dm_ prefix to driver model I2C functions so that we can keep the old
ones around.
This is a little unfortunate, but on reflection it is too difficult to
change the API. We can undo this rename when most boards and drivers are
converted to use driver model for I2C.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 15 Jan 2015 16:19:36 +0000 (09:19 -0700)]
dm: Drop gpio.h header from fdtdec.c
Since GPIO support has now moved to the driver model uclass, we can drop
this include.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:43 +0000 (20:05 -0700)]
dm: fdt: Remove the old GPIO functions
Now that we support device tree GPIO bindings directly in the driver model
GPIO uclass we can remove these functions.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:42 +0000 (20:05 -0700)]
dm: exynos: dts: Use GPIO bank phandles for GPIOs
U-Boot now supports using GPIOs using bank phandles instead of global
numbers. Update the exynos device tree files to use this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Minkyu Kang <mk7.kang@samsung.com>
Simon Glass [Tue, 6 Jan 2015 03:05:41 +0000 (20:05 -0700)]
dm: tegra: dts: Use TEGRA_GPIO() macro for all GPIOs
This new method is much easier and matches the kernel.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:40 +0000 (20:05 -0700)]
dm: spi: Remove use of fdtdec GPIO support
These functions are going away, so use the new uclass support instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:39 +0000 (20:05 -0700)]
dm: usb: Remove use of fdtdec GPIO support
These functions are going away, so use the new uclass support instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:38 +0000 (20:05 -0700)]
dm: mmc: Remove use of fdtdec GPIO support
These functions are going away, so use the new uclass support instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:37 +0000 (20:05 -0700)]
dm: zynq: Remove inline gpio functions
These functions serve no useful purpose, and conflict with the generic API.
Drop them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:36 +0000 (20:05 -0700)]
dm: tegra: nand: Remove use of fdtdec GPIO support
These functions are going away, so use the new uclass support instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:35 +0000 (20:05 -0700)]
dm: tegra: video: Remove use of fdtdec GPIO support
These functions are going away, so use the new uclass support instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:34 +0000 (20:05 -0700)]
dm: exynos: Add a GPIO translation function
This deals with the polarity bit. It also changes the GPIO devices so that
the correct device tree node is linked to each one. This allows us to use
the new uclass phandle functionality to implement a proper GPIO binding.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:33 +0000 (20:05 -0700)]
dm: tegra: Add a GPIO translation function
This deals with the polarity bit and selecting the correct bank device
given a GPIO number.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:32 +0000 (20:05 -0700)]
dm: cros_ec: Remove use of fdtdec GPIO support
These functions are going away, so use the new uclass support instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:31 +0000 (20:05 -0700)]
dm: demo: Add a simple GPIO demonstration
Add a new 'demo light' command which uses GPIOs to control imaginary lights.
Each light is assigned a bit number in the overall value. This provides an
example driver for using the new GPIO API.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:30 +0000 (20:05 -0700)]
dm: gpio: Mark the old GPIO API deprecated
Add a deprecation notice to each function so that it is more obvious that we
are moving GPIOs to driver model.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:29 +0000 (20:05 -0700)]
dm: gpio: Add better functions to request GPIOs
At present U-Boot sort-of supports the standard way of reading GPIOs from
device tree nodes, but the support is incomplete, a bit clunky and only
works for GPIO bindings where #gpio-cells is 2.
Add new functions to request GPIOs, taking full account of the device
tree binding. These permit requesting a GPIO with a simple call like:
gpio_request_by_name(dev, "cd-gpios", 0, &desc, GPIOD_IS_IN);
This will request the GPIO, looking at the device's node which might be
this, for example:
cd-gpios = <&gpio TEGRA_GPIO(B, 3) GPIO_ACTIVE_LOW>;
The GPIO will be set to input mode in this case and polarity will be
honoured by the GPIO calls.
It is also possible to request and free a list of GPIOs.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:28 +0000 (20:05 -0700)]
dm: gpio: Add a driver GPIO translation method
Only the GPIO driver knows about the full GPIO device tree binding used by
a device. Add a method to allow the driver to provide this information to the
uclass, including the GPIO offset within the device and flags such as the
polarity.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:27 +0000 (20:05 -0700)]
dm: gpio: Add a native driver model API
So far driver model's GPIO uclass just implements the existing GPIO API.
This has some limitations:
- it requires manual device tree munging to support GPIOs in device tree
(fdtdec_get_gpio() and friends)
- it does not understand polarity
- it is somewhat slower since we must scan for the GPIO device each time
- Global GPIO numbering can change if other GPIO drivers are probed
- it requires extra steps to set the GPIO direction and value
The new functions have a dm_ prefix where necessary to avoid name conflicts
but we can remove that when it is no-longer needed. The new struct gpio_desc
holds all required information about the GPIO. For now this is intended to
be stored by the client requesting the GPIO, but in future it might be
brought into the uclass in some way.
With these changes the old GPIO API still works, and uses the driver model
API underneath.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:26 +0000 (20:05 -0700)]
dm: fdt: Add a function to decode phandles with arguments
For GPIOs and other functions we want to look up a phandle and then decode
a list of arguments for that phandle. Each phandle can have a different
number of arguments, specified by a property in the target node. This is
the "#gpio-cells" property for GPIOs.
Add a function to provide this feature, taken modified from Linux 3.18.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:25 +0000 (20:05 -0700)]
dm: tegra: Bring in GPIO device tree binding
At present the tegra GPIO driver does not fully support the existing device
tree binding, but add the binding file to cover the existing partial support.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:24 +0000 (20:05 -0700)]
dm: exynos: Bring in GPIO device tree binding
At present the exynos GPIO driver does not fully support the existing device
tree binding, but add the binding file to cover the existing partial support.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jan 2015 03:05:23 +0000 (20:05 -0700)]
dm: gpio: Bring in GPIO device tree binding
Add the binding file that we are about to support.
Signed-off-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Wed, 14 Jan 2015 08:07:05 +0000 (17:07 +0900)]
generic-board: show model name in board_init_f() too
The common/board_r.c has show_model_r() to display the model name
if the DTB has a "model" property. It sounds useful to have a similar
function in common/board_f.c too because most of the boards show
their board name before relocation.
Instead of implementing the same function in both common/board_f.c
and common/board_r.c, let's split it up into common/show_board_info.c.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada [Fri, 19 Dec 2014 18:34:23 +0000 (03:34 +0900)]
cmd_i2c: change variable type for 10bit addressing support
To store 10bit chip address, the variable type should not be uchar,
but uint.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher<hs@denx.de>
Masahiro Yamada [Tue, 13 Jan 2015 03:44:39 +0000 (12:44 +0900)]
ARM: UniPhier: enable CONFIG_I2C_EEPROM
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>