mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-26 06:50:10 +00:00
Merge pull request #446 from vikramkanigiri/vk/tzc-400
Fix TZC-400 peripheral detection
This commit is contained in:
commit
f3974ea5b1
2 changed files with 17 additions and 12 deletions
|
@ -118,14 +118,13 @@ static inline void tzc_write_region_id_access(uintptr_t base,
|
||||||
REGION_NUM_OFF(region), val);
|
REGION_NUM_OFF(region), val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t tzc_read_component_id(uintptr_t base)
|
static unsigned int tzc_read_peripheral_id(uintptr_t base)
|
||||||
{
|
{
|
||||||
uint32_t id;
|
unsigned int id;
|
||||||
|
|
||||||
id = mmio_read_8(base + CID0_OFF);
|
id = mmio_read_8(base + PID0_OFF);
|
||||||
id |= (mmio_read_8(base + CID1_OFF) << 8);
|
/* Masks jep106_id_3_0 part in PID1 */
|
||||||
id |= (mmio_read_8(base + CID2_OFF) << 16);
|
id |= ((mmio_read_8(base + PID1_OFF) & 0xF) << 8);
|
||||||
id |= (mmio_read_8(base + CID3_OFF) << 24);
|
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
@ -166,17 +165,21 @@ static void tzc_set_gate_keeper(uintptr_t base, uint8_t filter, uint32_t val)
|
||||||
|
|
||||||
void tzc_init(uintptr_t base)
|
void tzc_init(uintptr_t base)
|
||||||
{
|
{
|
||||||
uint32_t tzc_id, tzc_build;
|
unsigned int tzc_id;
|
||||||
|
unsigned int tzc_build;
|
||||||
|
|
||||||
assert(base);
|
assert(base);
|
||||||
|
|
||||||
|
/* Assert if already initialised */
|
||||||
|
assert(!tzc.base);
|
||||||
|
|
||||||
tzc.base = base;
|
tzc.base = base;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We expect to see a tzc400. Check component ID. The TZC-400 TRM shows
|
* We expect to see a tzc400. Check peripheral ID.
|
||||||
* component ID is expected to be "0xB105F00D".
|
|
||||||
*/
|
*/
|
||||||
tzc_id = tzc_read_component_id(tzc.base);
|
tzc_id = tzc_read_peripheral_id(tzc.base);
|
||||||
if (tzc_id != TZC400_COMPONENT_ID) {
|
if (tzc_id != TZC400_PERIPHERAL_ID) {
|
||||||
ERROR("TZC : Wrong device ID (0x%x).\n", tzc_id);
|
ERROR("TZC : Wrong device ID (0x%x).\n", tzc_id);
|
||||||
panic();
|
panic();
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,9 @@
|
||||||
#define TZC_REGION_ACCESS_RDWR(id) \
|
#define TZC_REGION_ACCESS_RDWR(id) \
|
||||||
(TZC_REGION_ACCESS_RD(id) | TZC_REGION_ACCESS_WR(id))
|
(TZC_REGION_ACCESS_RD(id) | TZC_REGION_ACCESS_WR(id))
|
||||||
|
|
||||||
#define TZC400_COMPONENT_ID 0xb105f00d
|
/* Consist of part_number_1 and part_number_0 */
|
||||||
|
#define TZC400_PERIPHERAL_ID 0x0460
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
Loading…
Add table
Reference in a new issue