Author: quozl Date: Mon Oct 29 21:37:21 2012 New Revision: 3393 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3393
Log: OLPC ARM - assign "0 0 reg" properties to several devices
when linux names devices, devices without a reg property will get a globally assigned incrementing suffix, which may change depending on which devices are configured. if present, linux will use the reg property to create a stable name for a device. using "0 0 reg" will result in a linux name like "0.ols"
from Paul Fox pgf@laptop.org
Modified: cpu/arm/olpc/cl4/leds.fth cpu/arm/olpc/gpio-i2c.fth cpu/arm/olpc/sound.fth
Modified: cpu/arm/olpc/cl4/leds.fth ============================================================================== --- cpu/arm/olpc/cl4/leds.fth Mon Oct 29 21:34:26 2012 (r3392) +++ cpu/arm/olpc/cl4/leds.fth Mon Oct 29 21:37:21 2012 (r3393) @@ -4,6 +4,7 @@ 0 0 " " " /" begin-package " ols" device-name " olpc,xo-light-sensor" +compatible + 0 0 reg \ So linux will assign a static device name end-package
0 0 " 0" " /" begin-package
Modified: cpu/arm/olpc/gpio-i2c.fth ============================================================================== --- cpu/arm/olpc/gpio-i2c.fth Mon Oct 29 21:34:26 2012 (r3392) +++ cpu/arm/olpc/gpio-i2c.fth Mon Oct 29 21:37:21 2012 (r3393) @@ -34,6 +34,9 @@ " i2c-gpio" +compatible 1 " #address-cells" integer-property 1 " #size-cells" integer-property + + 0 0 reg \ So linux will assign a static device name + : encode-unit ( phys.. -- str ) push-hex (u.) pop-base ; : decode-unit ( str -- phys.. ) push-hex $number if 0 then pop-base ;
@@ -76,6 +79,9 @@ " i2c-gpio" +compatible 1 " #address-cells" integer-property 1 " #size-cells" integer-property + + 0 0 reg \ So linux will assign a static device name + : encode-unit ( phys.. -- str ) push-hex (u.) pop-base ; : decode-unit ( str -- phys.. ) push-hex $number if 0 then pop-base ;
Modified: cpu/arm/olpc/sound.fth ============================================================================== --- cpu/arm/olpc/sound.fth Mon Oct 29 21:34:26 2012 (r3392) +++ cpu/arm/olpc/sound.fth Mon Oct 29 21:37:21 2012 (r3393) @@ -759,6 +759,8 @@ \ The name that was hardcoded in the Linux driver was OLPC XO-1.75 " OLPC XO" " model" string-property
+ 0 0 reg \ So linux will assign a static device name + : +string encode-string encode+ ;
0 0 encode-bytes