-
Notifications
You must be signed in to change notification settings - Fork 34
drivers: qcom: rpmh: split target specific configuration for Lemans #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: qcom-next
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /* SPDX-License-Identifier: BSD-2-Clause */ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am thinking to club this existing header itself rather than having a new one
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can have a rpmh_target.h header like the one used in #57, another possibility is clubbing in target_config.h but that is supposed to be a higher level description, I believe.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, IDineshChoudhary; I discussed with Shivam as well & once he rebases his PR on top of the other PR which we're reviewing in upstream/qcom-next (raised by me), some of these comments would get addressed; We plan to do that once the other PR merges; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also can for micros defined if this if any unused ones there and clean them up.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do |
||
| /* | ||
| * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
| */ | ||
|
|
||
| #ifndef __RPMH_HWIO_H__ | ||
| #define __RPMH_HWIO_H__ | ||
|
|
||
| #include <util.h> | ||
|
|
||
| #define DRV_STRIDE 0x10000 | ||
| #define RSC_DRV_IRQ_ENABLE 0x0d00 | ||
| #define RSC_DRV_IRQ_STATUS 0x0d04 | ||
| #define RSC_DRV_IRQ_CLEAR 0x0d08 | ||
|
|
||
| #define RSC_DRV_TCS_CONFIG 0x0C | ||
| #define TCS_BASE_OFFSET 0x0D10 | ||
| #define TCS_STRIDE 0x2A0 | ||
|
|
||
| #define TCS_CONTROL_OFFSET 0x04 | ||
| #define TCS_STATUS_OFFSET 0x08 | ||
| #define TCS_CMD_ENABLE_OFFSET 0x0C | ||
|
|
||
| #define TCS_CMD_BASE_OFFSET 0x20 | ||
| #define TCS_CMDn_MSGID_OFFSET 0x00 | ||
| #define TCS_CMDn_ADDR_OFFSET 0x04 | ||
| #define TCS_CMDn_DATA_OFFSET 0x08 | ||
| #define TCS_CMD_STRIDE 0x14 | ||
|
|
||
| #define TCS_CONTROL_AMC_MODE_TRIGGER BIT(24) | ||
| #define TCS_CONTROL_AMC_MODE_EN BIT(16) | ||
|
|
||
| #define TCS_STATUS_CONTROLLER_IDLE BIT(0) | ||
|
|
||
| #define RSC_DRV_ERROR_IRQ_ENABLE 0xD8 | ||
|
|
||
| #define EPCB_TIMEOUT_IRQ_EN_MASK BIT(20) | ||
| #define EPCB_TIMEOUT_THRESHOLD_SHIFT 0x0 | ||
| #define EPCB_TIMEOUT_THRESHOLD_MASK 0xFFFF | ||
|
|
||
| #define MSGID_READ_OR_WRITE_SHIFT 0x10 | ||
| #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 | ||
|
|
||
| #endif /* __RPMH_HWIO_H__ */ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| #include <util.h> | ||
|
|
||
| #include "rpmh_hal.h" | ||
| #include "rpmh_hwio.h" | ||
|
|
||
| static struct { | ||
| vaddr_t rsc_base; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,5 +17,7 @@ srcs-y += rpmh_tcs.c | |
| # Resource command tracking and management | ||
| srcs-y += rpmh_resource_commands.c | ||
|
|
||
| # DRV configuration | ||
| srcs-y += rpmh_drv_config.c | ||
| # Per-target DRV configuration, register layout, target config | ||
| srcs-y += $(PLATFORM_FLAVOR)/rpmh_drv_config.c | ||
| global-incdirs-y += . | ||
| global-incdirs-y += $(PLATFORM_FLAVOR) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is good.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, the includes in the same directory can be directly used using #include "" pattern. The includes inside chipset folder it won't be appropriate to include with chipset name in C File (since it won't scale) and hence we've used global-incdirs-y pattern. The required includes are present in the PR I've raised & its compilation tested + unit tested on Lemans Device. Shivam has also unit tested my PR on Nord without this PR so its taken care.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have updated as response to the comments given in that PR clarifying the same as well;
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually IDineshChoudhary, rpmh_drv_config has been removed (as of now) from #57, that's why that may be different. Also regarding the "global-incdirs-y += .", Selvam (@zelvam95) , should we use this and follow include <> or simply use the include "" pattern, and remove this entry?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the header file is in same driver file path, you could just do "". In general - You could refer to existing upstream drivers/patterns and align to that;
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And yes, IDineshChoudhary, We plan to rebase this PR on top of the other PR I have raised once that is merged. We could re-use some of the header files I have introduced etc. here and move macros there. That would make it cleaner. Maybe you could hold this review for a bit until the other PR is merged, so it'll be cleaner; Shivam Sanjay (@shvm-ap), If it'd make sense, you could mark this as draft until the other PR is merged, since you will need the headers etc used in other PR over here for moving the MSG RAM Size etc. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally C requires U alias at last to indicate it's unsigned int why it's unsigned long here that maps to 64bit right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, UL is not required here. However, it aligns with the existing coding style. May prevent unwanted overflows while adding new entries.