Commit Graph

28790 Commits

Author SHA1 Message Date
Vladimir Barinov
3b7f0e109c arm: rmobile: Add SILK board support
SILK is an entry level development board based on R-Car E2 SoC (R8A7794)

This commit supports the following peripherals:
- SCIF, I2C, Ethernet, QSPI, MMC, USB Host

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Reviewed-by: Tom Rini <trini@ti.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2015-02-13 13:14:56 +09:00
Michal Simek
484fdf5ba0 dm: 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 for DM core
and serial-uclass to ensure that relocated functions are called.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-12 15:17:29 -07:00
Peng Fan
99c0ae16d8 dm:gpio:mxc add DT support
This patch add DT support for mxc gpio driver.

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

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

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-12 15:17:29 -07:00
Peng Fan
637a769318 dm:gpio:mxc add a bank_index entry in platdata
Add a new entry in platdata structure and intialize
bank_index in mxc_plat array.
This new entry can avoid using `plat - mxc_plat` by using
`plat->bank_index`.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-12 15:17:29 -07:00
Peng Fan
c9cac3f841 dm: introduce dev_get_addr interface
Abstracting dev_get_addr can improve drivers that want to
get device's address.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-12 15:17:29 -07:00
Simon Glass
be9891c52d dm: Drop unused driver model config_defaults
These are now in Kconfig so we can drop them from the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 15:17:28 -07:00
Simon Glass
b724bd7d63 dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to Kconfig
Move this option to Kconfig and update all boards.
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 15:17:28 -07:00
Simon Glass
ad885e4570 dm: at91: snapper: Move driver model CONFIGs to Kconfig
Remove driver model CONFIGs from the board config headers and use Kconfig
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 15:17:28 -07:00
Simon Glass
757fe635df dm: at91: Drop use of ATMEL_PIO_PORTS in the header file
With driver model the number of PIO ports is defined by platform data, so
remove it from the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
2015-02-12 15:17:27 -07:00
Nobuhiro Iwamatsu
59088e4a76 dm: sh: serial: Add support driver model
This adds driver model support with this driver. This was tested by Koelsch
board and Gose board.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-12 15:17:17 -07:00
Simon Glass
0f36f957f4 dm: socfpga: Move driver model CONFIGs to Kconfig
Remove driver model CONFIGs from the board config headers and use Kconfig
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:35 -07:00
Simon Glass
70c45aeb43 dm: mx6: Move driver model CONFIGs to Kconfig
Remove driver model CONFIGs from the board config headers and use Kconfig
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:35 -07:00
Simon Glass
7b051c5235 dm: sunxi: Move driver model CONFIGs to Kconfig
Remove driver model CONFIGs from the board config headers and use Kconfig
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
2015-02-12 10:35:35 -07:00
Simon Glass
f4aae59fdf dm: sandbox: Move driver model CONFIGs to Kconfig
Remove driver model CONFIGs from the board config headers and use Kconfig
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:35 -07:00
Simon Glass
001646c478 dm: omap3: Move driver model CONFIGs to Kconfig
Remove driver model CONFIGs from the board config headers and use Kconfig
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:35 -07:00
Simon Glass
d7a4b2e42e dm: tegra: Move driver model CONFIGs to Kconfig
Remove driver model CONFIGs from the board config headers and use Kconfig
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:34 -07:00
Simon Glass
9a89d50d8e dm: x86: Move driver model CONFIGs to Kconfig
Remove driver model CONFIGs from the board config headers and use Kconfig
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:34 -07:00
Simon Glass
aab7e80d5f dm: exynos: Move driver model CONFIGs to Kconfig
Remove driver model CONFIGs from the board config headers and use Kconfig
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:34 -07:00
Simon Glass
34e609ca82 dm: Move Raspberry Pi driver model CONFIGs to Kconfig
Remove driver model CONFIGs from the board config header and use Kconfig
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:34 -07:00
Simon Glass
f058f154a9 dm: Add CMD_DM and CMD_DEMO to Kconfig
Add Kconfig settings for these two options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-02-12 10:35:34 -07:00
Simon Glass
1967982a95 dm: test: Add a Kconfig file
Add a file to control driver model test features.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-02-12 10:35:34 -07:00
Simon Glass
91a91ff804 dm: Add Kconfig options for driver model SPL support
The SPL support cannot be enabled yet, but we can add the Kconfig
options in preparation for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:33 -07:00
Simon Glass
f94a1bed07 dm: Expand and complete Kconfig in drivers/
Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-02-12 10:35:33 -07:00
Simon Glass
2a4eeadd56 dm: Add Kconfig for driver/demo
Add a suitable Kconfig for this directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-02-12 10:35:33 -07:00
Simon Glass
fffff7268b dm: i2c: Make API accessible even without CONFIG_DM
Make the driver model I2C API available always, even if driver model
is not enabled. This allows for a 'soft' switch-over, where drivers can
use the new structures in code which is compiled but not yet used. This
makes migration easier in some cases.

