1/*
2 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
3 * Permission to use, copy, modify, and/or distribute this software for
4 * any purpose with or without fee is hereby granted, provided that the
5 * above copyright notice and this permission notice appear in all copies.
6 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
12 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13 */
14
15
16
17#ifndef _GARUDA_REG_ACCESS_H_
18#define _GARUDA_REG_ACCESS_H_
19
20#ifdef __cplusplus
21extern "C" {
22#endif /* __cplusplus */
23
24#include "common/sw.h"
25
26    sw_error_t
27    garuda_phy_get(a_uint32_t dev_id, a_uint32_t phy_addr,
28                   a_uint32_t reg, a_uint16_t * value);
29
30    sw_error_t
31    garuda_phy_set(a_uint32_t dev_id, a_uint32_t phy_addr,
32                   a_uint32_t reg, a_uint16_t value);
33
34    sw_error_t
35    garuda_reg_get(a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t value[],
36                   a_uint32_t value_len);
37
38    sw_error_t
39    garuda_reg_set(a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t value[],
40                   a_uint32_t value_len);
41
42    sw_error_t
43    garuda_reg_field_get(a_uint32_t dev_id, a_uint32_t reg_addr,
44                         a_uint32_t bit_offset, a_uint32_t field_len,
45                         a_uint8_t value[], a_uint32_t value_len);
46
47    sw_error_t
48    garuda_reg_field_set(a_uint32_t dev_id, a_uint32_t reg_addr,
49                         a_uint32_t bit_offset, a_uint32_t field_len,
50                         const a_uint8_t value[], a_uint32_t value_len);
51
52    sw_error_t
53    garuda_reg_access_init(a_uint32_t dev_id, hsl_access_mode mode);
54
55    sw_error_t
56    garuda_access_mode_set(a_uint32_t dev_id, hsl_access_mode mode);
57
58#ifdef __cplusplus
59}
60#endif /* __cplusplus */
61
62#endif /* _GARUDA_REG_ACCESS_H_ */
63
64