ARM v7: Flush icache when executing a program with go

ARM v7 runs with icache enabled. For reliable results the go command
needs to flush the icache before jumping or it may risk running
cached instructions that differ from what currently is in memory.

Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>
mkconfig: Make CONFIG_SYS_BOARD_NAME default to the configured target name

This change makes CONFIG_SYS_BOARD_NAME globally available as the configured
target name, avoiding the need to define manually for boards having multiple
targets sharing the same board implementation.

Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>
Makefile: Accept target names in all lower case to ease matching

Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>
sunxi: Really fix case-insensitive *_config targets

Conflicts:
	Makefile
ARM: sunxi: Basic Allwinner A10/A13/A10s (sun4i/sun5i) support

Basic support for Allwinner A10/A13/A10s family of SoC's and dev boards

This work is in part based on sun4i u-boot version published by Allwinner

Signed-off-by: Henrik Nordström <henrik@henriknordstrom.net>
Signed-off-by: Stefan Roese <sr@denx.de> (unverified)
Signed-off-by: Hans de Goede <hdegoede@redhat.com> (unverified)
Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> (unverified)

Series-version: 3
Cover-letter:
This series of patches adds support for Allwinner A10/A13/A10s family of
SoCs commonly found in budget tablets & HDMI sticks.

The series is split in
* Common SoC support
* Drivers (I2C, MMC, GPIO, watchdog)
* SPL support
* SPL FEL support (boot via USB "FEL" protocol)
* Boards (mostly SPL DRAM parameters)
END

Series-changes: 3
- A10s support added
- CONS_INDEX defaults to 1 for sun5i (from A10s support)
- pull-up enabled on UART RX pin
- Cosmetic code cleanups
- Added boot suppot for a sinle ext* partition with files in /boot
  (in addition to fat/ext partition with files in /)
- enabled zImage and raw initrd support
sunxi: statusled support
ARM sunxi: Basic GPIO driver

GPIO driver for Allwinner sun4i/sun5i family of SoCs

GPIO Pins are named by their symbolic pin names P<g><#>
such as PH19 or H19.

Note: This do not perform any validation if the pin is in use
for some other I/O function. Use with care.

Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>

Overal codebase cleanup (gpio driver)

This patch tries to improve concistency and cleans up things to make
checkpatch happy. (Except while errors :S )

Signed-off-by: Oliver Schinagl <oliver@schinagl.nl>
ARM: sunxi: MMC driver

This adds a basic MMC driver for Allwinner sun4i/sun5i family of SoC
this driver is limited to a single MMC channel.

This is based on earlier sun4i board support published by Allwinner

Signed-off-by: Henrik Nodstrom <henrik@henriknordstrom.net>
Signed-off-by: Stefan Roese <sr@denx.de> (unverified)
Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> (unverified)

Series-changes: 3
- Dynamically allocate buffer descriptors. Was hardcoded to 0x50000000
- Correct debug output
- Cosmetic code cleanup
sunxi: Enable MMC0 controller

sunxi: Don't enable MMC0 if the UART is router to PF (SDC0 slot)
ARM sunxi: I2C driver

A basic driver for the I2C controller found in Allwinner sunXi
(A10 & A13) SoCs.

Note: This will be replaced by compatible mvtwsi.

Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Oliver Schinagl <oliver@schinagl.nl>

Series-changes: 3
- cosmetic cleanup
ARM: sunxi: watchdog support

Support for the hardware watchdog in Allwinner sunxi SoC familiy.

From: Henrik Nordstrom <henrik@henriknordstrom.net>

Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>
Signed-off-by: Stefan Roese <sr@denx.de> (unverified)
Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> (unverified)

Series-changes: 3
- fixed issue where reset hang on second reboot
- cosmetic code cleaups
- moved watchdog code to arch/.../sunxi/watchdog.c
- corrected timeouts
power: Add AXP209 Power Management controller (I2C)

Support for AXP209 Power Management controller,
used by most sunxi (Allwinner A10/A13) based boards.

From: Henrik Nordstrom <henrik@henriknordstrom.net>
Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>
Signed-off-by: Stefan Roese <sr@denx.de>

axp209: Blindly assume it is an AXP209

It appears chip version detection is not so simple and different CHIP_ID
values are returned under some conditions.
axp209: Style fixes
sunxi: Enable AXP Power chip version check again.

Only low 4 bits indicate chip version. Upper 4 bits is unknown.
power axp209: Function for checking poweron reason and powerbutton
axp152: Add axp152 pmu driver

Based on Henrik Nordstrom's axp209 code and Simon "theRat" 's modifications
to the axp209 code for axp152 support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>

Series-changes: 3
- added axp152 driver
axp152: Style fixes
net: Add sunxi (Allwinner) emac driver

Adds support for Allwinner EMAC, the ethernet controller included
in the Allwinner families of SoCs.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>
Signed-off-by: Oliver Schinagl <oliver@schinagl.nl>

Series-changes: 3
- Initialize MII clock earlier so mii access to allow independent use
- Name change from WEMAC to EMAC to match mainline kernel & chip manual
- Cosmetic code cleanup
ARM: sunxi: Enable ethernet support (emac)

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>

Series-changes: 3
- name change from WEMAC to EMAC
- configuration generalized in sunxi-common.h
- now enabled per board from boards.cfg
- added more network commands and netconsole support
tools: mksunixboot adding a Allwinner boot header

This tool adds a boot header to the supplied file, for booting
code directly from the SoC embedded boot rom. Needed for making
the SPL loader bootable.

Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net>

mksunxiboot: Style fixes

mksunxiboot: Correct input file size check to reject too large programs