PetervdPerk-NXP commented on code in PR #16772: URL: https://github.com/apache/nuttx/pull/16772#discussion_r2281770981
########## drivers/pci/pcie_dw.c: ########## @@ -0,0 +1,1058 @@ +/**************************************************************************** + * drivers/pci/pcie_dw.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/pci/pci_regs.h> +#include <sys/param.h> + +#include "pcie_dw.h" + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static uint8_t +__dw_pcie_find_next_cap(FAR struct dw_pcie_s *pci, uint8_t cap_ptr, + uint8_t cap); +FAR static void * +dw_pcie_select_atu(FAR struct dw_pcie_s *pci, uint32_t dir, + uint32_t index); +static uint32_t +dw_pcie_readl_atu(FAR struct dw_pcie_s *pci, uint32_t dir, uint32_t index, + uint32_t reg); +static void +dw_pcie_writel_atu(FAR struct dw_pcie_s *pci, uint32_t dir, uint32_t index, + uint32_t reg, uint32_t val); +static uint32_t +dw_pcie_readl_atu_ob(FAR struct dw_pcie_s *pci, uint32_t index, + uint32_t reg); +static inline void +dw_pcie_writel_atu_ob(FAR struct dw_pcie_s *pci, uint32_t index, + uint32_t reg, uint32_t val); +static uint32_t dw_pcie_enable_ecrc(uint32_t val); +static uint32_t +dw_pcie_readl_atu_ib(FAR struct dw_pcie_s *pci, uint32_t index, + uint32_t reg); +static void +dw_pcie_writel_atu_ib(FAR struct dw_pcie_s *pci, uint32_t index, + uint32_t reg, uint32_t val); +static void dw_pcie_link_set_max_speed(FAR struct dw_pcie_s *pci); +static void +dw_pcie_link_set_max_link_width(FAR struct dw_pcie_s *pci, + uint32_t num_lanes); +static int dw_pcie_link_up(FAR struct dw_pcie_s *pci); +static uint8_t +dw_pcie_find_capability(FAR struct dw_pcie_s *pci, uint8_t cap); +static int dw_pcie_write(FAR void *addr, int size, uint32_t val); +static int dw_pcie_read(FAR void *addr, int size, FAR uint32_t *val); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static uint8_t Review Comment: This looks to be coming from the Linux DWC driver which is GPLv2. https://github.com/Xilinx/linux-xlnx/blob/786191c466220b9fe979f81053b82cb095d18225/drivers/pci/controller/dwc/pcie-designware.c#L211 FYI @jerpelea @acassis -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org