soc/mediatek/mt8196: Correct the region size for mcufw_reserved
[coreboot2.git] / src / soc / amd / common / block / data_fabric / mmio.c
blobf7f31037c754d4c81da6d18cfd94d27368bf92a1
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <amdblocks/data_fabric.h>
4 #include <device/device.h>
5 #include <types.h>
7 /* Read the registers and return normalized values */
8 void data_fabric_get_mmio_base_size(unsigned int reg, resource_t *mmio_base,
9 resource_t *mmio_limit)
11 const uint32_t base_reg = data_fabric_broadcast_read32(DF_MMIO_BASE(reg));
12 const uint32_t limit_reg = data_fabric_broadcast_read32(DF_MMIO_LIMIT(reg));
13 /* The raw register values are bits 47..16 of the actual address */
14 *mmio_base = (resource_t)base_reg << DF_MMIO_SHIFT;
15 *mmio_limit = (((resource_t)limit_reg + 1) << DF_MMIO_SHIFT) - 1;