[openfirmware] [commit] r3235 - in dev/olpc: . mmp2camera

repository service svn at openfirmware.info
Wed Aug 29 02:12:35 CEST 2012


Author: wmb
Date: Wed Aug 29 02:12:35 2012
New Revision: 3235
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3235

Log:
OLPC ARM - Set reg and compatible properties in the /image-sensor node dynamically, by probing for the specific chip that is present.  This requires the assistance of the camera driver, because the image sensor won't respond to its I2C bus unless it has a clock from the CCIC camera unit.

Modified:
   dev/olpc/imagesensor.fth
   dev/olpc/mmp2camera/loadpkg.fth
   dev/olpc/ov7670.fth
   dev/olpc/seti.fth

Modified: dev/olpc/imagesensor.fth
==============================================================================
--- dev/olpc/imagesensor.fth	Wed Aug 29 02:10:05 2012	(r3234)
+++ dev/olpc/imagesensor.fth	Wed Aug 29 02:12:35 2012	(r3235)
@@ -12,3 +12,21 @@
 : sensor-found?  ( -- flag )
    false
 ;
+: set-sensor-properties  ( name$ i2c-addr -- )
+   my-self >r  0 to my-self
+   " /image-sensor" find-device  ( name$ i2c-addr )
+      " reg" get-property  if    ( name$ i2c-addr )
+         1 reg                   ( name$ )
+         +compatible             ( )
+      else                       ( name$ i2c-addr regval$ )
+         2drop 3drop             ( )
+      then
+   device-end
+   r> to my-self
+;
+
+also forth definitions
+: probe-image-sensor  ( -- )
+   " /camera" open-dev close-dev
+;
+previous definitions

Modified: dev/olpc/mmp2camera/loadpkg.fth
==============================================================================
--- dev/olpc/mmp2camera/loadpkg.fth	Wed Aug 29 02:10:05 2012	(r3234)
+++ dev/olpc/mmp2camera/loadpkg.fth	Wed Aug 29 02:12:35 2012	(r3235)
@@ -10,6 +10,8 @@
       cam-rst-gpio# 0 encode-gpio
    " gpios" property
 
+   " /image-sensor" encode-phandle  " image-sensor" property
+
 0 [if]
    : alloc-capture-buffer  ( len -- vadr padr )
       \ XXX need map-in if we should use virtual mode

Modified: dev/olpc/ov7670.fth
==============================================================================
--- dev/olpc/ov7670.fth	Wed Aug 29 02:10:05 2012	(r3234)
+++ dev/olpc/ov7670.fth	Wed Aug 29 02:12:35 2012	(r3235)
@@ -166,6 +166,7 @@
    then                         ( )
 
    " OV7670" " sensor" string-property
+   " omnivision,ov7670" camera-smb-slave set-sensor-properties
 
    ['] ov7670-set-mirrored to set-mirrored
    ['] ov7670-config       to camera-config

Modified: dev/olpc/seti.fth
==============================================================================
--- dev/olpc/seti.fth	Wed Aug 29 02:10:05 2012	(r3234)
+++ dev/olpc/seti.fth	Wed Aug 29 02:12:35 2012	(r3235)
@@ -306,6 +306,7 @@
    h# 12 <>  if  false exit  then  ( )
 
    " SETi,SIV120D" " sensor" string-property
+   " seti,siv120d" camera-smb-slave set-sensor-properties
 
    ['] seti-set-mirrored to set-mirrored
    ['] seti-config       to camera-config



More information about the openfirmware mailing list