diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007/Documentation/arm/Samsung-S3C24XX/Suspend.txt linux-2.6.20-rmk-12feb2007-pm1/Documentation/arm/Samsung-S3C24XX/Suspend.txt --- linux-2.6.20-rmk-12feb2007/Documentation/arm/Samsung-S3C24XX/Suspend.txt 2007-02-04 18:44:54.000000000 +0000 +++ linux-2.6.20-rmk-12feb2007-pm1/Documentation/arm/Samsung-S3C24XX/Suspend.txt 2007-02-13 14:24:34.000000000 +0000 @@ -53,6 +53,11 @@ Machine Support saving the resume address, if your board requires it, then contact the maintainer and discuss what is required. + The include/asm-arm/plat-s3c24xx/pm.h defines an hook pm_board_prep + if the board needs to process something very late in the suspend + process. For example, the htc pm system writes a check value of part + of the RAM for the bootloader to check on resumption. + Note, the original method of adding an late_initcall() is wrong, and will end up initialising all compiled machines' pm init! diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007/include/asm-arm/plat-s3c24xx/pm.h linux-2.6.20-rmk-12feb2007-pm1/include/asm-arm/plat-s3c24xx/pm.h --- linux-2.6.20-rmk-12feb2007/include/asm-arm/plat-s3c24xx/pm.h 2007-02-12 10:28:24.000000000 +0000 +++ linux-2.6.20-rmk-12feb2007-pm1/include/asm-arm/plat-s3c24xx/pm.h 2007-02-13 14:15:05.000000000 +0000 @@ -39,6 +39,10 @@ extern unsigned long s3c_irqwake_eintall extern void (*pm_cpu_prep)(void); extern void (*pm_cpu_sleep)(void); +/* use these if the board needs very late code to suspend */ + +extern void (*pm_board_prep)(void); + /* Flags for PM Control */ extern unsigned long s3c_pm_flags; diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007/arch/arm/plat-s3c24xx/pm.c linux-2.6.20-rmk-12feb2007-pm1/arch/arm/plat-s3c24xx/pm.c --- linux-2.6.20-rmk-12feb2007/arch/arm/plat-s3c24xx/pm.c 2007-02-12 10:28:24.000000000 +0000 +++ linux-2.6.20-rmk-12feb2007-pm1/arch/arm/plat-s3c24xx/pm.c 2007-02-13 14:15:46.000000000 +0000 @@ -488,6 +488,7 @@ static void s3c2410_pm_configure_extint( void (*pm_cpu_prep)(void); void (*pm_cpu_sleep)(void); +void (*pm_board_prep)(void); #define any_allowed(mask, allow) (((mask) & (allow)) != (allow)) @@ -564,6 +565,11 @@ static int s3c2410_pm_enter(suspend_stat pm_cpu_prep(); + if (pm_board_prep) { + flush_cache_all(); + pm_board_prep(); + } + /* flush cache back to ram */ flush_cache_all();