From df45e4df7700d696817a198b73ba04ffc7b174b9 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 18 Feb 2020 08:05:16 -0600 Subject: [PATCH] drivers: intc: ioapic: convert to DT_INST defines Convert driver to use DT_INST_ defines. Signed-off-by: Kumar Gala --- drivers/interrupt_controller/intc_ioapic.c | 10 +++++----- soc/x86/apollo_lake/dts_fixup.h | 2 -- soc/x86/apollo_lake/soc.c | 2 +- soc/x86/atom/dts_fixup.h | 2 -- soc/x86/atom/soc.c | 2 +- soc/x86/ia32/dts_fixup.h | 3 --- soc/x86/ia32/soc.c | 2 +- 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/interrupt_controller/intc_ioapic.c b/drivers/interrupt_controller/intc_ioapic.c index e059ee2a078..a04243a2c42 100644 --- a/drivers/interrupt_controller/intc_ioapic.c +++ b/drivers/interrupt_controller/intc_ioapic.c @@ -62,6 +62,7 @@ #include /* public API declarations and registers */ #include "intc_ioapic_priv.h" +#define IOAPIC_REG DT_INST_0_INTEL_IOAPIC_BASE_ADDRESS #define BITS_PER_IRQ 3 #define IOAPIC_BITFIELD_HI_LO 0 #define IOAPIC_BITFIELD_LVL_EDGE 1 @@ -333,9 +334,8 @@ static u32_t __IoApicGet(s32_t offset) key = irq_lock(); - *((volatile u32_t *) - (DT_IOAPIC_BASE_ADDRESS + IOAPIC_IND)) = (char)offset; - value = *((volatile u32_t *)(DT_IOAPIC_BASE_ADDRESS + IOAPIC_DATA)); + *((volatile u32_t *) (IOAPIC_REG + IOAPIC_IND)) = (char)offset; + value = *((volatile u32_t *)(IOAPIC_REG + IOAPIC_DATA)); irq_unlock(key); @@ -360,8 +360,8 @@ static void __IoApicSet(s32_t offset, u32_t value) key = irq_lock(); - *(volatile u32_t *)(DT_IOAPIC_BASE_ADDRESS + IOAPIC_IND) = (char)offset; - *((volatile u32_t *)(DT_IOAPIC_BASE_ADDRESS + IOAPIC_DATA)) = value; + *(volatile u32_t *)(IOAPIC_REG + IOAPIC_IND) = (char)offset; + *((volatile u32_t *)(IOAPIC_REG + IOAPIC_DATA)) = value; irq_unlock(key); } diff --git a/soc/x86/apollo_lake/dts_fixup.h b/soc/x86/apollo_lake/dts_fixup.h index 793ca5c01f6..f3698f12b86 100644 --- a/soc/x86/apollo_lake/dts_fixup.h +++ b/soc/x86/apollo_lake/dts_fixup.h @@ -11,8 +11,6 @@ #define DT_RAM_SIZE CONFIG_SRAM_SIZE #define DT_ROM_SIZE CONFIG_FLASH_SIZE -#define DT_IOAPIC_BASE_ADDRESS DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS - #define DT_UART_NS16550_PORT_0_BASE_ADDR DT_INST_0_NS16550_BASE_ADDRESS #define DT_UART_NS16550_PORT_0_SIZE DT_INST_0_NS16550_SIZE #define DT_UART_NS16550_PORT_0_BAUD_RATE DT_INST_0_NS16550_CURRENT_SPEED diff --git a/soc/x86/apollo_lake/soc.c b/soc/x86/apollo_lake/soc.c index 78319617353..fa3222ed88b 100644 --- a/soc/x86/apollo_lake/soc.c +++ b/soc/x86/apollo_lake/soc.c @@ -24,7 +24,7 @@ MMU_BOOT_REGION(CONFIG_LOAPIC_BASE_ADDRESS, 4 * 1024, MMU_ENTRY_WRITE); /* ioapic */ -MMU_BOOT_REGION(DT_IOAPIC_BASE_ADDRESS, 1024 * 1024, MMU_ENTRY_WRITE); +MMU_BOOT_REGION(DT_INST_0_INTEL_IOAPIC_BASE_ADDRESS, 1024 * 1024, MMU_ENTRY_WRITE); #ifdef CONFIG_HPET_TIMER MMU_BOOT_REGION(DT_INST_0_INTEL_HPET_BASE_ADDRESS, KB(4), MMU_ENTRY_WRITE); diff --git a/soc/x86/atom/dts_fixup.h b/soc/x86/atom/dts_fixup.h index 1fb3b1e9612..70743cc719a 100644 --- a/soc/x86/atom/dts_fixup.h +++ b/soc/x86/atom/dts_fixup.h @@ -26,6 +26,4 @@ #define DT_ROM_SIZE CONFIG_FLASH_SIZE -#define DT_IOAPIC_BASE_ADDRESS DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS - /* End of SoC Level DTS fixup file */ diff --git a/soc/x86/atom/soc.c b/soc/x86/atom/soc.c index e8fc184a556..23b425e30bf 100644 --- a/soc/x86/atom/soc.c +++ b/soc/x86/atom/soc.c @@ -23,7 +23,7 @@ MMU_BOOT_REGION(CONFIG_LOAPIC_BASE_ADDRESS, 4*1024, MMU_ENTRY_WRITE); /*ioapic */ -MMU_BOOT_REGION(DT_IOAPIC_BASE_ADDRESS, 1024*1024, MMU_ENTRY_WRITE); +MMU_BOOT_REGION(DT_INST_0_INTEL_IOAPIC_BASE_ADDRESS, 1024*1024, MMU_ENTRY_WRITE); /* peripherals */ MMU_BOOT_REGION(0xB0000000, 128*1024, MMU_ENTRY_WRITE); diff --git a/soc/x86/ia32/dts_fixup.h b/soc/x86/ia32/dts_fixup.h index aae3e6b85c6..70743cc719a 100644 --- a/soc/x86/ia32/dts_fixup.h +++ b/soc/x86/ia32/dts_fixup.h @@ -26,7 +26,4 @@ #define DT_ROM_SIZE CONFIG_FLASH_SIZE - -#define DT_IOAPIC_BASE_ADDRESS DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS - /* End of SoC Level DTS fixup file */ diff --git a/soc/x86/ia32/soc.c b/soc/x86/ia32/soc.c index 311cf11578c..9513d73bea2 100644 --- a/soc/x86/ia32/soc.c +++ b/soc/x86/ia32/soc.c @@ -22,7 +22,7 @@ #ifdef CONFIG_X86_MMU MMU_BOOT_REGION(CONFIG_LOAPIC_BASE_ADDRESS, KB(4), MMU_ENTRY_WRITE); -MMU_BOOT_REGION(DT_IOAPIC_BASE_ADDRESS, MB(1), MMU_ENTRY_WRITE); +MMU_BOOT_REGION(DT_INST_0_INTEL_IOAPIC_BASE_ADDRESS, MB(1), MMU_ENTRY_WRITE); #ifdef CONFIG_HPET_TIMER MMU_BOOT_REGION(DT_INST_0_INTEL_HPET_BASE_ADDRESS, KB(4), MMU_ENTRY_WRITE);