diff options
Diffstat (limited to 'arch/arm/mach-imx/pm-imx6.c')
-rw-r--r-- | arch/arm/mach-imx/pm-imx6.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index 674a1537fae4..b03defb21473 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c | |||
@@ -85,6 +85,10 @@ static unsigned int cpu_type; | |||
85 | static void __iomem *ccm_base; | 85 | static void __iomem *ccm_base; |
86 | struct regmap *romcp; | 86 | struct regmap *romcp; |
87 | 87 | ||
88 | unsigned long total_suspend_size; | ||
89 | extern unsigned long imx6_suspend_start asm("imx6_suspend_start"); | ||
90 | extern unsigned long imx6_suspend_end asm("imx6_suspend_end"); | ||
91 | |||
88 | unsigned long save_ttbr1(void) | 92 | unsigned long save_ttbr1(void) |
89 | { | 93 | { |
90 | unsigned long lttbr1; | 94 | unsigned long lttbr1; |
@@ -415,7 +419,7 @@ void __init imx6_pm_map_io(void) | |||
415 | return; | 419 | return; |
416 | 420 | ||
417 | /* Set all entries to 0. */ | 421 | /* Set all entries to 0. */ |
418 | memset((void *)iram_tlb_base_addr, 0, SZ_16K); | 422 | memset((void *)iram_tlb_base_addr, 0, MX6Q_IRAM_TLB_SIZE); |
419 | 423 | ||
420 | /* | 424 | /* |
421 | * Make sure the IRAM virtual address has a mapping | 425 | * Make sure the IRAM virtual address has a mapping |
@@ -470,6 +474,8 @@ void imx6_pm_set_ccm_base(void __iomem *base) | |||
470 | 474 | ||
471 | void __init imx6_pm_init(void) | 475 | void __init imx6_pm_init(void) |
472 | { | 476 | { |
477 | unsigned long suspend_code_size; | ||
478 | |||
473 | if (!iram_tlb_base_addr) { | 479 | if (!iram_tlb_base_addr) { |
474 | pr_warn("No IRAM/OCRAM memory allocated for suspend/resume code. \ | 480 | pr_warn("No IRAM/OCRAM memory allocated for suspend/resume code. \ |
475 | Please ensure device tree has an entry fsl,lpm-sram\n"); | 481 | Please ensure device tree has an entry fsl,lpm-sram\n"); |
@@ -481,8 +487,11 @@ Please ensure device tree has an entry fsl,lpm-sram\n"); | |||
481 | suspend_iram_base = (void *)IMX_IO_P2V(iram_tlb_phys_addr) + | 487 | suspend_iram_base = (void *)IMX_IO_P2V(iram_tlb_phys_addr) + |
482 | MX6_SUSPEND_IRAM_ADDR_OFFSET; | 488 | MX6_SUSPEND_IRAM_ADDR_OFFSET; |
483 | 489 | ||
490 | suspend_code_size = (&imx6_suspend_end -&imx6_suspend_start) *4; | ||
484 | suspend_in_iram_fn = (void *)fncpy(suspend_iram_base, | 491 | suspend_in_iram_fn = (void *)fncpy(suspend_iram_base, |
485 | &imx6_suspend, MX6_SUSPEND_IRAM_SIZE); | 492 | &imx6_suspend, suspend_code_size); |
493 | /* Now add the space used for storing various registers and IO in suspend. */ | ||
494 | total_suspend_size = suspend_code_size + MX6_SUSPEND_IRAM_DATA_SIZE; | ||
486 | 495 | ||
487 | suspend_set_ops(&imx6_pm_ops); | 496 | suspend_set_ops(&imx6_pm_ops); |
488 | 497 | ||