summaryrefslogtreecommitdiff
path: root/board/sunxi/board.c
AgeCommit message (Collapse)Author
2017-03-09sunxi_mmc: convert to a device-model driverPhilipp Tomsich
We now support the device-model for configuration of the driver including the interface to the pinctrl, reset and clock frameworks. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-03-09sunxi: Scan DT tree node '/clocks' on sunxi boardsPhilipp Tomsich
Moving to a DT-based clock framework on sunxi requires the subnodes of /clocks to be bound on boot-up. As /clocks does not contain a compatible-string, the U-Boot DT parsing code ignores it (and any subnodes). To overcome this limitation, the sunxi board-init code retrieves the /clocks node and explicitly starts a DM scan of the subnodes. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-03-09sunxi (sun50i): support R_I2C on A64 (pin-config, clocking)Philipp Tomsich
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-03-09sunxi (sun50i): support i2c on A64 (pin-config, clocking)Philipp Tomsich
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-03-09[wip/fixup] board.c: fix missing PANGOLIN definePhilipp Tomsich
2017-03-09[fix] additional includes in sunxi/board.c to fix warning for CONFIG_LEDPhilipp Tomsich
2017-03-09[skip-after-rebase] newer board_fit_config_name_match from AndrePhilipp Tomsich
2017-03-09sunxi: SPL: add FIT config selector for Pine64 boardsAndre Przywara
For a board or platform to support FIT loading in the SPL, it has to provide a board_fit_config_name_match() routine, which helps to select one of possibly multiple DTBs contained in a FIT image. Provide a simple function to cover the two different Pine64 models, which can be easily told apart by looking at the amount of installed RAM. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Conflicts: board/sunxi/board.c
2017-03-09[wip] sun6i: Updated DRAM configuration w/ calculated timings (and matching ↵Philipp Tomsich
MR settings).
2017-03-09[fix] non-Pangolin rebase issuePhilipp Tomsich
2017-03-09Remove left-over #define DEBUG in board.c (from LED change)Philipp Tomsich
2017-03-09pangolin: Convert to the LED class for the on-module (power) LEDPhilipp Tomsich
2017-03-09sunxi: Do not acquire PHY reset pin in board.c, when DM_GPIO is enabledPhilipp Tomsich
2017-03-09[fix] merge artefacts for MAC/serial# on pangolinPhilipp Tomsich
2017-03-09[fix] lid_open requires a PULL_DOWNPhilipp Tomsich
2017-03-09ARM: sunxi: pangolin: base mac and serial on eMMCKlaus Goger
We have seen axp221 with all zeros in the sid registers. Therefore we base our mac address and serial number on the eMMC serial number as this is the only unique id on the board. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com> Conflicts: board/sunxi/board.c
2017-03-09[wip] Do not switch MMC device order from boot-pinsPhilipp Tomsich
2017-03-09[wip] sun6i: Fastboot/UMS/bootprompt via keysPhilipp Tomsich
2017-03-09sun6i: support I2C3 pinout on A31-uQ7Philipp Tomsich
2017-03-09[fix] update board_mmc_init for changed block_dev data-structurePhilipp Tomsich
2017-03-09[fix] pangolin: merge issue in ATX power supply setupPhilipp Tomsich
2017-03-09ARM: sunxi: add emmcboot commandKlaus Goger
command that returns true if the first mmc device is the on-board emmc. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2017-03-09ARM: sunxi: pangolin: base mac and serial on eMMCKlaus Goger
We have seen axp221 with all zeros in the sid registers. Therefore we base our mac address and serial number on the eMMC serial number as this is the only unique id on the board. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2017-03-09ARM: sun6i: pangolin: set pinmux for USBH3Klaus Goger
USBH3 is used as full speed USB connection to the onboard STM32. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2017-03-09ARM: sun6i: select mmc order based on VER_REGKlaus Goger
selecting the mmc boot device based on mmc content can fail if the device is booted from eMMC and there is a SD-card with u-boot plugged in. On sun6i we can ѕelect the correct boot device based on the hardware configuration pins in BOOT_SEL. We only want to do this if UBOOT_SEL is not active since this overrides the BOOT_SEL settings to SD card. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com> Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
2017-03-09sunxi: pangolin: enable ATX power supplyKlaus Goger
when powered by ATX the SUS3 line must be HIGH to enable the ATX power supply. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2017-03-09ARM: sun6i: configure axp221 for dual supplyKlaus Goger
switch to ACIN even if it's shorted with VBUS Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2017-03-09ARM: sun6i: blink led for boot feedbackKlaus Goger
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2017-03-09ARM: sun6i: set bootmode for stm32Klaus Goger
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2017-03-09[reword] sun6i: pangolin: PHY Reset, DTS: phy-addr, DTS: phy skewsKlaus Goger
should be done via devicetree but this require to enhance the micrel driver quite a bit so let's do this hack instead which breaks every other sun6i device other then pangolin Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com> [squash] pangolin: remove explicit PHY writes (done through DTS) [squash] DTS change for the PHY rxc-skew and txc-skew [squash] remove LAST_STAGE for mii
2016-10-30sunxi: add MMC pinmux setup for SDC2 on sun9iPhilipp Tomsich
The A80 can support 8-bit eMMC with reset on the PC pingroups. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-09-06sunxi: fix 64-bit compiler warning for SPL header parsingAndre Przywara
Casting "int"s to pointers is only valid for 32-bit systems. Add the appropriate pointer type cast to avoid a compiler warning when compiling for AArch64. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-07-31sunxi: On newer SoCs use words 1-3 instead of just word 3 from the SIDHans de Goede
It seems that bytes 13-14 of the SID / bytes 1-2 from word 3 of the SID are always 0 on H3 making it a poor candidate to use as source for the serialnr / mac-address, and the other non constant words (1 and 2) also have quite a few bits which are the same for some boards, This commits switches to using the crc32 of words 1 - 3 to get a more unique value for the mac-address / serialnr. Cc: Chen-Yu Tsai <wens@csie.org> Cc: Corentin LABBE <clabbe.montjoie@gmail.com> Cc: Amit Singh Tomar <amittomer25@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-07-31sunxi: Ensure that the NIC specific bytes of the mac are not all 0Hans de Goede
On 2 of my H3 boards bytes 13-15 of the SID are all 0 leading to the NIC specific bytes of the mac all being 0, which leads to the boards not getting an ipv6 address from the dhcp server. This commits adds a check to ensure this does not happen. Cc: Chen-Yu Tsai <wens@csie.org> Cc: Corentin LABBE <clabbe.montjoie@gmail.com> Cc: Amit Singh Tomar <amittomer25@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-07-24mtd: nand: Add the sunxi NAND controller driverBoris Brezillon
We already have an SPL driver for the sunxi NAND controller, now add the normal/standard one. The source has been copied from Linux 4.6 with a few changes to make it work in u-boot. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Hans de Goede <hdegoede@redhat.com>
2016-07-15sunxi: Use BROM stored boot_media value to determine our boot-sourceHans de Goede
Now that we know that the BROM stores a value indicating the boot-source at the beginning of SRAM, use that instead of trying to recreate the BROM's boot probing. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-07-15sunxi: Remove some unnecessary #ifdefsHans de Goede
We always define CONFIG_MISC_INIT_R on sunxi and misc_init_r is never called in the spl, so the linker will optimize it and parse_spl_header(), of which it is the only caller, away. On the tests I've done (Orange Pi PC build) the SPL actually becomes 8 bytes smaller with this patch. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-07-15sunxi: Add support for multiple ethadrr-essesHans de Goede
Currently we fill ethaddr with a fixed unique address based on the SoCs serial (from the sid) to make sure that boards which use the integrated emac / gmac get a fixed mac rather then a random one. On some boards the wifi does not come with a fixed mac either, so we need to also set eth1addr. This commit changes the ethaddr setting code to check for ethernet%d aliases (as fdt_fixup_ethernet does) and set an ethaddr variable for all present aliases. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-07-15sunxi: FEL - Add the ability to recognize and auto-import uEnv-style dataBernhard Nortmann
The patch converts one of the "reserved" fields in the sunxi SPL header to a fel_uEnv_length entry. When booting over USB ("FEL mode"), this enables the sunxi-fel utility to pass the string length of uEnv.txt compatible data; at the same time requesting that this data be imported into the U-Boot environment. If parse_spl_header() in the sunxi board.c encounters a non-zero value in this header field, it will therefore call himport_r() to merge the string (lines) passed via FEL into the default settings. Environment vars can be changed this way even before U-Boot will attempt to autoboot - specifically, this also allows overriding "bootcmd". With fel_script_addr set and a zero fel_uEnv_length, U-Boot is safe to assume that data in .scr format (a mkimage-type script) was passed at fel_script_addr, and will handle it using the existing mechanism ("bootcmd_fel"). Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de> Acked-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-07-02sunxi: spl: Fix DRAM info printingHans de Goede
The switch to simple_printf was causing the SPL dram info to show as: DRAM: u MiB This fixes this by switching from %lu to %d for printing the DRAM size. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-05-25Revert "sunxi: Reserve ATF memory space on A64"Andre Przywara
The ARM Trusted Firmware (ATF) code now lives in SRAM on the Pine64/A64, so we can claim the whole of DRAM for OS use. This reverts commit 3ffe39ed2b66af71c7271d0cef2a248b5bf7dfdb. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-05-25sunxi: power: add AXP809 supportChen-Yu Tsai
The A80 uses the AXP809 as its primary PMIC. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-05-25sunxi: power: axp818: Add support for switch SWChen-Yu Tsai
The AXP818 has a switchable output, SW. This is commonly used for controlling power to the LCD backlight. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-04-01sunxi: Reserve ATF memory space on A64Alexander Graf
On the A64 we usually boot with ATF running in EL3. ATF as it is available today resides in the first 16MB of RAM. So we should make sure we reserve that space in our memory maps. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-04-01sunxi: Add support for Allwinner A64 SoCsSiarhei Siamashka
The Allwinner A64 SoC is used in the Pine64. This patch adds all bits necessary to compile U-Boot for it running in AArch64 mode. Unfortunately SPL is not ready yet due to legal problems, so we need to boot using the binary boot0 for now. Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> [agraf: remove SPL code, move to AArch64] Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-03-31power: axp818: Add support for FLDOsChen-Yu Tsai
The FLDOs on AXP818 PMIC normally provide power to CPUS and USB HSIC PHY on the A83T/H8. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-03-23sunxi: Select CONFIG_OF_BOARD_SETUP from arch/arm/KconfigHans de Goede
Always select OF_BOARD_SETUP on sunxi, rather then having it in almost all our defconfigs. This also fixes it missing from some recently added defconfigs. This commit also modifies our ft_board_setup() to not cause warnings when CONFIG_VIDEO_DT_SIMPLEFB is not set, since we will now always build it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-03-23sunxi: Turn satapwr on from board_initHans de Goede
There are 2 reasons for doing this: 1) The main reason for doing this is to move it outside of board/sunxi/ahci.c, so that it can be used on boards which use a usb<->sata chip too; 2) While doing this I realized that doing it from board_init also meant doing it much earlier. Some printf get_timer(0) calls show that the time between board_init() and scsi_init() is more then 600 ms, so we can drop the mdelay(500) While at it also drop the printf("SUNXI SCSI INIT\n") AHCI init is noisy enough by itself. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2016-03-23sunxi: Fix gmac not working due to cpu_eth_init no longer being calledHans de Goede
cpu_eth_init is no longer called for dm enabled eth drivers, this was causing the sunxi gmac eth controller to no longer work in u-boot. This commit fixes this by calling the clock, reset and pinmux setup function from s_init() and enabling the phy power pin (if any) from board_init(). The enabling of phy power cannot be done from s_init because it uses dm and dm is not ready yet at this point. Note that the mdelay is dropped as the phy gets enabled much earlier now, so it is no longer needed. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk> Tested-by: Karsten Merker <merker@debian.org> Tested-by: Michael Haas <haas@computerlinguist.org>
2016-03-14dm: block: Rename device number member dev to devnumSimon Glass
This is a device number, and we want to use 'dev' to mean a driver model device. Rename the member. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>