pub fn try_parse<P>(link: &RefCell<P>, baseaddr: u64) -> Result<CSComponent, RomTableError>
    where
        P: MI + APAccess<GenericAP, IDR> + APAccess<MemoryAP, BASE> + APAccess<MemoryAP, BASE2>,
    {
        info!("\tReading component data at: {:08x}", baseaddr);

        let component_id = ComponentInformationReader::new(baseaddr, link).read_all()?;

        // Determine the component class to find out what component we are dealing with.
        info!("\tComponent class: {:x?}", component_id.class);

        // Determine the peripheral id to find out what peripheral we are dealing with.
        info!(
            "\tComponent peripheral id: {:x?}",
            component_id.peripheral_id
        );

        let class = match component_id.class {
            CSComponentClass::GenericVerificationComponent => {
                CSComponent::GenericVerificationComponent(component_id)
            }
            CSComponentClass::RomTable => {
                let rom_table = RomTable::try_parse(link, component_id.base_address);

                CSComponent::Class1RomTable(component_id, rom_table)
            }
            CSComponentClass::CoreSightComponent => CSComponent::Class9RomTable(component_id),
            CSComponentClass::PeripheralTestBlock => CSComponent::PeripheralTestBlock(component_id),
            CSComponentClass::GenericIPComponent => CSComponent::GenericIPComponent(component_id),
            CSComponentClass::CoreLinkOrPrimeCellOrSystemComponent => {
                CSComponent::CoreLinkOrPrimeCellOrSystemComponent(component_id)
            }
        };

        Ok(class)
    }
/// Tries to parse a CoreSight component table.
Tries to parse a CoreSight component table.
Tries to parse a CoreSight component table .
pub fn try_parse<P>(link: &RefCell<P>, baseaddr: u64) -> Result<CSComponent, RomTableError>
    where
        P: MI + APAccess<GenericAP, IDR> + APAccess<MemoryAP, BASE> + APAccess<MemoryAP, BASE2>,
    {
        info!("\tReading component data at: {:08x}", baseaddr);
        let component_id = ComponentInformationReader::new(baseaddr, link).read_all()?;
        // Determine the component class to find out what component we are dealing with.
        info!("\tComponent class: {:x?}", component_id.class);
        // Determine the peripheral id to find out what peripheral we are dealing with.
        info!(
            "\tComponent peripheral id: {:x?}",
            component_id.peripheral_id
        );
        let class = match component_id.class {
            CSComponentClass::GenericVerificationComponent => {
                CSComponent::GenericVerificationComponent(component_id)
            }
            CSComponentClass::RomTable => {
                let rom_table = RomTable::try_parse(link, component_id.base_address);
                CSComponent::Class1RomTable(component_id, rom_table)
            }
            CSComponentClass::CoreSightComponent => CSComponent::Class9RomTable(component_id),
            CSComponentClass::PeripheralTestBlock => CSComponent::PeripheralTestBlock(component_id),
            CSComponentClass::GenericIPComponent => CSComponent::GenericIPComponent(component_id),
            CSComponentClass::CoreLinkOrPrimeCellOrSystemComponent => {
                CSComponent::CoreLinkOrPrimeCellOrSystemComponent(component_id)
            }
        };
        Ok(class)
    }
pub fn try_parse < P > ( link : & RefCell < P > , baseaddr : u64 ) -> Result < CSComponent , RomTableError > where P : MI + APAccess < GenericAP , IDR > + APAccess < MemoryAP , BASE > + APAccess < MemoryAP , BASE2 > , { info ! ( " \t " baseaddr ) ; let component_id = ComponentInformationReader :: new ( baseaddr , link ) . read_all ( ) ? ; // Determine the component class to find out what component we are dealing with. info ! ( " \t " component_id class ) ; // Determine the peripheral id to find out what peripheral we are dealing with. info ! ( " \t " component_id peripheral_id ) ; let class = match component_id . class { CSComponentClass :: GenericVerificationComponent => { CSComponent :: GenericVerificationComponent ( component_id ) } CSComponentClass :: RomTable => { let rom_table = RomTable :: try_parse ( link , component_id . base_address ) ; CSComponent :: Class1RomTable ( component_id , rom_table ) } CSComponentClass :: CoreSightComponent => CSComponent :: Class9RomTable ( component_id ) , CSComponentClass :: PeripheralTestBlock => CSComponent :: PeripheralTestBlock ( component_id ) , CSComponentClass :: GenericIPComponent => CSComponent :: GenericIPComponent ( component_id ) , CSComponentClass :: CoreLinkOrPrimeCellOrSystemComponent => { CSComponent :: CoreLinkOrPrimeCellOrSystemComponent ( component_id ) } } ; Ok ( class ) }
Tries to parse a CoreSight component table.
Tries to parse a CoreSight component table .
link
&RefCell<P>
baseaddr
u64