Skip to contentSkip to conversation

Bunch of patches

PATCH In review Alexander Kern 2 participants 16 messages Mar 21, 2004 – Mar 24, 2004 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

cover Bunch of patches

Hello,

here a seven patches for mach64 fbdev driver.

01_mach64-add.diff
simple additions, once already send to James

02_mach64-aux.diff
patch based on patch from Ville Syrjälä, use aperture for register access

03_mach64-chipset2.diff
reorganize table of chipsets

04_mach64-bios.diff
let read frequence limits from BIOS

05_mach64-revers-hwtriple.diff
reverse logic for hardware triple

06_mach64-laterinit.diff
correct init from BIOS

07_mach64-aux_correct.diff
free regions, registered for aperture

Summary of patches tested on ARMADA E500 1400x1050

Regards Alex

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click

#1 lore raw

PATCH 1/7 [PATCH 1/7]

drivers/video/aty/atyfb.h +1 -0
diff -U 3 -H -d -p -r -N -- linux-2.6.4/drivers/video/aty/atyfb.h linux-2.6.alex/drivers/video/aty/atyfb.h
@@ -168,6 +168,7 @@ struct atyfb_par {
 #define M64F_LT_SLEEP		0x00040000
 #define M64F_XL_DLL		0x00080000
 #define M64F_MFB_FORCE_4	0x00100000
+#define M64F_NO_HW_TRIPLE	0x00200000
 
     /*
      *  Register access
drivers/video/aty/atyfb_base.c +80 -99

345 lines not on this page · raw message

drivers/video/aty/mach64_accel.c +21 -21

90 lines not on this page · raw message

drivers/video/aty/mach64_ct.c +5 -6
diff -U 3 -H -d -p -r -N -- linux-2.6.4/drivers/video/aty/mach64_ct.c linux-2.6.alex/drivers/video/aty/mach64_ct.c
@@ -477,18 +477,17 @@ int __init aty_init_pll_ct(const struct 
 		pll->ct.dsp_loop_latency = (dsp_config & DSP_LOOP_LATENCY) >> 16;
 #if 0
 	FIXME: is it relevant for us?
-	if ((!dsp_on_off && (Chip < ATI_CHIP_264GTPRO)) ||
+	if ((!dsp_on_off && !M64_HAS(RESET_3D)) ||
 		((dsp_on_off == vga_dsp_on_off) &&
 		(!dsp_config || !((dsp_config ^ vga_dsp_config) & DSP_XCLKS_PER_QW)))) {
-		if (ATIDivide(GetBits(vga_dsp_on_off, VGA_DSP_OFF),
-			GetBits(vga_dsp_config, VGA_DSP_XCLKS_PER_QW), 5, 1) > 24)
+		vga_dsp_on_off &= VGA_DSP_OFF;
+		vga_dsp_config &= VGA_DSP_XCLKS_PER_QW;
+		if (ATIDivide(vga_dsp_on_off, vga_dsp_config, 5, 1) > 24)
 			pll->ct.fifo_size = 32;
 		else
 			pll->ct.fifo_size = 24;
 	}
 #endif
-	/* end BIOS */
-
 	/* Exit if the user does not want us to tamper with the clock
 	rates of her chip. */
 	if (par->mclk_per == 0) {
@@ -549,7 +548,7 @@ int __init aty_init_pll_ct(const struct 
 		* The chip clock is not equal to the memory clock.
 		* Therefore we will use sclk to clock the chip.
 		*/
-		pll->ct.pll_gen_cntl |= (6 << 4); /* mclk == sclk*/
+		pll->ct.pll_gen_cntl |= (6 << 4); /* mclk == sclk */
 
 		q = par->ref_clk_per * pll->ct.pll_ref_div * 4 / par->mclk_per;
 		if (q < 16*8 || q > 255*8) {
#2 lore raw

PATCH 2/7 [PATCH 2/7]

In reply to Alexander Kern
drivers/video/aty/atyfb.h +24 -1
diff -U 3 -H -d -p -r -- linux-2.6.4/drivers/video/aty/atyfb.h linux-2.6.alex/drivers/video/aty/atyfb.h
@@ -33,6 +33,28 @@ struct crtc {
 #endif
 };
 
+struct pll_info {
+	int pll_max;
+	int pll_min;
+	int sclk, mclk, mclk_pm, xclk;
+	int ref_div;
+	int ref_clk;
+};
+
+typedef struct {
+	u16 unknown1;
+	u16 PCLK_min_freq;
+	u16 PCLK_max_freq;
+	u16 unknown2;
+	u16 ref_freq;
+	u16 ref_divider;
+	u16 unknown3;
+	u16 MCLK_pwd;
+	u16 MCLK_max_freq;
+	u16 XCLK_max_freq;
+	u16 SCLK_freq;
+} __attribute__ ((packed)) PLL_BLOCK_MACH64;
+
 struct pll_514 {
 	u8 m;
 	u8 n;
@@ -139,8 +161,9 @@ struct atyfb_par {
 	u16 lcd_hblank_len;
 	u16 lcd_vblank_len;
 #endif
+	int aux_app; /* auxiliary aperture */
 };
-    
+
     /*
      *  ATI Mach64 features
      */
drivers/video/aty/atyfb_base.c +27 -11
diff -U 3 -H -d -p -r -- linux-2.6.4/drivers/video/aty/atyfb_base.c linux-2.6.alex/drivers/video/aty/atyfb_base.c
@@ -1208,11 +1208,11 @@ static int atyfb_set_par(struct fb_info 
 			aty_st_le32(BUS_CNTL, 0x680000f9, par);
 		} else if (M64_HAS(MOBIL_BUS)) {
 			aty_st_le32(DAC_CNTL, 0x80010102, par);
-			aty_st_le32(BUS_CNTL, 0x7b33a040, par);
+			aty_st_le32(BUS_CNTL, 0x7b33a040 | (par->aux_app ? BUS_APER_REG_DIS : 0), par);
 		} else {
 			/* GT */
 			aty_st_le32(DAC_CNTL, 0x86010102, par);
-			aty_st_le32(BUS_CNTL, 0x7b23a040, par);
+			aty_st_le32(BUS_CNTL, 0x7b23a040 | (par->aux_app ? BUS_APER_REG_DIS : 0), par);
 			aty_st_le32(EXT_MEM_CNTL, aty_ld_le32(EXT_MEM_CNTL, par) | 0x5000001, par);
 		}
 		aty_st_le32(MEM_CNTL, tmp, par);
@@ -1965,8 +1965,7 @@ static int __init aty_init(struct fb_inf
 	rev = (chip_id & CFG_CHIP_REV) >> 24;
 	for (j = 0; j < (sizeof(aty_chips) / sizeof(*aty_chips)); j++)
 		if (type == aty_chips[j].chip_type &&
-		    (rev & aty_chips[j].rev_mask) ==
-		    aty_chips[j].rev_val) {
+		    (rev & aty_chips[j].rev_mask) == aty_chips[j].rev_val) {
 			chipname = aty_chips[j].name;
 			pll = aty_chips[j].pll;
 			mclk = aty_chips[j].mclk;
@@ -2211,10 +2210,18 @@ static int __init aty_init(struct fb_inf
 	 *  the full 8 MB of video RAM on 8 MB boards
 	 */
 
-	if (info->fix.smem_len == 0x800000 ||
-	    (par->bus_type == ISA && info->fix.smem_len == 0x400000))
+	if (!par->aux_app &&
+		(info->fix.smem_len == 0x800000 || (par->bus_type == ISA && info->fix.smem_len == 0x400000)))
 		info->fix.smem_len -= GUI_RESERVE;
 
+	/*
+	 *  Disable register access through the linear aperture
+	 *  if the auxiliary aperture is used so we can access
+	 *  the full 8 MB of video RAM on 8 MB boards.
+	 */
+	if (par->aux_app)
+		aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par);
+
 	/* Clear the video memory */
 	fb_memset((void *) info->screen_base, 0, info->fix.smem_len);
 
@@ -2225,8 +2232,7 @@ static int __init aty_init(struct fb_inf
 #ifdef CONFIG_PMAC_BACKLIGHT
 	if (M64_HAS(G3_PB_1_1) && machine_is_compatible("PowerBook1,1")) {
 		/* these bits let the 101 powerbook wake up from sleep -- paulus */
-		aty_st_lcd(POWER_MANAGEMENT,
-			   aty_ld_lcd(POWER_MANAGEMENT, par)
+		aty_st_lcd(POWER_MANAGEMENT, aty_ld_lcd(POWER_MANAGEMENT, par)
 			   | (USE_F32KHZ | TRISTATE_MEM_EN), par);
 	} else if (M64_HAS(MOBIL_BUS))
 		register_backlight_controller(&aty_backlight_controller, info, "ati");
@@ -2732,18 +2738,28 @@ static int __devinit atyfb_setup_generic
 {
 	struct atyfb_par *par = info->par;
 	u16 tmp;
+	unsigned long raddr;
+	struct resource *rrp;
 #if defined(CONFIG_FB_ATY_GENERIC_LCD)
 	u32 driv_inf_tab, sig, rom_addr;
 	u16 lcd_ofs;
 #endif
 
-	info->fix.mmio_start = 0x7ff000 + addr;
+	raddr = addr + 0x7ff000UL;
+	rrp = &pdev->resource[2];
+	if ((rrp->flags & IORESOURCE_MEM) && request_mem_region(rrp->start, rrp->end - rrp->start + 1, "atyfb")) {
+		par->aux_app = 1;
+		raddr = rrp->start;
+		printk(KERN_INFO "atyfb: using auxiliary register aperture\n");
+	}
+
+	info->fix.mmio_start = raddr;
 	par->ati_regbase = (unsigned long)ioremap(info->fix.mmio_start, 0x1000);
 	if (par->ati_regbase == 0)
 		return -ENOMEM;
 
-	info->fix.mmio_start += 0xc00;
-	par->ati_regbase += 0xc00;
+	info->fix.mmio_start += par->aux_app ? 0x400 : 0xc00;
+	par->ati_regbase += par->aux_app ? 0x400 : 0xc00;
 
 	/*
 	 * Enable memory-space accesses using config-space
#3 lore raw

PATCH 3/7 [PATCH 3/7]

In reply to Alexander Kern
drivers/video/aty/ati_ids.h +1 -0
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/ati_ids.h linux-2.6.alex/drivers/video/aty/ati_ids.h
@@ -64,6 +64,7 @@
 #define PCI_CHIP_MACH64LQ		0x4C51
 #define PCI_CHIP_MACH64LR		0x4C52
 #define PCI_CHIP_MACH64LS		0x4C53
+#define PCI_CHIP_MACH64LT		0x4C54
 #define PCI_CHIP_RADEON_LW		0x4C57
 #define PCI_CHIP_RADEON_LX		0x4C58
 #define PCI_CHIP_RADEON_LY		0x4C59
drivers/video/aty/atyfb.h +2 -0
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/atyfb.h linux-2.6.alex/drivers/video/aty/atyfb.h
@@ -122,6 +122,7 @@ struct atyfb_par {
 	unsigned long clk_wr_offset; /* meaning overloaded, clock id by CT */
 	struct crtc crtc;
 	union aty_pll pll;
+	struct pll_info pll_limits;
 	u32 features;
 	u32 ref_clk_per;
 	u32 pll_per;
@@ -130,6 +131,7 @@ struct atyfb_par {
 	u8 bus_type;
 	u8 ram_type;
 	u8 mem_refresh_rate;
+	u16 pci_id;
 	u32 accel_flags;
 	int blitter_may_be_busy;
 	int asleep;
drivers/video/aty/atyfb_base.c +151 -116

352 lines not on this page · raw message

#4 lore raw

PATCH 4/7 [PATCH 4/7]

In reply to Alexander Kern
drivers/video/aty/atyfb_base.c +157 -144
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/atyfb_base.c linux-2.6.alex/drivers/video/aty/atyfb_base.c
@@ -2766,124 +2766,33 @@ static int __devinit atyfb_setup_sparc(s
 
 #else /* __sparc__ */
 
-static int __devinit atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info, unsigned long addr)
+#ifdef CONFIG_FB_ATY_GENERIC_LCD
+void aty_init_lcd(struct atyfb_par *par, u32 bios_base)
 {
-	struct atyfb_par *par = info->par;
-	u16 tmp;
-	unsigned long raddr;
-	struct resource *rrp;
-#if defined(CONFIG_FB_ATY_GENERIC_LCD)
-	u32 driv_inf_tab, sig, rom_addr;
+	u32 driv_inf_tab, sig;
 	u16 lcd_ofs;
-#endif
-
-	raddr = addr + 0x7ff000UL;
-	rrp = &pdev->resource[2];
-	if ((rrp->flags & IORESOURCE_MEM) && request_mem_region(rrp->start, rrp->end - rrp->start + 1, "atyfb")) {
-		par->aux_app = 1;
-		raddr = rrp->start;
-		printk(KERN_INFO "atyfb: using auxiliary register aperture\n");
-	}
-
-	info->fix.mmio_start = raddr;
-	par->ati_regbase = (unsigned long)ioremap(info->fix.mmio_start, 0x1000);
-	if (par->ati_regbase == 0)
-		return -ENOMEM;
-
-	info->fix.mmio_start += par->aux_app ? 0x400 : 0xc00;
-	par->ati_regbase += par->aux_app ? 0x400 : 0xc00;
-
-	/*
-	 * Enable memory-space accesses using config-space
-	 * command register.
-	 */
-	pci_read_config_word(pdev, PCI_COMMAND, &tmp);
-	if (!(tmp & PCI_COMMAND_MEMORY)) {
-		tmp |= PCI_COMMAND_MEMORY;
-		pci_write_config_word(pdev, PCI_COMMAND, tmp);
-	}
-#ifdef __BIG_ENDIAN
-	/* Use the big-endian aperture */
-	addr += 0x800000;
-#endif
-
-	/* Map in frame buffer */
-	info->fix.smem_start = addr;
-	info->screen_base = (char *)ioremap(addr, 0x800000);
-	if (info->screen_base == NULL) {
-		iounmap((void *)par->ati_regbase);
-		par->ati_regbase = 0;
-		return -ENOMEM;
-	}
-
-#ifdef CONFIG_FB_ATY_GENERIC_LCD
+	
 	/* To support an LCD panel, we should know it's dimensions and
-	 * it's desired pixel clock.
+	 *  it's desired pixel clock.
 	 * There are two ways to do it:
-	 * - Check the startup video mode and calculate the panel
-	 *   size from it. This is unreliable.
-	 * - Read it from the driver information table in the video BIOS, that
-	 *   works only on x86
-	 *
-	 * So, we try to find a BIOS and get access to it.
-	 */
-	rom_addr = 0xc0000 + ((aty_ld_le32(SCRATCH_REG1, par) & 0x7f) << 11);
-	par->bios_base_phys = rom_addr;
-	par->bios_base = (unsigned long)ioremap(rom_addr, 0x10000);
-
-	/* The BIOS starts with 0xaa55. */
-	if (*((u16 *)par->bios_base) == 0xaa55) {
-		printk(KERN_INFO "atyfb: Mach64 BIOS is located at %x, mapped at %x.\n",
-		       (u32)par->bios_base_phys, (u32)par->bios_base);
-
-		/* check for frequncy table */
-		if (1) {
-			u8 *bios_ptr;
-			u16 rom_table_offset, freq_table_offset, XCLK_pwd, XCLK_dram, XCLK_vram, ref_freq, ref_divider, sclk;
-			u32 min_freq, max_freq;
-
-			bios_ptr = (u8*)par->bios_base;
-			rom_table_offset = (u16)(bios_ptr[0x48] | (bios_ptr[0x49] << 8));
-			printk(KERN_INFO "atyfb: rom table offset is %d\n", rom_table_offset);
-
-			freq_table_offset = bios_ptr[rom_table_offset + 16] | (bios_ptr[rom_table_offset + 17] << 8);
-			printk(KERN_INFO "atyfb: frequency table offset is %d\n", freq_table_offset);
-
-			min_freq = bios_ptr[freq_table_offset + 2] | (bios_ptr[freq_table_offset + 3] << 8);
-			max_freq = bios_ptr[freq_table_offset + 4] | (bios_ptr[freq_table_offset + 5] << 8);
-			ref_freq = bios_ptr[freq_table_offset + 8] | (bios_ptr[freq_table_offset + 9] << 8);
-			ref_divider = bios_ptr[freq_table_offset + 10] | (bios_ptr[freq_table_offset + 11] << 8);
-
-			XCLK_pwd = bios_ptr[freq_table_offset + 14] | (bios_ptr[freq_table_offset + 15] << 8);
-			XCLK_dram = bios_ptr[freq_table_offset + 16] | (bios_ptr[freq_table_offset + 17] << 8);
-			XCLK_vram = bios_ptr[freq_table_offset + 18] | (bios_ptr[freq_table_offset + 19] << 8);
-			sclk = bios_ptr[freq_table_offset + 20] | (bios_ptr[freq_table_offset + 21] << 8);
-
-			printk(KERN_INFO "atyfb: BIOS frequency table:\n");
-			printk(KERN_INFO "       XCLK_pwd %d, XCLK_dram %d, XCLK_vram %d\n", XCLK_pwd, XCLK_dram, XCLK_vram);
-			printk(KERN_INFO "       ref_clk %d, ref_divider %d\n", ref_freq, ref_divider);
-			printk(KERN_INFO "       vpll_min %d, vpll_max %d\n", min_freq, max_freq);
-			printk(KERN_INFO "       sclk %d\n", sclk);
-
-			par->ref_clk_per = 100000000UL / ref_freq;
-			par->xclk_per  = 100000000UL / XCLK_vram;
-			par->pll_per = 100000000UL / max_freq;
-		}
-
-		/* Address of driver information table is at offset 0x78. */
-		driv_inf_tab = par->bios_base + *((u16 *)(par->bios_base+0x78));
-
-		/* Check for the driver information table signature. */
-		sig = (*(u32 *)driv_inf_tab);
-		if ((sig == 0x54504c24) || /* Rage LT pro */
-		    (sig == 0x544d5224) || /* Rage mobility */
-		    (sig == 0x54435824) || /* Rage XC */
-		    (sig == 0x544c5824)) { /* Rage XL */
-			printk(KERN_INFO "atyfb: BIOS contains driver information table.\n");
-			lcd_ofs = (*(u16 *)(driv_inf_tab + 10));
-			par->lcd_table = 0;
-			if (lcd_ofs != 0)
-				par->lcd_table = par->bios_base + lcd_ofs;
+	 *  - Check the startup video mode and calculate the panel
+	 *    size from it. This is unreliable.
+	 *  - Read it from the driver information table in the video BIOS.
+	*/
+	/* Address of driver information table is at offset 0x78. */
+	driv_inf_tab = bios_base + *((u16 *)(bios_base+0x78));
+	
+	/* Check for the driver information table signature. */
+	sig = (*(u32 *)driv_inf_tab);
+	if ((sig == 0x54504c24) || /* Rage LT pro */
+		(sig == 0x544d5224) || /* Rage mobility */
+		(sig == 0x54435824) || /* Rage XC */
+		(sig == 0x544c5824)) { /* Rage XL */
+		printk(KERN_INFO "atyfb: BIOS contains driver information table.\n");
+		lcd_ofs = (*(u16 *)(driv_inf_tab + 10));
+		par->lcd_table = 0;
+		if (lcd_ofs != 0) {
+			par->lcd_table = bios_base + lcd_ofs;
 		}
 	}
 
@@ -2900,7 +2809,6 @@ static int __devinit atyfb_setup_generic
 		u16 *lcdmodeptr;
 		u32 format;
 		u8 lcd_refresh_rates[16] = {50,56,60,67,70,72,75,76,85,90,100,120,140,150,160,200};
-
 		/* The most important information is the panel size at
 		 * offset 25 and 27, but there's some other nice information
 		 * which we print to the screen.
@@ -2908,7 +2816,7 @@ static int __devinit atyfb_setup_generic
 		id = *(u8 *)par->lcd_table;
 		strncpy(model,(char *)par->lcd_table+1,24);
 		model[23]=0;
-
+	
 		width = par->lcd_width = *(u16 *)(par->lcd_table+25);
 		height = par->lcd_height = *(u16 *)(par->lcd_table+27);
 		panel_type = *(u16 *)(par->lcd_table+29);
@@ -2980,7 +2888,7 @@ static int __devinit atyfb_setup_generic
 			}
 		}
 		printk(KERN_INFO "atyfb: %s%s %s monitor detected: %s\n        id=%d, %dx%d pixels, %s\n",
-		       txtdual ,txtcolour, txtmonitor, model, id, width, height, txtformat);
+			txtdual ,txtcolour, txtmonitor, model, id, width, height, txtformat);
 		refresh_rates_buf[0] = 0;
 		refresh_rates = *(u16 *)(par->lcd_table+62);
 		m = 1;
@@ -2999,14 +2907,13 @@ static int __devinit atyfb_setup_generic
 		}
 		default_refresh_rate = (*(u8 *)(par->lcd_table+61) & 0xf0) >> 4;
 		printk(KERN_INFO "        supports refresh rates [%s], default %d Hz\n",
-		       refresh_rates_buf, lcd_refresh_rates[default_refresh_rate]);
+			refresh_rates_buf, lcd_refresh_rates[default_refresh_rate]);
 		par->lcd_refreshrate = lcd_refresh_rates[default_refresh_rate];
-
 		/* We now need to determine the crtc parameters for the
 		 * lcd monitor. This is tricky, because they are not stored
 		 * individually in the BIOS. Instead, the BIOS contains a
 		 * table of display modes that work for this monitor.
-		 *  
+		 *
 		 * The idea is that we search for a mode of the same dimensions
 		 * as the dimensions of the lcd monitor. Say our lcd monitor
 		 * is 800x600 pixels, we search for a 800x600 monitor.
@@ -3017,11 +2924,11 @@ static int __devinit atyfb_setup_generic
 		while (*lcdmodeptr != 0) {
 			u32 modeptr;
 			u16 mwidth, mheight, lcd_hsync_start, lcd_vsync_start;
-			modeptr = par->bios_base + *lcdmodeptr;
-
+			modeptr = bios_base + *lcdmodeptr;
+	
 			mwidth = *((u16 *)(modeptr+0));
 			mheight = *((u16 *)(modeptr+2));
-
+	
 			if (mwidth == width && mheight == height) {
 				par->lcd_pixclock = 100000000 / *((u16 *)(modeptr+9));
 				par->lcd_htotal = *((u16 *)(modeptr+17)) & 511;
@@ -3029,26 +2936,28 @@ static int __devinit atyfb_setup_generic
 				lcd_hsync_start = *((u16 *)(modeptr+21)) & 511;
 				par->lcd_hsync_dly = (*((u16 *)(modeptr+21)) >> 9) & 7;
 				par->lcd_hsync_len = *((u8 *)(modeptr+23)) & 63;
+	
 				par->lcd_vtotal = *((u16 *)(modeptr+24)) & 2047;
 				par->lcd_vdisp = *((u16 *)(modeptr+26)) & 2047;
 				lcd_vsync_start = *((u16 *)(modeptr+28)) & 2047;
 				par->lcd_vsync_len = (*((u16 *)(modeptr+28)) >> 11) & 31;
+	
 				par->lcd_htotal = (par->lcd_htotal + 1) * 8;
 				par->lcd_hdisp = (par->lcd_hdisp + 1) * 8;
 				lcd_hsync_start = (lcd_hsync_start + 1) * 8;
 				par->lcd_hsync_len = par->lcd_hsync_len * 8;
-
+	
 				par->lcd_vtotal++;
 				par->lcd_vdisp++;
 				lcd_vsync_start++;
-				
+	
 				par->lcd_right_margin = lcd_hsync_start - par->lcd_hdisp;
 				par->lcd_lower_margin = lcd_vsync_start - par->lcd_vdisp;
 				par->lcd_hblank_len = par->lcd_htotal - par->lcd_hdisp;
 				par->lcd_vblank_len = par->lcd_vtotal - par->lcd_vdisp;
 				break;
 			}
-
+	
 			lcdmodeptr++;
 		}
 		if (*lcdmodeptr == 0) {
@@ -3056,29 +2965,133 @@ static int __devinit atyfb_setup_generic
 			/* To do: Switch to CRT if possible. */
 		} else {
 			printk(KERN_INFO "        LCD CRTC parameters: %d.%d  %d %d %d %d  %d %d %d %d\n",
-			       1000000 / par->lcd_pixclock, 1000000 % par->lcd_pixclock,
-			       par->lcd_hdisp,
-			       par->lcd_hdisp + par->lcd_right_margin,
-			       par->lcd_hdisp + par->lcd_right_margin + par->lcd_hsync_dly + par->lcd_hsync_len,
-			       par->lcd_htotal,
-			       par->lcd_vdisp,
-			       par->lcd_vdisp + par->lcd_lower_margin,
-			       par->lcd_vdisp + par->lcd_lower_margin + par->lcd_vsync_len,
-			       par->lcd_vtotal);
+				1000000 / par->lcd_pixclock, 1000000 % par->lcd_pixclock,
+				par->lcd_hdisp,
+				par->lcd_hdisp + par->lcd_right_margin,
+				par->lcd_hdisp + par->lcd_right_margin
+					+ par->lcd_hsync_dly + par->lcd_hsync_len,
+				par->lcd_htotal,
+				par->lcd_vdisp,
+				par->lcd_vdisp + par->lcd_lower_margin,
+				par->lcd_vdisp + par->lcd_lower_margin + par->lcd_vsync_len,
+				par->lcd_vtotal);
 			printk(KERN_INFO "                           : %d %d %d %d %d %d %d %d %d\n",
-			       par->lcd_pixclock,
-			       par->lcd_hblank_len - (par->lcd_right_margin + par->lcd_hsync_dly + par->lcd_hsync_len),
-			       par->lcd_hdisp,
-			       par->lcd_right_margin,
-			       par->lcd_hsync_len,
-			       par->lcd_vblank_len - (par->lcd_lower_margin + par->lcd_vsync_len),
-			       par->lcd_vdisp,
-			       par->lcd_lower_margin,
-			       par->lcd_vsync_len);
+				par->lcd_pixclock,
+				par->lcd_hblank_len - (par->lcd_right_margin +
+					par->lcd_hsync_dly + par->lcd_hsync_len),
+				par->lcd_hdisp,
+				par->lcd_right_margin,
+				par->lcd_hsync_len,
+				par->lcd_vblank_len - (par->lcd_lower_margin + par->lcd_vsync_len),
+				par->lcd_vdisp,
+				par->lcd_lower_margin,
+				par->lcd_vsync_len);
 		}
 	}
+}
 #endif /* CONFIG_FB_ATY_GENERIC_LCD */
 
+static int __devinit init_from_bios(struct atyfb_par *par)
+{
+	u32 bios_base, rom_addr;
+	int ret;
+
+	rom_addr = 0xc0000 + ((aty_ld_le32(SCRATCH_REG1, par) & 0x7f) << 11);
+	bios_base = (unsigned long)ioremap(rom_addr, 0x10000);
+
+	/* The BIOS starts with 0xaa55. */
+	if (*((u16 *)bios_base) == 0xaa55) {
+
+		u8 *bios_ptr;
+		u16 rom_table_offset, freq_table_offset;
+		PLL_BLOCK_MACH64 pll_block;
+		
+		printk(KERN_INFO "atyfb: Mach64 BIOS is located at %x, mapped at %x.\n", rom_addr, bios_base);
+
+		/* check for frequncy table */
+		bios_ptr = (u8*)bios_base;
+		rom_table_offset = (u16)(bios_ptr[0x48] | (bios_ptr[0x49] << 8));
+		freq_table_offset = bios_ptr[rom_table_offset + 16] | (bios_ptr[rom_table_offset + 17] << 8);
+		memcpy(&pll_block, bios_ptr + freq_table_offset, sizeof(PLL_BLOCK_MACH64));
+
+		printk(KERN_INFO "atyfb: BIOS frequency table:\n");
+		printk(KERN_INFO " PCLK_min_freq %d, PCLK_max_freq %d, ref_freq %d, ref_divider %d\n",
+			pll_block.PCLK_min_freq, pll_block.PCLK_max_freq,
+			pll_block.ref_freq, pll_block.ref_divider);
+		printk(KERN_INFO " MCLK_pwd %d, MCLK_max_freq %d, XCLK_max_freq %d, SCLK_freq %d\n",
+			pll_block.MCLK_pwd, pll_block.MCLK_max_freq,
+			pll_block.XCLK_max_freq, pll_block.SCLK_freq);
+
+		par->pll_limits.pll_min = pll_block.PCLK_min_freq/100;
+		par->pll_limits.pll_max = pll_block.PCLK_max_freq/100;
+		par->pll_limits.ref_clk = pll_block.ref_freq/100;
+		par->pll_limits.ref_div = pll_block.ref_divider;
+		par->pll_limits.sclk = pll_block.SCLK_freq/100;
+		par->pll_limits.mclk = pll_block.MCLK_max_freq/100;
+		par->pll_limits.mclk_pm = pll_block.MCLK_pwd/100;
+		par->pll_limits.xclk = pll_block.XCLK_max_freq/100;
+#ifdef CONFIG_FB_ATY_GENERIC_LCD
+		aty_init_lcd(par, bios_base);
+#endif
+		ret = 0;
+	} else {
+		printk(KERN_CRIT "atyfb: no BIOS frequency table found, use parameters\n");
+		ret = -ENXIO;
+	}
+	iounmap((void*)bios_base);
+
+	return ret;
+}
+
+static int __devinit atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info, unsigned long addr)
+{
+	struct atyfb_par *par = info->par;
+	u16 tmp;
+	unsigned long raddr;
+	struct resource *rrp;
+
+	raddr = addr + 0x7ff000UL;
+	rrp = &pdev->resource[2];
+	if ((rrp->flags & IORESOURCE_MEM) && request_mem_region(rrp->start, rrp->end - rrp->start + 1, "atyfb")) {
+		par->aux_app = 1;
+		raddr = rrp->start;
+		printk(KERN_INFO "atyfb: using auxiliary register aperture\n");
+	}
+
+	info->fix.mmio_start = raddr;
+	par->ati_regbase = (unsigned long)ioremap(info->fix.mmio_start, 0x1000);
+	if (par->ati_regbase == 0)
+		return -ENOMEM;
+
+	info->fix.mmio_start += par->aux_app ? 0x400 : 0xc00;
+	par->ati_regbase += par->aux_app ? 0x400 : 0xc00;
+
+	/*
+	 * Enable memory-space accesses using config-space
+	 * command register.
+	 */
+	pci_read_config_word(pdev, PCI_COMMAND, &tmp);
+	if (!(tmp & PCI_COMMAND_MEMORY)) {
+		tmp |= PCI_COMMAND_MEMORY;
+		pci_write_config_word(pdev, PCI_COMMAND, tmp);
+	}
+#ifdef __BIG_ENDIAN
+	/* Use the big-endian aperture */
+	addr += 0x800000;
+#endif
+
+	/* Map in frame buffer */
+	info->fix.smem_start = addr;
+	info->screen_base = (char *)ioremap(addr, 0x800000);
+	if (info->screen_base == NULL) {
+		iounmap((void *)par->ati_regbase);
+		par->ati_regbase = 0;
+		return -ENOMEM;
+	}
+
+	/* always succeeded ? */
+	init_from_bios(par);
+
 	if (!(aty_ld_le32(CRTC_GEN_CNTL, par) & CRTC_EXT_DISP_EN))
 		par->clk_wr_offset = (inb(R_GENMO) & 0x0CU) >> 2;
 	else
#5 lore raw

PATCH 5/7 [PATCH 5/7]

In reply to Alexander Kern
drivers/video/aty/atyfb.h +1 -1
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/atyfb.h linux-2.6.alex/drivers/video/aty/atyfb.h
@@ -193,7 +193,7 @@ struct atyfb_par {
 #define M64F_LT_SLEEP		0x00040000
 #define M64F_XL_DLL		0x00080000
 #define M64F_MFB_FORCE_4	0x00100000
-#define M64F_NO_HW_TRIPLE	0x00200000
+#define M64F_HW_TRIPLE		0x00200000
 
     /*
      *  Register access

Only in linux-2.6.alex/drivers/video/aty/: atyfb.h.orig Only in linux-2.6.alex/drivers/video/aty/: atyfb.o

drivers/video/aty/atyfb_base.c +19 -16
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/atyfb_base.c linux-2.6.alex/drivers/video/aty/atyfb_base.c
@@ -283,26 +283,29 @@ static unsigned long phys_size[FB_MAX] _
 static unsigned long phys_guiregbase[FB_MAX] __initdata = { 0, };
 #endif
 
-#define ATI_CHIP_88800GX (M64F_GX | M64F_NO_HW_TRIPLE)
-#define ATI_CHIP_88800CX ATI_CHIP_88800GX
-#define ATI_CHIP_264CT     (M64F_CT | M64F_INTEGRATED | M64F_CT_BUS | M64F_MAGIC_FIFO | M64F_NO_HW_TRIPLE)
+#define ATI_CHIP_88800GX   (M64F_GX)
+#define ATI_CHIP_88800CX    ATI_CHIP_88800GX
+#define ATI_CHIP_264CT     (M64F_CT | M64F_INTEGRATED | M64F_CT_BUS | M64F_MAGIC_FIFO)
 #define ATI_CHIP_264ET      ATI_CHIP_264CT
 
-#define ATI_CHIP_264VT     (M64F_VT | M64F_INTEGRATED | M64F_VT_BUS | M64F_MAGIC_FIFO | M64F_FIFO_24 | M64F_NO_HW_TRIPLE)
-#define ATI_CHIP_264VTA4   (ATI_CHIP_264VT | M64F_MAGIC_POSTDIV)
-#define ATI_CHIP_264GT     (M64F_GT | M64F_INTEGRATED               | M64F_MAGIC_FIFO | M64F_FIFO_24 | M64F_NO_HW_TRIPLE | M64F_EXTRA_BRIGHT)
-#define ATI_CHIP_264VTB    (M64F_VT | M64F_INTEGRATED | M64F_VT_BUS | M64F_GTB_DSP    | M64F_FIFO_24 | M64F_NO_HW_TRIPLE)
-#define ATI_CHIP_264GTB    (M64F_GT | M64F_INTEGRATED               | M64F_GTB_DSP    | M64F_FIFO_24 | M64F_NO_HW_TRIPLE | M64F_EXTRA_BRIGHT | M64F_SDRAM_MAGIC_PLL) 
-#define ATI_CHIP_264VT3    (ATI_CHIP_264VTB | M64F_SDRAM_MAGIC_PLL)
+#define ATI_CHIP_264VT     (M64F_VT | M64F_INTEGRATED | M64F_VT_BUS | M64F_MAGIC_FIFO | M64F_FIFO_24)
+#define ATI_CHIP_264VTA4   (ATI_CHIP_264VT                                                           | M64F_MAGIC_POSTDIV)
+#define ATI_CHIP_264GT     (M64F_GT | M64F_INTEGRATED               | M64F_MAGIC_FIFO | M64F_FIFO_24 | M64F_EXTRA_BRIGHT)
+#define ATI_CHIP_264VTB    (M64F_VT | M64F_INTEGRATED | M64F_VT_BUS | M64F_GTB_DSP    | M64F_FIFO_24)
+#define ATI_CHIP_264GTB    (M64F_GT | M64F_INTEGRATED               | M64F_GTB_DSP    | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT) 
+#define ATI_CHIP_264VT3    (ATI_CHIP_264VTB                                                          | M64F_SDRAM_MAGIC_PLL)
 /*#define ATI_CHIP_264GTDVD  ?*/
-#define ATI_CHIP_264LT     (M64F_GT | M64F_INTEGRATED               | M64F_GTB_DSP    | M64F_FIFO_24 | M64F_NO_HW_TRIPLE)
+#define ATI_CHIP_264LT     (M64F_GT | M64F_INTEGRATED               | M64F_GTB_DSP    | M64F_FIFO_24)
 #define ATI_CHIP_264LTG    (ATI_CHIP_264LT                                                           | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT)
-#define ATI_CHIP_264VT4    (M64F_VT | M64F_INTEGRATED               | M64F_GTB_DSP    | M64F_FIFO_24 | M64F_NO_HW_TRIPLE)
-#define ATI_CHIP_264GT2C   (M64F_GT | M64F_INTEGRATED               | M64F_GTB_DSP    | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT)
-#define ATI_CHIP_264GTPRO  (M64F_GT | M64F_INTEGRATED               | M64F_GTB_DSP                   | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT | M64F_RESET_3D)
-#define ATI_CHIP_264LTPRO  (M64F_GT | M64F_INTEGRATED               | M64F_GTB_DSP                                          | M64F_EXTRA_BRIGHT | M64F_RESET_3D)
-#define ATI_CHIP_264XL     (ATI_CHIP_264GTPRO | M64F_XL_DLL | M64F_MFB_FORCE_4)
-#define ATI_CHIP_MOBILITY  (ATI_CHIP_264LTPRO | M64F_XL_DLL | M64F_MFB_FORCE_4 | M64F_MOBIL_BUS )
+#define ATI_CHIP_264VT4    (M64F_VT | M64F_INTEGRATED               | M64F_GTB_DSP    | M64F_FIFO_24)
+
+#define ATI_MODERN_SET     (M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP | M64F_EXTRA_BRIGHT | M64F_HW_TRIPLE)
+
+#define ATI_CHIP_264GT2C   (ATI_MODERN_SET | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL)
+#define ATI_CHIP_264GTPRO  (ATI_MODERN_SET                | M64F_SDRAM_MAGIC_PLL | M64F_RESET_3D)
+#define ATI_CHIP_264LTPRO  (ATI_MODERN_SET                                       | M64F_RESET_3D)
+#define ATI_CHIP_264XL     (ATI_MODERN_SET                | M64F_SDRAM_MAGIC_PLL | M64F_RESET_3D | M64F_XL_DLL | M64F_MFB_FORCE_4)
+#define ATI_CHIP_MOBILITY  (ATI_MODERN_SET                                       | M64F_RESET_3D | M64F_XL_DLL | M64F_MFB_FORCE_4 | M64F_MOBIL_BUS )
 
 static struct {
 	u16 pci_id;
drivers/video/aty/mach64_accel.c +1 -1
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/mach64_accel.c linux-2.6.alex/drivers/video/aty/mach64_accel.c
@@ -345,7 +345,7 @@ void atyfb_imageblit(struct fb_info *inf
 		 * since Rage 3D IIc we have DP_HOST_TRIPLE_EN bit
 		 * this hwaccelerated triple has an issue with not aligned data
 		 */
-		if (!M64_HAS(NO_HW_TRIPLE) && image->width % 8 == 0)
+		if (M64_HAS(HW_TRIPLE) && image->width % 8 == 0)
 			pix_width |= DP_HOST_TRIPLE_EN;
 	}
 
#6 lore raw

PATCH 6/7 [PATCH 6/7]

In reply to Alexander Kern

Only in linux-2.6.alex/drivers/video/aty/: .atyfb.o.cmd Only in linux-2.6.alex/drivers/video/aty/: .atyfb_base.o.cmd Only in linux-2.6.alex/drivers/video/aty/: .built-in.o.cmd Only in linux-2.6.alex/drivers/video/aty/: .mach64_accel.o.cmd Only in linux-2.6.alex/drivers/video/aty/: .mach64_ct.o.cmd Only in linux-2.6.alex/drivers/video/aty/: .mach64_cursor.o.cmd Only in linux-2.6.alex/drivers/video/aty/: atyfb.h.orig Only in linux-2.6.alex/drivers/video/aty/: atyfb.o

drivers/video/aty/atyfb_base.c +21 -14
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/atyfb_base.c linux-2.6.alex/drivers/video/aty/atyfb_base.c
@@ -366,24 +366,29 @@ static struct {
 };
 
 /* can not fail */
-static void __devinit correct_chipset(int i, struct atyfb_par *par)
+static void __devinit correct_chipset(struct atyfb_par *par)
 {
 	u8 rev;
 	u16 type;
 	u32 chip_id;
 	const char *name;
+	int i;
+
+	for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--)
+		if (par->pci_id == aty_chips[i].pci_id)
+			break;
 
 	name = aty_chips[i].name;
 	par->pll_limits.pll_max = aty_chips[i].pll;
 	par->pll_limits.mclk = aty_chips[i].mclk;
 	par->pll_limits.xclk = aty_chips[i].xclk;
 	par->features = aty_chips[i].features;
-	par->pci_id = aty_chips[i].pci_id;
 	
 	chip_id = aty_ld_le32(CONFIG_CHIP_ID, par);
 	type = chip_id & CFG_CHIP_TYPE;
 	rev = (chip_id & CFG_CHIP_REV) >> 24;
-	switch(aty_chips[i].pci_id) {
+
+	switch(par->pci_id) {
 #ifdef CONFIG_FB_ATY_GX
 	case PCI_CHIP_MACH64GX:
 		assert(type == 0x00d7);
@@ -432,7 +437,7 @@ static void __devinit correct_chipset(in
 #endif
 	}
 
-	printk("atyfb: %s [0x%04x rev 0x%02x] ", name, type, rev);
+	printk("atyfb: %s [0x%04x rev 0x%02x]\n", name, type, rev);
 }
 
 static char ram_dram[] __initdata = "DRAM";
@@ -2648,6 +2653,8 @@ static int __devinit atyfb_setup_sparc(s
 		par->mmap_map[j].prot_flag = _PAGE_E;
 		j++;
 	}
+	
+	correct_chipset(par);
 
 	if (IS_XL(pdev->device)) {
 		/*
@@ -3025,14 +3032,14 @@ static int __devinit init_from_bios(stru
 			pll_block.MCLK_pwd, pll_block.MCLK_max_freq,
 			pll_block.XCLK_max_freq, pll_block.SCLK_freq);
 
-		par->pll_limits.pll_min = pll_block.PCLK_min_freq;
-		par->pll_limits.pll_max = pll_block.PCLK_max_freq;
-		par->pll_limits.ref_clk = pll_block.ref_freq;
+		par->pll_limits.pll_min = pll_block.PCLK_min_freq/100;
+		par->pll_limits.pll_max = pll_block.PCLK_max_freq/100;
+		par->pll_limits.ref_clk = pll_block.ref_freq/100;
 		par->pll_limits.ref_div = pll_block.ref_divider;
-		par->pll_limits.sclk = pll_block.SCLK_freq;
-		par->pll_limits.mclk = pll_block.MCLK_max_freq;
-		par->pll_limits.mclk_pm = pll_block.MCLK_pwd;
-		par->pll_limits.xclk = pll_block.XCLK_max_freq;
+		par->pll_limits.sclk = pll_block.SCLK_freq/100;
+		par->pll_limits.mclk = pll_block.MCLK_max_freq/100;
+		par->pll_limits.mclk_pm = pll_block.MCLK_pwd/100;
+		par->pll_limits.xclk = pll_block.XCLK_max_freq/100;
 #ifdef CONFIG_FB_ATY_GENERIC_LCD
 		aty_init_lcd(par, bios_base);
 #endif
@@ -3093,6 +3100,7 @@ static int __devinit atyfb_setup_generic
 	}
 
 	/* always succeeded ? */
+	correct_chipset(par);
 	init_from_bios(par);
 
 	if (!(aty_ld_le32(CRTC_GEN_CNTL, par) & CRTC_EXT_DISP_EN))
@@ -3119,6 +3127,7 @@ static int __devinit atyfb_pci_probe(str
 	for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--)
 		if (pdev->device == aty_chips[i].pci_id)
 			break;
+
 	if (i < 0)
 		return -ENODEV;
 
@@ -3144,6 +3153,7 @@ static int __devinit atyfb_pci_probe(str
 	}
 	par = info->par;
 	info->fix = atyfb_fix;
+	par->pci_id = aty_chips[i].pci_id;
 
 	/* Reserve space */
 	par->res_start = rp->start;
@@ -3153,9 +3163,6 @@ static int __devinit atyfb_pci_probe(str
 		goto err_free;
 	}
 
-	/* set default Values aus pci_table */
-	correct_chipset(i, par);
-
 	/* Setup "info" structure */
 #ifdef __sparc__
 	rc = atyfb_setup_sparc(pdev, info, addr);

Only in linux-2.6.alex/drivers/video/aty/: atyfb_base.c.orig Only in linux-2.6.alex/drivers/video/aty/: atyfb_base.o Only in linux-2.6.alex/drivers/video/aty/: built-in.o Only in linux-2.6.alex/drivers/video/aty/: mach64_accel.c.orig Only in linux-2.6.alex/drivers/video/aty/: mach64_accel.o

drivers/video/aty/mach64_ct.c +1 -2
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/mach64_ct.c linux-2.6.alex/drivers/video/aty/mach64_ct.c
@@ -273,12 +273,11 @@ void aty_set_pll_ct(const struct fb_info
 		__FUNCTION__,
 		pll->ct.pll_ext_cntl, pll->ct.pll_gen_cntl, pll->ct.pll_vclk_cntl);
 
-#endif
 	printk("atyfb(%s): setting clock %lu for FeedBackDivider %i, ReferenceDivider %i, PostDivider %i(%i)\n",
 		__FUNCTION__,
 		par->clk_wr_offset, pll->ct.vclk_fb_div,
 		pll->ct.pll_ref_div, pll->ct.vclk_post_div, pll->ct.vclk_post_div_real);
-
+#endif
 #ifdef CONFIG_FB_ATY_GENERIC_LCD
 	if (par->lcd_table != 0) {
 		/* turn off LCD */

Only in linux-2.6.alex/drivers/video/aty/: mach64_ct.c.orig Only in linux-2.6.alex/drivers/video/aty/: mach64_ct.o Only in linux-2.6.alex/drivers/video/aty/: mach64_cursor.o Only in linux-2.6.alex/drivers/video/aty/: xlinit.c.orig

#7 lore raw

Re: [PATCH 6/7]

Am Sonntag, 21. März 2004 20:39 schrieb Alexander Kern:
Uups, something goes wrong
here another version...

drivers/video/aty/atyfb_base.c +14 -7
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/atyfb_base.c linux-2.6.alex/drivers/video/aty/atyfb_base.c
@@ -366,24 +366,29 @@ static struct {
 };
 
 /* can not fail */
-static void __devinit correct_chipset(int i, struct atyfb_par *par)
+static void __devinit correct_chipset(struct atyfb_par *par)
 {
 	u8 rev;
 	u16 type;
 	u32 chip_id;
 	const char *name;
+	int i;
+
+	for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--)
+		if (par->pci_id == aty_chips[i].pci_id)
+			break;
 
 	name = aty_chips[i].name;
 	par->pll_limits.pll_max = aty_chips[i].pll;
 	par->pll_limits.mclk = aty_chips[i].mclk;
 	par->pll_limits.xclk = aty_chips[i].xclk;
 	par->features = aty_chips[i].features;
-	par->pci_id = aty_chips[i].pci_id;
 	
 	chip_id = aty_ld_le32(CONFIG_CHIP_ID, par);
 	type = chip_id & CFG_CHIP_TYPE;
 	rev = (chip_id & CFG_CHIP_REV) >> 24;
-	switch(aty_chips[i].pci_id) {
+
+	switch(par->pci_id) {
 #ifdef CONFIG_FB_ATY_GX
 	case PCI_CHIP_MACH64GX:
 		assert(type == 0x00d7);
@@ -432,7 +437,7 @@ static void __devinit correct_chipset(in
 #endif
 	}
 
-	printk("atyfb: %s [0x%04x rev 0x%02x] ", name, type, rev);
+	printk("atyfb: %s [0x%04x rev 0x%02x]\n", name, type, rev);
 }
 
 static char ram_dram[] __initdata = "DRAM";
@@ -2648,6 +2653,8 @@ static int __devinit atyfb_setup_sparc(s
 		par->mmap_map[j].prot_flag = _PAGE_E;
 		j++;
 	}
+	
+	correct_chipset(par);
 
 	if (IS_XL(pdev->device)) {
 		/*
@@ -3094,6 +3101,7 @@ static int __devinit atyfb_setup_generic
 	}
 
 	/* always succeeded ? */
+	correct_chipset(par);
 	init_from_bios(par);
 
 	if (!(aty_ld_le32(CRTC_GEN_CNTL, par) & CRTC_EXT_DISP_EN))
@@ -3120,6 +3128,7 @@ static int __devinit atyfb_pci_probe(str
 	for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--)
 		if (pdev->device == aty_chips[i].pci_id)
 			break;
+
 	if (i < 0)
 		return -ENODEV;
 
@@ -3145,6 +3154,7 @@ static int __devinit atyfb_pci_probe(str
 	}
 	par = info->par;
 	info->fix = atyfb_fix;
+	par->pci_id = aty_chips[i].pci_id;
 
 	/* Reserve space */
 	par->res_start = rp->start;
@@ -3154,9 +3164,6 @@ static int __devinit atyfb_pci_probe(str
 		goto err_free;
 	}
 
-	/* set default Values aus pci_table */
-	correct_chipset(i, par);
-
 	/* Setup "info" structure */
 #ifdef __sparc__
 	rc = atyfb_setup_sparc(pdev, info, addr);
drivers/video/aty/mach64_ct.c +1 -2
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/mach64_ct.c linux-2.6.alex/drivers/video/aty/mach64_ct.c
@@ -273,12 +273,11 @@ void aty_set_pll_ct(const struct fb_info
 		__FUNCTION__,
 		pll->ct.pll_ext_cntl, pll->ct.pll_gen_cntl, pll->ct.pll_vclk_cntl);
 
-#endif
 	printk("atyfb(%s): setting clock %lu for FeedBackDivider %i, ReferenceDivider %i, PostDivider %i(%i)\n",
 		__FUNCTION__,
 		par->clk_wr_offset, pll->ct.vclk_fb_div,
 		pll->ct.pll_ref_div, pll->ct.vclk_post_div, pll->ct.vclk_post_div_real);
-
+#endif
 #ifdef CONFIG_FB_ATY_GENERIC_LCD
 	if (par->lcd_table != 0) {
 		/* turn off LCD */
#8 lore raw

PATCH 7/7 [PATCH 7/7]

In reply to Alexander Kern

Only in linux-2.6.alex/drivers/video/aty/: .atyfb.o.cmd Only in linux-2.6.alex/drivers/video/aty/: .atyfb_base.o.cmd Only in linux-2.6.alex/drivers/video/aty/: .built-in.o.cmd Only in linux-2.6.alex/drivers/video/aty/: .mach64_accel.o.cmd Only in linux-2.6.alex/drivers/video/aty/: .mach64_ct.o.cmd Only in linux-2.6.alex/drivers/video/aty/: .mach64_cursor.o.cmd

drivers/video/aty/atyfb.h +2 -1
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/atyfb.h linux-2.6.alex/drivers/video/aty/atyfb.h
@@ -163,7 +163,8 @@ struct atyfb_par {
 	u16 lcd_hblank_len;
 	u16 lcd_vblank_len;
 #endif
-	int aux_app; /* auxiliary aperture */
+	unsigned long aux_start; /* auxiliary aperture */
+	unsigned long aux_size;
 };
 
     /*

Only in linux-2.6.alex/drivers/video/aty/: atyfb.h.orig Only in linux-2.6.alex/drivers/video/aty/: atyfb.o

drivers/video/aty/atyfb_base.c +15 -7
diff -U 3 -H -d -I '*.o' -p -r -- linux-2.6.4/drivers/video/aty/atyfb_base.c linux-2.6.alex/drivers/video/aty/atyfb_base.c
@@ -1267,11 +1267,11 @@ static int atyfb_set_par(struct fb_info 
 			aty_st_le32(BUS_CNTL, 0x680000f9, par);
 		} else if (M64_HAS(MOBIL_BUS)) {
 			aty_st_le32(DAC_CNTL, 0x80010102, par);
-			aty_st_le32(BUS_CNTL, 0x7b33a040 | (par->aux_app ? BUS_APER_REG_DIS : 0), par);
+			aty_st_le32(BUS_CNTL, 0x7b33a040 | (par->aux_start ? BUS_APER_REG_DIS : 0), par);
 		} else {
 			/* GT */
 			aty_st_le32(DAC_CNTL, 0x86010102, par);
-			aty_st_le32(BUS_CNTL, 0x7b23a040 | (par->aux_app ? BUS_APER_REG_DIS : 0), par);
+			aty_st_le32(BUS_CNTL, 0x7b23a040 | (par->aux_start ? BUS_APER_REG_DIS : 0), par);
 			aty_st_le32(EXT_MEM_CNTL, aty_ld_le32(EXT_MEM_CNTL, par) | 0x5000001, par);
 		}
 		aty_st_le32(MEM_CNTL, tmp, par);
@@ -2250,7 +2250,7 @@ static int __init aty_init(struct fb_inf
 	 *  the full 8 MB of video RAM on 8 MB boards
 	 */
 
-	if (!par->aux_app &&
+	if (!par->aux_start &&
 		(info->fix.smem_len == 0x800000 || (par->bus_type == ISA && info->fix.smem_len == 0x400000)))
 		info->fix.smem_len -= GUI_RESERVE;
 
@@ -2259,7 +2259,7 @@ static int __init aty_init(struct fb_inf
 	 *  if the auxiliary aperture is used so we can access
 	 *  the full 8 MB of video RAM on 8 MB boards.
 	 */
-	if (par->aux_app)
+	if (par->aux_start)
 		aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par);
 
 	/* Clear the video memory */
@@ -3063,7 +3063,8 @@ static int __devinit atyfb_setup_generic
 	raddr = addr + 0x7ff000UL;
 	rrp = &pdev->resource[2];
 	if ((rrp->flags & IORESOURCE_MEM) && request_mem_region(rrp->start, rrp->end - rrp->start + 1, "atyfb")) {
-		par->aux_app = 1;
+		par->aux_start = rrp->start;
+		par->aux_size = rrp->end - rrp->start + 1;
 		raddr = rrp->start;
 		printk(KERN_INFO "atyfb: using auxiliary register aperture\n");
 	}
@@ -3073,8 +3074,8 @@ static int __devinit atyfb_setup_generic
 	if (par->ati_regbase == 0)
 		return -ENOMEM;
 
-	info->fix.mmio_start += par->aux_app ? 0x400 : 0xc00;
-	par->ati_regbase += par->aux_app ? 0x400 : 0xc00;
+	info->fix.mmio_start += par->aux_start ? 0x400 : 0xc00;
+	par->ati_regbase += par->aux_start ? 0x400 : 0xc00;
 
 	/*
 	 * Enable memory-space accesses using config-space
@@ -3211,6 +3212,9 @@ err_release_io:
 		iounmap((void *) info->screen_base);
 #endif
 err_release_mem:
+	if(par->aux_start)
+		release_mem_region(par->aux_start, par->aux_size);
+
 	release_mem_region(par->res_start, par->res_size);
 err_free:
 	framebuffer_release(info);
@@ -3302,8 +3306,12 @@ static void __devexit atyfb_remove(struc
 	if (par->mmap_map)
 		kfree(par->mmap_map);
 #endif
+	if (par->aux_start)
+		release_mem_region(par->aux_start, par->aux_size);
+
 	if (par->res_start)
 		release_mem_region(par->res_start, par->res_size);
+
 	framebuffer_release(info);
 }
 

Only in linux-2.6.alex/drivers/video/aty/: atyfb_base.c.orig Only in linux-2.6.alex/drivers/video/aty/: atyfb_base.o Only in linux-2.6.alex/drivers/video/aty/: built-in.o Only in linux-2.6.alex/drivers/video/aty/: mach64_accel.c.orig Only in linux-2.6.alex/drivers/video/aty/: mach64_accel.o Only in linux-2.6.alex/drivers/video/aty/: mach64_ct.c.orig Only in linux-2.6.alex/drivers/video/aty/: mach64_ct.o Only in linux-2.6.alex/drivers/video/aty/: mach64_cursor.o Only in linux-2.6.alex/drivers/video/aty/: xlinit.c.orig

#9 lore raw

PATCH 1/1 all changes in two, again James mach64.diff

In reply to Alexander Kern
include/video/mach64.h +1 -0
@@ -669,6 +669,7 @@
 /* Mach64 engine bit constants - these are typically ORed together */
 
 /* BUS_CNTL register constants */
+#define BUS_APER_REG_DIS	0x00000010
 #define BUS_FIFO_ERR_ACK	0x00200000
 #define BUS_HOST_ERR_ACK	0x00800000
 
#10 lore raw
In reply to Alexander Kern

I had no luck with any of the patches. They all bombed out for me. Can you create a patch against the mach64.diff.gz I have.

Quoted 22 lines · Alexander Kern

Hello,

here a seven patches for mach64 fbdev driver.

01_mach64-add.diff
simple additions, once already send to James

02_mach64-aux.diff
patch based on patch from Ville Syrjälä, use aperture for register access

03_mach64-chipset2.diff
reorganize table of chipsets

04_mach64-bios.diff
let read frequence limits from BIOS

05_mach64-revers-hwtriple.diff
reverse logic for hardware triple

06_mach64-laterinit.diff
correct init from BIOS

Quoted 7 lines

07_mach64-aux_correct.diff
free regions, registered for aperture

Summary of patches tested on ARMADA E500 1400x1050

Regards Alex

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

#11 lore raw

Am Dienstag, 23. März 2004 19:57 schrieb James Simmons:

Quoted 2 lines

I had no luck with any of the patches. They all bombed out for me. Can you create a patch against the mach64.diff.gz I have.

And these?

include/video/mach64.h +1 -0
@@ -669,6 +669,7 @@
 /* Mach64 engine bit constants - these are typically ORed together */
 
 /* BUS_CNTL register constants */
+#define BUS_APER_REG_DIS	0x00000010
 #define BUS_FIFO_ERR_ACK	0x00200000
 #define BUS_HOST_ERR_ACK	0x00800000
 
#12 lore raw

Re: all in one patch

Am Mittwoch, 24. März 2004 21:39 schrieb Alexander Kern:

Quoted 4 lines

Am Dienstag, 23. März 2004 19:57 schrieb James Simmons:

Quoted 2 lines

I had no luck with any of the patches. They all bombed out for me. Can you create a patch against the mach64.diff.gz I have.

#13 lore raw

Re: all in one patch

I will give it a try.

Quoted 7 lines · Alexander Kern

Am Mittwoch, 24. März 2004 21:39 schrieb Alexander Kern:

Quoted 4 lines

Am Dienstag, 23. März 2004 19:57 schrieb James Simmons:

Quoted 2 lines

I had no luck with any of the patches. They all bombed out for me. Can you create a patch against the mach64.diff.gz I have.

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

#14 lore raw

Re: all in one patch

In reply to Alexander Kern

Still bombs out. I can manually apply the patch.

Stanards 2.6.4 kernel
Applied http://phoenix.infradead.org/~jsimmons/mach64.diff.gz
applied your patch.

Quoted 7 lines · Alexander Kern

Am Mittwoch, 24. März 2004 21:39 schrieb Alexander Kern:

Quoted 4 lines

Am Dienstag, 23. März 2004 19:57 schrieb James Simmons:

Quoted 2 lines

I had no luck with any of the patches. They all bombed out for me. Can you create a patch against the mach64.diff.gz I have.

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

#15 lore raw
In reply to Alexander Kern
Quoted 4 lines · Alexander Kern

Am Dienstag, 23. März 2004 19:57 schrieb James Simmons:

Quoted 2 lines

I had no luck with any of the patches. They all bombed out for me. Can you create a patch against the mach64.diff.gz I have.

And these?

Same problem.

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click