From patchwork Tue Aug 18 14:03:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume GARDET X-Patchwork-Id: 508330 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id F05FD1406A9 for ; Wed, 19 Aug 2015 00:04:17 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 252084B715; Tue, 18 Aug 2015 16:04:16 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F-2JDAmsmisN; Tue, 18 Aug 2015 16:04:15 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C38F4B6E0; Tue, 18 Aug 2015 16:04:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 59F094B6E0 for ; Tue, 18 Aug 2015 16:04:09 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vN4T14PqjIcp for ; Tue, 18 Aug 2015 16:04:09 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by theia.denx.de (Postfix) with ESMTPS id 2483A4B65A for ; Tue, 18 Aug 2015 16:04:05 +0200 (CEST) Received: from OLI01.site (unknown [82.244.147.214]) by smtp2-g21.free.fr (Postfix) with ESMTP id 7037D4B0078; Tue, 18 Aug 2015 16:04:04 +0200 (CEST) From: Guillaume GARDET To: u-boot@lists.denx.de Date: Tue, 18 Aug 2015 16:03:55 +0200 Message-Id: <1439906635-28191-1-git-send-email-guillaume.gardet@free.fr> X-Mailer: git-send-email 1.8.4.5 Cc: Guillaume GARDET Subject: [U-Boot] [PATCH] ARM: rpi: Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support to set 'board_rev' and 'board_name' envs. Signed-off-by: Guillaume GARDET Cc: Stephen Warren --- board/raspberrypi/rpi/rpi.c | 6 ++++++ include/configs/rpi-common.h | 1 + 2 files changed, 7 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index d21750e..b61ff67 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -240,6 +240,12 @@ int misc_init_r(void) { set_fdtfile(); set_usbethaddr(); +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + char str_rev[11]; + sprintf(str_rev, "0x%X", rpi_board_rev); + setenv("board_rev", str_rev); + setenv("board_name", models[rpi_board_rev].name); +#endif return 0; } diff --git a/include/configs/rpi-common.h b/include/configs/rpi-common.h index 8830a10..17237cf 100644 --- a/include/configs/rpi-common.h +++ b/include/configs/rpi-common.h @@ -133,6 +133,7 @@ #include /* Environment */ +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define ENV_DEVICE_SETTINGS \ "stdin=serial,lcd\0" \ "stdout=serial,lcd\0" \