Author: wmb Date: Fri Aug 17 01:27:49 2012 New Revision: 3187 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3187
Log: OLPC ARM - Added I2C GPIO device nodes.
Modified: cpu/arm/mmp2/gpio.fth cpu/arm/mmp2/twsi.fth cpu/arm/olpc/1.75/gpiopins.fth cpu/arm/olpc/cl4/gpiopins.fth dev/olpc/dcon/mmp2dcon.fth dev/olpc/mmp2camera/platform.fth
Modified: cpu/arm/mmp2/gpio.fth ============================================================================== --- cpu/arm/mmp2/gpio.fth Fri Aug 17 01:27:02 2012 (r3186) +++ cpu/arm/mmp2/gpio.fth Fri Aug 17 01:27:49 2012 (r3187) @@ -78,10 +78,38 @@ h# 108 make-gpio-mux-node end-package
+: encode-gpio ( propval$ gpio# low? -- propval$' ) + >r >r ( propval$ r: low? gpio# ) + " /gpio" encode-phandle encode+ ( propval$' r: low? gpio# ) + r> encode-int encode+ ( propval$' r: low? ) + r> encode-int encode+ ( propval$' ) +; + : gpio-property ( gpionum low? gpioname$ -- ) - 2>r swap ( low? gpionum r: gpioname$ ) - " /gpio" encode-phandle ( low? gpionum propval$ r: gpioname$ ) - rot encode-int encode+ ( low? propval$' r: gpioname$ ) - rot encode-int encode+ ( propval$' r: gpioname$ ) + 2>r 2>r ( r: gpioname$ gpionum low? ) + 0 0 encode-bytes ( propval$ r: gpioname$ gpionum low? ) + 2r> encode-gpio ( propval$' r: gpioname$ ) 2r> property ( ) ; + +dev / + new-device + " camera-i2c" device-name + " i2c-gpio" +compatible + + 0 0 encode-bytes + cam-sda-gpio# 0 encode-gpio + cam-scl-gpio# 0 encode-gpio + " gpios" property + finish-device + + new-device + " dcon-i2c" device-name + " i2c-gpio" +compatible + + 0 0 encode-bytes + dcon-sda-gpio# 0 encode-gpio + dcon-scl-gpio# 0 encode-gpio + " gpios" property + finish-device +device-end
Modified: cpu/arm/mmp2/twsi.fth ============================================================================== --- cpu/arm/mmp2/twsi.fth Fri Aug 17 01:27:02 2012 (r3186) +++ cpu/arm/mmp2/twsi.fth Fri Aug 17 01:27:49 2012 (r3187) @@ -188,7 +188,7 @@
\ baseadr clk irq mux? fast? unit# h# d4011000 1 7 false true 2 make-twsi-node \ TWSI1 -\ h# d4031000 2 0 true true N make-twsi-node \ TWSI2 + h# d4031000 2 0 true true 3 make-twsi-node \ TWSI2 \ h# d4032000 3 1 true true N make-twsi-node \ TWSI3 h# d4033000 4 2 true true 0 make-twsi-node \ TWSI4 \ h# d4038000 d# 30 3 true true N make-twsi-node \ TWSI5 @@ -226,6 +226,12 @@ my-address my-space 1 reg end-package
+0 0 " 68" " /i2c@d4031000" begin-package \ TWSI2 + " rtc" name + " idt,idt1338-rtc" +compatible + my-address my-space 1 reg +end-package + 0 0 " " " /" begin-package " twsi" name
Modified: cpu/arm/olpc/1.75/gpiopins.fth ============================================================================== --- cpu/arm/olpc/1.75/gpiopins.fth Fri Aug 17 01:27:02 2012 (r3186) +++ cpu/arm/olpc/1.75/gpiopins.fth Fri Aug 17 01:27:49 2012 (r3187) @@ -15,6 +15,9 @@ d# 161 constant dcon-scl-gpio# d# 110 constant dcon-sda-gpio#
+d# 100 constant dcon-stat0-gpio# +d# 101 constant dcon-stat1-gpio# + d# 124 constant dcon-irq-gpio# d# 142 constant dcon-load-gpio#
Modified: cpu/arm/olpc/cl4/gpiopins.fth ============================================================================== --- cpu/arm/olpc/cl4/gpiopins.fth Fri Aug 17 01:27:02 2012 (r3186) +++ cpu/arm/olpc/cl4/gpiopins.fth Fri Aug 17 01:27:49 2012 (r3187) @@ -15,6 +15,9 @@ d# 168 constant dcon-scl-gpio# d# 167 constant dcon-sda-gpio#
+d# 100 constant dcon-stat0-gpio# +d# 101 constant dcon-stat1-gpio# + d# 126 constant dcon-irq-gpio# d# 142 constant dcon-load-gpio#
Modified: dev/olpc/dcon/mmp2dcon.fth ============================================================================== --- dev/olpc/dcon/mmp2dcon.fth Fri Aug 17 01:27:02 2012 (r3186) +++ dev/olpc/dcon/mmp2dcon.fth Fri Aug 17 01:27:49 2012 (r3187) @@ -18,6 +18,21 @@ " OLPC DCON panel" model : +i encode-int encode+ ;
+ 0 0 encode-bytes + dcon-stat0-gpio# 0 encode-gpio + dcon-stat1-gpio# 0 encode-gpio + dcon-load-gpio# 0 encode-gpio + dcon-irq-gpio# 0 encode-gpio + " gpios" property + + " stat0" encode-string + " stat1" encode-string encode+ + " load" encode-string encode+ + " irq" encode-string encode+ + " gpio-names" property + + " /dcon-i2c" encode-phandle " i2c-parent" property + decimal 0 0 encode-bytes \ xres, yres, refresh, clockhz, left, right, top, bottom, hsync, vsync, flags, widthmm, heightmm
Modified: dev/olpc/mmp2camera/platform.fth ============================================================================== --- dev/olpc/mmp2camera/platform.fth Fri Aug 17 01:27:02 2012 (r3186) +++ dev/olpc/mmp2camera/platform.fth Fri Aug 17 01:27:49 2012 (r3187) @@ -4,6 +4,8 @@ headers hex
+" /camera-i2c" encode-phandle " i2c-parent" property + 0 value camera-smb-slave : camera-smb-setup ( -- ) 1 to smb-dly-us