summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
Commit message (Collapse)AuthorAgeFilesLines
* ARM: at91: skov-arm9cpu: Add SD-Card xload supportSam Ravnborg2024-02-231-3/+1
| | | | | | | | | | | | | This updates skov-arm9cpu with xload support, and we can now use barebox as a replacement for at91bootstrap Only boot via SD card is supported. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: sam9263_ll: support configuration of PLLBAhmad Fatoum2024-02-232-8/+18
| | | | | | | | | | | | | | | | | PLLB may be used as input to derive the USB's 48 MHz clock. PLLA is already being setup by currently unused sam9263_lowlevel_init(), so add an extra parameter for PLLB as well. While at it, we change the API of sam9263_lowlevel_init(): AT91Bootstrap code has PLLA_SETTINGS and PLLB_SETTINGS as hex values in the headers, so it makes porting easier by just allowing low-level barebox code to use the values as is without having to split them up to stuff into a struct, only to have them ORed into a single value again. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: sam9263_ll: refactor MCK switch to PLLA for clarityAhmad Fatoum2024-02-231-10/+4
| | | | | | | | | | | Duplicating the bits being written to configure the MCK harms readability, so factor that out into a new variable to make clear the bits that change between the two calls to at91_pmc_cfg_mck(). Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: sam9263_ll: pass AT91_PMC_LL_AT91SAM9263 to PMC functionsAhmad Fatoum2024-02-231-4/+6
| | | | | | | | | | | | | | | The low level PMC driver does things differently according to its flags parameter that encodes what SoC is being used. The default case of flags == 0 is appropriate for the AT91SAM9263, but we have a AT91_PMC_LL_AT91SAM9263 macro that expands to 0, which makes apparent that we take the necessary precautions, so use that instead for documentation purposes. No functional change. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: sam9263_ll: drop PLL charge pump initializationAhmad Fatoum2024-02-231-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The datasheet[1] described the PLL Charge Pump Current Register in 27.9.17 very sparingly by mandating that 0x10001 is to be written into it. In the 28-Jan-16 revision of the datasheet the access mode for the register was changed from Write-only to Read/Write. Indeed reading the register is possible, but it seems to always return 0, even directly after write. Given that code for initializing the PLL charge pumps was added to AT91Bootsrap only for SAMA5 support and that apparently no adverse effect was observed on SAM9263 for not doing this for all these years, it follows that the PLL charge pump has to be already initialized on POR or by BootROM and we are better off playing it safe and not introducing code in the PMC setup that didn't exist in Atmel's own AT91Bootstrap. Therefore drop that line again. There are no upstream boards calling this function yet anyway, so this should have very limited effect. [1]: Atmel-6249N-ATARM-SAM9263-Datasheet_14-Mar-16 Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: at91: sync drivers with LinuxAhmad Fatoum2024-02-161-1/+14
| | | | | | | | | | | | | | | | | | | During bug hunt of a clocking issue that ultimately turned out to be unrelated, I resynced AT91 clk support with Linux. The changes look more extensive than they really are, because I first imported the clock drivers before a major overhaul of the barebox clock framework to be more compatible with the more recent kernel API changes. Most of the diff is due to that, but this resync also fixes at least a USB issue for the at91rm9200 and adds support for the new SAMA7 SoC as well as more clocks for the SAM9x60. Both these SoCs aren't supported by barebox yet, but this at least adds clock driver support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240215121837.251013-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: make COMMON_CLK a visible symbolAhmad Fatoum2024-01-192-3/+5
| | | | | | | | | | | | | | | | | | | So far, we expected platforms to select COMMON_CLK if they have a clock controller that's covered by the common clk framework and HAVE_CLK if they have a legacy clock driver. With the addition of SCMI clocks, platforms, especially virtualized ones, that previously didn't need clock support may now want access to them. Instead of having to select COMMON_CLK from such platforms on the off-chance that SCMI clocks may need to be used, just make COMMON_CLK user visible, so it can be selected as needed. As COMMON_CLK needs to conflict with legacy clock support, we also add a symbol for that and start selecting it where appropriate, Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240118090718.1314156-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: add first DT support for Calao usb/tny boardsAhmad Fatoum2023-10-041-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | We have a lot of defconfigs for ARM9 AT91 boards, that we want to get rid off after migrating the boards to at91_multi_defconfig. Thanks to a temporarily donated Calao USB-A9G20 by Wolfram, we start by switching the Calao boards to DT. This is not yet a complete replacement: - We use the legacy NAND driver instead of the newly backported driver that Linux uses with the hardware, presumably without issues - OHCI hangs during probe, so it's disabled for now - A barebox with comparative functionality to the non-DT version exceeds the 256K partition size These can be resolved separately though, so add here first DT support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230926183835.2617909-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: sam9260: don't build non-DT device support when unneededAhmad Fatoum2023-10-041-1/+1
| | | | | | | | | | | | The _device.c files create helper functions for creating devices for legacy boards that do not support CONFIG_AT91_MULTI_BOARDS. We are adding DT support for 9260, so guard the file behind a !CONFIG_AT91_MULTI_BOARDS check. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230926183835.2617909-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: at91sam9_rst: add DT support for at91sam9260Ahmad Fatoum2023-10-041-3/+15
| | | | | | | | | | AT91SAM9260 needs a special reset sequence that we already implement at91sam9_reset(). Make it easily available to DT-enabled boards by adding it to the at91sam9_rst driver used for newer SoCs. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230926183835.2617909-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: add SDRAMC driver for memory detectionAhmad Fatoum2023-10-043-0/+51
| | | | | | | | | | | | | We already have support to read back memory size from the SDRAM controller on older AT91 processor via the at91_get_sdram_size() function, but that's mostly called from board code. Add a proper driver that can probe the SDRAM device in the DT to dynamically detect the memory without hardcoding. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230926183835.2617909-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: add support for SAMA5D3 - Ethernet Development System BoardOleksij Rempel2023-07-281-0/+10
| | | | | | | | | | | | | | | | | | Microchip Technology SAMA5D3 Ethernet Development System (EDS) Board (DM320114) is an MPU-based platform for evaluating Ethernet Switch and PHY products. Compatible Ethernet Switch and PHY Evaluation Boards connect to the SAMA5D3 EDS Board via either an RGMII or RMII connector. The Microchip Technology SAMA5D3 EDS Board is not intended for stand-alone use and has no Ethernet capabilities when no daughter board or an USB Ethernet adapter is connected. For more information see: https://www.microchip.com/en-us/development-tool/DM320114 Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230706081126.784759-2-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: enable ddramc for sama5d3 and sama5d4Oleksij Rempel2023-07-281-0/+2
| | | | | | | | | | ddramc has already support for sama5d3 and sama5d4, so enable it officially. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230706081126.784759-1-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>
* treewide: drop trailing spaceAhmad Fatoum2023-05-021-2/+2
| | | | | | | | | | | | | | Found by manual inspection of the output of: rg '\s+$' | rg -v dts/ Patch can be verified by observing that no diff results from: git show --ignore-space-at-eol Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230424121805.150434-4-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: Move mach header files to include/mach/at91Sascha Hauer2023-03-0694-6844/+173
| | | | | | | | | | Currently arch specific headers can be included with longer possible as there won't be a single mach anymore. Move all at91 specific header files to include/mach/at91/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: Use ENTRY_FUNCTION_HEADSascha Hauer2023-03-033-56/+39
| | | | | | | | Use ENTRY_FUNCTION_HEAD in the at91 boards to customize the barebox image header without having to hook into a generic include file. Link: https://lore.barebox.org/20230302111606.1054037-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* at91: consolidate usb-a963 128m imagesSascha Hauer2023-03-011-6/+0
| | | | | | | | | We have some at91 which differ from other configs only in the memory size. Let's exploit the multiimage mechanism to build both memory sizes from the same config using different images. Link: https://lore.barebox.org/20230228143031.1718565-9-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: Switch all boards to multiimageSascha Hauer2023-03-011-1/+0
| | | | | | | | | Most at91 boards are not safe for multiimage support. We can however switch their compilation to the multiimage way which allows us to get rid of some legacy cruft in the longer run. Link: https://lore.barebox.org/20230228143031.1718565-8-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: SAMA5D4: add Wifx L1 supportAhmad Fatoum2023-01-121-0/+8
| | | | | | | | | | | | | | | The Wifx L1 is a SAMA5D4 LoRaWAN gateway. It boots from NAND, but this can be overridden by inserting a bootable SD-Card. This first port only provides second-stage SD-Card support. It enables use of UART, I2C/EEPROM, Ethernet and SD-Card. For NAND use on SAMA5D4, an updated Linux driver was ported to barebox. This will follow separately. Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230109130822.1657470-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: make bootsource code generic to all SAMA5Ahmad Fatoum2023-01-128-21/+43
| | | | | | | | | | | | While I couldn't find documentation, the BootROM of all of SAMA5D2, D3 and D4 populates R4 when calling next stage bootloader with information about the booutsource. barebox PBL will pass along this information to barebox proper, so add a generic initcall that sets the bootsource. Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230111172219.1640151-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: sama5d4: enable for DT useAhmad Fatoum2023-01-121-2/+2
| | | | | | | | | | | | | The sama5d4[devices].c files are for non-OF instantiation of platform devices. We don't need anything out of these two files, so don't build them when compiling for CONFIG_AT91_MULTI_BOARDS. We use that instead of CONFIG_OFDEVICE, as sama5d4_xplained_defconfig and sama5d4ek_defconfig enable CONFIG_OFDEVICE, but probe no device at all from DT. Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230111172219.1640151-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: sama5d4: add entry point helpersAhmad Fatoum2023-01-104-0/+15
| | | | | | | | | | Like already done for sama5d2 and sama5d3, provide a set of helpers for use in device-tree-enabled SAMA5D4 boards. Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230109130822.1657470-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: sama5: switch to nonnaked entry functionsAhmad Fatoum2023-01-101-4/+15
| | | | | | | | | | | | Functions were kept naked because they modify the stack pointer. We can hoist that up and change the board-provided entry point to be non-naked to be more robust in face of unexpected compiler optimizations. Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230109130822.1657470-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct driver_d to driverSascha Hauer2023-01-103-3/+3
| | | | | | | | | | | The '_d' suffix was originally meant to distinguish barebox struct names from Linux struct names. struct driver doesn't exist in Linux, so we can rename it and remove the meaningless suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-108-13/+13
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: replace errno_str() with %m printf format specifierAhmad Fatoum2022-10-111-1/+1
| | | | | | | | | | | Both errno_str() and printf("%m" end up calling strerror(). %m is more convenient to use, so switch over all instances to it. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/bootsource'Sascha Hauer2022-08-111-2/+2
|\
| * bootsource: rename existing bootsource_set to bootsource_set_rawAhmad Fatoum2022-08-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patterns like [ "$bootsource" = mmc ] && boot mmc$bootsource_instance expect that ${bootsource_instance} and MMC aliases align, which may not always be the case. In preparation for adding a new bootsource_set function that consults an optional mapping table from bootrom bootsource_instance to board-specific device numbering, rename all existing instances to bootsource_set_raw. While at it, clean up the legacy split into bootsource_set and bootsource_set_instance and have the new bootsource_set_raw accept both arguments at once. No functional change intended. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220720055042.3510276-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | pbl: factor out pbl_bio API into pbl/bio.hAhmad Fatoum2022-08-083-3/+3
| | | | | | | | | | | | | | | | | | | | | | We'll be adding more PBL driver interface definitions into include/pbl, so move the block I/O stuff there as well. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220805082137.2202560-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: at91: Add lowlevel helpers for at91sam9263Sam Ravnborg2022-06-303-0/+270
| | | | | | | | | | | | | | | | | | Add lowlevel helpers like we already have for sama5d2 etc. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220628203849.2785611-9-sam@ravnborg.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: at91: Add extra register definitionsSam Ravnborg2022-06-305-8/+141
| | | | | | | | | | | | | | | | | | Copied from at91bootstrap. Required in subsequent patches. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220628203849.2785611-8-sam@ravnborg.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: at91: Add at91sam9 xload_mmc for PBL useSam Ravnborg2022-06-303-0/+123
| | | | | | | | | | | | | | | | | | | | | | | | Add xload support to at91sam9263 similar to what is already present for the sama5d3. The xload supports reading barebox.bin from a SDCARD from the PBL and load the full barebox.bin and starts it. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220628203849.2785611-7-sam@ravnborg.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: atmel_mci: Add PBL helper to configure highcapacitySam Ravnborg2022-06-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Older atmel SoC's like at91sam9263 do not support highcapacity SD cards. Add helper that can be used to disable highcapacity support in the PBL code - as probing for the SD card type is not an option. Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220628203849.2785611-6-sam@ravnborg.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: at91: Provide at91_mux_pio_pin for use in lowlevelSam Ravnborg2022-06-301-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lowlevel init code may wish the ability to configure pins, e.g. for low level debug UART. The pinctrl-at91 driver already exports an at91_mux_pin function, but that one is only usable after driver probe. Instead, provide an at91_mux_pio_pin function, which can be used at all times. This is similar to the already existing at91_mux_pio3_pin function Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220628203849.2785611-5-sam@ravnborg.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: at91: Add initialize function to sdramcSam Ravnborg2022-06-303-1/+84
| | | | | | | | | | | | | | | | | | | | | | Port the sdramc initialize function from at91bootstrap. It is needed from lowlevel code and is a replacement for the sdramc init code in at91sam926x_board_init.h Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220628203849.2785611-4-sam@ravnborg.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: at91: Make sdramc.h useable in multi image buildsSam Ravnborg2022-06-301-41/+4
|/ | | | | | | | | | | There is no need to ifdef out all the static inlines as the headers no longer conflicts. Drop the ifdefs so we can now use the header in multi image builds. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220628203849.2785611-3-sam@ravnborg.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: assign non-zero priorities to all clocksourcesAhmad Fatoum2022-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most barebox clocksources have a zero priority and if multiple of them exist, but no higher priority ones, the first to call init_clock wins. Some supported boards like the Raspberry Pi additionally depended on initcall ordering to favor one zero-priority clocksource over another. With the move to deep probe and with Commit b641580deb8c ("of: platform: Ensure timers are probed early"), device tree blob iteration order could now dictate which clocksource is ultimately used. This led to a 20 times slower clock source being chosen on the Raspberry Pi, because the ARM architected timer was taken instead of the bcm2835 timer. Fix the root cause by assigning priorities to all clocksource drivers. Priorities chosen are: 50: device_initcall 60: coredevice_initcall 70: postcore_initcall 80: core_initcall These priorities are all below 100, which was previously the lowest positive priority and as they are positive, they win against the dummy clocksource. This should ensure no priority inversion happens. Fixes: b641580deb8c ("of: platform: Ensure timers are probed early") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220425094857.674044-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arch: add SPDX-License-Identifier to all .c filesAhmad Fatoum2022-01-0510-0/+20
| | | | | | | | | 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-055-0/+10
| | | | | | | | | 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: AT91: migrate sama5d3-xplained to DTAhmad Fatoum2021-10-011-5/+9
| | | | | | | | | | | | | | | | | | | | We have one other DT-enabled SAMA5D3 board already: microchip-ksz8477-evb, which is basically a sama5d3 xplained in different form factor and with a switch. Mimic what we do there to get rid of the sama5d3 board code. Unlike the microchip-ksz9477-evb, the barebox support for this board includes NAND, which is not yet up to date with respect to DT: - SMC for NAND configuration has no DT driver. Instead the board driver create this device - We don't support the newer NAND DT bindings (EBI). The device trees fix this up, so barebox sees the old bindings with the upstream partition layout. In future, this could be fixed. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210922065000.20970-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: sam9_smc: register driver earlierAhmad Fatoum2021-10-011-1/+1
| | | | | | | | | | | | | | | | | | The driver probe only depends on the device's resources, so there is no need to delay registration to coredevice_platform_driver. The way the AT91 code is structured is that: - board code adds SMC device (not probed from DT, so no deep probe) - SMC driver probe runs and stores regions - board code calls into SMC driver to apply config to regions - board code registers NAND Failure to keep this order results either in non-functional NAND or crash. Take the easy way out. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210922065000.20970-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: fix building samad2 images without sama5d3Ahmad Fatoum2021-08-091-4/+1
| | | | | | | | | | | | Addition of first stage support for SAMA5D3 added a dependency between sama5d2 and sama5d3 first stages: They both needed to be enabled to generate images for either. Break up this dependency to fix build failures for configs that e.g. only build one SoC. Fixes: e30fb46597d3 ("ARM: at91: xload-mmc: add sama5d3_atmci_start_image() helper") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210722124137.7431-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/overlapping-memory-banks'Sascha Hauer2021-06-161-3/+1
|\
| * ARM: report probe error at arm_add_mem_device() callsites on failureAhmad Fatoum2021-06-021-3/+1
| | | | | | | | | | | | | | | | | | | | | | Failure to add one memory bank shouldn't prevent the driver from trying to add other memory banks, but the user should be informed as this points at a misconfiguration. Have the probe functions eventually fail with -EBUSY in such a case. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210531071239.30653-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: at91: xload-mmc: fix typo in sama5d3_atmci_start_image()Oleksij Rempel2021-06-021-1/+1
|/ | | | | | | | Use SAMA5D3_ID_PIOD instead of SAMA5D2_ID_PIOD Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20210601084233.7948-1-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/at91'Sascha Hauer2021-05-1710-0/+216
|\
| * ARM: at91: sama5d3: add multiimage support for the microchip-ksz9477-evbOleksij Rempel2021-05-171-0/+88
| | | | | | | | | | | | | | | | | | Rework the lowlevel init code to make it multiimage capable. With this patch we can build first and second stage in one run. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20210423142829.29468-7-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: at91: ddramc: add sama5d3_barebox_entry() handlerOleksij Rempel2021-05-172-0/+9
| | | | | | | | | | | | | | | | Add sama5d3 specific barebox_entry helper. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20210423142829.29468-4-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>