drivers: litex: Convert litex drivers to new DT_INST macros
Convert older DT_INST_ macro use in litex drivers to the new include/devicetree.h DT_INST macro APIs. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
5a830b2238
commit
88469b7010
11 changed files with 92 additions and 72 deletions
|
@ -4,13 +4,15 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define DT_DRV_COMPAT litex_timer0
|
||||
|
||||
#include <kernel.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <device.h>
|
||||
#include <irq.h>
|
||||
#include <drivers/timer/system_timer.h>
|
||||
|
||||
#define TIMER_BASE DT_INST_0_LITEX_TIMER0_BASE_ADDRESS
|
||||
#define TIMER_BASE DT_INST_REG_ADDR(0)
|
||||
#define TIMER_LOAD_ADDR ((TIMER_BASE) + 0x00)
|
||||
#define TIMER_RELOAD_ADDR ((TIMER_BASE) + 0x10)
|
||||
#define TIMER_EN_ADDR ((TIMER_BASE) + 0x20)
|
||||
|
@ -18,7 +20,7 @@
|
|||
#define TIMER_EV_ENABLE_ADDR ((TIMER_BASE) + 0x40)
|
||||
|
||||
#define TIMER_EV 0x1
|
||||
#define TIMER_IRQ DT_INST_0_LITEX_TIMER0_IRQ_0
|
||||
#define TIMER_IRQ DT_INST_IRQN(0)
|
||||
#define TIMER_DISABLE 0x0
|
||||
#define TIMER_ENABLE 0x1
|
||||
|
||||
|
@ -50,7 +52,7 @@ u32_t z_clock_elapsed(void)
|
|||
int z_clock_driver_init(struct device *device)
|
||||
{
|
||||
ARG_UNUSED(device);
|
||||
IRQ_CONNECT(TIMER_IRQ, DT_INST_0_LITEX_TIMER0_IRQ_0_PRIORITY,
|
||||
IRQ_CONNECT(TIMER_IRQ, DT_INST_IRQ(0, priority),
|
||||
litex_timer_irq_handler, NULL, 0);
|
||||
irq_enable(TIMER_IRQ);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue