summaryrefslogtreecommitdiff
path: root/firmware/decompressor/decompressor.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/decompressor/decompressor.c')
-rw-r--r--firmware/decompressor/decompressor.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/firmware/decompressor/decompressor.c b/firmware/decompressor/decompressor.c
deleted file mode 100644
index 11888ef272..0000000000
--- a/firmware/decompressor/decompressor.c
+++ /dev/null
@@ -1,73 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Jens Arnold
11 *
12 * Self-extracting firmware loader to work around the 200KB size limit
13 * for archos player and recorder v1
14 * Decompresses a built-in UCL-compressed image (method 2e) and executes it.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
20 *
21 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22 * KIND, either express or implied.
23 *
24 ****************************************************************************/
25
26#include "uclimage.h"
27
28#define ICODE_ATTR __attribute__ ((section (".icode")))
29
30/* Symbols defined in the linker script */
31extern char iramcopy[], iramstart[], iramend[];
32extern char stackend[];
33extern char loadaddress[], dramend[];
34
35/* Prototypes */
36extern void start(void);
37
38void main(void) ICODE_ATTR;
39int ucl_nrv2e_decompress_8(const unsigned char *src, unsigned char *dst,
40 unsigned long *dst_len) ICODE_ATTR;
41
42/* Vector table */
43void (*vbr[]) (void) __attribute__ ((section (".vectors"))) =
44{
45 start, (void *)stackend,
46 start, (void *)stackend,
47 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
48 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
49};
50
51/** All subsequent functions are executed from IRAM **/
52
53#define ALIGNED_IMG_SIZE ((sizeof(image) + 3) & ~3)
54/* This will never return */
55void main(void)
56{
57 unsigned long dst_len; /* dummy */
58 unsigned long *src = (unsigned long *)image;
59 unsigned long *dst = (unsigned long *)(dramend - ALIGNED_IMG_SIZE);
60
61 do
62 *dst++ = *src++;
63 while (dst < (unsigned long *)dramend);
64
65 ucl_nrv2e_decompress_8(dramend - ALIGNED_IMG_SIZE, loadaddress, &dst_len);
66
67 asm(
68 "mov.l @%0+,r0 \n"
69 "jmp @r0 \n"
70 "mov.l @%0+,r15 \n"
71 : : "r"(loadaddress) : "r0"
72 );
73}