From 5760e197b3cfc5718740bc5aea4861ea521b9e01 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Sun, 26 Jan 2014 11:45:30 +1100 Subject: AGESA boards: Clean up definition of BIOS_SIZE in platform_cfg Clean up vendor code from hard coded #define if-def chain with a pre-processor shift and subtract. Change-Id: Ibce34ab576d7db8586a6ec8f9b2460268e0e1878 Signed-off-by: Edward O'Callaghan Reviewed-on: http://review.coreboot.org/4811 Reviewed-by: Alexandru Gagniuc Tested-by: build bot (Jenkins) --- src/mainboard/amd/torpedo/platform_cfg.h | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'src/mainboard/amd/torpedo') diff --git a/src/mainboard/amd/torpedo/platform_cfg.h b/src/mainboard/amd/torpedo/platform_cfg.h index 8ecb09c11d..bc69938ff9 100644 --- a/src/mainboard/amd/torpedo/platform_cfg.h +++ b/src/mainboard/amd/torpedo/platform_cfg.h @@ -25,29 +25,15 @@ /** - * @section BIOSSize BIOSSize - * @li 0 - 1M - * @li 1 - 2M - * @li 3 - 4M - * @li 7 - 8M - * In Hudson-2, default ROM size is 1M Bytes, if your platform - * ROM bigger then 1M you have to set the ROM size outside CIMx - * module and before AGESA module get call. - */ -#define BIOS_SIZE_1M 0 -#define BIOS_SIZE_2M 1 -#define BIOS_SIZE_4M 3 -#define BIOS_SIZE_8M 7 - -#if CONFIG_COREBOOT_ROMSIZE_KB_1024 - #define BIOS_SIZE BIOS_SIZE_1M -#elif CONFIG_COREBOOT_ROMSIZE_KB_2048 == 1 - #define BIOS_SIZE BIOS_SIZE_2M -#elif CONFIG_COREBOOT_ROMSIZE_KB_4096 == 1 - #define BIOS_SIZE BIOS_SIZE_4M -#elif CONFIG_COREBOOT_ROMSIZE_KB_8192 == 1 - #define BIOS_SIZE BIOS_SIZE_8M -#endif + * @def BIOS_SIZE -> BIOS_SIZE_{1,2,4,8,16}M + * + * In Hudson-2, default ROM size is 1M Bytes, if your platform ROM + * bigger than 1M you have to set the ROM size outside CIMx module and + * before AGESA module get call. + */ +#ifndef BIOS_SIZE +#define BIOS_SIZE ((CONFIG_COREBOOT_ROMSIZE_KB >> 10) - 1) +#endif /* BIOS_SIZE */ /** * @section SBCIMx_LEGACY_FREE SBCIMx_LEGACY_FREE -- cgit v1.2.3