Commit 8e2ad016 authored by Michal Simek's avatar Michal Simek
Browse files

microblaze: Add PVR for endians plus detection



Upcomming microblaze version will support little-endian.

Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 44180a57
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ struct cpuinfo {
	u32 use_exc;
	u32 ver_code;
	u32 mmu;
	u32 endian;

	/* CPU caches */
	u32 use_icache;
+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ struct pvr_s {
#define PVR0_USE_DCACHE_MASK		0x01000000
#define PVR0_USE_MMU			0x00800000
#define PVR0_USE_BTC			0x00400000
#define PVR0_ENDI			0x00200000
#define PVR0_VERSION_MASK		0x0000FF00
#define PVR0_USER1_MASK			0x000000FF

@@ -209,6 +210,8 @@ struct pvr_s {
#define PVR_MMU_TLB_ACCESS(pvr)	(pvr.pvr[11] & PVR11_MMU_TLB_ACCESS)
#define PVR_MMU_ZONES(pvr)	(pvr.pvr[11] & PVR11_MMU_ZONES)

/* endian */
#define PVR_ENDIAN(pvr)	(pvr.pvr[0] & PVR0_ENDI)

int cpu_has_pvr(void);
void get_pvr(struct pvr_s *pvr);
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
	CI(pvr_user2, USER2);

	CI(mmu, USE_MMU);
	CI(endian, ENDIAN);

	CI(use_icache, USE_ICACHE);
	CI(icache_tagbits, ICACHE_ADDR_TAG_BITS);
+1 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu)
	ci->pvr_user2 = fcpu(cpu, "xlnx,pvr-user2");

	ci->mmu = fcpu(cpu, "xlnx,use-mmu");
	ci->endian = fcpu(cpu, "xlnx,endianness");

	ci->ver_code = 0;
	ci->fpga_family_code = 0;
+2 −1
Original line number Diff line number Diff line
@@ -51,11 +51,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
	count = seq_printf(m,
			"CPU-Family:	MicroBlaze\n"
			"FPGA-Arch:	%s\n"
			"CPU-Ver:	%s\n"
			"CPU-Ver:	%s, %s endian\n"
			"CPU-MHz:	%d.%02d\n"
			"BogoMips:	%lu.%02lu\n",
			fpga_family,
			cpu_ver,
			cpuinfo.endian ? "little" : "big",
			cpuinfo.cpu_clock_freq /
			1000000,
			cpuinfo.cpu_clock_freq %
Loading