sb/nvidia/ck804: Get rid of device_t
Use of device_t has been abandoned in ramstage. Change-Id: I59078ff96428d134f108ff2551556c8a7d2d3b37 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/26401 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
parent
8349cb58de
commit
1cbe19f2d8
|
@ -24,9 +24,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);
|
||||||
if (!lpc_dev)
|
if (!lpc_dev)
|
||||||
|
@ -53,9 +53,9 @@ static device_t find_lpc_dev(device_t dev, unsigned devfn)
|
||||||
return lpc_dev;
|
return lpc_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ck804_enable(device_t dev)
|
static void ck804_enable(struct device *dev)
|
||||||
{
|
{
|
||||||
device_t lpc_dev;
|
struct device *lpc_dev;
|
||||||
unsigned index = 0, index2 = 0, deviceid, vendorid, devfn;
|
unsigned index = 0, index2 = 0, deviceid, vendorid, devfn;
|
||||||
u32 reg_old, reg;
|
u32 reg_old, reg;
|
||||||
u8 byte;
|
u8 byte;
|
||||||
|
@ -184,7 +184,8 @@ static void ck804_enable(device_t dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ck804_set_subsystem(device_t dev, unsigned vendor, unsigned device)
|
static void ck804_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 @@
|
||||||
|
|
||||||
unsigned long acpi_fill_mcfg(unsigned long current)
|
unsigned long acpi_fill_mcfg(unsigned long current)
|
||||||
{
|
{
|
||||||
device_t dev;
|
struct device *dev;
|
||||||
unsigned long mcfg_base;
|
unsigned long mcfg_base;
|
||||||
|
|
||||||
dev = dev_find_slot(0x0, PCI_DEVFN(0x0,0));
|
dev = dev_find_slot(0x0, PCI_DEVFN(0x0,0));
|
||||||
|
|
|
@ -51,7 +51,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)
|
static void lpc_common_init(struct device *dev)
|
||||||
{
|
{
|
||||||
u32 dword;
|
u32 dword;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -68,12 +68,12 @@ static void lpc_common_init(device_t dev)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lpc_slave_init(device_t dev)
|
static void lpc_slave_init(struct device *dev)
|
||||||
{
|
{
|
||||||
lpc_common_init(dev);
|
lpc_common_init(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rom_dummy_write(device_t dev)
|
static void rom_dummy_write(struct device *dev)
|
||||||
{
|
{
|
||||||
u8 old, new;
|
u8 old, new;
|
||||||
u8 *p;
|
u8 *p;
|
||||||
|
@ -103,7 +103,7 @@ static void rom_dummy_write(device_t dev)
|
||||||
|
|
||||||
unsigned pm_base = 0;
|
unsigned pm_base = 0;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -158,7 +158,7 @@ static void lpc_init(device_t dev)
|
||||||
rom_dummy_write(dev);
|
rom_dummy_write(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ck804_lpc_read_resources(device_t dev)
|
static void ck804_lpc_read_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
unsigned long index;
|
unsigned long index;
|
||||||
|
@ -203,7 +203,7 @@ static void ck804_lpc_read_resources(device_t dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ck804_lpc_set_resources(device_t dev)
|
static void ck804_lpc_set_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
u8 byte;
|
u8 byte;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -239,7 +239,7 @@ static void ck804_lpc_set_resources(device_t dev)
|
||||||
* This function is called by the global enable_resources() indirectly via the
|
* This function is called by the global enable_resources() indirectly via the
|
||||||
* device_operation::enable_resources() method of devices.
|
* device_operation::enable_resources() method of devices.
|
||||||
*/
|
*/
|
||||||
static void ck804_lpc_enable_childrens_resources(device_t dev)
|
static void ck804_lpc_enable_childrens_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
struct bus *link;
|
struct bus *link;
|
||||||
u32 reg, reg_var[4];
|
u32 reg, reg_var[4];
|
||||||
|
@ -248,7 +248,7 @@ static void ck804_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;
|
||||||
|
@ -295,7 +295,7 @@ static void ck804_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 ck804_lpc_enable_resources(device_t dev)
|
static void ck804_lpc_enable_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
pci_dev_enable_resources(dev);
|
pci_dev_enable_resources(dev);
|
||||||
ck804_lpc_enable_childrens_resources(dev);
|
ck804_lpc_enable_childrens_resources(dev);
|
||||||
|
@ -303,7 +303,7 @@ static void ck804_lpc_enable_resources(device_t 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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
static void pci_init(struct device *dev)
|
static void pci_init(struct device *dev)
|
||||||
{
|
{
|
||||||
u32 dword;
|
u32 dword;
|
||||||
device_t pci_domain_dev;
|
struct device *pci_domain_dev;
|
||||||
struct resource *mem, *pref;
|
struct resource *mem, *pref;
|
||||||
|
|
||||||
dword = pci_read_config32(dev, 0x04);
|
dword = pci_read_config32(dev, 0x04);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "chip.h"
|
#include "chip.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;
|
||||||
|
@ -38,7 +38,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;
|
||||||
|
@ -52,7 +52,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;
|
||||||
|
@ -66,7 +66,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;
|
||||||
|
|
Loading…
Reference in New Issue