/*-1* SPDX-License-Identifier: ISC2*3* Copyright (c) 2002-2008 Sam Leffler, Errno Consulting4* Copyright (c) 2002-2008 Atheros Communications, Inc.5*6* Permission to use, copy, modify, and/or distribute this software for any7* purpose with or without fee is hereby granted, provided that the above8* copyright notice and this permission notice appear in all copies.9*10* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES11* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF12* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR13* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES14* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN15* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF16* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.17*/18#ifndef _ATH_AH_SOC_H_19#define _ATH_AH_SOC_H_20/*21* Atheros System on Chip (SoC) public definitions.22*/2324/*25* This is board-specific data that is stored in a "known"26* location in flash. To find the start of this data search27* back from the (aliased) end of flash by 0x1000 bytes at a28* time until you find the string "5311", which marks the29* start of Board Configuration. Typically one gives up if30* more than 500KB is searched.31*/32struct ar531x_boarddata {33uint32_t magic; /* board data is valid */34#define AR531X_BD_MAGIC 0x35333131 /* "5311", for all 531x platforms */35uint16_t cksum; /* checksum (starting with BD_REV 2) */36uint16_t rev; /* revision of this struct */37#define BD_REV 438char boardName[64]; /* Name of board */39uint16_t major; /* Board major number */40uint16_t minor; /* Board minor number */41uint32_t config; /* Board configuration */42#define BD_ENET0 0x00000001 /* ENET0 is stuffed */43#define BD_ENET1 0x00000002 /* ENET1 is stuffed */44#define BD_UART1 0x00000004 /* UART1 is stuffed */45#define BD_UART0 0x00000008 /* UART0 is stuffed (dma) */46#define BD_RSTFACTORY 0x00000010 /* Reset factory defaults stuffed */47#define BD_SYSLED 0x00000020 /* System LED stuffed */48#define BD_EXTUARTCLK 0x00000040 /* External UART clock */49#define BD_CPUFREQ 0x00000080 /* cpu freq is valid in nvram */50#define BD_SYSFREQ 0x00000100 /* sys freq is set in nvram */51#define BD_WLAN0 0x00000200 /* Enable WLAN0 */52#define BD_MEMCAP 0x00000400 /* CAP SDRAM @ memCap for testing */53#define BD_DISWATCHDOG 0x00000800 /* disable system watchdog */54#define BD_WLAN1 0x00001000 /* Enable WLAN1 (ar5212) */55#define BD_ISCASPER 0x00002000 /* FLAG for AR2312 */56#define BD_WLAN0_2G_EN 0x00004000 /* FLAG for radio0_2G */57#define BD_WLAN0_5G_EN 0x00008000 /* FLAG for radio0_2G */58#define BD_WLAN1_2G_EN 0x00020000 /* FLAG for radio0_2G */59#define BD_WLAN1_5G_EN 0x00040000 /* FLAG for radio0_2G */60uint16_t resetConfigGpio; /* Reset factory GPIO pin */61uint16_t sysLedGpio; /* System LED GPIO pin */6263uint32_t cpuFreq; /* CPU core frequency in Hz */64uint32_t sysFreq; /* System frequency in Hz */65uint32_t cntFreq; /* Calculated C0_COUNT frequency */6667uint8_t wlan0Mac[6];68uint8_t enet0Mac[6];69uint8_t enet1Mac[6];7071uint16_t pciId; /* Pseudo PCIID for common code */72uint16_t memCap; /* cap bank1 in MB */7374/* version 3 */75uint8_t wlan1Mac[6]; /* (ar5212) */76};7778/*79* Board support data. The driver is required to locate80* and fill-in this information before passing a reference to81* this structure as the HAL_BUS_TAG parameter supplied to82* ath_hal_attach.83*/84struct ar531x_config {85const struct ar531x_boarddata *board; /* board config data */86const char *radio; /* radio config data */87int unit; /* unit number [0, 1] */88void *tag; /* bus space tag */89};90#endif /* _ATH_AH_SOC_H_ */919293