aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-meson
AgeCommit message (Collapse)Author
2021-10-29ARM: amlogic: add sm efuse write support and cmd for read/write efuseVyacheslav Bocharov
This adds support for amlogic efuse write and provides two subcommands of "sm" command: "efuseread" and "efusewrite" to read/write bytes between memory and efuse. Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in> [narmstrong: fixed indent at end of patch] Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-10-07ARM: meson: Add S905Y2 SOC IDChristian Hewitt
Add the SOC ID for the S905Y2 to board info, see below for before/after tested with a Radxa Zero board: SoC: Amlogic Meson G12A (Unknown) Revision 28:b (30:2) SoC: Amlogic Meson G12A (S905Y2) Revision 28:b (30:2) Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-07-30Revert "ARM: meson: Add support for fastboot_set_reboot_flag()"Mattijs Korpershoek
With the introduction of a generic reboot flag implemented in commit a362ce214f ("fastboot: Implement generic fastboot_set_reboot_flag"), we no longer need the custom PSCI implementation to handle the reboot reason. This reverts commit 9a34dedfae0ebb031a45324c2fed8c39b2c6fcf2. Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-04-06arm: meson: remove static ethernet link setupNeil Armstrong
The static ethernet link type config code is no more needed because now handled by the meson8b glue driver, delete it. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-04-06arm: meson: remove static ethernet memory power domain enableNeil Armstrong
The ethernet memory power domain is handled by the meson-ee-pwrc driver, delete the static code. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-04-06arm: meson: remove static MDIO mux handlingNeil Armstrong
The static MDIO mux handling in mach-meson is no more needed, delete it. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-03-02reset: Remove addr parameter from reset_cpu()Harald Seiler
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>
2021-02-19ARM: mach-meson: select MMC_PWRSEQ configJaehoon Chung
Before time, PWRSEQ is selected since below commit. commit 262d34363373 ("board: amlogic: select PWRSEQ for all amlogic platform") Select MMC_PWRSEQ config because of introducing CONFIG_MMC_PWRSEQ for only eMMC module. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-02-02common: Drop asm/global_data.h from common headerSimon Glass
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>
2021-01-11meson: Add soc_rev to environmentPascal Vizeli
Add SoC revision to environment. This can be useful to select the correct device tree at runtime (N2/N2+). Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> Signed-off-by: Stefan Agner <stefan@agner.ch> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-01-11ARM: meson: isolate loading of socinfoStefan Agner
Move loading of socinfo into a separate function so the value can be reused later. Signed-off-by: Stefan Agner <stefan@agner.ch> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2020-11-12ARM: mach-meson: update SoC IDsNeil Armstrong
Update From Linux commits - 240051cb833b ("soc: amlogic: meson-gx-socinfo: Add A1 and A113L IDs") - 1d7c541b8a5b ("soc: amlogic: meson-gx-socinfo: Add S905X3 ID for VIM3L") - fdfc6997bd08 ("soc: amlogic: meson-gx-socinfo: Fix S905D3 ID for VIM3L") - d16d0481e6ba ("soc: amlogic: meson-gx-socinfo: Fix S905X3 and S905D3 ID's") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2020-10-05arm: meson-axg: add board_usb_init()/cleanup() for USB gadgetNeil Armstrong
Add the board_usb_init()/cleanup() for USB gadget for AXG based on the code for the G12A architecture. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2020-10-05ARM: mach-meson: use new DWC3 glue for GXL & GXMNeil Armstrong
Use the new Amlogic GXL/GXM USB Glue instead of the set of USB3 PHY and Simple DWC3 wrapper. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2020-09-01fastboot: Extend fastboot_set_reboot_flag with reboot reasonRoman Kovalivskyi
Extend fastboot_set_reboot_flag arguments with reboot reason so that it could handle different reboot cases in future. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2020-07-17treewide: convert bd_t to struct bd_info by coccinelleMasahiro Yamada
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>
2020-05-18common: Drop linux/bitops.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop asm/ptrace.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop log.h from common headerSimon Glass
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18command: Remove the cmd_tbl_t typedefSimon Glass
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>
2020-05-18common: Drop init.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop net.h from common headerSimon Glass
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>
2020-05-17efi_loader: round the memory area in efi_add_memory_map()Michael Walle
Virtually all callers of this function do the rounding on their own. Some do it right, some don't. Instead of doing this in each caller, do the rounding in efi_add_memory_map(). Change the size parameter to bytes instead of pages and remove aligning and size calculation in all callers. There is no more need to make the original efi_add_memory_map() (which takes pages as size) available outside the module. Thus rename it to efi_add_memory_map_pg() and make it static to prevent further misuse outside the module. Signed-off-by: Michael Walle <michael@walle.cc> Add missing comma in sunxi_display.c. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-05-11phy: Use _nodev naming convention if non-device clientsJagan Teki
Clients that are requesting some of uclass API's without a device (with ofnode) usually have _nodev naming convention. - clk_get_by_index_nodev - clk_get_by_name_nodev - reset_get_by_index_nodev - gpio_request_by_name_nodev So, update the same naming convention PHY framework. This doesn't change the existing functionality. Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: Tom Rini <trini@konsulko.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-04-20arm: meson-gx: add board_usb_init()/cleanup() for USB gadgetNeil Armstrong
Add arch code to initialize USB Gadget mode using the DWC2 controller, and using the previously added set_mode() phy functions. [narmstrong: fixup board_usb_cleanup call to phy_meson_gxl_usb2_set_mode] Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2020-02-05dm: core: Require users of devres to include the headerSimon Glass
At present devres.h is included in all files that include dm.h but few make use of it. Also this pulls in linux/compat which adds several more headers. Drop the automatic inclusion and require files to include devres themselves. This provides a good indication of which files use devres. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-01-17common: Move RAM-sizing functions to init.hSimon Glass
These functions relate to memory init so move them into the init header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-17common: Move reset_cpu() to the CPU headerSimon Glass
Move this function out of common.h and into a relevant header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07board: amlogic: select PWRSEQ for all amlogic platformAnand Moon
commit a10388dc6982 ("mmc: meson-gx: add support for mmc-pwrseq-emmc") introduce CONFIG_PWRSEQ for power sequence for eMMC module on amlogic platform, so enable this to all amlogic boards. Signed-off-by: Anand Moon <linux.amoon@gmail.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-12-02common: Move some board functions out of common.hSimon Glass
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>
2019-12-02crc32: Use the crc.h header for crc functionsSimon Glass
Drop inclusion of crc.h in common.h and use the correct header directly instead. With this we can drop the conflicting definition in fw_env.h and rely on the crc.h header, which is already included. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-10-18ARM: meson: add SM1 SoC idNeil Armstrong
Add the missing IDs to detect the SM1 S905X3 SoC. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-10-18arm: meson: Recognize A311D SoCAndreas Färber
Values imported from Linux driver, but in correct numeric order. Khadas VIM3 prints: Amlogic Meson G12B (A311D) Revision 29:b (10:2) Cc: Christian Hewitt <christianshewitt@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-10-18arm: meson: Tidy SoC information outputAndreas Färber
Write SoC instead of Soc. The Linux driver is not affected. Fixes: f41d723b9f ("ARM: meson: display Amlogic SoC Information") Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-10-18arm: meson: board-g12a: Setup VPU in fdtNeil Armstrong
If VIDEO_MESON is enabled, we need to setup the fdt for the framebuffer. Call meson_vpu_rsv_fb() which reserves the framebuffer memory region for EFI, and sets up simple-framebuffer nodes if simplefb support is enabled. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2019-08-12Merge tag 'u-boot-amlogic-20190812' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic - amlogic: add support for the SEI Robotic SEI510
2019-08-12ARM: meson: Add support for fastboot_set_reboot_flag()Neil Armstrong
Add support for fastboot_set_reboot_flag() by storing the reboot flag in the common code to be used by the custom PSCI reboot handler. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-08-12arm: meson: add sm command to retrieve the reboot reasonNeil Armstrong
The Secure Monitor offers multiple services, like returning the SoC unique serial number, and can provide the "reboot reason" as set by the previous booted system. This extends the Amlogic specific "sm" cmd with a "reboot_reason" subcommand to print or set a specified environment variable with the reboot reason in human readable format. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-08-12arm: meson: add sm cmd to retrieve SoC serialNeil Armstrong
The Secure Monitor offers multiple services, like returning the SoC unique serial number, already used to generate an unique MAC address. This adds a new, Amlogic specific, "sm" cmd with a "serial" subcommand to write the SoC unique serial to memory. This "cm" command will be extended in further patches. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-08-11env: Drop environment.h header file where not neededSimon Glass
This header file is now only used by files that access internal environment features. Drop it from various places where it is not needed. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_set() to env.hSimon Glass
Move env_set() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-31ARM: meson-g12a: Handle 4GiB DRAM sizeNeil Armstrong
When configured with 4GiB DRAM size, only 3.8GiB is available, the I/O beeing mapped in the last 256MiB of the first 4GiB physical memory/ First fixup the mm_region to handle the first 3.8GiB as memory and the last 256MiB as I/O. Then limit the real memory reported by the firmware to the available physical space, 3.8GiB aligned with the mm_region memory zone size. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Tested-by: Mark Kettenis <kettenis@openbsd.org>
2019-07-04ARM: meson: add unique MAC address generationNeil Armstrong
Add support for generating an unique MAC address using the SoC internal serial number from the Secure Monitor interface. The algorithm generates an unicast locally administered 6bytes minus 2bits address using an crc16 of the serial for the top 16bits with the lower 2 bits masked to setup the unicast locally administered property and a crc24 for the lower 24bits. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-07-04ARM: meson: sm: Add secure monitor calls to retrieve SoC serial numberNeil Armstrong
The Secure Monitor interface permits retrieving the SoC Serial Number, add a function to retrieve it. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-05-31ARM: meson-gx: Reset GXL/GXM to external PHY when not using internal PHYNeil Armstrong
When using External PHY, reset the mux to use the external PHY in case U-Boot was chainloaded from a misconfigured bootloader. Fixes: 33e3378091 ("ARM: meson: rework soc arch file to prepare for new SoC") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-05-09mach-meson: g12a: add DWC2 peripheral mode supportNeil Armstrong
Adds support for Amlogic G12A USB Device mode. The DWC2 Controller behind the Glue can be connected to an OTG capable PHY. The Glue setups the PHY mode. This patch implements Device mode support by adding a board_usb_init/cleanup setting up the DWC2 controller and switch the OTG capable port to Device before starting the DWC2 controller in Device mode. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-04-23ARM: meson: add G12a supportJerome Brunet
Add support for the Amlogic G12A SoC, which is a mix between the new physical memory mapping of AXG and the functionnalities of the previous Amlogic GXL/GXM SoCs. To handle the internal ethernet PHY, the Amlogic G12A SoCs now embeds a dedicated PLL to feed the internal PHY. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-04-10ARM: meson: display Amlogic SoC InformationJulien Masson
The Amlogic SoCs have a registers containing the die revision and packaging type to determine the SoC family and package marketing name like S905X for the GXL SoC Family. This code is taken from the Linux meson-gx-socinfo driver and adapted to U-Boot printing. Signed-off-by: Julien Masson <jmasson@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> [narmstrong: also updated new p200/p201 defconfigs]
2019-04-10ARM: board: meson: rename odroid-c2 to p200Mohammad Rasim
This renames the odroid-c2 to p200 and set it as the default GXBB board Other boards (odroid-c2 and nanopi-k2) will inherit from p200 Signed-off-by: Mohammad Rasim <mohammad.rasim96@gmail.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-01-31arm: meson: board-gx: Setup VPU in fdtMaxime Jourdan
If VIDEO_MESON is enabled, we need to setup the fdt for the framebuffer. Call meson_vpu_rsv_fb() which reserves the framebuffer memory region for EFI, and sets up simple-framebuffer nodes if simplefb support is enabled. Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>