src/device: Get rid of device_t
Use of device_t has been abandoned in ramstage. The function prototype for "struct device *add_cpu_device" is already correct and doesn't need to be fixed. Change-Id: I7bd8b93922f113bdaf7ba460acf6a7d62c4df013 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/26067 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
9966703776
commit
e348066bd8
|
@ -17,10 +17,11 @@
|
|||
#include <device/device.h>
|
||||
#include <console/console.h>
|
||||
|
||||
device_t add_cpu_device(struct bus *cpu_bus, unsigned apic_id, int enabled)
|
||||
struct device *add_cpu_device(struct bus *cpu_bus, unsigned apic_id,
|
||||
int enabled)
|
||||
{
|
||||
struct device_path cpu_path;
|
||||
device_t cpu;
|
||||
struct device *cpu;
|
||||
|
||||
/* Build the CPU device path */
|
||||
cpu_path.type = DEVICE_PATH_APIC;
|
||||
|
@ -41,7 +42,8 @@ device_t add_cpu_device(struct bus *cpu_bus, unsigned apic_id, int enabled)
|
|||
return cpu;
|
||||
}
|
||||
|
||||
void set_cpu_topology(device_t cpu, unsigned node, unsigned package, unsigned core, unsigned thread)
|
||||
void set_cpu_topology(struct device *cpu, unsigned node, unsigned package,
|
||||
unsigned core, unsigned thread)
|
||||
{
|
||||
cpu->path.apic.node_id = node;
|
||||
cpu->path.apic.package_id = package;
|
||||
|
|
|
@ -122,7 +122,7 @@ uint64_t uma_memory_size = 0;
|
|||
*/
|
||||
static device_t __alloc_dev(struct bus *parent, struct device_path *path)
|
||||
{
|
||||
device_t dev, child;
|
||||
struct device *dev, *child;
|
||||
|
||||
/* Find the last child of our parent. */
|
||||
for (child = parent->children; child && child->sibling; /* */ )
|
||||
|
@ -156,7 +156,7 @@ static device_t __alloc_dev(struct bus *parent, struct device_path *path)
|
|||
|
||||
device_t alloc_dev(struct bus *parent, struct device_path *path)
|
||||
{
|
||||
device_t dev;
|
||||
struct device *dev;
|
||||
spin_lock(&dev_lock);
|
||||
dev = __alloc_dev(parent, path);
|
||||
spin_unlock(&dev_lock);
|
||||
|
@ -172,7 +172,7 @@ device_t alloc_dev(struct bus *parent, struct device_path *path)
|
|||
*/
|
||||
device_t alloc_find_dev(struct bus *parent, struct device_path *path)
|
||||
{
|
||||
device_t child;
|
||||
struct device *child;
|
||||
spin_lock(&dev_lock);
|
||||
child = find_dev_path(parent, path);
|
||||
if (!child)
|
||||
|
@ -627,7 +627,8 @@ struct constraints {
|
|||
struct resource io, mem;
|
||||
};
|
||||
|
||||
static struct resource * resource_limit(struct constraints *limits, struct resource *res)
|
||||
static struct resource *resource_limit(struct constraints *limits,
|
||||
struct resource *res)
|
||||
{
|
||||
struct resource *lim = NULL;
|
||||
|
||||
|
@ -640,7 +641,8 @@ static struct resource * resource_limit(struct constraints *limits, struct resou
|
|||
return lim;
|
||||
}
|
||||
|
||||
static void constrain_resources(const struct device *dev, struct constraints* limits)
|
||||
static void constrain_resources(const struct device *dev,
|
||||
struct constraints* limits)
|
||||
{
|
||||
const struct device *child;
|
||||
struct resource *res;
|
||||
|
@ -754,7 +756,7 @@ static void avoid_fixed_resources(const struct device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
device_t vga_pri = 0;
|
||||
struct device *vga_pri = NULL;
|
||||
static void set_vga_bridge_bits(void)
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -138,8 +138,8 @@ struct device *dev_find_lapic(unsigned apic_id)
|
|||
* @param path_type The Device Path Type.
|
||||
* @return Pointer to the device structure (if found), 0 otherwise.
|
||||
*/
|
||||
struct device *dev_find_path(device_t prev_match,
|
||||
enum device_path_type path_type)
|
||||
struct device *dev_find_path(struct device *prev_match,
|
||||
enum device_path_type path_type)
|
||||
{
|
||||
struct device *dev;
|
||||
struct device *result = NULL;
|
||||
|
@ -857,7 +857,8 @@ static void resource_tree(const struct device *root, int debug_level, int depth)
|
|||
}
|
||||
}
|
||||
|
||||
void print_resource_tree(const struct device *root, int debug_level, const char *msg)
|
||||
void print_resource_tree(const struct device *root, int debug_level,
|
||||
const char *msg)
|
||||
{
|
||||
/* Bail if root is null. */
|
||||
if (!root) {
|
||||
|
@ -957,7 +958,8 @@ void show_all_devs_resources(int debug_level, const char* msg)
|
|||
}
|
||||
|
||||
void fixed_mem_resource(struct device *dev, unsigned long index,
|
||||
unsigned long basek, unsigned long sizek, unsigned long type)
|
||||
unsigned long basek, unsigned long sizek,
|
||||
unsigned long type)
|
||||
{
|
||||
struct resource *resource;
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ struct rom_header *pci_rom_load(struct device *dev,
|
|||
*/
|
||||
if (PCI_CLASS_DISPLAY_VGA == (dev->class >> 8)) {
|
||||
#if !IS_ENABLED(CONFIG_MULTIPLE_VGA_ADAPTERS)
|
||||
extern device_t vga_pri; /* Primary VGA device (device.c). */
|
||||
extern struct device *vga_pri; /* Primary VGA device (device.c). */
|
||||
if (dev != vga_pri) return NULL; /* Only one VGA supported. */
|
||||
#endif
|
||||
if ((void *)PCI_VGA_RAM_IMAGE_START != rom_header) {
|
||||
|
@ -202,9 +202,8 @@ static struct rom_header *check_initialized(struct device *dev)
|
|||
}
|
||||
|
||||
static unsigned long
|
||||
pci_rom_acpi_fill_vfct(struct device *device,
|
||||
struct acpi_vfct *vfct_struct,
|
||||
unsigned long current)
|
||||
pci_rom_acpi_fill_vfct(struct device *device, struct acpi_vfct *vfct_struct,
|
||||
unsigned long current)
|
||||
{
|
||||
struct acpi_vfct_image_hdr *header = &vfct_struct->image_hdr;
|
||||
struct rom_header *rom;
|
||||
|
@ -238,9 +237,8 @@ pci_rom_acpi_fill_vfct(struct device *device,
|
|||
}
|
||||
|
||||
unsigned long
|
||||
pci_rom_write_acpi_tables(struct device *device,
|
||||
unsigned long current,
|
||||
struct acpi_rsdp *rsdp)
|
||||
pci_rom_write_acpi_tables(struct device *device, unsigned long current,
|
||||
struct acpi_rsdp *rsdp)
|
||||
{
|
||||
struct acpi_vfct *vfct;
|
||||
struct rom_header *rom;
|
||||
|
|
Loading…
Reference in New Issue