diff --git a/litex/soc/software/bios/sdram.c b/litex/soc/software/bios/sdram.c index 6907041a4..f7d8458c8 100644 --- a/litex/soc/software/bios/sdram.c +++ b/litex/soc/software/bios/sdram.c @@ -20,8 +20,6 @@ #include #include -#include // for hton/ntoh (byteswap) functions - #include "sdram.h" // FIXME(hack): If we don't have main ram, just target the sram instead. @@ -63,22 +61,6 @@ __attribute__((unused)) static void cdelay(int i) #define DFII_PIX_DATA_BYTES DFII_PIX_DATA_SIZE*CSR_DATA_BYTES -#if CSR_DATA_BYTES == 1 - typedef uint8_t csr_dw_t; - #define csr_dw_hton(x) (x) - #define csr_dw_ntoh(x) (x) -#elif CSR_DATA_BYTES == 2 - typedef uint16_t csr_dw_t; - #define csr_dw_hton(x) htons(x) - #define csr_dw_ntoh(x) ntohs(x) -#elif CSR_DATA_BYTES == 4 - typedef uint32_t csr_dw_t; - #define csr_dw_hton(x) htonl(x) - #define csr_dw_ntoh(x) ntohl(x) -#else -#error Unsupported CSR data width -#endif - void sdrsw(void) { sdram_dfii_control_write(DFII_CONTROL_CKE|DFII_CONTROL_ODT|DFII_CONTROL_RESET_N); @@ -120,8 +102,7 @@ void sdrrdbuf(int dq) { int i, p; int first_byte, step; - csr_dw_t buf[DFII_PIX_DATA_SIZE]; - unsigned char *buf_bytes = (unsigned char *)&(buf[0]); + unsigned char buf[DFII_PIX_DATA_BYTES]; if(dq < 0) { first_byte = 0; @@ -132,10 +113,10 @@ void sdrrdbuf(int dq) } for(p=0;p\n"); @@ -193,32 +174,35 @@ void sdrrderr(char *count) } for(p=0;p\n"); @@ -246,9 +229,9 @@ void sdrwr(char *startaddr) for(p=0;p