sb/broadcom/bcm5785: Get rid of device_t
Use of device_t has been abandoned in ramstage. Change-Id: Ia39347f9d07bb0055ea4686a8b319f323f68062e Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/26403 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
86c92ba042
commit
e490a87582
|
@ -20,10 +20,10 @@
|
||||||
#include <device/pci_ids.h>
|
#include <device/pci_ids.h>
|
||||||
#include "bcm5785.h"
|
#include "bcm5785.h"
|
||||||
|
|
||||||
void bcm5785_enable(device_t dev)
|
void bcm5785_enable(struct device *dev)
|
||||||
{
|
{
|
||||||
device_t sb_pci_main_dev;
|
struct device *sb_pci_main_dev;
|
||||||
device_t bus_dev;
|
struct device *bus_dev;
|
||||||
// unsigned index;
|
// unsigned index;
|
||||||
|
|
||||||
/* See if we are on the behind the pcix bridge */
|
/* See if we are on the behind the pcix bridge */
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
|
|
||||||
#ifndef __PRE_RAM__
|
#ifndef __PRE_RAM__
|
||||||
void bcm5785_enable(device_t dev);
|
void bcm5785_enable(struct device *dev);
|
||||||
#else
|
#else
|
||||||
void enable_fid_change_on_sb(unsigned sbbusn, unsigned sbdn);
|
void enable_fid_change_on_sb(unsigned sbbusn, unsigned sbdn);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <device/pci_ops.h>
|
#include <device/pci_ops.h>
|
||||||
#include "bcm5785.h"
|
#include "bcm5785.h"
|
||||||
|
|
||||||
static void bcm5785_ide_read_resources(device_t dev)
|
static void bcm5785_ide_read_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
/* Get the normal pci resources of this device */
|
/* Get the normal pci resources of this device */
|
||||||
pci_dev_read_resources(dev);
|
pci_dev_read_resources(dev);
|
||||||
|
@ -36,7 +36,8 @@ static void ide_init(struct device *dev)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
|
static void lpci_set_subsystem(struct device *dev, unsigned vendor,
|
||||||
|
unsigned device)
|
||||||
{
|
{
|
||||||
pci_write_config32(dev, 0x40,
|
pci_write_config32(dev, 0x40,
|
||||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <arch/ioapic.h>
|
#include <arch/ioapic.h>
|
||||||
#include "bcm5785.h"
|
#include "bcm5785.h"
|
||||||
|
|
||||||
static void lpc_init(device_t dev)
|
static void lpc_init(struct device *dev)
|
||||||
{
|
{
|
||||||
/* Initialize the real time clock */
|
/* Initialize the real time clock */
|
||||||
cmos_init(0);
|
cmos_init(0);
|
||||||
|
@ -35,7 +35,7 @@ static void lpc_init(device_t dev)
|
||||||
isa_dma_init();
|
isa_dma_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bcm5785_lpc_read_resources(device_t dev)
|
static void bcm5785_lpc_read_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ static void bcm5785_lpc_read_resources(device_t dev)
|
||||||
*
|
*
|
||||||
* @param dev The device whos children's resources are to be enabled.
|
* @param dev The device whos children's resources are to be enabled.
|
||||||
*/
|
*/
|
||||||
static void bcm5785_lpc_enable_childrens_resources(device_t dev)
|
static void bcm5785_lpc_enable_childrens_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
struct bus *link;
|
struct bus *link;
|
||||||
uint32_t reg;
|
uint32_t reg;
|
||||||
|
@ -74,7 +74,7 @@ static void bcm5785_lpc_enable_childrens_resources(device_t dev)
|
||||||
reg = pci_read_config8(dev, 0x44);
|
reg = pci_read_config8(dev, 0x44);
|
||||||
|
|
||||||
for (link = dev->link_list; link; link = link->next) {
|
for (link = dev->link_list; link; link = link->next) {
|
||||||
device_t child;
|
struct device *child;
|
||||||
for (child = link->children; child; child = child->sibling) {
|
for (child = link->children; child; child = child->sibling) {
|
||||||
if (child->enabled && (child->path.type == DEVICE_PATH_PNP)) {
|
if (child->enabled && (child->path.type == DEVICE_PATH_PNP)) {
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -110,13 +110,14 @@ static void bcm5785_lpc_enable_childrens_resources(device_t dev)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bcm5785_lpc_enable_resources(device_t dev)
|
static void bcm5785_lpc_enable_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
pci_dev_enable_resources(dev);
|
pci_dev_enable_resources(dev);
|
||||||
bcm5785_lpc_enable_childrens_resources(dev);
|
bcm5785_lpc_enable_childrens_resources(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
|
static void lpci_set_subsystem(struct device *dev, unsigned vendor,
|
||||||
|
unsigned device)
|
||||||
{
|
{
|
||||||
pci_write_config32(dev, 0x40,
|
pci_write_config32(dev, 0x40,
|
||||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||||
|
|
|
@ -68,7 +68,8 @@ static void sata_init(struct device *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
|
static void lpci_set_subsystem(struct device *dev, unsigned vendor,
|
||||||
|
unsigned device)
|
||||||
{
|
{
|
||||||
pci_write_config32(dev, 0x40,
|
pci_write_config32(dev, 0x40,
|
||||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#define NMI_OFF 0
|
#define NMI_OFF 0
|
||||||
|
|
||||||
static void sb_init(device_t dev)
|
static void sb_init(struct device *dev)
|
||||||
{
|
{
|
||||||
uint8_t byte;
|
uint8_t byte;
|
||||||
uint8_t byte_old;
|
uint8_t byte_old;
|
||||||
|
@ -52,7 +52,7 @@ static void sb_init(device_t dev)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bcm5785_sb_read_resources(device_t dev)
|
static void bcm5785_sb_read_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ static void bcm5785_sb_read_resources(device_t dev)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lsmbus_recv_byte(device_t dev)
|
static int lsmbus_recv_byte(struct device *dev)
|
||||||
{
|
{
|
||||||
unsigned device;
|
unsigned device;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -86,7 +86,7 @@ static int lsmbus_recv_byte(device_t dev)
|
||||||
return do_smbus_recv_byte(res->base, device);
|
return do_smbus_recv_byte(res->base, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lsmbus_send_byte(device_t dev, uint8_t val)
|
static int lsmbus_send_byte(struct device *dev, uint8_t val)
|
||||||
{
|
{
|
||||||
unsigned device;
|
unsigned device;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -100,7 +100,7 @@ static int lsmbus_send_byte(device_t dev, uint8_t val)
|
||||||
return do_smbus_send_byte(res->base, device, val);
|
return do_smbus_send_byte(res->base, device, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lsmbus_read_byte(device_t dev, uint8_t address)
|
static int lsmbus_read_byte(struct device *dev, uint8_t address)
|
||||||
{
|
{
|
||||||
unsigned device;
|
unsigned device;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -114,7 +114,7 @@ static int lsmbus_read_byte(device_t dev, uint8_t address)
|
||||||
return do_smbus_read_byte(res->base, device, address);
|
return do_smbus_read_byte(res->base, device, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lsmbus_write_byte(device_t dev, uint8_t address, uint8_t val)
|
static int lsmbus_write_byte(struct device *dev, uint8_t address, uint8_t val)
|
||||||
{
|
{
|
||||||
unsigned device;
|
unsigned device;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -135,7 +135,8 @@ static struct smbus_bus_operations lops_smbus_bus = {
|
||||||
.write_byte = lsmbus_write_byte,
|
.write_byte = lsmbus_write_byte,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
|
static void lpci_set_subsystem(struct device *dev, unsigned vendor,
|
||||||
|
unsigned device)
|
||||||
{
|
{
|
||||||
pci_write_config32(dev, 0x2c,
|
pci_write_config32(dev, 0x2c,
|
||||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||||
|
|
|
@ -33,7 +33,8 @@ static void usb_init(struct device *dev)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
|
static void lpci_set_subsystem(struct device *dev, unsigned vendor,
|
||||||
|
unsigned device)
|
||||||
{
|
{
|
||||||
pci_write_config32(dev, 0x40,
|
pci_write_config32(dev, 0x40,
|
||||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||||
|
|
Loading…
Reference in New Issue