3 * Copyright 2015 Freescale Semiconductor
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_
9 #define _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_
12 #include <linux/types.h>
13 #ifdef CONFIG_FSL_LSCH2
14 #include <asm/arch/immap_lsch2.h>
16 #ifdef CONFIG_FSL_LSCH3
17 #include <asm/arch/immap_lsch3.h>
21 #ifdef CONFIG_SYS_FSL_CCSR_GUR_LE
22 #define gur_in32(a) in_le32(a)
23 #define gur_out32(a, v) out_le32(a, v)
24 #elif defined(CONFIG_SYS_FSL_CCSR_GUR_BE)
25 #define gur_in32(a) in_be32(a)
26 #define gur_out32(a, v) out_be32(a, v)
29 #ifdef CONFIG_SYS_FSL_CCSR_SCFG_LE
30 #define scfg_in32(a) in_le32(a)
31 #define scfg_out32(a, v) out_le32(a, v)
32 #elif defined(CONFIG_SYS_FSL_CCSR_SCFG_BE)
33 #define scfg_in32(a) in_be32(a)
34 #define scfg_out32(a, v) out_be32(a, v)
37 #ifdef CONFIG_SYS_FSL_PEX_LUT_LE
38 #define pex_lut_in32(a) in_le32(a)
39 #define pex_lut_out32(a, v) out_le32(a, v)
40 #elif defined(CONFIG_SYS_FSL_PEX_LUT_BE)
41 #define pex_lut_in32(a) in_be32(a)
42 #define pex_lut_out32(a, v) out_be32(a, v)
51 #define CPU_TYPE_ENTRY(n, v, nc) \
52 { .name = #n, .soc_ver = SVR_##v, .num_cores = (nc)}
54 #define SVR_WO_E 0xFFFFFE
55 #define SVR_LS1012A 0x870400
56 #define SVR_LS1043A 0x879200
57 #define SVR_LS1023A 0x879208
58 #define SVR_LS1046A 0x870700
59 #define SVR_LS1026A 0x870708
60 #define SVR_LS1048A 0x870320
61 #define SVR_LS1084A 0x870302
62 #define SVR_LS1088A 0x870300
63 #define SVR_LS1044A 0x870322
64 #define SVR_LS2045A 0x870120
65 #define SVR_LS2080A 0x870110
66 #define SVR_LS2085A 0x870100
67 #define SVR_LS2040A 0x870130
68 #define SVR_LS2088A 0x870900
69 #define SVR_LS2084A 0x870910
70 #define SVR_LS2048A 0x870920
71 #define SVR_LS2044A 0x870930
72 #define SVR_LS2081A 0x870918
73 #define SVR_LS2041A 0x870914
75 #define SVR_DEV_LS2080A 0x8701
77 #define SVR_MAJ(svr) (((svr) >> 4) & 0xf)
78 #define SVR_MIN(svr) (((svr) >> 0) & 0xf)
79 #define SVR_REV(svr) (((svr) >> 0) & 0xff)
80 #define SVR_SOC_VER(svr) (((svr) >> 8) & SVR_WO_E)
81 #define IS_E_PROCESSOR(svr) (!((svr >> 8) & 0x1))
82 #define IS_SVR_REV(svr, maj, min) \
83 ((SVR_MAJ(svr) == (maj)) && (SVR_MIN(svr) == (min)))
85 /* ahci port register default value */
86 #define AHCI_PORT_PHY_1_CFG 0xa003fffe
87 #define AHCI_PORT_TRANS_CFG 0x08000029
88 #define AHCI_PORT_AXICC_CFG 0x3fffffff
91 /* AHCI (sata) register map */
93 u32 res1[0xa4/4]; /* 0x0 - 0xa4 */
94 u32 pcfg; /* port config */
95 u32 ppcfg; /* port phy1 config */
96 u32 pp2c; /* port phy2 config */
97 u32 pp3c; /* port phy3 config */
98 u32 pp4c; /* port phy4 config */
99 u32 pp5c; /* port phy5 config */
100 u32 axicc; /* AXI cache control */
101 u32 paxic; /* port AXI config */
102 u32 axipc; /* AXI PROT control */
103 u32 ptc; /* port Trans Config */
104 u32 pts; /* port Trans Status */
105 u32 plc; /* port link config */
106 u32 plc1; /* port link config1 */
107 u32 plc2; /* port link config2 */
108 u32 pls; /* port link status */
109 u32 pls1; /* port link status1 */
110 u32 pcmdc; /* port CMD config */
111 u32 ppcs; /* port phy control status */
112 u32 pberr; /* port 0/1 BIST error */
113 u32 cmds; /* port 0/1 CMD status error */
116 #ifdef CONFIG_FSL_LSCH3
117 void fsl_lsch3_early_init_f(void);
118 #elif defined(CONFIG_FSL_LSCH2)
119 void fsl_lsch2_early_init_f(void);
120 int setup_chip_volt(void);
121 /* Setup core vdd in unit mV */
122 int board_setup_core_volt(u32 vdd);
125 void cpu_name(char *name);
126 #ifdef CONFIG_SYS_FSL_ERRATUM_A009635
127 void erratum_a009635(void);
130 #ifdef CONFIG_SYS_FSL_ERRATUM_A010315
131 void erratum_a010315(void);
134 bool soc_has_dp_ddr(void);
135 bool soc_has_aiop(void);
138 #endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */