1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  */
12 
13 #include <xen/init.h>
14 #include <xen/lib.h>
15 #include <xen/sched.h>
16 
17 #include <asm/processor.h>
18 
identify_cpu(struct cpuinfo_arm * c)19 void identify_cpu(struct cpuinfo_arm *c)
20 {
21         c->midr.bits = READ_SYSREG32(MIDR_EL1);
22         c->mpidr.bits = READ_SYSREG(MPIDR_EL1);
23 
24 #ifdef CONFIG_ARM_64
25         c->pfr64.bits[0] = READ_SYSREG64(ID_AA64PFR0_EL1);
26         c->pfr64.bits[1] = READ_SYSREG64(ID_AA64PFR1_EL1);
27 
28         c->dbg64.bits[0] = READ_SYSREG64(ID_AA64DFR0_EL1);
29         c->dbg64.bits[1] = READ_SYSREG64(ID_AA64DFR1_EL1);
30 
31         c->aux64.bits[0] = READ_SYSREG64(ID_AA64AFR0_EL1);
32         c->aux64.bits[1] = READ_SYSREG64(ID_AA64AFR1_EL1);
33 
34         c->mm64.bits[0]  = READ_SYSREG64(ID_AA64MMFR0_EL1);
35         c->mm64.bits[1]  = READ_SYSREG64(ID_AA64MMFR1_EL1);
36 
37         c->isa64.bits[0] = READ_SYSREG64(ID_AA64ISAR0_EL1);
38         c->isa64.bits[1] = READ_SYSREG64(ID_AA64ISAR1_EL1);
39 #endif
40 
41         c->pfr32.bits[0] = READ_SYSREG32(ID_PFR0_EL1);
42         c->pfr32.bits[1] = READ_SYSREG32(ID_PFR1_EL1);
43 
44         c->dbg32.bits[0] = READ_SYSREG32(ID_DFR0_EL1);
45 
46         c->aux32.bits[0] = READ_SYSREG32(ID_AFR0_EL1);
47 
48         c->mm32.bits[0]  = READ_SYSREG32(ID_MMFR0_EL1);
49         c->mm32.bits[1]  = READ_SYSREG32(ID_MMFR1_EL1);
50         c->mm32.bits[2]  = READ_SYSREG32(ID_MMFR2_EL1);
51         c->mm32.bits[3]  = READ_SYSREG32(ID_MMFR3_EL1);
52 
53         c->isa32.bits[0] = READ_SYSREG32(ID_ISAR0_EL1);
54         c->isa32.bits[1] = READ_SYSREG32(ID_ISAR1_EL1);
55         c->isa32.bits[2] = READ_SYSREG32(ID_ISAR2_EL1);
56         c->isa32.bits[3] = READ_SYSREG32(ID_ISAR3_EL1);
57         c->isa32.bits[4] = READ_SYSREG32(ID_ISAR4_EL1);
58         c->isa32.bits[5] = READ_SYSREG32(ID_ISAR5_EL1);
59 }
60 
61 /*
62  * Local variables:
63  * mode: C
64  * c-file-style: "BSD"
65  * c-basic-offset: 4
66  * indent-tabs-mode: nil
67  * End:
68  */
69