From patchwork Fri Oct 23 08:52:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kovalivskyi X-Patchwork-Id: 1386600 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=globallogic.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=globallogic.com header.i=@globallogic.com header.a=rsa-sha256 header.s=google header.b=LSy+z2OL; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CHdKR5P6Wz9sV0 for ; Fri, 23 Oct 2020 19:52:43 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A62C882468; Fri, 23 Oct 2020 10:52:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=globallogic.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=globallogic.com header.i=@globallogic.com header.b="LSy+z2OL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2890B82468; Fri, 23 Oct 2020 10:52:39 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) (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 69B548244B for ; Fri, 23 Oct 2020 10:52:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=globallogic.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=roman.kovalivskyi@globallogic.com Received: by mail-lj1-x244.google.com with SMTP id x16so743714ljh.2 for ; Fri, 23 Oct 2020 01:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=globallogic.com; s=google; h=from:to:cc:subject:date:message-id; bh=yiJdV/oa76ULYBCHFl2a+Fo6CuipXmu2hxlIrIWwpJo=; b=LSy+z2OLXh+jW3lTnL3UnoFxe1EPOmiJej3XPhvyUxryH0JwkQBvo/bCs3zqXAydp5 peeyMaXHv2BPGtlH3isdLzl6cl+BpjqIlBUO5+TZQTqnbgFBtWdAXNxcktaNBQYPdAjE jYqwwcKPnRSx5LpzANemUJO5wFbdLxE44nZZH9KcgcTX+W45XqooDY61Xc8KHTeFx0jH Ng2LTifIjrd2EMr/m+F9Wgg6E3bdMAvxHFQOB6niyxahEzLAqmRxZi6spKFd81QmFhHp lEa7wOpaeI+wm6u6BSTkO/qDd7q7qwoZSWqqGzFuYuu4OrGaQ7/gG4ViX88esVMy3ueD 2Mhg== 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; bh=yiJdV/oa76ULYBCHFl2a+Fo6CuipXmu2hxlIrIWwpJo=; b=P36gXZv1m+zz0Hp0VucFCjk+jJAvhpRdbWl+7OwWKyO4Gx0k3Q9xUdxH3OJ4PaftWk pCdgmmU5mkp/k/C+t7En/eJ+e2A+nVGXZen+xcrXb6CvdEkOK6Ez+FUJJ+0eTYz9+geV zKmDbK7ipuU2t1oRqznGTVOhAruYpJhdnrisL7pNr4Kfu+06KtJNLJMFCRlQwRYULbrG Zmim32sxUTkFy0c58G9TwHg5Yvnqd5yhN2Q+6Yp96ySETt1Y8U7DKDnPncMNKQFFFYFH IHldGSVoWXwtSZvlZpdvIkAQOgZLSIQoq0HJOg4wSsu0Eme/HchrUKcyCBVns12cOWxA RHYA== X-Gm-Message-State: AOAM533415ijn0ZpmaSyNKa+uyIKvmXhSQvIVl9dRTew+2S6acdSh39H aarHNAwxQjeAMCYobKmiDgO6DxVD2Kr32g== X-Google-Smtp-Source: ABdhPJz2Qzc8vms0UwVFBvZVZhy8r8FAgWBggq3a6Z+bbepI0Oc/AcfLs7GTDVYXnYhAXppBbDn2LA== X-Received: by 2002:a2e:7803:: with SMTP id t3mr420076ljc.156.1603443155523; Fri, 23 Oct 2020 01:52:35 -0700 (PDT) Received: from user-HP-ZBook-14u-G4.synapse.com ([159.224.5.60]) by smtp.googlemail.com with ESMTPSA id f184sm74564lfd.253.2020.10.23.01.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 01:52:35 -0700 (PDT) From: Roman Kovalivskyi To: u-boot@lists.denx.de Cc: Roman Stratiienko , Joe Hershberger , Roman Kovalivskyi , Simon Glass , Marek Vasut , Lukasz Majewski , Eugeniu Rosca , Alex Kiernan , Sam Protsenko , Neil Armstrong , Philipp Tomsich , Kever Yang , Paul Kocialkowski , Lokesh Vutla , Jagan Teki , Miquel Raynal , Boris Brezillon , Tom Rini , Igor Opaniuk , Aleksandr Bulyshchenko Subject: [RESEND 0/7] Refactor generic fastboot_set_reboot_flag implementation Date: Fri, 23 Oct 2020 11:52:18 +0300 Message-Id: X-Mailer: git-send-email 2.17.1 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 Current generic implementation of fastboot_set_reboot_flag is somewhat messy and requires some additional configuration option to be enabled besides CMD_BCB, so it reverts that implementtion in order to bring a new cleaner one. New function called bcb_set_reboot_reason should be exposed by BCB commands, so that all of the details could be put there instead of dealing with it in fastboot implementation directly. After that, fastboot_set_reboot_flag could simply pass correct reboot reason string to the BCB implementation. If CMD_BCB is disabled then the whole operation would return error code, which is no different behaviour than the current implementation. Eugeniu Rosca (5): cmd: bcb: Extract '__bcb_load' from 'do_bcb_load' for internal needs cmd: bcb: Extract '__bcb_set' from 'do_bcb_set' for internal needs cmd: bcb: Extract '__bcb_store' from 'do_bcb_store' for internal needs cmd: bcb: Expose 'bcb_write_reboot_reason' to external callers cmd: bcb: Add support for processing const string literals in bcb_set() Roman Kovalivskyi (2): Revert "fastboot: Add default fastboot_set_reboot_flag implementation" fastboot: Implement generic fastboot_set_reboot_flag cmd/bcb.c | 88 +++++++++++++++++++++++++++------- drivers/fastboot/Kconfig | 12 ----- drivers/fastboot/Makefile | 1 - drivers/fastboot/fb_bcb_impl.c | 43 ----------------- drivers/fastboot/fb_common.c | 12 ++++- include/bcb.h | 20 ++++++++ include/fastboot.h | 9 ---- 7 files changed, 101 insertions(+), 84 deletions(-) delete mode 100644 drivers/fastboot/fb_bcb_impl.c create mode 100644 include/bcb.h