Page MenuHomeFreeBSD

A10/A20 Security ID
ClosedPublic

Authored by manu on May 16 2016, 4:57 AM.
Tags
Referenced Files
F81685600: D6383.id18378.diff
Fri, Apr 19, 10:25 PM
F81685598: D6383.id18337.diff
Fri, Apr 19, 10:25 PM
F81685594: D6383.id18587.diff
Fri, Apr 19, 10:25 PM
F81685592: D6383.id16367.diff
Fri, Apr 19, 10:25 PM
F81685590: D6383.id18338.diff
Fri, Apr 19, 10:25 PM
F81685586: D6383.id.diff
Fri, Apr 19, 10:25 PM
Unknown Object (File)
Wed, Apr 17, 3:53 PM
Unknown Object (File)
Wed, Apr 17, 11:40 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 Passed
Unit
No Test Coverage
Build Status
Buildable 3761
Build 3804: arc lint + arc unit

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

Can you make this based on compat string instead?

155

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

174

I would change == ENXIO to != 0.

sys/arm/allwinner/aw_sid.c
177

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

sys/arm/allwinner/aw_sid.c
177

%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

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
152

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.