Remove NRV2B compression support

It wasn't even hooked up to the build system anymore.

Change-Id: I4b962ffd945b39451e19da3ec2f7b8e0eecf2e53
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/3892
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
Patrick Georgi 2013-08-31 08:16:27 +02:00
parent de36d333c2
commit 2f39eae41d
7 changed files with 5 additions and 1583 deletions

1
.gitignore vendored
View File

@ -71,7 +71,6 @@ util/mptable/mptable
util/msrtool/Makefile
util/msrtool/Makefile.deps
util/msrtool/msrtool
util/nrv2b/nrv2b
util/nvramtool/.dependencies
util/nvramtool/nvramtool
util/optionlist/Options.wiki

View File

@ -308,8 +308,8 @@ struct cbfs_stage {
'compression' is an integer defining how the data is compressed. There
are three compression types defined by this version of the standard:
none (0x0), lzma (0x1), and nrv2b (0x02), though additional types may be
added assuming that coreboot understands how to handle the scheme.
none (0x0), lzma (0x1), and nrv2b (0x02, deprecated), though additional
types may be added assuming that coreboot understands how to handle the scheme.
'entry' is a 64 bit value indicating the location where the program
counter should jump following the loading of the stage. This should be
@ -388,9 +388,9 @@ PAYLOAD_SEGMENT_ENTRY 0x52544E45 The segment contains the entry point
'compression' is the compression scheme for the segment. Each segment can
be independently compressed. There are three compression types defined by
this version of the standard: none (0x0), lzma (0x1), and nrv2b (0x02),
though additional types may be added assuming that coreboot understands
how to handle the scheme.
this version of the standard: none (0x0), lzma (0x1), and nrv2b
(0x02, deprecated), though additional types may be added assuming that
coreboot understands how to handle the scheme.
'offset' is the address of the data within the component, starting from
the component header.

View File

@ -640,10 +640,6 @@ config COMPRESSED_PAYLOAD_LZMA
In order to reduce the size payloads take up in the ROM chip
coreboot can compress them using the LZMA algorithm.
config COMPRESSED_PAYLOAD_NRV2B
bool
default n
endmenu
menu "Debugging"

View File

@ -1,84 +0,0 @@
// This GETBIT is supposed to work on little endian
// 32bit systems. The algorithm will definitely need
// some fixing on other systems, but it might not be
// a problem since the nrv2b binary behaves the same..
#ifndef ENDIAN
#define ENDIAN 0
#endif
#ifndef BITSIZE
#define BITSIZE 32
#endif
#define GETBIT_8(bb, src, ilen) \
(((bb = bb & 0x7f ? bb*2 : ((unsigned)src[ilen++]*2+1)) >> 8) & 1)
#define GETBIT_LE16(bb, src, ilen) \
(bb*=2,bb&0xffff ? (bb>>16)&1 : (ilen+=2,((bb=(src[ilen-2]+src[ilen-1]*256u)*2+1)>>16)&1))
#define GETBIT_LE32(bb, src, ilen) \
(bc > 0 ? ((bb>>--bc)&1) : (bc=31,\
bb=*(const uint32_t *)((src)+ilen),ilen+=4,(bb>>31)&1))
#if ENDIAN == 0 && BITSIZE == 8
#define GETBIT(bb, src, ilen) GETBIT_8(bb, src, ilen)
#endif
#if ENDIAN == 0 && BITSIZE == 16
#define GETBIT(bb, src, ilen) GETBIT_LE16(bb, src, ilen)
#endif
#if ENDIAN == 0 && BITSIZE == 32
#define GETBIT(bb, src, ilen) GETBIT_LE32(bb, src, ilen)
#endif
static unsigned long unrv2b(uint8_t * src, uint8_t * dst, unsigned long *ilen_p)
{
unsigned long ilen = 0, olen = 0, last_m_off = 1;
uint32_t bb = 0;
unsigned bc = 0;
const uint8_t *m_pos;
// skip length
src += 4;
/* FIXME: check olen with the length stored in first 4 bytes */
for (;;) {
unsigned int m_off, m_len;
while (GETBIT(bb, src, ilen)) {
dst[olen++] = src[ilen++];
}
m_off = 1;
do {
m_off = m_off * 2 + GETBIT(bb, src, ilen);
} while (!GETBIT(bb, src, ilen));
if (m_off == 2) {
m_off = last_m_off;
} else {
m_off = (m_off - 3) * 256 + src[ilen++];
if (m_off == 0xffffffffU)
break;
last_m_off = ++m_off;
}
m_len = GETBIT(bb, src, ilen);
m_len = m_len * 2 + GETBIT(bb, src, ilen);
if (m_len == 0) {
m_len++;
do {
m_len = m_len * 2 + GETBIT(bb, src, ilen);
} while (!GETBIT(bb, src, ilen));
m_len += 2;
}
m_len += (m_off > 0xd00);
m_pos = dst + olen - m_off;
dst[olen++] = *m_pos++;
do {
dst[olen++] = *m_pos++;
} while (--m_len > 0);
}
*ilen_p = ilen;
return olen;
}

View File

@ -454,15 +454,6 @@ static int load_self_segments(
return 0;
break;
}
#if CONFIG_COMPRESSED_PAYLOAD_NRV2B
case CBFS_COMPRESS_NRV2B: {
printk(BIOS_DEBUG, "using NRV2B\n");
unsigned long unrv2b(u8 *src, u8 *dst, unsigned long *ilen_p);
unsigned long tmp;
len = unrv2b(src, dest, &tmp);
break;
}
#endif
case CBFS_COMPRESS_NONE: {
printk(BIOS_DEBUG, "it's not compressed!\n");
memcpy(dest, src, len);

View File

@ -1,7 +0,0 @@
GCC=gcc
nrv2b: nrv2b.c
$(GCC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG -DBITSIZE=32 -DENDIAN=0 -o $@ $<
clean:
rm -f nrv2b

File diff suppressed because it is too large Load Diff