Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions core/drivers/qcom/rpmh/kodiak/rpmh_msgram_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/

#ifndef __RPMH_MSGRAM_CONFIG_H__
#define __RPMH_MSGRAM_CONFIG_H__

#define MSG_RAM_SECTION_SIZE 0x10000

#endif /* __RPMH_MSGRAM_CONFIG_H__ */
11 changes: 11 additions & 0 deletions core/drivers/qcom/rpmh/lemans/rpmh_msgram_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/

#ifndef __RPMH_MSGRAM_CONFIG_H__
#define __RPMH_MSGRAM_CONFIG_H__

#define MSG_RAM_SECTION_SIZE 0x10000

#endif /* __RPMH_MSGRAM_CONFIG_H__ */
12 changes: 12 additions & 0 deletions core/drivers/qcom/rpmh/nord/rpmh_msgram_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/

#ifndef __RPMH_MSGRAM_CONFIG_H__
#define __RPMH_MSGRAM_CONFIG_H__

/* AOP message RAM section size: MSG_RAM_DRV_SIZE (0x400) + MSG_RAM_GAP_SIZE (0xC00) */
#define MSG_RAM_SECTION_SIZE 0x1000

#endif /* __RPMH_MSGRAM_CONFIG_H__ */
4 changes: 2 additions & 2 deletions core/drivers/qcom/rpmh/rpmh_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <util.h>

#include "rpmh_hal.h"
#include "rpmh_msgram_config.h"
#include "rpmh_resource_commands.h"
#include "rpmh_tcs.h"

Expand Down Expand Up @@ -66,7 +67,6 @@ struct client_queue {
};

#define AOP_BOOT_COOKIE 0xA0C00C1E
#define MSG_RAM_SECTION_SIZE 0x10000

struct aop_msg_ram_dict {
uint32_t boot_cookie_offset;
Expand Down Expand Up @@ -242,7 +242,7 @@ static TEE_Result check_aop_init(void)
return TEE_ERROR_GENERIC;
}

dict_addr = base + AOP_MSG_RAM_SIZE - MSG_RAM_SECTION_SIZE;
dict_addr = base + 15 * MSG_RAM_SECTION_SIZE;
dict = (struct aop_msg_ram_dict *)dict_addr;
cookie_addr = base + dict->boot_cookie_offset;

Expand Down
4 changes: 2 additions & 2 deletions core/drivers/qcom/rpmh/rpmh_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ enum hal_status hal_rpmh_write_cmd(enum rsc_drv_id drv_id,
cmd_base = tcs_base + TCS_CMD_BASE_OFFSET + (cmd_idx * TCS_CMD_STRIDE);

msgid = 0;
msgid |= SHIFT_U32(0, MSGID_READ_OR_WRITE_SHIFT);
msgid |= SHIFT_U32(MSGID_WRITE, MSGID_READ_OR_WRITE_SHIFT);
msgid |= SHIFT_U32((completion ? 1 : 0), MSGID_RES_REQ_SHIFT);
msgid |= SHIFT_U32(1, MSGID_MSG_LENGTH_SHIFT);
msgid |= SHIFT_U32(MSGID_MSG_LENGTH_VALUE, MSGID_MSG_LENGTH_SHIFT);

slave_id = (addr >> 16) & 0x7;
offset = addr & 0xFFFF;
Expand Down
6 changes: 6 additions & 0 deletions core/drivers/qcom/rpmh/rpmh_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ enum hal_status {
#define MSGID_RES_REQ_SHIFT 0x8
#define MSGID_MSG_LENGTH_SHIFT 0x0

#define MSGID_READ 0x0
#define MSGID_WRITE 0x1

/* Each RPMh command transfers a single 32-bit word (encoded as 8 bytes). */
#define MSGID_MSG_LENGTH_VALUE 0x8

#define ADDR_SLV_ID_SHIFT 0x10
#define ADDR_OFFSET_SHIFT 0x0

Expand Down
3 changes: 3 additions & 0 deletions core/drivers/qcom/rpmh/sub.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ srcs-y += rpmh_resource_commands.c

# DRV configuration
srcs-y += rpmh_drv_config.c

# Per-target rpmh_msgram_config.h (MSG_RAM_SECTION_SIZE)
global-incdirs-y += $(PLATFORM_FLAVOR)