Files
nvethernetrm/osi/common/eqos_common.h
rakesh goyal 56b160f12e nvethernetrm: fix review CG and DG comments
- Include header gaurds using INCLUDED_
- Move static inline function to private
  header file.
- Move private macro to private header

Bug 200681427

Change-Id: I810184e077a5642f727e47b9280d3fb9659abd74
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2455014
(cherry picked from commit b3afc7a112460d7f92d8ef0fbe8727c7acd9ec44)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2457307
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2020-12-10 14:52:50 -08:00

84 lines
2.5 KiB
C

/*
* Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef INCLUDED_EQOS_COMMON_H
#define INCLUDED_EQOS_COMMON_H
#include <local_common.h>
/**
* @brief PTP Time read registers
* @{
*/
#define EQOS_MAC_STSR 0x0B08
#define EQOS_MAC_STNSR 0x0B0C
#define EQOS_MAC_STNSR_TSSS_MASK 0x7FFFFFFFU
/** @} */
/**
* @brief Common MAC MCR register and its bits
* @{
*/
#define EQOS_MAC_MCR 0x0000
#define EQOS_MCR_TE OSI_BIT(0)
#define EQOS_MCR_RE OSI_BIT(1)
/** @} */
/**
* @brief eqos_get_systime - Get system time from MAC
*
* @param[in] addr: Base address indicating the start of
* memory mapped IO region of the MAC.
*
* @pre MAC should be init and started. see osi_start_mac()
*
* @note
* API Group:
* - Initialization: No
* - Run time: Yes
* - De-initialization: No
*
* @retval 0 on success
* @retval -1 on failure.
*/
nveul64_t eqos_get_systime_from_mac(void *addr);
/**
* @brief eqos_is_mac_enabled - Checks if MAC is enabled or not.
*
* @param[in] addr: Base address indicating the start of
* memory mapped IO region of the MAC.
*
* @pre MAC should be init and started. see osi_start_mac()
*
* @note
* API Group:
* - Initialization: Yes
* - Run time: No
* - De-initialization: No
*
* @retval OSI_ENABLE if MAC enabled.
* @retval OSI_DISABLE otherwise.
*/
nveu32_t eqos_is_mac_enabled(void *addr);
#endif /* INCLUDED_EQOS_COMMON_H */