Skip to contentSkip to conversation

Add Broadcom VK driver

PATCH Superseded Scott Branden 2 participants 5 messages Jul 29, 2020 – Jul 31, 2020

Subsystems (2)

v1 of 10 Superseded Latest is v10 →

lore
Share & tools
lore

Scott Branden

author maintainer
#0 lore raw

cover Add Broadcom VK driver

This patch series drops previous patches in [1] that were incorporated by Kees Cook into patch series "Introduce partial kernel_read_file() support" [2].

Remaining patches are contained in this series to add Broadcom VK driver. (which depends on request_firmware_into_buf API addition in other patch series [2] being applied first).

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/

Scott Branden (3):
bcm-vk: add bcm_vk UAPI
misc: bcm-vk: add Broadcom VK driver
MAINTAINERS: bcm-vk: add maintainer for Broadcom VK Driver

 MAINTAINERS                      |    7 +
 drivers/misc/Kconfig             |    1 +
 drivers/misc/Makefile            |    1 +
 drivers/misc/bcm-vk/Kconfig      |   29 +
 drivers/misc/bcm-vk/Makefile     |   11 +
 drivers/misc/bcm-vk/bcm_vk.h     |  424 +++++++++
 drivers/misc/bcm-vk/bcm_vk_dev.c | 1369 +++++++++++++++++++++++++++
 drivers/misc/bcm-vk/bcm_vk_msg.c | 1507 ++++++++++++++++++++++++++++++
 drivers/misc/bcm-vk/bcm_vk_msg.h |  211 +++++
 drivers/misc/bcm-vk/bcm_vk_sg.c  |  275 ++++++
 drivers/misc/bcm-vk/bcm_vk_sg.h  |   61 ++
 drivers/misc/bcm-vk/bcm_vk_tty.c |  365 ++++++++
 include/uapi/linux/misc/bcm_vk.h |   99 ++
 13 files changed, 4360 insertions(+)
 create mode 100644 drivers/misc/bcm-vk/Kconfig
 create mode 100644 drivers/misc/bcm-vk/Makefile
 create mode 100644 drivers/misc/bcm-vk/bcm_vk.h
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_dev.c
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_msg.c
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_msg.h
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_sg.c
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_sg.h
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_tty.c
 create mode 100644 include/uapi/linux/misc/bcm_vk.h
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH 1/3 bcm-vk: add bcm_vk UAPI

Add user space api for bcm-vk driver.

---
 include/uapi/linux/misc/bcm_vk.h | 99 ++++++++++++++++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 include/uapi/linux/misc/bcm_vk.h
include/uapi/linux/misc/bcm_vk.h new file +99 -0
new file mode 100644
index 000000000000..783087b7c31f
@@ -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 */
+};
+
+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;
+	__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 */
+};
+
+#define VK_BAR_FWSTS			0x41c
+#define VK_BAR_COP_FWSTS		0x428
+/* VK_FWSTS definitions */
+#define VK_FWSTS_RELOCATION_ENTRY	BIT(0)
+#define VK_FWSTS_RELOCATION_EXIT	BIT(1)
+#define VK_FWSTS_INIT_START		BIT(2)
+#define VK_FWSTS_ARCH_INIT_DONE		BIT(3)
+#define VK_FWSTS_PRE_KNL1_INIT_DONE	BIT(4)
+#define VK_FWSTS_PRE_KNL2_INIT_DONE	BIT(5)
+#define VK_FWSTS_POST_KNL_INIT_DONE	BIT(6)
+#define VK_FWSTS_INIT_DONE		BIT(7)
+#define VK_FWSTS_APP_INIT_START		BIT(8)
+#define VK_FWSTS_APP_INIT_DONE		BIT(9)
+#define VK_FWSTS_MASK			0xffffffff
+#define VK_FWSTS_READY			(VK_FWSTS_INIT_START | \
+					 VK_FWSTS_ARCH_INIT_DONE | \
+					 VK_FWSTS_PRE_KNL1_INIT_DONE | \
+					 VK_FWSTS_PRE_KNL2_INIT_DONE | \
+					 VK_FWSTS_POST_KNL_INIT_DONE | \
+					 VK_FWSTS_INIT_DONE | \
+					 VK_FWSTS_APP_INIT_START | \
+					 VK_FWSTS_APP_INIT_DONE)
+/* Deinit */
+#define VK_FWSTS_APP_DEINIT_START	BIT(23)
+#define VK_FWSTS_APP_DEINIT_DONE	BIT(24)
+#define VK_FWSTS_DRV_DEINIT_START	BIT(25)
+#define VK_FWSTS_DRV_DEINIT_DONE	BIT(26)
+#define VK_FWSTS_RESET_DONE		BIT(27)
+#define VK_FWSTS_DEINIT_TRIGGERED	(VK_FWSTS_APP_DEINIT_START | \
+					 VK_FWSTS_APP_DEINIT_DONE  | \
+					 VK_FWSTS_DRV_DEINIT_START | \
+					 VK_FWSTS_DRV_DEINIT_DONE)
+/* Last nibble for reboot reason */
+#define VK_FWSTS_RESET_REASON_SHIFT	28
+#define VK_FWSTS_RESET_REASON_MASK	(0xf << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_SYS_PWRUP	(0x0 << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_MBOX_DB		(0x1 << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_M7_WDOG		(0x2 << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_TEMP		(0x3 << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_PCI_FLR		(0x4 << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_PCI_HOT		(0x5 << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_PCI_WARM		(0x6 << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_PCI_COLD		(0x7 << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_L1		(0x8 << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_L0		(0x9 << VK_FWSTS_RESET_REASON_SHIFT)
+#define VK_FWSTS_RESET_UNKNOWN		(0xf << VK_FWSTS_RESET_REASON_SHIFT)
+
+#endif /* __UAPI_LINUX_MISC_BCM_VK_H */
Signature · 1 line
2.17.1
author maintainer
#2 lore raw

PATCH 2/3 misc: bcm-vk: add Broadcom VK driver

In reply to Scott Branden

Add Broadcom VK driver offload engine.
This driver interfaces to the VK PCIe offload engine to perform should offload functions as video transcoding on multiple streams in parallel. VK device is booted from files loaded using request_firmware_into_buf mechanism. After booted card status is updated and messages can then be sent to the card.
Such messages contain scatter gather list of addresses
to pull data from the host to perform operations on.

---
 drivers/misc/Kconfig             |    1 +
 drivers/misc/Makefile            |    1 +
 drivers/misc/bcm-vk/Kconfig      |   29 +
 drivers/misc/bcm-vk/Makefile     |   11 +
 drivers/misc/bcm-vk/bcm_vk.h     |  424 +++++++++
 drivers/misc/bcm-vk/bcm_vk_dev.c | 1369 +++++++++++++++++++++++++++
 drivers/misc/bcm-vk/bcm_vk_msg.c | 1507 ++++++++++++++++++++++++++++++
 drivers/misc/bcm-vk/bcm_vk_msg.h |  211 +++++
 drivers/misc/bcm-vk/bcm_vk_sg.c  |  275 ++++++
 drivers/misc/bcm-vk/bcm_vk_sg.h  |   61 ++
 drivers/misc/bcm-vk/bcm_vk_tty.c |  365 ++++++++
 11 files changed, 4254 insertions(+)
 create mode 100644 drivers/misc/bcm-vk/Kconfig
 create mode 100644 drivers/misc/bcm-vk/Makefile
 create mode 100644 drivers/misc/bcm-vk/bcm_vk.h
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_dev.c
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_msg.c
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_msg.h
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_sg.c
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_sg.h
 create mode 100644 drivers/misc/bcm-vk/bcm_vk_tty.c
drivers/misc/Kconfig +1 -0
index e1b1ba5e2b92..55d733d3a640 100644
@@ -469,6 +469,7 @@ source "drivers/misc/genwqe/Kconfig"
 source "drivers/misc/echo/Kconfig"
 source "drivers/misc/cxl/Kconfig"
 source "drivers/misc/ocxl/Kconfig"
+source "drivers/misc/bcm-vk/Kconfig"
 source "drivers/misc/cardreader/Kconfig"
 source "drivers/misc/habanalabs/Kconfig"
 source "drivers/misc/uacce/Kconfig"
drivers/misc/Makefile +1 -0
index c7bd01ac6291..766837e4b961 100644
@@ -52,6 +52,7 @@ obj-$(CONFIG_ECHO)		+= echo/
 obj-$(CONFIG_CXL_BASE)		+= cxl/
 obj-$(CONFIG_PCI_ENDPOINT_TEST)	+= pci_endpoint_test.o
 obj-$(CONFIG_OCXL)		+= ocxl/
+obj-$(CONFIG_BCM_VK)		+= bcm-vk/
 obj-y				+= cardreader/
 obj-$(CONFIG_PVPANIC)   	+= pvpanic.o
 obj-$(CONFIG_HABANA_AI)		+= habanalabs/
drivers/misc/bcm-vk/Kconfig new file +29 -0
new file mode 100644
index 000000000000..a3a020b19e3b
@@ -0,0 +1,29 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Broadcom VK device
+#
+config BCM_VK
+	tristate "Support for Broadcom VK Accelerators"
+	depends on PCI_MSI
+	help
+	  Select this option to enable support for Broadcom
+	  VK Accelerators.  VK is used for performing
+	  specific offload processing.
+	  This driver enables userspace programs to access these
+	  accelerators via /dev/bcm-vk.N devices.
+
+	  If unsure, say N.
+
+if BCM_VK
+
+config BCM_VK_QSTATS
+	bool "VK Queue Statistics"
+	help
+	  Turn on to enable Queue Statistics.
+	  These are useful for debugging purposes.
+	  Some performance loss by enabling this debug config.
+	  For properly operating PCIe hardware no need to enable this.
+
+	  If unsure, say N.
+
+endif
drivers/misc/bcm-vk/Makefile new file +11 -0
new file mode 100644
index 000000000000..05cb213ee826
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Makefile for Broadcom VK driver
+#
+
+obj-$(CONFIG_BCM_VK) += bcm_vk.o
+bcm_vk-objs := \
+	bcm_vk_dev.o \
+	bcm_vk_msg.o \
+	bcm_vk_sg.o \
+	bcm_vk_tty.o
drivers/misc/bcm-vk/bcm_vk.h new file +424 -0

424 lines not on this page · raw message

drivers/misc/bcm-vk/bcm_vk_dev.c new file +1369 -0

1,369 lines not on this page · raw message

drivers/misc/bcm-vk/bcm_vk_msg.c new file +1507 -0

1,153 lines not on this page · raw message

drivers/misc/bcm-vk/bcm_vk_msg.h new file +211 -0

211 lines not on this page · raw message

drivers/misc/bcm-vk/bcm_vk_sg.c new file +275 -0

275 lines not on this page · raw message

drivers/misc/bcm-vk/bcm_vk_sg.h new file +61 -0

61 lines not on this page · raw message

drivers/misc/bcm-vk/bcm_vk_tty.c new file +365 -0

365 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.17.1

Part of the diff is not shown here. View the raw message.

#3 lore raw

Re: [PATCH 2/3] misc: bcm-vk: add Broadcom VK driver

I love your patch! Yet something to improve:

Hi Scott,

I love your patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on soc/for-next kees/for-next/pstore linus/master v5.8-rc7 next-20200731] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Scott-Branden/Add-Broadcom-VK-driver/20200730-054729
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 22362aa30bad6f03b5bcbbeee3cdc61950d40086
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

drivers/misc/bcm-vk/bcm_vk_dev.c:138:5: warning: no previous prototype for 'bcm_vk_intf_ver_chk' [-Wmissing-prototypes]
138 | int bcm_vk_intf_ver_chk(struct bcm_vk *vk)
| ^~~~~~~~~~~~~~~~~~~
drivers/misc/bcm-vk/bcm_vk_dev.c: In function 'bcm_vk_load_image_by_type':

>> drivers/misc/bcm-vk/bcm_vk_dev.c:539:8: error: implicit declaration of function 'request_partial_firmware_into_buf'; did you mean 'request_firmware_into_buf'? [-Werror=implicit-function-declaration]
     539 |  ret = request_partial_firmware_into_buf(&fw, filename, dev,
         |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |        request_firmware_into_buf

cc1: some warnings being treated as errors

vim +539 drivers/misc/bcm-vk/bcm_vk_dev.c

462
463 static int bcm_vk_load_image_by_type(struct bcm_vk *vk, uint32_t load_type,
464 const char *filename)
465 {
466 struct device *dev = &vk->pdev->dev;
467 const struct firmware *fw = NULL;
468 void *bufp = NULL;
469 size_t max_buf, offset;
470 int ret;
471 uint64_t offset_codepush;
472 uint32_t codepush;
473 uint32_t value;
474 dma_addr_t boot_dma_addr;
475 bool is_stdalone;
476
477 if (load_type == VK_IMAGE_TYPE_BOOT1) {
478 /*
479 * After POR, enable VK soft BOOTSRC so bootrom do not clear
480 * the pushed image (the TCM memories).
481 */
482 value = vkread32(vk, BAR_0, BAR_BOOTSRC_SELECT);
483 value |= BOOTSRC_SOFT_ENABLE;
484 vkwrite32(vk, value, BAR_0, BAR_BOOTSRC_SELECT);
485
486 codepush = CODEPUSH_BOOTSTART + CODEPUSH_BOOT1_ENTRY;
487 offset_codepush = BAR_CODEPUSH_SBL;
488
489 /* Write a 1 to request SRAM open bit */
490 vkwrite32(vk, CODEPUSH_BOOTSTART, BAR_0, offset_codepush);
491
492 /* Wait for VK to respond */
493 ret = bcm_vk_wait(vk, BAR_0, BAR_BOOT_STATUS, SRAM_OPEN,
494 SRAM_OPEN, LOAD_IMAGE_TIMEOUT_MS);
495 if (ret < 0) {
496 dev_err(dev, "boot1 timeout\n");
497 goto err_buf_out;
498 }
499
500 max_buf = SZ_256K;
501 bufp = dma_alloc_coherent(dev,
502 max_buf,
503 &boot_dma_addr, GFP_KERNEL);
504 if (!bufp) {
505 dev_err(dev, "Error allocating 0x%zx\n", max_buf);
506 ret = -ENOMEM;
507 goto err_buf_out;
508 }
509 } else if (load_type == VK_IMAGE_TYPE_BOOT2) {
510 codepush = CODEPUSH_BOOT2_ENTRY;
511 offset_codepush = BAR_CODEPUSH_SBI;
512
513 /* Wait for VK to respond */
514 ret = bcm_vk_wait(vk, BAR_0, BAR_BOOT_STATUS, DDR_OPEN,
515 DDR_OPEN, LOAD_IMAGE_TIMEOUT_MS);
516 if (ret < 0) {
517 dev_err(dev, "boot2 timeout\n");
518 goto err_buf_out;
519 }
520
521 max_buf = SZ_4M;
522 bufp = dma_alloc_coherent(dev,
523 max_buf,
524 &boot_dma_addr, GFP_KERNEL);
525 if (!bufp) {
526 dev_err(dev, "Error allocating 0x%zx\n", max_buf);
527 ret = -ENOMEM;
528 goto err_buf_out;
529 }
530
531 bcm_vk_buf_notify(vk, bufp, boot_dma_addr, max_buf);
532 } else {
533 dev_err(dev, "Error invalid image type 0x%x\n", load_type);
534 ret = -EINVAL;
535 goto err_buf_out;
536 }
537
538 offset = 0;

 > 539		ret = request_partial_firmware_into_buf(&fw, filename, dev,
   540							bufp, max_buf, offset);
   541		if (ret) {
   542			dev_err(dev, "Error %d requesting firmware file: %s\n",
   543				ret, filename);
   544			goto err_firmware_out;
   545		}
   546		dev_dbg(dev, "size=0x%zx\n", fw->size);
   547		if (load_type == VK_IMAGE_TYPE_BOOT1)
   548			memcpy_toio(vk->bar[BAR_1] + BAR1_CODEPUSH_BASE_BOOT1,
   549				    bufp,
   550				    fw->size);
   551	
   552		dev_dbg(dev, "Signaling 0x%x to 0x%llx\n", codepush, offset_codepush);
   553		vkwrite32(vk, codepush, BAR_0, offset_codepush);
   554	
   555		if (load_type == VK_IMAGE_TYPE_BOOT1) {
   556			/* wait until done */
   557			ret = bcm_vk_wait(vk, BAR_0, BAR_BOOT_STATUS,
   558					  BOOT1_RUNNING,
   559					  BOOT1_RUNNING,
   560					  BOOT1_STARTUP_TIMEOUT_MS);
   561	
   562			is_stdalone = vkread32(vk, BAR_0, BAR_BOOT_STATUS) &
   563				      BOOT_STDALONE_RUNNING;
   564			if (ret && !is_stdalone) {
   565				dev_err(dev,
   566					"Timeout %ld ms waiting for boot1 to come up\n",
   567					BOOT1_STARTUP_TIMEOUT_MS);
   568				goto err_firmware_out;
   569			} else if (is_stdalone) {
   570				uint32_t reg;
   571	
   572				reg = vkread32(vk, BAR_0, BAR_BOOT1_STDALONE_PROGRESS);
   573				if ((reg & BOOT1_STDALONE_PROGRESS_MASK) ==
   574					     BOOT1_STDALONE_SUCCESS) {
   575					dev_info(dev, "Boot1 standalone success\n");
   576					ret = 0;
   577				} else {
   578					dev_err(dev, "Timeout %ld ms - Boot1 standalone failure\n",
   579						BOOT1_STARTUP_TIMEOUT_MS);
   580					ret = -EINVAL;
   581					goto err_firmware_out;
   582				}
   583			}
   584		} else if (load_type == VK_IMAGE_TYPE_BOOT2) {
   585			unsigned long timeout;
   586	
   587			timeout = jiffies + msecs_to_jiffies(LOAD_IMAGE_TIMEOUT_MS);
   588	
   589			/* To send more data to VK than max_buf allowed at a time */
   590			do {
   591				/*
   592				 * Check for ack from card. when Ack is received,
   593				 * it means all the data is received by card.
   594				 * Exit the loop after ack is received.
   595				 */
   596				ret = bcm_vk_wait(vk, BAR_0, BAR_BOOT_STATUS,
   597						  FW_LOADER_ACK_RCVD_ALL_DATA,
   598						  FW_LOADER_ACK_RCVD_ALL_DATA,
   599						  TXFR_COMPLETE_TIMEOUT_MS);
   600				if (ret == 0) {
   601					dev_info(dev, "Exit boot2 download\n");
   602					break;
   603				}
   604	
   605				/* exit the loop, if there is no response from card */
   606				if (time_after(jiffies, timeout)) {
   607					dev_err(dev, "Error. No reply from card\n");
   608					ret = -ETIMEDOUT;
   609					goto err_firmware_out;
   610				}
   611	
   612				/* Wait for VK to open BAR space to copy new data */
   613				ret = bcm_vk_wait(vk, BAR_0, offset_codepush,
   614						  codepush, 0,
   615						  TXFR_COMPLETE_TIMEOUT_MS);
   616				if (ret == 0) {
   617					offset += max_buf;
   618					ret = request_partial_firmware_into_buf
   619							(&fw,
   620							 filename,
   621							 dev, bufp,
   622							 max_buf,
   623							 offset);
   624					if (ret) {
   625						dev_err(dev,
   626							"Error %d requesting firmware file: %s offset: 0x%zx\n",
   627							ret, filename, offset);
   628						goto err_firmware_out;
   629					}
   630					dev_dbg(dev, "size=0x%zx\n", fw->size);
   631					dev_dbg(dev, "Signaling 0x%x to 0x%llx\n",
   632						codepush, offset_codepush);
   633					vkwrite32(vk, codepush, BAR_0, offset_codepush);
   634					/* reload timeout after every codepush */
   635					timeout = jiffies +
   636					    msecs_to_jiffies(LOAD_IMAGE_TIMEOUT_MS);
   637				}
   638			} while (1);
   639	
   640			/* wait for fw status bits to indicate app ready */
   641			ret = bcm_vk_wait(vk, BAR_0, VK_BAR_FWSTS,
   642					  VK_FWSTS_READY,
   643					  VK_FWSTS_READY,
   644					  BOOT2_STARTUP_TIMEOUT_MS);

645 if (ret < 0) {
646 dev_err(dev, "Boot2 not ready - timeout\n");
647 goto err_firmware_out;
648 }
649
650 is_stdalone = vkread32(vk, BAR_0, BAR_BOOT_STATUS) &
651 BOOT_STDALONE_RUNNING;
652 if (!is_stdalone) {
653 ret = bcm_vk_intf_ver_chk(vk);
654 if (ret) {
655 dev_err(dev, "failure in intf version check\n");
656 goto err_firmware_out;
657 }
658
659 /*
660 * Next, initialize Message Q if we are loading boot2.
661 * Do a force sync
662 */
663 ret = bcm_vk_sync_msgq(vk, true);
664 if (ret) {
665 dev_err(dev, "Boot2 Error reading comm msg Q info\n");
666 ret = -EIO;
667 goto err_firmware_out;
668 }
669
670 /* sync & channel other info */
671 ret = bcm_vk_sync_card_info(vk);
672 if (ret) {
673 dev_err(dev, "Syncing Card Info failure\n");
674 goto err_firmware_out;
675 }
676 }
677 }
678
679 err_firmware_out:
680 release_firmware(fw);
681
682 err_buf_out:
683 if (bufp)
684 dma_free_coherent(dev, max_buf, bufp, boot_dma_addr);
685
686 return ret;
687 }
688

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

author maintainer
#4 lore raw

PATCH 3/3 MAINTAINERS: bcm-vk: add maintainer for Broadcom VK Driver

In reply to Scott Branden

Add maintainer entry for new Broadcom VK Driver

---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
index f0569cf304ca..10e4e286baeb 100644
@@ -3658,6 +3658,13 @@ L:	[email protected]
 S:	Supported
 F:	drivers/net/ethernet/broadcom/tg3.*
 
+BROADCOM VK DRIVER
+M:	Scott Branden <[email protected]>
+L:	[email protected]
+S:	Supported
+F:	drivers/misc/bcm-vk/
+F:	include/uapi/linux/misc/bcm_vk.h
+
 BROCADE BFA FC SCSI DRIVER
 M:	Anil Gurumurthy <[email protected]>
 M:	Sudarsana Kalluru <[email protected]>
Signature · 1 line
2.17.1