Add "bcm2712" as a recognised platform. This will prevent Pi 5 from
loading bcm2711-specific versions, but there's a good chance they
wouldn't work anyway and will require modifications.
The dtoverlay wrappers add a DT_BLOB_T type and prevent users having
to import all of libfdt. Add thin veneers of fdt_first_subnode and
fdt_next_subnode.
The dtc compiler expands &node1 (as opposed to <&node1>) to the full
path to the node with the label "node1". Note that if this label is on
a node in an overlay that the path will reflect that, even if the
node with the label eventually ends up in the base dtb.
If a parameter of a base dtb is used to make an alias point to another
node in the base dtb, it is nice to be able to specify that replacement
path using a label on that node, rather than have to write it out
longhand. Doing so requires one simple change - treating literal
assignments of empty strings as a special case:
console_uart0 = <&aliases>, "console=", &uart0;
Prior to this commit, this would have resulted in an error when the
console_uart0 was applied because the start of the &uart0 path string
would have been interpreted as a phandle to the next override target.
With this commit, the parser sees the empty string assigment and
treats the next thing as a string to assign (rather like assigning
a phandle value to an integer property).
A consequence of this change is that intentionally assigning an empty
string (probably a very rare occurrence) requires an explicit empty
string to be added, i.e. "...=","" or that the empty assignment falls
at the end of the list of overrides for that parameter.
It's helpful if the dtoverlay and dtparam commands look in the right
place for overlays and the README. Make them check for and use
/proc/device-tree/chosen/os_prefix.
There was an off-by-one in the path rebasing code that caused it to
copy overlay-relative paths verbatim instead of rebasing them to
fit the target DTB.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add the ability to embed arbitrary byte data in strings. The change was
motivated by the desire to allow parameters to supply multiple compatible
strings, but there may be other uses.
The acceptable escape sequences are most of the range supported by C, but
with the hexadecimal ('\x??`) escape limited to precisely two digits.
See: https://forums.raspberrypi.com/viewtopic.php?t=330792
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
See: https://github.com/raspberrypi/firmware/issues/1728
Seems to be an issue with library ordering.
I guess it appeared with update to bullseye, or gcc.
Note: these are largely deprectated and several fail to run with kms
(with an error message), but may as well fix build errors
FDT errors are small negative integers, and non-fatal errors are the
positive versions of the same errors. This scheme only works if the
non-fatal error values are never returned from a function where a
positive integer has another interpretation.
dtoverlay_get_target_offset broke this rule, leading eventually to
an invalid DT and failure to boot. Fortunately, finding the offset for
a fragment target is a non-destructive operation and therefore always
non-fatal, so move the NON_FATAL classification to the callers - of
which there are only three.
See: https://github.com/raspberrypi/firmware/issues/1686
Aliases and labels/symbols are stored in the same way - as path strings.
The overlay application code already knows how to rewrite exported
symbol paths so they are correct in the base DTB (rebasing), so use the
same logic to rebase aliases as they are applied.
Add a src-length-limited version of VCOS_SAFE_STRCPY. For some
reason the vc4 linker complained about not being able to find strnlen,
hence the open-coded version.
The default linker option with Bullseye appears to now set
as-needed, so as the core doesn't call into mmal_vc_client
it is viewed as unnecesary, missing that mmal_vc_client has
a constructor that registers functions with the core.
Move the registration of the component supplier to the core_init.
The linker is therefore satisfied that mmal_vc_client is used,
and actually links to it.
This allows Picamera to work again.
https://github.com/waveform80/picamera/issues/697
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
If the system is obviously configured for libcamera (for example) by
dint of /dev/video0 being given over to "unicam", complain and abort
immediately. In all other circumstances maintain previous behaviour.
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
There are several reasons why /dev/fb0 might not exist, none of them
worrying, and the debug_sym library has fallbacks for those cases.
Suppress error messages for the ENOENT case, and only print one
message for other errors (unless the error keeps changing, which is
unlikely).
See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238
V4L2 needs to stop on any change that triggers a V4L2_EVENT_SOURCE_CHANGE,
and that includes aspect ratio and colourspace changes.
Add a new parameter to request that behaviour from the RIL component.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This change adds a colour denoise config structure to allow us to set the
operating mode of the software colour denoise. This essentially chooses
between the video and stills colour denoise variants.
The related kernel change is at:
https://github.com/raspberrypi/linux/pull/4069
The link was broken during the documentation revamp. Just link
to vcgencmd in the online docs. Related documentation is easy
to find with the online search and reduces the number for links
to update in the future.
A misformed string in an override, eg
changeme = <0>, "-1,-2";
would stall the parsing as it didn't know how to handle ','
and kept trying to process it over and over.
Abort on incorrect syntax.
bcm_host_is_model_pi4 should be equivalent to a test that the processor
type is BCM2711, so implement it as such (having added BCM2711 as a
recognised processor type and deprecating the name BCM2838).
See: https://github.com/raspberrypi/userland/issues/695
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
I've spent a little time going through the excellent raspberry pi
documentation site in order to build some man-pages for most of the
utilities in the suite. Note that not all utilities are covered here
(notably vchiq_test, mmal_vc_diag are missing) but I think it covers the
most commonly used utilities.
I've also included some auxilliary man-pages (in section 7) for
information relevant to utilities like vcmailbox (covering things like
the mailbox info from the wiki-page, and the OTP registers from the
documentation site).
Video_decode was always ensuring that timestamps increased in value
during a stream.
V4L2 M2M API wants a direct mapping, so add an option to disable it.
Unicam can unpack to 16bpp, but only using the bottom N bits, and
V4L2 supports them all. It is also far easier for a CPU to process.
Adds support to the framework and to the ISP component (changes the
black level config).
It's supported as a standard preset within the VEC, but there was
no way of selecting it.
The 2 bits for SDTV mode in enum SDTV_MODE_T were fully utilised,
so add it as a modifier in one of the higher bits if PAL is
selected.
https://github.com/raspberrypi/firmware/issues/811
The function parameters were extended without spotting another
user with their own local prototype.
Observed as misaligned exception when using video_render.
MIPI raw 14 wasn't previously defined, so add it for completeness
To support monochrome image sensors, add formats to handle the relevant
packed data formats into the ISP, and disable demosaic.
The Bayer pipeline is still active in Bayer mode, so all 4 channels need
to be programmed with the same data for blocks such as black level and
lens shading.
Adds the equivalent to "Add option to start in burst mode if AE settings
are manual" patch to RaspiStillYUV so it too can drop straight into
capture mode.
See https://github.com/raspberrypi/userland/issues/640
The examples read the first 512 bytes of the stream and try stuffing
them into the codec as header bytes.
If running a debug build of MMAL this will fail as the extradata
field of the port format is bigger than MMAL_FORMAT_EXTRADATA_MAX_SIZE
Reduce the header bytes array down to 128bytes to match
MMAL_FORMAT_EXTRADATA_MAX_SIZE.
Both these libraries/apps were related to the VPU accessing the
host file system over VCHI. This has never been used on the Pi,
and is creating build warnings with the latest versions of gcc.
Remove them from the source tree.
Current header generates warnings of the form "warning: cast from
function call of type ‘pthread_t’ {aka ‘long unsigned int’} to
non-matching type ‘VCOS_LLTHREAD_T *’ {aka ‘struct VCOS_LLTHREAD_T *’}
[-Wbad-function-cast]". Fix that.