]> git.kernelconcepts.de Git - karo-tx-uboot.git/log
karo-tx-uboot.git
9 years agodm: cros_ec: Don't require protocol 3 support
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>
9 years agodm: core: Ignore disabled devices when binding
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>
9 years agodm: exynos: Drop unused COMPAT features for SPI
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>
9 years agodm: tegra: Drop unused COMPAT features for I2C, SPI
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>
9 years agodm: i2c: Move slave details to child platdata
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>
9 years agodm: spi: Move slave details to child platdata
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>
9 years agodm: spi: Set up the spi_slave device pointer in child_pre_probe()
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>
9 years agodm: core: Allow uclass to set up a device's child before it is probed
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>
9 years agodm: sandbox: sf: Tidy up the error handling in sandbox_sf_probe()
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>
9 years agodm: core: Allow the uclass to set up a device's child after binding
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>
9 years agodm: spi: Move the per-child data size to the uclass
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>
9 years agodm: core: Allow uclasses to specify private data for a device's children
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>
9 years agodm: core: Add a flag to control sequence numbering
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>
9 years agodm: core: Add a function to get a device's uclass ID
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>
9 years agodm: core: Add a post_bind method for parents
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>
9 years agodm: core: Allow uclasses to specify platdata for a device's children
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>
9 years agodm: core: Allow parents to have platform data for their children
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>
9 years agodm: core: Allocate platform data when binding a device
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>
9 years agodm: core: Tidy up error handling in device_bind()
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>
9 years agodm: core: Set device tree node for root device
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>
9 years agodm: core: Improve comments for uclass_first/next_device()
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>
9 years agodm: Don't run tests if U-Boot cannot be built
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>
9 years agodm: i2c: Provide an offset length parameter where needed
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>
9 years agodm: i2c: Add a compatbility layer
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>
9 years agodm: i2c: Rename driver model I2C functions to permit compatibility
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>
9 years agodm: Drop gpio.h header from fdtdec.c
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>
9 years agodm: fdt: Remove the old GPIO functions
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>
9 years agodm: exynos: dts: Use GPIO bank phandles for GPIOs
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>
9 years agodm: tegra: dts: Use TEGRA_GPIO() macro for all GPIOs
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>
9 years agodm: spi: Remove use of fdtdec GPIO support
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>
9 years agodm: usb: Remove use of fdtdec GPIO support
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>
9 years agodm: mmc: Remove use of fdtdec GPIO support
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>
9 years agodm: zynq: Remove inline gpio functions
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>
9 years agodm: tegra: nand: Remove use of fdtdec GPIO support
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>
9 years agodm: tegra: video: Remove use of fdtdec GPIO support
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>
9 years agodm: exynos: Add a GPIO translation function
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>
9 years agodm: tegra: Add a GPIO translation function
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>
9 years agodm: cros_ec: Remove use of fdtdec GPIO support
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>
9 years agodm: demo: Add a simple GPIO demonstration
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>
9 years agodm: gpio: Mark the old GPIO API deprecated
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>
9 years agodm: gpio: Add better functions to request GPIOs
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>
9 years agodm: gpio: Add a driver GPIO translation method
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>
9 years agodm: gpio: Add a native driver model API
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>
9 years agodm: fdt: Add a function to decode phandles with arguments
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>
9 years agodm: tegra: Bring in GPIO device tree binding
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>
9 years agodm: exynos: Bring in GPIO device tree binding
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>
9 years agodm: gpio: Bring in GPIO device tree binding
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>
9 years agogeneric-board: show model name in board_init_f() too
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>
9 years agocmd_i2c: change variable type for 10bit addressing support
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>
9 years agoARM: UniPhier: enable CONFIG_I2C_EEPROM
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>
9 years agoARM: UniPhier: enable I2C for UniPhier SoCs
Masahiro Yamada [Tue, 13 Jan 2015 03:44:38 +0000 (12:44 +0900)]
ARM: UniPhier: enable I2C for UniPhier SoCs

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoi2c: UniPhier: add driver for UniPhier FIFO-builtin i2c controller
Masahiro Yamada [Tue, 13 Jan 2015 03:44:37 +0000 (12:44 +0900)]
i2c: UniPhier: add driver for UniPhier FIFO-builtin i2c controller

This commit adds on-chip I2C driver used on newer SoCs of Panasonic
UniPhier platform.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
9 years agoi2c: UniPhier: add driver for UniPhier i2c controller
Masahiro Yamada [Tue, 13 Jan 2015 03:44:36 +0000 (12:44 +0900)]
i2c: UniPhier: add driver for UniPhier i2c controller

This commit adds on-chip I2C driver used on some old Panasonic
UniPhier SoCs.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
9 years agoi2c: add CONFIG_DM_I2C to Kconfig
Masahiro Yamada [Tue, 13 Jan 2015 03:44:35 +0000 (12:44 +0900)]
i2c: add CONFIG_DM_I2C to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
9 years agocommon: bootm: Document fake bootm sub-command
Michal Simek [Thu, 15 Jan 2015 08:53:13 +0000 (09:53 +0100)]
common: bootm: Document fake bootm sub-command

Fake option is enabled only when CONFIG_TRACE is
enabled in common/bootm.c:do_boot_states().

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agotools: do not print error messages in verify_header() functions
Guilherme Maciel Ferreira [Thu, 15 Jan 2015 04:54:43 +0000 (02:54 -0200)]
tools: do not print error messages in verify_header() functions

default_image.c and socfpgaimage.c are the only image modules that print error
messages during header verification. The verify_header() is used to query if a
given image file is processed by the image format. Thus, if the image format
can't handle the file, it must simply return an error. Otherwise we pollute the
screen with errors messages until we find the image format that handle a given
image file.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
9 years agodumpimage: fit: extract FIT images
Guilherme Maciel Ferreira [Thu, 15 Jan 2015 04:54:42 +0000 (02:54 -0200)]
dumpimage: fit: extract FIT images

The dumpimage is able to extract components contained in a FIT image:

  $ ./dumpimage -T flat_dt -i CONTAINER.ITB -p INDEX FILE

The CONTAINER.ITB is a regular FIT container file. The INDEX is the poisition
of the sub-image to be retrieved, and FILE is the file (path+name) to save the
extracted sub-image.

For example, given the following kernel.its to build a kernel.itb:

  /dts-v1/;
  / {
      ...
      images {
        kernel@1 {
          description = "Kernel 2.6.32-34";
          data = /incbin/("/boot/vmlinuz-2.6.32-34-generic");
          type = "kernel";
          arch = "ppc";
          os = "linux";
          compression = "gzip";
          load = <00000000>;
          entry = <00000000>;
          hash@1 {
            algo = "md5";
          };
        };
        ...
      };
      ...
    };

The dumpimage can extract the 'kernel@1' node through the following command:

  $ ./dumpimage -T flat_dt -i kernel.itb -p 0 kernel
  Extracted:
   Image 0 (kernel@1)
    Description:  Kernel 2.6.32-34
    Created:      Wed Oct 22 15:50:26 2014
    Type:         Kernel Image
    Compression:  gzip compressed
    Data Size:    4040128 Bytes = 3945.44 kB = 3.85 MB
    Architecture: PowerPC
    OS:           Linux
    Load Address: 0x00000000
    Entry Point:  0x00000000
    Hash algo:    md5
    Hash value:   22352ad39bdc03e2e50f9cc28c1c3652

Which results in the file 'kernel' being exactly the same as '/boot/vmlinuz-2.6.32-34-generic'.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
9 years agodumpimage: replace the term "datafile" by "subimage"
Guilherme Maciel Ferreira [Thu, 15 Jan 2015 04:54:41 +0000 (02:54 -0200)]
dumpimage: replace the term "datafile" by "subimage"

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
9 years agodumpimage: add 'T' option to explicitly set the image type
Guilherme Maciel Ferreira [Thu, 15 Jan 2015 04:54:40 +0000 (02:54 -0200)]
dumpimage: add 'T' option to explicitly set the image type

Some image types, like "KeyStone GP", do not have magic numbers to
distinguish them from other image types. Thus, the automatic image
type discovery does not work correctly.

This patch also fix some integer type mismatches.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
9 years agoimagetool: replace image registration function by linker_lists feature
Guilherme Maciel Ferreira [Thu, 15 Jan 2015 04:48:07 +0000 (02:48 -0200)]
imagetool: replace image registration function by linker_lists feature

The registration was introduced in commit f86ed6a8d52c99bb2d17d3cac1647edca0c4399c

This commit also removes all registration functions, and the member "next"
from image_type_params struct

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
9 years agoimagetool: make the image_save_datafile() available to all image types
Guilherme Maciel Ferreira [Thu, 15 Jan 2015 04:48:06 +0000 (02:48 -0200)]
imagetool: make the image_save_datafile() available to all image types

Move the image_save_datafile() function from an U-Multi specific file
(default_image.c) to a file common to all image types (image.c). And rename it
to genimg_save_datafile(), to make clear it is useful for any image type.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
9 years agoimagetool: move common code to imagetool module
Guilherme Maciel Ferreira [Thu, 15 Jan 2015 04:48:05 +0000 (02:48 -0200)]
imagetool: move common code to imagetool module

The get_type() and verify_print_header() functions have the
same code on both dumpimage.c and mkimage.c modules.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
9 years agolinker_lists: fix misspellings
Guilherme Maciel Ferreira [Thu, 15 Jan 2015 04:39:59 +0000 (02:39 -0200)]
linker_lists: fix misspellings

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
9 years agodoc: fix misspellings
Guilherme Maciel Ferreira [Thu, 15 Jan 2015 04:37:34 +0000 (02:37 -0200)]
doc: fix misspellings

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
9 years agodoc: "os" is also mandatory for "ramdisk" FIT image components
Guilherme Maciel Ferreira [Thu, 15 Jan 2015 04:37:33 +0000 (02:37 -0200)]
doc: "os" is also mandatory for "ramdisk" FIT image components

According to fit_image_print(), the "os" property from "image" node is required
also when "type=ramdisk".

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
9 years agocommon: add cache flush to imxtract function
Pieter Voorthuijsen [Mon, 12 Jan 2015 15:23:18 +0000 (16:23 +0100)]
common: add cache flush to imxtract function

A cache flush is required when an image is extracted that is required on another core.

Signed-off-by: Pieter Voorthuijsen <pieter.voorthuijsen@prodrive-technologies.com>
9 years agodistro_distro_bootcmd: use CONFIG_BOOTCOMMAND instead of setting bootcmd=
Sjoerd Simons [Mon, 5 Jan 2015 17:13:39 +0000 (18:13 +0100)]
distro_distro_bootcmd: use CONFIG_BOOTCOMMAND instead of setting bootcmd=

Move the bootcmd commands into a seperate distro_bootcmd environment
variable. Allowing a user to easily launch the distro boot sequence if
the default bootcmd did not default to distro boot commands.

Also set CONFIG_BOOTCOMMAND to "run distro_bootcmd" if it hasn't been
configured yet rather then putting it directly in the environment. This
allows boards to make the distro boot commands available without
necessarily default to them or to use them as a fallback after running
some board specific commands instead.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
9 years agoconfig_distro_bootcmd: Scan all partitions for boot files
Sjoerd Simons [Mon, 5 Jan 2015 17:13:38 +0000 (18:13 +0100)]
config_distro_bootcmd: Scan all partitions for boot files

Not all devices use the convention that the boot scripts are on the
first partition. For example on chromebooks it seems common for the
first two partitions to be ChromeOS kernel partitions.

So instead of just the first partition scan all partitions on a device
with a filesystem u-boot can recognize.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
9 years agopart: let list put the list in an environment variable
Sjoerd Simons [Mon, 5 Jan 2015 17:13:37 +0000 (18:13 +0100)]
part: let list put the list in an environment variable

