2 * Atheros AR71XX/AR724X/AR913X common definitions
4 * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
7 * Parts of this file are based on Atheros' 2.6.15 BSP
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
14 #ifndef __ASM_MACH_ATH79_H
15 #define __ASM_MACH_ATH79_H
17 #include <linux/types.h>
34 extern enum ath79_soc_type ath79_soc
;
35 extern unsigned int ath79_soc_rev
;
37 static inline int soc_is_ar71xx(void)
39 return (ath79_soc
== ATH79_SOC_AR7130
||
40 ath79_soc
== ATH79_SOC_AR7141
||
41 ath79_soc
== ATH79_SOC_AR7161
);
44 static inline int soc_is_ar724x(void)
46 return (ath79_soc
== ATH79_SOC_AR7240
||
47 ath79_soc
== ATH79_SOC_AR7241
||
48 ath79_soc
== ATH79_SOC_AR7242
);
51 static inline int soc_is_ar7240(void)
53 return (ath79_soc
== ATH79_SOC_AR7240
);
56 static inline int soc_is_ar7241(void)
58 return (ath79_soc
== ATH79_SOC_AR7241
);
61 static inline int soc_is_ar7242(void)
63 return (ath79_soc
== ATH79_SOC_AR7242
);
66 static inline int soc_is_ar913x(void)
68 return (ath79_soc
== ATH79_SOC_AR9130
||
69 ath79_soc
== ATH79_SOC_AR9132
);
72 static inline int soc_is_ar933x(void)
74 return (ath79_soc
== ATH79_SOC_AR9330
||
75 ath79_soc
== ATH79_SOC_AR9331
);
78 extern void __iomem
*ath79_ddr_base
;
79 extern void __iomem
*ath79_pll_base
;
80 extern void __iomem
*ath79_reset_base
;
82 static inline void ath79_pll_wr(unsigned reg
, u32 val
)
84 __raw_writel(val
, ath79_pll_base
+ reg
);
87 static inline u32
ath79_pll_rr(unsigned reg
)
89 return __raw_readl(ath79_pll_base
+ reg
);
92 static inline void ath79_reset_wr(unsigned reg
, u32 val
)
94 __raw_writel(val
, ath79_reset_base
+ reg
);
97 static inline u32
ath79_reset_rr(unsigned reg
)
99 return __raw_readl(ath79_reset_base
+ reg
);
102 void ath79_device_reset_set(u32 mask
);
103 void ath79_device_reset_clear(u32 mask
);
105 #endif /* __ASM_MACH_ATH79_H */