From 54c272acd16dbfb7b83948b04bf19ba451885284 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 3 Jul 2008 11:24:30 +0100 Subject: [PATCH] [ARM] JIVE: Initialise the sleep configuration registers Ensure that the S3C2412 sleep configuration registers are approriately setup so that the device can safely go to sleep. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2412/mach-jive.c | 88 +++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c index 05da51d1ce4e..7cfab868cce3 100644 --- a/arch/arm/mach-s3c2412/mach-jive.c +++ b/arch/arm/mach-s3c2412/mach-jive.c @@ -319,6 +319,94 @@ static void __init jive_machine_init(void) sysdev_class_register(&jive_pm_sysclass); sysdev_register(&jive_pm_sysdev); + /* write our sleep configurations for the IO. Pull down all unused + * IO, ensure that we have turned off all peripherals we do not + * need, and configure the ones we do need. */ + + /* Port B sleep */ + + __raw_writel(S3C2412_SLPCON_IN(0) | + S3C2412_SLPCON_PULL(1) | + S3C2412_SLPCON_HIGH(2) | + S3C2412_SLPCON_PULL(3) | + S3C2412_SLPCON_PULL(4) | + S3C2412_SLPCON_PULL(5) | + S3C2412_SLPCON_PULL(6) | + S3C2412_SLPCON_HIGH(7) | + S3C2412_SLPCON_PULL(8) | + S3C2412_SLPCON_PULL(9) | + S3C2412_SLPCON_PULL(10), S3C2412_GPBSLPCON); + + /* Port C sleep */ + + __raw_writel(S3C2412_SLPCON_PULL(0) | + S3C2412_SLPCON_PULL(1) | + S3C2412_SLPCON_PULL(2) | + S3C2412_SLPCON_PULL(3) | + S3C2412_SLPCON_PULL(4) | + S3C2412_SLPCON_PULL(5) | + S3C2412_SLPCON_LOW(6) | + S3C2412_SLPCON_PULL(6) | + S3C2412_SLPCON_PULL(7) | + S3C2412_SLPCON_PULL(8) | + S3C2412_SLPCON_PULL(9) | + S3C2412_SLPCON_PULL(10) | + S3C2412_SLPCON_PULL(11) | + S3C2412_SLPCON_PULL(12) | + S3C2412_SLPCON_PULL(13) | + S3C2412_SLPCON_PULL(14) | + S3C2412_SLPCON_PULL(15), S3C2412_GPCSLPCON); + + /* Port D sleep */ + + __raw_writel(S3C2412_SLPCON_ALL_PULL, S3C2412_GPDSLPCON); + + /* Port F sleep */ + + __raw_writel(S3C2412_SLPCON_LOW(0) | + S3C2412_SLPCON_LOW(1) | + S3C2412_SLPCON_LOW(2) | + S3C2412_SLPCON_EINT(3) | + S3C2412_SLPCON_EINT(4) | + S3C2412_SLPCON_EINT(5) | + S3C2412_SLPCON_EINT(6) | + S3C2412_SLPCON_EINT(7), S3C2412_GPFSLPCON); + + /* Port G sleep */ + + __raw_writel(S3C2412_SLPCON_IN(0) | + S3C2412_SLPCON_IN(1) | + S3C2412_SLPCON_IN(2) | + S3C2412_SLPCON_IN(3) | + S3C2412_SLPCON_IN(4) | + S3C2412_SLPCON_IN(5) | + S3C2412_SLPCON_IN(6) | + S3C2412_SLPCON_IN(7) | + S3C2412_SLPCON_PULL(8) | + S3C2412_SLPCON_PULL(9) | + S3C2412_SLPCON_IN(10) | + S3C2412_SLPCON_PULL(11) | + S3C2412_SLPCON_PULL(12) | + S3C2412_SLPCON_PULL(13) | + S3C2412_SLPCON_IN(14) | + S3C2412_SLPCON_PULL(15), S3C2412_GPGSLPCON); + + /* Port H sleep */ + + __raw_writel(S3C2412_SLPCON_PULL(0) | + S3C2412_SLPCON_PULL(1) | + S3C2412_SLPCON_PULL(2) | + S3C2412_SLPCON_PULL(3) | + S3C2412_SLPCON_PULL(4) | + S3C2412_SLPCON_PULL(5) | + S3C2412_SLPCON_PULL(6) | + S3C2412_SLPCON_IN(7) | + S3C2412_SLPCON_IN(8) | + S3C2412_SLPCON_PULL(9) | + S3C2412_SLPCON_IN(10), S3C2412_GPHSLPCON); + + /* initialise the power management now we've setup everything. */ + s3c2410_pm_init(); s3c_device_nand.dev.platform_data = &jive_nand_info; -- 2.20.1