platform/kernel/u-boot.git
10 years agospi: altera: Clean up the use of variable d
Marek Vasut [Wed, 22 Oct 2014 19:56:02 +0000 (21:56 +0200)]
spi: altera: Clean up the use of variable d

The variable d is used in rather questionable way. Rework the code
a bit so it's clearer what it does. Also, rename the variable from
d to data to make it's name less mysterious. Finally, change it's
data type to uint32_t , since it's accessed as a 32bit number.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
10 years agospi: altera: Zap endless loop
Marek Vasut [Wed, 22 Oct 2014 19:56:01 +0000 (21:56 +0200)]
spi: altera: Zap endless loop

The driver contained an endless loop when waiting for TX completion,
this is a bad idea since if the hardware fails, the loop might spin
forever. Add timeout and handle it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
10 years agospi: altera: Clean up most checkpatch issues
Marek Vasut [Wed, 22 Oct 2014 19:56:00 +0000 (21:56 +0200)]
spi: altera: Clean up most checkpatch issues

This patch just zaps most of the checkpatch cries present in the
driver. There is one more left, which will be addressed separately.
There is no functional change.

This patch also adds a bunch of newlines all around the place, this
is to make the code much more readable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
10 years agospi: altera: Clean up bit definitions
Marek Vasut [Wed, 22 Oct 2014 19:55:59 +0000 (21:55 +0200)]
spi: altera: Clean up bit definitions

Clean up the definitions of bits in the Altera SPI driver, there
is no need to put braces around numbers afterall. No functional
change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
10 years agospi: altera: Use struct-based register access
Marek Vasut [Wed, 22 Oct 2014 19:55:58 +0000 (21:55 +0200)]
spi: altera: Use struct-based register access

Zap the offset-based register access and use the struct-based one
as this is the preferred method.

No functional change, but there are some line-over-80 problems in
the driver, which will be addressed later.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
10 years agoMerge branch 'master' of git://git.denx.de/u-boot-imx
Tom Rini [Mon, 27 Oct 2014 13:08:42 +0000 (09:08 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-imx

10 years agoMerge branch 'master' of git://git.denx.de/u-boot-ti
Tom Rini [Mon, 27 Oct 2014 13:05:43 +0000 (09:05 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-ti

10 years agoMerge branch 'master' of git://git.denx.de/u-boot-socfpga
Tom Rini [Mon, 27 Oct 2014 13:05:20 +0000 (09:05 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-socfpga

10 years agoarm: socfpga: config: Add USB support example
Marek Vasut [Fri, 24 Oct 2014 21:34:25 +0000 (23:34 +0200)]
arm: socfpga: config: Add USB support example

Add example configuration stub for the DWC2 USB controller.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Vince Bridgers <vbridger@altera.com>
Cc: Pavel Machek <pavel@denx.de>
10 years agotools/socfpgaimage.c: fix build on darwin
Andreas Bießmann [Fri, 24 Oct 2014 21:39:10 +0000 (23:39 +0200)]
tools/socfpgaimage.c: fix build on darwin

socfpgaimage utilizes htole32 and friends, unfortunately these functions are
not available on darwin. Fix it by using the cpu_to_le32 and friends defined
in compiler.h as other parts in mkimage do.

This patch fixes the following error:
---8<---
  HOSTCC  tools/socfpgaimage.o
tools/socfpgaimage.c:77:22: warning: implicit declaration of function 'htole32' is invalid in C99 [-Wimplicit-function-declaration]
        header.validation = htole32(VALIDATION_WORD);
                            ^
tools/socfpgaimage.c:80:22: warning: implicit declaration of function 'htole16' is invalid in C99 [-Wimplicit-function-declaration]
        header.length_u32 = htole16(length_bytes/4);
                            ^
tools/socfpgaimage.c:95:6: warning: implicit declaration of function 'le32toh' is invalid in C99 [-Wimplicit-function-declaration]
        if (le32toh(header.validation) != VALIDATION_WORD)
            ^
tools/socfpgaimage.c:97:6: warning: implicit declaration of function 'le16toh' is invalid in C99 [-Wimplicit-function-declaration]
        if (le16toh(header.checksum) != hdr_checksum(&header))
            ^
4 warnings generated.
...
  HOSTLD  tools/dumpimage
Undefined symbols for architecture x86_64:
  "_htole16", referenced from:
      _socfpgaimage_set_header in socfpgaimage.o
  "_htole32", referenced from:
      _socfpgaimage_set_header in socfpgaimage.o
  "_le16toh", referenced from:
      _verify_buffer in socfpgaimage.o
  "_le32toh", referenced from:
      _verify_buffer in socfpgaimage.o
ld: symbol(s) not found for architecture x86_64
--->8---

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Acked-by: Pavel Machek <pavel@denx.de>
10 years agoarm: socfpga: Zap CONFIG_EPHY[01]_PHY_ADDR macro
Marek Vasut [Wed, 22 Oct 2014 17:57:42 +0000 (19:57 +0200)]
arm: socfpga: Zap CONFIG_EPHY[01]_PHY_ADDR macro

This is not used anywhere, remove it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Acked-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Vince Bridgers <vbridger@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
10 years agoarm: socfpga: Zap spl.h and ad-hoc related syms
Marek Vasut [Thu, 16 Oct 2014 10:25:40 +0000 (12:25 +0200)]
arm: socfpga: Zap spl.h and ad-hoc related syms

Switch to the common spl.h file and zap the arch/spl.h . Since the arch/spl.h
contained various ad-hoc symbols, zap those symbols as well and rework the
board configuration a little so it doesn't depend on them.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Vince Bridgers <vbridger@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Acked-by: Pavel Machek <pavel@denx.de>
10 years agoarm: socfpga: Move code from misc_init_r() to arch_early_init_r()
Marek Vasut [Sat, 18 Oct 2014 01:52:36 +0000 (03:52 +0200)]
arm: socfpga: Move code from misc_init_r() to arch_early_init_r()

Move this initialization code to proper place. The misc_init_r()
function is called way too late and the platform initialization
code should be executed much earlier.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Vince Bridgers <vbridger@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Acked-by: Pavel Machek <pavel@denx.de>
10 years agoMerge http://git.denx.de/u-boot-sunxi
Tom Rini [Sun, 26 Oct 2014 18:13:24 +0000 (14:13 -0400)]
Merge http://git.denx.de/u-boot-sunxi

10 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Sun, 26 Oct 2014 18:12:18 +0000 (14:12 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

10 years agoMerge git://git.denx.de/u-boot-dm
Tom Rini [Sun, 26 Oct 2014 18:03:08 +0000 (14:03 -0400)]
Merge git://git.denx.de/u-boot-dm

Fix a trivial conflict over adding <dm.h>

Conflicts:
arch/arm/cpu/armv7/omap3/board.c

Signed-off-by: Tom Rini <trini@ti.com>
10 years agoi2c: designware: add an implement i2c protos
Jeroen Hofstee [Wed, 8 Oct 2014 20:58:09 +0000 (22:58 +0200)]
i2c: designware: add an implement i2c protos

Include the i2c header and change the non confirming
functions to do so.

Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Acked-by: Heiko Schocher <hs@denx.de>
[trini: Fix i2c_get_bus_num prototype]
Signed-off-by: Tom Rini <trini@ti.com>
10 years agotegra: add proto for pin_mux_mmc
Jeroen Hofstee [Wed, 8 Oct 2014 20:58:08 +0000 (22:58 +0200)]
tegra: add proto for pin_mux_mmc

while at it, fix a typo

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agospl: add prototype for jump_to_image_no_args
Jeroen Hofstee [Wed, 8 Oct 2014 20:58:07 +0000 (22:58 +0200)]
spl: add prototype for jump_to_image_no_args

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agommc: add prototype for mmc_get_env_addr
Jeroen Hofstee [Wed, 8 Oct 2014 20:58:05 +0000 (22:58 +0200)]
mmc: add prototype for mmc_get_env_addr

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoide: add missing prototype
Jeroen Hofstee [Wed, 8 Oct 2014 20:58:04 +0000 (22:58 +0200)]
ide: add missing prototype

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agogpio: add protype for name_to_gpio
Jeroen Hofstee [Wed, 8 Oct 2014 20:58:03 +0000 (22:58 +0200)]
gpio: add protype for name_to_gpio

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agofdt_support: add prototypes for __weak functions
Jeroen Hofstee [Wed, 8 Oct 2014 20:58:02 +0000 (22:58 +0200)]
fdt_support: add prototypes for __weak functions

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoelf: add prototype for valid_elf_image
Jeroen Hofstee [Wed, 8 Oct 2014 20:58:01 +0000 (22:58 +0200)]
elf: add prototype for valid_elf_image

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agobootm: add prototype for arch_preboot_os
Jeroen Hofstee [Wed, 8 Oct 2014 20:58:00 +0000 (22:58 +0200)]
bootm: add prototype for arch_preboot_os

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoarm: vectors: provide protypes from vectors.S
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:59 +0000 (22:57 +0200)]
arm: vectors: provide protypes from vectors.S

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
10 years agotwister: add missing includes
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:58 +0000 (22:57 +0200)]
twister: add missing includes

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoomap3: board: add missing include and proto
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:57 +0000 (22:57 +0200)]
omap3: board: add missing include and proto

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agonet: davince: add missing include
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:56 +0000 (22:57 +0200)]
net: davince: add missing include

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agommc: bcm2835_sdhci: add missing include
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:55 +0000 (22:57 +0200)]
mmc: bcm2835_sdhci: add missing include

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agolib: bootm: add missing include
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:54 +0000 (22:57 +0200)]
lib: bootm: add missing include

since the vxworks weaks are reimplement make
sure their prototypes are visible.

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoleds: missing include
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:53 +0000 (22:57 +0200)]
leds: missing include

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoimx: add missing includes
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:52 +0000 (22:57 +0200)]
imx: add missing includes

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agocommon/cmd_elf.c: add missing include
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:51 +0000 (22:57 +0200)]
common/cmd_elf.c: add missing include

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
[trini: bootm.h must come after common.h]
Signed-off-by: Tom Rini <trini@ti.com>
10 years agoarch-mx: add missing include
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:50 +0000 (22:57 +0200)]
arch-mx: add missing include

