From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 3 Sep 2015 11:34:04 +0200 Subject: [U-Boot] [PATCH v3 1/2] usb: zynqmp: Add XHCI driver support In-Reply-To: <1441271942-39785-1-git-send-email-sivadur@xilinx.com> References: <1441271942-39785-1-git-send-email-sivadur@xilinx.com> Message-ID: <201509031134.04738.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday, September 03, 2015 at 11:19:01 AM, Siva Durga Prasad Paladugu wrote: > Added USB XHCI driver support for zynqmp. > > Signed-off-by: Siva Durga Prasad Paladugu Hi, is this V3 in any way different from the previous V3 ? [...] > +int xhci_hcd_init(int index, struct xhci_hccr **hccr, struct xhci_hcor > **hcor) +{ > + struct zynqmp_xhci *ctx = &zynqmp_xhci; > + int ret = 0; You should sanitize the index here: if (index < 0 || index > ARRAY_SIZE(ctr_addr)) return -EINVAL; > + ctx->hcd = (struct xhci_hccr *)ctr_addr[index]; > + ctx->dwc3_reg = (struct dwc3 *)((char *)(ctx->hcd) + DWC3_REG_OFFSET); > + > + ret = board_usb_init(index, USB_INIT_HOST); > + if (ret != 0) { > + puts("Failed to initialize board for USB\n"); > + return ret; > + } > + > + ret = zynqmp_xhci_core_init(ctx); > + if (ret < 0) { > + puts("Failed to initialize xhci\n"); > + return ret; > + } > + > + *hccr = (struct xhci_hccr *)ctx->hcd; > + *hcor = (struct xhci_hcor *)((uint32_t) *hccr > + + HC_LENGTH(xhci_readl(&(*hccr)->cr_capbase))); > + > + debug("zynqmp-xhci: init hccr %x and hcor %x hc_length %d\n", > + (uint32_t)*hccr, (uint32_t)*hcor, > + (uint32_t)HC_LENGTH(xhci_readl(&(*hccr)->cr_capbase))); > + > + return ret; > +} Otherwise, Acked-by: Marek Vasut Best regards, Marek Vasut