Path: blob/main/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h
39566 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2012 Oleksandr Tymoshenko <[email protected]>4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*/2728/*29* Defines for converting physical address to VideoCore bus address and back30*/3132#ifndef _BCM2835_VCBUS_H_33#define _BCM2835_VCBUS_H_3435#define BCM2835_VCBUS_SDRAM_CACHED 0x4000000036#define BCM2835_VCBUS_SDRAM_UNCACHED 0xC00000003738#define BCM2835_ARM_IO_BASE 0x2000000039#define BCM2835_VCBUS_IO_BASE 0x7E00000040#define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_CACHED4142#define BCM2836_ARM_IO_BASE 0x3f00000043#define BCM2836_VCBUS_IO_BASE BCM2835_VCBUS_IO_BASE44#define BCM2836_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED4546#define BCM2837_ARM_IO_BASE BCM2836_ARM_IO_BASE47#define BCM2837_VCBUS_IO_BASE BCM2835_VCBUS_IO_BASE48#define BCM2837_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED4950#define BCM2838_ARM_IO_BASE 0xfe00000051#define BCM2838_VCBUS_IO_BASE BCM2835_VCBUS_IO_BASE52#define BCM2838_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED5354/*55* Max allowed SDRAM mapping for most peripherals. The Raspberry Pi 4 has more56* than 1 GB of SDRAM, but only the lowest 1 GB is mapped into the "Legacy57* Master view" of the address space accessible by the DMA engine. Technically,58* we can slide this window around to whatever similarly sized range is59* convenient, but this is the most useful window given how busdma(9) works and60* that the window must be reconfigured for all channels in a given DMA engine.61* The DMA lite engine's window can be configured separately from the 30-bit DMA62* engine.63*/64#define BCM2838_PERIPH_MAXADDR 0x3fffffff6566#define BCM28XX_ARM_IO_SIZE 0x010000006768vm_paddr_t bcm283x_armc_to_vcbus(vm_paddr_t pa);69vm_paddr_t bcm283x_vcbus_to_armc(vm_paddr_t vca);70bus_addr_t bcm283x_dmabus_peripheral_lowaddr(void);7172#define ARMC_TO_VCBUS(pa) bcm283x_armc_to_vcbus(pa)73#define VCBUS_TO_ARMC(vca) bcm283x_vcbus_to_armc(vca)7475/* Compatibility name for vchiq arm interface. */76#define PHYS_TO_VCBUS ARMC_TO_VCBUS7778#endif /* _BCM2835_VCBUS_H_ */798081