Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 //
0003 // Copyright 2004 Simtec Electronics
0004 //  Ben Dooks <ben@simtec.co.uk>
0005 //
0006 // http://armlinux.simtec.co.uk/
0007 //
0008 // Power Management helpers for Simtec S3C24XX implementations
0009 
0010 #include <linux/kernel.h>
0011 #include <linux/types.h>
0012 #include <linux/interrupt.h>
0013 #include <linux/list.h>
0014 #include <linux/timer.h>
0015 #include <linux/init.h>
0016 #include <linux/device.h>
0017 #include <linux/io.h>
0018 
0019 #include <asm/mach/arch.h>
0020 #include <asm/mach/map.h>
0021 
0022 #include "map.h"
0023 #include "regs-gpio.h"
0024 
0025 #include <asm/mach-types.h>
0026 
0027 #include "pm.h"
0028 
0029 #include "regs-mem-s3c24xx.h"
0030 
0031 #define COPYRIGHT ", Copyright 2005 Simtec Electronics"
0032 
0033 /* pm_simtec_init
0034  *
0035  * enable the power management functions
0036 */
0037 
0038 static __init int pm_simtec_init(void)
0039 {
0040     unsigned long gstatus4;
0041 
0042     /* check which machine we are running on */
0043 
0044     if (!machine_is_bast() && !machine_is_vr1000() &&
0045         !machine_is_anubis() && !machine_is_osiris() &&
0046         !machine_is_aml_m5900())
0047         return 0;
0048 
0049     printk(KERN_INFO "Simtec Board Power Management" COPYRIGHT "\n");
0050 
0051     gstatus4  = (__raw_readl(S3C2410_BANKCON7) & 0x3) << 30;
0052     gstatus4 |= (__raw_readl(S3C2410_BANKCON6) & 0x3) << 28;
0053     gstatus4 |= (__raw_readl(S3C2410_BANKSIZE) & S3C2410_BANKSIZE_MASK);
0054 
0055     __raw_writel(gstatus4, S3C2410_GSTATUS4);
0056 
0057     return s3c_pm_init();
0058 }
0059 
0060 arch_initcall(pm_simtec_init);