From patchwork Thu Aug 31 06:45:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Carvalho X-Patchwork-Id: 808047 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xjXwH3Pb0z9s7F for ; Thu, 31 Aug 2017 16:46:39 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xjXwH2clqzDqXs for ; Thu, 31 Aug 2017 16:46:39 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xjXvq4VlPzDqGZ for ; Thu, 31 Aug 2017 16:46:15 +1000 (AEST) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v7V6hm15112044 for ; Thu, 31 Aug 2017 02:46:13 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2cp98rrbw1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 31 Aug 2017 02:46:13 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Aug 2017 00:46:12 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 31 Aug 2017 00:46:10 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v7V6kA465570932 for ; Wed, 30 Aug 2017 23:46:10 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6618F78038 for ; Thu, 31 Aug 2017 00:46:10 -0600 (MDT) Received: from legolas.ibm.com (unknown [9.85.193.48]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id BBEEB7803F for ; Thu, 31 Aug 2017 00:46:09 -0600 (MDT) From: Claudio Carvalho To: skiboot@lists.ozlabs.org Date: Thu, 31 Aug 2017 03:45:49 -0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504161961-12190-1-git-send-email-cclaudio@linux.vnet.ibm.com> References: <1504161961-12190-1-git-send-email-cclaudio@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17083106-0016-0000-0000-000007720C5B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007640; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000226; SDB=6.00910085; UDB=6.00456503; IPR=6.00690365; BA=6.00005562; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016938; XFM=3.00000015; UTC=2017-08-31 06:46:11 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17083106-0017-0000-0000-00003B4739E7 Message-Id: <1504161961-12190-2-git-send-email-cclaudio@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-31_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1708310102 Subject: [Skiboot] [PATCH 01/13] core/flash: extern function to get the name of a PNOR partition X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This adds the flash_map_resource_name() to allow other skiboot subsystems to lookup the name of a PNOR partition. With this we don't need to duplicate the same information in other places (e.g. libstb). Signed-off-by: Claudio Carvalho --- core/flash.c | 10 ++++++++++ include/skiboot.h | 1 + 2 files changed, 11 insertions(+) diff --git a/core/flash.c b/core/flash.c index 53e6eba..90402ef 100644 --- a/core/flash.c +++ b/core/flash.c @@ -424,6 +424,16 @@ static struct { { RESOURCE_ID_IMA_CATALOG, RESOURCE_SUBID_SUPPORTED, "IMA_CATALOG" }, }; +char *flash_map_resource_name(enum resource_id id) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(part_name_map); i++) { + if (part_name_map[i].id == id) + return part_name_map[i].name; + } + return NULL; +} static size_t sizeof_elf_from_hdr(void *buf) { diff --git a/include/skiboot.h b/include/skiboot.h index 4b7d519..06d681e 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -243,6 +243,7 @@ extern int flash_subpart_info(void *part_header, uint32_t header_len, uint32_t part_size, uint32_t *part_actual, uint32_t subid, uint32_t *offset, uint32_t *size); +extern char *flash_map_resource_name(enum resource_id id); /* NVRAM support */ extern void nvram_init(void); extern void nvram_read_complete(bool success);