Skip to content

Commit 9733e34

Browse files
committed
soc: renesas: rx: enable option function select register 0
Enables OSF0 register select for IWDT driver setting on start mode Signed-off-by: Quy Tran <[email protected]>
1 parent 31cfaeb commit 9733e34

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

soc/renesas/rx/rx130/Kconfig

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,68 @@ config SOC_SERIES_RX130
88
select CLOCK_CONTROL_RENESAS_RX_CGC if CLOCK_CONTROL
99
select HAS_RENESAS_RX_RDP
1010
select CLOCK_CONTROL
11+
12+
if SOC_SERIES_RX130
13+
if WDT_RENESAS_RX_IWDT_AUTO_START_MODE
14+
15+
config WDT_RENESAS_RX_IWDTSTRT
16+
int "IWDT OFS0 Start Mode Select"
17+
default 0
18+
help
19+
0: IWDT is automatically activated in auto-start mode after a reset
20+
1: IWDT is halted after a reset
21+
22+
config WDT_RENESAS_RX_OFS0_IWDTTOPS
23+
int "IWDT Timeout Period Select"
24+
default 3
25+
help
26+
0: 128 cycles (007Fh)
27+
1: 512 cycles (01FFh)
28+
2: 1024 cycles (03FFh)
29+
3: 2048 cycles (07FFh)
30+
31+
config WDT_RENESAS_RX_OFS0_IWDTCKS
32+
int "IWDT Clock Divide Ratio Select"
33+
default 15
34+
help
35+
0: No division
36+
2: Divide-by-16
37+
3: Divide-by-32
38+
4: Divide-by-64
39+
15: Divide-by-128
40+
5: Divide-by-256
41+
42+
config WDT_RENESAS_RX_OFS0_IWDTRPSS
43+
int "IWDT Window Start Position Select"
44+
default 3
45+
help
46+
0: 25%
47+
1: 50%
48+
2: 75%
49+
3: 100% (window start position is not specified.)
50+
51+
config WDT_RENESAS_RX_OFS0_IWDTRPES
52+
int "IWDT Window End Position Select"
53+
default 3
54+
help
55+
0: 75%
56+
1: 50%
57+
2: 25%
58+
3: 0% (window end position is not specified.)
59+
60+
config WDT_RENESAS_RX_OFS0_IWDTRSTIRQS
61+
int "IWDT Reset Interrupt Request Select"
62+
default 0
63+
help
64+
0: Non-maskable interrupt request output is enabled.
65+
1: Reset output is enabled.
66+
67+
config WDT_RENESAS_RX_OFS0_IWDTSLCSTP
68+
int "IWDT Sleep Mode Count Stop Control"
69+
default 0
70+
help
71+
0: Count stop is disabled.
72+
1: Count is stopped at a transition to sleep mode, software standby mode, or deep sleep mode.
73+
74+
endif # WDT_RENESAS_RX_IWDT_AUTO_START_MODE
75+
endif # SOC_SERIES_RX130

soc/renesas/rx/rx130/ofsm.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,21 @@
3333
* by programming the OFS0 register. When enabled, IWDT starts counting automatically
3434
* starts after a reset.
3535
*/
36+
37+
#ifdef CONFIG_WDT_RENESAS_RX_IWDT_AUTO_START_MODE
38+
#define SOC_RX_OFS0 \
39+
((CONFIG_WDT_RENESAS_RX_IWDTSTRT << 1) | /* bit 1 */ \
40+
((CONFIG_WDT_RENESAS_RX_OFS0_IWDTTOPS & 0x3) << 2) | /* bits 2-3 */ \
41+
((CONFIG_WDT_RENESAS_RX_OFS0_IWDTCKS & 0xF) << 4) | /* bits 4-7 */ \
42+
((CONFIG_WDT_RENESAS_RX_OFS0_IWDTRPES & 0x3) << 8) | /* bits 8-9 */ \
43+
((CONFIG_WDT_RENESAS_RX_OFS0_IWDTRPSS & 0x3) << 10) | /* bits 10-11 */ \
44+
((CONFIG_WDT_RENESAS_RX_OFS0_IWDTRSTIRQS & 0x1) << 12) | /* bit 12 */ \
45+
((CONFIG_WDT_RENESAS_RX_OFS0_IWDTSLCSTP & 0x1) << 14) | /* bit 14 */ \
46+
0xFFFFA001UL /* reserved bits 0,13,15..31 */ \
47+
)
48+
#else
3649
#define SOC_RX_OFS0 (0xFFFFFFFFUL)
50+
#endif
3751

3852
/* Option Function Select Register 1 (OFS1) (Voltage detection and HOCO)
3953
*/

0 commit comments

Comments
 (0)