blob: ea78e15f49c9858af8c62696c45526be88efb8ae [file] [log] [blame]
Mingkai Hu9f3183d2015-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 Huaf523a02015-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 Hu9f3183d2015-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
Mingkai Hu8281c582015-10-26 19:47:51 +080044#define SVR_LS1043 0x879204
Mingkai Hu9f3183d2015-10-26 19:47:50 +080045#define SVR_LS2045 0x870120
46#define SVR_LS2080 0x870110
47#define SVR_LS2085 0x870100
Pratiyush Mohan Srivastavaaa4ba7f2015-12-22 16:48:43 +053048#define SVR_LS2040 0x870130
Mingkai Hu9f3183d2015-10-26 19:47:50 +080049
50#define SVR_MAJ(svr) (((svr) >> 4) & 0xf)
51#define SVR_MIN(svr) (((svr) >> 0) & 0xf)
52#define SVR_SOC_VER(svr) (((svr) >> 8) & SVR_WO_E)
53#define IS_E_PROCESSOR(svr) (!((svr >> 8) & 0x1))
54
Tang Yuantian989c5f02015-12-09 15:32:18 +080055/* ahci port register default value */
56#define AHCI_PORT_PHY_1_CFG 0xa003fffe
57#define AHCI_PORT_PHY_2_CFG 0x28184d1f
58#define AHCI_PORT_PHY_3_CFG 0x0e081509
59#define AHCI_PORT_TRANS_CFG 0x08000029
60
61/* AHCI (sata) register map */
62struct ccsr_ahci {
63 u32 res1[0xa4/4]; /* 0x0 - 0xa4 */
64 u32 pcfg; /* port config */
65 u32 ppcfg; /* port phy1 config */
66 u32 pp2c; /* port phy2 config */
67 u32 pp3c; /* port phy3 config */
68 u32 pp4c; /* port phy4 config */
69 u32 pp5c; /* port phy5 config */
70 u32 axicc; /* AXI cache control */
71 u32 paxic; /* port AXI config */
72 u32 axipc; /* AXI PROT control */
73 u32 ptc; /* port Trans Config */
74 u32 pts; /* port Trans Status */
75 u32 plc; /* port link config */
76 u32 plc1; /* port link config1 */
77 u32 plc2; /* port link config2 */
78 u32 pls; /* port link status */
79 u32 pls1; /* port link status1 */
80 u32 pcmdc; /* port CMD config */
81 u32 ppcs; /* port phy control status */
82 u32 pberr; /* port 0/1 BIST error */
83 u32 cmds; /* port 0/1 CMD status error */
84};
85
Mingkai Hu8281c582015-10-26 19:47:51 +080086#ifdef CONFIG_FSL_LSCH3
Mingkai Hu9f3183d2015-10-26 19:47:50 +080087void fsl_lsch3_early_init_f(void);
Mingkai Hu8281c582015-10-26 19:47:51 +080088#elif defined(CONFIG_FSL_LSCH2)
89void fsl_lsch2_early_init_f(void);
90#endif
91
Mingkai Hu9f3183d2015-10-26 19:47:50 +080092void cpu_name(char *name);
Prabhakar Kushwahab40173642015-11-05 12:00:14 +053093#ifdef CONFIG_SYS_FSL_ERRATUM_A009635
94void erratum_a009635(void);
95#endif
Mingkai Hu9f3183d2015-10-26 19:47:50 +080096#endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */