From 88bb2dec7852bcf835d0a69ae221d52f81836013 Mon Sep 17 00:00:00 2001 From: cpu Date: Thu, 24 Jan 2008 10:36:51 +0000 Subject: [PATCH] r536@Knoppix: root | 2008-01-24 18:36:31 +0800 sm502 can use 640x480 now. git-svn-id: file:///svn/pmon-all/pmon-all@185 214b0138-1524-0410-9122-e5cb4b5bc56c --- Targets/Bonito2edev/conf/Makefile.Bonito2edev | 12 +++++++----- Targets/Bonito2fdev/Bonito/tgt_machdep.c | 2 ++ Targets/Bonito2fdev/conf/Bonito.2fdev.sm502 | 5 +++-- Targets/Bonito2fdev/conf/Makefile.Bonito2fdev | 5 ++++- Targets/Bonito2fdev/include/cs5536.h | 1 + Targets/Bonito2fdev/include/cs5536_pci.h | 3 --- Targets/Bonito2fdev/pci/cs5536_vsm.c | 7 ++++++- Targets/Bonito2fdev/pci/pci_machdep.c | 2 ++ sys/dev/pci/sm502.c | 10 +++++----- 9 files changed, 30 insertions(+), 17 deletions(-) diff --git a/Targets/Bonito2edev/conf/Makefile.Bonito2edev b/Targets/Bonito2edev/conf/Makefile.Bonito2edev index 6b7e0318..8fbf487a 100644 --- a/Targets/Bonito2edev/conf/Makefile.Bonito2edev +++ b/Targets/Bonito2edev/conf/Makefile.Bonito2edev @@ -48,6 +48,8 @@ endif # Defines TARGET= ${S}/Targets/Bonito2edev +SUBTARGET?=Bonito +START?=start.o MACHINE=mips MACHINE_ARCH=mips COMPILEDIR=${shell pwd} @@ -118,7 +120,7 @@ endif # ${SYSTEM_LD_HEAD} # ${SYSTEM_LD} # ${SYSTEM_LD_TAIL} -SYSTEM_OBJ= start.o crtbegin.o param.o ioconf.o ri.o ${OBJS} ${LIBC} ${LIBM} ${LIBZ} \ +SYSTEM_OBJ= ${START} crtbegin.o param.o ioconf.o ri.o ${OBJS} ${LIBC} ${LIBM} ${LIBZ} \ crtend.o SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= rm -f $@ @@ -192,11 +194,11 @@ links: sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks sh makelinks && rm -f dontlink -SRCS= ${TARGET}/Bonito/start.S \ +SRCS= ${TARGET}/${SUBTARGET}/start.S \ param.c ioconf.c ri.c ${CFILES} ${SFILES} depend:: .depend .depend: ${SRCS} param.c - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${TARGET}/Bonito/start.S + ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${TARGET}/${SUBTARGET}/start.S ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} ifneq (${SFILES}, "") ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} @@ -208,14 +210,14 @@ autoconf.o conf.o: Makefile # depend on network or filesystem configuration uipc_proto.o vfs_conf.o: Makefile -start.o: ${TARGET}/Bonito/start.S Makefile +${START}: ${TARGET}/${SUBTARGET}/${START:.o=.S} Makefile ${NORMAL_S} zpmon: startz.o rm start.o && cp -f startz.o start.o make pmon make -C ../zboot zpmon -startz.o: ${TARGET}/Bonito/startz.S Makefile +startz.o: ${TARGET}/${SUBTARGET}/startz.S Makefile ${NORMAL_S} %RULES diff --git a/Targets/Bonito2fdev/Bonito/tgt_machdep.c b/Targets/Bonito2fdev/Bonito/tgt_machdep.c index c4c92082..88f8bea8 100644 --- a/Targets/Bonito2fdev/Bonito/tgt_machdep.c +++ b/Targets/Bonito2fdev/Bonito/tgt_machdep.c @@ -87,6 +87,7 @@ tgt_printf (const char *fmt, ...) #include "mod_framebuffer.h" #include "mod_smi712.h" #include "mod_smi502.h" +#include #if (NMOD_X86EMU_INT10 > 0)||(NMOD_X86EMU >0) extern int vga_bios_init(void); #endif @@ -471,6 +472,7 @@ w83627_write(5,0x63,0); w83627_write(5,0x70,1); w83627_write(5,0x72,0xc); w83627_write(5,0xf0,0x80); +_wrmsr(GET_MSR_ADDR(0x5140001F), 0, 0);//no keyboard emulation #endif /* diff --git a/Targets/Bonito2fdev/conf/Bonito.2fdev.sm502 b/Targets/Bonito2fdev/conf/Bonito.2fdev.sm502 index 4ab07ee0..7adfac33 100644 --- a/Targets/Bonito2fdev/conf/Bonito.2fdev.sm502 +++ b/Targets/Bonito2fdev/conf/Bonito.2fdev.sm502 @@ -79,8 +79,8 @@ option MY40IO select mod_framebuffer select mod_smi502 # Silicon Motion502 option SMI502 -#option X640x480 -option X800x600 +option X640x480 +#option X800x600 #option X1024x768 #option X1280x800 #option CONFIG_VIDEO_SM501_8BPP @@ -180,4 +180,5 @@ option FLOATINGPT option PCI_IDSEL_VIA686B=0 option COM3_BASE_ADDR=0xbfc803f8 option DEVBD2F_SM502 +select gzip diff --git a/Targets/Bonito2fdev/conf/Makefile.Bonito2fdev b/Targets/Bonito2fdev/conf/Makefile.Bonito2fdev index f49cca20..1c7d8fa7 100644 --- a/Targets/Bonito2fdev/conf/Makefile.Bonito2fdev +++ b/Targets/Bonito2fdev/conf/Makefile.Bonito2fdev @@ -81,6 +81,9 @@ include ${S}/lib/libc/Makefile.inc LIBC=${CLIB} include ${S}/lib/libm/Makefile.inc LIBM=${MLIB} +include ${S}/lib/libz/Makefile.inc +LIBZ=${ZLIB} + # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, @@ -117,7 +120,7 @@ endif # ${SYSTEM_LD_HEAD} # ${SYSTEM_LD} # ${SYSTEM_LD_TAIL} -SYSTEM_OBJ= ${START} crtbegin.o param.o ioconf.o ri.o ${OBJS} ${LIBC} ${LIBM} \ +SYSTEM_OBJ= ${START} crtbegin.o param.o ioconf.o ri.o ${OBJS} ${LIBC} ${LIBM} ${LIBZ} \ crtend.o SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= rm -f $@ diff --git a/Targets/Bonito2fdev/include/cs5536.h b/Targets/Bonito2fdev/include/cs5536.h index d936e1ed..8867c722 100644 --- a/Targets/Bonito2fdev/include/cs5536.h +++ b/Targets/Bonito2fdev/include/cs5536.h @@ -24,6 +24,7 @@ /* * MSR module base */ +#define GET_MSR_ADDR(x) (((x<<9)&0xff100000)|(x&0x3fff)) #define CS5536_SB_MSR_BASE (0x00000000) #define CS5536_GLIU_MSR_BASE (0x10000000) #define CS5536_ILLEGAL_MSR_BASE (0x20000000) diff --git a/Targets/Bonito2fdev/include/cs5536_pci.h b/Targets/Bonito2fdev/include/cs5536_pci.h index 117a772c..a3c3bd9c 100644 --- a/Targets/Bonito2fdev/include/cs5536_pci.h +++ b/Targets/Bonito2fdev/include/cs5536_pci.h @@ -23,9 +23,6 @@ * PCI bus device function */ #define PCI_BUS_CS5536 0 -#ifndef PCI_IDSEL_CS5536 -#define PCI_IDSEL_CS5536 14 -#endif #define PCI_CFG_BASE 0x02000000 #define CS5536_ISA_FUNC 0 diff --git a/Targets/Bonito2fdev/pci/cs5536_vsm.c b/Targets/Bonito2fdev/pci/cs5536_vsm.c index 83a201d9..1cc69530 100644 --- a/Targets/Bonito2fdev/pci/cs5536_vsm.c +++ b/Targets/Bonito2fdev/pci/cs5536_vsm.c @@ -1598,6 +1598,8 @@ static int cmd_rdmsr(int ac, char *av[]) return -1; } + if(getenv("get_msr_addr")) msr=GET_MSR_ADDR(msr); + _rdmsr(msr, &hi, &lo); printf("msr : address %x hi %x lo %x\n", msr, hi, lo); @@ -1620,6 +1622,9 @@ static int cmd_wrmsr(int ac, char *av[]) return -1; } + if(getenv("get_msr_addr")) msr=GET_MSR_ADDR(msr); + printf("msr : address %x hi %x lo %x\n", msr, hi, lo); + _wrmsr(msr, hi, lo); return 0; @@ -1629,7 +1634,7 @@ static const Cmd Cmds[] = { {"cs5536 debug"}, {"rdmsr", "reg", NULL, "msr read test", cmd_rdmsr, 2, 99, CMD_REPEAT}, - {"wrmsr", "reg", NULL, "msr write test", cmd_wrmsr, 2, 99, CMD_REPEAT}, + {"wrmsr", "reg", NULL, "msr write test", cmd_wrmsr, 4, 99, CMD_REPEAT}, {0}, }; diff --git a/Targets/Bonito2fdev/pci/pci_machdep.c b/Targets/Bonito2fdev/pci/pci_machdep.c index a799d303..2b760f85 100644 --- a/Targets/Bonito2fdev/pci/pci_machdep.c +++ b/Targets/Bonito2fdev/pci/pci_machdep.c @@ -48,9 +48,11 @@ #include extern void *pmalloc __P((size_t )); +#if (PCI_IDSEL_CS5536 != 0) #include extern pcireg_t cs5536_pci_conf_readn(int function, int reg, int width); extern int cs5536_pci_conf_writen(int function, int reg, int width, pcireg_t value); +#endif extern void *pmalloc __P((size_t )); extern int _pciverbose; diff --git a/sys/dev/pci/sm502.c b/sys/dev/pci/sm502.c index aab065c9..e9396f35 100644 --- a/sys/dev/pci/sm502.c +++ b/sys/dev/pci/sm502.c @@ -236,9 +236,8 @@ const SMI_REGS init_regs[] = {0x00004, 0x0}, {0x00048, 0x00021807}, //0x00021807 {0x0004C, 0x091a0a01}, - {0x00054, 0x1}, - {0x00040, 0x00021807},//0x00021807 - {0x00044, 0x091a0a01}, + {0x000040,0x0002180f}, + {0x000044,0x60090208}, {0x00054, 0x0}, #if defined(CONFIG_VIDEO_SM501_8BPP) {0x80000, 0x0f013104}, //0x0f013106 @@ -274,10 +273,11 @@ const SMI_REGS init_regs[] = #endif {0x8004c, 0x00800000},//rgb565 // {0x80080, 0x00010001},//rgb565 - {0x00048, 0x0002180f}, //0x00021807 - {0x0004C, 0x091a0a01}, +{0x000048,0x0002180f}, +{0x00004c,0x60090208}, {0x00054, 0x1}, {0x80200, 0x00010000}, + {0x000074,0x00020f1f}, #endif #ifdef X800x600 {0x00000004,0x00000000}, //0x00000001