Skip to content

Commit 8317797

Browse files
author
Linus Walleij
committed
mfd: add DB5500 PRCMU driver
This adds the DB5500 PRCMU driver. Right now this one is pretty restricted in functionality, exposing a simple interface to send I2C messages. Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 3df57bc commit 8317797

7 files changed

Lines changed: 623 additions & 0 deletions

File tree

‎arch/arm/mach-ux500/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ menu "Ux500 SoC"
1212

1313
config UX500_SOC_DB5500
1414
bool "DB5500"
15+
select MFD_DB5500_PRCMU
1516

1617
config UX500_SOC_DB8500
1718
bool "DB8500"

‎arch/arm/mach-ux500/cpu.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/io.h>
1010
#include <linux/clk.h>
1111
#include <linux/mfd/db8500-prcmu.h>
12+
#include <linux/mfd/db5500-prcmu.h>
1213

1314
#include <asm/cacheflush.h>
1415
#include <asm/hardware/cache-l2x0.h>
@@ -49,6 +50,8 @@ void __init ux500_init_irq(void)
4950
* Init clocks here so that they are available for system timer
5051
* initialization.
5152
*/
53+
if (cpu_is_u5500())
54+
db5500_prcmu_early_init();
5255
if (cpu_is_u8500())
5356
prcmu_early_init();
5457
clk_init();

‎drivers/mfd/Kconfig‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,16 @@ config MFD_DB8500_PRCMU
585585
system controller running an XP70 microprocessor, which is accessed
586586
through a register map.
587587

588+
config MFD_DB5500_PRCMU
589+
bool "ST-Ericsson DB5500 Power Reset Control Management Unit"
590+
depends on UX500_SOC_DB5500
591+
select MFD_CORE
592+
help
593+
Select this option to enable support for the DB5500 Power Reset
594+
and Control Management Unit. This is basically an autonomous
595+
system controller running an XP70 microprocessor, which is accessed
596+
through a register map.
597+
588598
config MFD_CS5535
589599
tristate "Support for CS5535 and CS5536 southbridge core functions"
590600
select MFD_CORE

‎drivers/mfd/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ obj-$(CONFIG_AB8500_GPADC) += ab8500-gpadc.o
7979
obj-$(CONFIG_MFD_DB8500_PRCMU) += db8500-prcmu.o
8080
# ab8500-i2c need to come after db8500-prcmu (which provides the channel)
8181
obj-$(CONFIG_AB8500_I2C_CORE) += ab8500-i2c.o
82+
obj-$(CONFIG_MFD_DB5500_PRCMU) += db5500-prcmu.o
8283
obj-$(CONFIG_MFD_TIMBERDALE) += timberdale.o
8384
obj-$(CONFIG_PMIC_ADP5520) += adp5520.o
8485
obj-$(CONFIG_LPC_SCH) += lpc_sch.o

