cec: add protection to cover default logic address [1/1]

PD#SWPL-95075

Problem:
logic address is saved as 0xf, it's
default invalid logic address, cause
cec not work under uboot

Solution:
add protection, cover default logic
address with address set by framework

Verify:
am301

Change-Id: I78a2969fccd0e5fa1ecab5ca2d607c8f62e53091
Signed-off-by: hang cheng <hang.cheng@amlogic.com>
This commit is contained in:
hang cheng
2022-10-20 12:45:42 +08:00
committed by gerrit autosubmit
parent 6dbb171315
commit b0bdf47617
+7 -1
View File
@@ -1667,7 +1667,13 @@ unsigned int cec_config2_logaddr(unsigned int value, bool wr_flag)
if (wr_flag) {
temp = (read_ao(AO_DEBUG_REG1) >> 16) & 0xf;
if (temp == 0) {
/* uboot will check first logic address firstly, if it's
* invalid address, it will set default logic address
* need replace first logic address with valid address.
* if the saved first address value is 0 or 0xf, it means
* it can be replaced.
*/
if (temp == 0 || temp == 0xf) {
cec_set_reg_bits(AO_DEBUG_REG1, value, 16, 4);
} else if (temp != value) {
/* assume platform will only alloc correct logic addr */