blob: 8d4a7adb1d574aca4a9e3e13a8918dc0a9fc9c69 [file] [log] [blame]
Mingkai Hu0e58b512015-10-26 19:47:50 +08001/*
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 Hu19218992015-11-11 17:58:34 +080026#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
33
Mingkai Hu0e58b512015-10-26 19:47:50 +080034struct 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)}
42
43#define SVR_WO_E 0xFFFFFE
Prabhakar Kushwahaac7f2422016-06-24 13:48:13 +053044#define SVR_LS1012A 0x870400
45#define SVR_LS1043A 0x879200
46#define SVR_LS1023A 0x879208
Mingkai Hucd54c0f2016-07-05 16:01:55 +080047#define SVR_LS1046A 0x870700
48#define SVR_LS1026A 0x870708
Prabhakar Kushwahaac7f2422016-06-24 13:48:13 +053049#define SVR_LS2045A 0x870120
50#define SVR_LS2080A 0x870110
51#define SVR_LS2085A 0x870100
52#define SVR_LS2040A 0x870130
Mingkai Hu0e58b512015-10-26 19:47:50 +080053
54#define SVR_MAJ(svr) (((svr) >> 4) & 0xf)
55#define SVR_MIN(svr) (((svr) >> 0) & 0xf)
56#define SVR_SOC_VER(svr) (((svr) >> 8) & SVR_WO_E)
57#define IS_E_PROCESSOR(svr) (!((svr >> 8) & 0x1))
Sriram Dash9282d262016-06-13 09:58:32 +053058#define IS_SVR_REV(svr, maj, min) \
59 ((SVR_MAJ(svr) == (maj)) && (SVR_MIN(svr) == (min)))
Mingkai Hu0e58b512015-10-26 19:47:50 +080060
Tang Yuantian57894be2015-12-09 15:32:18 +080061/* ahci port register default value */
62#define AHCI_PORT_PHY_1_CFG 0xa003fffe
63#define AHCI_PORT_PHY_2_CFG 0x28184d1f
64#define AHCI_PORT_PHY_3_CFG 0x0e081509
65#define AHCI_PORT_TRANS_CFG 0x08000029
66
67/* AHCI (sata) register map */
68struct ccsr_ahci {
69 u32 res1[0xa4/4]; /* 0x0 - 0xa4 */
70 u32 pcfg; /* port config */
71 u32 ppcfg; /* port phy1 config */
72 u32 pp2c; /* port phy2 config */
73 u32 pp3c; /* port phy3 config */
74 u32 pp4c; /* port phy4 config */
75 u32 pp5c; /* port phy5 config */
76 u32 axicc; /* AXI cache control */
77 u32 paxic; /* port AXI config */
78 u32 axipc; /* AXI PROT control */
79 u32 ptc; /* port Trans Config */
80 u32 pts; /* port Trans Status */
81 u32 plc; /* port link config */
82 u32 plc1; /* port link config1 */
83 u32 plc2; /* port link config2 */
84 u32 pls; /* port link status */
85 u32 pls1; /* port link status1 */
86 u32 pcmdc; /* port CMD config */
87 u32 ppcs; /* port phy control status */
88 u32 pberr; /* port 0/1 BIST error */
89 u32 cmds; /* port 0/1 CMD status error */
90};
91
Mingkai Hue4e93ea2015-10-26 19:47:51 +080092#ifdef CONFIG_FSL_LSCH3
Mingkai Hu0e58b512015-10-26 19:47:50 +080093void fsl_lsch3_early_init_f(void);
Mingkai Hue4e93ea2015-10-26 19:47:51 +080094#elif defined(CONFIG_FSL_LSCH2)
95void fsl_lsch2_early_init_f(void);
96#endif
97
Mingkai Hu0e58b512015-10-26 19:47:50 +080098void cpu_name(char *name);
Prabhakar Kushwaha22cfe962015-11-05 12:00:14 +053099#ifdef CONFIG_SYS_FSL_ERRATUM_A009635
100void erratum_a009635(void);
101#endif
York Suncbe8e1c2016-04-04 11:41:26 -0700102
103bool soc_has_dp_ddr(void);
104bool soc_has_aiop(void);
Mingkai Hu0e58b512015-10-26 19:47:50 +0800105#endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */