123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- /*++
- Copyright (c) 2014 Minoca Corp. All Rights Reserved
- Module Name:
- id.c
- Abstract:
- This module implements support for getting the OMAP4 chip revision.
- Author:
- Evan Green 1-Apr-2014
- Environment:
- Firmware
- --*/
- //
- // ------------------------------------------------------------------- Includes
- //
- #include <uefifw.h>
- #include "init.h"
- //
- // ---------------------------------------------------------------- Definitions
- //
- #define OMAP4_CONTROL_ID_REGISTER 0x4A002204
- //
- // ------------------------------------------------------ Data Type Definitions
- //
- /*++
- Structure Description:
- This structure defines the mapping between an OMAP4 revision code and its
- register value.
- Members:
- Revision - Stores the revision number.
- Value - Stores the value found in the ID register for the revision number.
- --*/
- typedef struct _OMAP4_REVISION_VALUE {
- OMAP4_REVISION Revision;
- UINT32 Value;
- } OMAP4_REVISION_VALUE, *POMAP4_REVISION_VALUE;
- //
- // ----------------------------------------------- Internal Function Prototypes
- //
- //
- // -------------------------------------------------------------------- Globals
- //
- OMAP4_REVISION_VALUE EfiOmap4RevisionValues[] = {
- {Omap4430RevisionEs10, 0x0B85202F},
- {Omap4430RevisionEs20, 0x1B85202F},
- {Omap4430RevisionEs21, 0x3B95C02F},
- {Omap4430RevisionEs22, 0x4B95C02F},
- {Omap4430RevisionEs23, 0x6B95C02F},
- {Omap4460RevisionEs10, 0x0B94E02F},
- {Omap4460RevisionEs11, 0x2B94E02F}
- };
- //
- // ------------------------------------------------------------------ Functions
- //
- OMAP4_REVISION
- EfipOmap4GetRevision (
- VOID
- )
- /*++
- Routine Description:
- This routine returns the OMAP4 revision number.
- Arguments:
- None.
- Return Value:
- Returns the SoC revision value.
- --*/
- {
- UINT32 Code;
- UINTN CodeCount;
- UINTN Index;
- Code = OMAP4_READ32(OMAP4_CONTROL_ID_REGISTER);
- CodeCount = sizeof(EfiOmap4RevisionValues) /
- sizeof(EfiOmap4RevisionValues[0]);
- for (Index = 0; Index < CodeCount; Index += 1) {
- if (EfiOmap4RevisionValues[Index].Value == Code) {
- return EfiOmap4RevisionValues[Index].Revision;
- }
- }
- return Omap4RevisionInvalid;
- }
- //
- // --------------------------------------------------------- Internal Functions
- //
|