src/base/elog: Add elog_add_event_raw

Implement the API of adding an new elog event and sync to NV.
The event will be filled with the same timestamp as the lastest event
already in the event log since depthcharge does not support real-time
clock now.

Currently we does not perform a shrink in the depthcharge since we
checked it in coreboot right before booting into depthcharge main and we
planned to add only one event in depthcharge now.

The shrink mechanism will be introduced later.

BUG=b:226551117
BRANCH=none
TEST=make tests/base/elog-test

Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org>
Change-Id: I9b8ffc60ae2343c6a3e6fb05a46c2c6ff46976ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/depthcharge/+/3874079
Reviewed-by: Julius Werner <jwerner@chromium.org>
4 files changed