Make SB600/SB700 more similar for easier diffs (trivial).
Also fixes random whitespace issues, typos, etc. 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@5837 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
977b985095
commit
ff492b1855
|
@ -20,7 +20,7 @@
|
||||||
#ifndef RS690_CHIP_H
|
#ifndef RS690_CHIP_H
|
||||||
#define RS690_CHIP_H
|
#define RS690_CHIP_H
|
||||||
|
|
||||||
/* Member variables are defined in Config.lb. */
|
/* Member variables are defined in devicetree.cb. */
|
||||||
struct southbridge_amd_rs690_config
|
struct southbridge_amd_rs690_config
|
||||||
{
|
{
|
||||||
u8 gpp_configuration; /* The configuration of General Purpose Port, A/B/C/D/E. */
|
u8 gpp_configuration; /* The configuration of General Purpose Port, A/B/C/D/E. */
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef RS780_CHIP_H
|
#ifndef RS780_CHIP_H
|
||||||
#define RS780_CHIP_H
|
#define RS780_CHIP_H
|
||||||
|
|
||||||
/* Member variables are defined in Config.lb. */
|
/* Member variables are defined in devicetree.cb. */
|
||||||
struct southbridge_amd_rs780_config
|
struct southbridge_amd_rs780_config
|
||||||
{
|
{
|
||||||
u8 gppsb_configuration; /* The configuration of General Purpose Port, A/B/C/D/E. */
|
u8 gppsb_configuration; /* The configuration of General Purpose Port, A/B/C/D/E. */
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#define SMBUS_IO_BASE 0x1000 /* Is it a temporary SMBus I/O base address? */
|
#define SMBUS_IO_BASE 0x1000 /* Is it a temporary SMBus I/O base address? */
|
||||||
/*SIZE 0x40 */
|
/*SIZE 0x40 */
|
||||||
|
|
||||||
|
|
||||||
static void pmio_write(u8 reg, u8 value)
|
static void pmio_write(u8 reg, u8 value)
|
||||||
{
|
{
|
||||||
outb(reg, PM_INDEX);
|
outb(reg, PM_INDEX);
|
||||||
|
@ -38,7 +37,7 @@ static u8 pmio_read(u8 reg)
|
||||||
return inb(PM_INDEX + 1);
|
return inb(PM_INDEX + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get SB ASIC Revision.*/
|
/* RPR 2.1: Get SB ASIC Revision. */
|
||||||
static u8 get_sb600_revision(void)
|
static u8 get_sb600_revision(void)
|
||||||
{
|
{
|
||||||
device_t dev;
|
device_t dev;
|
||||||
|
@ -131,15 +130,14 @@ static u32 get_sbdn(u32 bus)
|
||||||
return (dev >> 15) & 0x1f;
|
return (dev >> 15) & 0x1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static u8 dual_core(void)
|
static u8 dual_core(void)
|
||||||
{
|
{
|
||||||
return (pci_read_config32(PCI_DEV(0, 0x18, 3), 0xE8) & (0x3<<12)) != 0;
|
return (pci_read_config32(PCI_DEV(0, 0x18, 3), 0xE8) & (0x3<<12)) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SB600 VFSMAF (VID/FID System Management Action Field) is 010b by default.
|
* SB600 VFSMAF (VID/FID System Management Action Field) is 010b by default.
|
||||||
RPR 2.3.3 C-state and VID/FID change for the K8 platform.
|
* RPR 2.3.3 C-state and VID/FID change for the K8 platform.
|
||||||
*/
|
*/
|
||||||
static void enable_fid_change_on_sb(u32 sbbusn, u32 sbdn)
|
static void enable_fid_change_on_sb(u32 sbbusn, u32 sbdn)
|
||||||
{
|
{
|
||||||
|
@ -196,7 +194,6 @@ static void enable_fid_change_on_sb(u32 sbbusn, u32 sbdn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void hard_reset(void)
|
void hard_reset(void)
|
||||||
{
|
{
|
||||||
set_bios_reset();
|
set_bios_reset();
|
||||||
|
@ -277,7 +274,6 @@ void sb600_lpc_port80(void)
|
||||||
pci_write_config8(dev, 0x4a, byte);
|
pci_write_config8(dev, 0x4a, byte);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* sbDevicesPorInitTable */
|
/* sbDevicesPorInitTable */
|
||||||
static void sb600_devices_por_init(void)
|
static void sb600_devices_por_init(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,9 +20,7 @@
|
||||||
#include <usbdebug.h>
|
#include <usbdebug.h>
|
||||||
|
|
||||||
#ifndef SB600_DEVN_BASE
|
#ifndef SB600_DEVN_BASE
|
||||||
|
|
||||||
#define SB600_DEVN_BASE 0
|
#define SB600_DEVN_BASE 0
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EHCI_BAR_INDEX 0x10
|
#define EHCI_BAR_INDEX 0x10
|
||||||
|
@ -39,5 +37,5 @@ static void sb600_enable_usbdebug(u32 port)
|
||||||
set_debug_port(port);
|
set_debug_port(port);
|
||||||
pci_write_config32(PCI_DEV(0, SB600_DEVN_BASE + 0x13, 5),
|
pci_write_config32(PCI_DEV(0, SB600_DEVN_BASE + 0x13, 5),
|
||||||
EHCI_BAR_INDEX, EHCI_BAR);
|
EHCI_BAR_INDEX, EHCI_BAR);
|
||||||
pci_write_config8(PCI_DEV(0, SB600_DEVN_BASE + 0x13, 5), 0x04, 0x2); /* mem space enabe */
|
pci_write_config8(PCI_DEV(0, SB600_DEVN_BASE + 0x13, 5), 0x04, 0x2); /* mem space enable */
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,7 @@ static u32 cim_verb_data[] = {
|
||||||
0x01f71ec4,
|
0x01f71ec4,
|
||||||
0x01f71f01,
|
0x01f71f01,
|
||||||
};
|
};
|
||||||
|
|
||||||
static u32 find_verb(u32 viddid, u32 ** verb)
|
static u32 find_verb(u32 viddid, u32 ** verb)
|
||||||
{
|
{
|
||||||
device_t azalia_dev = dev_find_slot(0, PCI_DEVFN(0x14, 2));
|
device_t azalia_dev = dev_find_slot(0, PCI_DEVFN(0x14, 2));
|
||||||
|
@ -171,7 +172,6 @@ static u32 find_verb(u32 viddid, u32 ** verb)
|
||||||
* Wait 50usec for for the codec to indicate it is ready
|
* Wait 50usec for for the codec to indicate it is ready
|
||||||
* no response would imply that the codec is non-operative
|
* no response would imply that the codec is non-operative
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int wait_for_ready(u32 base)
|
static int wait_for_ready(u32 base)
|
||||||
{
|
{
|
||||||
/* Use a 50 usec timeout - the Linux kernel uses the
|
/* Use a 50 usec timeout - the Linux kernel uses the
|
||||||
|
@ -194,7 +194,6 @@ static int wait_for_ready(u32 base)
|
||||||
* the previous command. No response would imply that the code
|
* the previous command. No response would imply that the code
|
||||||
* is non-operative
|
* is non-operative
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int wait_for_valid(u32 base)
|
static int wait_for_valid(u32 base)
|
||||||
{
|
{
|
||||||
/* Use a 50 usec timeout - the Linux kernel uses the
|
/* Use a 50 usec timeout - the Linux kernel uses the
|
||||||
|
@ -301,7 +300,7 @@ static void hda_init(struct device *dev)
|
||||||
if (!res)
|
if (!res)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
base = ((u32)res->base);
|
base = (u32)res->base;
|
||||||
printk(BIOS_DEBUG, "base = 0x%x\n", base);
|
printk(BIOS_DEBUG, "base = 0x%x\n", base);
|
||||||
codec_mask = codec_detect(base);
|
codec_mask = codec_detect(base);
|
||||||
|
|
||||||
|
|
|
@ -327,10 +327,10 @@ static void sb600_sm_read_resources(device_t dev)
|
||||||
res->gran = 8;
|
res->gran = 8;
|
||||||
res->flags = IORESOURCE_IO | IORESOURCE_FIXED;
|
res->flags = IORESOURCE_IO | IORESOURCE_FIXED;
|
||||||
|
|
||||||
|
|
||||||
compact_resources(dev);
|
compact_resources(dev);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sb600_sm_set_resources(struct device *dev)
|
static void sb600_sm_set_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -338,7 +338,6 @@ static void sb600_sm_set_resources(struct device *dev)
|
||||||
|
|
||||||
pci_dev_set_resources(dev);
|
pci_dev_set_resources(dev);
|
||||||
|
|
||||||
|
|
||||||
/* rpr2.14: Make HPET MMIO decoding controlled by the memory enable bit in command register of LPC ISA bridage */
|
/* rpr2.14: Make HPET MMIO decoding controlled by the memory enable bit in command register of LPC ISA bridage */
|
||||||
byte = pm_ioread(0x52);
|
byte = pm_ioread(0x52);
|
||||||
byte |= 1 << 6;
|
byte |= 1 << 6;
|
||||||
|
@ -357,6 +356,7 @@ static void sb600_sm_set_resources(struct device *dev)
|
||||||
static struct pci_operations lops_pci = {
|
static struct pci_operations lops_pci = {
|
||||||
.set_subsystem = pci_dev_set_subsystem,
|
.set_subsystem = pci_dev_set_subsystem,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct device_operations smbus_ops = {
|
static struct device_operations smbus_ops = {
|
||||||
.read_resources = sb600_sm_read_resources,
|
.read_resources = sb600_sm_read_resources,
|
||||||
.set_resources = sb600_sm_set_resources,
|
.set_resources = sb600_sm_set_resources,
|
||||||
|
@ -367,6 +367,7 @@ static struct device_operations smbus_ops = {
|
||||||
.ops_pci = &lops_pci,
|
.ops_pci = &lops_pci,
|
||||||
.ops_smbus_bus = &lops_smbus_bus,
|
.ops_smbus_bus = &lops_smbus_bus,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct pci_driver smbus_driver __pci_driver = {
|
static const struct pci_driver smbus_driver __pci_driver = {
|
||||||
.ops = &smbus_ops,
|
.ops = &smbus_ops,
|
||||||
.vendor = PCI_VENDOR_ID_ATI,
|
.vendor = PCI_VENDOR_ID_ATI,
|
||||||
|
|
|
@ -114,8 +114,7 @@ int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_smbus_read_byte(u32 smbus_io_base, u32 device,
|
int do_smbus_read_byte(u32 smbus_io_base, u32 device, u32 address)
|
||||||
u32 address)
|
|
||||||
{
|
{
|
||||||
u8 byte;
|
u8 byte;
|
||||||
|
|
||||||
|
@ -145,8 +144,7 @@ int do_smbus_read_byte(u32 smbus_io_base, u32 device,
|
||||||
return byte;
|
return byte;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_smbus_write_byte(u32 smbus_io_base, u32 device,
|
int do_smbus_write_byte(u32 smbus_io_base, u32 device, u32 address, u8 val)
|
||||||
u32 address, u8 val)
|
|
||||||
{
|
{
|
||||||
u8 byte;
|
u8 byte;
|
||||||
|
|
||||||
|
@ -176,8 +174,7 @@ int do_smbus_write_byte(u32 smbus_io_base, u32 device,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void alink_ab_indx(u32 reg_space, u32 reg_addr,
|
static void alink_ab_indx(u32 reg_space, u32 reg_addr, u32 mask, u32 val)
|
||||||
u32 mask, u32 val)
|
|
||||||
{
|
{
|
||||||
u32 tmp;
|
u32 tmp;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ static u8 pmio_read(u8 reg)
|
||||||
return inb(PM_INDEX + 1);
|
return inb(PM_INDEX + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RPR 2.28 Get SB ASIC Revision.*/
|
/* RPR 2.28: Get SB ASIC Revision. */
|
||||||
static u8 set_sb700_revision(void)
|
static u8 set_sb700_revision(void)
|
||||||
{
|
{
|
||||||
device_t dev;
|
device_t dev;
|
||||||
|
|
|
@ -20,9 +20,7 @@
|
||||||
#include <usbdebug.h>
|
#include <usbdebug.h>
|
||||||
|
|
||||||
#ifndef SB700_DEVN_BASE
|
#ifndef SB700_DEVN_BASE
|
||||||
|
|
||||||
#define SB700_DEVN_BASE 0
|
#define SB700_DEVN_BASE 0
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EHCI_BAR_INDEX 0x10
|
#define EHCI_BAR_INDEX 0x10
|
||||||
|
@ -39,5 +37,5 @@ static void sb700_enable_usbdebug(u32 port)
|
||||||
set_debug_port(port);
|
set_debug_port(port);
|
||||||
pci_write_config32(PCI_DEV(0, SB700_DEVN_BASE + 0x13, 5),
|
pci_write_config32(PCI_DEV(0, SB700_DEVN_BASE + 0x13, 5),
|
||||||
EHCI_BAR_INDEX, EHCI_BAR);
|
EHCI_BAR_INDEX, EHCI_BAR);
|
||||||
pci_write_config8(PCI_DEV(0, SB700_DEVN_BASE + 0x13, 5), 0x04, 0x2); /* mem space enabe */
|
pci_write_config8(PCI_DEV(0, SB700_DEVN_BASE + 0x13, 5), 0x04, 0x2); /* mem space enable */
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ static void ide_init(struct device *dev)
|
||||||
pci_write_config16(dev, 0x4, dword);
|
pci_write_config16(dev, 0x4, dword);
|
||||||
|
|
||||||
/* set ide as primary, if you want to boot from IDE, you'd better set it
|
/* set ide as primary, if you want to boot from IDE, you'd better set it
|
||||||
* in mainboard/Config.lb */
|
* in $vendor/$mainboard/devicetree.cb */
|
||||||
if (conf->boot_switch_sata_ide == 1) {
|
if (conf->boot_switch_sata_ide == 1) {
|
||||||
byte = pci_read_config8(dev, 0xAD);
|
byte = pci_read_config8(dev, 0xAD);
|
||||||
byte |= 1 << 4;
|
byte |= 1 << 4;
|
||||||
|
|
|
@ -90,8 +90,7 @@ int do_smbus_recv_byte(u32 smbus_io_base, u32 device)
|
||||||
return byte;
|
return byte;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_smbus_send_byte(u32 smbus_io_base, u32 device,
|
int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val)
|
||||||
u8 val)
|
|
||||||
{
|
{
|
||||||
u8 byte;
|
u8 byte;
|
||||||
|
|
||||||
|
@ -118,8 +117,7 @@ int do_smbus_send_byte(u32 smbus_io_base, u32 device,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_smbus_read_byte(u32 smbus_io_base, u32 device,
|
int do_smbus_read_byte(u32 smbus_io_base, u32 device, u32 address)
|
||||||
u32 address)
|
|
||||||
{
|
{
|
||||||
u8 byte;
|
u8 byte;
|
||||||
|
|
||||||
|
@ -149,8 +147,7 @@ int do_smbus_read_byte(u32 smbus_io_base, u32 device,
|
||||||
return byte;
|
return byte;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_smbus_write_byte(u32 smbus_io_base, u32 device,
|
int do_smbus_write_byte(u32 smbus_io_base, u32 device, u32 address, u8 val)
|
||||||
u32 address, u8 val)
|
|
||||||
{
|
{
|
||||||
u8 byte;
|
u8 byte;
|
||||||
|
|
||||||
|
@ -180,8 +177,7 @@ int do_smbus_write_byte(u32 smbus_io_base, u32 device,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void alink_ab_indx(u32 reg_space, u32 reg_addr,
|
static void alink_ab_indx(u32 reg_space, u32 reg_addr, u32 mask, u32 val)
|
||||||
u32 mask, u32 val)
|
|
||||||
{
|
{
|
||||||
u32 tmp;
|
u32 tmp;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue