get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2221770,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2221770/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260410-topic-cpsw-switch-v2026-07-next-v1-4-c914724b13e4@baylibre.com/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260410-topic-cpsw-switch-v2026-07-next-v1-4-c914724b13e4@baylibre.com>",
    "list_archive_url": null,
    "date": "2026-04-10T11:04:06",
    "name": "[4/4] net: cpsw: Support new cpsw-switch DT bindings",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "f14eb05a3fa48849756c0f2b99f9f15ec3cc5627",
    "submitter": {
        "id": 82333,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/82333/?format=api",
        "name": "Markus Schneider-Pargmann (TI)",
        "email": "msp@baylibre.com"
    },
    "delegate": {
        "id": 157425,
        "url": "http://patchwork.ozlabs.org/api/1.2/users/157425/?format=api",
        "username": "jforissier",
        "first_name": "Jerome",
        "last_name": "Forissier",
        "email": "jerome.forissier@linaro.org"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260410-topic-cpsw-switch-v2026-07-next-v1-4-c914724b13e4@baylibre.com/mbox/",
    "series": [
        {
            "id": 499440,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/499440/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=499440",
            "date": "2026-04-10T11:04:02",
            "name": "net: cpsw: Add cpsw-switch DT binding support",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499440/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2221770/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2221770/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=baylibre-com.20251104.gappssmtp.com\n header.i=@baylibre-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=kSnOQD64;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=baylibre.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=baylibre-com.20251104.gappssmtp.com\n header.i=@baylibre-com.20251104.gappssmtp.com header.b=\"kSnOQD64\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=baylibre.com",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=msp@baylibre.com"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\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 4fsYqf0Frlz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 21:05:18 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 590C4841CD;\n\tFri, 10 Apr 2026 13:04:51 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 0863584106; Fri, 10 Apr 2026 13:04:45 +0200 (CEST)",
            "from mail-wr1-x429.google.com (mail-wr1-x429.google.com\n [IPv6:2a00:1450:4864:20::429])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id C105884199\n for <u-boot@lists.denx.de>; Fri, 10 Apr 2026 13:04:38 +0200 (CEST)",
            "by mail-wr1-x429.google.com with SMTP id\n ffacd0b85a97d-43d43e09de5so1017905f8f.1\n for <u-boot@lists.denx.de>; Fri, 10 Apr 2026 04:04:38 -0700 (PDT)",
            "from localhost ([2001:4091:a246:8598:4c79:7b44:ca74:c5de])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43d63dec090sm6797095f8f.12.2026.04.10.04.04.37\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 10 Apr 2026 04:04:37 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1775819078;\n x=1776423878;\n darn=lists.denx.de;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n :reply-to; bh=YIQqYGJyDi8KAoevzX3u7kL/iFz9ctO6qA4P1mcqGWY=;\n b=kSnOQD64nJYzlRgcJKO/2v8noz8iOt93pmYFfskeK7Kde/e2/5nxIslGCO/hrOXT1x\n v0DQkGtsRU/kj9v8tTKb43Sg8hV7roNSqwvP8hiPCUyOF5Ua5stn2+NmamUSYgpF06mF\n Zgwbxa/2hr7NJWoGUD7dm47cJYivKv28zaWqbT0wLKE+UcJZO3APxYw7iRijhr1G1Q+j\n PnXV2nk5GSJ/pqBrJrKKXX2GJPBpiecb2nlscaQBStVEUiIxQ0HcRQ0p93XAVnxiEz9c\n 4O3edrY1ELMLA4akTof8Qtu308JecIaQ3hXZQxBjyYJtpnJxKzTZoejVq2jntmVaPvhl\n NldA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775819078; x=1776423878;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=YIQqYGJyDi8KAoevzX3u7kL/iFz9ctO6qA4P1mcqGWY=;\n b=Q7wVvKKYJHBOR2ST/OyqBQB8fo/8/AjNG8J7CvtoszeTkheoPQWIpBIjTT2VNWt1t6\n E9rAHF6T9A/pjFbGhduEJSqI9nIFQVD4grUmXaM4FY305zSEaWIyAKtYGtWnpbrKrOth\n NbdzOrsVbasX5fxzMM4CTuGaSrasgDHJyGrE5deH518rzi3F/qOwHL+wuu+QZsJIIeZ1\n Wavqp9r1/+6kwFX45LYNy7KdQeF8YYt4rDDV4PV+lYUvjFtt+J87DiU5ftYXZozs1mN8\n CzB87NYBujvpf4BAfvC9mfVicGEq+LphzecgWagGpnLnGleNbnzl/6ExDBPqW/vr8DAH\n seFg==",
        "X-Gm-Message-State": "AOJu0YxQqJg4R1S5gblGEBCpeLq/ZJA+a54uri93zfSSAJ00II8ff1lU\n zEINwhoxyCoip+Zj4FFjZjqHBNYcUVf6NCDrY1tweS9iYta6ZKV/xkkBRe04SWZh02WbrtJGuOf\n 6Z1UA",
        "X-Gm-Gg": "AeBDiet3AwaVvVfMfL0HNVj8gg1lXxmFccpBWdvACCy64EYujjsVWP+FGtpQt0lxIhB\n jKRByVK5wRZKstgIq6qc7VflqqfEVOkJdT4TzTud7sTBvCcaBdWYUe1EOI7/lLMePIxEFTcSLak\n MwftdBUwywWXw0fjlfTEr5DNn1vb4VhZOT5D9/zvRRSZ0uK91Afy0H2aSxz3E18HUXemo/mcvKT\n 3DCpGF+K8mRy8l/7GpItwKO9Wyqhz/c7fSrGLBXyJ7N7ocREbsymnzK5XTTV3A1AS/1UQxb7l+E\n gIRQhKUlB12ywtub4bFbDMyHPgKaCUPQ7hJNz/obD4r2nAZxGRsmxO/OaMKPYpTd616yr2w9BrY\n AaraVVBVWU5dFTlJfKZxy71uzDePXLVpmRwtQz7YBMq/rUyGxIJDEa5rn0zY9pbg9tPg8iC/q4S\n eFuSaYHI0xOYQMbpapij2y",
        "X-Received": "by 2002:a05:6000:1447:b0:43d:1bf6:30f2 with SMTP id\n ffacd0b85a97d-43d6428d948mr4080856f8f.20.1775819077841;\n Fri, 10 Apr 2026 04:04:37 -0700 (PDT)",
        "From": "\"Markus Schneider-Pargmann (TI)\" <msp@baylibre.com>",
        "Date": "Fri, 10 Apr 2026 13:04:06 +0200",
        "Subject": "[PATCH 4/4] net: cpsw: Support new cpsw-switch DT bindings",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "\n <20260410-topic-cpsw-switch-v2026-07-next-v1-4-c914724b13e4@baylibre.com>",
        "References": "\n <20260410-topic-cpsw-switch-v2026-07-next-v1-0-c914724b13e4@baylibre.com>",
        "In-Reply-To": "\n <20260410-topic-cpsw-switch-v2026-07-next-v1-0-c914724b13e4@baylibre.com>",
        "To": "u-boot@lists.denx.de",
        "Cc": "Jerome Forissier <jerome.forissier@arm.com>,\n Tom Rini <trini@konsulko.com>,\n \"Markus Schneider-Pargmann (TI)\" <msp@baylibre.com>",
        "X-Mailer": "b4 0.14.2",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=6318; i=msp@baylibre.com;\n h=from:subject:message-id; bh=sC3LWihHEDj9ddzcYcUMy8y13zKnmjUYHGMG24BggXc=;\n b=owGbwMvMwCXWejAsc4KoVzDjabUkhswbN61DDs+OXxosvfTIz0eecossHPS/ddiWqb10lS2Xf\n uXxRuxmRykLgxgXg6yYIktnYmjaf/mdx5IXLdsMM4eVCWQIAxenAEzkiBcjw4fvzpd5ph2dXrf0\n 614zVZ1l589+LrOt0bykKTu3u+PCgVeMDPdcsvtuxjddy7jNeeGCmeXZShfeNakBmj7mSh35d+y\n mMgIA",
        "X-Developer-Key": "i=msp@baylibre.com; a=openpgp;\n fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41",
        "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": "Upstream devicetrees use a newer DT binding using cpsw-switch\ncompatibles. The bindings are a bit different, so two functions are\nintroduced to capture the differences, cpsw_eth_of_to_plat_switch() and\ncpsw_eth_of_to_plat_legacy().\n\nSigned-off-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com>\n---\n drivers/net/ti/cpsw.c | 148 +++++++++++++++++++++++++++++++++++++++-----------\n 1 file changed, 115 insertions(+), 33 deletions(-)",
    "diff": "diff --git a/drivers/net/ti/cpsw.c b/drivers/net/ti/cpsw.c\nindex b1fb009822e9586886e5487e4fbeee115eec9a59..7a7cb83bd9847bc79ed21b2786ef6fe869e3fc0d 100644\n--- a/drivers/net/ti/cpsw.c\n+++ b/drivers/net/ti/cpsw.c\n@@ -33,6 +33,7 @@\n #define PKT_MAX\t\t\t(1500 + 14 + 4 + 4)\n #define CLEAR_BIT\t\t1\n #define GIGABITEN\t\tBIT(7)\n+#define GMII_EN\t\t\tBIT(5)\n #define FULLDUPLEXEN\t\tBIT(0)\n #define MIIEN\t\t\tBIT(15)\n #define CTL_EXT_EN\t\tBIT(18)\n@@ -1133,33 +1134,13 @@ static void cpsw_eth_of_parse_slave(struct cpsw_platform_data *data,\n \t\t\t\t\t\t\t\"max-speed\", 0);\n }\n \n-static int cpsw_eth_of_to_plat(struct udevice *dev)\n+static int cpsw_eth_of_to_plat_legacy(struct udevice *dev,\n+\t\t\t\t      struct cpsw_platform_data *data)\n {\n-\tstruct eth_pdata *pdata = dev_get_plat(dev);\n-\tstruct cpsw_platform_data *data;\n-\tstruct gpio_desc *mode_gpios;\n \tint slave_index = 0;\n-\tint num_mode_gpios;\n \tofnode subnode;\n \tint ret;\n \n-\tdata = calloc(1, sizeof(struct cpsw_platform_data));\n-\tif (!data)\n-\t\treturn -ENOMEM;\n-\n-\tpdata->priv_pdata = data;\n-\tpdata->iobase = dev_read_addr(dev);\n-\tdata->version = CPSW_CTRL_VERSION_2;\n-\tdata->bd_ram_ofs = CPSW_BD_OFFSET;\n-\tdata->ale_reg_ofs = CPSW_ALE_OFFSET;\n-\tdata->cpdma_reg_ofs = CPSW_CPDMA_OFFSET;\n-\tdata->mdio_div = CPSW_MDIO_DIV;\n-\tdata->host_port_reg_ofs = CPSW_HOST_PORT_OFFSET,\n-\n-\tpdata->phy_interface = -1;\n-\n-\tdata->cpsw_base = pdata->iobase;\n-\n \tret = dev_read_s32(dev, \"cpdma_channels\", &data->channels);\n \tif (ret) {\n \t\tprintf(\"error: cpdma_channels not found in dt\\n\");\n@@ -1192,17 +1173,6 @@ static int cpsw_eth_of_to_plat(struct udevice *dev)\n \t\treturn ret;\n \t}\n \n-\tnum_mode_gpios = gpio_get_list_count(dev, \"mode-gpios\");\n-\tif (num_mode_gpios > 0) {\n-\t\tmode_gpios = malloc(sizeof(struct gpio_desc) *\n-\t\t\t\t    num_mode_gpios);\n-\t\tgpio_request_list_by_name(dev, \"mode-gpios\", mode_gpios,\n-\t\t\t\t\t  num_mode_gpios, GPIOD_IS_OUT);\n-\t\tfree(mode_gpios);\n-\t}\n-\n-\tdata->active_slave = dev_read_u32_default(dev, \"active_slave\", 0);\n-\n \tofnode_for_each_subnode(subnode, dev_ofnode(dev)) {\n \t\tconst char *name;\n \n@@ -1236,6 +1206,115 @@ static int cpsw_eth_of_to_plat(struct udevice *dev)\n \t\t}\n \t}\n \n+\treturn 0;\n+}\n+\n+static int cpsw_eth_of_to_plat_switch(struct udevice *dev,\n+\t\t\t\t      struct cpsw_platform_data *data)\n+{\n+\tofnode eth_ports_node, subnode;\n+\tint ret;\n+\n+\tdata->channels = 8;\n+\tdata->ale_entries = 1024;\n+\tdata->mac_control = GMII_EN;\n+\n+\teth_ports_node = ofnode_find_subnode(dev_ofnode(dev), \"ethernet-ports\");\n+\tdata->slaves = ofnode_get_child_count(eth_ports_node);\n+\tif (!data->slaves) {\n+\t\tpr_err(\"cpsw: No ethernet-ports defined\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdata->slave_data = malloc(sizeof(struct cpsw_slave_data) * data->slaves);\n+\tif (!data->slave_data)\n+\t\treturn -ENOMEM;\n+\n+\tofnode_for_each_subnode(subnode, eth_ports_node) {\n+\t\tstruct ofnode_phandle_args args;\n+\t\tu32 port_id;\n+\n+\t\tret = ofnode_read_u32(subnode, \"reg\", &port_id);\n+\t\tif (ret || !port_id || port_id > data->slaves) {\n+\t\t\tpr_err(\"cpsw: invalid or missing reg in port node\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tcpsw_eth_of_parse_slave(data, port_id - 1, subnode);\n+\n+\t\tif (!data->gmii_sel) {\n+\t\t\tret = ofnode_parse_phandle_with_args(subnode, \"phys\", \"#phy-cells\",\n+\t\t\t\t\t\t\t     0, 0, &args);\n+\t\t\tif (!ret)\n+\t\t\t\tdata->gmii_sel = ofnode_get_addr(args.node);\n+\t\t}\n+\t}\n+\n+\tif (!data->gmii_sel) {\n+\t\tpr_err(\"No port specified phys correctly\\n\");\n+\t\treturn -ENOENT;\n+\t}\n+\n+\tofnode_for_each_subnode(subnode, dev_ofnode(dev)) {\n+\t\tconst char *name = ofnode_get_name(subnode);\n+\n+\t\tif (strncmp(name, \"mdio\", 4))\n+\t\t\tcontinue;\n+\n+\t\tdata->mdio_base = ofnode_get_addr(subnode);\n+\t\tif (data->mdio_base == FDT_ADDR_T_NONE) {\n+\t\t\tpr_err(\"Not able to get MDIO address space\\n\");\n+\t\t\treturn -ENOENT;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int cpsw_eth_of_to_plat(struct udevice *dev)\n+{\n+\tstruct eth_pdata *pdata = dev_get_plat(dev);\n+\tstruct cpsw_platform_data *data;\n+\tstruct gpio_desc *mode_gpios;\n+\tint num_mode_gpios;\n+\tint ret;\n+\tbool switch_dt_bindings =\n+\t\tofnode_valid(ofnode_find_subnode(dev_ofnode(dev), \"ethernet-ports\"));\n+\n+\tdata = calloc(1, sizeof(struct cpsw_platform_data));\n+\tif (!data)\n+\t\treturn -ENOMEM;\n+\n+\tpdata->priv_pdata = data;\n+\tpdata->iobase = dev_read_addr(dev);\n+\tdata->version = CPSW_CTRL_VERSION_2;\n+\tdata->bd_ram_ofs = CPSW_BD_OFFSET;\n+\tdata->ale_reg_ofs = CPSW_ALE_OFFSET;\n+\tdata->cpdma_reg_ofs = CPSW_CPDMA_OFFSET;\n+\tdata->mdio_div = CPSW_MDIO_DIV;\n+\tdata->host_port_reg_ofs = CPSW_HOST_PORT_OFFSET;\n+\n+\tpdata->phy_interface = -1;\n+\n+\tdata->cpsw_base = pdata->iobase;\n+\n+\tnum_mode_gpios = gpio_get_list_count(dev, \"mode-gpios\");\n+\tif (num_mode_gpios > 0) {\n+\t\tmode_gpios = malloc(sizeof(struct gpio_desc) * num_mode_gpios);\n+\t\tgpio_request_list_by_name(dev, \"mode-gpios\", mode_gpios,\n+\t\t\t\t\t  num_mode_gpios, GPIOD_IS_OUT);\n+\t\tfree(mode_gpios);\n+\t}\n+\n+\tdata->active_slave = dev_read_u32_default(dev, \"active_slave\", 0);\n+\n+\tif (switch_dt_bindings)\n+\t\tret = cpsw_eth_of_to_plat_switch(dev, data);\n+\telse\n+\t\tret = cpsw_eth_of_to_plat_legacy(dev, data);\n+\tif (ret)\n+\t\treturn ret;\n+\n \tdata->slave_data[0].slave_reg_ofs = CPSW_SLAVE0_OFFSET;\n \tdata->slave_data[0].sliver_reg_ofs = CPSW_SLIVER0_OFFSET;\n \n@@ -1270,6 +1349,9 @@ static const struct udevice_id cpsw_eth_ids[] = {\n \t{ .compatible = \"ti,am335x-cpsw\",\t\t.data = (ulong)&cpsw_data_am3352 },\n \t{ .compatible = \"ti,am4372-cpsw\",\t\t.data = (ulong)&cpsw_data_am3352 },\n \t{ .compatible = \"ti,dra7-cpsw\",\t\t\t.data = (ulong)&cpsw_data_dra7xx },\n+\t{ .compatible = \"ti,am335x-cpsw-switch\",\t.data = (ulong)&cpsw_data_am3352 },\n+\t{ .compatible = \"ti,am4372-cpsw-switch\",\t.data = (ulong)&cpsw_data_am3352 },\n+\t{ .compatible = \"ti,dra7-cpsw-switch\",\t\t.data = (ulong)&cpsw_data_dra7xx },\n \t{ }\n };\n #endif\n",
    "prefixes": [
        "4/4"
    ]
}