mxs_wait_mask_set and friends need a declaration
of struct mxs_register_32.

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agostring.h: add missing prototypes
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:49 +0000 (22:57 +0200)]
string.h: add missing prototypes

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agocommon:console: add missing include
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:48 +0000 (22:57 +0200)]
common:console: add missing include

search_device is declared in iomux, but console only
had the definition. This prevents a warning.

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agomodem.c: Switch to debug() from dbg found in common/console.c
Tom Rini [Sat, 25 Oct 2014 00:26:19 +0000 (20:26 -0400)]
modem.c: Switch to debug() from dbg found in common/console.c

Signed-off-by: Tom Rini <trini@ti.com>
10 years agovideo: ipu: prevent warnings with W=1
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:47 +0000 (22:57 +0200)]
video: ipu: prevent warnings with W=1

- make local functions static
- remove unused is_interlaced function

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agotegra: make local functions static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:46 +0000 (22:57 +0200)]
tegra: make local functions static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoserial: make local functions static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:44 +0000 (22:57 +0200)]
serial: make local functions static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agosdhci: make local functions static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:43 +0000 (22:57 +0200)]
sdhci: make local functions static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoomap_gpmc: fix warnigs with W=1
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:42 +0000 (22:57 +0200)]
omap_gpmc: fix warnigs with W=1

