summaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/arch-octeontx/board.h
blob: c9fc3993f87b7dd7cf0198b264ac9d5352a5a4b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* SPDX-License-Identifier:    GPL-2.0
 *
 * Copyright (C) 2018 Marvell International Ltd.
 *
 * https://spdx.org/licenses
 */

#ifndef __BOARD_H__
#define __BOARD_H__

#include <asm/arch/soc.h>

#define MAX_LMAC_PER_BGX 4
#define LMAC_CNT MAX_LMAC_PER_BGX

#if defined(CONFIG_TARGET_OCTEONTX_81XX)

/** Maximum number of BGX interfaces per CPU node */
#define MAX_BGX_PER_NODE	3
#define OCTEONTX_XCV	/* RGMII Interface */

#elif defined(CONFIG_TARGET_OCTEONTX_83XX)

/** Maximum number of BGX interfaces per CPU node */
#define MAX_BGX_PER_NODE	4

#endif

/** Reg offsets */
#define RST_BOOT	0x87E006001600ULL

/** Structure definitions */

/**
 * Register (RSL) rst_boot
 *
 * RST Boot Register This register is not accessible through ROM scripts;
 * see SCR_WRITE32_S[ADDR].
 */
union rst_boot {
	u64 u;
	struct rst_boot_s {
		u64 rboot_pin                        : 1;
		u64 rboot                            : 1;
		u64 reserved_2_32                    : 31;
		u64 pnr_mul                          : 6;
		u64 reserved_39                      : 1;
		u64 c_mul                            : 7;
		u64 reserved_47_52                   : 6;
		u64 gpio_ejtag                       : 1;
		u64 mcp_jtagdis                      : 1;
		u64 dis_scan                         : 1;
		u64 dis_huk                          : 1;
		u64 vrm_err                          : 1;
		u64 jt_tstmode                       : 1;
		u64 ckill_ppdis                      : 1;
		u64 trusted_mode                     : 1;
		u64 reserved_61_62                   : 2;
		u64 chipkill                         : 1;
	} s;
	struct rst_boot_cn81xx {
		u64 rboot_pin                        : 1;
		u64 rboot                            : 1;
		u64 lboot                            : 10;
		u64 lboot_ext23                      : 6;
		u64 lboot_ext45                      : 6;
		u64 lboot_jtg                        : 1;
		u64 lboot_ckill                      : 1;
		u64 reserved_26_29                   : 4;
		u64 lboot_oci                        : 3;
		u64 pnr_mul                          : 6;
		u64 reserved_39                      : 1;
		u64 c_mul                            : 7;
		u64 reserved_47_54                   : 8;
		u64 dis_scan                         : 1;
		u64 dis_huk                          : 1;
		u64 vrm_err                          : 1;
		u64 jt_tstmode                       : 1;
		u64 ckill_ppdis                      : 1;
		u64 trusted_mode                     : 1;
		u64 ejtagdis                         : 1;
		u64 jtcsrdis                         : 1;
		u64 chipkill                         : 1;
	} cn81xx;
	struct rst_boot_cn83xx {
		u64 rboot_pin                        : 1;
		u64 rboot                            : 1;
		u64 lboot                            : 10;
		u64 lboot_ext23                      : 6;
		u64 lboot_ext45                      : 6;
		u64 lboot_jtg                        : 1;
		u64 lboot_ckill                      : 1;
		u64 lboot_pf_flr                     : 4;
		u64 lboot_oci                        : 3;
		u64 pnr_mul                          : 6;
		u64 reserved_39                      : 1;
		u64 c_mul                            : 7;
		u64 reserved_47_54                   : 8;
		u64 dis_scan                         : 1;
		u64 dis_huk                          : 1;
		u64 vrm_err                          : 1;
		u64 jt_tstmode                       : 1;
		u64 ckill_ppdis                      : 1;
		u64 trusted_mode                     : 1;
		u64 ejtagdis                         : 1;
		u64 jtcsrdis                         : 1;
		u64 chipkill                         : 1;
	} cn83xx;
};

extern unsigned long fdt_base_addr;

/** Function definitions */
void mem_map_fill(void);
int octeontx_board_has_pmp(void);
const char *fdt_get_board_model(void);
const char *fdt_get_board_serial(void);
const char *fdt_get_board_revision(void);
void fdt_parse_phy_info(void);
void fdt_board_get_ethaddr(int bgx, int lmac, unsigned char *eth);
void bgx_set_board_info(int bgx_id, int *mdio_bus, int *phy_addr,
			bool *autoneg_dis, bool *lmac_reg, bool *lmac_enable);
#endif /* __BOARD_H__ */