From patchwork Wed Apr 24 09:59:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 13641683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CAC7CC4345F for ; Wed, 24 Apr 2024 10:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=w1uphpwkNcNshIHUozbQYF2v3QflfOb6FSsobhDxl8k=; b=HPtjuBWh9o6LpN 9Vb5+YP7uw6N/BMBYvRNgAPzMM2+oPsUv1DreFlg7wj0fDfOQd1k0AGkeaqrt6AT0q/I+ZrE5xXMq 3lj8URJCS6RKxeBprm6hPDTi+AgqdiVf/kFaJon1UVbkveRbGXcwKaizibPFbXGGAm64GNlItCMjF N9+8OhsqcpCnlD3e2LpZQ4j9Gb8f+NdCpPSp0AEqrS8PqxKkiD8Lx3xn5660Ufi22i88qDEgXIhHS Ds8C/CLy8gHFjrJxRbLxL0EWmZPFtb96WrEb++2AkwhEBQAhDMCkC62WaE6ZjLgQzNQV/1cv4zM1l /DrKgI/4Rx2A+rftHbFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzZQE-00000003bM3-3GrA; Wed, 24 Apr 2024 10:00:14 +0000 Received: from mail-co1nam11on20600.outbound.protection.outlook.com ([2a01:111:f403:2416::600] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzZQB-00000003bJO-1mCj for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2024 10:00:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=STJBMBRTZFsXfcRXJugTESkSNq+7yIlCGoNYV2242l/TmXd+qJVwDJnR7y7mze44VsZ2YG+N2ZLki5jS59bI4casPWlRTEDnerBmI6ETtbR0cqGA9HVhb2PaPB8ooFal7mTgU6iM2zxaddtegPJjQrahI3SW7UazoNMIjHKObc8E8alTV71y0Xu/vA+VoJ5WaPoUrjoz8mfcETsUsXAjvoawFlbtro047ZlUXCX47BF8ovrPATfjwSfsPRT61qjhmtXS+PesT/agooS/f3K1L71tAgIq4HJK+Nt52UYfz+DZfpOmWDW9HEkx46Jtk3oG7L4ktyIwmO0Ck5XleKb+Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2m34a1BvNKuKhl6vxy1SwgC0Ebirw9tPVPg4fk7J3zI=; b=Elu8HsqikvFPxo0FqCe5YtzNaTBd4fHl+b4buOsPLmVwV3QJM693ZiFrpHvEw+j7Oga2lPQAp992uJhSF7nvMZ4d7y4kTyYpuZkPXbEJhiwZCf7M7S352wr5GeFDgbFQ1G9HB/xUMyyHtuVXnqOB5fnT/cktU04pQHzaow5NBkSOZMC2xgLGDOvJwa2AA6dRTkjRSluk8xWRvF1KMnMi1tHnGROZD/sdTc+DedZ5fdZWe7NKhUtca9MSzXcPWlB8RKvPxiK9ZlYcMnzef+VkW36NgF/Vx1EPT3OezKcqo2Ikj0OXQST0myryyR69ym+pvLo1S6cqg2+0BVJOdIqZLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2m34a1BvNKuKhl6vxy1SwgC0Ebirw9tPVPg4fk7J3zI=; b=0r8mGqS+3tRMZlDFSGhOB7/OCTHKydYNlUpNEZyUqn09b3sFuxDa/Vp3uMj7NU53DJLmes3QNoxX6UPX1L56SOl9/m6+TZQgzJkS+zIvH9l1aV+7DK4FR0sG21nKYgjmAipVq0j/Xu1O+1zqT7E8tI5pMnDnIbfgB5jfAp8cna0= Received: from CH2PR08CA0008.namprd08.prod.outlook.com (2603:10b6:610:5a::18) by DS0PR12MB6534.namprd12.prod.outlook.com (2603:10b6:8:c1::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Wed, 24 Apr 2024 10:00:02 +0000 Received: from CH3PEPF00000016.namprd21.prod.outlook.com (2603:10b6:610:5a:cafe::72) by CH2PR08CA0008.outlook.office365.com (2603:10b6:610:5a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.22 via Frontend Transport; Wed, 24 Apr 2024 10:00:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CH3PEPF00000016.mail.protection.outlook.com (10.167.244.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.0 via Frontend Transport; Wed, 24 Apr 2024 10:00:02 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 24 Apr 2024 05:00:01 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 24 Apr 2024 05:00:01 -0500 Received: from xsjarunbala50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Wed, 24 Apr 2024 05:00:00 -0500 From: Jay Buddhabhatti To: CC: , , Jay Buddhabhatti Subject: [PATCH] soc: xilinx: Add cb event for subsystem restart Date: Wed, 24 Apr 2024 02:59:37 -0700 Message-ID: <20240424095937.2448-1-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: jay.buddhabhatti@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF00000016:EE_|DS0PR12MB6534:EE_ X-MS-Office365-Filtering-Correlation-Id: 588433f0-f3cd-4c78-862b-08dc64454f03 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ihQUh8MUfJKh971h/6h+zNY4/w+3mpgSjBcweE83HvrgmgrREar31Hn94IbPlcRyQRHb7UXluOdnLffwaQzbwebAf2rXTbVJ/5difISw+26Hg7yeihtcFAHV3v5eq4LSu8gcT4K1emLz2B8alwwQzet1gbfd9IB5uYaznu+rSTD2n9FASZcY97yFro4rLkORsspXBRYBdjnPxhxkrBLjIEaJL/xOeIm1Qbf8Sb3HLvtoyaW3ZQL1Md2BpiFodNnsG5QKfEkargGI1jUejz/ud19JD7FQE1x8RydPcFuIdooI9FuMxuOc54fpuslzmcVmhcEsePpYGV1eA0wEdXA7b4ZS4DcD8Dj73Q9cnhyrU+Xa1Aqq9FGpKFzrtdk9auziDnFMbqf4MJhw0EqkGF5SsQy1XJWp8tDV4J8BuDmrAmZvpDYQA4kJT0DEClZcx3nnyIhdLhQiG6IL+Va3VZE/D5IrkfI59u+cGLPGKyvfA1KHt6i955fZAYpVd248hPt6Ex6x+34yq8XLyfox1BWcFG9EiAkvQ3EDjkR3KQALpkslKdj+HRw+oYwKLP7qvzRGpSJZ7e30WJgXR2aiJCS7Xu8WKXSCRTBjFkuZLfwzpd4bthPkS8wLDl/5iM4/m73jogR+rbIRWuF+Kj1/+Ax3xKZbJC8BR6cSUC3nrpZBdj+agIx4JA/a6P2a30QW+Nm1ZpwzNpLfoAaLbhOhmsuS1/Kj0ZISrvI8Hxr5D763LwUeanI65J9ElZsBMMd5gI7EQWBpxTbt2nz6glHCoAcX7LezfgQCel2ABTfEQHhkZWiPW2UOCVHdvtB/gW6Fv8NYZkXePVRRr93En1xopIXtx9vay1yM8ZwuO1TX8y4CukQWUY+va/81iBjZvYnypedYb0NQGrNAP37zDTy9+gpY5GEgVLfArgN6jFOQdMjwu9cb3R3RSb5jQ+jBROG/c9e9iYHsJlIKeHVccQVf9vdLyhx1E4q6SnKHkCGTxxlT3WCbBOsBZSL1q9zHDWZ38IPtlvju0NhvV1jV/kwhRfmHLFS0trwLHC1WHFmsHccGN+VzNxqtbTiMjsVlEZlaWXobh3Vr4NuxBtgK87CR7Zqe2cmq8rtizGjyDCkJGNSoGmoboMIOjC22rTQohIa+nfzVMkPa6U4CCJ4T1O7kl/bBHXzyd1ewQm+u2iLkpNQ8JDuWye0UEmnRYCwQn5/d5mqwWYju8aH5EjrEHWZ0FViPlTYZxQxHz2tCYI6J5bUtBcOFkX4BE9QYMj0cSLWRtxPy9JI56J/q8fE5e1bhzNyTlA59w4HKHyJhGJRj6RdcIn5aPAyv1tFxg8hmo1X6o0pbfHfkHhWK0Q3fkjF3K8OaZtjtw5unSzGzON7ZzH04qfkVbGIfzLgfAnDUEAtaH/OV X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(82310400014)(376005)(1800799015)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2024 10:00:02.0451 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 588433f0-f3cd-4c78-862b-08dc64454f03 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF00000016.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6534 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240424_030011_700811_D6015DC0 X-CRM114-Status: GOOD ( 24.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support to register subsystem restart events from firmware for Versal and Versal NET platforms. This event is received when firmware requests for subsystem restart. After receiving this event, the kernel needs to be restarted. Signed-off-by: Jay Buddhabhatti --- drivers/soc/xilinx/zynqmp_power.c | 151 +++++++++++++++++--- include/linux/firmware/xlnx-event-manager.h | 12 ++ 2 files changed, 143 insertions(+), 20 deletions(-) diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c index 8570ab1a6857..c193daf04a0a 100644 --- a/drivers/soc/xilinx/zynqmp_power.c +++ b/drivers/soc/xilinx/zynqmp_power.c @@ -31,9 +31,27 @@ struct zynqmp_pm_work_struct { u32 args[CB_ARG_CNT]; }; -static struct zynqmp_pm_work_struct *zynqmp_pm_init_suspend_work; +/** + * struct zynqmp_pm_event_info - event related information + * @cb_fun: Function pointer to store the callback function. + * @cb_type: Type of callback from pm_api_cb_id, + * PM_NOTIFY_CB - for Error Events, + * PM_INIT_SUSPEND_CB - for suspend callback. + * @node_id: Node-Id related to event. + * @event: Event Mask for the Error Event. + * @wake: Flag specifying whether the subsystem should be woken upon + * event notification. + */ +struct zynqmp_pm_event_info { + event_cb_func_t cb_fun; + enum pm_api_cb_id cb_type; + u32 node_id; + u32 event; + bool wake; +}; + +static struct zynqmp_pm_work_struct *zynqmp_pm_init_suspend_work, *zynqmp_pm_init_restart_work; static struct mbox_chan *rx_chan; -static bool event_registered; enum pm_suspend_mode { PM_SUSPEND_MODE_FIRST = 0, @@ -55,6 +73,19 @@ static void zynqmp_pm_get_callback_data(u32 *buf) zynqmp_pm_invoke_fn(GET_CALLBACK_DATA, buf, 0); } +static void subsystem_restart_event_callback(const u32 *payload, void *data) +{ + /* First element is callback API ID, others are callback arguments */ + if (work_pending(&zynqmp_pm_init_restart_work->callback_work)) + return; + + /* Copy callback arguments into work's structure */ + memcpy(zynqmp_pm_init_restart_work->args, &payload[0], + sizeof(zynqmp_pm_init_restart_work->args)); + + queue_work(system_unbound_wq, &zynqmp_pm_init_restart_work->callback_work); +} + static void suspend_event_callback(const u32 *payload, void *data) { /* First element is callback API ID, others are callback arguments */ @@ -120,6 +151,37 @@ static void ipi_receive_callback(struct mbox_client *cl, void *data) } } +/** + * zynqmp_pm_subsystem_restart_work_fn - Initiate Subsystem restart + * @work: Pointer to work_struct + * + * Bottom-half of PM callback IRQ handler. + */ +static void zynqmp_pm_subsystem_restart_work_fn(struct work_struct *work) +{ + int ret; + struct zynqmp_pm_work_struct *pm_work = container_of(work, struct zynqmp_pm_work_struct, + callback_work); + + /* First element is callback API ID, others are callback arguments */ + if (pm_work->args[0] == PM_NOTIFY_CB) { + if (pm_work->args[2] == EVENT_SUBSYSTEM_RESTART) { + ret = zynqmp_pm_system_shutdown(ZYNQMP_PM_SHUTDOWN_TYPE_SETSCOPE_ONLY, + ZYNQMP_PM_SHUTDOWN_SUBTYPE_SUBSYSTEM); + if (ret) { + pr_err("unable to set shutdown scope\n"); + return; + } + + kernel_restart(NULL); + } else { + pr_err("%s Unsupported Event - %d\n", __func__, pm_work->args[2]); + } + } else { + pr_err("%s() Unsupported Callback %d\n", __func__, pm_work->args[0]); + } +} + /** * zynqmp_pm_init_suspend_work_fn - Initialize suspend * @work: Pointer to work_struct @@ -185,10 +247,46 @@ static ssize_t suspend_mode_store(struct device *dev, static DEVICE_ATTR_RW(suspend_mode); +static void unregister_event(struct device *dev, void *res) +{ + struct zynqmp_pm_event_info *event_info = res; + + xlnx_unregister_event(event_info->cb_type, event_info->node_id, + event_info->event, event_info->cb_fun, NULL); +} + +static int register_event(struct device *dev, const enum pm_api_cb_id cb_type, const u32 node_id, + const u32 event, const bool wake, event_cb_func_t cb_fun) +{ + int ret; + struct zynqmp_pm_event_info *event_info; + + event_info = devres_alloc(unregister_event, sizeof(struct zynqmp_pm_event_info), + GFP_KERNEL); + if (!event_info) + return -ENOMEM; + + event_info->cb_type = cb_type; + event_info->node_id = node_id; + event_info->event = event; + event_info->wake = wake; + event_info->cb_fun = cb_fun; + + ret = xlnx_register_event(event_info->cb_type, event_info->node_id, + event_info->event, event_info->wake, event_info->cb_fun, NULL); + if (ret) { + devres_free(event_info); + return ret; + } + + devres_add(dev, event_info); + return 0; +} + static int zynqmp_pm_probe(struct platform_device *pdev) { int ret, irq; - u32 pm_api_version; + u32 pm_api_version, pm_family_code, pm_sub_family_code, node_id; struct mbox_client *client; ret = zynqmp_pm_get_api_version(&pm_api_version); @@ -206,21 +304,43 @@ static int zynqmp_pm_probe(struct platform_device *pdev) * is not available to use) or -ENODEV(Xilinx Event Manager not compiled), * then use ipi-mailbox or interrupt method. */ - ret = xlnx_register_event(PM_INIT_SUSPEND_CB, 0, 0, false, - suspend_event_callback, NULL); + ret = register_event(&pdev->dev, PM_INIT_SUSPEND_CB, 0, 0, false, + suspend_event_callback); if (!ret) { zynqmp_pm_init_suspend_work = devm_kzalloc(&pdev->dev, sizeof(struct zynqmp_pm_work_struct), GFP_KERNEL); - if (!zynqmp_pm_init_suspend_work) { - xlnx_unregister_event(PM_INIT_SUSPEND_CB, 0, 0, - suspend_event_callback, NULL); + if (!zynqmp_pm_init_suspend_work) return -ENOMEM; - } - event_registered = true; INIT_WORK(&zynqmp_pm_init_suspend_work->callback_work, zynqmp_pm_init_suspend_work_fn); + + ret = zynqmp_pm_get_family_info(&pm_family_code, &pm_sub_family_code); + if (ret < 0) + return ret; + + if (pm_sub_family_code == VERSALNET_SUB_FAMILY_CODE) + node_id = PM_DEV_ACPU_0_0; + else + node_id = PM_DEV_ACPU_0; + + ret = register_event(&pdev->dev, PM_NOTIFY_CB, node_id, EVENT_SUBSYSTEM_RESTART, + false, subsystem_restart_event_callback); + if (ret) { + dev_err(&pdev->dev, "Failed to Register with Xilinx Event manager %d\n", + ret); + return ret; + } + + zynqmp_pm_init_restart_work = devm_kzalloc(&pdev->dev, + sizeof(struct zynqmp_pm_work_struct), + GFP_KERNEL); + if (!zynqmp_pm_init_restart_work) + return -ENOMEM; + + INIT_WORK(&zynqmp_pm_init_restart_work->callback_work, + zynqmp_pm_subsystem_restart_work_fn); } else if (ret != -EACCES && ret != -ENODEV) { dev_err(&pdev->dev, "Failed to Register with Xilinx Event manager %d\n", ret); return ret; @@ -267,15 +387,8 @@ static int zynqmp_pm_probe(struct platform_device *pdev) } ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_suspend_mode.attr); - if (ret) { - if (event_registered) { - xlnx_unregister_event(PM_INIT_SUSPEND_CB, 0, 0, suspend_event_callback, - NULL); - event_registered = false; - } - dev_err(&pdev->dev, "unable to create sysfs interface\n"); + if (ret) return ret; - } return 0; } @@ -283,8 +396,6 @@ static int zynqmp_pm_probe(struct platform_device *pdev) static void zynqmp_pm_remove(struct platform_device *pdev) { sysfs_remove_file(&pdev->dev.kobj, &dev_attr_suspend_mode.attr); - if (event_registered) - xlnx_unregister_event(PM_INIT_SUSPEND_CB, 0, 0, suspend_event_callback, NULL); if (!rx_chan) mbox_free_channel(rx_chan); diff --git a/include/linux/firmware/xlnx-event-manager.h b/include/linux/firmware/xlnx-event-manager.h index 82e8254b0f80..317e51829346 100644 --- a/include/linux/firmware/xlnx-event-manager.h +++ b/include/linux/firmware/xlnx-event-manager.h @@ -1,4 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0 */ +/* + * Xilinx Event Management Driver + * + * Copyright (C) 2024, Advanced Micro Devices, Inc. + * + * Michal Simek + */ #ifndef _FIRMWARE_XLNX_EVENT_MANAGER_H_ #define _FIRMWARE_XLNX_EVENT_MANAGER_H_ @@ -7,6 +14,11 @@ #define CB_MAX_PAYLOAD_SIZE (4U) /*In payload maximum 32bytes */ +#define EVENT_SUBSYSTEM_RESTART (4U) + +#define PM_DEV_ACPU_0_0 (0x1810c0afU) +#define PM_DEV_ACPU_0 (0x1810c003U) + /************************** Exported Function *****************************/ typedef void (*event_cb_func_t)(const u32 *payload, void *data);