- make omap_spl_dev_ready static
- make omap_reverse_list static, move to under CONFIG_NAND_OMAP_ELM

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Signed-off-by: Tom Rini <trini@ti.com>
10 years agoomap3: make local functions static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:41 +0000 (22:57 +0200)]
omap3: make local functions static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agonet: fec_mxc: make local functions static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:40 +0000 (22:57 +0200)]
net: fec_mxc: make local functions static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agolmb: make local functions static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:39 +0000 (22:57 +0200)]
lmb: make local functions static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoimage-fit: make local function static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:38 +0000 (22:57 +0200)]
image-fit: make local function static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agogpio: make local functions static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:37 +0000 (22:57 +0200)]
gpio: make local functions static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoeth: make eth_address_set static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:36 +0000 (22:57 +0200)]
eth: make eth_address_set static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoenv_nand: make local functions static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:35 +0000 (22:57 +0200)]
env_nand: make local functions static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoehci-hcd.c: make local functions static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:34 +0000 (22:57 +0200)]
ehci-hcd.c: make local functions static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agodisk/part.c: make local function static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:33 +0000 (22:57 +0200)]
disk/part.c: make local function static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agocommon: board_r: make local functions static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:32 +0000 (22:57 +0200)]
common: board_r: make local functions static

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agocommon: cmd_elf: make do_bootelf_exec static
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:31 +0000 (22:57 +0200)]
common: cmd_elf: make do_bootelf_exec static

do_bootelf_exec was a weak function without a prototype nor
and strong version. Just make it static.

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agovideo: use __weak
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:30 +0000 (22:57 +0200)]
video: use __weak

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agousb: use __weak
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:29 +0000 (22:57 +0200)]
usb: use __weak

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agosamsung: board: use __weak
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:28 +0000 (22:57 +0200)]
samsung: board: use __weak

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agopci: use __weak
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:27 +0000 (22:57 +0200)]
pci: use __weak

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agonet: phy: fix warnings with W=1
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:26 +0000 (22:57 +0200)]
net: phy: fix warnings with W=1

get_phy_id is marked weak but has no protype nor a
strong version, just make it static. Use __weak for
board_phy_config.

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agomisc: use __weak
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:25 +0000 (22:57 +0200)]
misc: use __weak

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agocti_flash.c: use __weak when requested for flash_(read|write){8,16,32,64}
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:23 +0000 (22:57 +0200)]
cti_flash.c: use __weak when requested for flash_(read|write){8,16,32,64}

For various reasons (design, errata) boards may need to implement their
own versions of these accessors.  So in the case of
CONFIG_CFI_FLASH_USE_WEAK_ACCESSOR mark the functions as weak.  In the
normal case mark them as static to allow for better optimization.

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
[trini: Reword commit message]
Signed-off-by: Tom Rini <trini@ti.com>
10 years agocommon: board: use __weak
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:22 +0000 (22:57 +0200)]
common: board: use __weak

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
10 years agoarm: board: use __weak
Jeroen Hofstee [Wed, 8 Oct 2014 20:57:21 +0000 (22:57 +0200)]
arm: board: use __weak

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
10 years agosunxi: Add CONFIG_OLD_SUNXI_KERNEL_COMPAT Kconfig option
Hans de Goede [Wed, 22 Oct 2014 12:56:36 +0000 (14:56 +0200)]
sunxi: Add CONFIG_OLD_SUNXI_KERNEL_COMPAT Kconfig option

Add a Kconfig option which users can select when they want to boot older
kernels, e.g. the linux-sunxi 3.4 kernels. For now this just forces the pll5
"p" value to 1 (divide by 2) as that is what those kernels are hardcoded too,
in the future this may enable further workarounds.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Tom Rini <trini@ti.com>
--
Changes in v2:
-s/CONFIG_OLD_KERNEL_COMPAT/CONFIG_OLD_SUNXI_KERNEL_COMPAT.
-Move the code block setting P(1) for old kernels to where P gets cleared

10 years agosunxi: dram: Use clock_get_pll5p to calculate mbus, rather then hardcoding
Hans de Goede [Wed, 22 Oct 2014 12:48:38 +0000 (14:48 +0200)]
sunxi: dram: Use clock_get_pll5p to calculate mbus, rather then hardcoding

This is a preparation patch for making the pll5 "p" divisor configurable
through Kconfig.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agosunxi: Add clock_get_pll5p() function
Hans de Goede [Wed, 22 Oct 2014 12:42:48 +0000 (14:42 +0200)]
sunxi: Add clock_get_pll5p() function

