/*
 *               Copyright (C) 2005, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished proprietary information of BroadOn Communications Corp.,
 *  and are protected by federal copyright law. They may not be disclosed
 *  to third parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 *  Description:
 *      This file contains the public declarations for the boot process
 *
 */


#ifndef __BOOT_H__
#define __BOOT_H__


#include <fs.h>


/* Boot2 block map */
#define BOOT2_MAX_BLOCKS    (ISFS_SYSAREA_SIZE >> 14)   /* Max blocks in SYS */
#define BOOT2_MAGIC_SIZE    8

typedef struct {
    u8      magic[BOOT2_MAGIC_SIZE];    /* 64-bit magic */
    u32     seq;                        /* Sequence number to identify latest */
    u8      map[BOOT2_MAX_BLOCKS];
} Boot2BlockMap;

/* Block map magic value */
#define BOOT2_MAGIC         {0x26, 0xf2, 0x9a, 0x40, 0x1e, 0xe6, 0x84, 0xcf}

/* Block map status */
#define BOOT2_BLOCK_GOOD    0
#define BOOT2_BLOCK_BAD     1


#ifdef NEXT_GEN
/*
 * Boot OS image header, used as pre-amble for loading OS images. In
 * RVL, a merged OS image is preceded by a loader that knows how to
 * load the OS image
 */
typedef struct {
    u32     hdrSize;
    u32     loaderSize;
    u32     imageSize;
    u32     ddrInit;        /* If set, initialize DDR before loading OS */
} BootOSImageHeader;
#endif


/* Boot2 resource manager path */
#define BOOT2_RESRC_MGR_PATH        "/dev/boot2"

/* Boot2 ioctl commands */
#define BOOT2_COMMIT                1


#endif /* __BOOT_H__ */
