|
6 | 6 | * Cyril Chemparathy <cyril@ti.com>
|
7 | 7 | * Santosh Shilimkar <santosh.shillimkar@ti.com>
|
8 | 8 | */
|
| 9 | + |
9 | 10 | #include <linux/io.h>
|
10 | 11 | #include <linux/dma-map-ops.h>
|
11 | 12 | #include <linux/init.h>
|
| 13 | +#include <linux/pm_runtime.h> |
| 14 | +#include <linux/pm_clock.h> |
12 | 15 | #include <linux/memblock.h>
|
| 16 | +#include <linux/of.h> |
13 | 17 | #include <linux/platform_device.h>
|
14 | 18 |
|
15 | 19 | #include <asm/setup.h>
|
|
18 | 22 | #include <asm/mach/time.h>
|
19 | 23 | #include <asm/page.h>
|
20 | 24 |
|
21 |
| -#include "keystone.h" |
22 |
| - |
23 | 25 | #define KEYSTONE_LOW_PHYS_START 0x80000000ULL
|
24 | 26 | #define KEYSTONE_LOW_PHYS_SIZE 0x80000000ULL /* 2G */
|
25 | 27 | #define KEYSTONE_LOW_PHYS_END (KEYSTONE_LOW_PHYS_START + \
|
|
30 | 32 | #define KEYSTONE_HIGH_PHYS_END (KEYSTONE_HIGH_PHYS_START + \
|
31 | 33 | KEYSTONE_HIGH_PHYS_SIZE - 1)
|
32 | 34 |
|
| 35 | +static struct dev_pm_domain keystone_pm_domain = { |
| 36 | + .ops = { |
| 37 | + USE_PM_CLK_RUNTIME_OPS |
| 38 | + USE_PLATFORM_PM_SLEEP_OPS |
| 39 | + }, |
| 40 | +}; |
| 41 | + |
| 42 | +static struct pm_clk_notifier_block platform_domain_notifier = { |
| 43 | + .pm_domain = &keystone_pm_domain, |
| 44 | + .con_ids = { NULL }, |
| 45 | +}; |
| 46 | + |
| 47 | +static const struct of_device_id of_keystone_table[] = { |
| 48 | + {.compatible = "ti,k2hk"}, |
| 49 | + {.compatible = "ti,k2e"}, |
| 50 | + {.compatible = "ti,k2l"}, |
| 51 | + { /* end of list */ }, |
| 52 | +}; |
| 53 | + |
| 54 | +static int __init keystone_pm_runtime_init(void) |
| 55 | +{ |
| 56 | + struct device_node *np; |
| 57 | + |
| 58 | + np = of_find_matching_node(NULL, of_keystone_table); |
| 59 | + if (!np) |
| 60 | + return 0; |
| 61 | + |
| 62 | + pm_clk_add_notifier(&platform_bus_type, &platform_domain_notifier); |
| 63 | + |
| 64 | + return 0; |
| 65 | +} |
| 66 | + |
33 | 67 | #ifdef CONFIG_ARM_LPAE
|
34 | 68 | static int keystone_platform_notifier(struct notifier_block *nb,
|
35 | 69 | unsigned long event, void *data)
|
|
0 commit comments