ath25_platform.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_MACH_ATH25_PLATFORM_H
  3. #define __ASM_MACH_ATH25_PLATFORM_H
  4. #include <linux/etherdevice.h>
  5. /*
  6. * This is board-specific data that is stored in a "fixed" location in flash.
  7. * It is shared across operating systems, so it should not be changed lightly.
  8. * The main reason we need it is in order to extract the ethernet MAC
  9. * address(es).
  10. */
  11. struct ath25_boarddata {
  12. u32 magic; /* board data is valid */
  13. #define ATH25_BD_MAGIC 0x35333131 /* "5311", for all 531x/231x platforms */
  14. u16 cksum; /* checksum (starting with BD_REV 2) */
  15. u16 rev; /* revision of this struct */
  16. #define BD_REV 4
  17. char board_name[64]; /* Name of board */
  18. u16 major; /* Board major number */
  19. u16 minor; /* Board minor number */
  20. u32 flags; /* Board configuration */
  21. #define BD_ENET0 0x00000001 /* ENET0 is stuffed */
  22. #define BD_ENET1 0x00000002 /* ENET1 is stuffed */
  23. #define BD_UART1 0x00000004 /* UART1 is stuffed */
  24. #define BD_UART0 0x00000008 /* UART0 is stuffed (dma) */
  25. #define BD_RSTFACTORY 0x00000010 /* Reset factory defaults stuffed */
  26. #define BD_SYSLED 0x00000020 /* System LED stuffed */
  27. #define BD_EXTUARTCLK 0x00000040 /* External UART clock */
  28. #define BD_CPUFREQ 0x00000080 /* cpu freq is valid in nvram */
  29. #define BD_SYSFREQ 0x00000100 /* sys freq is set in nvram */
  30. #define BD_WLAN0 0x00000200 /* Enable WLAN0 */
  31. #define BD_MEMCAP 0x00000400 /* CAP SDRAM @ mem_cap for testing */
  32. #define BD_DISWATCHDOG 0x00000800 /* disable system watchdog */
  33. #define BD_WLAN1 0x00001000 /* Enable WLAN1 (ar5212) */
  34. #define BD_ISCASPER 0x00002000 /* FLAG for AR2312 */
  35. #define BD_WLAN0_2G_EN 0x00004000 /* FLAG for radio0_2G */
  36. #define BD_WLAN0_5G_EN 0x00008000 /* FLAG for radio0_2G */
  37. #define BD_WLAN1_2G_EN 0x00020000 /* FLAG for radio0_2G */
  38. #define BD_WLAN1_5G_EN 0x00040000 /* FLAG for radio0_2G */
  39. u16 reset_config_gpio; /* Reset factory GPIO pin */
  40. u16 sys_led_gpio; /* System LED GPIO pin */
  41. u32 cpu_freq; /* CPU core frequency in Hz */
  42. u32 sys_freq; /* System frequency in Hz */
  43. u32 cnt_freq; /* Calculated C0_COUNT frequency */
  44. u8 wlan0_mac[ETH_ALEN];
  45. u8 enet0_mac[ETH_ALEN];
  46. u8 enet1_mac[ETH_ALEN];
  47. u16 pci_id; /* Pseudo PCIID for common code */
  48. u16 mem_cap; /* cap bank1 in MB */
  49. /* version 3 */
  50. u8 wlan1_mac[ETH_ALEN]; /* (ar5212) */
  51. };
  52. #define BOARD_CONFIG_BUFSZ 0x1000
  53. /*
  54. * Platform device information for the Wireless MAC
  55. */
  56. struct ar231x_board_config {
  57. u16 devid;
  58. /* board config data */
  59. struct ath25_boarddata *config;
  60. /* radio calibration data */
  61. const char *radio;
  62. };
  63. #endif /* __ASM_MACH_ATH25_PLATFORM_H */