method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
device_name = "aml_pm";
status = "okay";
- reg = <0xff8000a8 0x4>,
- <0xff80023c 0x4>;
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
-
secmon {
compatible = "amlogic, secmon";
memory-region = <&secmon_reserved>;
method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
status = "okay";
device_name = "aml_pm";
- reg = <0xff8000a8 0x4>,
- <0xff80023c 0x4>;
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
status = "okay";
device_name = "aml_pm";
- reg = <0xff8000a8 0x4>,
- <0xff80023c 0x4>;
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
status = "okay";
device_name = "aml_pm";
- reg = <0xff8000a8 0x4>,
- <0xff80023c 0x4>;
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm{
+ aml_pm {
compatible = "amlogic, pm";
+ status = "okay";
device_name = "aml_pm";
- reg = <0xc81000a8 0x4>,
- <0xc810023c 0x4>;
+ debug_reg = <0xc81000a8>;
+ exit_reg = <0xc810023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm{
+ aml_pm {
compatible = "amlogic, pm";
+ status = "okay";
device_name = "aml_pm";
- reg = <0xc81000a8 0x4
- 0xc810023c 0x4>;
+ debug_reg = <0xc81000a8>;
+ exit_reg = <0xc810023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm{
+ aml_pm {
compatible = "amlogic, pm";
+ status = "okay";
device_name = "aml_pm";
- reg = <0xc81000a8 0x4>,
- <0xc810023c 0x4>;
+ debug_reg = <0xc81000a8>;
+ exit_reg = <0xc810023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
status = "okay";
device_name = "aml_pm";
- reg = <0xff8000a8 0x4>,
- <0xff80023c 0x4>;
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
secmon {
#clock-cells = <0>;
};
- meson_suspend: pm {
+ aml_pm {
compatible = "amlogic, pm";
- /*gxbaby-suspend;*/
status = "okay";
- reg = <0xff8000a8 0x4>,
- <0xff80023c 0x4>;
+ device_name = "aml_pm";
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
cpuinfo {
#clock-cells = <0>;
};
- meson_suspend: pm {
+ aml_pm {
compatible = "amlogic, pm";
- /*gxbaby-suspend;*/
status = "okay";
- reg = <0xff8000a8 0x4>,
- <0xff80023c 0x4>;
+ device_name = "aml_pm";
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
cpuinfo {
pinctrl-1=<&jtag_apee_pins>;
};
- meson_suspend: pm {
+ aml_pm {
compatible = "amlogic, pm";
status = "okay";
- reg = <0xc81000a8 0x4>,
- <0xc810023c 0x4>;
+ device_name = "aml_pm";
+ debug_reg = <0xc81000a8>;
+ exit_reg = <0xc810023c>;
};
reboot {
method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
- device_name = "aml_pm";
- /*gxbaby-suspend;*/
status = "okay";
- reg = <0xff8000a8 0x4>,
- <0xff80023c 0x4>;
+ device_name = "aml_pm";
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
device_name = "aml_pm";
status = "okay";
- reg = <0x0 0xff8000a8 0x0 0x4>,
- <0x0 0xff80023c 0x0 0x4>;
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
-
secmon {
compatible = "amlogic, secmon";
memory-region = <&secmon_reserved>;
method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
status = "okay";
device_name = "aml_pm";
- reg = <0x0 0xff8000a8 0x0 0x4>,
- <0x0 0xff80023c 0x0 0x4>;
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
status = "okay";
device_name = "aml_pm";
- reg = <0x0 0xff8000a8 0x0 0x4>,
- <0x0 0xff80023c 0x0 0x4>;
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
secmon {
compatible = "amlogic, pm";
status = "okay";
device_name = "aml_pm";
- reg = <0x0 0xff8000a8 0x0 0x4>,
- <0x0 0xff80023c 0x0 0x4>;
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm{
+ aml_pm {
compatible = "amlogic, pm";
+ status = "okay";
device_name = "aml_pm";
- reg = <0x0 0xc81000a8 0x0 0x4>,
- <0x0 0xc810023c 0x0 0x4>;
+ debug_reg = <0xc81000a8>;
+ exit_reg = <0xc810023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm{
+ aml_pm {
compatible = "amlogic, pm";
+ status = "okay";
device_name = "aml_pm";
- reg = <0x0 0xc81000a8 0x0 0x4
- 0x0 0xc810023c 0x0 0x4>;
+ debug_reg = <0xc81000a8>;
+ exit_reg = <0xc810023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm{
+ aml_pm {
compatible = "amlogic, pm";
+ status = "okay";
device_name = "aml_pm";
- reg = <0x0 0xc81000a8 0x0 0x4>,
- <0x0 0xc810023c 0x0 0x4>;
+ debug_reg = <0xc81000a8>;
+ exit_reg = <0xc810023c>;
};
secmon {
method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
status = "okay";
device_name = "aml_pm";
- reg = <0x0 0xff8000a8 0x0 0x4>,
- <0x0 0xff80023c 0x0 0x4>;
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
secmon {
#clock-cells = <0>;
};
- meson_suspend: pm {
+ aml_pm {
compatible = "amlogic, pm";
- /*gxbaby-suspend;*/
status = "okay";
- reg = <0x0 0xff8000a8 0x0 0x4>,
- <0x0 0xff80023c 0x0 0x4>;
+ device_name = "aml_pm";
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
cpuinfo {
#clock-cells = <0>;
};
- meson_suspend: pm {
+ aml_pm {
compatible = "amlogic, pm";
- /*gxbaby-suspend;*/
status = "okay";
- reg = <0x0 0xff8000a8 0x0 0x4>,
- <0x0 0xff80023c 0x0 0x4>;
+ device_name = "aml_pm";
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
cpuinfo {
pinctrl-1=<&jtag_apee_pins>;
};
- meson_suspend: pm {
+ aml_pm {
compatible = "amlogic, pm";
status = "okay";
- reg = <0x0 0xc81000a8 0x0 0x4>,
- <0x0 0xc810023c 0x0 0x4>;
+ device_name = "aml_pm";
+ debug_reg = <0xc81000a8>;
+ exit_reg = <0xc810023c>;
};
reboot {
method = "smc";
};
- meson_suspend:pm {
+ aml_pm {
compatible = "amlogic, pm";
- device_name = "aml_pm";
- /*gxbaby-suspend;*/
status = "okay";
- reg = <0x0 0xff8000a8 0x0 0x4>,
- <0x0 0xff80023c 0x0 0x4>;
+ device_name = "aml_pm";
+ debug_reg = <0xff8000a8>;
+ exit_reg = <0xff80023c>;
};
secmon {
{
struct device_node *cpu_node;
struct device_node *state_node;
- int count = 0;
+ int count = 0, ret;
u32 ver = psci_get_version();
+ u32 paddr = 0;
pr_info("enter meson_pm_probe!\n");
suspend_set_ops(&meson_gx_ops);
}
- debug_reg = of_iomap(pdev->dev.of_node, 0);
- exit_reg = of_iomap(pdev->dev.of_node, 1);
+ ret = of_property_read_u32(pdev->dev.of_node,
+ "debug_reg", &paddr);
+ if (!ret) {
+ pr_debug("debug_reg: 0x%x\n", paddr);
+ debug_reg = ioremap(paddr, 0x4);
+ if (IS_ERR_OR_NULL(debug_reg))
+ goto uniomap;
+ }
+
+ ret = of_property_read_u32(pdev->dev.of_node,
+ "exit_reg", &paddr);
+ if (!ret) {
+ pr_debug("exit_reg: 0x%x\n", paddr);
+ exit_reg = ioremap(paddr, 0x4);
+ if (IS_ERR_OR_NULL(exit_reg))
+ goto uniomap;
+ }
+
device_create_file(&pdev->dev, &dev_attr_suspend_reason);
device_create_file(&pdev->dev, &dev_attr_time_out);
- device_rename(&pdev->dev, "aml_pm");
#ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND
if (lgcy_early_suspend_init())
return -1;
pr_info("meson_pm_probe done\n");
return 0;
+uniomap:
+ if (debug_reg)
+ iounmap(debug_reg);
+ return -ENXIO;
}
-static int __exit meson_pm_remove(struct platform_device *pdev)
+static int meson_pm_remove(struct platform_device *pdev)
{
return 0;
}
.owner = THIS_MODULE,
.of_match_table = amlogic_pm_dt_match,
},
- .remove = __exit_p(meson_pm_remove),
+ .probe = meson_pm_probe,
+ .remove = meson_pm_remove,
};
static int __init meson_pm_init(void)
{
- return platform_driver_probe(&meson_pm_driver, meson_pm_probe);
+ return platform_driver_register(&meson_pm_driver);
}
late_initcall(meson_pm_init);