X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fasm-blackfin%2Fblackfin_local.h;h=3fd34b33fe7d4444e385d13fefd6100fe9be83bb;hb=61f2b38a17f5b21c59f2afe6cf1cbb5f28638cf9;hp=6f0e662a95994cf9b9f0c445568ccda93e2d54bf;hpb=a4f762a994657151536360b22c8df8bd56ba82a3;p=oweals%2Fu-boot.git diff --git a/include/asm-blackfin/blackfin_local.h b/include/asm-blackfin/blackfin_local.h index 6f0e662a95..3fd34b33fe 100644 --- a/include/asm-blackfin/blackfin_local.h +++ b/include/asm-blackfin/blackfin_local.h @@ -25,6 +25,8 @@ #ifndef __BLACKFIN_LOCAL_H__ #define __BLACKFIN_LOCAL_H__ +#include + #define LO(con32) ((con32) & 0xFFFF) #define lo(con32) ((con32) & 0xFFFF) #define HI(con32) (((con32) >> 16) & 0xFFFF) @@ -43,6 +45,9 @@ #define SCLK_TO_MSEC(sclk) ((MSEC_PER_SEC * ((sclk) / USEC_PER_MSEC)) / (BFIN_SCLK / USEC_PER_MSEC)) #define MSEC_TO_SCLK(msec) ((((BFIN_SCLK / USEC_PER_MSEC) * (msec)) / MSEC_PER_SEC) * USEC_PER_MSEC) +#define L1_CACHE_SHIFT 5 +#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) + #include #ifndef __ASSEMBLY__ @@ -52,25 +57,25 @@ # include +extern u_long get_vco(void); +extern u_long get_cclk(void); extern u_long get_sclk(void); -# define bfin_revid() (*pCHIPID >> 28) +# define bfin_revid() (bfin_read_CHIPID() >> 28) + +extern bool bfin_os_log_check(void); +extern void bfin_os_log_dump(void); extern void blackfin_icache_flush_range(const void *, const void *); extern void blackfin_dcache_flush_range(const void *, const void *); -extern void blackfin_dcache_invalidate_range(const void *, const void *); - -/* Use DMA to move data from on chip to external memory. While this is - * required for only L1 instruction (it is not directly readable by the - * core via data loads), it isn't a huge performance issue for other - * regions (it's probably even faster than core load/stores). However, - * the DMA engine does not have access to the L1 scratchpad, and we - * cannot use DMA inside of the MMR space. +extern void blackfin_icache_dcache_flush_range(const void *, const void *); +extern void blackfin_dcache_flush_invalidate_range(const void *, const void *); + +/* Use DMA to move data from on chip to external memory. The L1 instruction + * regions can only be accessed via DMA, so if the address in question is in + * that region, make sure we attempt to DMA indirectly. */ -# define addr_bfin_on_chip_mem(addr) \ - (((unsigned long)(addr) >= 0xef000000 && (unsigned long)addr < SYSMMR_BASE) && \ - !((unsigned long)(addr) >= L1_SRAM_SCRATCH && \ - (unsigned long)(addr) < L1_SRAM_SCRATCH_END)) +# define addr_bfin_on_chip_mem(addr) (((unsigned long)(addr) & 0xFFF00000) == 0xFFA00000) # include