On 6 November 2015 at 16:11, Jeremy Linton <jeremy.lin...@arm.com> wrote: > On 11/06/2015 01:31 AM, Ard Biesheuvel wrote: >> >> On 5 November 2015 at 22:51, Jeremy Linton <jeremy.lin...@arm.com> wrote: >>> >>> >>> [Guids.common] >>> gArmJunoTokenSpaceGuid = { 0xa1147a20, 0x3144, 0x4f8d, { 0x82, >>> 0x95, 0xb4, 0x83, 0x11, 0xc8, 0xe4, 0xa4 } } >>> + gArmJunoDxe = { 0x1484ebe8, 0x2681, 0x45f1, { 0xa2, >>> 0xe5, 0x12, 0xec, 0xad, 0x89, 0x3b, 0x62 } } # match the ArmJunoDxe FILE >>> GUID >>> >> >> I am not too crazy about using the BEFORE/AFTER depexes. Is this the >> only way to achieve the ordering? >> > > Ard, > > I'm sort of a EDK2 newbie, so there may be a lot of alternatives I didn't > consider. > > That said, that dependency is there to assure that the PcdJunoRevision is > set before the SMBIOS module loads. Initially I tried to make this module > sort of "generic" but as I progressed it became more Juno specific, so I > moved it into the Juno directory and set this dependency. > > I am keenly aware of the fact that there isn't a single BEFORE/AFTER > dependency in the whole project. Further I don't really like the fact that i > couldn't directly reference the FILE GUID (rather having to duplicate it). I > considered SOR (which results in a reverse dependency if you will) and > adding a bogus protocol/etc, duplicating the juno revision detection logic, > none of which seemed like a particularly clean implementation. To my > limited knowledge this seemed like the least evil solution. It also bothered > me that I couldn't set an AFTER with a protocol dependency.... > > Suggestions welcome, >
AFAICT, this is all you need to do to get the revision, right? ----------8<---------------- // // We detect whether we are running on a Juno r0 or Juno r1 board at // runtime by checking the value of the MIDR register. // Midr = ArmReadMidr (); CpuType = (Midr >> ARM_CPU_TYPE_SHIFT) & ARM_CPU_TYPE_MASK; CpuRev = Midr & ARM_CPU_REV_MASK; switch (CpuType) { case ARM_CPU_TYPE_A53: if (CpuRev == ARM_CPU_REV (0, 0)) { JunoRevision = JUNO_R0; } else if (CpuRev == ARM_CPU_REV (0, 3)) { JunoRevision = JUNO_R1; } break; case ARM_CPU_TYPE_A57: if (CpuRev == ARM_CPU_REV (0, 0)) { JunoRevision = JUNO_R0; } else if (CpuRev == ARM_CPU_REV (1, 1)) { JunoRevision = JUNO_R1; } } ----------8<---------------- I would much prefer duplicating this over adding dynamic PCDs and BEFORE/AFTER depexes. If you really insist, you can break it out into a separate static library, but I wouldn't even bother tbh. -- Ard. _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel