ar71xx_setup.c (211476) | ar71xx_setup.c (211502) |
---|---|
1/*- 2 * Copyright (c) 2010 Adrian Chadd 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2010 Adrian Chadd 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/mips/atheros/ar71xx_setup.c 211476 2010-08-19 02:03:12Z adrian $"); | 28__FBSDID("$FreeBSD: head/sys/mips/atheros/ar71xx_setup.c 211502 2010-08-19 11:40:10Z adrian $"); |
29 30#include <sys/param.h> 31#include <machine/cpuregs.h> 32 33#include <mips/sentry5/s5reg.h> 34 35#include "opt_ddb.h" 36 --- 19 unchanged lines hidden (view full) --- 56#include <machine/vmparam.h> 57 58#include <mips/atheros/ar71xxreg.h> 59#include <mips/atheros/ar71xx_setup.h> 60 61#include <mips/atheros/ar71xx_cpudef.h> 62 63#include <mips/atheros/ar71xx_chip.h> | 29 30#include <sys/param.h> 31#include <machine/cpuregs.h> 32 33#include <mips/sentry5/s5reg.h> 34 35#include "opt_ddb.h" 36 --- 19 unchanged lines hidden (view full) --- 56#include <machine/vmparam.h> 57 58#include <mips/atheros/ar71xxreg.h> 59#include <mips/atheros/ar71xx_setup.h> 60 61#include <mips/atheros/ar71xx_cpudef.h> 62 63#include <mips/atheros/ar71xx_chip.h> |
64#include <mips/atheros/ar91xx_chip.h> |
|
64 65#define AR71XX_SYS_TYPE_LEN 128 66 67static char ar71xx_sys_type[AR71XX_SYS_TYPE_LEN]; 68enum ar71xx_soc_type ar71xx_soc; 69struct ar71xx_cpu_def * ar71xx_cpu_ops = NULL; 70 71void --- 27 unchanged lines hidden (view full) --- 99 100 case AR71XX_REV_ID_MINOR_AR7161: 101 ar71xx_soc = AR71XX_SOC_AR7161; 102 chip = "7161"; 103 break; 104 } 105 break; 106 | 65 66#define AR71XX_SYS_TYPE_LEN 128 67 68static char ar71xx_sys_type[AR71XX_SYS_TYPE_LEN]; 69enum ar71xx_soc_type ar71xx_soc; 70struct ar71xx_cpu_def * ar71xx_cpu_ops = NULL; 71 72void --- 27 unchanged lines hidden (view full) --- 100 101 case AR71XX_REV_ID_MINOR_AR7161: 102 ar71xx_soc = AR71XX_SOC_AR7161; 103 chip = "7161"; 104 break; 105 } 106 break; 107 |
108 case REV_ID_MAJOR_AR913X: 109 minor = id & AR91XX_REV_ID_MINOR_MASK; 110 rev = id >> AR91XX_REV_ID_REVISION_SHIFT; 111 rev &= AR91XX_REV_ID_REVISION_MASK; 112 ar71xx_cpu_ops = &ar91xx_chip_def; 113 switch (minor) { 114 case AR91XX_REV_ID_MINOR_AR9130: 115 ar71xx_soc = AR71XX_SOC_AR9130; 116 chip = "9130"; 117 break; 118 119 case AR91XX_REV_ID_MINOR_AR9132: 120 ar71xx_soc = AR71XX_SOC_AR9132; 121 chip = "9132"; 122 break; 123 } 124 break; 125 126 |
|
107 default: 108 panic("ar71xx: unknown chip id:0x%08x\n", id); 109 } 110 111 sprintf(ar71xx_sys_type, "Atheros AR%s rev %u", chip, rev); 112} 113 114const char * 115ar71xx_get_system_type(void) 116{ 117 return ar71xx_sys_type; 118} 119 | 127 default: 128 panic("ar71xx: unknown chip id:0x%08x\n", id); 129 } 130 131 sprintf(ar71xx_sys_type, "Atheros AR%s rev %u", chip, rev); 132} 133 134const char * 135ar71xx_get_system_type(void) 136{ 137 return ar71xx_sys_type; 138} 139 |