diff --git a/arch/sim/src/sim/up_rptun.c b/arch/sim/src/sim/up_rptun.c index d3f78826fd..d40070a448 100644 --- a/arch/sim/src/sim/up_rptun.c +++ b/arch/sim/src/sim/up_rptun.c @@ -240,7 +240,7 @@ int up_rptun_init(void) #endif #if CONFIG_SIM_RPTUN_MASTER == 0 - up_rtc_set_lowerhalf(rpmsg_rtc_initialize("server", 0)); + up_rtc_set_lowerhalf(rpmsg_rtc_initialize(0)); #endif #ifdef CONFIG_FS_HOSTFS_RPMSG diff --git a/boards/sim/sim/sim/configs/rpproxy/defconfig b/boards/sim/sim/sim/configs/rpproxy/defconfig index cb151f9f83..42f3facdad 100644 --- a/boards/sim/sim/sim/configs/rpproxy/defconfig +++ b/boards/sim/sim/sim/configs/rpproxy/defconfig @@ -50,6 +50,7 @@ CONFIG_RTC_ARCH=y CONFIG_RTC_DRIVER=y CONFIG_RTC_EXTERNAL=y CONFIG_RTC_RPMSG=y +CONFIG_RTC_RPMSG_SERVER_NAME="server" CONFIG_SCHED_CHILD_STATUS=y CONFIG_SCHED_HAVE_PARENT=y CONFIG_SCHED_HPWORK=y diff --git a/drivers/timers/Kconfig b/drivers/timers/Kconfig index 686143a652..fb1ddf26cd 100644 --- a/drivers/timers/Kconfig +++ b/drivers/timers/Kconfig @@ -297,6 +297,13 @@ config RTC_RPMSG depends on OPENAMP select ARCH_HAVE_RTC_SUBSECONDS +config RTC_RPMSG_SERVER_NAME + string "The name of RTC Rpmsg Server" + depends on RTC_RPMSG + ---help--- + The proc name of rtc server. Client requests time from + specified name of remote proc. + endif # RTC menuconfig WATCHDOG diff --git a/drivers/timers/rpmsg_rtc.c b/drivers/timers/rpmsg_rtc.c index 2eef9b5207..bb38e10ade 100644 --- a/drivers/timers/rpmsg_rtc.c +++ b/drivers/timers/rpmsg_rtc.c @@ -107,7 +107,6 @@ struct rpmsg_rtc_lowerhalf_s */ struct rpmsg_endpoint ept; - FAR const char *cpuname; struct work_s syncwork; #ifdef CONFIG_RTC_ALARM @@ -229,7 +228,8 @@ static void rpmsg_rtc_device_created(FAR struct rpmsg_device *rdev, { FAR struct rpmsg_rtc_lowerhalf_s *lower = priv; - if (strcmp(lower->cpuname, rpmsg_get_cpuname(rdev)) == 0) + if (strcmp(CONFIG_RTC_RPMSG_SERVER_NAME, + rpmsg_get_cpuname(rdev)) == 0) { lower->ept.priv = lower; @@ -244,7 +244,8 @@ static void rpmsg_rtc_device_destroy(FAR struct rpmsg_device *rdev, { FAR struct rpmsg_rtc_lowerhalf_s *lower = priv; - if (strcmp(lower->cpuname, rpmsg_get_cpuname(rdev)) == 0) + if (strcmp(CONFIG_RTC_RPMSG_SERVER_NAME, + rpmsg_get_cpuname(rdev)) == 0) { rpmsg_destroy_ept(&lower->ept); } @@ -681,7 +682,6 @@ static void rpmsg_rtc_server_ns_bind(FAR struct rpmsg_device *rdev, * Take remote core RTC as external RTC hardware through rpmsg. * * Input Parameters: - * cpuname - current cpu name * minor - device minor number * * Returned Value: @@ -690,8 +690,7 @@ static void rpmsg_rtc_server_ns_bind(FAR struct rpmsg_device *rdev, * ****************************************************************************/ -FAR struct rtc_lowerhalf_s *rpmsg_rtc_initialize(FAR const char *cpuname, - int minor) +FAR struct rtc_lowerhalf_s *rpmsg_rtc_initialize(int minor) { FAR struct rpmsg_rtc_lowerhalf_s *lower; @@ -699,7 +698,6 @@ FAR struct rtc_lowerhalf_s *rpmsg_rtc_initialize(FAR const char *cpuname, if (lower) { lower->ops = &g_rpmsg_rtc_ops; - lower->cpuname = cpuname; rpmsg_register_callback(lower, rpmsg_rtc_device_created, diff --git a/include/nuttx/timers/rpmsg_rtc.h b/include/nuttx/timers/rpmsg_rtc.h index b0b2928c82..764904fe3a 100644 --- a/include/nuttx/timers/rpmsg_rtc.h +++ b/include/nuttx/timers/rpmsg_rtc.h @@ -42,8 +42,7 @@ extern "C" #ifdef CONFIG_RTC_RPMSG -FAR struct rtc_lowerhalf_s *rpmsg_rtc_initialize(FAR const char *cpu_name, - int minor); +FAR struct rtc_lowerhalf_s *rpmsg_rtc_initialize(int minor); FAR struct rtc_lowerhalf_s *rpmsg_rtc_server_initialize( FAR struct rtc_lowerhalf_s *lower);