2017-12-25 22:54:35 +03:00
/* SPDX-License-Identifier: GPL-2.0 */
/*
2011-08-19 21:18:18 +04:00
* Copyright ( c ) 2011 Samsung Electronics Co . , Ltd .
* http : //www.samsung.com/
2005-04-17 02:20:36 +04:00
*
* Copyright ( c ) 2004 - 2005 Simtec Electronics
* Ben Dooks < ben @ simtec . co . uk >
*
2011-08-19 21:18:18 +04:00
* Header file for Samsung CPU support
2017-12-25 22:54:35 +03:00
*/
2005-04-17 02:20:36 +04:00
/* todo - fix when rmk changes iodescs to use `void __iomem *` */
2009-11-17 10:41:17 +03:00
# ifndef __SAMSUNG_PLAT_CPU_H
# define __SAMSUNG_PLAT_CPU_H
2011-08-19 21:18:18 +04:00
extern unsigned long samsung_cpu_id ;
2014-03-18 02:28:09 +04:00
# define S3C2410_CPU_ID 0x32410000
# define S3C2410_CPU_MASK 0xFFFFFFFF
2011-08-19 21:18:18 +04:00
# define S3C24XX_CPU_ID 0x32400000
# define S3C24XX_CPU_MASK 0xFFF00000
2013-02-12 22:12:06 +04:00
# define S3C2412_CPU_ID 0x32412000
# define S3C2412_CPU_MASK 0xFFFFF000
2011-08-19 21:18:18 +04:00
# define S3C6400_CPU_ID 0x36400000
# define S3C6410_CPU_ID 0x36410000
2011-09-05 14:11:40 +04:00
# define S3C64XX_CPU_MASK 0xFFFFF000
2011-08-19 21:18:18 +04:00
# define S5PV210_CPU_ID 0x43110000
# define S5PV210_CPU_MASK 0xFFFFF000
# define IS_SAMSUNG_CPU(name, id, mask) \
static inline int is_samsung_ # # name ( void ) \
{ \
return ( ( samsung_cpu_id & mask ) = = ( id & mask ) ) ; \
}
2014-03-18 02:28:09 +04:00
IS_SAMSUNG_CPU ( s3c2410 , S3C2410_CPU_ID , S3C2410_CPU_MASK )
2011-08-19 21:18:18 +04:00
IS_SAMSUNG_CPU ( s3c24xx , S3C24XX_CPU_ID , S3C24XX_CPU_MASK )
2013-02-12 22:12:06 +04:00
IS_SAMSUNG_CPU ( s3c2412 , S3C2412_CPU_ID , S3C2412_CPU_MASK )
2011-10-18 03:39:57 +04:00
IS_SAMSUNG_CPU ( s3c6400 , S3C6400_CPU_ID , S3C64XX_CPU_MASK )
IS_SAMSUNG_CPU ( s3c6410 , S3C6410_CPU_ID , S3C64XX_CPU_MASK )
2011-08-19 21:18:18 +04:00
# if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \
defined ( CONFIG_CPU_S3C2416 ) | | defined ( CONFIG_CPU_S3C2440 ) | | \
defined ( CONFIG_CPU_S3C2442 ) | | defined ( CONFIG_CPU_S3C244X ) | | \
defined ( CONFIG_CPU_S3C2443 )
# define soc_is_s3c24xx() is_samsung_s3c24xx()
2014-03-18 02:28:09 +04:00
# define soc_is_s3c2410() is_samsung_s3c2410()
2011-08-19 21:18:18 +04:00
# else
# define soc_is_s3c24xx() 0
2014-03-18 02:28:09 +04:00
# define soc_is_s3c2410() 0
2011-08-19 21:18:18 +04:00
# endif
2013-02-12 22:12:06 +04:00
# if defined(CONFIG_CPU_S3C2412)
# define soc_is_s3c2412() is_samsung_s3c2412()
# else
# define soc_is_s3c2412() 0
# endif
2011-08-19 21:18:18 +04:00
# if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
2013-08-25 21:00:37 +04:00
# define soc_is_s3c6400() is_samsung_s3c6400()
# define soc_is_s3c6410() is_samsung_s3c6410()
2011-10-18 03:39:57 +04:00
# define soc_is_s3c64xx() (is_samsung_s3c6400() || is_samsung_s3c6410())
2011-08-19 21:18:18 +04:00
# else
2013-08-25 21:00:37 +04:00
# define soc_is_s3c6400() 0
# define soc_is_s3c6410() 0
2011-08-19 21:18:18 +04:00
# define soc_is_s3c64xx() 0
# endif
2006-01-26 18:20:50 +03:00
# define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
2005-04-17 02:20:36 +04:00
2012-06-20 11:34:25 +04:00
# ifndef KHZ
# define KHZ (1000)
# endif
2005-04-17 02:20:36 +04:00
# ifndef MHZ
# define MHZ (1000*1000)
# endif
2008-10-21 17:06:43 +04:00
# define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000)
2005-04-17 02:20:36 +04:00
/* forward declaration */
2006-06-19 02:04:05 +04:00
struct s3c24xx_uart_resources ;
struct platform_device ;
2005-04-17 02:20:36 +04:00
struct s3c2410_uartcfg ;
struct map_desc ;
2008-10-21 17:06:31 +04:00
/* per-cpu initialisation function table. */
struct cpu_table {
unsigned long idcode ;
unsigned long idmask ;
void ( * map_io ) ( void ) ;
void ( * init_uarts ) ( struct s3c2410_uartcfg * cfg , int no ) ;
void ( * init_clocks ) ( int xtal ) ;
int ( * init ) ( void ) ;
const char * name ;
} ;
extern void s3c_init_cpu ( unsigned long idcode ,
struct cpu_table * cpus , unsigned int cputab_size ) ;
2005-04-17 02:20:36 +04:00
/* core initialisation functions */
extern void s3c24xx_init_io ( struct map_desc * mach_desc , int size ) ;
2011-08-20 07:18:07 +04:00
extern void s3c64xx_init_cpu ( void ) ;
2011-08-20 08:41:21 +04:00
2005-04-17 02:20:36 +04:00
extern void s3c24xx_init_uarts ( struct s3c2410_uartcfg * cfg , int no ) ;
extern void s3c24xx_init_clocks ( int xtal ) ;
2006-06-19 02:04:05 +04:00
extern void s3c24xx_init_uartdevs ( char * name ,
struct s3c24xx_uart_resources * res ,
struct s3c2410_uartcfg * cfg , int no ) ;
2011-04-23 00:03:21 +04:00
extern struct syscore_ops s3c2410_pm_syscore_ops ;
extern struct syscore_ops s3c2412_pm_syscore_ops ;
extern struct syscore_ops s3c2416_pm_syscore_ops ;
extern struct syscore_ops s3c244x_pm_syscore_ops ;
2011-12-22 04:01:38 +04:00
extern struct bus_type s3c6410_subsys ;
2008-12-12 03:24:31 +03:00
2009-11-17 10:41:17 +03:00
# endif