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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5E350C6379F for ; Fri, 24 Feb 2023 01:23:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EBF8785B86; Fri, 24 Feb 2023 02:20:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Ya0pGcpT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C7B7485B26; Fri, 24 Feb 2023 02:19:29 +0100 (CET) Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 13C1E85A03 for ; Fri, 24 Feb 2023 02:19:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12e.google.com with SMTP id 4so2101367ilz.6 for ; Thu, 23 Feb 2023 17:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SfayWwmYsbYmInBrSHOagXAz7nXUuEz9eCgeXi3o/2Y=; b=Ya0pGcpTrLyPD7td6DVP4bM1ZZbuXMAzygs7LfcgG4FgasldVq3CVFKK3/OJFiDx/w HZf4G8Ggx9dTEUgLjU2GvuQjd18TGXhzqgG06hOpn3e8FKszYzbE6MP/i/PL2zcz2+0H CcfUIpwuAKPmYvIQVHkDSQBxY4bvOuYAgsLrk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SfayWwmYsbYmInBrSHOagXAz7nXUuEz9eCgeXi3o/2Y=; b=Pf21uVuNVNe/tp6SUXaLd8Hd/BC1pNjqQGHiL7r5D6fFb3IBzqsJHCEvPiC5QFL22J FvALKPyrPhf9xuMASWufkjfy2QqdPAuk784YSuLLgdtsurczC2+kNPktmu4SN3Vx8pi4 b4K39Y6tvXSf9/3K7+ZdhUdofjR9UayPDLVaFITIvJnulXQJ0JNbLbrVT/TKmV97P3+N RoSOzdCVs4xdjMV82mnXVmSs2sjCoX6TVJ/rLc+my+LCykn2WJID3tc0Tm0pMZDlafls nf1XVJBXf3VeRAk7ZlWo7Rq8SQIw6/xyTe3EAkvG2LqDFEuzoB3/kR710laK9VGpP0Ub Id9Q== X-Gm-Message-State: AO0yUKXZwX8bm/aMLjm0C2WHKNfFm8IPXAOXulc+DG6GuyeYpWhduWA+ b1jS0qLlI4HT0zr29N9UqxsG7AeDk880O/sE X-Google-Smtp-Source: AK7set9uKpnbBzka5LhzkNyp28+J2KfC9fDOj9ijlNjXWBmrkfnsGlX0HE2OFVtXjS6z0hywfqX1kg== X-Received: by 2002:a05:6e02:c22:b0:315:3036:4db with SMTP id q2-20020a056e020c2200b00315303604dbmr10675291ilg.16.1677201539256; Thu, 23 Feb 2023 17:18:59 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id q3-20020a92d403000000b003127b668eafsm2677214ilm.19.2023.02.23.17.18.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 17:18:58 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Alper Nebi Yasak , Neha Malcom Francis , Stefan Herbrechtsmeier , Philippe Reynes , Peng Fan , Heinrich Schuchardt , Simon Glass , =?UTF-8?q?Marek=20Beh=C3=BAn?= , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Quentin Schulz Subject: [PATCH v2 17/24] dtoc: Add support for building a dtoc PyPi package Date: Thu, 23 Feb 2023 18:18:17 -0700 Message-Id: <20230224011824.2111976-18-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230224011824.2111976-1-sjg@chromium.org> References: <20230224011824.2111976-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Create the necessary files to build this new package. This is needed for binman. Move the main program into a function so that it can easily be called by the PyPi-created script. Signed-off-by: Simon Glass --- (no changes since v1) Makefile | 1 + tools/dtoc/README.rst | 15 +++++++++++++++ tools/dtoc/pyproject.toml | 26 ++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 tools/dtoc/README.rst create mode 100644 tools/dtoc/pyproject.toml diff --git a/Makefile b/Makefile index 3c1bda50263..3951edabce1 100644 --- a/Makefile +++ b/Makefile @@ -2284,6 +2284,7 @@ _pip: scripts/make_pip.sh u_boot_pylib ${PIP_ARGS} scripts/make_pip.sh patman ${PIP_ARGS} scripts/make_pip.sh buildman ${PIP_ARGS} + scripts/make_pip.sh dtoc ${PIP_ARGS} help: @echo 'Cleaning targets:' diff --git a/tools/dtoc/README.rst b/tools/dtoc/README.rst new file mode 100644 index 00000000000..92b39759ed1 --- /dev/null +++ b/tools/dtoc/README.rst @@ -0,0 +1,15 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Devicetree-to-C generator +========================= + +This is a Python program and associated utilities, which supports converting +devicetree files into C code. It generates header files containing struct +definitions, as well as C files containing the data. It does not require any +modification of the devicetree files. + +Some high-level libraries are provided for working with devicetree. These may +be useful in other projects. + +This package also includes some U-Boot-specific features, such as creating +`struct udevice` and `struct uclass` entries for devicetree nodes. diff --git a/tools/dtoc/pyproject.toml b/tools/dtoc/pyproject.toml new file mode 100644 index 00000000000..77fe4da2158 --- /dev/null +++ b/tools/dtoc/pyproject.toml @@ -0,0 +1,26 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "dtoc" +version = "0.0.2" +authors = [ + { name="Simon Glass", email="sjg@chromium.org" }, +] +dependencies = ["pylibfdt", "u_boot_pylib"] +description = "Devicetree-to-C generator" +readme = "README.rst" +requires-python = ">=3.7" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", + "Operating System :: OS Independent", +] + +[project.urls] +"Homepage" = "https://u-boot.readthedocs.io/en/latest/develop/driver-model/of-plat.html" +"Bug Tracker" = "https://source.denx.de/groups/u-boot/-/issues" + +[project.scripts] +dtoc = "dtoc.main:run_dtoc" -- 2.39.2.637.g21b0678d19-goog