Author: wmb
Date: Tue Dec 6 08:10:34 2011
New Revision: 2734
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2734
Log:
OLPC XO-3 - USB SPH / ULPI PHY now working.
Added:
cpu/arm/mmp2/ulpiphy.fth
Modified:
cpu/arm/olpc/3.0/usb.fth
Added: cpu/arm/mmp2/ulpiphy.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/mmp2/ulpiphy.fth Tue Dec 6 08:10:34 2011 (r2734)
@@ -0,0 +1,38 @@
+\ See license at end of file
+purpose: Access to miscellaneous control/enable registers for the ULPI PHY portion of the USB SPH controller
+
+h# 3800 io2-va + constant usbsph-misc-va
+: usbsph-misc@ ( -- n ) usbsph-misc-va 4 + l@ ;
+: usbsph-misc! ( n -- ) usbsph-misc-va 4 + l! ;
+: usbsph-int@ ( -- n ) usbsph-misc-va h# 28 + l@ ;
+: usbsph-int! ( n -- ) usbsph-misc-va h# 28 + l! ;
+: usbsph-ctrl@ ( -- n ) usbsph-misc-va h# 30 + l@ ;
+: usbsph-ctrl! ( n -- ) usbsph-misc-va h# 30 + l! ;
+: ulpi-on ( -- ) h# 0800.0000 usbsph-misc! ;
+: ulpi-resume-interrupt-on ( -- ) 2 usbsph-int! ;
+: ulpi-clock-on ( -- ) usbsph-ctrl@ 1 or usbsph-ctrl! ;
+: ulpi-clock-select ( -- ) usbsph-ctrl@ h# 400 or usbsph-ctrl! ;
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2011 FirmWorks
+\
+\ Permission is hereby granted, free of charge, to any person obtaining
+\ a copy of this software and associated documentation files (the
+\ "Software"), to deal in the Software without restriction, including
+\ without limitation the rights to use, copy, modify, merge, publish,
+\ distribute, sublicense, and/or sell copies of the Software, and to
+\ permit persons to whom the Software is furnished to do so, subject to
+\ the following conditions:
+\
+\ The above copyright notice and this permission notice shall be
+\ included in all copies or substantial portions of the Software.
+\
+\ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+\ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+\ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+\ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+\ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+\ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+\ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+\
+\ LICENSE_END
Modified: cpu/arm/olpc/3.0/usb.fth
==============================================================================
--- cpu/arm/olpc/3.0/usb.fth Tue Dec 6 08:10:23 2011 (r2733)
+++ cpu/arm/olpc/3.0/usb.fth Tue Dec 6 08:10:34 2011 (r2734)
@@ -20,7 +20,7 @@
: wake ( -- ) ;
end-package
-0 0 " f0001000" " /" begin-package \ USB Host Controller 1 - ULPI
+0 0 " f0003000" " /" begin-package \ USB Host Controller 1 - ULPI
h# 200 constant /regs
my-address my-space /regs reg
: my-map-in ( len -- adr )
@@ -44,6 +44,9 @@
;
: reset-usb-hub ( -- )
d# 146 gpio-clr d# 10 ms d# 146 gpio-set \ Resets ULPI hub
+ ulpi-clock-on
+ ulpi-clock-select
+ ulpi-on
;
: init-usb ( -- )
Author: wmb
Date: Tue Dec 6 08:10:23 2011
New Revision: 2733
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2733
Log:
OLPC XO-3 - More of Added I/O mapping support for the fragment of I/O space that is discontinous with the rest of I/O space, for the benefit of the USB Single-Port Host controller which is in that other area.
Modified:
cpu/arm/olpc/addrs.fth
Modified: cpu/arm/olpc/addrs.fth
==============================================================================
--- cpu/arm/olpc/addrs.fth Tue Dec 6 08:10:17 2011 (r2732)
+++ cpu/arm/olpc/addrs.fth Tue Dec 6 08:10:23 2011 (r2733)
@@ -15,6 +15,7 @@
h# fdc0.0000 constant fb-mem-va
h# fe00.0000 constant io-va \ We map IO (APB + AXI) space at this virtual address
+h# fe30.0000 constant io2-va \ Mapping area for AXI2 space
[ifdef] virtual-mode
h# f700.0000 constant fw-virt-base
Author: wmb
Date: Tue Dec 6 08:10:17 2011
New Revision: 2732
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2732
Log:
OLPC XO-3 - Added I/O mapping support for the fragment of I/O space that is discontinous with the rest of I/O space, for the benefit of the USB Single-Port Host controller which is in that other area.
Modified:
cpu/arm/mmp2/hwaddrs.fth
cpu/arm/mmp2/rootnode.fth
cpu/arm/olpc/initmmu.fth
Modified: cpu/arm/mmp2/hwaddrs.fth
==============================================================================
--- cpu/arm/mmp2/hwaddrs.fth Tue Dec 6 08:10:06 2011 (r2731)
+++ cpu/arm/mmp2/hwaddrs.fth Tue Dec 6 08:10:17 2011 (r2732)
@@ -6,12 +6,17 @@
h# d400.0000 constant apb-pa \ Base of APB bus
h# d420.0000 constant axi-pa \ Base of AXI bus
+h# f000.0000 constant axi2-pa \ Another AXI bus area
h# e000.0000 constant audio-sram-pa \ Base of Audio SRAM
h# 0010.0000 constant /audio-sram \ Size of Audio SRAM
apb-pa constant io-pa \ We use this as the base for most IO accesses
-h# 0040.0000 constant /io
+h# 0030.0000 constant /io
+
+axi2-pa constant io2-pa \ Additional I/O space
+h# 0010.0000 constant /io2
+
\ The following are offsets from io-pa
\ AXI devices
Modified: cpu/arm/mmp2/rootnode.fth
==============================================================================
--- cpu/arm/mmp2/rootnode.fth Tue Dec 6 08:10:06 2011 (r2731)
+++ cpu/arm/mmp2/rootnode.fth Tue Dec 6 08:10:17 2011 (r2732)
@@ -25,10 +25,18 @@
: close ( -- ) ;
: map-in ( phys size -- virt )
- drop ( phys )
+ drop ( phys )
\ The display driver uses fb-mem-va directly instead of calling map-in
\ dup fb-mem-va >physical = if drop fb-mem-va exit then ( phys )
- io-pa - io-va +
+ dup io2-pa u>= if ( phys )
+ io2-pa - io2-va + ( virt )
+ exit
+ then ( phys )
+ dup io-pa u>= if ( phys )
+ io-pa - io-va + ( virt )
+ exit
+ then ( phys )
+ \ Fall through to return virt == phys
;
: map-out ( virtual size -- )
2drop
Modified: cpu/arm/olpc/initmmu.fth
==============================================================================
--- cpu/arm/olpc/initmmu.fth Tue Dec 6 08:10:06 2011 (r2731)
+++ cpu/arm/olpc/initmmu.fth Tue Dec 6 08:10:17 2011 (r2732)
@@ -316,6 +316,12 @@
set r4,`io-va #` \ Virtual address
bl `map-sections`
+ set r1,`io2-pa #` \ Address of I/O
+ set r2,`/io2 #` \ Size of I/O region
+ set r3,#0xc02 \ No caching or write buffering
+ set r4,`io2-va #` \ Virtual address
+ bl `map-sections`
+
mov pc, r10
end-code
Author: wmb
Date: Sat Dec 3 01:51:56 2011
New Revision: 2730
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2730
Log:
OLPC XO-3 - changed cforth-version from "modify" back to HEAD
Modified:
cpu/arm/olpc/3.0/cforth-version.fth
Modified: cpu/arm/olpc/3.0/cforth-version.fth
==============================================================================
--- cpu/arm/olpc/3.0/cforth-version.fth Sat Dec 3 01:45:21 2011 (r2729)
+++ cpu/arm/olpc/3.0/cforth-version.fth Sat Dec 3 01:51:56 2011 (r2730)
@@ -3,7 +3,7 @@
\ If CFORTH_VERSION is "modify", the repository will be cloned with git+ssh: so can push changes.
\ You need ssh access to the server.
-macro: CFORTH_VERSION modify
+\ macro: CFORTH_VERSION modify
\ If CFORTH_VERSION is "clone", the repository will be cloned with git:. You won't be able to
\ push changes, but you will get the full metadata so you can use commands like git grep.
@@ -12,6 +12,6 @@
\ Otherwise, the source code will be will be downloaded as a tarball via gitweb.
\ macro: CFORTH_VERSION 59859f04454bc2574ab68cf0fd76ebdbc5f26fb6
-\ macro: CFORTH_VERSION HEAD
+macro: CFORTH_VERSION HEAD
macro: CFORTH_BUILD_DIR cforth/build/arm-xo-3.0