blob: e149d2282b08df8704d77b05dfd7fa95365d3f26 [file] [log] [blame]
Angel Ponsf462b3d2021-01-20 00:36:31 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#ifndef NORTHBRIDGE_INTEL_COMMON_FIXED_BARS_H
4#define NORTHBRIDGE_INTEL_COMMON_FIXED_BARS_H
5
6_Static_assert(CONFIG_FIXED_MCHBAR_MMIO_BASE != 0, "MCHBAR base address is zero");
7_Static_assert(CONFIG_FIXED_DMIBAR_MMIO_BASE != 0, "DMIBAR base address is zero");
8_Static_assert(CONFIG_FIXED_EPBAR_MMIO_BASE != 0, "EPBAR base address is zero");
9
10#include <stdint.h>
11
Angel Pons35290242021-02-10 10:11:58 +010012#define MCHBAR8(x) (*((volatile u8 *)((uintptr_t)CONFIG_FIXED_MCHBAR_MMIO_BASE + (x))))
13#define MCHBAR16(x) (*((volatile u16 *)((uintptr_t)CONFIG_FIXED_MCHBAR_MMIO_BASE + (x))))
14#define MCHBAR32(x) (*((volatile u32 *)((uintptr_t)CONFIG_FIXED_MCHBAR_MMIO_BASE + (x))))
Angel Ponsf462b3d2021-01-20 00:36:31 +010015
Angel Pons35290242021-02-10 10:11:58 +010016#define DMIBAR8(x) (*((volatile u8 *)((uintptr_t)CONFIG_FIXED_DMIBAR_MMIO_BASE + (x))))
17#define DMIBAR16(x) (*((volatile u16 *)((uintptr_t)CONFIG_FIXED_DMIBAR_MMIO_BASE + (x))))
18#define DMIBAR32(x) (*((volatile u32 *)((uintptr_t)CONFIG_FIXED_DMIBAR_MMIO_BASE + (x))))
Angel Ponsf462b3d2021-01-20 00:36:31 +010019
Angel Pons35290242021-02-10 10:11:58 +010020#define EPBAR8(x) (*((volatile u8 *)((uintptr_t)CONFIG_FIXED_EPBAR_MMIO_BASE + (x))))
21#define EPBAR16(x) (*((volatile u16 *)((uintptr_t)CONFIG_FIXED_EPBAR_MMIO_BASE + (x))))
22#define EPBAR32(x) (*((volatile u32 *)((uintptr_t)CONFIG_FIXED_EPBAR_MMIO_BASE + (x))))
Angel Ponsf462b3d2021-01-20 00:36:31 +010023
24#endif /* ! NORTHBRIDGE_INTEL_COMMON_FIXED_BARS_H */