Author: wmb Date: Wed Aug 1 00:41:17 2012 New Revision: 3105 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3105
Log: OLPC CL4 - fix USB2 PHY init and reinstate USB probing.
Modified: cpu/arm/mmp3/usb2phy.fth cpu/arm/olpc/build-fw.fth cpu/arm/olpc/usb.fth
Modified: cpu/arm/mmp3/usb2phy.fth ============================================================================== --- cpu/arm/mmp3/usb2phy.fth Tue Jul 31 11:05:47 2012 (r3104) +++ cpu/arm/mmp3/usb2phy.fth Wed Aug 1 00:41:17 2012 (r3105) @@ -3,16 +3,16 @@
: +usb2 ( offset -- offset' ) h# 20.7000 + ;
-h# 04 +usb2 constant pll-reg0 -h# 08 +usb2 constant pll-reg1 -h# 10 +usb2 constant tx-reg0 -h# 14 +usb2 constant tx-reg1 -h# 18 +usb2 constant tx-reg2 -h# 20 +usb2 constant rx-reg0 -h# 24 +usb2 constant rx-reg1 -h# 28 +usb2 constant rx-reg2 + h# 04 +usb2 constant pll-reg0 + h# 08 +usb2 constant pll-reg1 + h# 10 +usb2 constant tx-reg0 + h# 14 +usb2 constant tx-reg1 + h# 18 +usb2 constant tx-reg2 + h# 20 +usb2 constant rx-reg0 + h# 24 +usb2 constant rx-reg1 + h# 28 +usb2 constant rx-reg2 \ h# 30 +usb2 constant ana-reg0 -\ h# 34 +usb2 constant ana-reg1 + h# 34 +usb2 constant ana-reg1 \ h# 38 +usb2 constant ana-reg2 \ h# 3c +usb2 constant dig-reg0 \ h# 40 +usb2 constant dig-reg1 @@ -22,9 +22,9 @@ \ h# 50 +usb2 constant test-reg1 \ h# 54 +usb2 constant test-reg2 \ h# 58 +usb2 constant charger-reg0 -\ h# 5c +usb2 constant otg-reg0 + h# 5c +usb2 constant otg-reg0 \ h# 60 +usb2 constant phy-mono -\ h# 64 +usb2 constant resetve-reg0 + h# 64 +usb2 constant reserve-reg0 \ h# 78 +usb2 constant icid-reg0 \ h# 7c +usb2 constant icid-reg1
@@ -38,28 +38,43 @@
: init-usb-phy ( -- ) h# f00 h# 100 +pmua io-clr -\ h# d00 h# 100 +pmua io-set \ Select 26 MHz VCXO clock - h# 200 h# 100 +pmua io-set \ Select crystal +\ h# d00 h# 100 +pmua io-set \ Select 26 MHz VCXO clock + h# 000 h# 100 +pmua io-set \ Select crystal
- h# 3fff pll-reg0 io-clr \ REFDIV_MASK_B0 3e00, FBDIV_MASK_B0 01ff - h# 1af0 pll-reg0 io-set \ 0xd << 9 , 0xf0 << 0 +\ h# 3fff pll-reg0 io-clr \ REFDIV_MASK_B0 3e00, FBDIV_MASK_B0 01ff +\ h# 1af0 pll-reg0 io-set \ 0xd << 9 , 0xf0 << 0 +\ h# ca60 is the value to use for a 25 MHz crystal + h# daf0 pll-reg0 io-set \ 0xd << 9 , 0xf0 << 0
- h# 2773 pll-reg1 io-clr \ PU_PLL_MASK 2000, (LOCK_BYPASS) 1000, ICP_MASK 700, KVCO_MASK 70, CALI12_MASK 3 - h# 3333 pll-reg1 io-set \ 1 1 3 3 3 + h# 3000 reserve-reg0 io! \ Program PLLVDD12 per Marvell email
- h# 0700 tx-reg0 io-clr \ TX_IMPCAL_VTH_MASK 0700 - h# 0200 tx-reg0 io-set \ 2 +\ h# 2773 pll-reg1 io-clr \ PU_PLL_MASK 2000, (LOCK_BYPASS) 1000, ICP_MASK 700, KVCO_MASK 70, CALI12_MASK 3 +\ h# 3333 pll-reg1 io-set \ 1 1 3 3 3
- h# 037f tx-reg1 io-clr \ TX_VDD12_MASK 300 , TX_AMP_MASK 70, TX_CK60_PHSEL_MASK f - h# 0344 tx-reg1 io-set \ 3 4 4 + h# 1433 pll-reg1 io! + d# 100 ms + h# 3433 pll-reg1 io!
- h# 0c00 tx-reg2 io-clr \ TX_DRV_SLEWRATE_MASK c00 - h# 0800 tx-reg2 io-set \ 2 << 10 +\ h# 0700 tx-reg0 io-clr \ TX_IMPCAL_VTH_MASK 0700 +\ h# 0200 tx-reg0 io-set \ 2 + h# 0588 tx-reg0 io! \ 2
- h# 00f0 rx-reg0 io-clr \ RX_SQ_THRESH_MASK 00f0 - h# 00a0 rx-reg0 io-set \ a +\ h# 037f tx-reg1 io-clr \ TX_VDD12_MASK 300 , TX_AMP_MASK 70, TX_CK60_PHSEL_MASK f +\ h# 0344 tx-reg1 io-set \ 3 4 4 + h# 07c4 tx-reg1 io!
- h# 0008 rx-reg1 io-set \ 1 << OTG_PU_OTG_SHIFT (3) +\ h# 0c00 tx-reg2 io-clr \ TX_DRV_SLEWRATE_MASK c00 +\ h# 0800 tx-reg2 io-set \ 2 << 10 + h# 0eff tx-reg2 io! + +\ h# 00f0 rx-reg0 io-clr \ RX_SQ_THRESH_MASK 00f0 +\ h# 00a0 rx-reg0 io-set \ a + h# aaa1 rx-reg0 io! + + h# 5000 ana-reg1 io-set \ Power up Analog Port + h# 0008 otg-reg0 io-set \ Power up OTG Port + +\ h# 0008 rx-reg1 io-set \ 1 << OTG_PU_OTG_SHIFT (3)
\ Calibrate PHY d# 200 us
Modified: cpu/arm/olpc/build-fw.fth ============================================================================== --- cpu/arm/olpc/build-fw.fth Tue Jul 31 11:05:47 2012 (r3104) +++ cpu/arm/olpc/build-fw.fth Wed Aug 1 00:41:17 2012 (r3105) @@ -316,9 +316,6 @@ warning @ warning off : stand-init stand-init -[ifdef] olpc-cl4 -." build-fw.fth: Skipping root node properties" cr exit -[then] root-device model-version$ 2dup model ( name$ ) " OLPC " encode-bytes 2swap encode-string encode+ " banner-name" property @@ -856,11 +853,7 @@ + use-screen-kbd ?text-on [ifdef] probe-usb factory-test? if d# 1000 ms then \ Extra USB probe delay in the factory -[ifdef] olpc-cl4 - ." build-fw.fth: not probing usb" cr -[else] probe-usb -[then] report-disk report-keyboard [then]
Modified: cpu/arm/olpc/usb.fth ============================================================================== --- cpu/arm/olpc/usb.fth Tue Jul 31 11:05:47 2012 (r3104) +++ cpu/arm/olpc/usb.fth Wed Aug 1 00:41:17 2012 (r3105) @@ -29,9 +29,6 @@ : init-usb ( -- ) h# 9 h# 5c pmua! \ Enable clock to USB block reset-usb-hub -[ifdef] olpc-cl4 - ." olpc/usb.fth: Skipping USB phy init!" cr exit -[then] init-usb-phy ;