changed dev->enable to dev->enabled. Sorry, I am the only one who can't speak

English in the project.


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1543 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Li-Ta Lo 2004-04-29 20:08:54 +00:00
parent fcdd571aee
commit 69c5a905ed
13 changed files with 50 additions and 48 deletions

View File

@ -115,7 +115,7 @@ void chip_enumerate(struct chip *chip)
printk_spew(" parent: (%p) %s\n", printk_spew(" parent: (%p) %s\n",
dev->bus->dev, dev_path(dev->bus->dev)); dev->bus->dev, dev_path(dev->bus->dev));
dev->chip = chip; dev->chip = chip;
dev->enable = chip->path[i].enable; dev->enabled = chip->path[i].enable;
dev->links = link + 1; dev->links = link + 1;
for (child = chip->children; child; child = child->next) { for (child = chip->children; child; child = child->next) {
if (!child->bus && child->link == i) { if (!child->bus && child->link == i) {
@ -152,7 +152,7 @@ void chip_enumerate(struct chip *chip)
* A static device chain is a linked list of static device structures which are * A static device chain is a linked list of static device structures which are
* on the same branch of the static device tree. This function does not only * on the same branch of the static device tree. This function does not only
* enumerate the devices on a single chain, as its name suggest, it also walks * enumerate the devices on a single chain, as its name suggest, it also walks
* into the subordinary chains. It calls the device specific * into the subordinary chains by recursion. It calls the device specific
* chip_control::enumerate() of the device if one exists or calls the generic * chip_control::enumerate() of the device if one exists or calls the generic
* chip_enumerate(). * chip_enumerate().
* *
@ -187,8 +187,12 @@ static void enumerate_static_device_chain(struct chip *root)
/** /**
* @brief Enumerate static devices in the system. * @brief Enumerate static devices in the system.
* *
* \note The definition of 'enumerate' is not clear in this context. Does it mean * Static device is . Static devices are actually enumerated or "listed" in
* probe ? * the Config.lb config file and the corresponding data structures are
* generated by config tool in the static.c.
*
* \note The definition of 'enumerate' is not clear in this context. Does it
* mean probe ?
* *
* \note How do we determine the existence of the static devices ? Static * \note How do we determine the existence of the static devices ? Static
* devices are listed in the config file and generated at compile time by config * devices are listed in the config file and generated at compile time by config
@ -203,5 +207,6 @@ static void enumerate_static_device_chain(struct chip *root)
*/ */
void enumerate_static_devices(void) void enumerate_static_devices(void)
{ {
printk_info("Enumerating static devices...\n");
enumerate_static_device_chain(&static_root); enumerate_static_device_chain(&static_root);
} }

View File

@ -85,7 +85,7 @@ device_t alloc_dev(struct bus *parent, struct device_path *path)
} }
/* If we don't have any other information about a device enable it */ /* If we don't have any other information about a device enable it */
dev->enable = 1; dev->enabled = 1;
return dev; return dev;
} }
@ -135,7 +135,7 @@ static void read_resources(struct bus *bus)
dev_path(curdev)); dev_path(curdev));
continue; continue;
} }
if (!curdev->enable) { if (!curdev->enabled) {
continue; continue;
} }
@ -434,7 +434,7 @@ void assign_resources(struct bus *bus)
dev_path(curdev)); dev_path(curdev));
continue; continue;
} }
if (!curdev->enable) { if (!curdev->enabled) {
continue; continue;
} }
curdev->ops->set_resources(curdev); curdev->ops->set_resources(curdev);
@ -461,7 +461,7 @@ void enable_resources(struct device *dev)
printk_err("%s missing enable_resources\n", dev_path(dev)); printk_err("%s missing enable_resources\n", dev_path(dev));
return; return;
} }
if (!dev->enable) { if (!dev->enabled) {
return; return;
} }
dev->ops->enable_resources(dev); dev->ops->enable_resources(dev);
@ -471,7 +471,7 @@ void enable_resources(struct device *dev)
* @brief Determine the existence of dynamic devices and construct dynamic * @brief Determine the existence of dynamic devices and construct dynamic
* device tree. * device tree.
* *
* Start for the root device 'dev_root', scan the buses in the system * Start form the root device 'dev_root', scan the buses in the system
* recursively, build the dynamic device tree according to the result * recursively, build the dynamic device tree according to the result
* of the probe. * of the probe.
* *
@ -565,7 +565,7 @@ void dev_initialize(void)
printk_info("Initializing devices...\n"); printk_info("Initializing devices...\n");
for (dev = all_devices; dev; dev = dev->next) { for (dev = all_devices; dev; dev = dev->next) {
if (dev->enable && dev->ops && dev->ops->init) { if (dev->enabled && dev->ops && dev->ops->init) {
printk_debug("%s init\n", dev_path(dev)); printk_debug("%s init\n", dev_path(dev));
dev->ops->init(dev); dev->ops->init(dev);
} }

View File

@ -264,10 +264,10 @@ unsigned int hypertransport_scan_chain(struct bus *bus, unsigned int max)
*chain_last = dev; *chain_last = dev;
/* Run the magice enable sequence for the device */ /* Run the magice enable sequence for the device */
if (dev->chip && dev->chip->control && dev->chip->control->enable_dev) { if (dev->chip && dev->chip->control && dev->chip->control->enable_dev) {
int enable = dev->enable; int enable = dev->enabled;
dev->enable = 1; dev->enabled = 1;
dev->chip->control->enable_dev(dev); dev->chip->control->enable_dev(dev);
dev->enable = enable; dev->enabled = enable;
} }
/* Now read the vendor and device id */ /* Now read the vendor and device id */
id = pci_read_config32(dev, PCI_VENDOR_ID); id = pci_read_config32(dev, PCI_VENDOR_ID);
@ -335,7 +335,7 @@ unsigned int hypertransport_scan_chain(struct bus *bus, unsigned int max)
printk_debug("%s [%04x/%04x] %s next_unitid: %04x\n", printk_debug("%s [%04x/%04x] %s next_unitid: %04x\n",
dev_path(dev), dev_path(dev),
dev->vendor, dev->device, dev->vendor, dev->device,
(dev->enable? "enabled": "disabled"), next_unitid); (dev->enabled? "enabled": "disabled"), next_unitid);
} while((last_unitid != next_unitid) && (next_unitid <= 0x1f)); } while((last_unitid != next_unitid) && (next_unitid <= 0x1f));
#if HAVE_HARD_RESET == 1 #if HAVE_HARD_RESET == 1

View File

@ -470,7 +470,7 @@ static void set_pci_ops(struct device *dev)
break; break;
default: default:
bad: bad:
if (dev->enable) { if (dev->enabled) {
printk_err("%s [%04x/%04x/%06x] has unknown header " printk_err("%s [%04x/%04x/%06x] has unknown header "
"type %02x, ignoring.\n", "type %02x, ignoring.\n",
dev_path(dev), dev_path(dev),
@ -605,10 +605,10 @@ unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn,
* some arbitray code without any justification */ * some arbitray code without any justification */
if (dev->chip && dev->chip->control && if (dev->chip && dev->chip->control &&
dev->chip->control->enable_dev) { dev->chip->control->enable_dev) {
int enable = dev->enable; int enable = dev->enabled;
dev->enable = 1; dev->enabled = 1;
dev->chip->control->enable_dev(dev); dev->chip->control->enable_dev(dev);
dev->enable = enable; dev->enabled = enable;
} }
/* Now read the vendor and device id */ /* Now read the vendor and device id */
id = pci_read_config32(dev, PCI_VENDOR_ID); id = pci_read_config32(dev, PCI_VENDOR_ID);
@ -648,7 +648,7 @@ unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn,
printk_debug("%s [%04x/%04x] %s\n", printk_debug("%s [%04x/%04x] %s\n",
dev_path(dev), dev_path(dev),
dev->vendor, dev->device, dev->vendor, dev->device,
dev->enable?"enabled": "disabled"); dev->enabled?"enabled": "disabled");
if (PCI_FUNC(devfn) == 0x00 && (hdr_type & 0x80) != 0x80) { if (PCI_FUNC(devfn) == 0x00 && (hdr_type & 0x80) != 0x80) {
/* if this is not a multi function device, don't /* if this is not a multi function device, don't

View File

@ -131,7 +131,7 @@ void pnp_enable_resources(device_t dev)
void pnp_enable(device_t dev) void pnp_enable(device_t dev)
{ {
if (!dev->enable) { if (!dev->enabled) {
pnp_set_logical_device(dev); pnp_set_logical_device(dev);
pnp_set_enable(dev, 0); pnp_set_enable(dev, 0);
} }

View File

@ -78,7 +78,7 @@ unsigned int walk_static_devices(device_t bus, unsigned int max)
child->ops->enable(child); child->ops->enable(child);
} }
printk_debug("%s %s\n", dev_path(child), printk_debug("%s %s\n", dev_path(child),
child->enable?"enabled": "disabled"); child->enabled?"enabled": "disabled");
} }
} }
for (link = 0; link < bus->links; link++) { for (link = 0; link < bus->links; link++) {
@ -124,7 +124,7 @@ struct device dev_root = {
.ops = &default_dev_ops_root, .ops = &default_dev_ops_root,
.bus = &dev_root.link[0], .bus = &dev_root.link[0],
.path = { .type = DEVICE_PATH_ROOT }, .path = { .type = DEVICE_PATH_ROOT },
.enable = 1, .enabled = 1,
.links = 1, .links = 1,
.link = { .link = {
[0] = { [0] = {

View File

@ -46,8 +46,7 @@ struct device {
unsigned short device; unsigned short device;
unsigned int class; /* 3 bytes: (base,sub,prog-if) */ unsigned int class; /* 3 bytes: (base,sub,prog-if) */
unsigned int hdr_type; /* PCI header type */ unsigned int hdr_type; /* PCI header type */
/* @todo rename this to 'enabled' */ unsigned int enabled : 1; /* set if we should enable the device */
unsigned int enable : 1; /* set if we should enable the device */
uint8_t command; uint8_t command;

View File

@ -492,12 +492,12 @@ unsigned int amdk8_scan_root_bus(device_t root, unsigned int max)
printk_debug("amdk8_scan_root_bus\n"); printk_debug("amdk8_scan_root_bus\n");
/* Unmap all of the HT chains */ /* Unmap all of the HT chains */
printk_debug("amdk8_scan_root_bus: clearing HT registers\n");
for (reg = 0xe0; reg <= 0xec; reg += 4) { for (reg = 0xe0; reg <= 0xec; reg += 4) {
printk_debug("amdk8_scan_root: clearing register %x\n", reg);
f1_write_config32(reg, 0); f1_write_config32(reg, 0);
} }
printk_debug("amdk8_scan_root_bus: start scan pci bus\n"); printk_debug("amdk8_scan_root_bus: start scaning pci bus\n");
max = pci_scan_bus(&root->link[0], PCI_DEVFN(0x18, 0), 0xff, max); max = pci_scan_bus(&root->link[0], PCI_DEVFN(0x18, 0), 0xff, max);
printk_debug("amdk8_scan_root_bus: done\n"); printk_debug("amdk8_scan_root_bus: done\n");
@ -570,14 +570,12 @@ static struct device_operations northbridge_operations = {
.enable = 0, .enable = 0,
}; };
static struct pci_driver mcf0_driver __pci_driver = { static struct pci_driver mcf0_driver __pci_driver = {
.ops = &northbridge_operations, .ops = &northbridge_operations,
.vendor = PCI_VENDOR_ID_AMD, .vendor = PCI_VENDOR_ID_AMD,
.device = 0x1100, .device = 0x1100,
}; };
static void enumerate(struct chip *chip) static void enumerate(struct chip *chip)
{ {
chip_enumerate(chip); chip_enumerate(chip);

View File

@ -40,7 +40,7 @@ void amd8111_enable(device_t dev)
} }
reg = reg_old = pci_read_config16(lpc_dev, 0x48); reg = reg_old = pci_read_config16(lpc_dev, 0x48);
reg &= ~(1 << index); reg &= ~(1 << index);
if (dev->enable) { if (dev->enabled) {
reg |= (1 << index); reg |= (1 << index);
} }
if (reg != reg_old) { if (reg != reg_old) {

View File

@ -98,19 +98,19 @@ static struct pci_driver pcix_driver __pci_driver = {
static void ioapic_enable(device_t dev) static void ioapic_enable(device_t dev)
{ {
uint32_t value; uint32_t value;
value = pci_read_config32(dev, 0x44); value = pci_read_config32(dev, 0x44);
if (dev->enable) { if (dev->enabled) {
value |= ((1 << 1) | (1 << 0)); value |= ((1 << 1) | (1 << 0));
} else { } else {
value &= ~((1 << 1) | (1 << 0)); value &= ~((1 << 1) | (1 << 0));
} }
pci_write_config32(dev, 0x44, value); pci_write_config32(dev, 0x44, value);
//BY LYH /* We have to enable MEM and Bus Master for IOAPIC */
value = pci_read_config32(dev, 0x4); value = pci_read_config32(dev, 0x4);
value |= 6; value |= 6;
pci_write_config32(dev, 0x4, value); pci_write_config32(dev, 0x4, value);
//BY LYH END
} }
static struct device_operations ioapic_ops = { static struct device_operations ioapic_ops = {

View File

@ -21,7 +21,7 @@ static void init(device_t dev)
/* Wishlist handle well known programming interfaces more /* Wishlist handle well known programming interfaces more
* generically. * generically.
*/ */
if (!dev->enable) { if (!dev->enabled) {
return; return;
} }
conf = dev->chip->chip_info; conf = dev->chip->chip_info;

View File

@ -21,7 +21,7 @@ static void init(device_t dev)
/* Wishlist handle well known programming interfaces more /* Wishlist handle well known programming interfaces more
* generically. * generically.
*/ */
if (!dev->enable) { if (!dev->enabled) {
return; return;
} }
conf = dev->chip->chip_info; conf = dev->chip->chip_info;

View File

@ -83,7 +83,7 @@ static void w83627hf_init(device_t dev)
{ {
struct superio_winbond_w83627hf_config *conf; struct superio_winbond_w83627hf_config *conf;
struct resource *res0, *res1; struct resource *res0, *res1;
if (!dev->enable) { if (!dev->enabled) {
return; return;
} }
conf = dev->chip->chip_info; conf = dev->chip->chip_info;
@ -140,7 +140,7 @@ void w83627hf_pnp_enable_resources(device_t dev)
void w83627hf_pnp_enable(device_t dev) void w83627hf_pnp_enable(device_t dev)
{ {
if (!dev->enable) { if (!dev->enabled) {
pnp_enter_ext_func_mode(dev); // BY LYH pnp_enter_ext_func_mode(dev); // BY LYH
pnp_set_logical_device(dev); pnp_set_logical_device(dev);