From e2f3912c5a633569d2de45dcf7ce66df16b77632 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 4 Mar 2024 03:15:20 +0000 Subject: [PATCH] x86: revert removing soc.h from atom soc This was part of the mega hwmv2 commit. Looks like hpet drivers heavily relies on soc.h. Reverting this for now while we look for a proper fix and remove reliance on soc.h for drivers. Signed-off-by: Anas Nashif --- arch/x86/core/early_serial.c | 1 + drivers/counter/counter_cmos.c | 7 ++-- drivers/disk/nvme/nvme_controller.c | 1 + drivers/timer/hpet.c | 2 + soc/intel/atom/soc.h | 60 +++++++++++++++++++++++++++++ subsys/bluetooth/host/hci_core.c | 1 + 6 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 soc/intel/atom/soc.h diff --git a/arch/x86/core/early_serial.c b/arch/x86/core/early_serial.c index a2abafbf05..3a0bc7465e 100644 --- a/arch/x86/core/early_serial.c +++ b/arch/x86/core/early_serial.c @@ -8,6 +8,7 @@ #include #include #include +#include #if DT_PROP_OR(DT_CHOSEN(zephyr_console), io_mapped, 0) != 0 diff --git a/drivers/counter/counter_cmos.c b/drivers/counter/counter_cmos.c index 00645bc71b..3edd718b9f 100644 --- a/drivers/counter/counter_cmos.c +++ b/drivers/counter/counter_cmos.c @@ -11,12 +11,11 @@ * crossing clock domains (no pun intended). Use accordingly. */ -#include +#define DT_DRV_COMPAT motorola_mc146818 + #include #include -#include - -#define DT_DRV_COMPAT motorola_mc146818 +#include /* The "CMOS" device is accessed via an address latch and data port. */ diff --git a/drivers/disk/nvme/nvme_controller.c b/drivers/disk/nvme/nvme_controller.c index e58a1baa73..699df325ad 100644 --- a/drivers/disk/nvme/nvme_controller.c +++ b/drivers/disk/nvme/nvme_controller.c @@ -13,6 +13,7 @@ LOG_MODULE_REGISTER(nvme, CONFIG_NVME_LOG_LEVEL); #include +#include #include #include diff --git a/drivers/timer/hpet.c b/drivers/timer/hpet.c index de2abf757f..8a7134a762 100644 --- a/drivers/timer/hpet.c +++ b/drivers/timer/hpet.c @@ -14,6 +14,8 @@ #include +#include + /** * @file * @brief HPET (High Precision Event Timers) driver diff --git a/soc/intel/atom/soc.h b/soc/intel/atom/soc.h new file mode 100644 index 0000000000..199820fa7b --- /dev/null +++ b/soc/intel/atom/soc.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2010-2015, Wind River Systems, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * @brief Board configuration macros for the ia32 platform + * + * This header file is used to specify and describe board-level aspects for + * the 'ia32' platform. + */ + +#ifndef __SOC_H_ +#define __SOC_H_ + +#include + +#ifndef _ASMLANGUAGE +#include +#include +#endif + +/* PCI definitions */ +/* FIXME: The values below copied from generic ia32 soc, we need to get the + * correct numbers for Atom and the minnowboard + * + * This is added now to get basic enumeration of devices and verify that PCI + * driver is functional. + */ +#define PCI_BUS_NUMBERS 1 + +#define PCI_CTRL_ADDR_REG 0xCF8 +#define PCI_CTRL_DATA_REG 0xCFC + +#define PCI_INTA 1 +#define PCI_INTB 2 +#define PCI_INTC 3 +#define PCI_INTD 4 + +/** + * + * @brief Convert PCI interrupt PIN to IRQ + * + * @return IRQ number, -1 if the result is incorrect + * + */ + +static inline int pci_pin2irq(int bus, int dev, int pin) +{ + ARG_UNUSED(bus); + + if ((pin < PCI_INTA) || (pin > PCI_INTD)) { + return -1; + } + return 10 + (((pin + dev - 1) >> 1) & 1); +} + +#endif /* __SOC_H_ */ diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 8406feef89..0c6a96e2ae 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -18,6 +18,7 @@ #include #include #include +#include #include