[PATCH] qi: initialize PMU GPIOs

Joerg Reisenweber joerg at openmoko.org
Sat Jan 24 14:52:08 CET 2009


Am Sa  24. Januar 2009 schrieb Andy Green:
> Somebody in the thread at some point said:
> | Werner Almesberger <werner at openmoko.org> writes:
> |> thanks for reporting this critter. Can you please test the patch
> |> below ?
> |
> | I originally discovered this issue and can confirm that the patch
> | works. Kernel sysfs driver is still not exactly correct though, as it
> | sets 0x15 to 0x01 (reserved) instead of 0x07 (fixed 1).
> 
> Maybe we can fix that and add a Reported-by: for Paul, otherwise it
> looks like a good bugfix.
> 
> Another issue though is that for determinism, really the kernel driver
> should arguably assert all the needed state for the default at kernel
> startup and not leave it to be inherited by the bootloader as we have
> previously done.  Really the defaults in hardware should be designed to
> be sane already (ie, pull that line down not up) so the bootloader is
> not involved.
> 
> -Andy
> 

As I mentioned to Paul and Werner on IRC, bootloader *must* set PMU-GPIO2 to 
low [for security reasons (airplane) and keeping 100mA boot current limit].
Nevertheless kernel shouldn't rely on this, but instead should do again set to 
default low on boottime [by asserting *all* needed settings: 
13h.1:1   GPIOCTL - gpio2dir = 0b ["output". PCF50633UM2.00.pdf,p.34, tbl.29]
15h.2:0  GPIO2CFG - gpio2sel = 000b ["fixed zero". p.34, tbl.31]
15h.3:3  GPIO2CFG - gpio2pol = 0b ["no inversion". ditto]

Similarly when enabling GSM_ON power for calypso, sysfs driver should not rely 
on any prev settings, but instead write gpio2dir, gpio2sel, gpio2pol 
accordingly.
Also to handle powerup in a sensible way, it seems to me sysfs driver should 
use he following sequence:

[2009-01-24 09:05:17] <DocScrutinizer> 
apply power (via GSM_ON, U1705) and 
assert modem-reset (to be found on gta01 only?). 
Wait for reset to complete (mwait(xyz)). 
deassert modem-reset. 
wait again some 100ms. 
assert MODEM_ON pushbutton of calypso (this is literally a power puhbutton 
input). 
wait for time needed by calypso to sense this button pressed and power up 
(might well be some seconds). 
deassert button aka MODEM_ON

[2009-01-24 09:05:51] <DocScrutinizer> PaulFertser: would you agree sysfs 
isn't exactly doing this right now?



For power down via sysfs, it should be regarded there are two different ways 
with different semantics to shut down a GSM-MT:
*soft* (= send "AT at POWEROFF", wait for modem to deregister with network, 
GSM_ON = low)
*hard* (= set GSM_ON=low unconditionally and immediately)




AFAIK Paul is working on this sysfs patch right now, so no need for Werner or 
Andy to duplicate this work right away :)


cheers
jOERG
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20090124/5b573825/attachment.pgp 


More information about the openmoko-kernel mailing list