| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#include <assert.h> |
| 9 |
|
| 10 |
#include <arch_helpers.h> |
| 11 |
#include <lib/psci/psci.h> |
| 12 |
|
| 13 |
#include <marvell_pm.h> |
| 14 |
|
| 15 |
|
| 16 |
extern const plat_psci_ops_t plat_arm_psci_pm_ops; |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
void marvell_program_mailbox(uintptr_t address) |
| 25 |
{ |
| 26 |
uintptr_t *mailbox = (void *)PLAT_MARVELL_MAILBOX_BASE; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
assert((PLAT_MARVELL_MAILBOX_BASE >= MARVELL_SHARED_RAM_BASE) && |
| 33 |
((PLAT_MARVELL_MAILBOX_BASE + sizeof(*mailbox)) <= |
| 34 |
(MARVELL_SHARED_RAM_BASE + MARVELL_SHARED_RAM_SIZE))); |
| 35 |
|
| 36 |
mailbox[MBOX_IDX_MAGIC] = MVEBU_MAILBOX_MAGIC_NUM; |
| 37 |
mailbox[MBOX_IDX_SEC_ADDR] = address; |
| 38 |
|
| 39 |
|
| 40 |
#if PLAT_MARVELL_SHARED_RAM_CACHED |
| 41 |
flush_dcache_range((uintptr_t)PLAT_MARVELL_MAILBOX_BASE + |
| 42 |
8 * MBOX_IDX_MAGIC, |
| 43 |
2 * sizeof(uint64_t)); |
| 44 |
#endif |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
int plat_setup_psci_ops(uintptr_t sec_entrypoint, |
| 53 |
const plat_psci_ops_t **psci_ops) |
| 54 |
{ |
| 55 |
*psci_ops = &plat_arm_psci_pm_ops; |
| 56 |
|
| 57 |
|
| 58 |
marvell_program_mailbox(sec_entrypoint); |
| 59 |
return 0; |
| 60 |
} |