summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
Commit message (Collapse)AuthorAgeFilesLines
* ARM: at91: build for all SoCs when AT91_MULTI_BOARDS is selectedAhmad Fatoum2019-10-181-3/+3
| | | | | | | | | This reverts a hunk I missed after a rebase: A previous commit restricts ARCH_BAREBOX_MAX_BARE_INIT to only non-multi-image boards, so no need to touch it to be compatible with the new multi-image changes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: add basic sama5d2-som1-ek1 supportAhmad Fatoum2019-10-141-0/+8
| | | | | | | | | | | | | | | The ATSAMA5D27-SOM1-EK1 is Microchip's evaluation kit for the SAMA5D2 System in Packages (SiPs). The ATSAMA5D27C-D1G-CU SIP embeds 128 MB of DDR2 DRAM and the SoM has a PMIC, QSPI flash and a 100Mbps PHY. barebox already supports the sama5d2 clocks, GPIO/Pinctrl, QSPI controller and Ethernet MAC. Most notable omission is the sama5d2 variant of the SDHCI, which differs from the MCI used by previous AT91 boards, but we kernel boot over the network works, so lets add the board now and have the SDHCI follow later. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: add basic sama5d2 supportAhmad Fatoum2019-10-147-7/+442
| | | | | | | | Add hardware description, chip identification and clock changes to support the sama5d2 SoC. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: import lowlevel dbgu UART init code from at91bootstrapAhmad Fatoum2019-10-141-1/+62
| | | | | | | | | | | | | | | For use in PBL, import dbgu init code from: https://github.com/linux4sam/at91bootstrap/blob/v3.8.12/driver/at91_usart.c The brgr calculation at the beginning is a untangled version of the BAUDRATE macro from the usart.h header: #define BAUDRATE(mck, baud) \ (((((mck) * 10) / ((baud) * 16)) % 10) >= 5) ? \ (mck / (baud * 16) + 1) : ((mck) / (baud * 16)) Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: import lowlevel clock initialization from at91bootstrapAhmad Fatoum2019-10-145-4/+287
| | | | | | | | For use by future at91 first stage bootloaders, this commit imports https://github.com/linux4sam/at91bootstrap/blob/v3.8.12/driver/pmc.c Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: use compressed DTB for AT91_MULTI_BOARDSAhmad Fatoum2019-10-141-0/+1
| | | | | | | | | | | To offset the size increase by using multi-image have the DTBs be compressed. This reduces e.g. the microchip_ksz9477_evb_defconfig by about 22K from 244K to 222K. This will also come in handy when implementing first stage support later on. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: build for all SoCs when AT91_MULTI_BOARDS is selectedAhmad Fatoum2019-10-143-43/+45
| | | | | | | | | | | | | | | | | | | | With the addition of 15afd9d25 ("ARM: at91: Add initial support for the EVB-KSZ9477 eval board"), we now have two multi-image capable boards supported, but users still have to choose a specific SoC, so they can't be selected at the same time. Fix this, by restricting the menu to the non-multi-image configurations, i.e. CONFIG_ARCH_* symbols become specific to non-multi-image. The multi-image configurations on the other hand directly select the CONFIG_SOC_* symbol they require. Existing CONFIG_ARCH_* usage is adjusted to align with the new usage. Eventually, we would want to have a at91_multi_defconfig along with this, but for now leave existing configs as is. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: don't define ARCH_BAREBOX_MAX_BARE_INIT_SIZE for multi-imageAhmad Fatoum2019-10-141-10/+10
| | | | | | | | | | Since ed04a7c3 ("pbl multiimage: Allow to check image sizes"), we can now check sizes per entry point, so no need to a Kconfig symbol that applies to all boards for that. Thus drop the Kconfig symbol for multi-image, so per-entry-point max image sizes can follow in future. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: delete no-longer needed #ifdef guardsAhmad Fatoum2019-10-141-6/+0
| | | | | | | | | c16bcbc644 ("ARM: at91: remove unused defines") removed conflicting definitions from the headers, so we can include the headers and code that uses them unconditionally now. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: add gpio and pinctrl driver for sama5d2 PIO4Ahmad Fatoum2019-10-143-3/+177
| | | | | | | | | | | | The sama5d2 features a GPIO and pin controller different than the one we support in barebox. The device tree bindings are different as well, so it makes sense to have a separate driver for it. Add the pin control and GPIO driver as well as some helpers usable from PBL, should we want to do pinmuxing that early. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: provide at91_mux_pio3_pin for use in first stageAhmad Fatoum2019-10-142-8/+40
| | | | | | | | | | | Low level 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_pio3_pin function, but that one is only usable after driver probe. Instead, provide an at91_mux_pio3_pin function, which can be used at all times. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: correct __iomem 'qualifier' placementAhmad Fatoum2019-05-271-1/+1
| | | | | | | | __iomem applies to the pointee, not to the auto pointer that points at it. Move the annotation to correct this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: remove duplicate get_ddram_size codeAhmad Fatoum2019-05-271-31/+3
| | | | | | | | | | | | | | | | | Both at91_get_ddram_size and at91sama5_get_ddram_size are the same if is_sdram == false and is_nb == true. is_sdram is always false, because according to the sama5d{2,3,4} datasheets, the lowest possible value for AT91_DDRSDRC_MD is 3 (i.e. none of them supports SDR SDRAM). Therefore replace calls to at91sama5_get_ddram_size with at91_get_ddram_size while is_nb == true and remove the duplicate code. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: fix at91sama5_get_ddram_size for sama5d4Ahmad Fatoum2019-05-273-4/+13
| | | | | | | | | | | | | | | | | at91sama5_get_ddram_size() is despite the name specific to the sama5d3 which it was added alongside of. sama5d4 board code continues to use it, but accessing SAMA5D3_BASE_MPDDRC (0xffffea00) on a sama5d4 should result in a Data Abort (Datasheet Figure 5-1).. Fix this by giving at91sama5_get_ddram_size the mpddrc base address as argument and migrate users to use one of two helpers that specify the base address. Tested-by: Sam Ravnborg <sam@ravnborg.org> [afa: Sam didn't test this exact change, but tested the use of the critical part: accessing a different register] Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: remove #ifdefery around *_get_ddram_size helpersAhmad Fatoum2019-05-271-32/+1
| | | | | | | | | | | | c16bcbc644 ("ARM: at91: remove unused defines") removed the conflicting defintions from these headers, so it's ok to include them at the same time now. Do this and remove the noise. Suggested-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: remove no-longer needed subarch #ifdeferyAhmad Fatoum2019-05-271-12/+0
| | | | | | | | | | c16bcbc644 ("ARM: at91: remove unused defines") removed conflicting definitions from the headers, so they can now be included all at the same time. Do this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: remove references to non-existing CONFIG_ARCH_AT91*Ahmad Fatoum2019-05-272-8/+0
| | | | | | | | | These symbols aren't set anywhere in barebox and in some cases they guard non-existing headers. Remove them. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: debug_ll: make UART base address configurableAhmad Fatoum2019-05-272-27/+3
| | | | | | | | | | | | | | | | | | This is in line with other platforms such as i.MX, which allow specifying a debug port. As we can't use port indices because the UARTs aren't mapped consecutively, allow specifying a hex base at configuration time. A side effect of this patch is that sama5d4's HAVE_AT91_DBGU2 is now honored as well. Previously anything besides DBGU0 defaulted to DBGU1. Fixes: 06a0773ee31 ("ARM: at91: add sama5d4 soc support #2") Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Sam Ravnborg <sam@ravnborg.org> [afa: moved base address defaults to common/Kconfig] Signed-off-by: Ahmad Fatoum <afa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: replace __raw_{readl, writel} of peripherals with readl, writelAhmad Fatoum2019-05-247-82/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the potentially endianness-changing readl, writel and siblings directly. They looks prettier and are the correct thing to do, as even if the CPU is in big-endian mode, the peripherals are little-endian. Unlike Linux, barebox readl,writel are the same Linux' {readl,writel}_relaxed (they don't imply memory barriers) and thus there shouldn't be any functional change. Patch was generated by a mass search and replace. I looked it over, adjust some whitespace and further verified by reviewing the output of git diff HEAD~1 --word-diff | \ perl -pe 's/\[-(.*?)__raw_/{+$1/; s/-\]\{\+/+}{+/;' \ -e 's/(\{\+.*?\+\})\1/__ALL_IS_WELL__/' | grep '+}{+' which filters out the common case of lines where a single __raw_{readT,writeT} had its __raw_ prefix stripped without any further changes. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: at91: update to PMC bindingsSam Ravnborg2019-02-251-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on kernel 5.0-rc6 update at91 clk support to match the new PMC bindings. Manually added all changes done in the kernel from 4.9-rc3 to 5.0-rc6. New drivers required was added as seperate commits. This includes dt-compat code required to support at91sam5d3, as this is not yet ported to use the new PMC bindings. clk-programmable saw some extra changes - it had never been bulit. It is used only by at91sama5d2 - and barebox has no board support for this cpu (yet). The CONFIG_SOC symbols is used to select the relevant drivers. CONFIG_SOC_SAM9 selects several drivers, and in the future this can be split to keep the image size down. In the kernel CLK_OF_DECLARE_DRIVER() can be used for a two step init. In barebox this is a simple one step init. It was added to have less differences between the kernel and the barebox versions of the drivers. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: at91: add SOC_SAMA5{D2,D3,D4}Sam Ravnborg2019-02-251-2/+18
| | | | | | | | | | | This split allows us to distingush between the SOC types. The SOC symbols will be used in following patches. SOC_SAMA5D2 is essential unused for now,, and only added to prepare for future use Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: at91: fix at91_configure_usart6 warningSam Ravnborg2019-02-251-0/+1
| | | | | | | | | | | Add declaration to silence following warning: arch/arm/mach-at91/sama5d4_devices.c:487:24: warning: no previous prototype for ‘at91_configure_usart6’ Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: delete unused mach/sama5d3_matrix.hAlexander Shiyan2019-01-211-15/+0
| | | | | | | This removes the stale mach/sama5d3_matrix.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>
* Merge branch 'for-next/mtd'Sascha Hauer2019-01-151-0/+2
|\
| * mtd: atmel_nand: Add per board ECC setupLadislav Michl2018-12-141-0/+2
| | | | | | | | | | Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/missing-prototypes'Sascha Hauer2019-01-153-12/+3
|\ \
| * | ARM: AT91: add missing includesSascha Hauer2018-12-142-0/+2
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: AT91: remove unused functionSascha Hauer2018-12-141-11/+0
| | | | | | | | | | | | | | | | | | at91rm9200_set_type() is unused. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: AT91: at91rm9200 clocksource: Make locally used function staticSascha Hauer2018-12-141-1/+1
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / arm: at91: fix clock to mci1 for at91sam9263Sam Ravnborg2019-01-071-0/+3
|/ | | | | | | | | | | | | | at91_add_device_mci() was missing configuration of PIOA6 when configuring mci1. With this fix we can read data from SD card with at91sam9263ek, when built without DT. Building without a DT is required when we do a bootstrap build. The other at91samxxx_devices was checked - only the 9263 was missing the CLK configuration for mci1. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: add architecture dependecy to KSZ9477_EVB boardLucas Stach2018-12-071-0/+1
| | | | | | | This board is part of the SAMA5D3 architecture. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: remove unused definesSascha Hauer2018-11-0610-133/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: separate restart handler registration into SoC specific codeSascha Hauer2018-11-0617-45/+111
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: make at91sam926x_board_init board specificSascha Hauer2018-11-062-11/+30
| | | | | | | | | The base addresses used in at91sam926x_board_init() differ with each SoC. The board knows which SoC we are running on though, so create and use SoC specific variants of these functions which pass the appropriate base addresses to at91sam926x_board_init(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: drop at91_pmc_write()/at91_pmc_read()Sascha Hauer2018-11-063-7/+24
| | | | | | | at91_pmc_write() and at91_pmc_read() need a compile time base address, so remove them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91rm9200ek: use plain readl/writel for pmc accessesSascha Hauer2018-11-061-0/+1
| | | | | | | at91_pmc_write() needs a compile time base address, so rather use plain read/writel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91sam926x use writel rather than pmc accessor functionSascha Hauer2018-11-061-8/+9
| | | | | | | | The pmc accessor function depends on a compile time base address, so rather use writel directly. In this case we can hardcode the base address again since all at91sam926x SoCs have the same pmc base address. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: remove mach/io.hSascha Hauer2018-11-0620-57/+11
| | | | | | | Remove at91_sys_read() and at91_sys_write() since these are no longer used. This makes mach/io.h empty so remove that aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91rm9200 timer: Make system timer defines SoC specificSascha Hauer2018-11-063-55/+57
| | | | | | | | - rename at91_st.h to at91rm9200_st.h - rename prefix from AT91_ to AT91RM9200_ - remove register offset from System timer defines Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91rm9200 timer: remove unused includeSascha Hauer2018-11-061-1/+0
| | | | | | | at91rm9200_time.c doesn't need anything from at91_pmc.h, remove the inclusion. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: remove unused header fileSascha Hauer2018-11-062-147/+0
| | | | | | nothing from mach/at91_tc.h is used, remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91rm9200: Add SoC namespace to memory controller definesSascha Hauer2018-11-062-144/+148
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: Use SoC specific base addresses where appropriateSascha Hauer2018-11-068-22/+22
| | | | | | | Replace AT91_ base addresses with their SoC specific variants where possible. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: Add SoC namespace to matrix definesSascha Hauer2018-11-0513-530/+535
| | | | | | | Add SoC namespace to matrix define so we have one source less of conflicting defines. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: remove common matrix header fileSascha Hauer2018-11-051-30/+0
| | | | | | | The common matrix header file can be removed when the users include the SoC specific one. Fix the only user and remove the file. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: consolidate phy reset functionsSascha Hauer2018-11-056-6/+34
| | | | | | | | | | Many boards have the same ethernet phy reset function, so share the code in a common function. While at it remove the AT91_RSTC offset from the rstc register defines. AT91_RSTC was the offset between the AT91_SYSTEM_BASE and the reset controller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: remove AT91_SDRAM_BASESascha Hauer2018-11-054-12/+1
| | | | | | | AT91_SDRAM_BASE is only used in board code which known the SDRAM base address, so we do not need a common define. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: drop AT91_NB_USARTSascha Hauer2018-11-0510-20/+0
| | | | | | | | | AT91_NB_USART only used to return an error from at91_register_uart() if an invalid UART number is passed. This will never happen as the linker fails earlier in that case, so the runtime check can be removed and with it the now unused AT91_NB_USART define. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: remove unused definesSascha Hauer2018-11-059-126/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91sam926x: Add header for at91sam926x common base addressesSascha Hauer2018-11-051-0/+8
| | | | | | | There are some base addresses common to at91sam926x. Add a separate header for these. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>