Skip to content

Commit 6e49279

Browse files
authored
Merge pull request #13 from ligenxxxx/fix_fpga_ddr_calib
Fix fpga ddr calib
2 parents 092d004 + 2b3223d commit 6e49279

File tree

7 files changed

+17
-13
lines changed

7 files changed

+17
-13
lines changed

mkapp/hal/HDZGOGGLE_RX.bin

-292 Bytes
Binary file not shown.

mkapp/hal/HDZGOGGLE_VA.bin

43.8 KB
Binary file not shown.

mkapp/hal/ver.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
77-182
1+
76-184

src/core/app_state.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ void app_exit_menu() {
7979
}
8080

8181
void app_switch_to_analog() {
82+
system_exec("aww 0x0300b084 0x00001555"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11
8283
Analog_Module_Power(0, 1);
8384

8485
if (GOGGLE_VER_2) {
@@ -112,6 +113,7 @@ void app_switch_to_analog() {
112113
system_script(REC_STOP_LIVE);
113114
}
114115
void app_switch_to_av_in() {
116+
system_exec("aww 0x0300b084 0x00001555"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11
115117
Analog_Module_Power(0, 0);
116118

117119
Source_AV(0);
@@ -134,6 +136,7 @@ void app_switch_to_av_in() {
134136
}
135137

136138
void app_switch_to_hdmi_in() {
139+
system_exec("aww 0x0300b084 0x00001555"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11
137140
Analog_Module_Power(0, 0);
138141

139142
Source_HDMI_in();
@@ -171,7 +174,7 @@ void app_switch_to_hdmi_in() {
171174
// false = user selected from auto scan page
172175
void app_switch_to_hdzero(bool is_default) {
173176
int ch;
174-
177+
system_exec("aww 0x0300b084 0x00001555"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11
175178
Analog_Module_Power(0, 0);
176179

177180
if (is_default) {

src/driver/hardware.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,12 @@ void vclk_phase_set(video_source_t source, uint8_t reg_8d_sel) {
475475
else
476476
I2C_Write(ADDR_FPGA, 0x8d, (vclk_phase[source] >> 24) & 0xff);
477477

478-
I2C_Write(ADDR_FPGA, 0x8e, (vclk_phase[source] >> 16) & 0xff);
478+
if (source == VIDEO_SOURCE_HDZERO_IN_720P60_50 || source == VIDEO_SOURCE_HDZERO_IN_720P90) {
479+
I2C_Write(ADDR_FPGA, 0x8e, 0x01);
480+
} else {
481+
I2C_Write(ADDR_FPGA, 0x8e, (vclk_phase[source] >> 16) & 0xff);
482+
}
483+
479484
I2C_Write(ADDR_AL, 0x14, (vclk_phase[source] >> 8) & 0xff);
480485

481486
IT66121_set_phase(vclk_phase[source] & 3, 0);
@@ -532,9 +537,9 @@ void pclk_phase_set(video_source_t source) {
532537
LOGI("pclk_phase_set %d", pclk_phase[source]);
533538
// bit[0] hdmi in
534539
if (source == VIDEO_SOURCE_HDMI_IN_1080P50 || source == VIDEO_SOURCE_HDMI_IN_1080P60 || source == VIDEO_SOURCE_HDMI_IN_1080POTHER) {
535-
IT66021_Set_Pclk((pclk_phase[source] >> 0) & 1, 1);
540+
IT66021_Set_Pclk((pclk_phase[source] >> 0) & 1);
536541
} else {
537-
IT66021_Set_Pclk((pclk_phase[source] >> 0) & 1, 2);
542+
IT66021_Set_Pclk((pclk_phase[source] >> 0) & 1);
538543
}
539544

540545
// bit[1] analog in
@@ -611,7 +616,7 @@ void Display_UI_init() {
611616
I2C_Write(ADDR_FPGA, 0x84, 0x11);
612617

613618
OLED_SetTMG(0);
614-
system_exec("aww 0x0300b084 0x00015565"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11
619+
system_exec("aww 0x0300b084 0x00002aaa"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11
615620

616621
if (GOGGLE_VER_2)
617622
I2C_Write(ADDR_FPGA, 0xa7, 0x00);

src/driver/it66021.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,6 @@ void IT66021_edid() {
340340
I2C_L_Write(0x49, 0xc0, 0x04);
341341
}
342342

343-
void IT66021_Set_Pclk(int inv, int dly) {
344-
IT66021_Mask_WR(0, 0x0f, 0x03, 0x00);
345-
if (inv)
346-
I2C_L_Write(ADDR_IT66021, 0x50, 0xA0 + dly);
347-
else
348-
I2C_L_Write(ADDR_IT66021, 0x50, 0xB0 + dly);
343+
void IT66021_Set_Pclk(int inv) {
344+
I2C_L_Write(ADDR_IT66021, 0x50, 0xB0);
349345
}

src/driver/it66021.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void IT66021_Set_CSMatrix(int cs);
1414
int IT66021_Get_PCLKFREQ();
1515
void IT66021_edid();
1616

17-
void IT66021_Set_Pclk(int inv, int dly);
17+
void IT66021_Set_Pclk(int inv);
1818

1919
#ifdef __cplusplus
2020
}

0 commit comments

Comments
 (0)