Use DIMM0 et al in lots more places instead of hardocding values.
authorUwe Hermann <uwe@hermann-uwe.de>
Sun, 21 Nov 2010 11:36:03 +0000 (11:36 +0000)
committerUwe Hermann <uwe@hermann-uwe.de>
Sun, 21 Nov 2010 11:36:03 +0000 (11:36 +0000)
The (0xa << 3) expression equals 0x50, i.e. DIMM0.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6103 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

66 files changed:
src/mainboard/amd/db800/romstage.c
src/mainboard/amd/norwich/romstage.c
src/mainboard/amd/rumba/romstage.c
src/mainboard/arima/hdama/romstage.c
src/mainboard/artecgroup/dbe61/romstage.c
src/mainboard/asus/a8n_e/romstage.c
src/mainboard/asus/a8v-e_deluxe/romstage.c
src/mainboard/asus/a8v-e_se/romstage.c
src/mainboard/asus/m2v-mx_se/romstage.c
src/mainboard/asus/m2v/romstage.c
src/mainboard/bcom/winnetp680/romstage.c
src/mainboard/dell/s1850/romstage.c
src/mainboard/digitallogic/adl855pc/romstage.c
src/mainboard/digitallogic/msm800sev/romstage.c
src/mainboard/gigabyte/ga_2761gxdk/romstage.c
src/mainboard/gigabyte/m57sli/romstage.c
src/mainboard/hp/dl145_g3/romstage.c
src/mainboard/ibm/e325/romstage.c
src/mainboard/ibm/e326/romstage.c
src/mainboard/iei/pcisa-lx-800-r10/romstage.c
src/mainboard/intel/eagleheights/romstage.c
src/mainboard/intel/jarrell/romstage.c
src/mainboard/intel/mtarvon/romstage.c
src/mainboard/intel/truxton/romstage.c
src/mainboard/intel/xe7501devkit/romstage.c
src/mainboard/jetway/j7f24/romstage.c
src/mainboard/lanner/em8510/romstage.c
src/mainboard/lippert/frontrunner/romstage.c
src/mainboard/lippert/hurricane-lx/romstage.c
src/mainboard/lippert/literunner-lx/romstage.c
src/mainboard/lippert/roadrunner-lx/romstage.c
src/mainboard/lippert/spacerunner-lx/romstage.c
src/mainboard/msi/ms7135/romstage.c
src/mainboard/msi/ms7260/romstage.c
src/mainboard/msi/ms9185/romstage.c
src/mainboard/msi/ms9282/romstage.c
src/mainboard/newisys/khepri/romstage.c
src/mainboard/nvidia/l1_2pvv/romstage.c
src/mainboard/pcengines/alix1c/romstage.c
src/mainboard/pcengines/alix2d/romstage.c
src/mainboard/sunw/ultra40/romstage.c
src/mainboard/supermicro/h8dme/romstage.c
src/mainboard/supermicro/h8dmr/romstage.c
src/mainboard/supermicro/x6dai_g/romstage.c
src/mainboard/supermicro/x6dhe_g/romstage.c
src/mainboard/supermicro/x6dhe_g2/romstage.c
src/mainboard/supermicro/x6dhr_ig/romstage.c
src/mainboard/supermicro/x6dhr_ig2/romstage.c
src/mainboard/traverse/geos/romstage.c
src/mainboard/tyan/s2735/romstage.c
src/mainboard/tyan/s2850/romstage.c
src/mainboard/tyan/s2875/romstage.c
src/mainboard/tyan/s2880/romstage.c
src/mainboard/tyan/s2881/romstage.c
src/mainboard/tyan/s2882/romstage.c
src/mainboard/tyan/s2885/romstage.c
src/mainboard/tyan/s2891/romstage.c
src/mainboard/tyan/s2892/romstage.c
src/mainboard/tyan/s2895/romstage.c
src/mainboard/tyan/s2912/romstage.c
src/mainboard/via/epia-cn/romstage.c
src/mainboard/via/epia-n/romstage.c
src/mainboard/via/pc2500e/romstage.c
src/mainboard/via/vt8454c/romstage.c
src/mainboard/winent/pl6064/romstage.c
src/mainboard/wyse/s50/romstage.c

index 8977b27bd42fa146528907bdc10629e7cbd25fbf..c1909c1ecbb2eda8923fbab215dd1c9175987b33 100644 (file)
@@ -65,7 +65,7 @@ void main(unsigned long bist)
        post_code(0x01);
 
        static const struct mem_controller memctrl[] = {
-               {.channel0 = {(0xa << 3) | 0, (0xa << 3) | 1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index 1211610421030da224f3263cce5c41f73e362963..4704cc2fe0acf870f3c0a0a29c7876828f21e0f8 100644 (file)
@@ -62,7 +62,7 @@ void main(unsigned long bist)
        post_code(0x01);
 
        static const struct mem_controller memctrl[] = {
-               {.channel0 = {(0xa << 3) | 0, (0xa << 3) | 1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index e08d967471214e97f3bbaca2c26227a26a1019f1..c7c45ccc58feabf36ea40e37c581c4d6e20cc1ec 100644 (file)
@@ -35,7 +35,7 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 void main(unsigned long bist)
 {
        static const struct mem_controller memctrl [] = {
-               {.channel0 = {(0xa<<3)|0, (0xa<<3)|1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index 7438b8438b6e6b1c12b0496d34e6ffd060754deb..3cc9553d25f0b24818af9708de3eeb813c3f8c1a 100644 (file)
@@ -24,6 +24,7 @@
 #include "cpu/x86/bist.h"
 
 #include "northbridge/amd/amdk8/setup_resource_map.c"
+#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, PC87360_SP1)
 
@@ -85,11 +86,11 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
-               (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-               (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
-               (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-               (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+               DIMM4, DIMM6, 0, 0,
+               DIMM5, DIMM7, 0, 0,
 #endif
        };
 
index 8303b15f4970b16294e9aa52c5d9dc2c9417b0e8..37cb71abd7e4cefd325e6c21106077adf7ae93a8 100644 (file)
@@ -78,7 +78,7 @@ void main(unsigned long bist)
 
        msr_t msr;
        static const struct mem_controller memctrl[] = {
-               {.channel0 = {(0xa << 3) | 0, (0xa << 3) | 1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index b9253aa4c4f9585432e99f6bef411b3f5f6f5791..155f414668272179382d5ead33a03ee3aee878ed 100644 (file)
@@ -48,6 +48,7 @@
 #include "northbridge/amd/amdk8/setup_resource_map.c"
 #include "northbridge/amd/amdk8/coherent_ht.c"
 #include "cpu/amd/dualcore/dualcore.c"
+#include <spd.h>
 
 static void memreset(int controllers, const struct mem_controller *ctrl)
 {
@@ -93,11 +94,11 @@ static void sio_setup(void)
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr[] = {
-               (0xa << 3) | 0, (0xa << 3) | 2, 0, 0,
-               (0xa << 3) | 1, (0xa << 3) | 3, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
-               (0xa << 3) | 4, (0xa << 3) | 6, 0, 0,
-               (0xa << 3) | 5, (0xa << 3) | 7, 0, 0,
+               DIMM4, DIMM6, 0, 0,
+               DIMM5, DIMM7, 0, 0,
 #endif
        };
 
index 1903adc97d13b5e9283ca53046314cab174a3dc1..fbefe34c0e6c09ae6b32741c23c838650d0907c8 100644 (file)
@@ -46,6 +46,7 @@ unsigned int get_sbdn(unsigned bus);
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
 #include "northbridge/amd/amdk8/setup_resource_map.c"
+#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, W83627EHG_SP1)
 #define GPIO_DEV PNP_DEV(0x2e, W83627EHG_GPIO_SUSLED)
@@ -154,11 +155,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr[] = {
                // Node 0
-               (0xa << 3) | 0, (0xa << 3) | 2, 0, 0,
-               (0xa << 3) | 1, (0xa << 3) | 3, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
                // Node 1
-               (0xa << 3) | 4, (0xa << 3) | 6, 0, 0,
-               (0xa << 3) | 5, (0xa << 3) | 7, 0, 0,
+               DIMM4, DIMM6, 0, 0,
+               DIMM5, DIMM7, 0, 0,
        };
        unsigned bsp_apicid = 0;
        int needs_reset = 0;
index 1903adc97d13b5e9283ca53046314cab174a3dc1..fbefe34c0e6c09ae6b32741c23c838650d0907c8 100644 (file)
@@ -46,6 +46,7 @@ unsigned int get_sbdn(unsigned bus);
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
 #include "northbridge/amd/amdk8/setup_resource_map.c"
+#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, W83627EHG_SP1)
 #define GPIO_DEV PNP_DEV(0x2e, W83627EHG_GPIO_SUSLED)
@@ -154,11 +155,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr[] = {
                // Node 0
-               (0xa << 3) | 0, (0xa << 3) | 2, 0, 0,
-               (0xa << 3) | 1, (0xa << 3) | 3, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
                // Node 1
-               (0xa << 3) | 4, (0xa << 3) | 6, 0, 0,
-               (0xa << 3) | 5, (0xa << 3) | 7, 0, 0,
+               DIMM4, DIMM6, 0, 0,
+               DIMM5, DIMM7, 0, 0,
        };
        unsigned bsp_apicid = 0;
        int needs_reset = 0;
index 91a75adfb8bcbcfe53e5a5243830d982447e19cc..e0b61fcbdb07c530318e2c97a034c3e58b553fd1 100644 (file)
@@ -49,6 +49,7 @@ unsigned int get_sbdn(unsigned bus);
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
 #include "northbridge/amd/amdk8/setup_resource_map.c"
+#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, IT8712F_SP1)
 #define WATCHDOG_DEV PNP_DEV(0x2e, IT8712F_GPIO)
@@ -128,11 +129,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr[] = {
                // Node 0
-               (0xa << 3) | 0, (0xa << 3) | 2, 0, 0,
-               (0xa << 3) | 1, (0xa << 3) | 3, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
                // Node 1
-               (0xa << 3) | 4, (0xa << 3) | 6, 0, 0,
-               (0xa << 3) | 5, (0xa << 3) | 7, 0, 0,
+               DIMM4, DIMM6, 0, 0,
+               DIMM5, DIMM7, 0, 0,
        };
        unsigned bsp_apicid = 0;
        int needs_reset = 0;
index 7237568b15caa4de5756aeab2d0463be4c7cade1..d54d2d5efba24cd3518057149b27b5ecefef1011 100644 (file)
@@ -49,6 +49,7 @@ unsigned int get_sbdn(unsigned bus);
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
 #include "northbridge/amd/amdk8/setup_resource_map.c"
+#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, IT8712F_SP1)
 #define WATCHDOG_DEV PNP_DEV(0x2e, IT8712F_GPIO)
@@ -231,11 +232,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr[] = {
                // Node 0
-               (0xa << 3) | 0, (0xa << 3) | 2, 0, 0,
-               (0xa << 3) | 1, (0xa << 3) | 3, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
                // Node 1
-               (0xa << 3) | 4, (0xa << 3) | 6, 0, 0,
-               (0xa << 3) | 5, (0xa << 3) | 7, 0, 0,
+               DIMM4, DIMM6, 0, 0,
+               DIMM5, DIMM7, 0, 0,
        };
        unsigned bsp_apicid = 0;
        int needs_reset = 0;
index 0d8746bcfc88eaddfc7f9e87c43ad0ef4af5ccda..32654d8ab3ebbe1a6c4d3a791727902c47198f6b 100644 (file)
@@ -32,6 +32,7 @@
 #include "pc80/udelay_io.c"
 #include "lib/delay.c"
 #include <lib.h>
+#include <spd.h>
 #include "southbridge/via/vt8237r/vt8237r_early_smbus.c"
 #include "superio/winbond/w83697hf/w83697hf_early_serial.c"
 #define SERIAL_DEV PNP_DEV(0x2e, W83697HF_SP1)
index a935ffc13d1477fdfc09534d9aab92817bae3f6d..0b64c9d9ebbdbca385c4203a28a0867e366155f4 100644 (file)
@@ -19,6 +19,7 @@
 #include "s1850_fixups.c"
 #include "northbridge/intel/e7520/memory_initialized.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
 #define CONSOLE_SERIAL_DEV PNP_DEV(0x2e, PC8374_SP1)
 
@@ -149,10 +150,7 @@ static void main(unsigned long bist)
        u16 w;
        u32 l;
        int do_reset;
-       /*
-        *
-        *
-        */
+
        static const struct mem_controller mch[] = {
                {
                        .node_id = 0,
@@ -164,8 +162,8 @@ static void main(unsigned long bist)
                        */
                        /* the wiring on this part is really messed up */
                        /* this is my best guess so far */
-                       .channel0 = {(0xa<<3)|0, (0xa<<3)|1, (0xa<<3)|2, (0xa<<3)|3, },
-                       .channel1 = {(0xa<<3)|4, (0xa<<3)|5, (0xa<<3)|6, (0xa<<3)|7, },
+                       .channel0 = {DIMM0, DIMM1, DIMM2, DIMM3, },
+                       .channel1 = {DIMM4, DIMM5, DIMM6, DIMM7, },
                }
        };
 
index 40a06264013e66ca55299d25174c64e8d2b440a5..5e782ed1b042544808f425451eb40f80acc003d8 100644 (file)
@@ -15,6 +15,7 @@
 #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
 
@@ -32,7 +33,7 @@ void main(unsigned long bist)
        static const struct mem_controller memctrl[] = {
                {
                        .d0 = PCI_DEV(0, 0, 1),
-                       .channel0 = { (0xa<<3)|0, 0 },
+                       .channel0 = { DIMM0, 0 },
                },
        };
 
index 6cf6ec6f19f3afb982b980b266bbc7956b3c5b0a..8b5f00d4fb58aa7f1d748020c2b93d9816fd4434 100644 (file)
@@ -45,7 +45,7 @@ void main(unsigned long bist)
        post_code(0x01);
 
        static const struct mem_controller memctrl [] = {
-               {.channel0 = {(0xa<<3)|0, (0xa<<3)|1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index a93179a42e40290298b0ff92bd8bdf22576861f5..4a6971be4d2574beb85fef9d04b13d0bb3588eba 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <console/console.h>
 #include <usbdebug.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
@@ -134,11 +135,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
                        // Node 0
-                       (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-                       (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+                       DIMM0, DIMM2, 0, 0,
+                       DIMM1, DIMM3, 0, 0,
                        // Node 1
-                       (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-                       (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+                       DIMM4, DIMM6, 0, 0,
+                       DIMM5, DIMM7, 0, 0,
        };
 
         struct sys_info *sysinfo = (struct sys_info *)(CONFIG_DCACHE_RAM_BASE +
index d606040d2c879d4890f8cba2c04139e6ecd70bb4..7665c7b622303a19888e416b20c062414b69c025 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <console/console.h>
 #include <usbdebug.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
@@ -131,11 +132,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
                        // Node 0
-                       (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-                       (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+                       DIMM0, DIMM2, 0, 0,
+                       DIMM1, DIMM3, 0, 0,
                        // Node 1
-                       (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-                       (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+                       DIMM4, DIMM6, 0, 0,
+                       DIMM5, DIMM7, 0, 0,
        };
 
         struct sys_info *sysinfo = (struct sys_info *)(CONFIG_DCACHE_RAM_BASE
index d2e393cbe137759cf0099010c2c454990b19d468..70f829a07ff62e602f8558931282b9640d50ee13 100644 (file)
@@ -146,8 +146,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr[] = {
                // first node
-                DIMM0, DIMM2, 0, 0,
-                DIMM1, DIMM3, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
 
                // second node
                DIMM4, DIMM6, 0, 0,
index 2ec5a82ddbd674e8b8d67bd7f177b6a6ca2653ea..75fcee2e22c3d2238917523f980302237ca418c7 100644 (file)
@@ -25,6 +25,7 @@
 #include "cpu/x86/bist.h"
 
 #include "northbridge/amd/amdk8/setup_resource_map.c"
+#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, PC87366_SP1)
 
@@ -87,8 +88,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x18, 1),
                        .f2 = PCI_DEV(0, 0x18, 2),
                        .f3 = PCI_DEV(0, 0x18, 3),
-                       .channel0 = { (0xa<<3)|0, (0xa<<3)|2, 0, 0 },
-                       .channel1 = { (0xa<<3)|1, (0xa<<3)|3, 0, 0 },
+                       .channel0 = { DIMM0, DIMM2, 0, 0 },
+                       .channel1 = { DIMM1, DIMM3, 0, 0 },
                },
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
                {
@@ -97,8 +98,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x19, 1),
                        .f2 = PCI_DEV(0, 0x19, 2),
                        .f3 = PCI_DEV(0, 0x19, 3),
-                       .channel0 = { (0xa<<3)|4, (0xa<<3)|6, 0, 0 },
-                       .channel1 = { (0xa<<3)|5, (0xa<<3)|7, 0, 0 },
+                       .channel0 = { DIMM4, DIMM6, 0, 0 },
+                       .channel1 = { DIMM5, DIMM7, 0, 0 },
                },
 #endif
        };
index 22ea09f436e6d36c102fedf0ae5cb307e3a684ac..1202001fdba27ba9b2dbe9a4bf048215bf8b390d 100644 (file)
@@ -29,6 +29,7 @@
 #define SERIAL_DEV PNP_DEV(0x2e, PC87366_SP1)
 
 #include "southbridge/amd/amd8111/amd8111_early_ctrl.c"
+#include <spd.h>
 
 static void memreset_setup(void)
 {
@@ -87,8 +88,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x18, 1),
                        .f2 = PCI_DEV(0, 0x18, 2),
                        .f3 = PCI_DEV(0, 0x18, 3),
-                       .channel0 = { (0xa<<3)|0, (0xa<<3)|2, 0, 0 },
-                       .channel1 = { (0xa<<3)|1, (0xa<<3)|3, 0, 0 },
+                       .channel0 = { DIMM0, DIMM2, 0, 0 },
+                       .channel1 = { DIMM1, DIMM3, 0, 0 },
                },
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
                {
@@ -97,8 +98,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x19, 1),
                        .f2 = PCI_DEV(0, 0x19, 2),
                        .f3 = PCI_DEV(0, 0x19, 3),
-                       .channel0 = { (0xa<<3)|4, (0xa<<3)|6, 0, 0 },
-                       .channel1 = { (0xa<<3)|5, (0xa<<3)|7, 0, 0 },
+                       .channel0 = { DIMM4, DIMM6, 0, 0 },
+                       .channel1 = { DIMM5, DIMM7, 0, 0 },
                },
 #endif
        };
index 8412e3317084673c3646b8ca31b04c448ded6d09..4a10c04afc49cd9428e9978a012f291947f321dc 100644 (file)
@@ -69,7 +69,7 @@ void main(unsigned long bist)
        post_code(0x01);
 
        static const struct mem_controller memctrl[] = {
-               {.channel0 = {(0xa << 3) | 0, (0xa << 3) | 1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index 07ba0a0bdf48ab4f7cd8f13ae1d20eefba67d9e8..d70798c8a29c5585e0b87340882637ef76a4dcc0 100644 (file)
@@ -78,6 +78,7 @@ static inline int spd_read_byte(u16 device, u8 address)
 #include "lib/generic_sdram.c"
 #include "northbridge/intel/i3100/reset_test.c"
 #include "debug.c"
+#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x4e, I3100_SP1)
 
@@ -136,8 +137,8 @@ void main(unsigned long bist)
                        .f1 = PCI_DEV(0, 0x00, 1),
                        .f2 = PCI_DEV(0, 0x00, 2),
                        .f3 = PCI_DEV(0, 0x00, 3),
-                       .channel0 = { (0xa<<3)|3, (0xa<<3)|2, (0xa<<3)|1, (0xa<<3)|0 },
-                       .channel1 = { (0xa<<3)|7, (0xa<<3)|6, (0xa<<3)|5, (0xa<<3)|4 },
+                       .channel0 = { DIMM3, DIMM2, DIMM1, DIMM0 },
+                       .channel1 = { DIMM7, DIMM6, DIMM5, DIMM4 },
                }
        };
 
index 530c22ae2493984b8531451ead5e69b16cd406da..22f5937e020c59426a016a48db487f2a4cdef2f1 100644 (file)
@@ -19,6 +19,7 @@
 #include "superio/nsc/pc87427/pc87427_early_init.c"
 #include "northbridge/intel/e7520/memory_initialized.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
 #define SIO_GPIO_BASE 0x680
 #define SIO_XBUS_BASE 0x4880
@@ -41,10 +42,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 
 static void main(unsigned long bist)
 {
-       /*
-        *
-        *
-        */
        static const struct mem_controller mch[] = {
                {
                        .node_id = 0,
@@ -54,8 +51,8 @@ static void main(unsigned long bist)
                        .f2 = PCI_DEV(0, 0x00, 2),
                        .f3 = PCI_DEV(0, 0x00, 3),
                        */
-                       .channel0 = { (0xa<<3)|2, (0xa<<3)|1, (0xa<<3)|0, 0 },
-                       .channel1 = { (0xa<<3)|6, (0xa<<3)|5, (0xa<<3)|4, 0 },
+                       .channel0 = { DIMM2, DIMM1, DIMM0, 0 },
+                       .channel1 = { DIMM6, DIMM5, DIMM4, 0 },
                }
        };
 
index f36e4a4e681568957528ebc3bdd7b8883ca53382..5d34058a843e765f885bdab33ae16c6283dfb80e 100644 (file)
@@ -36,6 +36,7 @@
 #include "superio/intel/i3100/i3100_early_serial.c"
 #include "northbridge/intel/i3100/memory_initialized.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
 #define DEVPRES_CONFIG  (DEVPRES_D1F0 | DEVPRES_D2F0)
 #define DEVPRES1_CONFIG (DEVPRES1_D0F1 | DEVPRES1_D8F0)
@@ -64,8 +65,8 @@ void main(unsigned long bist)
                        .f1 = PCI_DEV(0, 0x00, 1),
                        .f2 = PCI_DEV(0, 0x00, 2),
                        .f3 = PCI_DEV(0, 0x00, 3),
-                       .channel0 = { (0xa<<3)|3, (0xa<<3)|2, (0xa<<3)|1, (0xa<<3)|0 },
-                       .channel1 = { (0xa<<3)|7, (0xa<<3)|6, (0xa<<3)|5, (0xa<<3)|4 },
+                       .channel0 = { DIMM3, DIMM2, DIMM1, DIMM0 },
+                       .channel1 = { DIMM7, DIMM6, DIMM5, DIMM4 },
                }
        };
 
index 105b82115c85fb41487c45b6faab67b14d945bac..32cca1cfbfdb80e8fee50686d3ebf42be1301a66 100644 (file)
@@ -61,7 +61,7 @@ static void main(unsigned long bist)
                {
                        .node_id = 0,
                        .f0 = PCI_DEV(0, 0x00, 0),
-                       .channel0 = { (0xa<<3)|2, (0xa<<3)|3 },
+                       .channel0 = { DIMM2, DIMM3 },
                }
        };
 
index c04d63790ccc6290838858bb78fa571814ae94a7..4505cf2c91a6a9220c64f84b835d8ab47600301e 100644 (file)
@@ -16,9 +16,9 @@
 #include "superio/smsc/lpc47b272/lpc47b272_early_serial.c"
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
-#define SUPERIO_PORT   0x2e
-#define SERIAL_DEV             PNP_DEV(SUPERIO_PORT, LPC47B272_SP1)
+#define SERIAL_DEV PNP_DEV(0x2e, LPC47B272_SP1)
 
 static void hard_reset(void)
 {
@@ -41,8 +41,8 @@ static void main(unsigned long bist)
                {
                        .d0 = PCI_DEV(0, 0, 0),
                        .d0f1 = PCI_DEV(0, 0, 1),
-                       .channel0 = { (0xa<<3)|0, (0xa<<3)|1, (0xa<<3)|2, 0 },
-                       .channel1 = { (0xa<<3)|4, (0xa<<3)|5, (0xa<<3)|6, 0 },
+                       .channel0 = { DIMM0, DIMM1, DIMM2, 0 },
+                       .channel1 = { DIMM4, DIMM5, DIMM6, 0 },
                },
        };
 
index 0d70b70f822c1c6ac56c4994c38e1ede86b64542..0e1f078f82b1f2843efc9d34343aa372a43f646f 100644 (file)
@@ -34,6 +34,7 @@
 #include "southbridge/via/vt8237r/vt8237r_early_smbus.c"
 #include "superio/fintek/f71805f/f71805f_early_serial.c"
 #include <lib.h>
+#include <spd.h>
 
 #if CONFIG_TTYS0_BASE == 0x2f8
 #define SERIAL_DEV PNP_DEV(0x2e, F71805F_SP2)
index fe4fd693272d563dc64100ee68651f75c3c74126..d763a87bc7a2be6925adbaf63a828bb87c2ee75b 100644 (file)
@@ -27,6 +27,7 @@
 #include <arch/romcc_io.h>
 #include <arch/hlt.h>
 #include <stdlib.h>
+#include <spd.h>
 #include "pc80/udelay_io.c"
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
@@ -54,7 +55,7 @@ void main(unsigned long bist)
        static const struct mem_controller memctrl[] = {
                {
                        .d0 = PCI_DEV(0, 0, 1),
-                       .channel0 = { (0xa<<3)|0, 0 },
+                       .channel0 = { DIMM0, 0 },
                },
        };
 
index 2b3ebe2d85a8eb784e9ad6391cc9f11d37d55d71..e317f041f485bd1d192c74eff38b1573228ab06f 100644 (file)
@@ -11,7 +11,6 @@
 #include <cpu/amd/gx2def.h>
 #include <cpu/amd/geode_post_code.h>
 #include "southbridge/amd/cs5535/cs5535.h"
-#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
 
@@ -76,7 +75,7 @@ static inline int spd_read_byte(unsigned int device, unsigned int address)
 void main(unsigned long bist)
 {
        static const struct mem_controller memctrl [] = {
-               {.channel0 = {(0xa<<3)|0, (0xa<<3)|1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
        unsigned char temp;
        SystemPreInit();
index bc6cae005323fb2a82e2adcefea4c6ecdd8ad729..35674fbfcc0717239ebe7daed2a583675d484df6 100644 (file)
@@ -122,7 +122,7 @@ void main(unsigned long bist)
        post_code(0x01);
 
        static const struct mem_controller memctrl[] = {
-               {.channel0 = {(0xa << 3) | 0, (0xa << 3) | 1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index 38bac67728566bf95f7297c59b62d4f54e111d66..ca4980ba85856dfc6050d2fa3743a12d20c47bf0 100644 (file)
@@ -34,7 +34,6 @@
 #include <cpu/amd/lxdef.h>
 #include <cpu/amd/geode_post_code.h>
 #include "southbridge/amd/cs5536/cs5536.h"
-#include <spd.h>
 
 #include "southbridge/amd/cs5536/cs5536_early_smbus.c"
 #include "southbridge/amd/cs5536/cs5536_early_setup.c"
@@ -166,7 +165,7 @@ void main(unsigned long bist)
        post_code(0x01);
 
        static const struct mem_controller memctrl[] = {
-               {.channel0 = {(0xa << 3) | 0, (0xa << 3) | 1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index 086a61d8f1f0dd2778466ba80f679b100bc9c33b..95a9c82b2157a493586010cbd42bd12837ff08d9 100644 (file)
@@ -97,7 +97,7 @@ void main(unsigned long bist)
        post_code(0x01);
 
        static const struct mem_controller memctrl[] = {
-               {.channel0 = {(0xa << 3) | 0, (0xa << 3) | 1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index cc9e7fda98bdfe95731f36da698da7c0f8be9c0b..f5ae44e214f34c15fe56b357b9fa735628071c0d 100644 (file)
@@ -34,7 +34,6 @@
 #include <cpu/amd/lxdef.h>
 #include <cpu/amd/geode_post_code.h>
 #include "southbridge/amd/cs5536/cs5536.h"
-#include <spd.h>
 
 #include "southbridge/amd/cs5536/cs5536_early_smbus.c"
 #include "southbridge/amd/cs5536/cs5536_early_setup.c"
@@ -163,7 +162,7 @@ void main(unsigned long bist)
        post_code(0x01);
 
        static const struct mem_controller memctrl[] = {
-               {.channel0 = {(0xa << 3) | 0, (0xa << 3) | 1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index 2aa77409984c1eadcc06f4c4493d1a9c5d14a829..ca3185738278a20f3eaf1aa4218278559187817c 100644 (file)
@@ -49,6 +49,7 @@
 #include "northbridge/amd/amdk8/setup_resource_map.c"
 #include "northbridge/amd/amdk8/coherent_ht.c"
 #include "cpu/amd/dualcore/dualcore.c"
+#include <spd.h>
 
 static void memreset(int controllers, const struct mem_controller *ctrl)
 {
@@ -95,7 +96,7 @@ static void sio_setup(void)
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr[] = {
-               (0xa << 3) | 0, (0xa << 3) | 1, 0, 0,
+               DIMM0, DIMM1, 0, 0,
                0, 0, 0, 0,
                0, 0, 0, 0,
                0, 0, 0, 0,
index b37cd1f4bf4f68c7a56943abb18194e02a6a11e4..13dd4049b495695fa27d5c727ed3a9eaa3229a9e 100644 (file)
@@ -42,6 +42,7 @@
 #include "cpu/amd/model_fxx/apic_timer.c"
 #include "lib/delay.c"
 #include <lib.h>
+#include <spd.h>
 
 #include "cpu/x86/lapic/boot_cpu.c"
 #include "northbridge/amd/amdk8/reset_test.c"
@@ -117,11 +118,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr[] = {
                // Node 0
-               (0xa << 3) | 0, (0xa << 3) | 2, 0, 0,
-               (0xa << 3) | 1, (0xa << 3) | 3, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
                // Node 1
-               (0xa << 3) | 4, (0xa << 3) | 6, 0, 0,
-               (0xa << 3) | 5, (0xa << 3) | 7, 0, 0,
+               DIMM4, DIMM6, 0, 0,
+               DIMM5, DIMM7, 0, 0,
        };
 
        struct sys_info *sysinfo = (struct sys_info *)(CONFIG_DCACHE_RAM_BASE
index 74ec60af0a8732984a84bc353cabdef8e76907ef..5756b4c1c82224f93c1e601e88e6879f1afd0935 100644 (file)
@@ -109,9 +109,9 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr[] = {
-                       //first node
-                        RC0|DIMM0, RC0|DIMM2, RC0|DIMM4, RC0|DIMM6,
-                        RC0|DIMM1, RC0|DIMM3, RC0|DIMM5, RC0|DIMM7,
+                      //first node
+                       RC0|DIMM0, RC0|DIMM2, RC0|DIMM4, RC0|DIMM6,
+                       RC0|DIMM1, RC0|DIMM3, RC0|DIMM5, RC0|DIMM7,
                        //second node
                        RC1|DIMM0, RC1|DIMM2, RC1|DIMM4, RC1|DIMM6,
                        RC1|DIMM1, RC1|DIMM3, RC1|DIMM5, RC1|DIMM7,
index 6ec9daab18ccdc0bda09d4a2c56e1e00528ffddb..e7754d05356c6d146076c5e5f56948a0a7d66103 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
 #include "northbridge/amd/amdk8/setup_resource_map.c"
 
@@ -132,11 +133,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr[] = {
                // Node 0
-               RC0|(0xa<<3)|0, RC0|(0xa<<3)|2, RC0|(0xa<<3)|4, RC0|(0xa<<3)|6,
-               RC0|(0xa<<3)|1, RC0|(0xa<<3)|3, RC0|(0xa<<3)|5, RC0|(0xa<<3)|7,
+               RC0|DIMM0, RC0|DIMM2, RC0|DIMM4, RC0|DIMM6,
+               RC0|DIMM1, RC0|DIMM3, RC0|DIMM5, RC0|DIMM7,
                // node 1
-               RC1|(0xa<<3)|0, RC1|(0xa<<3)|2, RC1|(0xa<<3)|4, RC1|(0xa<<3)|6,
-               RC1|(0xa<<3)|1, RC1|(0xa<<3)|3, RC1|(0xa<<3)|5, RC1|(0xa<<3)|7,
+               RC1|DIMM0, RC1|DIMM2, RC1|DIMM4, RC1|DIMM6,
+               RC1|DIMM1, RC1|DIMM3, RC1|DIMM5, RC1|DIMM7,
        };
 
        unsigned bsp_apicid = 0;
index 84ece3897d0abaa87ec967ee291fdf42eb4d6204..984aa9da5430f496bd319369e64394c25627c46b 100644 (file)
@@ -14,6 +14,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
@@ -93,11 +94,11 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
-                       (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-                       (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+                       DIMM0, DIMM2, 0, 0,
+                       DIMM1, DIMM3, 0, 0,
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
-                       (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-                       (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+                       DIMM4, DIMM6, 0, 0,
+                       DIMM5, DIMM7, 0, 0,
 #endif
        };
 
index 447d38d89030dc3c2f2437781ebd7a40a06cb1c9..ed8e33a6073f477d9d4ca41ef141a23f3f920ac3 100644 (file)
@@ -36,6 +36,7 @@
 #include <console/console.h>
 #include <usbdebug.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
@@ -132,11 +133,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
                        // Node 0
-                       (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-                       (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+                       DIMM0, DIMM2, 0, 0,
+                       DIMM1, DIMM3, 0, 0,
                        // Node 1
-                       (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-                       (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+                       DIMM4, DIMM6, 0, 0,
+                       DIMM5, DIMM7, 0, 0,
        };
 
        struct sys_info *sysinfo = (struct sys_info *)(CONFIG_DCACHE_RAM_BASE
index 5ccc348047a8962f29bb42c7559504c70a349a37..395e1778009e73d9aaa386396f7094aeba693613 100644 (file)
@@ -32,7 +32,6 @@
 #include <cpu/amd/lxdef.h>
 #include <cpu/amd/geode_post_code.h>
 #include "southbridge/amd/cs5536/cs5536.h"
-#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
 
index 0312d4a27ccc5afca52ed4af784b1dfd54e971ed..557d6329b333fc69ae731971373ccb9b84e863a1 100644 (file)
@@ -32,7 +32,6 @@
 #include <cpu/amd/lxdef.h>
 #include <cpu/amd/geode_post_code.h>
 #include "southbridge/amd/cs5536/cs5536.h"
-#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
 
index 32204b02386eb5dd931969d2d0ac66310e682e69..1f567402d22a08278db9454f6b4819dd6c6edd35 100644 (file)
@@ -8,6 +8,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 #include "northbridge/amd/amdk8/incoherent_ht.c"
@@ -117,11 +118,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
                        // Node 0
-                       (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-                       (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+                       DIMM0, DIMM2, 0, 0,
+                       DIMM1, DIMM3, 0, 0,
                        // Node 1
-                       (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-                       (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+                       DIMM4, DIMM6, 0, 0,
+                       DIMM5, DIMM7, 0, 0,
        };
 
         int needs_reset;
index 86705fdfb64cad7dcce67054384b02281ef12530..4f32816ebb79764ecee12b6a2564fc39aa2c5654 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
@@ -188,15 +189,15 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
  */
        static const uint16_t spd_addr[] = {
                // Node 0
-               RC0 | (0xa << 3) | 0, RC0 | (0xa << 3) | 2,
-                   RC0 | (0xa << 3) | 4, RC0 | (0xa << 3) | 6,
-               RC0 | (0xa << 3) | 1, RC0 | (0xa << 3) | 3,
-                   RC0 | (0xa << 3) | 5, RC0 | (0xa << 3) | 7,
+               RC0 | DIMM0, RC0 | DIMM2,
+               RC0 | DIMM4, RC0 | DIMM6,
+               RC0 | DIMM1, RC0 | DIMM3,
+               RC0 | DIMM5, RC0 | DIMM7,
                // Node 1
-               RC1 | (0xa << 3) | 0, RC1 | (0xa << 3) | 2,
-                   RC1 | (0xa << 3) | 4, RC1 | (0xa << 3) | 6,
-               RC1 | (0xa << 3) | 1, RC1 | (0xa << 3) | 3,
-                   RC1 | (0xa << 3) | 5, RC1 | (0xa << 3) | 7,
+               RC1 | DIMM0, RC1 | DIMM2,
+               RC1 | DIMM4, RC1 | DIMM6,
+               RC1 | DIMM1, RC1 | DIMM3,
+               RC1 | DIMM5, RC1 | DIMM7,
        };
 
        struct sys_info *sysinfo = (struct sys_info *)(CONFIG_DCACHE_RAM_BASE
index b84bdea2eb379d39499ebbdbabdc137bd579982f..eb5cc05c7ab5aaef0bf9f85ab9613b33b5896f7e 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
@@ -124,11 +125,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
                        // Node 0
-                       (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-                       (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+                       DIMM0, DIMM2, 0, 0,
+                       DIMM1, DIMM3, 0, 0,
                        // Node 1
-                       (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-                       (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+                       DIMM4, DIMM6, 0, 0,
+                       DIMM5, DIMM7, 0, 0,
        };
 
         struct sys_info *sysinfo = (struct sys_info *)(CONFIG_DCACHE_RAM_BASE
index 6a7d77b3bdb3f7d50bfea390429aa5d25306f32f..6f3c671dc35d9b9355331a4ce2fbf6dde9c25991 100644 (file)
@@ -20,6 +20,7 @@
 #include "superio/winbond/w83627hf/w83627hf_early_init.c"
 #include "northbridge/intel/e7525/memory_initialized.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
 #define CONSOLE_SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
 #define HIDDEN_SERIAL_DEV  PNP_DEV(0x2e, W83627HF_SP2)
@@ -44,10 +45,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 
 static void main(unsigned long bist)
 {
-       /*
-        *
-        *
-        */
        static const struct mem_controller mch[] = {
                {
                        .node_id = 0,
@@ -55,8 +52,8 @@ static void main(unsigned long bist)
                        .f1 = PCI_DEV(0, 0x00, 1),
                        .f2 = PCI_DEV(0, 0x00, 2),
                        .f3 = PCI_DEV(0, 0x00, 3),
-                       .channel0 = {(0xa<<3)|3, (0xa<<3)|2, (0xa<<3)|1, (0xa<<3)|0, },
-                       .channel1 = {(0xa<<3)|7, (0xa<<3)|6, (0xa<<3)|5, (0xa<<3)|4, },
+                       .channel0 = {DIMM3, DIMM2, DIMM1, DIMM0, },
+                       .channel1 = {DIMM7, DIMM6, DIMM5, DIMM4, },
                }
        };
 
index 64196b2fc54fc19c3299912a81b77be406bc16bb..18d8b265b2227a1e6f610b7dd7781a90f341c25d 100644 (file)
@@ -21,6 +21,7 @@
 #include "superio/winbond/w83627hf/w83627hf_early_init.c"
 #include "northbridge/intel/e7520/memory_initialized.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
 #define CONSOLE_SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
 #define HIDDEN_SERIAL_DEV  PNP_DEV(0x2e, W83627HF_SP2)
@@ -58,8 +59,8 @@ static void main(unsigned long bist)
                        .f2 = PCI_DEV(0, 0x00, 2),
                        .f3 = PCI_DEV(0, 0x00, 3),
                        */
-                       .channel0 = {(0xa<<3)|0, (0xa<<3)|1, (0xa<<3)|2, (0xa<<3)|3, },
-                       .channel1 = {(0xa<<3)|4, (0xa<<3)|5, (0xa<<3)|6, (0xa<<3)|7, },
+                       .channel0 = {DIMM0, DIMM1, DIMM2, DIMM3, },
+                       .channel1 = {DIMM4, DIMM5, DIMM6, DIMM7, },
                }
        };
 
index 39cf5e778a932c772fc84803ad52ec63504e4e14..e8fcf306b7a1c15218bc3b6b05e87bde26a07b7e 100644 (file)
@@ -19,6 +19,7 @@
 #include "superio/nsc/pc87427/pc87427_early_init.c"
 #include "northbridge/intel/e7520/memory_initialized.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
 #define CONSOLE_SERIAL_DEV PNP_DEV(0x2e, PC87427_SP1)
 #define HIDDEN_SERIAL_DEV  PNP_DEV(0x2e, PC87427_SP2)
@@ -43,10 +44,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 
 static void main(unsigned long bist)
 {
-       /*
-        *
-        *
-        */
        static const struct mem_controller mch[] = {
                {
                        .node_id = 0,
@@ -56,8 +53,8 @@ static void main(unsigned long bist)
                        .f2 = PCI_DEV(0, 0x00, 2),
                        .f3 = PCI_DEV(0, 0x00, 3),
                        */
-                       .channel0 = {(0xa<<3)|3, (0xa<<3)|2, (0xa<<3)|1, (0xa<<3)|0, },
-                       .channel1 = {(0xa<<3)|7, (0xa<<3)|6, (0xa<<3)|5, (0xa<<3)|4, },
+                       .channel0 = {DIMM3, DIMM2, DIMM1, DIMM0, },
+                       .channel1 = {DIMM7, DIMM6, DIMM5, DIMM4, },
 
                }
        };
index 4dc5efe94a1d2f7038f32733561b914d55d6eb27..0a9af2d3bf157f247032b9b9734abc4a816e08cb 100644 (file)
@@ -19,6 +19,7 @@
 #include "superio/winbond/w83627hf/w83627hf_early_init.c"
 #include "northbridge/intel/e7520/memory_initialized.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
 #define CONSOLE_SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
 #define HIDDEN_SERIAL_DEV  PNP_DEV(0x2e, W83627HF_SP2)
@@ -57,8 +58,8 @@ static void main(unsigned long bist)
                        .f2 = PCI_DEV(0, 0x00, 2),
                        .f3 = PCI_DEV(0, 0x00, 3),
                        */
-                       .channel0 = {(0xa<<3)|3, (0xa<<3)|2, (0xa<<3)|1, (0xa<<3)|0, },
-                       .channel1 = {(0xa<<3)|7, (0xa<<3)|6, (0xa<<3)|5, (0xa<<3)|4, },
+                       .channel0 = {DIMM3, DIMM2, DIMM1, DIMM0, },
+                       .channel1 = {DIMM7, DIMM6, DIMM5, DIMM4, },
                }
        };
 
index 6d8e482463fcbc8f045d11fd83435fe0ff556020..efdacb5a5a2cd9127edfd946941d10d7ab1ce1e1 100644 (file)
@@ -19,6 +19,7 @@
 #include "superio/winbond/w83627hf/w83627hf_early_init.c"
 #include "northbridge/intel/e7520/memory_initialized.c"
 #include "cpu/x86/bist.h"
+#include <spd.h>
 
 #define CONSOLE_SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
 #define HIDDEN_SERIAL_DEV  PNP_DEV(0x2e, W83627HF_SP2)
@@ -44,10 +45,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 
 static void main(unsigned long bist)
 {
-       /*
-        *
-        *
-        */
        static const struct mem_controller mch[] = {
                {
                        .node_id = 0,
@@ -57,8 +54,8 @@ static void main(unsigned long bist)
                        .f2 = PCI_DEV(0, 0x00, 2),
                        .f3 = PCI_DEV(0, 0x00, 3),
                        */
-                       .channel0 = {(0xa<<3)|3, (0xa<<3)|2, (0xa<<3)|1, (0xa<<3)|0, },
-                       .channel1 = {(0xa<<3)|7, (0xa<<3)|6, (0xa<<3)|5, (0xa<<3)|4, },
+                       .channel0 = {DIMM3, DIMM2, DIMM1, DIMM0, },
+                       .channel1 = {DIMM7, DIMM6, DIMM5, DIMM4, },
                }
        };
 
index b3aff80af41f4ced08a1602a882c8732b551d985..7515a69136c6223d9e5f5c8188394450709a0f53 100644 (file)
@@ -63,7 +63,7 @@ void main(unsigned long bist)
        post_code(0x01);
 
        static const struct mem_controller memctrl[] = {
-               {.channel0 = {(0xa << 3) | 0, (0xa << 3) | 1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index d117112c3dda4bc4995b157f52a9019b1101a417..8e765a173a663671a9aa8e380c7a1fc2973eb30c 100644 (file)
@@ -9,6 +9,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include "southbridge/intel/i82801ex/i82801ex_early_smbus.c"
 #include "northbridge/intel/e7501/raminit.h"
@@ -44,8 +45,8 @@ void main(unsigned long bist)
                 {
                         .d0 = PCI_DEV(0, 0, 0),
                         .d0f1 = PCI_DEV(0, 0, 1),
-                        .channel0 = { (0xa<<3)|0, (0xa<<3)|1, (0xa<<3)|2, 0 },
-                        .channel1 = { (0xa<<3)|4, (0xa<<3)|5, (0xa<<3)|6, 0 },
+                        .channel0 = { DIMM0, DIMM1, DIMM2, 0 },
+                        .channel1 = { DIMM4, DIMM5, DIMM6, 0 },
                 },
        };
 
index 5ae6c95d75c7df06a7fb4c2da9f3c554c853adac..2711e2441e036a386e75f4038816de01ca180dd3 100644 (file)
@@ -9,6 +9,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 #include "northbridge/amd/amdk8/incoherent_ht.c"
@@ -86,8 +87,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x18, 1),
                        .f2 = PCI_DEV(0, 0x18, 2),
                        .f3 = PCI_DEV(0, 0x18, 3),
-                       .channel0 = { (0xa<<3)|0, (0xa<<3)|2, 0, 0 },
-                       .channel1 = { (0xa<<3)|1, (0xa<<3)|3, 0, 0 },
+                       .channel0 = { DIMM0, DIMM2, 0, 0 },
+                       .channel1 = { DIMM1, DIMM3, 0, 0 },
                },
        };
 
index 3d97099be5c775a88ba5839766903b58862b870d..728d2ecb72aff4aa68b7052442d5c0195281056a 100644 (file)
@@ -9,6 +9,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 #include "northbridge/amd/amdk8/incoherent_ht.c"
@@ -87,8 +88,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x18, 1),
                        .f2 = PCI_DEV(0, 0x18, 2),
                        .f3 = PCI_DEV(0, 0x18, 3),
-                       .channel0 = { (0xa<<3)|0, (0xa<<3)|2, 0, 0 },
-                       .channel1 = { (0xa<<3)|1, (0xa<<3)|3, 0, 0 },
+                       .channel0 = { DIMM0, DIMM2, 0, 0 },
+                       .channel1 = { DIMM1, DIMM3, 0, 0 },
                },
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
                {
@@ -97,8 +98,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x19, 1),
                        .f2 = PCI_DEV(0, 0x19, 2),
                        .f3 = PCI_DEV(0, 0x19, 3),
-                       .channel0 = { (0xa<<3)|4, (0xa<<3)|6, 0, 0 },
-                       .channel1 = { (0xa<<3)|5, (0xa<<3)|7, 0, 0 },
+                       .channel0 = { DIMM4, DIMM6, 0, 0 },
+                       .channel1 = { DIMM5, DIMM7, 0, 0 },
                },
 #endif
        };
index e32f35a4ebf1cc5ff5db04a11128b9d883dc434c..d3e8745355ff31e3251d79809ec022b4295b60ca 100644 (file)
@@ -9,6 +9,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 #include "northbridge/amd/amdk8/incoherent_ht.c"
@@ -87,8 +88,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x18, 1),
                        .f2 = PCI_DEV(0, 0x18, 2),
                        .f3 = PCI_DEV(0, 0x18, 3),
-                       .channel0 = { (0xa<<3)|0, (0xa<<3)|2, 0, 0 },
-                       .channel1 = { (0xa<<3)|1, (0xa<<3)|3, 0, 0 },
+                       .channel0 = { DIMM0, DIMM2, 0, 0 },
+                       .channel1 = { DIMM1, DIMM3, 0, 0 },
                },
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
                {
@@ -97,8 +98,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x19, 1),
                        .f2 = PCI_DEV(0, 0x19, 2),
                        .f3 = PCI_DEV(0, 0x19, 3),
-                       .channel0 = { (0xa<<3)|4, (0xa<<3)|6, 0, 0 },
-                       .channel1 = { (0xa<<3)|5, (0xa<<3)|7, 0, 0 },
+                       .channel0 = { DIMM4, DIMM6, 0, 0 },
+                       .channel1 = { DIMM5, DIMM7, 0, 0 },
                },
 #endif
        };
index ee3c3f0b69fcbfcdda55ae48a0d511d23b8904b3..c347e98cc988cf63bec6dc617991f7486b6c85bb 100644 (file)
@@ -8,6 +8,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
@@ -80,11 +81,11 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
-                       (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-                       (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+                       DIMM0, DIMM2, 0, 0,
+                       DIMM1, DIMM3, 0, 0,
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
-                       (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-                       (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+                       DIMM4, DIMM6, 0, 0,
+                       DIMM5, DIMM7, 0, 0,
 #endif
        };
 
index c050c2bf49b9cfc123d68fdf543b4b87394fd273..c17bc1376c0c9c52463809264a709c152371edb5 100644 (file)
@@ -9,6 +9,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 #include "northbridge/amd/amdk8/incoherent_ht.c"
@@ -85,8 +86,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x18, 1),
                        .f2 = PCI_DEV(0, 0x18, 2),
                        .f3 = PCI_DEV(0, 0x18, 3),
-                       .channel0 = { (0xa<<3)|0, (0xa<<3)|2, 0, 0 },
-                       .channel1 = { (0xa<<3)|1, (0xa<<3)|3, 0, 0 },
+                       .channel0 = { DIMM0, DIMM2, 0, 0 },
+                       .channel1 = { DIMM1, DIMM3, 0, 0 },
                },
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
                {
@@ -95,8 +96,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
                        .f1 = PCI_DEV(0, 0x19, 1),
                        .f2 = PCI_DEV(0, 0x19, 2),
                        .f3 = PCI_DEV(0, 0x19, 3),
-                       .channel0 = { (0xa<<3)|4, (0xa<<3)|6, 0, 0 },
-                       .channel1 = { (0xa<<3)|5, (0xa<<3)|7, 0, 0 },
+                       .channel0 = { DIMM4, DIMM6, 0, 0 },
+                       .channel1 = { DIMM5, DIMM7, 0, 0 },
                },
 #endif
        };
index deae2bbfdbf8f23789390e8b12f1e871b03b36e0..ab9b8d3077697e134e609794dbb7686dfd95480d 100644 (file)
@@ -8,6 +8,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
@@ -83,11 +84,11 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
-                       (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-                       (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+                       DIMM0, DIMM2, 0, 0,
+                       DIMM1, DIMM3, 0, 0,
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
-                       (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-                       (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+                       DIMM4, DIMM6, 0, 0,
+                       DIMM5, DIMM7, 0, 0,
 #endif
        };
 
index 8c490a9006074f9827e5d0a4e29a0020a75dcde5..973995e4af9a0d962937922845e01812b2443a60 100644 (file)
@@ -8,6 +8,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
@@ -93,11 +94,11 @@ static void sio_setup(void)
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
-               (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-               (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
-               (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-               (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+               DIMM4, DIMM6, 0, 0,
+               DIMM5, DIMM7, 0, 0,
 #endif
        };
 
index 447fecfaafd251ffaf9dbda05ed585e180edc8c3..1cf18258e7eb24ecfa6a7a7961ee475f9de4bd19 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
@@ -88,11 +89,11 @@ static void sio_setup(void)
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
-               (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-               (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
 #if CONFIG_MAX_PHYSICAL_CPUS > 1
-               (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-               (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+               DIMM4, DIMM6, 0, 0,
+               DIMM5, DIMM7, 0, 0,
 #endif
        };
 
index bb75a912cb391d442d5992178f1e66e4a2d955d2..01e4280e246c3a9a9895a19dad267e9c1a02c0b4 100644 (file)
@@ -8,6 +8,7 @@
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 #include <cpu/amd/model_fxx_rev.h>
 #include "northbridge/amd/amdk8/incoherent_ht.c"
 #include "southbridge/nvidia/ck804/ck804_early_smbus.h"
@@ -112,10 +113,10 @@ static void sio_setup(void)
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const u16 spd_addr [] = {
-               (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-               (0xa<<3)|1, (0xa<<3)|3, 0, 0,
-               (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-               (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+               DIMM0, DIMM2, 0, 0,
+               DIMM1, DIMM3, 0, 0,
+               DIMM4, DIMM6, 0, 0,
+               DIMM5, DIMM7, 0, 0,
        };
 
        int needs_reset;
index efb95254886d66684f63b64d88dcfa02678aae35..745c00081a472b519dd4f6834cf9945b27fc2dcc 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <console/console.h>
 #include <lib.h>
+#include <spd.h>
 #include <usbdebug.h>
 
 #include <cpu/amd/model_fxx_rev.h>
@@ -130,11 +131,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
        static const uint16_t spd_addr [] = {
                        // Node 0
-                       (0xa<<3)|0, (0xa<<3)|2, 0, 0,
-                       (0xa<<3)|1, (0xa<<3)|3, 0, 0,
+                       DIMM0, DIMM2, 0, 0,
+                       DIMM1, DIMM3, 0, 0,
                        // Node 1
-                       (0xa<<3)|4, (0xa<<3)|6, 0, 0,
-                       (0xa<<3)|5, (0xa<<3)|7, 0, 0,
+                       DIMM4, DIMM6, 0, 0,
+                       DIMM5, DIMM7, 0, 0,
        };
 
        struct sys_info *sysinfo = (struct sys_info *)(CONFIG_DCACHE_RAM_BASE
index 45df349cbcc3b620fd9edbf80a7188c5c1747d23..5053924217fa50e0f0108ddd4b8bc56e186630da 100644 (file)
@@ -34,6 +34,7 @@
 #include "lib/delay.c"
 #include "southbridge/via/vt8237r/vt8237r_early_smbus.c"
 #include "southbridge/via/vt8235/vt8235_early_serial.c"
+#include <spd.h>
 
 static inline int spd_read_byte(unsigned device, unsigned address)
 {
index 1b4e27a7afa92ee9ed188c04c35a1a95fe6e190e..a2ed0abdee277ab904df3e53cba669e4366aba26 100644 (file)
 #include "cpu/x86/lapic/boot_cpu.c"
 #include "southbridge/via/vt8237r/vt8237r_early_smbus.c"
 #include "superio/winbond/w83697hf/w83697hf_early_serial.c"
+#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, W83697HF_SP1)
 
-/*
- * NOOB ::
- * d0f0 - Device 0 Function 0 etc.
- */
 static const struct mem_controller ctrl = {
        .d0f0 = 0x0000,
        .d0f2 = 0x2000,
index 0b5a557125fdcd9a7dd041069f361a48f0bed790..a615c37cfd6ef158d16683419ed1f3613719c411 100644 (file)
@@ -34,6 +34,7 @@
 #include "lib/delay.c"
 #include "southbridge/via/vt8237r/vt8237r_early_smbus.c"
 #include "superio/ite/it8716f/it8716f_early_serial.c"
+#include <spd.h>
 
 #define SERIAL_DEV PNP_DEV(0x2e, IT8716F_SP1)
 
index 8c761464f24cfef3ac408c30372b7cfcb3e74068..bd7426b1a84440f26386734bb0d4a328c7858f4b 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "northbridge/via/cx700/cx700_early_serial.c"
 #include "northbridge/via/cx700/raminit.c"
+#include <spd.h>
 
 static void enable_mainboard_devices(void)
 {
index 6d081e94576ac4d553724f62a1fe01268429f520..20dc5879380b33f0b418b242b5f53d7fedd6f1a3 100644 (file)
@@ -67,7 +67,7 @@ void main(unsigned long bist)
        post_code(0x01);
 
        static const struct mem_controller memctrl[] = {
-               {.channel0 = {(0xa << 3) | 0, (0xa << 3) | 1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();
index d2724964629372dbb1aec3d4197a95666ad57ad8..9c0671e3b4771f79b878dfc78f101dc81e7be354 100644 (file)
@@ -54,7 +54,7 @@ static inline int spd_read_byte(unsigned int device, unsigned int address)
 void main(unsigned long bist)
 {
        static const struct mem_controller memctrl [] = {
-               {.channel0 = {(0xa<<3)|0, (0xa<<3)|1}}
+               {.channel0 = {DIMM0, DIMM1}}
        };
 
        SystemPreInit();