)]}'
{
  "commit": "e3f648c3146be28c642782b11187011dfd6f258d",
  "tree": "272af33324401b45fc68bef0e1d697bf502998c1",
  "parents": [
    "32f1ea8df501b41362058bb699a7ea96482e4db3"
  ],
  "author": {
    "name": "Nico Huber",
    "email": "nico.h@gmx.de",
    "time": "Wed Feb 15 02:55:23 2023 +0100"
  },
  "committer": {
    "name": "Nico Huber",
    "email": "nico.h@gmx.de",
    "time": "Sat Feb 14 22:42:55 2026 +0000"
  },
  "message": "spi: Implement top-aligned to avoid BBAR hassle\n\nThe BBAR quirk in `ichspi\u0027 is the only case left where we need a flash\ncontext in the SPI `.send_command\u0027 functions. Our Git history suggests\nthat the elaborate calculation there  was not added for an encountered\nsetup but rather all possible settings of BBAR [1]. There are only few\nsettings that make sense, however.\n\nBBAR sets a simple address boundary. Reads for any flash address below\nthe BBAR setting will be rejected.  This was originally the only read-\nprotection mechanism, introduced with ICH7.  The ICH7 datasheet states\nthat upper bits, above the flash chip\u0027s size, should be set to all 1s.\nThis makes sense, as otherwise the read-protection could be circumven-\nted by setting a higher address above BBAR, where the flash chip would\nsimply ignore the most significant bits.  Conversely, this requires us\nto \"lift\" the flash addresses when the BBAR is configured properly. We\ncan achieve this by top-aligning all addresses.\n\nNewer chipsets have protected-range registers (PRx) now, that allow to\nconfigure read protection. Also the descriptor mode was introduced. So\nflash addresses have to match the descriptor regions, and lifting them\nisn\u0027t feasible.  The BBAR register was still around until Wilcat Point\n(PCH9), though, probably useless, and without the note about upper ad-\ndress bits.  Odd though, since [2], we only consider the BBAR on newer\nchipsets when in descriptor mode.\n\nAs the BBAR protection seems unlikely on newer chipsets, and the quirk\nhandling error-prone,  we\u0027ll only change addresses on ICH7 and similar\nold chipsets. We don\u0027t want the dependency on the flash context, hence\nlet the generic `spi25\u0027 code top align the addresses.\n\n[1] commit ed098d62d66d (spi: Move ICH BBAR quirk out of the way)\n[2] commit 4095ed797f87 (Add support for Intel Silvermont: Bay Trail,\n    Rangeley and Avoton)\n\nChange-Id: Ic6f6f5a24d89d4a1ebe2b99f08aabfcd65df129f\nSigned-off-by: Nico Huber \u003cnico.h@gmx.de\u003e\nReviewed-on: https://review.sourcearcade.org/c/flashprog/+/74896\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9a5f1b793b6ecafff62b921953e197bc11f234a0",
      "old_mode": 33188,
      "old_path": "ichspi.c",
      "new_id": "0a32778dfedb87585432cda81d62acfd7cb4c461",
      "new_mode": 33188,
      "new_path": "ichspi.c"
    },
    {
      "type": "modify",
      "old_id": "b19049e38cac6f55cdb40ad458af243f2df8f67e",
      "old_mode": 33188,
      "old_path": "include/programmer.h",
      "new_id": "3270e0e2e63dbca2c1a97f1a091d0e212700e8a7",
      "new_mode": 33188,
      "new_path": "include/programmer.h"
    },
    {
      "type": "modify",
      "old_id": "b1d62881a6d2f2dc8e5e08a0eb07355f1f26975a",
      "old_mode": 33188,
      "old_path": "spi25.c",
      "new_id": "334e87a13a750768296caa174359658b1b62a58c",
      "new_mode": 33188,
      "new_path": "spi25.c"
    }
  ]
}
