arm: firmware: Check firmware is running or not
PATCH 1/1 arm: firmware: Check firmware is running or not
From: Kyungmin Park <[email protected]>
To support multi-platform, it needs to know it's running under secure OS or not. sometime it needs to access physical address by smc calls.
e.g.,
if (firmware_run()) {
addr = physical address;
} else {
addr = virtual address;
}
call_firmware_ops(read_address, addr, &value);Signed-off-by Kyungmin Park <[email protected]>
---
arch/arm/common/firmware.c +5 -0
@@ -16,3 +16,8 @@static const struct firmware_ops default_firmware_ops;const struct firmware_ops *firmware_ops = &default_firmware_ops; + +int firmware_run (void ) +{ +return firmware_ops != &default_firmware_ops; +}
arch/arm/include/asm/firmware.h +3 -0
@@ -42,6 +42,9 @@ struct firmware_ops {/* Global pointer for current firmware_ops structure, can't be NULL. */ extern const struct firmware_ops *firmware_ops; +/* Check firmware is running */ +extern int firmware_run (void ); +/* * call_firmware_op(op, ...) *