From 31b015fc08a13a5b63245808f7d1a49eadd8193a Mon Sep 17 00:00:00 2001 From: Drake Dowsett Date: Mon, 6 Nov 2006 16:54:10 +0100 Subject: [MTD] UBI: pfiflash needs to flash raw sections and check CRC Flashing of raw partitions should be possible now. CRC checking of pfi files before flashing the content was added. Signed-off-by: Frank Haverkamp --- ubi-utils/src/reader.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'ubi-utils/src/reader.c') diff --git a/ubi-utils/src/reader.c b/ubi-utils/src/reader.c index 5de06d5..975caa1 100644 --- a/ubi-utils/src/reader.c +++ b/ubi-utils/src/reader.c @@ -29,10 +29,11 @@ #include #include -#include "config.h" #include "bootenv.h" #include "reader.h" +#define __unused __attribute__((unused)) + /* @FIXME hard coded offsets right now - get them from Artem? */ #define NAND2048_DEFAULT_VID_HDR_OFF 1984 #define NAND512_DEFAULT_VID_HDR_OFF 448 @@ -152,6 +153,12 @@ read_pfi_raw(pfi_header pfi_hd, FILE* fp_pfi __unused, pfi_raw_t* pfi_raw, goto err; } + rc = pfi_header_getnumber(pfi_hd, "crc", &(res->crc)); + if (rc != 0) { + EBUF_PFI("Cannot read 'crc' from PFI."); + goto err; + } + rc = pfi_header_getstring(pfi_hd, "raw_starts", tmp_str, PFI_KEYWORD_LEN); if (rc != 0) { @@ -212,6 +219,12 @@ read_pfi_ubi(pfi_header pfi_hd, FILE* fp_pfi __unused, pfi_ubi_t* pfi_ubi, goto err; } + rc = pfi_header_getnumber(pfi_hd, "crc", &(res->crc)); + if (rc != 0) { + EBUF_PFI("Cannot read 'crc' from PFI."); + goto err; + } + rc = pfi_header_getstring(pfi_hd, "ubi_ids", tmp_str, PFI_KEYWORD_LEN); if (rc != 0) { EBUF_PFI("Cannot read 'ubi_ids' from PFI."); -- cgit v1.2.3