Debian Codegraph @

src/mainboard/google/hatch/variants/akemi/variant.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <baseboard/variants.h>
4 #include <chip.h>
5 #include <soc/pci_devs.h>
6 #include <ec/google/chromeec/ec.h>
7 #include <static.h>
8
9 void variant_devtree_update(void)
10 {
11 uint32_t sku_id;
12 struct device *emmc_host;
13 struct device *ssd_host;
14 config_t *cfg = config_of_soc();
15 emmc_host = pcidev_path_on_root(PCH_DEVFN_EMMC);
16 ssd_host = pcidev_path_on_root(PCH_DEVFN_SATA);
17
18 /* SKU ID 2 and 4 do not have eMMC, hence disable it. */
19 sku_id = google_chromeec_get_board_sku();
20 if ((sku_id == 2) || (sku_id == 4)) {
21 if (emmc_host == NULL)
22 return;
23 emmc_host->enabled = 0;
24 cfg->ScsEmmcHs400Enabled = 0;
25 }
26
27 /* SKU ID 1 and 3 do not have SSD, hence disable it. */
28 if ((sku_id == 1) || (sku_id == 3)) {
29 if (ssd_host == NULL)
30 return;
31 ssd_host->enabled = 0;
32 cfg->SataSalpSupport = 0;
33 cfg->SataPortsEnable[1] = 0;
34 cfg->SataPortsDevSlp[1] = 0;
35 cfg->satapwroptimize = 0;
36 }
37 }