|
From: Dave A. <ai...@us...> - 2003-06-10 02:10:23
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/alpha/kernel
Modified Files:
alpha_ksyms.c pci-noop.c pci_iommu.c proto.h smc37c669.c
sys_miata.c time.c
Log Message:
DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed)
Index: alpha_ksyms.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/alpha_ksyms.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- alpha_ksyms.c 10 Jun 2003 01:13:13 -0000 1.3
+++ alpha_ksyms.c 10 Jun 2003 01:45:48 -0000 1.4
@@ -109,6 +109,7 @@
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(memcmp);
EXPORT_SYMBOL(memmove);
+EXPORT_SYMBOL(memscan);
EXPORT_SYMBOL(__memcpy);
EXPORT_SYMBOL(__memset);
EXPORT_SYMBOL(__memsetw);
Index: pci-noop.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/pci-noop.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- pci-noop.c 10 Apr 2002 13:07:22 -0000 1.2
+++ pci-noop.c 10 Jun 2003 01:45:48 -0000 1.3
@@ -104,21 +104,23 @@
}
/* stubs for the routines in pci_iommu.c */
void *
-pci_alloc_consistent(struct pci_dev *pdev, long size, dma_addr_t *dma_addrp)
+pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp)
{
+ return (void *)0;
}
void
-pci_free_consistent(struct pci_dev *pdev, long size, void *cpu_addr,
+pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr,
dma_addr_t dma_addr)
{
}
dma_addr_t
-pci_map_single(struct pci_dev *pdev, void *cpu_addr, long size,
+pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size,
int direction)
{
+ return (dma_addr_t)0;
}
void
-pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, long size,
+pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,
int direction)
{
}
@@ -126,6 +128,7 @@
pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
int direction)
{
+ return 0;
}
void
pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
Index: pci_iommu.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/pci_iommu.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- pci_iommu.c 10 Apr 2002 13:07:22 -0000 1.2
+++ pci_iommu.c 10 Jun 2003 01:45:48 -0000 1.3
@@ -30,6 +30,10 @@
#define DEBUG_NODIRECT 0
#define DEBUG_FORCEDAC 0
+/* Most Alphas support 32-bit ISA DMA. Exceptions are XL, Ruffian and
+ Nautilus (see asm/dma.h for details). */
+#define ISA_DMA_MASK (MAX_DMA_ADDRESS - IDENT_ADDR - 1 < 0xffffffff ? \
+ MAX_DMA_ADDRESS - IDENT_ADDR - 1 : 0xffffffff)
static inline unsigned long
mk_iommu_pte(unsigned long paddr)
@@ -181,7 +185,7 @@
int dac_allowed)
{
struct pci_controller *hose = pdev ? pdev->sysdata : pci_isa_hose;
- dma_addr_t max_dma = pdev ? pdev->dma_mask : 0x00ffffff;
+ dma_addr_t max_dma = pdev ? pdev->dma_mask : ISA_DMA_MASK;
struct pci_iommu_arena *arena;
long npages, dma_ofs, i;
unsigned long paddr;
@@ -220,7 +224,7 @@
}
arena = hose->sg_pci;
- if (!arena || arena->dma_base + arena->size > max_dma)
+ if (!arena || arena->dma_base + arena->size - 1 > max_dma)
arena = hose->sg_isa;
npages = calc_npages((paddr & ~PAGE_MASK) + size);
@@ -247,20 +251,27 @@
dma_addr_t
pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size, int dir)
{
+ int dac_allowed;
+
if (dir == PCI_DMA_NONE)
BUG();
- return pci_map_single_1(pdev, cpu_addr, size,
- pdev ? (pdev->dma_mask >> 32) != 0 : 0);
+
+ dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0;
+ return pci_map_single_1(pdev, cpu_addr, size, dac_allowed);
}
dma_addr_t
pci_map_page(struct pci_dev *pdev, struct page *page, unsigned long offset,
size_t size, int dir)
{
+ int dac_allowed;
+
if (dir == PCI_DMA_NONE)
BUG();
- return pci_map_single_1(pdev, (char *)page_address(page) + offset,
- size, pdev ? (pdev->dma_mask >> 32) != 0 : 0);
+
+ dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0;
+ return pci_map_single_1(pdev, (char *)page_address(page) + offset,
+ size, dac_allowed);
}
/* Unmap a single streaming mode DMA translation. The DMA_ADDR and
@@ -558,7 +569,7 @@
if (direction == PCI_DMA_NONE)
BUG();
- dac_allowed = ((pdev->dma_mask >> 32) != 0);
+ dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0;
/* Fast path single entry scatterlists. */
if (nents == 1) {
@@ -578,9 +589,9 @@
/* Second, figure out where we're going to map things. */
if (alpha_mv.mv_pci_tbi) {
hose = pdev ? pdev->sysdata : pci_isa_hose;
- max_dma = pdev ? pdev->dma_mask : 0x00ffffff;
+ max_dma = pdev ? pdev->dma_mask : ISA_DMA_MASK;
arena = hose->sg_pci;
- if (!arena || arena->dma_base + arena->size > max_dma)
+ if (!arena || arena->dma_base + arena->size - 1 > max_dma)
arena = hose->sg_isa;
} else {
max_dma = -1;
@@ -641,9 +652,9 @@
return;
hose = pdev ? pdev->sysdata : pci_isa_hose;
- max_dma = pdev ? pdev->dma_mask : 0x00ffffff;
+ max_dma = pdev ? pdev->dma_mask : ISA_DMA_MASK;
arena = hose->sg_pci;
- if (!arena || arena->dma_base + arena->size > max_dma)
+ if (!arena || arena->dma_base + arena->size - 1 > max_dma)
arena = hose->sg_isa;
fbeg = -1, fend = 0;
@@ -710,11 +721,10 @@
struct pci_iommu_arena *arena;
/* If there exists a direct map, and the mask fits either
- MAX_DMA_ADDRESS defined such that GFP_DMA does something
- useful, or the total system memory as shifted by the
- map base. */
+ the entire direct mapped space or the total system memory as
+ shifted by the map base */
if (__direct_map_size != 0
- && (__direct_map_base + MAX_DMA_ADDRESS-IDENT_ADDR-1 <= mask
+ && (__direct_map_base + __direct_map_size - 1 <= mask
|| __direct_map_base + (max_low_pfn<<PAGE_SHIFT)-1 <= mask))
return 1;
Index: proto.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/proto.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- proto.h 10 Apr 2002 13:07:22 -0000 1.2
+++ proto.h 10 Jun 2003 01:45:48 -0000 1.3
@@ -106,7 +106,7 @@
extern void SMC93x_Init(void);
/* smc37c669.c */
-extern void SMC669_Init(int);
+extern int SMC669_Init(int);
/* es1888.c */
extern void es1888_init(void);
Index: smc37c669.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/smc37c669.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- smc37c669.c 25 Feb 2001 23:15:16 -0000 1.1.1.2
+++ smc37c669.c 10 Jun 2003 01:45:48 -0000 1.2
@@ -2528,7 +2528,7 @@
*
* RETURNS:
*
- * Nothing
+ * 1 if the chip found, 0 otherwise
*
* ARGUMENTS:
*
@@ -2539,7 +2539,7 @@
* None
*
*/
-void __init SMC669_Init ( int index )
+int __init SMC669_Init ( int index )
{
SMC37c669_CONFIG_REGS *SMC_base;
unsigned long flags;
@@ -2602,11 +2602,13 @@
__restore_flags(flags);
printk( "SMC37c669 Super I/O Controller found @ 0x%lx\n",
(unsigned long) SMC_base );
+ return 1;
}
else {
__restore_flags(flags);
#if SMC_DEBUG
printk( "No SMC37c669 Super I/O Controller found\n" );
#endif
+ return 0;
}
}
Index: sys_miata.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/sys_miata.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sys_miata.c 10 Apr 2002 13:07:22 -0000 1.2
+++ sys_miata.c 10 Jun 2003 01:45:48 -0000 1.3
@@ -230,7 +230,15 @@
miata_init_pci(void)
{
cia_init_pci();
- SMC669_Init(0); /* it might be a GL (fails harmlessly if not) */
+ /* The PYXIS has data corruption problem with scatter/gather
+ burst DMA reads crossing 8K boundary. It had been fixed
+ with off-chip logic on all PYXIS systems except first
+ MIATAs, so disable SG DMA on such machines. */
+ if (!SMC669_Init(0)) { /* MIATA GL has SMC37c669 Super I/O */
+ alpha_mv.mv_pci_tbi = NULL;
+ printk(KERN_INFO "pci: pyxis 8K boundary dma bug - "
+ "sg dma disabled\n");
+ }
es1888_init();
}
Index: time.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/time.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- time.c 10 Apr 2002 13:07:22 -0000 1.2
+++ time.c 10 Jun 2003 01:45:48 -0000 1.3
@@ -379,8 +379,6 @@
/* Startup the timer source. */
alpha_mv.init_rtc();
- do_get_fast_time = do_gettimeofday;
-
/*
* If we had wanted SRM console printk echoing early, undo it now.
*
|