From patchwork Wed Jun 24 19:34:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Igal.Liberman" X-Patchwork-Id: 488190 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3D3071402C3 for ; Thu, 25 Jun 2015 05:54:33 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 23E091A1D85 for ; Thu, 25 Jun 2015 05:54:33 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bbn0108.outbound.protection.outlook.com [157.56.111.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 5A7D01A1DE3 for ; Thu, 25 Jun 2015 05:50:29 +1000 (AEST) Received: from BY2PR03CA053.namprd03.prod.outlook.com (10.141.249.26) by BL2PR03MB369.namprd03.prod.outlook.com (10.141.89.12) with Microsoft SMTP Server (TLS) id 15.1.207.12; Wed, 24 Jun 2015 19:35:26 +0000 Received: from BN1BFFO11FD022.protection.gbl (2a01:111:f400:7c10::1:140) by BY2PR03CA053.outlook.office365.com (2a01:111:e400:2c5d::26) with Microsoft SMTP Server (TLS) id 15.1.201.16 via Frontend Transport; Wed, 24 Jun 2015 19:35:26 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD022.mail.protection.outlook.com (10.58.144.85) with Microsoft SMTP Server (TLS) id 15.1.201.10 via Frontend Transport; Wed, 24 Jun 2015 19:35:07 +0000 Received: from B31950-11.fsl.freescale.net ([10.214.105.148]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t5OJYwn7017565; Wed, 24 Jun 2015 12:35:01 -0700 From: igal.liberman@freescale.com To: netdev@vger.kernel.org Subject: [v2,4/9] fsl/fman: Add FMan MURAM support Date: Wed, 24 Jun 2015 22:34:56 +0300 Message-ID: <1435174496-7472-1-git-send-email-igal.liberman@freescale.com> X-Mailer: git-send-email 1.9.5.msysgit.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD022; 1:AwzfUNBUlwxQP0i7k0LT23AFiCpc5+n+IlEL9TDHbllo8LaTFlugoF8airY29WMxe9wV/yTYsoOKd5fRFK/R/Fn/JyOgdziBGgJAlCGgzr8a0GF8llFlocPgm6iud1dNQD11zrXS7AbrdRFvjc+cMM1bGQ0qUy4+Ytoq/YSL3mRWDVOUDB8ja31HruUYDbihfjgPvlNgh5n5F+9iq9/tYxh+znadYvT5x/DPfbXOzVqIhvIiOLuPsHltq2p1JvLc9t2cJ6W3fHHnc4ZhjVagtjLbo6n2zCUN9yBaYSJ7eJppUrZObNIXkVHltg3sOIjzqQ0M16u79Qlym+eRCuKpvw== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(85782001)(77096005)(19580395003)(19580405001)(87936001)(85426001)(68736005)(50226001)(575784001)(86362001)(62966003)(77156002)(43066003)(229853001)(2351001)(106466001)(53806999)(50986999)(2361001)(107886002)(110136002)(5001960100002)(189998001)(4001540100001)(81156007)(97736004)(46102003)(33646002)(104016003)(5001860100001)(5001830100001)(48376002)(50466002)(105606002)(64706001)(47776003)(6806004)(36756003)(2004002)(85772001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR03MB369; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB369; 2:DJfYVrLLLe1IxuRRhdsN9xDOIY2GdxQ23toDBFLToAKSefh+pV1HU5dtJwoTLukZ; 3:3eTHtbs84q3Cswq4VsOEu4GWF7JvbKfO0mNlimFhhQmXHbJHJwBbk9AcWvHwDlVOnDiuMzNehfUwk2ERaMoM681+xasxvLxqUVoCV81iu8lRVtXJPveYYrHxascqAXeTz4PpgHPvSyAvOUB36zrGbkc7+s5MaJE9OKmLhDf1CKg+ARgGDma1v0jjVCUN76YsmAQQRCWmz2mNiOjySvasN3tBRp9zPtROr9Y/dfUPzXw=; 20:2Ibhwx3z+B3L5R0iTQqi9mjeGftUuR1YFobVwq+n8MhbDZbrD8oKwHAn/4Sm5i2y1RoQY8MRNKrSB7hxZNiCPm+J8i6u23N4d3e5Yc3AKO2jxrV/YQn6fZ7oq7OTLVeocSCktquPCRTDYE3xS3yXYLF5qGAQQLeyNLXvFOZacFOymX/9fGSPVycMfWSijodRd6DhpiO32iVLzz7EB028aYfK6OdSDaj/e12u0qmm+OUDcApJLEc+c7HtYpSwdWNKAT44r0nxsROMQ1T2/JHJR4jRACpyBr2EgOT+o0LDabjEi1S7eELeiX6smrzD8V81mqM2AIOVoaGdzQVMsg19Z7eROD96X14U3mMK9GouU6g=; 4:BCIm6e1brva2dMG8k32ngbKHnuxuA+hYSkFfXpL1gVPCxNphZ9jZLFrrdtAkqxi4AlnDVR0Od467NjWXm5h5FSzVzppzzrCKt5skUqCQcJjrjpGtd72jShjGmH/w9w+pKVnvcpkcOinpnQ4IGiS7eV6UyBt+GuoGj3gpcW29mLzMC6iPiNjiBDMvxQI3BVRnO1CfB4b3Ci/W1/YugFA3lzZz3HaFlfT1S+sLqrZijzuoZoDQCaAyntoJD+zpR3PoIQcqDznuwbTDRtTfxOFOK5doqSgELZYzIv8tlQjl1V4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB369; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BL2PR03MB369; BCL:0; PCL:0; RULEID:; SRVR:BL2PR03MB369; X-Forefront-PRVS: 061725F016 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB369; 23:ueI8ZkuO3iDkLZJnQDFU68g7cLWbV++8bHYrxDyfAw?= =?us-ascii?Q?jnEDd8GeDgOgnp3yGeCWAJ7Q+rmTNFSjgFUNXWYWL+0lItrV5w9zlmheVHCg?= =?us-ascii?Q?qcqr+yzxtvnFqhsqlnzrRoJXIPDG95SOrlOCNefGqaNszIcWtpeyOgCZMX4Z?= =?us-ascii?Q?8Zx9Ykr7D1GS3LPnDHNesRqewfPTdrKE8KwGa8dUuK1p/+R+un0Om91gLwcQ?= =?us-ascii?Q?SmNWyAhCrjAV+JSAHrZAUsKfZwH1rnNuuw2DlpTs6ZXdorunqvKDDhMbB2h8?= =?us-ascii?Q?emVmzsS9MiuwdBxKT/FNUTVmbxoOslH79GPC0HCeKaXnZ7gAxzfzhc325VEQ?= =?us-ascii?Q?iKgHZdF3hrKYY9as73fJoe/fMkjhET2UtaYTJtGasARU4NkNek991gMxdG+z?= =?us-ascii?Q?FtJY+DJ/SwNK8gXvzz+jxy19f3jlZwCiEts8+OHKvYbPFagFCMZ60V/Ny+Wo?= =?us-ascii?Q?xoYLkRptamq7NEhsGLHR2F3t5CFSsaKGkdQ54KUjx2exYfrrZnT6TQPc44jP?= =?us-ascii?Q?4VqiZQokIk2Gwdt2zyFCo7deW/+g1Oysej1FzymvU3iuNGnZMkbD7GRZBeJ8?= =?us-ascii?Q?GF4wybTEHCjTg8urbpCe7c9ZljMhdHUBcvUFo224a8SaljcCu4UbtptYt7CY?= =?us-ascii?Q?62hkRAxYGW9n61LQSD3i7+0Zv+C4qvrd7Ioqk5OI+j0e/PWVe43k8wZdzjLI?= =?us-ascii?Q?p71YWBfSm3M7vBMG53ekj+egRhZe+VhOj/Wwvq5z+bbmpWvm1lP0pZORcMYG?= =?us-ascii?Q?E5sEZEp1TaHvINZ8qKf4i1xA4nxEDMyXOXhlLfl/lXhNPA6giD5DhxO5PBcE?= =?us-ascii?Q?hMTkEfIuXlWK39rRBnNwKuZswGO9GnZc8I+1VoqmgQ1309Ha97xQOuHvh2Cf?= =?us-ascii?Q?F/quhRyQmZIEUuWqar5BIUnO7SPbM49B1vCMrFL1swzj7+sNVBfEs98oQh09?= =?us-ascii?Q?MshXFyge/3IGp3PClVD0uNYcfwkBzAWvkdnJWJ9PHr1ikyIZFZwlURk4ZJVC?= =?us-ascii?Q?deVsEx+acxLaEn7G+AWhMH+dqQxB8GNSiym0RE3wPGCZY7wtgxCrUagm02M6?= =?us-ascii?Q?Qw9gnEldiKj9E0VT/EAjG1Ot0Ygv6ywfdNmnef6yKGR1Bb1IPxK4OndZqBCw?= =?us-ascii?Q?6GH1fo4VVJZQh3YxS2KdOVe126/UCn8Q7+leIbOC1MT+kRHdwatfRRFdc/2w?= =?us-ascii?Q?pJeVSFqtZ/6I0eNogJcIto95hdeskhh7pI?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB369; 5:7Ad7+T5KXrDuaOW/pcAfKr9HmfumEED5w0OyQdCFpQbMWsqt5BFF2JUMk0LpDKp+YUTvFwmjgRCkSRExD1ayPEz7FTI5TqHBsMoGLYgeqA5Q4/s1OihBSnddGyU4F10EztqGKXnuTm7TiIMv2KfzSw==; 24:Y81HHPF3FeRfxtpl3MRdsc7ltoL+KAboHxpFyWphH5BQAR0JVfrYjbGrAdA48BWRHj5lh+D8lnjcwlFTjG71L+HB+CltiyF05zJ6B6F5LrU=; 20:0yldN+LnDo42A7svVn4uGHGKhA0Uy+BeGy2zsht0CJ7HoxJkbdkWHJSm+5vzXJlQ5vw6vMjqC/+AsYrneb4VkA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2015 19:35:07.0240 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB369 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: igal.liberman@freescale.com Cc: scottwood@freescale.com, Igal Liberman , pebolle@tiscali.nl, linuxppc-dev@lists.ozlabs.org, madalin.bucur@freescale.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Igal Liberman Add Frame Manager Multi-User RAM support. Signed-off-by: Igal Liberman --- drivers/net/ethernet/freescale/fman/Kconfig | 1 + drivers/net/ethernet/freescale/fman/Makefile | 6 +- drivers/net/ethernet/freescale/fman/fm_muram.c | 127 ++++++++++++++++++++ .../net/ethernet/freescale/fman/inc/fm_muram_ext.h | 112 +++++++++++++++++ 4 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 drivers/net/ethernet/freescale/fman/fm_muram.c create mode 100644 drivers/net/ethernet/freescale/fman/inc/fm_muram_ext.h diff --git a/drivers/net/ethernet/freescale/fman/Kconfig b/drivers/net/ethernet/freescale/fman/Kconfig index af42c3a..825a0d5 100644 --- a/drivers/net/ethernet/freescale/fman/Kconfig +++ b/drivers/net/ethernet/freescale/fman/Kconfig @@ -1,6 +1,7 @@ config FSL_FMAN bool "FMan support" depends on FSL_SOC || COMPILE_TEST + select GENERIC_ALLOCATOR default n help Freescale Data-Path Acceleration Architecture Frame Manager diff --git a/drivers/net/ethernet/freescale/fman/Makefile b/drivers/net/ethernet/freescale/fman/Makefile index 1841b03..55c91bd 100644 --- a/drivers/net/ethernet/freescale/fman/Makefile +++ b/drivers/net/ethernet/freescale/fman/Makefile @@ -1,8 +1,10 @@ -subdir-ccflags-y += -I$(srctree)/drivers/net/ethernet/freescale/fman/flib +subdir-ccflags-y += -I$(srctree)/drivers/net/ethernet/freescale/fman/flib \ + -I$(srctree)/drivers/net/ethernet/freescale/fman/inc \ + -I$(srctree)/drivers/net/ethernet/freescale/fman obj-y += fsl_fman.o -fsl_fman-objs := fman.o +fsl_fman-objs := fman.o fm_muram.o obj-y += port/ obj-y += mac/ diff --git a/drivers/net/ethernet/freescale/fman/fm_muram.c b/drivers/net/ethernet/freescale/fman/fm_muram.c new file mode 100644 index 0000000..f62042a --- /dev/null +++ b/drivers/net/ethernet/freescale/fman/fm_muram.c @@ -0,0 +1,127 @@ +/* + * Copyright 2008-2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* FM MURAM ... */ +#include "fm_muram_ext.h" + +#include +#include +#include +#include + +struct muram_info { + struct gen_pool *pool; + void __iomem *vbase; + uint64_t size; + phys_addr_t pbase; +}; + +struct muram_info *fm_muram_init(phys_addr_t base, uint64_t size) +{ + struct muram_info *p_muram; + void __iomem *vaddr; + int ret; + + p_muram = kzalloc(sizeof(*p_muram), GFP_KERNEL); + if (!p_muram) + return NULL; + + p_muram->pool = gen_pool_create(ilog2(64), -1); + if (!p_muram->pool) { + pr_err("%s(): MURAM pool create failed\n", __func__); + return NULL; + } + + vaddr = ioremap(base, size); + if (!vaddr) { + pr_err("%s(): MURAM ioremap failed\n", __func__); + return NULL; + } + + ret = gen_pool_add_virt(p_muram->pool, (unsigned long)vaddr, + base, size, -1); + if (ret < 0) { + pr_err("%s(): MURAM pool add failed\n", __func__); + iounmap(vaddr); + return NULL; + } + + memset_io(vaddr, 0, (int)size); + + p_muram->vbase = vaddr; + p_muram->pbase = base; + return p_muram; +} + +void fm_muram_free(struct muram_info *p_muram) +{ + /* Destroy pool */ + gen_pool_destroy(p_muram->pool); + /* Unmap memory */ + iounmap(p_muram->vbase); + /* Free pointer */ + kfree(p_muram); +} + +unsigned long fm_muram_vbase_to_offset(struct muram_info *p_muram, + unsigned long vaddr) +{ + return vaddr - (unsigned long)p_muram->vbase; +} + +unsigned long fm_muram_offset_to_vbase(struct muram_info *p_muram, + unsigned long offset) +{ + return offset + (unsigned long)p_muram->vbase; +} + +int fm_muram_alloc(struct muram_info *p_muram, uint32_t size) +{ + unsigned long vaddr; + + vaddr = gen_pool_alloc(p_muram->pool, size); + if (!vaddr) + return -ENOMEM; + + memset_io((void __iomem *)vaddr, 0, (int)size); + + return fm_muram_vbase_to_offset(p_muram, vaddr); +} + +void fm_muram_free_mem(struct muram_info *p_muram, uint32_t offset, + uint32_t size) +{ + unsigned long addr = fm_muram_offset_to_vbase(p_muram, offset); + + gen_pool_free(p_muram->pool, addr, size); +} + diff --git a/drivers/net/ethernet/freescale/fman/inc/fm_muram_ext.h b/drivers/net/ethernet/freescale/fman/inc/fm_muram_ext.h new file mode 100644 index 0000000..0cc83338 --- /dev/null +++ b/drivers/net/ethernet/freescale/fman/inc/fm_muram_ext.h @@ -0,0 +1,112 @@ +/* + * Copyright 2008-2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef __FM_MURAM_EXT +#define __FM_MURAM_EXT + +#include "linux/types.h" + +#define FM_MURAM_INVALID_ALLOCATION -1 + +/* Structure for FM MURAM information */ +struct muram_info; + +/** + * fm_muram_init + * @base: Pointer to base of memory mapped FM-MURAM. + * @size: Size of the FM-MURAM partition. + * + * Creates partition in the MURAM. + * The routine returns a pointer to the MURAM partition. + * This pointer must be passed as to all other FM-MURAM function calls. + * No actual initialization or configuration of FM_MURAM hardware is done by + * this routine. + * + * Return: pointer to FM-MURAM object, or NULL for Failure. + */ +struct muram_info *fm_muram_init(phys_addr_t base, uint64_t size); + +/** + * fm_muram_free + * @p_muram: FM-MURAM module pointer. + * + * Frees all resources that were assigned to FM-MURAM module. + * Calling this routine invalidates the pointer. + */ +void fm_muram_free(struct muram_info *p_muram); + +/** + * fm_muram_vbase_to_offset + * @p_muram: FM-MURAM module pointer. + * @vaddr: The virtual address of the memory block + * + * Gives the offset of the memory region in the MURAM + * + * Return: The offset of the memory block + */ +unsigned long fm_muram_vbase_to_offset(struct muram_info *p_muram, + unsigned long vaddr); + +/** + * fm_muram_vbase_to_offset + * @p_muram: FM-MURAM module pointer. + * @offset: the offset of the memory block + * + * Gives the address of the memory region from specific oddset + * + * Return: The address of the memory blocl + */ +unsigned long fm_muram_offset_to_vbase(struct muram_info *p_muram, + unsigned long offset); + +/** + * fm_muram_alloc + * @p_muram: FM-MURAM module pointer. + * @size: Size of the memory to be allocated. + * + * Allocate some memory from FM-MURAM partition. + * + * Return: address of the allocated memory; NULL otherwise. + */ +int fm_muram_alloc(struct muram_info *p_muram, uint32_t size); + +/** + * fm_muram_free_mem + * p_muram: FM-MURAM module pointer. + * offset: offset of the memory region to be freed. + * size: size of the memory to be freed. + * + * Free an allocated memory from FM-MURAM partition. + */ +void fm_muram_free_mem(struct muram_info *p_muram, uint32_t offset, + uint32_t size); + +#endif /* __FM_MURAM_EXT */