From: Scott Branden <scott.branden@broadcom.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Kees Cook <keescook@chromium.org>,
linux-kernel@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH v3 1/3] bcm-vk: add bcm_vk UAPI
Date: Wed, 23 Sep 2020 16:55:14 -0700 [thread overview]
Message-ID: <d06815f8-c868-1aeb-ca9e-2181f7d00188@broadcom.com> (raw)
In-Reply-To: <20200907123546.GB2371705@kroah.com>
[-- Attachment #1: Type: text/plain, Size: 2601 bytes --]
Hi Greg,
On 2020-09-07 5:35 a.m., Greg Kroah-Hartman wrote:
> On Tue, Aug 25, 2020 at 12:43:58PM -0700, Scott Branden wrote:
>> Add user space api for bcm-vk driver.
>>
>> Signed-off-by: Scott Branden <scott.branden@broadcom.com>
>> ---
>> include/uapi/linux/misc/bcm_vk.h | 99 ++++++++++++++++++++++++++++++++
>> 1 file changed, 99 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..da7848e7c438
>> --- /dev/null
>> +++ b/include/uapi/linux/misc/bcm_vk.h
>> @@ -0,0 +1,99 @@
>> +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
>> +/*
>> + * Copyright 2018-2020 Broadcom.
>> + */
>> +
>> +#ifndef __UAPI_LINUX_MISC_BCM_VK_H
>> +#define __UAPI_LINUX_MISC_BCM_VK_H
>> +
>> +#include <linux/ioctl.h>
>> +#include <linux/types.h>
>> +
>> +#define BCM_VK_MAX_FILENAME 64
>> +
>> +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[BCM_VK_MAX_FILENAME]; /* Filename of image */
> nit, but this should really be __u8 filename[...
> right?
Changed to __u8. Thanks.
>
>
>
>> +};
>> +
>> +struct vk_reset {
>> + __u32 arg1;
>> + __u32 arg2;
>> +};
>> +
>> +#define VK_MAGIC 0x5e
>> +
>> +/* Load image to Valkyrie */
>> +#define VK_IOCTL_LOAD_IMAGE _IOW(VK_MAGIC, 0x2, struct vk_image)
>> +
>> +/* Send Reset to Valkyrie */
>> +#define VK_IOCTL_RESET _IOW(VK_MAGIC, 0x4, struct vk_reset)
>> +
>> +/*
>> + * message block - basic unit in the message where a message's size is always
>> + * N x sizeof(basic_block)
>> + */
>> +struct vk_msg_blk {
>> + __u8 function_id;
>> +#define VK_FID_TRANS_BUF 5
>> +#define VK_FID_SHUTDOWN 8
>> + __u8 size;
> Size of what?
Size is number of vk_msg_blk's. Comment is above the struct.
Can add a comment on this line as well.
>
>> + __u16 trans_id; /* transport id, queue & msg_id */
>> + __u32 context_id;
>> + __u32 args[2];
>> +#define VK_CMD_PLANES_MASK 0x000f /* number of planes to up/download */
>> +#define VK_CMD_UPLOAD 0x0400 /* memory transfer to vk */
>> +#define VK_CMD_DOWNLOAD 0x0500 /* memory transfer from vk */
>> +#define VK_CMD_MASK 0x0f00 /* command mask */
>> +};
> What are these defines for? The args? Something else? It's not really
> obvious here...
Agree, it's not really obvious and is confusing.
When args[0] is a command the defines apply.
Will add comments.
>
> thanks,
>
> greg k-h
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4169 bytes --]
next prev parent reply other threads:[~2020-09-23 23:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 19:43 [PATCH v3 0/3] Add Broadcom VK driver Scott Branden
2020-08-25 19:43 ` [PATCH v3 1/3] bcm-vk: add bcm_vk UAPI Scott Branden
2020-09-07 12:35 ` Greg Kroah-Hartman
2020-09-23 23:55 ` Scott Branden [this message]
2020-08-25 19:43 ` [PATCH v3 2/3] misc: bcm-vk: add Broadcom VK driver Scott Branden
2020-08-25 22:22 ` kernel test robot
2020-09-07 12:55 ` Greg Kroah-Hartman
[not found] ` <767f6b6a-07fc-f1b6-f43c-b974761f1505@broadcom.com>
2020-09-24 5:08 ` Greg Kroah-Hartman
2020-09-24 21:40 ` Scott Branden
2020-09-25 5:10 ` Greg Kroah-Hartman
2020-09-25 16:50 ` Scott Branden
2020-09-29 16:16 ` Greg Kroah-Hartman
2020-09-30 0:03 ` Scott Branden
2020-09-29 0:22 ` Scott Branden
2020-09-29 10:24 ` Greg Kroah-Hartman
2020-08-25 19:44 ` [PATCH v3 3/3] MAINTAINERS: bcm-vk: add maintainer for Broadcom VK Driver Scott Branden
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=d06815f8-c868-1aeb-ca9e-2181f7d00188@broadcom.com \
--to=scott.branden@broadcom.com \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
/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