summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElyes HAOUAS <ehaouas@noos.fr>2018-05-09 17:58:33 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2018-05-20 09:17:29 +0000
commit0d7c7a84e7b53702e0ff2b7c8e8598dddc6a9e4b (patch)
tree69cd78914bb30947111566d0b8e4e140af8ea810 /src
parenta93e754c36f27508a233011871fba2150553f90c (diff)
downloadcoreboot-0d7c7a84e7b53702e0ff2b7c8e8598dddc6a9e4b.tar.xz
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>
Diffstat (limited to 'src')
-rw-r--r--src/northbridge/amd/agesa/family14/amdfam14_conf.c10
-rw-r--r--src/northbridge/amd/agesa/family14/northbridge.c39
2 files changed, 25 insertions, 24 deletions
diff --git a/src/northbridge/amd/agesa/family14/amdfam14_conf.c b/src/northbridge/amd/agesa/family14/amdfam14_conf.c
index 5de7a05b6f..f78e3f55a4 100644
--- a/src/northbridge/amd/agesa/family14/amdfam14_conf.c
+++ b/src/northbridge/amd/agesa/family14/amdfam14_conf.c
@@ -24,7 +24,7 @@ struct dram_base_mask_t {
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 @@ static void set_ht_c_io_addr_reg(u32 nodeid, u32 linkn, u32 ht_c_index,
{
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 @@ static void clear_ht_c_io_addr_reg(u32 nodeid, u32 linkn, u32 ht_c_index,
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 @@ static u32 get_mmio_addr_index(u32 nodeid, u32 linkn)
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 ab444bd7bf..df52bf94f7 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -82,7 +82,7 @@ static void f1_write_config32(unsigned reg, u32 value)
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 void f1_write_config32(unsigned reg, u32 value)
}
}
-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 void set_vga_enable_reg(u32 nodeid, u32 linkn)
}
-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 @@ static int reg_useable(unsigned reg, device_t goal_dev, unsigned goal_nodeid,
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 @@ static struct resource *amdfam14_find_iopair(device_t dev, unsigned nodeid,
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 @@ static struct resource *amdfam14_find_mempair(device_t dev, u32 nodeid,
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 @@ static struct hw_mem_hole_info get_hw_mem_hole_info(void)
}
#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 @@ static void nb_read_resources(device_t dev)
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 @@ static void set_resource(device_t dev, struct resource *resource, u32 nodeid)
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 @@ static void create_vga_resource(device_t dev, unsigned nodeid)
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 @@ static void nb_set_resources(device_t dev)
/* 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 @@ static void domain_read_resources(device_t dev)
/* 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 @@ static void domain_read_resources(device_t dev)
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 const char *domain_acpi_name(const struct device *dev)
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_scan(struct device *dev)
}
}
-static void cpu_bus_init(device_t dev)
+static void cpu_bus_init(struct device *dev)
{
initialize_cpus(dev->link_list);
}