Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 2 | * Common Blackfin memory map |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 3 | * |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 4 | * Copyright 2004-2009 Analog Devices Inc. |
| 5 | * Licensed under the GPL-2 or later. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 8 | #ifndef __BFIN_MEM_MAP_H__ |
| 9 | #define __BFIN_MEM_MAP_H__ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 10 | |
Bryan Wu | 639f657 | 2008-08-27 10:51:02 +0800 | [diff] [blame] | 11 | #include <mach/mem_map.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 12 | |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 13 | /* Every Blackfin so far has MMRs like this */ |
| 14 | #ifndef COREMMR_BASE |
| 15 | # define COREMMR_BASE 0xFFE00000 |
| 16 | #endif |
| 17 | #ifndef SYSMMR_BASE |
| 18 | # define SYSMMR_BASE 0xFFC00000 |
| 19 | #endif |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 20 | |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 21 | /* Every Blackfin so far has on-chip Scratch Pad SRAM like this */ |
| 22 | #ifndef L1_SCRATCH_START |
| 23 | # define L1_SCRATCH_START 0xFFB00000 |
| 24 | # define L1_SCRATCH_LENGTH 0x1000 |
| 25 | #endif |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 26 | |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 27 | /* Most parts lack on-chip L2 SRAM */ |
| 28 | #ifndef L2_START |
| 29 | # define L2_START 0 |
| 30 | # define L2_LENGTH 0 |
| 31 | #endif |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 32 | |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 33 | /* Most parts lack on-chip L1 ROM */ |
| 34 | #ifndef L1_ROM_START |
| 35 | # define L1_ROM_START 0 |
| 36 | # define L1_ROM_LENGTH 0 |
| 37 | #endif |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 38 | |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 39 | /* Allow wonky SMP ports to override this */ |
| 40 | #ifndef GET_PDA_SAFE |
| 41 | # define GET_PDA_SAFE(preg) \ |
| 42 | preg.l = _cpu_pda; \ |
| 43 | preg.h = _cpu_pda; |
| 44 | # define GET_PDA(preg, dreg) GET_PDA_SAFE(preg) |
| 45 | |
| 46 | # ifndef __ASSEMBLY__ |
| 47 | |
| 48 | static inline unsigned long get_l1_scratch_start_cpu(int cpu) |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 49 | { |
| 50 | return L1_SCRATCH_START; |
| 51 | } |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 52 | static inline unsigned long get_l1_code_start_cpu(int cpu) |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 53 | { |
| 54 | return L1_CODE_START; |
| 55 | } |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 56 | static inline unsigned long get_l1_data_a_start_cpu(int cpu) |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 57 | { |
| 58 | return L1_DATA_A_START; |
| 59 | } |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 60 | static inline unsigned long get_l1_data_b_start_cpu(int cpu) |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 61 | { |
| 62 | return L1_DATA_B_START; |
| 63 | } |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 64 | static inline unsigned long get_l1_scratch_start(void) |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 65 | { |
| 66 | return get_l1_scratch_start_cpu(0); |
| 67 | } |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 68 | static inline unsigned long get_l1_code_start(void) |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 69 | { |
| 70 | return get_l1_code_start_cpu(0); |
| 71 | } |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 72 | static inline unsigned long get_l1_data_a_start(void) |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 73 | { |
| 74 | return get_l1_data_a_start_cpu(0); |
| 75 | } |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 76 | static inline unsigned long get_l1_data_b_start(void) |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 77 | { |
| 78 | return get_l1_data_b_start_cpu(0); |
| 79 | } |
| 80 | |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 81 | # endif /* __ASSEMBLY__ */ |
| 82 | #endif /* !GET_PDA_SAFE */ |
Graf Yang | dbc895f | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 83 | |
Mike Frysinger | fa48f84 | 2009-06-17 11:25:06 -0400 | [diff] [blame] | 84 | #endif |