2 Boot.S: boot loader for Siemens DVB-S card
4 Copyright (C) 2001 Convergence integrated media GmbH
5 Written by Ralph Metzler
7 Copyright (C) 2006 Matthieu CASTET <castet.mattheiu@free.fr>
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
26 check AV711x_3_1.pdf for some hardware infos
28 $ cc -mbig-endian -c Boot.S
29 $ ld -Ttext 0x2c000000 -EB -o Boot Boot.o
30 $ objcopy -Obinary Boot
37 b reset // reset vector
38 movs pc, r14 // undefined
39 subs pc, r14, #4 // SWI
40 subs pc, r14, #4 // prefetch abort
41 subs pc, r14, #8 // data abort
42 subs pc, r14, #4 // reserved
43 subs pc, r14, #4 // IRQ
44 subs pc, r14, #4 // FIQ
46 .word tbl // table needed by firmware ROM
47 tbl: .word (endtbl - tbl)
51 conf: .word 0xa5a55a5a
55 reset: ldr r13, buffer
65 copycode: // copy the code HW Sram
70 ldr pc, sram // jump to the copied code
72 wait: ldrh r1, [r4] // wait for flag!=0
76 mov r1, r13 // buffer address
77 ldr r3, [r4,#4] // destaddr
79 ldrh r2, [r4,#2] // get segment length
80 add r2, r2, #63 // round length to next 64 bytes
81 movs r2, r2, lsr #6 // and divide by 64
82 moveq r0, #2 // if 0, set flag to 2, else signal
83 strh r0, [r4] // that buffer is accepted by setting to 0
94 eor r13, r13, #0x1400 // switch to other buffer
97 // flag is stored at 0x2c0003f8, length at 0x2c0003fa,
98 // destaddr at 0x2c0003fc
100 flag: .word 0x2c0003f8
103 // buffer 1 is at 0x2c000400, buffer 2 at 0x2c001000
105 buffer: .word 0x2c000400
107 sram: .word 0x9e000800
108 wait_address: .word wait
109 flag_address: .word flag