On Thu, Jun 28, 2007 at 06:48:40PM +0200, svn@openbios.org wrote:
Modified: LinuxBIOSv3/mainboard/artecgroup/dbe61/initram.c
--- LinuxBIOSv3/mainboard/artecgroup/dbe61/initram.c 2007-06-28 16:21:38 UTC (rev 394) +++ LinuxBIOSv3/mainboard/artecgroup/dbe61/initram.c 2007-06-28 16:48:40 UTC (rev 395) @@ -43,9 +43,15 @@ */ #define GPIO_BASE 0x6100
+/* empty function to always fail smbus reads */
Is this done because every board needs this function but this one doesn't use it?
+int smbus_read_byte(unsigned device, unsigned address)
No unsigned, please use u16 or something.
+{
- return -1;
+}
static void init_gpio(void) {
- msr_t msr;
struct msr_struct msr; printk(BIOS_DEBUG, "Initializing GPIO module...\n");
// initialize the GPIO LBAR
@@ -63,7 +69,7 @@ * width in bits (byte 6,7) * = Density per side (byte 31) * number of sides (byte 5) */ /* 1. Initialize GLMC registers base on SPD values, do one DIMM for now */
- msr_t msr;
struct msr_struct msr;
msr.hi = 0x10075012; msr.lo = 0x00000040;
@@ -101,13 +107,21 @@ /* Hold Count - how long we will sit in reset */ #define PLLMSRlo 0x00DE0000
+struct wmsr {
- u32 reg;
- struct msr_struct msr;
+} dbe61_msr[] = {
- {.reg = 0x10000020, {.lo = 0xfff80, .hi = 0x20000000}},
- {.reg = 0x10000021, {.lo = 0x80fffe0, .hi = 0x20000000}},
- {.reg = 0x40000020, {.lo = 0xfff80, .hi = 0x20000000}},
- {.reg = 0x40000021, {.lo = 0x80fffe0, .hi = 0x20000000}},
+};
static void dbe61_msr_init(void) {
- __builtin_wrmsr(0x10000020, 0xfff80, 0x20000000);
__builtin_wrmsr(0x10000021, 0x80fffe0, 0x20000000);
__builtin_wrmsr(0x40000020, 0xfff80, 0x20000000);
__builtin_wrmsr(0x40000021, 0x80fffe0, 0x20000000);
- int i;
- for(i = 0; i < sizeof(dbe61_msr)/sizeof(dbe61_msr[0]); i++)
We want an ARRAY_SIZE macro in some header file for this, it's even recommnended by the coding guidelines.
wrmsr(dbe61_msr[i].reg, dbe61_msr[i].msr);
}
int main(void)
Uwe.
On 6/28/07, Uwe Hermann uwe@hermann-uwe.de wrote:
Is this done because every board needs this function but this one doesn't use it?
The LX code as written requires this function. It's not a great situation but a read of the code reveals it's going to be a long bit of work to resolve that.
+int smbus_read_byte(unsigned device, unsigned address)
Yeah, will change. I'll need to change it everywhere though. You'll see a patch in a few minutes.
We want an ARRAY_SIZE macro in some header file for this, it's even recommnended by the coding guidelines.
There ought to be nelem or some such, but I did not see it.
ron