Add an optional third argument to the "part list" command which puts a
space seperated list of valid partitions into the given environment
variable. This is useful for allowing boot scripts to iterate of all
partitions of a device.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
9 years agofs: Add command to retrieve the filesystem type
Sjoerd Simons [Mon, 5 Jan 2015 17:13:36 +0000 (18:13 +0100)]
fs: Add command to retrieve the filesystem type

New command to determine the filesystem type of a given partition.
Optionally stores the filesystem type in a environment variable.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
9 years agoOMAP3: igep00x0: Fix boot hang and add support for status LED.
Enric Balletbo i Serra [Wed, 28 Jan 2015 14:01:32 +0000 (15:01 +0100)]
OMAP3: igep00x0: Fix boot hang and add support for status LED.

Use the STATUS_LED APIs for indicating a boot progress instead of
show_boot_progress.

This patch also fixes a problem introduced with commit b3f4ca1135 (dm: omap3:
Move to driver model for GPIO and serial). After that commit the board doesn't
boot. Looks like the problem is the gpio_request call inside the function
show_boot_progress.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
9 years agodavinci: Do not duplicate setting of gd
Tom Rini [Thu, 22 Jan 2015 14:38:10 +0000 (09:38 -0500)]
davinci: Do not duplicate setting of gd

In f0c3a6c we stopped setting gd in board_init_f, but later had to
revert to due problems on certain platforms.  As davinci does not look
to have these problems, we can drop the setting here and rely upon
crt0.S to do it.

Cc: Peter Howard <pjh@northern-ridge.com.au>
Signed-off-by: Tom Rini <trini@ti.com>
9 years agoomap3: add some MUX definitions for upcoming cairo
Albert ARIBAUD \(3ADEV\) [Fri, 16 Jan 2015 08:09:51 +0000 (09:09 +0100)]
omap3: add some MUX definitions for upcoming cairo

Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
9 years agoomap3: mmc: add 1.8v bias setting for MMC1
Albert ARIBAUD \(3ADEV\) [Fri, 16 Jan 2015 08:09:50 +0000 (09:09 +0100)]
omap3: mmc: add 1.8v bias setting for MMC1

Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
9 years agoomap3: add SDRC settings for Samsung K4X51163PG
Albert ARIBAUD \(3ADEV\) [Fri, 16 Jan 2015 08:09:49 +0000 (09:09 +0100)]
omap3: add SDRC settings for Samsung K4X51163PG

Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
9 years agoomap3: make SDRC SHARING setting configurable
Albert ARIBAUD \(3ADEV\) [Fri, 16 Jan 2015 08:09:48 +0000 (09:09 +0100)]
omap3: make SDRC SHARING setting configurable

Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
9 years agoomap3: enable GP9 timer and UART2
Albert ARIBAUD \(3ADEV\) [Fri, 16 Jan 2015 08:09:47 +0000 (09:09 +0100)]
omap3: enable GP9 timer and UART2

These are needed for the upcoming Cairo board support.

Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
9 years agoNokia RX-51: Use generic board
Pali Rohár [Thu, 15 Jan 2015 09:26:36 +0000 (10:26 +0100)]
Nokia RX-51: Use generic board

Generic board with #define CONFIG_SYS_GENERIC_BOARD is working fine.
There is no visible difference between legacy and generic board code.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
9 years agoam335x_evm: Enable CONFIG_NAND_OMAP_GPMC_PREFETCH
Tom Rini [Tue, 13 Jan 2015 21:42:53 +0000 (16:42 -0500)]
am335x_evm: Enable CONFIG_NAND_OMAP_GPMC_PREFETCH

Signed-off-by: Tom Rini <trini@ti.com>
9 years agoARM: OMAP5: DRA7xx: Add support for power rail grouping
Lubomir Popov [Fri, 19 Dec 2014 15:34:31 +0000 (17:34 +0200)]
ARM: OMAP5: DRA7xx: Add support for power rail grouping

On the DRA72x (J6Eco) EVM one PMIC SMPS is powering three SoC
core rails. This concept of using one SMPS to supply multiple
core domains (in various, although limited combinations, per
primary device use case) has now become common and is used by
many customer J6/J6Eco designs; it is supported by a number of
corresponding PMIC OTP versions.

This patch implements correct operation of the core voltages
scaling routine by ensuring that each SMPS that is supplying
more than one domain shall be written only once, and with the
highest voltage of those fused in the SoC (or of those defined
in the corresponding header if fuse read is disabled or fails)
for the power rails belonging to the group.

The patch also replaces some PMIC-related magic numbers with
the appropriate definitions. The default OPP_NOM voltages for
the DRA7xx SoCs are updated as well, per the latest DMs.

Signed-off-by: Lubomir Popov <l-popov@ti.com>
9 years agomalta: enable ELF loading
Paul Burton [Thu, 29 Jan 2015 10:38:23 +0000 (10:38 +0000)]
malta: enable ELF loading

The ability to load ELF files is sometimes useful on Malta boards,
particularly for use with small embedded applications. Enable the
loadelf command in the malta config.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agomalta: enable HUSH parser
Paul Burton [Thu, 29 Jan 2015 10:38:22 +0000 (10:38 +0000)]
malta: enable HUSH parser

The malta board is used for development and thus the shell is interacted
with often. Enable HUSH to make the experience a little more pleasant.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agomalta: delay after reset
Paul Burton [Thu, 29 Jan 2015 10:38:21 +0000 (10:38 +0000)]
malta: delay after reset

Reset isn't instant, so delay to give it a chance. Otherwise we go on
to print a failure message before resetting anyway.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agomalta: IDE support
Paul Burton [Thu, 29 Jan 2015 10:38:20 +0000 (10:38 +0000)]
malta: IDE support

This patch adds IDE support to the MIPS Malta board. The IDE controller
is enabled after probing the PCI bus and otherwise just makes use of
U-boot generic IDE support.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agoMIPS: clear TagLo select 2 during cache init
Paul Burton [Thu, 29 Jan 2015 01:28:03 +0000 (01:28 +0000)]
MIPS: clear TagLo select 2 during cache init

Current MIPS cores from Imagination Technologies use TagLo select 2 for
the data cache. The architecture requires that it is safe for software
to write to this register even if it isn't present, so take the trivial
option of clearing both selects 0 & 2.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agoMIPS: allow systems to skip loads during cache init
Paul Burton [Thu, 29 Jan 2015 01:28:02 +0000 (01:28 +0000)]
MIPS: allow systems to skip loads during cache init

Current MIPS systems do not require that loads be performed to force the
parity of cache lines, a simple invalidate by clearing the tag for each
line will suffice. Thus this patch makes the loads & subsequent second
invalidation conditional upon the CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD
option, and defines that for existing mips32 targets. Exceptions are
malta where this is known to be unnecessary, and qemu-mips where caches
are not implemented.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agoMIPS: inline mips_init_[id]cache functions
Paul Burton [Thu, 29 Jan 2015 01:28:01 +0000 (01:28 +0000)]
MIPS: inline mips_init_[id]cache functions

The mips_init_[id]cache functions are small & only called once from a
single callsite. Inlining them allows mips_cache_reset to avoid having
to bother moving arguments around & leaves it a leaf function which is
thus able to simply keep the return address live in the ra register
throughout, simplifying the code.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agoMIPS: refactor cache loops to a macro
Paul Burton [Thu, 29 Jan 2015 01:28:00 +0000 (01:28 +0000)]
MIPS: refactor cache loops to a macro

Reduce duplication by performing loops through cache tags using an
assembler macro.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agoMIPS: refactor L1 cache config reads to a macro
Paul Burton [Thu, 29 Jan 2015 01:27:59 +0000 (01:27 +0000)]
MIPS: refactor L1 cache config reads to a macro

Reduce duplication between reading the configuration of the L1 dcache &
icache by performing both using a macro which calculates the appropriate
line & cache sizes from the coprocessor 0 Config1 register.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agoMIPS: unify cache initialization code
Paul Burton [Thu, 29 Jan 2015 01:27:58 +0000 (01:27 +0000)]
MIPS: unify cache initialization code

The mips32 & mips64 cache initialization code differs only in that the
mips32 code supports reading the cache size from coprocessor 0 registers
at runtime. Move the more developed mips32 version to a common
arch/mips/lib/cache_init.S & remove the now-redundant mips64 version in
order to reduce duplication. The temporary registers used are shuffled
slightly in order to work for both mips32 & mips64 builds. The RA
register is defined differently to suit mips32 & mips64, but will be
removed by a later commit in the series after further cleanup.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agoMIPS: unify cache maintenance functions
Paul Burton [Thu, 29 Jan 2015 01:27:57 +0000 (01:27 +0000)]
MIPS: unify cache maintenance functions

Move the more developed mips32 version of the cache maintenance
functions to a common arch/mips/lib/cache.c, in order to reduce
duplication between mips32 & mips64.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agoMIPS: avoid .set ISA for cache operations
Paul Burton [Thu, 29 Jan 2015 01:27:56 +0000 (01:27 +0000)]
MIPS: avoid .set ISA for cache operations

As a step towards unifying the cache maintenance code for mips32 &
mips64 CPUs, stop using ".set <ISA>" directives in the more developed
mips32 version of the code. Instead, when present make use of the GCC
builtin for emitting a cache instruction. When not present, simply don't
bother with the .set directives since U-boot always builds with
-march=mips32 or higher anyway.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agolcd: fix console address is not initialized
Bo Shen [Wed, 28 Jan 2015 01:13:22 +0000 (09:13 +0800)]
lcd: fix console address is not initialized

This commit 904672e (lcd: refactor lcd console stuff into its
own file), which cause lcd console address is not initialized.

This patch initialize the lcd console use the default value,
will be update when splash screen is enabled.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
9 years agoMakefile: clean boot.bin
Bo Shen [Thu, 15 Jan 2015 02:03:53 +0000 (10:03 +0800)]
Makefile: clean boot.bin

When build for Atmel related boards which support SPL,
it will generate boot.bin, also clean when it when do
"make clean" operation.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agospl: Change printf to puts for "Unsupported boot-device"
Stefan Roese [Tue, 27 Jan 2015 15:45:09 +0000 (16:45 +0100)]
spl: Change printf to puts for "Unsupported boot-device"

Microblaze currently doesn't use printf in SPL. So this one line was the only
reference to it and resulted in the printf functionality to be pulled in.
Exceeding the 4k size limit. Lets change the printf back to puts so that
Microblaze is fixed again. The only drawback is that the detected boot-device
number will not be printed. But this message alone should be helpful enough
to get an idea where the boot process is broken.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
9 years agoMerge branch 'master' of git://git.denx.de/u-boot-x86
Tom Rini [Mon, 26 Jan 2015 22:44:49 +0000 (17:44 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-x86

9 years agoMerge branch 'master' of git://git.denx.de/u-boot-atmel
Tom Rini [Mon, 26 Jan 2015 11:42:40 +0000 (06:42 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-atmel

9 years agoMerge branch 'zynq' of git://www.denx.de/git/u-boot-microblaze
Tom Rini [Mon, 26 Jan 2015 11:42:15 +0000 (06:42 -0500)]
Merge branch 'zynq' of git://www.denx.de/git/u-boot-microblaze

9 years agoserial: Extend structure comments with register offset
Michal Simek [Wed, 7 Jan 2015 14:00:47 +0000 (15:00 +0100)]
serial: Extend structure comments with register offset

This information help with debugging issues with uart.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoserial: zynq: Use global baudrate instead of hardcoded one
Michal Simek [Tue, 2 Dec 2014 12:52:00 +0000 (13:52 +0100)]
serial: zynq: Use global baudrate instead of hardcoded one

This change enables to change baudrate on command line.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>