Alexandru Gagniuc (mr.nuke.me@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5412
-gerrit
commit 845951a6642b5cbd94e07def6363bd84793aeeb5 Author: Alexandru Gagniuc mr.nuke.me@gmail.com Date: Fri Mar 28 14:48:13 2014 -0500
hp/pavilion_m6_1035dx: Sanitize #includes
There were a number of things wrong with the includes. First, The includes did not use paths to AGESA files, thus relying on the compiler include paths to find the correct file. This made it unclear where the file included was located, and whether it was local, under vendorcode, or under a different directory. Instead, use full paths for each non-local include.
Second, the local includes were mixed with the rest, making it unclear which file is local and which one is not. Keep the local includes at the top. This also prevents us from polluting the namespace of local headers, with library definitions, and allows us to catch if we missed an otherwise needed external header.
Thirdly, alphabetize the order of includes where possible.
Change-Id: I22c543291beabb83c16d912ea0a490be6ca4e03c Signed-off-by: Alexandru Gagniuc mr.nuke.me@gmail.com --- src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.c | 12 ++++------ .../hp/pavilion_m6_1035dx/PlatformGnbPcie.c | 7 ++---- .../hp/pavilion_m6_1035dx/PlatformGnbPcieComplex.h | 5 ++-- src/mainboard/hp/pavilion_m6_1035dx/acpi_tables.c | 13 ++++------ src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c | 28 ++++++++-------------- src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h | 3 +-- src/mainboard/hp/pavilion_m6_1035dx/buildOpts.c | 5 ++-- src/mainboard/hp/pavilion_m6_1035dx/get_bus_conf.c | 11 ++++----- src/mainboard/hp/pavilion_m6_1035dx/irq_tables.c | 5 ++-- src/mainboard/hp/pavilion_m6_1035dx/mainboard.c | 14 +++++------ src/mainboard/hp/pavilion_m6_1035dx/mptable.c | 14 +++++------ src/mainboard/hp/pavilion_m6_1035dx/romstage.c | 28 +++++++++++----------- 12 files changed, 61 insertions(+), 84 deletions(-)
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.c b/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.c index 110c2c8..34e688d 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/BiosCallOuts.c @@ -18,16 +18,12 @@ */
#include "agesawrapper.h" -#include "amdlib.h" #include "BiosCallOuts.h" -#include "Ids.h" #include "OptionsIds.h" -#include "heapManager.h" -#include "FchPlatform.h" -#include "cbfs.h" -#if IS_ENABLED(CONFIG_HUDSON_IMC_FWM) -#include "imc.h" -#endif + +#include <cbfs.h> +#include <southbridge/amd/agesa/hudson/imc.h> +#include <vendorcode/amd/agesa/f15tn/Proc/Fch/FchPlatform.h>
STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] = { diff --git a/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcie.c b/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcie.c index 784f6d9..de046ac 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcie.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcie.c @@ -17,12 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include "AGESA.h" -#include "amdlib.h" -#include "Ids.h" -#include "heapManager.h" #include "PlatformGnbPcieComplex.h" -#include "Filecode.h" + +#include <vendorcode/amd/agesa/f15tn/Proc/CPU/heapManager.h>
#define FILECODE PROC_GNB_PCIE_FAMILY_0X15_F15PCIECOMPLEXCONFIG_FILECODE
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcieComplex.h b/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcieComplex.h index b3c69cf..add9008 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcieComplex.h +++ b/src/mainboard/hp/pavilion_m6_1035dx/PlatformGnbPcieComplex.h @@ -20,9 +20,8 @@ #ifndef _PLATFORM_GNB_PCIE_COMPLEX_H #define _PLATFORM_GNB_PCIE_COMPLEX_H
-#include "Porting.h" -#include "AGESA.h" -#include "amdlib.h" +#include <vendorcode/amd/agesa/f15tn/AGESA.h> +#include <vendorcode/amd/agesa/f15tn/Lib/amdlib.h>
VOID OemCustomizeInitEarly ( diff --git a/src/mainboard/hp/pavilion_m6_1035dx/acpi_tables.c b/src/mainboard/hp/pavilion_m6_1035dx/acpi_tables.c index d93fecc..1c1d94b 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/acpi_tables.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/acpi_tables.c @@ -17,19 +17,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <console/console.h> -#include <string.h> +#include "agesawrapper.h" + #include <arch/acpi.h> #include <arch/acpigen.h> #include <arch/ioapic.h> +#include <cpu/amd/amdfam15.h> +#include <console/console.h> #include <device/pci.h> #include <device/pci_ids.h> -#include <cpu/x86/msr.h> -#include "agesawrapper.h" -#include <cpu/amd/mtrr.h> -#include <cpu/amd/amdfam15.h> - -#include "agesawrapper.h" +#include <string.h>
#define DUMP_ACPI_TABLES 0
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c index 827ce6d..a89ddbe 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c @@ -22,30 +22,22 @@ *---------------------------------------------------------------------------------------- */
-#include <stdint.h> -#include <string.h> -#include <cpu/x86/mtrr.h> #include "agesawrapper.h" #include "BiosCallOuts.h" -#include "cpuRegisters.h" -#include "cpuCacheInit.h" -#include "cpuApicUtilities.h" -#include "cpuEarlyInit.h" -#include "cpuLateInit.h" -#include "Dispatcher.h" -#include "cpuCacheInit.h" -#include "amdlib.h" #include "PlatformGnbPcieComplex.h" -#include "Filecode.h" -#include "heapManager.h" -#include "FchPlatform.h" -#include "Fch.h" -#include <cpu/amd/agesa/s3_resume.h> -#include <cbmem.h> + #include <arch/acpi.h> #include <arch/io.h> +#include <cbmem.h> +#include <cpu/x86/mtrr.h> #include <device/device.h> -#include "hudson.h" +#include <string.h> +#include <stdint.h> + +#include <cpu/amd/agesa/s3_resume.h> +#include <southbridge/amd/agesa/hudson/hudson.h> +#include <vendorcode/amd/agesa/f15tn/Proc/Fch/FchPlatform.h> +#include <vendorcode/amd/agesa/f15tn/Proc/CPU/heapManager.h>
VOID FchInitS3LateRestore (IN FCH_DATA_BLOCK *FchDataPtr); VOID FchInitS3EarlyRestore (IN FCH_DATA_BLOCK *FchDataPtr); diff --git a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h index 5007510..29eedaf 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h +++ b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h @@ -26,8 +26,7 @@ #define _AGESAWRAPPER_H_
#include <stdint.h> -#include "Porting.h" -#include "AGESA.h" +#include <vendorcode/amd/agesa/f15tn/AGESA.h>
/*---------------------------------------------------------------------------------------- * D E F I N I T I O N S A N D M A C R O S diff --git a/src/mainboard/hp/pavilion_m6_1035dx/buildOpts.c b/src/mainboard/hp/pavilion_m6_1035dx/buildOpts.c index 1a23190..d5dfe30 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/buildOpts.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/buildOpts.c @@ -33,9 +33,8 @@ * @e $Revision: 23714 $ @e $Date: 2009-12-09 17:28:37 -0600 (Wed, 09 Dec 2009) $ */
-#include "AGESA.h" -//#include "CommonReturns.h" -#include "Filecode.h" +#include <vendorcode/amd/agesa/f15tn/AGESA.h> + #define FILECODE PLATFORM_SPECIFIC_OPTIONS_FILECODE
/* Select the cpu family. */ diff --git a/src/mainboard/hp/pavilion_m6_1035dx/get_bus_conf.c b/src/mainboard/hp/pavilion_m6_1035dx/get_bus_conf.c index bf76fe2..79a5380 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/get_bus_conf.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/get_bus_conf.c @@ -17,17 +17,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include "agesawrapper.h" + #include <console/console.h> +#include <cpu/amd/amdfam15.h> #include <device/pci.h> #include <device/pci_ids.h> -#include <string.h> #include <stdint.h> #include <stdlib.h> -#include <cpu/amd/amdfam14.h> -#include "agesawrapper.h" -#if IS_ENABLED(CONFIG_HUDSON_IMC_FWM) -#include "imc.h" -#endif +#include <string.h> +#include <southbridge/amd/agesa/hudson/imc.h>
/* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. diff --git a/src/mainboard/hp/pavilion_m6_1035dx/irq_tables.c b/src/mainboard/hp/pavilion_m6_1035dx/irq_tables.c index d5339ad..dfa5d8f 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/irq_tables.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/irq_tables.c @@ -17,12 +17,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include <arch/pirq_routing.h> +#include <cpu/amd/amdfam15.h> #include <console/console.h> -#include <device/pci.h> #include <string.h> #include <stdint.h> -#include <arch/pirq_routing.h> -#include <cpu/amd/amdfam15.h>
static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, u8 link0, u16 bitmap0, u8 link1, u16 bitmap1, diff --git a/src/mainboard/hp/pavilion_m6_1035dx/mainboard.c b/src/mainboard/hp/pavilion_m6_1035dx/mainboard.c index f41d010..5ac478f 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/mainboard.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/mainboard.c @@ -17,17 +17,17 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include "agesawrapper.h" +#include "BiosCallOuts.h" + +#include <arch/acpi.h> +#include <arch/io.h> #include <console/console.h> +#include <cpu/x86/msr.h> +#include <cpu/amd/agesa/s3_resume.h> #include <device/device.h> #include <device/pci.h> -#include <arch/io.h> -#include <cpu/x86/msr.h> -#include "BiosCallOuts.h" -#include <cpu/amd/mtrr.h> #include <device/pci_def.h> -#include <arch/acpi.h> -#include <cpu/amd/agesa/s3_resume.h> -#include "agesawrapper.h"
/************************************************* * enable the dedicated function in parmer board. diff --git a/src/mainboard/hp/pavilion_m6_1035dx/mptable.c b/src/mainboard/hp/pavilion_m6_1035dx/mptable.c index d106697..8d42fff 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/mptable.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/mptable.c @@ -17,16 +17,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <console/console.h> -#include <arch/smp/mpspec.h> -#include <device/pci.h> +#include <arch/cpu.h> #include <arch/io.h> -#include <string.h> -#include <stdint.h> +#include <arch/smp/mpspec.h> +#include <console/console.h> #include <cpu/amd/amdfam15.h> -#include <arch/cpu.h> #include <cpu/x86/lapic.h> -#include "southbridge/amd/agesa/hudson/hudson.h" /* pm_ioread() */ +#include <device/pci.h> +#include <stdint.h> +#include <string.h> +#include <southbridge/amd/agesa/hudson/hudson.h> /* pm_ioread() */
//-#define IO_APIC_ID CONFIG_MAX_PHYSICAL_CPUS + 1 #define IO_APIC_ID CONFIG_MAX_CPUS diff --git a/src/mainboard/hp/pavilion_m6_1035dx/romstage.c b/src/mainboard/hp/pavilion_m6_1035dx/romstage.c index 202442c..dd19679 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/romstage.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/romstage.c @@ -17,25 +17,25 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdint.h> -#include <string.h> -#include <device/pci_def.h> -#include <device/pci_ids.h> +#include "agesawrapper.h" + +#include <arch/cpu.h> #include <arch/io.h> #include <arch/stages.h> -#include <device/pnp_def.h> -#include <arch/cpu.h> -#include <cpu/x86/lapic.h> +#include <cbmem.h> #include <console/console.h> -#include <console/loglevel.h> -#include "agesawrapper.h" -#include "cpu/x86/bist.h" -#include "cpu/x86/lapic.h" -#include "southbridge/amd/agesa/hudson/hudson.h" -#include "cpu/amd/agesa/s3_resume.h" +#include <cpu/amd/agesa/s3_resume.h> +#include <cpu/x86/bist.h> +#include <cpu/x86/lapic.h> +#include <device/pci_def.h> +#include <device/pci_ids.h> +#include <stdint.h> +#include <string.h> +#include <southbridge/amd/agesa/hudson/hudson.h> + #include "src/drivers/pc80/i8254.c" #include "src/drivers/pc80/i8259.c" -#include "cbmem.h" +
void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx); void disable_cache_as_ram(void);