X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=cpu%2Fblackfin%2Fserial.h;h=6cbc564b532b974ebbf5ecd1a2fb8893545b3959;hb=f15f14e52879711be1d1bba2634dec684eda722e;hp=7b47878df3d8a863dc9e8f4ff184bda19704624c;hpb=f75a729b5c1434d5a5bbf453b1b699bf1c3ffbce;p=oweals%2Fu-boot.git diff --git a/cpu/blackfin/serial.h b/cpu/blackfin/serial.h index 7b47878df3..6cbc564b53 100644 --- a/cpu/blackfin/serial.h +++ b/cpu/blackfin/serial.h @@ -81,11 +81,6 @@ #ifndef __ASSEMBLY__ -/* We cannot use get_sclk() in initcode as it is defined elsewhere. */ -#ifdef BFIN_IN_INITCODE -# define get_sclk() (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT / CONFIG_SCLK_DIV) -#endif - #ifdef __ADSPBF54x__ # define ACCESS_LATCH() # define ACCESS_PORT_IER() @@ -190,6 +185,11 @@ static inline uint16_t serial_early_get_div(void) return divisor; } +/* We cannot use get_sclk() early on as it uses caches in external memory */ +#if defined(BFIN_IN_INITCODE) || defined(CONFIG_DEBUG_EARLY_SERIAL) +# define get_sclk() (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT / CONFIG_SCLK_DIV) +#endif + __attribute__((always_inline)) static inline void serial_early_set_baud(uint32_t baud) {