Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97709
b: refs/heads/master
c: 96173a6
h: refs/heads/master
i:
  97707: ef58938
v: v3
  • Loading branch information
Thomas Bogendoerfer authored and Ralf Baechle committed Jun 5, 2008
1 parent 1b197c5 commit f02ef1b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 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: b32bb803fb52cc669762780d44b4c3d9e3d799f6
refs/heads/master: 96173a6c4ebca4c146bb87026cce78bbe392cb61
20 changes: 18 additions & 2 deletions trunk/arch/mips/pci/ops-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@
#include <asm/sn/intr.h>
#include <asm/sn/sn0/hub.h>

/*
* Most of the IOC3 PCI config register aren't present
* we emulate what is needed for a normal PCI enumeration
*/
static u32 emulate_ioc3_cfg(int where, int size)
{
if (size == 1 && where == 0x3d)
return 0x01;
else if (size == 2 && where == 0x3c)
return 0x0100;
else if (size == 4 && where == 0x3c)
return 0x00000100;

return 0;
}

/*
* The Bridge ASIC supports both type 0 and type 1 access. Type 1 is
* not really documented, so right now I can't write code which uses it.
Expand Down Expand Up @@ -64,7 +80,7 @@ static int pci_conf0_read_config(struct pci_bus *bus, unsigned int devfn,
* generic PCI code a chance to look at the wrong register.
*/
if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) {
*value = 0;
*value = emulate_ioc3_cfg(where, size);
return PCIBIOS_SUCCESSFUL;
}

Expand Down Expand Up @@ -127,7 +143,7 @@ static int pci_conf1_read_config(struct pci_bus *bus, unsigned int devfn,
* generic PCI code a chance to look at the wrong register.
*/
if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) {
*value = 0;
*value = emulate_ioc3_cfg(where, size);
return PCIBIOS_SUCCESSFUL;
}

Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/mips/pci/pci-ip27.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)
static int num_bridges = 0;
bridge_t *bridge;
int slot;
extern int pci_probe_only;

pci_probe_only = 1;

printk("a bridge\n");

Expand Down Expand Up @@ -100,6 +103,11 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)
*/
bridge->b_wid_control |= BRIDGE_CTRL_IO_SWAP |
BRIDGE_CTRL_MEM_SWAP;
#ifdef CONFIG_PAGE_SIZE_4KB
bridge->b_wid_control &= ~BRIDGE_CTRL_PAGE_SIZE;
#else /* 16kB or larger */
bridge->b_wid_control |= BRIDGE_CTRL_PAGE_SIZE;
#endif

/*
* Hmm... IRIX sets additional bits in the address which
Expand Down
22 changes: 0 additions & 22 deletions trunk/arch/mips/sgi-ip27/ip27-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,27 +161,6 @@ cnodeid_t get_compact_nodeid(void)
return NASID_TO_COMPACT_NODEID(get_nasid());
}

/* Extracted from the IOC3 meta driver. FIXME. */
static inline void ioc3_sio_init(void)
{
struct ioc3 *ioc3;
nasid_t nid;
long loops;

nid = get_nasid();
ioc3 = (struct ioc3 *) KL_CONFIG_CH_CONS_INFO(nid)->memory_base;

ioc3->sscr_a = 0; /* PIO mode for uarta. */
ioc3->sscr_b = 0; /* PIO mode for uartb. */
ioc3->sio_iec = ~0;
ioc3->sio_ies = (SIO_IR_SA_INT | SIO_IR_SB_INT);

loops=1000000; while(loops--);
ioc3->sregs.uarta.iu_fcr = 0;
ioc3->sregs.uartb.iu_fcr = 0;
loops=1000000; while(loops--);
}

static inline void ioc3_eth_init(void)
{
struct ioc3 *ioc3;
Expand Down Expand Up @@ -234,7 +213,6 @@ void __init plat_mem_setup(void)
panic("Kernel compiled for N mode.");
#endif

ioc3_sio_init();
ioc3_eth_init();
per_cpu_init();

Expand Down

0 comments on commit f02ef1b

Please sign in to comment.