aboutsummaryrefslogtreecommitdiff
path: root/src/soc/qualcomm/common/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/qualcomm/common/include')
-rw-r--r--src/soc/qualcomm/common/include/soc/mmu_common.h31
-rw-r--r--src/soc/qualcomm/common/include/soc/qclib_common.h76
-rw-r--r--src/soc/qualcomm/common/include/soc/symbols_common.h25
3 files changed, 132 insertions, 0 deletions
diff --git a/src/soc/qualcomm/common/include/soc/mmu_common.h b/src/soc/qualcomm/common/include/soc/mmu_common.h
new file mode 100644
index 0000000000..ee781224bd
--- /dev/null
+++ b/src/soc/qualcomm/common/include/soc/mmu_common.h
@@ -0,0 +1,31 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _SOC_QUALCOMM_MMU_COMMON_H_
+#define _SOC_QUALCOMM_MMU_COMMON_H_
+
+#include <commonlib/region.h>
+#include <soc/symbols_common.h>
+
+#define CACHED_RAM (MA_MEM | MA_S | MA_RW)
+#define UNCACHED_RAM (MA_MEM | MA_S | MA_RW | MA_MEM_NC)
+#define DEV_MEM (MA_DEV | MA_S | MA_RW)
+
+static struct region * const ddr_region = (struct region *)_ddr_information;
+
+void soc_mmu_dram_config_post_dram_init(void);
+void qc_mmu_dram_config_post_dram_init(void *ddr_base, size_t ddr_size);
+
+#endif /* _SOC_QUALCOMM_MMU_COMMON_H_ */
diff --git a/src/soc/qualcomm/common/include/soc/qclib_common.h b/src/soc/qualcomm/common/include/soc/qclib_common.h
new file mode 100644
index 0000000000..19ec083bfd
--- /dev/null
+++ b/src/soc/qualcomm/common/include/soc/qclib_common.h
@@ -0,0 +1,76 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _SOC_QUALCOMM_QCLIB_COMMON_H__
+#define _SOC_QUALCOMM_QCLIB_COMMON_H__
+
+/* coreboot & QCLib I/F definitions */
+
+/* string field lengths */
+#define QCLIB_MAGIC_NUMBER_LENGTH 8
+#define QCLIB_FMAP_NAME_LENGTH 24
+#define QCLIB_TE_NAME_LENGTH 24
+
+/* FMAP_REGION names */
+#define QCLIB_FR_DDR_TRAINING_DATA "RO_DDR_TRAINING"
+#define QCLIB_FR_LIMITS_CFG_DATA "RO_LIMITS_CFG"
+
+/* TE_NAME (table entry name) */
+#define QCLIB_TE_DDR_INFORMATION "ddr_information"
+#define QCLIB_TE_QCLIB_LOG_BUFFER "qclib_log_buffer"
+#define QCLIB_TE_DCB_SETTINGS "dcb_settings"
+#define QCLIB_TE_CDT_SETTINGS "cdt_settings"
+#define QCLIB_TE_PMIC_SETTINGS "pmic_settings"
+#define QCLIB_TE_DDR_TRAINING_DATA "ddr_training_data"
+#define QCLIB_TE_LIMITS_CFG_DATA "limits_cfg_data"
+#define QCLIB_TE_QCSDI "qcsdi"
+
+/* BA_BMASK_VALUES (blob_attributes bit mask values) */
+#define QCLIB_BA_SAVE_TO_STORAGE 0x00000001
+
+struct qclib_cb_if_table_entry {
+ char name[QCLIB_TE_NAME_LENGTH]; /* 0x00 TE_NAME */
+ uint64_t blob_address; /* 0x18 blob addr in SRAM */
+ uint32_t size; /* 0x20 blob size in SRAM */
+ uint32_t blob_attributes; /* 0x24 BA_BMASK_VALUES */
+};
+
+/* GA_BMASK_VALUES (global_attributes bit mask values) */
+#define QCLIB_GA_ENABLE_UART_LOGGING 0x00000001
+
+#define QCLIB_INTERFACE_VERSION 0x00000001
+#define QCLIB_MAX_NUMBER_OF_ENTRIES 16
+
+#define QCLIB_MAGIC_NUMBER "QCLIB_CB"
+
+struct qclib_cb_if_table {
+ char magic[8]; /* 0x00 */
+ uint32_t version; /* 0x08 */
+ uint32_t num_entries; /* 0x0C */
+ uint32_t max_entries; /* 0x10 */
+ uint32_t global_attributes; /* 0x14 */
+ uint64_t reserved; /* 0x18 */
+ struct qclib_cb_if_table_entry
+ te[QCLIB_MAX_NUMBER_OF_ENTRIES]; /* 0x20 */
+};
+
+extern struct qclib_cb_if_table qclib_cb_if_table;
+
+void qclib_add_if_table_entry(const char *name, void *base,
+ uint32_t size, uint32_t attrs);
+void qclib_load_and_run(void);
+int qclib_soc_blob_load(void);
+
+#endif // _SOC_QUALCOMM_QCLIB_COMMON_H_
diff --git a/src/soc/qualcomm/common/include/soc/symbols_common.h b/src/soc/qualcomm/common/include/soc/symbols_common.h
new file mode 100644
index 0000000000..ffa535c493
--- /dev/null
+++ b/src/soc/qualcomm/common/include/soc/symbols_common.h
@@ -0,0 +1,25 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _SOC_QUALCOMM_SYMBOLS_COMMON_H_
+#define _SOC_QUALCOMM_SYMBOLS_COMMON_H_
+
+#include <symbols.h>
+
+DECLARE_REGION(ddr_training);
+DECLARE_REGION(qclib_serial_log);
+DECLARE_REGION(ddr_information);
+
+#endif // _SOC_QUALCOMM_SYMBOLS_COMMON_H_