disable most of the debug output

This commit is contained in:
Markus Fröschle
2016-10-17 04:05:50 +00:00
parent 42729fa2ea
commit cb31dffa64
17 changed files with 759 additions and 546 deletions

View File

@@ -893,3 +893,4 @@ tos/vmem_test/sources/printf_helper.S
tos/vmem_test/sources/vmem_test.c
tos/vmem_test/Makefile
tos/Makefile
radeon/radeon_i2c.c

View File

@@ -138,6 +138,7 @@ CSRCS= \
radeon_accel.c \
radeon_cursor.c \
radeon_monitor.c \
radeon_i2c.c \
fnt_st_8x16.c \
\
x86emu.c \

View File

@@ -8,7 +8,9 @@ sleep 1
wait
# set VBR
write-ctrl 0x0801 0x00000000
dump-register VBR
# Turn on MBAR at 0x1000_0000
write-ctrl 0x0C0F 0x10000000
@@ -20,8 +22,8 @@ write-ctrl 0x0C04 0x20000021
# Turn on RAMBAR1 at address 20001000
write-ctrl 0x0C05 0x20001021
# Init CS0 (BootFLASH @ E000_0000 - E03F_FFFF 8Mbytes)
write 0x10000500 0xE0000000 4
# Init CS0 (BootFLASH @ ff80_0000 - ff8F_FFFF 8Mbytes)
write 0x10000500 0xff800000 4
write 0x10000508 0x00041180 4
write 0x10000504 0x003F0001 4
wait
@@ -47,11 +49,7 @@ write 0x10000100 0x018D0000 4 # SDMR (write to LMR)
write 0x10000104 0x710D0F00 4 # SDCR (lock SDMR and enable refresh)
sleep 100
load m548xlite_dbug_ram.elf .sec1 .sec2 .sec3
# set VBR
write-ctrl 0x0801 0x00000000
dump-register VBR
load m548xlite_dbug_ram.elf
execute
wait

View File

