)]}'
{
  "commit": "02b2c0a6067cc654457be84ec5faa6ea8e8bdcbc",
  "tree": "9313c386d723845cb1e44a7bb1873fcf2b294faf",
  "parents": [
    "97ff9d74d47328fc9a0a17947ec1a084ed437776"
  ],
  "author": {
    "name": "Jes B. Klinke",
    "email": "jbk@chromium.org",
    "time": "Tue May 24 14:21:19 2022 -0700"
  },
  "committer": {
    "name": "cfrantz",
    "email": "frantzcj+github@gmail.com",
    "time": "Thu Jun 09 12:03:57 2022 -0700"
  },
  "message": "[opentitantool]: Allow SPI chip select across transactions\n\nWhile implementing TPM communication, I came across a use case in which\nI wanted to perform a few SPI transfers, inspect the data that was read,\nand then possibly issue some more SPI transfers, while keeping CS\nasserted throughout.\n\nThe current `spi::Target` interface is such that `run_transaction()`\nkeeps CS asserted for the duration of the list of transfers given in the\nparameter list and then deasserts it unconditionally, with no option to\nadd more based on the result of the previous ones.\n\nThis PR introduces an explicit `assert_cs()` function, which can be used\nto keep CS asserted across multiple invocations of `run_transaction()`,\nlike below.\n\n```\nlet spi \u003d ...;\n{\n  let _cs_asserted \u003d spi.assert_cs()?;\n  spi.run_transaction(...)?;\n  if ... {\n    spi.run_transaction(...)?;\n  }\n  // CS will automatically deassert here (or earlier if bailing out.)\n}\n```\n\nFurthermore, `assert_cs()` counts its invocations, and releases CS only\nwhen every nested assertion has been released, such that if the above\ncode was part of a helper method, and the called wanted to make several\ninvocations of the helper, during a single CS session, then it could put\nanother `assert_cs()` around its logic.\n\nSigned-off-by: Jes B. Klinke \u003cjbk@chromium.org\u003e\nChange-Id: I219f3647d29129c4dfc1fc346f855fb4e9da2e53\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2a802184ad795ef247621b9789310add04178992",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/io/spi.rs",
      "new_id": "2f356a5b863d220423cd369a3c04cf4959417ced",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/io/spi.rs"
    },
    {
      "type": "modify",
      "old_id": "62c1d50f4d2733f12d3fa6829de6f9ab2d9f698d",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/proxy/handler.rs",
      "new_id": "4cc8600894cf957458bbab79222546123e46ada6",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/proxy/handler.rs"
    },
    {
      "type": "modify",
      "old_id": "ad6f20693d467248d965a2bb3ee4f8bb43ac3c60",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/proxy/mod.rs",
      "new_id": "37e550d58c9d5d51de53d8104a4f0be72ab69552",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/proxy/mod.rs"
    },
    {
      "type": "modify",
      "old_id": "3f77f23afc39f1d13360c5862c12268df011ff54",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/proxy/protocol.rs",
      "new_id": "61fbfe3466e8592c63c399f265c5da75274dff45",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/proxy/protocol.rs"
    },
    {
      "type": "modify",
      "old_id": "d314d97dd44cfc55f63ba4185f276b84477d41b6",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/proxy/socket_server.rs",
      "new_id": "f1612783fe0562c9ec129657f9e7e8358b204469",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/proxy/socket_server.rs"
    },
    {
      "type": "modify",
      "old_id": "3bb49bf77489b983298586ea21933d4ca961bd21",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/cw310/spi.rs",
      "new_id": "68161c5792c7337ac8689c3b650bacc9e846323c",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/cw310/spi.rs"
    },
    {
      "type": "modify",
      "old_id": "ba6422bf87fc60c4c53decdffd736acac84f3f73",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/errors.rs",
      "new_id": "925f0b862a5a6e65b94a8b5b8bb4a383221dcb74",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/errors.rs"
    },
    {
      "type": "modify",
      "old_id": "f7136a98d5b823c86327fe4e6d5d52ab6cba67aa",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/hyperdebug/spi.rs",
      "new_id": "e88e0289cdb71b0bb2385bed06a660390cc004b1",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/hyperdebug/spi.rs"
    },
    {
      "type": "modify",
      "old_id": "d8ecd94f7c86911a2fc1ba45125d2f30c0190c35",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/proxy/spi.rs",
      "new_id": "4ac3248564fa0d1b3dba318d7ebac57e2a980055",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/proxy/spi.rs"
    },
    {
      "type": "modify",
      "old_id": "56ff9cc72bfef7f2a8168ddb2509b5cd2a47488c",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/ti50emulator/spi.rs",
      "new_id": "f225d4e313e45deefed2d3d9628e12cdff8b5567",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/ti50emulator/spi.rs"
    },
    {
      "type": "modify",
      "old_id": "1a0cd5f8524eb4aaecf570c0f265ad82efcb719a",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/ultradebug/spi.rs",
      "new_id": "96e3ea628e8c0b57957030e056a68ce0f77cae8f",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/ultradebug/spi.rs"
    }
  ]
}
