msr_t soc_msr_read(unsigned index) { uint32_t offset; union { uint64_t u64; msr_t msr; } value; /* Read the low 32-bits of the register */ offset = mtrr_index_to_host_bridge_register_offset(index); value.u64 = port_reg_read(QUARK_NC_HOST_BRIDGE_SB_PORT_ID, offset); /* For 64-bit registers, read the upper 32-bits */ if ((offset >= QUARK_NC_HOST_BRIDGE_MTRR_FIX64K_00000) && (offset <= QUARK_NC_HOST_BRIDGE_MTRR_FIX4K_F8000)) { offset += 1; value.u64 |= port_reg_read(QUARK_NC_HOST_BRIDGE_SB_PORT_ID, offset); } return value.msr; }
void disable_rom_shadow(void) { uint32_t data; /* Determine if the shadow ROM is enabled */ data = port_reg_read(QUARK_NC_HOST_BRIDGE_SB_PORT_ID, QNC_MSG_FSBIC_REG_HMISC); if ((data & (ESEG_RD_DRAM | FSEG_RD_DRAM)) != (ESEG_RD_DRAM | FSEG_RD_DRAM)) { /* Disable the ROM shadow 0x000e0000 - 0x000fffff */ data |= ESEG_RD_DRAM | FSEG_RD_DRAM; port_reg_write(QUARK_NC_HOST_BRIDGE_SB_PORT_ID, QNC_MSG_FSBIC_REG_HMISC, data); } }