viresh kumar | ff37f6e | 2010-04-01 12:49:09 +0100 | [diff] [blame] | 1 | /* |
viresh kumar | ff37f6e | 2010-04-01 12:49:09 +0100 | [diff] [blame] | 2 | * ARM PrimeXsys System Controller SP810 header file |
| 3 | * |
| 4 | * Copyright (C) 2009 ST Microelectronics |
Viresh Kumar | 10d8935 | 2012-06-20 12:53:02 -0700 | [diff] [blame] | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
viresh kumar | ff37f6e | 2010-04-01 12:49:09 +0100 | [diff] [blame] | 6 | * |
| 7 | * This file is licensed under the terms of the GNU General Public |
| 8 | * License version 2. This program is licensed "as is" without any |
| 9 | * warranty of any kind, whether express or implied. |
| 10 | */ |
| 11 | |
Sachin Kamat | e0ea041 | 2013-12-30 10:34:57 +0530 | [diff] [blame] | 12 | #ifndef __AMBA_SP810_H |
| 13 | #define __AMBA_SP810_H |
viresh kumar | ff37f6e | 2010-04-01 12:49:09 +0100 | [diff] [blame] | 14 | |
| 15 | #include <linux/io.h> |
| 16 | |
| 17 | /* sysctl registers offset */ |
| 18 | #define SCCTRL 0x000 |
| 19 | #define SCSYSSTAT 0x004 |
| 20 | #define SCIMCTRL 0x008 |
| 21 | #define SCIMSTAT 0x00C |
| 22 | #define SCXTALCTRL 0x010 |
| 23 | #define SCPLLCTRL 0x014 |
| 24 | #define SCPLLFCTRL 0x018 |
| 25 | #define SCPERCTRL0 0x01C |
| 26 | #define SCPERCTRL1 0x020 |
| 27 | #define SCPEREN 0x024 |
| 28 | #define SCPERDIS 0x028 |
| 29 | #define SCPERCLKEN 0x02C |
| 30 | #define SCPERSTAT 0x030 |
| 31 | #define SCSYSID0 0xEE0 |
| 32 | #define SCSYSID1 0xEE4 |
| 33 | #define SCSYSID2 0xEE8 |
| 34 | #define SCSYSID3 0xEEC |
| 35 | #define SCITCR 0xF00 |
| 36 | #define SCITIR0 0xF04 |
| 37 | #define SCITIR1 0xF08 |
| 38 | #define SCITOR 0xF0C |
| 39 | #define SCCNTCTRL 0xF10 |
| 40 | #define SCCNTDATA 0xF14 |
| 41 | #define SCCNTSTEP 0xF18 |
| 42 | #define SCPERIPHID0 0xFE0 |
| 43 | #define SCPERIPHID1 0xFE4 |
| 44 | #define SCPERIPHID2 0xFE8 |
| 45 | #define SCPERIPHID3 0xFEC |
| 46 | #define SCPCELLID0 0xFF0 |
| 47 | #define SCPCELLID1 0xFF4 |
| 48 | #define SCPCELLID2 0xFF8 |
| 49 | #define SCPCELLID3 0xFFC |
| 50 | |
Pawel Moll | bcd6f56 | 2012-09-18 15:17:48 +0100 | [diff] [blame] | 51 | #define SCCTRL_TIMERENnSEL_SHIFT(n) (15 + ((n) * 2)) |
| 52 | |
viresh kumar | ff37f6e | 2010-04-01 12:49:09 +0100 | [diff] [blame] | 53 | static inline void sysctl_soft_reset(void __iomem *base) |
| 54 | { |
Shiraz Hashim | b8272a6 | 2011-02-16 07:40:29 +0100 | [diff] [blame] | 55 | /* switch to slow mode */ |
| 56 | writel(0x2, base + SCCTRL); |
| 57 | |
viresh kumar | ff37f6e | 2010-04-01 12:49:09 +0100 | [diff] [blame] | 58 | /* writing any value to SCSYSSTAT reg will reset system */ |
| 59 | writel(0, base + SCSYSSTAT); |
| 60 | } |
| 61 | |
Sachin Kamat | e0ea041 | 2013-12-30 10:34:57 +0530 | [diff] [blame] | 62 | #endif /* __AMBA_SP810_H */ |