summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-uniphier
Commit message (Collapse)AuthorAgeFilesLines
* reset: Remove addr parameter from reset_cpu()Harald Seiler2021-03-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically, the reset_cpu() function had an `addr` parameter which was meant to pass in an address of the reset vector location, where the CPU should reset to. This feature is no longer used anywhere in U-Boot as all reset_cpu() implementations now ignore the passed value. Generic code has been added which always calls reset_cpu() with `0` which means this feature can no longer be used easily anyway. Over time, many implementations seem to have "misunderstood" the existence of this parameter as a way to customize/parameterize the reset (e.g. COLD vs WARM resets). As this is not properly supported, the code will almost always not do what it is intended to (because all call-sites just call reset_cpu() with 0). To avoid confusion and to clean up the codebase from unused left-overs of the past, remove the `addr` parameter entirely. Code which intends to support different kinds of resets should be rewritten as a sysreset driver instead. This transformation was done with the following coccinelle patch: @@ expression argvalue; @@ - reset_cpu(argvalue) + reset_cpu() @@ identifier argname; type argtype; @@ - reset_cpu(argtype argname) + reset_cpu(void) { ... } Signed-off-by: Harald Seiler <hws@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* common: Drop asm/global_data.h from common headerSimon Glass2021-02-021-0/+1
| | | | | | | | | | | | Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
* dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET()Simon Glass2021-01-051-1/+1
| | | | | | | | In the spirit of using the same base name for all of these related macros, rename this to have the operation at the end. This is not widely used so the impact is fairly small. Signed-off-by: Simon Glass <sjg@chromium.org>
* ARM: uniphier: use FIELD_GET() to get access to revision register fieldsMasahiro Yamada2020-08-182-11/+15
| | | | | | Define register fields as macros, and use FIELD_GET(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove unneeded header inclusion from board_late_init.cMasahiro Yamada2020-08-181-2/+1
| | | | | | | | | | <nand.h> is unneeded since commit 9248a78f40d6 ("ARM: UniPhier: remove Denali NAND controller fixup code"). <linux/io.h> is uneeded since commit 1320fa2e55d2 ("ARM: uniphier: remove workaround for the NAND write protect"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove unused uniphier_pin_init()Masahiro Yamada2020-08-183-32/+0
| | | | | | | This function is unused since commit 862274913f8f ("bus: uniphier-system-bus: move hardware init from board files"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* treewide: convert bd_t to struct bd_info by coccinelleMasahiro Yamada2020-07-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux coding style guide (Documentation/process/coding-style.rst) clearly says: It's a **mistake** to use typedef for structures and pointers. Besides, using typedef for structures is annoying when you try to make headers self-contained. Let's say you have the following function declaration in a header: void foo(bd_t *bd); This is not self-contained since bd_t is not defined. To tell the compiler what 'bd_t' is, you need to include <asm/u-boot.h> #include <asm/u-boot.h> void foo(bd_t *bd); Then, the include direcective pulls in more bloat needlessly. If you use 'struct bd_info' instead, it is enough to put a forward declaration as follows: struct bd_info; void foo(struct bd_info *bd); Right, typedef'ing bd_t is a mistake. I used coccinelle to generate this commit. The semantic patch that makes this change is as follows: <smpl> @@ typedef bd_t; @@ -bd_t +struct bd_info </smpl> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
* ARM: uniphier: remove NAND reset codeMasahiro Yamada2020-07-114-55/+0
| | | | | | | | Now that commit 3e57f879eee6 ("mtd: nand: raw: denali: Assert reset before deassert") added the reset assertion, this code in the board file is unneeded. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove sbc/ directoryMasahiro Yamada2020-07-115-33/+8
| | | | | | | Now that this directory contains only uniphier_sbc_boot_is_swapped(), move it to boot-device.c and delete the sbc/ directory entirely. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* bus: uniphier-system-bus: move hardware init from board filesMasahiro Yamada2020-07-1110-256/+45
| | | | | | Move the bus initialization code to this driver from board files. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* bus: uniphier-system-bus: add UniPhier System Bus driverMasahiro Yamada2020-07-111-0/+1
| | | | | | | | | | | | | | Since commit 1517126fdac2 ("ARM: uniphier: select DM_ETH"), DM-based drivers/net/smc911x.c is compiled, but it is never probed because the parent node lacks the DM-based driver. I need a skeleton driver to populate child devices (but the next commit will move more hardware settings to the this driver). I put this to drivers/bus/uniphier-system-bus.c because this is the same path as the driver in Linux kernel. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove support for NOR Flash on support cardMasahiro Yamada2020-07-113-102/+0
| | | | | | | I actually do not see this used these days because eMMC or NAND is used for non-volatile devices. Dump the burden to maintain this crappy code. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove unused uniphier_sbc_init_admulti()Masahiro Yamada2020-07-112-34/+5
| | | | | | | | | This was used by the old sLD3 SoC, the support of which was removed by commit 00aa453ebf56 ("ARM: uniphier: remove sLD3 SoC support"). There is no more user of this function. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: fix build error when CONFIG_MICRO_SUPPORT_CARD=nMasahiro Yamada2020-07-111-0/+2
| | | | | | | If CONFIG_MICRO_SUPPORT_CARD is unset, the build fails due to function redefinition. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: consolidate SoC select menuMasahiro Yamada2020-07-111-18/+15
| | | | | | | | | | | | | | | | Currently, the supports for the following two ARMv7 SoC groups are exclusive, because the boot ROM loads the SPL to a different address: - LD4, sLD8 (SPL is loaded at 0x00040000) - Pro4, Pro5, PXs2, LD6b (SPL is loaded at 0x00100000) This limitation exists only when CONFIG_SPL=y. Instead of using crappy CONFIG options, checking SPL and SPL_TEXT_BASE is cleaner. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* Revert "ARM: uniphier: add weird workaround code for LD20"Masahiro Yamada2020-07-112-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 45f41c134baf5ff1bbf59d33027f6c79884fa4d9. This weird workaround was the best I came up with at that time to boot U-Boot from TF-A. I noticed U-Boot successfully boots on LD20 (i.e. CA72 CPU) by using the latest TF-A. Specifically, since the following TF-A commit, U-Boot runs at EL2 instead of EL1, and this issue went away as a side-effect. |commit f998a052fd94ea082833109f25b94ed5bfa24e8b |Author: Masahiro Yamada <yamada.masahiro@socionext.com> |Date: Thu Jul 25 10:57:38 2019 +0900 | | uniphier: run BL33 at EL2 | | All the SoCs in 64-bit UniPhier SoC family support EL2. | | Just hard-code MODE_EL2 instead of using el_implemented() helper. | | Change-Id: I7ab48002c5205bc8c013e1b46313b57d6c431db0 | Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> However, if I reverted that, this problem would come back, presumably because some EL1 code in U-Boot triggers this issue. Now that commit f8ddd8cbb513 ("arm64: issue ISB after updating system registers") fixed this issue properly, this weird workaround is no longer needed irrespective of the exception level at which U-Boot runs. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: remove board_eth_init()Masahiro Yamada2020-05-221-12/+0
| | | | | | | | | | This platform completely migrated to CONFIG_DM_ETH. board_eth_init() is only called from net/eth_legacy.c Remove the legacy hook. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: delete or replace <common.h> includesMasahiro Yamada2020-05-2236-36/+8
| | | | | | | | <common.h> pulls in a lot of bloat. <common.h> is unneeded in most of places. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* ARM: uniphier: drop #include <log.h> againMasahiro Yamada2020-05-225-5/+0
| | | | | | | | | | | | | | I do not understand the changes made to these files by commit f7ae49fc4f36 ("common: Drop log.h from common header"). git show f7ae49fc4f36 -- arch/arm/mach-uniphier/ None of them uses the log function feature. Simply revert the changes made to these files. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* ARM: uniphier: drop #include <init.h> again from umc-pxs2.cMasahiro Yamada2020-05-221-1/+0
| | | | | | | | | | | | | | I do not understand the change made to this file by commit 691d719db718 ("common: Drop init.h from common header"). git show 691d719db718 -- arch/arm/mach-uniphier/dram/umc-pxs2.c This file does not call or define any functions declared in <init.h> Simply revert the change made to this file. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* ARM: uniphier: remove #include <net.h> again from micro-support-card.cMasahiro Yamada2020-05-221-2/+1
| | | | | | | | | | | | | | | I do not understand the changes made to this file by commit 90526e9fbac4 ("common: Drop net.h from common header"). git show 90526e9fbac4 -- arch/arm/mach-uniphier/micro-support-card.c The necessary declaration is already included by <netdev.h> at line 112. It also moved the <dm/of.h> inclusion, but I do not understand the motivation of doing so, either. Simply revert the changes made to this file. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: include <asm/system.h> instead of <asm/cache.h> from psci.cMasahiro Yamada2020-05-221-1/+1
| | | | | | | | | | | | | | | | | | | I do not understand the change made to this file by commit 90526e9fbac4 ("common: Drop net.h from common header"). git show 90526e9fbac4 -- arch/arm/mach-uniphier/arm32/psci.c It added <asm/cache.h> while this file does not call the standard cache functions at all. All the uniphier-specific cache functions, uniphier_cache_*() are declared in cache-uniphier.h, which is already included from this file. Including <asm/system.h> is sensible to fix the -Wmissing-prototypes warnings because this file defines psci_cpu_on and psci_system_reset(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* common: Drop linux/bitops.h from common headerSimon 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>