Angel Pons | fabfe9d | 2020-04-05 15:47:07 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aamir Bohra | dd7acaa | 2020-03-25 11:36:22 +0530 | [diff] [blame] | 2 | |
Aamir Bohra | dd7acaa | 2020-03-25 11:36:22 +0530 | [diff] [blame] | 3 | #include <console/console.h> |
| 4 | #include <intelblocks/p2sb.h> |
| 5 | |
| 6 | void p2sb_soc_get_sb_mask(uint32_t *ep_mask, size_t count) |
| 7 | { |
| 8 | uint32_t mask; |
| 9 | |
| 10 | if (count != P2SB_EP_MASK_MAX_REG) { |
| 11 | printk(BIOS_ERR, "Unable to program EPMASK registers\n"); |
| 12 | return; |
| 13 | } |
| 14 | |
| 15 | /* Remove the host accessing right to PSF register range. |
| 16 | * Set p2sb PCI offset EPMASK5 [29, 28, 27, 26] to disable Sideband |
| 17 | * access for PCI Root Bridge. |
| 18 | */ |
| 19 | mask = (1 << 29) | (1 << 28) | (1 << 27) | (1 << 26); |
| 20 | |
| 21 | ep_mask[P2SB_EP_MASK_5_REG] = mask; |
| 22 | |
| 23 | /* |
| 24 | * Set p2sb PCI offset EPMASK7 [31, 30] to disable Sideband |
| 25 | * access for Broadcast and Multicast. |
| 26 | */ |
| 27 | mask = (1 << 31) | (1 << 30); |
| 28 | |
| 29 | ep_mask[P2SB_EP_MASK_7_REG] = mask; |
| 30 | } |