GK SDK 源码库: XMIPCLinuxV100R005C00SPC030 (kernel/tools/open_source excluded)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2020 NXP
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
|
||||
#include <endian.h>
|
||||
|
||||
#include <common/debug.h>
|
||||
#include <csu.h>
|
||||
#include <lib/mmio.h>
|
||||
|
||||
void enable_layerscape_ns_access(struct csu_ns_dev_st *csu_ns_dev,
|
||||
uint32_t num, uintptr_t nxp_csu_addr)
|
||||
{
|
||||
uint32_t *base = (uint32_t *)nxp_csu_addr;
|
||||
uint32_t *reg;
|
||||
uint32_t val;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
reg = base + csu_ns_dev[i].ind / 2U;
|
||||
val = be32toh(mmio_read_32((uintptr_t)reg));
|
||||
if (csu_ns_dev[i].ind % 2U == 0U) {
|
||||
val &= 0x0000ffffU;
|
||||
val |= csu_ns_dev[i].val << 16U;
|
||||
} else {
|
||||
val &= 0xffff0000U;
|
||||
val |= csu_ns_dev[i].val;
|
||||
}
|
||||
mmio_write_32((uintptr_t)reg, htobe32(val));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# Copyright 2021 NXP
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
ifeq (${CSU_ADDED},)
|
||||
|
||||
CSU_ADDED := 1
|
||||
|
||||
PLAT_INCLUDES += -I$(PLAT_DRIVERS_INCLUDE_PATH)/csu
|
||||
|
||||
CSU_SOURCES += $(PLAT_DRIVERS_PATH)/csu/csu.c
|
||||
|
||||
ifeq (${BL_COMM_CSU_NEEDED},yes)
|
||||
BL_COMMON_SOURCES += ${CSU_SOURCES}
|
||||
else
|
||||
ifeq (${BL2_CSU_NEEDED},yes)
|
||||
BL2_SOURCES += ${CSU_SOURCES}
|
||||
endif
|
||||
ifeq (${BL31_CSU_NEEDED},yes)
|
||||
BL31_SOURCES += ${CSU_SOURCES}
|
||||
endif
|
||||
endif
|
||||
|
||||
endif
|
||||
Reference in New Issue
Block a user