📄 boardcfg.c
字号:
/* openbios/arch/vesta/boardcfg.c *//*-----------------------------------------------------------------------------+|| This source code has been made available to you by IBM on an AS-IS| basis. Anyone receiving this source is licensed under IBM| copyrights to use it in any way he or she deems fit, including| copying it, modifying it, compiling it, and redistributing it either| with or without modifications. No license under IBM patents or| patent applications is to be implied by the copyright license.|| Any user of this software should understand that IBM cannot provide| technical support for this software and will not be responsible for| any consequences resulting from the use of this software.|| Any person who transfers this source code or any derivative work| must include the IBM copyright notice, this paragraph, and the| preceding two paragraphs in the transferred software.|| COPYRIGHT I B M CORPORATION 1995| LICENSED MATERIAL - PROGRAM PROPERTY OF I B M+-----------------------------------------------------------------------------*//*-----------------------------------------------------------------------------+|| File Name: boardcfg.c|| Function: Defines Vesta specific board config related routines.|| Author: Yudong Yang|| Change Activity-|| Date Description of Change BY| --------- --------------------- ---| 15-Jan-02 Splitted architecture specific parts from miscLib/boardcfg YYD|+-----------------------------------------------------------------------------*/static void init_sysclock_ratio(){ unsigned long temp_value; unsigned long Mult, RangeA, RangeB; unsigned long HSMC_speed; /*--------------------------------------------------------------------------+ | Calculate the HSMC and processor speeds from clock registers. Note that | the bus speed is the same as the processor speed. | Set the processor_speed and bus_speed fields in the board_cfg structure. +--------------------------------------------------------------------------*/ temp_value = ppcMfclkgpcr(); RangeB = 8 - ((temp_value >> 8) & 0x7); RangeA = 8 - ((temp_value >> 4) & 0x7); Mult = temp_value & 0xf; if (!Mult) { Mult = 16; } HSMC_speed = PROC_CLOCK * Mult * RangeA / RangeB ; HSMC_speed = HSMC_speed / 4; board_cfg.processor_speed = HSMC_speed / 2; Ticks_per_sec = board_cfg.bus_speed = board_cfg.processor_speed;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -