diff --git a/arch/blackfin/mm/blackfin_sram.c b/arch/blackfin/mm/blackfin_sram.c
index 0241764..dbb37b8 100644
--- a/arch/blackfin/mm/blackfin_sram.c
+++ b/arch/blackfin/mm/blackfin_sram.c
@@ -63,6 +63,7 @@
 	void *paddr;
 	int size;
 	int flag;
+	pid_t pid;
 };
 
 static struct l1_sram_piece l1_ssram[CONFIG_L1_MAX_PIECE];
@@ -97,23 +98,23 @@
 void __init l1_data_sram_init(void)
 {
 #if L1_DATA_A_LENGTH != 0
-	printk(KERN_INFO "Blackfin DATA_A SRAM: %d KB\n",
-	       L1_DATA_A_LENGTH >> 10);
-
 	memset(&l1_data_A_sram, 0x00, sizeof(l1_data_A_sram));
-	l1_data_A_sram[0].paddr = (void*)L1_DATA_A_START +
-		(_ebss_l1 - _sdata_l1);
+	l1_data_A_sram[0].paddr = (void *)L1_DATA_A_START +
+					(_ebss_l1 - _sdata_l1);
 	l1_data_A_sram[0].size = L1_DATA_A_LENGTH - (_ebss_l1 - _sdata_l1);
 	l1_data_A_sram[0].flag = SRAM_SLT_FREE;
+
+	printk(KERN_INFO "Blackfin Data A SRAM: %d KB (%d KB free)\n",
+	       L1_DATA_A_LENGTH >> 10, l1_data_A_sram[0].size >> 10);
 #endif
 #if L1_DATA_B_LENGTH != 0
-	printk(KERN_INFO "Blackfin DATA_B SRAM: %d KB\n",
-	       L1_DATA_B_LENGTH >> 10);
-
 	memset(&l1_data_B_sram, 0x00, sizeof(l1_data_B_sram));
 	l1_data_B_sram[0].paddr = (void*)L1_DATA_B_START;
 	l1_data_B_sram[0].size = L1_DATA_B_LENGTH;
 	l1_data_B_sram[0].flag = SRAM_SLT_FREE;
+
+	printk(KERN_INFO "Blackfin Data B SRAM: %d KB (%d KB free)\n",
+	       L1_DATA_B_LENGTH >> 10, l1_data_B_sram[0].size >> 10);
 #endif
 
 	/* mutex initialize */
@@ -123,13 +124,13 @@
 void __init l1_inst_sram_init(void)
 {
 #if L1_CODE_LENGTH != 0
-	printk(KERN_INFO "Blackfin Instruction SRAM: %d KB\n",
-	       L1_CODE_LENGTH >> 10);
-
 	memset(&l1_inst_sram, 0x00, sizeof(l1_inst_sram));
 	l1_inst_sram[0].paddr = (void*)L1_CODE_START + (_etext_l1 - _stext_l1);
 	l1_inst_sram[0].size = L1_CODE_LENGTH - (_etext_l1 - _stext_l1);
 	l1_inst_sram[0].flag = SRAM_SLT_FREE;
+
+	printk(KERN_INFO "Blackfin Instruction SRAM: %d KB (%d KB free)\n",
+	       L1_CODE_LENGTH >> 10, l1_inst_sram[0].size >> 10);
 #endif
 
 	/* mutex initialize */
@@ -155,6 +156,7 @@
 		    && (pfree[i].size >= size)) {
 			addr = pfree[i].paddr;
 			pfree[i].flag = SRAM_SLT_ALLOCATED;
+			pfree[i].pid = current->pid;
 			index = i;
 			break;
 		}
@@ -166,6 +168,7 @@
 	if (pfree[i].size > size) {
 		for (i = 0; i < count; i++) {
 			if (pfree[i].flag == SRAM_SLT_NULL) {
+				pfree[i].pid = 0;
 				pfree[i].flag = SRAM_SLT_FREE;
 				pfree[i].paddr = addr + size;
 				pfree[i].size = pfree[index].size - size;
@@ -198,13 +201,15 @@
 		return NULL;
 	*psize = best;
 
+	pfree[index].pid = current->pid;
 	pfree[index].flag = SRAM_SLT_ALLOCATED;
 	return addr;
 }
 
 /* L1 memory free function */
 static int _l1_sram_free(const void *addr,
-			 struct l1_sram_piece *pfree, int count)
+			struct l1_sram_piece *pfree,
+			int count)
 {
 	int i, index = 0;
 
@@ -222,12 +227,14 @@
 	if (i >= count)
 		return -1;
 
+	pfree[index].pid = 0;
 	pfree[index].flag = SRAM_SLT_FREE;
 
 	/* link the next address slot */
 	for (i = 0; i < count; i++) {
 		if (((pfree[index].paddr + pfree[index].size) == pfree[i].paddr)
 		    && (pfree[i].flag == SRAM_SLT_FREE)) {
+			pfree[i].pid = 0;
 			pfree[i].flag = SRAM_SLT_NULL;
 			pfree[index].size += pfree[i].size;
 			pfree[index].flag = SRAM_SLT_FREE;
@@ -538,3 +545,64 @@
 	return addr;
 }
 EXPORT_SYMBOL(sram_alloc_with_lsl);
+
+#ifdef CONFIG_PROC_FS
+/* Once we get a real allocator, we'll throw all of this away.
+ * Until then, we need some sort of visibility into the L1 alloc.
+ */
+static void _l1sram_proc_read(char *buf, int *len, const char *desc,
+		struct l1_sram_piece *pfree, const int array_size)
+{
+	int i;
+
+	*len += sprintf(&buf[*len], "--- L1 %-14s Size  PID State\n", desc);
+	for (i = 0; i < array_size; ++i) {
+		const char *alloc_type;
+		switch (pfree[i].flag) {
+		case SRAM_SLT_NULL:      alloc_type = "NULL"; break;
+		case SRAM_SLT_FREE:      alloc_type = "FREE"; break;
+		case SRAM_SLT_ALLOCATED: alloc_type = "ALLOCATED"; break;
+		default:                 alloc_type = "????"; break;
+		}
+		*len += sprintf(&buf[*len], "%p-%p %8i %4i %s\n",
+			pfree[i].paddr, pfree[i].paddr + pfree[i].size,
+			pfree[i].size, pfree[i].pid, alloc_type);
+	}
+}
+static int l1sram_proc_read(char *buf, char **start, off_t offset, int count,
+		int *eof, void *data)
+{
+	int len = 0;
+
+	_l1sram_proc_read(buf, &len, "Scratchpad",
+			l1_ssram, ARRAY_SIZE(l1_ssram));
+#if L1_DATA_A_LENGTH != 0
+	_l1sram_proc_read(buf, &len, "Data A",
+			l1_data_A_sram, ARRAY_SIZE(l1_data_A_sram));
+#endif
+#if L1_DATA_B_LENGTH != 0
+	_l1sram_proc_read(buf, &len, "Data B",
+			l1_data_B_sram, ARRAY_SIZE(l1_data_B_sram));
+#endif
+#if L1_CODE_LENGTH != 0
+	_l1sram_proc_read(buf, &len, "Instruction",
+			l1_inst_sram, ARRAY_SIZE(l1_inst_sram));
+#endif
+
+	return len;
+}
+
+static int __init l1sram_proc_init(void)
+{
+	struct proc_dir_entry *ptr;
+	ptr = create_proc_entry("sram", S_IFREG | S_IRUGO, NULL);
+	if (!ptr) {
+		printk(KERN_WARNING "unable to create /proc/sram\n");
+		return -1;
+	}
+	ptr->owner = THIS_MODULE;
+	ptr->read_proc = l1sram_proc_read;
+	return 0;
+}
+late_initcall(l1sram_proc_init);
+#endif
