Browse Source

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
master
cpu 17 years ago
parent
commit
88bb2dec78
  1. 12
      Targets/Bonito2edev/conf/Makefile.Bonito2edev
  2. 2
      Targets/Bonito2fdev/Bonito/tgt_machdep.c
  3. 5
      Targets/Bonito2fdev/conf/Bonito.2fdev.sm502
  4. 5
      Targets/Bonito2fdev/conf/Makefile.Bonito2fdev
  5. 1
      Targets/Bonito2fdev/include/cs5536.h
  6. 3
      Targets/Bonito2fdev/include/cs5536_pci.h
  7. 7
      Targets/Bonito2fdev/pci/cs5536_vsm.c
  8. 2
      Targets/Bonito2fdev/pci/pci_machdep.c
  9. 10
      sys/dev/pci/sm502.c

12
Targets/Bonito2edev/conf/Makefile.Bonito2edev

@ -48,6 +48,8 @@ endif
# Defines # Defines
TARGET= ${S}/Targets/Bonito2edev TARGET= ${S}/Targets/Bonito2edev
SUBTARGET?=Bonito
START?=start.o
MACHINE=mips MACHINE=mips
MACHINE_ARCH=mips MACHINE_ARCH=mips
COMPILEDIR=${shell pwd} COMPILEDIR=${shell pwd}
@ -118,7 +120,7 @@ endif
# ${SYSTEM_LD_HEAD} # ${SYSTEM_LD_HEAD}
# ${SYSTEM_LD} # ${SYSTEM_LD}
# ${SYSTEM_LD_TAIL} # ${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 crtend.o
SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
SYSTEM_LD_HEAD= rm -f $@ SYSTEM_LD_HEAD= rm -f $@
@ -192,11 +194,11 @@ links:
sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
sh makelinks && rm -f dontlink sh makelinks && rm -f dontlink
SRCS= ${TARGET}/Bonito/start.S \ SRCS= ${TARGET}/${SUBTARGET}/start.S \
param.c ioconf.c ri.c ${CFILES} ${SFILES} param.c ioconf.c ri.c ${CFILES} ${SFILES}
depend:: .depend depend:: .depend
.depend: ${SRCS} param.c .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} ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
ifneq (${SFILES}, "") ifneq (${SFILES}, "")
${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
@ -208,14 +210,14 @@ autoconf.o conf.o: Makefile
# depend on network or filesystem configuration # depend on network or filesystem configuration
uipc_proto.o vfs_conf.o: Makefile uipc_proto.o vfs_conf.o: Makefile
start.o: ${TARGET}/Bonito/start.S Makefile ${START}: ${TARGET}/${SUBTARGET}/${START:.o=.S} Makefile
${NORMAL_S} ${NORMAL_S}
zpmon: startz.o zpmon: startz.o
rm start.o && cp -f startz.o start.o rm start.o && cp -f startz.o start.o
make pmon make pmon
make -C ../zboot zpmon make -C ../zboot zpmon
startz.o: ${TARGET}/Bonito/startz.S Makefile startz.o: ${TARGET}/${SUBTARGET}/startz.S Makefile
${NORMAL_S} ${NORMAL_S}
%RULES %RULES

2
Targets/Bonito2fdev/Bonito/tgt_machdep.c

@ -87,6 +87,7 @@ tgt_printf (const char *fmt, ...)
#include "mod_framebuffer.h" #include "mod_framebuffer.h"
#include "mod_smi712.h" #include "mod_smi712.h"
#include "mod_smi502.h" #include "mod_smi502.h"
#include <include/cs5536.h>
#if (NMOD_X86EMU_INT10 > 0)||(NMOD_X86EMU >0) #if (NMOD_X86EMU_INT10 > 0)||(NMOD_X86EMU >0)
extern int vga_bios_init(void); extern int vga_bios_init(void);
#endif #endif
@ -471,6 +472,7 @@ w83627_write(5,0x63,0);
w83627_write(5,0x70,1); w83627_write(5,0x70,1);
w83627_write(5,0x72,0xc); w83627_write(5,0x72,0xc);
w83627_write(5,0xf0,0x80); w83627_write(5,0xf0,0x80);
_wrmsr(GET_MSR_ADDR(0x5140001F), 0, 0);//no keyboard emulation
#endif #endif
/* /*

5
Targets/Bonito2fdev/conf/Bonito.2fdev.sm502

@ -79,8 +79,8 @@ option MY40IO
select mod_framebuffer select mod_framebuffer
select mod_smi502 # Silicon Motion502 select mod_smi502 # Silicon Motion502
option SMI502 option SMI502
#option X640x480 option X640x480
option X800x600 #option X800x600
#option X1024x768 #option X1024x768
#option X1280x800 #option X1280x800
#option CONFIG_VIDEO_SM501_8BPP #option CONFIG_VIDEO_SM501_8BPP
@ -180,4 +180,5 @@ option FLOATINGPT
option PCI_IDSEL_VIA686B=0 option PCI_IDSEL_VIA686B=0
option COM3_BASE_ADDR=0xbfc803f8 option COM3_BASE_ADDR=0xbfc803f8
option DEVBD2F_SM502 option DEVBD2F_SM502
select gzip

5
Targets/Bonito2fdev/conf/Makefile.Bonito2fdev

@ -81,6 +81,9 @@ include ${S}/lib/libc/Makefile.inc
LIBC=${CLIB} LIBC=${CLIB}
include ${S}/lib/libm/Makefile.inc include ${S}/lib/libm/Makefile.inc
LIBM=${MLIB} LIBM=${MLIB}
include ${S}/lib/libz/Makefile.inc
LIBZ=${ZLIB}
# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
@ -117,7 +120,7 @@ endif
# ${SYSTEM_LD_HEAD} # ${SYSTEM_LD_HEAD}
# ${SYSTEM_LD} # ${SYSTEM_LD}
# ${SYSTEM_LD_TAIL} # ${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 crtend.o
SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
SYSTEM_LD_HEAD= rm -f $@ SYSTEM_LD_HEAD= rm -f $@

1
Targets/Bonito2fdev/include/cs5536.h

@ -24,6 +24,7 @@
/* /*
* MSR module base * MSR module base
*/ */
#define GET_MSR_ADDR(x) (((x<<9)&0xff100000)|(x&0x3fff))
#define CS5536_SB_MSR_BASE (0x00000000) #define CS5536_SB_MSR_BASE (0x00000000)
#define CS5536_GLIU_MSR_BASE (0x10000000) #define CS5536_GLIU_MSR_BASE (0x10000000)
#define CS5536_ILLEGAL_MSR_BASE (0x20000000) #define CS5536_ILLEGAL_MSR_BASE (0x20000000)

3
Targets/Bonito2fdev/include/cs5536_pci.h

@ -23,9 +23,6 @@
* PCI bus device function * PCI bus device function
*/ */
#define PCI_BUS_CS5536 0 #define PCI_BUS_CS5536 0
#ifndef PCI_IDSEL_CS5536
#define PCI_IDSEL_CS5536 14
#endif
#define PCI_CFG_BASE 0x02000000 #define PCI_CFG_BASE 0x02000000
#define CS5536_ISA_FUNC 0 #define CS5536_ISA_FUNC 0

7
Targets/Bonito2fdev/pci/cs5536_vsm.c

@ -1598,6 +1598,8 @@ static int cmd_rdmsr(int ac, char *av[])
return -1; return -1;
} }
if(getenv("get_msr_addr")) msr=GET_MSR_ADDR(msr);
_rdmsr(msr, &hi, &lo); _rdmsr(msr, &hi, &lo);
printf("msr : address %x hi %x lo %x\n", 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; 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); _wrmsr(msr, hi, lo);
return 0; return 0;
@ -1629,7 +1634,7 @@ static const Cmd Cmds[] =
{ {
{"cs5536 debug"}, {"cs5536 debug"},
{"rdmsr", "reg", NULL, "msr read test", cmd_rdmsr, 2, 99, CMD_REPEAT}, {"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}, {0},
}; };

2
Targets/Bonito2fdev/pci/pci_machdep.c

@ -48,9 +48,11 @@
#include <pmon.h> #include <pmon.h>
extern void *pmalloc __P((size_t )); extern void *pmalloc __P((size_t ));
#if (PCI_IDSEL_CS5536 != 0)
#include <include/cs5536_pci.h> #include <include/cs5536_pci.h>
extern pcireg_t cs5536_pci_conf_readn(int function, int reg, int width); 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); extern int cs5536_pci_conf_writen(int function, int reg, int width, pcireg_t value);
#endif
extern void *pmalloc __P((size_t )); extern void *pmalloc __P((size_t ));
extern int _pciverbose; extern int _pciverbose;

