Angel Pons | 0612b27 | 2020-04-05 15:46:56 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | ed8a723 | 2015-11-24 12:35:06 -0600 | [diff] [blame] | 2 | |
Kyösti Mälkki | 5daa1d3 | 2020-06-14 12:01:58 +0300 | [diff] [blame] | 3 | #include <acpi/acpi_gnvs.h> |
Aaron Durbin | e9657bc | 2016-06-28 15:00:30 -0500 | [diff] [blame] | 4 | #include <nhlt.h> |
Aaron Durbin | 36de465 | 2016-06-29 17:28:02 -0500 | [diff] [blame] | 5 | #include <soc/nvs.h> |
Aaron Durbin | ed8a723 | 2015-11-24 12:35:06 -0600 | [diff] [blame] | 6 | |
| 7 | uintptr_t nhlt_soc_serialize(struct nhlt *nhlt, uintptr_t acpi_addr) |
| 8 | { |
Aaron Durbin | b4afe3c | 2016-11-29 23:14:25 -0600 | [diff] [blame] | 9 | return nhlt_soc_serialize_oem_overrides(nhlt, acpi_addr, NULL, NULL, 0); |
Fang, Yang A | 16ff859 | 2016-01-28 16:52:33 -0800 | [diff] [blame] | 10 | } |
| 11 | |
| 12 | uintptr_t nhlt_soc_serialize_oem_overrides(struct nhlt *nhlt, |
Aaron Durbin | b4afe3c | 2016-11-29 23:14:25 -0600 | [diff] [blame] | 13 | uintptr_t acpi_addr, const char *oem_id, const char *oem_table_id, |
| 14 | uint32_t oem_revision) |
Fang, Yang A | 16ff859 | 2016-01-28 16:52:33 -0800 | [diff] [blame] | 15 | { |
Kyösti Mälkki | 0c1dd9c | 2020-06-17 23:37:49 +0300 | [diff] [blame] | 16 | struct global_nvs *gnvs; |
Aaron Durbin | ed8a723 | 2015-11-24 12:35:06 -0600 | [diff] [blame] | 17 | |
Kyösti Mälkki | 5daa1d3 | 2020-06-14 12:01:58 +0300 | [diff] [blame] | 18 | gnvs = acpi_get_gnvs(); |
Aaron Durbin | ed8a723 | 2015-11-24 12:35:06 -0600 | [diff] [blame] | 19 | |
| 20 | if (gnvs == NULL) |
| 21 | return acpi_addr; |
| 22 | |
| 23 | /* Update NHLT GNVS Data */ |
| 24 | gnvs->nhla = (uintptr_t)acpi_addr; |
| 25 | gnvs->nhll = nhlt_current_size(nhlt); |
| 26 | |
Fang, Yang A | 16ff859 | 2016-01-28 16:52:33 -0800 | [diff] [blame] | 27 | return nhlt_serialize_oem_overrides(nhlt, acpi_addr, |
Aaron Durbin | b4afe3c | 2016-11-29 23:14:25 -0600 | [diff] [blame] | 28 | oem_id, oem_table_id, oem_revision); |
Aaron Durbin | ed8a723 | 2015-11-24 12:35:06 -0600 | [diff] [blame] | 29 | } |