Commit 57abae34c8ec0b6d86a66ea2d53589b2564a70d5
1 parent
90c0ebd772
Exists in
master
arm:omap:am335x: Add cpuidle related board data
Add board specific cpuidle hookup for AM335x EVM Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Showing 1 changed file with 49 additions and 0 deletions Side-by-side Diff
arch/arm/mach-omap2/board-am335xevm.c
... | ... | @@ -56,6 +56,7 @@ |
56 | 56 | #include <plat/mmc.h> |
57 | 57 | |
58 | 58 | #include "board-flash.h" |
59 | +#include "cpuidle33xx.h" | |
59 | 60 | #include "mux.h" |
60 | 61 | #include "devices.h" |
61 | 62 | #include "hsmmc.h" |
62 | 63 | |
... | ... | @@ -1870,8 +1871,56 @@ |
1870 | 1871 | setup_pin_mux(clkout2_pin_mux); |
1871 | 1872 | } |
1872 | 1873 | |
1874 | +void __iomem * __init am33xx_get_mem_ctlr(void) | |
1875 | +{ | |
1876 | + void __iomem *am33xx_emif_base; | |
1877 | + | |
1878 | + am33xx_emif_base = ioremap(AM33XX_EMIF0_BASE, SZ_32K); | |
1879 | + | |
1880 | + if (!am33xx_emif_base) | |
1881 | + pr_warning("%s: Unable to map DDR2 controller", __func__); | |
1882 | + | |
1883 | + return am33xx_emif_base; | |
1884 | +} | |
1885 | + | |
1886 | +static struct resource am33xx_cpuidle_resources[] = { | |
1887 | + { | |
1888 | + .start = AM33XX_EMIF0_BASE, | |
1889 | + .end = AM33XX_EMIF0_BASE + SZ_32K - 1, | |
1890 | + .flags = IORESOURCE_MEM, | |
1891 | + }, | |
1892 | +}; | |
1893 | + | |
1894 | +/* AM33XX devices support DDR2 power down */ | |
1895 | +static struct am33xx_cpuidle_config am33xx_cpuidle_pdata = { | |
1896 | + .ddr2_pdown = 1, | |
1897 | +}; | |
1898 | + | |
1899 | +static struct platform_device am33xx_cpuidle_device = { | |
1900 | + .name = "cpuidle-am33xx", | |
1901 | + .num_resources = ARRAY_SIZE(am33xx_cpuidle_resources), | |
1902 | + .resource = am33xx_cpuidle_resources, | |
1903 | + .dev = { | |
1904 | + .platform_data = &am33xx_cpuidle_pdata, | |
1905 | + }, | |
1906 | +}; | |
1907 | + | |
1908 | +static void __init am33xx_cpuidle_init(void) | |
1909 | +{ | |
1910 | + int ret; | |
1911 | + | |
1912 | + am33xx_cpuidle_pdata.emif_base = am33xx_get_mem_ctlr(); | |
1913 | + | |
1914 | + ret = platform_device_register(&am33xx_cpuidle_device); | |
1915 | + | |
1916 | + if (ret) | |
1917 | + pr_warning("AM33XX cpuidle registration failed\n"); | |
1918 | + | |
1919 | +} | |
1920 | + | |
1873 | 1921 | static void __init am335x_evm_init(void) |
1874 | 1922 | { |
1923 | + am33xx_cpuidle_init(); | |
1875 | 1924 | am33xx_mux_init(board_mux); |
1876 | 1925 | omap_serial_init(); |
1877 | 1926 | am335x_rtc_init(); |