From patchwork Fri Dec 22 21:13:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 122669 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2748184qgn; Fri, 22 Dec 2017 13:20:51 -0800 (PST) X-Google-Smtp-Source: ACJfBot7+o+HUDJprZWDjO5xxPQgQdfC6qlvGSNczgtiP9wUwxRi64POIKfTh8Ga2TQPspap9arD X-Received: by 10.80.146.227 with SMTP id l32mr17201175eda.114.1513977650950; Fri, 22 Dec 2017 13:20:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513977650; cv=none; d=google.com; s=arc-20160816; b=kKwWsmzBKl0yvAYYIgdNpCyBK2cKH51EM3+6edTmxrwYs8InQ4M94S298gvUbHzTjJ IsQbyi8LciO6oHK/Ddvb1dj3vNfUlB1pdALNQ1STi4K249FUYDKQBpJ675o28DXDJzrX 0YS7nU8UIqcR6Lqlv0zky+Tt3cpY4JfIXRUAuDA2R+Gn6IPHj+a0T7uFMUooeIRmEWxC 7oqsWjRIb4KU0hlPqT2WIA3bMWYvC6aTtFs43DxO3KqReFXjI3RxKnCcOFLZO2HNRUtK KISO7wOKMzZZt07ZgNXTz54DCXjTxs63VuvtMjBzEPqUUwN/4IGCe7hUto3VNa0rKSbG 8rSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:arc-authentication-results; bh=8E1ePsz82v4xShBaJrFP+JWP9II5wzN+vUsrqF6c+TA=; b=M+BJDCCu1z2H1l2mge5wlUC1dx3iYetYe/Lr1Vy7nEX1dYUUxWCHB3qneVLeSqf2Su NCKzLrHaMQ9i8mgh/7u9hwkU15OhkukgUuy/ATQBIn4lA8OwkpE/CIUOf6yUC9hjOBse J9BiBgK/IQrdCP8Ko8TSb8OqxIB+D5cX9V4boWV6cJUZ7rDwepOHZnZfBiAnLgieUZig zTaGK1Hlf/EdYqxnk5wZOkf5y2kt2t6jNCg7fCvq/WuNmuqA7bKlIOCFizhurDNLhRzz nppNI8jmifkNEafuT29Qrinb9nAnuUbngHBjzYTb0kMWLf4aGv1tFjoDUtyAYjgikYxm h6Xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 93si2547137edj.475.2017.12.22.13.20.50; Fri, 22 Dec 2017 13:20:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 87515C21FAF; Fri, 22 Dec 2017 21:17:20 +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=none 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 8058DC21FC0; Fri, 22 Dec 2017 21:14:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 85D3BC22228; Fri, 22 Dec 2017 21:14:22 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 2EE72C21FF4 for ; Fri, 22 Dec 2017 21:14:19 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 58C05207C8; Fri, 22 Dec 2017 22:14:18 +0100 (CET) Received: from localhost.localdomain (unknown [80.12.41.248]) by mail.free-electrons.com (Postfix) with ESMTPSA id BBCBB203A1; Fri, 22 Dec 2017 22:14:17 +0100 (CET) From: Quentin Schulz To: jagan@openedev.com, maxime.ripard@free-electrons.com, hdegoede@redhat.com, sjg@chromium.org, wd@denx.de, andre.przywara@arm.com, lukma@denx.de Date: Fri, 22 Dec 2017 22:13:44 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Cc: thomas.petazzoni@free-electrons.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH 10/11] env: introducing env_info struct for storing info per env 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" To introduce the ability to use multiple environments at the same time, it is required to store a few information about each of the environment. Each environment has a different env_addr, "validity" (redund or main) and status of init (failed or succeeded). This structure is meant to be used in include/asm-generic/global_data.h and thus needs to be put out of the #ifndef DO_DEPS_ONLY. Signed-off-by: Quentin Schulz --- include/environment.h | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/include/environment.h b/include/environment.h index dd6450c..14df43f 100644 --- a/include/environment.h +++ b/include/environment.h @@ -183,20 +183,6 @@ extern uint mmc_get_env_part(struct mmc *mmc); # endif #endif -#ifndef DO_DEPS_ONLY - -#include -#include -#include -#include - -/* Value for environment validity */ -enum env_valid { - ENV_INVALID, /* No valid environment */ - ENV_VALID, /* First or only environment is valid */ - ENV_REDUND, /* Redundant environment is valid */ -}; - enum env_location { ENVL_EEPROM, ENVL_EXT4, @@ -215,6 +201,26 @@ enum env_location { ENVL_UNKNOWN, }; +/* Value for environment validity */ +enum env_valid { + ENV_INVALID, /* No valid environment */ + ENV_VALID, /* First or only environment is valid */ + ENV_REDUND, /* Redundant environment is valid */ +}; + +struct env_info { + unsigned long env_addr; + enum env_valid env_valid; + bool has_init; +}; + +#ifndef DO_DEPS_ONLY + +#include +#include +#include +#include + extern enum env_location env_locations[]; enum env_operation {