summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorwdenk <wdenk>2005-01-09 17:12:27 +0000
committerwdenk <wdenk>2005-01-09 17:12:27 +0000
commita1191902cab72b9f7127365fac39a1e1d5c9abda (patch)
tree2baffb8ff9c965e0bdaaa4f047a4a3b21aff27a3 /drivers
parent15c7a8efd2f7275e5b3249aac305f2598a998645 (diff)
downloadblackbird-obmc-uboot-a1191902cab72b9f7127365fac39a1e1d5c9abda.tar.gz
blackbird-obmc-uboot-a1191902cab72b9f7127365fac39a1e1d5c9abda.zip
* Patch by Jon Loeliger, 02 Sep 2004:
Reset monitor size back to 256 so environment can be written to flash on MPC85xx ADS and CDS releases. * Patch by Paolo Broggini, 02 Sep 2004: Make BSS clearing on ARM systems more robust * Patch by Yue Hu and Joe, 01 Sep 2004: - add PCI support for ixp425; - add EEPRO100 suppor tfor ixdp425 board. * Fix problem with protected sector detection in driver/cfi_flash.c
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cfi_flash.c20
-rw-r--r--drivers/pci.c21
2 files changed, 24 insertions, 17 deletions
diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c
index 4ced810385..101eb74913 100644
--- a/drivers/cfi_flash.c
+++ b/drivers/cfi_flash.c
@@ -1066,10 +1066,22 @@ static ulong flash_get_size (ulong base, int banknum)
for (j = 0; j < erase_region_count; j++) {
info->start[sect_cnt] = sector;
sector += (erase_region_size * size_ratio);
- info->protect[sect_cnt] =
- flash_isset (info, sect_cnt,
- FLASH_OFFSET_PROTECT,
- FLASH_STATUS_PROTECT);
+
+ /*
+ * Only read protection status from supported devices (intel...)
+ */
+ switch (info->vendor) {
+ case CFI_CMDSET_INTEL_EXTENDED:
+ case CFI_CMDSET_INTEL_STANDARD:
+ info->protect[sect_cnt] =
+ flash_isset (info, sect_cnt,
+ FLASH_OFFSET_PROTECT,
+ FLASH_STATUS_PROTECT);
+ break;
+ default:
+ info->protect[sect_cnt] = 0; /* default: not protected */
+ }
+
sect_cnt++;
}
}
diff --git a/drivers/pci.c b/drivers/pci.c
index c477a89025..c618f5b086 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -37,16 +37,6 @@
#include <asm/io.h>
#include <pci.h>
-#ifdef DEBUG
-#define DEBUGF(x...) printf(x)
-#else
-#define DEBUGF(x...)
-#endif /* DEBUG */
-
-/*
- *
- */
-
#define PCI_HOSE_OP(rw, size, type) \
int pci_hose_##rw##_config_##size(struct pci_controller *hose, \
pci_dev_t dev, \
@@ -62,6 +52,7 @@ PCI_HOSE_OP(write, byte, u8)
PCI_HOSE_OP(write, word, u16)
PCI_HOSE_OP(write, dword, u32)
+#ifndef CONFIG_IXP425
#define PCI_OP(rw, size, type, error_code) \
int pci_##rw##_config_##size(pci_dev_t dev, int offset, type value) \
{ \
@@ -82,6 +73,7 @@ PCI_OP(read, dword, u32 *, *value = 0xffffffff)
PCI_OP(write, byte, u8, )
PCI_OP(write, word, u16, )
PCI_OP(write, dword, u32, )
+#endif /* CONFIG_IXP425 */
#define PCI_READ_VIA_DWORD_OP(size, type, off_mask) \
int pci_hose_read_config_##size##_via_dword(struct pci_controller *hose,\
@@ -150,9 +142,11 @@ struct pci_controller *pci_bus_to_hose (int bus)
if (bus >= hose->first_busno && bus <= hose->last_busno)
return hose;
+ debug ("pci_bus_to_hose() failed\n");
return NULL;
}
+#ifndef CONFIG_IXP425
pci_dev_t pci_find_devices(struct pci_device_id *ids, int index)
{
struct pci_controller * hose;
@@ -208,6 +202,7 @@ pci_dev_t pci_find_devices(struct pci_device_id *ids, int index)
return (-1);
}
+#endif /* CONFIG_IXP425 */
pci_dev_t pci_find_device(unsigned int vendor, unsigned int device, int index)
{
@@ -300,7 +295,7 @@ int pci_hose_config_device(struct pci_controller *hose,
unsigned char pin;
int bar, found_mem64;
- DEBUGF ("PCI Config: I/O=0x%lx, Memory=0x%lx, Command=0x%lx\n",
+ debug ("PCI Config: I/O=0x%lx, Memory=0x%lx, Command=0x%lx\n",
io, mem, command);
pci_hose_write_config_dword (hose, dev, PCI_COMMAND, 0);
@@ -454,8 +449,8 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
if (!PCI_FUNC(dev))
found_multi = header_type & 0x80;
- DEBUGF("PCI Scan: Found Bus %d, Device %d, Function %d\n",
- PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev) );
+ debug ("PCI Scan: Found Bus %d, Device %d, Function %d\n",
+ PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev) );
pci_hose_read_config_word(hose, dev, PCI_DEVICE_ID, &device);
pci_hose_read_config_word(hose, dev, PCI_CLASS_DEVICE, &class);
OpenPOWER on IntegriCloud