aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-07-10ARM: uniphier: make dram_init() more genericMasahiro Yamada1-3/+7
Make this function work with any channel being empty. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: make dram_init() independent of SG_MEMCONFMasahiro Yamada1-64/+84
Currently, dram_init() code relies on the fact the DRAM size configuration exists in the SG_MEMCONF register. This will no longer be true for a planned new SoC, which will replace SG_MEMCONF with a different register. Refactor the hook in a more generic way. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: detect register base addresses run-timeMasahiro Yamada6-1/+97
Until the last SoC, the register addresses have been hard-coded because they are always constant. For a planned new SoC, the register bases will be completely changed. I insist on supporting multiple SoCs/boards by a single defconfig (uniphier_v8_defconfig) since duplicating similar defconfig files is a maintenance burden. The base addresses must be fixed-up at run-time somehow. Previously, the board init code identified the SoC by reading out the SG_REVISION register. This is much easier than parsing DT. You cannot do it any more because the base address of SG will be changed. The SG_REVISION register exists to read out the SoC ID, but you never know its address before identifying the SoC. Oh well. So, the possible solution is to parse the DT, and find out the node with "*-soc-glue" compatible string. Then, sg_base is set to the value of the "reg" property. The sc_base is set up likewise. It is worth noting a pit-fall. Having sc_base and sg_base in the global scope will make the life easier, but the global variables are poorly supported before the relocation. In fact, the .bss section overwraps with DT. Allocating them in the .bss section would break DT. So, I gave dummy initializers to assign them in the .data section. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: de-couple SC macros into base address and offsetMasahiro Yamada28-285/+266
The SC_* macros represent the address of SysCtrl registers. For a planned new SoC, its base address will be changed. Turn the SC_* macros into the offset from the base address. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: de-couple SG macros into base address and offsetMasahiro Yamada13-41/+46
The SG_* macros represent the address of SoC-glue registers. For a planned new SoC, its base address will be changed. Turn the SG_* macros into the offset from the base address. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: detect SD boot modeMasahiro Yamada2-0/+12
The planned new SoC supports the SD boot mode. Detect and display it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: make boot_is_swapped() code optionalMasahiro Yamada5-12/+30
The planned new SoC does not have SBC (System Bus Controller) block. Make boot_is_swapped() an optional hook. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: check DT to determine whether to initialize SBCMasahiro Yamada7-1/+33
If CONFIG_MICRO_SUPPORT_CARD is enabled, U-Boot initialize SBC (System Bus Controller), which may not be really necessary. Check the "socionext,uniphier-system-bus" node in DT run-time. If and only if it is found and its "status" property is okay, initialize the SBC block. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: check DT to determine whether to use support cardMasahiro Yamada1-0/+33
If CONFIG_MICRO_SUPPORT_CARD is enabled, U-Boot tries to get access to the devices on the support card, which may not actually exist. Check the DT and search for the on-board devices run-time. If the nodes are not found in DT, then disable the code. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10clk: uniphier: add EMMC clock for LD11, LD20, and PXs3Masahiro Yamada1-6/+8
I also added comments for NAND clocks. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: include <linux/io.h> from boot-device.cMasahiro Yamada1-0/+1
This file calls readl(), so needs to include <linux/io.h>. Currently, it relies on someone else including it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: use bool type for have_internal_stm parameterMasahiro Yamada1-10/+10
This is boolean logic. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: clean up clk/MakefileMasahiro Yamada1-7/+3
Now that 64-bit SoCs of this SoC family no longer support SPL, this Makefile can be slightly simpler. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: remove unused uniphier_ld11_boot_device_fixup()Masahiro Yamada3-11/+0
The .boot_device_fixup() is only called by SPL. Now that 64-bit SoCs of this SoC family no longer support SPL, debug-uart-ld20.c is never compiled. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10ARM: uniphier: remove empty #ifdef blockMasahiro Yamada1-4/+0
This is a remnant of commit f89d6133eef2 ("configs: move CONFIG_SPL_TEXT_BASE to Kconfig"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10arm64: dts: uniphier: add reserved-memory for secure memoryMasahiro Yamada3-6/+33
[ Linux commit aa38571246c6ac279ebebd141157297bcb959d76 ] The memory regions specified by /memreserve/ are passed to early_init_dt_reserve_memory_arch() with nomap=false, so it is not suitable for reserving memory for Trusted Firmware-A etc. Use the more robust /reserved-memory node with the no-map property to prevent the kernel from mapping it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10spi: Add SPI controller driver for UniPhier SoCsKunihiko Hayashi3-0/+422
Add SPI controller driver implemented in Socionext UniPhier SoCs. This controller has the SPI master mode only. Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
2019-07-10ARM: uniphier_v8_defconfig: make 64bit SoC image position independentMasahiro Yamada1-1/+3
For a planned new SoC in this SoC family, the base address of the DRAM will be changed from 0x80000000 to 0x20000000. The PIE support will be useful to maintain multiple similar SoCs whose DRAM addresses differ. Now CONFIG_SYS_TEXT_BASE is not important. I just set it to 0 to ensure CONFIG_POSITION_INDEPENDENT is working. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10arm64: add an option to switch visibility of CONFIG_SYS_INIT_SP_BSS_OFFSETMasahiro Yamada7-15/+20
By default, CONFIG_SYS_INIT_SP_BSS_OFFSET was made invisible by not giving a prompt to it. The only way to define it is to hard-code an extra entry in SoC/board Kconfig, like arch/arm/mach-tegra/tegra{186,210}/Kconfig. Add a prompt to it in order to allow defconfig files to specify the value of CONFIG_SYS_INIT_SP_BSS_OFFSET. With this, CONFIG_SYS_INIT_SP_BSS_OFFSET would become always visible. So, we need a new bool option to turn it off by default. I move the 'default 524288' to the common place. This value is not too big, but is big enough to avoid the overwrap of DT in most platforms. If 512KB is not a suitable choice for your platform, you can change it from your defconfig or menuconfig etc. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Stephen Warren <swarren@nvidia.com>
2019-07-09Merge tag 'u-boot-atmel-2019.10-a' of ↵Tom Rini16-26/+804
https://gitlab.denx.de/u-boot/custodians/u-boot-atmel First set of u-boot-atmel features and fixes for 2019.10 cycle This includes the Atmel QSPI driver and support for the at91 boards. This is the port of the driver from Linux, mostly done by Tudor Ambarus.
2019-07-09configs: sama5d2_xplained: add support QSPI flash bootEugen Hristev1-0/+11
The spi-nor flash resides on spi bus 1. Update the CONFIG_ENV_SPI_CS and CONFIG_BOOTCOMMAND accordingly. Based on original work by Wenyou Yang. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> [tudor.ambarus@microchip.com: amend the commit message.] Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-07-09configs: sama5d27_som1_ek: qspi: use common memory layoutTudor Ambarus1-7/+0
Use the qspi memory layout defined in at91-sama5_common - it aligns with the 8 Mbyte flash (sst26vf064b-104i/sn) available in sama5d27_som1_ek. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-07-09configs: sama5d27_som1_ek: add qspiflash_defconfigTudor Ambarus2-0/+102
Add the default config file of QSPI media. The config is based on sama5d27_som1_ek_mmc_defconfig. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-09configs: sama5d2_xplained: add qspiflash_defconfigTudor Ambarus2-0/+102
Add the default config file of QSPI media. The config is based on sama5d2_xplained_mmc_defconfig. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-09ARM: at91: sama5: add common environment for QSPICyrille Pitchen1-0/+8
Use the same memory layout as we use for the NAND boot on the other boards. QSPI flashes are present on the following boards: sama5d2_xplained RevB: 32 Mbyte flash (mx25l3273fm2i-08g) sama5d2_xplained RevC: 8 Mbyte flash (sst26vf064b-104i/sn) sama5d27_som1_ek: 8 Mbyte flash (sst26vf064b-104i/sn) sama5d2_ptc_ek: 8 Mbyte flash (sst26vf064b-104i/sn) The 8 Mbyte limit is enough to cope with the memory layout used in the NAND boot. rootfs exceeds the 8 Mbyte limit and will stay in eMMC in the sama5d2_xplained case. The final scope is to use a single memory layout for all boot medias. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com> [tudor.ambarus@microchip.com: change memory layout, add commit message] Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-07-09ARM: dts: at91: sama5d2_xplained: fix QSPI0 nodeCyrille Pitchen1-19/+17
Fix the following: - use "jedec,spi-nor" binding, we use jedec compatible flashes - set bus width to 4, we use quad capable flashes - differentiate bewteen data and clk and cs pins - drop partions as we don't use them in u-boot. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com> [tudor.ambarus@microchip.com: use "jedec,spi-nor", edit commit message] Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-07-09configs: sama5d27_som1_ek: enable qspi controller and flashesTudor Ambarus2-0/+4
We use a sst spi-nor flash memory on sama5d27_som1_ek. Select the others for testing purposes. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-09configs: sama5d2_xplained: enable qspi controller and flashesTudor Ambarus3-0/+15
We have a macronix spi-nor flash on sama5d2_xplained RevB and a sst spi-nor flash on RevC. Select the rest for testing purposes. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-09spi: Add Atmel QuadSPI driverTudor Ambarus3-0/+545
Backport the driver from linux v5.1-rc5 and adapt it for u-boot. Tested on sama5d2_xplained Rev B with mx25l25635e spi-nor flash. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-08Merge tag 'efi-2019-10-rc1' of ↵Tom Rini12-159/+332
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for v2019.10-rc1 Fix a possible overflow for GUID partition tables. For some runtime services we only have implementations valid at boottime. So we replace them when leaving boottime. Move this from SetVirtualAddressMap() to ExitBootServices() as SetVirtualAddressMap() is not called by all operating systems. Adjust the Python tests accordingly. Bump the supported UEFI specification version to 2.8.
2019-07-08Merge tag 'u-boot-amlogic-20190704' of ↵Tom Rini7-1/+67
https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic - fix khadas-vim README - add support for unique generated MAC adresses from SoC serial, limited to Amlogic GXL/GXM boards for now
2019-07-08Merge tag 'mmc-6-23' of https://github.com/MrVan/u-bootTom Rini256-982/+2297
- Pull in the series to split fsl_esdhc for i.MX/non-i.MX cleanly
2019-07-08Prepare v2019.07v2019.07Tom Rini1-1/+1
Signed-off-by: Tom Rini <trini@konsulko.com>
2019-07-08Merge tag 'mips-fixes-for-2019.07' of ↵Tom Rini2-1/+27
https://gitlab.denx.de/u-boot/custodians/u-boot-mips - mtmips: network stability fixes for gardena-smart-gateway
2019-07-07arm: mediatek: remove arch_misc_initWeijie Gao2-15/+0
The watchdog of mediatek chips is enabled by bootrom before u-boot is running. Previously we choose to enable the wdt driver only to disable the watchdog hardware. Now wdt service is enabled by default. The function arch_misc_init which is only used to disable wdt is no longer needed. Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2019-07-07board_r: move initr_watchdog to be called after initr_serialWeijie Gao1-3/+3
The initr_watchdog is currently placed before initr_serial. The initr_watchdog calls printf and printf finally calls ops->putc of a serial driver. However, gd->cur_serial_dev points to a udevice allocated in board_f. The gd->cur_serial_dev->driver->ops->putc points the the code region before relocation. Some serial drivers call WATCHDOG_RESET() in ops->putc. When DM is enabled for watchdog, watchdog_reset() is called. watchdog_reset() calls get_timer to get current timer. On some platforms the timer driver is also a DM driver. initr_watchdog is placed right after initr_dm, which means the timer driver hasn't been initialized. So dm_timer_init() is called. To create a new udevice, calloc is called. However start from ops->putc, u-boot execution flow is redirected into the memory region before relocation (board_f). In board_f, dlmalloc hasn't been initialized. The call to calloc will fail, and this will cause DM to print out an error message, and it will call printf again, causing recursive error outputs. This patch places initr_watchdog after initr_serial to solve this issue. Cc: Stefan Roese <sr@denx.de> Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Frank Wunderlich <frank-w@public-files.de> Tested-by: Suniel Mahesh <sunil.m@techveda.org>
2019-07-07Merge tag 'dm-pull-7jul19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dmTom Rini1-0/+1
Fix booting for wandboard
2019-07-07Merge tag 'video-for-2019.07' of ↵Tom Rini1-0/+3
https://gitlab.denx.de/u-boot/custodians/u-boot-video - fix pwm backlight
2019-07-07imx6: wandboard: allow booting from MMC 2Heinrich Schuchardt1-0/+1
One of the SD-CARD slots on the Wandboard Quad B1 is MMC 2. Enable it as a boot device. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2019-07-07Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usbTom Rini7-2/+131
- DWC and i.MX6 fixes
2019-07-07Merge tag 'rockchip-for-v2019.07-rc5-3' of ↵Tom Rini1-1/+1
https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip
2019-07-06video: backlight: fix pwm inversionMarc Dietrich1-0/+3
set_pwm() will always fail with -ENOSYS if pwm_ops set_invert() is not implemented, leaving the backlight dark. Fix this by returning no error if set_invert() is not implemented and no polarity change is requested. Fixes: 57e7775413 ("video: backlight: Parse PWM polarity cell") Signed-off-by: Marc Dietrich <marvin24@gmx.de>
2019-07-06efi_loader: detach runtime in ExitBootServices()Heinrich Schuchardt3-1/+6
Linux can be called with a command line parameter efi=novamap, cf. commit 4e46c2a95621 ("efi/arm/arm64: Allow SetVirtualAddressMap() to be omitted"). In this case SetVirtualAddressMap() is not called after ExitBootServices(). OpenBSD 32bit does not call SetVirtualAddressMap() either. Runtime services must be set to an implementation supported at runtime in ExitBootServices(). Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Suggested-by: Alexander Graf <agraf@csgraf.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-06efi_loader: simplify detachingHeinrich Schuchardt1-32/+8
We do not need any array typed detach list. Let's simply update the pointers directly. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-06efi_loader: decision on EFI_RT_SUPPORTED_RESET_SYSTEMHeinrich Schuchardt2-4/+7
Move the logic determining which board supports reset at runtime to Kconfig. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-06test/py: not all boards support UEFI runtime resetHeinrich Schuchardt1-4/+0
As not all boards support resets at runtime do not test for it in the Python tests. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-06efi_loader: bump UEFI specification number to 2.8Heinrich Schuchardt1-2/+2
We are implementing UEFI variable RuntimeServicesSupported and set the unimplemented runtime functions return EFI_UNSUPPORTED as described in UEFI specification 2.8. So let's also advertise this specification version in our system table. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Alexander Graf <agraf@csgraf.de>
2019-07-06efi_loader: split off detaching SetVirtualAddress()Heinrich Schuchardt1-11/+58
The runtime services SetVirtualAddress() and ConvertPointer() become unavailable after SetVirtualAddress(). Other runtime services become unavailable after ExitBootServices. Move the update of SetVirtualAddress() and ConvertPointer() to efi_relocate_runtime_table(). Use functions with the correct signature when detaching. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-06efi_selftest: test variable services at runtimeHeinrich Schuchardt2-0/+95
Provide a unit test for the variable services at runtime. Currently we expect EFI_UNSUPPORTED to be returned as the runtime implementation is still missing. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-06efi_loader: unimplemented runtime servicesHeinrich Schuchardt1-32/+2
Unimplemented runtime services should always return EFI_UNSUPPORTED as described in the UEFI 2.8 spec. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>