32 MmioAnd32 (DP_BASE + DP_DE_LG_CONTROL, ~DP_DE_LG_ENABLE);
45 MmioOr32 (DP_BASE + DP_DE_LG_CONTROL, DP_DE_LG_ENABLE);
65 DP_BASE + DP_DE_LG_PTR_LOW,
66 DP_DE_LG_PTR_LOW_MASK & FrameBaseAddress
71 DP_BASE + DP_DE_LG_PTR_HIGH,
72 (UINT32)(FrameBaseAddress >> DP_DE_LG_PTR_HIGH_SHIFT)
102 MmioWrite32 (DP_BASE + DP_DE_LG_IN_SIZE, FRAME_IN_SIZE (HRes, VRes));
105 MmioWrite32 (DP_BASE + DP_DE_LG_CMP_SIZE, FRAME_CMP_SIZE (HRes, VRes));
108 MmioWrite32 (DP_BASE + DP_DE_LG_H_STRIDE, (HRes *
sizeof (UINT32)));
118 PixelFormat = (mDpDeviceId == MALIDP_500) ? DP_PIXEL_FORMAT_DP500_XRGB_8888
119 : DP_PIXEL_FORMAT_XRGB_8888;
121 PixelFormat = (mDpDeviceId == MALIDP_500) ? DP_PIXEL_FORMAT_DP500_XBGR_8888
122 : DP_PIXEL_FORMAT_XBGR_8888;
125 MmioWrite32 (DP_BASE + DP_DE_LG_FORMAT, PixelFormat);
147 UINTN RegSyncControl;
148 UINTN RegHVActiveSize;
150 if (mDpDeviceId == MALIDP_500) {
152 RegHIntervals = DP_BASE + DP_DE_DP500_H_INTERVALS;
153 RegVIntervals = DP_BASE + DP_DE_DP500_V_INTERVALS;
154 RegSyncControl = DP_BASE + DP_DE_DP500_SYNC_CONTROL;
155 RegHVActiveSize = DP_BASE + DP_DE_DP500_HV_ACTIVESIZE;
158 RegHIntervals = DP_BASE + DP_DE_H_INTERVALS;
159 RegVIntervals = DP_BASE + DP_DE_V_INTERVALS;
160 RegSyncControl = DP_BASE + DP_DE_SYNC_CONTROL;
161 RegHVActiveSize = DP_BASE + DP_DE_HV_ACTIVESIZE;
167 H_INTERVALS (Horizontal->FrontPorch, Horizontal->BackPorch)
173 V_INTERVALS (Vertical->FrontPorch, Vertical->BackPorch)
179 SYNC_WIDTH (Horizontal->Sync, Vertical->Sync)
185 HV_ACTIVE (Horizontal->Resolution, Vertical->Resolution)
205 DpCoreId =
MmioRead32 (DP_BASE + DP_DE_DP500_CORE_ID);
206 DpCoreId >>= DP_DE_DP500_CORE_ID_SHIFT;
208 if (DpCoreId == MALIDP_500) {
213 DpCoreId =
MmioRead32 (DP_BASE + DP_DC_CORE_ID);
214 DpCoreId >>= DP_DC_CORE_ID_SHIFT;
216 if ((DpCoreId == MALIDP_550) || (DpCoreId == MALIDP_650)) {
220 return MALIDP_NOT_PRESENT;
240 "Probing ARM Mali DP500/DP550/DP650 at base address 0x%p\n",
244 if (mDpDeviceId == 0) {
248 if (mDpDeviceId == MALIDP_NOT_PRESENT) {
249 DEBUG ((DEBUG_WARN,
"ARM Mali DP not found...\n"));
250 return EFI_NOT_FOUND;
253 DEBUG ((DEBUG_WARN,
"Found ARM Mali DP %x\n", mDpDeviceId));
269 DEBUG ((DEBUG_WARN,
"Framebuffer base address = %p\n", FrameBaseAddress));
271 if (mDpDeviceId == 0) {
275 if (mDpDeviceId == MALIDP_NOT_PRESENT) {
278 "ARM Mali DP initialization failed,"
279 "no ARM Mali DP present\n"
281 return EFI_NOT_FOUND;
303 if (mDpDeviceId == MALIDP_500) {
304 MmioOr32 (DP_BASE + DP_DE_DP500_CONTROL, DP_DE_DP500_CONTROL_CONFIG_REQ);
306 MmioOr32 (DP_BASE + DP_DC_CONTROL, DP_DC_CONTROL_CM_ACTIVE);
323 if (mDpDeviceId == MALIDP_500) {
324 MmioAnd32 (DP_BASE + DP_DE_DP500_CONTROL, ~DP_DE_DP500_CONTROL_CONFIG_REQ);
326 MmioAnd32 (DP_BASE + DP_DC_CONTROL, ~DP_DC_CONTROL_CM_ACTIVE);
342 if (mDpDeviceId == MALIDP_500) {
343 MmioOr32 (DP_BASE + DP_DP500_CONFIG_VALID, DP_DC_CONFIG_VALID);
345 MmioOr32 (DP_BASE + DP_DC_CONFIG_VALID, DP_DC_CONFIG_VALID);
373 if (EFI_ERROR (Status)) {
378 ASSERT (Horizontal !=
NULL);
379 ASSERT (Vertical !=
NULL);
383 if (EFI_ERROR (Status)) {
394 Horizontal->Resolution,
EFI_STATUS LcdInitialize(IN CONST EFI_PHYSICAL_ADDRESS FrameBaseAddress)
STATIC VOID SetConfigurationMode(VOID)
STATIC VOID LayerGraphicsConfig(IN CONST EFI_GRAPHICS_PIXEL_FORMAT UefiGfxPixelFormat, IN CONST UINT32 HRes, IN CONST UINT32 VRes)
STATIC VOID SetDisplayEngineTiming(IN CONST SCAN_TIMINGS *CONST Horizontal, IN CONST SCAN_TIMINGS *CONST Vertical)
STATIC VOID SetNormalMode(VOID)
STATIC VOID LayerGraphicsEnable(VOID)
STATIC VOID LayerGraphicsSetFrame(IN CONST EFI_PHYSICAL_ADDRESS FrameBaseAddress)
STATIC VOID SetConfigValid(VOID)
EFI_STATUS LcdIdentify(VOID)
STATIC UINT32 ArmMaliDpGetCoreId()
EFI_STATUS LcdSetMode(IN CONST UINT32 ModeNumber)
STATIC VOID LayerGraphicsDisable(VOID)
UINT32 EFIAPI MmioAnd32(IN UINTN Address, IN UINT32 AndData)
UINT32 EFIAPI MmioOr32(IN UINTN Address, IN UINT32 OrData)
UINT32 EFIAPI MmioRead32(IN UINTN Address)
UINT32 EFIAPI MmioWrite32(IN UINTN Address, IN UINT32 Value)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
EFI_GRAPHICS_PIXEL_FORMAT
@ PixelBlueGreenRedReserved8BitPerColor
UINT64 EFI_PHYSICAL_ADDRESS
EFI_GRAPHICS_PIXEL_FORMAT PixelFormat