Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (C) 2016 - 2022, Xilinx, Inc. |
| 4 | * Copyright (C) 2022, Advanced Micro Devices, Inc. |
| 5 | */ |
| 6 | |
| 7 | #ifndef __ASSEMBLY__ |
| 8 | #include <linux/bitops.h> |
| 9 | #endif |
| 10 | |
Ashok Reddy Soma | 8162732 | 2023-01-10 08:44:07 +0100 | [diff] [blame] | 11 | struct crlapb_regs { |
| 12 | u32 reserved0[67]; |
| 13 | u32 cpu_r5_ctrl; |
| 14 | u32 reserved; |
| 15 | u32 iou_switch_ctrl; /* 0x114 */ |
| 16 | u32 reserved1[13]; |
| 17 | u32 timestamp_ref_ctrl; /* 0x14c */ |
| 18 | u32 reserved3[108]; |
| 19 | u32 rst_cpu_r5; |
| 20 | u32 reserved2[17]; |
| 21 | u32 rst_timestamp; /* 0x348 */ |
| 22 | }; |
| 23 | |
| 24 | struct iou_scntrs_regs { |
| 25 | u32 counter_control_register; /* 0x0 */ |
| 26 | u32 reserved0[7]; |
| 27 | u32 base_frequency_id_register; /* 0x20 */ |
| 28 | }; |
| 29 | |
| 30 | #define VERSAL_NET_CRL_APB_BASEADDR 0xEB5E0000 |
| 31 | #define VERSAL_NET_IOU_SCNTR_SECURE 0xEC920000 |
| 32 | |
| 33 | #define CRL_APB_TIMESTAMP_REF_CTRL_CLKACT_BIT BIT(25) |
| 34 | #define IOU_SWITCH_CTRL_CLKACT_BIT BIT(25) |
| 35 | #define IOU_SWITCH_CTRL_DIVISOR0_SHIFT 8 |
| 36 | #define IOU_SCNTRS_CONTROL_EN 1 |
| 37 | |
| 38 | #define crlapb_base ((struct crlapb_regs *)VERSAL_NET_CRL_APB_BASEADDR) |
| 39 | #define iou_scntr_secure ((struct iou_scntrs_regs *)VERSAL_NET_IOU_SCNTR_SECURE) |
| 40 | |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 41 | #define PMC_TAP 0xF11A0000 |
| 42 | |
| 43 | #define PMC_TAP_IDCODE (PMC_TAP + 0) |
| 44 | #define PMC_TAP_VERSION (PMC_TAP + 0x4) |
| 45 | # define PMC_VERSION_MASK GENMASK(7, 0) |
| 46 | # define PS_VERSION_MASK GENMASK(15, 8) |
| 47 | # define RTL_VERSION_MASK GENMASK(23, 16) |
| 48 | # define PLATFORM_MASK GENMASK(27, 24) |
| 49 | # define PLATFORM_VERSION_MASK GENMASK(31, 28) |
| 50 | #define PMC_TAP_USERCODE (PMC_TAP + 0x8) |
| 51 | |
| 52 | enum versal_net_platform { |
| 53 | VERSAL_NET_SILICON = 0, |
| 54 | VERSAL_NET_SPP = 1, |
| 55 | VERSAL_NET_EMU = 2, |
| 56 | VERSAL_NET_QEMU = 3, |
| 57 | }; |
Michal Simek | 2895a22 | 2022-09-19 14:21:03 +0200 | [diff] [blame] | 58 | |
| 59 | #define VERSAL_SLCR_BASEADDR 0xF1060000 |
| 60 | #define VERSAL_AXI_MUX_SEL (VERSAL_SLCR_BASEADDR + 0x504) |
| 61 | #define VERSAL_OSPI_LINEAR_MODE BIT(1) |