feat(nxp-drivers): add clock skeleton for s32cc

The S32CC is an umbrella for S32G2, S32G3 and S32R45 SoCs; therefore,
this clock driver will be used for all of these families.

Change-Id: Iede5371b212b67cf494a033c62fbfdcbe9b1a879
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
This commit is contained in:
Ghennadi Procopciuc 2024-06-11 18:39:58 +03:00
parent 2e0efb3f40
commit 3a580e9e47
5 changed files with 79 additions and 0 deletions

View file

@ -1146,6 +1146,9 @@ subsections:
- title: TRDC
scope: imx-trdc
- title: Clock
scope: nxp-clk
- title: Renesas
scope: renesas-drivers

View file

@ -767,6 +767,7 @@ NXP SoC Part S32G274A and its platform port
:|M|: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
:|G|: `gprocopciucnxp`_
:|F|: docs/plat/s32g274a.rst
:|F|: drivers/nxp/clk/s32cc
:|F|: drivers/nxp/console/linflex_console.S
:|F|: include/drivers/nxp/console/linflex.h
:|F|: plat/nxp/s32

View file

@ -0,0 +1,12 @@
#
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
CLK_SOURCES := \
${PLAT_DRIVERS_PATH}/clk/s32cc/s32cc_clk_drv.c \
ifeq (${BL_COMM_CLK_NEEDED},yes)
BL2_SOURCES += ${CLK_SOURCES}
endif

View file

@ -0,0 +1,59 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <errno.h>
#include <drivers/clk.h>
static int s32cc_clk_enable(unsigned long id)
{
return -ENOTSUP;
}
static void s32cc_clk_disable(unsigned long id)
{
}
static bool s32cc_clk_is_enabled(unsigned long id)
{
return false;
}
static unsigned long s32cc_clk_get_rate(unsigned long id)
{
return 0;
}
static int s32cc_clk_set_rate(unsigned long id, unsigned long rate,
unsigned long *orate)
{
return -ENOTSUP;
}
static int s32cc_clk_get_parent(unsigned long id)
{
return -ENOTSUP;
}
static int s32cc_clk_set_parent(unsigned long id, unsigned long parent_id)
{
return -ENOTSUP;
}
void s32cc_clk_register_drv(void)
{
static const struct clk_ops s32cc_clk_ops = {
.enable = s32cc_clk_enable,
.disable = s32cc_clk_disable,
.is_enabled = s32cc_clk_is_enabled,
.get_rate = s32cc_clk_get_rate,
.set_rate = s32cc_clk_set_rate,
.get_parent = s32cc_clk_get_parent,
.set_parent = s32cc_clk_set_parent,
};
clk_register(&s32cc_clk_ops);
}

View file

@ -97,3 +97,7 @@ endif
ifeq (${IFC_NAND_NEEDED},yes)
include ${PLAT_DRIVERS_PATH}/ifc/nand/ifc_nand.mk
endif
ifeq (${CLK_NEEDED},yes)
include ${PLAT_DRIVERS_PATH}/clk/s32cc/s32cc_clk.mk
endif