Changeset 3005


Ignore:
Timestamp:
Jun 9, 2012, 5:53:59 AM (3 years ago)
Author:
quozl
Message:

OLPC XO-1.75 - banner, calculate and display actual processor core frequency instead of only displaying what the processor fuses say.

Location:
cpu/arm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/mmp2/clocks.fth

    r2993 r3005  
    3939   h#      4000 h#   24 +mpmu io-set  \ APMU_PLL2 in PMUM_CGR_SP
    4040;
     41: pll2-ungated?  ( -- flag )
     42   h#      4000 h# 1024 +mpmu io@  and
     43;
     44: pll2-fbdiv  ( -- N )  h# 34 mpmu@ d# 10 rshift h# 1ff and  2+  ;
     45: pll2-refdiv  ( -- M )  h# 34 mpmu@ d# 19 rshift h# 1f and  2+  ;
    4146
    4247: fccr@    ( -- n )  h# 05.0008 io@  ;
     
    4651   fccr@  h# e000.0000 invert and  or  fccr!  ( )
    4752;
     53: pj4-clksel@  ( -- n )
     54   fccr@  h# e000.0000 and  d# 29 rshift
     55;
     56
    4857: sp-clksel  ( n -- )
    4958   d# 26 lshift                               ( field )
    5059   fccr@  h# 1c00.0000 invert and  or  fccr!  ( )
    5160;
     61
    5262: pj4-cc!  ( n -- )  h# 28.2804 io!  ;
     63: pj4-cc@  ( -- n )  h# 28.2804 io@  ;
     64: pj4-clkdiv  ( -- n )  pj4-cc@  h# 7  and  ;
    5365
    5466: sp-cc!     ( n -- )  h# 28.2800 io!  ;
     
    7890: pj4-988mhz ( -- )  set-pll2-988mhz 2 pj4-clksel  o# 21742201100 pj4-cc!  ;  \ A 266, D 400, XP 400, B 400, P 988
    7991[then]
     92
     93: pj4-speed  ( -- frequency )
     94   pj4-clksel@
     95   case
     96      0  of  d# 400,000,000 pj4-clkdiv 1+ /            endof  ( hz )
     97      1  of  d# 800,000,000                            endof  ( hz )
     98      2  of  d#  26,000,000 pll2-fbdiv pll2-refdiv */  endof  ( hz )
     99   endcase
     100   d# 1,000,000 /                                             ( mhz )
     101;
     102\ FIXME: should be a property clock-frequency of /cpu@0
  • cpu/arm/olpc/banner.fth

    r3003 r3005  
    120120
    121121: .cpu-speed  ( -- )
    122    rated-speed  case
    123       0 of  ." 800 MHz"  endof
    124       1 of  ." 910 MHz"  endof
    125             ." 1 GHz"
    126    endcase
     122   pj4-speed
     123   dup d# 988 =  if ." 1 GHz" else .d ." MHz" then
    127124;
     125
    128126: .memory-brief  ( -- )
    129127   memory-size dup d# 1024 / ?dup  if  ( mb gb )
  • cpu/arm/olpc/build-fw.fth

    r2993 r3005  
    568568;
    569569
     570fload ${BP}/cpu/arm/mmp2/clocks.fth
    570571fload ${BP}/cpu/arm/olpc/banner.fth
    571572
     
    967968\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/testinstructions.fth
    968969
    969 fload ${BP}/cpu/arm/mmp2/clocks.fth
    970 
    971970: startup  ( -- )
    972971   standalone?  0=  if  exit  then
Note: See TracChangeset for help on using the changeset viewer.