From patchwork Sat Aug 7 13:33:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1514680 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=rCLVSnvC; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=ZhubhB2p; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-sharedspace-onmicrosoft-com header.b=YLjXlfZL; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 4GhjxW14LGz9sRK for ; Sat, 7 Aug 2021 23:34:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V4oWH7SN/pqPWpniawqigrjbRD8K/JURnYZ589XhcV4=; b=rCLVSnvCxMLB5Y OtsIj6FshfzQjdOipBpoa+/savvDQPHkyMmo0Z0eo77vwZQ0z2O/Hp8o9RsNYBExT+0w8JyGH0GVO 0etdOHNmcy7Cw6CxozsSYgbsszRL/q/FNurujZToVELRS0+5y1M3lUaeOUV2G80wYzLnjHHu7yCBS MYa1jpbkxG9wRyEynZWe8tUl2GZ3NH9rm6x7QRxIf4u7ETUF539ePlwt3eqDk9JomoPjnVKpqCav+ oX9FrKgmF1USL+EzCpZFtylx3TMwZxxdu6ud5RvXpHQKO49PiPnIYvE75EwnRL9FhoIlT0mXb0cSJ xrAlQBZvGUmCZIBYoH2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCMSt-00Epj0-EG; Sat, 07 Aug 2021 13:34:15 +0000 Received: from esa4.hgst.iphmx.com ([216.71.154.42]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCMSq-00Epfd-3l for opensbi@lists.infradead.org; Sat, 07 Aug 2021 13:34:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1628343252; x=1659879252; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=rz1iwnWiQPLELi20WlvtoBAika+VokWI5YQb0p5aA7o=; b=ZhubhB2pmDcAn9IEN1WNRNNGiMQrDFmEHaCub5fIMhrpY2sqX4xP1VmK zp+uDmlOPl4XMogQJSwkC4LJOGgQ/q0rbxNG5zHs5rz6cSRIltcqbYUai D1gZOan83A4kffmh4c/AdeNY/9OriIbvuORO9VNKmXSwmK9mRzGEqT8LO lwrfKg/E4OFuwEu24DBVQTMDIdV/dHw8AF8x5DpQ118Qyavtvean0ldmd WlsQAjCE2x0j6NOf04vaJ43tqolIDH8NsZ6aeqGQhVbtTrBtr/sI+sQ6h Mf6+nFueBe6YUIjHeXQbwJc3FjBZ3nw+0UYJWL51HVYu/C7sOEcsPIsy1 A==; X-IronPort-AV: E=Sophos;i="5.84,301,1620662400"; d="scan'208";a="175779553" Received: from mail-bn8nam08lp2043.outbound.protection.outlook.com (HELO NAM04-BN8-obe.outbound.protection.outlook.com) ([104.47.74.43]) by ob1.hgst.iphmx.com with ESMTP; 07 Aug 2021 21:34:01 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XFGk5k+hu2itY1v6gMHLriNtF+h0BRfkhnK47p8vKU6GiOdca+h53v6VLBneuiU8T6DJRWMP58KfgnmYHmJGSErayQ5ET8NB5AobFDf1avSk0yyKEC0BkWlztkxAxe5p+blPWyJue7aGGuzq0RwaeGehRlHHnBGDYA8EO5QTc7bCDNUYb8a9c4omhcQIJWRgScEsULmXlCSHUKSnrHOLQrr/YuRjIhW4ulY5FFHVQNk4dBTk4mZUgkgonjqShV4/Xa5iszAikc6f4BkQPwZmHRke2bM4wZlv/Nt4+jXg46G04fGtHmbm7sOEJKXrvpxfnX/opzEbZxl+f3qrEvJZFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aeasbiOk6AFmGjRLDkgwuR48G1PE2JtcbZR1ozMe+0I=; b=M2Nubj7WPGrPhR/FQTYZ/aAIjftLsH2U/zwrzdoWxS8EjhEIGvxSjeBjzYEROEfWLx3SFwIMMJKPE1JTcq79A0QB6oBOYwSXRUO9eTqGVSWFWSKfl5ZDVt/44HHGn24wHfppO0HWqJxpUuS06Jf1ZGlR4GcNeXN0/tRgYWisxdlafXIycFllmUCPrmFoQOsASIK9FknS/PdcKD0gS0+qIRXmZFz/0zyCpVDJVQ6z94JpEevE3hF6SeYLcwYPrMz9FJMBscG3bu9YYFq+j+C4UviXPpE2pXl33JUSg09LVyZF+Cm72B52eyvjtMT7E34luQ4zAIUYgrbRYFcT9TFHgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aeasbiOk6AFmGjRLDkgwuR48G1PE2JtcbZR1ozMe+0I=; b=YLjXlfZL9vBTqwGwFi1R+wD1jvlJ73fHXkz8L1hzxYXXLtfcbKIwMQBoTXY1ljZTrYnQnw0hMwsCjmqRMFfNQbTwnThMuEh6xAoICX1D3MOZbfOD8Zf3FMHXxdIP8LaRJUNWiLgnjvxRuCGh1bl4Qz3Y4mok1L2wpKXRhFzlocU= Authentication-Results: wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7764.namprd04.prod.outlook.com (2603:10b6:303:138::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Sat, 7 Aug 2021 13:33:57 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::c9be:b1e1:60be:ef9d]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::c9be:b1e1:60be:ef9d%6]) with mapi id 15.20.4394.021; Sat, 7 Aug 2021 13:33:57 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH v2 2/5] lib: utils: Extend fdt_get_node_addr_size() for multiple register sets Date: Sat, 7 Aug 2021 19:03:19 +0530 Message-Id: <20210807133322.545675-3-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210807133322.545675-1-anup.patel@wdc.com> References: <20210807133322.545675-1-anup.patel@wdc.com> X-ClientProxiedBy: MAXPR0101CA0068.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::30) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.51.99) by MAXPR0101CA0068.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Sat, 7 Aug 2021 13:33:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 300ddb6a-186d-4fea-2513-08d959a801ec X-MS-TrafficTypeDiagnostic: CO6PR04MB7764: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K7ARR2ZkxO1MSEiCzlOPaR1dFECvVFdAM2OMRkvHC29JHmP2gSyW7efHz82ENDJdF7M79ZzjHcmS4IyA3Z2lcgXbzLd3DK5WSLhYyXFKzSw2i4E/RZAEyxFLzmfk4ggNsBLkkL/Wpf9//ooaA3fjQ0MKtZXquTJFUWutLpynNtNAkdGouifJvJ7lvXEFFRVq+Te6W4nIDWBgI6RfdrtLpUm9oo9h3NpMHZXf4tnuKpcHziJpeKoasOYVlZ8L4K9dBZvR0dUIh80vMC8fjQpmVO02q4fcHF9NsxTKh2uLLIxkoEkHxbE4GeZmynuZ8cYNKIJKqoCip7XO4RyW7qe9HAUh0NUyfLYjwdxWcuSxEE4/lGaoCmWzLkQ9uu1GPblZB2KTm9iR5+zYJkMq8SRe6epoBs2AJxqfJc9JTYFT8SnEoAxYyZL6suqxuC9+I3QvSVTesg6WcZYBgdmIuZpPpo1LmKMyGrC8u2Hk4VolhrqXURAo10RaYTpS5rS7ua0gs1b4RhTjeVVVgsVhBwwnFBToCAwp6eTAsFlSipTbF9SXfaX0gKk0ZYBiMcwtQwyabWkJmf1piXTKRz5Q6YCswsz+QbsOh9m/ZaBKvZK5oUDDamSBgcMPwQ5qCPpAU4R88FeT3a20y6CdTyxHAoipa1kOC4aMvuV62NkxfUVhjab/A0swg3E+Mm/A+5SA1B6Jh9iPCYsl+xuhO8WMq8oJtQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8886007)(54906003)(55016002)(2616005)(956004)(38100700002)(38350700002)(6666004)(36756003)(4326008)(86362001)(8676002)(6636002)(26005)(2906002)(44832011)(186003)(8936002)(1076003)(110136005)(316002)(7696005)(66476007)(52116002)(83380400001)(66946007)(508600001)(5660300002)(66556008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: W4vLidqyCJ+0JFZpgatz61oT6MUqVYpg1d+uZGEBE8lORPHeZoJRQTqwFzNsPPxC00xdhqVbgWzm0jc2PhJJvspXTRCqP5VpvA8viCqbPyY+H62wW0ZKyPnhe74jNVvF3uFNb28WvJOkv3j0Rc1RyPCFeNl6Coxg2M8Va0vZIGbkhKMVeqRKX5gJs9gVqWPb3S3RXboAeahUQ6P0GRMaiOOt3vz9GUWpfleJaDtGQ+LIG5cFI4fk49lu4D0TF6y5hBlUQCrE+bya8PRUWH+0u2EI3UIkHaS6ElLLZ8s5xTqlIos10hbYMke9PKXf2VtLXIEbGW4dUz/Jv16jNlorgfZwpe/HjoBOT8Mu4lYogxhP0FpP7ZGd09Hn/LtBpwE0FLiB3b6D/wYZX5egFid7XaLZJPqgxhga4hb9YLVfCZZrnqI49dRApEWLQ9Akv8Tf+pOdZ4o9aZ0ex+EIGrHkCgI4CODFhnjt0RdLalI4XrIacVmtekAtAYVYdjYHC3iKFZEOpLTNYef3MLK66F3hFpjqLglD5QlW2Qy21S+3270kLI2Y4mmlxp8mUUmHVytfFAuTKmYmwqM+PC5K1O91ADPNXmlEk1uTvqfLREAK9/YhvfvNsAN451aQgq16hIzPFC1D4qPWpNRdbh97f/mugJgc0YTo8nS8mfDJhgWhPdcnmdlmT07ebSjzMsMFbi2XWuQEHqz7Jj00hOwO7nnZuzbUNdG2j1PunTKgs0pVZ5iz7atZnQJTT/cMNIAYl81K66j4TLWqeaksaQ4PwNikpy9M+uXuUY1jPoXql2IUf4zOUQGCGzXPekb4F1amZImO+LNCOrnzhNLPxIIg1+Svis+NSRwqDHP/vv7XqzN40rnwDJFP4q8mdzKLQxEixHLKBpeNnjMPSeuQxoQlgz0RI6ybv8KYhZiIOxSCQ4YplalDi8hiRvvi7MIecl4HcfF1MKrN0r9Rfn05fwDLd1HJ9p7CEkw72FiBRORXAx5x5cXdVzynYxm320/gWpu65RSvCwxRjWdAjtdC9sx1hQ/ewEqQRnvI46vLXkYbg9ME4Rg2SE4TFNlHHEYxULk8xJ4JaeWbJFzf4rT4B7CDvzGw6RtuBe/pMozwn+/YJ6R0foMw9vXxctoreZ7TxjanGhHmIHU63w8M5sRkHM3rKSy2G4oHWuN6v2MIAzSb8OX6tK9BAGnnHb9rl7en7U+28BmgdLro+BBwChnSljkeRby48pInavhfThbG3Uj9s192zwDYwpjzOwGHtG8NQXTTH6FlYpG5EVT9Xzka+pag6GkhrQM2/2XfSHVF3GDOHKXkZYaAH+R3dY0GbZVkbDrZZgWI X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 300ddb6a-186d-4fea-2513-08d959a801ec X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2021 13:33:57.4482 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ncqzaVZ7FNuKAzHMxqEBAHQcYB4jzMzemXek38OGEzqg+NuRmXj1xcBtBBiAsCnwdFeVUD4yxOG0EXIQjsnFUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7764 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210807_063412_246494_6AB94836 X-CRM114-Status: GOOD ( 13.75 ) X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: We add "index" parameter to fdt_get_node_addr_size() API so that calling function can specify index of desired register set. This will allow fdt_get_node_addr_size() to handle DT nodes with multiple r [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.154.42 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We add "index" parameter to fdt_get_node_addr_size() API so that calling function can specify index of desired register set. This will allow fdt_get_node_addr_size() to handle DT nodes with multiple register sets. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- include/sbi_utils/fdt/fdt_helper.h | 4 ++-- lib/utils/fdt/fdt_helper.c | 31 ++++++++++++++++++------- lib/utils/gpio/fdt_gpio_sifive.c | 2 +- lib/utils/reset/fdt_reset_sifive_test.c | 2 +- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h index 32aebb4..1a93e1c 100644 --- a/include/sbi_utils/fdt/fdt_helper.h +++ b/include/sbi_utils/fdt/fdt_helper.h @@ -43,8 +43,8 @@ int fdt_parse_phandle_with_args(void *fdt, int nodeoff, const char *prop, const char *cells_prop, int index, struct fdt_phandle_args *out_args); -int fdt_get_node_addr_size(void *fdt, int node, uint64_t *addr, - uint64_t *size); +int fdt_get_node_addr_size(void *fdt, int node, int index, + uint64_t *addr, uint64_t *size); int fdt_parse_hart_id(void *fdt, int cpu_offset, u32 *hartid); diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c index a27f5ba..b68544f 100644 --- a/lib/utils/fdt/fdt_helper.c +++ b/lib/utils/fdt/fdt_helper.c @@ -157,13 +157,17 @@ static int fdt_translate_address(void *fdt, uint64_t reg, int parent, return 0; } -int fdt_get_node_addr_size(void *fdt, int node, uint64_t *addr, uint64_t *size) +int fdt_get_node_addr_size(void *fdt, int node, int index, + uint64_t *addr, uint64_t *size) { int parent, len, i, rc; int cell_addr, cell_size; const fdt32_t *prop_addr, *prop_size; uint64_t temp = 0; + if (!fdt || node < 0 || index < 0) + return SBI_EINVAL; + parent = fdt_parent_offset(fdt, node); if (parent < 0) return parent; @@ -178,6 +182,11 @@ int fdt_get_node_addr_size(void *fdt, int node, uint64_t *addr, uint64_t *size) prop_addr = fdt_getprop(fdt, node, "reg", &len); if (!prop_addr) return SBI_ENODEV; + + if ((len / sizeof(u32)) <= (index * (cell_addr + cell_size))) + return SBI_EINVAL; + + prop_addr = prop_addr + (index * (cell_addr + cell_size)); prop_size = prop_addr + cell_addr; if (addr) { @@ -270,7 +279,8 @@ int fdt_parse_gaisler_uart_node(void *fdt, int nodeoffset, if (nodeoffset < 0 || !uart || !fdt) return SBI_ENODEV; - rc = fdt_get_node_addr_size(fdt, nodeoffset, ®_addr, ®_size); + rc = fdt_get_node_addr_size(fdt, nodeoffset, 0, + ®_addr, ®_size); if (rc < 0 || !reg_addr || !reg_size) return SBI_ENODEV; uart->addr = reg_addr; @@ -308,7 +318,8 @@ int fdt_parse_shakti_uart_node(void *fdt, int nodeoffset, if (nodeoffset < 0 || !uart || !fdt) return SBI_ENODEV; - rc = fdt_get_node_addr_size(fdt, nodeoffset, ®_addr, ®_size); + rc = fdt_get_node_addr_size(fdt, nodeoffset, 0, + ®_addr, ®_size); if (rc < 0 || !reg_addr || !reg_size) return SBI_ENODEV; uart->addr = reg_addr; @@ -342,7 +353,8 @@ int fdt_parse_sifive_uart_node(void *fdt, int nodeoffset, if (nodeoffset < 0 || !uart || !fdt) return SBI_ENODEV; - rc = fdt_get_node_addr_size(fdt, nodeoffset, ®_addr, ®_size); + rc = fdt_get_node_addr_size(fdt, nodeoffset, 0, + ®_addr, ®_size); if (rc < 0 || !reg_addr || !reg_size) return SBI_ENODEV; uart->addr = reg_addr; @@ -380,7 +392,8 @@ int fdt_parse_uart8250_node(void *fdt, int nodeoffset, if (nodeoffset < 0 || !uart || !fdt) return SBI_ENODEV; - rc = fdt_get_node_addr_size(fdt, nodeoffset, ®_addr, ®_size); + rc = fdt_get_node_addr_size(fdt, nodeoffset, 0, + ®_addr, ®_size); if (rc < 0 || !reg_addr || !reg_size) return SBI_ENODEV; uart->addr = reg_addr; @@ -440,7 +453,8 @@ int fdt_parse_plic_node(void *fdt, int nodeoffset, struct plic_data *plic) if (nodeoffset < 0 || !plic || !fdt) return SBI_ENODEV; - rc = fdt_get_node_addr_size(fdt, nodeoffset, ®_addr, ®_size); + rc = fdt_get_node_addr_size(fdt, nodeoffset, 0, + ®_addr, ®_size); if (rc < 0 || !reg_addr || !reg_size) return SBI_ENODEV; plic->addr = reg_addr; @@ -481,7 +495,8 @@ int fdt_parse_aclint_node(void *fdt, int nodeoffset, bool for_timer, !out_first_hartid || !out_hart_count) return SBI_EINVAL; - rc = fdt_get_node_addr_size(fdt, nodeoffset, ®_addr, ®_size); + rc = fdt_get_node_addr_size(fdt, nodeoffset, 0, + ®_addr, ®_size); if (rc < 0 || !reg_addr || !reg_size) return SBI_ENODEV; *out_addr = reg_addr; @@ -543,7 +558,7 @@ int fdt_parse_compat_addr(void *fdt, uint64_t *addr, if (nodeoffset < 0) return nodeoffset; - rc = fdt_get_node_addr_size(fdt, nodeoffset, addr, NULL); + rc = fdt_get_node_addr_size(fdt, nodeoffset, 0, addr, NULL); if (rc < 0 || !addr) return SBI_ENODEV; diff --git a/lib/utils/gpio/fdt_gpio_sifive.c b/lib/utils/gpio/fdt_gpio_sifive.c index 00d3e14..677f0fa 100644 --- a/lib/utils/gpio/fdt_gpio_sifive.c +++ b/lib/utils/gpio/fdt_gpio_sifive.c @@ -77,7 +77,7 @@ static int sifive_gpio_init(void *fdt, int nodeoff, u32 phandle, return SBI_ENOSPC; chip = &sifive_gpio_chip_array[sifive_gpio_chip_count]; - rc = fdt_get_node_addr_size(fdt, nodeoff, &addr, NULL); + rc = fdt_get_node_addr_size(fdt, nodeoff, 0, &addr, NULL); if (rc) return rc; diff --git a/lib/utils/reset/fdt_reset_sifive_test.c b/lib/utils/reset/fdt_reset_sifive_test.c index b0b59e7..7e0eba3 100644 --- a/lib/utils/reset/fdt_reset_sifive_test.c +++ b/lib/utils/reset/fdt_reset_sifive_test.c @@ -18,7 +18,7 @@ static int sifive_test_reset_init(void *fdt, int nodeoff, int rc; uint64_t addr; - rc = fdt_get_node_addr_size(fdt, nodeoff, &addr, NULL); + rc = fdt_get_node_addr_size(fdt, nodeoff, 0, &addr, NULL); if (rc) return rc;