Patchwork Move cpu includes to cpus

login
register
about
Submitter Patrick Georgi
Date 2010-04-12 14:16:30
Message ID <4BC32B3E.1020901@georgi-clan.de>
Download mbox | patch
Permalink /patch/1227/
State Accepted
Headers show

Comments

Patrick Georgi - 2010-04-12 14:16:30
Hi,

attached patch moves the CPU specific includes from
src/arch/i386/Makefile.inc to the respective CPU directories.
One exception is the tyan/s2735 rule, as this is a weird situation: CAR
code for exactly one board. As soon as sibling boards are identified and
CAR enabled, it would make sense to move that include out as well. For
now, for the increased visibility (and because I'm a bit puzzled where a
good location for that file would be), I left it there.

The cpu/x86/car/cache_as_ram.lds is useless, so deleting it is also part
of this change (not tracked in this patch)

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Stefan Reinauer - 2010-04-12 15:18:43
>
> Hi,
>
> attached patch moves the CPU specific includes from
> src/arch/i386/Makefile.inc to the respective CPU directories.
>   
Very nice.. this will make using CAR easier, and the code flow easier to
understand
> One exception is the tyan/s2735 rule, as this is a weird situation: CAR
> code for exactly one board. As soon as sibling boards are identified and
> CAR enabled, it would make sense to move that include out as well. 
These boards have the same CPU socket, thus should be able to use CAR:

./src/mainboard/dell/s1850/Kconfig: select CPU_INTEL_SOCKET_MPGA604
./src/mainboard/intel/jarrell/Kconfig: select CPU_INTEL_SOCKET_MPGA604
./src/mainboard/intel/xe7501devkit/Kconfig: select CPU_INTEL_SOCKET_MPGA604
./src/mainboard/supermicro/x6dai_g/Kconfig: select CPU_INTEL_SOCKET_MPGA604
./src/mainboard/supermicro/x6dhe_g/Kconfig: select CPU_INTEL_SOCKET_MPGA604
./src/mainboard/supermicro/x6dhe_g2/Kconfig: select CPU_INTEL_SOCKET_MPGA604
./src/mainboard/supermicro/x6dhr_ig/Kconfig: select CPU_INTEL_SOCKET_MPGA604
./src/mainboard/supermicro/x6dhr_ig2/Kconfig: select
CPU_INTEL_SOCKET_MPGA604
./src/mainboard/tyan/s2735/Kconfig: select CPU_INTEL_SOCKET_MPGA604

I'm glad to provide a patch to convert these boards to CAE, if it can be
tested on at least one of them. So if you have a board in this list,
speak up!
Having 9 more boards use CAR would be really nice to have.

> For
> now, for the increased visibility (and because I'm a bit puzzled where a
> good location for that file would be), I left it there.
>   
Please put a big and fat "FIXME move to CPU_INTEL_SOCKET_MPGA604
instead" there.
> The cpu/x86/car/cache_as_ram.lds is useless, so deleting it is also part
> of this change (not tracked in this patch)
>
> Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
>   
Acked-by: Stefan Reinauer <stepan@coresystems.de>
Patrick Georgi - 2010-04-12 15:27:30
Am 12.04.2010 17:18, schrieb Stefan Reinauer:
> These boards have the same CPU socket, thus should be able to use CAR:
> 
> ./src/mainboard/dell/s1850/Kconfig: select CPU_INTEL_SOCKET_MPGA604
> ./src/mainboard/intel/jarrell/Kconfig: select CPU_INTEL_SOCKET_MPGA604
> ./src/mainboard/intel/xe7501devkit/Kconfig: select CPU_INTEL_SOCKET_MPGA604
> ./src/mainboard/supermicro/x6dai_g/Kconfig: select CPU_INTEL_SOCKET_MPGA604
> ./src/mainboard/supermicro/x6dhe_g/Kconfig: select CPU_INTEL_SOCKET_MPGA604
> ./src/mainboard/supermicro/x6dhe_g2/Kconfig: select CPU_INTEL_SOCKET_MPGA604
> ./src/mainboard/supermicro/x6dhr_ig/Kconfig: select CPU_INTEL_SOCKET_MPGA604
> ./src/mainboard/supermicro/x6dhr_ig2/Kconfig: select
> CPU_INTEL_SOCKET_MPGA604
> ./src/mainboard/tyan/s2735/Kconfig: select CPU_INTEL_SOCKET_MPGA604
> 
> I'm glad to provide a patch to convert these boards to CAE, if it can be
> tested on at least one of them. So if you have a board in this list,
> speak up!
> Having 9 more boards use CAR would be really nice to have.
If/When you do, please also move src/cpu/x86/car to something more
reasonable. It is _not_ generic x86 CAR.
Stefan Reinauer - 2010-04-12 15:42:17
>
> Am 12.04.2010 17:18, schrieb Stefan Reinauer:
>   
>> These boards have the same CPU socket, thus should be able to use CAR:
>>
>> ./src/mainboard/dell/s1850/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>> ./src/mainboard/intel/jarrell/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>> ./src/mainboard/intel/xe7501devkit/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>> ./src/mainboard/supermicro/x6dai_g/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>> ./src/mainboard/supermicro/x6dhe_g/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>> ./src/mainboard/supermicro/x6dhe_g2/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>> ./src/mainboard/supermicro/x6dhr_ig/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>> ./src/mainboard/supermicro/x6dhr_ig2/Kconfig: select
>> CPU_INTEL_SOCKET_MPGA604
>> ./src/mainboard/tyan/s2735/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>>
>> I'm glad to provide a patch to convert these boards to CAE, if it can be
>> tested on at least one of them. So if you have a board in this list,
>> speak up!
>> Having 9 more boards use CAR would be really nice to have.
>>     
> If/When you do, please also move src/cpu/x86/car to something more
> reasonable. It is _not_ generic x86 CAR.
>
>   
since we have amd/car and via/car (both not being amd generic, or via
generic), would intel/car be a reasonable place (for now?)

