blob: 4a9847a32ab4832ba843dfcd3c003b759d00ea8c [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Arthur Heymans1f2ae912018-06-12 23:48:30 +02002
3#ifndef SOUTHBRIDGE_INTEL_DEFAULT_RCBA_H
4#define SOUTHBRIDGE_INTEL_DEFAULT_RCBA_H
5
Angel Pons6e732d32021-01-28 13:56:18 +01006#define DEFAULT_RCBA ((u8 *)CONFIG_FIXED_RCBA_MMIO_BASE)
Peter Lemenkov7b428112018-10-23 11:12:46 +02007
8/* Root Complex Register Block */
9#define RCBA 0xf0
10#define RCBA_ENABLE 0x01
Arthur Heymans1f2ae912018-06-12 23:48:30 +020011
Angel Ponscf445ea2021-01-28 13:40:02 +010012#define RCBA8(x) (*((volatile u8 *)(DEFAULT_RCBA + (x))))
13#define RCBA16(x) (*((volatile u16 *)(DEFAULT_RCBA + (x))))
14#define RCBA32(x) (*((volatile u32 *)(DEFAULT_RCBA + (x))))
15#define RCBA64(x) (*((volatile u64 *)(DEFAULT_RCBA + (x))))
Arthur Heymans1f2ae912018-06-12 23:48:30 +020016
17#define RCBA_AND_OR(bits, x, and, or) \
18 (RCBA##bits(x) = ((RCBA##bits(x) & (and)) | (or)))
19#define RCBA8_AND_OR(x, and, or) RCBA_AND_OR(8, x, and, or)
20#define RCBA16_AND_OR(x, and, or) RCBA_AND_OR(16, x, and, or)
21#define RCBA32_AND_OR(x, and, or) RCBA_AND_OR(32, x, and, or)
22#define RCBA32_OR(x, or) RCBA_AND_OR(32, x, ~0UL, or)
23
Arthur Heymans1f2ae912018-06-12 23:48:30 +020024#endif /* SOUTHBRIDGE_INTEL_DEFAULT_RCBA_H */