Changeset View
Changeset View
Standalone View
Standalone View
sys/mips/broadcom/bcm_socinfo.c
Show All 23 Lines | |||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <dev/bhnd/cores/chipc/chipcreg.h> | |||||
#include "bcm_machdep.h" | |||||
#include "bcm_socinfo.h" | #include "bcm_socinfo.h" | ||||
/* found on https://wireless.wiki.kernel.org/en/users/drivers/b43/soc */ | /* found on https://wireless.wiki.kernel.org/en/users/drivers/b43/soc */ | ||||
struct bcm_socinfo bcm_socinfos[] = { | struct bcm_socinfo bcm_socinfos[] = { | ||||
{0x00005300, 600, 25000000, 1}, /* BCM4706 to check */ | {0x00005300, 600, 25000000, 1}, /* BCM4706 to check */ | ||||
{0x0022B83A, 300, 20000000, 1}, /* BCM4716B0 ASUS RT-N12 */ | {0x0022B83A, 300, 20000000, 1}, /* BCM4716B0 ASUS RT-N12 */ | ||||
{0x00914716, 354, 20000000, 1}, /* BCM4717A1 to check */ | {0x00914716, 354, 20000000, 1}, /* BCM4717A1 to check */ | ||||
{0x00A14716, 480, 20000000, 1}, /* BCM4718A1 ASUS RT-N16 */ | {0x00A14716, 480, 20000000, 1}, /* BCM4718A1 ASUS RT-N16 */ | ||||
Show All 40 Lines | bcm_get_socinfo(void) | ||||
* | 0x0000FFFF | Chip ID | | * | 0x0000FFFF | Chip ID | | ||||
* | 0x000F0000 | Chip Revision | | * | 0x000F0000 | Chip Revision | | ||||
* | 0x00F00000 | Package Options | | * | 0x00F00000 | Package Options | | ||||
* | 0x0F000000 | Number of Cores (ChipCommon Rev. >= 4)| | * | 0x0F000000 | Number of Cores (ChipCommon Rev. >= 4)| | ||||
* | 0xF0000000 | Chip Type | | * | 0xF0000000 | Chip Type | | ||||
* -------------------------------------------------------------- | * -------------------------------------------------------------- | ||||
*/ | */ | ||||
socid = BCM_READ_REG32(BCM_REG_CHIPC_ID) & 0x00FFFFFF; | socid = BCM_CHIPC_READ_4(CHIPC_ID) & 0x00FFFFFF; | ||||
socinfo = bcm_get_socinfo_by_socid(socid); | socinfo = bcm_get_socinfo_by_socid(socid); | ||||
return (socinfo != NULL) ? socinfo : &BCM_DEFAULT_SOCINFO; | return (socinfo != NULL) ? socinfo : &BCM_DEFAULT_SOCINFO; | ||||
} | } |