)]}'
{
  "commit": "14dd5faa7e168d70760902c269dc68f3104b8ed6",
  "tree": "9146aa0edaed9bb51974edd926645e66f6949a09",
  "parents": [
    "27424dcc6804e630602a61229e57e42b14050869"
  ],
  "author": {
    "name": "Peter Maydell",
    "email": "peter.maydell@linaro.org",
    "time": "Wed Mar 14 15:37:53 2012 +0000"
  },
  "committer": {
    "name": "Peter Maydell",
    "email": "peter.maydell@linaro.org",
    "time": "Fri Mar 16 18:09:55 2012 +0000"
  },
  "message": "hw/pxa2xx.c: Fix handling of pxa2xx_i2c variable offset within region\n\nThe pxa2xx I2C controller can have its registers at an arbitrary offset\nwithin the MemoryRegion it creates. We use this to create two controllers,\none which covers a region of size 0x10000 with registers starting at an\noffset 0x1600 into that region, and a second one which covers a region\nof size just 0x100 with the registers starting at the base of the region.\n\nThe implementation of this offsetting uses two qdev properties, \"offset\"\n(which sets the offset which must be subtracted from the address to\nget the offset into the actual register bank) and \"size\", which is the\nsize of the MemoryRegion. We were actually using \"offset\" for two\npurposes: firstly the required one of handling the registers not being\nat the base of the MemoryRegion, and secondly as a workaround for a\ndeficiency of QEMU. Until commit 5312bd8b3, if a MemoryRegion was mapped\nat a non-page boundary, the address passed into the read and write\nfunctions would be the offset from the start of the page, not the\noffset from the start of the MemoryRegion. So when calculating the value\nto set the \"offset\" qdev property we included a rounding to a page\nboundary.\n\nFollowing commit 5312bd8b3 MemoryRegion read/write functions are now\ncorrectly passed the offset from the base of the region, and our\nworkaround now means we\u0027re subtracting too much from addresses, resulting\nin warnings like \"pxa2xx_i2c_read: Bad register 0xffffff90\".\nThe fix for this is simply to remove the rounding to a page boundary;\nthis allows us to slightly simplify the expression since\n  base - (base \u0026 (~region_size)) \u003d\u003d base \u0026 region_size\n\nThe qdev property \"offset\" itself must remain because it is still\nperforming its primary job of handling register banks not being at\nthe base of the MemoryRegion.\n\nSigned-off-by: Peter Maydell \u003cpeter.maydell@linaro.org\u003e\nReviewed-by: Andreas Färber \u003cafaerber@suse.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f55287774adaa6b8a07b9ed67346dac33cf793ac",
      "old_mode": 33188,
      "old_path": "hw/pxa2xx.c",
      "new_id": "1d5c35f1740f20914054433ed23625ccf38e7142",
      "new_mode": 33188,
      "new_path": "hw/pxa2xx.c"
    }
  ]
}
