|
| 1 | +/* board.h |
| 2 | + * |
| 3 | + * Copyright (C) 2026 wolfSSL Inc. |
| 4 | + * |
| 5 | + * This file is part of wolfIP TCP/IP stack. |
| 6 | + * |
| 7 | + * wolfIP is free software; you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU General Public License as published by |
| 9 | + * the Free Software Foundation; either version 3 of the License, or |
| 10 | + * (at your option) any later version. |
| 11 | + * |
| 12 | + * wolfIP is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU General Public License |
| 18 | + * along with this program; if not, write to the Free Software |
| 19 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA |
| 20 | + * |
| 21 | + * Xilinx Versal Gen 1 (VCxxxx / VMK180 board) PS register base |
| 22 | + * addresses and GIC SPI IDs. Values are derived from the Versal ACAP |
| 23 | + * Technical Reference Manual (AM011), the VMK180 board user guide, |
| 24 | + * and the published `versal.dtsi` device tree. No Xilinx BSP header |
| 25 | + * (xparameters.h) or xilstandalone code is referenced. |
| 26 | + * |
| 27 | + * UNTESTED ON HARDWARE -- code-only scaffold while the lab board is |
| 28 | + * unavailable. The structure mirrors src/port/zcu102/. Key |
| 29 | + * differences from ZynqMP are: |
| 30 | + * - Cortex-A72 (not A53), with PLM handoff at EL2 |
| 31 | + * - GICv3 distributor + redistributor (no GICv2 legacy GICC) |
| 32 | + * - ARM PL011 UART (not Cadence) |
| 33 | + * - 2 GEMs (GEM0/GEM1) instead of 4; on-board RJ45 is GEM0 on VMK180 |
| 34 | + */ |
| 35 | +#ifndef VERSAL_BOARD_H |
| 36 | +#define VERSAL_BOARD_H |
| 37 | + |
| 38 | +#include <stdint.h> |
| 39 | + |
| 40 | +/* --------------------------------------------------------------------- |
| 41 | + * Memory map (Versal PS) |
| 42 | + * ------------------------------------------------------------------- */ |
| 43 | +#define DDR_BASE 0x00000000UL |
| 44 | +#define DDR_SIZE 0x80000000UL /* 2 GB lower bank */ |
| 45 | + |
| 46 | +/* OCM on Versal lives at 0xFFFC0000 (256 KB). Same as ZynqMP. */ |
| 47 | +#define OCM_BASE 0xFFFC0000UL |
| 48 | +#define OCM_SIZE 0x00040000UL |
| 49 | + |
| 50 | +/* --------------------------------------------------------------------- |
| 51 | + * PS peripherals |
| 52 | + * ------------------------------------------------------------------- */ |
| 53 | +#define UART0_BASE 0xFF000000UL /* PL011 */ |
| 54 | +#define UART1_BASE 0xFF010000UL /* PL011 */ |
| 55 | + |
| 56 | +#define GEM0_BASE 0xFF0C0000UL /* on-board GEM (VMK180) */ |
| 57 | +#define GEM1_BASE 0xFF0D0000UL |
| 58 | + |
| 59 | +#define CRL_APB_BASE 0xFF5E0000UL /* LPD clock & reset */ |
| 60 | +#define IOU_SLCR_BASE 0xFF180000UL |
| 61 | + |
| 62 | +/* GICv3: distributor + redistributor */ |
| 63 | +#define GICD_BASE 0xF9000000UL |
| 64 | +#define GICR_BASE 0xF9080000UL /* per-CPU redistributors */ |
| 65 | + |
| 66 | +/* --------------------------------------------------------------------- |
| 67 | + * GIC SPI numbers as GIC INTIDs (ARM GIC numbering: SPI N -> INTID 32+N). |
| 68 | + * Versal versal.dtsi: |
| 69 | + * GEM0: GIC_SPI 56 -> INTID 88 |
| 70 | + * GEM1: GIC_SPI 58 -> INTID 90 |
| 71 | + * ------------------------------------------------------------------- */ |
| 72 | +#define IRQ_GEM0 (32 + 56) /* GIC_SPI 56 -> INTID 88, |
| 73 | + * on-board VMK180 RJ45 */ |
| 74 | +#define IRQ_GEM1 (32 + 58) /* GIC_SPI 58 -> INTID 90 */ |
| 75 | + |
| 76 | +/* --------------------------------------------------------------------- |
| 77 | + * CRL clock and reset registers (LPD). Versal's CRL register map is NOT |
| 78 | + * the same as ZynqMP: the GEM clock/reset offsets differ. Verified |
| 79 | + * against the Versal PSM firmware crl.h (Vitis embeddedsw): |
| 80 | + * CRL.GEM0_REF_CTRL = CRL + 0x118 (CLKACT bit 25, DIVISOR0 [13:8], |
| 81 | + * SRCSEL [2:0]) |
| 82 | + * CRL.RST_GEM0 = CRL + 0x308 (RESET bit 0) |
| 83 | + * ------------------------------------------------------------------- */ |
| 84 | +#define CRL_APB_GEM0_REF_CTRL (CRL_APB_BASE + 0x118) /* Versal CRL.GEM0_REF_CTRL */ |
| 85 | +#define CRL_GEM0_RST (CRL_APB_BASE + 0x308) /* Versal CRL.RST_GEM0 */ |
| 86 | +#define CRL_GEM0_REF_CTRL_CLKACT (1u << 25) |
| 87 | +#define CRL_RST_GEM0_RESET (1u << 0) |
| 88 | + |
| 89 | +/* --------------------------------------------------------------------- |
| 90 | + * PL011 UART0 - on-board USB-UART on VMK180 |
| 91 | + * ------------------------------------------------------------------- */ |
| 92 | +#define UART_BAUD 115200 |
| 93 | + |
| 94 | +/* MAC address for eth0. Locally-administered, even first octet. */ |
| 95 | +#ifndef WOLFIP_MAC_0 |
| 96 | +#define WOLFIP_MAC_0 0x02 |
| 97 | +#endif |
| 98 | +#ifndef WOLFIP_MAC_1 |
| 99 | +#define WOLFIP_MAC_1 0x00 |
| 100 | +#endif |
| 101 | +#ifndef WOLFIP_MAC_2 |
| 102 | +#define WOLFIP_MAC_2 0x5A |
| 103 | +#endif |
| 104 | +#ifndef WOLFIP_MAC_3 |
| 105 | +#define WOLFIP_MAC_3 0x11 |
| 106 | +#endif |
| 107 | +#ifndef WOLFIP_MAC_4 |
| 108 | +#define WOLFIP_MAC_4 0x22 |
| 109 | +#endif |
| 110 | +#ifndef WOLFIP_MAC_5 |
| 111 | +#define WOLFIP_MAC_5 0x33 |
| 112 | +#endif |
| 113 | + |
| 114 | +#endif /* VERSAL_BOARD_H */ |
0 commit comments