From patchwork Tue Sep 4 16:28:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 10587635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08E7B13AC for ; Tue, 4 Sep 2018 16:29:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D88DD29BB6 for ; Tue, 4 Sep 2018 16:29:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC3E029BE3; Tue, 4 Sep 2018 16:29:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4CE8429BB6 for ; Tue, 4 Sep 2018 16:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=3jfE2ZhsRnOM1PT4x/zxDD83NmFlQhxQ37u8Bv1oTdA=; b=tu6 W4hK0nAIqXOLKrsuRVAGz8840CjlFhtH5PRUXQo+A6+b7UkB/tI+j2yUqnjhl6zwaiD9Ofe0uaX9q cuapmC8abvxyyIJ7pn2z7IH4846r1JO4yxe8cQ9loEU6L/8KDJDfaFEv5uuNTtcKOtXfF8AVYPPno PVorw6eG0uORp37n3/dvxvJS40iGEUTlH0GF3+qxAOMKaTmHw7UKz7wPOMcO3ZxpgZOGip7zj3wA1 E4gprBqshdYu+ni1h9+8CG7jTUXCZ3lafjl42hmgo82IV+x6ME1mGZDSoAABejp07jgIgplQa8Z/r IXprzaFf6xw/9tV5ghTo1dwHwpqEfuQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxECT-0004VL-VJ; Tue, 04 Sep 2018 16:29:09 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxECP-0004Sq-Rt for linux-arm-kernel@lists.infradead.org; Tue, 04 Sep 2018 16:29:07 +0000 Received: by mail-pl1-x642.google.com with SMTP id g2-v6so918127plo.2 for ; Tue, 04 Sep 2018 09:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=M4QpRLBVTJikY6BxzWTJ+PgCfWG/byCkTEpCLn4NuPE=; b=hu0IZNVyfqxH2wd+TnUV+lppEVU68U/wpM1pmPtJtIb46WWSD9YNlcO8v9OFLHI6rB 8qPKlrcVNwsLca05l4q6eq3iR9QfdTZI3HaO8EY+VVwtpzaZ+j9MXum+RRn9J3rgx/6n YN/bzQwHr8Lk6kdsvMobA8OhszFEKtfDdvotNfSoLRVjor1fwNG770FkuQUikmC11DhV nNrvpsWYoMzlaedON661rNP+26shPc85o37yz9Z1iG7xgXaiyySZn9dyZ0yOc232wK/R 2ngbALE0uG0Z9HTNRI+rykvgOdNc4FhyvvVFHEqNRFlFV2o/S8oao1Cucpw0PVOmMtn2 5BEg== 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; bh=M4QpRLBVTJikY6BxzWTJ+PgCfWG/byCkTEpCLn4NuPE=; b=BtG6fqeIhxCmMkQP2ZEGquq9EO9D/LYupZkqFxZZqzFR3OwxXfyVHzaxsrMG+KdUhf KYVaed0/TlUwBEB5tV3I/INZHDBQDoByln/gGOjRzd0YTI6nTJjal55jH9QerCwx/ESZ 3x2Rt0PYXS+XFrGlEArb1wFOS8LoqMVj/QXOM7zO1bv3lZ/KzAMr8M/av2zKLi32laYb ONSXaIevjh6iD4rY4YyX0BDH5gLbiULc+cFERX99vjd4HEDlSzW8RuT88CseYdxnsRZy wcVEAnhvuTOerTwHjsP8PemwaFUv6K4VBynsuQC4m4FYOIm0pfDvgK2FTR36q4cR3ehc qVvQ== X-Gm-Message-State: APzg51CCqANv0Hx+kqAT97brHeknhv+Mp+yMpnhTumloTAuO+z5SLe2l t2XvwBcZNDCyaQG6fq9P8LFsUbiv X-Google-Smtp-Source: ANB0VdZHiXl9yAvm1VR3X89ccNGPbrVZizSNzvd6mZpWw6ed/CExL80c8rnX9hikH2WRmzl9Dowq9Q== X-Received: by 2002:a17:902:8bc4:: with SMTP id r4-v6mr33296921plo.124.1536078533825; Tue, 04 Sep 2018 09:28:53 -0700 (PDT) Received: from machine421.caveonetworks.com ([115.113.156.2]) by smtp.googlemail.com with ESMTPSA id j191-v6sm32243827pfc.136.2018.09.04.09.28.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 09:28:52 -0700 (PDT) From: sunil.kovvuri@gmail.com To: linux-kernel@vger.kernel.org, arnd@arndb.de, olof@lixom.net Subject: [PATCH v3 00/15] soc: octeontx2: Add RVU admin function driver Date: Tue, 4 Sep 2018 21:58:30 +0530 Message-Id: <1536078525-31534-1-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180904_092905_902776_DC4647DC X-CRM114-Status: GOOD ( 12.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andrew@lunn.ch, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-soc@vger.kernel.org, davem@davemloft.net, Sunil Goutham MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sunil Goutham Resource virtualization unit (RVU) on Marvell's OcteonTX2 SOC supports multiple PCIe SRIOV physical functions (PFs) and virtual functions (VFs). PF0 is called administrative / admin function (AF) and has privilege access to registers to provision different RVU functional blocks to each of PF/VF. This admin function (AF) driver acts as a configuration / administrative software which provisions functional blocks to a PF/VF on demand for them to work as one of the following - A basic network controller (i.e NIC). - NIC with packet filtering, shaping and scheduling capabilities. - A crypto device. - A combination of above etc. PF/VFs communicate with admin function via a shared memory region. This patch series adds logic for the following - RVU AF driver with functional blocks provisioning support - Mailbox infrastructure for communication between AF and PFs. - CGX driver which provides information about physcial network interfaces which AF processes and forwards required info to PF/VF drivers. This is the first set of patches out of 70 odd patches. Note: This driver neither receives any data nor processes it i.e no I/O, just does the hardware configuration. Changes from v2: No changes, submitted again with netdev mailing list in loop. - Suggested by Arnd Bergmann and Andrew Lunn Changes from v1: 1 Merged RVU admin function and CGX drivers into a single module - Suggested by Arnd Bergmann 2 Pulled mbox communication APIs into a separate module to remove admin function driver dependency in a VM where AF is not attached. - Suggested by Arnd Bergmann Aleksey Makarov (2): soc: octeontx2: Add mailbox support infra soc: octeontx2: Convert mbox msg id check to a macro Geetha sowjanya (1): soc: octeontx2: Reconfig MSIX base with IOVA Linu Cherian (3): soc: octeontx2: Set RVU PFs to CGX LMACs mapping soc: octeontx2: Add support for CGX link management soc: octeontx2: Register for CGX lmac events Sunil Goutham (9): soc: octeontx2: Add Marvell OcteonTX2 RVU AF driver soc: octeontx2: Reset all RVU blocks soc: octeontx2: Gather RVU blocks HW info soc: octeontx2: Add mailbox IRQ and msg handlers soc: octeontx2: Scan blocks for LFs provisioned to PF/VF soc: octeontx2: Add RVU block LF provisioning support soc: octeontx2: Configure block LF's MSIX vector offset soc: octeontx2: Add Marvell OcteonTX2 CGX driver MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver MAINTAINERS | 10 + drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/marvell/Kconfig | 18 + drivers/soc/marvell/Makefile | 2 + drivers/soc/marvell/octeontx2/Makefile | 10 + drivers/soc/marvell/octeontx2/cgx.c | 517 +++++++++ drivers/soc/marvell/octeontx2/cgx.h | 65 ++ drivers/soc/marvell/octeontx2/cgx_fw_if.h | 225 ++++ drivers/soc/marvell/octeontx2/mbox.c | 303 +++++ drivers/soc/marvell/octeontx2/mbox.h | 211 ++++ drivers/soc/marvell/octeontx2/rvu.c | 1637 ++++++++++++++++++++++++++++ drivers/soc/marvell/octeontx2/rvu.h | 158 +++ drivers/soc/marvell/octeontx2/rvu_cgx.c | 194 ++++ drivers/soc/marvell/octeontx2/rvu_reg.h | 442 ++++++++ drivers/soc/marvell/octeontx2/rvu_struct.h | 78 ++ 16 files changed, 3872 insertions(+) create mode 100644 drivers/soc/marvell/Kconfig create mode 100644 drivers/soc/marvell/Makefile create mode 100644 drivers/soc/marvell/octeontx2/Makefile create mode 100644 drivers/soc/marvell/octeontx2/cgx.c create mode 100644 drivers/soc/marvell/octeontx2/cgx.h create mode 100644 drivers/soc/marvell/octeontx2/cgx_fw_if.h create mode 100644 drivers/soc/marvell/octeontx2/mbox.c create mode 100644 drivers/soc/marvell/octeontx2/mbox.h create mode 100644 drivers/soc/marvell/octeontx2/rvu.c create mode 100644 drivers/soc/marvell/octeontx2/rvu.h create mode 100644 drivers/soc/marvell/octeontx2/rvu_cgx.c create mode 100644 drivers/soc/marvell/octeontx2/rvu_reg.h create mode 100644 drivers/soc/marvell/octeontx2/rvu_struct.h