1313#ifndef _ASMLANGUAGE
1414/* CSR access helpers */
1515
16- static inline unsigned char litex_read8 (unsigned long addr )
16+ static inline uint8_t litex_read8 (mem_addr_t addr )
1717{
1818#if CONFIG_LITEX_CSR_DATA_WIDTH >= 8
1919 return sys_read8 (addr );
@@ -22,7 +22,7 @@ static inline unsigned char litex_read8(unsigned long addr)
2222#endif
2323}
2424
25- static inline unsigned short litex_read16 (unsigned long addr )
25+ static inline uint16_t litex_read16 (mem_addr_t addr )
2626{
2727#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
2828 return (sys_read8 (addr ) << 8 )
@@ -34,7 +34,7 @@ static inline unsigned short litex_read16(unsigned long addr)
3434#endif
3535}
3636
37- static inline unsigned int litex_read32 (unsigned long addr )
37+ static inline uint32_t litex_read32 (mem_addr_t addr )
3838{
3939#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
4040 return (sys_read8 (addr ) << 24 )
@@ -48,7 +48,7 @@ static inline unsigned int litex_read32(unsigned long addr)
4848#endif
4949}
5050
51- static inline uint64_t litex_read64 (unsigned long addr )
51+ static inline uint64_t litex_read64 (mem_addr_t addr )
5252{
5353#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
5454 return (((uint64_t )sys_read8 (addr )) << 56 )
@@ -68,7 +68,7 @@ static inline uint64_t litex_read64(unsigned long addr)
6868#endif
6969}
7070
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 )
7272{
7373#if CONFIG_LITEX_CSR_DATA_WIDTH >= 8
7474 sys_write8 (value , addr );
@@ -77,7 +77,7 @@ static inline void litex_write8(unsigned char value, unsigned long addr)
7777#endif
7878}
7979
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 )
8181{
8282#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
8383 sys_write8 (value >> 8 , addr );
@@ -89,7 +89,7 @@ static inline void litex_write16(unsigned short value, unsigned long addr)
8989#endif
9090}
9191
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 )
9393{
9494#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
9595 sys_write8 (value >> 24 , addr );
@@ -103,7 +103,7 @@ static inline void litex_write32(unsigned int value, unsigned long addr)
103103#endif
104104}
105105
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 )
107107{
108108#if CONFIG_LITEX_CSR_DATA_WIDTH == 8
109109 sys_write8 (value >> 56 , addr );
@@ -129,7 +129,7 @@ static inline void litex_write64(uint64_t value, unsigned long addr)
129129 * Size is in bytes and meaningful are 1, 2 or 4
130130 * Address must be aligned to 4 bytes
131131 */
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 )
133133{
134134 switch (size ) {
135135 case 1 :
@@ -151,7 +151,7 @@ static inline void litex_write(uint32_t addr, uint32_t size, uint32_t value)
151151 * Size is in bytes and meaningful are 1, 2 or 4
152152 * Address must be aligned to 4 bytes
153153 */
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 )
155155{
156156 switch (size ) {
157157 case 1 :
0 commit comments