summaryrefslogtreecommitdiff
path: root/arch/arm/mach-uniphier
Commit message (Collapse)AuthorAgeFilesLines
* common: Drop linux/bitops.h from common headerWIP/2020-05-18-reduce-size-of-common.hSimon Glass2020-05-185-0/+5
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop linux/delay.h from common headerSimon Glass2020-05-184-0/+4
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop linux/bug.h from common headerSimon Glass2020-05-181-0/+1
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop log.h from common headerSimon Glass2020-05-185-0/+5
| | | | | | Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* command: Remove the cmd_tbl_t typedefSimon Glass2020-05-184-5/+14
| | | | | | | | | | | | | We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop init.h from common headerSimon Glass2020-05-184-0/+4
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop net.h from common headerSimon Glass2020-05-182-1/+3
| | | | | | | | | | | Move this header out of the common header. Network support is used in quite a few places but it still does not warrant blanket inclusion. Note that this net.h header itself has quite a lot in it. It could be split into the driver-mode support, functions, structures, checksumming, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
* spl: Always define preloader_console_initSamuel Holland2020-05-151-2/+0
| | | | | | | | | | | | | | | A large number of boards call preloader_console_init unconditionally. Currently, they fail to build with CONFIG_SPL_SERIAL=n, because the function is undefined in that case. To fix the build, always define preloader_console_init, but make it no-op when CONFIG_SPL_SERIAL=n. For the few boards that did check for CONFIG_SPL_SERIAL before calling preloader_console_init, remove the checks, since the function can now be called unconditionally. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
* spl: mmc: Rename spl_boot_mode() to spl_mmc_boot_mode()Harald Seiler2020-04-221-1/+1
| | | | | | | | | | | | | | | The function's name is misleading as one might think it is used generally to select the boot-mode when in reality it is only used by the MMC driver to find out in what way it should try reading U-Boot Proper from a device (either using a filesystem, a raw sector/partition, or an eMMC boot partition). Rename it to spl_mmc_boot_mode() to make it more obvious what this function is about. Link: https://lists.denx.de/pipermail/u-boot/2020-April/405979.html Signed-off-by: Harald Seiler <hws@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* ARM: uniphier: detect the base of micro support card at run-timeMasahiro Yamada2020-02-281-12/+31
| | | | | | | The base address 0x43f00000 is no longer true for the future SoC. Extract the base address from the device tree. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove workaround for the NAND write protectMasahiro Yamada2020-02-281-17/+0
| | | | | | | | | | | | | | | This workaround was previously needed for LD4, Pro4, sLD8, Pro5 SoCs. The boot ROM does not touch this register for PXs2/LD6b or later. Now that the reset signal of the Denali NAND controller is always asserted in board_init() then deasserted in the driver, the WRITE_PROTECT register gets back to the default value, which means the write protect is deasserted. This workaround can go away entirely. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: move NAND reset assertion to U-Boot proper from SPLMasahiro Yamada2020-02-285-7/+56
| | | | | | | | | | The comment /* deassert reset */ is wrong. It asserts the reset. It no longer needs to stay in SPL. The NAND controller reset is handled in the driver. So, this assert can be moved to the board_init() of U-Boot proper. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: add sdscript, sdboot, sdupdate environment variablesMasahiro Yamada2020-02-281-4/+23
| | | | | | | | | | | | Add handy macros: - sdscript: source boot.scr in the file system of the SD media - sdboot : boot the kernel using the images in the file system of the SD media - sdscript: update the boot firmware in the SD media (in raw block sectors) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: set gd->ram_base correctlyMasahiro Yamada2020-02-011-6/+1
| | | | | | | gd->ram_base is not set at all if the end address of the DRAM ch0 exceeds the 4GB limit. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove adhoc reset deassertion for the NAND controllerMasahiro Yamada2020-02-017-73/+8
| | | | | | | Now that the reset controlling of the Denali NAND driver (denali_dt.c) works for this platform, remove the adhoc reset deassert code. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* common: Move hang() to the same header as panic()Simon Glass2020-01-171-0/+1
| | | | | | | | | | At present panic() is in the vsprintf.h header file. That does not seem like an obvious choice for hang(), even though it relates to panic(). So let's put hang() in its own header. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Migrate a few more files] Signed-off-by: Tom Rini <trini@konsulko.com>
* common: Move reset_cpu() to the CPU headerSimon Glass2020-01-171-0/+1
| | | | | | Move this function out of common.h and into a relevant header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Move some board functions out of common.hSimon Glass2019-12-021-0/+1
| | | | | | | A number of board function belong in init.h with the others. Move them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* common: Move some cache and MMU functions out of common.hSimon Glass2019-12-021-0/+1
| | | | | | | | | | | | These functions belong in cpu_func.h. Another option would be cache.h but that code uses driver model and we have not moved these cache functions to use driver model. Since they are CPU-related it seems reasonable to put them here. Move them over. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* common: Move some SMP functions out of common.hSimon Glass2019-12-021-0/+1
| | | | | | | These functions belong in cpu_func.h so move them over. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* dm: core: Add device_foreach_child()Simon Glass2019-10-081-2/+2
| | | | | | | | We have a 'safe' version of this function but sometimes it is not needed. Add a normal version too and update a few places that can use it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* env: Move env_set_ulong() to env.hSimon Glass2019-08-111-0/+1
| | | | | | | Move env_set_ulong() over to the new header file. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* env: Move env_set_hex() to env.hSimon Glass2019-08-111-0/+1
| | | | | | | | Move env_set_hex() over to the new header file along with env_set_addr() which uses it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* psci: Fix warnings when compiling with W=1Patrick Delaunay2019-07-241-2/+2
| | | | | | | | | | | | | | | | | | This patch solves the following warnings: arch/arm/mach-stm32mp/psci.c: warning: no previous prototype for ‘psci_set_state’ [-Wmissing-prototypes] warning: no previous prototype for ‘psci_arch_cpu_entry’ [-Wmissing-prototypes] warning: no previous prototype for ‘psci_features’ [-Wmissing-prototypes] warning: no previous prototype for ‘psci_version’ [-Wmissing-prototypes] warning: no previous prototype for ‘psci_affinity_info’ [-Wmissing-prototypes] warning: no previous prototype for ‘psci_migrate_info_type’ [-Wmissing-prototypes] warning: no previous prototype for ‘psci_cpu_on’ [-Wmissing-prototypes] warning: no previous prototype for ‘psci_cpu_off’ [-Wmissing-prototypes] warning: no previous prototype for ‘psci_system_reset’ [-Wmissing-prototypes] warning: no previous prototype for ‘psci_system_off’ [-Wmissing-prototypes] Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* ARM: uniphier: set {kernel, ramdisk, fdt}_addr_r at boot-timeMasahiro Yamada2019-07-101-0/+4
| | | | | | | | The base of DRAM will be changed for the next generation SoC. The addresses needed for booting the kernel should be shifted according to the DRAM base. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: set dram_base environment variableMasahiro Yamada2019-07-101-0/+2
| | | | | | | | | The base of DRAM will be changed for the next generation SoC. Set the base address to the 'dram_base' environment variable, which will be useful for scripting. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: set loadaddr at boot-timeMasahiro Yamada2019-07-101-0/+32
| | | | | | | | | | | The base of DRAM will be changed for the next generation SoC. To support it along with existing SoCs in the single defconfig, set 'loadaddr' at boot-time by adding the offset to the DRAM base. CONFIG_SYS_LOAD_ADDR is still hard-coded for compilation, but the value from environment variable 'loadaddr' should be used. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: turn uniphier_set_fdt_file() into void functionMasahiro Yamada2019-07-101-7/+13
| | | | | | For consistency with a function that will be added. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove CONFIG_SYS_SDRAM_BASEMasahiro Yamada2019-07-101-1/+4
| | | | | | | | | The base address of DRAM was 0x80000000 for all the ARM SoCs of this family in the past. It will be changed to 0x20000000 for a planned new SoC. To support multiple SoCs by the single uniphier_v8_defconfig, the base must be run-time determined. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: make mem_map run-time configurableMasahiro Yamada2019-07-103-4/+38
| | | | | | | | Currently, mem_map is hard-coded, and it worked well until the last SoC. For a planned new SoC, the addresses of peripherals and DRAM will be changed. Set it up run-time. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: make dram_init() more genericMasahiro Yamada2019-07-101-3/+7
| | | | | | Make this function work with any channel being empty. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: make dram_init() independent of SG_MEMCONFMasahiro Yamada2019-07-101-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>
* ARM: uniphier: detect register base addresses run-timeMasahiro Yamada2019-07-106-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>
* ARM: uniphier: de-couple SC macros into base address and offsetMasahiro Yamada2019-07-1028-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>
* ARM: uniphier: de-couple SG macros into base address and offsetMasahiro Yamada2019-07-1013-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>
* ARM: uniphier: detect SD boot modeMasahiro Yamada2019-07-102-0/+12
| | | | | | The planned new SoC supports the SD boot mode. Detect and display it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: make boot_is_swapped() code optionalMasahiro Yamada2019-07-105-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>
* ARM: uniphier: check DT to determine whether to initialize SBCMasahiro Yamada2019-07-107-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>
* ARM: uniphier: check DT to determine whether to use support cardMasahiro Yamada2019-07-101-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>
* ARM: uniphier: include <linux/io.h> from boot-device.cMasahiro Yamada2019-07-101-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>
* ARM: uniphier: use bool type for have_internal_stm parameterMasahiro Yamada2019-07-101-10/+10
| | | | | | This is boolean logic. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: clean up clk/MakefileMasahiro Yamada2019-07-101-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>
* ARM: uniphier: remove unused uniphier_ld11_boot_device_fixup()Masahiro Yamada2019-07-103-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>
* ARM: uniphier: move sg_set_{pinsel, iectrl} to more relevant placesMasahiro Yamada2019-06-294-42/+40
| | | | | | | | | | Move the sg_set_pinsel macro to arch/arm/mach-uniphier/arm32/debug_ll.S since it is not used anywhere else. Move the C functions sg_set_{pinsel,iectrl} to debug-uart.c since they are not used anywhere else. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove unused init code for CONFIG_DEBUG_UARTMasahiro Yamada2019-06-294-44/+2
| | | | | | | | | | | debug_uart_init() is called from spl_board_init(), which is only compiled for SPL. For U-boot proper, _debug_uart_init() is unreachable, so dropped by the dead code elimination. 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>
* ARM: uniphier: include <linux/io.h> from dram_init.cMasahiro Yamada2019-06-291-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>
* ARM: uniphier: remove unused sg_set_iectrl_range()Masahiro Yamada2019-06-291-8/+0
| | | | Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove unused SC_DPLLOSCCTRLMasahiro Yamada2019-06-291-4/+0
| | | | Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: fix build error for CONFIG_DEBUG_LL=yMasahiro Yamada2019-06-291-0/+2
| | | | | | | | | | Commit e27d6c7d328c ("ARM: uniphier: simplify SoC ID get function") accidentally removed the macros needed to compile debug_ll.S Revive them. Fixes: e27d6c7d328c ("ARM: uniphier: simplify SoC ID get function") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: do not modify bootcmd environment variable at run-timeMasahiro Yamada2018-12-291-4/+4
| | | | | | | | | | | | | Some users might want to modify 'bootcmd' at compile-time by editing include/configs/uniphier.h, but overwriting it at run-time makes it impossible. Instead, set 'bootdev' at run-time, which contains the boot device the system is booting from, then indirectly reference it from 'bootcmd'. It is up to users whether to override 'bootcmd'. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>