blob: dec59633328f3e9964f9ee195839f5b0b5debbe2 [file] [log] [blame]
Antonio Nino Diazae6779e2017-11-06 14:49:04 +00001/*
Mario Bălănicăcb759ff2023-12-06 21:36:25 +02002 * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
Antonio Nino Diazae6779e2017-11-06 14:49:04 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Andre Przywarabb6ef152019-07-09 11:44:14 +01007#ifndef RPI_HW_H
8#define RPI_HW_H
Antonio Nino Diazae6779e2017-11-06 14:49:04 +00009
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <lib/utils_def.h>
Antonio Nino Diazae6779e2017-11-06 14:49:04 +000011
12/*
13 * Peripherals
14 */
15
Andre Przywara4f4f7692019-07-09 15:59:26 +010016#define RPI_IO_BASE ULL(0x3F000000)
17#define RPI_IO_SIZE ULL(0x01000000)
Antonio Nino Diazae6779e2017-11-06 14:49:04 +000018
19/*
Antonio Nino Diazecf34712018-07-12 13:38:53 +010020 * ARM <-> VideoCore mailboxes
21 */
22#define RPI3_MBOX_OFFSET ULL(0x0000B880)
Andre Przywara4f4f7692019-07-09 15:59:26 +010023#define RPI3_MBOX_BASE (RPI_IO_BASE + RPI3_MBOX_OFFSET)
Antonio Nino Diazecf34712018-07-12 13:38:53 +010024
25/*
Antonio Nino Diazae6779e2017-11-06 14:49:04 +000026 * Power management, reset controller, watchdog.
27 */
28#define RPI3_IO_PM_OFFSET ULL(0x00100000)
Andre Przywara4f4f7692019-07-09 15:59:26 +010029#define RPI3_PM_BASE (RPI_IO_BASE + RPI3_IO_PM_OFFSET)
Antonio Nino Diaz6942f052018-07-14 02:15:51 +010030
31/*
Antonio Nino Diaz12f73ff2018-07-13 09:27:16 +010032 * Hardware random number generator.
33 */
34#define RPI3_IO_RNG_OFFSET ULL(0x00104000)
Andre Przywara4f4f7692019-07-09 15:59:26 +010035#define RPI3_RNG_BASE (RPI_IO_BASE + RPI3_IO_RNG_OFFSET)
Antonio Nino Diaz12f73ff2018-07-13 09:27:16 +010036
37/*
Andre Przywara9ba6bb02020-03-10 12:34:56 +000038 * Serial ports:
39 * 'Mini UART' in the BCM docucmentation is the 8250 compatible UART.
40 * There is also a PL011 UART, multiplexed to the same pins.
Antonio Nino Diaz6942f052018-07-14 02:15:51 +010041 */
42#define RPI3_IO_MINI_UART_OFFSET ULL(0x00215040)
Andre Przywara4f4f7692019-07-09 15:59:26 +010043#define RPI3_MINI_UART_BASE (RPI_IO_BASE + RPI3_IO_MINI_UART_OFFSET)
Andre Przywara9ba6bb02020-03-10 12:34:56 +000044#define RPI3_IO_PL011_UART_OFFSET ULL(0x00201000)
45#define RPI3_PL011_UART_BASE (RPI_IO_BASE + RPI3_IO_PL011_UART_OFFSET)
46#define RPI3_PL011_UART_CLOCK ULL(48000000)
Antonio Nino Diazae6779e2017-11-06 14:49:04 +000047
48/*
Ying-Chun Liu (PaulLiu)34527382019-01-22 03:27:55 +080049 * GPIO controller
50 */
51#define RPI3_IO_GPIO_OFFSET ULL(0x00200000)
Andre Przywara4f4f7692019-07-09 15:59:26 +010052#define RPI3_GPIO_BASE (RPI_IO_BASE + RPI3_IO_GPIO_OFFSET)
Ying-Chun Liu (PaulLiu)34527382019-01-22 03:27:55 +080053
54/*
Ying-Chun Liu (PaulLiu)de6f2f42019-01-30 04:20:38 +080055 * SDHost controller
56 */
57#define RPI3_IO_SDHOST_OFFSET ULL(0x00202000)
Andre Przywara4f4f7692019-07-09 15:59:26 +010058#define RPI3_SDHOST_BASE (RPI_IO_BASE + RPI3_IO_SDHOST_OFFSET)
Ying-Chun Liu (PaulLiu)de6f2f42019-01-30 04:20:38 +080059
60/*
Antonio Nino Diazae6779e2017-11-06 14:49:04 +000061 * Local interrupt controller
62 */
63#define RPI3_INTC_BASE_ADDRESS ULL(0x40000000)
64/* Registers on top of RPI3_INTC_BASE_ADDRESS */
65#define RPI3_INTC_CONTROL_OFFSET ULL(0x00000000)
66#define RPI3_INTC_PRESCALER_OFFSET ULL(0x00000008)
67#define RPI3_INTC_MBOX_CONTROL_OFFSET ULL(0x00000050)
68#define RPI3_INTC_MBOX_CONTROL_SLOT3_FIQ ULL(0x00000080)
69#define RPI3_INTC_PENDING_FIQ_OFFSET ULL(0x00000070)
70#define RPI3_INTC_PENDING_FIQ_MBOX3 ULL(0x00000080)
71
Andre Przywarabb6ef152019-07-09 11:44:14 +010072#endif /* RPI_HW_H */