mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* MIPS: relocation issue
@ 2020-01-28  6:46 Antony Pavlov
  2020-01-28  9:34 ` Oleksij Rempel
  2020-01-30  8:26 ` maeling list issue Oleksij Rempel
  0 siblings, 2 replies; 7+ messages in thread
From: Antony Pavlov @ 2020-01-28  6:46 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: barebox, Peter Mamonov, Oleksij Rempel

Hi!

Since 28ed10d6a6 ("MIPS: relocation: add relocation support")
iomem output on memory regions is invalid,
all the code that rely on registered sdram memory regions
after relocation can fail. E.g. the memtest commands fails
on barebox.

How to reproduce the problem ov v2020.01.0:

$ wget https://www.barebox.org/download/barebox-2020.01.0.tar.bz2
...
$ tar fx barebox-2020.01.0.tar.bz2
$ cd barebox-2020.01.0
$ export ARCH=mips
$ export CROSS_COMPILE=mips-linux-gnu-
$ make qemu-malta_defconfig
$ sed -i "s/^.*CONFIG_CMD_MEMTEST.*/CONFIG_CMD_MEMTEST=y/" .config
$ make
$ qemu-system-mips -nodefaults -M malta -m 256 -nographic -serial stdio -monitor null -bios barebox-flash-image
...
barebox@qemu malta:/ memtest
Start iteration 1 of 1.
Testing memory space: 0xa0865000 -> 0xafffffff:
Starting data line test.
Check for address bits stuck high.
Check for address bits stuck low or shorted.
Starting moving inversions test of RAM:
Fill with address, compare, fill with inverted address, compare again
	[##########################################                       ]
FAILURE (read/write): expected 0x03cca9f2, actual 0xa08126c4 at address 0xafb8f7c4.

Ooops, TLB miss on load or ifetch!

$ 0   : 00000000 00000000 fffffffb a085c900
$ 4   : a0407e90 0000000a b80003f8 00000001
$ 8   : a0858f28 00000000 00000053 00000008
$12   : 00000000 00000000 0000005c 00000001
$16   : 03ccab3c 03ccab3d a0825c48 00000000
$20   : 00000000 00000001 a0853518 a085352c
$24   : 00000018 a08124b8                  
$28   : 00000000 8fb8fcf8 a0860000 03ccab3e
Hi    : 0000000a
Lo    : 00000000
epc   : 03ccab3e
ra    : 03ccab3e
Status: 00000002
Cause : 00000408
Config: 80008482

### ERROR ### Please RESET the board ###


memtest for qemu-malta can be repaired by disabling relocation, e.g.

diff --git a/arch/mips/boot/start.S b/arch/mips/boot/start.S
index c1cd2d9dd5..95b6596dde 100644
--- a/arch/mips/boot/start.S
+++ b/arch/mips/boot/start.S
@@ -34,7 +34,7 @@ EXPORT(_start)
        move    a0, s0
        move    a1, s1
        move    a2, s2
-       la      v0, relocate_code
+       la      v0, main_entry
        jal     v0
         nop


Additional testing on real hardware has to be done.

-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-01-30 11:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-28  6:46 MIPS: relocation issue Antony Pavlov
2020-01-28  9:34 ` Oleksij Rempel
2020-01-28 10:49   ` Peter Mamonov
2020-01-28 11:03     ` Oleksij Rempel
2020-01-28 11:10       ` Peter Mamonov
2020-01-30  8:26 ` maeling list issue Oleksij Rempel
2020-01-30 11:14   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox