Page MenuHomeFreeBSD

A10/A20 Security ID
ClosedPublic

Authored by manu on May 16 2016, 4:57 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

manu updated this revision to Diff 16367.May 16 2016, 4:57 AM
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.
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.

andrew added inline comments.Jul 11 2016, 9:24 AM
sys/arm/allwinner/aw_sid.c
177 ↗(On Diff #16367)

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

manu added inline comments.Jul 12 2016, 7:15 AM
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.

manu updated this revision to Diff 18337.Jul 12 2016, 6:20 PM

Update based on comment from jmcneill

manu marked 5 inline comments as done.Jul 12 2016, 6:20 PM
andrew added inline comments.Jul 12 2016, 6:34 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

manu updated this revision to Diff 18338.Jul 12 2016, 6:54 PM

Use printf(9) %D conversion char.

manu marked an inline comment as done.Jul 12 2016, 6:54 PM
jmcneill added inline comments.Jul 13 2016, 7:07 AM
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.

manu updated this revision to Diff 18378.Jul 13 2016, 12:05 PM
Return ENXIO if rootkey is called on a SoC != A10 and A20
Return ENXIO if tscalib is called on a SoC != A83T
manu marked an inline comment as done.Jul 13 2016, 12:05 PM
jmcneill accepted this revision.Jul 19 2016, 8:40 PM
jmcneill added a reviewer: jmcneill.
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.