{"id":811005,"url":"http://patchwork.ozlabs.org/api/1.2/patches/811005/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/1504790001-24715-2-git-send-email-bmeng.cn@gmail.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/projects/18/?format=json","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":"<1504790001-24715-2-git-send-email-bmeng.cn@gmail.com>","list_archive_url":null,"date":"2017-09-07T13:13:18","name":"[U-Boot,2/5] dm: usb: xhci: Implement get_max_xfer_size() operation","commit_ref":"022ceacaf8a6a67f86f0a5ed8f6ce6b2f6ab73a4","pull_url":null,"state":"accepted","archived":false,"hash":"491d4f91cb8dc8ea80c464fc75c626b0671182b3","submitter":{"id":64981,"url":"http://patchwork.ozlabs.org/api/1.2/people/64981/?format=json","name":"Bin Meng","email":"bmeng.cn@gmail.com"},"delegate":{"id":1699,"url":"http://patchwork.ozlabs.org/api/1.2/users/1699/?format=json","username":"marex","first_name":"Marek","last_name":"Vasut","email":"marek.vasut@gmail.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/1504790001-24715-2-git-send-email-bmeng.cn@gmail.com/mbox/","series":[{"id":1998,"url":"http://patchwork.ozlabs.org/api/1.2/series/1998/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=1998","date":"2017-09-07T13:13:17","name":"[U-Boot,1/5] dm: usb: Add a new USB controller operation 'get_max_xfer_size'","version":1,"mbox":"http://patchwork.ozlabs.org/series/1998/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/811005/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/811005/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"T/873yXO\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xp1600LsKz9sNd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 23:10:32 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid CF210C21EDB; Thu,  7 Sep 2017 13:09:21 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 03D67C21E2D;\n\tThu,  7 Sep 2017 13:09:04 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid A7193C21D5B; Thu,  7 Sep 2017 13:09:01 +0000 (UTC)","from mail-io0-f196.google.com (mail-io0-f196.google.com\n\t[209.85.223.196])\n\tby lists.denx.de (Postfix) with ESMTPS id 2C8A4C21C73\n\tfor <u-boot@lists.denx.de>; Thu,  7 Sep 2017 13:09:01 +0000 (UTC)","by mail-io0-f196.google.com with SMTP id 2so849059ion.3\n\tfor <u-boot@lists.denx.de>; Thu, 07 Sep 2017 06:09:01 -0700 (PDT)","from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com.\n\t[147.11.156.139]) by smtp.gmail.com with ESMTPSA id\n\tw63sm1238554iof.18.2017.09.07.06.08.58\n\t(version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 07 Sep 2017 06:08:59 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:subject:date:message-id:in-reply-to:references;\n\tbh=qndKJU/pPPeDmbD6ButiTk5Xx+tJcHtLcijQoIKPYE8=;\n\tb=T/873yXOnK2llgSCNMnS/UlNkUFdGrTQLf5MJ29l2UwKNzI89iCZIVTEVCzyWnFdqH\n\tGQIVGwMOlKa5+PVwzjUAauJZ3ACSP/TGxuONKhFB8N7U2TpAfNGuCBammsH7k2IwYFs9\n\tsMRv3Edy7UDtfhfD1VO1QHZwVPd1DTy7x6FBydyba8P0mR3DI1x2j8IMVtjxQ0bsb8Ov\n\t3qkWfn/71LS0gVfy9eICQooBN+SCb7AR2EozVdTLIrUmmuGFIKR2a7ke+q5PXBVXP6Lt\n\tW/5I3t+932Qu70MBTS92unXh6NAZQyP6XtrLV2KeemBSMKm9HPXq7Ohii/cg9vdQ0Z92\n\tnqHg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=qndKJU/pPPeDmbD6ButiTk5Xx+tJcHtLcijQoIKPYE8=;\n\tb=mtiwN4Av66E1bIWtEDBprcliid0BcGDNre0F97V5rg5VxqQ+tpKVfND0vmME9RlOQg\n\tTqE2wE9qQT9m51cELdSfto6IS3LIh0AKigI6z3zWA4hv4mTL/OI8+VGsiwuMB/2Okw11\n\tfC754SsImQmqap3a7Zzx+Pk8UeE/8QA0AUKChN2t902GxeQf/i3rU4ut5gR5KueKzc5f\n\tvIdcanWb/dygdUlBj8C1knyZhmWaqT7/7PKgGOuSgBdB3KxvDBkWISzsQ54TEDyjquqy\n\tIlPoAnrz9Sr9bRbLh7YxiWu5dZNBCb2fweUhZzqsvgIM6LOMej+sWowxA3v8OZUfJq1A\n\tJXcA==","X-Gm-Message-State":"AHPjjUjXQjtvsUnb6Z7ojt0XmAOMWz9jSvYC0nZzVfomqzf9N+cwkhpE\n\t4eKg/JE/lqd+vw==","X-Google-Smtp-Source":"AOwi7QBhH6pXEElbKnuO1YEEHzqoRyRnYA8Hxsvk71NCpoIjDVBR9NGoJxApyG4/30U6uohfsVa/PQ==","X-Received":"by 10.107.38.82 with SMTP id m79mr2903436iom.306.1504789740043; \n\tThu, 07 Sep 2017 06:09:00 -0700 (PDT)","From":"Bin Meng <bmeng.cn@gmail.com>","To":"Marek Vasut <marex@denx.de>, Stefan Roese <sr@denx.de>,\n\tMasahiro Yamada <yamada.masahiro@socionext.com>,\n\tSimon Glass <sjg@chromium.org>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","Date":"Thu,  7 Sep 2017 06:13:18 -0700","Message-Id":"<1504790001-24715-2-git-send-email-bmeng.cn@gmail.com>","X-Mailer":"git-send-email 1.7.9.5","In-Reply-To":"<1504790001-24715-1-git-send-email-bmeng.cn@gmail.com>","References":"<1504790001-24715-1-git-send-email-bmeng.cn@gmail.com>","Subject":"[U-Boot] [PATCH 2/5] dm: usb: xhci: Implement get_max_xfer_size()\n\toperation","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://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\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"xHCD allocates one segment which includes 64 TRBs for each endpoint\nand the last TRB in this segment is configured as a link TRB to form\na TRB ring. Each TRB can transfer up to 64K bytes, however data\nbuffers referenced by transfer TRBs shall not span 64KB boundaries.\nHence the maximum number of TRBs we can use in one transfer is 62.\n\nSigned-off-by: Bin Meng <bmeng.cn@gmail.com>\n---\n\n drivers/usb/host/xhci.c | 15 +++++++++++++++\n 1 file changed, 15 insertions(+)","diff":"diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c\nindex 9b82ee5..04eb1eb 100644\n--- a/drivers/usb/host/xhci.c\n+++ b/drivers/usb/host/xhci.c\n@@ -1228,6 +1228,20 @@ static int xhci_update_hub_device(struct udevice *dev, struct usb_device *udev)\n \treturn xhci_configure_endpoints(udev, false);\n }\n \n+static int xhci_get_max_xfer_size(struct udevice *dev, size_t *size)\n+{\n+\t/*\n+\t * xHCD allocates one segment which includes 64 TRBs for each endpoint\n+\t * and the last TRB in this segment is configured as a link TRB to form\n+\t * a TRB ring. Each TRB can transfer up to 64K bytes, however data\n+\t * buffers referenced by transfer TRBs shall not span 64KB boundaries.\n+\t * Hence the maximum number of TRBs we can use in one transfer is 62.\n+\t */\n+\t*size = (TRBS_PER_SEGMENT - 2) * TRB_MAX_BUFF_SIZE;\n+\n+\treturn 0;\n+}\n+\n int xhci_register(struct udevice *dev, struct xhci_hccr *hccr,\n \t\t  struct xhci_hcor *hcor)\n {\n@@ -1281,6 +1295,7 @@ struct dm_usb_ops xhci_usb_ops = {\n \t.interrupt = xhci_submit_int_msg,\n \t.alloc_device = xhci_alloc_device,\n \t.update_hub_device = xhci_update_hub_device,\n+\t.get_max_xfer_size  = xhci_get_max_xfer_size,\n };\n \n #endif\n","prefixes":["U-Boot","2/5"]}