📄 cpu_startup.h
字号:
/* * $QNXLicenseC: * Copyright 2007, QNX Software Systems. * * Licensed under the Apache License, Version 2.0 (the "License"). You * may not reproduce, modify or distribute this software except in * compliance with the License. You may obtain a copy of the License * at: http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OF ANY KIND, either express or implied. * * This file may contain contributions from others, either as * contributors under the License or as licensors under other terms. * Please review this entire file for other proprietary rights or license * notices, as well as the QNX Development Suite License Guide at * http://licensing.qnx.com/license-guide/ for other information. * $ */#include <arm/inout.h>#include <arm/inline.h>#include <arm/mmu.h>/***************************************************************************************************************************************** These definitions are required for the system independent code.*****************************************************************************************************************************************/#define KERCALL_SEQUENCE(name) uint32_t name[] = { \ 0xef000000, /* swi (syscall no. in ip) */ \ 0xe7ffffff /* undefined instruction */ \}#define CPU_SYSPAGE_TYPE SYSPAGE_ARMstruct cpu_local_syspage { SYSPAGE_SECTION(arm_boxinfo); SYSPAGE_SECTION(arm_cpu);};extern void print_arm_boxinfo(void);extern void print_arm_cpu(void);#define CPU_PRT_SYSPAGE_RTNS \ CPU_PRT_SYSPAGE_RTN(arm, 1, boxinfo), \ CPU_PRT_SYSPAGE_RTN(arm, 1, cpu),#define BOOTSTRAPS_RUN_ONE_TO_ONE 0#define CPU_COMMON_OPTIONS_STRING "w:"/***************************************************************************************************************************************** Everything below is specific to the ARM.*****************************************************************************************************************************************//* * ------------------------------------------------------------------ * Generic ARM support * ------------------------------------------------------------------ */extern unsigned long arm_cpuspeed();extern paddr_t arm_map(uintptr_t va, paddr_t pa, size_t sz, int flags);extern void arm_ptmap(paddr_t pt, uintptr_t va);extern void arm_scmap(paddr_t va, paddr_t pa, int flags);extern unsigned trap_vectors;extern unsigned mmu_control;extern int cycles_per_loop;extern paddr_t L1_paddr;extern paddr_t L1_vaddr;extern paddr_t L2_paddr;extern paddr_t startup_base;extern unsigned startup_size;/* * CPU cache configuration used if there is no CP15 cache type register */struct arm_cache_config { unsigned flags; unsigned line_size; unsigned num_lines;};/* * CPU cache callout and configuration */struct arm_cache_info { const struct arm_cache_config *dcache_config; const struct callout_rtn *dcache_rtn; const struct arm_cache_config *icache_config; const struct callout_rtn *icache_rtn;};/* * MMU PTE details */struct arm_pte_info { unsigned short upte_ro; // user RO mappings unsigned short upte_rw; // user RW mappings unsigned short kpte_ro; // kern RO mappings unsigned short kpte_rw; // kern RW mappings unsigned short mask_nc; // bits to clear for uncached mappings};extern const struct arm_pte_info *arm_pte_info;extern const struct arm_pte_info armv4_pte_info;extern const struct arm_pte_info armv5_wa_pte_info;extern const struct arm_pte_info armv5_wb_pte_info;extern const struct arm_pte_info armv5_wt_pte_info;extern const struct arm_pte_info ixp2400_pte_info;/* * CPU core details */struct arm_core_config { unsigned mmu_cr; // additional CP15 C0 values int cycles; // cycles per arm_cpuspeed() loop const struct arm_cache_info *cache; // cache configuration const struct callout_rtn *power; // idle callout const struct callout_rtn *flush; // page_flush callout const struct callout_rtn *deferred; // page_flush_deferred callout const struct arm_pte_info *pte; // page table entries};/* * CPU core info */struct arm_core_info { unsigned cpuid; // bits 4-15 of CP15 C1 const char *name; const struct arm_core_config *config; void (*extra_init)(struct cpuinfo_entry *cpu, unsigned cpuid);};extern const struct arm_core_info * arm_core_detect();extern void arm_add_cache(struct cpuinfo_entry *cpu, const struct arm_cache_info *cache);extern void arm_get_pte_info();extern int arm_altpte;/* * ------------------------------------------------------------------ * SA-1100/1110 Processor Support * ------------------------------------------------------------------ */extern void init_sa1100(unsigned, const char *, const char *);extern void put_sa1100(int);extern void init_qtime_sa1100(void);extern unsigned sa11x1_base;extern unsigned sa1100_grer;extern unsigned sa1100_gfer;extern struct callout_rtn reboot_sa1100;extern struct callout_rtn power_sa1100;extern struct callout_rtn interrupt_id_sa1100;extern struct callout_rtn interrupt_eoi_sa1100;extern struct callout_rtn interrupt_mask_sa1100;extern struct callout_rtn interrupt_unmask_sa1100;extern struct callout_rtn interrupt_id_sa1100_gpio;extern struct callout_rtn interrupt_eoi_sa1100_gpio;extern struct callout_rtn interrupt_mask_sa1100_gpio;extern struct callout_rtn interrupt_unmask_sa1100_gpio;extern struct callout_rtn display_char_sa1100;extern struct callout_rtn poll_key_sa1100;extern struct callout_rtn break_detect_sa1100;extern struct callout_rtn timer_load_sa1100;extern struct callout_rtn timer_value_sa1100;extern struct callout_rtn timer_reload_sa1100;extern struct callout_rtn cache_sa_i;extern struct callout_rtn cache_sa_d;extern struct callout_rtn page_flush_sa;extern struct callout_rtn page_flush_deferred_sa;extern struct callout_rtn interrupt_id_sa1101;extern struct callout_rtn interrupt_eoi_sa1101;extern struct callout_rtn interrupt_mask_sa1101;extern struct callout_rtn interrupt_unmask_sa1101;extern struct callout_rtn interrupt_id_sa1111;extern struct callout_rtn interrupt_eoi_sa1111;extern struct callout_rtn interrupt_mask_sa1111;extern struct callout_rtn interrupt_unmask_sa1111;extern const struct arm_cache_config sa11x0_dcache_config;extern const struct arm_cache_config sa11x0_icache_config;extern const struct arm_cache_info sa11x0_cache;extern const struct arm_core_config sa11x0_config;extern unsigned long rtc_time_sa1100(unsigned);/* * ------------------------------------------------------------------ * Xscale processor support * ------------------------------------------------------------------ */extern struct callout_rtn power_xscale;extern struct callout_rtn cache_sa2_i;extern struct callout_rtn cache_sa2_d;extern struct callout_rtn page_flush_sa2;extern struct callout_rtn page_flush_deferred_sa2;extern const struct arm_cache_info xscale_cache;extern const struct arm_core_config xscale_errata_config;extern const struct arm_core_config xscale_config;extern void xscale_extra_init(struct cpuinfo_entry *, unsigned);extern unsigned long rtc_time_pxa250(unsigned);/* * ------------------------------------------------------------------ * ARM720T processor support * ------------------------------------------------------------------ */extern struct callout_rtn cache_720;extern struct callout_rtn page_flush_720;extern struct callout_rtn page_flush_deferred_720;extern const struct arm_cache_config arm720_cache_config;extern const struct arm_cache_info arm720_cache;extern const struct arm_core_config arm720_config;/* * ------------------------------------------------------------------ * ARM920T processor support * ------------------------------------------------------------------ */extern struct callout_rtn power_920;extern struct callout_rtn cache_920_i;extern struct callout_rtn cache_920_d;extern struct callout_rtn page_flush_920;extern struct callout_rtn page_flush_deferred_920;extern const struct arm_cache_info arm92x_cache;extern const struct arm_core_config arm92x_config;extern void arm920_extra_init(struct cpuinfo_entry *, unsigned);extern struct callout_rtn cache_925_i;extern struct callout_rtn cache_925_d;extern struct callout_rtn page_flush_925;extern struct callout_rtn page_flush_deferred_925;extern const struct arm_cache_info arm925_cache;extern const struct arm_core_config arm925_config;/* * ------------------------------------------------------------------ * ARM1020T processor support * ------------------------------------------------------------------ */extern struct callout_rtn cache_1020_i;extern struct callout_rtn cache_1020_d;extern struct callout_rtn page_flush_1020;extern struct callout_rtn page_flush_deferred_1020;extern const struct arm_cache_info arm102x_cache;extern const struct arm_core_config arm102x_config;/* * ------------------------------------------------------------------ * PrimeCell UART/RTC support * ------------------------------------------------------------------ */extern void init_primecell(unsigned, const char *, const char *);extern void put_primecell(int);extern struct callout_rtn display_char_primecell;extern struct callout_rtn poll_key_primecell;extern struct callout_rtn break_detect_primecell;extern unsigned long rtc_time_primecell(unsigned);/* * ------------------------------------------------------------------ * PXA250 support * ------------------------------------------------------------------ */extern void init_pxa250(unsigned, const char *, const char *);extern void put_pxa250(int);extern void init_qtime_pxa250(void);extern struct callout_rtn display_char_pxa250;extern struct callout_rtn poll_key_pxa250;extern struct callout_rtn break_detect_pxa250;extern struct callout_rtn timer_load_pxa250;extern struct callout_rtn timer_value_pxa250;extern struct callout_rtn timer_reload_pxa250;extern struct callout_rtn interrupt_id_pxa250;extern struct callout_rtn interrupt_eoi_pxa250;extern struct callout_rtn interrupt_mask_pxa250;extern struct callout_rtn interrupt_unmask_pxa250;extern struct callout_rtn interrupt_id_pxa250_gpio;extern struct callout_rtn interrupt_eoi_pxa250_gpio;extern struct callout_rtn interrupt_mask_pxa250_gpio;extern struct callout_rtn interrupt_unmask_pxa250_gpio;/* * ------------------------------------------------------------------ * PXA270 support * ------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -