diff options
author | Aurora pro automerger <aurora-pro-automerger@google.com> | 2022-05-23 12:51:51 +0000 |
---|---|---|
committer | John Scheible <johnscheible@google.com> | 2022-05-23 19:40:12 +0000 |
commit | f74aa638e06c1edcb7c8c295c03d2f7b9b6f604d (patch) | |
tree | 581ae85ae9b6f7c153ba4e4d884da2b71b26a65c /gxp-firmware.c | |
parent | 35e3403a4d6660b3db2e434d5fa93e23961222ec (diff) | |
download | gs201-f74aa638e06c1edcb7c8c295c03d2f7b9b6f604d.tar.gz |
[Copybara Auto Merge] Merge branch 'gs201-release' into 'android13-gs-pixel-5.10'.
release info:233216473 dsp prod 5/23 RC03
gxp: remove unrequired CORE_SCRATCHPAD_BASE offset
Bug: 233381187
gxp: Refactor FW boot mode into its own functions
Bug: 233381187
gxp: Switch the boot mode storage from CSRs into the scratchpad space
Bug: 233381187
gxp: Fix locking in gxp_telemetry_disable()
Bug: 232876605
GitOrigin-RevId: da625dba4f2565974652c7b1fdfb6db90870230e
Change-Id: Iaab2bef0c866741ce0d1390ad39ddd87e932dd73
Diffstat (limited to 'gxp-firmware.c')
-rw-r--r-- | gxp-firmware.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/gxp-firmware.c b/gxp-firmware.c index ba3a784..15497cf 100644 --- a/gxp-firmware.c +++ b/gxp-firmware.c @@ -283,8 +283,7 @@ static int gxp_firmware_load(struct gxp_dev *gxp, uint core) memset(gxp->fwbufs[core].vaddr + AURORA_SCRATCHPAD_OFF, 0, AURORA_SCRATCHPAD_LEN); - core_scratchpad_base = gxp->fwbufs[core].vaddr + AURORA_SCRATCHPAD_OFF + - CORE_SCRATCHPAD_BASE(core); + core_scratchpad_base = gxp->fwbufs[core].vaddr + AURORA_SCRATCHPAD_OFF; offset = SCRATCHPAD_MSG_OFFSET(MSG_CORE_ALIVE); writel(0, core_scratchpad_base + offset); offset = SCRATCHPAD_MSG_OFFSET(MSG_TOP_ACCESS_OK); @@ -649,8 +648,7 @@ int gxp_firmware_run(struct gxp_dev *gxp, struct gxp_virtual_device *vd, } /* Mark this as a cold boot */ - gxp_write_32_core(gxp, core, GXP_REG_BOOT_MODE, - GXP_BOOT_MODE_REQUEST_COLD_BOOT); + gxp_firmware_set_boot_mode(gxp, core, GXP_BOOT_MODE_REQUEST_COLD_BOOT); #ifdef CONFIG_GXP_GEM5 /* @@ -743,3 +741,31 @@ void gxp_firmware_stop(struct gxp_dev *gxp, struct gxp_virtual_device *vd, gxp_pm_core_off(gxp, core); gxp_firmware_unload(gxp, core); } + +void gxp_firmware_set_boot_mode(struct gxp_dev *gxp, uint core, u32 mode) +{ + void __iomem *boot_mode_addr; + + /* Callers shouldn't call the function under this condition. */ + if (!gxp->fwbufs[core].vaddr) + return; + + boot_mode_addr = gxp->fwbufs[core].vaddr + AURORA_SCRATCHPAD_OFF + + SCRATCHPAD_MSG_OFFSET(MSG_BOOT_MODE); + + writel(mode, boot_mode_addr); +} + +u32 gxp_firmware_get_boot_mode(struct gxp_dev *gxp, uint core) +{ + void __iomem *boot_mode_addr; + + /* Callers shouldn't call the function under this condition. */ + if (!gxp->fwbufs[core].vaddr) + return 0; + + boot_mode_addr = gxp->fwbufs[core].vaddr + AURORA_SCRATCHPAD_OFF + + SCRATCHPAD_MSG_OFFSET(MSG_BOOT_MODE); + + return readl(boot_mode_addr); +} |