From mboxrd@z Thu Jan 1 00:00:00 1970 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 4B238C5320E for ; Tue, 20 Aug 2024 08:39:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EA4D6B0083; Tue, 20 Aug 2024 04:39:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 973426B0085; Tue, 20 Aug 2024 04:39:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 814FD6B0088; Tue, 20 Aug 2024 04:39:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 63E446B0083 for ; Tue, 20 Aug 2024 04:39:48 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1666D1419D5 for ; Tue, 20 Aug 2024 08:39:48 +0000 (UTC) X-FDA: 82471975656.17.A1AFFF8 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by imf19.hostedemail.com (Postfix) with ESMTP id DB9C11A0009 for ; Tue, 20 Aug 2024 08:39:45 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=bootlin.com header.s=gm1 header.b=c5HQjpd+; spf=pass (imf19.hostedemail.com: domain of thomas.richard@bootlin.com designates 217.70.183.193 as permitted sender) smtp.mailfrom=thomas.richard@bootlin.com; dmarc=pass (policy=reject) header.from=bootlin.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724143170; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gjbZOxwR9PVGgaPf4uUaZd0JrjKtSGINO0OZPhHVGyE=; b=pWcKQidKXy3NTl5xwghT6wtcNOjPgtr5T/snU0F7/P4nMJawRBKZkN2ccdzsx09DPM2WJw H9snVQ09fRLKasLdBHPb0svGI4ZK/d4kut19jlkSv/Ct+Su/BuAa8c6nfHoO/RcauklDCX w1wLwIn06PuMXnW0eJHSqcTKMcHmI8U= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=bootlin.com header.s=gm1 header.b=c5HQjpd+; spf=pass (imf19.hostedemail.com: domain of thomas.richard@bootlin.com designates 217.70.183.193 as permitted sender) smtp.mailfrom=thomas.richard@bootlin.com; dmarc=pass (policy=reject) header.from=bootlin.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724143170; a=rsa-sha256; cv=none; b=k9LULWAicAEQ+OfYx8mbCZ0KmFeyUImTCzAsIwgg655LBvCJN/AIs0kQx0y7zONl+3ST8S BYzvz3oEgNMGd42CU/3LQghBL8fx+FEEDLLfSMikutHJRENEAQFwBGz9aUVsUfQY3xoChI y+gFu/tTgpvpdebq/yZq5YVRAqKQrNY= Received: by mail.gandi.net (Postfix) with ESMTPSA id 30B65240002; Tue, 20 Aug 2024 08:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1724143183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gjbZOxwR9PVGgaPf4uUaZd0JrjKtSGINO0OZPhHVGyE=; b=c5HQjpd+Or9Pj+ejVrX1nGX4PvgGzQJftCNT2NtxvISrNrqvjgYe2dOBghNRWvDSJqIxZf wCVNrnJZ2LeXP5uE9pswbO2yYpZMffoMrmuFoJ5V24+8DitD4lVy5/WE3TqQ3LVQl5npu4 mjn02iEzlkBSMj4TZy/Vk5RbEwFewbSlZ0LAVW2iKrqDDgEGsw1U++4G+Xf/fdwOtHRMHu /1ck3f1fMrbVe1L33TqrUXttiGDqCnTX6JuC7eI2As+OtWdqpAtx7WEPMsfawOcybtjaeJ WrpzC2hU3IOztDocVmDxBmPys0xLN710+YRTbYIpPWLbDrgOZ5xk1N9vbslUXA== Message-ID: <8d8b1967-1d41-44d9-9791-d7809bed269c@bootlin.com> Date: Tue, 20 Aug 2024 10:39:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/2] Add support for Congatec CGEB BIOS interface To: Mary Strodl , 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, Thomas Petazzoni References: <20240814184731.1310988-1-mstrodl@csh.rit.edu> Content-Language: en-US From: Thomas Richard In-Reply-To: <20240814184731.1310988-1-mstrodl@csh.rit.edu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-GND-Sasl: thomas.richard@bootlin.com X-Rspam-User: X-Stat-Signature: hmrbsks3hq11s7ur43uf1sh6uk9idbmk X-Rspamd-Queue-Id: DB9C11A0009 X-Rspamd-Server: rspam11 X-HE-Tag: 1724143185-326726 X-HE-Meta: U2FsdGVkX18H++8mV2oJnlpJ2sQG5DGdAz/APGLakTVCrtTL7VLQHfXhawqSEh3/QKjgeZPiLJ9VB0UugdjwERjRAMUG5DDYbzM1jGzLfek/Um9jnRQspmHaooWeVcU/y36x7gSZu6tp1BuhavkojL5CQnurZDjMMRp0fpQoBE1PNOV7wAw21i6e1Ylnjj9xDWgLRW2dVTDYLphZ+giXWdJB0PR/2EW297LsMX40vOl/QEnpNM15+cWrey44pxZ/VTjDODQSNlVf8M01X9nF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jXj16NPxIqUZjneAhiK4g1NKVTa/ZTRpxzGGvCX+wCy19cFvQ== 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: On 8/14/24 20:47, Mary Strodl wrote: > 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. Hello Mary !! It was by pure luck that I found your series. It seems we are working on the same thing, the Congatec Board Controller. I sent a first version of my series few weeks ago [1]. My implementation is very different. There is an MFD which maps the needed IO regions and declares cells (gpio, watchdog, i2c). It also contains all the code to communicate with the Board Controller (using ioread and iowrite). The DMI table is used to detect if the board is supported, so the driver can be probed (or not). Other drivers (gpio, i2c and watchdog for now) use the API provided by the MFD to communicate with the Board Controller. With this approach, I don't need a userspace component. For this work I used the Congatec driver (that Thomas Gleixner pointed you) as reference. But as mentioned by Thomas the driver is not well written at all. By the way their latest version is available in their yocto metalayer (please find the link in my series). For now I did the job for the conga-SA7 board (which has a 5th generation Board Controller). So if you have hardware which has the same generation of the Board Controller, you can easily test the series. You only need to add the DMI entry of your board in the MFD driver. For other generations, I had a quick look. The sequences seem very similar, with minor differences. It could be easily implemented in the future, and only the MFD will be modified. Please feel free to test/comment my series [1]. [1] https://lore.kernel.org/all/20240503-congatec-board-controller-v1-0-fec5236270e7@bootlin.com/ Best Regards, Thomas -- Thomas Richard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com