Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284682
b: refs/heads/master
c: c539ef7
h: refs/heads/master
v: v3
  • Loading branch information
Ralf Baechle committed Jan 11, 2012
1 parent 209e28f commit e97cb6e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f467e4bfb50ca6af042f1b19b3556bd4aca854c3
refs/heads/master: c539ef7d355219c7b0e16cc302bf179fcad936b3
29 changes: 28 additions & 1 deletion trunk/arch/mips/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Copyright (C) 2003, 04 Ralf Baechle (ralf@linux-mips.org)
* Copyright (C) 2003, 04, 11 Ralf Baechle (ralf@linux-mips.org)
* Copyright (C) 2011 Wind River Systems,
* written by Ralf Baechle (ralf@linux-mips.org)
*/
#include <linux/bug.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/bootmem.h>
Expand All @@ -14,6 +17,8 @@
#include <linux/types.h>
#include <linux/pci.h>

#include <asm/cpu-info.h>

/*
* Indicate whether we respect the PCI setup left by the firmware.
*
Expand Down Expand Up @@ -150,10 +155,32 @@ void __devinit register_pci_controller(struct pci_controller *hose)
"Skipping PCI bus scan due to resource conflict\n");
}

static void __init pcibios_set_cache_line_size(void)
{
struct cpuinfo_mips *c = &current_cpu_data;
unsigned int lsize;

/*
* Set PCI cacheline size to that of the highest level in the
* cache hierarchy.
*/
lsize = c->dcache.linesz;
lsize = c->scache.linesz ? : lsize;
lsize = c->tcache.linesz ? : lsize;

BUG_ON(!lsize);

pci_dfl_cache_line_size = lsize >> 2;

pr_debug("PCI: pci_cache_line_size set to %d bytes\n", lsize);
}

static int __init pcibios_init(void)
{
struct pci_controller *hose;

pcibios_set_cache_line_size();

/* Scan all of the recorded PCI controllers. */
for (hose = hose_head; hose; hose = hose->next)
pcibios_scanbus(hose);
Expand Down

0 comments on commit e97cb6e

Please sign in to comment.