From patchwork Wed Jan 15 05:18:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1223178 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47yFxq4ddzz9sR0 for ; Wed, 15 Jan 2020 16:19:43 +1100 (AEDT) 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=q/gogZoC; 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 47yFxp71bDzDqRt for ; Wed, 15 Jan 2020 16:19:42 +1100 (AEDT) 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 47yFxJ1vtZzDqDl for ; Wed, 15 Jan 2020 16:19:16 +1100 (AEDT) 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=q/gogZoC; 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 47yFxH142lz9sNx; Wed, 15 Jan 2020 16:19:14 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1579065555; bh=EnqkHYMbXkSVHFl0Q0oAQg+9Wc7H0/cBSFZ4HcWeEaI=; h=From:To:Cc:Subject:Date:From; b=q/gogZoCqfOWp5+69cRGC8nf4rh+IVkjuHP21eg3WS5W5oeoOLKgZ18Yg/emMoi+f j9x3HZmRDwKGAtks72Y1ZGsigTQgVr7oNSwaRgHf1T7goqvJOVw/PjbViliHnNX7BM khozzzogcKhavY83/QStu1/CjtQRW/bp8jigeO2Bir+OBgJcaW2Zn5uoaBG1aYIFWj YZhLf0OrIFA8jaIh6tWRYkxZr6mFxfmwoQQsDjqA5mHnOgngdSnXU8GV9UTeixu8TT ufbW6FwMysK7eMQsroJ0jLb25aufjGSHx6DI9TtMM1kG6+K7s0GnKRYOk14KbfnR8d 4jPXn8737lc/A== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Wed, 15 Jan 2020 16:18:48 +1100 Message-Id: <20200115051901.17514-1-amitay@ozlabs.org> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Subject: [Pdbg] [PATCH 00/13] Use fdt properties directly 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" Currently pdbg caches the properties in memory. Any changes made to the properties are stored only during runtime and do not persist. Even though internal device trees cannot be modified, the external device trees (specified via environmental variables) can be modified to store the updates to the properties during runtime. This patch set removes the caching of node properties in memory and accesses the properties directly from device tree. This allows properties to be updated in the device trees which are externally specified. Amitay Isaacs (13): libpdbg: Cache device tree pointer and offset for each node libpdbg: Map external device trees read-write by default Revert "libpdbg.h: Expose method to read fdt pointer" libpdbg: Cache device trees globally libpdbg: Add an api to get system device tree libpdbg: Restrict set_property to updating existing property libpdbg: Do not store properties in linked list libpdbg: Read/write properties directly from/to device tree libpdbg: Instead of dt_find_property(), use pdbg_target_property() libpdbg: Drop unused struct dt_property libpdbg: Properly close the mmaped files on exit libpdbg: Add a check if device tree is writeable tests: Add test for libpdbg property api Makefile.am | 10 +- fake.dts.m4 | 2 + libpdbg/device.c | 210 ++++++++++++------------------- libpdbg/dtb.c | 224 ++++++++++++++++++++++------------ libpdbg/libpdbg.c | 8 +- libpdbg/libpdbg.h | 10 +- libpdbg/target.h | 15 +++ src/tests/libpdbg_prop_test.c | 120 ++++++++++++++++++ tests/test_prop.sh | 55 +++++++++ 9 files changed, 432 insertions(+), 222 deletions(-) create mode 100644 src/tests/libpdbg_prop_test.c create mode 100755 tests/test_prop.sh