diff options
author | Michal Simek <monstr@monstr.eu> | 2010-08-13 06:47:42 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2010-10-21 01:51:57 -0400 |
commit | 8e2ad016b20f98790d5995aae1d157d1613ab9e6 (patch) | |
tree | e1eb651eff6d7f45c0a3e8316a26112611ad5f4d | |
parent | 44180a573ec936cd989a7c0478f5fd1cf8e1ebc3 (diff) |
microblaze: Add PVR for endians plus detection
Upcomming microblaze version will support little-endian.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
-rw-r--r-- | arch/microblaze/include/asm/cpuinfo.h | 1 | ||||
-rw-r--r-- | arch/microblaze/include/asm/pvr.h | 3 | ||||
-rw-r--r-- | arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c | 1 | ||||
-rw-r--r-- | arch/microblaze/kernel/cpu/cpuinfo-static.c | 1 | ||||
-rw-r--r-- | arch/microblaze/kernel/cpu/mb.c | 3 | ||||
-rw-r--r-- | arch/microblaze/platform/generic/system.dts | 1 |
6 files changed, 9 insertions, 1 deletions
diff --git a/arch/microblaze/include/asm/cpuinfo.h b/arch/microblaze/include/asm/cpuinfo.h index b4f5ca33aebf..0d4f0ce3ff7c 100644 --- a/arch/microblaze/include/asm/cpuinfo.h +++ b/arch/microblaze/include/asm/cpuinfo.h | |||
@@ -38,6 +38,7 @@ struct cpuinfo { | |||
38 | u32 use_exc; | 38 | u32 use_exc; |
39 | u32 ver_code; | 39 | u32 ver_code; |
40 | u32 mmu; | 40 | u32 mmu; |
41 | u32 endian; | ||
41 | 42 | ||
42 | /* CPU caches */ | 43 | /* CPU caches */ |
43 | u32 use_icache; | 44 | u32 use_icache; |
diff --git a/arch/microblaze/include/asm/pvr.h b/arch/microblaze/include/asm/pvr.h index 316105531d55..37db96a15b45 100644 --- a/arch/microblaze/include/asm/pvr.h +++ b/arch/microblaze/include/asm/pvr.h | |||
@@ -32,6 +32,7 @@ struct pvr_s { | |||
32 | #define PVR0_USE_DCACHE_MASK 0x01000000 | 32 | #define PVR0_USE_DCACHE_MASK 0x01000000 |
33 | #define PVR0_USE_MMU 0x00800000 | 33 | #define PVR0_USE_MMU 0x00800000 |
34 | #define PVR0_USE_BTC 0x00400000 | 34 | #define PVR0_USE_BTC 0x00400000 |
35 | #define PVR0_ENDI 0x00200000 | ||
35 | #define PVR0_VERSION_MASK 0x0000FF00 | 36 | #define PVR0_VERSION_MASK 0x0000FF00 |
36 | #define PVR0_USER1_MASK 0x000000FF | 37 | #define PVR0_USER1_MASK 0x000000FF |
37 | 38 | ||
@@ -209,6 +210,8 @@ struct pvr_s { | |||
209 | #define PVR_MMU_TLB_ACCESS(pvr) (pvr.pvr[11] & PVR11_MMU_TLB_ACCESS) | 210 | #define PVR_MMU_TLB_ACCESS(pvr) (pvr.pvr[11] & PVR11_MMU_TLB_ACCESS) |
210 | #define PVR_MMU_ZONES(pvr) (pvr.pvr[11] & PVR11_MMU_ZONES) | 211 | #define PVR_MMU_ZONES(pvr) (pvr.pvr[11] & PVR11_MMU_ZONES) |
211 | 212 | ||
213 | /* endian */ | ||
214 | #define PVR_ENDIAN(pvr) (pvr.pvr[0] & PVR0_ENDI) | ||
212 | 215 | ||
213 | int cpu_has_pvr(void); | 216 | int cpu_has_pvr(void); |
214 | void get_pvr(struct pvr_s *pvr); | 217 | void get_pvr(struct pvr_s *pvr); |
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c index f72dbd66c844..f70a6047f08e 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c +++ b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c | |||
@@ -72,6 +72,7 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) | |||
72 | CI(pvr_user2, USER2); | 72 | CI(pvr_user2, USER2); |
73 | 73 | ||
74 | CI(mmu, USE_MMU); | 74 | CI(mmu, USE_MMU); |
75 | CI(endian, ENDIAN); | ||
75 | 76 | ||
76 | CI(use_icache, USE_ICACHE); | 77 | CI(use_icache, USE_ICACHE); |
77 | CI(icache_tagbits, ICACHE_ADDR_TAG_BITS); | 78 | CI(icache_tagbits, ICACHE_ADDR_TAG_BITS); |
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-static.c b/arch/microblaze/kernel/cpu/cpuinfo-static.c index 6095aa6b5c88..b16b994ca3d2 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo-static.c +++ b/arch/microblaze/kernel/cpu/cpuinfo-static.c | |||
@@ -119,6 +119,7 @@ void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu) | |||
119 | ci->pvr_user2 = fcpu(cpu, "xlnx,pvr-user2"); | 119 | ci->pvr_user2 = fcpu(cpu, "xlnx,pvr-user2"); |
120 | 120 | ||
121 | ci->mmu = fcpu(cpu, "xlnx,use-mmu"); | 121 | ci->mmu = fcpu(cpu, "xlnx,use-mmu"); |
122 | ci->endian = fcpu(cpu, "xlnx,endianness"); | ||
122 | 123 | ||
123 | ci->ver_code = 0; | 124 | ci->ver_code = 0; |
124 | ci->fpga_family_code = 0; | 125 | ci->fpga_family_code = 0; |
diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c index 7086e3564281..b4048af02615 100644 --- a/arch/microblaze/kernel/cpu/mb.c +++ b/arch/microblaze/kernel/cpu/mb.c | |||
@@ -51,11 +51,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
51 | count = seq_printf(m, | 51 | count = seq_printf(m, |
52 | "CPU-Family: MicroBlaze\n" | 52 | "CPU-Family: MicroBlaze\n" |
53 | "FPGA-Arch: %s\n" | 53 | "FPGA-Arch: %s\n" |
54 | "CPU-Ver: %s\n" | 54 | "CPU-Ver: %s, %s endian\n" |
55 | "CPU-MHz: %d.%02d\n" | 55 | "CPU-MHz: %d.%02d\n" |
56 | "BogoMips: %lu.%02lu\n", | 56 | "BogoMips: %lu.%02lu\n", |
57 | fpga_family, | 57 | fpga_family, |
58 | cpu_ver, | 58 | cpu_ver, |
59 | cpuinfo.endian ? "little" : "big", | ||
59 | cpuinfo.cpu_clock_freq / | 60 | cpuinfo.cpu_clock_freq / |
60 | 1000000, | 61 | 1000000, |
61 | cpuinfo.cpu_clock_freq % | 62 | cpuinfo.cpu_clock_freq % |
diff --git a/arch/microblaze/platform/generic/system.dts b/arch/microblaze/platform/generic/system.dts index ef667d125ce0..3f85df2b73b3 100644 --- a/arch/microblaze/platform/generic/system.dts +++ b/arch/microblaze/platform/generic/system.dts | |||
@@ -85,6 +85,7 @@ | |||
85 | xlnx,dynamic-bus-sizing = <0x1>; | 85 | xlnx,dynamic-bus-sizing = <0x1>; |
86 | xlnx,edge-is-positive = <0x1>; | 86 | xlnx,edge-is-positive = <0x1>; |
87 | xlnx,family = "virtex5"; | 87 | xlnx,family = "virtex5"; |
88 | xlnx,endianness = <0x1>; | ||
88 | xlnx,fpu-exception = <0x1>; | 89 | xlnx,fpu-exception = <0x1>; |
89 | xlnx,fsl-data-size = <0x20>; | 90 | xlnx,fsl-data-size = <0x20>; |
90 | xlnx,fsl-exception = <0x0>; | 91 | xlnx,fsl-exception = <0x0>; |