hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/** @file
 
  Copyright (c) 2016 - 2017, Socionext Inc. All rights reserved.<BR>
  Copyright (c) 2017, Linaro, Ltd. All rights reserved.<BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
 
**/
 
#ifndef OGMA_BASIC_ACCESS_H
#define OGMA_BASIC_ACCESS_H
 
#include "ogma_internal.h"
 
static __inline void ogma_write_reg (
    ogma_ctrl_t *ctrl_p,
    ogma_uint32 reg_addr,
    ogma_uint32 value
    )
{
 
    pfdep_iomem_write( (void *) ( ( pfdep_cpu_addr_t)ctrl_p->base_addr +
                                  ( reg_addr << 2) ),
                       value);
}
 
static __inline ogma_uint32 ogma_read_reg (
    ogma_ctrl_t *ctrl_p,
    ogma_uint32 reg_addr
    )
{
 
    return ( ogma_uint32)pfdep_iomem_read( (void *)( ( pfdep_cpu_addr_t)ctrl_p->base_addr +
                                                     ( reg_addr << 2) ) );
}
 
void ogma_set_mac_reg (
    ogma_ctrl_t *ctrl_p,
    ogma_uint32 addr,
    ogma_uint32 value);
 
ogma_uint32 ogma_get_mac_reg (
    ogma_ctrl_t *ctrl_p,
    ogma_uint32 addr);
 
#endif/* OGMA_BASIC_ACCESS_H */