From f8b73ad2e16934621a86fd1fd67b46aa21521d0b Mon Sep 17 00:00:00 2001 From: Juli Mallett Date: Sun, 11 Mar 2012 04:14:00 +0000 Subject: Import Cavium Octeon SDK 2.3.0 Simple Executive from cnusers.org. --- cvmx-fpa.h | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'cvmx-fpa.h') diff --git a/cvmx-fpa.h b/cvmx-fpa.h index 88de80596a84..45210a17a49b 100644 --- a/cvmx-fpa.h +++ b/cvmx-fpa.h @@ -1,5 +1,5 @@ /***********************license start*************** - * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). All rights + * Copyright (c) 2003-2010 Cavium Inc. (support@cavium.com). All rights * reserved. * * @@ -15,7 +15,7 @@ * disclaimer in the documentation and/or other materials provided * with the distribution. - * * Neither the name of Cavium Networks nor the names of + * * Neither the name of Cavium Inc. nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written * permission. @@ -26,7 +26,7 @@ * countries. * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" - * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR + * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM @@ -43,7 +43,7 @@ * * Interface to the hardware Free Pool Allocator. * - *
$Revision: 50048 $
+ *
$Revision: 70030 $
* */ @@ -145,7 +145,12 @@ static inline void cvmx_fpa_enable(void) status.u64 = cvmx_read_csr(CVMX_FPA_CTL_STATUS); if (status.s.enb) { - cvmx_dprintf("Warning: Enabling FPA when FPA already enabled.\n"); + /* + * CN68XXP1 should not reset the FPA (doing so may break the + * SSO, so we may end up enabling it more than once. Just + * return and don't spew messages. + */ + return; } status.u64 = 0; @@ -153,6 +158,19 @@ static inline void cvmx_fpa_enable(void) cvmx_write_csr(CVMX_FPA_CTL_STATUS, status.u64); } +/** + * Reset FPA to disable. Make sure buffers from all FPA pools are freed + * before disabling FPA. + */ +static inline void cvmx_fpa_disable(void) +{ + cvmx_fpa_ctl_status_t status; + + status.u64 = cvmx_read_csr(CVMX_FPA_CTL_STATUS); + status.s.reset = 1; + cvmx_write_csr(CVMX_FPA_CTL_STATUS, status.u64); +} + /** * Get a new block from the FPA * @@ -191,7 +209,7 @@ static inline void cvmx_fpa_async_alloc(uint64_t scr_addr, uint64_t pool) { cvmx_fpa_iobdma_data_t data; - /* Hardware only uses 64 bit alligned locations, so convert from byte address + /* Hardware only uses 64 bit aligned locations, so convert from byte address ** to 64-bit index */ data.s.scraddr = scr_addr >> 3; -- cgit v1.2.3