Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/include/memory/renesas-rpc-if.h
26278 views
1
/* SPDX-License-Identifier: GPL-2.0 */
2
/*
3
* Renesas RPC-IF core driver
4
*
5
* Copyright (C) 2018~2019 Renesas Solutions Corp.
6
* Copyright (C) 2019 Macronix International Co., Ltd.
7
* Copyright (C) 2019-2020 Cogent Embedded, Inc.
8
*/
9
10
#ifndef __RENESAS_RPC_IF_H
11
#define __RENESAS_RPC_IF_H
12
13
#include <linux/pm_runtime.h>
14
#include <linux/types.h>
15
16
enum rpcif_data_dir {
17
RPCIF_NO_DATA,
18
RPCIF_DATA_IN,
19
RPCIF_DATA_OUT,
20
};
21
22
struct rpcif_op {
23
struct {
24
u8 buswidth;
25
u8 opcode;
26
bool ddr;
27
} cmd, ocmd;
28
29
struct {
30
u8 nbytes;
31
u8 buswidth;
32
bool ddr;
33
u64 val;
34
} addr;
35
36
struct {
37
u8 ncycles;
38
u8 buswidth;
39
} dummy;
40
41
struct {
42
u8 nbytes;
43
u8 buswidth;
44
bool ddr;
45
u32 val;
46
} option;
47
48
struct {
49
u8 buswidth;
50
unsigned int nbytes;
51
enum rpcif_data_dir dir;
52
bool ddr;
53
union {
54
void *in;
55
const void *out;
56
} buf;
57
} data;
58
};
59
60
enum rpcif_type {
61
RPCIF_RCAR_GEN3,
62
RPCIF_RCAR_GEN4,
63
RPCIF_RZ_G2L,
64
XSPI_RZ_G3E,
65
};
66
67
struct rpcif {
68
struct device *dev;
69
void __iomem *dirmap;
70
size_t size;
71
bool xspi;
72
};
73
74
int rpcif_sw_init(struct rpcif *rpc, struct device *dev);
75
int rpcif_hw_init(struct device *dev, bool hyperflash);
76
void rpcif_prepare(struct device *dev, const struct rpcif_op *op, u64 *offs,
77
size_t *len);
78
int rpcif_manual_xfer(struct device *dev);
79
ssize_t rpcif_dirmap_read(struct device *dev, u64 offs, size_t len, void *buf);
80
ssize_t xspi_dirmap_write(struct device *dev, u64 offs, size_t len,
81
const void *buf);
82
83
#endif // __RENESAS_RPC_IF_H
84
85