]> git.hungrycats.org Git - linux/commitdiff
[ARM PATCH] 2493/1: put IXP2000 slowport in 8-bit mode after boot
authorLennert Buytenhek <buytenh@org.rmk.(none)>
Fri, 18 Feb 2005 21:48:16 +0000 (21:48 +0000)
committerRussell King <rmk@flint.arm.linux.org.uk>
Fri, 18 Feb 2005 21:48:16 +0000 (21:48 +0000)
Patch from Lennert Buytenhek

This is an old patch from 2.6.9-rc3-ds2 that never made it upstream.
The IXP2000 slowport has two modes of operation, 8-bit and 32-bit.
The slowport itself is a byte-wide bus, and in 8-bit mode, it does the
more-or-less obvious thing: every word read causes four byte reads,
and those bytes are then combined into a word according to the xscale
core's current endian setting.  So, what value you get depends on what
endianity your IXP2000 is running in.
In 32-bit mode, however, it is the slowport itself which combines
bytes into words, and for this it unconditionally uses little endian
mode.  In this mode, word reads from the slowport will return the
same value no matter whether the xscale core is running in big or
little endian mode.  This can be a plus in some cases.  Byte (and
halfword) accesses in 32-bit mode have rather useless semantics
due to this, though.
The usefulness of 32-bit mode is limited to the initial boot.  When
the IXP2000 resets, the slowport is always in 32-bit mode, so if you
flash the bootloader into flash (which is connected to the slowport)
using little-endian byte ordering, the xscale will always read the
instruction stream correctly, no matter whether it's running in big
or little endian mode.
After booting it makes no sense to use 32-bit mode anymore.  Especially
since the slowport's word ordering in 32-bit mode is little endian,
and the IXP2000 is conventionally run in big endian, which gives all
kinds of fun issues when trying to access peripherals connected to
the slowport.
In fact, the current MTD map driver for IXP2000 already sets the
slowport to 8-bit mode because it cannot access the flash otherwise.
However, this means that if the MTD map driver is not compiled in for
some reason, the slowport will stay in 32-bit mode after the initial
boot, which will cause peripheral accesses to unexpectedly break!

Signed-off-by: Lennert Buytenhek
Signed-off-by: Russell King
arch/arm/mach-ixp2000/core.c

index a98f69aeb48d4292436547f3ab8d3af9455fb887..36d9ecedaea977785926a16a0f9ebc7d726ca23b 100644 (file)
@@ -160,6 +160,9 @@ void __init ixp2000_map_io(void)
        iotable_init(ixp2000_small_io_desc, ARRAY_SIZE(ixp2000_small_io_desc));
        iotable_init(ixp2000_large_io_desc, ARRAY_SIZE(ixp2000_large_io_desc));
        early_serial_setup(&ixp2000_serial_port);
+
+       /* Set slowport to 8-bit mode.  */
+       ixp2000_reg_write(IXP2000_SLOWPORT_FRM, 1);
 }
 
 /*************************************************************************