blob: 9c05452c9e7ac94a5df70f55c69f9f35c8b1c018 [file] [log] [blame]
T Michael Turney7783c602019-10-09 07:04:54 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2018, The Linux Foundation. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <cbfs.h>
17#include <fmap.h>
18#include <console/console.h>
19#include <soc/symbols.h>
20#include <soc/qclib_common.h>
21
22int qclib_soc_blob_load(void)
23{
24 size_t size;
25 ssize_t ssize;
26
27 /* Attempt to load PMICCFG Blob */
28 size = cbfs_boot_load_file(CONFIG_CBFS_PREFIX "/pmiccfg",
29 _pmic, REGION_SIZE(pmic), CBFS_TYPE_RAW);
30 if (!size)
31 return -1;
32 qclib_add_if_table_entry(QCLIB_TE_PMIC_SETTINGS, _pmic, size, 0);
33
34 /* Attempt to load DCB Blob */
35 size = cbfs_boot_load_file(CONFIG_CBFS_PREFIX "/dcb",
36 _dcb, REGION_SIZE(dcb), CBFS_TYPE_RAW);
37 if (!size)
38 return -1;
39 qclib_add_if_table_entry(QCLIB_TE_DCB_SETTINGS, _dcb, size, 0);
40
41 /* Attempt to load Limits Config Blob */
42 ssize = fmap_read_area(QCLIB_FR_LIMITS_CFG_DATA, _limits_cfg,
43 REGION_SIZE(limits_cfg));
44 if (ssize < 0)
45 return -1;
46 qclib_add_if_table_entry(QCLIB_TE_LIMITS_CFG_DATA,
47 _limits_cfg, ssize, 0);
48
49 return 0;
50}