From patchwork Sun Sep 27 12:36:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1372043 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=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=Ps8/vi0+; 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 4BzlWv2ynHz9sPB for ; Sun, 27 Sep 2020 22:36:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7D24182374; Sun, 27 Sep 2020 14:36:28 +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="Ps8/vi0+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 040AE82377; Sun, 27 Sep 2020 14:36:25 +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.18]) (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 647708235C for ; Sun, 27 Sep 2020 14:36:22 +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=1601210179; bh=meut2PDpoQoCqbAhzTy274uXCTxItxYvO8jUYxkGYTI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Ps8/vi0+sEYfYvMXDlR5wqxNkYZhJCCEpVHoWm5ow+IkxZ1IL6gC7P9x136GpxiJ5 f8+F8dq8w20A1PuAiEAQwft2ejuOpClWOH96jV2jz3qzxdUT5NYupeamjNNIawMm09 tGxbNfiyxy9UVtyhRyvo+rYy6goqgsJ6j2BBYOBU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([178.202.41.107]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MbzyP-1kzhU41s35-00dYvH; Sun, 27 Sep 2020 14:36:19 +0200 From: Heinrich Schuchardt To: Tom Rini Cc: Simon Glass , Ilias Apalodimas , Peng Fan , Bin Meng , Masahiro Yamada , Baruch Siach , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH v3 1/3] global_data.h: convert GD_FLG_* to enum Date: Sun, 27 Sep 2020 14:36:07 +0200 Message-Id: <20200927123609.37517-2-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200927123609.37517-1-xypron.glpk@gmx.de> References: <20200927123609.37517-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:sBeLNt2hE1ioZprZb+wAN6gOc8vDw4eXf4+rljxAb2qbFNlWrNZ xRlQzqnsp7StAfWz9hTNQCVkiowkxe9b3MEdi99nwAs2kVvcFyz8Jpi0H03xApa9fLH0B+L VCqbP512E+nya6E8DDDo6aWW/I0rcsgQY1w0nlRbGpGE5ljEkhK7jkRn1Xz/ls+X72VdRyp gK4KlH/ore9S8uynu7H5Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:atQLNda5CL0=:HDRF2UPo6UMlqlme2SbhLx Lg6gidxyodMCgTDdIskRIr8R36YZf9OK6nL/uy2Z4k1EOYPPFC18E5fXmi4tMRKrj7leQcVip mkpU0SrtX+4Pc2wY/NgomvUKYF97HNqUHLIFqWe6u6fdemAVXa3i1RVoAsHyP3nkWOAC/n2WI 8nqWNTI0mRj/9MWIUiBs2JVYVk4GRvdlHMX7MbaQGPkyM/GtJJ4OTK/Eisw2CWZwUfqhbSX0T 7F7BNswLc6u80afc1u1ommsmI9GPXcn/n5DcYN1mOlQo3GWSA50Ycy+2/yUdyWl9vkHK3SXQ3 ScbD0N8sOWU/FJsFJrWDCAq3ouWadxO94nnMmLsfdxOwCIwkvkQKfyKlmUY0JLW+40mREDqD0 2A0q3VoMFH+0zQsHhcBrrUc5NdUSAkdbYhZDI5VeGwosSshfWSTAVnw6pvUuI4lnXiJF78TdG nOXYkHZ7MUydrUnf7EUhLcZ5Ophbj4igKRxK8LeBkCUkROQOHilH3h+y9e68Gp9+sDQ9cvgbQ ZiRqvre/7RqeRCloxFKift0+yHTROQg0caT9+2yntpKwB2orEKeRlPTW/FLQrVwCmsBQ/PgYR Y2XTOJ8cAJWRdr4U1TpiWVeqaBkDBRlpJzLiWPHAG6rWAw/N5Sv+MiH8pPL46raC1p9tG/1zI 7sXIkPljrTo4b//a5riaOBJnkqVaqCR9LrmEHyeLmOESj/fnZ2yPrr4BWum6BeScOnX1yFnUg 2HwmDhCqSvkUuQz9jcKkEjdbAFVq5G3hLwSDHzsfAXv1FWJ4IpoOPLgJ0T2i+DyCm7ahchHlY mFl/Yp/SbGnMS7nJ3YGEbvLtlSbMkVQLYWp6cC75CETlriRSqqvvwQIUcZZSv4N9KkUBtlgsP +bdjI+aCLekeCxnDIN5noz3bS9UjhWOJaTpOAAo8gyF4l0Kn7rblOm7wLgRlaOI3/9QVeKhf2 a4ZLy1fFPENFkqyAoBD28+Hm+zi98RI3Cx8zZnyx6Ud0z4xyrywT5bz4jwun7Mtztxr7qaGL3 TBgj2QqJt6nKHi24EGRACF5ezhjDom/WMXlmHqM3JvFVAD5mf8DS5JZJbD2La8SzvOGQhqsMD PjK6nVciCJLZtF/i/ihrV539u7+I/ukJIVYHT9MZ9m68QXsHfjnsFTsiz8Xla9jbBdC/tYLW6 ZusPPmgBaIVk0JOWcO18h5uItnjy4fwjp85ocBYpgAW4scf5a32FNDggbo/+owwCw8mA0GiR2 AQWsheXu5QzPyEu2wt0cLAGJFL2Y60qnnYkItPg== 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 --- v3: no change 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 */