Stefan
Joseph Smith - 2010-04-12 19:46:14
On 04/12/2010 10:16 AM, Patrick Georgi wrote:
> Hi,
>
> attached patch moves the CPU specific includes from
> src/arch/i386/Makefile.inc to the respective CPU directories.
> One exception is the tyan/s2735 rule, as this is a weird situation:

Yes it is. I think it was just coverted over from v1 this way. I also 
think most of the CAR code embedded in it's romstage.c could be moved to 
a cache_as_ram_disable.c thus eliminating the weirdness. But we would 
need someone with the board to test it. I would be glad to whip up a 
patch if there is anyone out there willing to test?


By the way Nice job Patrick, moving all this to cpu, makes life easier :-)
Joseph Smith - 2010-04-12 19:52:24
On 04/12/2010 11:42 AM, Stefan Reinauer wrote:
>>
>> Am 12.04.2010 17:18, schrieb Stefan Reinauer:
>>
>>> These boards have the same CPU socket, thus should be able to use CAR:
>>>
>>> ./src/mainboard/dell/s1850/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>>> ./src/mainboard/intel/jarrell/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>>> ./src/mainboard/intel/xe7501devkit/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>>> ./src/mainboard/supermicro/x6dai_g/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>>> ./src/mainboard/supermicro/x6dhe_g/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>>> ./src/mainboard/supermicro/x6dhe_g2/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>>> ./src/mainboard/supermicro/x6dhr_ig/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>>> ./src/mainboard/supermicro/x6dhr_ig2/Kconfig: select
>>> CPU_INTEL_SOCKET_MPGA604
>>> ./src/mainboard/tyan/s2735/Kconfig: select CPU_INTEL_SOCKET_MPGA604
>>>
>>> I'm glad to provide a patch to convert these boards to CAE, if it can be
>>> tested on at least one of them. So if you have a board in this list,
>>> speak up!
>>> Having 9 more boards use CAR would be really nice to have.
>>>
>> If/When you do, please also move src/cpu/x86/car to something more
>> reasonable. It is _not_ generic x86 CAR.
>>
>>
> since we have amd/car and via/car (both not being amd generic, or via
> generic), would intel/car be a reasonable place (for now?)
>
Is there any other brands that use src/cpu/x86/car or just intel? If 
just intel then I say yes to intel/car.

Patch

Index: src/cpu/via/model_c7/Makefile.inc
===================================================================
--- src/cpu/via/model_c7/Makefile.inc	(revision 5408)
+++ src/cpu/via/model_c7/Makefile.inc	(working copy)
@@ -6,3 +6,5 @@ 
 subdirs-y += ../../intel/microcode
 
 driver-y += model_c7_init.o
+
+cpu_incs += $(src)/cpu/via/car/cache_as_ram.inc
Index: src/cpu/amd/model_gx1/Makefile.inc
===================================================================
--- src/cpu/amd/model_gx1/Makefile.inc	(revision 5408)
+++ src/cpu/amd/model_gx1/Makefile.inc	(working copy)
@@ -23,3 +23,6 @@ 
 subdirs-y += ../../x86/cache
 subdirs-y += ../../x86/smm
 driver-y += model_gx1_init.o
+
+cpu_incs += $(src)/cpu/amd/model_gx1/cpu_setup.inc
+cpu_incs += $(src)/cpu/amd/model_gx1/gx_setup.inc
Index: src/cpu/amd/socket_S1G1/Makefile.inc
===================================================================
--- src/cpu/amd/socket_S1G1/Makefile.inc	(revision 5408)
+++ src/cpu/amd/socket_S1G1/Makefile.inc	(working copy)
@@ -10,3 +10,4 @@ 
 subdirs-y += ../../x86/smm
 subdirs-y += ../../x86/mtrr
 
+cpu_incs += $(src)/cpu/amd/car/cache_as_ram.inc
Index: src/cpu/amd/socket_940/Makefile.inc
===================================================================
--- src/cpu/amd/socket_940/Makefile.inc	(revision 5408)
+++ src/cpu/amd/socket_940/Makefile.inc	(working copy)
@@ -8,3 +8,5 @@ 
 subdirs-y += ../../x86/cache
 subdirs-y += ../../x86/mtrr
 subdirs-y += ../../x86/pae
+
+cpu_incs += $(src)/cpu/amd/car/cache_as_ram.inc
Index: src/cpu/amd/socket_AM2/Makefile.inc
===================================================================
--- src/cpu/amd/socket_AM2/Makefile.inc	(revision 5408)
+++ src/cpu/amd/socket_AM2/Makefile.inc	(working copy)
@@ -9,3 +9,5 @@ 
 subdirs-y += ../../x86/mtrr
 subdirs-y += ../../x86/pae
 subdirs-y += ../../x86/smm
+
+cpu_incs += $(src)/cpu/amd/car/cache_as_ram.inc
Index: src/cpu/amd/socket_754/Makefile.inc
===================================================================
--- src/cpu/amd/socket_754/Makefile.inc	(revision 5408)
+++ src/cpu/amd/socket_754/Makefile.inc	(working copy)
@@ -8,3 +8,5 @@ 
 subdirs-y += ../../x86/cache
 subdirs-y += ../../x86/mtrr
 subdirs-y += ../../x86/pae
+
+cpu_incs += $(src)/cpu/amd/car/cache_as_ram.inc
Index: src/cpu/amd/socket_AM2r2/Makefile.inc
===================================================================
--- src/cpu/amd/socket_AM2r2/Makefile.inc	(revision 5408)
+++ src/cpu/amd/socket_AM2r2/Makefile.inc	(working copy)
@@ -9,3 +9,5 @@ 
 subdirs-y += ../../x86/pae
 subdirs-y += ../../x86/smm
 subdirs-y += ../../x86/mtrr
+
+cpu_incs += $(src)/cpu/amd/car/cache_as_ram.inc
Index: src/cpu/amd/socket_939/Makefile.inc
===================================================================
--- src/cpu/amd/socket_939/Makefile.inc	(revision 5408)
+++ src/cpu/amd/socket_939/Makefile.inc	(working copy)
@@ -8,3 +8,5 @@ 
 subdirs-y += ../../x86/cache
 subdirs-y += ../../x86/mtrr
 subdirs-y += ../../x86/pae
+
+cpu_incs += $(src)/cpu/amd/car/cache_as_ram.inc
Index: src/cpu/amd/socket_F/Makefile.inc
===================================================================
--- src/cpu/amd/socket_F/Makefile.inc	(revision 5408)
+++ src/cpu/amd/socket_F/Makefile.inc	(working copy)
@@ -9,3 +9,5 @@ 
 subdirs-y += ../../x86/mtrr
 subdirs-y += ../../x86/pae
 subdirs-y += ../../x86/smm
+
+cpu_incs += $(src)/cpu/amd/car/cache_as_ram.inc
Index: src/cpu/amd/model_lx/Makefile.inc
===================================================================
--- src/cpu/amd/model_lx/Makefile.inc	(revision 5408)
+++ src/cpu/amd/model_lx/Makefile.inc	(working copy)
@@ -6,3 +6,5 @@ 
 driver-y += model_lx_init.o
 obj-y += cpubug.o
 obj-y += vsmsetup.o
+
+cpu_incs += $(src)/cpu/amd/model_lx/cache_as_ram.inc
Index: src/cpu/amd/socket_F_1207/Makefile.inc
===================================================================
--- src/cpu/amd/socket_F_1207/Makefile.inc	(revision 5408)
+++ src/cpu/amd/socket_F_1207/Makefile.inc	(working copy)
@@ -9,3 +9,5 @@ 
 subdirs-y += ../../x86/mtrr
 subdirs-y += ../../x86/pae
 subdirs-y += ../../x86/smm
+
+cpu_incs += $(src)/cpu/amd/car/cache_as_ram.inc
Index: src/cpu/intel/model_6ex/Makefile.inc
===================================================================
--- src/cpu/intel/model_6ex/Makefile.inc	(revision 5408)
+++ src/cpu/intel/model_6ex/Makefile.inc	(working copy)
@@ -1 +1,3 @@ 
 driver-y += model_6ex_init.o
+
+cpu_incs += $(src)/cpu/intel/model_6ex/cache_as_ram.inc
Index: src/cpu/intel/socket_mFCBGA479/Makefile.inc
===================================================================
--- src/cpu/intel/socket_mFCBGA479/Makefile.inc	(revision 5408)
+++ src/cpu/intel/socket_mFCBGA479/Makefile.inc	(working copy)
@@ -6,3 +6,5 @@ 
 subdirs-y += ../../x86/cache
 subdirs-y += ../../x86/smm
 subdirs-y += ../microcode
+
+cpu_incs += $(src)/cpu/x86/car/cache_as_ram.inc
Index: src/cpu/intel/bga956/Makefile.inc
===================================================================
--- src/cpu/intel/bga956/Makefile.inc	(revision 5408)
+++ src/cpu/intel/bga956/Makefile.inc	(working copy)
@@ -8,3 +8,5 @@ 
 subdirs-y += ../microcode
 subdirs-y += ../hyperthreading
 
+# Use Intel Core (not Core 2) code for CAR init, any CPU might be used.
+cpu_incs += $(src)/cpu/intel/model_6ex/cache_as_ram.inc
Index: src/cpu/intel/model_106cx/Makefile.inc
===================================================================
--- src/cpu/intel/model_106cx/Makefile.inc	(revision 5408)
+++ src/cpu/intel/model_106cx/Makefile.inc	(working copy)
@@ -1 +1,3 @@ 
 driver-y += model_106cx_init.o
+
+cpu_incs += $(src)/cpu/intel/model_106cx/cache_as_ram.inc
Index: src/arch/i386/Makefile.inc
===================================================================
--- src/arch/i386/Makefile.inc	(revision 5408)
+++ src/arch/i386/Makefile.inc	(working copy)
@@ -117,61 +117,15 @@ 
 endif
 
 crt0s += $(src)/cpu/x86/fpu_enable.inc
-ifeq ($(CONFIG_CPU_AMD_GX1),y)
-crt0s += $(src)/cpu/amd/model_gx1/cpu_setup.inc
-crt0s += $(src)/cpu/amd/model_gx1/gx_setup.inc
-endif
 ifeq ($(CONFIG_SSE),y)
 crt0s += $(src)/cpu/x86/sse_enable.inc
 endif
 
-ifeq ($(CONFIG_CPU_AMD_LX),y)
-crt0s += $(src)/cpu/amd/model_lx/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_AMD_SOCKET_F),y)
-crt0s += $(src)/cpu/amd/car/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_AMD_SOCKET_F_1207),y)
-crt0s += $(src)/cpu/amd/car/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_AMD_SOCKET_AM2R2),y)
-crt0s += $(src)/cpu/amd/car/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_AMD_SOCKET_AM2),y)
-crt0s += $(src)/cpu/amd/car/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_AMD_SOCKET_S1G1),y)
-crt0s += $(src)/cpu/amd/car/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_AMD_SOCKET_754),y)
-crt0s += $(src)/cpu/amd/car/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_AMD_SOCKET_939),y)
-crt0s += $(src)/cpu/amd/car/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_AMD_SOCKET_940),y)
-crt0s += $(src)/cpu/amd/car/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_INTEL_ATOM_230),y)
-crt0s += $(src)/cpu/intel/model_106cx/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_INTEL_CORE),y)
-crt0s += $(src)/cpu/intel/model_6ex/cache_as_ram.inc
-endif
-# Use Intel Core (not Core 2) code for CAR init, any CPU might be used.
-ifeq ($(CONFIG_CPU_INTEL_SOCKET_BGA956),y)
-crt0s += $(src)/cpu/intel/model_6ex/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_INTEL_SOCKET_MFCBGA479),y)
-crt0s += $(src)/cpu/x86/car/cache_as_ram.inc
-endif
-ifeq ($(CONFIG_CPU_VIA_C7),y)
-crt0s += $(src)/cpu/via/car/cache_as_ram.inc
-endif
+crt0s += $(cpu_incs)
+
 # who else could use this?
 ifeq ($(CONFIG_BOARD_TYAN_S2735),y)
 crt0s += $(src)/cpu/x86/car/cache_as_ram.inc
-ldscripts += $(src)/cpu/x86/car/cache_as_ram.lds
 endif
 
 ifeq ($(CONFIG_LLSHELL),y)