From patchwork Tue Oct 27 18:46:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1388881 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; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=cw+DKogV; 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 4CLLKy4g73z9sSs for ; Wed, 28 Oct 2020 05:47:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D254582361; Tue, 27 Oct 2020 19:47:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de 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; secure) header.d=gmx.net header.i=@gmx.net header.b="cw+DKogV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ECCA481260; Tue, 27 Oct 2020 19:47:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8328081260 for ; Tue, 27 Oct 2020 19:47:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1603824434; bh=VOPJNJVkVB+lqZbMw1Al7LD/1YIfYEMX7Ge71o9w2w4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=cw+DKogVMWo6c4hHbgbpxidBpBpM7b+va8/mpYunQuiuhYp3/5Qurh+6xjp+gfPap OnkkdeuysJYkJeNwq05h+oWiDQAWmq3sLZGO6k/3TgBzBcGFFso16N1OgyhzByD3qk QFvJJNIYbmnPAWdzycb4lOb+N4hrfF8guW5Fz91A= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from workstation4.fritz.box ([178.202.41.107]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MulmF-1kGm81217T-00rndQ; Tue, 27 Oct 2020 19:47:14 +0100 From: Heinrich Schuchardt To: Simon Glass Cc: Rasmus Villemoes , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH v2 0/8] sandbox: implement cold reset Date: Tue, 27 Oct 2020 19:46:56 +0100 Message-Id: <20201027184704.15910-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:85GyLWbOrGhp1it5ChhgDR3QHO/z7A97HVy4QdOQCooyOaY6m0/ wUG5iDjM1EuZ6VpEM3sF4aRCE0K8BhP06W90ZZeFBJC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JWhUDtCqw== 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.3 at phobos.denx.de X-Virus-Status: Clean The command to shut down a device is 'poweroff'. It is a deficit of the sandbox that it does not support resetting yet but shuts down upong seeing the 'reset' command. The patch series implements the cold reset function as a relaunch of the U-Boot binary via execv(). Unit tests are adjusted. A bug leading to closing the console input file descriptor is resolved. Add some of the sandbox API to the HTML documentation. v2: use O_CLOEXEC in os_open() avoid longjmp() add more comments add the os.h to the HTML documentation Heinrich Schuchardt (8): sandbox: eth-raw: do not close the console input sandbox: enable poweroff command test/py: test poweroff sandbox: use O_CLOEXEC in os_open() sandbox: implement reset test: adjust sysreset tests sandbox: update function descriptions in os.h doc: add sandbox API arch/Kconfig | 3 +- arch/sandbox/cpu/eth-raw-os.c | 8 +- arch/sandbox/cpu/os.c | 16 +- arch/sandbox/cpu/start.c | 26 +++ arch/sandbox/cpu/state.c | 1 + arch/sandbox/include/asm/u-boot-sandbox.h | 10 + doc/api/index.rst | 1 + doc/api/sandbox.rst | 9 + drivers/sysreset/sysreset_sandbox.c | 3 + include/os.h | 236 +++++++++++++--------- test/dm/sysreset.c | 11 +- test/py/tests/test_sandbox_exit.py | 8 +- 12 files changed, 227 insertions(+), 105 deletions(-) create mode 100644 doc/api/sandbox.rst --- 2.28.0