drivers: counter: Refactor mcux rtc driver to use generated dts macros

Refactors the mcux rtc driver to use generated device tree macros
directly. Removes now unused dts fixup macros from kinetis socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
Maureen Helm 2020-01-11 13:39:42 -06:00 committed by Anas Nashif
commit 9329c0db27
5 changed files with 8 additions and 21 deletions

View file

@ -259,25 +259,26 @@ static struct mcux_rtc_data mcux_rtc_data_0;
static void mcux_rtc_irq_config_0(struct device *dev);
static struct mcux_rtc_config mcux_rtc_config_0 = {
.base = (RTC_Type *)DT_RTC_MCUX_0_BASE_ADDRESS,
.base = (RTC_Type *)DT_NXP_KINETIS_RTC_RTC_0_BASE_ADDRESS,
.irq_config_func = mcux_rtc_irq_config_0,
.info = {
.max_top_value = UINT32_MAX,
.freq = DT_INST_0_NXP_KINETIS_RTC_CLOCK_FREQUENCY /
DT_INST_0_NXP_KINETIS_RTC_PRESCALER,
.freq = DT_NXP_KINETIS_RTC_RTC_0_CLOCK_FREQUENCY /
DT_NXP_KINETIS_RTC_RTC_0_PRESCALER,
.flags = COUNTER_CONFIG_INFO_COUNT_UP,
.channels = 1,
},
};
DEVICE_AND_API_INIT(rtc, DT_RTC_MCUX_0_NAME, &mcux_rtc_init,
DEVICE_AND_API_INIT(rtc, DT_NXP_KINETIS_RTC_RTC_0_LABEL, &mcux_rtc_init,
&mcux_rtc_data_0, &mcux_rtc_config_0.info,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&mcux_rtc_driver_api);
static void mcux_rtc_irq_config_0(struct device *dev)
{
IRQ_CONNECT(DT_RTC_MCUX_0_IRQ, DT_RTC_MCUX_0_IRQ_PRI,
IRQ_CONNECT(DT_NXP_KINETIS_RTC_RTC_0_IRQ_0,
DT_NXP_KINETIS_RTC_RTC_0_IRQ_0_PRIORITY,
mcux_rtc_isr, DEVICE_GET(rtc), 0);
irq_enable(DT_RTC_MCUX_0_IRQ);
irq_enable(DT_NXP_KINETIS_RTC_RTC_0_IRQ_0);
}

View file

@ -32,10 +32,6 @@
#define CONFIG_ENTROPY_NAME DT_NXP_KINETIS_TRNG_400A0000_LABEL
#define DT_RTC_0_NAME DT_NXP_KINETIS_RTC_4003D000_LABEL
#define DT_RTC_MCUX_0_NAME DT_NXP_KINETIS_RTC_4003D000_LABEL
#define DT_RTC_MCUX_0_BASE_ADDRESS DT_NXP_KINETIS_RTC_4003D000_BASE_ADDRESS
#define DT_RTC_MCUX_0_IRQ DT_NXP_KINETIS_RTC_4003D000_IRQ_ALARM
#define DT_RTC_MCUX_0_IRQ_PRI DT_NXP_KINETIS_RTC_4003D000_IRQ_ALARM_PRIORITY
#define DT_USBD_KINETIS_NAME DT_NXP_KINETIS_USBD_40072000_LABEL
#define DT_USBD_KINETIS_IRQ DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG

View file

@ -19,10 +19,6 @@
#define DT_MCUX_PCC_0_BASE_ADDRESS DT_NXP_KINETIS_PCC_40065000_BASE_ADDRESS
#define DT_RTC_0_NAME DT_NXP_KINETIS_RTC_4003D000_LABEL
#define DT_RTC_MCUX_0_NAME DT_NXP_KINETIS_RTC_4003D000_LABEL
#define DT_RTC_MCUX_0_BASE_ADDRESS DT_NXP_KINETIS_RTC_4003D000_BASE_ADDRESS
#define DT_RTC_MCUX_0_IRQ DT_NXP_KINETIS_RTC_4003D000_IRQ_ALARM
#define DT_RTC_MCUX_0_IRQ_PRI DT_NXP_KINETIS_RTC_4003D000_IRQ_ALARM_PRIORITY
#define DT_FLASH_DEV_BASE_ADDRESS DT_NXP_KINETIS_FTFE_40020000_BASE_ADDRESS
#define DT_FLASH_DEV_NAME DT_NXP_KINETIS_FTFE_40020000_LABEL

View file

@ -12,10 +12,7 @@
#define DT_MCG_NAME DT_NXP_KINETIS_MCG_40064000_LABEL
#define DT_RTC_MCUX_0_BASE_ADDRESS DT_NXP_KINETIS_RTC_4003D000_BASE_ADDRESS
#define DT_RTC_MCUX_0_IRQ_PRI DT_NXP_KINETIS_RTC_4003D000_IRQ_0_PRIORITY
#define DT_RTC_MCUX_0_IRQ DT_NXP_KINETIS_RTC_4003D000_IRQ_0
#define DT_RTC_MCUX_0_NAME DT_NXP_KINETIS_RTC_4003D000_LABEL
#define DT_RTC_0_NAME DT_NXP_KINETIS_RTC_4003D000_LABEL
#if defined(CONFIG_SOC_MKW22D5) || defined(CONFIG_SOC_MKW24D5)
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS

View file

@ -57,9 +57,6 @@ const char *devices[] = {
#ifdef CONFIG_COUNTER_IMX_EPIT_2
DT_COUNTER_IMX_EPIT_2_LABEL,
#endif
#ifdef DT_RTC_MCUX_0_NAME
DT_RTC_MCUX_0_NAME,
#endif
#ifdef DT_INST_0_ARM_CMSDK_TIMER_LABEL
DT_INST_0_ARM_CMSDK_TIMER_LABEL,
#endif