drivers/intel/mipi_camera: Verify SSDB struct size at build time

Add a static assert ensuring `struct ssdb` stays 0x6C bytes, matching
the sensor descriptor in ACPI. This guards future edits from drifting
away from the documented layout without changing runtime behavior.

Change-Id: I2b4dfb86494d13525cbc6e6de4573ceb36f0b482
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90183
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Matt DeVillier 2025-11-09 18:20:44 -06:00
commit 0361e1a865

View file

@ -6,6 +6,8 @@
#include <stdint.h>
#include <uuid.h>
#define SSDB_SIZE 108
enum camera_device_type {
DEV_TYPE_SENSOR = 0,
DEV_TYPE_VCM,
@ -83,5 +85,7 @@ struct intel_ssdb {
uint8_t reserved[13]; /* Pads SSDB out so the binary blob in ACPI is
the same size as seen on other firmwares.*/
} __packed;
_Static_assert(sizeof(struct intel_ssdb) == SSDB_SIZE,
"SSDB structure size must match SSDB_SIZE");
#endif