summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mvebu
Commit message (Collapse)AuthorAgeFilesLines
* treewide: add MODULE_DEVICE_TABLE markersAhmad Fatoum2023-06-132-0/+2
| | | | | | | | | | | | | | | | Syncing device trees with Linux upstream can lead to breakage, when the device trees are switched to newer bindings, which are not yet supported in barebox. To make it easier to spot such issues, we want to start applying some heuristics to flag possibly problematic DT changes. One step towards being able to do that is to know what nodes barebox actually consumes. Most of the nodes have a compatible entry, which is matched by an array of of_device_id, so let's have MODULE_DEVICE_TABLE point at it for future extraction. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230612125908.1087340-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: Move mach header files to include/mach/mvebuSascha Hauer2023-03-0615-373/+9
| | | | | | | | | | Currently arch specific headers can be included with possible as there won't be a single mach anymore. Move all mvebu specific header files to include/mach/mvebu/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: Use ENTRY_FUNCTION_HEADSascha Hauer2023-03-021-8/+4
| | | | | | | | Use ENTRY_FUNCTION_HEAD in the mvebu boards to customize the barebox image header without having to hook into a generic include file. Link: https://lore.barebox.org/20230302111606.1054037-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM64: asm: drop __barebox_arm_headAhmad Fatoum2022-10-261-17/+0
| | | | | | | | | Now that we have the common PBL head written in assembly, the 64-bit inline assembly version remains unused. Drop it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221024065716.1215046-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spdx'Sascha Hauer2022-01-196-0/+12
|\
| * arch: add SPDX-License-Identifier to all .c filesAhmad Fatoum2022-01-052-0/+4
| | | | | | | | | | | | | | | | | | Record GPL-2.0-only as license for all files lacking an explicit license statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * arch: add SPDX-License-Identifier to all headersAhmad Fatoum2022-01-052-0/+4
| | | | | | | | | | | | | | | | | | Record GPL-2.0-only as license for all files lacking an explicit license statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * treewide: add SPDX-License-Identifier for Kbuild/KconfigAhmad Fatoum2022-01-052-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To verify only Kconfig/Makefile is touched: git show --numstat --format=oneline HEAD | grep -v 'Kconfig\|Makefile' will print only arch/powerpc/Kbuild. To verify nothing unexpected is added: git show -U0 | grep '^-[^-]\|^+[^+]' | sort -u Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | arm: mvebu: Replace license and copyright boilerplate by SPDX identifiersUwe Kleine-König2022-01-0311-166/+26
|/ | | | | | | | | | Converts the files that licensecheck can determine to be licensed under GPL-2.0-only or GPL-2.0-or-later and also convert their copyright statements to SPDX. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.barebox.org/20211230143145.68650-1-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: add dedicated header for printf/printkAhmad Fatoum2021-11-011-1/+1
| | | | | | | | | | | | Including <stdio.h> for printf is a bit problematic, because it pulls in other headers for <console.h>, which includes quite a few more headers as well. To make it easier to share code between barebox and host tools make <printk.h> the new minimal header for printf and move the extra logging stuff into <linux/printk.h>. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm/mvebu: sync barebox-arm-head.h to generic variantUwe Kleine-König2021-08-091-1/+24
| | | | | | | | | | | En passant this adds support for PBL_BREAK. While there is no 64 bit support available for mvebu, keeping the difference between arch/arm/mach-mvebu/include/mach/barebox-arm-head.h and arch/arm/include/asm/barebox-arm-head.h minimal is a good thing. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.barebox.org/20210730070001.1441742-1-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* restart: give all restart handlers a descriptive nameAhmad Fatoum2020-09-153-3/+3
| | | | | | | | | | | | | With incoming changes to choose a specific reset method, give all currently unnamed "default" reset handlers a name: - soc reset via SoC-specific means - soc-wdt reset via SoC watchdog timer - vector reset via jump to reset vector - efi reset via EFI firmware Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mvebu: make the compiler inline mvebu_remap_registersUwe Kleine-König2019-06-071-1/+1
| | | | | | | | | | | Without that gcc 7.3.1 (from OSELAS.Toolchain-2018.02.0) makes mvebu_remap_registers a standalone function which in its prolog saves two registers to the stack. However this function is called early during startup when there is no stack available yet and sp still points into the nirvana which makes barebox crash. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: add basic support for the Armada XP DB platformSascha Hauer2019-05-071-0/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Add missing includesSascha Hauer2019-03-181-0/+1
| | | | | | | | | Many files in the tree implement functions, but do not include the header files which provide the prototypes for these functions. This means conflicting prototypes remain undetected. Add the missing includes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Make locally used functions staticSascha Hauer2019-03-181-1/+1
| | | | | | | Many functions are only used locally but still are globally visible. Make these function static. Avoids warnings generated with -Wmissing-prototypes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: delete unused mach/dove.hAlexander Shiyan2019-01-211-23/+0
| | | | | | | This removes the stale mach/dove.h include as there is no user of it. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: delete unused mach/kirkwood.hAlexander Shiyan2019-01-211-22/+0
| | | | | | | This removes the stale mach/kirkwood.h include as there is no user of it. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Remove trailing whitespaces and tabsAlexander Shiyan2019-01-211-3/+3
| | | | | | | Just a cleanup over barebox tree Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mvebu: create bbu handler for kwb images and use it on cuboxUwe Kleine-König2018-06-133-0/+67
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kwbimage_v0: add support to detect and boot a mvebu v0 imageUwe Kleine-König2018-06-041-2/+9
| | | | | | | | | The differences between v0 and v1 of the mvebu kwbimage are small enough that the function to boot such an image can be shared between both variants. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dove: fix bit layout of DOVE_CPU_CTRL registerUwe Kleine-König2018-05-311-2/+2
| | | | | | | | | | | | | While creating the previous patch I checked the cpu's reference manual to see what the affected registers actually do and noticed that bits of the DOVE_CPU_CTRL actually used by the code doesn't match the bits described as AHBSlaveBase in the manual. I'm not aware of any effect (neither positive nor negative) of this patch. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dove: move memory controller remapping before RAM detectionUwe Kleine-König2018-05-312-22/+29
| | | | | | | | | | | | | | | | | | Compared to other mvebu cpus the memory controller registers are in their own register window that can be moved independently of the mbus register window. Since commit f05c6e095cf8 the available RAM configured by the boot ROM is read out earlier. This happens to be before the memory controller register window is moved and so dove_memory_find() fails. To fix this move the memory controller window together with the mbus window. This change allows to boot barebox first stage again on a Solidrun Cubox. Fixes: f05c6e095cf8 ("mvebu: rework how memory is detected") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: get_runtime_offset() returns unsigned longSascha Hauer2018-03-211-1/+1
| | | | | | | Change return type from uint32_t to unsigned long which is suitable for aarch64 aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: return positive offset in get_runtime_offset()Sascha Hauer2018-03-211-1/+1
| | | | | | | | | | | When we are linked at 0x0 and running at 0x01000000 then get_runtime_offset() should return 0x01000000 and not 0xff000000. This makes get_runtime_offset() more consistent and better understandable. This was tested on a Freescale i.MX53 Quickstart board. Additionally relocate_to_adr() was tested since that is normally not called. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: armada-xp: configure PLL and PHY registerJan Luebbe2017-08-152-0/+47
| | | | | | | | | The PLL setup is needed to use the USB ports in Linux. This code is ported from mainline U-Boot arch/arm/mach-mvebu/cpu.c. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* ARM: mvebu: Add initial support for Turris OmniaUwe Kleine-König2017-06-191-0/+10
| | | | | | | | Up to now only 2nd stage booting is tested and boots up to a prompt. i2c and spi are working, ethernet, usb and sata don't. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: initial support for Armada 38xUwe Kleine-König2017-06-192-0/+6
| | | | | | | | This SoC is similar enough to Armada 380/XP to make use of the code supporting these without further adaption. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: fix size mask for RAM windowUwe Kleine-König2017-06-131-1/+1
| | | | | | | | | | The size field in the window control register occupies bits 31:16. So adapt ARMADA_370_XP_DDR_SIZE_MASK accordingly. This fixes detection of RAM chips smaller than 32 MiB and so probably doesn't affect any supported machine. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: only build kwbootimage support if BOOTM is enabledLucas Stach2017-03-221-1/+1
| | | | | | | | As this is the bootm image handler implementation for the kwbootimage it is of no use if BOOTM is missing and fails to link. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kwbimage_v1: add support to boot a mvebu imageUwe Kleine-König2017-03-022-0/+85
| | | | | | | | This just starts the main image of the mvebu image assuming that the header images just setup the RAM. The position of the internal register window is provided in the header as introduced in the previous commit. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* mvebu: get initial position of register window from image headerUwe Kleine-König2017-03-023-3/+74
| | | | | | | | | | | | | | | A problem when using 2nd stage booting on mvebu is that the first bootloader already switched the register window location from 0xd0000000 to 0xf1000000 by writing to 0xd0000080. When the second bootloader also tries to do this switch it writes to the wrong location resulting in an exception and so a boot failure. For this reason the base address of the register window is passed in the barebox header and picked up from there by early code. In a further patch bootm is taught to put the actual position of the window there for the second bootloader to finally make second stage booting work. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* mvebu: kirkwood: simplify soc init code flowUwe Kleine-König2017-03-021-9/+2
| | | | | | | | | | | | | | | Similar to the two previous commits, this gets rid of a of-fixup which is strange because the soc init stuff is rerun then when a new dt for booting into Linux is loaded. The initcall must be postponed to post-core to ensure of_machine_is_compatible is working correctly. The call to mvebu_mbus_add_range is moved to drivers/bus/mvebu-mbus.c to ensure it's registered early enough. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mvebu: dove: simplify soc init code flowUwe Kleine-König2017-03-021-11/+2
| | | | | | | | | | | | | | | Similar to the previous commit, this gets rid of a of-fixup which is strange because the soc init stuff is rerun then when a new dt for booting into Linux is loaded. The initcall must be postponed to post-core to ensure of_machine_is_compatible is working correctly. The call to mvebu_mbus_add_range is moved to drivers/bus/mvebu-mbus.c to ensure it's registered early enough. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mvebu: armada-370-xp: simplify soc init code flowUwe Kleine-König2017-03-021-23/+8
| | | | | | | | | | | | | | This gets rid of a of-fixup which is strange because the soc init stuff is rerun then when a new dt for booting into Linux is loaded. The initcall must be postponed to post-core to ensure of_machine_is_compatible is working correctly. The call to mvebu_mbus_add_range is moved to drivers/bus/mvebu-mbus.c to ensure it's registered early enough. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mvebu: rework how memory is detectedUwe Kleine-König2017-02-168-182/+124
| | | | | | | | | | | | | | Status quo is that initially a size of 64 MiB is assumed (which is also used to determine the size of the malloc area) and then later the dtb is fixed up with the actually available RAM which is then used. Instead detect the real RAM size earlier and don't fixup the device tree. The device tree is fixed up instead by generic code. This way the malloc area is more appropriately sized and RAM detection is more similar to mach-imx which is both nice. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mvebu: remove unused function barebox_arm_reset_vectorUwe Kleine-König2017-02-161-6/+0
| | | | | | | This isn't needed since mvebu was converted to multi-pbl Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mvebu: simplify detection and fixup of MV78230-A0Uwe Kleine-König2017-02-161-19/+12
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: add support for Netgear RN2120Uwe Kleine-König2016-10-071-0/+4
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add initial support for Netgear ReadyNAS 104Uwe Kleine-König2016-01-221-0/+4
| | | | | | | | | | | | | | | Currently only second stage booting from the vendor U-Boot is tested. I don't want to flash barebox into NAND yet because UART-booting for recovery doesn't work for me. Working so far are: - UART - networking - nand flash Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* restart: replace reset_cpu with registered restart handlersSascha Hauer2015-08-275-26/+15
| | | | | | | | | | | | | | | | | | | | | | This replaces the reset_cpu() function which every SoC or board must provide with registered handlers. This makes it possible to have multiple reset functions for boards which have multiple ways to reset the machine. Also boards which have no way at all to reset the machine no longer have to provide a dummy reset_cpu() function. The problem this solves is that some machines have external PMICs or similar to reset the system which have to be preferred over the internal SoC reset, because the PMIC can reset not only the SoC but also the external devices. To pick the right way to reset a machine each handler has a priority. The default priority is 100 and all currently existing restart handlers are registered with this priority. of_get_restart_priority() allows to retrieve the priority from the device tree which makes it possible for boards to give certain restart handlers a higher priority in order to use this one instead of the default one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: armada-xp: Add Lenovo Iomega ix4-300dSebastian Hesselbarth2015-04-271-0/+4
| | | | | | | | This adds support for Marvell Armada XP based 4-bay NAS Lenovo Iomega ix4-300d. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: armada-xp: Sort boards and images alphabeticallySebastian Hesselbarth2015-04-271-4/+4
| | | | | | | | Before adding new Armada XP based boards becomes messier than necessary, sort Armada XP based board Kconfig and image Makefile alphabetically. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: armada-xp: Use MBUS_ERR_PROP_EN defineSebastian Hesselbarth2015-04-271-3/+3
| | | | | | | | With proper defines for ARMADA_370_XP_FABRIC_CTRL and MBUS_ERR_PROP_EN make use of it. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: armada-xp: Limit PUP access to Armada XPSebastian Hesselbarth2015-04-272-6/+15
| | | | | | | | | | | | | | Commit 6638760c225c37f90e822ebf4dd8f0d2cd0b0ef3 ("ARM: mvebu: Enable PUP register") correctly enables devices that are disabled after boot-up due to some Design For Testability registers. However, although harmless on Armada 370, call the code conditionally on Armada XP only. While at it, move PUP register defines to SYSCTL registers where they belong to. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: armada-xp: Fixup broken MV78230-A0 SoC IDSebastian Hesselbarth2015-04-272-4/+86
| | | | | | | | | Marvell Armada XP MV78230-A0 incorrectly identifies itself as MV78460. Check number of CPUs in FABRIC_CONF and fixup PCIe DEV_ID when it is 2 CPUs instead of 4. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: Move PCIe register defines to socid.hSebastian Hesselbarth2015-04-272-4/+5
| | | | | | | | To prepare PCIe device id fixups, move PCIe register defines to a common location. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bus: mvebu-mbus: Convert mbus platform driver to direct driverSebastian Hesselbarth2015-04-273-0/+3
| | | | | | | | | | Registering mbus driver as platform driver is a little late for some register accesses to work. We have to make sure boot-up mbus windows are disabled early, so call mbus driver directly from SoC init. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-081-1/+1
| | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: Enable PUP registerEzequiel Garcia2014-11-112-0/+12
| | | | | | | | | | | | | | As reported by Sebastian, we need to enable this explicitly for the Tx clock on RGMII. While here, let's enable all the other peripherals. Although this is documented to be required only for Armada XP SoC, it has been found to be harmless on Armada 370, so we do it unconditionally to simplify the code. Reported-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>