Skip to content

Commit c6e322d

Browse files
finikorgfabiobaltieri
authored andcommitted
soc: alder_lake: Add Adler Lake SoC
Add Adler Lake SoC. The SoC is derived from Elkhart Lake SoC. Signed-off-by: Andrei Emeltchenko <[email protected]>
1 parent 8141157 commit c6e322d

File tree

10 files changed

+283
-0
lines changed

10 files changed

+283
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2023 Intel Corp.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: Intel Alder Lake CPU
5+
6+
compatible: "intel,alder-lake"
7+
8+
include: cpu.yaml

dts/x86/intel/alder_lake.dtsi

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*
2+
* Copyright (c) 2023 Intel Corporation.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include "skeleton.dtsi"
8+
#include <zephyr/dt-bindings/interrupt-controller/intel-ioapic.h>
9+
#include <zephyr/dt-bindings/i2c/i2c.h>
10+
#include <zephyr/dt-bindings/pcie/pcie.h>
11+
12+
/ {
13+
cpus {
14+
#address-cells = <1>;
15+
#size-cells = <0>;
16+
17+
cpu@0 {
18+
device_type = "cpu";
19+
compatible = "intel,alder_lake";
20+
d-cache-line-size = <64>;
21+
reg = <0>;
22+
};
23+
24+
};
25+
26+
dram0: memory@0 {
27+
device_type = "memory";
28+
reg = <0x0 DT_DRAM_SIZE>;
29+
};
30+
31+
intc: ioapic@fec00000 {
32+
compatible = "intel,ioapic";
33+
reg = <0xfec00000 0x1000>;
34+
interrupt-controller;
35+
#interrupt-cells = <3>;
36+
};
37+
38+
pcie0: pcie0 {
39+
#address-cells = <1>;
40+
#size-cells = <1>;
41+
compatible = "intel,pcie";
42+
ranges;
43+
44+
smbus0: smbus0 {
45+
compatible = "intel,pch-smbus";
46+
#address-cells = <1>;
47+
#size-cells = <0>;
48+
vendor-id = <0x8086>;
49+
device-id = <0x54a3>;
50+
interrupts = <16 IRQ_TYPE_LOWEST_LEVEL_LOW 3>;
51+
interrupt-parent = <&intc>;
52+
53+
status = "okay";
54+
};
55+
56+
uart0: uart0 {
57+
compatible = "ns16550";
58+
59+
vendor-id = <0x8086>;
60+
device-id = <0x54a8>;
61+
62+
clock-frequency = <1843200>;
63+
current-speed = <115200>;
64+
reg-shift = <2>;
65+
66+
interrupts = <PCIE_IRQ_DETECT IRQ_TYPE_LOWEST_LEVEL_LOW 3>;
67+
interrupt-parent = <&intc>;
68+
69+
status = "okay";
70+
};
71+
};
72+
73+
soc {
74+
#address-cells = <1>;
75+
#size-cells = <1>;
76+
compatible = "simple-bus";
77+
ranges;
78+
79+
uart0_legacy: uart@3f8 {
80+
compatible = "ns16550";
81+
reg = <0x000003f8 0x100>;
82+
clock-frequency = <1843200>;
83+
interrupts = <4 IRQ_TYPE_LOWEST_EDGE_RISING 3>;
84+
interrupt-parent = <&intc>;
85+
reg-shift = <0>;
86+
status = "okay";
87+
};
88+
89+
hpet: hpet@fed00000 {
90+
compatible = "intel,hpet";
91+
reg = <0xfed00000 0x400>;
92+
interrupts = <2 IRQ_TYPE_FIXED_EDGE_RISING 4>;
93+
interrupt-parent = <&intc>;
94+
95+
status = "okay";
96+
};
97+
98+
counter: counter@70 {
99+
compatible = "motorola,mc146818";
100+
reg = <0x70 0x0D 0x71 0x0D>;
101+
102+
status = "okay";
103+
};
104+
105+
tco_wdt: tco_wdt@400 {
106+
compatible = "intel,tco-wdt";
107+
reg = <0x0400 0x20>;
108+
};
109+
};
110+
};

soc/x86/alder_lake/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
5+
6+
zephyr_cc_option(-march=goldmont)
7+
8+
zephyr_library_sources(cpu.c)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Alder Lake SoC configuration options
2+
3+
# Copyright (c) 2018-2023 Intel Corporation
4+
# Copyright (c) 2014-2015 Wind River Systems, Inc.
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
if SOC_ALDER_LAKE
8+
9+
config SOC
10+
default "alder_lake"
11+
12+
config PCIE_MMIO_CFG
13+
default y
14+
15+
config X86_DYNAMIC_IRQ_STUBS
16+
default 16
17+
depends on DYNAMIC_INTERRUPTS
18+
19+
endif # SOC_ALDER_LAKE

