Skip to content

Commit 8f3c041

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 92bddd0 commit 8f3c041

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

soc/renesas/rx/rx130/Kconfig.defconfig

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,66 @@ config SYS_CLOCK_TICKS_PER_SEC
1717
config INITIALIZATION_STACK_SIZE
1818
default 512
1919

20+
if WDT_RENESAS_RX_IWDT_AUTO_START_MODE
21+
22+
config WDT_RENESAS_RX_IWDTSTRT
23+
int "IWDT OFS0 Start Mode Select"
24+
default 0
25+
help
26+
0: IWDT is automatically activated in auto-start mode after a reset
27+
1: IWDT is halted after a reset
28+
29+
config WDT_RENESAS_RX_OFS0_IWDTTOPS
30+
int "IWDT Timeout Period Select"
31+
default 3
32+
help
33+
0: 128 cycles (007Fh)
34+
1: 512 cycles (01FFh)
35+
2: 1024 cycles (03FFh)
36+
3: 2048 cycles (07FFh)
37+
38+
config WDT_RENESAS_RX_OFS0_IWDTCKS
39+
int "IWDT Clock Divide Ratio Select"
40+
default 15
41+
help
42+
0: No division
43+
2: Divide-by-16
44+
3: Divide-by-32
45+
4: Divide-by-64
46+
15: Divide-by-128
47+
5: Divide-by-256
48+
49+
config WDT_RENESAS_RX_OFS0_IWDTRPSS
50+
int "IWDT Window Start Position Select"
51+
default 3
52+
help
53+
0: 25%
54+
1: 50%
55+
2: 75%
56+
3: 100% (window start position is not specified.)
57+
58+
config WDT_RENESAS_RX_OFS0_IWDTRPES
59+
int "IWDT Window End Position Select"
60+
default 3
61+
help
62+
0: 75%
63+
1: 50%
64+
2: 25%
65+
3: 0% (window end position is not specified.)
66+
67+
config WDT_RENESAS_RX_OFS0_IWDTRSTIRQS
68+
int "IWDT Reset Interrupt Request Select"
69+
default 0
70+
help
71+
0: Non-maskable interrupt request output is enabled.
72+
1: Reset output is enabled.
73+
74+
config WDT_RENESAS_RX_OFS0_IWDTSLCSTP
75+
int "IWDT Sleep Mode Count Stop Control"
76+
default 0
77+
help
78+
0: Count stop is disabled.
79+
1: Count is stopped at a transition to sleep mode, software standby mode, or deep sleep mode.
80+
81+
endif # WDT_RENESAS_RX_IWDT_AUTO_START_MODE
2082
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)