From patchwork Tue Apr 21 04:16:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1273916 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 495qz91CrKz9sSM for ; Tue, 21 Apr 2020 14:17:25 +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=AmCu+6/O; 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 495qz84pMhzDr27 for ; Tue, 21 Apr 2020 14:17:24 +1000 (AEST) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (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 495qyz3GnMzDqt0 for ; Tue, 21 Apr 2020 14:17:15 +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=AmCu+6/O; 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 495qyy0hFwz9sSM; Tue, 21 Apr 2020 14:17:14 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1587442634; bh=ICxoj/1kX3xQ9kR2vMcTeuHAEkjkcIDkEuBwU8cRMT4=; h=From:To:Cc:Subject:Date:From; b=AmCu+6/O/RGMGZXYwB6m4gbDp1mvFj4sC6rxE9G1VtUL95mkuZifQOJv9BLFTFtOC 4RZyOSnamEIaQismo/wdSUPItwl57rzAKp/6+VXX2HitIBNEFo4Em0bxxEZtsYgVGO t2v9lGrfKAFM7TzN0OonhD6LGughz6+dA1Lya4+YFIsPytZLzr/SuKhaJ5OpJwdYry nmW/k/tzYblLrmTpEFaQWxpP/6W/LLfat7c4vBhHGOILb6RFYkbCXVHc+BWeHHpO4W cUHWVCjxM6CQ9fSbrbvfA769LisFS8D+2ILcZf+C6uygDuI8dETAeEAoXluX11QKvg Gmen+ZnuQqbLQ== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Tue, 21 Apr 2020 14:16:36 +1000 Message-Id: <20200421041655.82856-1-amitay@ozlabs.org> X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 Subject: [Pdbg] [PATCH v4 00/19] 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. The drivers for targets in the system device tree which can be matched to the same compatible string (e.g. ibm,power-thread) are assigned to 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 must be only single compatible string 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,power-thread and ibm,power9-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) V4 changes: - When matching compatible property, search all strings at once - All backend drivers are registered to default backend - All system drivers with specific compatible string (e.g. ibm,power9-thread) are registered to default backend - Only system drivers with generic compatible string (e.g. ibm,power-thread) are registered to specific backend - Do not assume specific parent/child relationship for sbefifo, find the sbefifo target based on pib index Amitay Isaacs (19): 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 PDBG_BACKEND_DRIVER to specify drivers to load libpdbg: Use const char * for filenames dts: Backend device trees must use specific driver dts: Rename ibm,processor -> ibm,power-proc dts: Add a generic compatible string 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/device.c | 15 +- libpdbg/dtb.c | 28 ++- libpdbg/fake.c | 8 +- libpdbg/host.c | 2 +- libpdbg/htm.c | 6 +- libpdbg/hwunit.c | 86 ++++++- libpdbg/hwunit.h | 13 +- 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 | 181 ++++++++++++-- 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 + 31 files changed, 696 insertions(+), 404 deletions(-) create mode 100644 p9-sbefifo.dts.m4