‎drivers/mfd/db5500-prcmu-regs.h‎

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/*
2+
* Copyright (C) STMicroelectronics 2009
3+
* Copyright (C) ST-Ericsson SA 2010
4+
*
5+
* Author: Kumar Sanghvi <kumar.sanghvi@stericsson.com>
6+
* Author: Sundar Iyer <sundar.iyer@stericsson.com>
7+
*
8+
* License Terms: GNU General Public License v2
9+
*
10+
* PRCM Unit registers
11+
*/
12+
13+
#ifndef __MACH_PRCMU_REGS_H
14+
#define __MACH_PRCMU_REGS_H
15+
16+
#include <mach/hardware.h>
17+
18+
#define PRCM_ARM_PLLDIVPS (_PRCMU_BASE + 0x118)
19+
#define PRCM_ARM_PLLDIVPS_ARM_BRM_RATE 0x3f
20+
#define PRCM_ARM_PLLDIVPS_MAX_MASK 0xf
21+
22+
#define PRCM_PLLARM_LOCKP (_PRCMU_BASE + 0x0a8)
23+
#define PRCM_PLLARM_LOCKP_PRCM_PLLARM_LOCKP3 0x2
24+
25+
#define PRCM_ARM_CHGCLKREQ (_PRCMU_BASE + 0x114)
26+
#define PRCM_ARM_CHGCLKREQ_PRCM_ARM_CHGCLKREQ 0x1
27+
28+
#define PRCM_PLLARM_ENABLE (_PRCMU_BASE + 0x98)
29+
#define PRCM_PLLARM_ENABLE_PRCM_PLLARM_ENABLE 0x1
30+
#define PRCM_PLLARM_ENABLE_PRCM_PLLARM_COUNTON 0x100
31+
32+
#define PRCM_ARMCLKFIX_MGT (_PRCMU_BASE + 0x0)
33+
#define PRCM_A9_RESETN_CLR (_PRCMU_BASE + 0x1f4)
34+
#define PRCM_A9_RESETN_SET (_PRCMU_BASE + 0x1f0)
35+
#define PRCM_ARM_LS_CLAMP (_PRCMU_BASE + 0x30c)
36+
#define PRCM_SRAM_A9 (_PRCMU_BASE + 0x308)
37+
38+
/* ARM WFI Standby signal register */
39+
#define PRCM_ARM_WFI_STANDBY (_PRCMU_BASE + 0x130)
40+
#define PRCM_IOCR (_PRCMU_BASE + 0x310)
41+
#define PRCM_IOCR_IOFORCE 0x1
42+
43+
/* CPU mailbox registers */
44+
#define PRCM_MBOX_CPU_VAL (_PRCMU_BASE + 0x0fc)
45+
#define PRCM_MBOX_CPU_SET (_PRCMU_BASE + 0x100)
46+
#define PRCM_MBOX_CPU_CLR (_PRCMU_BASE + 0x104)
47+
48+
/* Dual A9 core interrupt management unit registers */
49+
#define PRCM_A9_MASK_REQ (_PRCMU_BASE + 0x328)
50+
#define PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ 0x1
51+
52+
#define PRCM_A9_MASK_ACK (_PRCMU_BASE + 0x32c)
53+
#define PRCM_ARMITMSK31TO0 (_PRCMU_BASE + 0x11c)
54+
#define PRCM_ARMITMSK63TO32 (_PRCMU_BASE + 0x120)
55+
#define PRCM_ARMITMSK95TO64 (_PRCMU_BASE + 0x124)
56+
#define PRCM_ARMITMSK127TO96 (_PRCMU_BASE + 0x128)
57+
#define PRCM_POWER_STATE_VAL (_PRCMU_BASE + 0x25C)
58+
#define PRCM_ARMITVAL31TO0 (_PRCMU_BASE + 0x260)
59+
#define PRCM_ARMITVAL63TO32 (_PRCMU_BASE + 0x264)
60+
#define PRCM_ARMITVAL95TO64 (_PRCMU_BASE + 0x268)
61+
#define PRCM_ARMITVAL127TO96 (_PRCMU_BASE + 0x26C)
62+
63+
#define PRCM_HOSTACCESS_REQ (_PRCMU_BASE + 0x334)
64+
#define ARM_WAKEUP_MODEM 0x1
65+
66+
#define PRCM_ARM_IT1_CLEAR (_PRCMU_BASE + 0x48C)
67+
#define PRCM_ARM_IT1_VAL (_PRCMU_BASE + 0x494)
68+
#define PRCM_HOLD_EVT (_PRCMU_BASE + 0x174)
69+
70+
#define PRCM_ITSTATUS0 (_PRCMU_BASE + 0x148)
71+
#define PRCM_ITSTATUS1 (_PRCMU_BASE + 0x150)
72+
#define PRCM_ITSTATUS2 (_PRCMU_BASE + 0x158)
73+
#define PRCM_ITSTATUS3 (_PRCMU_BASE + 0x160)
74+
#define PRCM_ITSTATUS4 (_PRCMU_BASE + 0x168)
75+
#define PRCM_ITSTATUS5 (_PRCMU_BASE + 0x484)
76+
#define PRCM_ITCLEAR5 (_PRCMU_BASE + 0x488)
77+
#define PRCM_ARMIT_MASKXP70_IT (_PRCMU_BASE + 0x1018)
78+
79+
/* System reset register */
80+
#define PRCM_APE_SOFTRST (_PRCMU_BASE + 0x228)
81+
82+
/* Level shifter and clamp control registers */
83+
#define PRCM_MMIP_LS_CLAMP_SET (_PRCMU_BASE + 0x420)
84+
#define PRCM_MMIP_LS_CLAMP_CLR (_PRCMU_BASE + 0x424)
85+
86+
/* PRCMU clock/PLL/reset registers */
87+
#define PRCM_PLLDSI_FREQ (_PRCMU_BASE + 0x500)
88+
#define PRCM_PLLDSI_ENABLE (_PRCMU_BASE + 0x504)
89+
#define PRCM_PLLDSI_LOCKP (_PRCMU_BASE + 0x508)
90+
#define PRCM_LCDCLK_MGT (_PRCMU_BASE + 0x044)
91+
#define PRCM_MCDECLK_MGT (_PRCMU_BASE + 0x064)
92+
#define PRCM_HDMICLK_MGT (_PRCMU_BASE + 0x058)
93+
#define PRCM_TVCLK_MGT (_PRCMU_BASE + 0x07c)
94+
#define PRCM_DSI_PLLOUT_SEL (_PRCMU_BASE + 0x530)
95+
#define PRCM_DSITVCLK_DIV (_PRCMU_BASE + 0x52C)
96+
#define PRCM_PLLDSI_LOCKP (_PRCMU_BASE + 0x508)
97+
#define PRCM_APE_RESETN_SET (_PRCMU_BASE + 0x1E4)
98+
#define PRCM_APE_RESETN_CLR (_PRCMU_BASE + 0x1E8)
99+
#define PRCM_CLKOCR (_PRCMU_BASE + 0x1CC)
100+
101+
/* ePOD and memory power signal control registers */
102+
#define PRCM_EPOD_C_SET (_PRCMU_BASE + 0x410)
103+
#define PRCM_SRAM_LS_SLEEP (_PRCMU_BASE + 0x304)
104+
105+
/* Debug power control unit registers */
106+
#define PRCM_POWER_STATE_SET (_PRCMU_BASE + 0x254)
107+
108+
/* Miscellaneous unit registers */
109+
#define PRCM_DSI_SW_RESET (_PRCMU_BASE + 0x324)
110+
#define PRCM_GPIOCR (_PRCMU_BASE + 0x138)
111+
#define PRCM_GPIOCR_DBG_STM_MOD_CMD1 0x800
112+
#define PRCM_GPIOCR_DBG_UARTMOD_CMD0 0x1
113+
114+
115+
#endif /* __MACH_PRCMU__REGS_H */

0 commit comments

Comments
 (0)