Changeset 3040
- Timestamp:
- Jul 7, 2012 4:18:02 AM (11 months ago)
- Location:
- cpu/arm/olpc
- Files:
-
- 3 edited
-
build-fw.fth (modified) (1 diff)
-
sdhci.fth (modified) (4 diffs)
-
sdregs.fth (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/olpc/build-fw.fth
r3036 r3040 358 358 [then] 359 359 360 devalias int /sd/ sdhci@d4281000/disk361 devalias ext /sd/ sdhci@d4280000/disk360 devalias int /sd/disk@3 361 devalias ext /sd/disk@1 362 362 devalias net /wlan \ XXX should report-net in case of USB Ethernet 363 363 -
cpu/arm/olpc/sdhci.fth
r3023 r3040 1 1 purpose: Load file for SDHCI (Secure Digital Host Controller Interface) 2 2 3 0 0 " " " /" begin-package3 0 0 " d4280000" " /" begin-package 4 4 5 5 fload ${BP}/cpu/arm/olpc/sdregs.fth 6 6 fload ${BP}/dev/mmc/sdhci/sdhci.fth 7 8 " simple-bus" +compatible9 h# d4280000 encode-int h# d4280000 encode-int encode+ h# 2000 encode-int encode+ " ranges" property10 1 " #address-cells" integer-property11 1 " #size-cells" integer-property12 7 13 8 d# 1 to power-off-time \ A2 and A3 have turn-off clamps … … 15 10 16 11 hex 17 : slot# ( -- n ) slot h# d4280000 - h# 800 / 1+ ;18 12 : olpc-card-inserted? ( -- flag ) 19 slot #1 = if d# 31 gpio-pin@ 0= else true then13 slot 1 = if d# 31 gpio-pin@ 0= else true then 20 14 ; 21 15 ' olpc-card-inserted? to card-inserted? … … 25 19 sdhci-card-power-on 26 20 \ The CL3 version below actually works for CL2 >= B1 27 \+ olpc-cl2 d# 36 slot #- gpio-set28 \+ olpc-cl3 slot #2 = if d# 34 gpio-set then21 \+ olpc-cl2 d# 36 slot - gpio-set 22 \+ olpc-cl3 slot 2 = if d# 34 gpio-set then 29 23 ; 30 24 ' gpio-power-on to card-power-on 31 25 32 26 : gpio-power-off ( -- ) 33 \+ olpc-cl2 d# 36 slot #- gpio-clr34 \+ olpc-cl3 slot #2 = if d# 34 gpio-clr then27 \+ olpc-cl2 d# 36 slot - gpio-clr 28 \+ olpc-cl3 slot 2 = if d# 34 gpio-clr then 35 29 sdhci-card-power-off 36 30 ; … … 38 32 39 33 \+ olpc-cl2 new-device 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 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 55 38 \+ olpc-cl2 finish-device 56 39 57 40 new-device 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 41 2 encode-int " reg" property 42 fload ${BP}/dev/mmc/sdhci/mv8686/loadpkg.fth 73 43 finish-device 74 44 75 45 new-device 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 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 93 50 finish-device 94 51 -
cpu/arm/olpc/sdregs.fth
r3023 r3040 5 5 0 instance value chip 6 6 7 \my-space /regs reg7 my-space /regs reg 8 8 9 9 : map-regs ( -- ) 10 10 chip if exit then 11 slot /regs " map-in" $call-parent11 slot 1- h# 800 * my-space + /regs " map-in" $call-parent 12 12 to chip 13 13 ;
Note: See TracChangeset
for help on using the changeset viewer.