10
sys/dev/pci/sm502.c

@ -236,9 +236,8 @@ const SMI_REGS init_regs[] =
{0x00004, 0x0}, {0x00004, 0x0},
{0x00048, 0x00021807}, //0x00021807 {0x00048, 0x00021807}, //0x00021807
{0x0004C, 0x091a0a01}, {0x0004C, 0x091a0a01},
{0x00054, 0x1}, {0x000040,0x0002180f},
{0x00040, 0x00021807},//0x00021807 {0x000044,0x60090208},
{0x00044, 0x091a0a01},
{0x00054, 0x0}, {0x00054, 0x0},
#if defined(CONFIG_VIDEO_SM501_8BPP) #if defined(CONFIG_VIDEO_SM501_8BPP)
{0x80000, 0x0f013104}, //0x0f013106 {0x80000, 0x0f013104}, //0x0f013106
@ -274,10 +273,11 @@ const SMI_REGS init_regs[] =
#endif #endif
{0x8004c, 0x00800000},//rgb565 {0x8004c, 0x00800000},//rgb565
// {0x80080, 0x00010001},//rgb565 // {0x80080, 0x00010001},//rgb565
{0x00048, 0x0002180f}, //0x00021807 {0x000048,0x0002180f},
{0x0004C, 0x091a0a01}, {0x00004c,0x60090208},
{0x00054, 0x1}, {0x00054, 0x1},
{0x80200, 0x00010000}, {0x80200, 0x00010000},
{0x000074,0x00020f1f},
#endif #endif
#ifdef X800x600 #ifdef X800x600
{0x00000004,0x00000000}, //0x00000001 {0x00000004,0x00000000}, //0x00000001

Loading…
Cancel
Save