Page MenuHomeFreeBSD

A10/A20 Security ID
ClosedPublic

Authored by manu on May 16 2016, 4:57 AM.
Tags
Referenced Files
Unknown Object (File)
Sun, Mar 24, 4:30 AM
Unknown Object (File)
Tue, Mar 12, 9:08 AM
Unknown Object (File)
Sat, Mar 2, 1:48 AM
Unknown Object (File)
Wed, Feb 28, 9:54 AM
Unknown Object (File)
Feb 16 2024, 4:35 AM
Unknown Object (File)
Feb 16 2024, 4:35 AM
Unknown Object (File)
Feb 16 2024, 4:35 AM
Unknown Object (File)
Feb 16 2024, 4:35 AM

Details

Summary

Add A10/A20 support for aw_sid.
Expose the rootkey via sysctl.
The rootkey can be used for product identification or to generate a mac address (this is was u-boot uses).

Test Plan

Tested on A10 and A20 hardware.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu retitled this revision from to A10/A20 Security ID.
manu updated this object.
manu edited the test plan for this revision. (Show Details)
manu added a reviewer: ARM.
manu set the repository for this revision to rS FreeBSD src repository - subversion.
manu added a project: ARM.
jmcneill added inline comments.
sys/arm/allwinner/aw_sid.c
112 ↗(On Diff #16367)

Can you make this based on compat string instead?

155 ↗(On Diff #16367)

be32enc(&out[i * 4], tmp);

174 ↗(On Diff #16367)

I would change == ENXIO to != 0.

sys/arm/allwinner/aw_sid.c
177 ↗(On Diff #16367)

I think you can use %D here. It's part of printf(9).

sys/arm/allwinner/aw_sid.c
177 ↗(On Diff #16367)

%D gives me the decimal representation.
Also quoting the man :
These conversion characters are deprecated, and will eventually disappear.

Update based on comment from jmcneill

manu marked 5 inline comments as done.Jul 12 2016, 6:20 PM
sys/arm/allwinner/aw_sid.c
177 ↗(On Diff #16367)

The libc printf will print a decimal representation, however the kernel printf will print a hexdump of a string. It is also not listed as being deprecated in the man page.

https://www.freebsd.org/cgi/man.cgi?query=printf&sektion=9

Use printf(9) %D conversion char.

manu marked an inline comment as done.Jul 12 2016, 6:54 PM
sys/arm/allwinner/aw_sid.c
159 ↗(On Diff #18338)

Should return an error here if this gets called on something other than A10/A20.

Return ENXIO if rootkey is called on a SoC != A10 and A20
Return ENXIO if tscalib is called on a SoC != A83T
This revision is now accepted and ready to land.Jul 19 2016, 8:40 PM
This revision was automatically updated to reflect the committed changes.