From patchwork Thu Aug 8 18:35:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mary Strodl X-Patchwork-Id: 13758056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1FC7C3DA4A for ; Thu, 8 Aug 2024 18:36:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 501456B009F; Thu, 8 Aug 2024 14:36:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B0856B00A0; Thu, 8 Aug 2024 14:36:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A1D46B00A1; Thu, 8 Aug 2024 14:36:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1A3046B009F for ; Thu, 8 Aug 2024 14:36:04 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id DAA37A76B9 for ; Thu, 8 Aug 2024 18:36:03 +0000 (UTC) X-FDA: 82429932606.20.D5FD662 Received: from greygoose-centos7.csh.rit.edu (greygoose-centos7.csh.rit.edu [129.21.49.170]) by imf12.hostedemail.com (Postfix) with ESMTP id 3083440018 for ; Thu, 8 Aug 2024 18:36:02 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=csh.rit.edu header.s=mail header.b=O1TwBqcV; dmarc=pass (policy=none) header.from=csh.rit.edu; spf=pass (imf12.hostedemail.com: domain of mstrodl@csh.rit.edu designates 129.21.49.170 as permitted sender) smtp.mailfrom=mstrodl@csh.rit.edu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723142114; a=rsa-sha256; cv=none; b=fBTPmyuOo7pa8zaJsezycqGcsVXG3Q0oAAFnjd8tST8B4v/5xOki0PqCxejdIxcBZoKGzu fxAMgMdFT6uJpA6jEeVS0o5jNCj49KzAx5whdKIGAqolWnrM1BcK5gNl80Bm1T/wpwjJv2 OwbOdxvHS1M19EB3eiZM367Q4ijJJeM= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=csh.rit.edu header.s=mail header.b=O1TwBqcV; dmarc=pass (policy=none) header.from=csh.rit.edu; spf=pass (imf12.hostedemail.com: domain of mstrodl@csh.rit.edu designates 129.21.49.170 as permitted sender) smtp.mailfrom=mstrodl@csh.rit.edu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723142114; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=tx3WA15oQ2X5yNCZJ1h13QrzfqyC6ZY3viC2Jo4RRZo=; b=pXaEEVyzoYE76PODcFxi/pXHFPWKcDC/cZTAw1YQUm03W6dLo/75IJk5zh1+l29UnFljUe hHYik4jEsxY8iY4nasHl6jIqB0cL3sEYbNWz2noo29SDRCXKouWSN89uHYj914+7eYP2As Ih0VPkQA2Gu4b4qBdBU61MeBP2i+svY= Received: from localhost (localhost [127.0.0.1]) by greygoose-centos7.csh.rit.edu (Postfix) with ESMTP id 2DD2F456D905; Thu, 8 Aug 2024 14:36:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=csh.rit.edu; h= content-transfer-encoding:mime-version:x-mailer:message-id:date :date:subject:subject:from:from:received:received; s=mail; t= 1723142160; x=1724956561; bh=kCgWHc+83KGG6UfWWtFMPlYslsuSMeiP0G9 EIf0zPM4=; b=O1TwBqcVMW+3LfCcrxJTYKGrnXBAQ/6aJQpOWqlVApBJy7SQWGo TbQfutrWgCJ/w+mlTobkpofSpx4oG+D+m8+cNLUQKhdDPlQZB2es0XzPwDKP1C8Q TYL+tuayRgIrOr6sBk1JqFtAdJ6sfpHBVcvCq3qUgCKuhn2VS69naFMY= X-Virus-Scanned: amavisd-new at csh.rit.edu Received: from greygoose-centos7.csh.rit.edu ([127.0.0.1]) by localhost (mail.csh.rit.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LRR5fCN_yTkM; Thu, 8 Aug 2024 14:36:00 -0400 (EDT) Received: from freedom.csh.rit.edu (freedom.csh.rit.edu [129.21.49.182]) by greygoose-centos7.csh.rit.edu (Postfix) with ESMTP id 63894457383A; Thu, 8 Aug 2024 14:36:00 -0400 (EDT) From: Mary Strodl To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, urezki@gmail.com, hch@infradead.org, linux-mm@kvack.org, lee@kernel.org, andi.shyti@kernel.org, linux-i2c@vger.kernel.org, s.hauer@pengutronix.de, christian.gmeiner@gmail.com, Mary Strodl Subject: [PATCH v3 0/2] Add support for Congatec CGEB BIOS interface Date: Thu, 8 Aug 2024 14:35:24 -0400 Message-ID: <20240808183527.3950120-1-mstrodl@csh.rit.edu> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: 3083440018 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: dp1xkj1o77zzwhpzn78g5qg8xgmomh1e X-HE-Tag: 1723142162-706259 X-HE-Meta: U2FsdGVkX186cT1RiOXkc7RL1bWXFYiM3NPPO1Wm7ZhcZJBQ5VZmur2Hd4cMkZJrx9zmHAFrb+rSOIiWgR6cmm/6UagtnsV7c+xj/hwUylNrPKpXGwxeo5oDlM3t481rWeox8WvTEqSHI0YYloyeAq5IYi3PHA8S7UVSevVZdRth92QOrPzvvsFVAuzYNROzv4SFcTy3um8Y3qXXAqnXTsFZYHRNrc1PXYzQU0Gu40A+hUbVPgzIfKlvpFBPphjCysxofbi7GCmvXVQelWqFUoyVxS86fpUTB59872pi6MXcgzPjcd2m3Lch/3HR9qCR4d6qjUjyMOajXfi9NObjM0xQjIzPdw6Yd0Lg41InvMTDfDXq0QQND40t05IMBJmNGkaKopOaKpyndfdnls3rkvstA8YbJT1Ri3k23MoJu0p4SLiVuMHJXVl6VctpxEUbW+JaSrzWkxRyZ6+ZGxthPJh+EfU4+mDuzx8gG9ACBDNe2VuPc4AoTevo7VHDrv7A7EypRueP0K2pFqTfPaiIYHT74XzDSuanpAGQzp5cGIHzoiZ3RDMY/VAVSNn1KUt+qP79ndPuieUepZHmQfF5H7a9KCodXjrsQLD8lvnw0PPUZmWAxmTCm0oHqBv6E2+wB4VN3Ga5+OpmQNUCJe6vh2V3cGw2tu7eNrOnfA0UCaO9mxN38a39R4GqRi3jaRnCICFhEXzNLI5J9R8Z6h0Ctg7iccFAHkUTIQV695OTfTKIsMGvb79lOcgedQlD/30y3ev77sLvDQn/b6I3X9P4taAlNKXuXGawFaceeLDl5xktGQsICUm6pxr8byxl9X6qMt2OwL5Ea0l17yGOxg+sxrTe3Wo0CalM89mMi1wqKXsYYXm0zHImG5rUrxl4km1xhJfFk3Syn9YBzfHy4fSB6nmNL+H/E2G8LU0oI/mDdnFWbjzEDMwWiePmdaEO0d9t7jdwwF2EfPVUIFweHAU 8vrYWE4N /vaiW7c4PHkt7Y5muxxlsAPkTrfoDMVuP3vxsQyYRUuIUVWWpU947mtZULbDXpH9EVY+3KlcbSxjb1rjq2lzv8BuI33sX595zltWpVM2cB7/J0ZmOiW5urhVPCgtraCA3A/KCcsB4nn433wlVZ8uHki89YDQY9r2vpCkHF1i3Yi4TKX+jPcgEQnSAS4/8By9hObQ5j5UgLYI7Gmj1svVwPrgN0w42SrK08eqPCpjjzWuHeQlEwdXPW4IDUanI0tYxyF9Zj9yO5sgH71Q= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The following series adds support for the Congatec CGEB interface found on some Congatec x86 boards. The CGEB interface is a BIOS interface which provides access to onboard peripherals like I2C busses and watchdogs. It works by mapping BIOS code and searching for magic values which specify the entry points to the CGEB call. The CGEB call is an API provided by the BIOS which provides access to the functions in an ioctl like fashion. At the request of some folks the first time I sent this series out, CGEB has a userspace component which runs the x86 blob (rather than running it directly in the kernel), which sends requests back and forth using the cn_netlink API. You can find a reference implementation of the userspace helper here: https://github.com/Mstrodl/cgeb-helper I didn't get an answer when I asked where the userspace component should live, so I didn't put a ton of work into getting the helper up to snuff since similar userspace helpers (like v86d) are not in-tree. If folks would like the helper in-tree, that's fine too. Changelog: v2: * Moved CGEB code snippet execution into userspace v3: * `checkpatch` pass * Should I add the driver files to MAINTAINERS? I'm not sure what the norm is there... * `sparse` pass * I'm not sure there's a good way to keep the __iomem marker around while not making the struct fields really inconvenient to access, so I just cast them away which causes a sparse warning. I figure it's probably okay since this driver is x86-specific anyways? Let me know if this is an issue and what the preferred approach is. This series is based on the excellent work of Sascha Hauer and Christian Gmeiner. You can find their original work here: http://patchwork.ozlabs.org/patch/219756/ http://patchwork.ozlabs.org/patch/219755/ http://patchwork.ozlabs.org/patch/219757/ http://patchwork.ozlabs.org/patch/483262/ http://patchwork.ozlabs.org/patch/483264/ http://patchwork.ozlabs.org/patch/483261/ http://patchwork.ozlabs.org/patch/483263/ Mary Strodl (1): x86: Add basic support for the Congatec CGEB BIOS interface Sascha Hauer (1): i2c: Add Congatec CGEB I2C driver drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-congatec-cgeb.c | 190 ++++ drivers/mfd/Kconfig | 10 + drivers/mfd/Makefile | 1 + drivers/mfd/congatec-cgeb.c | 1138 ++++++++++++++++++++++++ include/linux/mfd/congatec-cgeb.h | 112 +++ include/uapi/linux/connector.h | 4 +- 8 files changed, 1465 insertions(+), 1 deletion(-) create mode 100644 drivers/i2c/busses/i2c-congatec-cgeb.c create mode 100644 drivers/mfd/congatec-cgeb.c create mode 100644 include/linux/mfd/congatec-cgeb.h