From patchwork Fri Apr 17 07:07:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1272042 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 493Ry76qR9z9sT6 for ; Fri, 17 Apr 2020 17:08:15 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=r8Jhof8l; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 493Ry71vC3zDqWn for ; Fri, 17 Apr 2020 17:08:15 +1000 (AEST) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 493Rxr2bjjzDq77 for ; Fri, 17 Apr 2020 17:08:00 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=r8Jhof8l; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 493Rxq6QP9z9sSh; Fri, 17 Apr 2020 17:07:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1587107280; bh=9I3F0xtGENBz1eh779+dS5pVQXpk1XWJJip9OoXzkO4=; h=From:To:Cc:Subject:Date:From; b=r8Jhof8l1aiGth6JpQsrdI2vok9+7adcgopzHuq6/4qP8iMJqect8FonyILLGPpGS KDxcedyppE2fjZroNy5BD3Gw2g34fHdX0Wz38JCr9hxTFHIT9nJngLiiXU7eAdDBb0 vPvWO0cKa1Jvpi/tJfdGHjsJjqJgGn8zfXbwKPXcI5fw8aU4oY7ntVv8rAdjxT37XR vXHpxK2J0RIs8RjE17TLzAw6KZcJhz+e8i/Wk1kLfP7NlqbV1d8vLUF/sljpCFYGuC M+ZfiPJG7bqHEJCw6aqormA7lAm8XN9jGYHZYIX3U7X36/h+AXqFSOO9R/c/hNUVx9 wtD5TmEDhWyMA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Fri, 17 Apr 2020 17:07:24 +1000 Message-Id: <20200417070749.276754-1-amitay@ozlabs.org> X-Mailer: git-send-email 2.25.2 MIME-Version: 1.0 Subject: [Pdbg] [PATCH v3 00/25] Add sbefifo backend X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" This patch set adds per backend support of hardware drivers. All hardware drivers are assigned to a specific backend. When looking up a driver for a target in device tree, first lookup the specific backend and then the default backend. All targets in backend device tree, use compatible properties that describe the hardware access (e.g. ibm,bmcfsi). There is only single compatible property assigned to targets in backend device trees. All targets in system device tree, use compatible properties that describe the hardware (ibm,power9-adu) and can have multiple compatible properties (e.g. ibm,power9-thread and ibm,power-thread) to load different drivers based on the backend. For openbmc, all the hardware access is required to go via sbefifo. Currently some of the operations are hacked in to go via sbefifo (e.g. all thread operations). This patchset removes temporary hacks and adds infrastructure to create sbefifo backend. Also fix couple of bugs in libsbefifo. V2 changes: - Rebased on top of latest master (resolved conflicts and add missing code due to upstream changes) V3 changes: - Compatible properties in system device tree updated as per defined convetion (mentioned above) Amitay Isaacs (25): libsbefifo: Fix compilation error for undefined variable libsbefifo: Use the correct sized pointer libpdbg: Add a private api to get current backend libpdbg: Register hwunit drivers per backend libpdbg: Use const char * for filenames libpdbg: Backend device tree cannot be overriden libpdbg: Register fsi drivers with fsi backend libpdbg: Register i2c driver with i2c backend libpdbg: Register kernel drivers with kernel backend libpdbg: Register fake drivers with fake backend libpdbg: Register host drivers with host backend libpdbg: Register cronus drivers with cronus backend dts: Backend device trees must use specific driver libpdbg: Rename ibm,processor -> ibm,power-proc dts: Add a generic compatible property for core and thread libpdbg: Add sbefifo backend libpdbg: Add pib driver using sbefifo libpdbg: Add thread driver using sbefifo libpdbg: Add all thread procedures to pib target libpdbg: Implement all thread procedures using sbefifo libpdbg: Remove special case thread procedures using sbefifo libpdbg: Drop thread procedures from chipop target dts: Add sbefifo backend device tree libpdbg: Enable sbefifo backend main: Add sbefifo backend Makefile.am | 1 + libpdbg/adu.c | 4 +- libpdbg/bmcfsi.c | 2 +- libpdbg/cfam.c | 8 +- libpdbg/chip.c | 64 ++-- libpdbg/cronus.c | 6 +- libpdbg/dtb.c | 56 +++- libpdbg/fake.c | 8 +- libpdbg/host.c | 2 +- libpdbg/htm.c | 6 +- libpdbg/hwunit.c | 31 +- libpdbg/hwunit.h | 10 +- libpdbg/i2c.c | 2 +- libpdbg/kernel.c | 4 +- libpdbg/libpdbg.h | 7 +- libpdbg/p8chip.c | 4 +- libpdbg/p9_fapi_targets.c | 52 ++-- libpdbg/p9chip.c | 4 +- libpdbg/sbefifo.c | 163 ++++++++-- libpdbg/target.h | 1 + libsbefifo/cmd_scom.c | 4 +- libsbefifo/operation.c | 5 +- p8-fsi.dts.m4 | 6 +- p8-i2c.dts.m4 | 4 +- p8-kernel.dts.m4 | 4 +- p8.dts.m4 | 2 +- p9-fsi.dtsi.m4 | 4 +- p9-sbefifo.dts.m4 | 86 ++++++ p9.dts | 484 +++++++++++++++--------------- src/main.c | 3 + tests/test_p9_fapi_translation.sh | 2 +- 31 files changed, 639 insertions(+), 400 deletions(-) create mode 100644 p9-sbefifo.dts.m4