Jon Murphy | bf63960 | 2023-12-19 13:28:03 -0700 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <baseboard/variants.h> |
| 4 | #include <baseboard/port_descriptors.h> |
| 5 | #include <console/console.h> |
| 6 | #include <fw_config.h> |
| 7 | #include <soc/platform_descriptors.h> |
| 8 | |
| 9 | enum baseboard_dxio_port_id { |
| 10 | BASEBOARD_DXIO_WWAN, |
| 11 | BASEBOARD_DXIO_WLAN, |
| 12 | BASEBOARD_DXIO_SD, |
| 13 | BASEBOARD_DXIO_STORAGE, |
| 14 | }; |
| 15 | |
| 16 | static fsp_dxio_descriptor myst_dxio_descriptors[] = { |
| 17 | [BASEBOARD_DXIO_WWAN] = WWAN_DXIO_DESCRIPTOR, |
| 18 | [BASEBOARD_DXIO_WLAN] = WLAN_DXIO_DESCRIPTOR, |
| 19 | [BASEBOARD_DXIO_SD] = SD_DXIO_DESCRIPTOR, |
| 20 | /* This value modified at runtime, default to emmc */ |
| 21 | [BASEBOARD_DXIO_STORAGE] = EMMC_DXIO_DESCRIPTOR, |
| 22 | }; |
| 23 | |
| 24 | __weak void variant_get_dxio_descriptors(const fsp_dxio_descriptor **dxio_descriptor, size_t *num) |
| 25 | { |
| 26 | if (fw_config_is_provisioned() && fw_config_probe(FW_CONFIG(STORAGE, NVME))) { |
| 27 | printk(BIOS_DEBUG, "Enabling NVMe.\n"); |
| 28 | myst_dxio_descriptors[BASEBOARD_DXIO_STORAGE] = (fsp_dxio_descriptor)NVME_DXIO_DESCRIPTOR; |
| 29 | } else { |
| 30 | printk(BIOS_DEBUG, "Defaulting to eMMC.\n"); |
| 31 | } |
| 32 | *dxio_descriptor = myst_dxio_descriptors; |
| 33 | *num = ARRAY_SIZE(myst_dxio_descriptors); |
| 34 | } |