Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192122
b: refs/heads/master
c: bcd6a1c
h: refs/heads/master
v: v3
  • Loading branch information
Cyril Chemparathy authored and Kevin Hilman committed May 13, 2010
1 parent 1c742ec commit 8408a32
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 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: 779b0d53ca41873d59225eb776c5d4493a0abd0f
refs/heads/master: bcd6a1c695c8b404bfde22b276186ac52a20291b
7 changes: 3 additions & 4 deletions trunk/arch/arm/mach-davinci/da830.c
Original file line number Diff line number Diff line change
Expand Up @@ -1210,9 +1210,8 @@ static struct davinci_soc_info davinci_soc_info_da830 = {

void __init da830_init(void)
{
da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K);
if (WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module"))
return;

davinci_common_init(&davinci_soc_info_da830);

da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K);
WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module");
}
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-davinci/da850.c
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,8 @@ void __init da850_init(void)
{
unsigned int v;

davinci_common_init(&davinci_soc_info_da850);

da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K);
if (WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module"))
return;
Expand All @@ -1107,8 +1109,6 @@ void __init da850_init(void)
if (WARN(!da8xx_syscfg1_base, "Unable to map syscfg1 module"))
return;

davinci_common_init(&davinci_soc_info_da850);

/*
* Move the clock source of Async3 domain to PLL1 SYSCLK2.
* This helps keeping the peripherals on this domain insulated
Expand Down
8 changes: 7 additions & 1 deletion trunk/arch/arm/mach-davinci/include/mach/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ struct davinci_timer_info {

struct davinci_gpio_controller;

/* SoC specific init support */
/*
* SoC info passed into common davinci modules.
*
* Base addresses in this structure should be physical and not virtual.
* Modules that take such base addresses, should internally ioremap() them to
* use.
*/
struct davinci_soc_info {
struct map_desc *io_desc;
unsigned long io_desc_num;
Expand Down
20 changes: 15 additions & 5 deletions trunk/arch/arm/mach-davinci/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,29 @@
#include <linux/io.h>

#include <asm/tlb.h>
#include <asm/mach/map.h>

#define BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz)))
#define XLATE(p, pst, vst) ((void __iomem *)((p) - (pst) + (vst)))
#include <mach/common.h>

/*
* Intercept ioremap() requests for addresses in our fixed mapping regions.
*/
void __iomem *davinci_ioremap(unsigned long p, size_t size, unsigned int type)
{
if (BETWEEN(p, IO_PHYS, IO_SIZE))
return XLATE(p, IO_PHYS, IO_VIRT);
struct map_desc *desc = davinci_soc_info.io_desc;
int desc_num = davinci_soc_info.io_desc_num;
int i;

return __arm_ioremap_caller(p, size, type, __builtin_return_address(0));
for (i = 0; i < desc_num; i++, desc++) {
unsigned long iophys = __pfn_to_phys(desc->pfn);
unsigned long iosize = desc->length;

if (p >= iophys && (p + size) <= (iophys + iosize))
return __io(desc->virtual + p - iophys);
}

return __arm_ioremap_caller(p, size, type,
__builtin_return_address(0));
}
EXPORT_SYMBOL(davinci_ioremap);

Expand Down

0 comments on commit 8408a32

Please sign in to comment.