blob: 68910d8e1ff4aa381312c36f8b0cdb29d24a66a1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* romfs move to __ebss */
2
3#include <asm/linkage.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
5#if defined(__H8300H__)
6 .h8300h
7#endif
8#if defined(__H8300S__)
9 .h8300s
10#endif
11
12#define BLKOFFSET 512
13
14 .text
15.globl __move_romfs
16_romfs_sig_len = 8
17
18__move_romfs:
19 mov.l #__sbss,er0
20 mov.l #_romfs_sig,er1
21 mov.b #_romfs_sig_len,r3l
221: /* check romfs image */
23 mov.b @er0+,r2l
24 mov.b @er1+,r2h
25 cmp.b r2l,r2h
26 bne 2f
27 dec.b r3l
28 bne 1b
29
30 /* find romfs image */
31 mov.l @__sbss+8,er0 /* romfs length(be) */
32 mov.l #__sbss,er1
33 add.l er0,er1 /* romfs image end */
34 mov.l #__ebss,er2
35 add.l er0,er2 /* distination address */
36#if defined(CONFIG_INTELFLASH)
37 add.l #BLKOFFSET,er2
38#endif
39 adds #2,er0
40 adds #1,er0
41 shlr er0
42 shlr er0 /* transfer length */
431:
44 mov.l @er1,er3 /* copy image */
45 mov.l er3,@er2
46 subs #4,er1
47 subs #4,er2
48 dec.l #1,er0
49 bpl 1b
502:
51 rts
52
53 .section .rodata
54_romfs_sig:
55 .ascii "-rom1fs-"
56
57 .end