1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * (C) Copyright 2018
4 * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
5 */
6
7 #ifndef _MPC83XX_SOC_H_
8 #define _MPC83XX_SOC_H_
9
10 enum soc_type {
11 SOC_MPC8308,
12 SOC_MPC8309,
13 SOC_MPC8313,
14 SOC_MPC8315,
15 SOC_MPC832X,
16 SOC_MPC8349,
17 SOC_MPC8360,
18 SOC_MPC8379,
19 };
20
mpc83xx_has_sdhc(int type)21 bool mpc83xx_has_sdhc(int type)
22 {
23 return (type == SOC_MPC8308) ||
24 (type == SOC_MPC8309) ||
25 (type == SOC_MPC8379);
26 }
27
mpc83xx_has_tsec(int type)28 bool mpc83xx_has_tsec(int type)
29 {
30 return (type == SOC_MPC8308) ||
31 (type == SOC_MPC8313) ||
32 (type == SOC_MPC8315) ||
33 (type == SOC_MPC8349) ||
34 (type == SOC_MPC8379);
35 }
36
mpc83xx_has_pcie1(int type)37 bool mpc83xx_has_pcie1(int type)
38 {
39 return (type == SOC_MPC8308) ||
40 (type == SOC_MPC8315) ||
41 (type == SOC_MPC8379);
42 }
43
mpc83xx_has_pcie2(int type)44 bool mpc83xx_has_pcie2(int type)
45 {
46 return (type == SOC_MPC8315) ||
47 (type == SOC_MPC8379);
48 }
49
mpc83xx_has_sata(int type)50 bool mpc83xx_has_sata(int type)
51 {
52 return (type == SOC_MPC8315) ||
53 (type == SOC_MPC8379);
54 }
55
mpc83xx_has_pci(int type)56 bool mpc83xx_has_pci(int type)
57 {
58 return type != SOC_MPC8308;
59 }
60
mpc83xx_has_second_i2c(int type)61 bool mpc83xx_has_second_i2c(int type)
62 {
63 return (type != SOC_MPC8315) &&
64 (type != SOC_MPC832X);
65 }
66
mpc83xx_has_quicc_engine(int type)67 bool mpc83xx_has_quicc_engine(int type)
68 {
69 return (type == SOC_MPC8309) ||
70 (type == SOC_MPC832X) ||
71 (type == SOC_MPC8360);
72 }
73
74 #endif /* _MPC83XX_SOC_H_ */
75