devices.h 964 B

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