Commit d2d20c26 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://lia64.bkbits.net/to-linus-2.5

into home.osdl.org:/home/torvalds/v2.5/linux
parents e176cdfe 6853823b
...@@ -1849,18 +1849,19 @@ static struct file_operations ioc_map_fops = { ...@@ -1849,18 +1849,19 @@ static struct file_operations ioc_map_fops = {
static void __init static void __init
ioc_proc_init(void) ioc_proc_init(void)
{ {
if (ioc_list) { struct proc_dir_entry *dir, *entry;
struct proc_dir_entry *dir, *entry;
dir = proc_mkdir("bus/mckinley", 0); dir = proc_mkdir("bus/mckinley", 0);
entry = create_proc_entry(ioc_list->name, 0, dir); if (!dir)
if (entry) return;
entry->proc_fops = &ioc_fops;
entry = create_proc_entry("bitmap", 0, dir); entry = create_proc_entry(ioc_list->name, 0, dir);
if (entry) if (entry)
entry->proc_fops = &ioc_map_fops; entry->proc_fops = &ioc_fops;
}
entry = create_proc_entry("bitmap", 0, dir);
if (entry)
entry->proc_fops = &ioc_map_fops;
} }
#endif #endif
...@@ -1946,6 +1947,8 @@ static int __init ...@@ -1946,6 +1947,8 @@ static int __init
sba_init(void) sba_init(void)
{ {
acpi_bus_register_driver(&acpi_sba_ioc_driver); acpi_bus_register_driver(&acpi_sba_ioc_driver);
if (!ioc_list)
return 0;
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
{ {
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <asm/ia32.h> #include <asm/ia32.h>
#include <asm/machvec.h> #include <asm/machvec.h>
#include <asm/mca.h> #include <asm/mca.h>
#include <asm/meminit.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/patch.h> #include <asm/patch.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -83,91 +84,12 @@ unsigned long ia64_max_iommu_merge_mask = ~0UL; ...@@ -83,91 +84,12 @@ unsigned long ia64_max_iommu_merge_mask = ~0UL;
char saved_command_line[COMMAND_LINE_SIZE]; /* used in proc filesystem */ char saved_command_line[COMMAND_LINE_SIZE]; /* used in proc filesystem */
/*
* Entries defined so far:
* - boot param structure itself
* - memory map
* - initrd (optional)
* - command line string
* - kernel code & data
*
* More could be added if necessary
*/
#define IA64_MAX_RSVD_REGIONS 5
struct rsvd_region {
unsigned long start; /* virtual address of beginning of element */
unsigned long end; /* virtual address of end of element + 1 */
};
/* /*
* We use a special marker for the end of memory and it uses the extra (+1) slot * We use a special marker for the end of memory and it uses the extra (+1) slot
*/ */
static struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1]; struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
static int num_rsvd_regions; int num_rsvd_regions;
#define IGNORE_PFN0 1 /* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */
#ifndef CONFIG_DISCONTIGMEM
static unsigned long bootmap_start; /* physical address where the bootmem map is located */
static int
find_max_pfn (unsigned long start, unsigned long end, void *arg)
{
unsigned long *max_pfnp = arg, pfn;
pfn = (PAGE_ALIGN(end - 1) - PAGE_OFFSET) >> PAGE_SHIFT;
if (pfn > *max_pfnp)
*max_pfnp = pfn;
return 0;
}
#else /* CONFIG_DISCONTIGMEM */
/*
* efi_memmap_walk() knows nothing about layout of memory across nodes. Find
* out to which node a block of memory belongs. Ignore memory that we cannot
* identify, and split blocks that run across multiple nodes.
*
* Take this opportunity to round the start address up and the end address
* down to page boundaries.
*/
void
call_pernode_memory (unsigned long start, unsigned long end, void *arg)
{
unsigned long rs, re;
void (*func)(unsigned long, unsigned long, int, int);
int i;
start = PAGE_ALIGN(start);
end &= PAGE_MASK;
if (start >= end)
return;
func = arg;
if (!num_memblks) {
/*
* This machine doesn't have SRAT, so call func with
* nid=0, bank=0.
*/
if (start < end)
(*func)(start, end - start, 0, 0);
return;
}
for (i = 0; i < num_memblks; i++) {
rs = max(start, node_memblk[i].start_paddr);
re = min(end, node_memblk[i].start_paddr+node_memblk[i].size);
if (rs < re)
(*func)(rs, re-rs, node_memblk[i].nid,
node_memblk[i].bank);
}
}
#endif /* CONFIG_DISCONTIGMEM */
/* /*
* Filter incoming memory segments based on the primitive map created from the boot * Filter incoming memory segments based on the primitive map created from the boot
...@@ -215,48 +137,6 @@ filter_rsvd_memory (unsigned long start, unsigned long end, void *arg) ...@@ -215,48 +137,6 @@ filter_rsvd_memory (unsigned long start, unsigned long end, void *arg)
return 0; return 0;
} }
#ifndef CONFIG_DISCONTIGMEM
/*
* Find a place to put the bootmap and return its starting address in bootmap_start.
* This address must be page-aligned.
*/
static int
find_bootmap_location (unsigned long start, unsigned long end, void *arg)
{
unsigned long needed = *(unsigned long *)arg;
unsigned long range_start, range_end, free_start;
int i;
#if IGNORE_PFN0
if (start == PAGE_OFFSET) {
start += PAGE_SIZE;
if (start >= end) return 0;
}
#endif
free_start = PAGE_OFFSET;
for (i = 0; i < num_rsvd_regions; i++) {
range_start = max(start, free_start);
range_end = min(end, rsvd_region[i].start & PAGE_MASK);
if (range_end <= range_start) continue; /* skip over empty range */
if (range_end - range_start >= needed) {
bootmap_start = __pa(range_start);
return 1; /* done */
}
/* nothing more available in this segment */
if (range_end == end) return 0;
free_start = PAGE_ALIGN(rsvd_region[i].end);
}
return 0;
}
#endif /* !CONFIG_DISCONTIGMEM */
static void static void
sort_regions (struct rsvd_region *rsvd_region, int max) sort_regions (struct rsvd_region *rsvd_region, int max)
{ {
...@@ -275,10 +155,16 @@ sort_regions (struct rsvd_region *rsvd_region, int max) ...@@ -275,10 +155,16 @@ sort_regions (struct rsvd_region *rsvd_region, int max)
} }
} }
static void /**
find_memory (void) * reserve_memory - setup reserved memory areas
*
* Setup the reserved memory areas set aside for the boot parameters,
* initrd, etc. There are currently %IA64_MAX_RSVD_REGIONS defined,
* see include/asm-ia64/meminit.h if you need to define more.
*/
void
reserve_memory (void)
{ {
unsigned long bootmap_size;
int n = 0; int n = 0;
/* /*
...@@ -317,36 +203,17 @@ find_memory (void) ...@@ -317,36 +203,17 @@ find_memory (void)
num_rsvd_regions = n; num_rsvd_regions = n;
sort_regions(rsvd_region, num_rsvd_regions); sort_regions(rsvd_region, num_rsvd_regions);
}
#ifdef CONFIG_DISCONTIGMEM /**
{ * find_initrd - get initrd parameters from the boot parameter structure
extern void discontig_mem_init (void); *
* Grab the initrd start and end from the boot parameter struct given us by
bootmap_size = max_pfn = 0; /* stop gcc warnings */ * the boot loader.
discontig_mem_init(); */
} void
#else /* !CONFIG_DISCONTIGMEM */ find_initrd (void)
{
/* first find highest page frame number */
max_pfn = 0;
efi_memmap_walk(find_max_pfn, &max_pfn);
/* how many bytes to cover all the pages */
bootmap_size = bootmem_bootmap_pages(max_pfn) << PAGE_SHIFT;
/* look for a location to hold the bootmap */
bootmap_start = ~0UL;
efi_memmap_walk(find_bootmap_location, &bootmap_size);
if (bootmap_start == ~0UL)
panic("Cannot find %ld bytes for bootmap\n", bootmap_size);
bootmap_size = init_bootmem(bootmap_start >> PAGE_SHIFT, max_pfn);
/* Free all available memory, then mark bootmem-map as being in use. */
efi_memmap_walk(filter_rsvd_memory, free_bootmem);
reserve_bootmem(bootmap_start, bootmap_size);
#endif /* !CONFIG_DISCONTIGMEM */
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (ia64_boot_param->initrd_start) { if (ia64_boot_param->initrd_start) {
initrd_start = (unsigned long)__va(ia64_boot_param->initrd_start); initrd_start = (unsigned long)__va(ia64_boot_param->initrd_start);
......
...@@ -335,7 +335,8 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr) ...@@ -335,7 +335,8 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
if ((fpu_swa_count < 4) && !(current->thread.flags & IA64_THREAD_FPEMU_NOPRINT)) { if ((fpu_swa_count < 4) && !(current->thread.flags & IA64_THREAD_FPEMU_NOPRINT)) {
last_time = jiffies; last_time = jiffies;
++fpu_swa_count; ++fpu_swa_count;
printk(KERN_WARNING "%s(%d): floating-point assist fault at ip %016lx, isr %016lx\n", printk(KERN_WARNING
"%s(%d): floating-point assist fault at ip %016lx, isr %016lx\n",
current->comm, current->pid, regs->cr_iip + ia64_psr(regs)->ri, isr); current->comm, current->pid, regs->cr_iip + ia64_psr(regs)->ri, isr);
} }
......
...@@ -7,3 +7,6 @@ obj-y := init.o fault.o tlb.o extable.o ...@@ -7,3 +7,6 @@ obj-y := init.o fault.o tlb.o extable.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
obj-$(CONFIG_NUMA) += numa.o obj-$(CONFIG_NUMA) += numa.o
obj-$(CONFIG_DISCONTIGMEM) += discontig.o obj-$(CONFIG_DISCONTIGMEM) += discontig.o
ifndef CONFIG_DISCONTIGMEM
obj-y += contig.o
endif
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1998-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com>
* Copyright (C) 2000, Rohit Seth <rohit.seth@intel.com>
* Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
* Copyright (C) 2003 Silicon Graphics, Inc. All rights reserved.
*
* Routines used by ia64 machines with contiguous (or virtually contiguous)
* memory.
*/
#include <linux/config.h>
#include <linux/bootmem.h>
#include <linux/efi.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <asm/meminit.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/sections.h>
/**
* show_mem - display a memory statistics summary
*
* Just walks the pages in the system and describes where they're allocated.
*/
void
show_mem (void)
{
int i, total = 0, reserved = 0;
int shared = 0, cached = 0;
printk("Mem-info:\n");
show_free_areas();
printk("Free swap: %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
i = max_mapnr;
while (i-- > 0) {
total++;
if (PageReserved(mem_map+i))
reserved++;
else if (PageSwapCache(mem_map+i))
cached++;
else if (page_count(mem_map + i))
shared += page_count(mem_map + i) - 1;
}
printk("%d pages of RAM\n", total);
printk("%d reserved pages\n", reserved);
printk("%d pages shared\n", shared);
printk("%d pages swap cached\n", cached);
printk("%ld pages in page table cache\n", pgtable_cache_size);
}
/* physical address where the bootmem map is located */
unsigned long bootmap_start;
/**
* find_max_pfn - adjust the maximum page number callback
* @start: start of range
* @end: end of range
* @arg: address of pointer to global max_pfn variable
*
* Passed as a callback function to efi_memmap_walk() to determine the highest
* available page frame number in the system.
*/
int
find_max_pfn (unsigned long start, unsigned long end, void *arg)
{
unsigned long *max_pfnp = arg, pfn;
pfn = (PAGE_ALIGN(end - 1) - PAGE_OFFSET) >> PAGE_SHIFT;
if (pfn > *max_pfnp)
*max_pfnp = pfn;
return 0;
}
/**
* find_bootmap_location - callback to find a memory area for the bootmap
* @start: start of region
* @end: end of region
* @arg: unused callback data
*
* Find a place to put the bootmap and return its starting address in
* bootmap_start. This address must be page-aligned.
*/
int
find_bootmap_location (unsigned long start, unsigned long end, void *arg)
{
unsigned long needed = *(unsigned long *)arg;
unsigned long range_start, range_end, free_start;
int i;
#if IGNORE_PFN0
if (start == PAGE_OFFSET) {
start += PAGE_SIZE;
if (start >= end)
return 0;
}
#endif
free_start = PAGE_OFFSET;
for (i = 0; i < num_rsvd_regions; i++) {
range_start = max(start, free_start);
range_end = min(end, rsvd_region[i].start & PAGE_MASK);
if (range_end <= range_start)
continue; /* skip over empty range */
if (range_end - range_start >= needed) {
bootmap_start = __pa(range_start);
return 1; /* done */
}
/* nothing more available in this segment */
if (range_end == end)
return 0;
free_start = PAGE_ALIGN(rsvd_region[i].end);
}
return 0;
}
/**
* find_memory - setup memory map
*
* Walk the EFI memory map and find usable memory for the system, taking
* into account reserved areas.
*/
void
find_memory (void)
{
unsigned long bootmap_size;
reserve_memory();
/* first find highest page frame number */
max_pfn = 0;
efi_memmap_walk(find_max_pfn, &max_pfn);
/* how many bytes to cover all the pages */
bootmap_size = bootmem_bootmap_pages(max_pfn) << PAGE_SHIFT;
/* look for a location to hold the bootmap */
bootmap_start = ~0UL;
efi_memmap_walk(find_bootmap_location, &bootmap_size);
if (bootmap_start == ~0UL)
panic("Cannot find %ld bytes for bootmap\n", bootmap_size);
bootmap_size = init_bootmem(bootmap_start >> PAGE_SHIFT, max_pfn);
/* Free all available memory, then mark bootmem-map as being in use. */
efi_memmap_walk(filter_rsvd_memory, free_bootmem);
reserve_bootmem(bootmap_start, bootmap_size);
find_initrd();
}
/* /*
* Copyright (c) 2000 Silicon Graphics, Inc. All rights reserved. * Copyright (c) 2000, 2003 Silicon Graphics, Inc. All rights reserved.
* Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Intel Corp.
* Copyright (c) 2001 Tony Luck <tony.luck@intel.com> * Copyright (c) 2001 Tony Luck <tony.luck@intel.com>
* Copyright (c) 2002 NEC Corp. * Copyright (c) 2002 NEC Corp.
...@@ -12,10 +12,13 @@ ...@@ -12,10 +12,13 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/swap.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/mmzone.h> #include <linux/mmzone.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/efi.h> #include <linux/efi.h>
#include <asm/pgalloc.h>
#include <asm/meminit.h>
/* /*
...@@ -27,9 +30,6 @@ static struct ia64_node_data *node_data[NR_NODES]; ...@@ -27,9 +30,6 @@ static struct ia64_node_data *node_data[NR_NODES];
static long boot_pg_data[8*NR_NODES+sizeof(pg_data_t)] __initdata; static long boot_pg_data[8*NR_NODES+sizeof(pg_data_t)] __initdata;
static pg_data_t *pg_data_ptr[NR_NODES] __initdata; static pg_data_t *pg_data_ptr[NR_NODES] __initdata;
static bootmem_data_t bdata[NR_NODES][NR_BANKS_PER_NODE+1] __initdata; static bootmem_data_t bdata[NR_NODES][NR_BANKS_PER_NODE+1] __initdata;
extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
/* /*
* Return the compact node number of this cpu. Used prior to * Return the compact node number of this cpu. Used prior to
* setting up the cpu_data area. * setting up the cpu_data area.
...@@ -198,7 +198,7 @@ allocate_pernode_structures(void) ...@@ -198,7 +198,7 @@ allocate_pernode_structures(void)
pgdat->pgdat_next = new_pgdat_list; pgdat->pgdat_next = new_pgdat_list;
new_pgdat_list = pgdat; new_pgdat_list = pgdat;
} }
memcpy(node_data[mynode]->pg_data_ptrs, pg_data_ptr, sizeof(pg_data_ptr)); memcpy(node_data[mynode]->pg_data_ptrs, pg_data_ptr, sizeof(pg_data_ptr));
memcpy(node_data[mynode]->node_data_ptrs, node_data, sizeof(node_data)); memcpy(node_data[mynode]->node_data_ptrs, node_data, sizeof(node_data));
...@@ -209,11 +209,12 @@ allocate_pernode_structures(void) ...@@ -209,11 +209,12 @@ allocate_pernode_structures(void)
* Called early in boot to setup the boot memory allocator, and to * Called early in boot to setup the boot memory allocator, and to
* allocate the node-local pg_data & node-directory data structures.. * allocate the node-local pg_data & node-directory data structures..
*/ */
void __init void __init find_memory(void)
discontig_mem_init(void)
{ {
int node; int node;
reserve_memory();
if (numnodes == 0) { if (numnodes == 0) {
printk(KERN_ERR "node info missing!\n"); printk(KERN_ERR "node info missing!\n");
numnodes = 1; numnodes = 1;
...@@ -232,6 +233,8 @@ discontig_mem_init(void) ...@@ -232,6 +233,8 @@ discontig_mem_init(void)
efi_memmap_walk(filter_rsvd_memory, discontig_free_bootmem_node); efi_memmap_walk(filter_rsvd_memory, discontig_free_bootmem_node);
discontig_reserve_bootmem(); discontig_reserve_bootmem();
allocate_pernode_structures(); allocate_pernode_structures();
find_initrd();
} }
/* /*
...@@ -242,8 +245,8 @@ discontig_mem_init(void) ...@@ -242,8 +245,8 @@ discontig_mem_init(void)
* the per-bank mem_map entries. * the per-bank mem_map entries.
* - fix the page struct "virtual" pointers. These are bank specific * - fix the page struct "virtual" pointers. These are bank specific
* values that the paging system doesn't understand. * values that the paging system doesn't understand.
* - replicate the nodedir structure to other nodes * - replicate the nodedir structure to other nodes
*/ */
void __init void __init
discontig_paging_init(void) discontig_paging_init(void)
...@@ -305,3 +308,71 @@ discontig_paging_init(void) ...@@ -305,3 +308,71 @@ discontig_paging_init(void)
} }
} }
void show_mem(void)
{
int i, reserved = 0;
int shared = 0, cached = 0;
pg_data_t *pgdat;
printk("Mem-info:\n");
show_free_areas();
printk("Free swap: %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
for_each_pgdat(pgdat) {
printk("Node ID: %d\n", pgdat->node_id);
for(i = 0; i < pgdat->node_spanned_pages; i++) {
if (PageReserved(pgdat->node_mem_map+i))
reserved++;
else if (PageSwapCache(pgdat->node_mem_map+i))
cached++;
else if (page_count(pgdat->node_mem_map+i))
shared += page_count(pgdat->node_mem_map+i)-1;
}
printk("\t%ld pages of RAM\n", pgdat->node_present_pages);
printk("\t%d reserved pages\n", reserved);
printk("\t%d pages shared\n", shared);
printk("\t%d pages swap cached\n", cached);
}
printk("Total of %ld pages in page table cache\n", pgtable_cache_size);
printk("%d free buffer pages\n", nr_free_buffer_pages());
}
/*
* efi_memmap_walk() knows nothing about layout of memory across nodes. Find
* out to which node a block of memory belongs. Ignore memory that we cannot
* identify, and split blocks that run across multiple nodes.
*
* Take this opportunity to round the start address up and the end address
* down to page boundaries.
*/
void call_pernode_memory(unsigned long start, unsigned long end, void *arg)
{
unsigned long rs, re;
void (*func)(unsigned long, unsigned long, int, int);
int i;
start = PAGE_ALIGN(start);
end &= PAGE_MASK;
if (start >= end)
return;
func = arg;
if (!num_memblks) {
/*
* This machine doesn't have SRAT, so call func with
* nid=0, bank=0.
*/
if (start < end)
(*func)(start, end - start, 0, 0);
return;
}
for (i = 0; i < num_memblks; i++) {
rs = max(start, node_memblk[i].start_paddr);
re = min(end, node_memblk[i].start_paddr+node_memblk[i].size);
if (rs < re)
(*func)(rs, re-rs, node_memblk[i].nid,
node_memblk[i].bank);
}
}
...@@ -214,58 +214,6 @@ free_initrd_mem (unsigned long start, unsigned long end) ...@@ -214,58 +214,6 @@ free_initrd_mem (unsigned long start, unsigned long end)
} }
} }
void
show_mem(void)
{
int i, total = 0, reserved = 0;
int shared = 0, cached = 0;
printk("Mem-info:\n");
show_free_areas();
#ifdef CONFIG_DISCONTIGMEM
{
pg_data_t *pgdat;
printk("Free swap: %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
for_each_pgdat(pgdat) {
printk("Node ID: %d\n", pgdat->node_id);
for(i = 0; i < pgdat->node_spanned_pages; i++) {
if (PageReserved(pgdat->node_mem_map+i))
reserved++;
else if (PageSwapCache(pgdat->node_mem_map+i))
cached++;
else if (page_count(pgdat->node_mem_map + i))
shared += page_count(pgdat->node_mem_map + i) - 1;
}
printk("\t%d pages of RAM\n", pgdat->node_spanned_pages);
printk("\t%d reserved pages\n", reserved);
printk("\t%d pages shared\n", shared);
printk("\t%d pages swap cached\n", cached);
}
printk("Total of %ld pages in page table cache\n", pgtable_cache_size);
printk("%d free buffer pages\n", nr_free_buffer_pages());
}
#else /* !CONFIG_DISCONTIGMEM */
printk("Free swap: %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
i = max_mapnr;
while (i-- > 0) {
total++;
if (PageReserved(mem_map+i))
reserved++;
else if (PageSwapCache(mem_map+i))
cached++;
else if (page_count(mem_map + i))
shared += page_count(mem_map + i) - 1;
}
printk("%d pages of RAM\n", total);
printk("%d reserved pages\n", reserved);
printk("%d pages shared\n", shared);
printk("%d pages swap cached\n", cached);
printk("%ld pages in page table cache\n", pgtable_cache_size);
#endif /* !CONFIG_DISCONTIGMEM */
}
/* /*
* This is like put_dirty_page() but installs a clean page in the kernel's page table. * This is like put_dirty_page() but installs a clean page in the kernel's page table.
*/ */
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/sn/sgi.h> #include <asm/sn/sgi.h>
#include <linux/devfs_fs.h>
#include <linux/devfs_fs_kernel.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/sn/iograph.h> #include <asm/sn/iograph.h>
#include <asm/sn/invent.h> #include <asm/sn/invent.h>
...@@ -354,7 +352,7 @@ struct file_operations ioconfig_bus_fops = { ...@@ -354,7 +352,7 @@ struct file_operations ioconfig_bus_fops = {
/* /*
* init_ifconfig_bus() - Boot time initialization. Ensure that it is called * init_ifconfig_bus() - Boot time initialization. Ensure that it is called
* after devfs has been initialized. * after hwgfs has been initialized.
* *
*/ */
int init_ioconfig_bus(void) int init_ioconfig_bus(void)
......
...@@ -9,5 +9,4 @@ ...@@ -9,5 +9,4 @@
EXTRA_CFLAGS := -DLITTLE_ENDIAN EXTRA_CFLAGS := -DLITTLE_ENDIAN
obj-y += hcl.o labelcl.o hcl_util.o invent_stub.o \ obj-y += hcl.o labelcl.o hcl_util.o ramfs.o interface.o
ramfs.o interface.o
...@@ -53,73 +53,12 @@ static unsigned int hcl_debug = HCL_DEBUG_NONE; ...@@ -53,73 +53,12 @@ static unsigned int hcl_debug = HCL_DEBUG_NONE;
static unsigned int boot_options = OPTION_NONE; static unsigned int boot_options = OPTION_NONE;
#endif #endif
/*
* Some Global definitions.
*/
vertex_hdl_t hcl_handle;
invplace_t invplace_none = { invplace_t invplace_none = {
GRAPH_VERTEX_NONE, GRAPH_VERTEX_NONE,
GRAPH_VERTEX_PLACE_NONE, GRAPH_VERTEX_PLACE_NONE,
NULL NULL
}; };
/*
* HCL device driver.
* The purpose of this device driver is to provide a facility
* for User Level Apps e.g. hinv, ioconfig etc. an ioctl path
* to manipulate label entries without having to implement
* system call interfaces. This methodology will enable us to
* make this feature module loadable.
*/
static int hcl_open(struct inode * inode, struct file * filp)
{
if (hcl_debug) {
printk("HCL: hcl_open called.\n");
}
return(0);
}
static int hcl_close(struct inode * inode, struct file * filp)
{
if (hcl_debug) {
printk("HCL: hcl_close called.\n");
}
return(0);
}
static int hcl_ioctl(struct inode * inode, struct file * file,
unsigned int cmd, unsigned long arg)
{
if (hcl_debug) {
printk("HCL: hcl_ioctl called.\n");
}
switch (cmd) {
default:
if (hcl_debug) {
printk("HCL: hcl_ioctl cmd = 0x%x\n", cmd);
}
}
return(0);
}
struct file_operations hcl_fops = {
.owner = (struct module *)0,
.ioctl = hcl_ioctl,
.open = hcl_open,
.release = hcl_close,
};
/* /*
* init_hcl() - Boot time initialization. * init_hcl() - Boot time initialization.
* *
...@@ -146,21 +85,6 @@ int __init init_hcl(void) ...@@ -146,21 +85,6 @@ int __init init_hcl(void)
if (rv) if (rv)
printk ("WARNING: init_hcl: Failed to create hwgraph_root. Error = %d.\n", rv); printk ("WARNING: init_hcl: Failed to create hwgraph_root. Error = %d.\n", rv);
/*
* Create the hcl driver to support inventory entry manipulations.
*
*/
hcl_handle = hwgraph_register(hwgraph_root, ".hcl",
0, 0,
0, 0,
S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0,
&hcl_fops, NULL);
if (hcl_handle == NULL) {
panic("HCL: Unable to create HCL Driver in init_hcl().\n");
return(0);
}
/* /*
* Initialize the HCL string table. * Initialize the HCL string table.
*/ */
......
/* $Id$
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
*/
/*
* Hardware Inventory
*
* See sys/sn/invent.h for an explanation of the hardware inventory contents.
*
*/
#include <linux/types.h>
#include <asm/sn/sgi.h>
#include <asm/sn/hwgfs.h>
#include <asm/sn/invent.h>
#include <asm/sn/hcl.h>
#include <asm/sn/labelcl.h>
#include <asm/sn/invent.h>
void
inventinit(void)
{
}
/*
* For initializing/updating an inventory entry.
*/
void
replace_in_inventory(
inventory_t *pinv, int class, int type,
int controller, int unit, int state)
{
}
/*
* Inventory addition
*
* XXX NOTE: Currently must be called after dynamic memory allocator is
* initialized.
*
*/
void
add_to_inventory(int class, int type, int controller, int unit, int state)
{
}
/*
* Inventory retrieval
*
* These two routines are intended to prevent the caller from having to know
* the internal structure of the inventory table.
*
* The caller of get_next_inventory is supposed to call start_scan_invent
* before the irst call to get_next_inventory, and the caller is required
* to call end_scan_invent after the last call to get_next_inventory.
*/
inventory_t *
get_next_inventory(invplace_t *place)
{
return((inventory_t *) NULL);
}
/* ARGSUSED */
int
get_sizeof_inventory(int abi)
{
return sizeof(inventory_t);
}
/* Must be called prior to first call to get_next_inventory */
void
start_scan_inventory(invplace_t *iplace)
{
}
/* Must be called after last call to get_next_inventory */
void
end_scan_inventory(invplace_t *iplace)
{
}
/*
* Hardware inventory scanner.
*
* Calls fun() for every entry in inventory list unless fun() returns something
* other than 0.
*/
int
scaninvent(int (*fun)(inventory_t *, void *), void *arg)
{
return 0;
}
/*
* Find a particular inventory object
*
* pinv can be a pointer to an inventory entry and the search will begin from
* there, or it can be 0 in which case the search starts at the beginning.
* A -1 for any of the other arguments is a wildcard (i.e. it always matches).
*/
inventory_t *
find_inventory(inventory_t *pinv, int class, int type, int controller,
int unit, int state)
{
return((inventory_t *) NULL);
}
/*
** Retrieve inventory data associated with a device.
*/
inventory_t *
device_inventory_get_next( vertex_hdl_t device,
invplace_t *invplace)
{
return((inventory_t *) NULL);
}
/*
** Associate canonical inventory information with a device (and
** add it to the general inventory).
*/
void
device_inventory_add( vertex_hdl_t device,
int class,
int type,
major_t controller,
minor_t unit,
int state)
{
}
int
device_controller_num_get(vertex_hdl_t device)
{
return (0);
}
void
device_controller_num_set(vertex_hdl_t device, int contr_num)
{
}
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
* can probably be removed with a little more cleanup now that the SAL routines * can probably be removed with a little more cleanup now that the SAL routines
* work on sn2. * work on sn2.
*/ */
#ifdef CONFIG_PCI
extern vertex_hdl_t devfn_to_vertex(unsigned char bus, unsigned char devfn); extern vertex_hdl_t devfn_to_vertex(unsigned char bus, unsigned char devfn);
int sn_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val) int sn_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
...@@ -71,9 +69,3 @@ struct pci_ops sn_pci_ops = { ...@@ -71,9 +69,3 @@ struct pci_ops sn_pci_ops = {
.read = sn_read_config, .read = sn_read_config,
.write = sn_write_config, .write = sn_write_config,
}; };
#else
struct list_head pci_root_buses;
struct list_head pci_root_buses;
struct list_head pci_devices;
#endif /* CONFIG_PCI */
...@@ -426,7 +426,7 @@ sn_pci_fixup(int arg) ...@@ -426,7 +426,7 @@ sn_pci_fixup(int arg)
struct pci_dev *device_dev = NULL; struct pci_dev *device_dev = NULL;
struct sn_widget_sysdata *widget_sysdata; struct sn_widget_sysdata *widget_sysdata;
struct sn_device_sysdata *device_sysdata; struct sn_device_sysdata *device_sysdata;
pciio_intr_t intr_handle; pcibr_intr_t intr_handle;
int cpuid; int cpuid;
vertex_hdl_t device_vertex; vertex_hdl_t device_vertex;
pciio_intr_line_t lines; pciio_intr_line_t lines;
...@@ -438,14 +438,18 @@ sn_pci_fixup(int arg) ...@@ -438,14 +438,18 @@ sn_pci_fixup(int arg)
extern void register_sn_procfs(void); extern void register_sn_procfs(void);
#endif #endif
extern void irix_io_init(void); extern void irix_io_init(void);
extern void sn_init_cpei_timer(void);
init_hcl(); init_hcl();
irix_io_init(); irix_io_init();
for (cnode = 0; cnode < numnodes; cnode++) { for (cnode = 0; cnode < numnodes; cnode++) {
extern void intr_init_vecblk(nodepda_t *npda, cnodeid_t, int); extern void intr_init_vecblk(cnodeid_t);
intr_init_vecblk(NODEPDA(cnode), cnode, 0); intr_init_vecblk(cnode);
} }
sn_init_cpei_timer();
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
register_sn_procfs(); register_sn_procfs();
#endif #endif
...@@ -545,17 +549,17 @@ sn_pci_fixup(int arg) ...@@ -545,17 +549,17 @@ sn_pci_fixup(int arg)
(unsigned char *)&lines); (unsigned char *)&lines);
irqpdaindr->curr = device_dev; irqpdaindr->curr = device_dev;
intr_handle = pciio_intr_alloc(device_vertex, NULL, lines, device_vertex); intr_handle = pcibr_intr_alloc(device_vertex, NULL, lines, device_vertex);
irq = intr_handle->pi_irq; irq = intr_handle->bi_irq;
irqpdaindr->device_dev[irq] = device_dev; irqpdaindr->device_dev[irq] = device_dev;
cpuid = intr_handle->pi_cpu; cpuid = intr_handle->bi_cpu;
pciio_intr_connect(intr_handle, (intr_func_t)0, (intr_arg_t)0); pcibr_intr_connect(intr_handle, (intr_func_t)0, (intr_arg_t)0);
device_dev->irq = irq; device_dev->irq = irq;
register_pcibr_intr(irq, (pcibr_intr_t)intr_handle); register_pcibr_intr(irq, intr_handle);
for (idx = 0; idx < PCI_ROM_RESOURCE; idx++) { for (idx = 0; idx < PCI_ROM_RESOURCE; idx++) {
int ibits = ((pcibr_intr_t)intr_handle)->bi_ibits; int ibits = intr_handle->bi_ibits;
int i; int i;
size = device_dev->resource[idx].end - size = device_dev->resource[idx].end -
...@@ -700,12 +704,12 @@ pci_bus_map_create(vertex_hdl_t xtalk, char * io_moduleid) ...@@ -700,12 +704,12 @@ pci_bus_map_create(vertex_hdl_t xtalk, char * io_moduleid)
* Pre assign DMA maps needed for 32 Bits Page Map DMA. * Pre assign DMA maps needed for 32 Bits Page Map DMA.
*/ */
busnum_to_atedmamaps[num_bridges - 1] = (void *) kmalloc( busnum_to_atedmamaps[num_bridges - 1] = (void *) kmalloc(
sizeof(struct sn_dma_maps_s) * MAX_ATE_MAPS, GFP_KERNEL); sizeof(struct pcibr_dmamap_s) * MAX_ATE_MAPS, GFP_KERNEL);
if (!busnum_to_atedmamaps[num_bridges - 1]) if (!busnum_to_atedmamaps[num_bridges - 1])
printk("WARNING: pci_bus_map_create: Unable to precreate ATE DMA Maps for busnum %d vertex 0x%p\n", num_bridges - 1, (void *)xwidget); printk("WARNING: pci_bus_map_create: Unable to precreate ATE DMA Maps for busnum %d vertex 0x%p\n", num_bridges - 1, (void *)xwidget);
memset(busnum_to_atedmamaps[num_bridges - 1], 0x0, memset(busnum_to_atedmamaps[num_bridges - 1], 0x0,
sizeof(struct sn_dma_maps_s) * MAX_ATE_MAPS); sizeof(struct pcibr_dmamap_s) * MAX_ATE_MAPS);
} }
...@@ -764,12 +768,12 @@ pci_bus_map_create(vertex_hdl_t xtalk, char * io_moduleid) ...@@ -764,12 +768,12 @@ pci_bus_map_create(vertex_hdl_t xtalk, char * io_moduleid)
* Pre assign DMA maps needed for 32 Bits Page Map DMA. * Pre assign DMA maps needed for 32 Bits Page Map DMA.
*/ */
busnum_to_atedmamaps[bus_number] = (void *) kmalloc( busnum_to_atedmamaps[bus_number] = (void *) kmalloc(
sizeof(struct sn_dma_maps_s) * MAX_ATE_MAPS, GFP_KERNEL); sizeof(struct pcibr_dmamap_s) * MAX_ATE_MAPS, GFP_KERNEL);
if (!busnum_to_atedmamaps[bus_number]) if (!busnum_to_atedmamaps[bus_number])
printk("WARNING: pci_bus_map_create: Unable to precreate ATE DMA Maps for busnum %d vertex 0x%p\n", num_bridges - 1, (void *)xwidget); printk("WARNING: pci_bus_map_create: Unable to precreate ATE DMA Maps for busnum %d vertex 0x%p\n", num_bridges - 1, (void *)xwidget);
memset(busnum_to_atedmamaps[bus_number], 0x0, memset(busnum_to_atedmamaps[bus_number], 0x0,
sizeof(struct sn_dma_maps_s) * MAX_ATE_MAPS); sizeof(struct pcibr_dmamap_s) * MAX_ATE_MAPS);
} }
} }
......
This diff is collapsed.
...@@ -14,6 +14,3 @@ EXTRA_CFLAGS := -DLITTLE_ENDIAN ...@@ -14,6 +14,3 @@ EXTRA_CFLAGS := -DLITTLE_ENDIAN
obj-y += pcibr/ ml_SN_intr.o shub_intr.o shuberror.o shub.o bte_error.o \ obj-y += pcibr/ ml_SN_intr.o shub_intr.o shuberror.o shub.o bte_error.o \
pic.o geo_op.o l1_command.o klconflib.o klgraph.o ml_SN_init.o \ pic.o geo_op.o l1_command.o klconflib.o klgraph.o ml_SN_init.o \
ml_iograph.o module.o pciio.o xbow.o xtalk.o shubio.o ml_iograph.o module.o pciio.o xbow.o xtalk.o shubio.o
obj-$(CONFIG_KDB) += kdba_io.o
obj-$(CONFIG_SHUB_1_0_SPECIFIC) += efi-rtc.o
/*
* Kernel Debugger Architecture Dependent POD functions.
*
* Copyright (C) 1999-2003 Silicon Graphics, Inc. All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#include <linux/types.h>
#include <linux/kdb.h>
//#include <linux/kdbprivate.h>
/**
* kdba_io - enter POD mode from kdb
* @argc: arg count
* @argv: arg values
* @envp: kdb env. vars
* @regs: current register state
*
* Enter POD mode from kdb using SGI SN specific SAL function call.
*/
static int
kdba_io(int argc, const char **argv, const char **envp, struct pt_regs *regs)
{
kdb_printf("kdba_io entered with addr 0x%p\n", (void *) regs);
return(0);
}
/**
* kdba_io_init - register 'io' command with kdb
*
* Register the 'io' command with kdb at load time.
*/
void
kdba_io_init(void)
{
kdb_register("io", kdba_io, "<vaddr>", "Display IO Contents", 0);
}
/**
* kdba_io_exit - unregister the 'io' command
*
* Tell kdb that the 'io' command is no longer available.
*/
static void __exit
kdba_exit(void)
{
kdb_unregister("io");
}
This diff is collapsed.
...@@ -268,17 +268,6 @@ iograph_early_init(void) ...@@ -268,17 +268,6 @@ iograph_early_init(void)
} }
} }
/*
* Let boot processor know that we're done initializing our node's IO
* and then exit.
*/
/* ARGSUSED */
static void
io_init_done(cnodeid_t cnodeid,cpu_cookie_t c)
{
/* Let boot processor know that we're done. */
}
/* /*
* Probe to see if this hub's xtalk link is active. If so, * Probe to see if this hub's xtalk link is active. If so,
* return the Crosstalk Identification of the widget that we talk to. * return the Crosstalk Identification of the widget that we talk to.
...@@ -329,28 +318,6 @@ early_probe_for_widget(vertex_hdl_t hubv, xwidget_hwid_t hwid) ...@@ -329,28 +318,6 @@ early_probe_for_widget(vertex_hdl_t hubv, xwidget_hwid_t hwid)
} }
} }
/* Add inventory information to the widget vertex
* Right now (module,slot,revision) is being
* added as inventory information.
*/
static void
xwidget_inventory_add(vertex_hdl_t widgetv,
lboard_t *board,
struct xwidget_hwid_s hwid)
{
if (!board)
return;
/* Donot add inventory information for the baseio
* on a speedo with an xbox. It has already been
* taken care of in SN00_vmc.
* Speedo with xbox's baseio comes in at slot io1 (widget 9)
*/
device_inventory_add(widgetv,INV_IOBD,board->brd_type,
geo_module(board->brd_geoid),
SLOTNUM_GETSLOT(board->brd_slot),
hwid.rev_num);
}
/* /*
* io_xswitch_widget_init * io_xswitch_widget_init
* *
...@@ -494,10 +461,6 @@ io_xswitch_widget_init(vertex_hdl_t xswitchv, ...@@ -494,10 +461,6 @@ io_xswitch_widget_init(vertex_hdl_t xswitchv,
hwid.part_num = XWIDGET_PART_NUM(widget_id); hwid.part_num = XWIDGET_PART_NUM(widget_id);
hwid.rev_num = XWIDGET_REV_NUM(widget_id); hwid.rev_num = XWIDGET_REV_NUM(widget_id);
hwid.mfg_num = XWIDGET_MFG_NUM(widget_id); hwid.mfg_num = XWIDGET_MFG_NUM(widget_id);
/* Store some inventory information about
* the xwidget in the hardware graph.
*/
xwidget_inventory_add(widgetv,board,hwid);
(void)xwidget_register(&hwid, widgetv, widgetnum, (void)xwidget_register(&hwid, widgetv, widgetnum,
hubv, hub_widgetid); hubv, hub_widgetid);
...@@ -687,11 +650,6 @@ io_init_node(cnodeid_t cnodeid) ...@@ -687,11 +650,6 @@ io_init_node(cnodeid_t cnodeid)
DBG("Interfering with device probing!!!\n"); DBG("Interfering with device probing!!!\n");
} }
#endif #endif
/* io_init_done takes cpu cookie as 2nd argument
* to do a restorenoderun for the setnoderun done
* at the start of this thread
*/
DBG("**** io_init_node: Node's 0x%p hub widget has XWIDGET_PART_NUM_NONE ****\n", hubv); DBG("**** io_init_node: Node's 0x%p hub widget has XWIDGET_PART_NUM_NONE ****\n", hubv);
return; return;
/* NOTREACHED */ /* NOTREACHED */
...@@ -795,15 +753,6 @@ io_init_node(cnodeid_t cnodeid) ...@@ -795,15 +753,6 @@ io_init_node(cnodeid_t cnodeid)
(void)xwidget_register(&hwid, widgetv, npdap->basew_id, hubv, hubinfo->h_widgetid); (void)xwidget_register(&hwid, widgetv, npdap->basew_id, hubv, hubinfo->h_widgetid);
if (!is_xswitch) {
/* io_init_done takes cpu cookie as 2nd argument
* to do a restorenoderun for the setnoderun done
* at the start of this thread
*/
io_init_done(cnodeid,c);
/* NOTREACHED */
}
/* /*
* Special handling for Crosstalk Switches (e.g. xbow). * Special handling for Crosstalk Switches (e.g. xbow).
* We need to do things in roughly the following order: * We need to do things in roughly the following order:
...@@ -848,35 +797,9 @@ io_init_node(cnodeid_t cnodeid) ...@@ -848,35 +797,9 @@ io_init_node(cnodeid_t cnodeid)
io_init_xswitch_widgets(switchv, cnodeid); io_init_xswitch_widgets(switchv, cnodeid);
io_link_xswitch_widgets(switchv, cnodeid); io_link_xswitch_widgets(switchv, cnodeid);
/* io_init_done takes cpu cookie as 2nd argument
* to do a restorenoderun for the setnoderun done
* at the start of this thread
*/
io_init_done(cnodeid,c);
DBG("\nio_init_node: DONE INITIALIZED ALL I/O FOR CNODEID %d\n\n", cnodeid); DBG("\nio_init_node: DONE INITIALIZED ALL I/O FOR CNODEID %d\n\n", cnodeid);
} }
#define IOINIT_STKSZ (16 * 1024)
#define __DEVSTR1 "/../.master/"
#define __DEVSTR2 "/target/"
#define __DEVSTR3 "/lun/0/disk/partition/"
#define __DEVSTR4 "/../ef"
/*
* ioconfig starts numbering SCSI's at NUM_BASE_IO_SCSI_CTLR.
*/
#define NUM_BASE_IO_SCSI_CTLR 6
/*
* This tells ioconfig where it can start numbering scsi controllers.
* Below this base number, platform-specific handles the numbering.
* XXX Irix legacy..controller numbering should be part of devfsd's job
*/
int num_base_io_scsi_ctlr = 2; /* used by syssgi */
vertex_hdl_t base_io_scsi_ctlr_vhdl[NUM_BASE_IO_SCSI_CTLR];
#include <asm/sn/ioerror_handling.h> #include <asm/sn/ioerror_handling.h>
/* #endif */ /* #endif */
...@@ -914,78 +837,6 @@ init_all_devices(void) ...@@ -914,78 +837,6 @@ init_all_devices(void)
#define toint(x) ((int)(x) - (int)('0')) #define toint(x) ((int)(x) - (int)('0'))
void
devnamefromarcs(char *devnm)
{
int val;
char tmpnm[MAXDEVNAME];
char *tmp1, *tmp2;
val = strncmp(devnm, "dks", 3);
if (val != 0)
return;
tmp1 = devnm + 3;
if (!isdigit(*tmp1))
return;
val = 0;
while (isdigit(*tmp1)) {
val = 10*val+toint(*tmp1);
tmp1++;
}
if(*tmp1 != 'd')
return;
else
tmp1++;
if ((val < 0) || (val >= num_base_io_scsi_ctlr)) {
int i;
int viable_found = 0;
DBG("Only controller numbers 0..%d are supported for\n", NUM_BASE_IO_SCSI_CTLR-1);
DBG("prom \"root\" variables of the form dksXdXsX.\n");
DBG("To use another disk you must use the full hardware graph path\n\n");
DBG("Possible controller numbers for use in 'dksXdXsX' on this system: ");
for (i=0; i<NUM_BASE_IO_SCSI_CTLR; i++) {
if (base_io_scsi_ctlr_vhdl[i] != GRAPH_VERTEX_NONE) {
DBG("%d ", i);
viable_found=1;
}
}
if (viable_found)
DBG("\n");
else
DBG("none found!\n");
DELAY(15000000);
//prom_reboot();
panic("FIXME: devnamefromarcs: should call prom_reboot here.\n");
/* NOTREACHED */
}
ASSERT(base_io_scsi_ctlr_vhdl[val] != GRAPH_VERTEX_NONE);
vertex_to_name(base_io_scsi_ctlr_vhdl[val],
tmpnm,
MAXDEVNAME);
tmp2 = tmpnm + strlen(tmpnm);
strcpy(tmp2, __DEVSTR2);
tmp2 += strlen(__DEVSTR2);
while (*tmp1 != 's') {
if((*tmp2++ = *tmp1++) == '\0')
return;
}
tmp1++;
strcpy(tmp2, __DEVSTR3);
tmp2 += strlen(__DEVSTR3);
while ( (*tmp2++ = *tmp1++) )
;
tmp2--;
*tmp2++ = '/';
strcpy(tmp2, EDGE_LBL_BLOCK);
strcpy(devnm,tmpnm);
}
static static
struct io_brick_map_s io_brick_tab[] = { struct io_brick_map_s io_brick_tab[] = {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/module.h>
#include <asm/sn/sgi.h> #include <asm/sn/sgi.h>
#include <asm/sn/xtalk/xbow.h> /* Must be before iograph.h to get MAX_PORT_NUM */ #include <asm/sn/xtalk/xbow.h> /* Must be before iograph.h to get MAX_PORT_NUM */
#include <asm/sn/iograph.h> #include <asm/sn/iograph.h>
...@@ -947,15 +948,6 @@ pciio_info_get(vertex_hdl_t pciio) ...@@ -947,15 +948,6 @@ pciio_info_get(vertex_hdl_t pciio)
pciio_info = (pciio_info_t) hwgraph_fastinfo_get(pciio); pciio_info = (pciio_info_t) hwgraph_fastinfo_get(pciio);
#ifdef DEBUG_PCIIO
{
int pos;
char dname[256];
pos = devfs_generate_path(pciio, dname, 256);
printk("%s : path= %s\n", __FUNCTION__, &dname[pos]);
}
#endif /* DEBUG_PCIIO */
if ((pciio_info != NULL) && if ((pciio_info != NULL) &&
(pciio_info->c_fingerprint != pciio_info_fingerprint) (pciio_info->c_fingerprint != pciio_info_fingerprint)
&& (pciio_info->c_fingerprint != NULL)) { && (pciio_info->c_fingerprint != NULL)) {
...@@ -1212,14 +1204,6 @@ pciio_device_info_register( ...@@ -1212,14 +1204,6 @@ pciio_device_info_register(
pciio_info->c_vertex = pconn; pciio_info->c_vertex = pconn;
pciio_info_set(pconn, pciio_info); pciio_info_set(pconn, pciio_info);
#ifdef DEBUG_PCIIO
{
int pos;
char dname[256];
pos = devfs_generate_path(pconn, dname, 256);
printk("%s : pconn path= %s \n", __FUNCTION__, &dname[pos]);
}
#endif /* DEBUG_PCIIO */
/* /*
* create link to our pci provider * create link to our pci provider
...@@ -1254,24 +1238,6 @@ pciio_device_info_unregister(vertex_hdl_t connectpt, ...@@ -1254,24 +1238,6 @@ pciio_device_info_unregister(vertex_hdl_t connectpt,
hwgraph_vertex_destroy(pconn); hwgraph_vertex_destroy(pconn);
} }
/* Add the pci card inventory information to the hwgraph
*/
static void
pciio_device_inventory_add(vertex_hdl_t pconn_vhdl)
{
pciio_info_t pciio_info = pciio_info_get(pconn_vhdl);
ASSERT(pciio_info);
ASSERT(pciio_info->c_vertex == pconn_vhdl);
/* Donot add inventory for non-existent devices */
if ((pciio_info->c_vendor == PCIIO_VENDOR_ID_NONE) ||
(pciio_info->c_device == PCIIO_DEVICE_ID_NONE))
return;
device_inventory_add(pconn_vhdl,INV_IOBD,INV_PCIADAP,
pciio_info->c_vendor,pciio_info->c_device,
pciio_info->c_slot);
}
/*ARGSUSED */ /*ARGSUSED */
int int
...@@ -1283,7 +1249,6 @@ pciio_device_attach(vertex_hdl_t pconn, ...@@ -1283,7 +1249,6 @@ pciio_device_attach(vertex_hdl_t pconn,
pciio_device_id_t device_id; pciio_device_id_t device_id;
pciio_device_inventory_add(pconn);
pciio_info = pciio_info_get(pconn); pciio_info = pciio_info_get(pconn);
vendor_id = pciio_info->c_vendor; vendor_id = pciio_info->c_vendor;
...@@ -1435,27 +1400,10 @@ pciio_info_type1_get(pciio_info_t pci_info) ...@@ -1435,27 +1400,10 @@ pciio_info_type1_get(pciio_info_t pci_info)
return(0); return(0);
} }
/* /*
* These are complementary Linux interfaces that takes in a pci_dev * as the * XXX: should probably be called __sn2_pci_rrb_alloc
* first arguement instead of vertex_hdl_t.
*/ */
iopaddr_t snia_pciio_dmatrans_addr(struct pci_dev *, device_desc_t, paddr_t, size_t, unsigned); /* used by qla1280 */
pciio_dmamap_t snia_pciio_dmamap_alloc(struct pci_dev *, device_desc_t, size_t, unsigned);
void snia_pciio_dmamap_free(pciio_dmamap_t);
iopaddr_t snia_pciio_dmamap_addr(pciio_dmamap_t, paddr_t, size_t);
void snia_pciio_dmamap_done(pciio_dmamap_t);
pciio_endian_t snia_pciio_endian_set(struct pci_dev *pci_dev, pciio_endian_t device_end,
pciio_endian_t desired_end);
#include <linux/module.h>
EXPORT_SYMBOL(snia_pciio_dmatrans_addr);
EXPORT_SYMBOL(snia_pciio_dmamap_alloc);
EXPORT_SYMBOL(snia_pciio_dmamap_free);
EXPORT_SYMBOL(snia_pciio_dmamap_addr);
EXPORT_SYMBOL(snia_pciio_dmamap_done);
EXPORT_SYMBOL(snia_pciio_endian_set);
int int
snia_pcibr_rrb_alloc(struct pci_dev *pci_dev, snia_pcibr_rrb_alloc(struct pci_dev *pci_dev,
int *count_vchan0, int *count_vchan0,
...@@ -1467,6 +1415,13 @@ snia_pcibr_rrb_alloc(struct pci_dev *pci_dev, ...@@ -1467,6 +1415,13 @@ snia_pcibr_rrb_alloc(struct pci_dev *pci_dev,
} }
EXPORT_SYMBOL(snia_pcibr_rrb_alloc); EXPORT_SYMBOL(snia_pcibr_rrb_alloc);
/*
* XXX: interface should be more like
*
* int __sn2_pci_enable_bwswap(struct pci_dev *dev);
* void __sn2_pci_disable_bswap(struct pci_dev *dev);
*/
/* used by ioc4 ide */
pciio_endian_t pciio_endian_t
snia_pciio_endian_set(struct pci_dev *pci_dev, snia_pciio_endian_set(struct pci_dev *pci_dev,
pciio_endian_t device_end, pciio_endian_t device_end,
...@@ -1477,62 +1432,4 @@ snia_pciio_endian_set(struct pci_dev *pci_dev, ...@@ -1477,62 +1432,4 @@ snia_pciio_endian_set(struct pci_dev *pci_dev,
return DEV_FUNC(dev, endian_set) return DEV_FUNC(dev, endian_set)
(dev, device_end, desired_end); (dev, device_end, desired_end);
} }
EXPORT_SYMBOL(snia_pciio_endian_set);
iopaddr_t
snia_pciio_dmatrans_addr(struct pci_dev *pci_dev, /* translate for this device */
device_desc_t dev_desc, /* device descriptor */
paddr_t paddr, /* system physical address */
size_t byte_count, /* length */
unsigned flags)
{ /* defined in dma.h */
vertex_hdl_t dev = PCIDEV_VERTEX(pci_dev);
/*
* If the device is not a PIC, we always want the PCIIO_BYTE_STREAM to be
* set. Otherwise, it must not be set. This applies to SN1 and SN2.
*/
return DEV_FUNC(dev, dmatrans_addr)
(dev, dev_desc, paddr, byte_count, (IS_PIC_DEVICE(pci_dev)) ? (flags & ~PCIIO_BYTE_STREAM) : flags | PCIIO_BYTE_STREAM);
}
pciio_dmamap_t
snia_pciio_dmamap_alloc(struct pci_dev *pci_dev, /* set up mappings for this device */
device_desc_t dev_desc, /* device descriptor */
size_t byte_count_max, /* max size of a mapping */
unsigned flags)
{ /* defined in dma.h */
vertex_hdl_t dev = PCIDEV_VERTEX(pci_dev);
/*
* If the device is not a PIC, we always want the PCIIO_BYTE_STREAM to be
* set. Otherwise, it must not be set. This applies to SN1 and SN2.
*/
return (pciio_dmamap_t) DEV_FUNC(dev, dmamap_alloc)
(dev, dev_desc, byte_count_max, (IS_PIC_DEVICE(pci_dev)) ? (flags & ~PCIIO_BYTE_STREAM) : flags | PCIIO_BYTE_STREAM);
}
void
snia_pciio_dmamap_free(pciio_dmamap_t pciio_dmamap)
{
DMAMAP_FUNC(pciio_dmamap, dmamap_free)
(CAST_DMAMAP(pciio_dmamap));
}
iopaddr_t
snia_pciio_dmamap_addr(pciio_dmamap_t pciio_dmamap, /* use these mapping resources */
paddr_t paddr, /* map for this address */
size_t byte_count)
{ /* map this many bytes */
return DMAMAP_FUNC(pciio_dmamap, dmamap_addr)
(CAST_DMAMAP(pciio_dmamap), paddr, byte_count);
}
void
snia_pciio_dmamap_done(pciio_dmamap_t pciio_dmamap)
{
DMAMAP_FUNC(pciio_dmamap, dmamap_done)
(CAST_DMAMAP(pciio_dmamap));
}
/* $Id: shub_intr.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $ /*
*
* This file is subject to the terms and conditions of the GNU General Public * This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive * License. See the file "COPYING" in the main directory of this archive
* for more details. * for more details.
...@@ -61,8 +60,7 @@ do_hub_intr_alloc(vertex_hdl_t dev, ...@@ -61,8 +60,7 @@ do_hub_intr_alloc(vertex_hdl_t dev,
xwidget_info_t xwidget_info; xwidget_info_t xwidget_info;
ilvl_t intr_swlevel = 0; ilvl_t intr_swlevel = 0;
cpu = intr_heuristic(dev, dev_desc, -1, 0, owner_dev, NULL, &vector); cpu = intr_heuristic(dev, -1, &vector);
if (cpu == CPU_NONE) { if (cpu == CPU_NONE) {
printk("Unable to allocate interrupt for 0x%p\n", (void *)owner_dev); printk("Unable to allocate interrupt for 0x%p\n", (void *)owner_dev);
return(0); return(0);
...@@ -150,10 +148,9 @@ hub_intr_connect(hub_intr_t intr_hdl, ...@@ -150,10 +148,9 @@ hub_intr_connect(hub_intr_t intr_hdl,
ASSERT(intr_hdl->i_flags & HUB_INTR_IS_ALLOCED); ASSERT(intr_hdl->i_flags & HUB_INTR_IS_ALLOCED);
rv = intr_connect_level(cpu, vector, intr_hdl->i_swlevel, NULL); rv = intr_connect_level(cpu, vector);
if (rv < 0) { if (rv < 0)
return rv; return rv;
}
intr_hdl->i_xtalk_info.xi_setfunc = setfunc; intr_hdl->i_xtalk_info.xi_setfunc = setfunc;
intr_hdl->i_xtalk_info.xi_sfarg = setfunc_arg; intr_hdl->i_xtalk_info.xi_sfarg = setfunc_arg;
......
...@@ -145,14 +145,13 @@ hubii_eint_init(cnodeid_t cnode) ...@@ -145,14 +145,13 @@ hubii_eint_init(cnodeid_t cnode)
/* Select a possible interrupt target where there is a free interrupt /* Select a possible interrupt target where there is a free interrupt
* bit and also reserve the interrupt bit for this IO error interrupt * bit and also reserve the interrupt bit for this IO error interrupt
*/ */
intr_cpu = intr_heuristic(hub_v,0,SGI_II_ERROR,0,hub_v, intr_cpu = intr_heuristic(hub_v, SGI_II_ERROR, &bit);
"HUB IO error interrupt",&bit);
if (intr_cpu == CPU_NONE) { if (intr_cpu == CPU_NONE) {
printk("hubii_eint_init: intr_reserve_level failed, cnode %d", cnode); printk("hubii_eint_init: intr_heuristic failed, cnode %d", cnode);
return; return;
} }
rv = intr_connect_level(intr_cpu, SGI_II_ERROR, 0, NULL); rv = intr_connect_level(intr_cpu, SGI_II_ERROR);
request_irq(SGI_II_ERROR, hubii_eint_handler, SA_SHIRQ, "SN_hub_error", (void *)hub_v); request_irq(SGI_II_ERROR, hubii_eint_handler, SA_SHIRQ, "SN_hub_error", (void *)hub_v);
irq_descp(bit)->status |= SN2_IRQ_PER_HUB; irq_descp(bit)->status |= SN2_IRQ_PER_HUB;
ASSERT_ALWAYS(rv >= 0); ASSERT_ALWAYS(rv >= 0);
......
...@@ -257,7 +257,7 @@ xbow_attach(vertex_hdl_t conn) ...@@ -257,7 +257,7 @@ xbow_attach(vertex_hdl_t conn)
*/ */
/* /*
* Register a xbow driver with devfs. * Register a xbow driver with hwgraph.
* file ops. * file ops.
*/ */
vhdl = NULL; vhdl = NULL;
......
...@@ -11,4 +11,3 @@ EXTRA_CFLAGS := -DLITTLE_ENDIAN ...@@ -11,4 +11,3 @@ EXTRA_CFLAGS := -DLITTLE_ENDIAN
obj-y += probe.o setup.o bte.o irq.o mca.o idle.o sn2/ obj-y += probe.o setup.o bte.o irq.o mca.o idle.o sn2/
obj-$(CONFIG_IA64_GENERIC) += machvec.o obj-$(CONFIG_IA64_GENERIC) += machvec.o
obj-$(CONFIG_MODULES) += sn_ksyms.o
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2000-2003 Silicon Graphics, Inc. All rights reserved.
*/
/*
* Architecture-specific kernel symbols
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <asm/machvec.h>
#include <asm/sn/intr.h>
#include <asm/sn/sgi.h>
#include <asm/sn/types.h>
#include <asm/sn/arch.h>
#include <asm/sn/bte.h>
#include <asm/sal.h>
#include <asm/sn/sn_sal.h>
#ifdef CONFIG_IA64_SGI_SN_DEBUG
EXPORT_SYMBOL(__pa_debug);
EXPORT_SYMBOL(__va_debug);
#endif
EXPORT_SYMBOL(bte_copy);
EXPORT_SYMBOL(bte_unaligned_copy);
EXPORT_SYMBOL(ia64_sal);
EXPORT_SYMBOL(sal_lock);
EXPORT_SYMBOL(sn_local_partid);
#ifndef meminit_h
#define meminit_h
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
/*
* Entries defined so far:
* - boot param structure itself
* - memory map
* - initrd (optional)
* - command line string
* - kernel code & data
*
* More could be added if necessary
*/
#define IA64_MAX_RSVD_REGIONS 5
struct rsvd_region {
unsigned long start; /* virtual address of beginning of element */
unsigned long end; /* virtual address of end of element + 1 */
};
extern struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
extern int num_rsvd_regions;
extern void find_memory (void);
extern void reserve_memory (void);
extern void find_initrd (void);
extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
#ifdef CONFIG_DISCONTIGMEM
extern void call_pernode_memory (unsigned long start, unsigned long end, void *arg);
#endif
#define IGNORE_PFN0 1 /* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */
#endif /* meminit_h */
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#ifndef _ASM_IA64_NUMA_H #ifndef _ASM_IA64_NUMA_H
#define _ASM_IA64_NUMA_H #define _ASM_IA64_NUMA_H
#include <linux/config.h>
#include <linux/cpumask.h>
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
#ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_DISCONTIGMEM
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
#ifndef _ASM_IA64_SN_HCL_UTIL_H #ifndef _ASM_IA64_SN_HCL_UTIL_H
#define _ASM_IA64_SN_HCL_UTIL_H #define _ASM_IA64_SN_HCL_UTIL_H
#include <linux/devfs_fs_kernel.h>
extern char * dev_to_name(vertex_hdl_t, char *, uint); extern char * dev_to_name(vertex_hdl_t, char *, uint);
extern int device_master_set(vertex_hdl_t, vertex_hdl_t); extern int device_master_set(vertex_hdl_t, vertex_hdl_t);
extern vertex_hdl_t device_master_get(vertex_hdl_t); extern vertex_hdl_t device_master_get(vertex_hdl_t);
......
...@@ -720,28 +720,14 @@ typedef struct invplace_s { ...@@ -720,28 +720,14 @@ typedef struct invplace_s {
extern invplace_t invplace_none; extern invplace_t invplace_none;
#define INVPLACE_NONE invplace_none #define INVPLACE_NONE invplace_none
extern void add_to_inventory(int, int, int, int, int); static inline void device_inventory_add(vertex_hdl_t device,
extern void replace_in_inventory(inventory_t *, int, int, int, int, int);
extern void start_scan_inventory(invplace_t *);
extern inventory_t *get_next_inventory(invplace_t *);
extern void end_scan_inventory(invplace_t *);
extern inventory_t *find_inventory(inventory_t *, int, int, int, int, int);
extern int scaninvent(int (*)(inventory_t *, void *), void *);
extern int get_sizeof_inventory(int);
extern void device_inventory_add( vertex_hdl_t device,
int class, int class,
int type, int type,
major_t ctlr, major_t ctlr,
minor_t unit, minor_t unit,
int state); int state)
{
}
extern inventory_t *device_inventory_get_next( vertex_hdl_t device,
invplace_t *);
extern void device_controller_num_set( vertex_hdl_t,
int);
extern int device_controller_num_get( vertex_hdl_t);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _ASM_IA64_SN_INVENT_H */ #endif /* _ASM_IA64_SN_INVENT_H */
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/devfs_fs_kernel.h>
#include <asm/sn/sgi.h> #include <asm/sn/sgi.h>
#if __KERNEL__ #if __KERNEL__
......
...@@ -40,7 +40,7 @@ typedef struct label_info_s { ...@@ -40,7 +40,7 @@ typedef struct label_info_s {
/* /*
* Definition of the data structure that provides the link to * Definition of the data structure that provides the link to
* the hwgraph fastinfo and the label entries associated with a * the hwgraph fastinfo and the label entries associated with a
* particular devfs entry. * particular hwgraph entry.
*/ */
typedef struct labelcl_info_s { typedef struct labelcl_info_s {
unsigned long hwcl_magic; unsigned long hwcl_magic;
...@@ -87,6 +87,5 @@ extern int labelcl_info_replace_IDX(vertex_hdl_t, int, arbitrary_info_t, ...@@ -87,6 +87,5 @@ extern int labelcl_info_replace_IDX(vertex_hdl_t, int, arbitrary_info_t,
arbitrary_info_t *); arbitrary_info_t *);
extern int labelcl_info_connectpt_set(vertex_hdl_t, vertex_hdl_t); extern int labelcl_info_connectpt_set(vertex_hdl_t, vertex_hdl_t);
extern int labelcl_info_get_IDX(vertex_hdl_t, int, arbitrary_info_t *); extern int labelcl_info_get_IDX(vertex_hdl_t, int, arbitrary_info_t *);
extern struct devfs_handle_t device_info_connectpt_get(vertex_hdl_t);
#endif /* _ASM_IA64_SN_LABELCL_H */ #endif /* _ASM_IA64_SN_LABELCL_H */
/*
* Intel Multimedia Timer device interface
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (c) 2001-2003 Silicon Graphics, Inc. All rights reserved.
*
* Helper file for the SN implementation of mmtimers
*
* 11/01/01 - jbarnes - initial revision
*/
#ifndef _SN_MMTIMER_PRIVATE_H
#define RTC_BITS 55 /* 55 bits for this implementation */
#define NUM_COMPARATORS 2 /* two comparison registers in SN1 */
/*
* Check for an interrupt and clear the pending bit if
* one is waiting.
*/
#define MMTIMER_INT_PENDING(x) (x ? *(RTC_INT_PENDING_B_ADDR) : *(RTC_INT_PENDING_A_ADDR))
/*
* Set interrupts on RTC 'x' to 'v' (true or false)
*/
#define MMTIMER_SET_INT(x,v) (x ? (*(RTC_INT_ENABLED_B_ADDR) = (unsigned long)(v)) : (*(RTC_INT_ENABLED_A_ADDR) = (unsigned long)(v)))
#define MMTIMER_ENABLE_INT(x) MMTIMER_SET_INT(x, 1)
#define MMTIMER_DISABLE_INT(x) MMTIMER_SET_INT(x, 0)
typedef struct mmtimer {
spinlock_t timer_lock;
unsigned long periodic;
int signo;
volatile unsigned long *compare;
struct task_struct *process;
} mmtimer_t;
#endif /* _SN_LINUX_MMTIMER_PRIVATE_H */
...@@ -60,11 +60,6 @@ struct sn_device_sysdata { ...@@ -60,11 +60,6 @@ struct sn_device_sysdata {
volatile unsigned int *xbow_buf_sync; volatile unsigned int *xbow_buf_sync;
}; };
struct sn_dma_maps_s{
struct pcibr_dmamap_s dma_map;
dma_addr_t dma_addr;
};
struct ioports_to_tlbs_s { struct ioports_to_tlbs_s {
unsigned long p:1, unsigned long p:1,
rv_1:1, rv_1:1,
......
...@@ -139,6 +139,7 @@ struct pcibr_dmamap_s { ...@@ -139,6 +139,7 @@ struct pcibr_dmamap_s {
bridge_ate_p bd_ate_ptr; /* where to write first ATE */ bridge_ate_p bd_ate_ptr; /* where to write first ATE */
bridge_ate_t bd_ate_proto; /* prototype ATE (for xioaddr=0) */ bridge_ate_t bd_ate_proto; /* prototype ATE (for xioaddr=0) */
bridge_ate_t bd_ate_prime; /* value of 1st ATE written */ bridge_ate_t bd_ate_prime; /* value of 1st ATE written */
dma_addr_t bd_dma_addr; /* Linux dma handle */
}; };
#define IBUFSIZE 5 /* size of circular buffer (holds 4) */ #define IBUFSIZE 5 /* size of circular buffer (holds 4) */
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <asm/sn/types.h> #include <asm/sn/types.h>
#include <asm/uaccess.h> /* for copy_??_user */ #include <asm/uaccess.h> /* for copy_??_user */
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <asm/sn/hwgfs.h> #include <asm/sn/hwgfs.h>
......
...@@ -49,14 +49,10 @@ extern void get_dir_ent(paddr_t paddr, int *state, ...@@ -49,14 +49,10 @@ extern void get_dir_ent(paddr_t paddr, int *state,
#endif #endif
/* intr.c */ /* intr.c */
extern int intr_reserve_level(cpuid_t cpu, int level, int err, vertex_hdl_t owner_dev, char *name);
extern void intr_unreserve_level(cpuid_t cpu, int level); extern void intr_unreserve_level(cpuid_t cpu, int level);
extern int intr_connect_level(cpuid_t cpu, int bit, ilvl_t mask_no, extern int intr_connect_level(cpuid_t cpu, int bit);
intr_func_t intr_prefunc);
extern int intr_disconnect_level(cpuid_t cpu, int bit); extern int intr_disconnect_level(cpuid_t cpu, int bit);
extern cpuid_t intr_heuristic(vertex_hdl_t dev, device_desc_t dev_desc, extern cpuid_t intr_heuristic(vertex_hdl_t dev, int req_bit, int *resp_bit);
int req_bit,int intr_resflags,vertex_hdl_t owner_dev,
char *intr_name,int *resp_bit);
extern void intr_block_bit(cpuid_t cpu, int bit); extern void intr_block_bit(cpuid_t cpu, int bit);
extern void intr_unblock_bit(cpuid_t cpu, int bit); extern void intr_unblock_bit(cpuid_t cpu, int bit);
extern void setrtvector(intr_func_t); extern void setrtvector(intr_func_t);
......
/*
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
*/
#ifndef _ASM_IA64_SN_UART16550_H
#define _ASM_IA64_SN_UART16550_H
/*
* Definitions for 16550 chip
*/
/* defined as offsets from the data register */
#define REG_DAT 0 /* receive/transmit data */
#define REG_ICR 1 /* interrupt control register */
#define REG_ISR 2 /* interrupt status register */
#define REG_FCR 2 /* fifo control register */
#define REG_LCR 3 /* line control register */
#define REG_MCR 4 /* modem control register */
#define REG_LSR 5 /* line status register */
#define REG_MSR 6 /* modem status register */
#define REG_SCR 7 /* Scratch register */
#define REG_DLL 0 /* divisor latch (lsb) */
#define REG_DLH 1 /* divisor latch (msb) */
#define REG_EFR 2 /* 16650 enhanced feature register */
/*
* 16450/16550 Registers Structure.
*/
/* Line Control Register */
#define LCR_WLS0 0x01 /*word length select bit 0 */
#define LCR_WLS1 0x02 /*word length select bit 2 */
#define LCR_STB 0x04 /* number of stop bits */
#define LCR_PEN 0x08 /* parity enable */
#define LCR_EPS 0x10 /* even parity select */
#define LCR_SETBREAK 0x40 /* break key */
#define LCR_DLAB 0x80 /* divisor latch access bit */
#define LCR_RXLEN 0x03 /* # of data bits per received/xmitted char */
#define LCR_STOP1 0x00
#define LCR_STOP2 0x04
#define LCR_PAREN 0x08
#define LCR_PAREVN 0x10
#define LCR_PARMARK 0x20
#define LCR_SNDBRK 0x40
#define LCR_DLAB 0x80
#define LCR_BITS5 0x00 /* 5 bits per char */
#define LCR_BITS6 0x01 /* 6 bits per char */
#define LCR_BITS7 0x02 /* 7 bits per char */
#define LCR_BITS8 0x03 /* 8 bits per char */
#define LCR_MASK_BITS_CHAR 0x03
#define LCR_MASK_STOP_BITS 0x04
#define LCR_MASK_PARITY_BITS 0x18
/* Line Status Register */
#define LSR_RCA 0x01 /* data ready */
#define LSR_OVRRUN 0x02 /* overrun error */
#define LSR_PARERR 0x04 /* parity error */
#define LSR_FRMERR 0x08 /* framing error */
#define LSR_BRKDET 0x10 /* a break has arrived */
#define LSR_XHRE 0x20 /* tx hold reg is now empty */
#define LSR_XSRE 0x40 /* tx shift reg is now empty */
#define LSR_RFBE 0x80 /* rx FIFO Buffer error */
/* Interrupt Status Regisger */
#define ISR_MSTATUS 0x00
#define ISR_TxRDY 0x02
#define ISR_RxRDY 0x04
#define ISR_ERROR_INTR 0x08
#define ISR_FFTMOUT 0x0c /* FIFO Timeout */
#define ISR_RSTATUS 0x06 /* Receiver Line status */
/* Interrupt Enable Register */
#define ICR_RIEN 0x01 /* Received Data Ready */
#define ICR_TIEN 0x02 /* Tx Hold Register Empty */
#define ICR_SIEN 0x04 /* Receiver Line Status */
#define ICR_MIEN 0x08 /* Modem Status */
/* Modem Control Register */
#define MCR_DTR 0x01 /* Data Terminal Ready */
#define MCR_RTS 0x02 /* Request To Send */
#define MCR_OUT1 0x04 /* Aux output - not used */
#define MCR_OUT2 0x08 /* turns intr to 386 on/off */
#define MCR_LOOP 0x10 /* loopback for diagnostics */
#define MCR_AFE 0x20 /* Auto flow control enable */
/* Modem Status Register */
#define MSR_DCTS 0x01 /* Delta Clear To Send */
#define MSR_DDSR 0x02 /* Delta Data Set Ready */
#define MSR_DRI 0x04 /* Trail Edge Ring Indicator */
#define MSR_DDCD 0x08 /* Delta Data Carrier Detect */
#define MSR_CTS 0x10 /* Clear To Send */
#define MSR_DSR 0x20 /* Data Set Ready */
#define MSR_RI 0x40 /* Ring Indicator */
#define MSR_DCD 0x80 /* Data Carrier Detect */
#define DELTAS(x) ((x)&(MSR_DCTS|MSR_DDSR|MSR_DRI|MSR_DDCD))
#define STATES(x) ((x)(MSR_CTS|MSR_DSR|MSR_RI|MSR_DCD))
#define FCR_FIFOEN 0x01 /* enable receive/transmit fifo */
#define FCR_RxFIFO 0x02 /* enable receive fifo */
#define FCR_TxFIFO 0x04 /* enable transmit fifo */
#define FCR_MODE1 0x08 /* change to mode 1 */
#define RxLVL0 0x00 /* Rx fifo level at 1 */
#define RxLVL1 0x40 /* Rx fifo level at 4 */
#define RxLVL2 0x80 /* Rx fifo level at 8 */
#define RxLVL3 0xc0 /* Rx fifo level at 14 */
#define FIFOEN (FCR_FIFOEN | FCR_RxFIFO | FCR_TxFIFO | RxLVL3 | FCR_MODE1)
#define FCT_TxMASK 0x30 /* mask for Tx trigger */
#define FCT_RxMASK 0xc0 /* mask for Rx trigger */
/* enhanced festures register */
#define EFR_SFLOW 0x0f /* various S/w Flow Controls */
#define EFR_EIC 0x10 /* Enhanced Interrupt Control bit */
#define EFR_SCD 0x20 /* Special Character Detect */
#define EFR_RTS 0x40 /* RTS flow control */
#define EFR_CTS 0x80 /* CTS flow control */
/* Rx Tx software flow controls in 16650 enhanced mode */
#define SFLOW_Tx0 0x00 /* no Xmit flow control */
#define SFLOW_Tx1 0x08 /* Transmit Xon1, Xoff1 */
#define SFLOW_Tx2 0x04 /* Transmit Xon2, Xoff2 */
#define SFLOW_Tx3 0x0c /* Transmit Xon1,Xon2, Xoff1,Xoff2 */
#define SFLOW_Rx0 0x00 /* no Rcv flow control */
#define SFLOW_Rx1 0x02 /* Receiver compares Xon1, Xoff1 */
#define SFLOW_Rx2 0x01 /* Receiver compares Xon2, Xoff2 */
#define ASSERT_DTR(x) (x |= MCR_DTR)
#define ASSERT_RTS(x) (x |= MCR_RTS)
#define DU_RTS_ASSERTED(x) (((x) & MCR_RTS) != 0)
#define DU_RTS_ASSERT(x) ((x) |= MCR_RTS)
#define DU_RTS_DEASSERT(x) ((x) &= ~MCR_RTS)
/*
* ioctl(fd, I_STR, arg)
* use the SIOC_RS422 and SIOC_EXTCLK combination to support MIDI
*/
#define SIOC ('z' << 8) /* z for z85130 */
#define SIOC_EXTCLK (SIOC | 1) /* select/de-select external clock */
#define SIOC_RS422 (SIOC | 2) /* select/de-select RS422 protocol */
#define SIOC_ITIMER (SIOC | 3) /* upstream timer adjustment */
#define SIOC_LOOPBACK (SIOC | 4) /* diagnostic loopback test mode */
/* channel control register */
#define DMA_INT_MASK 0xe0 /* ring intr mask */
#define DMA_INT_TH25 0x20 /* 25% threshold */
#define DMA_INT_TH50 0x40 /* 50% threshold */
#define DMA_INT_TH75 0x60 /* 75% threshold */
#define DMA_INT_EMPTY 0x80 /* ring buffer empty */
#define DMA_INT_NEMPTY 0xa0 /* ring buffer not empty */
#define DMA_INT_FULL 0xc0 /* ring buffer full */
#define DMA_INT_NFULL 0xe0 /* ring buffer not full */
#define DMA_CHANNEL_RESET 0x400 /* reset dma channel */
#define DMA_ENABLE 0x200 /* enable DMA */
/* peripheral controller intr status bits applicable to serial ports */
#define ISA_SERIAL0_MASK 0x03f00000 /* mask for port #1 intrs */
#define ISA_SERIAL0_DIR 0x00100000 /* device intr request */
#define ISA_SERIAL0_Tx_THIR 0x00200000 /* Transmit DMA threshold */
#define ISA_SERIAL0_Tx_PREQ 0x00400000 /* Transmit DMA pair req */
#define ISA_SERIAL0_Tx_MEMERR 0x00800000 /* Transmit DMA memory err */
#define ISA_SERIAL0_Rx_THIR 0x01000000 /* Receive DMA threshold */
#define ISA_SERIAL0_Rx_OVERRUN 0x02000000 /* Receive DMA over-run */
#define ISA_SERIAL1_MASK 0xfc000000 /* mask for port #1 intrs */
#define ISA_SERIAL1_DIR 0x04000000 /* device intr request */
#define ISA_SERIAL1_Tx_THIR 0x08000000 /* Transmit DMA threshold */
#define ISA_SERIAL1_Tx_PREQ 0x10000000 /* Transmit DMA pair req */
#define ISA_SERIAL1_Tx_MEMERR 0x20000000 /* Transmit DMA memory err */
#define ISA_SERIAL1_Rx_THIR 0x40000000 /* Receive DMA threshold */
#define ISA_SERIAL1_Rx_OVERRUN 0x80000000 /* Receive DMA over-run */
#define MAX_RING_BLOCKS 128 /* 4096/32 */
#define MAX_RING_SIZE 4096
/* DMA Input Control Byte */
#define DMA_IC_OVRRUN 0x01 /* overrun error */
#define DMA_IC_PARERR 0x02 /* parity error */
#define DMA_IC_FRMERR 0x04 /* framing error */
#define DMA_IC_BRKDET 0x08 /* a break has arrived */
#define DMA_IC_VALID 0x80 /* pair is valid */
/* DMA Output Control Byte */
#define DMA_OC_TxINTR 0x20 /* set Tx intr after processing byte */
#define DMA_OC_INVALID 0x00 /* invalid pair */
#define DMA_OC_WTHR 0x40 /* Write byte to THR */
#define DMA_OC_WMCR 0x80 /* Write byte to MCR */
#define DMA_OC_DELAY 0xc0 /* time delay before next xmit */
/* ring id's */
#define RID_SERIAL0_TX 0x4 /* serial port 0, transmit ring buffer */
#define RID_SERIAL0_RX 0x5 /* serial port 0, receive ring buffer */
#define RID_SERIAL1_TX 0x6 /* serial port 1, transmit ring buffer */
#define RID_SERIAL1_RX 0x7 /* serial port 1, receive ring buffer */
#define CLOCK_XIN 22
#define PRESCALER_DIVISOR 3
#define CLOCK_ACE 7333333
/*
* increment the ring offset. One way to do this would be to add b'100000.
* this would let the offset value roll over automatically when it reaches
* its maximum value (127). However when we use the offset, we must use
* the appropriate bits only by masking with 0xfe0.
* The other option is to shift the offset right by 5 bits and look at its
* value. Then increment if required and shift back
* note: 127 * 2^5 = 4064
*/
#define INC_RING_POINTER(x) \
( ((x & 0xffe0) < 4064) ? (x += 32) : 0 )
#endif /* _ASM_IA64_SN_UART16550_H */
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#define _ASM_SN_XTALK_XBOW_INFO_H #define _ASM_SN_XTALK_XBOW_INFO_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/devfs_fs_kernel.h>
#define XBOW_PERF_MODES 0x03 #define XBOW_PERF_MODES 0x03
#define XBOW_PERF_COUNTERS 0x02 #define XBOW_PERF_COUNTERS 0x02
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/devfs_fs_kernel.h>
#include <asm/sn/xtalk/xtalk.h> #include <asm/sn/xtalk/xtalk.h>
typedef struct xswitch_info_s *xswitch_info_t; typedef struct xswitch_info_s *xswitch_info_t;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#define _ASM_SN_XTALK_XTALK_PRIVATE_H #define _ASM_SN_XTALK_XTALK_PRIVATE_H
#include <asm/sn/ioerror.h> /* for error function and arg types */ #include <asm/sn/ioerror.h> /* for error function and arg types */
#include <linux/devfs_fs_kernel.h>
#include <asm/sn/xtalk/xwidget.h> #include <asm/sn/xtalk/xwidget.h>
#include <asm/sn/xtalk/xtalk.h> #include <asm/sn/xtalk/xtalk.h>
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
*/ */
#include <linux/compiler.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -57,9 +58,10 @@ ...@@ -57,9 +58,10 @@
* address TASK_SIZE is never valid. We also need to make sure that the address doesn't * address TASK_SIZE is never valid. We also need to make sure that the address doesn't
* point inside the virtually mapped linear page table. * point inside the virtually mapped linear page table.
*/ */
#define __access_ok(addr,size,segment) (((unsigned long) (addr)) <= (segment).seg \ #define __access_ok(addr,size,segment) \
&& ((segment).seg == KERNEL_DS.seg \ likely(((unsigned long) (addr)) <= (segment).seg \
|| REGION_OFFSET((unsigned long) (addr)) < RGN_MAP_LIMIT)) && ((segment).seg == KERNEL_DS.seg \
|| REGION_OFFSET((unsigned long) (addr)) < RGN_MAP_LIMIT))
#define access_ok(type,addr,size) __access_ok((addr),(size),get_fs()) #define access_ok(type,addr,size) __access_ok((addr),(size),get_fs())
static inline int static inline int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment