Author: wmb Date: 2009-11-04 12:02:54 +0100 (Wed, 04 Nov 2009) New Revision: 1458
Modified: cpu/x86/pc/olpc/via/versions.fth dev/mmc/sdhci/sdhcixo.bth dev/olpc/dcon/viadcon.fth Log: OLPC trac 9489 - implement SD port reassignments and DCONINT GPIO change for B3 build.
Modified: cpu/x86/pc/olpc/via/versions.fth =================================================================== --- cpu/x86/pc/olpc/via/versions.fth 2009-11-03 22:12:32 UTC (rev 1457) +++ cpu/x86/pc/olpc/via/versions.fth 2009-11-04 11:02:54 UTC (rev 1458) @@ -2,7 +2,7 @@
\ The overall firmware revision macro: FW_MAJOR A -macro: FW_MINOR 15 +macro: FW_MINOR 15b
\ The EC microcode macro: EC_VERSION 1_9_14
Modified: dev/mmc/sdhci/sdhcixo.bth =================================================================== --- dev/mmc/sdhci/sdhcixo.bth 2009-11-03 22:12:32 UTC (rev 1457) +++ dev/mmc/sdhci/sdhcixo.bth 2009-11-04 11:02:54 UTC (rev 1458) @@ -13,7 +13,10 @@ init
: populate-children ( -- ) - " atest?" evaluate if + " board-revision" evaluate ( boardrev ) + + dup h# d10 < if \ A1 and A2 + drop new-device 2 encode-int " reg" property " sdmmc" " $load-driver" eval drop @@ -23,24 +26,49 @@ 1 encode-int " reg" property " mv8686" " $load-driver" eval drop finish-device - else + exit + then + + dup h# d28 >= if \ B3 and greater + drop + new-device 1 encode-int " reg" property " sdmmc" " $load-driver" eval drop - " internal" " slot-name" string-property + " external" " slot-name" string-property finish-device
new-device 2 encode-int " reg" property - " sdmmc" " $load-driver" eval drop - " external" " slot-name" string-property + " mv8686" " $load-driver" eval drop finish-device
new-device 3 encode-int " reg" property - " mv8686" " $load-driver" eval drop + " sdmmc" " $load-driver" eval drop + " internal" " slot-name" string-property finish-device then + + \ B1,B2 + drop + + new-device + 1 encode-int " reg" property + " sdmmc" " $load-driver" eval drop + " internal" " slot-name" string-property + finish-device + + new-device + 2 encode-int " reg" property + " sdmmc" " $load-driver" eval drop + " external" " slot-name" string-property + finish-device + + new-device + 3 encode-int " reg" property + " mv8686" " $load-driver" eval drop + finish-device ;
populate-children
Modified: dev/olpc/dcon/viadcon.fth =================================================================== --- dev/olpc/dcon/viadcon.fth 2009-11-03 22:12:32 UTC (rev 1457) +++ dev/olpc/dcon/viadcon.fth 2009-11-04 11:02:54 UTC (rev 1458) @@ -28,10 +28,12 @@ \ h# 4000 constant DM_DEBUG \ h# 8000 constant DM_SELFTEST
+: b3+? ( -- flag ) board-revision h# d28 >= ; + \ Enable SMBALRT# IRQ as DCON IRQ -: dcon-enable-irq ( -- ) 8 8 smb-reg! ; +: dcon-enable-irq ( -- ) b3+? if exit then 8 8 smb-reg! ; \ Disable SMBALRT# IRQ as DCON IRQ; leaving it enabled causes spurious S3 wakeups -: dcon-disable-irq ( -- ) 0 8 smb-reg! ; +: dcon-disable-irq ( -- ) b3+? if exit then 0 8 smb-reg! ;
: dcon-load ( -- ) atest? if @@ -49,8 +51,8 @@ ; : dcon-blnk? ( -- flag ) h# 4a acpi-b@ 4 and 0<> ; : dcon-stat@ ( -- n ) h# 4b acpi-b@ 3 and ; -: dcon-irq? ( -- flag ) 1 smb-reg@ h# 20 and 0<> ; -: dcon-clr-irq ( -- ) h# 20 1 smb-reg! ; +: dcon-irq? ( -- flag ) b3+? if 4a acpi-b@ h# 40 else 1 smb-reg@ h# 20 then and 0<> ; +: dcon-clr-irq ( -- ) b3+? if exit then h# 20 1 smb-reg! ;
\ DCONSTAT values: 0 SCANINT 1 SCANINT_DCON 2 DISPLAYLOAD 3 MISSED
@@ -72,15 +74,16 @@
: wait-dcon-mode ( -- ) dcon-enable-irq - d# 100 ms-factor * tsc@ drop + ( end-time ) + 8 acpi-l@ d# 357,955 + ( end-time ) \ 100 ms timeout begin ( end-time ) dcon-irq? if dcon-disable-irq dcon-stat@ dcon-clr-irq 2 = if \ DCONSTAT=10 drop exit then + dcon-enable-irq then - dup tsc@ drop - 0< ( end-time reached? ) + dup 8 acpi-l@ - 0< ( end-time reached? ) until ( end-time ) drop dcon-disable-irq @@ -195,46 +198,6 @@ 1 set-source \ Unfreeze image ;
-0 [if] -dconstat dconblnk or dconirq or constant in-gpios -dconload constant out-gpios - -: dcon-gpio-init ( -- ) - out-gpios in-gpios wljoin OUT_EN gpio! - in-gpios out-gpios wljoin IN_EN gpio! - - dconirq >set INV_EN gpio! - - dconirq dconblnk or ( events ) - -\ Linux doesn't want me to turn these on -\ dup >set EVNT_EN gpio! -\ dup >set IN_FLTR_EN gpio! \ Enable counter for GPIO7 (DCONIRQ) -\ dup >clr EVNTCNT_EN gpio! -\ d# 12 gpio-base h# f7 + rb! \ GPIO_FE7_SEL -\ dup >clr h# 44 gpio! \ NEGEDGE_EN - -\ 0 gpio-base h# d8 + rw! \ GPIO_FLTR7_AMNT - - h# e0 gpio@ h# 0fff.ffff and h# 2000.0000 or h# e0 gpio! \ p512 Map X - h# e4 gpio@ h# fff0.ffff and h# 0000.0000 or h# e4 gpio! \ p511 Map Y - -[ifdef] dcon-interrupts - h# 5140.0023 rdmsr ( lo hi ) drop ( lo ) - h# ff0f.fffff and h# 0050.0000 or 0 wrmsrl \ p 381 unrestricted Z - 0 h# 4d0 pc! \ IRQs 0-7 edge sensitive -[then] - - ( events ) - dup >set IN_EN gpio! - >set h# 4c gpio! \ GPIOL_NEGEDGE_STS - clear detected edges - - dcon-load - - \ ['] dcon-interrupt 5 request_irq -; -[then] - 0 value dcon-found?
d# 440 8 / constant dcon-flag