firmware: fw_base: Introduce optional fw_platform_init()
authorAnup Patel <anup.patel@wdc.com>
Sun, 26 Apr 2020 09:01:28 +0000 (14:31 +0530)
committerAnup Patel <anup@brainfault.org>
Fri, 1 May 2020 05:03:02 +0000 (10:33 +0530)
commit4d063538f0493916dc6263276c4c84f31446db41
treeb5dfda0139ca79e3da7b16e84100e8ad74352f01
parent7cc6fa4d8a65e08048e1dd469087805ce89bf306
firmware: fw_base: Introduce optional fw_platform_init()

We add optional fw_platform_init() function which will allow
platform specific code to update "struct sbi_platform platform"
before it is used.

The fw_platform_init() can be a regular C function so before
callint it we:
1. zero-out BSS section
2. Setup temporary trap handler to catch bugs
3. Setup temporary stack pointer

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
firmware/fw_base.S