|
@@ -1,13 +1,13 @@
|
|
|
/*
|
|
|
- * File: arch/blackfin/mm/blackfin_sram.c
|
|
|
+ * File: arch/blackfin/mm/sram-alloc.c
|
|
|
* Based on:
|
|
|
* Author:
|
|
|
*
|
|
|
* Created:
|
|
|
- * Description: SRAM driver for Blackfin ADSP-BF5xx
|
|
|
+ * Description: SRAM allocator for Blackfin L1 and L2 memory
|
|
|
*
|
|
|
* Modified:
|
|
|
- * Copyright 2004-2007 Analog Devices Inc.
|
|
|
+ * Copyright 2004-2008 Analog Devices Inc.
|
|
|
*
|
|
|
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
|
|
*
|
|
@@ -78,7 +78,7 @@ static void __init l1sram_init(void)
|
|
|
free_l1_ssram_head.next =
|
|
|
kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
|
|
|
if (!free_l1_ssram_head.next) {
|
|
|
- printk(KERN_INFO"Fail to initialize Scratchpad data SRAM.\n");
|
|
|
+ printk(KERN_INFO "Failed to initialize Scratchpad data SRAM\n");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -102,7 +102,7 @@ static void __init l1_data_sram_init(void)
|
|
|
free_l1_data_A_sram_head.next =
|
|
|
kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
|
|
|
if (!free_l1_data_A_sram_head.next) {
|
|
|
- printk(KERN_INFO"Fail to initialize L1 Data A SRAM.\n");
|
|
|
+ printk(KERN_INFO "Failed to initialize L1 Data A SRAM\n");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -123,7 +123,7 @@ static void __init l1_data_sram_init(void)
|
|
|
free_l1_data_B_sram_head.next =
|
|
|
kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
|
|
|
if (!free_l1_data_B_sram_head.next) {
|
|
|
- printk(KERN_INFO"Fail to initialize L1 Data B SRAM.\n");
|
|
|
+ printk(KERN_INFO "Failed to initialize L1 Data B SRAM\n");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -151,7 +151,7 @@ static void __init l1_inst_sram_init(void)
|
|
|
free_l1_inst_sram_head.next =
|
|
|
kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
|
|
|
if (!free_l1_inst_sram_head.next) {
|
|
|
- printk(KERN_INFO"Fail to initialize L1 Instruction SRAM.\n");
|
|
|
+ printk(KERN_INFO "Failed to initialize L1 Instruction SRAM\n");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -179,7 +179,7 @@ static void __init l2_sram_init(void)
|
|
|
free_l2_sram_head.next =
|
|
|
kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
|
|
|
if (!free_l2_sram_head.next) {
|
|
|
- printk(KERN_INFO"Fail to initialize L2 SRAM.\n");
|
|
|
+ printk(KERN_INFO "Failed to initialize L2 SRAM\n");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -351,28 +351,31 @@ static int _sram_free(const void *addr,
|
|
|
|
|
|
int sram_free(const void *addr)
|
|
|
{
|
|
|
- if (0) {}
|
|
|
+
|
|
|
#if L1_CODE_LENGTH != 0
|
|
|
- else if (addr >= (void *)L1_CODE_START
|
|
|
+ if (addr >= (void *)L1_CODE_START
|
|
|
&& addr < (void *)(L1_CODE_START + L1_CODE_LENGTH))
|
|
|
return l1_inst_sram_free(addr);
|
|
|
+ else
|
|
|
#endif
|
|
|
#if L1_DATA_A_LENGTH != 0
|
|
|
- else if (addr >= (void *)L1_DATA_A_START
|
|
|
+ if (addr >= (void *)L1_DATA_A_START
|
|
|
&& addr < (void *)(L1_DATA_A_START + L1_DATA_A_LENGTH))
|
|
|
return l1_data_A_sram_free(addr);
|
|
|
+ else
|
|
|
#endif
|
|
|
#if L1_DATA_B_LENGTH != 0
|
|
|
- else if (addr >= (void *)L1_DATA_B_START
|
|
|
+ if (addr >= (void *)L1_DATA_B_START
|
|
|
&& addr < (void *)(L1_DATA_B_START + L1_DATA_B_LENGTH))
|
|
|
return l1_data_B_sram_free(addr);
|
|
|
+ else
|
|
|
#endif
|
|
|
#if L2_LENGTH != 0
|
|
|
- else if (addr >= (void *)L2_START
|
|
|
+ if (addr >= (void *)L2_START
|
|
|
&& addr < (void *)(L2_START + L2_LENGTH))
|
|
|
return l2_sram_free(addr);
|
|
|
-#endif
|
|
|
else
|
|
|
+#endif
|
|
|
return -1;
|
|
|
}
|
|
|
EXPORT_SYMBOL(sram_free);
|