From patchwork Sat May 18 04:00:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1101359 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="mO/b3JYo"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 455Wvl6Q4zz9s4Y for ; Sat, 18 May 2019 14:12:19 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9407FC21DE8; Sat, 18 May 2019 04:09:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id F054AC21E75; Sat, 18 May 2019 04:02:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D54B2C21DA6; Sat, 18 May 2019 04:01:30 +0000 (UTC) Received: from mail-it1-f194.google.com (mail-it1-f194.google.com [209.85.166.194]) by lists.denx.de (Postfix) with ESMTPS id 539CEC21E3E for ; Sat, 18 May 2019 04:01:26 +0000 (UTC) Received: by mail-it1-f194.google.com with SMTP id q132so15050698itc.5 for ; Fri, 17 May 2019 21:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8+CT/3YUcTfkSaGi5o8r9/24LRpRcjD5x6Ms+ySz9Ss=; b=mO/b3JYoWhqb5ONQ+svzVhUGncu2/ZeT79GF7uFP3cd8xZZtt7yjqtYfDjtAOgsWmS jZwp0RfBGpZygBrsdIXB78PF87f1YXSSF6IXV9jI4dllRv26ZcHUypngjc8gHAH+yUfE h0oOiYfsHFWsCMRYabMLWo/aIABFgwBr9NxeU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8+CT/3YUcTfkSaGi5o8r9/24LRpRcjD5x6Ms+ySz9Ss=; b=mmFjiD8KI5BV07qHy9dHFEEfEOj/qlLdStfvECaSJhqiVi0gF4pjeX3c6aVvzxtgMF vux3O0Z9fHWp6FF8rcyYnPchvUKqbBu1yw2V/LAw6YSw27NTEjGkkbBfj98yefoLnkqq 7JmbSFeYDpRvSIako0GCI9SuOxF/mZe4i9NSepJXc1HG/Z9NblwAHpw8akHnV1Vt0IwM jniDfHoP73s8O1LCWv7Av5OvWkZvMrtsTsq8gXnjvZwKb4T51a7udTXMlLpQ2Wb4AELI z/jak+kWXHkycu1+M8NhSiPDhN0HSgpdhBtBFxy6idofTbVw2TN4yvxjERqxCEv8u3OO SeUA== X-Gm-Message-State: APjAAAXQbWsUNMHBGYwS8Mtvb98VVruAN5HtilzQmstnAWW1ys1AJ1x3 uh26M98FNmkk62XS+AkD44I+El6g/18= X-Google-Smtp-Source: APXvYqxvcjKi8DrgRHMXvXGI5LhJZ0YA9ojQgEFXexSWmL5wi45zZ9e3zNYfE1loCrWSgF1Wja2rug== X-Received: by 2002:a02:3ecb:: with SMTP id s194mr40251467jas.29.1558152085213; Fri, 17 May 2019 21:01:25 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id e7sm1284986itc.44.2019.05.17.21.01.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2019 21:01:24 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Fri, 17 May 2019 22:00:43 -0600 Message-Id: <20190518040054.230179-14-sjg@chromium.org> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog In-Reply-To: <20190518040054.230179-1-sjg@chromium.org> References: <20190518040054.230179-1-sjg@chromium.org> MIME-Version: 1.0 Cc: Tom Rini Subject: [U-Boot] [PATCH 13/24] dtoc: Update dtb_platdata to support Python 3 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The only change needed is to update get_value() to support the 'bytes' type correctly with Python 3. With this the dtoc unit tests pass with both Python 2 and 3: PYTHONPATH=/tmp/b/sandbox_spl/scripts/dtc/pylibfdt python \ ./tools/dtoc/dtoc -t PYTHONPATH=~/cosarm/dtc/pylibfdt:tools/patman python3 \ ./tools/dtoc/dtoc -t Signed-off-by: Simon Glass --- tools/dtoc/dtb_platdata.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index 3b66af8df78..037e82c8bbd 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -17,6 +17,7 @@ import sys import fdt import fdt_util +import tools # When we see these properties we ignore them - i.e. do not create a structure member PROP_IGNORE_LIST = [ @@ -99,7 +100,7 @@ def get_value(ftype, value): if ftype == fdt.TYPE_INT: return '%#x' % fdt_util.fdt32_to_cpu(value) elif ftype == fdt.TYPE_BYTE: - return '%#x' % ord(value[0]) + return '%#x' % tools.ToByte(value[0]) elif ftype == fdt.TYPE_STRING: return '"%s"' % value elif ftype == fdt.TYPE_BOOL: