artecgroup/dbe61: Use dbe61c specific variables and macros instead of generic ones
This is in preparation of dbe61a handling addition.
Uses DIMM_DBE61C and DIMM_EMPTY instead of generic DIMM0/DIMM1, and spd_table_dbe61c instead of spd_table.
Also removes a completely unused smb_devices structure definition.
Signed-off-by: Mart Raudsepp mart.raudsepp@artecdesign.ee --- mainboard/artecgroup/dbe61/initram.c | 27 ++++++++++++--------------- 1 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/mainboard/artecgroup/dbe61/initram.c b/mainboard/artecgroup/dbe61/initram.c index 8c84792..4a89247 100644 --- a/mainboard/artecgroup/dbe61/initram.c +++ b/mainboard/artecgroup/dbe61/initram.c @@ -35,8 +35,8 @@ #define MANUALCONF 0 /* Do automatic strapped PLL config */ #define PLLMSRHI 0x00001490 /* manual settings for the PLL */ #define PLLMSRLO 0x02000030 -#define DIMM0 ((u8) 0xA0) -#define DIMM1 ((u8) 0xA2) +#define DIMM_DBE61C ((u8) 0xA0) +#define DIMM_EMPTY ((u8) 0xA2)
struct spd_entry { u8 address; @@ -46,7 +46,7 @@ struct spd_entry { /* Save space by using a short list of SPD values used by Geode LX Memory init */ /* Fake SPD for DBE61C - 256MB. Same memory chip, and therefore same SPD entries, as for DBE62. */ /* Micron MT46V32M16 */ -static const struct spd_entry spd_table[] = { +static const struct spd_entry spd_table_dbe61c[] = { {SPD_MEMORY_TYPE, 7}, {SPD_NUM_ROWS, 13}, {SPD_tRFC, 0x4b}, @@ -95,7 +95,7 @@ static const struct spd_entry spd_table_dbe61a[] = {
/** * Given an SMBUS device, and an address in that device, return the value of SPD - * for that device. In this mainboard, the only one that can return is DIMM0. + * for that device. In this mainboard, the only one that can return is DIMM_DBE61C. * @param device The device number * @param address The address in SPD rom to return the value of * @returns The value @@ -107,15 +107,15 @@ u8 spd_read_byte(u16 device, u8 address) u8 ret = 0xff;
printk(BIOS_DEBUG, "spd_read_byte dev %04x", device); - if (device == DIMM0) { - for (i = 0; i < ARRAY_SIZE(spd_table); i++) { - if (spd_table[i].address == address) { - ret = spd_table[i].data; + if (device == DIMM_DBE61C) { + for (i = 0; i < ARRAY_SIZE(spd_table_dbe61c); i++) { + if (spd_table_dbe61c[i].address == address) { + ret = spd_table_dbe61c[i].data; break; } }
- if (i == ARRAY_SIZE(spd_table)) + if (i == ARRAY_SIZE(spd_table_dbe61c)) printk(BIOS_DEBUG, " addr %02x does not exist in SPD table", address); } @@ -143,9 +143,6 @@ static void mb_gpio_init(void) */ int main(void) { - u8 smb_devices[] = { - DIMM0, DIMM1 - }; printk(BIOS_DEBUG, "Hi there from stage1\n"); post_code(POST_START_OF_MAIN);
@@ -158,16 +155,16 @@ int main(void) pll_reset(MANUALCONF, PLLMSRHI, PLLMSRLO); printk(BIOS_DEBUG, "done pll reset\n");
- cpu_reg_init(0, DIMM0, DIMM1, DRAM_UNTERMINATED); + cpu_reg_init(0, DIMM_DBE61C, DIMM_EMPTY, DRAM_UNTERMINATED); printk(BIOS_DEBUG, "done cpu reg init\n");
sdram_set_registers(); printk(BIOS_DEBUG, "done sdram set registers\n");
- sdram_set_spd_registers(DIMM0, DIMM1); + sdram_set_spd_registers(DIMM_DBE61C, DIMM_EMPTY); printk(BIOS_DEBUG, "done sdram set spd registers\n");
- sdram_enable(DIMM0, DIMM1); + sdram_enable(DIMM_DBE61C, DIMM_EMPTY); printk(BIOS_DEBUG, "done sdram enable\n");
/* Check low memory */
On 13.11.2008 01:18, Mart Raudsepp wrote:
artecgroup/dbe61: Use dbe61c specific variables and macros instead of generic ones
This is in preparation of dbe61a handling addition.
Uses DIMM_DBE61C and DIMM_EMPTY instead of generic DIMM0/DIMM1, and spd_table_dbe61c instead of spd_table.
I somehow dislike using 0xA2 for DIMM_EMPTY. Sorry.
Also removes a completely unused smb_devices structure definition.
Please kill smb_devices for dbe61,dbe62,alix1c in a separate patch. That removal patch is preemptively acked.
Regards, Carl-Daniel
Carl-Daniel Hailfinger wrote:
Please kill smb_devices for dbe61,dbe62,alix1c in a separate patch. That removal patch is preemptively acked.
r1011
On N, 2008-11-13 at 01:51 +0100, Carl-Daniel Hailfinger wrote:
On 13.11.2008 01:18, Mart Raudsepp wrote:
artecgroup/dbe61: Use dbe61c specific variables and macros instead of generic ones
This is in preparation of dbe61a handling addition.
Uses DIMM_DBE61C and DIMM_EMPTY instead of generic DIMM0/DIMM1, and spd_table_dbe61c instead of spd_table.
I somehow dislike using 0xA2 for DIMM_EMPTY. Sorry.
Note that 0xA2 is used by all other boards that have soldered on memory as one DIMM. It's just named perhaps less intuitively DIMM1. In case of DBE61 what really makes these values perhaps not ideal, is the addition of a third one that is an OR relationship with the first.
What random numbers between 0x00 and 0xFF would you suggest for all the three then? :)
Regards, Mart Raudsepp
On 13.11.2008 03:56, Mart Raudsepp wrote:
On N, 2008-11-13 at 01:51 +0100, Carl-Daniel Hailfinger wrote:
On 13.11.2008 01:18, Mart Raudsepp wrote:
artecgroup/dbe61: Use dbe61c specific variables and macros instead of generic ones
This is in preparation of dbe61a handling addition.
Uses DIMM_DBE61C and DIMM_EMPTY instead of generic DIMM0/DIMM1, and spd_table_dbe61c instead of spd_table.
I somehow dislike using 0xA2 for DIMM_EMPTY. Sorry.
Note that 0xA2 is used by all other boards that have soldered on memory as one DIMM. It's just named perhaps less intuitively DIMM1. In case of DBE61 what really makes these values perhaps not ideal, is the addition of a third one that is an OR relationship with the first.
Hm yes. Could you convert all other boards with soldered DIMMS to the DIMM_EMPTY scheme as well? That change would be Acked-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
What random numbers between 0x00 and 0xFF would you suggest for all the three then? :)
You gave a perfectly valid reason to keep it as is. Go for it. If we ever want to move DIMM_EMPTY to 0x0 or something else, we can do so in a separate patch.
Regards, Carl-Daniel
Mart Raudsepp wrote:
artecgroup/dbe61: Use dbe61c specific variables and macros instead of generic ones
Note that 0xA2 is used by all other boards that have soldered on memory as one DIMM. It's just named perhaps less intuitively DIMM1.
Please go ahead and commit.
//Peter
Mart Raudsepp wrote:
artecgroup/dbe61: Use dbe61c specific variables and macros instead of generic ones
This is in preparation of dbe61a handling addition.
Uses DIMM_DBE61C and DIMM_EMPTY instead of generic DIMM0/DIMM1, and spd_table_dbe61c instead of spd_table.
Also removes a completely unused smb_devices structure definition.
Signed-off-by: Mart Raudsepp mart.raudsepp@artecdesign.ee
Acked-by: Peter Stuge peter@stuge.se