Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5838332ybp; Tue, 8 Oct 2019 09:03:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZ9s9NM4f9DMLHg7tZh0B39Ri/0KnWgEpDuS6Yg10zgcp2bEXUltiCKx+m7ebNzBBUemmQ X-Received: by 2002:adf:fb11:: with SMTP id c17mr29366083wrr.0.1570550597613; Tue, 08 Oct 2019 09:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570550597; cv=none; d=google.com; s=arc-20160816; b=sQWY9rAi+UlmaUuV330rHLG4D4Yau4uuBDmnqP+yV2rDJh3z02HyU8zJ86gcup+ei3 tygSvQ70cSdHXZ2ekemCQdoutcSvoKnScp9595IJ04S3EjC1Iuf/lnnfE7JO24svt0GI +2f7IhKu/crALHuPdlsVFIBBNGmRWG6eUMKHtR8JbHato5SOkBjQjhKrtizBrM43slGl Qz/4RHv3BlbbcgIPldtpzUAOqDd33HoDquTx+ONCRqC+ggBfn30k1aCJCmcQWmukweI1 5yLfEumK3zKhsqRqgIRs6CLSSmXnquswcE1d8My/X1CMynMvfEo9GruBa/FC0Xk7NJfr zYwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tBcYZS8wTLJ+jyCTUqfygduDl+keSPK2KmttGIFgonY=; b=osXThX6f8tGeM8C7n2RencVviSpr1YC5JFuD3LTWIyZUBYbJShnBl35ybuIlp/Y4/o 3gtiat2Ko++8u0spAv7G1F7eaMBh3EWtwEB6eSzB5Lz9n84+/egh61FAqLKK5sdk2Ssh /YZvsekDrSM7xdNtYcs/paAFBNzo33RO1VyW5bZ4VoBV9CoBTDvQj7HJwDSp5/R4twJV 4YRs9J3sIRZXZket9i+uO65/F0PrQkDBBvpxb7937iioCv4t9kSQ4JBg51RqmAByBASF sgJOdR4aSaySdjcivhwKAryXnfTWChugxMLkryBIN8IJytZyCbsR9P6VC824ac2FP7l6 /XXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b="M/ESIIsD"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y50si11814201edd.237.2019.10.08.09.02.49; Tue, 08 Oct 2019 09:03:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b="M/ESIIsD"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727409AbfJHP76 (ORCPT + 99 others); Tue, 8 Oct 2019 11:59:58 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:42943 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbfJHP76 (ORCPT ); Tue, 8 Oct 2019 11:59:58 -0400 Received: by mail-io1-f65.google.com with SMTP id n197so37548990iod.9 for ; Tue, 08 Oct 2019 08:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tBcYZS8wTLJ+jyCTUqfygduDl+keSPK2KmttGIFgonY=; b=M/ESIIsDxB9Ncm/b7SrUpQK2qVva33uQVjzi0rmMNZWq+KjIL4kQkdUI6PDLqU/YO0 NizkAN6jpaDwaYsdMmnkZNXTiTw1jJ+zVkTDYA/lUqABHr4pIaFRqaMSCzBxtVbHR1VZ W5O61xR+bDEC4nuTDqOy/p8AXbBLd8hpsQv8gtlYA7SRZXmD5ks72VKXDo1PFN8cDKDc u1FSmMLttZ1FH2imVoFaRFZGhWVppi2xW4NChmzu3G/5rUR84dHQwCFid99lcEpRkHXZ 32yB2Ijm9S2jk5yGsVvOUma6diTYFfZIsF4IzLIRtWRF67jK0JXedwEtHlt4eLm/N8rT mJDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tBcYZS8wTLJ+jyCTUqfygduDl+keSPK2KmttGIFgonY=; b=Rfw06P4jKkdyyeriBGyrxeHjFrmoYpw6XD/1nThjIboW9q96r2vl6KXdyFX9wSNPHk Eu+e67yDeEKJMOBEM7Y50xhf0RHjYVgw9W+aixZfb2T+pszJlcwi/Ys/Jh7zSxPfjHfP FoayrbseorxY/biT0qsW/BnwFR2hz5pUG/MbA74cJgmXvwT2CSVsIjpIqqO99vGKpSbw bGwRuyzC056HzxUe2yyowDxwbqb9rCTyf+Y+nXuOBtUhdUsloXmjsmilIQdc/LZGJpLy JO/nxsy5w5XmPjv9bL/gFFveDE7p32g9FwG+F9D5vAHwz+fqpKhQuibG1oXlv9Ymp70+ gsXw== X-Gm-Message-State: APjAAAV7EIAzMa5nRbZwr2v5kZTjC4OSfx2FRPq5fC+yiTcCGEw5lg/Z PEIecOB5+B895T4PY+G4m+F7z3rsZdOlzGZh9IjWXw== X-Received: by 2002:a6b:ca85:: with SMTP id a127mr29155336iog.278.1570550395547; Tue, 08 Oct 2019 08:59:55 -0700 (PDT) MIME-Version: 1.0 References: <20190822192451.5983-1-scott.branden@broadcom.com> <20190822192451.5983-6-scott.branden@broadcom.com> <61c3e8a2-b230-844e-466c-ba45b42542a1@ideasonboard.com> In-Reply-To: <61c3e8a2-b230-844e-466c-ba45b42542a1@ideasonboard.com> From: Olof Johansson Date: Tue, 8 Oct 2019 08:59:43 -0700 Message-ID: Subject: Re: [PATCH 5/7] bcm-vk: add bcm_vk UAPI To: kieran.bingham@ideasonboard.com Cc: Scott Branden , Luis Chamberlain , Greg Kroah-Hartman , David Brown , Alexander Viro , Shuah Khan , Bjorn Andersson , Shuah Khan , Arnd Bergmann , "Rafael J . Wysocki" , Linux Kernel Mailing List , linux-arm-msm , linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , Takashi Iwai , "open list:KERNEL SELFTEST FRAMEWORK" , Ohad Ben-Cohen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 7:49 AM Kieran Bingham wrote: > > Hi Scott, > > On 22/08/2019 20:24, Scott Branden wrote: > > Add user space api for bcm-vk driver. > > > > Signed-off-by: Scott Branden > > --- > > include/uapi/linux/misc/bcm_vk.h | 88 ++++++++++++++++++++++++++++++++ > > 1 file changed, 88 insertions(+) > > create mode 100644 include/uapi/linux/misc/bcm_vk.h > > > > diff --git a/include/uapi/linux/misc/bcm_vk.h b/include/uapi/linux/misc/bcm_vk.h > > new file mode 100644 > > index 000000000000..df7dfd7f0702 > > --- /dev/null > > +++ b/include/uapi/linux/misc/bcm_vk.h > > @@ -0,0 +1,88 @@ > > +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ > > +/* > > + * Copyright(c) 2018 Broadcom > > + */ > > + > > +#ifndef __UAPI_LINUX_MISC_BCM_VK_H > > +#define __UAPI_LINUX_MISC_BCM_VK_H > > + > > +#include > > +#include > > + > > +struct vk_metadata { > > + /* struct version, always backwards compatible */ > > + __u32 version; > > + > > + /* Version 0 fields */ > > + __u32 card_status; > > +#define VK_CARD_STATUS_FASTBOOT_READY BIT(0) > > +#define VK_CARD_STATUS_FWLOADER_READY BIT(1) > > + > > + __u32 firmware_version; > > + __u32 fw_status; > > + /* End version 0 fields */ > > + > > + __u64 reserved[14]; > > + /* Total of 16*u64 for all versions */ > > +}; > > + > > +struct vk_image { > > + __u32 type; /* Type of image */ > > +#define VK_IMAGE_TYPE_BOOT1 1 /* 1st stage (load to SRAM) */ > > +#define VK_IMAGE_TYPE_BOOT2 2 /* 2nd stage (load to DDR) */ > > + char filename[64]; /* Filename of image */ > > +}; > > + > > +/* default firmware images names */ > > +#define VK_BOOT1_DEF_FILENAME "vk-boot1.bin" > > +#define VK_BOOT2_DEF_FILENAME "vk-boot2.bin" > > + > > +struct vk_access { > > + __u8 barno; /* BAR number to use */ > > + __u8 type; /* Type of access */ > > +#define VK_ACCESS_READ 0 > > +#define VK_ACCESS_WRITE 1 > > + __u32 len; /* length of data */ > > + __u64 offset; /* offset in BAR */ > > + __u32 *data; /* where to read/write data to */ > > +}; > > + > > +struct vk_reset { > > + __u32 arg1; > > + __u32 arg2; > > +}; > > + > > +#define VK_MAGIC 0x5E > > + > > +/* Get metadata from Valkyrie (firmware version, card status, etc) */ > > +#define VK_IOCTL_GET_METADATA _IOR(VK_MAGIC, 0x1, struct vk_metadata) > > + > > +/* Load image to Valkyrie */ > > +#define VK_IOCTL_LOAD_IMAGE _IOW(VK_MAGIC, 0x2, struct vk_image) > > + > > +/* Read data from Valkyrie */ > > +#define VK_IOCTL_ACCESS_BAR _IOWR(VK_MAGIC, 0x3, struct vk_access) > > + > > +/* Send Reset to Valkyrie */ > > +#define VK_IOCTL_RESET _IOW(VK_MAGIC, 0x4, struct vk_reset) > > It sounds a bit like the valkyrie is a generic asynchronous coprocessor, > does it merit using the remoteproc interfaces to control it ? > > Or is it really just a single purpose cell doing video operations ? Remoteproc brings some useful shared functionality, in particular around loading and parsing firmware formats for platforms where the remote processor uses system carved out memory to run, etc. For something like a PCIe device, it *can* be used but it really doesn't bring any immediate benefit, especially if there aren't multiple in-kernel drivers that need to talk to the hardware in an abstracted way. -Olof -Olof