12 Commits

Author SHA1 Message Date
Richard Acayan
23a69640bf tools: make json-c optional
This shouldn't be a requirement to compile anything else. Stop requiring
it for building anything, and assume the user just wants to compile the
main project.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2025-08-19 22:30:25 -04:00
Richard Acayan
6e1281dc8d tools: add sscregistrygen from sensh
From the sensor shell repository, sscregistrygen is a tool for
generating the sensor registry from the sensor config. It is useful when
the sensor registry is not included in device firmware. Add
sscregistrygen here since it is more directly used by hexagonrpc rather
than sensh.

Link: 23b7681f3f/tools/sscregistrygen.c
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2025-08-19 22:13:32 -04:00
Richard Acayan
63b1711021 move fastrpc to project root
The FastRPC implementation is loosely related to the sensor shell. It is
useful to provide interfaces over FastRPC for sensor DSP firmware, and
enables the sensor shell to provide most physical sensors. However, the
FastRPC implementation has no meaningful connection with the sensor
shell in terms of code. Move the FastRPC implementation to the project
root to make it more intuitive to install and use and to separate it
from a distinct project.
2024-03-01 21:48:39 -05:00
Richard Acayan
23b7681f3f tools: sscregistrygen: actually check the soc_id
The hardware platform was checked in the above code. Check the SoC
identifier here, instead of checking the hardware platform against the
command-line SoC identifier.
2023-05-22 17:11:36 -04:00
Richard Acayan
d0eb322672 tools: sscregistrygen: parse directories from non-option arguments
The arguments may include options, in which case the optind variable
contains the point where the program should continue reading arguments.
Start accepting directory names from the first non-option argument,
instead of the second argument.
2023-05-22 17:11:36 -04:00
Richard Acayan
f1f50b2309 tools: registry: rename to sscregistrygen
This tool cannot be packaged without a unique name. Rename it to
something more descriptive.
2023-05-22 17:11:36 -04:00
Richard Acayan
5e0cb90499 tools: registry: store option character as integer
The option character is being compared to -1, but this -1 is an integer.
With GCC 12.2.1 on aarch64 platforms, the 8-bit character is not
properly sign-extended to 32 bits. Store the option character as an
integer so it is properly sign-extended.

Further investigation is needed to determine whether this is an
optimization bug and what value the 8-bit signed -1 is equal to.
2023-05-02 19:31:58 -04:00
Richard Acayan
3a8ee7ca22 tools: registry: move library flag to end of compiler command
GCC is a bit picky on Alpine Linux and wants `-ljson-c` to be at the end
of the command-line arguments. Move it to the end so the tools can be
built with this requirement.
2023-05-02 18:59:10 -04:00
Richard Acayan
f47b329e45 tools: registry: only redefine O_SEARCH if necessary
This is sometimes necessary on Linux, but some C libraries define it.
Only redefine O_SEARCH if it is not defined already, otherwise the
existing macro definition can be used.
2023-03-24 22:18:21 -04:00
Richard Acayan
aede1b89f5 tools: registry: correct copyright year
This was added in 2023, not 2022.
2023-02-24 17:24:39 -05:00
Richard Acayan
aab53e525e tools: registry: remove reference to hardware_platform in debugfs
This debugfs value outputs a number. Sensor configuration matches the
platform against a textual representation for this. Since the registry
generator doesn't convert between these, hardcode this in the example
command so it isn't broken.
2023-02-24 17:20:50 -05:00
Richard Acayan
21969385ef add registry generator
The sensor registry is generated from the configuration on the vendor
partition. Add a registry generator so this registry can be generated,
even without access to the partition of a given device.
2023-02-23 17:27:03 -05:00