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 75AD2C3DA4A for ; Tue, 20 Aug 2024 08:48:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C8A406B0083; Tue, 20 Aug 2024 04:48:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C399F6B0085; Tue, 20 Aug 2024 04:48:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B019A6B0088; Tue, 20 Aug 2024 04:48:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 926F96B0083 for ; Tue, 20 Aug 2024 04:48:22 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 10C6F161887 for ; Tue, 20 Aug 2024 08:48:22 +0000 (UTC) X-FDA: 82471997244.25.D5DFED3 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf06.hostedemail.com (Postfix) with ESMTP id 3894918000E for ; Tue, 20 Aug 2024 08:48:19 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=bnnsFmUm; spf=pass (imf06.hostedemail.com: domain of christian.gmeiner@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=christian.gmeiner@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724143622; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=t/uNXXnv03CIiAzfZ7u4tK+ugMMRPPralmCSVLDeJRM=; b=LZU5gWatkLcgO8POQ9UFXTMNuTYCde5ZeKRiizt4n18zgRy+V+35ns0/4UvczZWZDdAMy2 RmDovFs48vGBDCQgQ+jTbgniew6eyJnp3twtOKUNM6gonFAo3PKGJqI/oM6LcIvuJP/Fmr /C1Bqvf6DQlAaGi5bB5HqXBHoYAwzwk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724143622; a=rsa-sha256; cv=none; b=Ub7uI9XyOLrL1Qm04XafJ7MucYv/jB/a8qd42nnMNuxutuVmTnZlptjpIj4/p+Pbjtugnt /4cT0m++aMEYrw6A6gGotj2IMc9jqsWF8zD++Ya/P+/aEdqnxqafFOzZrFVQz2twtGhyUr Gczrr7b9rqPOfwZqctwERYs4KYfluBk= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=bnnsFmUm; spf=pass (imf06.hostedemail.com: domain of christian.gmeiner@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=christian.gmeiner@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2d3c08541cdso3829985a91.2 for ; Tue, 20 Aug 2024 01:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724143699; x=1724748499; darn=kvack.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=t/uNXXnv03CIiAzfZ7u4tK+ugMMRPPralmCSVLDeJRM=; b=bnnsFmUmWlw3oHUhJQhIDIBmIXFWMTBnk0f1ex1/3YgWXYwCWllg2MdWP9XGpKAuCc uTRhkaZ/pWPHuiuwUCiXxlYTCm5Xs5ChgtLxBgB1tTiO+MrZznt9LBcRkIdSBWxdTDa6 bpugoi9BcZQxdVAT8RTakLtTxyHf9G0HsiKVnYpWabEttWcIzf6CuXnp85a/G2BTeXcl O0BMs/ETQncC/Iu2Zo9IkSI3lRri/68NepF/KD0HOXJYNO3+WjFAluSuq0zEpNjRHgdS wstvySOFODAJ0Y+N99mdRXVwqTz9Xx7EgzT1la93nwcCzHS02scxn0EKpd+vGEegIyN8 gM2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724143699; x=1724748499; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=t/uNXXnv03CIiAzfZ7u4tK+ugMMRPPralmCSVLDeJRM=; b=qezLPvTzfQKoIXCilcCzXcUUixwK1Su4gfhZhd3VOjd19W3yrHOopF6eC11yOXe2pi 5GFIM8mrjLsoN4ry9NDGVfZpAuojE0l0IRg7N8AnMphD/qXhwljnMjPQXNoKVfzY22De 4nxQiiA0wx+zTW7MGtT9LHkWIbB/x44fKhukvCQ4iCGCJ2eRtnUAm5sGtoa7GepbHi0n AbaaYhzHTSrgq4ci7SR/zClGZL3xS0+E+n1UelI1QzRN9xdV2QN2NabfAxGpFd/cZy1U xydIdQVD844HYJWERmUDTZ9sYHRQuna/RrMqPTBJN+xZKx23jYZv4qLNt8CGhKMNhnjS DgRw== X-Forwarded-Encrypted: i=1; AJvYcCX123u2IN/2af4dxCXZVwCeZ7ltxuYL6OnLbjjVBWX6NdkeHlPiRz87yfn7t4iOIiL16HvYs7ROkBL7FXD4DuJ6NYg= X-Gm-Message-State: AOJu0YyL/UeLok8X4D5hCQB0Q0OKXM804S6TK+3D1Tj+reSjIyFqEno6 /13aP2G3ALg2kdAVdSAdADn7AIZ4Wv6c4uHBV9cXlD+bhT7reP4EDfGFtNitvLzwyk7pm1B/nlw OVncHc5aNb/vPw4dMf5Bqhj0oOK8= X-Google-Smtp-Source: AGHT+IGl20eaG1MSKchcVc8w+aDbhG9xyfJEjgu/4Qv0nlMLVTGvqcOObec3KUVkSVYqX1Txnb+mTysBBu0CbTONrHM= X-Received: by 2002:a17:90b:1910:b0:2d3:d0b7:da4 with SMTP id 98e67ed59e1d1-2d5c0dd48eamr1622384a91.19.1724143698501; Tue, 20 Aug 2024 01:48:18 -0700 (PDT) MIME-Version: 1.0 References: <20240814184731.1310988-1-mstrodl@csh.rit.edu> <8d8b1967-1d41-44d9-9791-d7809bed269c@bootlin.com> In-Reply-To: <8d8b1967-1d41-44d9-9791-d7809bed269c@bootlin.com> From: Christian Gmeiner Date: Tue, 20 Aug 2024 10:48:06 +0200 Message-ID: Subject: Re: [PATCH v4 0/2] Add support for Congatec CGEB BIOS interface To: Thomas Richard Cc: Mary Strodl , linux-kernel@vger.kernel.org, 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, Thomas Petazzoni Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 3894918000E X-Stat-Signature: oem8wfof5e6woxr31kn68t7np8bqrpr7 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1724143699-90267 X-HE-Meta: U2FsdGVkX1+4RmhRg0qQn2SPjRVKkVPeY3Ie9Cbj8lt2wnhkDu0ElcspIViMoGegvwCyreYBaY4R4xW08XnPjSYqCV0Dcrk4+F/HiUOFpnv+tGxPKABFilNxF4SlTrb97qQF5HtOowrwEF2WUelRN7MLYdQ762qCDq90+mg6HmJTuoimR8Z3sh+2HApM4ob5RkqkVZIfapYpEcMuhjZPo2ACy+O0HhV2I36w+gqJCDrQFcmfYi8EdaahyUdzl8TxJhs213zDXvhI9ChENJY2CnauE8RlDS1LDOBtH7mMy3H02WNlNKO+ZHxJkUUUpc7AHZzrGEzFlDh51sgTEWdnPbHKBs3PbUoJoBmck8wqfRZQFUo//B8Qurlb0B+TjhANclX3/mzVZ07Zw4iIQkS6dxFPBE92mTXNJXNnJWECLoi+54lC+CzC7/KA2PXS+PBZK6uvIdfZ2+RSD5p8rOubQA88TMYv5nQilTI9uZ1sqg5JtdQCfTStP8kXAcFazJgZTiKNj5vYbayYb18GjSGD6P/rUXpda/I83QD7hytnNy9sCu4eTHJKsvolXWPLA7Pa99m7nzhvUfd58tXhFkgw1n89GUyFKnprq3AMpoRQtJkbgAJjbcF0pFpHz+MXoV1GGNQBrkNTzqKNe4OGodsbV2tDn7L++Jw4gCuEPYEfmhrNe3zy4h48tZmV8AabQlF8cm3dTAMU0MBPfxghxEPshO0nT0/v1hzXvEAndeN5Msljnm0A+/zCzbV18WFA923PgjLvu047UKRRYLoww+pi1cormqbLD54Y7fjsw56Nvp49CNORnziYmzEeTxPK6QMxZ7Gksf0ht9SvWaLWkm1j+2ydm98swIXSXsjr3A60+WvcoOMilMARSLasID8RzvbDmBoC+zJUhfsS3DKVChvH+rG8uEYh5LH1wWFpHJpNmjyIzxIPwys0/i4fWmh0Mx1rHSyV1qD8fqtDn6WTB2Z KkLmlmoG jsROGWZpLyQxWc2Qg6MJWqY9wLB+vjVqdF/QLKE+2B9Z7Ys/ASyK6xXy4UBQDsXw94DfYzA+gaISXHM/dHuhWNtWWYSEkCStcRkw77FAu/4E2X4KEN9CqTGEhMKot2soAPUQUrm4A8BYlpBT5q47jfkmFT4Gx2SNxzVMvpSIS1y73G+lbzrd7OAnsrSEjCWJTFekjB8ZhrtX9JCC594M3cEbTp2+tn8R9M5t0IsPkMjf4SbWprv0P4i/aGQl9S40P4G4rQ76ggYTki4t/AHA7Q09B7S0APXL9Gm4MmXihglK5BjtuNr/jCfgz12gD1JJWXql4gdcOEsJM/kRvfGfeyvjLO2ihgrofrRKWLnx4jOgHCUQMdD7EUV3XZm6zaPF0KFnFh+HUnUs1YO4wrVwbaYGQ8Q== 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: Hi Thomas! > > 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). > I'm glad to see that Congatec has taken a different approach with their driver and is no longer relying on the BIOS blob method. Years ago, I shared my frustrations with them over this outdated solution through numerous phone calls, but the company I worked for was simply too small to have any real influence. > 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. > Fantastic news - looks like all the pain with this board controller under Linux is gone soon. -- greets -- Christian Gmeiner, MSc https://christian-gmeiner.info/privacypolicy