Path: blob/master/arch/blackfin/mach-bf561/include/mach/mem_map.h
10820 views
/*1* BF561 memory map2*3* Copyright 2004-2009 Analog Devices Inc.4* Licensed under the GPL-2 or later.5*/67#ifndef __BFIN_MACH_MEM_MAP_H__8#define __BFIN_MACH_MEM_MAP_H__910#ifndef __BFIN_MEM_MAP_H__11# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"12#endif1314/* Async Memory Banks */15#define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */16#define ASYNC_BANK3_SIZE 0x04000000 /* 64M */17#define ASYNC_BANK2_BASE 0x28000000 /* Async Bank 2 */18#define ASYNC_BANK2_SIZE 0x04000000 /* 64M */19#define ASYNC_BANK1_BASE 0x24000000 /* Async Bank 1 */20#define ASYNC_BANK1_SIZE 0x04000000 /* 64M */21#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */22#define ASYNC_BANK0_SIZE 0x04000000 /* 64M */2324/* Boot ROM Memory */2526#define BOOT_ROM_START 0xEF00000027#define BOOT_ROM_LENGTH 0x8002829/* Level 1 Memory */3031#ifdef CONFIG_BFIN_ICACHE32#define BFIN_ICACHESIZE (16*1024)33#else34#define BFIN_ICACHESIZE (0*1024)35#endif3637/* Memory Map for ADSP-BF561 processors */3839#define COREA_L1_CODE_START 0xFFA0000040#define COREA_L1_DATA_A_START 0xFF80000041#define COREA_L1_DATA_B_START 0xFF90000042#define COREB_L1_CODE_START 0xFF60000043#define COREB_L1_DATA_A_START 0xFF40000044#define COREB_L1_DATA_B_START 0xFF5000004546#define L1_CODE_START COREA_L1_CODE_START47#define L1_DATA_A_START COREA_L1_DATA_A_START48#define L1_DATA_B_START COREA_L1_DATA_B_START4950#define L1_CODE_LENGTH 0x40005152#ifdef CONFIG_BFIN_DCACHE5354#ifdef CONFIG_BFIN_DCACHE_BANKA55#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)56#define L1_DATA_A_LENGTH (0x8000 - 0x4000)57#define L1_DATA_B_LENGTH 0x800058#define BFIN_DCACHESIZE (16*1024)59#define BFIN_DSUPBANKS 160#else61#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)62#define L1_DATA_A_LENGTH (0x8000 - 0x4000)63#define L1_DATA_B_LENGTH (0x8000 - 0x4000)64#define BFIN_DCACHESIZE (32*1024)65#define BFIN_DSUPBANKS 266#endif6768#else69#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)70#define L1_DATA_A_LENGTH 0x800071#define L1_DATA_B_LENGTH 0x800072#define BFIN_DCACHESIZE (0*1024)73#define BFIN_DSUPBANKS 074#endif /*CONFIG_BFIN_DCACHE*/7576/*77* If we are in SMP mode, then the cache settings of Core B will match78* the settings of Core A. If we aren't, then we assume Core B is not79* using any cache. This allows the rest of the kernel to work with80* the core in either mode as we are only loading user code into it and81* it is the user's problem to make sure they aren't doing something82* stupid there.83*84* Note that we treat the L1 code region as a contiguous blob to make85* the rest of the kernel simpler. Easier to check one region than a86* bunch of small ones. Again, possible misbehavior here is the fault87* of the user -- don't try to use memory that doesn't exist.88*/89#ifdef CONFIG_SMP90# define COREB_L1_CODE_LENGTH L1_CODE_LENGTH91# define COREB_L1_DATA_A_LENGTH L1_DATA_A_LENGTH92# define COREB_L1_DATA_B_LENGTH L1_DATA_B_LENGTH93#else94# define COREB_L1_CODE_LENGTH 0x1400095# define COREB_L1_DATA_A_LENGTH 0x800096# define COREB_L1_DATA_B_LENGTH 0x800097#endif9899/* Level 2 Memory */100#define L2_START 0xFEB00000101#define L2_LENGTH 0x20000102103/* Scratch Pad Memory */104105#define COREA_L1_SCRATCH_START 0xFFB00000106#define COREB_L1_SCRATCH_START 0xFF700000107108#ifdef CONFIG_SMP109110/*111* The following macros both return the address of the PDA for the112* current core.113*114* In its first safe (and hairy) form, the macro neither clobbers any115* register aside of the output Preg, nor uses the stack, since it116* could be called with an invalid stack pointer, or the current stack117* space being uncovered by any CPLB (e.g. early exception handling).118*119* The constraints on the second form are a bit relaxed, and the code120* is allowed to use the specified Dreg for determining the PDA121* address to be returned into Preg.122*/123# define GET_PDA_SAFE(preg) \124preg.l = lo(DSPID); \125preg.h = hi(DSPID); \126preg = [preg]; \127preg = preg << 2; \128preg = preg << 2; \129preg = preg << 2; \130preg = preg << 2; \131preg = preg << 2; \132preg = preg << 2; \133preg = preg << 2; \134preg = preg << 2; \135preg = preg << 2; \136preg = preg << 2; \137preg = preg << 2; \138preg = preg << 2; \139if cc jump 2f; \140cc = preg == 0x0; \141preg.l = _cpu_pda; \142preg.h = _cpu_pda; \143if !cc jump 3f; \1441: \145/* preg = 0x0; */ \146cc = !cc; /* restore cc to 0 */ \147jump 4f; \1482: \149cc = preg == 0x0; \150preg.l = _cpu_pda; \151preg.h = _cpu_pda; \152if cc jump 4f; \153/* preg = 0x1000000; */ \154cc = !cc; /* restore cc to 1 */ \1553: \156preg = [preg]; \1574:158159# define GET_PDA(preg, dreg) \160preg.l = lo(DSPID); \161preg.h = hi(DSPID); \162dreg = [preg]; \163preg.l = _cpu_pda; \164preg.h = _cpu_pda; \165cc = bittst(dreg, 0); \166if !cc jump 1f; \167preg = [preg]; \1681: \169170# define GET_CPUID(preg, dreg) \171preg.l = lo(DSPID); \172preg.h = hi(DSPID); \173dreg = [preg]; \174dreg = ROT dreg BY -1; \175dreg = CC;176177# ifndef __ASSEMBLY__178179# include <asm/processor.h>180181static inline unsigned long get_l1_scratch_start_cpu(int cpu)182{183return cpu ? COREB_L1_SCRATCH_START : COREA_L1_SCRATCH_START;184}185static inline unsigned long get_l1_code_start_cpu(int cpu)186{187return cpu ? COREB_L1_CODE_START : COREA_L1_CODE_START;188}189static inline unsigned long get_l1_data_a_start_cpu(int cpu)190{191return cpu ? COREB_L1_DATA_A_START : COREA_L1_DATA_A_START;192}193static inline unsigned long get_l1_data_b_start_cpu(int cpu)194{195return cpu ? COREB_L1_DATA_B_START : COREA_L1_DATA_B_START;196}197198static inline unsigned long get_l1_scratch_start(void)199{200return get_l1_scratch_start_cpu(blackfin_core_id());201}202static inline unsigned long get_l1_code_start(void)203{204return get_l1_code_start_cpu(blackfin_core_id());205}206static inline unsigned long get_l1_data_a_start(void)207{208return get_l1_data_a_start_cpu(blackfin_core_id());209}210static inline unsigned long get_l1_data_b_start(void)211{212return get_l1_data_b_start_cpu(blackfin_core_id());213}214215# endif /* __ASSEMBLY__ */216#endif /* CONFIG_SMP */217218#endif219220221