mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
supsend: update gx_pm driver [1/1]
PD#SWPL-7226 Problem: update gx_pm driver Solution: update gx_pm driver Verify: test pass on tl1_x309 Change-Id: If078b0744cb8ce46029d77512d5755f4d40c2014 Signed-off-by: Hong Guo <hong.guo@amlogic.com>
This commit is contained in:
@@ -147,15 +147,14 @@
|
||||
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>;
|
||||
|
||||
@@ -183,12 +183,12 @@
|
||||
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 {
|
||||
|
||||
@@ -245,12 +245,12 @@
|
||||
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 {
|
||||
|
||||
@@ -245,12 +245,12 @@
|
||||
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 {
|
||||
|
||||
@@ -159,11 +159,12 @@
|
||||
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 {
|
||||
|
||||
@@ -161,11 +161,12 @@
|
||||
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 {
|
||||
|
||||
@@ -302,11 +302,12 @@
|
||||
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 {
|
||||
|
||||
@@ -183,12 +183,12 @@
|
||||
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 {
|
||||
|
||||
@@ -240,12 +240,12 @@
|
||||
#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 {
|
||||
|
||||
@@ -242,12 +242,12 @@
|
||||
#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 {
|
||||
|
||||
@@ -377,11 +377,12 @@
|
||||
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 {
|
||||
|
||||
@@ -159,13 +159,12 @@
|
||||
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 {
|
||||
|
||||
@@ -147,15 +147,14 @@
|
||||
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>;
|
||||
|
||||
@@ -183,12 +183,12 @@
|
||||
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 {
|
||||
|
||||
@@ -245,12 +245,12 @@
|
||||
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 {
|
||||
|
||||
@@ -249,8 +249,8 @@
|
||||
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 {
|
||||
|
||||
@@ -147,11 +147,12 @@
|
||||
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 {
|
||||
|
||||
@@ -161,11 +161,12 @@
|
||||
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 {
|
||||
|
||||
@@ -302,11 +302,12 @@
|
||||
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 {
|
||||
|
||||
@@ -183,12 +183,12 @@
|
||||
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 {
|
||||
|
||||
@@ -229,12 +229,12 @@
|
||||
#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 {
|
||||
|
||||
@@ -231,12 +231,12 @@
|
||||
#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 {
|
||||
|
||||
@@ -377,11 +377,12 @@
|
||||
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 {
|
||||
|
||||
@@ -159,13 +159,12 @@
|
||||
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 {
|
||||
|
||||
@@ -218,8 +218,9 @@ static int __init meson_pm_probe(struct platform_device *pdev)
|
||||
{
|
||||
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");
|
||||
|
||||
@@ -245,11 +246,26 @@ static int __init meson_pm_probe(struct platform_device *pdev)
|
||||
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;
|
||||
@@ -258,9 +274,13 @@ static int __init meson_pm_probe(struct platform_device *pdev)
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -277,12 +297,13 @@ static struct platform_driver meson_pm_driver = {
|
||||
.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);
|
||||
|
||||
Reference in New Issue
Block a user