Commit Graph

28622 Commits

Author SHA1 Message Date
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
Chris Kuethe
9009798df2 RSA depends on DM
Discovered while experimenting with signature checking on vexpress
which doesn't typically use DM.
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-12 10:35:29 -07:00
Michael Walle
4fe49d7bec lsxl: switch from bootm to bootz for boot commands
Use the bootz command to load zImages in case of any new boot scripts. Only
the legacy one will still use bootm. Apart form the fact, that this will
simplify the image generation process, it saves one copy of the kernel
image: Common practice is to generate an uImage with a loading address of
0x8000. This uImage contains a compressed zImage, which will unpack the
kernel image to the beginning of the RAM. But because there is already the
compressed image the uncompressor first relocates the compressed image to a
higher location. The load address is encoded into the uImage which is
generated by the distributions and thus cannot be easily changed. By using
the bootz command we can load the compressed image to a higher memory
address and the decompressor doesn't have to reloacte the image.

Signed-off-by: Michael Walle <michael@walle.cc>
2015-02-12 15:28:02 +01:00
Michael Walle
145df6fe2a lsxl: place the dtb below the inital ramdisk
The dtb was loaded at a memory address after the initial ramdisk. Thus a
large ramdisk would overwrite the dtb. Move it to "ramdisk_start - 64k".
64k should be enough for the device tree blob. Also the kernel
documentation arm/Booting suggests to put the dtb before the initial
ramdisk.

Signed-off-by: Michael Walle <michael@walle.cc>
2015-02-12 15:28:02 +01:00
Michael Walle
bc2ad9f04d lsxl: use default load addresses for legacy boot
The load addresses for the bootcmd_legacy script were taken from the
original bootloader from Buffalo. But newer kernels are too big and the
uncompressing will overwrite parts of the initial ramdisk. Therefore,
we switch to the load addresses which are also used by the other boot
script.

Signed-off-by: Michael Walle <michael@walle.cc>
2015-02-12 15:28:02 +01:00
Hans de Goede
bd2a4888b1 sunxi: configs/sunxi-common.h: Enable CONFIG_CMD_PART
The recent changes to config_distro_bootcmd.h require CONFIG_CMD_PART to be
defined, as the default bootcmd not uses the "part" command.

This fixes sunxi boards not booting with v2015.04-rc1.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-02-11 19:43:45 -05:00
Hans de Goede
478b02f1a7 Add linux/compiler-gcc5.h to fix builds with gcc5
Add linux/compiler-gcc5/h from the kernel sources at:

commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b
Author: Steven Noonan <steven@uplinklabs.net>
Date:   Sat Oct 25 15:09:42 2014 -0700

    compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-02-11 19:43:45 -05:00
Tom Rini
db7a7dee68 Merge branch 'master' of git://git.denx.de/u-boot-x86 2015-02-10 10:42:56 -05:00
Tom Rini
c956662cc3 Merge branch 'master' of git://git.denx.de/u-boot-atmel 2015-02-10 10:42:22 -05:00
Tom Rini
0dac731d19 Merge branch 'master' of git://git.denx.de/u-boot-video
Conflicts:
	include/splash.h

Signed-off-by: Tom Rini <trini@ti.com>
2015-02-10 10:41:54 -05:00
Tom Rini
307367eaff Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2015-02-10 10:40:43 -05:00
Nikita Kiryanov
7bf71d1f55 lcd: split splash code into its own function
lcd_logo() currently performs tasks well beyond just displaying the logo.
It has code which displays splash image, it has logic which determines
when the different display features are displayed, and it is coupled with
the lcd console because it holds the responsibility of returning the
lcd console base address.

Make lcd_logo() just about the logo by:
* Moving splash image display code into a dedicated function
* Moving the logic regarding when various features are displayed to
  lcd_clear() (which is arguably not the correct name for housing such
  code either, but it is currently the most fitting location code wise)
* Move the responsibility of setting the console base address to
  lcd_clear() too.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Bo Shen <voice.shen@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
2015-02-10 13:31:58 +01:00
Nikita Kiryanov
033167c4c5 lcd: dt: extract simplefb support
We now have api functions that can support compiling simplefb code as its own
module. Since this code is not part of the display functionality, extract it
to its own file.

Raspberry Pi is updated to accommodate the changes.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stephen Warren <swarren@wwwdotorg.org>
2015-02-10 13:31:26 +01:00
Nikita Kiryanov
bf21a5deb9 lcd: rename bitmap_plot to better represent its functionality
The name "bitmap_plot" is misleading because it implies that this is a generic
function capable of dealing with any bitmap, but its implementation only works
with the logo data.

Rename the function to better reflect this.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
2015-02-10 13:30:49 +01:00
Nikita Kiryanov
c8d2febcc7 lcd: various cleanups
This cleanup mostly focuses on removing unnecessary whitespace and comments
which are superfluous and/or do not conform to the coding style.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
2015-02-10 13:30:20 +01:00
Nikita Kiryanov
8ddfe2fad8 lcd: remove unused includes
Remove unused includes.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Bo Shen <voice.shen@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
2015-02-10 13:29:44 +01:00
Nikita Kiryanov
0b29a8969e lcd: introduce lcd_set_cmap
Reduce the lcd_display_bitmap #ifdef complexity by extracting Atmel-specific
code for setting cmap for bitmap images into a new function lcd_set_cmap().
A default version is implemented with the remainder of the code.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Bo Shen <voice.shen@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
2015-02-10 13:29:02 +01:00
Nikita Kiryanov
2306457c45 lcd: logo: move generic cmap setting to lcd_logo_set_cmap()
Get rid of platform-specific #ifdefs in bitmap_plot() by moving the generic
case of setting cmap into the weak lcd_logo_set_cmap().

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Bo Shen <voice.shen@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
2015-02-10 13:28:30 +01:00
Nikita Kiryanov
0ee261f6d3 lcd: mpc823: move mpc823-specific lcd_logo_set_cmap code to mpc8xx_lcd.c
Reduce the bitmap_plot #ifdef complexity by extracting MPC823-specific code for
setting cmap into its own implementation of lcd_logo_set_cmap(), implemented in
mpc8xx_lcd.c. In the MPC823 implementation, ARRAY_SIZE(bmp_logo_palette) is
switched for BMP_LOGO_COLORS to avoid having to include bmp_logo_data.h, which
would cause a compilation error because the logo data and palette arrays would
be defined twice.

This is a step towards cleaning bitmap_plot() of platform-specific code.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
2015-02-10 13:27:58 +01:00