00001 /* clib/include/able/cpuop.h 00002 * ABLE delay functions 00003 * 00004 * Copyright 2004 Simtec Electronics 00005 * 00006 * Permission is hereby granted, free of charge, to any person 00007 * obtaining a copy of this software and associated documentation 00008 * files (the "Software"), to deal in the Software without 00009 * restriction, including without limitation the rights to use, copy, 00010 * modify, merge, publish, distribute, sublicense, and/or sell copies 00011 * of the Software, and to permit persons to whom the Software is 00012 * furnished to do so, subject to the following conditions: 00013 * 00014 * The above copyright notice and this permission notice shall be 00015 * included in all copies or substantial portions of the Software. 00016 * 00017 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00018 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00019 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00020 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00021 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00022 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00023 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00024 * SOFTWARE. 00025 */ 00026 00027 #ifndef _ABLE_CLIB_ABLE_CPUO_H 00028 #define _ABLE_CLIB_ABLE_CPUO_H __FILE__ 00029 00030 #define CPU_TYPE_ARM (0x01) 00031 00032 #define CPU_ARM_ARCH_V3 (0x03) 00033 #define CPU_ARM_ARCH_V4 (0x04) 00034 00035 #define CPU_ARM_HALFWORD (0x10000) 00036 #define CPU_END (-1) 00037 00038 /* codes for cpu_op() */ 00039 00040 #define CPUOP_IRQINIT (0x01) 00041 #define CPUOP_IRQSTATE (0x02) 00042 #define CPUOP_MMUCHANGE (0x03) 00043 #define CPUOP_JUMP_NEWMMU (0x04) 00044 #define CPUOP_JUMP_NOMMU (0x05) 00045 #define CPUOP_MKDEV (0x06) /* create bus and device for cpu */ 00046 #define CPUOP_CHANGE_SPEED (0x07) 00047 #define CPUOP_CHANGE_TIMING (0x08) 00048 00049 #ifndef __ASSEMBLY__ 00050 typedef void (*cpu_irq_fn_t)(void); 00051 typedef void (*cpu_abrt_fn_t)(void); 00052 typedef int (*cpu_op_fn_t)(int op, void *arg); 00053 00054 struct cpu_info { 00055 const int arch; 00056 const int *capabilities; 00057 const property_ent_t *properties; 00058 const cpu_irq_fn_t irq; 00059 const cpu_abrt_fn_t data_abort; 00060 const cpu_abrt_fn_t prefetch_abort; 00061 const cpu_op_fn_t op; 00062 const cpu_abrt_fn_t undefined_instr; 00063 }; 00064 00065 typedef struct cpu_info cpu_info_t; 00066 00067 struct cpu_ident { 00068 int (*ident)(void); 00069 const cpu_info_t *cpu_info; 00070 }; 00071 00072 struct cpu_jump_nommu { 00073 u32_t *regs; 00074 u32_t jump_to; 00075 }; 00076 00077 struct cpu_jumpnewmmu { 00078 u32_t *regs; 00079 void *pagetables; 00080 u32_t jump_to; 00081 }; 00082 00083 struct cpu_change_speed { 00084 u32_t new_speed; 00085 }; 00086 00087 struct cpu_change_timing { 00088 u32_t bank; 00089 void *timing; 00090 }; 00091 00092 extern int cpu_op(int op, void *arg); 00093 00094 #endif /* __ASSEMBLY__ */ 00095 #endif /* _ABLE_CLIB_ABLE_CPUO_H */