18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * cbe_regs.h 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * This file is intended to hold the various register definitions for CBE 68c2ecf20Sopenharmony_ci * on-chip system devices (memory controller, IO controller, etc...) 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * (C) Copyright IBM Corporation 2001,2006 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * Authors: Maximino Aguilar (maguilar@us.ibm.com) 118c2ecf20Sopenharmony_ci * David J. Erb (djerb@us.ibm.com) 128c2ecf20Sopenharmony_ci * 138c2ecf20Sopenharmony_ci * (c) 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp. 148c2ecf20Sopenharmony_ci */ 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#ifndef CBE_REGS_H 178c2ecf20Sopenharmony_ci#define CBE_REGS_H 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci#include <asm/cell-pmu.h> 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci/* 228c2ecf20Sopenharmony_ci * 238c2ecf20Sopenharmony_ci * Some HID register definitions 248c2ecf20Sopenharmony_ci * 258c2ecf20Sopenharmony_ci */ 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci/* CBE specific HID0 bits */ 288c2ecf20Sopenharmony_ci#define HID0_CBE_THERM_WAKEUP 0x0000020000000000ul 298c2ecf20Sopenharmony_ci#define HID0_CBE_SYSERR_WAKEUP 0x0000008000000000ul 308c2ecf20Sopenharmony_ci#define HID0_CBE_THERM_INT_EN 0x0000000400000000ul 318c2ecf20Sopenharmony_ci#define HID0_CBE_SYSERR_INT_EN 0x0000000200000000ul 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define MAX_CBE 2 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci/* 368c2ecf20Sopenharmony_ci * 378c2ecf20Sopenharmony_ci * Pervasive unit register definitions 388c2ecf20Sopenharmony_ci * 398c2ecf20Sopenharmony_ci */ 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ciunion spe_reg { 428c2ecf20Sopenharmony_ci u64 val; 438c2ecf20Sopenharmony_ci u8 spe[8]; 448c2ecf20Sopenharmony_ci}; 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ciunion ppe_spe_reg { 478c2ecf20Sopenharmony_ci u64 val; 488c2ecf20Sopenharmony_ci struct { 498c2ecf20Sopenharmony_ci u32 ppe; 508c2ecf20Sopenharmony_ci u32 spe; 518c2ecf20Sopenharmony_ci }; 528c2ecf20Sopenharmony_ci}; 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_cistruct cbe_pmd_regs { 568c2ecf20Sopenharmony_ci /* Debug Bus Control */ 578c2ecf20Sopenharmony_ci u64 pad_0x0000; /* 0x0000 */ 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci u64 group_control; /* 0x0008 */ 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ci u8 pad_0x0010_0x00a8 [0x00a8 - 0x0010]; /* 0x0010 */ 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci u64 debug_bus_control; /* 0x00a8 */ 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci u8 pad_0x00b0_0x0100 [0x0100 - 0x00b0]; /* 0x00b0 */ 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci u64 trace_aux_data; /* 0x0100 */ 688c2ecf20Sopenharmony_ci u64 trace_buffer_0_63; /* 0x0108 */ 698c2ecf20Sopenharmony_ci u64 trace_buffer_64_127; /* 0x0110 */ 708c2ecf20Sopenharmony_ci u64 trace_address; /* 0x0118 */ 718c2ecf20Sopenharmony_ci u64 ext_tr_timer; /* 0x0120 */ 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci u8 pad_0x0128_0x0400 [0x0400 - 0x0128]; /* 0x0128 */ 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci /* Performance Monitor */ 768c2ecf20Sopenharmony_ci u64 pm_status; /* 0x0400 */ 778c2ecf20Sopenharmony_ci u64 pm_control; /* 0x0408 */ 788c2ecf20Sopenharmony_ci u64 pm_interval; /* 0x0410 */ 798c2ecf20Sopenharmony_ci u64 pm_ctr[4]; /* 0x0418 */ 808c2ecf20Sopenharmony_ci u64 pm_start_stop; /* 0x0438 */ 818c2ecf20Sopenharmony_ci u64 pm07_control[8]; /* 0x0440 */ 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci u8 pad_0x0480_0x0800 [0x0800 - 0x0480]; /* 0x0480 */ 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci /* Thermal Sensor Registers */ 868c2ecf20Sopenharmony_ci union spe_reg ts_ctsr1; /* 0x0800 */ 878c2ecf20Sopenharmony_ci u64 ts_ctsr2; /* 0x0808 */ 888c2ecf20Sopenharmony_ci union spe_reg ts_mtsr1; /* 0x0810 */ 898c2ecf20Sopenharmony_ci u64 ts_mtsr2; /* 0x0818 */ 908c2ecf20Sopenharmony_ci union spe_reg ts_itr1; /* 0x0820 */ 918c2ecf20Sopenharmony_ci u64 ts_itr2; /* 0x0828 */ 928c2ecf20Sopenharmony_ci u64 ts_gitr; /* 0x0830 */ 938c2ecf20Sopenharmony_ci u64 ts_isr; /* 0x0838 */ 948c2ecf20Sopenharmony_ci u64 ts_imr; /* 0x0840 */ 958c2ecf20Sopenharmony_ci union spe_reg tm_cr1; /* 0x0848 */ 968c2ecf20Sopenharmony_ci u64 tm_cr2; /* 0x0850 */ 978c2ecf20Sopenharmony_ci u64 tm_simr; /* 0x0858 */ 988c2ecf20Sopenharmony_ci union ppe_spe_reg tm_tpr; /* 0x0860 */ 998c2ecf20Sopenharmony_ci union spe_reg tm_str1; /* 0x0868 */ 1008c2ecf20Sopenharmony_ci u64 tm_str2; /* 0x0870 */ 1018c2ecf20Sopenharmony_ci union ppe_spe_reg tm_tsr; /* 0x0878 */ 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci /* Power Management */ 1048c2ecf20Sopenharmony_ci u64 pmcr; /* 0x0880 */ 1058c2ecf20Sopenharmony_ci#define CBE_PMD_PAUSE_ZERO_CONTROL 0x10000 1068c2ecf20Sopenharmony_ci u64 pmsr; /* 0x0888 */ 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ci /* Time Base Register */ 1098c2ecf20Sopenharmony_ci u64 tbr; /* 0x0890 */ 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci u8 pad_0x0898_0x0c00 [0x0c00 - 0x0898]; /* 0x0898 */ 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_ci /* Fault Isolation Registers */ 1148c2ecf20Sopenharmony_ci u64 checkstop_fir; /* 0x0c00 */ 1158c2ecf20Sopenharmony_ci u64 recoverable_fir; /* 0x0c08 */ 1168c2ecf20Sopenharmony_ci u64 spec_att_mchk_fir; /* 0x0c10 */ 1178c2ecf20Sopenharmony_ci u32 fir_mode_reg; /* 0x0c18 */ 1188c2ecf20Sopenharmony_ci u8 pad_0x0c1c_0x0c20 [4]; /* 0x0c1c */ 1198c2ecf20Sopenharmony_ci#define CBE_PMD_FIR_MODE_M8 0x00800 1208c2ecf20Sopenharmony_ci u64 fir_enable_mask; /* 0x0c20 */ 1218c2ecf20Sopenharmony_ci 1228c2ecf20Sopenharmony_ci u8 pad_0x0c28_0x0ca8 [0x0ca8 - 0x0c28]; /* 0x0c28 */ 1238c2ecf20Sopenharmony_ci u64 ras_esc_0; /* 0x0ca8 */ 1248c2ecf20Sopenharmony_ci u8 pad_0x0cb0_0x1000 [0x1000 - 0x0cb0]; /* 0x0cb0 */ 1258c2ecf20Sopenharmony_ci}; 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ciextern struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np); 1288c2ecf20Sopenharmony_ciextern struct cbe_pmd_regs __iomem *cbe_get_cpu_pmd_regs(int cpu); 1298c2ecf20Sopenharmony_ci 1308c2ecf20Sopenharmony_ci/* 1318c2ecf20Sopenharmony_ci * PMU shadow registers 1328c2ecf20Sopenharmony_ci * 1338c2ecf20Sopenharmony_ci * Many of the registers in the performance monitoring unit are write-only, 1348c2ecf20Sopenharmony_ci * so we need to save a copy of what we write to those registers. 1358c2ecf20Sopenharmony_ci * 1368c2ecf20Sopenharmony_ci * The actual data counters are read/write. However, writing to the counters 1378c2ecf20Sopenharmony_ci * only takes effect if the PMU is enabled. Otherwise the value is stored in 1388c2ecf20Sopenharmony_ci * a hardware latch until the next time the PMU is enabled. So we save a copy 1398c2ecf20Sopenharmony_ci * of the counter values if we need to read them back while the PMU is 1408c2ecf20Sopenharmony_ci * disabled. The counter_value_in_latch field is a bitmap indicating which 1418c2ecf20Sopenharmony_ci * counters currently have a value waiting to be written. 1428c2ecf20Sopenharmony_ci */ 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_cistruct cbe_pmd_shadow_regs { 1458c2ecf20Sopenharmony_ci u32 group_control; 1468c2ecf20Sopenharmony_ci u32 debug_bus_control; 1478c2ecf20Sopenharmony_ci u32 trace_address; 1488c2ecf20Sopenharmony_ci u32 ext_tr_timer; 1498c2ecf20Sopenharmony_ci u32 pm_status; 1508c2ecf20Sopenharmony_ci u32 pm_control; 1518c2ecf20Sopenharmony_ci u32 pm_interval; 1528c2ecf20Sopenharmony_ci u32 pm_start_stop; 1538c2ecf20Sopenharmony_ci u32 pm07_control[NR_CTRS]; 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ci u32 pm_ctr[NR_PHYS_CTRS]; 1568c2ecf20Sopenharmony_ci u32 counter_value_in_latch; 1578c2ecf20Sopenharmony_ci}; 1588c2ecf20Sopenharmony_ci 1598c2ecf20Sopenharmony_ciextern struct cbe_pmd_shadow_regs *cbe_get_pmd_shadow_regs(struct device_node *np); 1608c2ecf20Sopenharmony_ciextern struct cbe_pmd_shadow_regs *cbe_get_cpu_pmd_shadow_regs(int cpu); 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_ci/* 1638c2ecf20Sopenharmony_ci * 1648c2ecf20Sopenharmony_ci * IIC unit register definitions 1658c2ecf20Sopenharmony_ci * 1668c2ecf20Sopenharmony_ci */ 1678c2ecf20Sopenharmony_ci 1688c2ecf20Sopenharmony_cistruct cbe_iic_pending_bits { 1698c2ecf20Sopenharmony_ci u32 data; 1708c2ecf20Sopenharmony_ci u8 flags; 1718c2ecf20Sopenharmony_ci u8 class; 1728c2ecf20Sopenharmony_ci u8 source; 1738c2ecf20Sopenharmony_ci u8 prio; 1748c2ecf20Sopenharmony_ci}; 1758c2ecf20Sopenharmony_ci 1768c2ecf20Sopenharmony_ci#define CBE_IIC_IRQ_VALID 0x80 1778c2ecf20Sopenharmony_ci#define CBE_IIC_IRQ_IPI 0x40 1788c2ecf20Sopenharmony_ci 1798c2ecf20Sopenharmony_cistruct cbe_iic_thread_regs { 1808c2ecf20Sopenharmony_ci struct cbe_iic_pending_bits pending; 1818c2ecf20Sopenharmony_ci struct cbe_iic_pending_bits pending_destr; 1828c2ecf20Sopenharmony_ci u64 generate; 1838c2ecf20Sopenharmony_ci u64 prio; 1848c2ecf20Sopenharmony_ci}; 1858c2ecf20Sopenharmony_ci 1868c2ecf20Sopenharmony_cistruct cbe_iic_regs { 1878c2ecf20Sopenharmony_ci u8 pad_0x0000_0x0400[0x0400 - 0x0000]; /* 0x0000 */ 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_ci /* IIC interrupt registers */ 1908c2ecf20Sopenharmony_ci struct cbe_iic_thread_regs thread[2]; /* 0x0400 */ 1918c2ecf20Sopenharmony_ci 1928c2ecf20Sopenharmony_ci u64 iic_ir; /* 0x0440 */ 1938c2ecf20Sopenharmony_ci#define CBE_IIC_IR_PRIO(x) (((x) & 0xf) << 12) 1948c2ecf20Sopenharmony_ci#define CBE_IIC_IR_DEST_NODE(x) (((x) & 0xf) << 4) 1958c2ecf20Sopenharmony_ci#define CBE_IIC_IR_DEST_UNIT(x) ((x) & 0xf) 1968c2ecf20Sopenharmony_ci#define CBE_IIC_IR_IOC_0 0x0 1978c2ecf20Sopenharmony_ci#define CBE_IIC_IR_IOC_1S 0xb 1988c2ecf20Sopenharmony_ci#define CBE_IIC_IR_PT_0 0xe 1998c2ecf20Sopenharmony_ci#define CBE_IIC_IR_PT_1 0xf 2008c2ecf20Sopenharmony_ci 2018c2ecf20Sopenharmony_ci u64 iic_is; /* 0x0448 */ 2028c2ecf20Sopenharmony_ci#define CBE_IIC_IS_PMI 0x2 2038c2ecf20Sopenharmony_ci 2048c2ecf20Sopenharmony_ci u8 pad_0x0450_0x0500[0x0500 - 0x0450]; /* 0x0450 */ 2058c2ecf20Sopenharmony_ci 2068c2ecf20Sopenharmony_ci /* IOC FIR */ 2078c2ecf20Sopenharmony_ci u64 ioc_fir_reset; /* 0x0500 */ 2088c2ecf20Sopenharmony_ci u64 ioc_fir_set; /* 0x0508 */ 2098c2ecf20Sopenharmony_ci u64 ioc_checkstop_enable; /* 0x0510 */ 2108c2ecf20Sopenharmony_ci u64 ioc_fir_error_mask; /* 0x0518 */ 2118c2ecf20Sopenharmony_ci u64 ioc_syserr_enable; /* 0x0520 */ 2128c2ecf20Sopenharmony_ci u64 ioc_fir; /* 0x0528 */ 2138c2ecf20Sopenharmony_ci 2148c2ecf20Sopenharmony_ci u8 pad_0x0530_0x1000[0x1000 - 0x0530]; /* 0x0530 */ 2158c2ecf20Sopenharmony_ci}; 2168c2ecf20Sopenharmony_ci 2178c2ecf20Sopenharmony_ciextern struct cbe_iic_regs __iomem *cbe_get_iic_regs(struct device_node *np); 2188c2ecf20Sopenharmony_ciextern struct cbe_iic_regs __iomem *cbe_get_cpu_iic_regs(int cpu); 2198c2ecf20Sopenharmony_ci 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_cistruct cbe_mic_tm_regs { 2228c2ecf20Sopenharmony_ci u8 pad_0x0000_0x0040[0x0040 - 0x0000]; /* 0x0000 */ 2238c2ecf20Sopenharmony_ci 2248c2ecf20Sopenharmony_ci u64 mic_ctl_cnfg2; /* 0x0040 */ 2258c2ecf20Sopenharmony_ci#define CBE_MIC_ENABLE_AUX_TRC 0x8000000000000000LL 2268c2ecf20Sopenharmony_ci#define CBE_MIC_DISABLE_PWR_SAV_2 0x0200000000000000LL 2278c2ecf20Sopenharmony_ci#define CBE_MIC_DISABLE_AUX_TRC_WRAP 0x0100000000000000LL 2288c2ecf20Sopenharmony_ci#define CBE_MIC_ENABLE_AUX_TRC_INT 0x0080000000000000LL 2298c2ecf20Sopenharmony_ci 2308c2ecf20Sopenharmony_ci u64 pad_0x0048; /* 0x0048 */ 2318c2ecf20Sopenharmony_ci 2328c2ecf20Sopenharmony_ci u64 mic_aux_trc_base; /* 0x0050 */ 2338c2ecf20Sopenharmony_ci u64 mic_aux_trc_max_addr; /* 0x0058 */ 2348c2ecf20Sopenharmony_ci u64 mic_aux_trc_cur_addr; /* 0x0060 */ 2358c2ecf20Sopenharmony_ci u64 mic_aux_trc_grf_addr; /* 0x0068 */ 2368c2ecf20Sopenharmony_ci u64 mic_aux_trc_grf_data; /* 0x0070 */ 2378c2ecf20Sopenharmony_ci 2388c2ecf20Sopenharmony_ci u64 pad_0x0078; /* 0x0078 */ 2398c2ecf20Sopenharmony_ci 2408c2ecf20Sopenharmony_ci u64 mic_ctl_cnfg_0; /* 0x0080 */ 2418c2ecf20Sopenharmony_ci#define CBE_MIC_DISABLE_PWR_SAV_0 0x8000000000000000LL 2428c2ecf20Sopenharmony_ci 2438c2ecf20Sopenharmony_ci u64 pad_0x0088; /* 0x0088 */ 2448c2ecf20Sopenharmony_ci 2458c2ecf20Sopenharmony_ci u64 slow_fast_timer_0; /* 0x0090 */ 2468c2ecf20Sopenharmony_ci u64 slow_next_timer_0; /* 0x0098 */ 2478c2ecf20Sopenharmony_ci 2488c2ecf20Sopenharmony_ci u8 pad_0x00a0_0x00f8[0x00f8 - 0x00a0]; /* 0x00a0 */ 2498c2ecf20Sopenharmony_ci u64 mic_df_ecc_address_0; /* 0x00f8 */ 2508c2ecf20Sopenharmony_ci 2518c2ecf20Sopenharmony_ci u8 pad_0x0100_0x01b8[0x01b8 - 0x0100]; /* 0x0100 */ 2528c2ecf20Sopenharmony_ci u64 mic_df_ecc_address_1; /* 0x01b8 */ 2538c2ecf20Sopenharmony_ci 2548c2ecf20Sopenharmony_ci u64 mic_ctl_cnfg_1; /* 0x01c0 */ 2558c2ecf20Sopenharmony_ci#define CBE_MIC_DISABLE_PWR_SAV_1 0x8000000000000000LL 2568c2ecf20Sopenharmony_ci 2578c2ecf20Sopenharmony_ci u64 pad_0x01c8; /* 0x01c8 */ 2588c2ecf20Sopenharmony_ci 2598c2ecf20Sopenharmony_ci u64 slow_fast_timer_1; /* 0x01d0 */ 2608c2ecf20Sopenharmony_ci u64 slow_next_timer_1; /* 0x01d8 */ 2618c2ecf20Sopenharmony_ci 2628c2ecf20Sopenharmony_ci u8 pad_0x01e0_0x0208[0x0208 - 0x01e0]; /* 0x01e0 */ 2638c2ecf20Sopenharmony_ci u64 mic_exc; /* 0x0208 */ 2648c2ecf20Sopenharmony_ci#define CBE_MIC_EXC_BLOCK_SCRUB 0x0800000000000000ULL 2658c2ecf20Sopenharmony_ci#define CBE_MIC_EXC_FAST_SCRUB 0x0100000000000000ULL 2668c2ecf20Sopenharmony_ci 2678c2ecf20Sopenharmony_ci u64 mic_mnt_cfg; /* 0x0210 */ 2688c2ecf20Sopenharmony_ci#define CBE_MIC_MNT_CFG_CHAN_0_POP 0x0002000000000000ULL 2698c2ecf20Sopenharmony_ci#define CBE_MIC_MNT_CFG_CHAN_1_POP 0x0004000000000000ULL 2708c2ecf20Sopenharmony_ci 2718c2ecf20Sopenharmony_ci u64 mic_df_config; /* 0x0218 */ 2728c2ecf20Sopenharmony_ci#define CBE_MIC_ECC_DISABLE_0 0x4000000000000000ULL 2738c2ecf20Sopenharmony_ci#define CBE_MIC_ECC_REP_SINGLE_0 0x2000000000000000ULL 2748c2ecf20Sopenharmony_ci#define CBE_MIC_ECC_DISABLE_1 0x0080000000000000ULL 2758c2ecf20Sopenharmony_ci#define CBE_MIC_ECC_REP_SINGLE_1 0x0040000000000000ULL 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_ci u8 pad_0x0220_0x0230[0x0230 - 0x0220]; /* 0x0220 */ 2788c2ecf20Sopenharmony_ci u64 mic_fir; /* 0x0230 */ 2798c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_SINGLE_0_ERR 0x0200000000000000ULL 2808c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_MULTI_0_ERR 0x0100000000000000ULL 2818c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_SINGLE_1_ERR 0x0080000000000000ULL 2828c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_MULTI_1_ERR 0x0040000000000000ULL 2838c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_ERR_MASK 0xffff000000000000ULL 2848c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_SINGLE_0_CTE 0x0000020000000000ULL 2858c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_MULTI_0_CTE 0x0000010000000000ULL 2868c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_SINGLE_1_CTE 0x0000008000000000ULL 2878c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_MULTI_1_CTE 0x0000004000000000ULL 2888c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_CTE_MASK 0x0000ffff00000000ULL 2898c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_SINGLE_0_RESET 0x0000000002000000ULL 2908c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_MULTI_0_RESET 0x0000000001000000ULL 2918c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_SINGLE_1_RESET 0x0000000000800000ULL 2928c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_MULTI_1_RESET 0x0000000000400000ULL 2938c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_RESET_MASK 0x00000000ffff0000ULL 2948c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_SINGLE_0_SET 0x0000000000000200ULL 2958c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_MULTI_0_SET 0x0000000000000100ULL 2968c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_SINGLE_1_SET 0x0000000000000080ULL 2978c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_MULTI_1_SET 0x0000000000000040ULL 2988c2ecf20Sopenharmony_ci#define CBE_MIC_FIR_ECC_SET_MASK 0x000000000000ffffULL 2998c2ecf20Sopenharmony_ci u64 mic_fir_debug; /* 0x0238 */ 3008c2ecf20Sopenharmony_ci 3018c2ecf20Sopenharmony_ci u8 pad_0x0240_0x1000[0x1000 - 0x0240]; /* 0x0240 */ 3028c2ecf20Sopenharmony_ci}; 3038c2ecf20Sopenharmony_ci 3048c2ecf20Sopenharmony_ciextern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np); 3058c2ecf20Sopenharmony_ciextern struct cbe_mic_tm_regs __iomem *cbe_get_cpu_mic_tm_regs(int cpu); 3068c2ecf20Sopenharmony_ci 3078c2ecf20Sopenharmony_ci 3088c2ecf20Sopenharmony_ci/* Cell page table entries */ 3098c2ecf20Sopenharmony_ci#define CBE_IOPTE_PP_W 0x8000000000000000ul /* protection: write */ 3108c2ecf20Sopenharmony_ci#define CBE_IOPTE_PP_R 0x4000000000000000ul /* protection: read */ 3118c2ecf20Sopenharmony_ci#define CBE_IOPTE_M 0x2000000000000000ul /* coherency required */ 3128c2ecf20Sopenharmony_ci#define CBE_IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */ 3138c2ecf20Sopenharmony_ci#define CBE_IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */ 3148c2ecf20Sopenharmony_ci#define CBE_IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */ 3158c2ecf20Sopenharmony_ci#define CBE_IOPTE_H 0x0000000000000800ul /* cache hint */ 3168c2ecf20Sopenharmony_ci#define CBE_IOPTE_IOID_Mask 0x00000000000007fful /* ioid */ 3178c2ecf20Sopenharmony_ci 3188c2ecf20Sopenharmony_ci/* some utility functions to deal with SMT */ 3198c2ecf20Sopenharmony_ciextern u32 cbe_get_hw_thread_id(int cpu); 3208c2ecf20Sopenharmony_ciextern u32 cbe_cpu_to_node(int cpu); 3218c2ecf20Sopenharmony_ciextern u32 cbe_node_to_cpu(int node); 3228c2ecf20Sopenharmony_ci 3238c2ecf20Sopenharmony_ci/* Init this module early */ 3248c2ecf20Sopenharmony_ciextern void cbe_regs_init(void); 3258c2ecf20Sopenharmony_ci 3268c2ecf20Sopenharmony_ci 3278c2ecf20Sopenharmony_ci#endif /* CBE_REGS_H */ 328