Author: wmb Date: Sat Nov 24 01:34:03 2012 New Revision: 3457 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3457
Log: XO-4 - Additional SMBUS functions for HDMI EDID reading.
Modified: cpu/arm/olpc/smbus.fth
Modified: cpu/arm/olpc/smbus.fth ============================================================================== --- cpu/arm/olpc/smbus.fth Sat Nov 24 01:33:25 2012 (r3456) +++ cpu/arm/olpc/smbus.fth Sat Nov 24 01:34:03 2012 (r3457) @@ -128,6 +128,29 @@ smb-stop ( ) ;
+: smb-read ( adr len reg# -- ) + over 0= if 3drop exit then ( adr len reg# ) + smb-start ( adr len reg# ) + 0 smb-addr ( adr len reg# ) + smb-byte ( adr len ) + smb-stop smb-start \ SCCB bus needs a stop and a start for the second phase + 1 smb-addr ( adr len ) + 2dup bounds ?do ( adr len ) + 0 smb-byte-in i c! ( adr len ) + loop ( adr len ) + 1 smb-byte-in -rot ( byte adr len ) + 1- + c! ( ) + smb-stop ( ) +; + +: smb-write ( adr len reg# -- ) + smb-start ( adr len reg# ) + 0 smb-addr ( adr len reg# ) + smb-byte ( adr len ) + bounds ?do i c@ smb-byte loop ( ) + smb-stop ( ) +; + : smb-word! ( word reg# -- ) smb-start 0 smb-addr ( word reg# )
openfirmware@openfirmware.info