@@ -173,7 +173,8 @@ extern struct mode_option resolution; /* fVDI */
#define FB_ACCEL_PROSAVAGE_DDR 0x8d /* S3 ProSavage DDR */
#define FB_ACCEL_PROSAVAGE_DDRK 0x8e /* S3 ProSavage DDR-K */
struct fb_fix_screeninfo {
struct fb_fix_screeninfo
{
char id[16]; /* identification string eg "TT Builtin" */
unsigned long smem_start; /* Start of frame buffer mem */
/* (physical address) */
@@ -199,7 +200,8 @@ struct fb_fix_screeninfo {
* stream and is written to video memory as that unmodified. This implies
* big-endian byte order if bits_per_pixel is greater than 8.
*/
struct fb_bitfield {
struct fb_bitfield
{
unsigned long offset; /* beginning of bitfield */
unsigned long length; /* length of bitfield */
unsigned long msb_right; /* != 0 : Most significant bit is */
@@ -242,7 +244,8 @@ struct fb_bitfield {
#define PICOS2KHZ(a) (1000000000UL/(a))
#define KHZ2PICOS(a) (1000000000UL/(a))
struct fb_var_screeninfo {
struct fb_var_screeninfo
{
unsigned long xres; /* visible resolution */
unsigned long yres;
unsigned long xres_virtual; /* virtual resolution */
@@ -311,7 +314,8 @@ enum {
#define FB_VBLANK_VSYNCING 0x080 /* currently in a vsync */
#define FB_VBLANK_HAVE_VSYNC 0x100 /* verical syncs can be detected */
struct fb_vblank {
struct fb_vblank
{
unsigned long flags; /* FB_VBLANK flags */
unsigned long count; /* counter of retraces since boot */
unsigned long vcount; /* current scanline position */
@@ -349,7 +353,8 @@ struct file;
#define FB_MISC_PRIM_COLOR 1
#define FB_MISC_1ST_DETAIL 2 /* First Detailed Timing is preferred */
struct fb_chroma {
struct fb_chroma
{
unsigned long redx; /* in fraction of 1024 */
unsigned long greenx;
unsigned long bluex;
@@ -360,7 +365,8 @@ struct fb_chroma {
unsigned long whitey;
};
struct fb_monspecs {
struct fb_monspecs
{
struct fb_chroma chroma;
struct fb_videomode *modedb; /* mode database */
unsigned char manufacturer[4]; /* Manufacturer */
@@ -390,7 +396,8 @@ struct fb_monspecs {
unsigned char max_y; /* Maximum vertical size (cm) */
};
struct fb_ops {
struct fb_ops
{
/* checks var and eventually tweaks if to soomething supported,
* DO NOT MODIFY PAR */
int (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info);
@@ -449,7 +456,8 @@ struct fb_ops {
void (*WaitVbl)(struct fb_info *info);
};
struct fb_info {
struct fb_info
{
struct fb_var_screeninfo var; /* Current var */
struct fb_fix_screeninfo fix; /* Current fix */
struct fb_monspecs monspecs; /* Current Monitor specs */

View File

@@ -1,6 +1,10 @@
#ifndef __RADEONFB_H__
#define __RADEONFB_H__
#ifdef CONFIG_FB_RADEON_I2C
#undef CONFIG_FB_RADEON_I2C
#endif
#include <bas_string.h>
#include "pci.h"
#include "mod_devicetable.h"
@@ -582,12 +586,12 @@ extern void radeon_wait_for_idle_mmio(struct radeonfb_info *rinfo);
#define radeon_engine_idle() radeon_wait_for_idle_mmio(rinfo)
#define radeon_wait_for_fifo(rinfo, entries) \
do \
{ \
do \
{ \
if (rinfo->fifo_slots < entries) \
radeon_wait_for_fifo_function(rinfo, entries); \
rinfo->fifo_slots -= entries; \
} while (0)
} while (0)
static inline int radeonfb_sync(struct fb_info *info)
{

View File

@@ -34,7 +34,7 @@
#include "interrupts.h"
#include "wait.h"
#define DEBUG
// #define DEBUG
#include "debug.h"
#define pci_config_wait() do { __asm__ __volatile("tpf" ::: "memory"); } while (0)
@@ -862,7 +862,7 @@ static void pci_device_config(uint16_t bus, uint16_t device, uint16_t function)
if (IS_PCI_MEM_BAR(address))
{
/* adjust base address to card's alignment requirements */
long size = ~(address & 0xfffffff0) + 1;
size_t size = ~(address & 0xfffffff0) + 1;
dbg("device 0x%02x: BAR[%d] requests %ld kBytes of memory\r\n", handle, i / 4, size / 1024);
/* calculate a valid map adress with alignment requirements */

View File

@@ -79,7 +79,7 @@ extern void run_bios(struct radeonfb_info *rinfo);
0, \
0, \
(flags) | (CHIP_FAMILY_##family) \
}
}
struct pci_device_id radeonfb_pci_table[] =
{
@@ -236,8 +236,6 @@ extern struct fb_info *info_fb;
#define rinfo ((struct radeonfb_info *) info_fb->par)
static uint32_t inreg(uint32_t addr)
{
dbg("info_fb = %p, info_fb->par = %p\r\n", info_fb, info_fb->par);
dbg("retrieve from addr %p\r\n", rinfo->mmio_base + addr);
return INREG(addr);
}
@@ -282,8 +280,8 @@ void radeon_pll_errata_after_index(struct radeonfb_info *rinfo)
{
if (!(rinfo->errata & CHIP_ERRATA_PLL_DUMMYREADS))
return;
(void)INREG(CLOCK_CNTL_DATA);
(void)INREG(CRTC_GEN_CNTL);
(void) INREG(CLOCK_CNTL_DATA);
(void) INREG(CRTC_GEN_CNTL);
}
void radeon_pll_errata_after_data(struct radeonfb_info *rinfo)
@@ -363,9 +361,7 @@ static int radeon_map_ROM(struct radeonfb_info *rinfo)
dbg("bios_seg=%p\r\n", rinfo->bios_seg);
dbg("bios_seg_phys=%p\r\n", rinfo->bios_seg_phys);
dbg("before inreg\r\n");
temp = inreg(MPP_TB_CONFIG);
dbg("after inreg\r\n");
dbg("temp=%d\r\n", temp);
temp &= 0x00ffffffu;
@@ -490,7 +486,8 @@ static int radeon_probe_pll_params(struct radeonfb_info *rinfo)
{
if ((get_timer() - start_tv) > US_TO_TIMER(10000000UL)) /* 10 sec */
{
timeout=1;
timeout = 1;
dbg("timeout\r\n");
break;
}
}
@@ -502,7 +499,8 @@ static int radeon_probe_pll_params(struct radeonfb_info *rinfo)
{
if ((get_timer() - start_tv) > US_TO_TIMER(1000000UL)) /* 1 sec */
{
timeout=1;
timeout = 1;
dbg("timeout2\r\n");
break;
}
}
@@ -512,7 +510,8 @@ static int radeon_probe_pll_params(struct radeonfb_info *rinfo)
{
if ((get_timer() - start_tv) > US_TO_TIMER(10000000UL)) /* 10 sec */
{
timeout=1;
timeout = 1;
dbg("timeout3\r\n");
break;
}
}
@@ -773,7 +772,10 @@ int radeonfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
}
if (radeon_match_mode(rinfo, &v, var))
{
dbg("invalid mode\r\n");
return -1; //-EINVAL;
}
switch (v.bits_per_pixel)
{
@@ -795,6 +797,7 @@ int radeonfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
break;
default:
dbg("invalid bits per pixel\r\n");
return -1; //-EINVAL;
}
@@ -2128,7 +2131,7 @@ int32_t radeonfb_pci_register(int32_t handle, const struct pci_device_id *ent)
info = framebuffer_alloc(sizeof(struct radeonfb_info));
if (!info)
{
dbg("could not allocate frame buffer\r\n");
dbg("could not allocate frame buffer info\r\n");
return -1; // -ENOMEM;
}
@@ -2376,7 +2379,7 @@ int32_t radeonfb_pci_register(int32_t handle, const struct pci_device_id *ent)
#endif
//rinfo->RageTheatreCrystal = rinfo->RageTheatreTunerPort=rinfo->RageTheatreCompositePort = rinfo->RageTheatreSVideoPort = -1;
//rinfo->tunerType = -1;
return(0);
return 0;
}
#if 0

216
radeon/radeon_i2c.c Normal file
View File

@@ -0,0 +1,216 @@
#include "radeonfb.h"
// #include "relocate.h"
#include "edid.h"
#include "driver_mem.h"
#ifdef CONFIG_FB_RADEON_I2C
#define RADEON_DDC 0x50
extern void mdelay(long msec);
extern void udelay(long usec);
static void radeon_gpio_setscl(void* data, int state)
{
struct radeon_i2c_chan *chan = data;
struct radeonfb_info *rinfo = chan->rinfo;
unsigned long val;
val = INREG(chan->ddc_reg) & ~(VGA_DDC_CLK_OUT_EN);
if(!state)
val |= VGA_DDC_CLK_OUT_EN;
OUTREG(chan->ddc_reg, val);
(void)INREG(chan->ddc_reg);
}
static void radeon_gpio_setsda(void* data, int state)
{
struct radeon_i2c_chan *chan = data;
struct radeonfb_info *rinfo = chan->rinfo;
unsigned long val;
val = INREG(chan->ddc_reg) & ~(VGA_DDC_DATA_OUT_EN);
if(!state)
val |= VGA_DDC_DATA_OUT_EN;
OUTREG(chan->ddc_reg, val);
(void)INREG(chan->ddc_reg);
}
static int radeon_gpio_getscl(void* data)
{
struct radeon_i2c_chan *chan = data;
struct radeonfb_info *rinfo = chan->rinfo;
unsigned long val;
val = INREG(chan->ddc_reg);
return(val & VGA_DDC_CLK_INPUT) ? 1 : 0;
}
static int radeon_gpio_getsda(void* data)
{
struct radeon_i2c_chan *chan = data;
struct radeonfb_info *rinfo = chan->rinfo;
unsigned long val;
val = INREG(chan->ddc_reg);
return(val & VGA_DDC_DATA_INPUT) ? 1 : 0;
}
static int radeon_setup_i2c_bus(struct radeon_i2c_chan *chan)
{
int rc;
chan->adapter.algo_data = &chan->algo;
chan->algo.setsda = radeon_gpio_setsda;
chan->algo.setscl = radeon_gpio_setscl;
chan->algo.getsda = radeon_gpio_getsda;
chan->algo.getscl = radeon_gpio_getscl;
chan->algo.udelay = 40;
chan->algo.timeout = 20;
chan->algo.data = chan;
/* Raise SCL and SDA */
radeon_gpio_setsda(chan, 1);
radeon_gpio_setscl(chan, 1);
udelay(20);
rc = i2c_bit_add_bus(&chan->adapter);
return rc;
}
void radeon_create_i2c_busses(struct radeonfb_info *rinfo)
{
rinfo->i2c[0].rinfo = rinfo;
rinfo->i2c[0].ddc_reg = GPIO_MONID;
radeon_setup_i2c_bus(&rinfo->i2c[0]);
rinfo->i2c[1].rinfo = rinfo;
rinfo->i2c[1].ddc_reg = GPIO_DVI_DDC;
radeon_setup_i2c_bus(&rinfo->i2c[1]);
rinfo->i2c[2].rinfo = rinfo;
rinfo->i2c[2].ddc_reg = GPIO_VGA_DDC;
radeon_setup_i2c_bus(&rinfo->i2c[2]);
rinfo->i2c[3].rinfo = rinfo;
rinfo->i2c[3].ddc_reg = GPIO_CRT2_DDC;
radeon_setup_i2c_bus(&rinfo->i2c[3]);
}
#if 0
void radeon_delete_i2c_busses(struct radeonfb_info *rinfo)
{
if(rinfo->i2c[0].rinfo)
i2c_bit_del_bus(&rinfo->i2c[0].adapter);
rinfo->i2c[0].rinfo = NULL;
if(rinfo->i2c[1].rinfo)
i2c_bit_del_bus(&rinfo->i2c[1].adapter);
rinfo->i2c[1].rinfo = NULL;
if(rinfo->i2c[2].rinfo)
i2c_bit_del_bus(&rinfo->i2c[2].adapter);
rinfo->i2c[2].rinfo = NULL;
if(rinfo->i2c[3].rinfo)
i2c_bit_del_bus(&rinfo->i2c[3].adapter);
rinfo->i2c[3].rinfo = NULL;
}
#endif
static unsigned char *radeon_do_probe_i2c_edid(struct radeon_i2c_chan *chan)
{
unsigned char start = 0x0;
struct i2c_msg msgs[] =
{
{
.addr = RADEON_DDC,
.len = 1,
.buf = &start,
},
{
.addr = RADEON_DDC,
.flags = I2C_M_RD,
.len = EDID_LENGTH,
},
};
unsigned char *buf;
buf = driver_mem_alloc(EDID_LENGTH * 3);
if (!buf)
return NULL;
msgs[1].buf = buf;
if(i2c_transfer(&chan->adapter, msgs, 2) == 2)
return buf;
driver_mem_free(buf);
return NULL;
}
int32_t radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int32_t conn, uint8_t **out_edid)
{
unsigned long reg = rinfo->i2c[conn-1].ddc_reg;
unsigned char *edid = NULL;
int i, j;
// DPRINTVAL("radeonfb: radeon_probe_i2c_connector ", conn);
// DPRINT("\r\n");
OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUTPUT | VGA_DDC_CLK_OUTPUT));
OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
(void)INREG(reg);
for(i = 0; i < 3; i++)
{
/* For some old monitors we need the
* following process to initialize/stop DDC
*/
OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
(void)INREG(reg);
mdelay(13);
OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
(void)INREG(reg);
for(j = 0; j < 5; j++)
{
mdelay(10);
if(INREG(reg) & VGA_DDC_CLK_INPUT)
break;
}
if(j == 5)
continue;
OUTREG(reg, INREG(reg) | VGA_DDC_DATA_OUT_EN);
(void)INREG(reg);
mdelay(15);
OUTREG(reg, INREG(reg) | VGA_DDC_CLK_OUT_EN);
(void)INREG(reg);
mdelay(15);
OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
(void)INREG(reg);
mdelay(15);
/* Do the real work */
edid = radeon_do_probe_i2c_edid(&rinfo->i2c[conn-1]);
OUTREG(reg, INREG(reg) | (VGA_DDC_DATA_OUT_EN | VGA_DDC_CLK_OUT_EN));
(void)INREG(reg);
mdelay(15);
OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
(void)INREG(reg);
for(j = 0; j < 10; j++)
{
mdelay(10);
if(INREG(reg) & VGA_DDC_CLK_INPUT)
break;
}
OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
(void)INREG(reg);
mdelay(15);
OUTREG(reg, INREG(reg) | (VGA_DDC_DATA_OUT_EN | VGA_DDC_CLK_OUT_EN));
(void)INREG(reg);
if(edid)
break;
}
/* Release the DDC lines when done or the Apple Cinema HD display
* will switch off */
OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN | VGA_DDC_DATA_OUT_EN));
(void)INREG(reg);
if(out_edid)
*out_edid = edid;
if(!edid)
return MT_NONE;
if(edid[0x14] & 0x80)
{
/* Fix detection using BIOS tables */
if(rinfo->is_mobility /*&& conn == ddc_dvi*/ && (INREG(LVDS_GEN_CNTL) & LVDS_ON))
return MT_LCD;
else
return MT_DFP;
}
return MT_CRT;
}
#endif /* CONFIG_FB_RADEON_I2C */

View File

@@ -5,12 +5,8 @@
#include "bas_printf.h"
#include "bas_string.h"
//#define DBG_MONITOR
#ifdef DBG_MONITOR
#define dbg(format, arg...) do { xprintf("DEBUG: " format, ##arg); } while (0)
#else
#define dbg(format, arg...) do { ; } while (0)
#endif /* DBG_MONITOR */
// #define DEBUG
#include "debug.h"
#ifndef INT_MAX
#define INT_MAX ((int) (~0U >> 1))
@@ -136,7 +132,7 @@ static int radeon_parse_monitor_layout(struct radeonfb_info *rinfo, const char *
if ((monitor_layout == NULL) || (*monitor_layout == '\0'))
{
dbg("%s: monitor_layout missing\r\n");
dbg("monitor_layout missing\r\n");
return 0;
}
@@ -178,33 +174,33 @@ static int radeon_parse_monitor_layout(struct radeonfb_info *rinfo, const char *
if (strcmp(s1, "CRT"))
{
rinfo->mon1_type = MT_CRT;
dbg("%s: monitor 1 set to CRT\r\n", __FUNCTION__);
dbg("monitor 1 set to CRT\r\n");
}
else if (strcmp(s1, "TMDS"))
{
rinfo->mon1_type = MT_DFP;
dbg("%s: monitor 1 set to TMDS\r\n", __FUNCTION__);
dbg("monitor 1 set to TMDS\r\n");
}
else if (strcmp(s1, "LVDS"))
{
rinfo->mon1_type = MT_LCD;
dbg("%s: monitor 1 set to LVDS\r\n", __FUNCTION__);
dbg("monitor 1 set to LVDS\r\n");
}
if (strcmp(s2, "CRT"))
{
rinfo->mon2_type = MT_CRT;
dbg("%s: monitor 2 set to CRT\r\n", __FUNCTION__);
dbg("monitor 2 set to CRT\r\n");
}
else if (strcmp(s2, "TMDS"))
{
rinfo->mon2_type = MT_DFP;
dbg("%s: monitor 2 set to TMDS\r\n", __FUNCTION__);
dbg("monitor 2 set to TMDS\r\n");
}
else if (strcmp(s2, "LVDS"))
{
rinfo->mon2_type = MT_LCD;
dbg("%s: monitor 2 set to LVDS\r\n", __FUNCTION__);
dbg("monitor 2 set to LVDS\r\n");
}
return 1;
}
@@ -227,25 +223,25 @@ void radeon_probe_screens(struct radeonfb_info *rinfo, const char *monitor_layou
* a layout for each card ?
*/
#ifdef CONFIG_FB_RADEON_I2C
dbg("%s: use monitor layout\r\n", __FUNCTION__);
dbg("use monitor layout\r\n");
if (!ignore_edid)
{
if (rinfo->mon1_type != MT_NONE)
{
dbg("%s: probe ddc_dvi on MON1\r\n", __FUNCTION__);
dbg("probe ddc_dvi on MON1\r\n");
if (!radeon_probe_i2c_connector(rinfo, ddc_dvi, &rinfo->mon1_EDID))
{
dbg("%s: probe ddc_crt2 on MON1\r\n", __FUNCTION__);
dbg("probe ddc_crt2 on MON1\r\n");
radeon_probe_i2c_connector(rinfo, ddc_crt2, &rinfo->mon1_EDID);
ddc_crt2_used = 1;
}
}
if (rinfo->mon2_type != MT_NONE)
{
dbg("%s: probe ddc_vga on MON2\r\n", __FUNCTION__);
dbg("probe ddc_vga on MON2\r\n");
if (!radeon_probe_i2c_connector(rinfo, ddc_vga, &rinfo->mon2_EDID) && !ddc_crt2_used)
{
dbg("%s: probe ddc_crt2 on MON2\r\n", __FUNCTION__);
dbg("probe ddc_crt2 on MON2\r\n");
radeon_probe_i2c_connector(rinfo, ddc_crt2, &rinfo->mon2_EDID);
}
}
@@ -261,7 +257,7 @@ void radeon_probe_screens(struct radeonfb_info *rinfo, const char *monitor_layou
else
{
rinfo->mon1_type = MT_CRT;
dbg("%s: No valid monitor, assuming CRT on first port\r\n", __FUNCTION__);
dbg("No valid monitor, assuming CRT on first port\r\n");
}
rinfo->mon2_type = MT_NONE;
rinfo->mon2_EDID = NULL;
@@ -273,7 +269,7 @@ void radeon_probe_screens(struct radeonfb_info *rinfo, const char *monitor_layou
* Auto-detecting display type (well... trying to ...)
*/
#ifdef CONFIG_FB_RADEON_I2C
dbg("%s: Auto-detecting\r\n", __FUNCTION__);
dbg("Auto-detecting\r\n");
#endif
#if 0 //#if DEBUG && defined(CONFIG_FB_RADEON_I2C)
{
@@ -292,17 +288,17 @@ void radeon_probe_screens(struct radeonfb_info *rinfo, const char *monitor_layou
#ifdef CONFIG_FB_RADEON_I2C
if (rinfo->mon1_type == MT_NONE)
{
dbg("%s: probe ddc_dvi on MON1\r\n", __FUNCTION__);
dbg("probe ddc_dvi on MON1\r\n");
rinfo->mon1_type = radeon_probe_i2c_connector(rinfo, ddc_dvi, &rinfo->mon1_EDID);
}
if (rinfo->mon1_type == MT_NONE)
{
dbg("%s: probe ddc_vga on MON1\r\n", __FUNCTION__);
dbg("probe ddc_vga on MON1\r\n");
rinfo->mon1_type = radeon_probe_i2c_connector(rinfo, ddc_vga, &rinfo->mon1_EDID);
}
if (rinfo->mon1_type == MT_NONE)
{
dbg("%s: probe ddc_crt2 on MON1\r\n", __FUNCTION__);
dbg("probe ddc_crt2 on MON1\r\n");
rinfo->mon1_type = radeon_probe_i2c_connector(rinfo, ddc_crt2, &rinfo->mon1_EDID);
}
#endif /* CONFIG_FB_RADEON_I2C */
@@ -316,12 +312,12 @@ void radeon_probe_screens(struct radeonfb_info *rinfo, const char *monitor_layou
#ifdef CONFIG_FB_RADEON_I2C
if (rinfo->mon1_type == MT_NONE)
{
dbg("%s: probe ddc_dvi on MON1\r\n", __FUNCTION__);
dbg("probe ddc_dvi on MON1\r\n");
rinfo->mon1_type = radeon_probe_i2c_connector(rinfo, ddc_dvi, &rinfo->mon1_EDID);
}
if (rinfo->mon1_type == MT_NONE)
{
dbg("%s: probe ddc_crt2 on MON1\r\n", __FUNCTION__);
dbg("probe ddc_crt2 on MON1\r\n");
rinfo->mon1_type = radeon_probe_i2c_connector(rinfo, ddc_crt2, &rinfo->mon1_EDID);
if (rinfo->mon1_type != MT_NONE)
ddc_crt2_used = 1;
@@ -331,7 +327,7 @@ void radeon_probe_screens(struct radeonfb_info *rinfo, const char *monitor_layou
&& (INREG(LVDS_GEN_CNTL) & LVDS_ON))
{
rinfo->mon1_type = MT_LCD;
dbg("%s: Non-DDC laptop panel detected\r\n", __FUNCTION__);
dbg("Non-DDC laptop panel detected\r\n");
}
if (rinfo->mon1_type == MT_NONE)
rinfo->mon1_type = radeon_crt_is_connected(rinfo, rinfo->reversed_DAC);
@@ -341,12 +337,12 @@ void radeon_probe_screens(struct radeonfb_info *rinfo, const char *monitor_layou
#ifdef CONFIG_FB_RADEON_I2C
if (rinfo->mon2_type == MT_NONE)
{
dbg("%s: probe ddc_vga on MON2\r\n", __FUNCTION__);
dbg("probe ddc_vga on MON2\r\n");
rinfo->mon2_type = radeon_probe_i2c_connector(rinfo, ddc_vga, &rinfo->mon2_EDID);
}
if (rinfo->mon2_type == MT_NONE && !ddc_crt2_used)
{
dbg("%s: probe ddc_crt2 on MON2\r\n", __FUNCTION__);
dbg("probe ddc_crt2 on MON2\r\n");
rinfo->mon2_type = radeon_probe_i2c_connector(rinfo, ddc_crt2, &rinfo->mon2_EDID);
}
#endif /* CONFIG_FB_RADEON_I2C */
@@ -399,18 +395,18 @@ void radeon_probe_screens(struct radeonfb_info *rinfo, const char *monitor_layou
}
bail:
dbg("%s: Monitor 1 type %s found\r\n", __FUNCTION__, radeon_get_mon_name(rinfo->mon1_type));
dbg("Monitor 1 type %s found\r\n", radeon_get_mon_name(rinfo->mon1_type));
if (rinfo->mon1_EDID)
{
dbg("%s: EDID probed\r\n", __FUNCTION__);
dbg("EDID probed\r\n");
}
if (!rinfo->has_CRTC2)
return;
dbg("%s: Monitor 2 type %s\r\n", __FUNCTION__, radeon_get_mon_name(rinfo->mon2_type));
dbg("Monitor 2 type %s\r\n", radeon_get_mon_name(rinfo->mon2_type));
if (rinfo->mon2_EDID)
{
dbg("%s: EDID probed\r\n", __FUNCTION__);
dbg("EDID probed\r\n");
}
}
@@ -470,7 +466,7 @@ void radeon_check_modes(struct radeonfb_info *rinfo, struct mode_option *resolut
struct fb_info *info = rinfo->info;
int has_default_mode = 0;
struct mode_option xres_yres;
dbg("%s: radeon_check_modes\r\n", __FUNCTION__);
dbg("\r\n");
/*
* Fill default var first
@@ -487,7 +483,7 @@ void radeon_check_modes(struct radeonfb_info *rinfo, struct mode_option *resolut
{
struct fb_var_screeninfo var;
dbg("%s: fb_parse_edid\r\n", __FUNCTION__);
dbg("fb_parse_edid\r\n");
if (fb_parse_edid(rinfo->mon1_EDID, &var) == 0)
{
if ((var.xres >= rinfo->panel_info.xres) && (var.yres >= rinfo->panel_info.yres))
@@ -495,7 +491,7 @@ void radeon_check_modes(struct radeonfb_info *rinfo, struct mode_option *resolut
}
else
{
dbg("%s: no data to parse\r\n", __FUNCTION__);
dbg("no data to parse\r\n");
}
}
/*
@@ -505,7 +501,8 @@ void radeon_check_modes(struct radeonfb_info *rinfo, struct mode_option *resolut
if (rinfo->mon1_type != MT_CRT && rinfo->panel_info.valid)
{
struct fb_var_screeninfo *var = &info->var;
dbg("%s: setup the default mode based on panel info\r\n", __FUNCTION__);
dbg("setup the default mode based on panel info\r\n");
var->xres = rinfo->panel_info.xres;
var->yres = rinfo->panel_info.yres;
var->xres_virtual = rinfo->panel_info.xres;
@@ -664,7 +661,7 @@ int radeon_match_mode(struct radeonfb_info *rinfo,
int distance = INT_MAX;
const struct fb_videomode *candidate = NULL;
dbg("%s:\r\n", __FUNCTION__);
dbg("\r\n");
/* Start with a copy of the requested mode */
memcpy(dest, src, sizeof(struct fb_var_screeninfo));
@@ -698,7 +695,7 @@ int radeon_match_mode(struct radeonfb_info *rinfo,
}
return 0;
}
dbg("%s:look for a mode in the database\r\n", __FUNCTION__);
dbg("look for a mode in the database\r\n");
/* Now look for a mode in the database */
while(db)

View File

@@ -53,7 +53,7 @@
#include "usb.h"
#include "video.h"
#define DEBUG
// #define DEBUG
#include "debug.h"
#define UNUSED(x) (void)(x) /* Unused variable */

View File

@@ -54,7 +54,7 @@
#include "usb.h"
#include "usb_hub.h"
#define DEBUG
// #define DEBUG
#include "debug.h"
struct hci

View File

@@ -12,14 +12,8 @@
#include "usb.h"
#include "usb_hub.h"
#define DEBUG_HUB
#ifdef DEBUG_HUB
#define dbg(format, arg...) do { xprintf("DEBUG: %s(): " format, __FUNCTION__, ##arg); } while (0)
#else
#define dbg(format, arg...) do { ; } while (0)
#endif /* DEBUG_HUB */
#define err(format, arg...) do { xprintf("DEBUG: %s(): " format, __FUNCTION__, ##arg); } while (0)
#define info(format, arg...) do { xprintf("DEBUG: %s(): " format, __FUNCTION__, ##arg); } while (0)
// #define DEBUG
#include "debug.h"
static struct usb_hub_device hub_dev[USB_MAX_BUS][USB_MAX_HUB];
static int usb_hub_index[USB_MAX_BUS];

View File

@@ -26,13 +26,8 @@
#include "exceptions.h"
#include "driver_mem.h"
#define DEBUG_USBMOUSE
#ifdef DEBUG_USBMOUSE
#define dbg(format, arg...) do { xprintf("DEBUG: %s(): " format, __FUNCTION__, ##arg); } while (0)
#else
#define dbg(format, arg...) do { ; } while (0)
#endif /* DEBUG_USBMOUSE */
#define err(format, arg...) do { xprintf("ERROR: %s(): " format, __FUNCTION__, ##arg); } while (0)
// #define DEBUG
#include "debug.h"
extern void ltoa(char *buf, long n, unsigned long base);
extern void call_mousevec(unsigned char *data, void (**mousevec)(void *));

View File

@@ -16,12 +16,8 @@
#include "bas_printf.h"
#include "bas_string.h"
#define DBG_MODES
#ifdef DBG_MODES
#define dbg(format, arg...) do { xprintf("DEBUG: " format, __FUNCTION__, ##arg); } while (0)
#else
#define dbg(format, arg...) do { ; } while (0)
#endif /* DBG_MODES */
// #define DEBUG
#include "debug.h"
#define name_matches(v, s, l) \
((v).name && !strncmp((s), (v).name, (l)) && strlen((v).name) == (l))

View File

@@ -286,12 +286,12 @@ int16_t ignore_edid;
struct mode_option resolution =
{
.used = 0,
.used = 1,
.width = 640,
.height = 480,
.bpp = 8,
.freq = 60,
.flags = 0
.flags = MODE_VESA_FLAG
};
int16_t force_measure_pll;

View File

@@ -10,7 +10,7 @@
#include "pci_ids.h"
#include "x86pcibios.h"
#define DEBUG
// #define DEBUG
#include "debug.h"
#define USE_SDRAM

View File

@@ -6,7 +6,7 @@
#include "bas_printf.h"
extern unsigned short offset_port;
#define DEBUG
// #define DEBUG
#include "debug.h"
int x86_pcibios_handler(struct X86EMU *emu)