Hi,
attached patch adds high table support to via vt8454c and might be a good template for other boards and chipsets.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Patrick
-----Original Message----- From: coreboot-bounces@coreboot.org [mailto:coreboot-bounces@coreboot.org] On Behalf Of Patrick Georgi Sent: Monday, April 27, 2009 1:18 PM To: coreboot@coreboot.org Subject: [coreboot] [PATCH] Add support for high tables to via vt8454c
Hi,
attached patch adds high table support to via vt8454c and might be a good template for other boards and chipsets.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Acked-by: Myles Watson mylesgw@gmail.com
Thanks, Myles
Patrick Georgi wrote:
attached patch adds high table support to via vt8454c and might be a good template for other boards and chipsets.
I don't think it is.
+++ src/mainboard/via/vt8454c/mainboard.c (Arbeitskopie) @@ -20,8 +20,23 @@ */
#include <device/device.h> +#include <boot/tables.h> +#include <console/console.h> #include "chip.h"
+/* in arch/i386/boot/tables.c */ +extern uint64_t high_tables_base, high_tables_size;
+int add_mainboard_resources(struct lb_memory *mem) +{ +#if HAVE_HIGH_TABLES == 1
printk_debug("Adding high table area\n");
lb_add_memory_range(mem, LB_MEM_TABLE,
high_tables_base, high_tables_size);
+#endif
- return 0;
+}
This code doesn't seem mainboard specific so I think it must not be in mainboard/.
+++ src/northbridge/via/cx700/northbridge.c (Arbeitskopie) @@ -87,6 +87,12 @@ return tolm; }
+#if HAVE_HIGH_TABLES==1 +/* maximum size of high tables in KB */ +#define HIGH_TABLES_SIZE 64 +extern uint64_t high_tables_base, high_tables_size; +#endif
static void pci_domain_set_resources(device_t dev) { device_t mc_dev; @@ -117,6 +123,12 @@ else tomk = (((rambits << 6) - (4 << reg) - 1) * 1024);
+#if HAVE_HIGH_TABLES == 1
- high_tables_base = (tomk - HIGH_TABLES_SIZE) * 1024;
- high_tables_size = HIGH_TABLES_SIZE* 1024;
- printk_debug("tom: %lx, high_tables_base: %llx, high_tables_size: %llx\n", tomk*1024, high_tables_base, high_tables_size);
+#endif
Likewise, this does not seem northbridge specific.
Could this live in one common place instead?
//Peter
Am 27.04.2009 23:37, schrieb Peter Stuge:
Patrick Georgi wrote:
attached patch adds high table support to via vt8454c and might be a good template for other boards and chipsets.
I don't think it is.
You are right. I've figured as much yesterday (after this mail, obviously), after talking with Stefan about unifying the part in mainboard.c
+++ src/mainboard/via/vt8454c/mainboard.c (Arbeitskopie) @@ -20,8 +20,23 @@ */
#include<device/device.h> +#include<boot/tables.h> +#include<console/console.h> #include "chip.h"
+/* in arch/i386/boot/tables.c */ +extern uint64_t high_tables_base, high_tables_size;
+int add_mainboard_resources(struct lb_memory *mem) +{ +#if HAVE_HIGH_TABLES == 1
printk_debug("Adding high table area\n");
lb_add_memory_range(mem, LB_MEM_TABLE,
high_tables_base, high_tables_size);
+#endif
- return 0;
+}
This code doesn't seem mainboard specific so I think it must not be in mainboard/.
add_mainboard_resources is necessary for some boards (eg. kontron), but this generic code could be added to the caller of add_mainboard_resources (wrapped in HAVE_HIGH_TABLES, of course). That way, boards that really need it (for other things) can use this function, while others don't have to do anything.
I'll prepare a patch for that.
+++ src/northbridge/via/cx700/northbridge.c (Arbeitskopie) @@ -87,6 +87,12 @@ return tolm; }
+#if HAVE_HIGH_TABLES==1 +/* maximum size of high tables in KB */ +#define HIGH_TABLES_SIZE 64 +extern uint64_t high_tables_base, high_tables_size; +#endif
- static void pci_domain_set_resources(device_t dev)>> { device_t mc_dev;
@@ -117,6 +123,12 @@ else tomk = (((rambits<< 6) - (4<< reg) - 1) * 1024);
+#if HAVE_HIGH_TABLES == 1
- high_tables_base = (tomk - HIGH_TABLES_SIZE) * 1024;
- high_tables_size = HIGH_TABLES_SIZE* 1024;
- printk_debug("tom: %lx, high_tables_base: %llx, high_tables_size: %llx\n", tomk*1024, high_tables_base, high_tables_size);
+#endif
Likewise, this does not seem northbridge specific.
It needs knowledge about the top of memory. I don't think we can push this elsewhere without merely selecting a different global variable (eg. one that is exported by the northbridge). And in this case, we're better off with the current solution, as it doesn't force changes for all northbridges at once.
What is not northbridge specific is the HIGH_TABLES_SIZE. It also depends on the amount of ACPI code etc, which is mainboard specific. I'll work on the other part first, to have more time to think over this and discuss it.
I'm open to better solutions. What I'd like to see eventually is that we can drop HAVE_HIGH_TABLES (and HAVE_LOW_TABLES, really) because both are set for all boards. Same for CONFIG_CBFS, btw. Having too many options makes our support matrix explode.
Patrick
Am 28.04.2009 10:41, schrieb Patrick Georgi:
Am 27.04.2009 23:37, schrieb Peter Stuge:
This code doesn't seem mainboard specific so I think it must not be in mainboard/.
add_mainboard_resources is necessary for some boards (eg. kontron), but this generic code could be added to the caller of add_mainboard_resources (wrapped in HAVE_HIGH_TABLES, of course). That way, boards that really need it (for other things) can use this function, while others don't have to do anything.
I'll prepare a patch for that.
Attached.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
On 28.04.2009 14:24 Uhr, Patrick Georgi wrote:
Am 28.04.2009 10:41, schrieb Patrick Georgi:
Am 27.04.2009 23:37, schrieb Peter Stuge:
This code doesn't seem mainboard specific so I think it must not be in mainboard/.
add_mainboard_resources is necessary for some boards (eg. kontron), but this generic code could be added to the caller of add_mainboard_resources (wrapped in HAVE_HIGH_TABLES, of course). That way, boards that really need it (for other things) can use this function, while others don't have to do anything.
I'll prepare a patch for that.
Attached.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Wonderful! This is much better. Can we enable HAVE_HIGH_TABLES for all amdk8 boards now?
Acked-by: Stefan Reinauer stepan@coresystems.de
Stefan Reinauer wrote:
Attached.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Wonderful! This is much better.
Yes! Good stuff! :)
Acked-by: Peter Stuge peter@stuge.se
Am 28.04.2009 14:39, schrieb Stefan Reinauer:
Wonderful! This is much better. Can we enable HAVE_HIGH_TABLES for all amdk8 boards now?
for i in \ `grep "northbridge/amd/amdk8" src/mainboard/*/*/Config.lb|\ cut -d: -f1 |sort -u`; do grep -L HAVE_HIGH_TABLES `dirname $i`/Options.lb done
claims the following boards are amdk8 (whose northbridge code is high tables equipped) without HAVE_HIGH_TABLES:
src/mainboard/amd/dbm690t/Options.lb src/mainboard/amd/pistachio/Options.lb src/mainboard/amd/serengeti_cheetah/Options.lb src/mainboard/amd/serengeti_cheetah_fam10/Options.lb src/mainboard/arima/hdama/Options.lb src/mainboard/asus/a8n_e/Options.lb src/mainboard/asus/a8v-e_se/Options.lb src/mainboard/broadcom/blast/Options.lb src/mainboard/gigabyte/ga_2761gxdk/Options.lb src/mainboard/gigabyte/m57sli/Options.lb src/mainboard/hp/dl145_g3/Options.lb src/mainboard/ibm/e325/Options.lb src/mainboard/ibm/e326/Options.lb src/mainboard/iwill/dk8_htx/Options.lb src/mainboard/iwill/dk8s2/Options.lb src/mainboard/iwill/dk8x/Options.lb src/mainboard/msi/ms7135/Options.lb src/mainboard/msi/ms7260/Options.lb src/mainboard/msi/ms9185/Options.lb src/mainboard/msi/ms9282/Options.lb src/mainboard/newisys/khepri/Options.lb src/mainboard/nvidia/l1_2pvv/Options.lb src/mainboard/sunw/ultra40/Options.lb src/mainboard/supermicro/h8dmr/Options.lb src/mainboard/technexion/tim8690/Options.lb src/mainboard/tyan/s2850/Options.lb src/mainboard/tyan/s2875/Options.lb src/mainboard/tyan/s2880/Options.lb src/mainboard/tyan/s2881/Options.lb src/mainboard/tyan/s2882/Options.lb src/mainboard/tyan/s2885/Options.lb src/mainboard/tyan/s2912/Options.lb src/mainboard/tyan/s4880/Options.lb src/mainboard/tyan/s4882/Options.lb
anyone willing to convert them?
Patrick
On Tue, Apr 28, 2009 at 7:00 AM, Patrick Georgi patrick@georgi-clan.de wrote:
Am 28.04.2009 14:39, schrieb Stefan Reinauer:
Wonderful! This is much better. Can we enable HAVE_HIGH_TABLES for all amdk8 boards now?
for i in \ `grep "northbridge/amd/amdk8" src/mainboard/*/*/Config.lb|\ cut -d: -f1 |sort -u`; do grep -L HAVE_HIGH_TABLES `dirname $i`/Options.lb done
claims the following boards are amdk8 (whose northbridge code is high tables equipped) without HAVE_HIGH_TABLES:
src/mainboard/amd/dbm690t/Options.lb src/mainboard/amd/pistachio/Options.lb src/mainboard/amd/serengeti_cheetah/Options.lb src/mainboard/amd/serengeti_cheetah_fam10/Options.lb src/mainboard/arima/hdama/Options.lb src/mainboard/asus/a8n_e/Options.lb src/mainboard/asus/a8v-e_se/Options.lb src/mainboard/broadcom/blast/Options.lb src/mainboard/gigabyte/ga_2761gxdk/Options.lb src/mainboard/gigabyte/m57sli/Options.lb src/mainboard/hp/dl145_g3/Options.lb src/mainboard/ibm/e325/Options.lb src/mainboard/ibm/e326/Options.lb src/mainboard/iwill/dk8_htx/Options.lb src/mainboard/iwill/dk8s2/Options.lb src/mainboard/iwill/dk8x/Options.lb src/mainboard/msi/ms7135/Options.lb src/mainboard/msi/ms7260/Options.lb src/mainboard/msi/ms9185/Options.lb src/mainboard/msi/ms9282/Options.lb src/mainboard/newisys/khepri/Options.lb src/mainboard/nvidia/l1_2pvv/Options.lb src/mainboard/sunw/ultra40/Options.lb src/mainboard/supermicro/h8dmr/Options.lb src/mainboard/technexion/tim8690/Options.lb src/mainboard/tyan/s2850/Options.lb src/mainboard/tyan/s2875/Options.lb src/mainboard/tyan/s2880/Options.lb src/mainboard/tyan/s2881/Options.lb src/mainboard/tyan/s2882/Options.lb src/mainboard/tyan/s2885/Options.lb src/mainboard/tyan/s2912/Options.lb src/mainboard/tyan/s4880/Options.lb src/mainboard/tyan/s4882/Options.lb
anyone willing to convert them?
To spare us from having to do so many conversions maybe we should have an include file for ACPI options, another for K8-specific options, ...
Thanks, Myles
Am 28.04.2009 15:04, schrieb Myles Watson:
To spare us from having to do so many conversions maybe we should have an include file for ACPI options, another for K8-specific options, ...
Or add high tables support to _all_ northbridges, and drop the option, making high tables the immutable default.
They're required for seabios (it overwrites some crucial tables otherwise), and there are few reasons not to use them.
Patrick
On Tue, Apr 28, 2009 at 7:11 AM, Patrick Georgi patrick@georgi-clan.de wrote:
Am 28.04.2009 15:04, schrieb Myles Watson:
To spare us from having to do so many conversions maybe we should have an include file for ACPI options, another for K8-specific options, ...
Or add high tables support to _all_ northbridges, and drop the option, making high tables the immutable default.
They're required for seabios (it overwrites some crucial tables otherwise), and there are few reasons not to use them.
I thought the main disadvantage was that there are other payloads which can't handle high tables yet. It would be too bad not to be able to boot a Linux kernel directly anymore.
Thanks, Myles
Am 28.04.2009 15:17, schrieb Myles Watson:
I thought the main disadvantage was that there are other payloads which can't handle high tables yet. It would be too bad not to be able to boot a Linux kernel directly anymore.
HAVE_HIGH_TABLES doesn't exclude using HAVE_LOW_TABLES. Most tables are copied to both locations if both are active, some (eg. ACPI) use a pointer in low memory that points to high memory in that case.
Patrick
On 28.04.2009 15:04 Uhr, Myles Watson wrote:
On Tue, Apr 28, 2009 at 7:00 AM, Patrick Georgi patrick@georgi-clan.de wrote:
Am 28.04.2009 14:39, schrieb Stefan Reinauer:
Wonderful! This is much better. Can we enable HAVE_HIGH_TABLES for all amdk8 boards now?
for i in \ `grep "northbridge/amd/amdk8" src/mainboard/*/*/Config.lb|\ cut -d: -f1 |sort -u`; do grep -L HAVE_HIGH_TABLES `dirname $i`/Options.lb done
claims the following boards are amdk8 (whose northbridge code is high tables equipped) without HAVE_HIGH_TABLES:
src/mainboard/amd/dbm690t/Options.lb src/mainboard/amd/pistachio/Options.lb src/mainboard/amd/serengeti_cheetah/Options.lb src/mainboard/amd/serengeti_cheetah_fam10/Options.lb src/mainboard/arima/hdama/Options.lb src/mainboard/asus/a8n_e/Options.lb src/mainboard/asus/a8v-e_se/Options.lb src/mainboard/broadcom/blast/Options.lb src/mainboard/gigabyte/ga_2761gxdk/Options.lb src/mainboard/gigabyte/m57sli/Options.lb src/mainboard/hp/dl145_g3/Options.lb src/mainboard/ibm/e325/Options.lb src/mainboard/ibm/e326/Options.lb src/mainboard/iwill/dk8_htx/Options.lb src/mainboard/iwill/dk8s2/Options.lb src/mainboard/iwill/dk8x/Options.lb src/mainboard/msi/ms7135/Options.lb src/mainboard/msi/ms7260/Options.lb src/mainboard/msi/ms9185/Options.lb src/mainboard/msi/ms9282/Options.lb src/mainboard/newisys/khepri/Options.lb src/mainboard/nvidia/l1_2pvv/Options.lb src/mainboard/sunw/ultra40/Options.lb src/mainboard/supermicro/h8dmr/Options.lb src/mainboard/technexion/tim8690/Options.lb src/mainboard/tyan/s2850/Options.lb src/mainboard/tyan/s2875/Options.lb src/mainboard/tyan/s2880/Options.lb src/mainboard/tyan/s2881/Options.lb src/mainboard/tyan/s2882/Options.lb src/mainboard/tyan/s2885/Options.lb src/mainboard/tyan/s2912/Options.lb src/mainboard/tyan/s4880/Options.lb src/mainboard/tyan/s4882/Options.lb
anyone willing to convert them?
Will this do?
Index: src/northbridge/amd/amdk8/Config.lb =================================================================== --- src/northbridge/amd/amdk8/Config.lb (revision 1595) +++ src/northbridge/amd/amdk8/Config.lb (working copy) @@ -1,7 +1,9 @@ uses AGP_APERTURE_SIZE uses HAVE_ACPI_TABLES +uses HAVE_HIGH_TABLES
default AGP_APERTURE_SIZE=0x4000000 +default HAVE_HIGH_TABLES=1
config chip.h
On Tue, Apr 28, 2009 at 7:14 AM, Stefan Reinauer stepan@coresystems.de wrote:
On 28.04.2009 15:04 Uhr, Myles Watson wrote:
On Tue, Apr 28, 2009 at 7:00 AM, Patrick Georgi patrick@georgi-clan.de wrote:
Am 28.04.2009 14:39, schrieb Stefan Reinauer:
Wonderful! This is much better. Can we enable HAVE_HIGH_TABLES for all amdk8 boards now?
for i in \ `grep "northbridge/amd/amdk8" src/mainboard/*/*/Config.lb|\ cut -d: -f1 |sort -u`; do grep -L HAVE_HIGH_TABLES `dirname $i`/Options.lb done
claims the following boards are amdk8 (whose northbridge code is high tables equipped) without HAVE_HIGH_TABLES:
src/mainboard/amd/dbm690t/Options.lb src/mainboard/amd/pistachio/Options.lb src/mainboard/amd/serengeti_cheetah/Options.lb src/mainboard/amd/serengeti_cheetah_fam10/Options.lb src/mainboard/arima/hdama/Options.lb src/mainboard/asus/a8n_e/Options.lb src/mainboard/asus/a8v-e_se/Options.lb src/mainboard/broadcom/blast/Options.lb src/mainboard/gigabyte/ga_2761gxdk/Options.lb src/mainboard/gigabyte/m57sli/Options.lb src/mainboard/hp/dl145_g3/Options.lb src/mainboard/ibm/e325/Options.lb src/mainboard/ibm/e326/Options.lb src/mainboard/iwill/dk8_htx/Options.lb src/mainboard/iwill/dk8s2/Options.lb src/mainboard/iwill/dk8x/Options.lb src/mainboard/msi/ms7135/Options.lb src/mainboard/msi/ms7260/Options.lb src/mainboard/msi/ms9185/Options.lb src/mainboard/msi/ms9282/Options.lb src/mainboard/newisys/khepri/Options.lb src/mainboard/nvidia/l1_2pvv/Options.lb src/mainboard/sunw/ultra40/Options.lb src/mainboard/supermicro/h8dmr/Options.lb src/mainboard/technexion/tim8690/Options.lb src/mainboard/tyan/s2850/Options.lb src/mainboard/tyan/s2875/Options.lb src/mainboard/tyan/s2880/Options.lb src/mainboard/tyan/s2881/Options.lb src/mainboard/tyan/s2882/Options.lb src/mainboard/tyan/s2885/Options.lb src/mainboard/tyan/s2912/Options.lb src/mainboard/tyan/s4880/Options.lb src/mainboard/tyan/s4882/Options.lb
anyone willing to convert them?
Will this do?
Index: src/northbridge/amd/amdk8/Config.lb
--- src/northbridge/amd/amdk8/Config.lb (revision 1595) +++ src/northbridge/amd/amdk8/Config.lb (working copy) @@ -1,7 +1,9 @@ uses AGP_APERTURE_SIZE uses HAVE_ACPI_TABLES +uses HAVE_HIGH_TABLES
default AGP_APERTURE_SIZE=0x4000000 +default HAVE_HIGH_TABLES=1
config chip.h
Good point. I think you're right that this should be sufficient. This is probably also the place to migrate a lot of the uses statements that are K8-specific.
Myles
On 28.04.2009 15:18 Uhr, Myles Watson wrote:
Will this do?
Index: src/northbridge/amd/amdk8/Config.lb
--- src/northbridge/amd/amdk8/Config.lb (revision 1595) +++ src/northbridge/amd/amdk8/Config.lb (working copy) @@ -1,7 +1,9 @@ uses AGP_APERTURE_SIZE uses HAVE_ACPI_TABLES +uses HAVE_HIGH_TABLES
default AGP_APERTURE_SIZE=0x4000000 +default HAVE_HIGH_TABLES=1
config chip.h
Good point. I think you're right that this should be sufficient. This is probably also the place to migrate a lot of the uses statements that are K8-specific.
agreed!
Am 28.04.2009 15:14, schrieb Stefan Reinauer:
Will this do?
[...]
Attached patch does this for all high tables capable northbridges, and eliminates HAVE_HIGH_TABLES in the mainboards.
The northbridge code keeps the HAVE_HIGH_TABLES #ifs in case boards want to disable that feature.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
On 28.04.2009 15:35 Uhr, Patrick Georgi wrote:
Am 28.04.2009 15:14, schrieb Stefan Reinauer:
Will this do?
[...]
Attached patch does this for all high tables capable northbridges, and eliminates HAVE_HIGH_TABLES in the mainboards.
The northbridge code keeps the HAVE_HIGH_TABLES #ifs in case boards want to disable that feature.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Acked-by: Stefan Reinauer stepan@coresystems.de
On Tue, Apr 28, 2009 at 7:35 AM, Patrick Georgi patrick@georgi-clan.de wrote:
Am 28.04.2009 15:14, schrieb Stefan Reinauer:
Will this do?
[...]
Attached patch does this for all high tables capable northbridges, and eliminates HAVE_HIGH_TABLES in the mainboards.
The northbridge code keeps the HAVE_HIGH_TABLES #ifs in case boards want to disable that feature.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Acked-by: Myles Watson mylesgw@gmail.com
While I was reviewing I noticed that there's some code in kontron/986lcd-m/acpi_tables.c that looks like it doesn't need to depend on HAVE_HIGH_TABLES anymore.
Thanks, Myles
On Tue, Apr 28, 2009 at 8:01 AM, Myles Watson mylesgw@gmail.com wrote:
On Tue, Apr 28, 2009 at 7:35 AM, Patrick Georgi patrick@georgi-clan.de wrote:
Am 28.04.2009 15:14, schrieb Stefan Reinauer:
Will this do?
[...]
Attached patch does this for all high tables capable northbridges, and eliminates HAVE_HIGH_TABLES in the mainboards.
The northbridge code keeps the HAVE_HIGH_TABLES #ifs in case boards want to disable that feature.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Acked-by: Myles Watson mylesgw@gmail.com
While I was reviewing :)
This patch fixes the build for K8 targets that don't have ACPI, so defaulting to HAVE_HIGH_TABLES breaks them.
Compile tested on a couple of broken boards.
Signed-off-by: Myles Watson mylesgw@gmail.com
Thanks, Myles
Am 28.04.2009 17:04, schrieb Myles Watson:
This patch fixes the build for K8 targets that don't have ACPI, so defaulting to HAVE_HIGH_TABLES breaks them.
HAVE_HIGH_TABLES isn't only useful for ACPI tables, so I have to disagree on this part of the patch (in src/northbridge/amd/amdk8/Config.lb)
I committed a fix (tested on _clean_ trees, that was the problem in my tests for my last patch) that guards ACPI table writing with #if HAVE_ACPI_TABLES.
As for the other stuff, what's its purpose?
Patrick
On Tue, Apr 28, 2009 at 9:07 AM, Patrick Georgi patrick@georgi-clan.de wrote:
Am 28.04.2009 17:04, schrieb Myles Watson:
This patch fixes the build for K8 targets that don't have ACPI, so defaulting to HAVE_HIGH_TABLES breaks them.
HAVE_HIGH_TABLES isn't only useful for ACPI tables, so I have to disagree on this part of the patch (in src/northbridge/amd/amdk8/Config.lb)
I committed a fix (tested on _clean_ trees, that was the problem in my tests for my last patch) that guards ACPI table writing with #if HAVE_ACPI_TABLES.
As for the other stuff, what's its purpose?
Showing you that I wasn't very careful with svn diff :)
Myles