|
| 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 Zynq-7000 (Cortex-A9, ARMv7-A 32-bit) PS register base |
| 22 | + * addresses and GIC interrupt IDs. Derived from the Zynq-7000 TRM |
| 23 | + * (UG585). No Xilinx Standalone BSP header is required. |
| 24 | + * |
| 25 | + * UNTESTED ON HARDWARE -- code-only scaffold while the lab board is |
| 26 | + * unavailable. Mirrors src/port/zcu102/ structurally. Key differences: |
| 27 | + * - Cortex-A9 (not A53), ARMv7-A 32-bit (not AArch64) |
| 28 | + * - SLCR replaces ZynqMP's CRL_APB |
| 29 | + * - GIC-390 (GICv2) inside the SCU at different base addresses |
| 30 | + * - Cadence UART (same IP as ZynqMP; different base address) |
| 31 | + * - Cadence GEM (older revision; 32-bit BD format default) |
| 32 | + * - 2 GEMs (GEM0 / GEM1); on-board RJ45 is typically GEM0 |
| 33 | + */ |
| 34 | +#ifndef ZYNQ7000_BOARD_H |
| 35 | +#define ZYNQ7000_BOARD_H |
| 36 | + |
| 37 | +#include <stdint.h> |
| 38 | + |
| 39 | +/* --------------------------------------------------------------------- |
| 40 | + * Memory map (Zynq-7000 PS) |
| 41 | + * ------------------------------------------------------------------- */ |
| 42 | +#define DDR_BASE 0x00000000UL |
| 43 | +#define DDR_SIZE 0x40000000UL /* 1 GB typical, e.g. ZC702 */ |
| 44 | + |
| 45 | +/* OCM is mappable to 0x00000000 (low) or 0xFFFC0000 (high). Most |
| 46 | + * bare-metal apps use the high mapping; FSBL configures the OCM |
| 47 | + * address filter via SLCR.OCM_CFG. We assume the high mapping. */ |
| 48 | +#define OCM_BASE 0xFFFC0000UL |
| 49 | +#define OCM_SIZE 0x00040000UL /* 256 KB */ |
| 50 | + |
| 51 | +/* --------------------------------------------------------------------- |
| 52 | + * PS peripherals |
| 53 | + * ------------------------------------------------------------------- */ |
| 54 | +#define UART0_BASE 0xE0000000UL /* Cadence */ |
| 55 | +#define UART1_BASE 0xE0001000UL |
| 56 | + |
| 57 | +#define GEM0_BASE 0xE000B000UL /* on-board RJ45 typical */ |
| 58 | +#define GEM1_BASE 0xE000C000UL |
| 59 | + |
| 60 | +#define SLCR_BASE 0xF8000000UL /* clock + reset */ |
| 61 | + |
| 62 | +/* GIC-390 (ARMv7 GICv2 compatible). Distributor + CPU IF are in the |
| 63 | + * SCU (Snoop Control Unit) memory region on Zynq-7000. */ |
| 64 | +#define GICD_BASE 0xF8F01000UL |
| 65 | +#define GICC_BASE 0xF8F00100UL |
| 66 | + |
| 67 | +/* --------------------------------------------------------------------- |
| 68 | + * GIC interrupt IDs (raw GIC INTIDs, not GIC_SPI offsets). |
| 69 | + * Per Zynq-7000 TRM Table 7-3: |
| 70 | + * GEM0: INTID 54 |
| 71 | + * GEM1: INTID 77 |
| 72 | + * ------------------------------------------------------------------- */ |
| 73 | +#define IRQ_GEM0 54 |
| 74 | +#define IRQ_GEM1 77 |
| 75 | + |
| 76 | +/* --------------------------------------------------------------------- |
| 77 | + * SLCR clock and reset registers |
| 78 | + * ------------------------------------------------------------------- */ |
| 79 | +#define SLCR_LOCK (SLCR_BASE + 0x004) |
| 80 | +#define SLCR_UNLOCK (SLCR_BASE + 0x008) |
| 81 | +#define SLCR_GEM0_CLK_CTRL (SLCR_BASE + 0x140) |
| 82 | +#define SLCR_GEM1_CLK_CTRL (SLCR_BASE + 0x144) |
| 83 | +#define SLCR_GEM_RST_CTRL (SLCR_BASE + 0x214) |
| 84 | + |
| 85 | +#define SLCR_UNLOCK_KEY 0xDF0D /* per TRM */ |
| 86 | + |
| 87 | +/* --------------------------------------------------------------------- |
| 88 | + * Cadence UART0 baud |
| 89 | + * ------------------------------------------------------------------- */ |
| 90 | +#define UART_BAUD 115200 |
| 91 | + |
| 92 | +/* MAC address for eth0. Locally-administered, even first octet. */ |
| 93 | +#ifndef WOLFIP_MAC_0 |
| 94 | +#define WOLFIP_MAC_0 0x02 |
| 95 | +#endif |
| 96 | +#ifndef WOLFIP_MAC_1 |
| 97 | +#define WOLFIP_MAC_1 0x00 |
| 98 | +#endif |
| 99 | +#ifndef WOLFIP_MAC_2 |
| 100 | +#define WOLFIP_MAC_2 0x5A |
| 101 | +#endif |
| 102 | +#ifndef WOLFIP_MAC_3 |
| 103 | +#define WOLFIP_MAC_3 0x11 |
| 104 | +#endif |
| 105 | +#ifndef WOLFIP_MAC_4 |
| 106 | +#define WOLFIP_MAC_4 0x22 |
| 107 | +#endif |
| 108 | +#ifndef WOLFIP_MAC_5 |
| 109 | +#define WOLFIP_MAC_5 0x33 |
| 110 | +#endif |
| 111 | + |
| 112 | +#endif /* ZYNQ7000_BOARD_H */ |
0 commit comments