From patchwork Tue Apr 13 22:43:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1465958 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=jentTkY5; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4FKgdc532bz9sVv for ; Wed, 14 Apr 2021 08:44:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BBC0681D1E; Wed, 14 Apr 2021 00:44:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk 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=prevas.dk header.i=@prevas.dk header.b="jentTkY5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6F87C81D1E; Wed, 14 Apr 2021 00:44:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0709.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::709]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6AB0E80F5B for ; Wed, 14 Apr 2021 00:43:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HtvgdzE/KBNe7rwWvAB28+D2zLaXhb6tDTEsI3pUrDZgbJkSd9o2FXW0AcSEmdczh9q52StxBkuGobE+l3lYQvHrsiA92eBIFlIyemKJhc0eb9XN3PyW/9CJUZ9uZR6Zl7bexOaCEcpz/gcGsEEjbFhiRP8sEUwQVbZMcq/QqOFZfIGFfCymsnbr7xFsepEdGUZDkpV7GjLUvS+qzVyve2hnku6jAkOMb05Zklz+vy13Ictl4foxKQcjg7gp/jMZ5UgklDSp6938OkQKD7CBu1GQCt8TMKP7C3jfVHZoC2VMaCrwwkj3I8vzTEoRfCWav+IJ4D17MPxYnPneW7y3uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GRYj9Z+zQiIpx33mtcWrGUVJ3Y3jTAPlF4Tx8bR2Os4=; b=Q29qlGlPgCkxG8h4rwdRkje01d4fpcJobZxCkxwXdNtCmSGJxvUZnMBTxF6y07v5L5goGzDhPoMnAFUYKM8/KiJwZlu9XQuFUqxIuMyVgv2YAWnadWpn6NbQlnxo/6VPmiNMAPjv1XBm59v3EXMHto+RkZ4Zde5kE+bx7599DhOXSj5h/zu6EzeC+pWIXtuz8wKvtGKTH5yfC6BCvQJSueqMpy8QeS9FwS7DwLtOndzXDpcRHORsfOCOasXeRurHfQv6qchli91x30hMqjqogXcKggfOa+AGJpJW8WBNMNjioqL7h0WJ50mO8PupO6UNllus67kR1nY6Mc450ruMIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GRYj9Z+zQiIpx33mtcWrGUVJ3Y3jTAPlF4Tx8bR2Os4=; b=jentTkY50hFTm4EWqfKcx5v9nHdZCxATREIM4NJhTnse7Y4g8lITeSc2bpCv37zniLzmVvOnu3pVxWRGjLa6DA8397RG3TwzJ5eV/Uvjlx2uRDd+Gpnz08aG6HBMK+B6NoPCmIdF4s10yykDeKO0gVLq4PKVBVHAXP/i51kgE60= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM9PR10MB4484.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:269::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.16; Tue, 13 Apr 2021 22:43:56 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::edba:45:89f8:b31f]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::edba:45:89f8:b31f%7]) with mapi id 15.20.4020.022; Tue, 13 Apr 2021 22:43:56 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Wolfgang Denk , Simon Glass , Tom Rini , Joe Hershberger , Patrick Delaunay , Rasmus Villemoes Subject: [PATCH 2/2] sandbox: add test of CONFIG_ENV_IMPORT_FDT Date: Wed, 14 Apr 2021 00:43:45 +0200 Message-Id: <20210413224345.2692591-3-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210413224345.2692591-1-rasmus.villemoes@prevas.dk> References: <20210413224345.2692591-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [80.208.71.248] X-ClientProxiedBy: AM6P191CA0015.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::28) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (80.208.71.248) by AM6P191CA0015.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Tue, 13 Apr 2021 22:43:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d1b45db8-2138-49e4-88e6-08d8fecd9ebc X-MS-TrafficTypeDiagnostic: AM9PR10MB4484: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:785; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oPYGQK0djscs6Lqd+X9aXTfoVrVDGQ/nKz+i64I2KQSyycumbeUGVDZ0qjMlIq2LtEgl1ojJo+h37RxNW1dTvBI+mPuGZ4X+zeY3VC4h90aZtBVP1L0LZrok/d8aItOwYDGtyA7bXaHxCA6Tz8kJIHmHauveNR84r4g4mX6P2QXRV+b15nRZ75VFleeq7Li2iNyTTb6Sa5KJIeJ7YW/PARRyoZ/NKwy5JZK8hmy+RONL5ZyTEJpa7AJLC2EVGCOCMJBQ26Tz+szp4ikn2pzYQZEu/d9lPz806oh63Jcau+FSBDSOR47u1GU33wzYae6HmpwX2VJcYI1etw8qQfj3P9OLrpDRej20danNuQMfJ2dRXb07/tabjnE0eM43e/wkfLIxeZrjjXlB5ULO8hNG6SJYJ7CBb81qfrALPtYM4FRjdAUaGB+sNs1+H48lMrOE/v2UZZAost7OWPHKOJR/mCv5f8usEUwJwrj3clz0AYySsPzUXnBkCwecNAG5EDN/jkbIHdm57+MTbA9Q0Rt284cbZ0u/STbntyB4oKtMU+QDpRC9Vb5VCM+OMcHNVnIhjIrTEAkUHcOTGs4VY2zyAxAPRvqgavd1bwG7O63OgCBTdqTOAnXe7euqS5Fk5zGjuigVhkpCytRxpbn/0Njvp983nPM/BmpOQnQ9zprMk7Q= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(366004)(2616005)(6512007)(956004)(498600001)(36756003)(107886003)(16526019)(6486002)(186003)(6666004)(26005)(44832011)(66556008)(66946007)(66476007)(6916009)(8936002)(1076003)(4326008)(52116002)(2906002)(54906003)(38350700002)(8676002)(86362001)(38100700002)(8976002)(6506007)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: uZWH5wlXDnPSWnZNDFm5q8BphSMVNWeUKNlMxcNyBVLzcGWGwDRAiIYQ/ydvhbTCFJgTPyTiy8dIxeQ2Jp5Y1kBefGk7QvOvkegF2XpoIRddznDqvCpzhH4F8h6bYITBxBFtXX5NZzKe7seYl+NHR9qpj6ZHkcJCEfM3igRTAB/eZ2cREfJqaDPK9fGdiY1RXZLWdqPbMZ1wON2cESkbOlthrDAV01osBvu1SxPMBlQ5Xwv5rk4gZQUb+oYzfI77lCmkTtaVPRFJuBeGNBZx/ilA1/jklbO6rRxoomKszLghnR5c1OlV051k0Cx/f5fh339hAt9Fz5C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d8fecd9ebc X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2021 22:43:55.9460 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4N84wAWBoGGxHq9e9z+ybv6MSZGzXT1JiJ2IVNt3I7pzIS1YESFKmrPPJgdcNJX898Jl/P97qLRabv4yrEYPC52QNw7RrxP0Vbx1F1frWaY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR10MB4484 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean Check that a variable defined in /config/environment is found in the run-time environment, and that clearing fdt_env_path from within that node works. Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Glass --- arch/sandbox/dts/test.dts | 7 +++++++ configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + test/env/Makefile | 1 + test/env/fdt.c | 20 ++++++++++++++++++++ 5 files changed, 30 insertions(+) create mode 100644 test/env/fdt.c diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 899e75f260..442f269a6c 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -51,6 +51,13 @@ osd0 = "/osd"; }; + config { + environment { + from_fdt = "yes"; + fdt_env_path = ""; + }; + }; + audio: audio-codec { compatible = "sandbox,audio-codec"; #sound-dai-cells = <1>; diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 4648808d51..b193a83b5c 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -91,6 +91,7 @@ CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_EXT4=y CONFIG_ENV_EXT4_INTERFACE="host" CONFIG_ENV_EXT4_DEVICE_AND_PART="0:0" +CONFIG_ENV_IMPORT_FDT=y CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_NETCONSOLE=y CONFIG_IP_DEFRAG=y diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 5da8d1679e..25baabb6a1 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -106,6 +106,7 @@ CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_EXT4=y CONFIG_ENV_EXT4_INTERFACE="host" CONFIG_ENV_EXT4_DEVICE_AND_PART="0:0" +CONFIG_ENV_IMPORT_FDT=y CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_NETCONSOLE=y CONFIG_IP_DEFRAG=y diff --git a/test/env/Makefile b/test/env/Makefile index 5c8eae31b0..170bece3d6 100644 --- a/test/env/Makefile +++ b/test/env/Makefile @@ -5,3 +5,4 @@ obj-y += cmd_ut_env.o obj-y += attr.o obj-y += hashtable.o +obj-y += fdt.o diff --git a/test/env/fdt.c b/test/env/fdt.c new file mode 100644 index 0000000000..30bfa88c35 --- /dev/null +++ b/test/env/fdt.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include +#include + +static int env_test_fdt_import(struct unit_test_state *uts) +{ + const char *val; + + val = env_get("from_fdt"); + ut_assertnonnull(val); + ut_asserteq_str("yes", val); + + val = env_get("fdt_env_path"); + ut_assertnull(val); + + return 0; +} +ENV_TEST(env_test_fdt_import, 0);