Skip to content

Commit f3805fb

Browse files
ldubeacassis
authored andcommitted
arch/mips/jz4780: Add HDMI EDID parsing and dynamic display modes
This commit introduces EDID reading and parsing to the JZ4780 display driver, replacing hardcoded resolution limits with dynamic mode selection based on the connected display's capabilities. Specific changes include: - Implemented I2C DDC master communication for the HDMI controller to read EDID blocks from monitors. - Added dynamic mode selection to calculate bandwidth and pick the best supported resolution, prioritizing the EDID preferred mode. - Dynamically allocated framebuffer bounds (g_planeinfo and g_videoinfo) based on parsed EDID dimensions. - Configured GPIO pin multiplexing for HDMI power, DDC, and control pins (POWER_EN, CEC, SCL, SDA) to enable display power and communication on the CI20 board. Signed-off-by: Lwazi Dube <lwazeh@gmail.com>
1 parent 5d2ed54 commit f3805fb

5 files changed

Lines changed: 368 additions & 90 deletions

File tree

Documentation/platforms/mips/jz4780/boards/mips-creator-ci20/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CPU1 No 1.2GHz MIPS32 processor
2121
RAM Yes 256MiB
2222
ADC No
2323
Audio No
24-
Display Yes HDMI (EDID not yet supported)
24+
Display Yes HDMI
2525
DMA No
2626
Ethernet Yes Fast Ethernet (DM9000)
2727
GPIO Yes

arch/mips/include/jz4780/chip.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@
8989

9090
#define JZPMC_BASE 0xb0000000
9191

92+
#define JZ_EXTCLK 48000000U
93+
94+
#define PCR_PLLM(r) ((r >> 19) & 0x1FFF)
95+
#define PCR_PLLN(r) ((r >> 13) & 0x3F)
96+
#define PCR_PLLOD(r) ((r >> 9) & 0xF)
97+
98+
#define CPMPCR_REG (JZPMC_BASE + 0x14)
99+
#define CPVPCR_REG (JZPMC_BASE + 0x1c)
100+
92101
#define CLKGR0_REG (JZPMC_BASE + 0x20)
93102
# define CLKGR0_OTG0 (1 << 2)
94103
# define CLKGR0_UHC (1 << 24)
@@ -111,11 +120,17 @@
111120

112121
#define LP1CDR_REG (JZPMC_BASE + 0x54)
113122
# define LPCDR_VAL 0x15
114-
# define LPCS_VPLL 0X80000000
123+
# define LPCS_MPLL 0x40000000
124+
# define LPCS_VPLL 0x80000000
115125
# define CE_LCD (1 << 28)
116126
# define LCD_BUSY (1 << 27)
117127

118128
#define HDMICDR_REG (JZPMC_BASE + 0x8c)
129+
# define HPCS_SCLK_A 0x00000000
130+
# define HPCS_MPLL 0x40000000
131+
# define HPCS_VPLL 0x80000000
132+
# define CE_HDMI (1 << 29)
133+
# define HDMI_BUSY (1 << 28)
119134

120135
#define SRBC_REG (JZPMC_BASE + 0xc4)
121136
# define SRBC_UHC_SR (1 << 14)

0 commit comments

Comments
 (0)