Mingkai Hu | 9f3183d | 2015-10-26 19:47:50 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Freescale Semiconductor |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #ifndef _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ |
| 8 | #define _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ |
| 9 | |
| 10 | #ifdef CONFIG_SYS_FSL_CCSR_GUR_LE |
| 11 | #define gur_in32(a) in_le32(a) |
| 12 | #define gur_out32(a, v) out_le32(a, v) |
| 13 | #elif defined(CONFIG_SYS_FSL_CCSR_GUR_BE) |
| 14 | #define gur_in32(a) in_be32(a) |
| 15 | #define gur_out32(a, v) out_be32(a, v) |
| 16 | #endif |
| 17 | |
| 18 | #ifdef CONFIG_SYS_FSL_CCSR_SCFG_LE |
| 19 | #define scfg_in32(a) in_le32(a) |
| 20 | #define scfg_out32(a, v) out_le32(a, v) |
| 21 | #elif defined(CONFIG_SYS_FSL_CCSR_SCFG_BE) |
| 22 | #define scfg_in32(a) in_be32(a) |
| 23 | #define scfg_out32(a, v) out_be32(a, v) |
| 24 | #endif |
| 25 | |
Mingkai Hu | af523a0 | 2015-11-11 17:58:34 +0800 | [diff] [blame] | 26 | #ifdef CONFIG_SYS_FSL_PEX_LUT_LE |
| 27 | #define pex_lut_in32(a) in_le32(a) |
| 28 | #define pex_lut_out32(a, v) out_le32(a, v) |
| 29 | #elif defined(CONFIG_SYS_FSL_PEX_LUT_BE) |
| 30 | #define pex_lut_in32(a) in_be32(a) |
| 31 | #define pex_lut_out32(a, v) out_be32(a, v) |
| 32 | #endif |
Priyanka Jain | f6b96ff | 2016-11-17 12:29:52 +0530 | [diff] [blame] | 33 | #ifndef __ASSEMBLY__ |
Mingkai Hu | 9f3183d | 2015-10-26 19:47:50 +0800 | [diff] [blame] | 34 | struct cpu_type { |
| 35 | char name[15]; |
| 36 | u32 soc_ver; |
| 37 | u32 num_cores; |
| 38 | }; |
| 39 | |
| 40 | #define CPU_TYPE_ENTRY(n, v, nc) \ |
| 41 | { .name = #n, .soc_ver = SVR_##v, .num_cores = (nc)} |
Priyanka Jain | f6b96ff | 2016-11-17 12:29:52 +0530 | [diff] [blame] | 42 | #endif |
Mingkai Hu | 9f3183d | 2015-10-26 19:47:50 +0800 | [diff] [blame] | 43 | #define SVR_WO_E 0xFFFFFE |
Prabhakar Kushwaha | 49cdce1 | 2016-06-24 13:48:13 +0530 | [diff] [blame] | 44 | #define SVR_LS1012A 0x870400 |
| 45 | #define SVR_LS1043A 0x879200 |
| 46 | #define SVR_LS1023A 0x879208 |
Mingkai Hu | b528b93 | 2016-07-05 16:01:55 +0800 | [diff] [blame] | 47 | #define SVR_LS1046A 0x870700 |
| 48 | #define SVR_LS1026A 0x870708 |
Prabhakar Kushwaha | 49cdce1 | 2016-06-24 13:48:13 +0530 | [diff] [blame] | 49 | #define SVR_LS2045A 0x870120 |
| 50 | #define SVR_LS2080A 0x870110 |
| 51 | #define SVR_LS2085A 0x870100 |
| 52 | #define SVR_LS2040A 0x870130 |
Priyanka Jain | 9ae836c | 2016-11-17 12:29:55 +0530 | [diff] [blame^] | 53 | #define SVR_LS2088A 0x870900 |
| 54 | #define SVR_LS2084A 0x870910 |
| 55 | #define SVR_LS2048A 0x870920 |
| 56 | #define SVR_LS2044A 0x870930 |
Mingkai Hu | 9f3183d | 2015-10-26 19:47:50 +0800 | [diff] [blame] | 57 | |
Priyanka Jain | f6b96ff | 2016-11-17 12:29:52 +0530 | [diff] [blame] | 58 | #define SVR_DEV_LS2080A 0x8701 |
| 59 | |
Mingkai Hu | 9f3183d | 2015-10-26 19:47:50 +0800 | [diff] [blame] | 60 | #define SVR_MAJ(svr) (((svr) >> 4) & 0xf) |
| 61 | #define SVR_MIN(svr) (((svr) >> 0) & 0xf) |
| 62 | #define SVR_SOC_VER(svr) (((svr) >> 8) & SVR_WO_E) |
| 63 | #define IS_E_PROCESSOR(svr) (!((svr >> 8) & 0x1)) |
Sriram Dash | 6fb522d | 2016-06-13 09:58:32 +0530 | [diff] [blame] | 64 | #define IS_SVR_REV(svr, maj, min) \ |
| 65 | ((SVR_MAJ(svr) == (maj)) && (SVR_MIN(svr) == (min))) |
Mingkai Hu | 9f3183d | 2015-10-26 19:47:50 +0800 | [diff] [blame] | 66 | |
Tang Yuantian | 989c5f0 | 2015-12-09 15:32:18 +0800 | [diff] [blame] | 67 | /* ahci port register default value */ |
| 68 | #define AHCI_PORT_PHY_1_CFG 0xa003fffe |
Tang Yuantian | 989c5f0 | 2015-12-09 15:32:18 +0800 | [diff] [blame] | 69 | #define AHCI_PORT_TRANS_CFG 0x08000029 |
Tang Yuantian | 4de6ce1 | 2016-08-08 15:07:20 +0800 | [diff] [blame] | 70 | #define AHCI_PORT_AXICC_CFG 0x3fffffff |
Tang Yuantian | 989c5f0 | 2015-12-09 15:32:18 +0800 | [diff] [blame] | 71 | |
Priyanka Jain | f6b96ff | 2016-11-17 12:29:52 +0530 | [diff] [blame] | 72 | #ifndef __ASSEMBLY__ |
Tang Yuantian | 989c5f0 | 2015-12-09 15:32:18 +0800 | [diff] [blame] | 73 | /* AHCI (sata) register map */ |
| 74 | struct ccsr_ahci { |
| 75 | u32 res1[0xa4/4]; /* 0x0 - 0xa4 */ |
| 76 | u32 pcfg; /* port config */ |
| 77 | u32 ppcfg; /* port phy1 config */ |
| 78 | u32 pp2c; /* port phy2 config */ |
| 79 | u32 pp3c; /* port phy3 config */ |
| 80 | u32 pp4c; /* port phy4 config */ |
| 81 | u32 pp5c; /* port phy5 config */ |
| 82 | u32 axicc; /* AXI cache control */ |
| 83 | u32 paxic; /* port AXI config */ |
| 84 | u32 axipc; /* AXI PROT control */ |
| 85 | u32 ptc; /* port Trans Config */ |
| 86 | u32 pts; /* port Trans Status */ |
| 87 | u32 plc; /* port link config */ |
| 88 | u32 plc1; /* port link config1 */ |
| 89 | u32 plc2; /* port link config2 */ |
| 90 | u32 pls; /* port link status */ |
| 91 | u32 pls1; /* port link status1 */ |
| 92 | u32 pcmdc; /* port CMD config */ |
| 93 | u32 ppcs; /* port phy control status */ |
| 94 | u32 pberr; /* port 0/1 BIST error */ |
| 95 | u32 cmds; /* port 0/1 CMD status error */ |
| 96 | }; |
| 97 | |
Mingkai Hu | 8281c58 | 2015-10-26 19:47:51 +0800 | [diff] [blame] | 98 | #ifdef CONFIG_FSL_LSCH3 |
Mingkai Hu | 9f3183d | 2015-10-26 19:47:50 +0800 | [diff] [blame] | 99 | void fsl_lsch3_early_init_f(void); |
Mingkai Hu | 8281c58 | 2015-10-26 19:47:51 +0800 | [diff] [blame] | 100 | #elif defined(CONFIG_FSL_LSCH2) |
| 101 | void fsl_lsch2_early_init_f(void); |
| 102 | #endif |
| 103 | |
Mingkai Hu | 9f3183d | 2015-10-26 19:47:50 +0800 | [diff] [blame] | 104 | void cpu_name(char *name); |
Prabhakar Kushwaha | b4017364 | 2015-11-05 12:00:14 +0530 | [diff] [blame] | 105 | #ifdef CONFIG_SYS_FSL_ERRATUM_A009635 |
| 106 | void erratum_a009635(void); |
| 107 | #endif |
York Sun | 3c1d218 | 2016-04-04 11:41:26 -0700 | [diff] [blame] | 108 | |
Hou Zhiqiang | b392a6d | 2016-08-02 19:03:27 +0800 | [diff] [blame] | 109 | #ifdef CONFIG_SYS_FSL_ERRATUM_A010315 |
| 110 | void erratum_a010315(void); |
| 111 | #endif |
| 112 | |
York Sun | 3c1d218 | 2016-04-04 11:41:26 -0700 | [diff] [blame] | 113 | bool soc_has_dp_ddr(void); |
| 114 | bool soc_has_aiop(void); |
Priyanka Jain | f6b96ff | 2016-11-17 12:29:52 +0530 | [diff] [blame] | 115 | #endif |
Mingkai Hu | 9f3183d | 2015-10-26 19:47:50 +0800 | [diff] [blame] | 116 | #endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */ |