diff options
author | Angel Pons <th3fanbus@gmail.com> | 2020-03-21 12:45:12 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-03-23 19:24:22 +0000 |
commit | 7f6586ff782e632902ae9a807b95c97659dd6a9a (patch) | |
tree | 624e80a86cad0a613a3aff75bec6162f61cce995 /src/northbridge | |
parent | 0e47ad6d2cd6322324658757cb345c5758449e18 (diff) |
nb/intel/sandybridge: Do not define tables in a header
Header files are supposed to not make allocations from .bss. Builds
fail if said file is included multiple times. To prevent this from
happening, move the definitions to a C file.
Also, rename raminit_patterns to raminit_tables. This is because more
tables that are not patterns will be added here in subsequent changes.
Tested on Asus P8Z77-V LX2, still boots fine.
Change-Id: If8e3a285ecdc4df9e978ae156be915ced6e1750b
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39754
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/northbridge')
-rw-r--r-- | src/northbridge/intel/sandybridge/Makefile.inc | 1 | ||||
-rw-r--r-- | src/northbridge/intel/sandybridge/raminit_common.c | 3 | ||||
-rw-r--r-- | src/northbridge/intel/sandybridge/raminit_tables.c (renamed from src/northbridge/intel/sandybridge/raminit_patterns.h) | 19 | ||||
-rw-r--r-- | src/northbridge/intel/sandybridge/raminit_tables.h | 15 |
4 files changed, 20 insertions, 18 deletions
diff --git a/src/northbridge/intel/sandybridge/Makefile.inc b/src/northbridge/intel/sandybridge/Makefile.inc index 7718bf9acd..11f1f15656 100644 --- a/src/northbridge/intel/sandybridge/Makefile.inc +++ b/src/northbridge/intel/sandybridge/Makefile.inc @@ -36,6 +36,7 @@ romstage-y += raminit.c romstage-y += raminit_common.c romstage-y += raminit_sandy.c romstage-y += raminit_ivy.c +romstage-y += raminit_tables.c romstage-y += ../../../device/dram/ddr3.c else romstage-y += raminit_mrc.c diff --git a/src/northbridge/intel/sandybridge/raminit_common.c b/src/northbridge/intel/sandybridge/raminit_common.c index e28907086d..9eb60c74c9 100644 --- a/src/northbridge/intel/sandybridge/raminit_common.c +++ b/src/northbridge/intel/sandybridge/raminit_common.c @@ -24,6 +24,7 @@ #include "raminit_native.h" #include "raminit_common.h" +#include "raminit_tables.h" #include "sandybridge.h" /* FIXME: no ECC support */ @@ -2100,8 +2101,6 @@ static int test_320c(ramctr_timing *ctrl, int channel, int slotrank) return lanes_ok != ((1 << NUM_LANES) - 1); } -#include "raminit_patterns.h" - static void fill_pattern5(ramctr_timing *ctrl, int channel, int patno) { unsigned int i, j; diff --git a/src/northbridge/intel/sandybridge/raminit_patterns.h b/src/northbridge/intel/sandybridge/raminit_tables.c index aa6c2dcfc7..1ecba1b935 100644 --- a/src/northbridge/intel/sandybridge/raminit_patterns.h +++ b/src/northbridge/intel/sandybridge/raminit_tables.c @@ -1,18 +1,7 @@ -/* - * This file is part of the coreboot project. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * 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. - */ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* This file is part of the coreboot project. */ -#ifndef SANDYBRIDGE_RAMINIT_PATTERNS_H -#define SANDYBRIDGE_RAMINIT_PATTERNS_H +#include "raminit_tables.h" const u32 pattern[32][16] = { {0x00000000, 0x00000000, 0xffffffff, 0xffffffff, @@ -654,5 +643,3 @@ const u8 invert[63][32] = { 0x88, 0xa4, 0x1c, 0xea, 0x11, 0x8c, 0xfb, 0xbe, 0x70, 0x62, 0xec, 0x4e, 0x00, 0x56, 0x0e, 0xa9}, }; - -#endif /* SANDYBRIDGE_RAMINIT_PATTERNS_H */ diff --git a/src/northbridge/intel/sandybridge/raminit_tables.h b/src/northbridge/intel/sandybridge/raminit_tables.h new file mode 100644 index 0000000000..4e225552c3 --- /dev/null +++ b/src/northbridge/intel/sandybridge/raminit_tables.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* This file is part of the coreboot project. */ + +#ifndef RAMINIT_TABLES_H +#define RAMINIT_TABLES_H + +#include <types.h> + +extern const u32 pattern[32][16]; + +extern const u8 use_base[63][32]; + +extern const u8 invert[63][32]; + +#endif /* RAMINIT_TABLES_H */ |