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>
Signed-off-by: Luan Yuan <luan.yuan@amlogic.com>
This commit is contained in:
Hong Guo
2019-04-18 16:42:01 +08:00
committed by Luan Yuan
parent 8c195df75b
commit 47855af10f
20 changed files with 93 additions and 70 deletions

View File

@@ -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>;

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -295,11 +295,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 {

View File

@@ -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 {

View File

@@ -237,12 +237,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 {

View File

@@ -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 {

View File

@@ -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>;

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -295,11 +295,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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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);