On Mon, Feb 23, 2009 at 11:10 AM, Myles Watson <[email protected]> wrote:
> On Mon, Feb 23, 2009 at 10:43 AM, Myles Watson <[email protected]> wrote:
>> On Mon, Feb 23, 2009 at 10:22 AM, Stefan Reinauer <[email protected]>
>> wrote:
>>> On 23.02.2009 18:04 Uhr, Myles Watson wrote:
>>>> I implemented the *_PLUGIN_SUPPORT config options for v3. I thought
>>>> it was simple since I was just enabling the defines already in the
>>>> code. In retrospect I may have implemented them backward.
>>>>
>>>> The space in the ROM consumed by PLUGIN_SUPPORT is very small if you
>>>> already have support for that bus. If you don't have support for the
>>>> bus it could be significant. I wanted to make it so that e.g.
>>>> HYPERTRANSPORT_PLUGIN_SUPPORT was the default if you had
>>>> HYPERTRANSPORT_SUPPORT. I'd also like people to be able to select
>>>> CARDBUS_PLUGIN_SUPPORT or NO_CARDBUS_PLUGIN_SUPPORT.
>>>>
>>> How much code do all those "plugins" together consume, given you have a
>>> system with none of that buses in the dts?
>>
>> Coreboot ROM Image (QEMU) with no plugin support:
>> normal/option_table (932 bytes @0x50);loadaddress 0x0 entry 0x0
>> normal/initram/segment0 (440 bytes @0x450);loadaddress 0x0 entry 0x0x20
>> normal/stage2/segment0 (194780 bytes, zeroes compressed to 1 bytes
>> @0x660);loadaddress 0x0xd130 entry 0x0x2000
>> normal/stage2/segment1 (35188 bytes, lzma compressed to 18410 bytes
>> @0x6c0);loadaddress 0x0x2000 entry 0x0x2000
>> normal/stage2/segment2 (6076 bytes, lzma compressed to 360 bytes
>> @0x4f00);loadaddress 0x0xb974 entry 0x0x2000
>> bootblock (20480 bytes @0x3b000)
>> Total size = 41071B 40KB (0xa06f)
>>
>> Coreboot ROM Image with all plugins:
>> normal/option_table (932 bytes @0x50);loadaddress 0x0 entry 0x0
>> normal/initram/segment0 (440 bytes @0x450);loadaddress 0x0 entry 0x0x20
>> normal/stage2/segment0 (194784 bytes, zeroes compressed to 1 bytes
>> @0x660);loadaddress 0x0xe1c0 entry 0x0x2000
>> normal/stage2/segment1 (39340 bytes, lzma compressed to 20416 bytes
>> @0x6c0);loadaddress 0x0x2000 entry 0x0x2000
>> normal/stage2/segment2 (6164 bytes, lzma compressed to 376 bytes
>> @0x56d0);loadaddress 0x0xc9ac entry 0x0x2000
>> bootblock (20480 bytes @0x3b000)
>> Total size = 43093B 42KB (0xa855)
>>
>> It looks like about 2K. In order for it to build I had to define a
>> few HT-specific things and put in an empty mainboard.h, but it won't
>> be hard if we want to make it the default to always include all buses.
>
> Coreboot ROM Image with everything but HyperTransport:
> normal/option_table (932 bytes @0x50);loadaddress 0x0 entry 0x0
> normal/initram/segment0 (440 bytes @0x450);loadaddress 0x0 entry 0x0x20
> normal/stage2/segment0 (194784 bytes, zeroes compressed to 1 bytes
> @0x660);loadaddress 0x0xda70 entry 0x0x2000
> normal/stage2/segment1 (37468 bytes, lzma compressed to 19388 bytes
> @0x6c0);loadaddress 0x0x2000 entry 0x0x2000
> normal/stage2/segment2 (6164 bytes, lzma compressed to 379 bytes
> @0x52d0);loadaddress 0x0xc25c entry 0x0x2000
> bootblock (20480 bytes @0x3b000)
> Total size = 42068B 41KB (0xa454)
>
> Maybe this is a good middle ground. I haven't seen a PCI->HT bridge yet :)
This patch removes all *_PLUGIN_SUPPORT options and replaces most
*_SUPPORT options with NO_*_SUPPORT options. This means that you have
to specify that you want a smaller BIOS, otherwise you get full
functionality.
HyperTransport is the only exception for a couple of reasons. HT
requires a mainboard.h file which not all mainboards have, and it's
less likely to be "plugged in" to a board that doesn't have some
onboard HT.
It also fixes a trivial typo in Kconfig (paylaod -> payload)
Signed-off-by: Myles Watson <[email protected]>
Build tested on Serengeti and qemu.
Thanks,
Myles
Index: Kconfig
===================================================================
--- Kconfig (revision 1139)
+++ Kconfig (working copy)
@@ -94,15 +94,15 @@
# These are used for internal purposes only:
# Buses:
-config PCIX_SUPPORT
+config NO_PCIX_SUPPORT
boolean
-config PCIE_SUPPORT
+config NO_PCIE_SUPPORT
boolean
config HYPERTRANSPORT_SUPPORT
boolean
-config AGP_SUPPORT
+config NO_AGP_SUPPORT
boolean
-config CARDBUS_SUPPORT
+config NO_CARDBUS_SUPPORT
boolean
# Northbridges:
@@ -124,19 +124,14 @@
config SOUTHBRIDGE_INTEL_I82371EB
boolean
config SOUTHBRIDGE_NVIDIA_CK804
- select PCIE_SUPPORT
boolean
config SOUTHBRIDGE_NVIDIA_MCP55
- select PCIE_SUPPORT
boolean
config SOUTHBRIDGE_AMD_AMD8151
- select AGP_SUPPORT
boolean
config SOUTHBRIDGE_AMD_AMD8132
- select PCIX_SUPPORT
boolean
config SOUTHBRIDGE_AMD_AMD8131
- select PCIX_SUPPORT
boolean
config SOUTHBRIDGE_AMD_AMD8111
boolean
@@ -174,7 +169,7 @@
bool "Include ELF payload loader"
default n
help
- This option allows an unparsed ELF paylaod to be added and loaded.
+ This option allows an unparsed ELF payload to be added and loaded.
choice
prompt "Payload type"
Index: device/Kconfig
===================================================================
--- device/Kconfig (revision 1139)
+++ device/Kconfig (working copy)
@@ -123,44 +123,33 @@
Initialize onboard VGA chips before any plugin VGA cards
are initialized.
-menu "Plugin Support"
+menu "Remove Bus Support (for size reasons)"
depends EXPERT
-config PCIX_PLUGIN_SUPPORT
- bool "Support for devices that provide PCI-X and aren't in the dts."
- select PCIX_SUPPORT
+config NO_PCIX_SUPPORT
+ bool "Remove support for PCI-X."
default false
help
- Compile in the drivers for cards that provide PCI-X.
+ Don't compile in the drivers for cards that provide PCI-X.
-config PCIE_PLUGIN_SUPPORT
- bool "Support for devices that provide PCI-e and aren't in the dts."
- select PCIE_SUPPORT
+config NO_PCIE_SUPPORT
+ bool "Remove support for PCI-Express."
default false
help
- Compile in the drivers for cards that provide PCI-e.
+ Don't compile in the drivers for cards that provide PCI-e.
-config HYPERTRANSPORT_PLUGIN_SUPPORT
- bool "Support for devices that provide HT and aren't in the dts."
- select HYPERTRANSPORT_SUPPORT
+config NO_AGP_SUPPORT
+ bool "Remove support for AGP."
default false
help
- Compile in the drivers for cards that provide HT.
+ Don't compile in the drivers for cards that provide AGP.
-config AGP_PLUGIN_SUPPORT
- bool "Support for devices that provide AGP and aren't in the dts."
- select AGP_SUPPORT
+config NO_CARDBUS_SUPPORT
+ bool "Remove support for Cardbus."
default false
help
- Compile in the drivers for cards that provide AGP.
+ Don't compile in the drivers for cards that provide Cardbus.
-config CARDBUS_PLUGIN_SUPPORT
- bool "Support for devices that provide Cardbus and aren't in the dts."
- select CARDBUS_SUPPORT
- default false
- help
- Compile in the drivers for cards that provide Cardbus.
-
endmenu
endmenu #Devices
Index: device/hypertransport.c
===================================================================
--- device/hypertransport.c (revision 1139)
+++ device/hypertransport.c (working copy)
@@ -41,6 +41,15 @@
#include <lib.h>
#include <lapic.h>
+/* These defines are for PLUGIN_SUPPORT. */
+#ifndef HT_CHAIN_UNITID_BASE
+#define HT_CHAIN_UNITID_BASE 0
+#endif
+
+#ifndef HT_CHAIN_END_UNITID_BASE
+#define HT_CHAIN_END_UNITID_BASE 0
+#endif
+
#define OPT_HT_LINK 0
static struct device *ht_scan_get_devs(struct device **old_devices)
Index: device/pci_device.c
===================================================================
--- device/pci_device.c (revision 1139)
+++ device/pci_device.c (working copy)
@@ -32,19 +32,19 @@
#include <device/pci.h>
#include <device/pci_ids.h>
-#ifdef CONFIG_PCIX_PLUGIN_SUPPORT
+#ifndef CONFIG_NO_PCIX_SUPPORT
#include <device/pcix.h>
#endif
-#ifdef CONFIG_AGP_PLUGIN_SUPPORT
+#ifndef CONFIG_NO_AGP_SUPPORT
#include <device/agp.h>
#endif
-#ifdef CONFIG_HYPERTRANSPORT_PLUGIN_SUPPORT
+#ifdef CONFIG_HYPERTRANSPORT_SUPPORT
#include <device/hypertransport.h>
#endif
-#ifdef CONFIG_PCIE_PLUGIN_SUPPORT
+#ifndef CONFIG_NO_PCIE_SUPPORT
#include <device/pcie.h>
#endif
-#ifdef CONFIG_CARDBUS_PLUGIN_SUPPORT
+#ifndef CONFIG_NO_CARDBUS_SUPPORT
#include <device/cardbus.h>
#endif
@@ -792,7 +792,7 @@
*/
static const struct device_operations *get_pci_bridge_ops(struct device *dev)
{
-#ifdef CONFIG_PCIX_PLUGIN_SUPPORT
+#ifndef CONFIG_NO_PCIX_SUPPORT
unsigned int pcix_pos;
pcix_pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
if (pcix_pos) {
@@ -801,12 +801,12 @@
return &default_pcix_ops_bus;
}
#endif
-#ifdef CONFIG_AGP_PLUGIN_SUPPORT
+#ifndef CONFIG_NO_AGP_SUPPORT
/* How do I detect an PCI to AGP bridge? */
#warning AGP detection not implemented, so AGP bridge plugin not supported.
#endif
-#ifdef CONFIG_HYPERTRANSPORT_PLUGIN_SUPPORT
+#ifdef CONFIG_HYPERTRANSPORT_SUPPORT
unsigned int ht_pos;
ht_pos = 0;
while ((ht_pos = pci_find_next_capability(dev, PCI_CAP_ID_HT, ht_pos))) {
@@ -821,7 +821,7 @@
}
}
#endif
-#ifdef CONFIG_PCIE_PLUGIN_SUPPORT
+#ifndef CONFIG_NO_PCIE_SUPPORT
unsigned int pcie_pos;
pcie_pos = pci_find_capability(dev, PCI_CAP_ID_PCIE);
if (pcie_pos) {
@@ -897,7 +897,7 @@
else
dev->ops = get_pci_bridge_ops(dev);
break;
-#ifdef CONFIG_CARDBUS_PLUGIN_SUPPORT
+#ifndef CONFIG_NO_CARDBUS_SUPPORT
case PCI_HEADER_TYPE_CARDBUS:
dev->ops = &default_cardbus_ops_bus;
break;
Index: device/Makefile
===================================================================
--- device/Makefile (revision 1139)
+++ device/Makefile (working copy)
@@ -32,19 +32,19 @@
STAGE2_DEVICE_SRC += hypertransport.c
endif
-ifeq ($(CONFIG_PCIX_SUPPORT),y)
+ifneq ($(CONFIG_NO_PCIX_SUPPORT),y)
STAGE2_DEVICE_SRC += pcix_device.c
endif
-ifeq ($(CONFIG_PCIE_SUPPORT),y)
+ifneq ($(CONFIG_NO_PCIE_SUPPORT),y)
STAGE2_DEVICE_SRC += pcie_device.c
endif
-ifeq ($(CONFIG_CARDBUS_SUPPORT),y)
+ifneq ($(CONFIG_NO_CARDBUS_SUPPORT),y)
STAGE2_DEVICE_SRC += cardbus_device.c
endif
-ifeq ($(CONFIG_AGP_SUPPORT),y)
+ifneq ($(CONFIG_NO_AGP_SUPPORT),y)
STAGE2_DEVICE_SRC += agp_device.c
endif
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot