summaryrefslogtreecommitdiffstats
path: root/resources/libreboot/patch/kgpe-d16/0031-northbridge-amd-amdmct-Fix-S3-suspend-resume-with-la.patch
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-10-17 11:10:53 (EDT)
committer Francis Rowe <info@gluglug.org.uk>2015-10-17 14:07:35 (EDT)
commit5999dba5f71f1c05040a551d2420ab8c7f3a9da4 (patch)
tree7313b1996a247bf938417d5cf2496f5f6625c0db /resources/libreboot/patch/kgpe-d16/0031-northbridge-amd-amdmct-Fix-S3-suspend-resume-with-la.patch
parent4d909153e79661e54999e51693668f6d1ecc1cca (diff)
downloadlibreboot-5999dba5f71f1c05040a551d2420ab8c7f3a9da4.zip
libreboot-5999dba5f71f1c05040a551d2420ab8c7f3a9da4.tar.gz
libreboot-5999dba5f71f1c05040a551d2420ab8c7f3a9da4.tar.bz2
New board: ASUS KGPE-D16
coreboot build errors: In file included from src/northbridge/amd/amdfam10/misc_control.c:35:0: src/include/option.h:13:27: error: static declaration of 'get_option' follows non-static declaration static inline enum cb_err get_option(void *dest, const char *name) ^ In file included from src/northbridge/amd/amdfam10/misc_control.c:34:0: src/include/pc80/mc146818rtc.h:176:13: note: previous declaration of 'get_option' was here enum cb_err get_option(void *dest, const char *name); Ping tpearson about this. Also ping him about the fact that there isn't actually an option to enable or disable native graphics initialization, but that the option MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG is in fact available and set to Y in the Kconfig file. I think this is probably since there isn't even an option ROM available for the machine, so it's pointless to offer the setting.
Diffstat (limited to 'resources/libreboot/patch/kgpe-d16/0031-northbridge-amd-amdmct-Fix-S3-suspend-resume-with-la.patch')
-rw-r--r--resources/libreboot/patch/kgpe-d16/0031-northbridge-amd-amdmct-Fix-S3-suspend-resume-with-la.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/resources/libreboot/patch/kgpe-d16/0031-northbridge-amd-amdmct-Fix-S3-suspend-resume-with-la.patch b/resources/libreboot/patch/kgpe-d16/0031-northbridge-amd-amdmct-Fix-S3-suspend-resume-with-la.patch
new file mode 100644
index 0000000..6754fc1
--- /dev/null
+++ b/resources/libreboot/patch/kgpe-d16/0031-northbridge-amd-amdmct-Fix-S3-suspend-resume-with-la.patch
@@ -0,0 +1,78 @@
+From 67497b91b5d5e9d28264cbbcdfb772e40860ad09 Mon Sep 17 00:00:00 2001
+From: Timothy Pearson <kb9vqf@pearsoncomputing.net>
+Date: Tue, 2 Jun 2015 15:55:35 -0500
+Subject: [PATCH 031/146] northbridge/amd/amdmct: Fix S3 suspend/resume with
+ latest CBFS changes
+
+---
+ src/northbridge/amd/amdmct/mct_ddr3/s3utils.c | 28 ++++++++++++-------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/src/northbridge/amd/amdmct/mct_ddr3/s3utils.c b/src/northbridge/amd/amdmct/mct_ddr3/s3utils.c
+index 98b533b..c9bcac1 100644
+--- a/src/northbridge/amd/amdmct/mct_ddr3/s3utils.c
++++ b/src/northbridge/amd/amdmct/mct_ddr3/s3utils.c
+@@ -36,17 +36,15 @@ static ssize_t get_s3nv_file_offset(void);
+
+ ssize_t get_s3nv_file_offset(void)
+ {
+- struct cbfs_file file;
+- ssize_t offset;
+- struct cbfs_media *media = CBFS_DEFAULT_MEDIA;
+-
+- offset = cbfs_locate_file(media, &file, S3NV_FILE_NAME);
+- if (offset < 0) {
++ struct region_device s3nv_region;
++ struct cbfsf s3nv_cbfs_file;
++ if (cbfs_boot_locate(&s3nv_cbfs_file, S3NV_FILE_NAME, NULL)) {
+ printk(BIOS_DEBUG, "S3 state file not found in CBFS: %s\n", S3NV_FILE_NAME);
+ return -1;
+ }
++ cbfs_file_data(&s3nv_region, &s3nv_cbfs_file);
+
+- return offset;
++ return s3nv_region.region.offset;
+ }
+
+ static uint32_t read_amd_dct_index_register(device_t dev, uint32_t index_ctl_reg, uint32_t index)
+@@ -604,9 +602,9 @@ int8_t save_mct_information_to_nvram(void)
+ int8_t restore_mct_information_from_nvram(void)
+ {
+ ssize_t s3nv_offset;
++ ssize_t s3nv_file_offset;
++ void * s3nv_cbfs_file_ptr;
+ struct amd_s3_persistent_data *persistent_data;
+- struct cbfs_media default_media;
+- struct cbfs_media* media = CBFS_DEFAULT_MEDIA;
+
+ /* Obtain CBFS file offset */
+ s3nv_offset = get_s3nv_file_offset();
+@@ -614,17 +612,19 @@ int8_t restore_mct_information_from_nvram(void)
+ return -1;
+
+ /* Align flash pointer to nearest boundary */
++ s3nv_file_offset = s3nv_offset;
+ s3nv_offset &= ~(CONFIG_S3_DATA_SIZE-1);
+ s3nv_offset += CONFIG_S3_DATA_SIZE;
++ s3nv_file_offset = s3nv_offset - s3nv_file_offset;
+
+ /* Map data structure in CBFS and restore settings */
+- if (init_backing_media(&media, &default_media))
++ s3nv_cbfs_file_ptr = cbfs_boot_map_with_leak(S3NV_FILE_NAME, CBFS_TYPE_RAW, NULL);
++ if (!s3nv_cbfs_file_ptr) {
++ printk(BIOS_DEBUG, "S3 state file could not be mapped: %s\n", S3NV_FILE_NAME);
+ return -1;
+-
+- media->open(media);
+- persistent_data = media->map(media, s3nv_offset, sizeof(struct amd_s3_persistent_data));
++ }
++ persistent_data = (s3nv_cbfs_file_ptr + s3nv_file_offset);
+ restore_mct_data_from_save_variable(persistent_data);
+- media->close(media);
+
+ return 0;
+ }
+\ No newline at end of file
+--
+1.7.9.5
+