xref: /openbmc/qemu/include/hw/arm/raspi_platform.h (revision 074259c0)
17c62aeb8SAndrew Baumann /*
27c62aeb8SAndrew Baumann  * bcm2708 aka bcm2835/2836 aka Raspberry Pi/Pi2 SoC platform defines
37c62aeb8SAndrew Baumann  *
47c62aeb8SAndrew Baumann  * These definitions are derived from those in Raspbian Linux at
57c62aeb8SAndrew Baumann  * arch/arm/mach-{bcm2708,bcm2709}/include/mach/platform.h
67c62aeb8SAndrew Baumann  * where they carry the following notice:
77c62aeb8SAndrew Baumann  *
87c62aeb8SAndrew Baumann  * Copyright (C) 2010 Broadcom
97c62aeb8SAndrew Baumann  *
107c62aeb8SAndrew Baumann  * This program is free software; you can redistribute it and/or modify
117c62aeb8SAndrew Baumann  * it under the terms of the GNU General Public License as published by
127c62aeb8SAndrew Baumann  * the Free Software Foundation; either version 2 of the License, or
137c62aeb8SAndrew Baumann  * (at your option) any later version.
147c62aeb8SAndrew Baumann  *
157c62aeb8SAndrew Baumann  * This program is distributed in the hope that it will be useful,
167c62aeb8SAndrew Baumann  * but WITHOUT ANY WARRANTY; without even the implied warranty of
177c62aeb8SAndrew Baumann  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
187c62aeb8SAndrew Baumann  * GNU General Public License for more details.
197c62aeb8SAndrew Baumann  *
207c62aeb8SAndrew Baumann  * You should have received a copy of the GNU General Public License
210c201cc1SKhadija Kamran  * along with this program. If not, see <https://www.gnu.org/licenses/>.
22d8e53d7bSPhilippe Mathieu-Daudé  *
23d8e53d7bSPhilippe Mathieu-Daudé  * Various undocumented addresses and names come from Herman Hermitage's VC4
24d8e53d7bSPhilippe Mathieu-Daudé  * documentation:
25d8e53d7bSPhilippe Mathieu-Daudé  * https://github.com/hermanhermitage/videocoreiv/wiki/MMIO-Register-map
267c62aeb8SAndrew Baumann  */
277c62aeb8SAndrew Baumann 
28f91005e1SMarkus Armbruster #ifndef HW_ARM_RASPI_PLATFORM_H
29f91005e1SMarkus Armbruster #define HW_ARM_RASPI_PLATFORM_H
30f91005e1SMarkus Armbruster 
315cd436f9SPhilippe Mathieu-Daudé #define MSYNC_OFFSET            0x0000   /* Multicore Sync Block */
32d8e53d7bSPhilippe Mathieu-Daudé #define CCPT_OFFSET             0x1000   /* Compact Camera Port 2 TX */
33d8e53d7bSPhilippe Mathieu-Daudé #define INTE_OFFSET             0x2000   /* VC Interrupt controller */
347c62aeb8SAndrew Baumann #define ST_OFFSET               0x3000   /* System Timer */
35d8e53d7bSPhilippe Mathieu-Daudé #define TXP_OFFSET              0x4000   /* Transposer */
36d8e53d7bSPhilippe Mathieu-Daudé #define JPEG_OFFSET             0x5000
377c62aeb8SAndrew Baumann #define MPHI_OFFSET             0x6000   /* Message-based Parallel Host Intf. */
387c62aeb8SAndrew Baumann #define DMA_OFFSET              0x7000   /* DMA controller, channels 0-14 */
39d8e53d7bSPhilippe Mathieu-Daudé #define ARBA_OFFSET             0x9000
40d8e53d7bSPhilippe Mathieu-Daudé #define BRDG_OFFSET             0xa000
41d8e53d7bSPhilippe Mathieu-Daudé #define ARM_OFFSET              0xB000   /* ARM control block */
427c62aeb8SAndrew Baumann #define ARMCTRL_OFFSET          (ARM_OFFSET + 0x000)
437c62aeb8SAndrew Baumann #define ARMCTRL_IC_OFFSET       (ARM_OFFSET + 0x200) /* Interrupt controller */
44d8e53d7bSPhilippe Mathieu-Daudé #define ARMCTRL_TIMER0_1_OFFSET (ARM_OFFSET + 0x400) /* Timer 0 and 1 (SP804) */
457c62aeb8SAndrew Baumann #define ARMCTRL_0_SBM_OFFSET    (ARM_OFFSET + 0x800) /* User 0 (ARM) Semaphores
467c62aeb8SAndrew Baumann                                                       * Doorbells & Mailboxes */
4774de7145SLuc Michel #define PM_OFFSET               0x100000 /* Power Management */
4874de7145SLuc Michel #define CPRMAN_OFFSET           0x101000 /* Clock Management */
4900cbd5bdSPhilippe Mathieu-Daudé #define AVS_OFFSET              0x103000 /* Audio Video Standard */
507c62aeb8SAndrew Baumann #define RNG_OFFSET              0x104000
517c62aeb8SAndrew Baumann #define GPIO_OFFSET             0x200000
52d8e53d7bSPhilippe Mathieu-Daudé #define UART0_OFFSET            0x201000 /* PL011 */
53d8e53d7bSPhilippe Mathieu-Daudé #define MMCI0_OFFSET            0x202000 /* Legacy MMC */
54d8e53d7bSPhilippe Mathieu-Daudé #define I2S_OFFSET              0x203000 /* PCM */
55d8e53d7bSPhilippe Mathieu-Daudé #define SPI0_OFFSET             0x204000 /* SPI master */
567c62aeb8SAndrew Baumann #define BSC0_OFFSET             0x205000 /* BSC0 I2C/TWI */
57d8e53d7bSPhilippe Mathieu-Daudé #define PIXV0_OFFSET            0x206000
58d8e53d7bSPhilippe Mathieu-Daudé #define PIXV1_OFFSET            0x207000
59d8e53d7bSPhilippe Mathieu-Daudé #define DPI_OFFSET              0x208000
60d8e53d7bSPhilippe Mathieu-Daudé #define DSI0_OFFSET             0x209000 /* Display Serial Interface */
61d8e53d7bSPhilippe Mathieu-Daudé #define PWM_OFFSET              0x20c000
62d8e53d7bSPhilippe Mathieu-Daudé #define PERM_OFFSET             0x20d000
63d8e53d7bSPhilippe Mathieu-Daudé #define TEC_OFFSET              0x20e000
6400cbd5bdSPhilippe Mathieu-Daudé #define OTP_OFFSET              0x20f000
65d8e53d7bSPhilippe Mathieu-Daudé #define SLIM_OFFSET             0x210000 /* SLIMbus */
66d8e53d7bSPhilippe Mathieu-Daudé #define CPG_OFFSET              0x211000
67d442d95fSPhilippe Mathieu-Daudé #define THERMAL_OFFSET          0x212000
68d8e53d7bSPhilippe Mathieu-Daudé #define AVSP_OFFSET             0x213000
69d8e53d7bSPhilippe Mathieu-Daudé #define BSC_SL_OFFSET           0x214000 /* SPI slave (bootrom) */
705cd436f9SPhilippe Mathieu-Daudé #define AUX_OFFSET              0x215000 /* AUX: UART1/SPI1/SPI2 */
715cd436f9SPhilippe Mathieu-Daudé #define EMMC1_OFFSET            0x300000
72d8e53d7bSPhilippe Mathieu-Daudé #define EMMC2_OFFSET            0x340000
73d8e53d7bSPhilippe Mathieu-Daudé #define HVS_OFFSET              0x400000
747c62aeb8SAndrew Baumann #define SMI_OFFSET              0x600000
75d8e53d7bSPhilippe Mathieu-Daudé #define DSI1_OFFSET             0x700000
76d8e53d7bSPhilippe Mathieu-Daudé #define UCAM_OFFSET             0x800000
77d8e53d7bSPhilippe Mathieu-Daudé #define CMI_OFFSET              0x802000
787c62aeb8SAndrew Baumann #define BSC1_OFFSET             0x804000 /* BSC1 I2C/TWI */
7900cbd5bdSPhilippe Mathieu-Daudé #define BSC2_OFFSET             0x805000 /* BSC2 I2C/TWI */
80d8e53d7bSPhilippe Mathieu-Daudé #define VECA_OFFSET             0x806000
81d8e53d7bSPhilippe Mathieu-Daudé #define PIXV2_OFFSET            0x807000
82d8e53d7bSPhilippe Mathieu-Daudé #define HDMI_OFFSET             0x808000
83d8e53d7bSPhilippe Mathieu-Daudé #define HDCP_OFFSET             0x809000
84d8e53d7bSPhilippe Mathieu-Daudé #define ARBR0_OFFSET            0x80a000
8500cbd5bdSPhilippe Mathieu-Daudé #define DBUS_OFFSET             0x900000
8600cbd5bdSPhilippe Mathieu-Daudé #define AVE0_OFFSET             0x910000
875cd436f9SPhilippe Mathieu-Daudé #define USB_OTG_OFFSET          0x980000 /* DTC_OTG USB controller */
88d8e53d7bSPhilippe Mathieu-Daudé #define V3D_OFFSET              0xc00000
8900cbd5bdSPhilippe Mathieu-Daudé #define SDRAMC_OFFSET           0xe00000
90d8e53d7bSPhilippe Mathieu-Daudé #define L2CC_OFFSET             0xe01000 /* Level 2 Cache controller */
91d8e53d7bSPhilippe Mathieu-Daudé #define L1CC_OFFSET             0xe02000 /* Level 1 Cache controller */
92d8e53d7bSPhilippe Mathieu-Daudé #define ARBR1_OFFSET            0xe04000
937c62aeb8SAndrew Baumann #define DMA15_OFFSET            0xE05000 /* DMA controller, channel 15 */
94d8e53d7bSPhilippe Mathieu-Daudé #define DCRC_OFFSET             0xe07000
95d8e53d7bSPhilippe Mathieu-Daudé #define AXIP_OFFSET             0xe08000
967c62aeb8SAndrew Baumann 
977c62aeb8SAndrew Baumann /* GPU interrupts */
987c62aeb8SAndrew Baumann #define INTERRUPT_TIMER0               0
997c62aeb8SAndrew Baumann #define INTERRUPT_TIMER1               1
1007c62aeb8SAndrew Baumann #define INTERRUPT_TIMER2               2
1017c62aeb8SAndrew Baumann #define INTERRUPT_TIMER3               3
1027c62aeb8SAndrew Baumann #define INTERRUPT_CODEC0               4
1037c62aeb8SAndrew Baumann #define INTERRUPT_CODEC1               5
1047c62aeb8SAndrew Baumann #define INTERRUPT_CODEC2               6
1057c62aeb8SAndrew Baumann #define INTERRUPT_JPEG                 7
1067c62aeb8SAndrew Baumann #define INTERRUPT_ISP                  8
1077c62aeb8SAndrew Baumann #define INTERRUPT_USB                  9
1087c62aeb8SAndrew Baumann #define INTERRUPT_3D                   10
1097c62aeb8SAndrew Baumann #define INTERRUPT_TRANSPOSER           11
1107c62aeb8SAndrew Baumann #define INTERRUPT_MULTICORESYNC0       12
1117c62aeb8SAndrew Baumann #define INTERRUPT_MULTICORESYNC1       13
1127c62aeb8SAndrew Baumann #define INTERRUPT_MULTICORESYNC2       14
1137c62aeb8SAndrew Baumann #define INTERRUPT_MULTICORESYNC3       15
1147c62aeb8SAndrew Baumann #define INTERRUPT_DMA0                 16
1157c62aeb8SAndrew Baumann #define INTERRUPT_DMA1                 17
1167c62aeb8SAndrew Baumann #define INTERRUPT_DMA2                 18
1177c62aeb8SAndrew Baumann #define INTERRUPT_DMA3                 19
1187c62aeb8SAndrew Baumann #define INTERRUPT_DMA4                 20
1197c62aeb8SAndrew Baumann #define INTERRUPT_DMA5                 21
1207c62aeb8SAndrew Baumann #define INTERRUPT_DMA6                 22
1217c62aeb8SAndrew Baumann #define INTERRUPT_DMA7                 23
1227c62aeb8SAndrew Baumann #define INTERRUPT_DMA8                 24
1237c62aeb8SAndrew Baumann #define INTERRUPT_DMA9                 25
1247c62aeb8SAndrew Baumann #define INTERRUPT_DMA10                26
1257c62aeb8SAndrew Baumann #define INTERRUPT_DMA11                27
1267c62aeb8SAndrew Baumann #define INTERRUPT_DMA12                28
1277c62aeb8SAndrew Baumann #define INTERRUPT_AUX                  29
1287c62aeb8SAndrew Baumann #define INTERRUPT_ARM                  30
1297c62aeb8SAndrew Baumann #define INTERRUPT_VPUDMA               31
1307c62aeb8SAndrew Baumann #define INTERRUPT_HOSTPORT             32
1317c62aeb8SAndrew Baumann #define INTERRUPT_VIDEOSCALER          33
1327c62aeb8SAndrew Baumann #define INTERRUPT_CCP2TX               34
1337c62aeb8SAndrew Baumann #define INTERRUPT_SDC                  35
1347c62aeb8SAndrew Baumann #define INTERRUPT_DSI0                 36
1357c62aeb8SAndrew Baumann #define INTERRUPT_AVE                  37
1367c62aeb8SAndrew Baumann #define INTERRUPT_CAM0                 38
1377c62aeb8SAndrew Baumann #define INTERRUPT_CAM1                 39
1387c62aeb8SAndrew Baumann #define INTERRUPT_HDMI0                40
1397c62aeb8SAndrew Baumann #define INTERRUPT_HDMI1                41
1407c62aeb8SAndrew Baumann #define INTERRUPT_PIXELVALVE1          42
1417c62aeb8SAndrew Baumann #define INTERRUPT_I2CSPISLV            43
1427c62aeb8SAndrew Baumann #define INTERRUPT_DSI1                 44
1437c62aeb8SAndrew Baumann #define INTERRUPT_PWA0                 45
1447c62aeb8SAndrew Baumann #define INTERRUPT_PWA1                 46
1457c62aeb8SAndrew Baumann #define INTERRUPT_CPR                  47
1467c62aeb8SAndrew Baumann #define INTERRUPT_SMI                  48
1477c62aeb8SAndrew Baumann #define INTERRUPT_GPIO0                49
1487c62aeb8SAndrew Baumann #define INTERRUPT_GPIO1                50
1497c62aeb8SAndrew Baumann #define INTERRUPT_GPIO2                51
1507c62aeb8SAndrew Baumann #define INTERRUPT_GPIO3                52
1517c62aeb8SAndrew Baumann #define INTERRUPT_I2C                  53
1527c62aeb8SAndrew Baumann #define INTERRUPT_SPI                  54
1537c62aeb8SAndrew Baumann #define INTERRUPT_I2SPCM               55
1547c62aeb8SAndrew Baumann #define INTERRUPT_SDIO                 56
1555cd436f9SPhilippe Mathieu-Daudé #define INTERRUPT_UART0                57
1567c62aeb8SAndrew Baumann #define INTERRUPT_SLIMBUS              58
1577c62aeb8SAndrew Baumann #define INTERRUPT_VEC                  59
1587c62aeb8SAndrew Baumann #define INTERRUPT_CPG                  60
1597c62aeb8SAndrew Baumann #define INTERRUPT_RNG                  61
1607c62aeb8SAndrew Baumann #define INTERRUPT_ARASANSDIO           62
1617c62aeb8SAndrew Baumann #define INTERRUPT_AVSPMON              63
1627c62aeb8SAndrew Baumann 
1637c62aeb8SAndrew Baumann /* ARM CPU IRQs use a private number space */
1647c62aeb8SAndrew Baumann #define INTERRUPT_ARM_TIMER            0
1657c62aeb8SAndrew Baumann #define INTERRUPT_ARM_MAILBOX          1
1667c62aeb8SAndrew Baumann #define INTERRUPT_ARM_DOORBELL_0       2
1677c62aeb8SAndrew Baumann #define INTERRUPT_ARM_DOORBELL_1       3
1687c62aeb8SAndrew Baumann #define INTERRUPT_VPU0_HALTED          4
1697c62aeb8SAndrew Baumann #define INTERRUPT_VPU1_HALTED          5
1707c62aeb8SAndrew Baumann #define INTERRUPT_ILLEGAL_TYPE0        6
1717c62aeb8SAndrew Baumann #define INTERRUPT_ILLEGAL_TYPE1        7
172f91005e1SMarkus Armbruster 
1735dc49636SSergey Kambalin /* Clock rates */
1745dc49636SSergey Kambalin #define RPI_FIRMWARE_EMMC_CLK_RATE    50000000
1755dc49636SSergey Kambalin #define RPI_FIRMWARE_UART_CLK_RATE    3000000
176*074259c0SSergey Kambalin /*
177*074259c0SSergey Kambalin  * TODO: this is really SoC-specific; we might want to
178*074259c0SSergey Kambalin  * set it per-SoC if it turns out any guests care.
179*074259c0SSergey Kambalin  */
180*074259c0SSergey Kambalin #define RPI_FIRMWARE_CORE_CLK_RATE    350000000
1815dc49636SSergey Kambalin #define RPI_FIRMWARE_DEFAULT_CLK_RATE 700000000
1825dc49636SSergey Kambalin 
183f91005e1SMarkus Armbruster #endif
184