Miika Pekkarinen | 954b732 | 2006-08-05 20:19:10 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2006 by Miika Pekkarinen |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * 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 Pekkarinen | 954b732 | 2006-08-05 20:19:10 +0000 | [diff] [blame] | 16 | * |
| 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 Pekkarinen | 0ea4d31 | 2007-01-12 18:34:00 +0000 | [diff] [blame] | 28 | #define EEPROM_SETTINGS_VERSION 0x24c01002 |
Miika Pekkarinen | 954b732 | 2006-08-05 20:19:10 +0000 | [diff] [blame] | 29 | #define EEPROM_SETTINGS_BL_MINVER 7 |
| 30 | |
Miika Pekkarinen | 0ea4d31 | 2007-01-12 18:34:00 +0000 | [diff] [blame] | 31 | enum boot_methods { |
| 32 | BOOT_DISK = 0, |
| 33 | BOOT_RAM, |
| 34 | BOOT_ROM, |
| 35 | BOOT_RECOVERY, |
| 36 | }; |
| 37 | |
Miika Pekkarinen | 954b732 | 2006-08-05 20:19:10 +0000 | [diff] [blame] | 38 | struct 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 Pekkarinen | 0ea4d31 | 2007-01-12 18:34:00 +0000 | [diff] [blame] | 43 | uint8_t bootmethod; /* The default boot method. */ |
Miika Pekkarinen | 954b732 | 2006-08-05 20:19:10 +0000 | [diff] [blame] | 44 | uint8_t bl_version; /* Installed bootloader version */ |
| 45 | |
Miika Pekkarinen | 0ea4d31 | 2007-01-12 18:34:00 +0000 | [diff] [blame] | 46 | long reserved; /* A few reserved bits for the future. */ |
| 47 | |
Miika Pekkarinen | 954b732 | 2006-08-05 20:19:10 +0000 | [diff] [blame] | 48 | /* This must be the last entry */ |
| 49 | uint32_t checksum; /* Checksum of this structure */ |
| 50 | }; |
| 51 | |
| 52 | extern struct eeprom_settings firmware_settings; |
| 53 | |
Miika Pekkarinen | 954b732 | 2006-08-05 20:19:10 +0000 | [diff] [blame] | 54 | bool eeprom_settings_init(void); |
| 55 | bool eeprom_settings_store(void); |
| 56 | |
| 57 | #endif |
| 58 | |