This is a preparation patch for making the pll5 "p" divisor configurable
through Kconfig.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agosunxi: Increase command line buffer size (CONFIG_SYS_CBSIZE)
Ian Campbell [Tue, 7 Oct 2014 13:20:30 +0000 (14:20 +0100)]
sunxi: Increase command line buffer size (CONFIG_SYS_CBSIZE)

I was running into this limit with a not overly long PXE append line.

Since the PXE code wants to print the resulting command line increase
CONFIG_SYS_PBSIZE too.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
10 years agoARM: sunxi: Add Ippo-q8h-v5 A23 tablet board defconfig
Chen-Yu Tsai [Wed, 22 Oct 2014 08:47:48 +0000 (16:47 +0800)]
ARM: sunxi: Add Ippo-q8h-v5 A23 tablet board defconfig

Ippo q8h is a series of A23 tablet boards. This defconfig
is for v5 of these boards, though for u-boot purposes they
are mostly the same.

See: http://linux-sunxi.org/Ippo_q8h

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Add support for using R_UART as console
Chen-Yu Tsai [Wed, 22 Oct 2014 08:47:47 +0000 (16:47 +0800)]
ARM: sunxi: Add support for using R_UART as console

The A23 only has UART0 muxed with MMC0. Some of the boards we
encountered expose R_UART as a set of pads.

Add support for R_UART so we can have a console while using mmc.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Allow specifying module in prcm apb0 init function
Chen-Yu Tsai [Wed, 22 Oct 2014 08:47:46 +0000 (16:47 +0800)]
ARM: sunxi: Allow specifying module in prcm apb0 init function

The prcm apb0 controls multiple modules. Allow specifying which
modules to enable clocks and de-assert resets so the function
can be reused.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Add support for R_PIO gpio banks
Hans de Goede [Wed, 22 Oct 2014 08:47:45 +0000 (16:47 +0800)]
ARM: sunxi: Add support for R_PIO gpio banks

The A31, A23 and later SoCs have an extra pin controller, called CPUs_PIO
or R_PIO, which handles pin banks L and beyond.

Also add a clear description about SUNXI_GPIO_BANKS, stating it only
counts the number of pin banks in the _main_ pin controller.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[wens@csie.org: expanded commit message]
[wens@csie.org: add pin bank M and expand comments]
[wens@csie.org: add comment on SUNXI_GPIO_BANKS macro]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Add basic A23 support
Chen-Yu Tsai [Wed, 22 Oct 2014 08:47:44 +0000 (16:47 +0800)]
ARM: sunxi: Add basic A23 support

The basic blocks of the A23 are similar to the A31 (sun6i). Re-use
sun6i code for initial clock, gpio, and uart setup.

There is no SPL support for A23, as we do not have any documentation
or sample code for DRAM initialization.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agommc: sunxi: Add support for sun8i (A23)
Chen-Yu Tsai [Wed, 22 Oct 2014 08:47:43 +0000 (16:47 +0800)]
mmc: sunxi: Add support for sun8i (A23)

The Allwinner A23 SoC has reset controls like the A31 (sun6i).
The FIFO address is also the same as sun6i.

Re-use code added for sun6i.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Add support for uart0 on port F (mmc0)
Chen-Yu Tsai [Wed, 22 Oct 2014 08:47:42 +0000 (16:47 +0800)]
ARM: sunxi: Add support for uart0 on port F (mmc0)

Allwinner SoCs provide uart0 muxed with mmc0, which can then be used
with a micro SD breakout board. On the A23, this is the only way to
use uart0.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Add sun8i (A23) UART0 pin mux support
Chen-Yu Tsai [Wed, 22 Oct 2014 08:47:41 +0000 (16:47 +0800)]
ARM: sunxi: Add sun8i (A23) UART0 pin mux support

UART0 pin muxes on the A23 have a different function value.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Fix reset command on sun6i/sun8i
Chen-Yu Tsai [Sat, 4 Oct 2014 12:37:28 +0000 (20:37 +0800)]
ARM: sunxi: Fix reset command on sun6i/sun8i

The watchdog on sun6i/sun8i has a different layout.

Add the new layout and fix up the setup functions so that reset works.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
[ ijc -- removed sun5i workaround from sun6i/sun8i codepath as discussed ]

