From patchwork Sun Sep 20 08:04:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1367807 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=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=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=LPN0WfQI; 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 4BvKqb2XjTz9sSf for ; Sun, 20 Sep 2020 18:04:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 750B982476; Sun, 20 Sep 2020 10:04:45 +0200 (CEST) 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="LPN0WfQI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4746082469; Sun, 20 Sep 2020 10:04:44 +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.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.15.19]) (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 BF3AE8243F for ; Sun, 20 Sep 2020 10:04:41 +0200 (CEST) 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=1600589078; bh=qHXL9/RWP8HE0kiylUiEuLoC3GOftr+ldU9yZcPf950=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=LPN0WfQIlTJDxfjaO8XQfugOoJRb6Zg0HIToba1fIKT8GWgzjIg3OEPzdwtzgeWb1 kx9SSh9UMV58R8QMoYHa8coBItPYBaRpwgIGQ09VrAlIQWBIDb7JRim1iL61IT6G6c Qnsz9hWF/ro3vFdkYbApPBvmebQiY2QhT857RMi8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([178.202.41.107]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MXGvM-1jyZKt3cnW-00Yl56; Sun, 20 Sep 2020 10:04:37 +0200 From: Heinrich Schuchardt To: Tom Rini Cc: Ilias Apalodimas , Simon Glass , Peng Fan , Bin Meng , Wolfgang Wallner , Baruch Siach , Masahiro Yamada , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH v2 1/3] global_data.h: convert GD_FLG_* to enum Date: Sun, 20 Sep 2020 10:04:28 +0200 Message-Id: <20200920080430.7676-2-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200920080430.7676-1-xypron.glpk@gmx.de> References: <20200920080430.7676-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Rrjw+lMusTLUqeHuwUv2b7FLjQX6lmlcg1SDWJRPfUZc+HevfBc G91opFvjWHD2PZTsW0ZGgvTgJrJaB32JwTSxxyLxgl2TXd25TpWvu7vkXZuf5ByODwFkADy mA2x5IeiVnXgpUhSsJtye2TzIhxZNDdBR2SReYiIwLcrXlbV/Y3e6gInF9I3Dzm1I7Ylvjf piUofEOmNfbZWNxNtMAnA== X-UI-Out-Filterresults: notjunk:1;V03:K0:1OnC6oxsN1o=:zMXzLwtfinFiMPmrIsEksW dsKiJ+WSBNWxcyODnUgO6bQu0WJTA4g75r/3HVUL7UhSKklJVNBJrAdwlJdWY457SHzHyPY8I dEhUzaBmcOgY/WCsm9F+Ktja+z75+Pb2Q2SLoOy+LoymosP8Nfq3K42zaJ9DTsnLiXBP5gWDa fmYqlB3GrGWFpb/008G3qyO8XiHQUSAF7+TSkwWTPZHHWAAtUGBjMjVDm89AODcQ73H5M/VlN RU8jWfoKhpEmYkyBViLbCeLb3eTB7o9ROxiiMOa43K5JmfmZaonQDUfBPhoBZY8nkdR5j2Lgk 1Lrd4FMuxBR38ZcXkBM0vMd7aZpw2cbAO2g2U6UwzXCy8ZaehPYlZP4mK+lfyIf9Q/CgZnagF WAuL4kRgrf4UlbOaL5Zb+sMhxjN7rZneqnwEulQtSH0ZSq7ck6NrJB8rh12upFFF8vNy6cr9g SPdGko2KztnBu29D10sYHCyyICynop7iVUKFMROQ8XNOT92548CR1fA6wXbQynPTsVHnSwNd9 QszRTJUFgcHkkcOUeVU5JbZsBzNu//IXgSnUvgBSu7zu+PS6tdbc6iIjF78J2rQu9R3qcbJcp WksY4M4Kyacs7O5R53RGuBq7gCYybIi/Xc0BFOu8QOb0hWDOnpOCFB5TBwyfaG8CP2mMLejg4 BRQLNRkYEP3desWQw/fNuxOLdaItzrljXOWPaH1nq2Gr5xckB/emsUNPKaUhZzdzedxfdJ48s QPME3jiVBKgmgszbxNhJArag+OS/9HJz2QV/o+k/MNJKgjBv4P7+5hA+zLh28GKXsQAcOI/0D jTnamMN0y3RwaIdfmUfqgi+bXSvdGRhXqmUmNNs4YMClKZZtmeIl5GJcqjroeUR9rHdAIc9PN WPAsU/FGaZhicumsGHifWRNGvhXUIMEjGiKSAK2ySurGBAxfONYdpFhsJwwmV5u8GFKk8vudC MAUjT3YAP7yejPUE4x9NiM/AGjBUo//ODoDoBo+IcNC7trEqOsiBwSvGHYAITwSMXmYgOV8Hm artIfJegkCjbqXhAL8m+pHdwfWl+DMIdviweRp72SJQ/tLa2prs5zn+zamZzPFARUbDue3MnX dDB0LJkTJc8x96Kz3843082qNBqchWG8joKeOVGZA2s6reGnfLdtAG0/UUKmx/ARWjxPtFCAs cpzfvNc/8kznbxyoRgrWuM63qHo965I4ghPfPessek1opwjGIJemZ2zPcj7rsxFACcQZsPvWu B0zObGbuKIuDKz1x8vs+9tSiC5uThPA5wVvB5Dw== 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 Sphinx documentation is only available for enums not for #defines. Anyway it is better to keep related definitions in an enum. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- v2: enum gd_flags must not be exposed to assembler code --- include/asm-generic/global_data.h | 106 +++++++++++++++++++++++------- 1 file changed, 84 insertions(+), 22 deletions(-) -- 2.28.0 diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index d4a4e2215d..e4a68e0d91 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -138,7 +138,6 @@ typedef struct global_data { struct udevice *watchdog_dev; #endif } gd_t; -#endif #ifdef CONFIG_BOARD_TYPES #define gd_board_type() gd->board_type @@ -146,27 +145,90 @@ typedef struct global_data { #define gd_board_type() 0 #endif -/* - * Global Data Flags +/** + * enum gd_flags - global data flags + * + * See field flags of &struct global_data. */ -#define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */ -#define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */ -#define GD_FLG_SILENT 0x00004 /* Silent mode */ -#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */ -#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */ -#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */ -#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */ -#define GD_FLG_ENV_READY 0x00080 /* Env. imported into hash table */ -#define GD_FLG_SERIAL_READY 0x00100 /* Pre-reloc serial console ready */ -#define GD_FLG_FULL_MALLOC_INIT 0x00200 /* Full malloc() is ready */ -#define GD_FLG_SPL_INIT 0x00400 /* spl_init() has been called */ -#define GD_FLG_SKIP_RELOC 0x00800 /* Don't relocate */ -#define GD_FLG_RECORD 0x01000 /* Record console */ -#define GD_FLG_ENV_DEFAULT 0x02000 /* Default variable flag */ -#define GD_FLG_SPL_EARLY_INIT 0x04000 /* Early SPL init is done */ -#define GD_FLG_LOG_READY 0x08000 /* Log system is ready for use */ -#define GD_FLG_WDT_READY 0x10000 /* Watchdog is ready for use */ -#define GD_FLG_SKIP_LL_INIT 0x20000 /* Don't perform low-level init */ -#define GD_FLG_SMP_READY 0x40000 /* SMP init is complete */ +enum gd_flags { + /** + * @GD_FLG_RELOC: code was relocated to RAM + */ + GD_FLG_RELOC = 0x00001, + /** + * @GD_FLG_DEVINIT: devices have been initialized + */ + GD_FLG_DEVINIT = 0x00002, + /** + * @GD_FLG_SILENT: silent mode + */ + GD_FLG_SILENT = 0x00004, + /** + * @GD_FLG_POSTFAIL: critical POST test failed + */ + GD_FLG_POSTFAIL = 0x00008, + /** + * @GD_FLG_POSTSTOP: POST sequence aborted + */ + GD_FLG_POSTSTOP = 0x00010, + /** + * @GD_FLG_LOGINIT: log Buffer has been initialized + */ + GD_FLG_LOGINIT = 0x00020, + /** + * @GD_FLG_DISABLE_CONSOLE: disable console (in & out) + */ + GD_FLG_DISABLE_CONSOLE = 0x00040, + /** + * @GD_FLG_ENV_READY: environment imported into hash table + */ + GD_FLG_ENV_READY = 0x00080, + /** + * @GD_FLG_SERIAL_READY: pre-relocation serial console ready + */ + GD_FLG_SERIAL_READY = 0x00100, + /** + * @GD_FLG_FULL_MALLOC_INIT: full malloc() is ready + */ + GD_FLG_FULL_MALLOC_INIT = 0x00200, + /** + * @GD_FLG_SPL_INIT: spl_init() has been called + */ + GD_FLG_SPL_INIT = 0x00400, + /** + * @GD_FLG_SKIP_RELOC: don't relocate + */ + GD_FLG_SKIP_RELOC = 0x00800, + /** + * @GD_FLG_RECORD: record console + */ + GD_FLG_RECORD = 0x01000, + /** + * @GD_FLG_ENV_DEFAULT: default variable flag + */ + GD_FLG_ENV_DEFAULT = 0x02000, + /** + * @GD_FLG_SPL_EARLY_INIT: early SPL initialization is done + */ + GD_FLG_SPL_EARLY_INIT = 0x04000, + /** + * @GD_FLG_LOG_READY: log system is ready for use + */ + GD_FLG_LOG_READY = 0x08000, + /** + * @GD_FLG_WDT_READY: watchdog is ready for use + */ + GD_FLG_WDT_READY = 0x10000, + /** + * @GD_FLG_SKIP_LL_INIT: don't perform low-level initialization + */ + GD_FLG_SKIP_LL_INIT = 0x20000, + /** + * @GD_FLG_SMP_READY: SMP initialization is complete + */ + GD_FLG_SMP_READY = 0x40000, +}; + +#endif /* __ASSEMBLY__ */ #endif /* __ASM_GENERIC_GBL_DATA_H */