Changeset 3023


Ignore:
Timestamp:
Jun 29, 2012, 9:04:07 PM (3 years ago)
Author:
wmb
Message:

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

Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/linux.fth

    r2917 r3023  
    105105[ifdef] flatten-device-tree
    106106   use-fdt?  if
     107      load-base h# 40000 - to linux-params
    107108      linux-params h# 40000 flatten-device-tree
    108109   else
  • cpu/arm/mmp2/devices.fth

    r2570 r3023  
    71710 0  " d4018000"  " /" begin-package  \ UART3
    7272   fload ${BP}/cpu/arm/mmp2/uart.fth
     73   d# 24 " interrupts" integer-property
    7374end-package
    7475devalias com1 /uart
  • cpu/arm/mmp2/gpio.fth

    r2550 r3023  
    4040: gpio-set-xmsk ( gpio# -- )  >gpio-xmsk tuck io@  or  swap io!  ;
    4141: gpio-clr-xmsk ( gpio# -- )  >gpio-xmsk tuck io@  swap invert and  swap io!  ;
     42
     43\ See <Linux> Documentation/devicetree/bindings/gpio/mrvl-gpio.txt
     440 0  " d4019000" " /" begin-package
     45   " gpio" name
     46
     47   " mrvl,mmp-gpio" encode-string
     48   " mrvl,pxa-gpio" encode-string encode+  " compatible" property
     49
     50   my-address my-space  h# 1000 reg
     51
     52   d# 49  encode-int  " interrupts" property
     53   " gpio_mux"  " interrupt-names" string-property
     54   " " " gpio-controller" property
     55   3 " #gpio-cells" integer-property
     56   " " " interrupt-controller" property
     57   1 " #interrupt-cells" integer-property
     58
     59   " /apbc" encode-phandle d# 13 encode-int encode+ " clocks" property
     60   " GPIO" " clock-names" string-property
     61
     62
     63   1 " #address-cells" integer-property
     64   1 " #size-cells" integer-property
     65   : encode-unit  ( phys.. -- str )  push-hex (u.) pop-base  ;
     66   : decode-unit  ( str -- phys.. )  push-hex  $number  if  0  then  pop-base  ;
     67
     68   : make-gpio-mux-node  ( offset -- )
     69      new-device
     70      " gpio" name
     71      4 reg
     72      finish-device
     73   ;
     74   h#  00 make-gpio-mux-node
     75   h#  04 make-gpio-mux-node
     76   h#  08 make-gpio-mux-node
     77   h# 100 make-gpio-mux-node
     78   h# 104 make-gpio-mux-node
     79   h# 108 make-gpio-mux-node
     80end-package
  • cpu/arm/mmp2/irq.fth

    r2551 r3023  
    55
    66" interrupt-controller" device-name
    7 my-address my-space h# 400 reg
     7\ my-address my-space h# 400 reg
     8my-address my-space h# 1000 reg
    89
    9100 value base-adr
     
    3637
    3738: open  ( -- flag )
    38    my-unit h# 400 " map-in" $call-parent to base-adr
     39   my-unit h# 1000 " map-in" $call-parent to base-adr
    3940\ Leave the IRQ table alone so as not to steal interrupts from the SP
    4041\   block-irqs
     
    4445;
    4546: close  ( -- )  ;
     47
     48" mrvl,mmp2-intc" " compatible" string-property
     491 " #address-cells" integer-property
     501 " #size-cells" integer-property
     51: encode-unit  ( phys.. -- str )  push-hex (u.) pop-base  ;
     52: decode-unit  ( str -- phys.. )  push-hex  $number  if  0  then  pop-base  ;
     53
     540 0 " interrupt-controller" property
     551 " #interrupt-cells" integer-property
     56\ d# 64 " mrvl,intc-numbers" integer-property
     57d# 64 " mrvl,intc-nr-irqs" integer-property
     58\ h# 20 " mrvl,intc-enable-mask" integer-property
     59
     60: make-mux-node  ( statreg maskreg irq# #irqs )
     61   new-device
     62      " interrupt-controller" name             ( maskreg statreg irq# #irqs )
     63      " mrvl,intc-nr-irqs" integer-property    ( maskreg statreg irq# )
     64      " interrupts" integer-property           ( maskreg statreg )
     65      >r  4 encode-reg  r> 4 encode-reg encode+  " reg" property  ( )
     66      " mrvl,mmp2-mux-intc" +compatible
     67      0 0 " interrupt-controller" property
     68      1 " #interrupt-cells" integer-property
     69      " mux status" encode-string  " mux mask" encode-string  encode+ " reg-names" property
     70   finish-device
     71;
     72
     73   h# 150 h# 168     4     2 make-mux-node \ intcmux4
     74   h# 154 h# 16c     5     2 make-mux-node \ intcmux5
     75   h# 180 h# 17c     9     3 make-mux-node \ intcmux9
     76   h# 158 h# 170 d# 17     5 make-mux-node \ intcmux17
     77   h# 15c h# 174 d# 35 d# 15 make-mux-node \ intcmux35
     78   h# 160 h# 178 d# 51     2 make-mux-node \ intcmux51
     79   h# 188 h# 184 d# 55     2 make-mux-node \ intcmux55
     80
     810 [if]
     82new-device
     83  " interrupt-controller" name
     84  " mrvl,mmp2-mux-intc" +compatible
     85
     86  0 0
     87  h# 150 encode-int encode+  4 encode-int encode+ 
     88  h# 168 encode-int encode+  4 encode-int encode+  " reg" property
     89  \  h# 150 " mrvl,intc-status" integer-property
     90  \  h# 168 " mrvl,intc-mask" integer-property
     91
     92  4 " interrupts" integer-property
     93  d# 2 " mrvl,intc-nr-irqs" integer-property
     94  \ 0: USB_CHARGER 1: PMIC
     95finish-device
     96 
     97new-device
     98  " interrupt-controller" name
     99  " mrvl,mmp2-mux-intc" +compatible
     100
     101  0 0
     102  h# 154 encode-int encode+  4 encode-int encode+ 
     103  h# 16c encode-int encode+  4 encode-int encode+  " reg" property
     104
     105  5 " interrupts" integer-property
     106  d# 2 " mrvl,intc-numbers" integer-property
     107  d# 1 " mrvl,clr-mfp-irq" integer-property
     108  \ 0: RTC_ALARM 1: RTC
     109finish-device
     110
     111new-device
     112  " interrupt-controller" name
     113
     114  " mrvl,mmp2-mux-intc" +compatible
     115
     116  0 0
     117  h# 180 encode-int encode+  4 encode-int encode+ 
     118  h# 17c encode-int encode+  4 encode-int encode+  " reg" property
     119
     120  d# 9 " interrupts" integer-property
     121  d# 3 " mrvl,intc-numbers" integer-property
     122  \ 0:KPC (keypad) 1:ROT (rotary) 2: TBALL (trackball)
     123  \  h# 15c " mrvl,intc-status" integer-property
     124  \  h# 174 " mrvl,intc-mask" integer-property
     125finish-device
     126
     127new-device
     128  " interrupt-controller" name
     129  " mrvl,mmp2-mux-intc" +compatible
     130
     131  0 0
     132  h# 158 encode-int encode+  4 encode-int encode+ 
     133  h# 170 encode-int encode+  4 encode-int encode+  " reg" property
     134
     135  d# 17 " interrupts" integer-property
     136  d# 5 " mrvl,intc-numbers" integer-property
     137  \ 0: TWSI2 1: TWSI3 2: TWSI4 3: TWSI5 4: TWSI6
     138finish-device
     139
     140new-device
     141  " interrupt-controller" name
     142
     143  " mrvl,mmp2-mux-intc" +compatible
     144
     145  0 0
     146  h# 15c encode-int encode+  4 encode-int encode+ 
     147  h# 174 encode-int encode+  4 encode-int encode+  " reg" property
     148  \  h# 15c " mrvl,intc-status" integer-property
     149  \  h# 174 " mrvl,intc-mask" integer-property
     150
     151  d# 35 " interrupts" integer-property
     152  d# 15 " mrvl,intc-numbers" integer-property
     153  \ 0: PERF 1: L2_PA_ECC 2: L2_ECC 3: L2_UECC 4: DDR
     154  \ 5: FABRIC0_TO 6: FABRIC1_TO 7: FABRIC2_TO  8: resv 9: THERMAL
     155  \ 10: MAIN_PMU 11: WDT2 12: CORESIGHT 13: COMMTX 14: COMMRX
     156finish-device
     157
     158new-device
     159  " interrupt-controller" name
     160  0 0 " interrupt-controller" property
     161  " mrvl,mmp2-mux-intc" +compatible
     162
     163  0 0
     164  h# 160 encode-int encode+  4 encode-int encode+ 
     165  h# 178 encode-int encode+  4 encode-int encode+  " reg" property
     166
     167  d# 51 " interrupts" integer-property
     168  d# 2 " mrvl,intc-numbers" integer-property
     169  \ 0:HSI_CAWAKE 1:MIPI_HSI_INT1
     170  \  h# 15c " mrvl,intc-status" integer-property
     171  \  h# 174 " mrvl,intc-mask" integer-property
     172finish-device
     173[then]
    46174
    47175end-package
  • cpu/arm/mmp2/mfpr.fth

    r2640 r3023  
    6565: sleep1  ( n -- n' )  h# 0100 or  ;
    6666: sleepi  ( n -- n' )  h# 0080 or  ;
     67
     680 0  " d401e000" " /" begin-package  \ MFPR
     69   " mfpr" name
     70   my-address my-space  h# 1000 reg
     71   " mrvl,pxa-mfpr" +compatible
     72
     73   \ These are for generating a table in a form used by arch/arm/plat-pxa/mfp.c
     74   : +int  ( adr len n -- adr len' )  encode-int encode+  ;
     75   : +mfpr  ( adr len gpio# reg-offset -- adr len' )  >r +int  -1 +int  r> +int  ;
     76   : +mfpr-range  ( adr len gpio#-start gpio#-end reg-offset -- adr len' )
     77      >r >r  +int  r> +int  r> +int
     78   ;
     79   : +mfpr-end  ( adr len -- adr len' )   -1 +int  -1 +int  -1 +int  ;
     80
     81
     82   0 0 encode-bytes
     83      d#   0 d#  58 h#  54 +mfpr-range
     84      d#  59 d#  73 h# 280 +mfpr-range
     85      d#  74 d# 101 h# 170 +mfpr-range
     86      d# 102 d# 103 h#  00 +mfpr-range
     87      d# 104        h# 1fc +mfpr
     88      d# 105        h# 1f8 +mfpr
     89      d# 106        h# 1f4 +mfpr
     90      d# 107        h# 1f0 +mfpr
     91      d# 108        h# 21c +mfpr
     92      d# 109        h# 218 +mfpr
     93      d# 110        h# 214 +mfpr
     94      d# 111        h# 200 +mfpr
     95      d# 112        h# 244 +mfpr
     96      d# 113        h# 25c +mfpr
     97      d# 114        h# 164 +mfpr
     98      d# 115 d# 122 h# 260 +mfpr-range
     99      d# 123        h# 148 +mfpr
     100      d# 124 d# 141 h# 00c +mfpr-range
     101      d# 142        h# 008 +mfpr
     102      d# 143 d# 151 h# 220 +mfpr-range
     103      d# 152 d# 152 h# 248 +mfpr-range
     104      d# 154 d# 155 h# 254 +mfpr-range
     105      d# 156 d# 159 h# 14c +mfpr-range
     106
     107      d# 160        h# 250 +mfpr
     108      d# 161        h# 210 +mfpr
     109      d# 162        h# 20c +mfpr
     110      d# 163        h# 208 +mfpr
     111      d# 164        h# 204 +mfpr
     112      d# 165        h# 1ec +mfpr
     113      d# 166        h# 1e8 +mfpr
     114      d# 167        h# 1e4 +mfpr
     115      d# 168        h# 1e0 +mfpr
     116      d# 171        h# 2c8 +mfpr        \ PXA2128 only
     117      h# 15b h# 15c h# 140 +mfpr-range  \ MFPR_PIN_TWSI1_SCL - MFPR_PIN_TWSI1_SDA
     118      h# 15d h# 15e h# 2bc +mfpr-range  \ MFPR_PIN_TWSI4_SCL - MFPR_PIN_TWSI4_SDA
     119      h# 159        h# 2c4 +mfpr        \ MFPR_PIN_PMIC_INT
     120      h# 15f        h# 160 +mfpr        \ MFPR_PIN_CLK_REQ
     121      +mfpr-end
     122   " mrvl,pin-map" property
     123
     124end-package
  • cpu/arm/mmp2/spimaster.fth

    r2570 r3023  
    99
    10100 0 encode-bytes
    11    " Marvell,ssp-spi"  encode-string encode+
     11   " mrvl,ssp-spi"  encode-string encode+
    1212" compatible" property
     13   " /abpc" encode-phandle d# 19 encode-int encode+ " clocks" property
    1314
    1415my-address      my-space  h# 1000  encode-reg
  • cpu/arm/mmp2/timer.fth

    r2895 r3023  
    189189;
    190190' safe-idle to stdin-idle
     191
     1920 0  " d4014000" " /" begin-package
     193   " timer" name
     194   " mrvl,mmp-timer" +compatible
     195   my-address my-space  h# 100 reg
     196   d# 13 " interrupts" integer-property
     197   " /apbc" encode-phandle 9 encode-int encode+ " clocks" property
     198end-package
  • cpu/arm/mmp2/twsi.fth

    r2678 r3023  
    157157
    158158[ifdef] begin-package
     159: make-twsi-node  ( baseadr clock# irq# muxed-irq? fast? unit# -- )
     160   root-device
     161   new-device
     162      " linux,unit#" integer-property
     163      " i2c" name
     164      " mrvl,mmp-twsi" +compatible                    ( baseadr clock# irq# muxed-irq? fast? )
     165      if  0 0  " mrvl,i2c-fast-mode" property  then   ( baseadr clock# irq# muxed-irq? )
     166      if
     167          " /interrupt-controller/interrupt-controller@158" encode-phandle " interrupt-parent" property
     168      then                                            ( baseadr clock# irq# )
     169      " interrupts" integer-property                  ( baseadr clock# )
     170      " /apbc" encode-phandle rot encode-int encode+ " clocks" property
     171
     172      h# 1000 reg                                     ( )
     173      1 " #address-cells" integer-property
     174      1 " #size-cells" integer-property
     175      " : open true ; : close ;" evaluate
     176      " : encode-unit  ( phys.. -- str )  push-hex (u.) pop-base  ;" evaluate
     177      " : decode-unit  ( str -- phys.. )  push-hex  $number  if  0  then  pop-base  ;" evaluate
     178   finish-device
     179   device-end
     180;     
     181
     182\     baseadr   clk irq mux? fast? unit#
     183\ h# d4011000     1   7 false true     N make-twsi-node  \ TWSI1
     184\ h# d4031000     2   0 true  true     N make-twsi-node  \ TWSI2
     185\ h# d4032000     3   1 true  true     N make-twsi-node  \ TWSI3
     186  h# d4033000     4   2 true  true     0 make-twsi-node  \ TWSI4
     187\ h# d4038000 d# 30   3 true  true     N make-twsi-node  \ TWSI5
     188  h# d4034000 d# 31   4 true  true     1 make-twsi-node  \ TWSI6
     189
     1900 0  " 30" " /i2c@d4033000" begin-package  \ TWSI
     191   " touchscreen" name
     192   " raydium_ts" +compatible
     193   my-address my-space 1 reg
     194end-package
     195
     1960 0  " 19" " /i2c@d4034000" begin-package
     197   " accelerometer" name
     198   " lis3lv02d" +compatible
     199   my-address my-space 1 reg
     200end-package
     201
    1592020 0  " "  " /" begin-package
    160203" twsi" name
  • cpu/arm/mmp2/uart.fth

    r1987 r3023  
    11   " uart" name
     2   " mrvl,mmp-uart" +compatible
    23   my-space  h# 20  reg
    34
  • cpu/arm/olpc/1.75/usb.fth

    r2985 r3023  
    99   ;
    1010   : my-map-out  ( adr len -- )  swap h# 100 - swap " map-out" $call-parent  ;
     11   " /pmua" encode-phandle 5 encode-int encode+ " clocks" property
     12   d# 44 " interrupts" integer-property
     13
    1114   false constant has-dbgp-regs?
    1215   false constant needs-dummy-qh?
  • cpu/arm/olpc/build-fw.fth

    r3005 r3023  
    8282
    8383
     84fload ${BP}/cpu/arm/mmp2/pmua.fth
     85fload ${BP}/cpu/arm/mmp2/apbc.fth
     86fload ${BP}/cpu/arm/mmp2/irq.fth
    8487fload ${BP}/cpu/arm/mmp2/timer.fth
    8588fload ${BP}/cpu/arm/mmp2/twsi.fth
     
    99102warning !
    100103
    101 fload ${BP}/cpu/arm/mmp2/irq.fth
    102 
    103104fload ${BP}/cpu/arm/mmp2/watchdog.fth   \ reset-all using watchdog timer
    104105
    1051060 0  " d4018000"  " /" begin-package  \ UART3
    106107   fload ${BP}/cpu/arm/mmp2/uart.fth
     108   " /apbc" encode-phandle d# 12 encode-int encode+ " clocks" property
     109   d# 24 " interrupts" integer-property
     110   1 " linux,unit#" integer-property
    107111end-package
    108112devalias com1 /uart
     
    1121160 0  " d4030000"  " /" begin-package  \ UART1
    113117   fload ${BP}/cpu/arm/mmp2/uart.fth
     118   d# 27 " interrupts" integer-property
     119   " /apbc" encode-phandle d# 10 encode-int encode+ " clocks" property
     120   0 " linux,unit#" integer-property
    114121end-package
    115122devalias com2 /uart
     
    132139   " flash" device-name
    133140
     141   " /apbc" encode-phandle d# 19 encode-int encode+ " clocks" property
     142   d# 0 " interrupts" integer-property
    134143   h# 10.0000 value /device
    135144   my-address my-space h# 100 reg
     
    178187: hdd-led-on      ( -- )  ;
    179188: hdd-led-toggle  ( -- )  ;
    180 [then]
    181 [ifdef] olpc-cl2
     189[else]
    182190: hdd-led-off     ( -- )  d# 10 gpio-clr  ;
    183191: hdd-led-on      ( -- )  d# 10 gpio-set  ;
     
    220228' ofw-fw-filename$ to fw-filename$
    221229
     2300 0  " f0400000"  " /" begin-package
     231   " vmeta" name
     232   my-address my-space h# 1000 reg
     233
     234   " mrvl,mmp2-vmeta" +compatible
     235
     236   " /pmua" encode-phandle d# 10 encode-int encode+ " clocks" property
     237   d# 26 " interrupts" integer-property
     238end-package
     239
    2222400 0  " d420b000"  " /" begin-package
    223241   " display" name
    224 \+ olpc-cl2   fload ${BP}/cpu/arm/olpc/1.75/lcdcfg.fth
    225 \+ olpc-cl3   fload ${BP}/cpu/arm/olpc/3.0/lcdcfg.fth
     242   my-address my-space h# 1000 reg
     243
     244   " /pmua" encode-phandle 1 encode-int encode+ " clocks" property
     245   d# 41 " interrupts" integer-property
     246
     247[ifdef] olpc-cl3
     248   fload ${BP}/cpu/arm/olpc/3.0/lcdcfg.fth
     249[else]
     250   fload ${BP}/cpu/arm/olpc/1.75/lcdcfg.fth
     251[then]
    226252
    227253   fload ${BP}/cpu/arm/olpc/lcd.fth
    228 \+ olpc-cl2   fload ${BP}/dev/olpc/dcon/mmp2dcon.fth        \ DCON control
     254[ifndef] olpc-cl3
     255   fload ${BP}/dev/olpc/dcon/mmp2dcon.fth        \ DCON control
     256[then]
    229257   defer convert-color ' noop to convert-color
    230258   defer pixel*
     
    300328devalias screen /display
    301329   
    302 \- olpc-cl3 devalias keyboard /keyboard
    303 
    304 \+ olpc-cl2 create 15x30pc  " ${BP}/ofw/termemu/15x30pc.psf" $file,
    305 \+ olpc-cl2 ' 15x30pc to romfont
    306 \+ olpc-cl3 create cp881-16  " ${BP}/ofw/termemu/cp881-16.obf" $file,
    307 \+ olpc-cl3 ' cp881-16 to romfont
     330[ifdef] olpc-cl3
     331create cp881-16  " ${BP}/ofw/termemu/cp881-16.obf" $file,
     332' cp881-16 to romfont
     333[else]
     334devalias keyboard /keyboard
     335
     336create 15x30pc  " ${BP}/ofw/termemu/15x30pc.psf" $file,
     337' 15x30pc to romfont
     338[then]
    308339
    309340fload ${BP}/cpu/arm/olpc/sdhci.fth
    310341\- cl2-a1 fload ${BP}/cpu/arm/olpc/emmc.fth
    311342
    312 devalias int /sd/disk@3
    313 devalias ext /sd/disk@1
     343devalias int /sd/sdhci@d4281000/disk
     344devalias ext /sd/sdhci@d4280000/disk
    314345devalias net /wlan  \ XXX should report-net in case of USB Ethernet
    315346
     
    371402\+ olpc-cl3 fload ${BP}/cpu/arm/mmp2/ulpiphy.fth
    372403\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/usb.fth
     404\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/usb.fth
    373405
    374406fload ${BP}/dev/olpc/mmp2camera/loadpkg.fth
     
    394426\+ olpc-cl2  " olpc,xo-1.75" " compatible" string-property
    395427\+ olpc-cl3  " olpc,xo-3.0"  " compatible" string-property
     428\+ olpc-cl4  " olpc,xo-cl4"  " compatible" string-property
    396429
    397430      \ The "1-" removes the null byte
     
    403436      ['] ec-date$  catch  0=  if  " ec-date" string-property  then
    404437      ['] ec-user$  catch  0=  if  " ec-user" string-property  then
     438      " /interrupt-controller" encode-phandle " interrupt-parent" property
     439\      " /interrupt-controller"  find-package  if
     440\         " interrupt-parent" integer-property
     441\      then
     442      0 0 " ranges" property
    405443   dend
    406444
     
    421459fload ${BP}/cpu/arm/mmp2/thermal.fth
    422460fload ${BP}/cpu/arm/mmp2/fuse.fth
     461fload ${BP}/cpu/arm/olpc/bsl.fth
    423462
    424463[ifndef] virtual-mode
     
    510549;
    511550
    512 \+ olpc-cl2 : rotate-button?  ( -- flag )  d# 15 gpio-pin@ 0=  ;
    513 \+ olpc-cl3 false value rotate-button?
     551[ifdef] olpc-cl3
     552false value rotate-button?
     553[else]
     554: rotate-button?  ( -- flag )  d# 15 gpio-pin@ 0=  ;
     555[then]
     556
    514557warning @  warning off
    515558: init
     
    626669code halt  ( -- )  wfi   c;
    627670
     671\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/switches.fth \ Lid and ebook switches
    628672\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/switches.fth  \ Switches
    629 \+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/switches.fth \ Lid and ebook switches
     673\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/switches.fth  \ Lid and ebook switches
     674
    630675fload ${BP}/cpu/arm/mmp2/rtc.fth       \ Internal RTC, used for wakeups
    631 \+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/leds.fth     \ LEDs
     676
    632677\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/leds.fth     \ LEDs
     678\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/leds.fth      \ LEDs
     679\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/leds.fth      \ LEDs
     680
    633681fload ${BP}/cpu/x86/pc/olpc/via/factory.fth  \ Manufacturing tools
    634682
    635683fload ${BP}/cpu/arm/olpc/accelerometer.fth
    636 \+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/compass.fth
     684
     685[ifndef] olpc-cl3
     686fload ${BP}/cpu/arm/olpc/1.75/compass.fth
     687[then]
    637688
    638689\ Suppress long memory test at final test stage
     
    701752fload ${BP}/cpu/x86/pc/olpc/gamekeynames.fth
    702753
     754[ifdef] cl2-a1
    703755: game-key@  ( -- n )
    704756   0                                        ( n )
    705 [ifdef] cl2-a1
    706757   d# 16 gpio-pin@ 0=  if  h#  80 or  then  \ O
    707758   d# 17 gpio-pin@ 0=  if  h#  02 or  then  \ Check
     
    709760   d# 19 gpio-pin@ 0=  if  h#  01 or  then  \ Square
    710761   d# 20 gpio-pin@ 0=  if  h#  40 or  then  \ Rotate
    711 [then]
    712 [ifdef] olpc-cl2
    713 [ifdef] use_mmp2_keypad_control
     762;
     763[then]
     764
     765defined? olpc-cl2  defined? olpc-cl4 or  [if]
     766
     767   [ifdef] use_mmp2_keypad_control
     768: game-key@  ( -- n )
     769   0                                        ( n )
    714770   d# 15 gpio-pin@ 0=  if  button-rotate or  then   ( n )
    715771   scan-keypad                              ( n keypad )
     
    723779   rocker-left    h# 80  keypad-bit         ( n' keypad )
    724780   drop                                     ( n )
    725 [else]
     781;
     782   [else]
     783: game-key@  ( -- n )
     784   0                                        ( n )
    726785   d# 15 gpio-pin@ 0=  if  button-rotate  or  then
    727786   d# 16 gpio-pin@ 0=  if  button-o       or  then
     
    733792   d# 22 gpio-pin@ 0=  if  rocker-down    or  then
    734793   d# 23 gpio-pin@ 0=  if  rocker-left    or  then
    735 [then]
    736 [then]
    737 ;
     794;
     795   [then]
     796
     797[then]
    738798
    739799fload ${BP}/cpu/x86/pc/olpc/gamekeys.fth
     
    757817fload ${BP}/cpu/x86/pc/olpc/gridmap.fth      \ Gridded display tools
    758818fload ${BP}/cpu/x86/pc/olpc/via/copynand.fth
     819
     820\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/rm3150-touchscreen.fth    \ Touchscreen driver and diagnostic
    759821\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/exc7200-touchscreen.fth    \ Touchscreen driver and diagnostic
    760822\+ olpc-cl3 fload ${BP}/dev/softkeyboard.fth                    \ On-screen keyboard
    761 \+ olpc-cl2 fload ${BP}/cpu/arm/olpc/rm3150-touchscreen.fth    \ Touchscreen driver and diagnostic
     823\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/nn-touchscreen.fth        \ Touchscreen driver and diagnostic
    762824fload ${BP}/cpu/arm/olpc/roller.fth     \ Accelerometer test
    763825
     
    829891
    830892\ create pong-use-touchscreen
    831 fload ${BP}/ofw/gui/ofpong.fth
    832 fload ${BP}/cpu/x86/pc/olpc/life.fth
     893\ fload ${BP}/ofw/gui/ofpong.fth
    833894
    834895d# 999 ' screen-#rows    set-config-int-default  \ Expand the terminal emulator to fill the screen
     
    898959   rocker-right game-key?  if
    899960      protect-fw
    900       time&date 5drop 1 and  if
    901          ['] pong guarded
    902       else
    903          ['] life-demo guarded
    904       then
     961\      ['] pong guarded
    905962      power-off
    906963   then
     
    9651022
    9661023fload ${BP}/cpu/arm/olpc/testitems.fth
     1024\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/testinstructions.fth
    9671025\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/testinstructions.fth
    968 \+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/testinstructions.fth
     1026\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/testinstructions.fth
    9691027
    9701028: startup  ( -- )
  • cpu/arm/olpc/rtc.fth

    r2977 r3023  
    11purpose: Driver for external IDT1338 RTC chip on XO-1.75
    22
    3 0 0  " "  " /" begin-package
    4 " rtc" name
     30 0  " d4010000"  " /" begin-package
     4   " rtc" name
     5   " mrvl,mmp-rtc" +compatible
     6   my-address my-space  h# 1000 reg
     7
     8   d# 1 encode-int  0 encode-int encode+ " interrupts" property
     9   " /interrupt-controller/interrupt-controller@154" encode-phandle " interrupt-parent" property
     10
     11   " rtc 1Hz" encode-string " rtc alarm" encode-string  encode+ " interrupt-names" property
     12
     13         
     14   " /apbc" encode-phandle 0 encode-int encode+ " clocks" property
    515
    616[ifdef] cl2-a1
  • cpu/arm/olpc/sdhci.fth

    r2748 r3023  
    11purpose: Load file for SDHCI (Secure Digital Host Controller Interface)
    22
    3 0 0  " d4280000"  " /"  begin-package
     30 0  " "  " /"  begin-package
    44
    55   fload ${BP}/cpu/arm/olpc/sdregs.fth
    66   fload ${BP}/dev/mmc/sdhci/sdhci.fth
     7
     8   " simple-bus" +compatible
     9   h# d4280000 encode-int  h# d4280000 encode-int encode+  h# 2000 encode-int encode+  " ranges" property
     10   1 " #address-cells" integer-property
     11   1 " #size-cells" integer-property
    712
    813   d# 1 to power-off-time  \ A2 and A3 have turn-off clamps
     
    1015
    1116   hex
     17   : slot#  ( -- n )  slot h# d4280000 -  h# 800 /  1+  ;
    1218   : olpc-card-inserted?  ( -- flag )
    13       slot 1 =  if  d# 31 gpio-pin@ 0=  else  true  then
     19      slot# 1 =  if  d# 31 gpio-pin@ 0=  else  true  then
    1420   ;
    1521   ' olpc-card-inserted? to card-inserted?
     
    1925      sdhci-card-power-on
    2026\ The CL3 version below actually works for CL2 >= B1
    21 \+ olpc-cl2  d# 36 slot - gpio-set
    22 \+ olpc-cl3  slot 2 =  if  d# 34 gpio-set  then
     27\+ olpc-cl2  d# 36 slot# - gpio-set
     28\+ olpc-cl3  slot# 2 =  if  d# 34 gpio-set  then
    2329   ;
    2430   ' gpio-power-on to card-power-on
    2531
    2632   : gpio-power-off  ( -- )
    27 \+ olpc-cl2  d# 36 slot - gpio-clr
    28 \+ olpc-cl3  slot 2 =  if  d# 34 gpio-clr  then
     33\+ olpc-cl2  d# 36 slot# - gpio-clr
     34\+ olpc-cl3  slot# 2 =  if  d# 34 gpio-clr  then
    2935      sdhci-card-power-off
    3036   ;
     
    3238
    3339\+ olpc-cl2   new-device
    34 \+ olpc-cl2      1 encode-int " reg" property
    35 \+ olpc-cl2      fload ${BP}/dev/mmc/sdhci/sdmmc.fth
    36 \+ olpc-cl2      fload ${BP}/dev/mmc/sdhci/selftest.fth
    37 \+ olpc-cl2      " external" " slot-name" string-property
     40\+ olpc-cl2      h# d428.0000 h# 800 reg
     41\+ olpc-cl2      8 encode-int " bus-width" property
     42\+ olpc-cl2      " mrvl,pxav3-mmc" encode-string  " compatible" property
     43\+ olpc-cl2      d# 31 encode-int " clk-delay-cycles" property
     44\+ olpc-cl2      fload ${BP}/dev/mmc/sdhci/slot.fth
     45\+ olpc-cl2      d# 39 " interrupts" integer-property
     46
     47\+ olpc-cl2      " /pmua" encode-phandle 3 encode-int encode+ " clocks" property
     48\+ olpc-cl2      " PXA-SDHCLK" " clock-names" string-property
     49
     50\+ olpc-cl2      new-device
     51\+ olpc-cl2         fload ${BP}/dev/mmc/sdhci/sdmmc.fth
     52\+ olpc-cl2         fload ${BP}/dev/mmc/sdhci/selftest.fth
     53\+ olpc-cl2         " external" " slot-name" string-property
     54\+ olpc-cl2      finish-device
    3855\+ olpc-cl2   finish-device
    3956
    4057   new-device
    41       2 encode-int " reg" property
    42       fload ${BP}/dev/mmc/sdhci/mv8686/loadpkg.fth
     58      h# d428.0800 h# 800 reg
     59      8 encode-int " bus-width" property
     60      " sdhci-pxav3" +compatible
     61      " mrvl,pxav3-mmc" +compatible
     62      d# 31 encode-int " clk-delay-cycles" property
     63      0 0  " non-removable" property
     64      d# 52 " interrupts" integer-property
     65
     66      " /pmua" encode-phandle 4 encode-int encode+ " clocks" property
     67      " PXA-SDHCLK" " clock-names" string-property
     68
     69      fload ${BP}/dev/mmc/sdhci/slot.fth
     70      new-device
     71         fload ${BP}/dev/mmc/sdhci/mv8686/loadpkg.fth
     72      finish-device
    4373   finish-device
    4474
    4575   new-device
    46       3 encode-int " reg" property
    47       fload ${BP}/dev/mmc/sdhci/sdmmc.fth
    48       fload ${BP}/dev/mmc/sdhci/selftest.fth
    49       " internal" " slot-name" string-property
     76      h# d428.1000 h# 800 reg
     77      0 0  " non-removable" property
     78      8 encode-int " bus-width" property
     79      " sdhci-pxav3" +compatible
     80      " mrvl,pxav3-mmc" +compatible
     81      d# 31 encode-int " clk-delay-cycles" property
     82      d# 53 " interrupts" integer-property
     83
     84      " /pmua" encode-phandle d# 14 encode-int encode+ " clocks" property
     85      " PXA-SDHCLK" " clock-names" string-property
     86
     87      fload ${BP}/dev/mmc/sdhci/slot.fth
     88      new-device
     89         fload ${BP}/dev/mmc/sdhci/sdmmc.fth
     90         fload ${BP}/dev/mmc/sdhci/selftest.fth
     91         " internal" " slot-name" string-property
     92      finish-device
    5093   finish-device
    5194
  • cpu/arm/olpc/sdregs.fth

    r2726 r3023  
    550 instance value chip
    66
    7 my-space /regs  reg
     7\ my-space /regs  reg
    88
    99: map-regs  ( -- )
    1010   chip  if  exit  then
    11    slot 1-  h# 800 *  my-space + /regs " map-in" $call-parent
     11   slot /regs " map-in" $call-parent
    1212   to chip
    1313;
  • cpu/arm/olpc/sound.fth

    r2814 r3023  
    22" audio" name
    33my-space h# 800 reg
     4
     5" /pmua" encode-phandle d# 20 encode-int encode+ " clocks" property
     6d# 2 " interrupts" integer-property
    47
    580 value sspa-base  \ E.g. h# 2a.0c00 +io
  • cpu/arm/olpc/spcmd.fth

    r2582 r3023  
    2525   " olpc,ap-sp"  encode-string encode+
    2626" compatible" property
     27   d# 40 " interrupts" integer-property
     28   " /pmua" encode-phandle 8 encode-int encode+ " clocks" property
    2729
    2830my-address      my-space  h# 1000  encode-reg
  • dev/olpc/kb3700/spicmd.fth

    r2574 r3023  
    35351 " #address-cells"  integer-property
    36360 " #size-cells"     integer-property
     37
     38   d# 20 " interrupts" integer-property
     39   " /apbc" encode-phandle d# 21 encode-int encode+ " clocks" property
     40
    3741
    3842: encode-unit  ( phys -- adr len )  push-hex  (u.)  pop-base  ;
  • dev/olpc/mmp2camera/loadpkg.fth

    r2880 r3023  
    11" "  " d420a000" " /"  begin-package
    22   " camera" device-name
    3    0 0 reg  \ A reg property makes "test-all" consider this device
     3   my-address my-space  h# 800  reg
     4   " /pmua" encode-phandle 2 encode-int encode+ " clocks" property
     5   d# 42 " interrupts" integer-property
    46
    570 [if]
  • ofw/core/fdt.fth

    r2917 r3023  
    5353;
    5454
    55 also client-services
    5655: flatten-path  ( -- )
    5756   the-node phandle>devname       ( adr len )
     
    177176   \ Test for unprintable characters
    178177   2dup -null text?  if   
    179       to-display-column  -null  type exit 
     178      to-display-column  -null  type cr exit 
    180179   then   ( adr,len )
    181180
     
    213212   again
    214213;
    215 
    216 previous
    217214
    218215\ LICENSE_BEGIN
Note: See TracChangeset for help on using the changeset viewer.