Skip to content

Commit

Permalink
Merge branch 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/cmetcalf/linux-tile

* 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  pci root complex: support for tile architecture
  drivers/net/tile/: on-chip network drivers for the tile architecture
  MAINTAINERS: add drivers/char/hvc_tile.c as maintained by tile
  • Loading branch information
Linus Torvalds committed Nov 24, 2010
2 parents 0b9466c + f02cbbe commit 47143b0
Show file tree
Hide file tree
Showing 19 changed files with 7,210 additions and 187 deletions.
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5839,6 +5839,8 @@ M: Chris Metcalf <cmetcalf@tilera.com>
W: http://www.tilera.com/scm/
S: Supported
F: arch/tile/
F: drivers/char/hvc_tile.c
F: drivers/net/tile/

TLAN NETWORK DRIVER
M: Samuel Chessman <chessman@tux.org>
Expand Down
12 changes: 12 additions & 0 deletions arch/tile/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,18 @@ endmenu # Tilera-specific configuration

menu "Bus options"

config PCI
bool "PCI support"
default y
select PCI_DOMAINS
---help---
Enable PCI root complex support, so PCIe endpoint devices can
be attached to the Tile chip. Many, but not all, PCI devices
are supported under Tilera's root complex driver.

config PCI_DOMAINS
bool

config NO_IOMEM
def_bool !PCI

Expand Down
52 changes: 52 additions & 0 deletions arch/tile/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,56 @@ static inline void finv_buffer(void *buffer, size_t size)
mb_incoherent();
}

/*
* Flush & invalidate a VA range that is homed remotely on a single core,
* waiting until the memory controller holds the flushed values.
*/
static inline void finv_buffer_remote(void *buffer, size_t size)
{
char *p;
int i;

/*
* Flush and invalidate the buffer out of the local L1/L2
* and request the home cache to flush and invalidate as well.
*/
__finv_buffer(buffer, size);

/*
* Wait for the home cache to acknowledge that it has processed
* all the flush-and-invalidate requests. This does not mean
* that the flushed data has reached the memory controller yet,
* but it does mean the home cache is processing the flushes.
*/
__insn_mf();

/*
* Issue a load to the last cache line, which can't complete
* until all the previously-issued flushes to the same memory
* controller have also completed. If we weren't striping
* memory, that one load would be sufficient, but since we may
* be, we also need to back up to the last load issued to
* another memory controller, which would be the point where
* we crossed an 8KB boundary (the granularity of striping
* across memory controllers). Keep backing up and doing this
* until we are before the beginning of the buffer, or have
* hit all the controllers.
*/
for (i = 0, p = (char *)buffer + size - 1;
i < (1 << CHIP_LOG_NUM_MSHIMS()) && p >= (char *)buffer;
++i) {
const unsigned long STRIPE_WIDTH = 8192;

/* Force a load instruction to issue. */
*(volatile char *)p;

/* Jump to end of previous stripe. */
p -= STRIPE_WIDTH;
p = (char *)((unsigned long)p | (STRIPE_WIDTH - 1));
}

/* Wait for the loads (and thus flushes) to have completed. */
__insn_mf();
}

#endif /* _ASM_TILE_CACHEFLUSH_H */
15 changes: 11 additions & 4 deletions arch/tile/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ extern void iounmap(volatile void __iomem *addr);
#define ioremap_writethrough(physaddr, size) ioremap(physaddr, size)
#define ioremap_fullcache(physaddr, size) ioremap(physaddr, size)

void __iomem *ioport_map(unsigned long port, unsigned int len);
extern inline void ioport_unmap(void __iomem *addr) {}

#define mmiowb()

/* Conversion between virtual and physical mappings. */
Expand Down Expand Up @@ -189,12 +186,22 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src,
* we never run, uses them unconditionally.
*/

static inline int ioport_panic(void)
static inline long ioport_panic(void)
{
panic("inb/outb and friends do not exist on tile");
return 0;
}

static inline void __iomem *ioport_map(unsigned long port, unsigned int len)
{
return (void __iomem *) ioport_panic();
}

static inline void ioport_unmap(void __iomem *addr)
{
ioport_panic();
}

