nvidia/mcp55: Get rid of device_t
Use of device_t has been abandoned in ramstage. Change-Id: I48ab6d77be0201ac7b49b26e0366b6e3a1e5ac52 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/26400 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
parent
bcb124e009
commit
1df39c3aca
|
@ -254,7 +254,8 @@ static void azalia_init(struct device *dev)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void azalia_set_subsystem(device_t dev, unsigned vendor, unsigned device)
|
static void azalia_set_subsystem(struct device *dev, unsigned vendor,
|
||||||
|
unsigned device)
|
||||||
{
|
{
|
||||||
if (!vendor || !device) {
|
if (!vendor || !device) {
|
||||||
pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
|
pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
|
||||||
|
|
|
@ -29,7 +29,7 @@ extern unsigned pm_base;
|
||||||
void acpi_create_fadt(acpi_fadt_t *fadt, acpi_facs_t *facs, void *dsdt)
|
void acpi_create_fadt(acpi_fadt_t *fadt, acpi_facs_t *facs, void *dsdt)
|
||||||
{
|
{
|
||||||
acpi_header_t *header = &(fadt->header);
|
acpi_header_t *header = &(fadt->header);
|
||||||
device_t dev;
|
struct device *dev;
|
||||||
int is_mcp55 = 0;
|
int is_mcp55 = 0;
|
||||||
dev = dev_find_device(PCI_VENDOR_ID_NVIDIA,
|
dev = dev_find_device(PCI_VENDOR_ID_NVIDIA,
|
||||||
PCI_DEVICE_ID_NVIDIA_MCP55_LPC, 0);
|
PCI_DEVICE_ID_NVIDIA_MCP55_LPC, 0);
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
#define CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL MAINBOARD_POWER_ON
|
#define CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL MAINBOARD_POWER_ON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void lpc_common_init(device_t dev, int master)
|
static void lpc_common_init(struct device *dev, int master)
|
||||||
{
|
{
|
||||||
u8 byte;
|
u8 byte;
|
||||||
void *ioapic_base;
|
void *ioapic_base;
|
||||||
|
@ -70,7 +70,7 @@ static void lpc_common_init(device_t dev, int master)
|
||||||
clear_ioapic(ioapic_base);
|
clear_ioapic(ioapic_base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lpc_slave_init(device_t dev)
|
static void lpc_slave_init(struct device *dev)
|
||||||
{
|
{
|
||||||
lpc_common_init(dev, 0);
|
lpc_common_init(dev, 0);
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ static void enable_hpet(struct device *dev)
|
||||||
printk(BIOS_DEBUG, "enabling HPET @0x%lx\n", hpet_address);
|
printk(BIOS_DEBUG, "enabling HPET @0x%lx\n", hpet_address);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lpc_init(device_t dev)
|
static void lpc_init(struct device *dev)
|
||||||
{
|
{
|
||||||
u8 byte, byte_old;
|
u8 byte, byte_old;
|
||||||
int on, nmi_option;
|
int on, nmi_option;
|
||||||
|
@ -145,7 +145,7 @@ static void lpc_init(device_t dev)
|
||||||
enable_hpet(dev);
|
enable_hpet(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mcp55_lpc_read_resources(device_t dev)
|
static void mcp55_lpc_read_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ static void mcp55_lpc_read_resources(device_t dev)
|
||||||
*
|
*
|
||||||
* @param dev The device whose children's resources are to be enabled.
|
* @param dev The device whose children's resources are to be enabled.
|
||||||
*/
|
*/
|
||||||
static void mcp55_lpc_enable_childrens_resources(device_t dev)
|
static void mcp55_lpc_enable_childrens_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
u32 reg, reg_var[4];
|
u32 reg, reg_var[4];
|
||||||
int i, var_num = 0;
|
int i, var_num = 0;
|
||||||
|
@ -186,7 +186,7 @@ static void mcp55_lpc_enable_childrens_resources(device_t dev)
|
||||||
reg = pci_read_config32(dev, 0xa0);
|
reg = pci_read_config32(dev, 0xa0);
|
||||||
|
|
||||||
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;
|
||||||
|
@ -234,14 +234,14 @@ static void mcp55_lpc_enable_childrens_resources(device_t dev)
|
||||||
pci_write_config32(dev, 0xa8 + i * 4, reg_var[i]);
|
pci_write_config32(dev, 0xa8 + i * 4, reg_var[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mcp55_lpc_enable_resources(device_t dev)
|
static void mcp55_lpc_enable_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
pci_dev_enable_resources(dev);
|
pci_dev_enable_resources(dev);
|
||||||
mcp55_lpc_enable_childrens_resources(dev);
|
mcp55_lpc_enable_childrens_resources(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
|
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
|
||||||
static void southbridge_acpi_fill_ssdt_generator(device_t device)
|
static void southbridge_acpi_fill_ssdt_generator(struct device *device)
|
||||||
{
|
{
|
||||||
amd_generate_powernow(0, 0, 0);
|
amd_generate_powernow(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
|
|
||||||
static u32 final_reg;
|
static u32 final_reg;
|
||||||
|
|
||||||
static device_t find_lpc_dev(device_t dev, unsigned devfn)
|
static struct device *find_lpc_dev(struct device *dev, unsigned devfn)
|
||||||
{
|
{
|
||||||
device_t lpc_dev;
|
struct device *lpc_dev;
|
||||||
|
|
||||||
lpc_dev = dev_find_slot(dev->bus->secondary, devfn);
|
lpc_dev = dev_find_slot(dev->bus->secondary, devfn);
|
||||||
|
|
||||||
|
@ -54,9 +54,9 @@ static device_t find_lpc_dev(device_t dev, unsigned devfn)
|
||||||
return lpc_dev;
|
return lpc_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mcp55_enable(device_t dev)
|
void mcp55_enable(struct device *dev)
|
||||||
{
|
{
|
||||||
device_t lpc_dev = 0, sm_dev = 0;
|
struct device *lpc_dev = NULL, *sm_dev = NULL;
|
||||||
unsigned index = 0, index2 = 0;
|
unsigned index = 0, index2 = 0;
|
||||||
u32 reg_old, reg;
|
u32 reg_old, reg;
|
||||||
u8 byte;
|
u8 byte;
|
||||||
|
@ -221,7 +221,8 @@ void mcp55_enable(device_t dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mcp55_set_subsystem(device_t dev, unsigned vendor, unsigned device)
|
static void mcp55_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 @@
|
||||||
|
|
||||||
#ifndef __PRE_RAM__
|
#ifndef __PRE_RAM__
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
void mcp55_enable(device_t dev);
|
void mcp55_enable(struct device *dev);
|
||||||
extern struct pci_operations mcp55_pci_ops;
|
extern struct pci_operations mcp55_pci_ops;
|
||||||
#else
|
#else
|
||||||
void enable_fid_change_on_sb(unsigned sbbusn, unsigned sbdn);
|
void enable_fid_change_on_sb(unsigned sbbusn, unsigned sbdn);
|
||||||
|
|
|
@ -29,7 +29,7 @@ static void pci_init(struct device *dev)
|
||||||
{
|
{
|
||||||
u32 dword;
|
u32 dword;
|
||||||
u16 word;
|
u16 word;
|
||||||
device_t pci_domain_dev;
|
struct device *pci_domain_dev;
|
||||||
struct resource *mem, *pref;
|
struct resource *mem, *pref;
|
||||||
|
|
||||||
/* System error enable */
|
/* System error enable */
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include "mcp55.h"
|
#include "mcp55.h"
|
||||||
#include "smbus.h"
|
#include "smbus.h"
|
||||||
|
|
||||||
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;
|
||||||
|
@ -41,7 +41,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, u8 val)
|
static int lsmbus_send_byte(struct device *dev, u8 val)
|
||||||
{
|
{
|
||||||
unsigned device;
|
unsigned device;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -55,7 +55,7 @@ static int lsmbus_send_byte(device_t dev, u8 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, u8 address)
|
static int lsmbus_read_byte(struct device *dev, u8 address)
|
||||||
{
|
{
|
||||||
unsigned device;
|
unsigned device;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -69,7 +69,7 @@ static int lsmbus_read_byte(device_t dev, u8 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, u8 address, u8 val)
|
static int lsmbus_write_byte(struct device *dev, u8 address, u8 val)
|
||||||
{
|
{
|
||||||
unsigned device;
|
unsigned device;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -93,7 +93,7 @@ static struct smbus_bus_operations lops_smbus_bus = {
|
||||||
unsigned pm_base;
|
unsigned pm_base;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void mcp55_sm_read_resources(device_t dev)
|
static void mcp55_sm_read_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
unsigned long index;
|
unsigned long index;
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ static void mcp55_sm_read_resources(device_t dev)
|
||||||
compact_resources(dev);
|
compact_resources(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mcp55_sm_init(device_t dev)
|
static void mcp55_sm_init(struct device *dev)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
|
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
|
Loading…
Reference in New Issue