Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ATH25_DEVICES_H
0003 #define __ATH25_DEVICES_H
0004 
0005 #include <linux/cpu.h>
0006 
0007 #define ATH25_REG_MS(_val, _field)  (((_val) & _field##_M) >> _field##_S)
0008 
0009 #define ATH25_IRQ_CPU_CLOCK (MIPS_CPU_IRQ_BASE + 7) /* C0_CAUSE: 0x8000 */
0010 
0011 enum ath25_soc_type {
0012     /* handled by ar5312.c */
0013     ATH25_SOC_AR2312,
0014     ATH25_SOC_AR2313,
0015     ATH25_SOC_AR5312,
0016 
0017     /* handled by ar2315.c */
0018     ATH25_SOC_AR2315,
0019     ATH25_SOC_AR2316,
0020     ATH25_SOC_AR2317,
0021     ATH25_SOC_AR2318,
0022 
0023     ATH25_SOC_UNKNOWN
0024 };
0025 
0026 extern enum ath25_soc_type ath25_soc;
0027 extern struct ar231x_board_config ath25_board;
0028 extern void (*ath25_irq_dispatch)(void);
0029 
0030 int ath25_find_config(phys_addr_t offset, unsigned long size);
0031 void ath25_serial_setup(u32 mapbase, int irq, unsigned int uartclk);
0032 int ath25_add_wmac(int nr, u32 base, int irq);
0033 
0034 static inline bool is_ar2315(void)
0035 {
0036     return (current_cpu_data.cputype == CPU_4KEC);
0037 }
0038 
0039 static inline bool is_ar5312(void)
0040 {
0041     return !is_ar2315();
0042 }
0043 
0044 #endif