13
13
#ifndef _ASMLANGUAGE
14
14
/* CSR access helpers */
15
15
16
- static inline unsigned char litex_read8 (unsigned long addr )
16
+ static inline uint8_t litex_read8 (mem_addr_t addr )
17
17
{
18
18
#if CONFIG_LITEX_CSR_DATA_WIDTH >= 8
19
19
return sys_read8 (addr );
@@ -22,7 +22,7 @@ static inline unsigned char litex_read8(unsigned long addr)
22
22
#endif
23
23
}
24
24
25
- static inline unsigned short litex_read16 (unsigned long addr )
25
+ static inline uint16_t litex_read16 (mem_addr_t addr )
26
26
{
27
27
#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
28
28
return (sys_read8 (addr ) << 8 )
@@ -34,7 +34,7 @@ static inline unsigned short litex_read16(unsigned long addr)
34
34
#endif
35
35
}
36
36
37
- static inline unsigned int litex_read32 (unsigned long addr )
37
+ static inline uint32_t litex_read32 (mem_addr_t addr )
38
38
{
39
39
#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
40
40
return (sys_read8 (addr ) << 24 )
@@ -48,7 +48,7 @@ static inline unsigned int litex_read32(unsigned long addr)
48
48
#endif
49
49
}
50
50
51
- static inline uint64_t litex_read64 (unsigned long addr )
51
+ static inline uint64_t litex_read64 (mem_addr_t addr )
52
52
{
53
53
#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
54
54
return (((uint64_t )sys_read8 (addr )) << 56 )
@@ -68,7 +68,7 @@ static inline uint64_t litex_read64(unsigned long addr)
68
68
#endif
69
69
}
70
70
71
- static inline void litex_write8 (unsigned char value , unsigned long addr )
71
+ static inline void litex_write8 (uint8_t value , mem_addr_t addr )
72
72
{
73
73
#if CONFIG_LITEX_CSR_DATA_WIDTH >= 8
74
74
sys_write8 (value , addr );
@@ -77,7 +77,7 @@ static inline void litex_write8(unsigned char value, unsigned long addr)
77
77
#endif
78
78
}
79
79
80
- static inline void litex_write16 (unsigned short value , unsigned long addr )
80
+ static inline void litex_write16 (uint16_t value , mem_addr_t addr )
81
81
{
82
82
#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
83
83
sys_write8 (value >> 8 , addr );
@@ -89,7 +89,7 @@ static inline void litex_write16(unsigned short value, unsigned long addr)
89
89
#endif
90
90
}
91
91
92
- static inline void litex_write32 (unsigned int value , unsigned long addr )
92
+ static inline void litex_write32 (uint32_t value , mem_addr_t addr )
93
93
{
94
94
#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
95
95
sys_write8 (value >> 24 , addr );
@@ -103,7 +103,7 @@ static inline void litex_write32(unsigned int value, unsigned long addr)
103
103
#endif
104
104
}
105
105
106
- static inline void litex_write64 (uint64_t value , unsigned long addr )
106
+ static inline void litex_write64 (uint64_t value , mem_addr_t addr )
107
107
{
108
108
#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
109
109
sys_write8 (value >> 56 , addr );
@@ -129,7 +129,7 @@ static inline void litex_write64(uint64_t value, unsigned long addr)
129
129
* Size is in bytes and meaningful are 1, 2 or 4
130
130
* Address must be aligned to 4 bytes
131
131
*/
132
- static inline void litex_write (uint32_t addr , uint32_t size , uint32_t value )
132
+ static inline void litex_write (mem_addr_t addr , uint8_t size , uint32_t value )
133
133
{
134
134
switch (size ) {
135
135
case 1 :
@@ -151,7 +151,7 @@ static inline void litex_write(uint32_t addr, uint32_t size, uint32_t value)
151
151
* Size is in bytes and meaningful are 1, 2 or 4
152
152
* Address must be aligned to 4 bytes
153
153
*/
154
- static inline uint32_t litex_read (uint32_t addr , uint32_t size )
154
+ static inline uint32_t litex_read (mem_addr_t addr , uint32_t size )
155
155
{
156
156
switch (size ) {
157
157
case 1 :
0 commit comments