soc/x86/alder_lake/Kconfig.soc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2018-2023 Intel Corporation Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_ALDER_LAKE
5+
bool "Intel Alder Lake SOC"
6+
select X86
7+
select CPU_ATOM
8+
select PCIE
9+
select PCIE_MSI
10+
select DYNAMIC_INTERRUPTS
11+
select X86_MMU

soc/x86/alder_lake/cpu.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2023 Intel Corporation
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/kernel.h>
7+
8+
uint8_t x86_cpu_loapics[] = { 0x00, 0x02, 0x04, 0x06 };
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Supported Features
2+
==================
3+
4+
In addition to the standard architecture devices (HPET, local and I/O APICs,
5+
etc.), Zephyr supports the following Alder Lake-specific SoC devices:
6+
7+
* I2C
8+
* SMBus
9+
10+
UART Serial Port Support
11+
-------------------------------------
12+
13+
The Alder Lake UARTs are NS16550-compatible. Baud rate of
14+
115.2kbps is supported.

soc/x86/alder_lake/linker.ld

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2011-2014, Wind River Systems, Inc.
3+
* Copyright (c) 2019-2023 Intel Corp.
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#include <zephyr/arch/x86/memory.ld>
9+
10+
#ifdef CONFIG_X86_64
11+
#include <zephyr/arch/x86/intel64/linker.ld>
12+
#else
13+
#include <zephyr/arch/x86/ia32/linker.ld>
14+
#endif /* CONFIG_X86_64 */

soc/x86/alder_lake/soc.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2018-2023, Intel Corporation
3+
* Copyright (c) 2010-2015, Wind River Systems, Inc.
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/**
9+
* @file
10+
* @brief Board configuration macros for the Alder Lake SoC
11+
*
12+
* This header file is used to specify and describe soc-level aspects for
13+
* the 'Alder Lake' SoC.
14+
*/
15+
16+
#ifndef __SOC_H_
17+
#define __SOC_H_
18+
19+
#include <zephyr/sys/util.h>
20+
21+
#ifndef _ASMLANGUAGE
22+
#include <zephyr/device.h>
23+
#include <zephyr/random/rand32.h>
24+
#endif
25+
26+
#ifdef CONFIG_GPIO_INTEL
27+
#include "soc_gpio.h"
28+
#endif
29+
30+
#if DT_ON_BUS(DT_CHOSEN(zephyr_console), pcie)
31+
#include <zephyr/drivers/pcie/pcie.h>
32+
#define X86_SOC_EARLY_SERIAL_PCIDEV PCIE_BDF(0, 0x19, 2) /* uart2 */
33+
#else
34+
#define X86_SOC_EARLY_SERIAL_MMIO8_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_console))
35+
#endif
36+
37+
#endif /* __SOC_H_ */

soc/x86/alder_lake/soc_gpio.h

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright (c) 2021-2023, Intel Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @file
9+
* @brief GPIO macros for the Alder Lake SoC
10+
*
11+
* This header file is used to specify the GPIO macros for
12+
* the Alder Lake SoC.
13+
*/
14+
15+
#ifndef __SOC_GPIO_H_
16+
#define __SOC_GPIO_H_
17+
18+
#define GPIO_INTEL_NR_SUBDEVS 15
19+
20+
#define REG_PAD_OWNER_BASE 0x0020
21+
#define REG_GPI_INT_STS_BASE 0x0100
22+
#define PAD_CFG0_PMODE_MASK (0x0F << 10)
23+
24+
#define REG_PAD_BASE_ADDR 0x000C
25+
#define REG_GPI_INT_EN_BASE 0x0120
26+
#define REG_PAD_HOST_SW_OWNER 0x0B0
27+
#define PAD_BASE_ADDR_MASK 0xfff
28+
29+
#define GPIO_REG_BASE(reg_base) \
30+
(reg_base & ~PAD_BASE_ADDR_MASK)
31+
32+
#define GPIO_PAD_BASE(reg_base) \
33+
(reg_base & PAD_BASE_ADDR_MASK)
34+
35+
#define GPIO_PAD_OWNERSHIP(raw_pin, pin_offset) \
36+
(pin_offset % 8) ? \
37+
REG_PAD_OWNER_BASE + \
38+
((((pin_offset / 8) + 1) + (raw_pin / 8)) * 0x4) : \
39+
REG_PAD_OWNER_BASE + \
40+
(((pin_offset / 8) + (raw_pin / 8)) * 0x4); \
41+
42+
#define GPIO_OWNERSHIP_BIT(raw_pin) ((raw_pin % 8) * 4)
43+
44+
#define GPIO_RAW_PIN(pin, pin_offset) pin
45+
46+
#define GPIO_INTERRUPT_BASE(cfg) \
47+
(cfg->group_index * 0x4)
48+
49+
#define GPIO_BASE(cfg) \
50+
(cfg->group_index * 0x4)
51+
52+
#define PIN_OFFSET 0x10
53+
54+
#endif /* __SOC_GPIO_H_ */

0 commit comments

Comments
 (0)