Skip to content
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

ufs: add support for UFS WriteBooster feature #85

Merged
merged 1 commit into from
Dec 12, 2024
Merged
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
6 changes: 6 additions & 0 deletions firehose.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,12 @@ int firehose_apply_ufs_common(struct qdl_device *qdl, struct ufs_common *ufs)
xml_setpropf(node_to_send, "wPeriodicRTCUpdate", "%d", ufs->wPeriodicRTCUpdate);
xml_setpropf(node_to_send, "bConfigDescrLock", "%d", ufs->bConfigDescrLock);

if (ufs->wb) {
xml_setpropf(node_to_send, "bWriteBoosterBufferPreserveUserSpaceEn", "%d", ufs->bWriteBoosterBufferPreserveUserSpaceEn);
xml_setpropf(node_to_send, "bWriteBoosterBufferType", "%d", ufs->bWriteBoosterBufferType);
xml_setpropf(node_to_send, "shared_wb_buffer_size_in_kb", "%d", ufs->shared_wb_buffer_size_in_kb);
}

ret = firehose_send_single_tag(qdl, node_to_send);
if (ret)
fprintf(stderr, "[APPLY UFS common] %d\n", ret);
Expand Down
7 changes: 7 additions & 0 deletions ufs.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ struct ufs_common *ufs_parse_common_params(xmlNode *node, bool finalize_provisio
return NULL;
}

/* These parameters are optional */
errors = 0;
result->bWriteBoosterBufferPreserveUserSpaceEn = !!attr_as_unsigned(node, "bWriteBoosterBufferPreserveUserSpaceEn", &errors);
result->bWriteBoosterBufferType = !!attr_as_unsigned(node, "bWriteBoosterBufferType", &errors);
result->shared_wb_buffer_size_in_kb = attr_as_unsigned(node, "shared_wb_buffer_size_in_kb", &errors);
result->wb = !errors;

return result;
}

Expand Down
4 changes: 4 additions & 0 deletions ufs.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ struct ufs_common {
unsigned bInitActiveICCLevel;
unsigned wPeriodicRTCUpdate;
bool bConfigDescrLock;
bool wb;
bool bWriteBoosterBufferPreserveUserSpaceEn;
bool bWriteBoosterBufferType;
unsigned shared_wb_buffer_size_in_kb;
};

struct ufs_body {
Expand Down
Loading