162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * ARM PrimeXsys System Controller SP810 header file 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Copyright (C) 2009 ST Microelectronics 562306a36Sopenharmony_ci * Viresh Kumar <vireshk@kernel.org> 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * This file is licensed under the terms of the GNU General Public 862306a36Sopenharmony_ci * License version 2. This program is licensed "as is" without any 962306a36Sopenharmony_ci * warranty of any kind, whether express or implied. 1062306a36Sopenharmony_ci */ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#ifndef __AMBA_SP810_H 1362306a36Sopenharmony_ci#define __AMBA_SP810_H 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci#include <linux/io.h> 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci/* sysctl registers offset */ 1862306a36Sopenharmony_ci#define SCCTRL 0x000 1962306a36Sopenharmony_ci#define SCSYSSTAT 0x004 2062306a36Sopenharmony_ci#define SCIMCTRL 0x008 2162306a36Sopenharmony_ci#define SCIMSTAT 0x00C 2262306a36Sopenharmony_ci#define SCXTALCTRL 0x010 2362306a36Sopenharmony_ci#define SCPLLCTRL 0x014 2462306a36Sopenharmony_ci#define SCPLLFCTRL 0x018 2562306a36Sopenharmony_ci#define SCPERCTRL0 0x01C 2662306a36Sopenharmony_ci#define SCPERCTRL1 0x020 2762306a36Sopenharmony_ci#define SCPEREN 0x024 2862306a36Sopenharmony_ci#define SCPERDIS 0x028 2962306a36Sopenharmony_ci#define SCPERCLKEN 0x02C 3062306a36Sopenharmony_ci#define SCPERSTAT 0x030 3162306a36Sopenharmony_ci#define SCSYSID0 0xEE0 3262306a36Sopenharmony_ci#define SCSYSID1 0xEE4 3362306a36Sopenharmony_ci#define SCSYSID2 0xEE8 3462306a36Sopenharmony_ci#define SCSYSID3 0xEEC 3562306a36Sopenharmony_ci#define SCITCR 0xF00 3662306a36Sopenharmony_ci#define SCITIR0 0xF04 3762306a36Sopenharmony_ci#define SCITIR1 0xF08 3862306a36Sopenharmony_ci#define SCITOR 0xF0C 3962306a36Sopenharmony_ci#define SCCNTCTRL 0xF10 4062306a36Sopenharmony_ci#define SCCNTDATA 0xF14 4162306a36Sopenharmony_ci#define SCCNTSTEP 0xF18 4262306a36Sopenharmony_ci#define SCPERIPHID0 0xFE0 4362306a36Sopenharmony_ci#define SCPERIPHID1 0xFE4 4462306a36Sopenharmony_ci#define SCPERIPHID2 0xFE8 4562306a36Sopenharmony_ci#define SCPERIPHID3 0xFEC 4662306a36Sopenharmony_ci#define SCPCELLID0 0xFF0 4762306a36Sopenharmony_ci#define SCPCELLID1 0xFF4 4862306a36Sopenharmony_ci#define SCPCELLID2 0xFF8 4962306a36Sopenharmony_ci#define SCPCELLID3 0xFFC 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ci#define SCCTRL_TIMERENnSEL_SHIFT(n) (15 + ((n) * 2)) 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_cistatic inline void sysctl_soft_reset(void __iomem *base) 5462306a36Sopenharmony_ci{ 5562306a36Sopenharmony_ci /* switch to slow mode */ 5662306a36Sopenharmony_ci writel(0x2, base + SCCTRL); 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci /* writing any value to SCSYSSTAT reg will reset system */ 5962306a36Sopenharmony_ci writel(0, base + SCSYSSTAT); 6062306a36Sopenharmony_ci} 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_ci#endif /* __AMBA_SP810_H */ 63