diff --git a/litex/soc/cores/cpu/gowin_emcu/core.py b/litex/soc/cores/cpu/gowin_emcu/core.py index dcc38edc0..d9ba87858 100644 --- a/litex/soc/cores/cpu/gowin_emcu/core.py +++ b/litex/soc/cores/cpu/gowin_emcu/core.py @@ -251,14 +251,6 @@ class GowinEMCU(CPU): # --------------------------------- self.submodules += ahb.AHB2Wishbone(ahb_targexp0, self.pbus) - def connect_uart(self, pads, n=0): - assert n in (0, 1), "this CPU has 2 built-in UARTs, 0 and 1" - self.cpu_params.update({ - f"i_UART{n}RXDI" : pads.rx, - f"o_UART{n}TXDO" : pads.tx, - f"o_UART{n}BAUDTICK" : Signal() - }) - def connect_jtag(self, pads): self.cpu_params.update( i_DAPSWDITMS = pads.tms, diff --git a/litex/soc/cores/cpu/gowin_emcu/crt0.c b/litex/soc/cores/cpu/gowin_emcu/crt0.c index cafc474c8..54415dad1 100644 --- a/litex/soc/cores/cpu/gowin_emcu/crt0.c +++ b/litex/soc/cores/cpu/gowin_emcu/crt0.c @@ -19,9 +19,6 @@ void _start(void) { for (uint32_t *x = &_fbss; x < &_ebss; x ++) *x = 0; - UART0->ctrl = 0b11; // set rx and tx enable bits - UART0->baud_div = CONFIG_CLOCK_FREQUENCY / 115200; // FIXME - __asm__("bl main"); while(1); } diff --git a/litex/soc/cores/cpu/gowin_emcu/system.h b/litex/soc/cores/cpu/gowin_emcu/system.h index c7a14e816..262446a62 100644 --- a/litex/soc/cores/cpu/gowin_emcu/system.h +++ b/litex/soc/cores/cpu/gowin_emcu/system.h @@ -12,58 +12,6 @@ void flush_l2_cache(void); void busy_wait(unsigned int ms); void busy_wait_us(unsigned int us); -#include - -// FIXME -#define CSR_UART_BASE - -struct EMCU_UART -{ - volatile uint32_t data; - volatile uint32_t state; - volatile uint32_t ctrl; - volatile uint32_t int_ctrl; - volatile uint32_t baud_div; -}; - -#define PERIPHERALS_BASE 0x40000000 -#define UART0 ((struct EMCU_UART *) (PERIPHERALS_BASE + 0x4000)) - -static inline char uart_txfull_read(void); -static inline char uart_rxempty_read(void); -static inline void uart_ev_enable_write(char c); -static inline void uart_rxtx_write(char c); -static inline char uart_rxtx_read(void); -static inline void uart_ev_pending_write(char); -static inline char uart_ev_pending_read(void); - -static inline char uart_txfull_read(void) { - return UART0->state & 0b01; -} - -static inline char uart_rxempty_read(void) { - return !(UART0->state & 0b10); -} - -static inline void uart_ev_enable_write(char c) { - // FIXME -} - -static inline void uart_rxtx_write(char c) { - UART0->data = (uint32_t) c; -} - -static inline char uart_rxtx_read(void) -{ - return (char)(UART0->data); -} - -static inline void uart_ev_pending_write(char x) {} -static inline char uart_ev_pending_read(void) { - return 0; -} - - #ifdef __cplusplus } #endif