arm64/a64: Add driver for Display Engine

This PR adds the driver for Display Engine 2.0 on Allwinner A64 SoC. The Display Engine Driver will be called by the upcoming LCD Driver for PINE64 PinePhone.

`arch/arm64/src/a64/Kconfig`: Added the Kconfig option for "A64 Peripheral Selection > DE" (`CONFIG_A64_DE`), which enables the Display Engine Driver

`arch/arm64/src/a64/hardware/a64_memorymap.h`: Added the Base Address for Display Engine

`arch/arm64/src/a64/Make.defs`: Added the Display Engine Driver to the Makefile

`boards/arm64/a64/pinephone/configs/nsh/defconfig`: Removed Scheduler Debug Info (`CONFIG_DEBUG_SCHED_INFO`) from the PinePhone Board Config, because it garbles the Console Output.

`arch/arm64/src/a64/a64_de.c`, `a64_de.h`: Display Engine Driver for Allwinner A64

`platforms/arm/a64/boards/pinephone/index.rst`: Added Display Engine as supported peripheral for PinePhone
This commit is contained in:
Lee Lup Yuen 2022-12-19 20:49:58 +08:00 committed by Xiang Xiao
parent 3e36f40130
commit 64a54d2dfd
7 changed files with 1160 additions and 10 deletions

View File

@ -142,12 +142,13 @@ Peripheral Support
NuttX for PinePhone supports these peripherals:
=========== ======= =====
Peripheral Support NOTES
=========== ======= =====
MIPI D-PHY Yes
MIPI DSI Yes
PIO Yes
TCON0 Yes
UART Yes Only UART0 is supported
=========== ======= =====
============== ======= =====
Peripheral Support NOTES
============== ======= =====
Display Engine Yes
MIPI D-PHY Yes
MIPI DSI Yes
PIO Yes
TCON0 Yes
UART Yes Only UART0 is supported
============== ======= =====

View File

@ -7,6 +7,13 @@ if ARCH_CHIP_A64
menu "Allwinner A64 Peripheral Selection"
config A64_DE
bool "DE"
default n
select A64_TCON0
---help---
Select to enable support for Display Engine 2.0.
config A64_MIPI_DSI
bool "MIPI DSI"
default n

View File

@ -23,6 +23,10 @@ include common/Make.defs
# Allwinner A64 specific C source files
CHIP_CSRCS = a64_boot.c a64_pio.c a64_serial.c
ifeq ($(CONFIG_A64_DE),y)
CHIP_CSRCS += a64_de.c
endif
ifeq ($(CONFIG_A64_MIPI_DSI),y)
CHIP_CSRCS += a64_mipi_dphy.c a64_mipi_dsi.c mipi_dsi.c
endif

1017
arch/arm64/src/a64/a64_de.c Normal file

File diff suppressed because it is too large Load Diff

120
arch/arm64/src/a64/a64_de.h Normal file
View File

@ -0,0 +1,120 @@
/****************************************************************************
* arch/arm64/src/a64/a64_de.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __ARCH_ARM64_SRC_A64_A64_DE_H
#define __ARCH_ARM64_SRC_A64_A64_DE_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: a64_de_init
*
* Description:
* Initialize the Display Engine on the SoC. Mixer 0 will be configured
* to stream pixel data to Timing Controller TCON0. Should be called
* before any Display Engine operation.
*
* Input Parameters:
* None
*
* Returned Value:
* Zero (OK) on success; ERROR if timeout.
*
****************************************************************************/
int a64_de_init(void);
/****************************************************************************
* Name: a64_de_blender_init
*
* Description:
* Initialize the UI Blender for Display Engine. Should be called after
* a64_de_init() and before a64_de_ui_channel_init().
*
* Input Parameters:
* None
*
* Returned Value:
* OK is always returned at present.
*
****************************************************************************/
int a64_de_blender_init(void);
/****************************************************************************
* Name: a64_de_ui_channel_init
*
* Description:
* Initialize a UI Channel for Display Engine. Display Engine will
* stream the pixel data from the Frame Buffer Memory (over DMA) to the
* UI Blender. There are 3 UI Channels: Base UI Channel (Channel 1) and
* 2 Overlay UI Channels (Channels 2 and 3). Should be called after
* a64_de_blender_init() and before a64_de_enable().
*
* Input Parameters:
* channel - UI Channel Number: 1, 2 or 3
* fbmem - Start of Frame Buffer Memory (address should be 32-bit),
* or NULL if this UI Channel should be disabled
* fblen - Length of Frame Buffer Memory in bytes
* xres - Horizontal resolution in pixel columns
* yres - Vertical resolution in pixel rows
* xoffset - Horizontal offset in pixel columns
* yoffset - Vertical offset in pixel rows
*
* Returned Value:
* OK is always returned at present.
*
****************************************************************************/
int a64_de_ui_channel_init(uint8_t channel,
void *fbmem,
size_t fblen,
uint16_t xres,
uint16_t yres,
uint16_t xoffset,
uint16_t yoffset);
/****************************************************************************
* Name: a64_de_enable
*
* Description:
* Set the UI Blender Route, enable the Blender Pipes and enable the
* Display Engine. Should be called after all 3 UI Channels have been
* initialized.
*
* Input Parameters:
* channels - Number of UI Channels to enable: 1 or 3
*
* Returned Value:
* OK is always returned at present.
*
****************************************************************************/
int a64_de_enable(uint8_t channels);
#endif /* __ARCH_ARM64_SRC_A64_A64_DE_H */

View File

@ -33,6 +33,8 @@
/* Peripheral Base Addresses */
#define A64_DE_ADDR 0x01000000 /* DE 0x0100:0000-0x012f:ffff 3M */
#define A64_SYSCTL_ADDR 0x01c00000 /* System Control 0x01c0:0000-0x01c0:0fff 4K */
#define A64_TCON0_ADDR 0x01c0c000 /* TCON 0 0x01c0:c000-0x01c0:cfff 4K */
#define A64_CCU_ADDR 0x01c20000 /* CCU 0x01c2:0000-0x01c2:03ff 1K */
#define A64_PIO_ADDR 0x01c20800 /* PIO 0x01c2:0800-0x01c2:0bff 1K */

View File

@ -22,7 +22,6 @@ CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_SCHED=y
CONFIG_DEBUG_SCHED_ERROR=y
CONFIG_DEBUG_SCHED_INFO=y
CONFIG_DEBUG_SCHED_WARN=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEBUG_WARN=y