Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340022
b: refs/heads/master
c: 626863a
h: refs/heads/master
v: v3
  • Loading branch information
Ben Gardiner authored and Sekhar Nori committed Oct 27, 2012
1 parent bd93fad commit 87d641f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2eb2478d471e45e1d0c8bb3defbf82bf7204e13d
refs/heads/master: 626863a3f32f0baaf55a1d18b8d4fbb937700dda
6 changes: 0 additions & 6 deletions trunk/arch/arm/mach-davinci/da850.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,12 +781,6 @@ static struct map_desc da850_io_desc[] = {
.length = DA8XX_CP_INTC_SIZE,
.type = MT_DEVICE
},
{
.virtual = SRAM_VIRT,
.pfn = __phys_to_pfn(DA8XX_ARM_RAM_BASE),
.length = SZ_8K,
.type = MT_DEVICE
},
};

static u32 da850_psc_bases[] = { DA8XX_PSC0_BASE, DA8XX_PSC1_BASE };
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/arm/mach-davinci/dm355.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,12 +758,6 @@ static struct map_desc dm355_io_desc[] = {
.length = IO_SIZE,
.type = MT_DEVICE
},
{
.virtual = SRAM_VIRT,
.pfn = __phys_to_pfn(0x00010000),
.length = SZ_32K,
.type = MT_MEMORY_NONCACHED,
},
};

/* Contents of JTAG ID register used to identify exact cpu type */
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/arm/mach-davinci/dm365.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,12 +985,6 @@ static struct map_desc dm365_io_desc[] = {
.length = IO_SIZE,
.type = MT_DEVICE
},
{
.virtual = SRAM_VIRT,
.pfn = __phys_to_pfn(0x00010000),
.length = SZ_32K,
.type = MT_MEMORY_NONCACHED,
},
};

static struct resource dm365_ks_resources[] = {
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/arm/mach-davinci/dm644x.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,6 @@ static struct map_desc dm644x_io_desc[] = {
.length = IO_SIZE,
.type = MT_DEVICE
},
{
.virtual = SRAM_VIRT,
.pfn = __phys_to_pfn(0x00008000),
.length = SZ_16K,
.type = MT_MEMORY_NONCACHED,
},
};

/* Contents of JTAG ID register used to identify exact cpu type */
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/arm/mach-davinci/dm646x.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,6 @@ static struct map_desc dm646x_io_desc[] = {
.length = IO_SIZE,
.type = MT_DEVICE
},
{
.virtual = SRAM_VIRT,
.pfn = __phys_to_pfn(0x00010000),
.length = SZ_32K,
.type = MT_MEMORY_NONCACHED,
},
};

/* Contents of JTAG ID register used to identify exact cpu type */
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/arm/mach-davinci/include/mach/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ int davinci_pm_init(void);
static inline int davinci_pm_init(void) { return 0; }
#endif

/* standard place to map on-chip SRAMs; they *may* support DMA */
#define SRAM_VIRT 0xfffe0000
#define SRAM_SIZE SZ_128K

#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
18 changes: 15 additions & 3 deletions trunk/arch/arm/mach-davinci/sram.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/genalloc.h>

#include <mach/common.h>
Expand All @@ -32,7 +33,7 @@ void *sram_alloc(size_t len, dma_addr_t *dma)
return NULL;

if (dma)
*dma = dma_base + (vaddr - SRAM_VIRT);
*dma = gen_pool_virt_to_phys(sram_pool, vaddr);
return (void *)vaddr;

}
Expand All @@ -53,17 +54,28 @@ EXPORT_SYMBOL(sram_free);
*/
static int __init sram_init(void)
{
phys_addr_t phys = davinci_soc_info.sram_dma;
unsigned len = davinci_soc_info.sram_len;
int status = 0;
void *addr;

if (len) {
len = min_t(unsigned, len, SRAM_SIZE);
sram_pool = gen_pool_create(ilog2(SRAM_GRANULARITY), -1);
if (!sram_pool)
status = -ENOMEM;
}
if (sram_pool)
status = gen_pool_add(sram_pool, SRAM_VIRT, len, -1);

if (sram_pool) {
addr = ioremap(phys, len);
if (!addr)
return -ENOMEM;
status = gen_pool_add_virt(sram_pool, (unsigned)addr,
phys, len, -1);
if (status < 0)
iounmap(addr);
}

WARN_ON(status < 0);
return status;
}
Expand Down

0 comments on commit 87d641f

Please sign in to comment.