-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 260651 b: refs/heads/master c: 0f75a96 h: refs/heads/master i: 260649: 0684e00 260647: 3928423 v: v3
- Loading branch information
Kamil Debski
authored and
Kukjin Kim
committed
Jul 21, 2011
1 parent
49815c3
commit a63138a
Showing
11 changed files
with
235 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 35ce909ee6dacb0cb74ad04fd04e869fd5f83a7f | ||
refs/heads/master: 0f75a96bc0c4611dea0c7207533f822315120054 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
/* linux/arch/arm/plat-s5p/dev-mfc.c | ||
* | ||
* Copyright (C) 2010-2011 Samsung Electronics Co.Ltd | ||
* | ||
* Base S5P MFC resource and device definitions | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
|
||
#include <linux/kernel.h> | ||
#include <linux/interrupt.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/dma-mapping.h> | ||
#include <linux/memblock.h> | ||
#include <linux/ioport.h> | ||
|
||
#include <mach/map.h> | ||
#include <plat/devs.h> | ||
#include <plat/irqs.h> | ||
#include <plat/mfc.h> | ||
|
||
static struct resource s5p_mfc_resource[] = { | ||
[0] = { | ||
.start = S5P_PA_MFC, | ||
.end = S5P_PA_MFC + SZ_64K - 1, | ||
.flags = IORESOURCE_MEM, | ||
}, | ||
[1] = { | ||
.start = IRQ_MFC, | ||
.end = IRQ_MFC, | ||
.flags = IORESOURCE_IRQ, | ||
} | ||
}; | ||
|
||
struct platform_device s5p_device_mfc = { | ||
.name = "s5p-mfc", | ||
.id = -1, | ||
.num_resources = ARRAY_SIZE(s5p_mfc_resource), | ||
.resource = s5p_mfc_resource, | ||
}; | ||
|
||
/* | ||
* MFC hardware has 2 memory interfaces which are modelled as two separate | ||
* platform devices to let dma-mapping distinguish between them. | ||
* | ||
* MFC parent device (s5p_device_mfc) must be registered before memory | ||
* interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r). | ||
*/ | ||
|
||
static u64 s5p_mfc_dma_mask = DMA_BIT_MASK(32); | ||
|
||
struct platform_device s5p_device_mfc_l = { | ||
.name = "s5p-mfc-l", | ||
.id = -1, | ||
.dev = { | ||
.parent = &s5p_device_mfc.dev, | ||
.dma_mask = &s5p_mfc_dma_mask, | ||
.coherent_dma_mask = DMA_BIT_MASK(32), | ||
}, | ||
}; | ||
|
||
struct platform_device s5p_device_mfc_r = { | ||
.name = "s5p-mfc-r", | ||
.id = -1, | ||
.dev = { | ||
.parent = &s5p_device_mfc.dev, | ||
.dma_mask = &s5p_mfc_dma_mask, | ||
.coherent_dma_mask = DMA_BIT_MASK(32), | ||
}, | ||
}; | ||
|
||
struct s5p_mfc_reserved_mem { | ||
phys_addr_t base; | ||
unsigned long size; | ||
struct device *dev; | ||
}; | ||
|
||
static struct s5p_mfc_reserved_mem s5p_mfc_mem[2] __initdata; | ||
|
||
void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize, | ||
phys_addr_t lbase, unsigned int lsize) | ||
{ | ||
int i; | ||
|
||
s5p_mfc_mem[0].dev = &s5p_device_mfc_r.dev; | ||
s5p_mfc_mem[0].base = rbase; | ||
s5p_mfc_mem[0].size = rsize; | ||
|
||
s5p_mfc_mem[1].dev = &s5p_device_mfc_l.dev; | ||
s5p_mfc_mem[1].base = lbase; | ||
s5p_mfc_mem[1].size = lsize; | ||
|
||
for (i = 0; i < ARRAY_SIZE(s5p_mfc_mem); i++) { | ||
struct s5p_mfc_reserved_mem *area = &s5p_mfc_mem[i]; | ||
if (memblock_remove(area->base, area->size)) { | ||
printk(KERN_ERR "Failed to reserve memory for MFC device (%ld bytes at 0x%08lx)\n", | ||
area->size, (unsigned long) area->base); | ||
area->base = 0; | ||
} | ||
} | ||
} | ||
|
||
static int __init s5p_mfc_memory_init(void) | ||
{ | ||
int i; | ||
|
||
for (i = 0; i < ARRAY_SIZE(s5p_mfc_mem); i++) { | ||
struct s5p_mfc_reserved_mem *area = &s5p_mfc_mem[i]; | ||
if (!area->base) | ||
continue; | ||
|
||
if (dma_declare_coherent_memory(area->dev, area->base, | ||
area->base, area->size, | ||
DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE) == 0) | ||
printk(KERN_ERR "Failed to declare coherent memory for MFC device (%ld bytes at 0x%08lx)\n", | ||
area->size, (unsigned long) area->base); | ||
} | ||
return 0; | ||
} | ||
device_initcall(s5p_mfc_memory_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. | ||
*/ | ||
|
||
#ifndef __PLAT_S5P_MFC_H | ||
#define __PLAT_S5P_MFC_H | ||
|
||
/** | ||
* s5p_mfc_reserve_mem - function to early reserve memory for MFC driver | ||
* @rbase: base address for MFC 'right' memory interface | ||
* @rsize: size of the memory reserved for MFC 'right' interface | ||
* @lbase: base address for MFC 'left' memory interface | ||
* @lsize: size of the memory reserved for MFC 'left' interface | ||
* | ||
* This function reserves system memory for both MFC device memory | ||
* interfaces and registers it to respective struct device entries as | ||
* coherent memory. | ||
*/ | ||
void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize, | ||
phys_addr_t lbase, unsigned int lsize); | ||
|
||
#endif /* __PLAT_S5P_MFC_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters