mp1000-seprom.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef MP1000_SEPROM_H
  2. #define MP1000_SEPROM_H
  3. /*
  4. * mp1000-seprom.h
  5. *
  6. *
  7. * This file contains the Serial EEPROM definitions for the MP1000 board
  8. *
  9. * Copyright (C) 2005 Comdial Corporation
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24. *
  25. */
  26. #define COMMAND_ERASE (0x1C0)
  27. #define COMMAND_ERASE_ALL (0x120)
  28. #define COMMAND_WRITE_DISABLE (0x100)
  29. #define COMMAND_WRITE_ENABLE (0x130)
  30. #define COMMAND_READ (0x180)
  31. #define COMMAND_WRITE (0x140)
  32. #define COMMAND_WRITE_ALL (0x110)
  33. //
  34. // Serial EEPROM data format
  35. //
  36. #define PACKED __attribute__ ((packed))
  37. typedef struct _EEPROM {
  38. union {
  39. unsigned char eprom_byte_data[128];
  40. unsigned short eprom_short_data[64];
  41. struct {
  42. unsigned char version PACKED; // EEPROM Version "1" for now
  43. unsigned char box_id PACKED; // Box ID (Standalone, SOHO, embedded, etc)
  44. unsigned char major_hw_version PACKED; // Major Hardware version (Hex)
  45. unsigned char minor_hw_version PACKED; // Minor Hardware Version (Hex)
  46. unsigned char mfg_id[3] PACKED; // Manufacturer ID (3 character Alphabetic)
  47. unsigned char mfg_serial_number[10] PACKED; // Manufacturer Serial number
  48. unsigned char mfg_date[3] PACKED; // Date of Mfg (Formatted YY:MM:DD)
  49. unsigned char country PACKED; // Country of deployment
  50. unsigned char mac_Address[6] PACKED; // MAC Address
  51. unsigned char oem_string[20] PACKED; // OEM ID string
  52. unsigned short feature_bits1 PACKED; // Feature Bits 1
  53. unsigned short feature_bits2 PACKED; // Feature Bits 2
  54. unsigned char filler[75] PACKED; // Unused/Undefined “0” initialized
  55. unsigned short checksum PACKED; // byte accumulated short checksum
  56. } eprom_struct;
  57. } variant;
  58. } eeprom_struct;
  59. /* These settings must be mutually exclusive */
  60. #define FEATURE_BITS1_DRAMSIZE_16MEG 0x0001 /* 0 signifies 4 MEG system */
  61. #define FEATURE_BITS1_DRAMSIZE_8MEG 0x0002 /* 1 in bit 1 = 8MEG system */
  62. #define FEATURE_BITS1_DRAMSIZE_64MEG 0x0004 /* 1 in bit 2 = 64MEG system */
  63. #define FEATURE_BITS1_CPUIS90MEG 0x0010
  64. extern void seprom_init(void);
  65. extern eeprom_struct* get_seprom_ptr(void);
  66. extern unsigned char* get_eeprom_mac_address(void);
  67. #endif /* MP1000_SEPROM_H */