10 years agoARM: sunxi: Add sun6i/sun8i timer block register definition
Chen-Yu Tsai [Sat, 4 Oct 2014 12:37:27 +0000 (20:37 +0800)]
ARM: sunxi: Add sun6i/sun8i timer block register definition

The RTC hardware has been moved out of the timer block on sun6i/sun8i.
In addition, there are more watchdogs available.

Also note that the timer block definition is not completely accurate
for sun5i/sun7i. Various blocks are missing or have been moved out.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Move watchdog register definitions to separate file
Chen-Yu Tsai [Sat, 4 Oct 2014 12:37:26 +0000 (20:37 +0800)]
ARM: sunxi: Move watchdog register definitions to separate file

On later Allwinner SoCs, the watchdog hardware is by all means a
separate hardware block, with its own address range and interrupt
line.

Move the register definitions to a separate file to facilitate
supporting newer SoCs.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Fix build break when CONFIG_MMC is not defined
Chen-Yu Tsai [Tue, 7 Oct 2014 07:11:49 +0000 (15:11 +0800)]
ARM: sunxi: Fix build break when CONFIG_MMC is not defined

BOOT_TARGET_DEVICES includes MMC unconditionally. This breaks when
CONFIG_CMD_MMC is not defined. Use a secondary macro to conditionally
include it when CONFIG_MMC is enabled, as we do for CONFIG_AHCI.

This is used when we want to use uart0 from port F, which conflicts
with mmc0.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agosunxi: Add CONFIG_MACH_TYPE defines to sun4i, sun5i and sun7i
Hans de Goede [Mon, 13 Oct 2014 05:41:16 +0000 (07:41 +0200)]
sunxi: Add CONFIG_MACH_TYPE defines to sun4i, sun5i and sun7i

Many people are still using old linux-sunxi-3.4 kernels on sunxi devices,
adding the proper MACH_TYPE defines for this allows people to switch to
upstream u-boot, so that we can stop maintaining the linux-sunxi u-boot fork.

These machine-ids are all properly registered at:

http://www.arm.linux.org.uk/developer/machines/

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agosunxi: Kconfig: Unify sunxi Kconfig code
Hans de Goede [Wed, 13 Aug 2014 12:02:29 +0000 (14:02 +0200)]
sunxi: Kconfig: Unify sunxi Kconfig code

Unify the sunxi Kconfig code, instead of having separate code blocks for
each of sun4i - sun7i.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agosunxi: Enable second sdcard slot found on some boards
Hans de Goede [Fri, 3 Oct 2014 14:58:04 +0000 (16:58 +0200)]
sunxi: Enable second sdcard slot found on some boards

Enable the second sdcard slot found on some boards. Note that we do not
set CONFIG_MMC_SUNXI_SLOT_EXTRA for the SPL, as having it there is not useful,

Except for on the Mele-M3 where the second sdcard is an eMMC, from which the
device can also boot, and there we want to have both in the SPL, so that
a single u-boot binary can both from both. So for the M3 we do prefix the
defconfig setting with the special "+S:" syntax so that it applies to the
SPL too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agosunxi: Use PG3 - PG8 as io-pins for mmc1
Hans de Goede [Fri, 3 Oct 2014 14:44:57 +0000 (16:44 +0200)]
sunxi: Use PG3 - PG8 as io-pins for mmc1

None of the known sunxi devices actually use mmc1 routed through PH, where
as some devices do actually use mmc1 routed through PG, so change the routing
of mmc1 to PG. If in the future we encounter devices with mmc1 routed through
PH, we will need to change things to be a bit more flexible.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agosunxi: When we've both mmc0 and mmc2, detect from which one we're booting
Hans de Goede [Thu, 2 Oct 2014 19:13:54 +0000 (21:13 +0200)]
sunxi: When we've both mmc0 and mmc2, detect from which one we're booting

sunxi SOCs can boot from both mmc0 and mmc2, detect from which one we're
booting, and make that one "mmc dev 0" so that a single u-boot binary can
be used for both the onboard eMMC and for external sdcards.

