mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
Every GeodeLX target already has spd_read_byte in
mainboard/$VENDOR/$BOARD/initram.c. It's pointless to have it in the southbridge code as well. Kill it in the southbridge code and use mainboard code only. Thanks to Segher for rediscovering this bug. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://coreboot.org/repository/coreboot-v3@830 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
268630d472
commit
27b2fb4f07
4 changed files with 51 additions and 17 deletions
|
@ -34,6 +34,8 @@
|
|||
#include <southbridge/amd/cs5536/cs5536.h>
|
||||
#include <northbridge/amd/geodelx/raminit.h>
|
||||
|
||||
extern int smbus_read_byte(u16 device, u8 address);
|
||||
|
||||
#define MANUALCONF 0 /* Do automatic strapped PLL config. */
|
||||
|
||||
#define PLLMSRHI 0x00001490 /* Manual settings for the PLL */
|
||||
|
@ -42,6 +44,31 @@
|
|||
#define DIMM0 ((u8) 0xA0)
|
||||
#define DIMM1 ((u8) 0xA2)
|
||||
|
||||
/**
|
||||
* Read a byte from the SPD.
|
||||
*
|
||||
* For this board, that is really just saying 'read a byte from SMBus'.
|
||||
* So we use smbus_read_byte(). Nota Bene: leave this here as a function
|
||||
* rather than a #define in an obscure location. This function is called
|
||||
* only a few dozen times, and it's not performance critical.
|
||||
*
|
||||
* @param device The device.
|
||||
* @param address The address.
|
||||
* @return The data from the SMBus packet area or an error of 0xff (i.e. -1).
|
||||
*/
|
||||
u8 spd_read_byte(u16 device, u8 address)
|
||||
{
|
||||
u8 spdbyte;
|
||||
|
||||
printk(BIOS_DEBUG, "spd_read_byte dev %04x\n", device);
|
||||
|
||||
spdbyte = smbus_read_byte(device, address);
|
||||
|
||||
printk(BIOS_DEBUG, " addr %02x returns %02x\n", address, spdbyte);
|
||||
|
||||
return spdbyte;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void done_cache_as_ram_main(void);
|
||||
|
|
|
@ -42,6 +42,18 @@ extern int smbus_read_byte(u16 device, u8 address);
|
|||
#define DIMM0 ((u8) 0xA0)
|
||||
#define DIMM1 ((u8) 0xA2)
|
||||
|
||||
/**
|
||||
* Read a byte from the SPD.
|
||||
*
|
||||
* For this board, that is really just saying 'read a byte from SMBus'.
|
||||
* So we use smbus_read_byte(). Nota Bene: leave this here as a function
|
||||
* rather than a #define in an obscure location. This function is called
|
||||
* only a few dozen times, and it's not performance critical.
|
||||
*
|
||||
* @param device The device.
|
||||
* @param address The address.
|
||||
* @return The data from the SMBus packet area or an error of 0xff (i.e. -1).
|
||||
*/
|
||||
u8 spd_read_byte(u16 device, u8 address)
|
||||
{
|
||||
u8 spdbyte;
|
||||
|
|
|
@ -42,6 +42,18 @@ extern int smbus_read_byte(u16 device, u8 address);
|
|||
#define DIMM0 ((u8) 0xA0)
|
||||
#define DIMM1 ((u8) 0xA2)
|
||||
|
||||
/**
|
||||
* Read a byte from the SPD.
|
||||
*
|
||||
* For this board, that is really just saying 'read a byte from SMBus'.
|
||||
* So we use smbus_read_byte(). Nota Bene: leave this here as a function
|
||||
* rather than a #define in an obscure location. This function is called
|
||||
* only a few dozen times, and it's not performance critical.
|
||||
*
|
||||
* @param device The device.
|
||||
* @param address The address.
|
||||
* @return The data from the SMBus packet area or an error of 0xff (i.e. -1).
|
||||
*/
|
||||
u8 spd_read_byte(u16 device, u8 address)
|
||||
{
|
||||
u8 spdbyte;
|
||||
|
|
|
@ -330,20 +330,3 @@ int smbus_read_byte(u16 device, u8 address)
|
|||
|
||||
return do_smbus_read_byte(SMBUS_IO_BASE, device, address);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a byte from the SPD.
|
||||
*
|
||||
* For this chip, that is really just saying 'read a byte from SMBus'.
|
||||
* So we use smbus_read_byte(). Nota Bene: leave this here as a function
|
||||
* rather than a #define in an obscure location. This function is called
|
||||
* only a few dozen times, and it's not performance critical.
|
||||
*
|
||||
* @param device The device.
|
||||
* @param address The address.
|
||||
* @return The data from the SMBus packet area or an error of 0xff (i.e. -1).
|
||||
*/
|
||||
u8 spd_read_byte(u16 device, u8 address)
|
||||
{
|
||||
return smbus_read_byte(device, address);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue