boardcfg.c

来自「Ibmstb02500 miniboot 源码」· C语言 代码 · 共 64 行

C
64
字号
/* openbios/arch/pallas/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 Pallas 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 processor speed is 4x as the bus 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;       }       temp_value = PROC_CLOCK * Mult * RangeA / RangeB ;       board_cfg.processor_speed = temp_value / 2;       HSMC_speed                = temp_value / 4;       board_cfg.bus_speed       = temp_value / 8;       Ticks_per_sec = BOARD_CLOCK;  // board_cfg.bus_speed;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?