EmmcGpp1.efi

THIS IS AN INTERNAL TOOL FOR THE JOULE MANUFACTURING LINE ONLY!!!

- This tool manipulates the data on the eMMC GPP1 partition for the manufacturing line.
  It can either read or write GPP1 data.

Usage:
  EmmcGpp1.efi is a tool to manipulate the data in eMMC GPP1 partition.

  Switches:
     -b [--board]    ID                Programs the Joule Board ID
     -c [--clear]                      Clears the GPP1 data
     -f [--fab]      ID                Programs the Joule Fab ID
     -h [--help]                       Prints help info
     -j [--joule]    Serial #          Programs the Joule serial #
     -m [--mm]       MM #              Programs the Joule MM #
     -o [--bom]      ID                Programs the Joule BOM ID
     -r [--read]                       Prints out the data in GPP1
     -t [--tuchuck]  Serial #          Programs the Tuchuck Serial #
     -w [--write]    -j # -m # [-t #]  Programs the data into the GPP1
                                         -j & -m are required.
                                         -b, -f, -o, -t are optional.

  Examples:
     EmmcGpp1.efi -w -j 12345678 -t 87654321 -m 09876
     - Writes the Joule Serial #12345678, Tuchuck Serial #87654321, and MM #09876 to GPP1.
     EmmcGpp1.efi -r
     - Dumps the GPP1 info to the screen in human readable form.

GPP1 usage scheme:
- GPP1 platform data area resides in the first 512KB (1,024 sectors) of GPP1. The data structure is outlined below.
  - EMMC_INFO starts at the beginning of the first sector.
- All other space in GPP1 is reserved for future features. This utility will ignore all of the remaining space.

    typedef struct {
        CHAR8   signature[8];
        UINT16  vermajor;
        UINT16  verminor;
        UINT32  length;
        UINT32  structlength;
        UINT32  crc32;
        UINT32  version;
        UINT32  reserved;
    } EEPROM_HEADER;

    typedef struct {
        CHAR8   signature[8];
        UINT16  vermajor;
        UINT16  verminor;
        UINT32  length;
        CHAR8   manuname[16];
        CHAR8   brdname[16];
        CHAR8   brdserial[16];
        UINT32  boardid;
        UINT32  fabid;
        UINT32  ecid; // This is being used to hold the BOM ID
        UINT8   boardtype;
        CHAR8   reserved[19];
    } BOARD_INFO_TABLE;

    typedef struct {
      EEPROM_HEADER      Header;
      BOARD_INFO_TABLE   Joule;
      CHAR8              MM[16];
      CHAR8              Tuchuck[16];
      UINT8              Reserved[16];
    } EMMC_INFO;
