Skip to content

[qcom-next] Improve serial number detection using SMEM interface#52

Closed
balajiselvanathan wants to merge 1 commit intoqualcomm-linux:qcom-nextfrom
balajiselvanathan:fastboot_serial_num_qn1
Closed

[qcom-next] Improve serial number detection using SMEM interface#52
balajiselvanathan wants to merge 1 commit intoqualcomm-linux:qcom-nextfrom
balajiselvanathan:fastboot_serial_num_qn1

Conversation

@balajiselvanathan
Copy link
Copy Markdown

Enhance serial number detection by prioritizing SMEM-based retrieval over bootargs parsing for better reliability and consistency across Qualcomm Snapdragon platforms.

Add board_serial_num() function to retrieve serial number directly from SMEM using the socinfo interface. This provides access to the hardware-stored serial number in shared memory, eliminating the dependency on kernel command line parsing.

This patch depends on the following patch [1], which adds the socinfo header file.

[1] https://lore.kernel.org/all/20260106122134.2047864-3-aswin.murugan@oss.qualcomm.com/

Upstreamed Link: https://lore.kernel.org/u-boot/20260422-serial-v1-1-1f246885bd70@oss.qualcomm.com/

Comment thread arch/arm/mach-snapdragon/qcom-priv.h Outdated
*
* Return: 0 on success, negative error code on failure.
*/
int board_serial_num(u32 *serial_num_ptr);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this board_serial_num() implemented?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The definition of board_serial_num is part of [qcom-next] Add OF_LIVE device tree fixup infrastructure
#50

@balajiselvanathan balajiselvanathan force-pushed the fastboot_serial_num_qn1 branch from b59cbf6 to e1a9eab Compare May 2, 2026 06:42
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since board_serial_num() is statically defined, we don't this declaration any longer.

Comment thread arch/arm/mach-snapdragon/board.c Outdated
*
* Return: 0 on success, negative error code on failure.
*/
int board_serial_num(u32 *serial_num_ptr)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark this as static

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made it static.

Enhance serial number detection by prioritizing SMEM-based retrieval
over bootargs parsing for better reliability and consistency across
Qualcomm Snapdragon platforms.

Add board_serial_num() function to retrieve serial number directly
from SMEM using the socinfo interface. This provides access to the
hardware-stored serial number in shared memory, eliminating the
dependency on kernel command line parsing.

This patch depends on the following patch [1], which adds the
socinfo header file.

[1] https://lore.kernel.org/all/20260106122134.2047864-3-aswin.murugan@oss.qualcomm.com/

Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
@balajiselvanathan balajiselvanathan force-pushed the fastboot_serial_num_qn1 branch from e1a9eab to b2f009b Compare May 4, 2026 08:11
#include <sort.h>
#include <time.h>
#include <smem.h>
#include <soc/qcom/socinfo.h>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dependency header is not part of the qcom-next.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is part of FIT DTB PR.

@b49020
Copy link
Copy Markdown
Member

b49020 commented May 5, 2026

@balajiselvanathan please validate serial number support already added by this PR: #56

@balajiselvanathan
Copy link
Copy Markdown
Author

Hi Sumit, validated serial num working in fastboot using PR 56 and it is workinh. So, closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants