summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-bcm283x
Commit message (Collapse)AuthorAgeFilesLines
* ARM: remove remaining occurences of CONFIG_MMU_EARLYSascha Hauer2023-10-231-2/+0
| | | | | | | CONFIG_MMU_EARLY has been removed. Remove the remaining occurences of this option. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: rework dma_sync_single_for_*() interfaceDenis Orlov2023-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a lot of code handles dma_addr_t values as if they actually hold CPU addresses. However, this is not always true. For example, MIPS architecture requires an explicit conversion from the physical address space to some virtual address space segment to get a valid CPU-side pointer. Another issue is that DMA ranges that may be specified in a device tree will not work this way. To get from a virtual address to a dma handle and vice versa we need to add/subtract some offset, which is calculated from "dma-ranges" property. Only dma_map_single() was doing this, but dma_sync_single_for_*() also should. Improve the interface by adding 'struct device' as the first argument to the dma_sync_single_for_*(). This allows to do cpu_to_dma/dma_to_cpu() conversions in common code and call into arch-specific code with proper cpu-side addresses. To make things more clear, make the virtual address argument of those arch-side functions be properly represented with a void* type. Apply the required changes in device drivers that use the affected functions, making them pass the appropriate device pointer. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230604215002.20240-2-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bcm283x: Move mach header files to include/mach/bcm283xSascha Hauer2023-03-066-716/+3
| | | | | | | | | | Currently arch specific headers can be included with longer possible as there won't be a single mach anymore. Move all bcm283x specific header files to include/mach/bcm283x/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: add debug_ll support for Raspberry Pi 4Ahmad Fatoum2022-06-172-0/+21
| | | | | | | | | | | The mini uart (Pins 8/10) is the primary UART on the Raspberry Pi 4 and can be set up in firmware by specifying enable_uart=1 in the config.txt. Add a DEBUG_LL implementation to use this for early debugging. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-20-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: add Raspberry Pi 4 supportAhmad Fatoum2022-06-172-0/+8
| | | | | | | | | | | | | | | With basic driver support added in previous commits, add the boilerplate to have barebox-raspberry-pi.img usable as bootloader for the Raspberry Pi 4 in 64-Bit mode. Tested peripherals: - SD-Card - pinctrl - clocksource - mini-UART Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-19-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: rpi: add Raspberry Pi 4 supportAhmad Fatoum2022-06-171-0/+1
| | | | | | | | | | | | Our Raspberry Pi clock driver is a hack, but it works well enough for older Rpis and just needs one more clock to support the SD-Card on the Raspberry Pi 4, so add that. In return, we remove bcm2835-cs, which we won't use on Raspberry Pi 4, because we'll leverage the ARM architected timer instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-16-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: rpi3: disallow MMU_EARLY && 64BITAhmad Fatoum2022-06-171-0/+2
| | | | | | | | | | | | Early MMU setup in 64-bit Raspberry Pi 3 barebox hangs, while normal setup concludes normally. Until this is figured out, disallow build of 64-Bit Raspberry Pi 3 support while CONFIG_MMU_EARLY=y. This issue doesn't affect the Raspberry Pi 4. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-15-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: add Raspberry Pi 3 64-bit build supportAhmad Fatoum2022-06-173-7/+20
| | | | | | | | | | | Have the subarch select the needed symbols to display a 32-bit/64-bit menu and hide the boards that aren't capable of 64-bit when CONFIG_64BIT=y. Building for 64-bit throws some warning about mismatched type sizes, so fix those as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-14-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: add generic Raspberry Pi imageAhmad Fatoum2022-06-171-0/+6
| | | | | | | | | | | | | | | | Add a new image that can be booted on all supported boards. This work by including DTs for all enabled boards in config and then consulting the mailbox interface at runtime to deduce which DT to pass to barebox proper. An alternative would have been to use the existing barebox-dt-2nd.img with a VideoCore-supplied device tree, but that has the drawback of requiring barebox to observe the same bindings as the kernel that's booted later. This approach makes migration straight-forward, because no difference in VideoCore configuration is required. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: switch to ARM_USE_COMPRESSED_DTBAhmad Fatoum2022-06-171-0/+1
| | | | | | | | | | We'll add a generic image containing multiple DTs in a follow-up commit, which would benefit from compressing the DTs. For uniformity, compress the existing DTs as well to save some kilobytes there. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: support PBL use of mboxAhmad Fatoum2022-06-174-9/+48
| | | | | | | | | | | | | | barebox uses DT to find out the base address of the mailbox. For the generic image, we need to use the mailbox interface to find out which DT to use. Resolve the chicken-egg problem by hardcoding a list of mailbox base addresses and selecting the correct one by looking up the CPU ID and using that to deduce the Raspberry Pi SoC type. Note that this is incompatible with arm_peri_high=1. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: move bcm2835_add_device_sdram() into headerAhmad Fatoum2022-06-173-53/+10
| | | | | | | | | | We will repurpose core.c in a later commit. It has a single function similar in spirit to bcm2835_register_fb which lives in a header, so move it there too. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: fix CM3 breakage after multi-image reworkAhmad Fatoum2022-05-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | barebox used to apply quirks by asking VideoCore firmware. If this was not possible, an error message is printed, but other initialization happened as expected. With the move to board driver matched by DT, we incur two breakages: - Compute Module 3/3+ used to be explicitly supported, but are absent in new compatible list - Unsupported variants used to initialize with only an error message, but now their revision ID must be known Fix this by amending the compatible list with all non-Raspberry Pi 4 compatibles listed in the binding. We also make existence of a match data optional and error out if it doesn't exist. This is so far unused, but it conveys the intent for future users. Fixes: c062cd5cf47d ("ARM: rpi: validate devicetree compatible instead of changing model name") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220502142959.1325298-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bcm2835 mbox: drop driver mode and probe on first requestOleksij Rempel2022-02-071-30/+22
| | | | | | | | | | | | | Currently we have multiple driver depending on the bcm2835 mbox. Since the probe dependency currently can't be solved properly we have different issue depending with or without deep-probe. To make it work with and without deep-probe, we need to init MBOX on first request. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220203104552.3158202-3-o.rempel@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: rpi: support raspberry pi 1 and zero mini-uartAhmad Fatoum2020-12-071-0/+1
| | | | | | | | | | | We don't have a clock driver for the raspberry pi, so board code needs to list which used devices have clocks that are already known to be active on boot. The Mini UART is one such device. We already wave away the clock on the BCM2836, do the same for the BCM2835 as well. Cc: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Use driver macroSascha Hauer2020-09-291-5/+1
| | | | | | | We have several macros for a oneline driver registration. Add some missing and use them consistently where possible througout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove references to CREDITSUwe Kleine-König2020-04-271-1/+0
| | | | | | | | The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97 ("Remove the CREDITS file"). Remove references to it from several files. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi mailbox: Use non interruptible timeoutSascha Hauer2020-01-081-3/+3
| | | | | | | | | | | This makes sure that during a mailbox transfer no other mailbox transfer is started. This happens on a raspberrypi3 where one GPIO on the firmware GPIO controller (which is controlled via mailbox) is registered as a heartbeat LED. With this it can happen that during a mailbox transfer the poller which drives the heartbeat LED is triggered in is_timeout() which results in corrupted transfers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bcm2835 mbox: use pr_* to print messagesSascha Hauer2020-01-081-17/+19
| | | | | | To give the user an idea where the messages come from. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: Add raspberrypi exp gpio driverSascha Hauer2020-01-081-0/+4
| | | | | | Taken from the kernel adopted to barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bcm2835 mbox: Remove response valid checkSascha Hauer2020-01-081-5/+0
| | | | | | | | Not all messages return a valid response as they do not send a response at all. This is at least true for the SET_GPIO_STATE and SET_GPIO_CONFIG messages. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: add board revision for Compute Module 3+Tomaz Solc2019-03-271-0/+1
| | | | | | | | | | | Raspberry Pi Compute Module 3+ was released in January 2019. Source for the new board revision code: https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md Signed-off-by: Tomaz Solc <tomaz.solc@tablix.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: Add mini UART debug_ll supportSascha Hauer2019-03-061-0/+37
| | | | | | | The raspberry pi 3 comes up with the mini UART as default, so allow to use it for debug_ll output. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: move debug UART Kconfig settingsSascha Hauer2019-03-062-24/+8
| | | | | | | | | | | | In contrast to other architectures, R.Pi debug UART config was placed under the "System Type" menu, not under the "Debugging -> low-level debugging port". This made this setting easy to miss when enabling low level debug mesages. While at it use the existing base address defines rather than defining them again in Kconfig. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* debug_ll: Move pl011 header file to architecture independent placeSascha Hauer2019-03-061-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: Move UART base address definitions to header fileSascha Hauer2019-03-061-0/+4
| | | | | | Move defines to header file to make them reusable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: Add device tree for Compute Module 3.Tomaz Solc2019-02-191-0/+6
| | | | | | | Compute Module needs "no-sd" property on the MMC interface otherwise mci-bcm2835 hangs on SD card probe. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: complete new revision schemeMoritz Augsburger2019-02-051-16/+26
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: move clks into board specific rpi-commonRouven Czerwinski2019-02-051-19/+0
| | | | | | | | | | | | We don't know if the firmware running on the raspberry pi is the same firmware which is running on all bcm283x devices. Therefore move the console clock initialization into the rpi-common.c board file. A future commit will use this function to retrieve the miniuart clock from the raspberry pi firmware. No functional changes. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/checkpatch'Sascha Hauer2018-12-071-0/+2
|\
| * Add Raspberry Pi Zero W BoardChris Fiege2018-11-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The Raspberry Pi Zero W is basically a Raspberry Pi 1 B+ but on a smaller PCB and with Bluetooth and WiFi. See: https://elinux.org/RPi_Hardware This patch adds support for Raspberry Pi Zero W to barebox. Signed-off-by: Chris Fiege <chris@tinyhost.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | multiple/raspberry-pi: fix clkdevs for raspberry piRouven Czerwinski2018-11-291-2/+2
|/ | | | | | | | | Commit 7e497d48acbd1184e3f6bd23bd16dfae84dd1129 introduced a name change which breaks support for the fixed clkdev for uart and sdhci for RPI. Use clkdev_add_physbase instead to be independant from the device tree names. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: add raspberry pi 3 supportLucas Stach2018-11-052-0/+7
| | | | | | | | | This adds basic support at the same feature level as the other supported raspberry pi boards. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: add revision IDs for Pi 3 Model B and Pi ZeroEnrico Joerns2018-11-051-0/+4
| | | | | | | Signed-off-by: Enrico Joerns <ejo@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* watchdog: implement bcm2835 watchdogLucas Stach2018-02-093-123/+1
| | | | | | | Move out of architecture code and add some real watchdog functionality. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: switch to DT probe and multi-image buildLucas Stach2017-03-024-62/+5
| | | | | | | | This commit switches the RaspberryPi arch over to probe Barebox from the builtin DT and enables multi-image builds. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: move debug UART base selection to KconfigLucas Stach2017-03-022-1/+25
| | | | | | | To let the user select the right base, when building multi-image. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: always build relocatable imageLucas Stach2017-03-021-1/+1
| | | | | | | | Makes more space available for the malloc area and will allow to switch to multi-image later on. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: convert watchdog/reset to regular driverLucas Stach2017-03-025-21/+84
| | | | | | | This way it can be probed from DT later on. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rpi: convert mailbox interface to regular driverLucas Stach2017-03-024-20/+61
| | | | | | | In prepareation for devicetree probing. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: bcm283x: add rpi2 supportAlexander Aring2016-01-073-3/+24
| | | | | | | | This patch adds Raspberry Pi 2 support in barebox. The features should be the same like the current RPi status in barebox. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bcm283x: mbox: align to cachesizeAlexander Aring2016-01-041-1/+3
| | | | | | | | | | | | This patch change the align of mbox stack resource to 32. The reason is that I had some experience with bcm2836 and the mbox implementation, after setting the align to 64(on bcm2836) the issues was gone. I found these values inside the u-boot implementation, they use 32 (bcm2835) and 64 (bcm2836). Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bcm2835: introduce mach-bcm283xAlexander Aring2016-01-049-0/+936
This patch changes the most part of mach-bcm2835 to mach-bcm283x. This prepares to add RPi2 support which is a bcm2836. This patch changes the Kconfig entry namens to BCM283X for drivers only. These drivers should working the same in bcm2836. While updating defconfig I added LED support/trigger option. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>