Jonathan Zhang | 3ed903f | 2023-01-25 11:37:27 -0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <device/pci_ops.h> |
| 4 | #include <soc/crashlog.h> |
| 5 | #include <soc/pci_devs.h> |
| 6 | |
| 7 | static uint32_t read_msm_config_reg(uint32_t func, uint32_t reg) |
| 8 | { |
| 9 | uint32_t pcie_offset = PCI_DEV(MSM_BUS, MSM_DEV, func); |
| 10 | return pci_s_read_config32(pcie_offset, reg); |
| 11 | } |
| 12 | |
| 13 | static void write_msm_config_reg(uint32_t func, uint32_t reg, uint32_t value) |
| 14 | { |
| 15 | uint32_t pcie_offset = PCI_DEV(MSM_BUS, MSM_DEV, func); |
| 16 | pci_s_write_config32(pcie_offset, reg, value); |
| 17 | } |
| 18 | |
| 19 | void disable_cpu_crashlog(void) |
| 20 | { |
| 21 | uint32_t ctl; |
| 22 | ctl = read_msm_config_reg(MSM_FUN, CRASHLOG_CTL); |
| 23 | ctl |= CRASHLOG_CTL_DIS; |
| 24 | write_msm_config_reg(MSM_FUN, CRASHLOG_CTL, ctl); |
| 25 | ctl = read_msm_config_reg(MSM_FUN_PMON, BIOS_CRASHLOG_CTL); |
| 26 | ctl |= CRASHLOG_CTL_DIS; |
| 27 | write_msm_config_reg(MSM_FUN_PMON, BIOS_CRASHLOG_CTL, ctl); |
| 28 | } |