summaryrefslogtreecommitdiff
path: root/src/include/device
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2017-03-06 18:01:04 -0800
committerLee Leahy <leroy.p.leahy@intel.com>2017-03-09 17:16:09 +0100
commit0ca2a0654ca4b403e8a54d558bce07a862820a9d (patch)
tree86c845b441c8ae4824bf6178943148ec94441c6d /src/include/device
parent75d8d8da47a3cc759d7395f5b0ef91ba13a59e51 (diff)
downloadcoreboot-0ca2a0654ca4b403e8a54d558bce07a862820a9d.tar.xz
src/include: Fix unsigned warnings
Fix warning detected by checkpatch.pl: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' BRANCH=none BUG=None TEST=Build and run on Galileo Gen2 Change-Id: I23d9b4b715aa74acc387db8fb8d3c73bd5cabfaa Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com> Reviewed-on: https://review.coreboot.org/18607 Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/include/device')
-rw-r--r--src/include/device/device.h18
-rw-r--r--src/include/device/dram/ddr3.h30
-rw-r--r--src/include/device/i2c.h36
-rw-r--r--src/include/device/path.h36
-rw-r--r--src/include/device/pci.h31
-rw-r--r--src/include/device/pci_ehci.h2
-rw-r--r--src/include/device/pnp.h4
-rw-r--r--src/include/device/resource.h6
8 files changed, 85 insertions, 78 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 284c039fc8..6fcb9ae8a4 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -85,7 +85,7 @@ struct bus {
ROMSTAGE_CONST struct device * dev; /* This bridge device */
ROMSTAGE_CONST struct device * children; /* devices behind this bridge */
ROMSTAGE_CONST struct bus *next; /* The next bridge on this device */
- unsigned bridge_ctrl; /* Bridge control register */
+ unsigned int bridge_ctrl; /* Bridge control register */
uint16_t bridge_cmd; /* Bridge command register */
unsigned char link_num; /* The index of this link */
uint16_t secondary; /* secondary bus number */
@@ -93,9 +93,9 @@ struct bus {
unsigned char cap; /* PCi capability offset */
uint32_t hcdn_reg; /* For HyperTransport link */
- unsigned reset_needed : 1;
- unsigned disable_relaxed_ordering : 1;
- unsigned ht_link_up : 1;
+ unsigned int reset_needed : 1;
+ unsigned int disable_relaxed_ordering : 1;
+ unsigned int ht_link_up : 1;
};
/*
@@ -119,8 +119,8 @@ struct device {
ROMSTAGE_CONST struct device * next; /* chain of all devices */
struct device_path path;
- unsigned vendor;
- unsigned device;
+ unsigned int vendor;
+ unsigned int device;
u16 subsystem_vendor;
u16 subsystem_device;
unsigned int class; /* 3 bytes: (base, sub, prog-if) */
@@ -201,11 +201,11 @@ device_t dev_find_path(device_t prev_match, enum device_path_type path_type);
device_t dev_find_slot (unsigned int bus, unsigned int devfn);
device_t dev_find_slot_on_smbus (unsigned int bus, unsigned int addr);
device_t dev_find_slot_pnp(u16 port, u16 device);
-device_t dev_find_lapic(unsigned apic_id);
+device_t dev_find_lapic(unsigned int apic_id);
int dev_count_cpu(void);
-device_t add_cpu_device(struct bus *cpu_bus, unsigned apic_id, int enabled);
-void set_cpu_topology(device_t cpu, unsigned node, unsigned package, unsigned core, unsigned thread);
+device_t add_cpu_device(struct bus *cpu_bus, unsigned int apic_id, int enabled);
+void set_cpu_topology(device_t cpu, unsigned int node, unsigned int package, unsigned int core, unsigned int thread);
#define amd_cpu_topology(cpu, node, core) \
set_cpu_topology(cpu, node, 0, core, 0)
diff --git a/src/include/device/dram/ddr3.h b/src/include/device/dram/ddr3.h
index 905aa8407a..bc9fca7495 100644
--- a/src/include/device/dram/ddr3.h
+++ b/src/include/device/dram/ddr3.h
@@ -106,35 +106,35 @@ typedef union dimm_flags_st {
struct {
/* Indicates if rank 1 of DIMM uses a mirrored pin mapping. See:
* Annex K: Serial Presence Detect (SPD) for DDR3 SDRAM */
- unsigned pins_mirrored:1;
+ unsigned int pins_mirrored:1;
/* Module can work at 1.50V - All DIMMS must be 1.5V operable */
- unsigned operable_1_50V:1;
+ unsigned int operable_1_50V:1;
/* Module can work at 1.35V */
- unsigned operable_1_35V:1;
+ unsigned int operable_1_35V:1;
/* Module can work at 1.20V */
- unsigned operable_1_25V:1;
+ unsigned int operable_1_25V:1;
/* Has an 8-bit bus extension, meaning the DIMM supports ECC */
- unsigned is_ecc:1;
+ unsigned int is_ecc:1;
/* DLL-Off Mode Support */
- unsigned dll_off_mode:1;
+ unsigned int dll_off_mode:1;
/* Indicates a drive strength of RZQ/6 (40 Ohm) is supported */
- unsigned rzq6_supported:1;
+ unsigned int rzq6_supported:1;
/* Indicates a drive strength of RZQ/7 (35 Ohm) is supported */
- unsigned rzq7_supported:1;
+ unsigned int rzq7_supported:1;
/* Partial Array Self Refresh */
- unsigned pasr:1;
+ unsigned int pasr:1;
/* On-die Thermal Sensor Readout */
- unsigned odts:1;
+ unsigned int odts:1;
/* Auto Self Refresh */
- unsigned asr:1;
+ unsigned int asr:1;
/* Extended temperature range supported */
- unsigned ext_temp_range:1;
+ unsigned int ext_temp_range:1;
/* Operating at extended temperature requires 2X refresh rate */
- unsigned ext_temp_refresh:1;
+ unsigned int ext_temp_refresh:1;
/* Thermal sensor incorporated */
- unsigned therm_sensor:1;
+ unsigned int therm_sensor:1;
};
- unsigned raw;
+ unsigned int raw;
} dimm_flags_t;
/**
diff --git a/src/include/device/i2c.h b/src/include/device/i2c.h
index d8a793c716..6316748b85 100644
--- a/src/include/device/i2c.h
+++ b/src/include/device/i2c.h
@@ -40,27 +40,29 @@ struct i2c_seg
int len;
};
-int platform_i2c_transfer(unsigned bus, struct i2c_seg *segments, int count);
+int platform_i2c_transfer(unsigned int bus, struct i2c_seg *segments,
+ int count);
#define SOFTWARE_I2C_MAX_BUS 10 /* increase as necessary */
struct software_i2c_ops {
- void (*set_sda)(unsigned bus, int high);
- void (*set_scl)(unsigned bus, int high);
- int (*get_sda)(unsigned bus);
- int (*get_scl)(unsigned bus);
+ void (*set_sda)(unsigned int bus, int high);
+ void (*set_scl)(unsigned int bus, int high);
+ int (*get_sda)(unsigned int bus);
+ int (*get_scl)(unsigned int bus);
};
extern struct software_i2c_ops *software_i2c[];
-int software_i2c_transfer(unsigned bus, struct i2c_seg *segments, int count);
-void software_i2c_wedge_ack(unsigned bus, u8 chip);
-void software_i2c_wedge_read(unsigned bus, u8 chip, u8 reg, int bit_count);
-void software_i2c_wedge_write(unsigned bus, u8 chip, u8 reg, int bit_count);
+int software_i2c_transfer(unsigned int bus, struct i2c_seg *segments,
+ int count);
+void software_i2c_wedge_ack(unsigned int bus, u8 chip);
+void software_i2c_wedge_read(unsigned int bus, u8 chip, u8 reg, int bit_count);
+void software_i2c_wedge_write(unsigned int bus, u8 chip, u8 reg, int bit_count);
-int i2c_read_field(unsigned bus, uint8_t chip, uint8_t reg, uint8_t *data,
+int i2c_read_field(unsigned int bus, uint8_t chip, uint8_t reg, uint8_t *data,
uint8_t mask, uint8_t shift);
-int i2c_write_field(unsigned bus, uint8_t chip, uint8_t reg, uint8_t data,
+int i2c_write_field(unsigned int bus, uint8_t chip, uint8_t reg, uint8_t data,
uint8_t mask, uint8_t shift);
/*
@@ -69,7 +71,7 @@ int i2c_write_field(unsigned bus, uint8_t chip, uint8_t reg, uint8_t data,
* Need this ugly stub to arbitrate since I2C device drivers hardcode
* 'i2c_transfer()' as their entry point.
*/
-static inline int i2c_transfer(unsigned bus, struct i2c_seg *segments,
+static inline int i2c_transfer(unsigned int bus, struct i2c_seg *segments,
int count)
{
if (CONFIG_SOFTWARE_I2C)
@@ -84,7 +86,7 @@ static inline int i2c_transfer(unsigned bus, struct i2c_seg *segments,
*
* [start][slave addr][r][data][stop]
*/
-static inline int i2c_read_raw(unsigned bus, uint8_t chip, uint8_t *data,
+static inline int i2c_read_raw(unsigned int bus, uint8_t chip, uint8_t *data,
int len)
{
struct i2c_seg seg =
@@ -97,7 +99,7 @@ static inline int i2c_read_raw(unsigned bus, uint8_t chip, uint8_t *data,
*
* [start][slave addr][w][data][stop]
*/
-static inline int i2c_write_raw(unsigned bus, uint8_t chip, uint8_t *data,
+static inline int i2c_write_raw(unsigned int bus, uint8_t chip, uint8_t *data,
int len)
{
struct i2c_seg seg =
@@ -110,7 +112,7 @@ static inline int i2c_write_raw(unsigned bus, uint8_t chip, uint8_t *data,
*
* [start][slave addr][w][register addr][start][slave addr][r][data...][stop]
*/
-static inline int i2c_read_bytes(unsigned bus, uint8_t chip, uint8_t reg,
+static inline int i2c_read_bytes(unsigned int bus, uint8_t chip, uint8_t reg,
uint8_t *data, int len)
{
struct i2c_seg seg[2];
@@ -132,7 +134,7 @@ static inline int i2c_read_bytes(unsigned bus, uint8_t chip, uint8_t reg,
*
* [start][slave addr][w][register addr][start][slave addr][r][data][stop]
*/
-static inline int i2c_readb(unsigned bus, uint8_t chip, uint8_t reg,
+static inline int i2c_readb(unsigned int bus, uint8_t chip, uint8_t reg,
uint8_t *data)
{
struct i2c_seg seg[2];
@@ -154,7 +156,7 @@ static inline int i2c_readb(unsigned bus, uint8_t chip, uint8_t reg,
*
* [start][slave addr][w][register addr][data][stop]
*/
-static inline int i2c_writeb(unsigned bus, uint8_t chip, uint8_t reg,
+static inline int i2c_writeb(unsigned int bus, uint8_t chip, uint8_t reg,
uint8_t data)
{
struct i2c_seg seg;
diff --git a/src/include/device/path.h b/src/include/device/path.h
index 849b579455..1eaa32fb57 100644
--- a/src/include/device/path.h
+++ b/src/include/device/path.h
@@ -40,64 +40,64 @@ enum device_path_type {
struct domain_path
{
- unsigned domain;
+ unsigned int domain;
};
struct pci_path
{
- unsigned devfn;
+ unsigned int devfn;
};
struct pnp_path
{
- unsigned port;
- unsigned device;
+ unsigned int port;
+ unsigned int device;
};
struct i2c_path
{
- unsigned device;
- unsigned mode_10bit;
+ unsigned int device;
+ unsigned int mode_10bit;
};
struct spi_path
{
- unsigned cs;
+ unsigned int cs;
};
struct apic_path
{
- unsigned apic_id;
- unsigned package_id;
- unsigned node_id;
- unsigned core_id;
- unsigned thread_id;
+ unsigned int apic_id;
+ unsigned int package_id;
+ unsigned int node_id;
+ unsigned int core_id;
+ unsigned int thread_id;
};
struct ioapic_path
{
- unsigned ioapic_id;
+ unsigned int ioapic_id;
};
struct cpu_cluster_path
{
- unsigned cluster;
+ unsigned int cluster;
};
struct cpu_path
{
- unsigned id;
+ unsigned int id;
};
struct cpu_bus_path
{
- unsigned id;
+ unsigned int id;
};
struct generic_path
{
- unsigned id;
- unsigned subid;
+ unsigned int id;
+ unsigned int subid;
};
diff --git a/src/include/device/pci.h b/src/include/device/pci.h
index e167752e92..8dc7c46d35 100644
--- a/src/include/device/pci.h
+++ b/src/include/device/pci.h
@@ -32,7 +32,8 @@
/* Common pci operations without a standard interface */
struct pci_operations {
/* set the Subsystem IDs for the PCI device */
- void (*set_subsystem)(device_t dev, unsigned vendor, unsigned device);
+ void (*set_subsystem)(device_t dev, unsigned int vendor,
+ unsigned int device);
void (*set_L1_ss_latency)(device_t dev, unsigned int off);
};
@@ -69,26 +70,28 @@ void pci_dev_set_resources(device_t dev);
void pci_dev_enable_resources(device_t dev);
void pci_bus_enable_resources(device_t dev);
void pci_bus_reset(struct bus *bus);
-device_t pci_probe_dev(device_t dev, struct bus *bus, unsigned devfn);
+device_t pci_probe_dev(device_t dev, struct bus *bus, unsigned int devfn);
void do_pci_scan_bridge(device_t bus,
void (*do_scan_bus)(struct bus *bus,
- unsigned min_devfn, unsigned max_devfn));
+ unsigned int min_devfn, unsigned int max_devfn));
void pci_scan_bridge(device_t bus);
-void pci_scan_bus(struct bus *bus, unsigned min_devfn, unsigned max_devfn);
+void pci_scan_bus(struct bus *bus, unsigned int min_devfn,
+ unsigned int max_devfn);
-uint8_t pci_moving_config8(struct device *dev, unsigned reg);
-uint16_t pci_moving_config16(struct device *dev, unsigned reg);
-uint32_t pci_moving_config32(struct device *dev, unsigned reg);
+uint8_t pci_moving_config8(struct device *dev, unsigned int reg);
+uint16_t pci_moving_config16(struct device *dev, unsigned int reg);
+uint32_t pci_moving_config32(struct device *dev, unsigned int reg);
struct resource *pci_get_resource(struct device *dev, unsigned long index);
-void pci_dev_set_subsystem(device_t dev, unsigned vendor, unsigned device);
+void pci_dev_set_subsystem(device_t dev, unsigned int vendor,
+ unsigned int device);
void pci_dev_init(struct device *dev);
unsigned int pci_match_simple_dev(device_t dev, pci_devfn_t sdev);
const char * pin_to_str(int pin);
int get_pci_irq_pins(device_t dev, device_t *parent_bdg);
-void pci_assign_irqs(unsigned bus, unsigned slot,
+void pci_assign_irqs(unsigned int bus, unsigned int slot,
const unsigned char pIntAtoD[4]);
const char *get_pci_class_name(device_t dev);
const char *get_pci_subclass_name(device_t dev);
@@ -109,11 +112,13 @@ static inline const struct pci_operations *ops_pci(device_t dev)
#endif /* ! __SIMPLE_DEVICE__ */
#ifdef __SIMPLE_DEVICE__
-unsigned pci_find_next_capability(pci_devfn_t dev, unsigned cap, unsigned last);
-unsigned pci_find_capability(pci_devfn_t dev, unsigned cap);
+unsigned int pci_find_next_capability(pci_devfn_t dev, unsigned int cap,
+ unsigned int last);
+unsigned int pci_find_capability(pci_devfn_t dev, unsigned int cap);
#else /* !__SIMPLE_DEVICE__ */
-unsigned pci_find_next_capability(device_t dev, unsigned cap, unsigned last);
-unsigned pci_find_capability(device_t dev, unsigned cap);
+unsigned int pci_find_next_capability(device_t dev, unsigned int cap,
+ unsigned int last);
+unsigned int pci_find_capability(device_t dev, unsigned int cap);
#endif /* __SIMPLE_DEVICE__ */
void pci_early_bridge_init(void);
diff --git a/src/include/device/pci_ehci.h b/src/include/device/pci_ehci.h
index e80cf2bbab..42e1d8365f 100644
--- a/src/include/device/pci_ehci.h
+++ b/src/include/device/pci_ehci.h
@@ -23,7 +23,7 @@
#define EHCI_BAR_INDEX 0x10
#define PCI_EHCI_CLASSCODE 0x0c0320 /* USB2.0 with EHCI controller */
-pci_devfn_t pci_ehci_dbg_dev(unsigned hcd_idx);
+pci_devfn_t pci_ehci_dbg_dev(unsigned int hcd_idx);
u8 *pci_ehci_base_regs(pci_devfn_t dev);
void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port);
void pci_ehci_dbg_enable(pci_devfn_t dev, unsigned long base);
diff --git a/src/include/device/pnp.h b/src/include/device/pnp.h
index cfed7c708d..bb66317742 100644
--- a/src/include/device/pnp.h
+++ b/src/include/device/pnp.h
@@ -31,7 +31,7 @@ extern struct device_operations pnp_ops;
/* PNP helper operations */
struct io_info {
- unsigned mask, set;
+ unsigned int mask, set;
};
struct pnp_info {
@@ -64,7 +64,7 @@ struct pnp_info {
#define PNP_MSCE 0x800000
struct io_info io0, io1, io2, io3;
};
-struct resource *pnp_get_resource(device_t dev, unsigned index);
+struct resource *pnp_get_resource(device_t dev, unsigned int index);
void pnp_enable_devices(struct device *dev, struct device_operations *ops,
unsigned int functions, struct pnp_info *info);
diff --git a/src/include/device/resource.h b/src/include/device/resource.h
index 768c86d46a..7160eec74a 100644
--- a/src/include/device/resource.h
+++ b/src/include/device/resource.h
@@ -57,9 +57,9 @@ struct resource {
struct device;
struct bus;
extern void compact_resources(struct device * dev);
-extern struct resource *probe_resource(struct device *dev, unsigned index);
-extern struct resource *new_resource(struct device * dev, unsigned index);
-extern struct resource *find_resource(struct device * dev, unsigned index);
+extern struct resource *probe_resource(struct device *dev, unsigned int index);
+extern struct resource *new_resource(struct device * dev, unsigned int index);
+extern struct resource *find_resource(struct device * dev, unsigned int index);
extern resource_t resource_end(struct resource *resource);
extern resource_t resource_max(struct resource *resource);
extern void report_resource_stored(struct device * dev, struct resource *resource, const char *comment);