devices.h 925 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __ATH25_DEVICES_H
  2. #define __ATH25_DEVICES_H
  3. #include <linux/cpu.h>
  4. #define ATH25_REG_MS(_val, _field) (((_val) & _field##_M) >> _field##_S)
  5. #define ATH25_IRQ_CPU_CLOCK (MIPS_CPU_IRQ_BASE + 7) /* C0_CAUSE: 0x8000 */
  6. enum ath25_soc_type {
  7. /* handled by ar5312.c */
  8. ATH25_SOC_AR2312,
  9. ATH25_SOC_AR2313,
  10. ATH25_SOC_AR5312,
  11. /* handled by ar2315.c */
  12. ATH25_SOC_AR2315,
  13. ATH25_SOC_AR2316,
  14. ATH25_SOC_AR2317,
  15. ATH25_SOC_AR2318,
  16. ATH25_SOC_UNKNOWN
  17. };
  18. extern enum ath25_soc_type ath25_soc;
  19. extern struct ar231x_board_config ath25_board;
  20. extern void (*ath25_irq_dispatch)(void);
  21. int ath25_find_config(phys_addr_t offset, unsigned long size);
  22. void ath25_serial_setup(u32 mapbase, int irq, unsigned int uartclk);
  23. int ath25_add_wmac(int nr, u32 base, int irq);
  24. static inline bool is_ar2315(void)
  25. {
  26. return (current_cpu_data.cputype == CPU_4KEC);
  27. }
  28. static inline bool is_ar5312(void)
  29. {
  30. return !is_ar2315();
  31. }
  32. #endif