private static IEnumerable <HostCheckLocation> GetHostCheckLocations(HwGeneration gen) { switch (gen) { case HwGeneration.DSL6540_6340: case HwGeneration.JHL6540_6340: return(new HostCheckLocation[8] { new HostCheckLocation(HwType._1Port, 5u, 2u, "Device ID", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 16u, 4u, "PCIe Settings", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 18u, 1u, "PA", Convert.ToByte("11001100", 2), Sections.DRAMUCode), new HostCheckLocation(HwType._2Ports, 19u, 1u, "PB", Convert.ToByte("11001100", 2), Sections.DRAMUCode), new HostCheckLocation(HwType._1Port, 289u, 1u, "Snk0", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 297u, 1u, "Snk1", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 310u, 1u, "Src0", 240, Sections.Digital), new HostCheckLocation(HwType._1Port, 182u, 1u, "PA/PB (USB2)", Convert.ToByte("11000000", 2), Sections.Digital) }); case HwGeneration.JHL6240: return(new HostCheckLocation[6] { new HostCheckLocation(HwType._1Port, 5u, 2u, "Device ID", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 16u, 4u, "PCIe Settings", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 18u, 1u, "PA", Convert.ToByte("11001100", 2), Sections.DRAMUCode), new HostCheckLocation(HwType._1Port, 19u, 1u, "PB", Convert.ToByte("01000100", 2), Sections.DRAMUCode), new HostCheckLocation(HwType._1Port, 289u, 1u, "Snk0", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 182u, 1u, "PA/PB (USB2)", Convert.ToByte("11000000", 2), Sections.Digital) }); case HwGeneration.JHL7540_7440_7340: return(new HostCheckLocation[10] { new HostCheckLocation(HwType._1Port, 5u, 2u, "Device ID", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 16u, 4u, "PCIe Settings", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 18u, 1u, "PA", Convert.ToByte("11001100", 2), Sections.DRAMUCode), new HostCheckLocation(HwType._2Ports, 19u, 1u, "PB", Convert.ToByte("11001100", 2), Sections.DRAMUCode), new HostCheckLocation(HwType._1Port, 289u, 1u, "Snk0", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 297u, 1u, "Snk1", byte.MaxValue, Sections.Digital), new HostCheckLocation(HwType._1Port, 310u, 1u, "Src0", 240, Sections.Digital), new HostCheckLocation(HwType._1Port, 182u, 1u, "PA/PB (USB2)", Convert.ToByte("11000000", 2), Sections.Digital), new HostCheckLocation(HwType._1Port, 94u, 1u, "Aux", 15, Sections.Digital), new HostCheckLocation(HwType._2Ports, 94u, 1u, "Aux (PB)", 16, Sections.Digital) }); default: throw new TbtException(TbtStatus.SDK_UNKNOWN_CHIP); } }
protected override IEnumerable <CheckLocation> GetCheckLocations(HwGeneration generation) { CheckLocation isHostCheckLocation = ImageValidator.GetIsHostCheckLocation(); isHostCheckLocation.ErrorCode = TbtStatus.SDK_IMAGE_FOR_DEVICE_ERROR; List <CheckLocation> list = new List <CheckLocation>(); list.Add(isHostCheckLocation); list.AddRange(GetHostCheckLocations(generation).Where(delegate(HostCheckLocation val) { if (val.Type != HwType._1Port) { return(val.Type == base.HwInfo.Type); } return(true); })); return(list); }
protected override IEnumerable <CheckLocation> GetCheckLocations(HwGeneration generation) { CheckLocation isHostCheckLocation = ImageValidator.GetIsHostCheckLocation(); isHostCheckLocation.ErrorCode = TbtStatus.SDK_IMAGE_FOR_HOST_ERROR; if ((uint)(generation - 3) <= 2u) { return(new CheckLocation[2] { isHostCheckLocation, new CheckLocation(292u, 1u, byte.MaxValue, Sections.ArcParams, TbtStatus.SDK_IMAGE_VALIDATION_ERROR, "X of N") }); } if (generation == HwGeneration.JHL7540_7440_7340) { return(new CheckLocation[1] { isHostCheckLocation }); } throw new TbtException(TbtStatus.SDK_UNKNOWN_CHIP); }
protected abstract IEnumerable <CheckLocation> GetCheckLocations(HwGeneration generation);
public override Dictionary <Sections, SectionDetails> GetSectionInfo() { Dictionary <Sections, SectionDetails> sectionInfo = base.GetSectionInfo(); HwGeneration generation = base.Source.Info.Generation; if ((uint)(generation - 3) > 3u) { throw new TbtException(TbtStatus.SDK_UNKNOWN_CHIP); } FwLocation fwLocation = new FwLocation { Offset = sectionInfo[Sections.Digital].Offset + 2, Length = 1 }; SectionReadBit sectionReadBit = (SectionReadBit)base.Source.Read(fwLocation.Offset, fwLocation.Length)[0]; if (sectionReadBit.HasFlag(SectionReadBit.DRAM)) { var obj = new[] { new { name = "CP", flag = SectionReadBit.CP }, new { name = "HDPOut", flag = SectionReadBit.DPOUT }, new { name = "HDPIn", flag = SectionReadBit.DPIN }, new { name = "LC", flag = SectionReadBit.LC }, new { name = "ARC", flag = SectionReadBit.ARC }, new { name = "IRAM", flag = SectionReadBit.IRAM } }; FwLocation fwLocation2 = new FwLocation { Offset = sectionInfo[Sections.Digital].Offset + 3, Length = 2 }; uint num = sectionInfo[Sections.Digital].Offset + BitConverter.ToUInt16(base.Source.Read(fwLocation2.Offset, fwLocation2.Length), 0); var array = obj; foreach (var anon in array) { if (sectionReadBit.HasFlag(anon.flag)) { uint num2 = SectionSize16BitDw(num); num += num2; } } sectionInfo[Sections.DRAMUCode] = new SectionDetails { Offset = num }; sectionInfo[Sections.DRAMUCode].Length = SectionSize16BitDw(sectionInfo[Sections.DRAMUCode].Offset); } return(sectionInfo); }