mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-12-23 16:24:16 +02:00
qi-fix-compute-GTA03-pcb-rev-backwards.patch
Hm the revision bit ordering is backwards... oh well Signed-off-by: Christopher Hall <hsw@openmoko.com>
This commit is contained in:
parent
d80dd5b880
commit
31fe321be5
@ -808,11 +808,20 @@ void port_init_gta03(void)
|
|||||||
int gta03_get_pcb_revision(void)
|
int gta03_get_pcb_revision(void)
|
||||||
{
|
{
|
||||||
u32 v = __REG(GPIDAT);
|
u32 v = __REG(GPIDAT);
|
||||||
|
/*
|
||||||
|
* PCB rev is 3 bit code (info from Dkay)
|
||||||
|
* (b2, b1, b0) = (0,0,1) => pcb rev A1
|
||||||
|
* maximum rev = A7
|
||||||
|
* bit0 = GPI8
|
||||||
|
* bit1 = GPI1
|
||||||
|
* bit2 = GPI0
|
||||||
|
*/
|
||||||
|
|
||||||
return (v & (1 << 8)) >> (8 - 2) |
|
return (
|
||||||
(v & (1 << 1)) >> 0 |
|
((v & (1 << 8)) ? 1 : 0) |
|
||||||
(v & (1 << 0)) >> 0
|
((v & (1 << 1)) ? 2 : 0) |
|
||||||
;
|
((v & (1 << 0)) ? 4 : 0)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct board_variant const * get_board_variant_gta03(void)
|
const struct board_variant const * get_board_variant_gta03(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user