When we're booting from mmc2, we make it dev 0 because that is where the SPL
will load the tertiary payload (the actual u-boot binary in our case) from,
see: common/spl/spl_mmc.c, which has dev 0 hardcoded everywhere.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agosunxi: Turn MMC_SUNXI_SLOT_EXTRA into a proper Kconfig option
Hans de Goede [Thu, 2 Oct 2014 18:43:50 +0000 (20:43 +0200)]
sunxi: Turn MMC_SUNXI_SLOT_EXTRA into a proper Kconfig option

Note we also drop the SPL check for initializing the 2nd mmc slot, the SPL
check is not necessary with Kconfig, because only options explicitly marked
as also being for the SPL get set during SPL builds.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agosunxi: Add mmc card-detect functionality
Hans de Goede [Thu, 2 Oct 2014 18:29:26 +0000 (20:29 +0200)]
sunxi: Add mmc card-detect functionality

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sun6i: Add Colombus board defconfig
Chen-Yu Tsai [Fri, 3 Oct 2014 12:16:30 +0000 (20:16 +0800)]
ARM: sun6i: Add Colombus board defconfig

The Colombus board is an A31 evaluation board from WITS Technology.

Maxime has kindly agreed to maintain this board.

[1] http://lists.denx.de/pipermail/u-boot/2014-September/190043.html

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Add basic A31 support
Maxime Ripard [Fri, 3 Oct 2014 12:16:29 +0000 (20:16 +0800)]
ARM: sunxi: Add basic A31 support

Add a new sun6i machine that supports UART and MMC.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[wens@csie.org: use SPDX labels, adapt to Kconfig system, drop ifdef
around mmc and smp code, drop MACH_TYPE]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sun6i: Setup the A31 UART0 muxing
Maxime Ripard [Fri, 3 Oct 2014 12:16:28 +0000 (20:16 +0800)]
ARM: sun6i: Setup the A31 UART0 muxing

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[wens@csie.org: commit message was "ARM: sunxi: Setup the A31 UART0 muxing"]
[wens@csie.org: reorder #ifs by SUN?I]
[wens@csie.org: replace magic numbers with GPIO definitions]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sun6i: Define UART0 pins for A31
Chen-Yu Tsai [Fri, 3 Oct 2014 12:16:27 +0000 (20:16 +0800)]
ARM: sun6i: Define UART0 pins for A31

UART0 is the default debug/console UART on the A31.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi-mmc: Add mmc support for sun6i / A31
Hans de Goede [Fri, 3 Oct 2014 12:16:26 +0000 (20:16 +0800)]
ARM: sunxi-mmc: Add mmc support for sun6i / A31

The mmc hardware on sun6i has an extra reset control that needs to
be de-asserted prior to usage. Also the FIFO address is different.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[wens@csie.org: use setbits_le32 for reset control, drop obsolete changes,
rewrite different FIFO address handling, add commit message]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sun6i: Add clock support
Chen-Yu Tsai [Fri, 3 Oct 2014 12:16:25 +0000 (20:16 +0800)]
ARM: sun6i: Add clock support

This patch adds the basic clocks support for the Allwinner A31 (sun6i)
processor. This code will not been compiled until the build is hooked
up in a later patch. It has been split out to keep the patches manageable.

This includes changes from the following commits from u-boot-sunxi:

a92051b ARM: sunxi: Add sun6i clock controller structure
1f72c6f ARM: sun6i: Setup the UART0 clocks
5f2e712 ARM: sunxi: Enable pll6 by default on all models
2be2f2a ARM: sunxi-mmc: Add mmc support for sun6i / A31
12e1633 ARM: sun6i: Add initial clock setup for SPL
1a9c9c6 ARM: sunxi: Split clock code into common, sun4i and sun6i code
0b194ee ARM: sun6i: Properly setup the PLL LDO in clock_init_safe
b54c626 sunxi: avoid sr32 for APB1 clock setup.
68fe29c sunxi: remove magic numbers from clock_get_pll{5,6}
c89867d sunxi: clocks: clock_get_pll5 prototype and coding style
501ab1e ARM: sunxi: Fix sun6i PLL6 settings
37f669b ARM: sunxi: Fix macro names for mmc and uart reset offsets
61de1e6 ARM: sunxi: Correct comment for MBUS1 register in sun6i clock definitions

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[wens@csie.org: styling fixes reported by checkpatch.pl]
[wens@csie.org: drop unsupported SPL code block and unused gpio.h header]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Cc: Tom Cubie <Mr.hipboi@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sun6i: Add support for the power reset control module found on the A31
Oliver Schinagl [Fri, 3 Oct 2014 12:16:24 +0000 (20:16 +0800)]
ARM: sun6i: Add support for the power reset control module found on the A31

The A31 has a new module called PRCM, or Power, Reset Control Module.
This module controls clocks and resets for RTC block modules, and also
PLL biasing in the main clock module.

This patch adds the register definitions, and also enables the clocks
and resets for the RTC block PIO (pin controller) and P2WI (push-pull
2 wire interface) which is used to talk to the PMIC.

Signed-off-by: Oliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[wens@csie.org: spacing fixes reported by checkpatch.pl]
[wens@csie.org: Use setbits helper in PRCM init function]
[wens@csie.org: rephrase commit message to explain what the hardware
supports and what we actually enable]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sun6i: Add base address for the new controllers in A31
Oliver Schinagl [Fri, 3 Oct 2014 12:16:23 +0000 (20:16 +0800)]
ARM: sun6i: Add base address for the new controllers in A31

A31 has several new and changed memory address. This patch adds them.

Signed-off-by: Oliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Fix build break when CONFIG_USB_EHCI is not defined
Chen-Yu Tsai [Fri, 3 Oct 2014 12:16:22 +0000 (20:16 +0800)]
ARM: sunxi: Fix build break when CONFIG_USB_EHCI is not defined

BOOT_TARGET_DEVICES includes USB unconditionally. This breaks when
CONFIG_CMD_USB is not defined. Use a secondary macro to conditionally
include it when CONFIG_EHCI is enabled, as we do for CONFIG_AHCI.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agoARM: sunxi: Use macro values for setting UART GPIO pull-ups
Chen-Yu Tsai [Fri, 3 Oct 2014 12:16:21 +0000 (20:16 +0800)]
ARM: sunxi: Use macro values for setting UART GPIO pull-ups

We have already defined macros for pull-up/down values in the
GPIO header. Use them instead of magic numbers when configuring
the UART pins.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agosunxi: Add support for the Mele M3 board
Hans de Goede [Tue, 30 Sep 2014 14:12:39 +0000 (16:12 +0200)]
sunxi: Add support for the Mele M3 board

The Mele M3 is yet another Allwinnner based Android top set box from Mele.

It uses a housing similar to the A2000, but without the USM sata storage slot
at the top.

It features an A20 SoC, 1G RAM, 4G eMMC (unique for Allwinner devices),
100Mbit ethernet, HDMI out, 3 USB A receptacles, VGA, and A/V OUT connections.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
10 years agommc: sunxi: add SDHC support for sun6i/sun7i/sun8i
Wills Wang [Mon, 22 Sep 2014 10:26:03 +0000 (18:26 +0800)]
mmc: sunxi: add SDHC support for sun6i/sun7i/sun8i

Allwinner A20/A23/A31's SD/MMC host support SDHC High Capacity feature.

Signed-off-by: Wills Wang <wills.wang.open@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agosun7i: Add support for Olimex A20-OLinuXino-LIME2
Iain Paton [Sun, 28 Sep 2014 13:18:42 +0000 (14:18 +0100)]
sun7i: Add support for Olimex A20-OLinuXino-LIME2

This adds support for the Olimex A20-OLinuXino-Lime2
https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXIno-LIME2

Differences to previous Lime boards are 1GB RAM and gigabit ethernet

Signed-off-by: Iain Paton <ipaton0@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agoserial: remove uniphier_serial_initialize() call
Masahiro Yamada [Thu, 23 Oct 2014 13:26:12 +0000 (22:26 +0900)]
serial: remove uniphier_serial_initialize() call

The UniPhier serial driver has been converted to driver model.
Let's remove uniphier_serial_initialize() call from the old
serial driver framework.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>