v1.1.2:add audio and efuse patch

This commit is contained in:
刘可亮
2025-03-14 16:31:58 +08:00
parent fe0b990053
commit 049676e8a8
27 changed files with 380 additions and 119 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
* Copyright (c) 2022-2025, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,13 +24,28 @@ int efuse_init(void)
return 0;
}
void efuse_write_enable(void)
{
hal_efuse_write_enable();
}
void efuse_write_disable(void)
{
hal_efuse_write_disable();
}
int efuse_read(u32 addr, void *data, u32 size)
{
u32 wid, wval, rest, cnt;
u8 *pd, *pw;
int ret;
if (hal_efuse_clk_enable()) {
return -1;
}
if (hal_efuse_wait_ready()) {
hal_efuse_clk_disable();
pr_err("eFuse is not ready.\n");
return -1;
}
@@ -58,6 +73,8 @@ int efuse_read(u32 addr, void *data, u32 size)
rest -= cnt;
}
hal_efuse_clk_disable();
return (int)(size - rest);
}
@@ -82,6 +99,7 @@ int efuse_read_chip_id(void *data)
return 0;
}
#ifdef EFUSE_WRITE_SUPPORT
int efuse_program(u32 addr, const void *data, u32 size)
{
u32 wid, wval, rest, cnt;
@@ -89,7 +107,12 @@ int efuse_program(u32 addr, const void *data, u32 size)
u8 *pw;
int ret;
if (hal_efuse_clk_enable()) {
return -1;
}
if (hal_efuse_wait_ready()) {
hal_efuse_clk_disable();
pr_err("eFuse is not ready.\n");
return -1;
}
@@ -119,15 +142,38 @@ int efuse_program(u32 addr, const void *data, u32 size)
rest -= cnt;
}
hal_efuse_clk_disable();
return (int)(size - rest);
}
#endif
int sjtag_auth(u32 *key, u32 kwlen)
{
return hal_sjtag_auth(key, kwlen);
int ret;
if (hal_efuse_clk_enable()) {
return -1;
}
ret = hal_sjtag_auth(key, kwlen);
hal_efuse_clk_disable();
return ret;
}
int szone_auth(u32 *key, u32 kwlen)
{
return hal_szone_auth(key, kwlen);
int ret;
if (hal_efuse_clk_enable()) {
return -1;
}
ret = hal_szone_auth(key, kwlen);
hal_efuse_clk_disable();
return ret;
}