get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2217050/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2217050,
    "url": "http://patchwork.ozlabs.org/api/patches/2217050/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260327141029.628483-8-uros.stajic@htecgroup.com/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260327141029.628483-8-uros.stajic@htecgroup.com>",
    "list_archive_url": null,
    "date": "2026-03-27T14:15:21",
    "name": "[v6,7/7] riscv: p8700: Add Coherence Manager (CM) and IOCU support",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c335f0473876642a46fbbf1b5fd95d3844294595",
    "submitter": {
        "id": 90991,
        "url": "http://patchwork.ozlabs.org/api/people/90991/?format=api",
        "name": "Uros Stajic",
        "email": "uros.stajic@htecgroup.com"
    },
    "delegate": {
        "id": 20174,
        "url": "http://patchwork.ozlabs.org/api/users/20174/?format=api",
        "username": "Andes",
        "first_name": "Andes",
        "last_name": "",
        "email": "uboot@andestech.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260327141029.628483-8-uros.stajic@htecgroup.com/mbox/",
    "series": [
        {
            "id": 497792,
            "url": "http://patchwork.ozlabs.org/api/series/497792/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=497792",
            "date": "2026-03-27T14:10:46",
            "name": "riscv: Add support for P8700 platform on Boston board",
            "version": 6,
            "mbox": "http://patchwork.ozlabs.org/series/497792/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217050/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217050/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=htecgroup.com header.i=@htecgroup.com\n header.a=rsa-sha256 header.s=selector1 header.b=kirCkvMb;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=htecgroup.com",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=htecgroup.com header.i=@htecgroup.com\n header.b=\"kirCkvMb\";\n\tdkim-atps=neutral",
            "phobos.denx.de; dmarc=pass (p=reject dis=none)\n header.from=htecgroup.com",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=uros.stajic@htecgroup.com",
            "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=htecgroup.com;"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fj5gv6ZwCz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 03:29:15 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id A5EE0841E6;\n\tFri, 27 Mar 2026 17:24:58 +0100 (CET)",
            "by phobos.denx.de (Postfix, from userid 109)\n id D353F83C5E; Fri, 27 Mar 2026 15:15:25 +0100 (CET)",
            "from MRWPR03CU001.outbound.protection.outlook.com\n (mail-francesouthazlp170110003.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c207::3])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 7BA5581E18\n for <u-boot@lists.denx.de>; Fri, 27 Mar 2026 15:15:23 +0100 (CET)",
            "from PA3PR09MB8140.eurprd09.prod.outlook.com (2603:10a6:102:4d4::20)\n by AM8PR09MB5398.eurprd09.prod.outlook.com (2603:10a6:20b:328::5)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9723.31; Fri, 27 Mar\n 2026 14:15:21 +0000",
            "from PA3PR09MB8140.eurprd09.prod.outlook.com\n ([fe80::ca17:d4db:b6cd:fb81]) by PA3PR09MB8140.eurprd09.prod.outlook.com\n ([fe80::ca17:d4db:b6cd:fb81%6]) with mapi id 15.20.9745.019; Fri, 27 Mar 2026\n 14:15:21 +0000"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2",
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=SilUm/EDEhQGmRlc+wtAJAZLvrI0D3YQISjx8z/1f8nQSbi8E9htTxa/POY7M8xWvaa3pYM5xuW0RnAGvsCKGcIID7kS7tU83ii24PvjHHX2VMHipWk9N/6XrIjScaLJ3kLGfNrEWsQMVxaPlvOzOWOvWIQyVwIXJQaD4tZtiFwWZhUEBogihmqv96GzoXbVeeaHQmlFaCo/oUDmY+HVyx98OcZo7kTMaOUWwvgt9YiqsXiuz/zagMXd5+SfCHn9drCjy+Ch/YjY3pzFmaVg87EzDvRNCjXG+0uocebhfBlU2rDgxEveZLTPCGutlaeIoNkn8RPoOZ7Xwt71CC7/Ig==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=tNGrQU56nbbJNJC2too1e7vZFM9oUUAj/ujP6qVBM0o=;\n b=BOqW8CcJm6Mb3w7JOBQzTRi96twYfs+DisbEhWQoXWNW/VHWFkNmOPK8AvjfIpOmAHH039Bhsz91e7uo8srtCBOz8oscR5VEHcV73ebY72xet/P2diPA7aeEuuwK/eTCvhweuzctqfcbDqjJIR7awfEZZxHb2wtI7oRr/uwlXRga2KokztpSS+Wux3XJ+jHWvEDNHzOe2f7vVTdtryuRMzTasYj06JnCZBXKBr1+T+a+mTe3gBz0ntNi5YHaJsigpAYg8LK4P+6cPHPoMwk9JByLNLEfGgMIFXDvOZvI2ceA5V5QBzH5v2uQyYd8KtoGxtAIgNu1ymZphz+HQ5eiMA==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=htecgroup.com; dmarc=pass action=none\n header.from=htecgroup.com; dkim=pass header.d=htecgroup.com; arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=htecgroup.com;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=tNGrQU56nbbJNJC2too1e7vZFM9oUUAj/ujP6qVBM0o=;\n b=kirCkvMb09s24zcunaDz/H7vTfQe5jzotYJUyUB7EZ2KbAzn6SOQdglimZ3iQdBWXmo1MsCRcthR5/q/XKCyf9GuAQRA8m5AFqW+D2MmMBTq4E6Jo70/zObM167iydsgmCHxjwpnMr82RE80hznSrTaDzLsMZ6Uy99PhI6qQLEZHoK6Uk1AqfmFSl3fraf2LH0K9xNWhhxGlghCrTV6BrrVuqnwVwpMg//jFMI7Pg0ajlWSfaH5BB0TnRCzf3nyKBCY9iNaymvEYvfIeCi0jFQ+6gGP7BU/5VaYYiHdAjkrV1rrLTQggjcMciuIdAnpa86zV1SYArPPTVixSRlctrA==",
        "From": "Uros Stajic <uros.stajic@htecgroup.com>",
        "To": "\"u-boot@lists.denx.de\" <u-boot@lists.denx.de>",
        "CC": "Djordje Todorovic <Djordje.Todorovic@htecgroup.com>, Chao-ying Fu\n <cfu@mips.com>, Uros Stajic <uros.stajic@htecgroup.com>",
        "Subject": "[PATCH v6 7/7] riscv: p8700: Add Coherence Manager (CM) and IOCU\n support",
        "Thread-Topic": "[PATCH v6 7/7] riscv: p8700: Add Coherence Manager (CM) and IOCU\n support",
        "Thread-Index": "AQHcvfQlPGduBtZt5UCUV2TIoHW0FA==",
        "Date": "Fri, 27 Mar 2026 14:15:21 +0000",
        "Message-ID": "<20260327141029.628483-8-uros.stajic@htecgroup.com>",
        "References": "<20260327141029.628483-1-uros.stajic@htecgroup.com>",
        "In-Reply-To": "<20260327141029.628483-1-uros.stajic@htecgroup.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "authentication-results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=htecgroup.com header.i=@htecgroup.com\n header.a=rsa-sha256 header.s=selector1 header.b=kirCkvMb;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=htecgroup.com",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=htecgroup.com header.i=@htecgroup.com\n header.b=\"kirCkvMb\";\n\tdkim-atps=neutral",
            "phobos.denx.de; dmarc=pass (p=reject dis=none)\n header.from=htecgroup.com",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=uros.stajic@htecgroup.com",
            "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=htecgroup.com;"
        ],
        "x-ms-publictraffictype": "Email",
        "x-ms-traffictypediagnostic": "PA3PR09MB8140:EE_|AM8PR09MB5398:EE_",
        "x-ms-office365-filtering-correlation-id": "a84b5014-475e-420f-398a-08de8c0b4820",
        "x-ms-exchange-senderadcheck": "1",
        "x-ms-exchange-antispam-relay": "0",
        "x-microsoft-antispam": "BCL:0;\n ARA:13230040|366016|1800799024|376014|38070700021|18002099003|22082099003|56012099003;",
        "x-microsoft-antispam-message-info": "\n KJQvYK0CdTuo1SlizsmdqbkeZdg9N67vsyf2TtvB3a/7P99fCQV6t5ZUoBVUZcdFf4NeJHxAI/rg5NGIXKB7yX/XvqQw9VK23WNmH8yLo7hhOGxTOY2LDsJvey0awTqB0iUZMlVHY8UkY2pMMsXNlYBDAaDqCYyE3f6BwEhfHeMQI7QRPrIJWDwRwxlAsSZFopYmbpc93mXWkc8p7bDte7Z70c9oBxsQg2MLtTQvn/NREG+KaJFS8AHBvWaod/3vGhSCn+syp4mgBb3XB1dYVCI4atRX5VUbzxJnQPg6DC4OUeZY1MOPKVOZu5h10zGBb+4H2LLu+DHlxUqwcYwFpfAQLv5u404lve1zfI5j/g+SrwYCmzfmX4FEa5qkmsCw9OD9Ipyj71llfNRa2AdjJWnzf/Rzn3Z2+r55OseJzaDxGIttSUwdOjLiJSvJDC8qfhRPlrRY9G6rtoXta38ET+IJ3Cr1GRrtTohE2Uwf/Sv+tgpdCkVoTW0tOrZ8AZZCaog4hSzHzdCcP+ed3qR3rPqT3CVFQfyYrFYl/0RsaHE8UZ4zU0H4LIjrmhEUbmkz/CQXLbCO+pBDLsgBiiRHPB/En/jLQ6VPBAeY3RxE4MbjnpUjMHWFAVkTJ177Ch239NhBSLQY9/ZfomGlYvA5PqHAwXxahSmAcRevVHqb34RqVHRO1F5gbcGrLunRc8jnUJKtHOvV5pcnO8EEHG/i+N3QJr7Q37Bchmbx51Jxi3bQ6Mfzxv7XtWXG4Bsi0UQi+Zl8ZA29RR5gEEBdGvwrkCvN8iOuM+2Nma0/vRIPq6o=",
        "x-forefront-antispam-report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:PA3PR09MB8140.eurprd09.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230040)(366016)(1800799024)(376014)(38070700021)(18002099003)(22082099003)(56012099003);\n DIR:OUT; SFP:1102;",
        "x-ms-exchange-antispam-messagedata-chunkcount": "1",
        "x-ms-exchange-antispam-messagedata-0": "=?iso-8859-1?q?oIj3Z+dGVKgnD8KrLk8UgKs?=\n\t=?iso-8859-1?q?0dPF7Y9YZeXZOkR3kJ+aPf1QqHLZJuG/vi4peuXkvHf16GY4ppPvV2Y1LBRH?=\n\t=?iso-8859-1?q?h5fgj49afnYpmn/+xCfERc6hBIbXa/z3aFuAnxgr8gGc4DMPwf9yBqfvtOYD?=\n\t=?iso-8859-1?q?hWSSAj9liy5dZ2Mc2zCo9pAC6g+fbDfi6sYyonpNKJgEzWaY7labMcTtvvUI?=\n\t=?iso-8859-1?q?Eji7Kq5Uod2HAWg9YBqb8bjS7pBzQxcnpKwTjOU+TRsJhWAADahRjAL0nirs?=\n\t=?iso-8859-1?q?UF+5cU/NnHuZVOTFwdNxy7eo9IUlZjD8dnkaqAwu3VIv4qNFSSdvu+1BQ89Z?=\n\t=?iso-8859-1?q?HVo8VEPpAY0mPqInkEoVJR5zBT7ZU1haOXRFXMLD4jXSOklHy0EFB6l8Z+Ox?=\n\t=?iso-8859-1?q?0hqrTSwZPmg4t94HSVH0wJc5cTupazmLN2GIAOMP8kmTDPedXZPps0ENSh1d?=\n\t=?iso-8859-1?q?R3epnA8sqgHpVuzb22nmm0q1lYSnIjbS46xrvjl2ZRk3Rq9awZ6WoB+kkxWk?=\n\t=?iso-8859-1?q?bzwws0gOc44++Dl9sYzxUHmAplhm18FCvidOeziftj6sm+fUUnhsAGSuTVMQ?=\n\t=?iso-8859-1?q?qVFi0+JQzeSD9dyvpm/fSDAtu5o1TmX00tYf2OcS/3vGKIJE3oAAYPWEt4Dj?=\n\t=?iso-8859-1?q?Fub8s5OLjFV6KTsVG1/2pPVkgRIShsxcrJ9Jusy1XTKLwh5qYT5ximI/K7AP?=\n\t=?iso-8859-1?q?G/MJYfY6xSdHg/09tryZJnA3mri/vNAHS4iM+qVlaYzhKjuxYDbR1N6o9EQu?=\n\t=?iso-8859-1?q?lDgGWGB6ZKlom1Xml745vMejDVTeHL6u3fHYMNRqm9DL/3PtUdKzU81Sr4R7?=\n\t=?iso-8859-1?q?3GI7wzhgseFdvTwvU8TBPpyq2IWM2hSaG/yZQGlU5UM+yV32bLDkmJhPTtKk?=\n\t=?iso-8859-1?q?F9ZnIdhuN/88WhAtLN/Y+uqq9GDY0/pohLqn+n5gfcRd0at5WySJbyoFujPV?=\n\t=?iso-8859-1?q?csc7pHoXq4P1+Rhqwi1SsZVCMzQWx32LYNE4z4hMJj82nZKqrMlE7RtykfB/?=\n\t=?iso-8859-1?q?mj1yUnFRlaNelqfb9LJt9Dhf/5PKu8dT8rJjkZBE6yzTR689h9d7m0GBIs7y?=\n\t=?iso-8859-1?q?9qVHi4buNV3wSTgXGPg8qZyF5uHi0R9lKoNoewnWsNbksh9CymhawkejRgGz?=\n\t=?iso-8859-1?q?LceAPYfgTicQhiK/hlqmgkb70QAoMP4q2Qwc8JvRfa+D3W1lI4yfr1YjoSn1?=\n\t=?iso-8859-1?q?3gbcBkifRsjcdboBp+Kvy4jfNUVGkr0AzbWEmqyEiLc+8C3tMn4Rt4YJYlEi?=\n\t=?iso-8859-1?q?4w6YP01+lbE6w7soiPm8nqQCMvzJq9Md01tv2DHPmwXMzRw41GwY8+4FomHv?=\n\t=?iso-8859-1?q?2VLHcbGsYZkESC6m8fX19Wfrl6fWMt258a76/8vw3jFq1YuoJLBDsnoc8iyu?=\n\t=?iso-8859-1?q?GZHbdCDYB5aSMHxuxDT359exdlHnLfHyZnahLPEEGdBagYKakPmNiz+XNEiW?=\n\t=?iso-8859-1?q?VUO7+T+cD2u0L7kR9C0YyRIr4T3c2YSe8M4g7A3oIVkIEWao3TKNPANoor+J?=\n\t=?iso-8859-1?q?HTlzclIpYalzyzVKcRXQaFIFTdobYobjxLmIngncQkU55WbaaICiI5HkJGXN?=\n\t=?iso-8859-1?q?/RPOPS7BVoZISZQueqdPbGJPM02k0emKzJf3xb8/4XxJ9MCzyIJpS7e8yGUU?=\n\t=?iso-8859-1?q?xAaQooXLB37V98iBb+4rYkOCVRn/IPMl3xynk4b1fZkvjs1lZGr5GY6I7LRj?=\n\t=?iso-8859-1?q?0zY4TooIW0RHkqRviLQgYC64OOOPC4OpdyTtw/H6URo+fJLUru6GCFaxAuma?=\n\t=?iso-8859-1?q?OJ+2pEl0P+qW/hex9wK970msql0CBRkKJRIgsr06TGVW4119ic9w6RURuuig?=\n\t=?iso-8859-1?q?L/GHzVPM=3D?=",
        "Content-Type": "text/plain; charset=\"iso-8859-1\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "htecgroup.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-AuthSource": "PA3PR09MB8140.eurprd09.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n a84b5014-475e-420f-398a-08de8c0b4820",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "27 Mar 2026 14:15:21.5747 (UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "9f85665b-7efd-4776-9dfe-b6bfda2565ee",
        "X-MS-Exchange-CrossTenant-mailboxtype": "HOSTED",
        "X-MS-Exchange-CrossTenant-userprincipalname": "\n 5GcXx/xiQXl5KoiQcdaaZPLSpHsjQtkKN+JuaczjV0F/W10cqqfxEo+LaDJwc5PcHTaFEnN9IjWkAPXV9aALZpSMuid/YUK2I2g1uoCbwrE=",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM8PR09MB5398",
        "X-Mailman-Approved-At": "Fri, 27 Mar 2026 17:24:54 +0100",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "From: Chao-ying Fu <cfu@mips.com>\n\nAdd support for Coherence Manager (CM) and IOCU discovery and\nconfiguration on the P8700 platform.\n\nSigned-off-by: Chao-ying Fu <cfu@mips.com>\nSigned-off-by: Uros Stajic <uros.stajic@htecgroup.com>\n---\n arch/riscv/cpu/p8700/Makefile             |   2 +\n arch/riscv/cpu/p8700/cache.c              |   6 ++\n arch/riscv/cpu/p8700/cm-iocu.c            |  75 ++++++++++++++++\n arch/riscv/cpu/p8700/cm.c                 |  92 +++++++++++++++++++\n arch/riscv/cpu/p8700/p8700.c              |   2 +\n arch/riscv/include/asm/arch-p8700/cm.h    |  61 +++++++++++++\n arch/riscv/include/asm/arch-p8700/p8700.h |  32 +++++++\n arch/riscv/include/asm/global_data.h      |   4 +\n board/mips/boston-riscv/Makefile          |   1 +\n board/mips/boston-riscv/boston-riscv.c    |  11 +++\n board/mips/boston-riscv/iocu.c            | 102 ++++++++++++++++++++++\n 11 files changed, 388 insertions(+)\n create mode 100644 arch/riscv/cpu/p8700/cm-iocu.c\n create mode 100644 arch/riscv/cpu/p8700/cm.c\n create mode 100644 arch/riscv/include/asm/arch-p8700/cm.h\n create mode 100644 board/mips/boston-riscv/iocu.c",
    "diff": "diff --git a/arch/riscv/cpu/p8700/Makefile b/arch/riscv/cpu/p8700/Makefile\nindex 04291375a29..45f68bbda3d 100644\n--- a/arch/riscv/cpu/p8700/Makefile\n+++ b/arch/riscv/cpu/p8700/Makefile\n@@ -3,6 +3,8 @@\n # Copyright (C) 2021, Chao-ying Fu <cfu@mips.com>\n \n obj-y += cache.o\n+obj-y += cm.o\n+obj-y += cm-iocu.o\n obj-y += cpu.o\n obj-y += dram.o\n obj-y += p8700.o\ndiff --git a/arch/riscv/cpu/p8700/cache.c b/arch/riscv/cpu/p8700/cache.c\nindex 06e60156394..1343637eea7 100644\n--- a/arch/riscv/cpu/p8700/cache.c\n+++ b/arch/riscv/cpu/p8700/cache.c\n@@ -48,6 +48,9 @@ static void probe_cache_config(void)\n \n void flush_dcache_range(unsigned long start, unsigned long end)\n {\n+\tif (dma_is_coherent())\n+\t\treturn;\n+\n \tif (lsize == 0)\n \t\tprobe_cache_config();\n \n@@ -71,6 +74,9 @@ void flush_dcache_range(unsigned long start, unsigned long end)\n \n void invalidate_dcache_range(unsigned long start, unsigned long end)\n {\n+\tif (dma_is_coherent())\n+\t\treturn;\n+\n \tif (lsize == 0)\n \t\tprobe_cache_config();\n \ndiff --git a/arch/riscv/cpu/p8700/cm-iocu.c b/arch/riscv/cpu/p8700/cm-iocu.c\nnew file mode 100644\nindex 00000000000..5850647d20f\n--- /dev/null\n+++ b/arch/riscv/cpu/p8700/cm-iocu.c\n@@ -0,0 +1,75 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * MIPS Coherence Manager (CM) Support\n+ *\n+ * Copyright (c) 2016 Imagination Technologies Ltd.\n+ */\n+#include <asm/io.h>\n+#include <asm/global_data.h>\n+#include <asm/arch-p8700/cm.h>\n+\n+__weak bool plat_iocu_usable(unsigned int cluster, unsigned int iocu)\n+{\n+\treturn true;\n+}\n+\n+static int init_cluster_iocus(unsigned int cluster)\n+{\n+\tDECLARE_GLOBAL_DATA_PTR;\n+\tvoid __iomem *global_gcrs;\n+\tu32 cfg, num_iocus, num_iocus_usable, local_cluster;\n+\tint i;\n+\n+\tlocal_cluster = mips_cluster_id();\n+\n+\tglobal_gcrs = mips_cm_base();\n+\tif (cluster != local_cluster) {\n+\t\t// FIXME\n+\t\treturn 1;\n+\t}\n+\n+\tcfg = __raw_readl(global_gcrs + GCR_CONFIG);\n+\tnum_iocus = cfg >> GCR_CONFIG_NUMIOCU_SHIFT;\n+\tnum_iocus &= GCR_CONFIG_NUMIOCU_MASK;\n+\tgd->arch.num_iocus += num_iocus;\n+\n+\t/* Discover how many IOCUs are usable */\n+\tnum_iocus_usable = num_iocus;\n+\tfor (i = num_iocus - 1; i >= 0; i--) {\n+\t\tif (!plat_iocu_usable(cluster, i))\n+\t\t\tnum_iocus_usable--;\n+\t}\n+\tgd->arch.num_iocus_usable += num_iocus_usable;\n+\n+\t/* If the cluster has no usable IOCUs there's nothing to do */\n+\tif (num_iocus_usable == 0) {\n+\t\tif (cluster != local_cluster)\n+\t\t\tpower_down_cluster(cluster);\n+\n+\t\treturn 0;\n+\t}\n+\n+\t/* If the IOCUs are in the local cluster we're good to go already */\n+\tif (cluster == local_cluster)\n+\t\treturn 0;\n+\n+\t/* Ensure that the cluster's L2 cache is initialised */\n+\treturn init_cluster_l2(cluster);\n+}\n+\n+int mips_cm_init_iocus(void)\n+{\n+\tDECLARE_GLOBAL_DATA_PTR;\n+\tunsigned int cluster;\n+\tint err;\n+\n+\tfor (cluster = 0; cluster < mips_cm_num_clusters(); cluster++) {\n+\t\terr = init_cluster_iocus(cluster);\n+\t\tif (err) {\n+\t\t\tgd->arch.num_iocus_usable = err;\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\ndiff --git a/arch/riscv/cpu/p8700/cm.c b/arch/riscv/cpu/p8700/cm.c\nnew file mode 100644\nindex 00000000000..ce7485c564d\n--- /dev/null\n+++ b/arch/riscv/cpu/p8700/cm.c\n@@ -0,0 +1,92 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * MIPS Coherence Manager (CM) Support\n+ *\n+ * Copyright (c) 2016 Imagination Technologies Ltd.\n+ */\n+\n+#include <asm/io.h>\n+#include <asm/arch-p8700/cm.h>\n+#include <asm/arch-p8700/p8700.h>\n+\n+static void mips_cpc_init(void)\n+{\n+}\n+\n+__weak const struct mmio_region *get_mmio_regions(void)\n+{\n+\treturn NULL;\n+}\n+\n+static void p8700_setup_mmio_limits(void)\n+{\n+\tvoid __iomem *gcrs = mips_cm_base();\n+\tconst struct mmio_region *rgn = get_mmio_regions();\n+\tunsigned int num_clusters = mips_cm_num_clusters();\n+\tunsigned int limit = MIPS_CM_MMIO_LIMIT / num_clusters;\n+\tunsigned int i, reg_off;\n+\n+\tif (!rgn)\n+\t\treturn;\n+\n+\tif (num_clusters != 1) {\n+\t\t// FIXME! Need to support multiple clusters.\n+\t\treturn;\n+\t}\n+\n+\treg_off = GCR_MMIO0_BOTTOM;\n+\n+\tfor (i = 0; rgn[i].addr_high; i++) {\n+\t\t__raw_writeq(rgn[i].addr_high & GCR_MMIO0_TOP_ADDR,\n+\t\t\t     gcrs + reg_off + (GCR_MMIO0_TOP - GCR_MMIO0_BOTTOM));\n+\n+\t\t__raw_writeq((rgn[i].addr_low & GCR_MMIO0_BOTTOM_ADDR) |\n+\t\t\t     (rgn[i].port << GCR_MMIO0_BOTTOM_PORT_SHIFT) |\n+\t\t\t     (rgn[i].enable ? GCR_MMIO0_BOTTOM_ENABLE : 0),\n+\t\t\t     gcrs + reg_off);\n+\t\treg_off += GCR_MMIO1_BOTTOM - GCR_MMIO0_BOTTOM;\n+\t}\n+\n+\t__raw_writel(limit, gcrs + GCR_MMIO_REQ_LIMIT);\n+}\n+\n+int power_up_cluster(unsigned int cluster)\n+{\n+\treturn 0;\n+}\n+\n+int power_down_cluster(unsigned int cluster)\n+{\n+\treturn 0;\n+}\n+\n+int init_cluster_l2(unsigned int cluster)\n+{\n+\treturn 0;\n+}\n+\n+int mips_cm_init(void)\n+{\n+\tint err;\n+\n+\tmips_cpc_init();\n+\n+\terr = mips_cm_init_iocus();\n+\tif (err)\n+\t\treturn err;\n+\n+\tp8700_setup_mmio_limits();\n+\n+\treturn 0;\n+}\n+\n+int arch_cpu_init(void)\n+{\n+\tint err;\n+\n+\terr = mips_cm_init();\n+\tif (err)\n+\t\treturn err;\n+\n+\treturn 0;\n+}\ndiff --git a/arch/riscv/cpu/p8700/p8700.c b/arch/riscv/cpu/p8700/p8700.c\nindex 41d5547c511..802ec65ffb2 100644\n--- a/arch/riscv/cpu/p8700/p8700.c\n+++ b/arch/riscv/cpu/p8700/p8700.c\n@@ -10,3 +10,5 @@\n __weak void wait_ddr_calib(void) { }\n \n __weak void setup_pcie_dma_map(void) { }\n+\n+__weak bool dma_is_coherent(void) { return false; }\ndiff --git a/arch/riscv/include/asm/arch-p8700/cm.h b/arch/riscv/include/asm/arch-p8700/cm.h\nnew file mode 100644\nindex 00000000000..ab5ea7385b2\n--- /dev/null\n+++ b/arch/riscv/include/asm/arch-p8700/cm.h\n@@ -0,0 +1,61 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+/*\n+ * Copyright (C) 2021, Chao-ying Fu <cfu@mips.com>\n+ */\n+\n+#ifndef __P8700_CM_H__\n+#define __P8700_CM_H__\n+\n+#include <asm/arch-p8700/p8700.h>\n+\n+struct mmio_region {\n+\tphys_addr_t addr_low;\n+\tphys_addr_t addr_high;\n+\tunsigned int port : 4;\n+\tunsigned int enable : 1;\n+};\n+\n+const struct mmio_region *get_mmio_regions(void);\n+\n+void setup_redirect(unsigned int cluster, unsigned int core,\n+\t\t    unsigned int vp, unsigned int block);\n+\n+int mips_cm_init_iocus(void);\n+\n+int power_up_cluster(unsigned int cluster);\n+int power_down_cluster(unsigned int cluster);\n+int init_cluster_l2(unsigned int cluster);\n+\n+static inline void *mips_cm_base(void)\n+{\n+\treturn (void *)CM_BASE;\n+}\n+\n+static inline void *mips_cpc_base(void)\n+{\n+\treturn (void *)CPC_BASE;\n+}\n+\n+static inline unsigned int mips_cm_num_clusters(void)\n+{\n+\tu32 cfg;\n+\n+\tcfg = __raw_readl(mips_cm_base() + GCR_CONFIG);\n+\tcfg >>= GCR_CONFIG_NUMCLUSTERS_SHIFT;\n+\tcfg &= GCR_CONFIG_NUMCLUSTERS_MASK;\n+\n+\treturn cfg;\n+}\n+\n+static inline unsigned int mips_cluster_id(void)\n+{\n+\tu32 temp;\n+\n+\tasm volatile(\"csrr %0, mhartid\" : \"=r\"(temp));\n+\ttemp >>= MHARTID_CLUSTER_SHIFT;\n+\ttemp &= MHARTID_CLUSTER_MASK;\n+\n+\treturn temp;\n+}\n+\n+#endif /* __P8700_CM_H__ */\ndiff --git a/arch/riscv/include/asm/arch-p8700/p8700.h b/arch/riscv/include/asm/arch-p8700/p8700.h\nindex d6cc125d76a..98ce5ba3ffb 100644\n--- a/arch/riscv/include/asm/arch-p8700/p8700.h\n+++ b/arch/riscv/include/asm/arch-p8700/p8700.h\n@@ -65,6 +65,10 @@\n #define CM_BASE\t\t\tCONFIG_RISCV_CM_BASE\n #define CPC_BASE\t\t(CM_BASE + 0x8000)\n \n+/* Block offsets */\n+#define GCR_OFF_GLOBAL\t\t0x0000\n+#define GCR_OFF_LOCAL\t\t0x2000\n+\n /* CPC Block offsets */\n #define CPC_OFF_LOCAL\t\t0x2000\n \n@@ -75,6 +79,33 @@\n #define CPC_Cx_CMD\t\t0x0000\n #define CPC_Cx_CMD_RESET\t0x4\n \n+/* GCR_CONFIG */\n+#define GCR_CONFIG\t\t\t\t\t\t0x0000\n+#define GCR_REV\t\t\t\t\t\t\t0x0030\n+#define GCR_CONFIG_NUMCLUSTERS_SHIFT\t23\n+#define GCR_CONFIG_NUMCLUSTERS_MASK\t    0x7f\n+#define GCR_CONFIG_NUMIOCU_SHIFT\t    8\n+#define GCR_CONFIG_NUMIOCU_MASK\t\t    0xf\n+#define GCR_CONFIG_NUMCORES_SHIFT\t    0\n+#define GCR_CONFIG_NUMCORES_MASK\t    0xff\n+\n+/* GCR_REV CM versions */\n+#define GCR_REV_CM3\t\t\t0x0800\n+#define GCR_REV_CM3_5\t\t0x0900\n+\n+#define GCR_MMIO_REQ_LIMIT\t\t\t\t0x06f8\n+#define GCR_MMIO0_BOTTOM\t\t\t\t0x0700\n+#define GCR_MMIO0_BOTTOM_ADDR\t\t\t(0xffffffffull << 16)\n+#define GCR_MMIO0_BOTTOM_PORT_SHIFT\t\t2\n+#define GCR_MMIO0_BOTTOM_PORT\t\t\t(0xf << 2)\n+#define GCR_MMIO0_BOTTOM_DISABLE_LIMIT\t(0x1 << 1)\n+#define GCR_MMIO0_BOTTOM_ENABLE\t\t\t(0x1 << 0)\n+#define GCR_MMIO0_TOP\t\t\t\t\t0x0708\n+#define GCR_MMIO0_TOP_ADDR\t\t\t\t(0xffffffffull << 16)\n+#define GCR_MMIO1_BOTTOM\t\t\t\t0x0710\n+\n+#define MIPS_CM_MMIO_LIMIT\t4\n+\n #define P8700_GCR_C0_COH_EN\t0x20f8\n #define P8700_GCR_C1_COH_EN\t0x21f8\n #define P8700_GCR_C2_COH_EN\t0x22f8\n@@ -97,5 +128,6 @@\n \n void wait_ddr_calib(void);\n void setup_pcie_dma_map(void);\n+bool dma_is_coherent(void);\n \n #endif /* __P8700_H__ */\ndiff --git a/arch/riscv/include/asm/global_data.h b/arch/riscv/include/asm/global_data.h\nindex 33f2b5ec5c8..198eacd1e07 100644\n--- a/arch/riscv/include/asm/global_data.h\n+++ b/arch/riscv/include/asm/global_data.h\n@@ -44,6 +44,10 @@ struct arch_global_data {\n \tulong smbios_start;\t\t/* Start address of SMBIOS table */\n #endif\n \tstruct resume_data *resume;\n+#if CONFIG_IS_ENABLED(P8700_RISCV)\n+\tint num_iocus;\n+\tint num_iocus_usable;\n+#endif\n };\n \n #include <asm-generic/global_data.h>\ndiff --git a/board/mips/boston-riscv/Makefile b/board/mips/boston-riscv/Makefile\nindex 0615c677d23..c67c001d4e6 100644\n--- a/board/mips/boston-riscv/Makefile\n+++ b/board/mips/boston-riscv/Makefile\n@@ -4,5 +4,6 @@\n \n obj-y += boston-riscv.o\n obj-y += checkboard.o\n+obj-y += iocu.o\n obj-y += lowlevel_init.o\n obj-y += reset.o\ndiff --git a/board/mips/boston-riscv/boston-riscv.c b/board/mips/boston-riscv/boston-riscv.c\nindex f3fd2ec8348..4af918c8c81 100644\n--- a/board/mips/boston-riscv/boston-riscv.c\n+++ b/board/mips/boston-riscv/boston-riscv.c\n@@ -46,3 +46,14 @@ void setup_pcie_dma_map(void)\n \twritel(0x00, (void __iomem *)BOSTON_PLAT_NOCPCIE1ADDR);\n \twritel(0x00, (void __iomem *)BOSTON_PLAT_NOCPCIE2ADDR);\n }\n+\n+bool dma_is_coherent(void)\n+{\n+\tu32 pcie0_off = readl((void __iomem *)BOSTON_PLAT_NOCPCIE0ADDR);\n+\tu32 pcie1_off = readl((void __iomem *)BOSTON_PLAT_NOCPCIE1ADDR);\n+\tu32 pcie2_off = readl((void __iomem *)BOSTON_PLAT_NOCPCIE2ADDR);\n+\n+\treturn pcie0_off == BOSTON_IOCU_NOC_OFFSET &&\n+\t       pcie1_off == BOSTON_IOCU_NOC_OFFSET &&\n+\t       pcie2_off == BOSTON_IOCU_NOC_OFFSET;\n+}\ndiff --git a/board/mips/boston-riscv/iocu.c b/board/mips/boston-riscv/iocu.c\nnew file mode 100644\nindex 00000000000..807f09804a3\n--- /dev/null\n+++ b/board/mips/boston-riscv/iocu.c\n@@ -0,0 +1,102 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * Copyright (c) 2016 Imagination Technologies Ltd.\n+ */\n+\n+#include \"boston-regs.h\"\n+#include <dm.h>\n+#include <env_callback.h>\n+#include <event.h>\n+#include <asm/io.h>\n+#include <asm/arch-p8700/cm.h>\n+\n+static const struct mmio_region mmio_regions[] = {\n+\t{ 0x10000000, 0x160f0000, .enable = 1 },\n+\t{ 0x17ff0000, 0x17ff0000, .enable = 1 },\n+\t{ 0 },\n+};\n+\n+const struct mmio_region *get_mmio_regions(void)\n+{\n+\treturn mmio_regions;\n+}\n+\n+static int set_io_coherent(bool coherent)\n+{\n+\tDECLARE_GLOBAL_DATA_PTR;\n+\n+\tif (!coherent) {\n+\t\tprintf(\"I/O:   Non-Coherent (Forced by environment)\\n\");\n+\t\tgoto noncoherent;\n+\t}\n+\n+\tif (gd->arch.num_iocus_usable < 0) {\n+\t\tprintf(\"I/O:   Non-Coherent (IOCU init error %d)\\n\",\n+\t\t       gd->arch.num_iocus_usable);\n+\t\tgoto noncoherent;\n+\t}\n+\n+\tif (gd->arch.num_iocus == 0) {\n+\t\tprintf(\"I/O:   Non-Coherent (No IOCU)\\n\");\n+\t\tgoto noncoherent;\n+\t}\n+\n+\tif (gd->arch.num_iocus_usable == 0) {\n+\t\tprintf(\"I/O:   Non-Coherent (IOCU not connected)\\n\");\n+\t\tgoto noncoherent;\n+\t}\n+\n+\t/*\n+\t * We have some number of connected IOCUs. Map all PCIe DMA access to\n+\t * hit the IOCU by offsetting the addresses as they pass from the PCIe\n+\t * controller to the NoC.\n+\t */\n+\twritel(0x10, (u32 *)BOSTON_PLAT_NOCPCIE0ADDR);\n+\twritel(0x10, (u32 *)BOSTON_PLAT_NOCPCIE1ADDR);\n+\twritel(0x10, (u32 *)BOSTON_PLAT_NOCPCIE2ADDR);\n+\n+\tprintf(\"I/O:   Coherent\\n\");\n+\treturn 0;\n+\n+noncoherent:\n+\t/* Map all PCIe DMA access to its default, non-IOCU, target */\n+\twritel(0x00, (u32 *)BOSTON_PLAT_NOCPCIE0ADDR);\n+\twritel(0x00, (u32 *)BOSTON_PLAT_NOCPCIE1ADDR);\n+\twritel(0x00, (u32 *)BOSTON_PLAT_NOCPCIE2ADDR);\n+\t\n+\treturn 0;\n+}\n+\n+static int on_io_coherent(const char *name, const char *value,\n+\t\t\t  enum env_op op, int flags)\n+{\n+\tswitch (op) {\n+\tcase env_op_create:\n+\tcase env_op_overwrite:\n+\t\tif (!strcmp(value, \"0\")) {\n+\t\t\tset_io_coherent(false);\n+\t\t} else if (!strcmp(value, \"1\")) {\n+\t\t\tset_io_coherent(true);\n+\t\t} else {\n+\t\t\tprintf(\"### io.coherent must equal 0 or 1\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\treturn 0;\n+\n+\tcase env_op_delete:\n+\t\tset_io_coherent(true);\n+\t\treturn 0;\n+\n+\tdefault:\n+\t\treturn 0;\n+\t}\n+}\n+\n+U_BOOT_ENV_CALLBACK(io_coherent, on_io_coherent);\n+\n+static int p8700_misc_init_f(void)\n+{\n+\treturn set_io_coherent(env_get_yesno(\"io.coherent\") != 0);\n+}\n+\n+EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, p8700_misc_init_f);\n",
    "prefixes": [
        "v6",
        "7/7"
    ]
}