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