1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Atheros AR71XX/AR724X/AR913X common definitions
10 #ifndef __ASM_MACH_ATH79_H
11 #define __ASM_MACH_ATH79_H
13 #include <linux/types.h>
15 DECLARE_GLOBAL_DATA_PTR;
39 static inline int soc_is_ar71xx(void)
41 return gd->arch.soc == ATH79_SOC_AR7130 ||
42 gd->arch.soc == ATH79_SOC_AR7141 ||
43 gd->arch.soc == ATH79_SOC_AR7161;
46 static inline int soc_is_ar724x(void)
48 return gd->arch.soc == ATH79_SOC_AR7240 ||
49 gd->arch.soc == ATH79_SOC_AR7241 ||
50 gd->arch.soc == ATH79_SOC_AR7242;
53 static inline int soc_is_ar7240(void)
55 return gd->arch.soc == ATH79_SOC_AR7240;
58 static inline int soc_is_ar7241(void)
60 return gd->arch.soc == ATH79_SOC_AR7241;
63 static inline int soc_is_ar7242(void)
65 return gd->arch.soc == ATH79_SOC_AR7242;
68 static inline int soc_is_ar913x(void)
70 return gd->arch.soc == ATH79_SOC_AR9130 ||
71 gd->arch.soc == ATH79_SOC_AR9132;
74 static inline int soc_is_ar933x(void)
76 return gd->arch.soc == ATH79_SOC_AR9330 ||
77 gd->arch.soc == ATH79_SOC_AR9331;
80 static inline int soc_is_ar9341(void)
82 return gd->arch.soc == ATH79_SOC_AR9341;
85 static inline int soc_is_ar9342(void)
87 return gd->arch.soc == ATH79_SOC_AR9342;
90 static inline int soc_is_ar9344(void)
92 return gd->arch.soc == ATH79_SOC_AR9344;
95 static inline int soc_is_ar934x(void)
97 return soc_is_ar9341() ||
102 static inline int soc_is_qca9533(void)
104 return gd->arch.soc == ATH79_SOC_QCA9533;
107 static inline int soc_is_qca953x(void)
109 return soc_is_qca9533();
112 static inline int soc_is_qca9556(void)
114 return gd->arch.soc == ATH79_SOC_QCA9556;
117 static inline int soc_is_qca9558(void)
119 return gd->arch.soc == ATH79_SOC_QCA9558;
122 static inline int soc_is_qca955x(void)
124 return soc_is_qca9556() || soc_is_qca9558();
127 static inline int soc_is_tp9343(void)
129 return gd->arch.soc == ATH79_SOC_TP9343;
132 static inline int soc_is_qca9561(void)
134 return gd->arch.soc == ATH79_SOC_QCA9561;
137 static inline int soc_is_qca956x(void)
139 return soc_is_tp9343() || soc_is_qca9561();
142 u32 ath79_get_bootstrap(void);
143 int ath79_eth_reset(void);
144 int ath79_usb_reset(void);
146 void ar934x_pll_init(const u16 cpu_mhz, const u16 ddr_mhz, const u16 ahb_mhz);
147 void ar934x_ddr_init(const u16 cpu_mhz, const u16 ddr_mhz, const u16 ahb_mhz);
149 #endif /* __ASM_MACH_ATH79_H */