Path: blob/master/arch/microblaze/include/asm/cpuinfo.h
15126 views
/*1* Generic support for queying CPU info2*3* Copyright (C) 2007-2009 Michal Simek <[email protected]>4* Copyright (C) 2007-2009 PetaLogix5* Copyright (C) 2007 John Williams <[email protected]>6*7* This file is subject to the terms and conditions of the GNU General8* Public License. See the file COPYING in the main directory of this9* archive for more details.10*/1112#ifndef _ASM_MICROBLAZE_CPUINFO_H13#define _ASM_MICROBLAZE_CPUINFO_H1415#include <asm/prom.h>1617/* CPU Version and FPGA Family code conversion table type */18struct cpu_ver_key {19const char *s;20const unsigned k;21};2223extern const struct cpu_ver_key cpu_ver_lookup[];2425struct family_string_key {26const char *s;27const unsigned k;28};2930extern const struct family_string_key family_string_lookup[];3132struct cpuinfo {33/* Core CPU configuration */34u32 use_instr;35u32 use_mult;36u32 use_fpu;37u32 use_exc;38u32 ver_code;39u32 mmu;40u32 endian;4142/* CPU caches */43u32 use_icache;44u32 icache_tagbits;45u32 icache_write;46u32 icache_line_length;47u32 icache_size;48unsigned long icache_base;49unsigned long icache_high;5051u32 use_dcache;52u32 dcache_tagbits;53u32 dcache_write;54u32 dcache_line_length;55u32 dcache_size;56u32 dcache_wb;57unsigned long dcache_base;58unsigned long dcache_high;5960/* Bus connections */61u32 use_dopb;62u32 use_iopb;63u32 use_dlmb;64u32 use_ilmb;65u32 num_fsl;6667/* CPU interrupt line info */68u32 irq_edge;69u32 irq_positive;7071u32 area_optimised;7273/* HW debug support */74u32 hw_debug;75u32 num_pc_brk;76u32 num_rd_brk;77u32 num_wr_brk;78u32 cpu_clock_freq; /* store real freq of cpu */7980/* FPGA family */81u32 fpga_family_code;8283/* User define */84u32 pvr_user1;85u32 pvr_user2;86};8788extern struct cpuinfo cpuinfo;8990/* fwd declarations of the various CPUinfo populators */91void setup_cpuinfo(void);9293void set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu);94void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu);9596static inline unsigned int fcpu(struct device_node *cpu, char *n)97{98const __be32 *val;99return (val = of_get_property(cpu, n, NULL)) ?100be32_to_cpup(val) : 0;101}102103#endif /* _ASM_MICROBLAZE_CPUINFO_H */104105106