[openfirmware] [commit] r3023 - cpu/arm cpu/arm/mmp2 cpu/arm/olpc cpu/arm/olpc/1.75 dev/olpc/kb3700 dev/olpc/mmp2camera ofw/core

repository service svn at openfirmware.info
Fri Jun 29 23:04:14 CEST 2012


Author: wmb
Date: Fri Jun 29 23:04:07 2012
New Revision: 3023
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3023

Log:
OLPC ARM - omnibus checkin of device tree additions to support the conversion of the XO Linux kernel to use the device tree.

Added:
   cpu/arm/mmp2/apbc.fth
   cpu/arm/mmp2/pmua.fth
Modified:
   cpu/arm/linux.fth
   cpu/arm/mmp2/devices.fth
   cpu/arm/mmp2/gpio.fth
   cpu/arm/mmp2/irq.fth
   cpu/arm/mmp2/mfpr.fth
   cpu/arm/mmp2/spimaster.fth
   cpu/arm/mmp2/timer.fth
   cpu/arm/mmp2/twsi.fth
   cpu/arm/mmp2/uart.fth
   cpu/arm/olpc/1.75/usb.fth
   cpu/arm/olpc/build-fw.fth
   cpu/arm/olpc/rtc.fth
   cpu/arm/olpc/sdhci.fth
   cpu/arm/olpc/sdregs.fth
   cpu/arm/olpc/sound.fth
   cpu/arm/olpc/spcmd.fth
   dev/olpc/kb3700/spicmd.fth
   dev/olpc/mmp2camera/loadpkg.fth
   ofw/core/fdt.fth

Modified: cpu/arm/linux.fth
==============================================================================
--- cpu/arm/linux.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/linux.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -104,6 +104,7 @@
    arm-linux-machine-type to r1
 [ifdef] flatten-device-tree
    use-fdt?  if
+      load-base h# 40000 - to linux-params
       linux-params h# 40000 flatten-device-tree
    else
       args-buf cscount linux-params set-parameters

Added: cpu/arm/mmp2/apbc.fth
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ cpu/arm/mmp2/apbc.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -0,0 +1,90 @@
+0 0  " "  " /" begin-package
+" apbc" name
+" mrvl,pxa-apbc" +compatible
+" mrvl,mmp2-apbc" +compatible
+
+h# d4015000 h# 1000 reg
+1 " #clock-cells" integer-property
+
+: +string  encode-string encode+  ;
+
+0 0 encode-bytes
+" RTC"       +string  \ 00
+" TWSI1"     +string  \ 01
+" TWSI2"     +string  \ 02
+" TWSI3"     +string  \ 03
+" TWSI4"     +string  \ 04
+" ONEWIRE"   +string  \ 05
+" KPC"       +string  \ 06
+" TB_ROTARY" +string  \ 07
+" SW_JTAG"   +string  \ 08
+" TIMERS1"   +string  \ 09
+" UART1"     +string  \ 10
+" UART2"     +string  \ 11
+" UART3"     +string  \ 12
+" GPIO"      +string  \ 13
+" PWM0"      +string  \ 14
+" PWM1"      +string  \ 15
+" PWM2"      +string  \ 16
+" PWM3"      +string  \ 17
+" SSP0"      +string  \ 18
+" SSP1"      +string  \ 19
+" SSP2"      +string  \ 20
+" SSP3"      +string  \ 21
+" SSP4"      +string  \ 22
+" SSP5"      +string  \ 23
+" AIB"       +string  \ 24
+" ASFAR"     +string  \ 25
+" ASSAR"     +string  \ 26
+" USIM"      +string  \ 27
+" MPMU"      +string  \ 28
+" IPC"       +string  \ 29
+" TWSI5"     +string  \ 30
+" TWSI6"     +string  \ 31
+" UART4"     +string  \ 32
+" RIPC"      +string  \ 33
+" THSENS1"   +string  \ 34
+" clock-output-names" property
+
+: +int  encode-int encode+ ;
+
+0 0 encode-bytes
+\  offset      clr-mask    value       rate
+h# 00 +int  h# f7 +int  h# 87 +int  d#     32,768 +int  \ 00 RTC
+h# 04 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 01 TWSI1
+h# 08 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 02 TWSI2
+h# 0c +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 03 TWSI3
+h# 10 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 04 TWSI4
+h# 14 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 05 ONEWIRE
+h# 18 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 06 KPC
+h# 1c +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 07 TB_ROTARY
+h# 20 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 08 SW_JTAG
+h# 24 +int  h# 77 +int  h# 17 +int  d#  6,500,000 +int  \ 09 TIMERS1
+h# 2c +int  h# 77 +int  h# 17 +int  d# 26,000,000 +int  \ 10 UART1
+h# 30 +int  h# 77 +int  h# 17 +int  d# 26,000,000 +int  \ 11 UART2
+h# 34 +int  h# 77 +int  h# 17 +int  d# 26,000,000 +int  \ 12 UART3
+h# 38 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 13 GPIO
+h# 3c +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 14 PWM0
+h# 40 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 15 PWM1
+h# 44 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 16 PWM2
+h# 48 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 17 PWM3
+h# 4c +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 18 SSP0
+h# 50 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 19 SSP1
+h# 54 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 20 SSP2
+h# 58 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 21 SSP3
+h# 5c +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 22 SSP4
+h# 60 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 23 SSP5
+h# 64 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 24 AIB
+h# 68 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 25 ASFAR
+h# 6c +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 26 ASSAR
+h# 70 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 27 USIM
+h# 74 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 28 MPMU
+h# 78 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 29 IPC
+h# 7c +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 30 TWSI5
+h# 80 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 31 TWSI6
+h# 88 +int  h# 77 +int  h# 17 +int  d# 26,000,000 +int  \ 32 UART4
+h# 8c +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 33 RIPC
+h# 90 +int  h# 77 +int  h#  7 +int  d# 26,000,000 +int  \ 34 THSENS1
+" clock-enable-registers" property
+
+end-package

Modified: cpu/arm/mmp2/devices.fth
==============================================================================
--- cpu/arm/mmp2/devices.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/mmp2/devices.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -70,6 +70,7 @@
 
 0 0  " d4018000"  " /" begin-package  \ UART3
    fload ${BP}/cpu/arm/mmp2/uart.fth
+   d# 24 " interrupts" integer-property
 end-package
 devalias com1 /uart
 : com1  " com1"  ;

Modified: cpu/arm/mmp2/gpio.fth
==============================================================================
--- cpu/arm/mmp2/gpio.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/mmp2/gpio.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -39,3 +39,42 @@
 : >gpio-xmsk     ( gpio# -- mask pa )  >gpio-pin h# a8 +  ;
 : gpio-set-xmsk ( gpio# -- )  >gpio-xmsk tuck io@  or  swap io!  ;
 : gpio-clr-xmsk ( gpio# -- )  >gpio-xmsk tuck io@  swap invert and  swap io!  ;
+
+\ See <Linux> Documentation/devicetree/bindings/gpio/mrvl-gpio.txt
+0 0  " d4019000" " /" begin-package
+   " gpio" name
+
+   " mrvl,mmp-gpio" encode-string
+   " mrvl,pxa-gpio" encode-string encode+  " compatible" property
+
+   my-address my-space  h# 1000 reg
+
+   d# 49  encode-int  " interrupts" property
+   " gpio_mux"  " interrupt-names" string-property
+   " " " gpio-controller" property
+   3 " #gpio-cells" integer-property
+   " " " interrupt-controller" property
+   1 " #interrupt-cells" integer-property
+
+   " /apbc" encode-phandle d# 13 encode-int encode+ " clocks" property
+   " GPIO" " clock-names" string-property
+
+
+   1 " #address-cells" integer-property
+   1 " #size-cells" integer-property
+   : encode-unit  ( phys.. -- str )  push-hex (u.) pop-base  ;
+   : decode-unit  ( str -- phys.. )  push-hex  $number  if  0  then  pop-base  ;
+
+   : make-gpio-mux-node  ( offset -- )
+      new-device
+      " gpio" name
+      4 reg
+      finish-device
+   ;
+   h#  00 make-gpio-mux-node
+   h#  04 make-gpio-mux-node
+   h#  08 make-gpio-mux-node
+   h# 100 make-gpio-mux-node
+   h# 104 make-gpio-mux-node
+   h# 108 make-gpio-mux-node
+end-package

Modified: cpu/arm/mmp2/irq.fth
==============================================================================
--- cpu/arm/mmp2/irq.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/mmp2/irq.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -4,7 +4,8 @@
 0 0  " d4282000"  " /" begin-package
 
 " interrupt-controller" device-name
-my-address my-space h# 400 reg
+\ my-address my-space h# 400 reg
+my-address my-space h# 1000 reg
 
 0 value base-adr
 d# 64 constant #levels
@@ -35,7 +36,7 @@
 ;
 
 : open  ( -- flag )
-   my-unit h# 400 " map-in" $call-parent to base-adr
+   my-unit h# 1000 " map-in" $call-parent to base-adr
 \ Leave the IRQ table alone so as not to steal interrupts from the SP
 \   block-irqs
 \   d# 64 0  do  i disable-irq  loop
@@ -44,6 +45,133 @@
 ;
 : close  ( -- )  ;
 
+" mrvl,mmp2-intc" " compatible" string-property
+1 " #address-cells" integer-property
+1 " #size-cells" integer-property
+: encode-unit  ( phys.. -- str )  push-hex (u.) pop-base  ;
+: decode-unit  ( str -- phys.. )  push-hex  $number  if  0  then  pop-base  ;
+
+0 0 " interrupt-controller" property
+1 " #interrupt-cells" integer-property
+\ d# 64 " mrvl,intc-numbers" integer-property
+d# 64 " mrvl,intc-nr-irqs" integer-property
+\ h# 20 " mrvl,intc-enable-mask" integer-property
+
+: make-mux-node  ( statreg maskreg irq# #irqs )
+   new-device
+      " interrupt-controller" name             ( maskreg statreg irq# #irqs )
+      " mrvl,intc-nr-irqs" integer-property    ( maskreg statreg irq# )
+      " interrupts" integer-property           ( maskreg statreg )
+      >r  4 encode-reg  r> 4 encode-reg encode+  " reg" property  ( )
+      " mrvl,mmp2-mux-intc" +compatible
+      0 0 " interrupt-controller" property
+      1 " #interrupt-cells" integer-property
+      " mux status" encode-string  " mux mask" encode-string  encode+ " reg-names" property
+   finish-device
+;
+
+   h# 150 h# 168     4     2 make-mux-node \ intcmux4
+   h# 154 h# 16c     5     2 make-mux-node \ intcmux5
+   h# 180 h# 17c     9     3 make-mux-node \ intcmux9
+   h# 158 h# 170 d# 17     5 make-mux-node \ intcmux17
+   h# 15c h# 174 d# 35 d# 15 make-mux-node \ intcmux35
+   h# 160 h# 178 d# 51     2 make-mux-node \ intcmux51
+   h# 188 h# 184 d# 55     2 make-mux-node \ intcmux55
+
+0 [if]
+new-device
+  " interrupt-controller" name
+  " mrvl,mmp2-mux-intc" +compatible
+
+  0 0
+  h# 150 encode-int encode+  4 encode-int encode+  
+  h# 168 encode-int encode+  4 encode-int encode+  " reg" property
+  \  h# 150 " mrvl,intc-status" integer-property
+  \  h# 168 " mrvl,intc-mask" integer-property
+
+  4 " interrupts" integer-property
+  d# 2 " mrvl,intc-nr-irqs" integer-property
+  \ 0: USB_CHARGER 1: PMIC
+finish-device
+  
+new-device
+  " interrupt-controller" name
+  " mrvl,mmp2-mux-intc" +compatible
+
+  0 0
+  h# 154 encode-int encode+  4 encode-int encode+  
+  h# 16c encode-int encode+  4 encode-int encode+  " reg" property
+
+  5 " interrupts" integer-property
+  d# 2 " mrvl,intc-numbers" integer-property
+  d# 1 " mrvl,clr-mfp-irq" integer-property
+  \ 0: RTC_ALARM 1: RTC
+finish-device
+
+new-device
+  " interrupt-controller" name
+
+  " mrvl,mmp2-mux-intc" +compatible
+
+  0 0
+  h# 180 encode-int encode+  4 encode-int encode+  
+  h# 17c encode-int encode+  4 encode-int encode+  " reg" property
+
+  d# 9 " interrupts" integer-property
+  d# 3 " mrvl,intc-numbers" integer-property
+  \ 0:KPC (keypad) 1:ROT (rotary) 2: TBALL (trackball)
+  \  h# 15c " mrvl,intc-status" integer-property
+  \  h# 174 " mrvl,intc-mask" integer-property
+finish-device
+
+new-device
+  " interrupt-controller" name
+  " mrvl,mmp2-mux-intc" +compatible
+
+  0 0
+  h# 158 encode-int encode+  4 encode-int encode+  
+  h# 170 encode-int encode+  4 encode-int encode+  " reg" property
+
+  d# 17 " interrupts" integer-property
+  d# 5 " mrvl,intc-numbers" integer-property
+  \ 0: TWSI2 1: TWSI3 2: TWSI4 3: TWSI5 4: TWSI6
+finish-device
+
+new-device
+  " interrupt-controller" name
+
+  " mrvl,mmp2-mux-intc" +compatible
+
+  0 0
+  h# 15c encode-int encode+  4 encode-int encode+  
+  h# 174 encode-int encode+  4 encode-int encode+  " reg" property
+  \  h# 15c " mrvl,intc-status" integer-property
+  \  h# 174 " mrvl,intc-mask" integer-property
+
+  d# 35 " interrupts" integer-property
+  d# 15 " mrvl,intc-numbers" integer-property
+  \ 0: PERF 1: L2_PA_ECC 2: L2_ECC 3: L2_UECC 4: DDR
+  \ 5: FABRIC0_TO 6: FABRIC1_TO 7: FABRIC2_TO  8: resv 9: THERMAL
+  \ 10: MAIN_PMU 11: WDT2 12: CORESIGHT 13: COMMTX 14: COMMRX
+finish-device
+
+new-device
+  " interrupt-controller" name
+  0 0 " interrupt-controller" property
+  " mrvl,mmp2-mux-intc" +compatible
+
+  0 0
+  h# 160 encode-int encode+  4 encode-int encode+  
+  h# 178 encode-int encode+  4 encode-int encode+  " reg" property
+
+  d# 51 " interrupts" integer-property
+  d# 2 " mrvl,intc-numbers" integer-property
+  \ 0:HSI_CAWAKE 1:MIPI_HSI_INT1
+  \  h# 15c " mrvl,intc-status" integer-property
+  \  h# 174 " mrvl,intc-mask" integer-property
+finish-device
+[then]
+
 end-package
 
 \ LICENSE_BEGIN

Modified: cpu/arm/mmp2/mfpr.fth
==============================================================================
--- cpu/arm/mmp2/mfpr.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/mmp2/mfpr.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -64,3 +64,61 @@
 : sleep0  ( n -- n' )  h# 0000 or  ;
 : sleep1  ( n -- n' )  h# 0100 or  ;
 : sleepi  ( n -- n' )  h# 0080 or  ;
+
+0 0  " d401e000" " /" begin-package  \ MFPR
+   " mfpr" name
+   my-address my-space  h# 1000 reg
+   " mrvl,pxa-mfpr" +compatible
+
+   \ These are for generating a table in a form used by arch/arm/plat-pxa/mfp.c
+   : +int  ( adr len n -- adr len' )  encode-int encode+  ;
+   : +mfpr  ( adr len gpio# reg-offset -- adr len' )  >r +int  -1 +int  r> +int  ;
+   : +mfpr-range  ( adr len gpio#-start gpio#-end reg-offset -- adr len' )
+      >r >r  +int  r> +int  r> +int
+   ;
+   : +mfpr-end  ( adr len -- adr len' )   -1 +int  -1 +int  -1 +int  ;
+
+
+   0 0 encode-bytes
+      d#   0 d#  58 h#  54 +mfpr-range
+      d#  59 d#  73 h# 280 +mfpr-range
+      d#  74 d# 101 h# 170 +mfpr-range
+      d# 102 d# 103 h#  00 +mfpr-range
+      d# 104        h# 1fc +mfpr
+      d# 105        h# 1f8 +mfpr
+      d# 106        h# 1f4 +mfpr
+      d# 107        h# 1f0 +mfpr
+      d# 108        h# 21c +mfpr
+      d# 109        h# 218 +mfpr
+      d# 110        h# 214 +mfpr
+      d# 111        h# 200 +mfpr
+      d# 112        h# 244 +mfpr
+      d# 113        h# 25c +mfpr
+      d# 114        h# 164 +mfpr
+      d# 115 d# 122 h# 260 +mfpr-range
+      d# 123        h# 148 +mfpr
+      d# 124 d# 141 h# 00c +mfpr-range
+      d# 142        h# 008 +mfpr
+      d# 143 d# 151 h# 220 +mfpr-range
+      d# 152 d# 152 h# 248 +mfpr-range
+      d# 154 d# 155 h# 254 +mfpr-range
+      d# 156 d# 159 h# 14c +mfpr-range
+
+      d# 160        h# 250 +mfpr
+      d# 161        h# 210 +mfpr
+      d# 162        h# 20c +mfpr
+      d# 163        h# 208 +mfpr
+      d# 164        h# 204 +mfpr
+      d# 165        h# 1ec +mfpr
+      d# 166        h# 1e8 +mfpr
+      d# 167        h# 1e4 +mfpr
+      d# 168        h# 1e0 +mfpr
+      d# 171        h# 2c8 +mfpr        \ PXA2128 only
+      h# 15b h# 15c h# 140 +mfpr-range  \ MFPR_PIN_TWSI1_SCL - MFPR_PIN_TWSI1_SDA
+      h# 15d h# 15e h# 2bc +mfpr-range  \ MFPR_PIN_TWSI4_SCL - MFPR_PIN_TWSI4_SDA
+      h# 159        h# 2c4 +mfpr        \ MFPR_PIN_PMIC_INT
+      h# 15f        h# 160 +mfpr        \ MFPR_PIN_CLK_REQ
+      +mfpr-end
+   " mrvl,pin-map" property
+
+end-package

Added: cpu/arm/mmp2/pmua.fth
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ cpu/arm/mmp2/pmua.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -0,0 +1,74 @@
+also known-int-properties definitions
+: clocks 2 ;
+previous definitions
+
+0 0  " "  " /" begin-package
+" pmua" name
+" mrvl,pxa-apmu" +compatible
+" mrvl,mmp2-apmu" +compatible
+
+h# d4282800 h# 1000 reg
+1 " #clock-cells" integer-property
+
+: +string  encode-string encode+  ;
+
+0 0 encode-bytes
+" IRE"      +string \ 0
+" DISPLAY1" +string \ 1
+" CCIC"     +string \ 2
+" SDH0"     +string \ 3
+" SDH1"     +string \ 4
+" USB"      +string \ 5
+" NF"       +string \ 6
+" DMA"      +string \ 7
+" WTM"      +string \ 8
+" BUS"      +string \ 9
+" VMETA"    +string \ 10
+" GC"       +string \ 11
+" SMC"      +string \ 12
+" MSPRO"    +string \ 13
+" SDH2"     +string \ 14
+" SDH3"     +string \ 15
+" CCIC2"    +string \ 16
+" HSIC1"    +string \ 17
+" FSIC3"    +string \ 18
+" HSI"      +string \ 19
+" AUDIO"    +string \ 20
+" DISPLAY2" +string \ 21
+" ISP"      +string \ 22
+" EPD"      +string \ 23
+" APB2"     +string \ 24
+" clock-output-names" property
+
+: +int  encode-int encode+ ;
+
+0 0 encode-bytes
+\    offset  clr-mask         value               rate
+h# 048 +int  h#    19 +int  h#   19 +int  d#           0 +int  \ 0 IRE
+h# 04c +int  h# fffff +int  h#  71b +int  d# 400,000,000 +int  \ 1 DISPLAY1
+h# 050 +int  h#    3f +int  h#   3f +int  d#           0 +int  \ 2 CCIC
+h# 054 +int  h#    1b +int  h#   1b +int  d# 200,000,000 +int  \ 3 SDH0
+h# 058 +int  h#    1b +int  h#   1b +int  d# 200,000,000 +int  \ 4 SDH1
+h# 05c +int  h#    09 +int  h#   09 +int  d# 480,000,000 +int  \ 5 USB
+h# 060 +int  h#   1ff +int  h#   bf +int  d# 100,000,000 +int  \ 6 NF
+h# 064 +int  h#    09 +int  h#   09 +int  d#           0 +int  \ 7 DMA
+h# 068 +int  h#    1b +int  h#   1b +int  d#           0 +int  \ 8 WTM
+h# 06c +int  h#    01 +int  h#   01 +int  d#           0 +int  \ 9 BUS
+h# 0a4 +int  h#    1b +int  h#   1b +int  d#           0 +int  \ 10 VMETA
+h# 0cc +int  h#    0f +int  h#   0f +int  d#           0 +int  \ 11 GC
+h# 0d4 +int  h#    1b +int  h#   1b +int  d#           0 +int  \ 12 SMC
+h# 0d8 +int  h#    3f +int  h#   3f +int  d#           0 +int  \ 13 MSPRO
+h# 0e8 +int  h#    1b +int  h#   1b +int  d# 200,000,000 +int  \ 14 SDH2
+h# 0ec +int  h#    1b +int  h#   1b +int  d# 200,000,000 +int  \ 15 SDH3
+h# 0f4 +int  h#    3f +int  h#   3f +int  d#           0 +int  \ 16 CCIC2
+h# 0f8 +int  h#    1b +int  h#   1b +int  d#           0 +int  \ 17 HSIC1
+h# 100 +int  h#    1b +int  h#   1b +int  d#           0 +int  \ 18 FSIC3
+h# 108 +int  h#    09 +int  h#   09 +int  d#           0 +int  \ 19 HSI
+h# 10c +int  h#    13 +int  h#   13 +int  d#           0 +int  \ 20 AUDIO
+h# 110 +int  h#    1b +int  h#   1b +int  d#           0 +int  \ 21 DISPLAY2
+h# 120 +int  h#    3f +int  h#   3f +int  d#           0 +int  \ 22 ISP
+h# 124 +int  h#    1b +int  h#   1b +int  d#           0 +int  \ 23 EPD
+h# 134 +int  h#    12 +int  h#   12 +int  d#           0 +int  \ 24 APB2
+" clock-enable-registers" property
+
+end-package

Modified: cpu/arm/mmp2/spimaster.fth
==============================================================================
--- cpu/arm/mmp2/spimaster.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/mmp2/spimaster.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -8,8 +8,9 @@
 " spi"     device-name
 
 0 0 encode-bytes
-   " Marvell,ssp-spi"  encode-string encode+
+   " mrvl,ssp-spi"  encode-string encode+
 " compatible" property
+   " /abpc" encode-phandle d# 19 encode-int encode+ " clocks" property
 
 my-address      my-space  h# 1000  encode-reg
 " reg" property

Modified: cpu/arm/mmp2/timer.fth
==============================================================================
--- cpu/arm/mmp2/timer.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/mmp2/timer.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -188,3 +188,11 @@
    do-lid
 ;
 ' safe-idle to stdin-idle
+
+0 0  " d4014000" " /" begin-package
+   " timer" name
+   " mrvl,mmp-timer" +compatible
+   my-address my-space  h# 100 reg
+   d# 13 " interrupts" integer-property
+   " /apbc" encode-phandle 9 encode-int encode+ " clocks" property
+end-package

Modified: cpu/arm/mmp2/twsi.fth
==============================================================================
--- cpu/arm/mmp2/twsi.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/mmp2/twsi.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -156,6 +156,49 @@
 : twsi-b!  ( byte reg -- )  2 twsi-out  ;
 
 [ifdef] begin-package
+: make-twsi-node  ( baseadr clock# irq# muxed-irq? fast? unit# -- )
+   root-device
+   new-device
+      " linux,unit#" integer-property
+      " i2c" name
+      " mrvl,mmp-twsi" +compatible                    ( baseadr clock# irq# muxed-irq? fast? )
+      if  0 0  " mrvl,i2c-fast-mode" property  then   ( baseadr clock# irq# muxed-irq? )
+      if
+          " /interrupt-controller/interrupt-controller at 158" encode-phandle " interrupt-parent" property
+      then                                            ( baseadr clock# irq# )
+      " interrupts" integer-property                  ( baseadr clock# )
+      " /apbc" encode-phandle rot encode-int encode+ " clocks" property
+
+      h# 1000 reg                                     ( )
+      1 " #address-cells" integer-property
+      1 " #size-cells" integer-property
+      " : open true ; : close ;" evaluate
+      " : encode-unit  ( phys.. -- str )  push-hex (u.) pop-base  ;" evaluate
+      " : decode-unit  ( str -- phys.. )  push-hex  $number  if  0  then  pop-base  ;" evaluate
+   finish-device
+   device-end
+;      
+
+\     baseadr   clk irq mux? fast? unit#
+\ h# d4011000     1   7 false true     N make-twsi-node  \ TWSI1
+\ h# d4031000     2   0 true  true     N 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
+  h# d4034000 d# 31   4 true  true     1 make-twsi-node  \ TWSI6
+
+0 0  " 30" " /i2c at d4033000" begin-package  \ TWSI
+   " touchscreen" name
+   " raydium_ts" +compatible
+   my-address my-space 1 reg
+end-package
+
+0 0  " 19" " /i2c at d4034000" begin-package
+   " accelerometer" name
+   " lis3lv02d" +compatible
+   my-address my-space 1 reg
+end-package
+
 0 0  " "  " /" begin-package
 " twsi" name
 

Modified: cpu/arm/mmp2/uart.fth
==============================================================================
--- cpu/arm/mmp2/uart.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/mmp2/uart.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -1,4 +1,5 @@
    " uart" name
+   " mrvl,mmp-uart" +compatible
    my-space  h# 20  reg
 
    : write  ( adr len -- actual )

Modified: cpu/arm/olpc/1.75/usb.fth
==============================================================================
--- cpu/arm/olpc/1.75/usb.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/olpc/1.75/usb.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -8,6 +8,9 @@
       my-space swap  " map-in" $call-parent  h# 100 +  ( adr )
    ;
    : my-map-out  ( adr len -- )  swap h# 100 - swap " map-out" $call-parent  ;
+   " /pmua" encode-phandle 5 encode-int encode+ " clocks" property
+   d# 44 " interrupts" integer-property
+
    false constant has-dbgp-regs?
    false constant needs-dummy-qh?
    : grab-controller  ( config-adr -- error? )  drop false  ;

Modified: cpu/arm/olpc/build-fw.fth
==============================================================================
--- cpu/arm/olpc/build-fw.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/olpc/build-fw.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -81,6 +81,9 @@
 ;
 
 
+fload ${BP}/cpu/arm/mmp2/pmua.fth
+fload ${BP}/cpu/arm/mmp2/apbc.fth
+fload ${BP}/cpu/arm/mmp2/irq.fth
 fload ${BP}/cpu/arm/mmp2/timer.fth
 fload ${BP}/cpu/arm/mmp2/twsi.fth
 fload ${BP}/cpu/arm/mmp2/mfpr.fth
@@ -98,12 +101,13 @@
 ;
 warning !
 
-fload ${BP}/cpu/arm/mmp2/irq.fth
-
 fload ${BP}/cpu/arm/mmp2/watchdog.fth	\ reset-all using watchdog timer
 
 0 0  " d4018000"  " /" begin-package  \ UART3
    fload ${BP}/cpu/arm/mmp2/uart.fth
+   " /apbc" encode-phandle d# 12 encode-int encode+ " clocks" property
+   d# 24 " interrupts" integer-property
+   1 " linux,unit#" integer-property
 end-package
 devalias com1 /uart
 : com1  " com1"  ;
@@ -111,6 +115,9 @@
 
 0 0  " d4030000"  " /" begin-package  \ UART1
    fload ${BP}/cpu/arm/mmp2/uart.fth
+   d# 27 " interrupts" integer-property
+   " /apbc" encode-phandle d# 10 encode-int encode+ " clocks" property
+   0 " linux,unit#" integer-property
 end-package
 devalias com2 /uart
 : com2  " com2"  ;
@@ -131,6 +138,8 @@
 0 0  " d4035000"  " /" begin-package
    " flash" device-name
 
+   " /apbc" encode-phandle d# 19 encode-int encode+ " clocks" property
+   d# 0 " interrupts" integer-property
    h# 10.0000 value /device
    my-address my-space h# 100 reg
    fload ${BP}/dev/nonmmflash.fth
@@ -177,8 +186,7 @@
 : hdd-led-off     ( -- )  ;
 : hdd-led-on      ( -- )  ;
 : hdd-led-toggle  ( -- )  ;
-[then]
-[ifdef] olpc-cl2
+[else]
 : hdd-led-off     ( -- )  d# 10 gpio-clr  ;
 : hdd-led-on      ( -- )  d# 10 gpio-set  ;
 : hdd-led-toggle  ( -- )  d# 10 gpio-pin@  if  hdd-led-off  else  hdd-led-on  then  ;
@@ -219,13 +227,33 @@
 : ofw-fw-filename$  " disk:\boot\olpc.rom"  ;
 ' ofw-fw-filename$ to fw-filename$
 
+0 0  " f0400000"  " /" begin-package
+   " vmeta" name
+   my-address my-space h# 1000 reg
+
+   " mrvl,mmp2-vmeta" +compatible
+
+   " /pmua" encode-phandle d# 10 encode-int encode+ " clocks" property
+   d# 26 " interrupts" integer-property
+end-package
+
 0 0  " d420b000"  " /" begin-package
    " display" name
-\+ olpc-cl2   fload ${BP}/cpu/arm/olpc/1.75/lcdcfg.fth
-\+ olpc-cl3   fload ${BP}/cpu/arm/olpc/3.0/lcdcfg.fth
+   my-address my-space h# 1000 reg
+
+   " /pmua" encode-phandle 1 encode-int encode+ " clocks" property
+   d# 41 " interrupts" integer-property
+
+[ifdef] olpc-cl3
+   fload ${BP}/cpu/arm/olpc/3.0/lcdcfg.fth
+[else]
+   fload ${BP}/cpu/arm/olpc/1.75/lcdcfg.fth
+[then]
 
    fload ${BP}/cpu/arm/olpc/lcd.fth
-\+ olpc-cl2   fload ${BP}/dev/olpc/dcon/mmp2dcon.fth        \ DCON control
+[ifndef] olpc-cl3
+   fload ${BP}/dev/olpc/dcon/mmp2dcon.fth        \ DCON control
+[then]
    defer convert-color ' noop to convert-color
    defer pixel*
    defer pixel+
@@ -299,18 +327,21 @@
 
 devalias screen /display
    
-\- olpc-cl3 devalias keyboard /keyboard
+[ifdef] olpc-cl3
+create cp881-16  " ${BP}/ofw/termemu/cp881-16.obf" $file,
+' cp881-16 to romfont
+[else]
+devalias keyboard /keyboard
 
-\+ olpc-cl2 create 15x30pc  " ${BP}/ofw/termemu/15x30pc.psf" $file,
-\+ olpc-cl2 ' 15x30pc to romfont
-\+ olpc-cl3 create cp881-16  " ${BP}/ofw/termemu/cp881-16.obf" $file,
-\+ olpc-cl3 ' cp881-16 to romfont
+create 15x30pc  " ${BP}/ofw/termemu/15x30pc.psf" $file,
+' 15x30pc to romfont
+[then]
 
 fload ${BP}/cpu/arm/olpc/sdhci.fth
 \- cl2-a1 fload ${BP}/cpu/arm/olpc/emmc.fth
 
-devalias int /sd/disk at 3
-devalias ext /sd/disk at 1
+devalias int /sd/sdhci at d4281000/disk
+devalias ext /sd/sdhci at d4280000/disk
 devalias net /wlan  \ XXX should report-net in case of USB Ethernet
 
 fload ${BP}/dev/olpc/kb3700/spicmd.fth           \ EC SPI Command Protocol
@@ -370,6 +401,7 @@
 \+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/usb.fth
 \+ olpc-cl3 fload ${BP}/cpu/arm/mmp2/ulpiphy.fth
 \+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/usb.fth
+\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/usb.fth
 
 fload ${BP}/dev/olpc/mmp2camera/loadpkg.fth
 
@@ -393,6 +425,7 @@
       board-revision " board-revision-int" integer-property
 \+ olpc-cl2  " olpc,xo-1.75" " compatible" string-property
 \+ olpc-cl3  " olpc,xo-3.0"  " compatible" string-property
+\+ olpc-cl4  " olpc,xo-cl4"  " compatible" string-property
 
       \ The "1-" removes the null byte
       " SN" find-tag  if  1-  else  " Unknown"  then  " serial-number" string-property
@@ -402,6 +435,11 @@
       ['] ec-name$  catch  0=  if  " ec-name" string-property  then
       ['] ec-date$  catch  0=  if  " ec-date" string-property  then
       ['] ec-user$  catch  0=  if  " ec-user" string-property  then
+      " /interrupt-controller" encode-phandle " interrupt-parent" property
+\      " /interrupt-controller"  find-package  if
+\         " interrupt-parent" integer-property
+\      then
+      0 0 " ranges" property
    dend
 
    " /openprom" find-device
@@ -420,6 +458,7 @@
 
 fload ${BP}/cpu/arm/mmp2/thermal.fth
 fload ${BP}/cpu/arm/mmp2/fuse.fth
+fload ${BP}/cpu/arm/olpc/bsl.fth
 
 [ifndef] virtual-mode
 warning off
@@ -509,8 +548,12 @@
    false
 ;
 
-\+ olpc-cl2 : rotate-button?  ( -- flag )  d# 15 gpio-pin@ 0=  ;
-\+ olpc-cl3 false value rotate-button?
+[ifdef] olpc-cl3
+false value rotate-button?
+[else]
+: rotate-button?  ( -- flag )  d# 15 gpio-pin@ 0=  ;
+[then]
+
 warning @  warning off 
 : init
 \ initial-heap add-memory
@@ -625,15 +668,23 @@
 
 code halt  ( -- )  wfi   c;
 
-\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/switches.fth  \ Switches
 \+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/switches.fth \ Lid and ebook switches
+\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/switches.fth  \ Switches
+\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/switches.fth  \ Lid and ebook switches
+
 fload ${BP}/cpu/arm/mmp2/rtc.fth       \ Internal RTC, used for wakeups
-\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/leds.fth     \ LEDs
+
 \+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/leds.fth     \ LEDs
+\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/leds.fth      \ LEDs
+\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/leds.fth      \ LEDs
+
 fload ${BP}/cpu/x86/pc/olpc/via/factory.fth  \ Manufacturing tools
 
 fload ${BP}/cpu/arm/olpc/accelerometer.fth
-\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/compass.fth
+
+[ifndef] olpc-cl3
+fload ${BP}/cpu/arm/olpc/1.75/compass.fth
+[then]
 
 \ Suppress long memory test at final test stage
 dev /memory
@@ -700,17 +751,22 @@
 
 fload ${BP}/cpu/x86/pc/olpc/gamekeynames.fth
 
+[ifdef] cl2-a1
 : game-key@  ( -- n )
    0                                        ( n )
-[ifdef] cl2-a1
    d# 16 gpio-pin@ 0=  if  h#  80 or  then  \ O
    d# 17 gpio-pin@ 0=  if  h#  02 or  then  \ Check
    d# 18 gpio-pin@ 0=  if  h# 100 or  then  \ X
    d# 19 gpio-pin@ 0=  if  h#  01 or  then  \ Square
    d# 20 gpio-pin@ 0=  if  h#  40 or  then  \ Rotate
+;
 [then]
-[ifdef] olpc-cl2
-[ifdef] use_mmp2_keypad_control
+
+defined? olpc-cl2  defined? olpc-cl4 or  [if]
+
+   [ifdef] use_mmp2_keypad_control
+: game-key@  ( -- n )
+   0                                        ( n )
    d# 15 gpio-pin@ 0=  if  button-rotate or  then   ( n )
    scan-keypad                              ( n keypad )
    button-o       h# 01  keypad-bit         ( n' keypad )
@@ -722,7 +778,10 @@
    rocker-down    h# 40  keypad-bit         ( n' keypad )
    rocker-left    h# 80  keypad-bit         ( n' keypad )
    drop                                     ( n )
-[else]
+;
+   [else]
+: game-key@  ( -- n )
+   0                                        ( n )
    d# 15 gpio-pin@ 0=  if  button-rotate  or  then
    d# 16 gpio-pin@ 0=  if  button-o       or  then
    d# 17 gpio-pin@ 0=  if  button-check   or  then
@@ -732,9 +791,10 @@
    d# 21 gpio-pin@ 0=  if  rocker-right   or  then
    d# 22 gpio-pin@ 0=  if  rocker-down    or  then
    d# 23 gpio-pin@ 0=  if  rocker-left    or  then
-[then]
-[then]
 ;
+   [then]
+
+[then]
 
 fload ${BP}/cpu/x86/pc/olpc/gamekeys.fth
 
@@ -756,9 +816,11 @@
 
 fload ${BP}/cpu/x86/pc/olpc/gridmap.fth      \ Gridded display tools
 fload ${BP}/cpu/x86/pc/olpc/via/copynand.fth
+
+\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/rm3150-touchscreen.fth    \ Touchscreen driver and diagnostic
 \+ olpc-cl3 fload ${BP}/cpu/arm/olpc/exc7200-touchscreen.fth    \ Touchscreen driver and diagnostic
 \+ olpc-cl3 fload ${BP}/dev/softkeyboard.fth                    \ On-screen keyboard
-\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/rm3150-touchscreen.fth    \ Touchscreen driver and diagnostic
+\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/nn-touchscreen.fth        \ Touchscreen driver and diagnostic
 fload ${BP}/cpu/arm/olpc/roller.fth     \ Accelerometer test
 
 \ fload ${BP}/cpu/arm/olpc/pinch.fth  \ Touchscreen gestures
@@ -828,8 +890,7 @@
 devalias fsdisk int:0
 
 \ create pong-use-touchscreen
-fload ${BP}/ofw/gui/ofpong.fth
-fload ${BP}/cpu/x86/pc/olpc/life.fth
+\ fload ${BP}/ofw/gui/ofpong.fth
 
 d# 999 ' screen-#rows    set-config-int-default  \ Expand the terminal emulator to fill the screen
 d# 999 ' screen-#columns set-config-int-default  \ Expand the terminal emulator to fill the screen
@@ -897,11 +958,7 @@
 : ?games  ( -- )
    rocker-right game-key?  if
       protect-fw
-      time&date 5drop 1 and  if
-         ['] pong guarded
-      else
-         ['] life-demo guarded
-      then
+\      ['] pong guarded
       power-off
    then
 ;
@@ -964,8 +1021,9 @@
 [then]
 
 fload ${BP}/cpu/arm/olpc/testitems.fth
-\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/testinstructions.fth
 \+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/testinstructions.fth
+\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/testinstructions.fth
+\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/testinstructions.fth
 
 : startup  ( -- )
    standalone?  0=  if  exit  then

Modified: cpu/arm/olpc/rtc.fth
==============================================================================
--- cpu/arm/olpc/rtc.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/olpc/rtc.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -1,7 +1,17 @@
 purpose: Driver for external IDT1338 RTC chip on XO-1.75
 
-0 0  " "  " /" begin-package
-" rtc" name
+0 0  " d4010000"  " /" begin-package
+   " rtc" name
+   " mrvl,mmp-rtc" +compatible
+   my-address my-space  h# 1000 reg
+
+   d# 1 encode-int  0 encode-int encode+ " interrupts" property
+   " /interrupt-controller/interrupt-controller at 154" encode-phandle " interrupt-parent" property
+
+   " rtc 1Hz" encode-string " rtc alarm" encode-string  encode+ " interrupt-names" property
+
+         
+   " /apbc" encode-phandle 0 encode-int encode+ " clocks" property
 
 [ifdef] cl2-a1
 : set-address  ( -- )

Modified: cpu/arm/olpc/sdhci.fth
==============================================================================
--- cpu/arm/olpc/sdhci.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/olpc/sdhci.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -1,16 +1,22 @@
 purpose: Load file for SDHCI (Secure Digital Host Controller Interface)
 
-0 0  " d4280000"  " /"  begin-package
+0 0  " "  " /"  begin-package
 
    fload ${BP}/cpu/arm/olpc/sdregs.fth
    fload ${BP}/dev/mmc/sdhci/sdhci.fth
 
+   " simple-bus" +compatible
+   h# d4280000 encode-int  h# d4280000 encode-int encode+  h# 2000 encode-int encode+  " ranges" property
+   1 " #address-cells" integer-property
+   1 " #size-cells" integer-property
+
    d# 1 to power-off-time  \ A2 and A3 have turn-off clamps
 \   true to avoid-high-speed?
 
    hex
+   : slot#  ( -- n )  slot h# d4280000 -  h# 800 /  1+  ;
    : olpc-card-inserted?  ( -- flag )
-      slot 1 =  if  d# 31 gpio-pin@ 0=  else  true  then
+      slot# 1 =  if  d# 31 gpio-pin@ 0=  else  true  then
    ;
    ' olpc-card-inserted? to card-inserted?
 
@@ -18,35 +24,72 @@
    : gpio-power-on  ( -- )
       sdhci-card-power-on
 \ The CL3 version below actually works for CL2 >= B1
-\+ olpc-cl2  d# 36 slot - gpio-set
-\+ olpc-cl3  slot 2 =  if  d# 34 gpio-set  then
+\+ olpc-cl2  d# 36 slot# - gpio-set
+\+ olpc-cl3  slot# 2 =  if  d# 34 gpio-set  then
    ;
    ' gpio-power-on to card-power-on
 
    : gpio-power-off  ( -- )
-\+ olpc-cl2  d# 36 slot - gpio-clr
-\+ olpc-cl3  slot 2 =  if  d# 34 gpio-clr  then
+\+ olpc-cl2  d# 36 slot# - gpio-clr
+\+ olpc-cl3  slot# 2 =  if  d# 34 gpio-clr  then
       sdhci-card-power-off
    ;
    ' gpio-power-off to card-power-off
 
 \+ olpc-cl2   new-device
-\+ olpc-cl2      1 encode-int " reg" property
-\+ olpc-cl2      fload ${BP}/dev/mmc/sdhci/sdmmc.fth
-\+ olpc-cl2      fload ${BP}/dev/mmc/sdhci/selftest.fth
-\+ olpc-cl2      " external" " slot-name" string-property
+\+ olpc-cl2      h# d428.0000 h# 800 reg
+\+ olpc-cl2      8 encode-int " bus-width" property
+\+ olpc-cl2      " mrvl,pxav3-mmc" encode-string  " compatible" property
+\+ olpc-cl2      d# 31 encode-int " clk-delay-cycles" property
+\+ olpc-cl2      fload ${BP}/dev/mmc/sdhci/slot.fth
+\+ olpc-cl2      d# 39 " interrupts" integer-property
+
+\+ olpc-cl2      " /pmua" encode-phandle 3 encode-int encode+ " clocks" property
+\+ olpc-cl2      " PXA-SDHCLK" " clock-names" string-property
+
+\+ olpc-cl2      new-device
+\+ olpc-cl2         fload ${BP}/dev/mmc/sdhci/sdmmc.fth
+\+ olpc-cl2         fload ${BP}/dev/mmc/sdhci/selftest.fth
+\+ olpc-cl2         " external" " slot-name" string-property
+\+ olpc-cl2      finish-device
 \+ olpc-cl2   finish-device
 
    new-device
-      2 encode-int " reg" property
-      fload ${BP}/dev/mmc/sdhci/mv8686/loadpkg.fth
+      h# d428.0800 h# 800 reg
+      8 encode-int " bus-width" property
+      " sdhci-pxav3" +compatible
+      " mrvl,pxav3-mmc" +compatible
+      d# 31 encode-int " clk-delay-cycles" property
+      0 0  " non-removable" property
+      d# 52 " interrupts" integer-property
+
+      " /pmua" encode-phandle 4 encode-int encode+ " clocks" property
+      " PXA-SDHCLK" " clock-names" string-property
+
+      fload ${BP}/dev/mmc/sdhci/slot.fth
+      new-device
+         fload ${BP}/dev/mmc/sdhci/mv8686/loadpkg.fth
+      finish-device
    finish-device
 
    new-device
-      3 encode-int " reg" property
-      fload ${BP}/dev/mmc/sdhci/sdmmc.fth
-      fload ${BP}/dev/mmc/sdhci/selftest.fth
-      " internal" " slot-name" string-property
+      h# d428.1000 h# 800 reg
+      0 0  " non-removable" property
+      8 encode-int " bus-width" property
+      " sdhci-pxav3" +compatible
+      " mrvl,pxav3-mmc" +compatible
+      d# 31 encode-int " clk-delay-cycles" property
+      d# 53 " interrupts" integer-property
+
+      " /pmua" encode-phandle d# 14 encode-int encode+ " clocks" property
+      " PXA-SDHCLK" " clock-names" string-property
+
+      fload ${BP}/dev/mmc/sdhci/slot.fth
+      new-device
+         fload ${BP}/dev/mmc/sdhci/sdmmc.fth
+         fload ${BP}/dev/mmc/sdhci/selftest.fth
+         " internal" " slot-name" string-property
+      finish-device
    finish-device
 
 end-package

Modified: cpu/arm/olpc/sdregs.fth
==============================================================================
--- cpu/arm/olpc/sdregs.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/olpc/sdregs.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -4,11 +4,11 @@
 0 instance value slot
 0 instance value chip
 
-my-space /regs  reg
+\ my-space /regs  reg
 
 : map-regs  ( -- )
    chip  if  exit  then
-   slot 1-  h# 800 *  my-space +  /regs " map-in" $call-parent
+   slot  /regs " map-in" $call-parent
    to chip
 ;
 : unmap-regs  ( -- )

Modified: cpu/arm/olpc/sound.fth
==============================================================================
--- cpu/arm/olpc/sound.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/olpc/sound.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -2,6 +2,9 @@
 " audio" name
 my-space h# 800 reg
 
+" /pmua" encode-phandle d# 20 encode-int encode+ " clocks" property
+d# 2 " interrupts" integer-property
+
 0 value sspa-base  \ E.g. h# 2a.0c00 +io
 0 value adma-base  \ E.g. h# 2a.0800 +io
 : sspa!  ( n offset -- )  sspa-base + rl!  ;  \ Write a register in SSPA1

Modified: cpu/arm/olpc/spcmd.fth
==============================================================================
--- cpu/arm/olpc/spcmd.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ cpu/arm/olpc/spcmd.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -24,6 +24,8 @@
 0 0 encode-bytes
    " olpc,ap-sp"  encode-string encode+
 " compatible" property
+   d# 40 " interrupts" integer-property
+   " /pmua" encode-phandle 8 encode-int encode+ " clocks" property
 
 my-address      my-space  h# 1000  encode-reg
 " reg" property

Modified: dev/olpc/kb3700/spicmd.fth
==============================================================================
--- dev/olpc/kb3700/spicmd.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ dev/olpc/kb3700/spicmd.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -35,6 +35,10 @@
 1 " #address-cells"  integer-property
 0 " #size-cells"     integer-property
 
+   d# 20 " interrupts" integer-property
+   " /apbc" encode-phandle d# 21 encode-int encode+ " clocks" property
+
+
 : encode-unit  ( phys -- adr len )  push-hex  (u.)  pop-base  ;
 : decode-unit  ( adr len -- phys )  push-hex  $number  if  0  then  pop-base  ;
 

Modified: dev/olpc/mmp2camera/loadpkg.fth
==============================================================================
--- dev/olpc/mmp2camera/loadpkg.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ dev/olpc/mmp2camera/loadpkg.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -1,6 +1,8 @@
 " "  " d420a000" " /"  begin-package
    " camera" device-name
-   0 0 reg  \ A reg property makes "test-all" consider this device
+   my-address my-space  h# 800  reg
+   " /pmua" encode-phandle 2 encode-int encode+ " clocks" property
+   d# 42 " interrupts" integer-property
 
 0 [if]
    : alloc-capture-buffer  ( len -- vadr padr )

Modified: ofw/core/fdt.fth
==============================================================================
--- ofw/core/fdt.fth	Fri Jun 29 22:52:33 2012	(r3022)
+++ ofw/core/fdt.fth	Fri Jun 29 23:04:07 2012	(r3023)
@@ -52,7 +52,6 @@
    fdt-string,                                          ( offset )
 ;
 
-also client-services
 : flatten-path  ( -- )
    the-node phandle>devname       ( adr len )
    fdt$,  0 fdt-c,  4 fdt-align   ( )
@@ -176,7 +175,7 @@
 
    \ Test for unprintable characters
    2dup -null text?  if   
-      to-display-column  -null  type  exit  
+      to-display-column  -null  type cr exit  
    then   ( adr,len )
 
    dup /n /mod  swap 0=  if         ( adr len #ints )
@@ -213,8 +212,6 @@
    again
 ;
 
-previous
-
 \ LICENSE_BEGIN
 \ Copyright (c) 2012 FirmWorks
 \ 



More information about the openfirmware mailing list