X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=arch%2Farm%2Fmach-at91%2Fsetup.c;h=aa64294c7db39e9fba2da9cdffb46a9ac7d1c907;hp=9ea41838f5dba7422f4646944164935bdb528d52;hb=fb149f9e2835446e02e796081635520b881dc351;hpb=8c3583b634d5705d8f604c0d9392bc273d19c256 diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index 9ea41838f5db..aa64294c7db3 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c @@ -7,6 +7,7 @@ #include #include +#include #include @@ -45,6 +46,26 @@ void __init at91_init_interrupts(unsigned int *priority) at91_gpio_irq_setup(); } +static struct map_desc sram_desc[2] __initdata; + +void __init at91_init_sram(int bank, unsigned long base, unsigned int length) +{ + struct map_desc *desc = &sram_desc[bank]; + + desc->virtual = AT91_IO_VIRT_BASE - length; + if (bank > 0) + desc->virtual -= sram_desc[bank - 1].length; + + desc->pfn = __phys_to_pfn(base); + desc->length = length; + desc->type = MT_DEVICE; + + pr_info("AT91: sram at 0x%lx of 0x%x mapped at 0x%lx\n", + base, length, desc->virtual); + + iotable_init(desc, 1); +} + static struct map_desc at91_io_desc __initdata = { .virtual = AT91_VA_BASE_SYS, .pfn = __phys_to_pfn(AT91_BASE_SYS), @@ -52,6 +73,24 @@ static struct map_desc at91_io_desc __initdata = { .type = MT_DEVICE, }; +void __iomem *at91_ioremap(unsigned long p, size_t size, unsigned int type) +{ + if (p >= AT91_BASE_SYS && p <= (AT91_BASE_SYS + SZ_16K - 1)) + return (void __iomem *)AT91_IO_P2V(p); + + return __arm_ioremap_caller(p, size, type, __builtin_return_address(0)); +} +EXPORT_SYMBOL(at91_ioremap); + +void at91_iounmap(volatile void __iomem *addr) +{ + unsigned long virt = (unsigned long)addr; + + if (virt >= VMALLOC_START && virt < VMALLOC_END) + __iounmap(addr); +} +EXPORT_SYMBOL(at91_iounmap); + #define AT91_DBGU0 0xfffff200 #define AT91_DBGU1 0xffffee00 @@ -248,5 +287,11 @@ void __init at91_map_io(void) void __init at91_initialize(unsigned long main_clock) { - at91_boot_soc.init(main_clock); + /* Init clock subsystem */ + at91_clock_init(main_clock); + + /* Register the processor-specific clocks */ + at91_boot_soc.register_clocks(); + + at91_boot_soc.init(); }