From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32344C49EA5 for ; Sat, 26 Jun 2021 18:31:27 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9FA6C61C29 for ; Sat, 26 Jun 2021 18:31:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FA6C61C29 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2F9EE82C40; Sat, 26 Jun 2021 20:31:02 +0200 (CEST) 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="iLBdjQJM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B6FC82C55; Sat, 26 Jun 2021 20:30:38 +0200 (CEST) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (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 9D8EA82C43 for ; Sat, 26 Jun 2021 20:30:27 +0200 (CEST) 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@google.com Received: by mail-ot1-x32e.google.com with SMTP id n99-20020a9d206c0000b029045d4f996e62so13262683ota.4 for ; Sat, 26 Jun 2021 11:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IT7SAihU77ev8XTgVbtcX+4316xPErdefOM3uJh+RAk=; b=iLBdjQJMcUfXphdBXQVmEtoJxJxRW2ccyY3P33Fcq1aiyqYDHfoOIBtv6GQTw2h5bE LzyS5S9GpwYqndj/qm9wGW6SaMQB4KfbRwzmRx9fOu2rpgJ7rygyR/7hRyMMrPYLuxlW U0G9PoEOejc0fk4x77ddPtwmtI3W8R2qSs/S8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IT7SAihU77ev8XTgVbtcX+4316xPErdefOM3uJh+RAk=; b=rOFl49GECjxxrXF8bDvIwPWGuhvoSq220Z3DaUyBw6fWHMmBprCkOAUyFPnO3u/yQL 1i5YHj2Mv+v0a/RL/pf4/QxyZ6GNxuAdPeAeLgvMLKDzWM99w06VR0WUjdJm3gdx87uZ 4sWirrf6V7EDpHVcqyxFWkXYkZxk42Lv8fhIaUQbEc/L29tKya/CMKnqxKaT0NdaJ5EC Ktjz3IhCjp/GY85wbMw4Hn+lyO39aDbRmWlIOS0GZa2IJ+S+9E1xNeFkTIDf/CXG2hPN Zy6EvR3ucPawt0N43kMy/EILkqHyvnVoY8HBZt1QAXge8XjGLCFsh50YFHZ5hskm9cKq ITUQ== X-Gm-Message-State: AOAM533cuTxxXDfDVf2lc9e8v1YRiQ8chYmQrbzIW2KmRQl3hdj+tJRh HrbsrTivJDWx221OVbgHL+DMdMdY13+TAWuTjKD9Y8yi/eY= X-Google-Smtp-Source: ABdhPJzE3SDI86fU8eM1sJPXDAh9QVvyUJiDEThLh6JGYRgiuqktzZi6oxQ70BbOjw4O1NnZ+N7GzEVaoNXI/Ek04sk= X-Received: by 2002:a9d:d42:: with SMTP id 60mr14977398oti.88.1624732218263; Sat, 26 Jun 2021 11:30:18 -0700 (PDT) MIME-Version: 1.0 References: <4e6d9194f7cdeaab9280d385d57bd39f2dae7534.1623332762.git.nandor.han@vaisala.com> In-Reply-To: <4e6d9194f7cdeaab9280d385d57bd39f2dae7534.1623332762.git.nandor.han@vaisala.com> From: Simon Glass Date: Sat, 26 Jun 2021 12:30:04 -0600 Message-ID: Subject: Re: [PATCH v4 2/3] reboot-mode: read the boot mode from GPIOs status To: Nandor Han Cc: U-Boot Mailing List , Tom Rini , =?UTF-8?B?VmVzYSBKw6TDpHNrZWzDpGluZW4=?= Content-Type: text/plain; charset="UTF-8" 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.103.2 at phobos.denx.de X-Virus-Status: Clean On Thu, 10 Jun 2021 at 07:57, Nandor Han wrote: > > A use case for controlling the boot mode is when the user wants > to control the device boot by pushing a button without needing to > go in user-space. > > Add a new backed for reboot mode where GPIOs are used to control the > reboot-mode. The driver is able to scan a predefined list of GPIOs > and return the magic value. Having the modes associated with > the magic value generated based on the GPIO values, allows the > reboot mode uclass to select the proper mode. > > Signed-off-by: Nandor Han > --- > arch/sandbox/dts/test.dts | 8 ++ > configs/sandbox_defconfig | 2 + > .../reboot-mode/reboot-mode-gpio.txt | 20 +++ > drivers/reboot-mode/Kconfig | 9 ++ > drivers/reboot-mode/Makefile | 1 + > drivers/reboot-mode/reboot-mode-gpio.c | 128 ++++++++++++++++++ > include/reboot-mode/reboot-mode-gpio.h | 32 +++++ > test/dm/Makefile | 1 + > test/dm/reboot-mode.c | 42 ++++++ > 9 files changed, 243 insertions(+) > create mode 100644 doc/device-tree-bindings/reboot-mode/reboot-mode-gpio.txt > create mode 100644 drivers/reboot-mode/reboot-mode-gpio.c > create mode 100644 include/reboot-mode/reboot-mode-gpio.h > create mode 100644 test/dm/reboot-mode.c Reviewed-by: Simon Glass