Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: convert raminit_tables to header ......................................................................
nb/intel/nehalem: convert raminit_tables to header
This is necessary to get rid of a .c include.
Also do some cosmetic fixes to a table, now that the line length limit has been raised.
Change-Id: I6fd7fa5c9b21368bde8f089060733df6de34b4fd Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/northbridge/intel/nehalem/raminit.c R src/northbridge/intel/nehalem/raminit_tables.h 2 files changed, 24 insertions(+), 34 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/34876/1
diff --git a/src/northbridge/intel/nehalem/raminit.c b/src/northbridge/intel/nehalem/raminit.c index fadf0e0..b9d407a 100644 --- a/src/northbridge/intel/nehalem/raminit.c +++ b/src/northbridge/intel/nehalem/raminit.c @@ -42,6 +42,7 @@ #include "chip.h" #include "nehalem.h" #include "raminit.h" +#include "raminit_tables.h"
#define NORTHBRIDGE PCI_DEV(0, 0, 0) #define SOUTHBRIDGE PCI_DEV(0, 0x1f, 0) @@ -357,8 +358,6 @@ #define RANK_SHIFT 28 #define CHANNEL_SHIFT 10
-#include "raminit_tables.c" - static void seq9(struct raminfo *info, int channel, int slot, int rank) { int i, lane; diff --git a/src/northbridge/intel/nehalem/raminit_tables.c b/src/northbridge/intel/nehalem/raminit_tables.h similarity index 98% rename from src/northbridge/intel/nehalem/raminit_tables.c rename to src/northbridge/intel/nehalem/raminit_tables.h index 5c5d46f..540cc30 100644 --- a/src/northbridge/intel/nehalem/raminit_tables.c +++ b/src/northbridge/intel/nehalem/raminit_tables.h @@ -14,6 +14,11 @@ * GNU General Public License for more details. */
+#ifndef RAMINIT_TABLES_H +#define RAMINIT_TABLES_H + +#include <types.h> + /* [CHANNEL][EXT_REVISON][LANE][2*SLOT+RANK][CLOCK_SPEED] */ const u8 u8_FFFD1240[2][5][9][4][4] = { { @@ -617,46 +622,30 @@ const u8 u8_FFFD1891[2][2][4][12] = { { { - {0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x08, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00}, + {0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x08, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, }, { - {0x04, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x05, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x07, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x08, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, - 0x00}, + {0x04, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x05, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x07, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x08, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00}, } }, { { - {0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x08, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x0a, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x0c, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, - 0x00}, + {0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x08, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x0a, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x0c, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00}, }, { - {0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x08, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x0a, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x0c, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x74} + {0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x08, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x0a, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x0c, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74} } } }; @@ -1272,3 +1261,5 @@ };
const u8 lut16[4] = { 14, 13, 14, 14 }; + +#endif // RAMINIT_TABLES_H
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: convert raminit_tables to header ......................................................................
Patch Set 1:
Why not link the c file and use 'extern' ?
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: convert raminit_tables to header ......................................................................
Patch Set 1:
Patch Set 1:
Why not link the c file and use 'extern' ?
What for? I don't think much is gained doing that.
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: convert raminit_tables to header ......................................................................
Patch Set 1:
Patch Set 1:
Patch Set 1:
Why not link the c file and use 'extern' ?
What for? I don't think much is gained doing that.
Because header files are supposed to not make allocations from .bss. Builds fail if said file is included multiple times.
Frans Hendriks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: convert raminit_tables to header ......................................................................
Patch Set 1: Code-Review+1
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: convert raminit_tables to header ......................................................................
Patch Set 1: Code-Review+1
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: convert raminit_tables to header ......................................................................
Patch Set 1: Code-Review-1
Patch Set 1:
Patch Set 1:
Patch Set 1:
Why not link the c file and use 'extern' ?
What for? I don't think much is gained doing that.
Because header files are supposed to not make allocations from .bss. Builds fail if said file is included multiple times.
Right, I've just been hit by this on a different project. Will fix.
Angel Pons has removed a vote from this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: convert raminit_tables to header ......................................................................
Removed Code-Review+1 by Frans Hendriks fhendriks@eltan.com
Angel Pons has removed a vote from this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: convert raminit_tables to header ......................................................................
Removed Code-Review+1 by Paul Menzel paulepanter@users.sourceforge.net
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: convert raminit_tables to header ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34876/1/src/northbridge/intel/nehal... File src/northbridge/intel/nehalem/raminit_tables.h:
PS1: Do not merge until declaration and definition have been split.
Hello Patrick Rudolph, Frans Hendriks, Paul Menzel, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34876
to look at the new patch set (#2).
Change subject: nb/intel/nehalem: Add a header for raminit_tables.c ......................................................................
nb/intel/nehalem: Add a header for raminit_tables.c
This is necessary to get rid of a .c include.
Also do some cosmetic fixes to a table, now that the line length limit has been raised.
Change-Id: I6fd7fa5c9b21368bde8f089060733df6de34b4fd Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/northbridge/intel/nehalem/raminit.c M src/northbridge/intel/nehalem/raminit_tables.c A src/northbridge/intel/nehalem/raminit_tables.h 3 files changed, 85 insertions(+), 34 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/34876/2
Hello Patrick Rudolph, Frans Hendriks, Paul Menzel, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34876
to look at the new patch set (#3).
Change subject: nb/intel/nehalem: Add a header for raminit_tables.c ......................................................................
nb/intel/nehalem: Add a header for raminit_tables.c
This is necessary to get rid of a .c include.
Also do some cosmetic fixes to a table, now that the line length limit has been raised.
Change-Id: I6fd7fa5c9b21368bde8f089060733df6de34b4fd Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/northbridge/intel/nehalem/Makefile.inc M src/northbridge/intel/nehalem/raminit.c M src/northbridge/intel/nehalem/raminit_tables.c A src/northbridge/intel/nehalem/raminit_tables.h 4 files changed, 86 insertions(+), 34 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/34876/3
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: Add a header for raminit_tables.c ......................................................................
Patch Set 3:
(1 comment)
Should be good to go now.
https://review.coreboot.org/c/coreboot/+/34876/1/src/northbridge/intel/nehal... File src/northbridge/intel/nehalem/raminit_tables.h:
PS1:
Do not merge until declaration and definition have been split.
Done
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: Add a header for raminit_tables.c ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/34876 )
Change subject: nb/intel/nehalem: Add a header for raminit_tables.c ......................................................................
nb/intel/nehalem: Add a header for raminit_tables.c
This is necessary to get rid of a .c include.
Also do some cosmetic fixes to a table, now that the line length limit has been raised.
Change-Id: I6fd7fa5c9b21368bde8f089060733df6de34b4fd Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34876 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- M src/northbridge/intel/nehalem/Makefile.inc M src/northbridge/intel/nehalem/raminit.c M src/northbridge/intel/nehalem/raminit_tables.c A src/northbridge/intel/nehalem/raminit_tables.h 4 files changed, 86 insertions(+), 34 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/src/northbridge/intel/nehalem/Makefile.inc b/src/northbridge/intel/nehalem/Makefile.inc index 52374ac..ebb7b8b 100644 --- a/src/northbridge/intel/nehalem/Makefile.inc +++ b/src/northbridge/intel/nehalem/Makefile.inc @@ -24,6 +24,7 @@
romstage-y += memmap.c romstage-y += raminit.c +romstage-y += raminit_tables.c romstage-y += early_init.c romstage-y += ../../../arch/x86/walkcbfs.S
diff --git a/src/northbridge/intel/nehalem/raminit.c b/src/northbridge/intel/nehalem/raminit.c index fadf0e0..b9d407a 100644 --- a/src/northbridge/intel/nehalem/raminit.c +++ b/src/northbridge/intel/nehalem/raminit.c @@ -42,6 +42,7 @@ #include "chip.h" #include "nehalem.h" #include "raminit.h" +#include "raminit_tables.h"
#define NORTHBRIDGE PCI_DEV(0, 0, 0) #define SOUTHBRIDGE PCI_DEV(0, 0x1f, 0) @@ -357,8 +358,6 @@ #define RANK_SHIFT 28 #define CHANNEL_SHIFT 10
-#include "raminit_tables.c" - static void seq9(struct raminfo *info, int channel, int slot, int rank) { int i, lane; diff --git a/src/northbridge/intel/nehalem/raminit_tables.c b/src/northbridge/intel/nehalem/raminit_tables.c index 5c5d46f..1bd7330 100644 --- a/src/northbridge/intel/nehalem/raminit_tables.c +++ b/src/northbridge/intel/nehalem/raminit_tables.c @@ -14,6 +14,8 @@ * GNU General Public License for more details. */
+#include "raminit_tables.h" + /* [CHANNEL][EXT_REVISON][LANE][2*SLOT+RANK][CLOCK_SPEED] */ const u8 u8_FFFD1240[2][5][9][4][4] = { { @@ -617,46 +619,30 @@ const u8 u8_FFFD1891[2][2][4][12] = { { { - {0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x08, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00}, + {0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x08, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, }, { - {0x04, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x05, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x07, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x08, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, - 0x00}, + {0x04, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x05, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x07, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x08, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00}, } }, { { - {0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x08, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x0a, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x0c, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, - 0x00}, + {0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x08, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x0a, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x0c, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00}, }, { - {0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x08, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x0a, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, - 0x00}, - {0x0c, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x74} + {0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x08, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x0a, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x0c, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74} } } }; diff --git a/src/northbridge/intel/nehalem/raminit_tables.h b/src/northbridge/intel/nehalem/raminit_tables.h new file mode 100644 index 0000000..d912d6b --- /dev/null +++ b/src/northbridge/intel/nehalem/raminit_tables.h @@ -0,0 +1,66 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2013 Vladimir Serbinenko. + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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 RAMINIT_TABLES_H +#define RAMINIT_TABLES_H + +#include <types.h> + +/* [CHANNEL][EXT_REVISON][LANE][2*SLOT+RANK][CLOCK_SPEED] */ +extern const u8 u8_FFFD1240[2][5][9][4][4]; + +extern const u16 u16_FFFE0EB8[2][4]; + +/* [CARD][LANE][CLOCK_SPEED] */ +extern const u16 u16_ffd1188[2][9][4]; + +/* [REVISION][CHANNEL][CLOCK_INDEX][?] */ +extern const u8 u8_FFFD1891[2][2][4][12]; + +extern const u8 u8_FFFD17E0[2][5][4][4]; + +extern const u8 u8_FFFD0C78[2][5][4][2][2][4]; + +extern const u16 u16_fffd0c68[3]; + +extern const u16 u16_fffd0c70[2][2]; + +extern const u16 u16_fffd0c50[3][2][2]; + +/* [CLOCK_INDEX] */ +extern const u16 min_cycletime[4]; + +/* [CLOCK_INDEX] */ +extern const u16 min_cas_latency_time[4]; + +/* [CHANNEL][EXT_SILICON_REVISION][?][CLOCK_INDEX] */ +/* On other mobos may also depend on slot and rank. */ +extern const u8 u8_FFFD0EF8[2][5][4][4]; + +/* [CLOCK_SPEED] */ +extern const u8 u8_FFFD1218[4]; + +extern const u8 reg178_min[]; +extern const u8 reg178_max[]; +extern const u8 reg178_step[]; + +extern const u16 u16_ffd1178[2][4]; + +extern const u16 u16_fe0eb8[2][4]; + +extern const u8 lut16[4]; + +#endif // RAMINIT_TABLES_H