From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B005C64E90 for ; Wed, 2 Dec 2020 03:05:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A776C20C56 for ; Wed, 2 Dec 2020 03:05:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727902AbgLBDFs (ORCPT ); Tue, 1 Dec 2020 22:05:48 -0500 Received: from mga03.intel.com ([134.134.136.65]:37973 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726441AbgLBDFr (ORCPT ); Tue, 1 Dec 2020 22:05:47 -0500 IronPort-SDR: KpvNgF/FhCjUUVsWF7bHwJH9cEsWGgKKeEPfiPs0vXnfZ4oonIep0YuWDzfe0uAB8+xId8lwMN 8+zSYgf8A1yA== X-IronPort-AV: E=McAfee;i="6000,8403,9822"; a="173041944" X-IronPort-AV: E=Sophos;i="5.78,385,1599548400"; d="scan'208";a="173041944" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2020 19:04:57 -0800 IronPort-SDR: GBCM2P7tgqOK8o7TvMfXOZ+BefCxHQCn7xcH9OAKNbNSwNraesLQiiwx2iBK7mq5DGaa2Aq8Lp uCgOvMAd1pfA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,385,1599548400"; d="scan'208";a="539490975" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.141]) by fmsmga005.fm.intel.com with ESMTP; 01 Dec 2020 19:04:55 -0800 Date: Wed, 2 Dec 2020 11:00:26 +0800 From: Xu Yilun To: Sonal Santan Cc: linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org, maxz@xilinx.com, 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 Message-ID: <20201202030026.GD22103@yilunxu-OptiPlex-7050> References: <20201129000040.24777-1-sonals@xilinx.com> <20201129000040.24777-8-sonals@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201129000040.24777-8-sonals@xilinx.com> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +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? I didn't find the creation of leaf platform devices, maybe I can find the answer in the missing Patch #5? 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; > + }