===================================================================
@@ -20,3 +20,10 @@
source src/cpu/amd/model_lx/Kconfig
source src/cpu/amd/sc520/Kconfig
+
+config SYSTEM_TYPE_AMD
+ int
+ default 0 if SYSTEM_TYPE_UNSPECIFIED | SYSTEM_TYPE_ENTERPRISE_SERVER | SYSTEM_TYPE_SOHO_SERVER | SYSTEM_TYPE_PERFORMANCE_SERVER
+ default 1 if SYSTEM_TYPE_DESKTOP | SYSTEM_TYPE_WORKSTATION
+ default 2 if SYSTEM_TYPE_LAPTOP | SYSTEM_TYPE_APPLIANCE_PC
+
===================================================================
@@ -582,7 +582,7 @@
{
u32 ret = 0;
- switch (SYSTEM_TYPE) {
+ switch (CONFIG_SYSTEM_TYPE_AMD) {
case 1:
ret |= AMD_PTYPE_DSK;
break;
===================================================================
@@ -247,6 +247,50 @@
default 0x200000 if COREBOOT_ROMSIZE_KB_2048
default 0x400000 if COREBOOT_ROMSIZE_KB_4096
+choice
+ prompt "System Type"
+ default SYSTEM_TYPE_UNSPECIFIED
+ help
+ Chipset configuration and OS behaviour can be tuned for several
+ use cases.
+
+config SYSTEM_TYPE_UNSPECIFIED
+ bool "Unspecified"
+
+config SYSTEM_TYPE_DESKTOP
+ bool "Desktop"
+
+config SYSTEM_TYPE_MOBILE
+ bool "Mobile"
+
+config SYSTEM_TYPE_WORKSTATION
+ bool "Workstation"
+
+config SYSTEM_TYPE_ENTERPRISE_SERVER
+ bool "Enterprise Server"
+
+config SYSTEM_TYPE_SOHO_SERVER
+ bool "SOHO Server"
+
+config SYSTEM_TYPE_APPLIANCE_PC
+ bool "Appliance PC"
+
+config SYSTEM_TYPE_PERFORMANCE_SERVER
+ bool "Performance Server"
+
+endchoice
+
+config SYSTEM_TYPE_FADT
+ int
+ default 0 if SYSTEM_TYPE_UNSPECIFIED
+ default 1 if SYSTEM_TYPE_DESKTOP
+ default 2 if SYSTEM_TYPE_MOBILE
+ default 3 if SYSTEM_TYPE_WORKSTATION
+ default 4 if SYSTEM_TYPE_ENTERPRISE_SERVER
+ default 5 if SYSTEM_TYPE_SOHO_SERVER
+ default 6 if SYSTEM_TYPE_APPLIANCE_PC
+ default 7 if SYSTEM_TYPE_PERFORMANCE_SERVER
+
config ENABLE_POWER_BUTTON
bool "Enable the power button" if POWER_BUTTON_IS_OPTIONAL
default y if POWER_BUTTON_DEFAULT_ENABLE
===================================================================
@@ -60,8 +60,7 @@
fadt->firmware_ctrl = (u32) facs;
fadt->dsdt = (u32) dsdt;
- /* 3=Workstation,4=Enterprise Server, 7=Performance Server */
- fadt->preferred_pm_profile = 0x03;
+ fadt->preferred_pm_profile = CONFIG_SYSTEM_TYPE_FADT;
fadt->sci_int = 9;
/* disable system management mode by setting to 0: */
fadt->smi_cmd = 0;
===================================================================
@@ -29,6 +29,7 @@
select GFXUMA
select RAMINIT_SYSINFO
select QRANK_DIMM_SUPPORT
+ select SYSTEM_TYPE_WORKSTATION
config MAINBOARD_DIR
string
===================================================================
@@ -17,10 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-//#define SYSTEM_TYPE 0 /* SERVER */
-#define SYSTEM_TYPE 1 /* DESKTOP */
-//#define SYSTEM_TYPE 2 /* MOBILE */
-
#define SET_NB_CFG_54 1
//used by incoherent_ht
===================================================================
@@ -60,8 +60,7 @@
fadt->firmware_ctrl = (u32) facs;
fadt->dsdt = (u32) dsdt;
- /* 3=Workstation,4=Enterprise Server, 7=Performance Server */
- fadt->preferred_pm_profile = 0x03;
+ fadt->preferred_pm_profile = CONFIG_SYSTEM_TYPE_FADT;
fadt->sci_int = 9;
/* disable system management mode by setting to 0: */
fadt->smi_cmd = 0;
===================================================================
@@ -29,6 +29,7 @@
select GFXUMA
select RAMINIT_SYSINFO
select QRANK_DIMM_SUPPORT
+ select SYSTEM_TYPE_WORKSTATION
config MAINBOARD_DIR
string
===================================================================
@@ -17,10 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-//#define SYSTEM_TYPE 0 /* SERVER */
-#define SYSTEM_TYPE 1 /* DESKTOP */
-//#define SYSTEM_TYPE 2 /* MOBILE */
-
#define SET_NB_CFG_54 1
//used by init_cpus and fidvid
===================================================================
@@ -29,6 +29,7 @@
select TINY_BOOTBLOCK
select GFXUMA
select QRANK_DIMM_SUPPORT
+ select SYSTEM_TYPE_WORKSTATION
config MAINBOARD_DIR
string
===================================================================
@@ -60,8 +60,7 @@
fadt->firmware_ctrl = (u32) facs;
fadt->dsdt = (u32) dsdt;
- /* 3=Workstation,4=Enterprise Server, 7=Performance Server */
- fadt->preferred_pm_profile = 0x03;
+ fadt->preferred_pm_profile = CONFIG_SYSTEM_TYPE_FADT;
fadt->sci_int = 9;
/* disable system management mode by setting to 0: */
fadt->smi_cmd = 0;
===================================================================
@@ -17,10 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-//#define SYSTEM_TYPE 0 /* SERVER */
-#define SYSTEM_TYPE 1 /* DESKTOP */
-//#define SYSTEM_TYPE 2 /* MOBILE */
-
#define SET_NB_CFG_54 1
//used by incoherent_ht
===================================================================
@@ -29,6 +29,7 @@
select TINY_BOOTBLOCK
select GFXUMA
select QRANK_DIMM_SUPPORT
+ select SYSTEM_TYPE_WORKSTATION
config MAINBOARD_DIR
string
===================================================================
@@ -60,8 +60,7 @@
fadt->firmware_ctrl = (u32) facs;
fadt->dsdt = (u32) dsdt;
- /* 3=Workstation,4=Enterprise Server, 7=Performance Server */
- fadt->preferred_pm_profile = 0x03;
+ fadt->preferred_pm_profile = CONFIG_SYSTEM_TYPE_FADT;
fadt->sci_int = 9;
/* disable system management mode by setting to 0: */
fadt->smi_cmd = 0;
===================================================================
@@ -17,10 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-//#define SYSTEM_TYPE 0 /* SERVER */
-#define SYSTEM_TYPE 1 /* DESKTOP */
-//#define SYSTEM_TYPE 2 /* MOBILE */
-
#define SET_NB_CFG_54 1
//used by incoherent_ht
===================================================================
@@ -27,6 +27,7 @@
select LIFT_BSP_APIC_ID
select TINY_BOOTBLOCK
select QRANK_DIMM_SUPPORT
+ select SYSTEM_TYPE_SOHO_SERVER
config MAINBOARD_DIR
string
===================================================================
@@ -48,8 +48,7 @@
fadt->firmware_ctrl=(u32)facs;
fadt->dsdt= (u32)dsdt;
- // 3=Workstation,4=Enterprise Server, 7=Performance Server
- fadt->preferred_pm_profile=0x03;
+ fadt->preferred_pm_profile=CONFIG_SYSTEM_TYPE_FADT;
fadt->sci_int=9;
// disable system management mode by setting to 0:
fadt->smi_cmd = 0;//pm_base+0x2f;
===================================================================
@@ -17,10 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define SYSTEM_TYPE 0 /* SERVER */
-//#define SYSTEM_TYPE 1 /* DESKTOP */
-//#define SYSTEM_TYPE 2 /* MOBILE */
-
#define SET_NB_CFG_54 1
//used by incoherent_ht
===================================================================
@@ -29,6 +29,7 @@
select TINY_BOOTBLOCK
select GFXUMA
select QRANK_DIMM_SUPPORT
+ select SYSTEM_TYPE_WORKSTATION
config MAINBOARD_DIR
string
===================================================================
@@ -60,8 +60,7 @@
fadt->firmware_ctrl = (u32) facs;
fadt->dsdt = (u32) dsdt;
- /* 3=Workstation,4=Enterprise Server, 7=Performance Server */
- fadt->preferred_pm_profile = 0x03;
+ fadt->preferred_pm_profile = CONFIG_SYSTEM_TYPE_FADT;
fadt->sci_int = 9;
/* disable system management mode by setting to 0: */
fadt->smi_cmd = 0;
===================================================================
@@ -17,10 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-//#define SYSTEM_TYPE 0 /* SERVER */
-#define SYSTEM_TYPE 1 /* DESKTOP */
-//#define SYSTEM_TYPE 2 /* MOBILE */
-
#define SET_NB_CFG_54 1
//used by raminit
===================================================================
@@ -60,8 +60,7 @@
fadt->firmware_ctrl = (u32) facs;
fadt->dsdt = (u32) dsdt;
- /* 3=Workstation,4=Enterprise Server, 7=Performance Server */
- fadt->preferred_pm_profile = 0x03;
+ fadt->preferred_pm_profile = CONFIG_SYSTEM_TYPE_FADT;
fadt->sci_int = 9;
/* disable system management mode by setting to 0: */
fadt->smi_cmd = 0;
===================================================================
@@ -29,6 +29,7 @@
select TINY_BOOTBLOCK
select GFXUMA
select QRANK_DIMM_SUPPORT
+ select SYSTEM_TYPE_WORKSTATION
config MAINBOARD_DIR
string
===================================================================
@@ -18,10 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-//#define SYSTEM_TYPE 0 /* SERVER */
-#define SYSTEM_TYPE 1 /* DESKTOP */
-//#define SYSTEM_TYPE 2 /* MOBILE */
-
#define SET_NB_CFG_54 1
//used by incoherent_ht
===================================================================
@@ -28,6 +28,7 @@
select TINY_BOOTBLOCK
select GFXUMA
select QRANK_DIMM_SUPPORT
+ select SYSTEM_TYPE_WORKSTATION
config MAINBOARD_DIR
string
===================================================================
@@ -60,8 +60,7 @@
fadt->firmware_ctrl = (u32) facs;
fadt->dsdt = (u32) dsdt;
- /* 3=Workstation,4=Enterprise Server, 7=Performance Server */
- fadt->preferred_pm_profile = 0x03;
+ fadt->preferred_pm_profile = CONFIG_SYSTEM_TYPE_FADT;
fadt->sci_int = 9;
/* disable system management mode by setting to 0: */
fadt->smi_cmd = 0;
===================================================================
@@ -17,10 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-//#define SYSTEM_TYPE 0 /* SERVER */
-#define SYSTEM_TYPE 1 /* DESKTOP */
-//#define SYSTEM_TYPE 2 /* MOBILE */
-
#define SET_NB_CFG_54 1
//used by incoherent_ht
===================================================================
@@ -32,7 +32,7 @@
val = 1;
#elif CONFIG_CPU_SOCKET_TYPE == 0x13 /* ASB2 */
val = 4;
-//#elif SYSTEM_TYPE == MOBILE
+//#elif CONFIG_SYSTEM_TYPE_AMD == MOBILE
// val = 2;
#endif
break;
@@ -51,7 +51,7 @@
val = 400; /* 400MHz(DDR800) */
break;
case NV_ECC_CAP:
-#if SYSTEM_TYPE == SERVER
+#if CONFIG_SYSTEM_TYPE_AMD == SERVER
val = 1; /* memory bus ECC capable */
#else
val = 0; /* memory bus ECC not capable */
@@ -142,21 +142,21 @@
#endif
break;
case NV_ECC:
-#if (SYSTEM_TYPE == SERVER)
+#if (CONFIG_SYSTEM_TYPE_AMD == SERVER)
val = 1; /* Enable */
#else
val = 0; /* Disable */
#endif
break;
case NV_NBECC:
-#if (SYSTEM_TYPE == SERVER)
+#if (CONFIG_SYSTEM_TYPE_AMD == SERVER)
val = 1; /* Enable */
#else
val = 0; /* Disable */
#endif
break;
case NV_ChipKill:
-#if (SYSTEM_TYPE == SERVER)
+#if (CONFIG_SYSTEM_TYPE_AMD == SERVER)
val = 1; /* Enable */
#else
val = 0; /* Disable */
===================================================================
@@ -36,15 +36,6 @@
/*----------------------------------------------------------------------------
COMMENT OUT ALL BUT 1
----------------------------------------------------------------------------*/
-#ifndef SYSTEM_TYPE
-#define SYSTEM_TYPE SERVER
-//#define SYSTEM_TYPE DESKTOP
-//#define SYSTEM_TYPE MOBILE
-#endif
-
-/*----------------------------------------------------------------------------
-COMMENT OUT ALL BUT 1
-----------------------------------------------------------------------------*/
#define UMA_SUPPORT 0 /*Not supported */
//#define UMA_SUPPORT 1 /*Supported */
===================================================================
@@ -109,7 +109,7 @@
#elif CONFIG_CPU_SOCKET_TYPE == 0x11
//AM2
#include "../amdmct/mct/mctardk4.c"
-//#elif SYSTEM_TYPE == MOBILE
+//#elif CONFIG_SYSTEM_TYPE_AMD == MOBILE
//s1g1
//#include "../amdmct/mct/mctardk5.c"
#endif
Hi, we currently have a config variable SYSTEM_TYPE in AMD based boards' romstage.c, which defines if the board is "server", "desktop" or "mobile". Among other things, the AMD code expects "server" to do ECC. I broke that out to Kconfig, but extended the categories to the ACPI set (which the OS can use for tuning the power management profile accordingly). Now, it's declared in Kconfig with ACPI categories (which provides a couple more values, like "SOHO Server" and "Performance Server"), and based on these, the AMD value is chosen. The Kconfig selection is also used to set the preferred PM profile in ACPI (on the modified boards only for now). The upside of this approach is that we only set the board type once, and have it trickle down to whoever cares for it - so consistency is implicitely ensured through the build system. We also won't have to worry about this field should we ever get to the point that the fadt is handled by unified code instead of per-board code (and I hope we'll get there eventually). The downside is that some things can't be modelled quite right (eg. one AMD board was marked "server" for the AMD code, but "workstation" for ACPI - I made that a "SOHO Server" instead in this patch). If this patch is accepted, I'd build another patch that adapts those boards which provide an FADT (which contains the PM profile field) to this new config option. All others are of "unspecified" type by default if they're ever made ACPI aware. Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>