/** * @brief Return base address of GIC. * * When 40 bit address supports, This function wil use. */ static uint64_t gic_periphbase_pa(void) { /* CBAR: 4, c0, 0 */ /* * MRC p15, 4, <Rt>, c15, c0, 0; Read Configuration Base * Address Register */ uint64_t periphbase = (uint64_t) read_cbar(); uint64_t pbmsb = periphbase & ((uint64_t)CBAR_PERIPHBASE_MSB_MASK); if (pbmsb) { periphbase &= ~((uint64_t)CBAR_PERIPHBASE_MSB_MASK); periphbase |= (pbmsb << 32); } return periphbase; }
static uint64_t get_periphbase(void) { uint32_t periphbase = 0x0; uint32_t cbar = (uint64_t) read_cbar(); uint8_t upper_periphbase = cbar & 0xFF; printf("%s[%d]: value of cbar: 0x%08x\n", __func__, __LINE__, cbar); if (upper_periphbase != 0) { periphbase |= (upper_periphbase << 32); cbar &= ~(0xFF); } periphbase |= cbar; return periphbase; }