Skip to content

Commit 5469528

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 <quy.tran.pz@renesas.com>
1 parent e9e2e5c commit 5469528

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

soc/renesas/rx/rx130/ofsm.c

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616

1717
#define __OFS_MDE __attribute__((section(".ofs_mde")))
18+
#define __OFS0 __attribute__((section(".ofs0")))
19+
#define __OFS1 __attribute__((section(".ofs1")))
1820

1921
/* Endian Select Register (MDE) at 0xFE7F5D00
2022
*
@@ -28,22 +30,29 @@
2830
*/
2931
const unsigned long __OFS_MDE __MDEreg = 0xffffffff; /* little */
3032

31-
struct st_ofs0 {
32-
unsigned long res0: 1;
33-
unsigned long IWDTSTRT: 1;
34-
unsigned long IWDTTOPS: 2;
35-
unsigned long IWDTCKS: 4;
36-
unsigned long IWDTRPES: 2;
37-
unsigned long IWDTRPSS: 2;
38-
unsigned long IWDTRSTIRQS: 1;
39-
unsigned long res1: 1;
40-
unsigned long IWDTSLCSTP: 1;
41-
unsigned long res2: 16;
33+
#ifdef CONFIG_IWDT_RENESAS_RX_AUTO_START_MODE
34+
/* Option Function Select Register 0 (OFS0)
35+
* This section sets the IWDT (Independent Watchdog Timer) behavior immediately after reset
36+
* by programming the OFS0 register. When enabled, IWDT starts counting automatically
37+
* starts after a reset.
38+
*/
39+
struct st_ofs0 __OFS0 __OFS0reg = {
40+
.res0 = 1,
41+
.IWDTSTRT = CONFIG_IWDT_RENESAS_RX_IWDTSTRT,
42+
.IWDTTOPS = CONFIG_IWDT_RENESAS_RX_OFS0_IWDTTOPS,
43+
.IWDTCKS = CONFIG_IWDT_RENESAS_RX_OFS0_IWDTCKS,
44+
.IWDTRPES = CONFIG_IWDT_RENESAS_RX_OFS0_IWDTRPES,
45+
.IWDTRPSS = CONFIG_IWDT_RENESAS_RX_OFS0_IWDTRPSS,
46+
.IWDTRSTIRQS = CONFIG_IWDT_RENESAS_RX_OFS0_IWDTRSTIRQS,
47+
.res1 = 1,
48+
.IWDTSLCSTP = CONFIG_IWDT_RENESAS_RX_OFS0_IWDTSLCSTP,
49+
.res2 = 0xFFFF,
4250
};
43-
44-
const unsigned long __OFS_MDE __OFS0reg = 0xffffffff;
51+
#else
52+
const unsigned long __OFS0 __OFS0reg = 0xffffffff;
53+
#endif
4554

4655
/* Option Function Select Register 1 (OFS1) at 0xFE7F5D08 (Voltage detection and
4756
* HOCO)
4857
*/
49-
const unsigned long __OFS_MDE __OFS1reg = 0xffffffff;
58+
const unsigned long __OFS1 __OFS1reg = 0xffffffff;

0 commit comments

Comments
 (0)