linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Zhen <max.zhen@xilinx.com>
To: Xu Yilun <yilun.xu@intel.com>, Sonal Santan <sonal.santan@xilinx.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-fpga@vger.kernel.org>,
	<lizhih@xilinx.com>, <michal.simek@xilinx.com>,
	<stefanos@xilinx.com>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH Xilinx Alveo 7/8] fpga: xrt: Alveo management physical function driver
Date: Thu, 3 Dec 2020 20:40:21 -0800	[thread overview]
Message-ID: <84c896d1-1e61-fbec-df22-72fe061f39e3@xilinx.com> (raw)
In-Reply-To: <20201202030026.GD22103@yilunxu-OptiPlex-7050>

Hi Yilun,


On 12/1/20 7:00 PM, Xu Yilun wrote:
> 
> 
>> +static int xmgmt_main_event_cb(struct platform_device *pdev,
>> +     enum xrt_events evt, void *arg)
>> +{
>> +     struct xmgmt_main *xmm = platform_get_drvdata(pdev);
>> +     struct xrt_event_arg_subdev *esd = (struct xrt_event_arg_subdev *)arg;
>> +     enum xrt_subdev_id id;
>> +     int instance;
>> +     size_t fwlen;
>> +
>> +     switch (evt) {
>> +     case XRT_EVENT_POST_CREATION: {
>> +             id = esd->xevt_subdev_id;
>> +             instance = esd->xevt_subdev_instance;
>> +             xrt_info(pdev, "processing event %d for (%d, %d)",
>> +                     evt, id, instance);
>> +
>> +             if (id == XRT_SUBDEV_GPIO)
>> +                     xmm->gpio_ready = true;
>> +             else if (id == XRT_SUBDEV_QSPI)
>> +                     xmm->flash_ready = true;
>> +             else
>> +                     BUG_ON(1);
>> +
>> +             if (xmm->gpio_ready && xmm->flash_ready) {
>> +                     int rc;
>> +
>> +                     rc = load_firmware_from_disk(pdev, &xmm->firmware_blp,
>> +                             &fwlen);
>> +                     if (rc != 0) {
>> +                             rc = load_firmware_from_flash(pdev,
>> +                                     &xmm->firmware_blp, &fwlen);
> 
> I'm curious that before the shell metadata is loaded, how the QSPI
> subdev is enumerated and get to work? The QSPI DT info itself is
> stored in metadata, is it?

No, it is not from the shell metadata. The QSPI subdev info is 
discovered from a rom located on the PCIE BAR pointed to by VSEC cap 
found in config space.

> 
> I didn't find the creation of leaf platform devices, maybe I can find
> the answer in the missing Patch #5?

Leaf driver is children of partition driver. They are created in 
xrt_part_create_leaves() in xrt-partition.c.

Thanks,
Max

> 
> Thanks,
> Yilun
> 
>> +                     }
>> +                     if (rc == 0 && is_valid_firmware(pdev,
>> +                         xmm->firmware_blp, fwlen))
>> +                             (void) xmgmt_create_blp(xmm);
>> +                     else
>> +                             xrt_err(pdev,
>> +                                     "failed to find firmware, giving up");
>> +                     xmm->evt_hdl = NULL;
>> +             }
>> +             break;
>> +     }

  reply	other threads:[~2020-12-04  4:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29  0:00 [PATCH Xilinx Alveo 0/8] Xilinx Alveo/XRT patch overview Sonal Santan
2020-11-29  0:00 ` [PATCH Xilinx Alveo 1/8] Documentation: fpga: Add a document describing Alveo XRT drivers Sonal Santan
2020-12-01  4:54   ` Moritz Fischer
2020-12-02 21:24     ` Max Zhen
2020-12-02 23:10       ` Moritz Fischer
2020-12-03  3:38         ` Max Zhen
2020-12-03  4:36           ` Moritz Fischer
2020-12-04  1:17             ` Max Zhen
2020-12-04  4:18               ` Moritz Fischer
2020-11-29  0:00 ` [PATCH Xilinx Alveo 2/8] fpga: xrt: Add UAPI header files Sonal Santan
2020-12-01  4:27   ` Moritz Fischer
2020-12-02 18:57     ` Sonal Santan
2020-12-02 23:47       ` Moritz Fischer
2020-11-29  0:00 ` [PATCH Xilinx Alveo 3/8] fpga: xrt: infrastructure support for xmgmt driver Sonal Santan
2020-11-29  0:00 ` [PATCH Xilinx Alveo 4/8] fpga: xrt: core infrastructure for xrt-lib module Sonal Santan
2020-11-29  0:00 ` [PATCH Xilinx Alveo 6/8] fpga: xrt: header file for platform and parent drivers Sonal Santan
2020-11-29  0:00 ` [PATCH Xilinx Alveo 7/8] fpga: xrt: Alveo management physical function driver Sonal Santan
2020-12-01 20:51   ` Moritz Fischer
     [not found]     ` <BY5PR02MB60683E3470179E6AD10FEE26B9F20@BY5PR02MB6068.namprd02.prod.outlook.com>
2020-12-04  6:22       ` Sonal Santan
2020-12-02  3:00   ` Xu Yilun
2020-12-04  4:40     ` Max Zhen [this message]
2020-11-29  0:00 ` [PATCH Xilinx Alveo 8/8] fpga: xrt: Kconfig and Makefile updates for XRT drivers Sonal Santan
2020-11-30 18:08 ` [PATCH Xilinx Alveo 0/8] Xilinx Alveo/XRT patch overview Rob Herring
2020-12-01 19:39   ` Sonal Santan
2020-12-02  2:14 ` Xu Yilun
2020-12-02  5:33   ` Sonal Santan
2020-12-06 16:31 ` Tom Rix
2020-12-08 21:40   ` Sonal Santan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84c896d1-1e61-fbec-df22-72fe061f39e3@xilinx.com \
    --to=max.zhen@xilinx.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhih@xilinx.com \
    --cc=michal.simek@xilinx.com \
    --cc=sonal.santan@xilinx.com \
    --cc=stefanos@xilinx.com \
    --cc=yilun.xu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).