Commit 0d04eb47 authored by David Brownell's avatar David Brownell Committed by Kevin Hilman

davinci: soc-specific SRAM setup

Package on-chip SRAM.  It's always accessible from the ARM, so
set up a standardized virtual address mapping into a 128 KiB
area that's reserved for platform use.

In some cases (dm6467) the physical addresses used for EDMA are
not the same as the ones used by the ARM ... so record that info
separately in the SOC data, for chips (unlike the OMAP-L137)
where SRAM may be used with EDMA.

Other blocks of SRAM, such as the ETB buffer or DSP L1/L2 RAM,
may be unused/available on some system.  They are ignored here.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent b79dbdef
...@@ -613,6 +613,13 @@ static struct map_desc dm355_io_desc[] = { ...@@ -613,6 +613,13 @@ static struct map_desc dm355_io_desc[] = {
.length = IO_SIZE, .length = IO_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, },
{
.virtual = SRAM_VIRT,
.pfn = __phys_to_pfn(0x00010000),
.length = SZ_32K,
/* MT_MEMORY_NONCACHED requires supersection alignment */
.type = MT_DEVICE,
},
}; };
/* Contents of JTAG ID register used to identify exact cpu type */ /* Contents of JTAG ID register used to identify exact cpu type */
...@@ -702,6 +709,8 @@ static struct davinci_soc_info davinci_soc_info_dm355 = { ...@@ -702,6 +709,8 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
.gpio_num = 104, .gpio_num = 104,
.gpio_irq = IRQ_DM355_GPIOBNK0, .gpio_irq = IRQ_DM355_GPIOBNK0,
.serial_dev = &dm355_serial_device, .serial_dev = &dm355_serial_device,
.sram_dma = 0x00010000,
.sram_len = SZ_32K,
}; };
void __init dm355_init(void) void __init dm355_init(void)
......
...@@ -539,6 +539,13 @@ static struct map_desc dm644x_io_desc[] = { ...@@ -539,6 +539,13 @@ static struct map_desc dm644x_io_desc[] = {
.length = IO_SIZE, .length = IO_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, },
{
.virtual = SRAM_VIRT,
.pfn = __phys_to_pfn(0x00008000),
.length = SZ_16K,
/* MT_MEMORY_NONCACHED requires supersection alignment */
.type = MT_DEVICE,
},
}; };
/* Contents of JTAG ID register used to identify exact cpu type */ /* Contents of JTAG ID register used to identify exact cpu type */
...@@ -629,6 +636,8 @@ static struct davinci_soc_info davinci_soc_info_dm644x = { ...@@ -629,6 +636,8 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
.gpio_irq = IRQ_GPIOBNK0, .gpio_irq = IRQ_GPIOBNK0,
.serial_dev = &dm644x_serial_device, .serial_dev = &dm644x_serial_device,
.emac_pdata = &dm644x_emac_pdata, .emac_pdata = &dm644x_emac_pdata,
.sram_dma = 0x00008000,
.sram_len = SZ_16K,
}; };
void __init dm644x_init(void) void __init dm644x_init(void)
......
...@@ -518,6 +518,13 @@ static struct map_desc dm646x_io_desc[] = { ...@@ -518,6 +518,13 @@ static struct map_desc dm646x_io_desc[] = {
.length = IO_SIZE, .length = IO_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, },
{
.virtual = SRAM_VIRT,
.pfn = __phys_to_pfn(0x00010000),
.length = SZ_32K,
/* MT_MEMORY_NONCACHED requires supersection alignment */
.type = MT_DEVICE,
},
}; };
/* Contents of JTAG ID register used to identify exact cpu type */ /* Contents of JTAG ID register used to identify exact cpu type */
...@@ -608,6 +615,8 @@ static struct davinci_soc_info davinci_soc_info_dm646x = { ...@@ -608,6 +615,8 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
.gpio_irq = IRQ_DM646X_GPIOBNK0, .gpio_irq = IRQ_DM646X_GPIOBNK0,
.serial_dev = &dm646x_serial_device, .serial_dev = &dm646x_serial_device,
.emac_pdata = &dm646x_emac_pdata, .emac_pdata = &dm646x_emac_pdata,
.sram_dma = 0x10010000,
.sram_len = SZ_32K,
}; };
void __init dm646x_init(void) void __init dm646x_init(void)
......
...@@ -66,10 +66,16 @@ struct davinci_soc_info { ...@@ -66,10 +66,16 @@ struct davinci_soc_info {
unsigned gpio_irq; unsigned gpio_irq;
struct platform_device *serial_dev; struct platform_device *serial_dev;
struct emac_platform_data *emac_pdata; struct emac_platform_data *emac_pdata;
dma_addr_t sram_dma;
unsigned sram_len;
}; };
extern struct davinci_soc_info davinci_soc_info; extern struct davinci_soc_info davinci_soc_info;
extern void davinci_common_init(struct davinci_soc_info *soc_info); extern void davinci_common_init(struct davinci_soc_info *soc_info);
/* 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 */ #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment