diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2008-07-19 03:42:41 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-07-19 03:42:41 -0400 |
commit | 262c3825a9f3eb0f4f30ebb4b1ee57397bcb3ffc (patch) | |
tree | fb5402f0de002d3e7a6671820228a2b9808d831f /arch/blackfin/kernel/setup.c | |
parent | bafcc1b97323261a42d47960db99947bcc1be133 (diff) |
Blackfin arch: Extend sram malloc to handle L2 SRAM.
Extend system call to alloc L2 SRAM in application.
Automatically move following sections to L2 SRAM:
1. kernel built-in l2 attribute section
2. kernel module l2 attribute section
3. elf-fdpic application l2 attribute section
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/setup.c')
-rw-r--r-- | arch/blackfin/kernel/setup.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index 861a1db74df8..8671d1db1f99 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c | |||
@@ -104,6 +104,7 @@ void __init bf53x_relocate_l1_mem(void) | |||
104 | unsigned long l1_code_length; | 104 | unsigned long l1_code_length; |
105 | unsigned long l1_data_a_length; | 105 | unsigned long l1_data_a_length; |
106 | unsigned long l1_data_b_length; | 106 | unsigned long l1_data_b_length; |
107 | unsigned long l2_length; | ||
107 | 108 | ||
108 | l1_code_length = _etext_l1 - _stext_l1; | 109 | l1_code_length = _etext_l1 - _stext_l1; |
109 | if (l1_code_length > L1_CODE_LENGTH) | 110 | if (l1_code_length > L1_CODE_LENGTH) |
@@ -129,6 +130,15 @@ void __init bf53x_relocate_l1_mem(void) | |||
129 | /* Copy _sdata_b_l1 to _ebss_b_l1 to L1 data bank B SRAM */ | 130 | /* Copy _sdata_b_l1 to _ebss_b_l1 to L1 data bank B SRAM */ |
130 | dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length + | 131 | dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length + |
131 | l1_data_a_length, l1_data_b_length); | 132 | l1_data_a_length, l1_data_b_length); |
133 | |||
134 | #ifdef L2_LENGTH | ||
135 | l2_length = _ebss_l2 - _stext_l2; | ||
136 | if (l2_length > L2_LENGTH) | ||
137 | panic("L2 SRAM Overflow\n"); | ||
138 | |||
139 | /* Copy _stext_l2 to _edata_l2 to L2 SRAM */ | ||
140 | dma_memcpy(_stext_l2, _l2_lma_start, l2_length); | ||
141 | #endif | ||
132 | } | 142 | } |
133 | 143 | ||
134 | /* add_memory_region to memmap */ | 144 | /* add_memory_region to memmap */ |