)]}'
{
  "commit": "f38431a5b23e578cff1299b8d69e7d650c060b60",
  "tree": "293fe367a94034d5b17d622c33e0365ec1a9b871",
  "parents": [
    "c04ee22c7006d6e006086c40651b8761cea0fbfc"
  ],
  "author": {
    "name": "Carl-Daniel Hailfinger",
    "email": "c-d.hailfinger.devel.2006@gmx.net",
    "time": "Sat Sep 05 02:30:58 2009 +0000"
  },
  "committer": {
    "name": "Carl-Daniel Hailfinger",
    "email": "c-d.hailfinger.devel.2006@gmx.net",
    "time": "Sat Sep 05 02:30:58 2009 +0000"
  },
  "message": "Store block sizes and corresponding erase functions in struct flashchip\n\nI decided to fill in the info for a\nfew chips to illustrate how this works both for uniform and non-uniform\nsector sizes.\n\nstruct eraseblock{\nint size; /* Eraseblock size */\nint count; /* Number of contiguous blocks with that size */\n};\n\nstruct eraseblock doesn\u0027t correspond with a single erase block, but with\na group of contiguous erase blocks having the same size.\nGiven a (top boot block) flash chip with the following weird, but\nreal-life structure:\n\ntop\n16384\n8192\n8192\n32768\n65536\n65536\n65536\n65536\n65536\n65536\n65536\nbottom\n\nwe get the following encoding:\n{65536,7},{32768,1},{8192,2},{16384,1}\n\nAlthough the number of blocks is bigger than 4, the number of block\ngroups is only 4. If you ever add some flash chips with more than 4\ncontiguous block groups, the definition will not fit into the 4-member\narray anymore and gcc will recognize that and error out. No undetected\noverflow possible. In that case, you simply increase array size a bit.\nFor modern flash chips with uniform erase block size, you only need one\narray member anyway.\n\nOf course data types will need to be changed if you ever get flash chips\nwith more than 2^30 erase blocks, but even with the lowest known erase\ngranularity of 256 bytes, these flash chips will have to have a size of\na quarter Terabyte. I\u0027m pretty confident we won\u0027t see such big EEPROMs\nin the near future (or at least not attached in a way that makes\nflashrom usable). For SPI chips, we even have a guaranteed safety factor\nof 4096 over the maximum SPI chip size (which is 2^24). And if such a\nbig flash chip has uniform erase block size, you could even split it\namong the 4 array members. If you change int count to unsigned int\ncount, the storable size doubles. So with a split and a slight change of\ndata type, the maximum ROM chip size is 2 Terabytes.\n\nSince many chips have multiple block erase functions where the\neraseblock layout depends on the block erase function, this patch\ncouples the block erase functions with their eraseblock layouts.\nstruct block_eraser {\n  struct eraseblock{\n    unsigned int size; /* Eraseblock size */\n    unsigned int count; /* Number of contiguous blocks with that size */\n  } eraseblocks[NUM_ERASEREGIONS];\n  int (*block_erase) (struct flashchip *flash, unsigned int blockaddr, unsigned int blocklen);\n} block_erasers[NUM_ERASEFUNCTIONS];\n\nCorresponding to flashrom svn r719.\n\nSigned-off-by: Carl-Daniel Hailfinger \u003cc-d.hailfinger.devel.2006@gmx.net\u003e\nAcked-by: Stefan Reinauer \u003cstepan@coresystems.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8752c4a80e41ee6b3ccdb870875aa7d7bc07dd74",
      "old_mode": 33188,
      "old_path": "flash.h",
      "new_id": "dce0e41918c585936a7aeae8450ffe5fd6158c30",
      "new_mode": 33188,
      "new_path": "flash.h"
    },
    {
      "type": "modify",
      "old_id": "3b72cdfbdd2d2defc789d585db6299ad0e73e340",
      "old_mode": 33188,
      "old_path": "flashchips.c",
      "new_id": "33ebd042dcbd6f67f684d284fc2b235157617e19",
      "new_mode": 33188,
      "new_path": "flashchips.c"
    },
    {
      "type": "modify",
      "old_id": "6da6741a68452fafd16d46fc0acff7ce98d5dbde",
      "old_mode": 33188,
      "old_path": "flashrom.c",
      "new_id": "6c03d9363beed4eb6be2311bf2ecbfd03445a241",
      "new_mode": 33188,
      "new_path": "flashrom.c"
    },
    {
      "type": "modify",
      "old_id": "9bf1af3c0e5ebbc0a68ed65cd21e6fa08850a6a6",
      "old_mode": 33188,
      "old_path": "ft2232_spi.c",
      "new_id": "ee8d67dc69ddbd19f7b2d8d29acdff9825126486",
      "new_mode": 33188,
      "new_path": "ft2232_spi.c"
    },
    {
      "type": "modify",
      "old_id": "d58f83712e3fc6b13a936f7ce8534b5a7eea5919",
      "old_mode": 33188,
      "old_path": "it87spi.c",
      "new_id": "a5dc06e5318c930d3a20fcc51e5a0acfb81c361b",
      "new_mode": 33188,
      "new_path": "it87spi.c"
    },
    {
      "type": "modify",
      "old_id": "c853f420e6dfcabed242f094b2110233f7b5a625",
      "old_mode": 33188,
      "old_path": "sb600spi.c",
      "new_id": "0738a86e132c835fa51614ca6cfa6c270e476e00",
      "new_mode": 33188,
      "new_path": "sb600spi.c"
    },
    {
      "type": "modify",
      "old_id": "7a17b2475f65c395bb24bd39627a69dfc341398f",
      "old_mode": 33188,
      "old_path": "spi.c",
      "new_id": "86ffe69624ed2e69e45be3da122e5b196efe5dde",
      "new_mode": 33188,
      "new_path": "spi.c"
    },
    {
      "type": "modify",
      "old_id": "bfa98538c732d348e99b5b0b2969339181551369",
      "old_mode": 33188,
      "old_path": "w39v040c.c",
      "new_id": "722ae2952bed4ab61dd9c368e0857a2d49274441",
      "new_mode": 33188,
      "new_path": "w39v040c.c"
    }
  ]
}
