diff options
author | Dan Murphy <dmurphy@ti.com> | 2012-01-05 07:50:19 -0600 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 12:55:13 +0200 |
commit | b30c9109481a98a7581cd68f3c2ad3dc141ddac6 (patch) | |
tree | 65aa54273dee949e1cdb8cc310bce146bb4e650d | |
parent | 7b905dcb3e7d29d28907c4839fdf25a368a5353e (diff) | |
download | kernel_samsung_tuna-b30c9109481a98a7581cd68f3c2ad3dc141ddac6.tar.gz kernel_samsung_tuna-b30c9109481a98a7581cd68f3c2ad3dc141ddac6.tar.bz2 kernel_samsung_tuna-b30c9109481a98a7581cd68f3c2ad3dc141ddac6.zip |
ARM: OMAP: Fix ramconsole init.
Fix the issue when trying to register a platform device
before the platform device was initialized.
Postpone the device registration until the board file init.
Change-Id: I3920f9236fec957e4f63f39ff9aa3bae530af014
Signed-off-by: Dan Murphy <dmurphy@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/omap_ram_console.c | 33 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_ram_console.h | 6 |
2 files changed, 31 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/omap_ram_console.c b/arch/arm/mach-omap2/omap_ram_console.c index cf84c643a5e..03b87cdf7d6 100644 --- a/arch/arm/mach-omap2/omap_ram_console.c +++ b/arch/arm/mach-omap2/omap_ram_console.c @@ -43,6 +43,31 @@ static struct platform_device ram_console_device = { }; /** + * omap_ram_console_register() - registers the ramconsole device + * + * Board files call this to register the ramconsole platform device. + * + * IMPORTANT: board files need to ensure that the DDR configurations + * enable self refresh mode for this to function properly. + */ +int omap_ram_console_register(void) +{ + int ret; + + ret = platform_device_register(&ram_console_device); + if (ret) { + pr_err("%s: unable to register ram console device:" + "start=0x%08x, end=0x%08x, ret=%d\n", + __func__, (u32)ram_console_resources[0].start, + (u32)ram_console_resources[0].end, ret); + memblock_add(ram_console_resources[0].start, + (ram_console_resources[0].end - ram_console_resources[0].start)); + } + + return ret; +} + +/** * omap_ram_console_init() - setup the ram console device for OMAP * @phy_addr: physical address of the start of ram console buffer * @size: ram console buffer size @@ -75,13 +100,5 @@ int __init omap_ram_console_init(phys_addr_t phy_addr, size_t size) ram_console_resources[0].start = phy_addr; ram_console_resources[0].end = phy_addr + size - 1; - ret = platform_device_register(&ram_console_device); - if (ret) { - pr_err("%s: unable to register ram console device:" - "start=0x%08x, size=0x%08x, ret=%d\n", - __func__, (u32)phy_addr, (u32)size, ret); - memblock_add(phy_addr, size); - } - return ret; } diff --git a/arch/arm/mach-omap2/omap_ram_console.h b/arch/arm/mach-omap2/omap_ram_console.h index edd75e8d484..fb41799b80c 100644 --- a/arch/arm/mach-omap2/omap_ram_console.h +++ b/arch/arm/mach-omap2/omap_ram_console.h @@ -23,11 +23,17 @@ #ifdef CONFIG_OMAP_RAM_CONSOLE extern int omap_ram_console_init(phys_addr_t phy_addr, size_t size); +extern int omap_ram_console_register(void); #else static inline int omap_ram_console_init(phys_addr_t phy_addr, size_t size) { return 0; } + +static inline int omap_ram_console_register(void) +{ + return 0; +} #endif /* CONFIG_OMAP_RAM_CONSOLE */ #endif |