Fix up the existing drivers which define their own 'struct i2c_msg'.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
2015-02-12 10:35:33 -07:00
Simon Glass
ca88b9b939 dm: i2c: Add a dm_ prefix to driver model bus speed functions
As with i2c_read() and i2c_write(), add a dm_ prefix to the driver model
versions of these functions to avoid conflicts.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
2015-02-12 10:35:33 -07:00
Simon Glass
0da0fcd51f net: Use new checksum functions
Drop the old checksum functions in favour of the new ones.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2015-02-12 10:35:33 -07:00
Stefan Roese
360334a178 powerpc: ppc4xx: Enable CONFIG_DISPLAY_BOARDINFO
This also displays the "Board:" line in the bootup text with the
generic board support code.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:32 -07:00
Stefan Roese
275029074d powerpc: ppc4xx: Add defaults for DT based booting to really work
These additional nodes need to be provided to get U-Boot to boot correctly
on the Canyonlands / Glacier board:

- chosen path to the console-uart
- reg-shift set to 0 in the uart device nodes

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:32 -07:00
Stefan Roese
f693e7f514 powerpc: ppc4xx: Change from OF_SEPARATE to OF_EMBED
This is necessary, as ppc4xx has the reset vector located at the end
of the U-Boot image. This needs to be flashed to the end of the NOR
flash. Adding the dtb to the main U-Boot image will break booting
on ppc4xx. This patch now embeds the dtb in the U-Boot image instead.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:32 -07:00
Simon Glass
0df09047fa powerpc: Add linkage.h file
This permits us to use linux/linkage.h on PowerPC machines.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:32 -07:00
Simon Glass
5d418fdb99 dm: powerpc: ppc4xx: Move glacier to use driver model for serial
Adjust Kconfig to default to driver model for glacier, canyonlands and
arches.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:32 -07:00
Simon Glass
fad486ce51 powerpc: Add serial driver for driver model
This uses the ns16550 driver but sets up the clock at run-time. It does
not seem to be available in the device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:31 -07:00
Simon Glass
0e7806d24a ppc: amcc: Omit unneeded ns16550 CONFIG if using driver model
This comes from the device tree or a call to get_uart_clock().

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:31 -07:00
Simon Glass
43301741fc powerpc: ppc4xx: Use CONFIG_OF_CONTROL for canyonlands boards
Enable CONFIG_OF_CONTROL so that U-Boot on these three boards uses a device
tree for its configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:31 -07:00
Simon Glass
0de36f8b62 powerpc: ppc4xx: Allow the end of u-boot.bin to be found
Define an _end symbol indicating the end of u-boot.bin. Also add some dummy
words into the link script to ensure that u-boot.bin will always extend
that far. There may be a better way of doing this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:31 -07:00
Simon Glass
86bedaebb5 powerpc: ppc4xx: Add a gpio.h header file
This is required at present for device tree control. The ppc4xx does support
GPIOs but does not seem to have a proper driver. So this file is empty.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:31 -07:00
Simon Glass
36ec4c021a powerpc: ppc4xx: Call board_init_f_mem() for generic board
Call this function to set up our early memory.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:31 -07:00
Simon Glass
281aea45f8 powerpc: ppc4xx: dts: Bring in canyonlands device tree files
The canyonlands.h config file works with canyonlands, glacier and arches
boards. Bring in the device tree files for these from Linux 3.17.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:30 -07:00
Simon Glass
1d60f2b986 powerpc: ppc4xx: canyonlands: Move to generic board
Switch to generic board so that this board will not be broken/removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:30 -07:00
Simon Glass
00cca639d5 powerpc: ppc4xx: Add ramboot config for glacier
Add a new ramboot config for glacier so that it is possible to test U-Boot
loaded over Ethernet instead of using JTAG.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:30 -07:00
Simon Glass
6566041c0b powerpc: ppc4xx: Move CANYONLANDS/GLACIER/ARCHES to Kconfig
Move these options to Kconfig and remove them from the CONFIG files.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:30 -07:00
Simon Glass
0bca284b17 powerpc: ppc4xx: canyonlands: config: Tidy up CONFIGs and config.mk
Many CONFIG options have an unnecessary value of 1. CONFIG_440 is set in
the various board config files. Also simplify the CONFIG_440 check in
config.mk

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:30 -07:00
Simon Glass
c1c615735f powerpc: Permit device tree control of U-Boot (CONFIG_OF_CONTROL)
Enable this in the Kconfig so that PowerPC boards can use device tree to
configure U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:30 -07:00
Simon Glass
74d0186766 Introduce board_init_f_mem() to handle early memory layout
At present on some architectures we set up the following before calling
board_init_f():

   - global_data
   - stack
   - early malloc memory

Adding the code to support early malloc and global data setup to every
arch's assembler start-up is a pain. Also this code is not actually
architecture-specific. We can use common code for all architectures and
with a bit of care we can write this code in C.

Add a new function to deal with this. It should be called after memory
is available, with a pointer to the top of the area that should be used
before relocation. The function will set things up and return the lowest
memory address that it allocated/used. That can then be set as the top
of the stack.

Note that on some archs this function will use the stack, so the stack
pointer should be set to same value as is pased to board_init_f_mem().
A margin of 128 bytes will be left for this stack, so that it is not
overwritten. This means that 64 bytes is wasted by this early call.
This is not strictly necessary on several more modern archs, so we could
remove this at the cost of some arch-dependent code.

With this function there is no-longer any need for the assembler code to
zero global_data or set up the early malloc pointers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:29 -07:00
Hans de Goede
2c8571703a malloc_simple: Return NULL on malloc failure rather then calling panic()
All callers of malloc should already do error checking, and may even be able
to continue without the alloc succeeding.

Moreover, common/malloc_simple.c is the only user of .rodata.str1.1 in
common/built-in.o when building the SPL, triggering this gcc bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54303

Causing .rodata to grow with e.g. 0xc21 bytes, nullifying all benefits of
using malloc_simple in the first place.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:29 -07:00
Przemyslaw Marczak
a3e757a5d2 i2c: s3c24x0: reduce transmission status timeout
If no device is connected to I2C bus, the i2c probe command
can take a lot of time for probe each address. This commit
reduces the busy timeout to 10ms for standard and high speed
modes. This doesn't break the transmission an also allow for
properly probe the devices.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>

Changes v3:
- new commit, after split the next one
Tested-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:29 -07:00
Axel Lin
26c0472cb0 gpio: omap: Pass correct argument to _get_gpio_direction()
Pass bank rather than bank->base to _get_gpio_direction().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:29 -07:00
Axel Lin
d895821f4c gpio: at91: Fix getting address of private data
Use dev_get_priv() rather than dev_get_platdata() to get correct address of
private data.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:29 -07:00
Peter Tyser
b922a5f94d dm: Prevent "demo hello" and "demo status" segfaults
Segfaults can occur when a mandatory argument is not provided to
"demo hello" and "demo status".  Eg:

   => demo hello
   Segmentation fault (core dumped)

Add a check to ensure all required arguments are provided.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:29 -07:00