summaryrefslogtreecommitdiff
path: root/arch/arm/mach-bcm283x
AgeCommit message (Collapse)AuthorFilesLines
2020-07-10Merge tag 'rpi-next-2020.10' of ↵Tom Rini4-4/+82
https://gitlab.denx.de/u-boot/custodians/u-boot-raspberrypi - add support for PCI and XHCI for RPi4 (64 bit only) - optionally reset XHCI device on registration - enable USB_KEYBOARD for rpi_4_defconfig
2020-07-10rpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 32bit)Marek Szyprowski3-0/+30
Create a non-cacheable mapping for the 0x600000000 physical memory region, where MMIO registers for the PCIe XHCI controller are instantiated by the PCIe bridge. Due to 32bit limit in the CPU virtual address space in ARM 32bit mode, this region is mapped at 0xff800000 CPU virtual address. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2020-07-10arm: rpi: Add function to trigger VL805's firmware loadNicolas Saenz Julienne3-0/+66
On the Raspberry Pi 4, after a PCI reset, VL805's (a xHCI chip) firmware may either be loaded directly from an EEPROM or, if not present, by the SoC's VideCore (the SoC's co-processor). Introduce the function that informs VideCore that VL805 may need its firmware loaded. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2020-07-09rpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 64bit)Marek Szyprowski1-3/+15
Create a non-cacheable mapping for the 0x600000000 physical memory region, where MMIO registers for the PCIe XHCI controller are instantiated by the PCIe bridge. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2020-07-09rpi4: shorten a mapping for the DRAMMarek Szyprowski1-1/+1
Remove the overlap between DRAM and device's IO area. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2020-05-19common: Drop linux/bug.h from common headerSimon Glass1-0/+1
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop log.h from common headerSimon Glass1-0/+1
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop init.h from common headerSimon Glass1-0/+1
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop net.h from common headerSimon Glass1-0/+1
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-13rpi: Kconfig option for initial page reservationKyle Evans1-0/+2
While the nearly-universal default for the Raspberry Pi family is to use spin tables and the spin table implementation provided by the Raspberry Pi Foundation, FreeBSD and others may use a PSCI implementation instead. Accommodate these setups by allowing them to configure for more than one page to be reserved in the initial reservation. The default reservation remains as one page. Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2020-01-29rpi4: Update memory map to accommodate scb devicesAmit Singh Tomar1-3/+3
Some of the devices(for instance, pcie and gnet controller) sitting on SCB bus falls behind/below the memory range that we currenty have. This patch updates the memory range to map those devices correctly. Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Tested-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2020-01-17common: Move reset_cpu() to the CPU headerSimon Glass1-0/+1
Move this function out of common.h and into a relevant header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-12-03common: Move ARM cache operations out of common.hSimon Glass1-0/+1
These functions are CPU-related and do not use driver model. Move them to cpu_func.h Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-03common: Move some cache and MMU functions out of common.hSimon Glass1-0/+1
These functions belong in cpu_func.h. Another option would be cache.h but that code uses driver model and we have not moved these cache functions to use driver model. Since they are CPU-related it seems reasonable to put them here. Move them over. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-11-24ARM: defconfig: add unified config for RPi3 and RPi4Matthias Brugger1-0/+7
Provide a defconfig which allows us to boot Raspberrry Pi 4 and Raspberry Pi 3 Model B/B+ Instead of using the embedded DTB as done in RPi3 we use the devicetree provided by the firmware. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2019-11-24ARM: bcm283x: Set memory map at run-timeMatthias Brugger1-0/+92
For bcm283x based on arm64 we also have to change the mm_region. Add assign this in mach_cpu_init() so we can create now one binary for RPi3 and RPi4. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2019-11-24ARM: bcm283x: Set rpi_bcm283x_base at run-timeMatthias Brugger2-8/+18
As part of the effort to create one binary for several bcm83x SoCs we read the IO base address from device-tree. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2019-11-24ARM: bcm283x: Move BCM283x_BASE to a global variableMatthias Brugger8-9/+52
We move the per SOC define BCM283x_BASE to a global variable. This is a first step to provide a single binary for several bcm283x SoCs. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2019-10-31lib: time: Add microsecond timerMarek Vasut1-3/+0
Add get_timer_us(), which is useful e.g. when we need higher precision timestamps. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> [trini: Fixup arch/arm/mach-bcm283x/include/mach/timer.h] Signed-off-by: Tom Rini <trini@konsulko.com>
2019-09-06ARM: bcm283x: Include definition for additional emmc clockAndrei Gherzan1-0/+1
This clock has a different mbox ID so have this included in the relevant header file. Signed-off-by: Andrei Gherzan <andrei@balena.io> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2019-09-06ARM: bcm283x: Define configs for RaspberryPi 4Andrei Gherzan1-0/+62
Define two target configs for Raspberry Pi 4 (32 and 64bit) and the corresponding BCM2838* configs. Be aware of the current limitation in firmware which requires an explicit configuration to force the arm in 64bit mode when the respective target is used. Signed-off-by: Andrei Gherzan <andrei@balena.io> [mb: rename BCM2838 -> BCM2711] Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2019-09-06ARM: bcm283x: Add BCM283x_BASE defineMatthias Brugger5-20/+9
Devices of bcm283x have different base address, depending if they are on bcm2835 or bcm2836/7. Use BCM283x_BASE depending on the SoC you want to build and only add the offset in the header files. Signed-off-by: Matthias Brugger <mbrugger@suse.com> Signed-off-by: Andrei Gherzan <andrei@balena.io>
2019-09-06ARM: bcm283x mbox: Fix send status registerFabian Vogt2-5/+8
Before we can send a message to the mailbox we have to check that there is space to do so. Therefore we poll the status register. But up to now the wrong status register, the one of mailbox 0, was checked. Fix this by polling the status regiser of mailbox 1. Signed-off-by: Fabian Vogt <fvogt@suse.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> [mb: rename registers and update commit message] Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2019-08-05watchdog: bcm2835_wdt: Remove unused BCM283x watchdog driver and its referencesStefan Roese1-4/+0
The BCM2835/2836 watchdog is not used in mainline U-Boot at all. This patch removes the driver and its references (CONFIG_BCM2835_WDT) completely. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Paolo Pisati <p.pisati@gmail.com>
2019-06-12ARM: bcm283x: Fix definition of MBOX_TAG_TEST_PIXEL_ORDERBerkus Decker1-1/+1
The MBOX_TAG_TEST_PIXEL_ORDER define is incorrect. According to official documentation it has a slightly different numbering. Correct mailbox constants are defined in e.g. linux raspberry-firmware https://code.woboq.org/linux/linux/include/soc/bcm2835/raspberrypi-firmware.h.html#RPI_FIRMWARE_FRAMEBUFFER_TEST_PIXEL_ORDER These are obtained from the bcm2835 documentation e.g. https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface#test-pixel-order Fix the define to get us back in sync with the spec. Signed-off-by: Berkus Decker <berkus+github@metta.systems> [agraf: clarify subject, extend commit message] Signed-off-by: Alexander Graf <agraf@csgraf.de> [mb: updating email of agraf] Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2019-01-18arm: Kconfig: spelling fixesChris Packham1-5/+5
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2018-06-14efi_loader: Convert runtime reset from switch to if statementsAlexander Graf1-7/+4
We currently handle the UEFI runtime reset / power off case handling via a switch statement. Compilers (gcc in my case) may opt to handle these via jump tables which they may conveniently put into .rodata which is not part of the runtime section, so it will be unreachable when executed. Fix this by just converting the switch statement into an if/else statement. It produces smaller code that is faster and also correct because we no longer refer .rodata from efi runtime code. Reported-by: Andreas Färber <aferber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-05-07arm: v7: Kconfig: Rename CPU_V7 as CPU_V7ALokesh Vutla1-2/+2
Currently CPU_V7 kconfig symbol supports only ARMv7A architectures under armv7 folder. This led to a misconception of creating separate folders for armv7m and armv7r. There is no reason to create separate folder for other armv7 based architectures when it can co-exist with few Kconfig symbols. As a first step towards a common folder, rename CPU_V7 as CPUV7A. Later separate Kconfig symbols can be added for CPU_V7R and CPU_V7M and can co exist in the same folder. Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Michal Simek <michal.simek@xilinx.com> Suggested-by: Alexander Graf <agraf@suse.de> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini13-27/+13
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-09Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini1-2/+3
Patch queue for efi - 2018-04-09 Highlights this time around: - Lots of minor spec compliance fixes - Support full range of GOP BLT commands - More fine grained error checking - Network fixes (init, DP) - Lots of other bug fixes...
2018-04-05mmc: use core clock frequency in bcm2835 sdhostJonathan Gray2-3/+4
In raspberrypi-firmware 7fdcd00e00a42a1c91e8bd6f5eb8352fe9358557 and later start.elf now sets the EMMC clock to 200 MHz. According to Phil Elwell in https://github.com/raspberrypi/firmware/issues/953 the SDHost controller shares the core/VPU clock and doesn't use the EMMC clock. Use the core clock id when determining the frequency to allow U-Boot to work with recent versions of raspberrypi-firmware. Otherwise U-Boot hangs at: U-Boot 2018.03 (Mar 14 2018 - 20:36:00 +1100) DRAM: 948 MiB RPI 3 Model B (0xa02082) MMC: mmc@7e202000: 0, sdhci@7e300000: 1 Loading Environment from FAT... Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: add missing EFI_RESET_PLATFORM_SPECIFICHeinrich Schuchardt1-0/+1
EFI_RESET_PLATFORM_SPECIFIC is one of the values that can be used for the EFI service ResetSystem. The missing definition is added. The value has to handled in efi_reset_system(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: exit status for efi_reset_system_initHeinrich Schuchardt1-2/+2
efi_reset_system_init provides the architecture or board specific initialization of the EFI subsystem. Errors should be caught and signalled by a return code. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28bcm283x: Add pinctrl driverAlexander Graf1-2/+0
The bcm283x family of SoCs have a GPIO controller that also acts as pinctrl controller. This patch introduces a new pinctrl driver that can actually properly mux devices into their device tree defined pin states and is now the primary owner of the gpio device. The previous GPIO driver gets moved into a subdevice of the pinctrl driver, bound to the same OF node. That way whenever a device asks for pinctrl support, it gets it automatically from the pinctrl driver and GPIO support is still available in the normal command line phase. Signed-off-by: Alexander Graf <agraf@suse.de>
2017-12-04add support for Raspberry Pi Zero WDmitry Korunov1-0/+16
Signed-off-by: Dmitry Korunov <dessel.k@gmail.com>
2017-05-10bcm2835_wdt: support for the BCM2835/2836 watchdogPaolo Pisati1-3/+18
Signed-off-by: Paolo Pisati <p.pisati@gmail.com>
2017-05-10video: arm: rpi: Move the video settings out of the driverSimon Glass2-0/+78
Add a function to set the video parameters to the msg handler and remove it from the video driver. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
2017-05-10video: arm: rpi: Move the video query out of the driverSimon Glass2-0/+35
Add a function to get the video size to the msg handler and remove it from the video driver. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
2017-05-10arm: rpi: Add a function to obtain the MMC clockSimon Glass2-0/+35
Move this code into the new message handler file. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-10arm: rpi: Add a file to handle messagesSimon Glass3-1/+58
The bcm283x chips provide a way for the ARM core to communicate with the graphics processor, which is in charge of many things. This is handled by way of a message prototcol. At present the code for sending message (and receiving a reply) is spread around U-Boot, primarily in the board file. This means that sending a message from a driver requires duplicating the code. Create a new message implementation with a function to support powering on a subsystem as a starting point. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-10arm: rpi: Drop the GPIO device addressesSimon Glass1-5/+0
We can rely on the device tree to provide this information. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-11-29ARM: bcm283x: Implement EFI RTS reset_systemAlexander Graf2-7/+54
The rpi has a pretty simple way of resetting the whole system. All it takes is to poke a few registers at a well defined location in MMIO space. This patch adds support for the EFI loader implementation to allow an OS to reset and power off the system when we're outside of boot time. Signed-off-by: Alexander Graf <agraf@suse.de>
2016-09-06bcm2835_gpio: Implement GPIOF_FUNCAlexander Graf1-0/+2
So far we could only tell the gpio framework that a GPIO was mapped as input or output, not as alternative function. This patch adds support for determining whether a function is mapped as alternative. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
2016-04-12rpi: remove redundant board filesStephen Warren2-17/+21
Now that rpi_*defconfig and Kconfig (rather than the config header file) provide the identity of the build, we don't need to separate config headers and board directories for each RPi variant. Set CONFIG_SYS_BOARD and CONFIG_SYS_CONFIG_NAME so that we can get rid of the duplication. This requires a tiny number of extra ifdefs in the config header. The only disadvantage of this approach is that the $board/$board_name environment variables aren't as descriptive as they used to be. This isn't really an issue because those only exist to allow scripts to create DTB filenames at runtime. However, the RPi board code already sets $fdtfile to something more accurate based on FW-reported board ID anyway. While at it, unify some Kconfig select options, and add a MAINTAINERS entry for bcm283x too. Partially-suggested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-11ARM: rpi: add some missing Kconfig help textStephen Warren1-1/+27
Add notes re: enabling the UART to the RPi 3 32-bit help text. Fully describe the RPi 3 64-bit board option. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-11ARM: add Raspberry Pi 3 64-bit configStephen Warren1-0/+7
On all Pis so far, the VC FW provides a short stub to set up the ARM CPU before entering the kernel (a/k/a U-Boot for us). This feature is not currently supported by the VC FW when booting in 64-bit mode. However, this feature will likely appear in the near future, and this U-Boot port assumes that such a feature is in place. Without that feature, or a temporary workaround described below, U-Boot will not boot. Once the VC FW does provide the ARM stub, u-boot.bin built for rpi_3 can be used drectly as kernel7.img, in the same way as any other RPi port. The following config.txt is required: # Fix mini UART input frequency, and setup/enable up the UART. # Without this option, U-Boot will not boot, even if you don't care # about the serial console. This option will always be required for # all RPi3 use-cases, unless the PL011 UART is used, which is not # yet supported by rpi_3* builds of U-Boot. enable_uart=1 # Boot in AArch64 (64-bit) mode. # It is possible that a future VC FW will remove the need for this # option, instead auto-setting 32-/64-bit mode based on the "kernel" # filename present on the SD card. arm_control=0x200 Prior to the VC FW providing the ARM boot stub, you can use the following steps to build an equivalent stub into the U-Boot binary: git clone https://github.com/swarren/rpi-3-aarch64-demo.git \ ../rpi-3-aarch64-demo (cd ../rpi-3-aarch64-demo && ./build.sh) Build U-Boot for rpi_3 in the usual way cat ../rpi-3-aarch64-demo/armstub64.bin u-boot.bin > u-boot.bin.stubbed Use u-boot.bin.stubbed as kernel7.img on the Pi SD card. In this case, the following additional entries are required in config.txt: # Tell the FW to load the kernel image at address 0, the reset vector. kernel_old=1 Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-02rpi: BCM2837 and Raspberry Pi 3 32-bit supportStephen Warren1-0/+22
The Raspberry Pi 3 contains a BCM2837 SoC. The BCM2837 is a BCM2836 with the CPU complex swapped out for a quad-core ARMv8. This can operate in 32- or 64-bit mode. 32-bit mode is the current default selected by the VideoCore firmware on the Raspberry Pi 3. This patch adds a 32-bit port of U-Boot for the Raspberry Pi 3. >From U-Boot's perspective, the only delta between the RPi 2 and RPi 3 is a change in usage of the SoC UARTs. On all previous Pis, the PL011 was the only UART in use. The Raspberry Pi 3 adds a Bluetooth module which uses a UART to connect to the SoC. By default, the PL011 is used for this purpose since it has larger FIFOs than the other "mini" UART. However, this can be configured via the VideoCore firmware's config.txt file. This patch hard-codes use of the mini UART in the RPi 3 port. If your system uses the PL011 UART for the console even on the RPi 3, please use the RPi 2 U-Boot port instead. A future change might determine which UART to use at run-time, thus allowing the RPi 2 and RPi 3 (32-bit) ports to be squashed together. The mini UART has some limitations. One externally visible issue in the BCM2837 integration is that the UART divides the SoC's "core clock" to generate the baud rate. The core clock is typically variable, and under control of the VideoCore firmware for thermal management reasons. If the VC FW does modify the core clock rate, UART communication will be corrupted since the baud rate will vary from the expected value. This was not an issue for the PL011 UART, since it is fed by a fixed 3MHz clock. To work around this, the VideoCore firmware can be told not to modify the SoC core clock. However, the only way this can happen and be thermally safe is to limit the core clock to a low/minimum frequency. This leaves performance on the table for use-cases that don't care about a UART console. Consequently, use of the mini UART console must be explicitly requested by entering the following line into config.txt: enable_uart=1 A recent version of the VC firmware is required to ensure that the mini UART is fully and correctly initialized by the VC FW; at least firmware.git 046effa13ebc "firmware: arm_loader: emmc clock depends on core clock See: https://github.com/raspberrypi/firmware/issues/572". Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-02ARM: bcm2835: expand Kconfig target descriptionsStephen Warren1-1/+27
This adds an explanation of which Raspberry Pi models each target option supports. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-02ARM: bcm2835: move CONFIG_BCM283* to KconfigStephen Warren1-1/+11
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-27ARM: bcm2835: fix 64-bit build warning in mboxStephen Warren1-2/+4
Fixes: arch/arm/mach-bcm283x/mbox.c: In function ‘bcm2835_mbox_call_prop’: arch/arm/mach-bcm283x/mbox.c:118:48: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] arch/arm/mach-bcm283x/mbox.c:126:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Tom Rini <trini@konsulko.com>