Commit Graph

28 Commits

Author SHA1 Message Date
Liming Xue 32a62cf946 kernel6.12: add dsp reset function [6/6]
PD#SWPL-222902

Problem:
dsp need to reset when dsp hang

Solution:
add reset function when dsp panic

Verify:
a5

Change-Id: I3203af2530026098d929c32558abafcf328a17d5
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2025-08-21 18:47:30 -07:00
Liming Xue d2a142709c dsp: kernel6.12 fix coverity [1/1]
PD#TV-168598

Problem:
dsp host driver have coverity issue

Solution:
fixed it

Verify:
coverity scan

Change-Id: Ia73438fce8acb2f757cc7656c8b682fd3026c093
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2025-07-07 07:08:19 -07:00
Yao Jie 63ac4c44f1 mailbox: correct FFV DSP to ARM data structure [1/1]
PD#SWPL-221289

Problem:
In host driver, DSP can not send mailbox message to
ARM successfully, because the mailbox data structure
in the host driver callback is not right

Solution:
Correct the mailbox data structure in the host
driver callback

Verify:
S6/SC2

Change-Id: I67d3a78f3adee1da7db13704915aa31afeb96524
Signed-off-by: Yao Jie <jie.yao@amlogic.com>
2025-07-07 03:27:21 -07:00
bangzheng.liu 33ba7b423c SoC s6 sc2: do not wake up screen when ffv wake up (k6.12) [4/5]
PD#SWPL-208510

Problem:
Google do not need wake up screen when ffv wake up, then
host driver would not exit early suspend mode. When katniss
do not record again, dsp side should start VWE but dsp would
not enter suspend mode.

Solution:
When katniss do not record again, audio hal would send mbox
to notice dsp, and then start VWE, if arm state is already
early_suspend, then check it dsp wakeup_flag is 1, then set
dsp to suspend state.

Verify:
s6 sc2

Change-Id: I962916e9d53a1ad0f7bb940d865a5ef1f93991f7
Signed-off-by: bangzheng.liu <bangzheng.liu@amlogic.com>
2025-06-10 20:15:42 -07:00
Wanwei Jiang 0ebbe91209 build: supports direct compilation using tools/bazel [1/4]
PD#SWPL-211590

Problem:
supports direct compilation using tools/bazel

Solution:
1. Default is the trunk's kernel, and can also be configured to
use the project kernel.
2. Default is the trunk's build.config.project, and can also be configured to
use the project's build.config.project.
3. Default is the trunk's Kconfig.ext_modules, and can also be configured to
use the project's Kconfig.ext_modules.
4. Default is the trunk's project.bzl, and can also be configured to
use the project's project.bzl. For other drivers' BUILD.bazel,
currently the corresponding GKI_CONFIG is automatically selected
based on the project. Other members are not distinguished at present.
5. Package all variables in project.bzl into a struct called project_configs,
which facilitates accessing the corresponding variables on a per-project basis.
6. Remove the DDK dependency check mechanism. However,
since it is protected by the configuration of the config, the impact is
not significant.
7. Change kernel_build to kernel_select in ddk_module.
8. support build command:
tools/bazel run --config=adt4 //project/sei/adt4:adt4_dist
./mk.sh --package adt4
9. Optimize the Bazel configure settings.
10. Optimize the copying of ko sources.
11. Optimize the copying of ko sources with debugging symbols.
12. Optimize the paths of some temporary files, so that the files are located
in the out directory instead of the /tmp directory.

Verify:
local

Test:
PB

Change-Id: I38f631215a41156910ae378c34c92de5a255309f
Signed-off-by: Wanwei Jiang <wanwei.jiang@amlogic.com>
2025-05-12 18:25:48 -07:00
qinglin.li 9294f0bbf9 scripts: use kernel build ddk_module_headers [1/1]
PD#SWPL-208157

Problem:
use kernel build ddk_module_headers

Solution:
use kernel build ddk_module_headers

Verify:
local

Test:
local

Change-Id: I68cb33366c826fcd58fdb0a040229011ea669064
Signed-off-by: qinglin.li <qinglin.li@amlogic.com>
2025-04-15 04:35:40 -07:00
biao.sun 9460c30e50 smc: can't patch to kernel for google [1/1]
PD#SWPL-208253

Problem:
can't patch to kernel for google

Solution:
modify in common_drivers

Verify:
SC2

Test:
boot and play video

Change-Id: If7adf4b52c10ec259f6ce4549f31b215895c828e
Signed-off-by: biao.sun <biao.sun@amlogic.com>
2025-04-09 21:18:46 -07:00
bangzheng.liu de1831134d host dsp: ffv fix cfi check failed [1/1]
PD#SWPL-206272

Problem:
fix cfi check failed when ffv enabled and VAD wakeup.
sched_yield is called when system waked up by mbox irq
during cpu idle, which would cause null yield_task to
schedule.

Solution:
fix cfi check failed when ffv enabled and VAD wakeup.
start work queue in mbox irq and send uevent after irq.

Verify:
local & PB

Change-Id: I07735c7ec8c97c6f51467c73b73e84347113c214
Signed-off-by: bangzheng.liu <bangzheng.liu@amlogic.com>
2025-04-08 07:08:42 -07:00
Liming Xue d40e6867e2 dsp: A5 kernel6.12 cannot load dsp firmware [1/1]
PD#SWPL-206767

Problem:
when used dsp_util load dsp firmware, it copy dsp firmware name to
fname0,but A5 start dsp from sram, it load firmware use fname1, so
A5 cannot load dsp firmware

Solution:
when dsp start from DDR, copy dsp firmware name to fname0, start from
SRAM copy dsp firmware name to fname1

Verify:
A5

Change-Id: I58ac9bdb619ea27d558b5bf4237817b120c66ec0
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2025-04-08 06:59:46 -07:00
Dezhen Wang 054039b58e scripts: add Kconfig and Makefile to common kernel source [1/1]
PD#SWPL-206164

Problem:
ddk_module cannot find Kconfig and Makefile in sub package

Solution:
add Kconfig and Makefile srcs to common kernel srcs

Verify:
local

Test:
local

Change-Id: I3e71b7e1ddea15e9d32efc0e6cb7e8e81b95b793
Signed-off-by: Dezhen Wang <dezhen.wang@amlogic.com>
2025-03-26 02:30:24 -08:00
Liming Xue 7c16056a5e dsp: host driver panic [1/1]
PD#SWPL-203492

Problem:
g12a/sm1 not have dsp and not malloc host_dsp struct,
but used host_dsp struct in probe, so caused kernel panic

Solution:
not use host_dsp in g12a/sm1

Verify:
g12a

Change-Id: I9a4856de8fbb0c00d9fe6d4832e17645fae31137
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2025-03-11 00:57:36 -08:00
Wanwei Jiang 22a093e819 ddk: optimize ddk build [1/1]
PD#SWPL-195997

Problem:
optimize ddk build

Solution:
optimize ddk build

Verify:
sc2

Test:
PB

Change-Id: I662f1e2a33ae0e5bdae97a70deb624964c5e1c5a
Signed-off-by: Wanwei Jiang <wanwei.jiang@amlogic.com>
2025-03-03 22:25:19 -08:00
Wanwei Jiang cadab66c37 build: support ddk [1/1]
PD#SWPL-195997

Problem:
the drivers in the common_drivers directory can be built using DDK
with gki_20 mode, it is also compatible with the original build.

Solution:
add BUILD.bazel and modify build script

Verify:
sc2

Test:
PB

Change-Id: Ie138e63f4eec8715d976d421dc8a431bcfadd859
Signed-off-by: Wanwei Jiang <wanwei.jiang@amlogic.com>
2025-02-25 07:17:36 -08:00
Liming Xue 9b28daa227 dsp: s6 dsp kernel6.12 bringup [1/1]
PD#SWPL-201509

Problem:
s6 dsp kernel6.12 bringup and some cl is missing compared to kernel5.15
CL number:
497805:SC2 ffv dsp flow modification
496874: object already free
509562: add shutdown function
469071: kernel support DSP suspend resume with ffv
513144: optimize DSP ffv to enter dsp power down in early suspend
510711: optimize DSP ffv to send uevent to audio hal

Solution:
kernel6.12 code matches it with kernel5.15 and synchronizes the CL
missing from kernel6.12

Verify:
s6

Change-Id: I16f853fe250545aa165df022802d0337280354f4
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2025-02-18 05:56:19 -08:00
Liming Xue 7483c429d0 host driver: synchronize fixed code from kernel5.15 [1/1]
PD#SWPL-192261

Problem:
need synchronize fixed code from kernel5.15 to kernel6.12

Solution:
fixed

Verify:
sc2

Change-Id: I9247afced7ae103ca84cda95a962622c5511dfd6
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2024-11-11 22:06:32 -08:00
Wanwei Jiang 911eeadc02 bringup: upgrade kernel from 6.6.10 to 6.6.11 [1/1]
PD#SWPL-183292

Problem:
upgrade kernel from 6.6.10 to 6.6.11

Solution:
1. modify auto patches
2. modify the code due to the change of
the remove function in struct platform_driver
3. modify the code due to the change of
the match function in struct bus_type
4. modify some page function to folio function
5. modify spi module due to some functions changed

Verify:
local

Change-Id: I92c266b6a1bbae363abd0ff50d7f3037e90bc624
Signed-off-by: Wanwei Jiang <wanwei.jiang@amlogic.com>
2024-09-26 15:05:50 +08:00
Wanwei Jiang 73604c9f07 bringup: porting basic modules [1/1]
PD#SWPL-183292

Problem:
porting basic modules

Solution:
1. porting basic modules(build pass)
2. porting common patches

Verify:
local

Change-Id: I2941231c1c3a4225adea7133d9a7d0eb8f438a73
Signed-off-by: Wanwei Jiang <wanwei.jiang@amlogic.com>
2024-09-11 15:17:02 +08:00
Liming Xue f22a30471b host: fix misc device driver data issue [1/1]
PD#SWPL-175244

Problem:
misc device store in device's drv data
host driver rewrite this data

Solution:
Not rewrite this data

Verify:
sc2

Change-Id: Ice5f14dba78330e36d707f39866d482711a0a620
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2024-06-28 11:29:49 +08:00
Liming Xue 7fab25a8db android U: kernel6.6 sc2 autotest failed [1/1]
PD#SWPL-170698

Problem:
sc2 not have dsp,resources have been released,but also register misc,
so When sc2 autostart,it accesses the /dev/hifi4dsp0 node,
so causing a panic in load firmware

Solution:
when board not have dsp,resources have been released,then return
negative value

Verify:
sc2

Change-Id: I0c453f2a17cf2772ebf0af643c3a3ccb2880aa4e
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2024-06-27 12:12:57 +00:00
Liming Xue 79d8639707 dsp: kernel6.6 bringup branch modify smc Parameters [1/1]
PD#SWPL-169092

Problem:
dsp start/suspend/remap smc uses different cmd
but there are dsp functions, so need to use the same cmd together

Solution:
dsp start/suspend/remap smc cmd uses the same

Verify:
sc2

Change-Id: I737343bf87a82d42a1a545fca15e77a0ce216bdf
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2024-06-27 12:12:23 +00:00
Liming Xue 9f46374afc dsp: sc2 bringup [1/1]
PD#SWPL-160403

Problem:
sc2 kernel6.6 dsp bringup

Solution:
sc2 kernel6.6 dsp bringup

Verify:
sc2

Change-Id: I8b31abb5094fbb463fd259b81ac8af11d5a4638f
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2024-06-27 07:42:34 +00:00
shuai.liu db0b494c66 host: dsp driver support shm for sram [1/1]
PD#SWPL-171248

Problem:
arm cannot access sram address space.

Solution:
1. add host driver support for sram.
2. remove sram related cache operations.

Verify:
A113X2 AV400 Board.

Change-Id: Ief95ab9071c9aee230492a098a041c25b7ba4203
Signed-off-by: shuai.liu <shuai.liu@amlogic.com>
2024-05-29 01:59:46 -07:00
Liming Xue 727938a93e dsp: kernel6.6 modify smc Parameters [1/1]
PD#SWPL-169092

Problem:
dsp start/suspend/remap smc uses different cmd
but there are dsp functions, so need to use the same cmd together

Solution:
dsp start/suspend/remap smc cmd uses the same

Verify:
a5/sc2

Change-Id: I5efae086e3105445c37edece5b56d3ccb58e4090
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2024-05-15 18:51:01 -07:00
Wanwei Jiang c73f5afdef module: disable module_param [1/1]
PD#SWPL-151470

Problem:
many of module parameters are no longer in use, but have not been deleted,
which affects memory and performance. all module parameters are now
disabled and can only be used after the application is approved.

Solution:
disabled all module parameters

Verify:
a4 a5

Test:
none

Change-Id: I27ee98a0437542d7b8a3da437c1525e0afded6b1
Signed-off-by: Wanwei Jiang <wanwei.jiang@amlogic.com>
2024-01-09 19:58:31 +08:00
Liming Xue 6930aef5a5 dsp: A5 kernel6.6 bringup [1/1]
PD#SWPL-149460

Problem:
A5 kernel6.6 dsp bringup

Solution:
A5 kernel6.6 dsp bringup

Verify:
A5

Change-Id: Ibeabe4507f715a82c58c8f32068b04bf4ee8ad59
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2024-01-04 23:47:02 -07:00
Liming Xue 61924ba6ba dsp: resolve dsp reconfiguration bugs [1/1]
PD#SWPL-142319

Problem:
1.a1 suspend dsp power off
2.The dsp bin name is arbitrary, when dsp_util is used,
forward incompatibility

Solution:
1.Fix device init  wakeup
2.The dsp bin name is arbitrary, when dsp_util is used

Verify:
a1/t7/t7c

Change-Id: I80001e2166a5fae8c72f5ff30b45ea1d319bbcac
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2023-10-23 02:29:13 -07:00
Liming Xue 1620ec39d0 dsp: add wfi [1/1]
PD#SWPL-99041

Problem:
dsp stop can not access wfi

Solution:
add wfi

Verify:
c1/c2/sc2

Change-Id: I10f6089501a005adf10bbe5c92ad3e95c2fb811a
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2023-09-28 05:59:05 -07:00
Liming Xue d70741d666 host driver: reconstruct dsp host driver [1/1]
PD#SWPL-99041

Problem:
reconstruct dsp host driver

Solution:
config CONFIG_AMLOGIC_MCU_DRIVER to enable mcu driver
the new driver support multiple dsp/m4 cores

Verify:
a1/c1/c2/sc2/t3/t3x/t7/t7c

Change-Id: Ib1e666e615260bb5b7377a18eeaaf8daa65de86f
Signed-off-by: Liming Xue <liming.xue@amlogic.com>
2023-09-25 00:13:42 -07:00