2 * LZMA compressed kernel decompressor for bcm947xx boards
4 * Copyright (C) 2005 by Oleg I. Vdovikin <oleg@cs.msu.su>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 The code is intended to decompress kernel, being compressed using lzma utility
23 build using 7zip LZMA SDK. This utility is located in the LZMA_Alone directory
25 decompressor code expects that your .trx file consist of three partitions:
27 1) decompressor itself (this is gziped code which pmon/cfe will extract and run
28 on boot-up instead of real kernel)
29 2) LZMA compressed kernel (both streamed and regular modes are supported now)
32 Please be sure to apply the following patch for use this new trx layout (it will
33 allow using both new and old trx files for root filesystem lookup code)
35 --- linuz/arch/mips/brcm-boards/bcm947xx/setup.c 2005-01-23 19:24:27.503322896 +0300
36 +++ linux/arch/mips/brcm-boards/bcm947xx/setup.c 2005-01-23 19:29:05.237100944 +0300
38 /* Try looking at TRX header for rootfs offset */
39 if (le32_to_cpu(trx->magic) == TRX_MAGIC) {
40 bcm947xx_parts[1].offset = off;
41 - if (le32_to_cpu(trx->offsets[1]) > off)
42 + if (le32_to_cpu(trx->offsets[2]) > off)
43 + off = le32_to_cpu(trx->offsets[2]);
44 + else if (le32_to_cpu(trx->offsets[1]) > off)
45 off = le32_to_cpu(trx->offsets[1]);
52 0.03 Added Mineharu Takahara <mtakahar@yahoo.com> patch to pass actual
53 output size to decoder (stream mode compressed input is not
54 a requirement anymore)
55 0.04 Reordered functions using lds script