nb/amd/agesa/family14: Get rid of device_t
Use of device_t has been abandoned in ramstage.
Change-Id: I9841fa591c4051653267b9e7c2f5b347d6f25b74
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/26199
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
diff --git a/src/northbridge/amd/agesa/family14/amdfam14_conf.c b/src/northbridge/amd/agesa/family14/amdfam14_conf.c
index 5de7a05..f78e3f5 100644
--- a/src/northbridge/amd/agesa/family14/amdfam14_conf.c
+++ b/src/northbridge/amd/agesa/family14/amdfam14_conf.c
@@ -24,7 +24,7 @@
static struct dram_base_mask_t get_dram_base_mask(u32 nodeid)
{
- device_t dev;
+ struct device *dev;
struct dram_base_mask_t d;
#if defined(__PRE_RAM__)
dev = PCI_DEV(CONFIG_CBB, CONFIG_CDB, 1);
@@ -50,7 +50,7 @@
{
u32 i;
u32 tempreg;
- device_t dev;
+ struct device *dev;
/* io range allocation */
tempreg = (nodeid&0xf) | ((nodeid & 0x30)<<(8-4)) | (linkn << 4) | ((io_max&0xf0)<<(12-4)); //limit
@@ -70,7 +70,7 @@
u32 io_min, u32 io_max, u32 nodes)
{
u32 i;
- device_t dev;
+ struct device *dev;
/* io range allocation */
for (i = 0; i < nodes; i++) {
@@ -92,8 +92,8 @@
return 0;
}
-static void set_io_addr_reg(device_t dev, u32 nodeid, u32 linkn, u32 reg,
- u32 io_min, u32 io_max)
+static void set_io_addr_reg(struct device *dev, u32 nodeid, u32 linkn, u32 reg,
+ u32 io_min, u32 io_max)
{
u32 tempreg;
diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c
index ab444bd..df52bf9 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -82,7 +82,7 @@
if (fx_devs == 0)
get_fx_devs();
for (i = 0; i < fx_devs; i++) {
- device_t dev;
+ struct device *dev;
dev = __f1_dev[i];
if (dev && dev->enabled) {
pci_write_config32(dev, reg, value);
@@ -90,14 +90,14 @@
}
}
-static u32 amdfam14_nodeid(device_t dev)
+static u32 amdfam14_nodeid(struct device *dev)
{
return (dev->path.pci.devfn >> 3) - CONFIG_CDB;
}
#include "amdfam14_conf.c"
-static void northbridge_init(device_t dev)
+static void northbridge_init(struct device *dev)
{
printk(BIOS_DEBUG, "Northbridge init\n");
}
@@ -113,15 +113,15 @@
}
-static int reg_useable(unsigned reg, device_t goal_dev, unsigned goal_nodeid,
- unsigned goal_link)
+static int reg_useable(unsigned reg, struct device *goal_dev,
+ unsigned goal_nodeid, unsigned goal_link)
{
struct resource *res;
unsigned nodeid, link = 0;
int result;
res = 0;
for (nodeid = 0; !res && (nodeid < fx_devs); nodeid++) {
- device_t dev;
+ struct device *dev;
dev = __f0_dev[nodeid];
if (!dev)
continue;
@@ -140,8 +140,8 @@
return result;
}
-static struct resource *amdfam14_find_iopair(device_t dev, unsigned nodeid,
- unsigned link)
+static struct resource *amdfam14_find_iopair(struct device *dev,
+ unsigned nodeid, unsigned link)
{
struct resource *resource;
u32 result, reg;
@@ -167,7 +167,7 @@
return resource;
}
-static struct resource *amdfam14_find_mempair(device_t dev, u32 nodeid,
+static struct resource *amdfam14_find_mempair(struct device *dev, u32 nodeid,
u32 link)
{
struct resource *resource;
@@ -202,7 +202,7 @@
return resource;
}
-static void amdfam14_link_read_bases(device_t dev, u32 nodeid, u32 link)
+static void amdfam14_link_read_bases(struct device *dev, u32 nodeid, u32 link)
{
struct resource *resource;
@@ -283,7 +283,7 @@
}
#endif
-static void nb_read_resources(device_t dev)
+static void nb_read_resources(struct device *dev)
{
u32 nodeid;
struct bus *link;
@@ -305,7 +305,8 @@
mmconf_resource(dev, 0xc0010058);
}
-static void set_resource(device_t dev, struct resource *resource, u32 nodeid)
+static void set_resource(struct device *dev, struct resource *resource,
+ u32 nodeid)
{
resource_t rbase, rend;
unsigned reg, link_num;
@@ -357,7 +358,7 @@
extern device_t vga_pri; // the primary vga device, defined in device.c
#endif
-static void create_vga_resource(device_t dev, unsigned nodeid)
+static void create_vga_resource(struct device *dev, unsigned nodeid)
{
struct bus *link;
@@ -389,7 +390,7 @@
set_vga_enable_reg(nodeid, link->link_num);
}
-static void nb_set_resources(device_t dev)
+static void nb_set_resources(struct device *dev)
{
unsigned nodeid;
struct bus *bus;
@@ -416,7 +417,7 @@
/* Domain/Root Complex related code */
-static void domain_read_resources(device_t dev)
+static void domain_read_resources(struct device *dev)
{
unsigned reg;
@@ -431,7 +432,7 @@
/* Is this register allocated? */
if ((base & 3) != 0) {
unsigned nodeid, reg_link;
- device_t reg_dev;
+ struct device *reg_dev;
if (reg < 0xc0) { // mmio
nodeid = (limit & 0xf) + (base & 0x30);
} else { // io
@@ -458,7 +459,7 @@
pci_domain_read_resources(dev);
}
-static void domain_set_resources(device_t dev)
+static void domain_set_resources(struct device *dev)
{
printk(BIOS_DEBUG, "\nFam14h - %s\n", __func__);
printk(BIOS_DEBUG, " amsr - incoming dev = %p\n", dev);
@@ -592,7 +593,7 @@
static void cpu_bus_scan(struct device *dev)
{
struct bus *cpu_bus = dev->link_list;
- device_t cpu;
+ struct device *cpu;
int apic_id, cores_found;
/* There is only one node for fam14, but there may be multiple cores. */
@@ -610,7 +611,7 @@
}
}
-static void cpu_bus_init(device_t dev)
+static void cpu_bus_init(struct device *dev)
{
initialize_cpus(dev->link_list);
}