[parisc-linux-cvs] 2.4.17-pa28
Thomas Bogendoerfer
tsbogend@alpha.franken.de
Thu, 21 Feb 2002 00:34:05 +0100
I've got sticon on a FXe working, patch is below.
Thomas.
Index: drivers/video/sti/sticore.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticore.c,v
retrieving revision 1.34
diff -u -p -r1.34 sticore.c
--- drivers/video/sti/sticore.c 2002/02/02 19:46:52 1.34
+++ drivers/video/sti/sticore.c 2002/02/20 23:09:38
@@ -68,7 +68,7 @@ static const struct sti_init_flags defau
init_cmap_tx: 1,
};
-void
+int
sti_init_graph(struct sti_struct *sti)
{
struct sti_init_inptr_ext inptr_ext = { 0, };
@@ -87,7 +87,13 @@ sti_init_graph(struct sti_struct *sti)
spin_unlock_irqrestore(&sti->lock, flags);
+ if (ret < 0) {
+ printk (KERN_ERR "STI init_graph failed (ret %d, errno %d)\n",ret,outptr.errno);
+ return -1;
+ }
+
sti->text_planes = outptr.text_planes;
+ return 0;
}
static const struct sti_conf_flags default_conf_flags = {
@@ -406,8 +412,23 @@ sti_init_glob_cfg(struct sti_struct *sti
for (i=0; i<8; i++) {
unsigned long newhpa, len;
- newhpa = (i==0) ? rom_address : hpa;
-
+ if (sti->pd) {
+ unsigned char offs = sti->rm_entry[i];
+
+ if (offs == 0)
+ continue;
+ if (offs != PCI_ROM_ADDRESS &&
+ (offs < PCI_BASE_ADDRESS_0 ||
+ offs > PCI_BASE_ADDRESS_5)) {
+ printk (KERN_WARNING
+ "STI pci region maping for region %d (%02x) can't be mapped\n",
+ i,sti->rm_entry[i]);
+ continue;
+ }
+ newhpa = pci_resource_start (sti->pd, (offs - PCI_BASE_ADDRESS_0) / 4);
+ } else
+ newhpa = (i == 0) ? rom_address : hpa;
+
sti->regions_phys[i] =
REGION_OFFSET_TO_PHYS(sti->regions[i], newhpa);
@@ -415,11 +436,6 @@ sti_init_glob_cfg(struct sti_struct *sti
/* FIXME: add BTLB support if btlb==1 */
len = sti->regions[i].region_desc.length * 4096;
- /* PCI cards may use more memory than the 16MB
- * which fits into the region_desc.length field. */
- if (i==1 && sti->pd && len==(16*1024*1024))
- len = pci_resource_len(sti->pd, 0);
-
if (len)
glob_cfg->region_ptrs[i] = (unsigned long) (
sti->regions[i].region_desc.cache ?
@@ -548,6 +564,8 @@ sti_dump_rom(struct sti_rom *rom)
DPRINTK((" font start %08x\n", rom->font_start));
DPRINTK((" region list %08x\n", rom->region_list));
DPRINTK((" init_graph %08x\n", rom->init_graph));
+ DPRINTK((" bus support %02x\n", rom->bus_support));
+ DPRINTK((" ext bus support %02x\n", rom->ext_bus_support));
DPRINTK((" alternate code type %d\n", rom->alt_code_type));
}
@@ -845,7 +863,8 @@ test_rom:
if (sti_init_glob_cfg(sti, address, hpa))
goto out_err; /* not enough memory */
- sti_init_graph(sti);
+ if (sti_init_graph(sti))
+ goto out_err;
sti_inq_conf(sti);
sti_dump_globcfg(PTR_STI(sti->glob_cfg), sti->sti_mem_request);
@@ -956,6 +975,10 @@ static int __devinit sticore_pci_init(st
print_pci_hwpath(pd, pa_path);
sticore_check_for_default_sti(sti, pa_path);
}
+ if (rom_base) {
+ pci_write_config_dword(pd, PCI_ROM_ADDRESS, rom_base & ~PCI_ROM_ADDRESS_ENABLE);
+ printk("STI PCI ROM disabled\n");
+ }
break;
}
@@ -977,10 +1000,12 @@ static void __devexit sticore_pci_remove
#define PCI_DEVICE_ID_VISUALIZE_EG 0x1005
#define PCI_DEVICE_ID_VISUALIZE_FX 0x1008
+#define PCI_DEVICE_ID_VISUALIZE_FX_NEW 0x108b
static struct pci_device_id sti_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_HP, PCI_DEVICE_ID_VISUALIZE_EG, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_HP, PCI_DEVICE_ID_VISUALIZE_FX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_VISUALIZE_FX_NEW, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0, } /* terminate list */
};
MODULE_DEVICE_TABLE(pci, sti_pci_tbl);
Index: drivers/video/sti/sticore.h
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticore.h,v
retrieving revision 1.20
diff -u -p -r1.20 sticore.h
--- drivers/video/sti/sticore.h 2002/01/12 19:54:55 1.20
+++ drivers/video/sti/sticore.h 2002/02/20 23:06:25
@@ -84,7 +84,7 @@ extern struct sti_struct *sti_init_roms(
extern struct sti_struct *default_sti;
-void sti_init_graph(struct sti_struct *sti);
+int sti_init_graph(struct sti_struct *sti);
void sti_inq_conf(struct sti_struct *sti);
void sti_putc(struct sti_struct *sti, int c, int y, int x);
void sti_set(struct sti_struct *sti, int src_y, int src_x,
--
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea. [ Alexander Viro on linux-kernel ]