From patchwork Thu Jun 26 14:15:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Przemyslaw Marczak X-Patchwork-Id: 364553 X-Patchwork-Delegate: promsoft@gmail.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 AE25814008B for ; Fri, 27 Jun 2014 00:17:28 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B82BDA775D; Thu, 26 Jun 2014 16:17:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 W4AOe0ahs7AH; Thu, 26 Jun 2014 16:17:04 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7BB8EA7737; Thu, 26 Jun 2014 16:16:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D0EDDA772B for ; Thu, 26 Jun 2014 16:16:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 iY5OPLLqYckG for ; Thu, 26 Jun 2014 16:16:06 +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 mailout4.w1.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by theia.denx.de (Postfix) with ESMTPS id 7FE67A771C for ; Thu, 26 Jun 2014 16:16:02 +0200 (CEST) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N7S007QZ4YCNOB0@mailout4.w1.samsung.com> for u-boot@lists.denx.de; Thu, 26 Jun 2014 15:15:48 +0100 (BST) X-AuditID: cbfec7f4-b7fac6d000006cfe-d7-53ac2b1bda9b Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 12.98.27902.B1B2CA35; Thu, 26 Jun 2014 15:15:55 +0100 (BST) Received: from AMDC1186.digital.local ([106.116.147.185]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N7S00E7W4YB8V60@eusync2.samsung.com>; Thu, 26 Jun 2014 15:15:55 +0100 (BST) From: Przemyslaw Marczak To: u-boot@lists.denx.de Date: Thu, 26 Jun 2014 16:15:34 +0200 Message-id: <1403792137-3113-9-git-send-email-p.marczak@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1403792137-3113-1-git-send-email-p.marczak@samsung.com> References: <1402566394-23342-1-git-send-email-p.marczak@samsung.com> <1403792137-3113-1-git-send-email-p.marczak@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFJMWRmVeSWpSXmKPExsVy+t/xK7rS2muCDfbvVbfY9fc+o8WNX22s Fm8ebma06DjSwmix4/INFot1T9ayWrzd28nuwO5x9s4ORo++LasYA5iiuGxSUnMyy1KL9O0S uDJunFnOUjCRp6Ln2Ar2BsZZXF2MnBwSAiYSm/5uYoGwxSQu3FvP1sXIxSEksJRRYseKa0wQ Th+TxKsVB1hBqtgEDCT2XDrDDGKLCEhI/Oq/yghSxCzwlVHiwYanYAlhgViJ/z0dYDaLgKrE ln+PwGxeAReJp1vnskKsk5M4eWwymM0p4Cqxbec5VohtDYwST67sYp3AyLuAkWEVo2hqaXJB cVJ6rqFecWJucWleul5yfu4mRkj4fNnBuPiY1SFGAQ5GJR5eibmrg4VYE8uKK3MPMUpwMCuJ 8B6TWhMsxJuSWFmVWpQfX1Sak1p8iJGJg1OqgVGd86Gw6wFH8yvXPNpmNrTdanpb2vRGuVfA qi5dKnPixo6rR/1LLdavnfLqec2PepvFNxtzBU4IM7OvX2cQ1NKlrLiv7lf1pgvtL5jDlgQt UDhqyaC+UtsoiG9qYHcz/74HTK1bD367dWeK/0QFAS3GzN+CFarWH/LzL7UmGq7c/OR0qvav mUosxRmJhlrMRcWJAPrU00f9AQAA Cc: Piotr Wilczek , Jaehoon Chung , Przemyslaw Marczak Subject: [U-Boot] [PATCH v3 08/11] samsung: misc: use board specific functions to set env board info X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This change adds setup of environmental board info using get_board_name() and get_board_type() functions for config CONFIG_BOARD_TYPES. This is useful in case of running many boards with just one config. Signed-off-by: Przemyslaw Marczak Cc: Piotr Wilczek Cc: Minkyu Kang --- Changes v2: - set_board_info: move the bdtype pointer to avoid unused pointer compilation warning Changes v3: - samsung: misc: change get_board_type_fdt() to get_board_type() - samsung: misc: set env $boardname using get_board_* functions for CONFIG_BOARD_TYPES - update commit msg --- board/samsung/common/misc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c index 166ea83..fca1fed 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -74,8 +74,17 @@ void set_board_info(void) setenv("board_rev", info); #endif #ifdef CONFIG_OF_LIBFDT - snprintf(info, ARRAY_SIZE(info), "%s%x-%s.dtb", - CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD); + const char *bdtype = ""; + const char *bdname = CONFIG_SYS_BOARD; + +#ifdef CONFIG_BOARD_TYPES + bdtype = get_board_type(); + bdname = get_board_name(); + sprintf(info, "%s%s", bdname, bdtype); + setenv("boardname", info); +#endif + snprintf(info, ARRAY_SIZE(info), "%s%x-%s%s.dtb", + CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype); setenv("fdtfile", info); #endif }