static inline u8 inb(unsigned long addr)
{
return ioport_panic();
Expand Down
117 changes: 0 additions & 117 deletions arch/tile/include/asm/pci-bridge.h

This file was deleted.

107 changes: 41 additions & 66 deletions arch/tile/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,29 @@
#ifndef _ASM_TILE_PCI_H
#define _ASM_TILE_PCI_H

#include <asm/pci-bridge.h>
#include <linux/pci.h>

/*
* Structure of a PCI controller (host bridge)
*/
struct pci_controller {
int index; /* PCI domain number */
struct pci_bus *root_bus;

int first_busno;
int last_busno;

int hv_cfg_fd[2]; /* config{0,1} fds for this PCIe controller */
int hv_mem_fd; /* fd to Hypervisor for MMIO operations */

struct pci_ops *ops;

int irq_base; /* Base IRQ from the Hypervisor */
int plx_gen1; /* flag for PLX Gen 1 configuration */

/* Address ranges that are routed to this controller/bridge. */
struct resource mem_resources[3];
};

/*
* The hypervisor maps the entirety of CPA-space as bus addresses, so
Expand All @@ -24,56 +46,12 @@
*/
#define PCI_DMA_BUS_IS_PHYS 1

struct pci_controller *pci_bus_to_hose(int bus);
unsigned char __init common_swizzle(struct pci_dev *dev, unsigned char *pinp);
int __init tile_pci_init(void);
void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
void __devinit pcibios_fixup_bus(struct pci_bus *bus);

int __devinit _tile_cfg_read(struct pci_controller *hose,
int bus,
int slot,
int function,
int offset,
int size,
u32 *val);
int __devinit _tile_cfg_write(struct pci_controller *hose,
int bus,
int slot,
int function,
int offset,
int size,
u32 val);
void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {}

/*
* These are used to to config reads and writes in the early stages of
* setup before the driver infrastructure has been set up enough to be
* able to do config reads and writes.
*/
#define early_cfg_read(where, size, value) \
_tile_cfg_read(controller, \
current_bus, \
pci_slot, \
pci_fn, \
where, \
size, \
value)

#define early_cfg_write(where, size, value) \
_tile_cfg_write(controller, \
current_bus, \
pci_slot, \
pci_fn, \
where, \
size, \
value)



#define PCICFG_BYTE 1
#define PCICFG_WORD 2
#define PCICFG_DWORD 4
void __devinit pcibios_fixup_bus(struct pci_bus *bus);

#define TILE_NUM_PCIE 2

Expand All @@ -88,41 +66,38 @@ static inline int pci_proc_domain(struct pci_bus *bus)
}

/*
* I/O space is currently not supported.
* pcibios_assign_all_busses() tells whether or not the bus numbers
* should be reassigned, in case the BIOS didn't do it correctly, or
* in case we don't have a BIOS and we want to let Linux do it.
*/
static inline int pcibios_assign_all_busses(void)
{
return 1;
}

#define TILE_PCIE_LOWER_IO 0x0
#define TILE_PCIE_UPPER_IO 0x10000
#define TILE_PCIE_PCIE_IO_SIZE 0x0000FFFF

#define _PAGE_NO_CACHE 0
#define _PAGE_GUARDED 0


#define pcibios_assign_all_busses() pci_assign_all_buses
extern int pci_assign_all_buses;

/*
* No special bus mastering setup handling.
*/
static inline void pcibios_set_master(struct pci_dev *dev)
{
/* No special bus mastering setup handling */
}

#define PCIBIOS_MIN_MEM 0
#define PCIBIOS_MIN_IO TILE_PCIE_LOWER_IO
#define PCIBIOS_MIN_IO 0

/*
* This flag tells if the platform is TILEmpower that needs
* special configuration for the PLX switch chip.
*/
extern int blade_pci;
extern int tile_plx_gen1;

/* Use any cpu for PCI. */
#define cpumask_of_pcibus(bus) cpu_online_mask

/* implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>

/* generic pci stuff */
#include <asm-generic/pci.h>

/* Use any cpu for PCI. */
#define cpumask_of_pcibus(bus) cpu_online_mask

#endif /* _ASM_TILE_PCI_H */
Loading

0 comments on commit 47143b0

Please sign in to comment.