blob: 00039fa1544f9cdb67eab147a97fe3fb37485523 [file] [log] [blame]
Miika Pekkarinen954b7322006-08-05 20:19:10 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Miika Pekkarinen
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
Miika Pekkarinen954b7322006-08-05 20:19:10 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _EEPROM_SETTINGS_H_
23#define _EEPROM_SETTINGS_H_
24
25#include <stdbool.h>
26#include "inttypes.h"
27
Miika Pekkarinen0ea4d312007-01-12 18:34:00 +000028#define EEPROM_SETTINGS_VERSION 0x24c01002
Miika Pekkarinen954b7322006-08-05 20:19:10 +000029#define EEPROM_SETTINGS_BL_MINVER 7
30
Miika Pekkarinen0ea4d312007-01-12 18:34:00 +000031enum boot_methods {
32 BOOT_DISK = 0,
33 BOOT_RAM,
34 BOOT_ROM,
35 BOOT_RECOVERY,
36};
37
Miika Pekkarinen954b7322006-08-05 20:19:10 +000038struct eeprom_settings
39{
40 long version; /* Settings version number */
41 bool initialized; /* Is eeprom_settings ready to be used */
42 bool disk_clean; /* Is disk intact from last reboot */
Miika Pekkarinen0ea4d312007-01-12 18:34:00 +000043 uint8_t bootmethod; /* The default boot method. */
Miika Pekkarinen954b7322006-08-05 20:19:10 +000044 uint8_t bl_version; /* Installed bootloader version */
45
Miika Pekkarinen0ea4d312007-01-12 18:34:00 +000046 long reserved; /* A few reserved bits for the future. */
47
Miika Pekkarinen954b7322006-08-05 20:19:10 +000048 /* This must be the last entry */
49 uint32_t checksum; /* Checksum of this structure */
50};
51
52extern struct eeprom_settings firmware_settings;
53
Miika Pekkarinen954b7322006-08-05 20:19:10 +000054bool eeprom_settings_init(void);
55bool eeprom_settings_store(void);
56
57#endif
58