Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1194893ybj; Thu, 7 May 2020 17:30:03 -0700 (PDT) X-Google-Smtp-Source: APiQypIHXGSvDXwFAYYrdPAQOXR5b1ASC/+Wp+aBC3th/160cwYKdaIFFc3laN6LPiCGzWEb4Wtf X-Received: by 2002:a17:906:340a:: with SMTP id c10mr14914780ejb.218.1588897803645; Thu, 07 May 2020 17:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588897803; cv=none; d=google.com; s=arc-20160816; b=AgD/OPwNWT9CifKlWNDHNL2giDHy82gbmFgid7Ku68lWtEBKJpHf9spVostz+OHb9Z qqCgCrx81rvjBE3frWtos0fxVjhEkAiQm2Kn6lVBdEvXf/OhcNzQ12r0koyfynHph30F lzVaIF0F21/bs5hiazkuEMoiG6aEA0+t+FRAp7IFAxsFREkCcCbQRWRfSO+AU/dI++L3 5NMkxPrwAWwxchDQzcriVr2rC/spAGwWlk9ucKyFaGy9HRZwkQwNuG48ZkNpfEsLjVc9 TJ4HOU6eG3LPph9XKSxnVfi/VuGohkNZJth4c6Qf5CETXYZ1nMeci45JH6VwknmQl7hD D5Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=qz7MuNPVCvdbh+ZgEThp7mjF9Pplt5mjBACsV2Ifvtc=; b=InHP8YsHSjKS3ptXrUJRPs3vN+sWDuWhK3PeDXIr5NC+2CWO48KUYN+XbuLTmv5D0W gTIkqvIPZ4Q3RD4HxInAwAzK0BsgN6IkenehRngt3kfdXTLDqQCpkNJJnoK1T/xBRmkE NxCFYTsNW9Shvjv9KbQw3XJ+tpsEw9OBlp5aI7TTjzWkgoApRFMVuB50ONB/SlGqPxvf 5kqJ2laeWYWGyYOaYH2mHXThU1v30SfSs6W2jopTkvlWgmY+QQgz4wpwHc23CcGQ3WzA vb/GmCItPCtAKf/pVpRiqsB1uqWaf7ZuIaFqZDEZ3vSk0OXYZVyNVq1kr4xT+dEmaU7m 096w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=VbqGzOA6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fi25si31876ejb.25.2020.05.07.17.29.40; Thu, 07 May 2020 17:30:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=VbqGzOA6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727108AbgEHA2K (ORCPT + 99 others); Thu, 7 May 2020 20:28:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726638AbgEHA2H (ORCPT ); Thu, 7 May 2020 20:28:07 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C00F3C05BD0A for ; Thu, 7 May 2020 17:28:07 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id t9so3448489pjw.0 for ; Thu, 07 May 2020 17:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qz7MuNPVCvdbh+ZgEThp7mjF9Pplt5mjBACsV2Ifvtc=; b=VbqGzOA6MXmLVPAUp5CGKAnJuiPIfp8fSeIlGkmDQeel96tDNT4jJTQ9eCOiTtHuHy myN8Q+j+eyXKiD0PbU6x1jatv1vVA2ExUbuR6to/gjEwXqvdX2YtZTtFrzr2QRgjJZTD /wsj+PhEmtO+FD8A4y2rlaAyLfgNwrvfEvM94= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qz7MuNPVCvdbh+ZgEThp7mjF9Pplt5mjBACsV2Ifvtc=; b=l6+hw89fRJ0hdXPOPg/YydDvG7Tb91mzlxch7ZUIhPSCbh8rR3UEm7/OZGkvGNq+VN UNEuo2VZJX5W0AHZojCMwo785f4uYoZTDh3SVIujBSAXx8qRGyuirazlgydZzJVB73UH fLpHvau799rRQmZGMYxLJi4QkxuR3D6ACnrA/hvOtGuXp2G0xTqBOQJs9jqWl6k2GrcE B/lP1c8YZsH0LNMAAcq7+QoSj+7Vx9D7TvF3HC9M4GkpU1ffGPIIb5ZJDju1Lp4mHVl1 V6GvtpuULbXdlLFoJlQhM8j5IGzvqhOK85FKhIktRm63SxsxFgbfT3ZiKvsrtnY7J/ZS OB/g== X-Gm-Message-State: AGi0PuZKs8AnVRGvSLK4zv6AXrChInXz8CWJ3pln3gnXgZCfqOdpy3sz iFJR6dIOf4/nAW0UF4ou2YMYmw== X-Received: by 2002:a17:90a:f197:: with SMTP id bv23mr2918485pjb.3.1588897687199; Thu, 07 May 2020 17:28:07 -0700 (PDT) Received: from lbrmn-lnxub113.broadcom.net ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id gz14sm882677pjb.42.2020.05.07.17.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 17:28:06 -0700 (PDT) From: Scott Branden To: Luis Chamberlain , Greg Kroah-Hartman , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann Cc: "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , Takashi Iwai , linux-kselftest@vger.kernel.org, Andy Gross , Scott Branden Subject: [PATCH v5 5/7] bcm-vk: add bcm_vk UAPI Date: Thu, 7 May 2020 17:27:37 -0700 Message-Id: <20200508002739.19360-6-scott.branden@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508002739.19360-1-scott.branden@broadcom.com> References: <20200508002739.19360-1-scott.branden@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add user space api for bcm-vk driver. Signed-off-by: Scott Branden --- 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..783087b7c31f --- /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 +#include + +#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 */ -- 2.17.1