From f1f51a277554486f3f46e9a4c16e9a2c78e730de Mon Sep 17 00:00:00 2001 From: Peter Nessrup Date: Tue, 17 Aug 2010 10:39:02 +0200 Subject: Added TOC partition support TOC partition support added under disk New files: part_toc.c, part_toc.h CONFIG_TOC_PARTITION needs to be set for it to be activated. ST-Ericsson ID: ER256835 Change-Id: I301b0650cb73b34f04b80dd5f27babdbf7ba09e1 Signed-off-by: Peter Nessrup Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/4369 Reviewed-by: Sebastian RASMUSSEN Reviewed-by: Michael BRANDT Reviewed-by: Ulf HANSSON --- disk/part_toc.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 disk/part_toc.h (limited to 'disk/part_toc.h') diff --git a/disk/part_toc.h b/disk/part_toc.h new file mode 100644 index 000000000..fbe7624ba --- /dev/null +++ b/disk/part_toc.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) ST-Ericsson SA 2010 + * Author: Peter Nessrup for + * ST-Ericsson. + * License terms: GNU General Public License (GPL), version 2. + */ +#ifndef _DISK_PART_TOC_H +#define _DISK_PART_TOC_H + +#define SUPPORTED_SECTOR_SIZE 512 +#define TOC_MAGIC "ISSW" +#define TOC_ID_NO_ENTRY "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" +#define TOC_MAX_ENTRIES (SUPPORTED_SECTOR_SIZE/sizeof(toc_entry_t)) +#define MAX_NUM_TOCS 4 +#define TOC_BOOT_IMAGE_SIZE (0x20000 / SUPPORTED_SECTOR_SIZE) +#define NO_TOC -1 +#define TOC_ID_LENGTH 12 + +/* Sub TOC identifier in the 'flags' field is 'ST' */ +#define FLAGS_SUB_TOC 0x00005354 +#define FLAGS_PARTITION 0x00000001 + +typedef struct __attribute__ ((__packed__)) { + u32 offset; + u32 size; + u32 flags; + u32 align; + u32 loadaddr; + u8 id[TOC_ID_LENGTH]; +} toc_entry_t; + +typedef struct { + u8 id[TOC_ID_LENGTH]; + u32 num_items; + u32 location; + u32 cached_section; + toc_entry_t cache[TOC_MAX_ENTRIES]; +} subtoc_t; + +typedef struct { + u32 start; + u32 size; + u8 name[12]; + u32 cfg_offset; + u32 type; + u32 unused; +} toc_part_entry_t; +#endif /* _DISK_PART_TOC_H */ -- cgit v1.2.3