[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

call for help: CPU clock speed on PowerBook5,6


as indicated by my previous postings I am trying to find out why
Ben's cpuspeed patch [1] crashes my powerbook.  An updated description about
my machine can be found at [2].

  [1] http://lists.debian.org/debian-powerpc/2005/03/msg00554.html
  [2] http://seehuhn.de/comp/powerbook/

The problem: without the patch from [1] the laptop only runs at 833MHz
instead of the advertised 1.67GHz.  With the patch the laptop hangs
early during boot.

Switching the clock speed internally consists of 2 steps: using some
GPIO to change the processor power and then toggling a bit in the
cpu's HID1 register to change the clock multiplyer.  This is done in
the 'dfs_set_cpu_speed' function in arch/ppc/platform/pmac_cpufreq.c,
which uses the calls

    pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, ...)



to do the work.  The low_choose_744a_dfs function is defined in
arch/ppc/kernel/misc.S and uses the command 'mtspr SPRN_HID1,r4'
to toggle bit 9 in the HID1 register.

What I tried:

1) Applying Ben's patch unchanged -> machine hangs during boot

2) Applying Ben's patch and changing the waiting time
  after the pmac_call_feature from 'msleep(1)' to 'msleep(10)'.
  the machine hangs during boot

3) Applying Ben's patch but ignoring the first few calls to
  'dfs_set_cpu_speed' -> the machine hangs during the first non
  ignored call which tries to change to high clock speed.  Performing
  the switch to low clock speed while the machine actually is running on
  the lower clock "works" (i.e. no crash).
  This shows that it is not a problem of using facilities which are
  only initialised later during boot.

4) Applying Ben's patch but commenting out the 'mtspr
  SPRN_HID1,r4' line in 'low_choose_744a_dfs' -> everything "works"
  but of course the machine is never really switched to high CPU

  Reading /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq gives the
  kernel warning

    CPU frequency out of sync: cpufreq and timing core thinks of 1666666, is 833333 kHz.

  This shows that the crash is not caused by the voltage switching.

5) The result of pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, voltage_gpio, 0)
  seems to be always zero.  Does this indicate a problem?

The only explanation I can think of is, that the voltage switching somehow
fails and that then the CPU sulks when it is switch to high speed while on
derated voltage.  Does this make sense?

My questions:

1) It seems that writing 5 into the register mean full voltage and and
  writing 4 means derated voltage.  Is there some documentation about
  the GPIO?  How long does one have to wait after setting the voltage?
  Should I be able to read back the current value using

2) Did anybody else manage to run a post February 2005 Powerbook on
  full CPU speed?

3) Can anybody think of another way to debug this problem?  Are there
  other potential causes for the crash?

Many thanks,

Attachment: signature.asc
Description: Digital signature

Reply to: