]> git.baikalelectronics.ru Git - arm-tf.git/commit
refactor(mediatek): smc registration services
authorLeon Chen <leon.chen@mediatek.com>
Wed, 8 Jun 2022 02:49:24 +0000 (10:49 +0800)
committerBo-Chen Chen <rex-bc.chen@mediatek.com>
Tue, 30 Aug 2022 08:47:43 +0000 (16:47 +0800)
commit6a7e8ebf76a9e25614fd98634f26059953cd9309
tree1410e24979e2b20db698693052a37c0534b02341
parent52035dee1ae7b0f2f0d5f16c734ca7a5cea127b7
refactor(mediatek): smc registration services

To modularize SMC handler, provide macro function in mtk_sip_svc.h.
Drivers register SMC name with value in mtk_sip_def.h, and bind the SMC
handler with the SMC ID by calling DECLARE_SMC_HANDLER macro.

MTK_SIP_SMC_FROM_BL33_TABLE expand the SMC table as switch-case table
statically. DECLARE_SMC_HANDLER wrap SMC handlers with a structure and
put in a section.
During cold boot initialization, in MTK_EARLY_PLAT_INIT level parse the
section to assign each handler with an index. Each SMC request can be
identified with switch-case and take the index to call into
corresponding SMC handler.

Signed-off-by: Leon Chen <leon.chen@mediatek.com>
Change-Id: I03da212c786de0ec0ea646ba906065ecfcd82571
plat/mediatek/common/mtk_smc_handlers.c [new file with mode: 0644]