* radeonfb IGP patch
@ 2004-04-05 19:11 Alex Song
2004-04-08 1:21 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 2+ messages in thread
From: Alex Song @ 2004-04-05 19:11 UTC (permalink / raw)
To: 'Benjamin Herrenschmidt'; +Cc: 'linux-fbdev-devel@lists.sf.net'
[-- Attachment #1: Type: text/plain, Size: 388 bytes --]
hi ben,
this patch for the new radeonfb in linux-2.6.4 fixes memory detection and fb
offsets for IGP based radeons.
cheers,
alex
============================================
Alex Song
Software Engineer
Digital Stream USA, Inc.
44061 Nobel Drive
Fremont, CA 94538, USA
Work: (510) 770-5700 x266
Fax: (510) 770-5769
Email: asong@ds-usa.com
============================================
[-- Attachment #2: radeonfb-IGP-linux-2.6.4.patch --]
[-- Type: application/octet-stream, Size: 3436 bytes --]
diff -uprN -X dontdiff linux-2.6.4-clean/drivers/video/aty/radeon_base.c linux-2.6.4/drivers/video/aty/radeon_base.c
--- linux-2.6.4-clean/drivers/video/aty/radeon_base.c 2004-03-10 18:55:25.000000000 -0800
+++ linux-2.6.4/drivers/video/aty/radeon_base.c 2004-04-01 16:10:32.050172056 -0800
@@ -1144,6 +1144,7 @@ static void radeon_write_pll_regs(struct
/* Set PPLL ref. div */
if (rinfo->family == CHIP_FAMILY_R300 ||
+ rinfo->family == CHIP_FAMILY_RS300 ||
rinfo->family == CHIP_FAMILY_R350 ||
rinfo->family == CHIP_FAMILY_RV350) {
if (mode->ppll_ref_div & R300_PPLL_REF_DIV_ACC_MASK) {
@@ -2129,7 +2130,31 @@ static int radeonfb_pci_register (struct
#endif /* CONFIG_PPC_OF */
/* framebuffer size */
- tmp = INREG(CONFIG_MEMSIZE);
+ if ((rinfo->family == CHIP_FAMILY_RS100) ||
+ (rinfo->family == CHIP_FAMILY_RS200) ||
+ (rinfo->family == CHIP_FAMILY_RS300)) {
+ u32 tom = INREG(NB_TOM);
+ tmp = ((((tom >> 16) - (tom & 0xffff) + 1) << 6) * 1024);
+
+ OUTREG(MC_FB_LOCATION, tom);
+ OUTREG(DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
+ OUTREG(CRTC2_DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
+ OUTREG(OV0_BASE_ADDR, (tom & 0xffff) << 16);
+
+ /* This is supposed to fix the crtc2 noise problem. */
+ OUTREG(GRPH2_BUFFER_CNTL, INREG(GRPH2_BUFFER_CNTL) & ~0x7f0000);
+
+ if ((rinfo->family == CHIP_FAMILY_RS100) ||
+ (rinfo->family == CHIP_FAMILY_RS200)) {
+ /* This is to workaround the asic bug for RMX, some versions
+ of BIOS dosen't have this register initialized correctly.
+ */
+ OUTREGP(CRTC_MORE_CNTL, CRTC_H_CUTOFF_ACTIVE_EN,
+ ~CRTC_H_CUTOFF_ACTIVE_EN);
+ }
+ } else {
+ tmp = INREG(CONFIG_MEMSIZE);
+ }
/* mem size is bits [28:0], mask off the rest */
rinfo->video_ram = tmp & CONFIG_MEMSIZE_MASK;
diff -uprN -X dontdiff linux-2.6.4-clean/include/video/radeon.h linux-2.6.4/include/video/radeon.h
--- linux-2.6.4-clean/include/video/radeon.h 2004-03-10 18:55:54.000000000 -0800
+++ linux-2.6.4/include/video/radeon.h 2004-03-29 18:34:57.000000000 -0800
@@ -73,6 +73,7 @@
#define MEM_IO_CNTL_A0 0x0178
#define MEM_INIT_LATENCY_TIMER 0x0154
#define MEM_SDRAM_MODE_REG 0x0158
+#define NB_TOM 0x015C
#define AGP_BASE 0x0170
#define MEM_IO_CNTL_A1 0x017C
#define MEM_IO_CNTL_B0 0x0180
@@ -173,6 +174,8 @@
#define CUR_CLR1 0x0270
#define FP_HORZ_VERT_ACTIVE 0x0278
#define CRTC_MORE_CNTL 0x027C
+# define CRTC_H_CUTOFF_ACTIVE_EN (1<<4)
+# define CRTC_V_CUTOFF_ACTIVE_EN (1<<5)
#define DAC_EXT_CNTL 0x0280
#define FP_GEN_CNTL 0x0284
#define FP_HORZ_STRETCH 0x028C
@@ -185,6 +188,7 @@
//#define DDA_ON_OFF 0x02e4
#define DVI_I2C_CNTL_1 0x02e4
#define GRPH_BUFFER_CNTL 0x02F0
+#define GRPH2_BUFFER_CNTL 0x03F0
#define VGA_BUFFER_CNTL 0x02F4
#define OV0_Y_X_START 0x0400
#define OV0_Y_X_END 0x0404
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: radeonfb IGP patch
2004-04-05 19:11 radeonfb IGP patch Alex Song
@ 2004-04-08 1:21 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2004-04-08 1:21 UTC (permalink / raw)
To: Alex Song; +Cc: 'linux-fbdev-devel@lists.sf.net'
On Tue, 2004-04-06 at 05:11, Alex Song wrote:
> hi ben,
>
> this patch for the new radeonfb in linux-2.6.4 fixes memory detection and fb
> offsets for IGP based radeons.
Looks good, I'll submit asap (no hurry, 2.6.5 was just released, so 2.6.6 won't
be out before a couple of monthes at least).
Ben.
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-08 1:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-05 19:11 radeonfb IGP patch Alex Song
2004-04-08 1:21 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).