lkml.org 
[lkml]   [2020]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/3] bcm-vk: add bcm_vk UAPI
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?



> +};
> +
> +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?

> + __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...

thanks,

greg k-h

\
 
 \ /
  Last update: 2020-09-07 14:45    [W:0.116 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site