Browse Source
Change-Id: I1e38caba33d9ffe6bfbbfd9d620abaf613ccda57 Signed-off-by: qiaochong <qiaochong@loongson.cn>master
qiaochong
10 years ago
committed by
Chong Qiao
10 changed files with 4882 additions and 0 deletions
@ -0,0 +1,182 @@ |
|||
#define DEBUG_LOCORE |
|||
|
|||
|
|||
|
|||
#ifdef DEBUG_LOCORE |
|||
#define TTYDBG(x) \ |
|||
.rdata;98: .asciz x; .text; la a0, 98b; bal stringserial; nop |
|||
#define TTYDBG_COM1(x) \ |
|||
.rdata;98: .asciz x; .text; la a0, 98b; bal stringserial_COM1; nop |
|||
#else |
|||
#define TTYDBG(x) |
|||
#endif |
|||
|
|||
#define PRINTSTR(x) \ |
|||
.rdata;98: .asciz x; .text; la a0, 98b; bal stringserial; nop |
|||
|
|||
#ifdef DEVBD2F_SM502 |
|||
#define GPIOLED_DIR 0xe |
|||
#else |
|||
#define GPIOLED_DIR 0xf |
|||
#endif |
|||
|
|||
#undef USE_GPIO_SERIAL |
|||
#ifndef USE_GPIO_SERIAL |
|||
#define GPIOLED_SET(x) \ |
|||
li v0,0xbfe0011c; \ |
|||
lw v1,4(v0); \ |
|||
or v1,0xf; \ |
|||
xor v1,GPIOLED_DIR; \ |
|||
sw v1,4(v0); \ |
|||
li v1,(~x)&0xf;\ |
|||
sw v1,0(v0);\ |
|||
li v1,0x1000;\ |
|||
78: \ |
|||
subu v1,1;\ |
|||
bnez v1,78b;\ |
|||
nop; |
|||
#else |
|||
#define GPIOLED_SET(x) |
|||
#endif |
|||
|
|||
|
|||
/* set GPIO as output
|
|||
* x : 0x1<<offset |
|||
*/ |
|||
#define GPIO_SET_OUTPUT(x) \ |
|||
li v0, 0xbfe0011c; \ |
|||
lw v1, 0(v0); \ |
|||
or v1, x&0xffff; \ |
|||
xor v1, 0x0; \ |
|||
sw v1, 0(v0); \ |
|||
lw v1, 4(v0); \ |
|||
or v1, x&0xffff; \ |
|||
xor v1, x; \ |
|||
sw v1, 4(v0); \ |
|||
nop; \ |
|||
nop; |
|||
|
|||
/* clear GPIO as output
|
|||
* x : 0x1 <<offsest |
|||
*/ |
|||
#define GPIO_CLEAR_OUTPUT(x) \ |
|||
li v0, 0xbfe0011c; \ |
|||
lw v1, 0(v0); \ |
|||
or v1, x&0xffff; \ |
|||
xor v1, x; \ |
|||
sw v1, 0(v0); \ |
|||
lw v1, 4(v0); \ |
|||
or v1, x&0xffff; \ |
|||
xor v1, x; \ |
|||
sw v1, 4(v0); \ |
|||
nop; \ |
|||
nop; |
|||
|
|||
/* WatchDog Close for chip MAX6369*/ |
|||
#define WatchDog_Close \ |
|||
GPIO_CLEAR_OUTPUT(0x0040); \ |
|||
GPIO_SET_OUTPUT(0x2030); |
|||
|
|||
/* WatchDog Enable for chip MAX6369*/ |
|||
#define WatchDog_Enable \ |
|||
GPIO_CLEAR_OUTPUT(0x0020); \ |
|||
GPIO_SET_OUTPUT(0x2050); \ |
|||
|
|||
|
|||
#define w83627write(x,y,z) \ |
|||
li v0, 0xb800002e; \ |
|||
li v1, 0x87; \ |
|||
sb v1, 0(v0); \ |
|||
sb v1, 0(v0); \ |
|||
li v1, 0x7; \ |
|||
sb v1, 0(v0); \ |
|||
li v1, x; \ |
|||
sb v1, 1(v0); \ |
|||
li v1, y; \ |
|||
sb v1, 0(v0); \ |
|||
li v1, z; \ |
|||
sb v1, 1(v0); \ |
|||
li v1, 0xaa; \ |
|||
sb v1, 0(v0); \ |
|||
sb v1, 0(v0); \ |
|||
nop; \ |
|||
nop |
|||
|
|||
#define CONFIG_CACHE_64K_4WAY 1 |
|||
|
|||
#define tmpsize s1 |
|||
#define msize s2 |
|||
#define bonito s4 |
|||
#define dbg s5 |
|||
#define sdCfg s6 |
|||
|
|||
|
|||
/*
|
|||
* Coprocessor 0 register names |
|||
*/ |
|||
#define CP0_INDEX $0 |
|||
#define CP0_RANDOM $1 |
|||
#define CP0_ENTRYLO0 $2 |
|||
#define CP0_ENTRYLO1 $3 |
|||
#define CP0_CONF $3 |
|||
#define CP0_CONTEXT $4 |
|||
#define CP0_PAGEMASK $5 |
|||
#define CP0_WIRED $6 |
|||
#define CP0_INFO $7 |
|||
#define CP0_BADVADDR $8 |
|||
#define CP0_COUNT $9 |
|||
#define CP0_ENTRYHI $10 |
|||
#define CP0_COMPARE $11 |
|||
#define CP0_STATUS $12 |
|||
#define CP0_CAUSE $13 |
|||
#define CP0_EPC $14 |
|||
#define CP0_PRID $15 |
|||
#define CP0_CONFIG $16 |
|||
#define CP0_LLADDR $17 |
|||
#define CP0_WATCHLO $18 |
|||
#define CP0_WATCHHI $19 |
|||
#define CP0_XCONTEXT $20 |
|||
#define CP0_FRAMEMASK $21 |
|||
#define CP0_DIAGNOSTIC $22 |
|||
#define CP0_PERFORMANCE $25 |
|||
#define CP0_ECC $26 |
|||
#define CP0_CACHEERR $27 |
|||
#define CP0_TAGLO $28 |
|||
#define CP0_TAGHI $29 |
|||
#define CP0_ERROREPC $30 |
|||
|
|||
#define CP0_DEBUG $23 |
|||
#define CP0_DEPC $24 |
|||
#define CP0_DESAVE $31 |
|||
|
|||
#define NODE0_CORE0_BUF0 0x900000003ff01000 |
|||
#define NODE1_CORE0_BUF0 0x900010003ff01000 |
|||
#define NODE2_CORE0_BUF0 0x900020003ff01000 |
|||
#define NODE3_CORE0_BUF0 0x900030003ff01000 |
|||
|
|||
#define HT_REMOTE_NODE 0x900010003ff01000 |
|||
|
|||
/*BOOTCORE_ID at [0, 3]*/ |
|||
#define BOOTCORE_ID 0 |
|||
|
|||
#define Index_Store_Tag_I 0x08 |
|||
#define Index_Store_Tag_D 0x09 |
|||
#define Index_Invalidate_I 0x00 |
|||
#define Index_Writeback_Inv_D 0x01 |
|||
#define Index_Store_Tag_S 0x0b |
|||
#define Index_Writeback_Inv_S 0x03 |
|||
|
|||
#define FN_OFF 0x020 |
|||
#define SP_OFF 0x028 |
|||
#define GP_OFF 0x030 |
|||
#define A1_OFF 0x038 |
|||
|
|||
|
|||
#define L2_CACHE_OK 0x1111 |
|||
#define L2_CACHE_DONE 0x2222 |
|||
#define TEST_HT 0x3333 |
|||
#define NODE_MEM_INIT_DONE 0x4444 |
|||
#define ALL_CORE0_INIT_DONE 0x5555 |
|||
#define NODE_SCACHE_ENABLED 0x6666 |
|||
#define SYSTEM_INIT_OK 0x5a5a |
|||
|
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,19 @@ |
|||
ifndef S |
|||
S:=$(shell cd ../../../..; pwd) |
|||
endif |
|||
TARGET= ${S}/Targets/Bonito3a780e |
|||
SUBTARGET?=Bonito |
|||
CPPFLAGS=-mips3 |
|||
|
|||
%OBJS |
|||
|
|||
%CFILES |
|||
|
|||
%SFILES |
|||
|
|||
%LOAD |
|||
|
|||
export CFILES OBJS SFILES |
|||
include ${S}/Makefile.inc |
|||
|
|||
%RULES |
@ -0,0 +1,54 @@ |
|||
# $Id: files.Bonito |
|||
# |
|||
# Bonito Target specific files |
|||
# |
|||
|
|||
file Targets/Bonito3a780e/pci/pci_machdep.c |
|||
file Targets/Bonito3a780e/Bonito/tgt_machdep_firewall.c |
|||
file Targets/Bonito3a780e/pci/cs5536_io.c cs5536 |
|||
file Targets/Bonito3a780e/pci/cs5536_vsm.c cs5536 |
|||
file Targets/Bonito3a780e/pci/rs780_cmn.c amd_780e |
|||
file Targets/Bonito3a780e/pci/amd_780e.c amd_780e |
|||
file Targets/Bonito3a780e/pci/sb700.c amd_780e |
|||
file Targets/Bonito3a780e/pci/sb700_ide.c amd_780e |
|||
file Targets/Bonito3a780e/pci/sb700_lpc.c amd_780e |
|||
file Targets/Bonito3a780e/pci/sb700_sata.c amd_780e |
|||
file Targets/Bonito3a780e/pci/sb700_usb.c amd_780e |
|||
|
|||
file pmon/cmds/msqt.c cmd_test_sata |
|||
|
|||
define localbus { [base = -1 ] } |
|||
device localbus |
|||
attach localbus at mainbus |
|||
file Targets/Bonito2fdev/dev/localbus.c localbus |
|||
|
|||
|
|||
# Ethernet driver for Discovery ethernet |
|||
device gt: ether, ifnet, ifmedia |
|||
attach gt at localbus |
|||
file sys/dev/ic/if_gt.c gt |
|||
|
|||
# |
|||
# Media Indepedent Interface (mii) |
|||
# |
|||
include "sys/dev/mii/files.mii" |
|||
|
|||
# Various PCI bridges |
|||
|
|||
include "sys/dev/pci/files.pci" |
|||
|
|||
# |
|||
# Machine-independent ATAPI drivers |
|||
# |
|||
|
|||
include "sys/dev/ata/files.ata" |
|||
|
|||
# |
|||
# SCSI framework |
|||
# |
|||
include "sys/scsi/files.scsi" |
|||
|
|||
# |
|||
# Custom application files |
|||
# |
|||
include "pmon/custom/files.custom" |
@ -0,0 +1,259 @@ |
|||
# $Id: Bonito,v 1.1.1.1 2006/09/14 01:59:09 root Exp $ # # GENERIC configuration for Galileo EV64240 # # This file is supposed to be included by target file after # endian has been defined. |
|||
# |
|||
machine LS3afirewall mips # CPU Architecture, Platform |
|||
config pmon |
|||
option VGAROM_IN_BIOS |
|||
# |
|||
# Define target endian |
|||
# |
|||
makeoptions ENDIAN=EL # Little endian version. |
|||
|
|||
|
|||
#include "conf/GENERIC_ALL" |
|||
|
|||
# |
|||
# System Name and Target Name |
|||
# |
|||
option SYSTYPE="\"Bonito\"" |
|||
option TARGETNAME="\"Bonito\"" |
|||
|
|||
# |
|||
# Platform options |
|||
# |
|||
option loongson3A3 |
|||
option ARB_LEVEL |
|||
option DDR3_DIMM |
|||
|
|||
option AUTO_DDR_CONFIG |
|||
option USE_SB_I2C |
|||
|
|||
option BONITOEL |
|||
option DEVBD2F |
|||
option LS3_SERVER |
|||
option MIPS |
|||
option INET |
|||
option LS3_HT # Enable the IO cache coherent of HT |
|||
#option MCP68_IDE # Enable the MCP68 IDE 0 channel |
|||
#option USE_LPC_UART |
|||
#option MULTI_CHIP |
|||
option ENABLE_SATA #Enable SATA ,when enable IDE can also use, when commended only IDE can use |
|||
option BOOTCORE_ID=0 |
|||
option RESERVED_COREMASK=0xfff0 |
|||
|
|||
# |
|||
# Uart serial baud rate selection |
|||
# |
|||
#option BONITO_33M |
|||
option BONITO_25M |
|||
#option BONITO_50M |
|||
|
|||
option LOONGSON_3ASINGLE |
|||
option BOOT_PARAM |
|||
select amd_780e |
|||
|
|||
## VGA option ## |
|||
option SERVER_3A |
|||
option RS780E |
|||
option USE_780E_VGA |
|||
option VGA_NO_ROM |
|||
option VGA_BASE=0xbe000000 |
|||
option VRAM_SIZE=128 |
|||
#option DEBUG_EMU_VGA |
|||
#option CONFIG_GFXUMA |
|||
|
|||
# |
|||
# GPU driver selection. Selects for video |
|||
# Disable all options below to disable gpu driver |
|||
# Enable all options below to enble gpu driver |
|||
# |
|||
select mod_x86emu_int10 |
|||
select mod_framebuffer |
|||
select mod_vesa |
|||
select mod_vgacon |
|||
option VESAFB |
|||
option INTERFACE_3A780E |
|||
|
|||
# |
|||
# flash type selection. Selects flash support |
|||
# |
|||
select mod_flash_amd # AMD flash device programming |
|||
select mod_flash_intel # intel flash device programming |
|||
select mod_flash_sst # intel flash device programming |
|||
select mod_debugger # Debugging module |
|||
select mod_symbols # Symbol table handling |
|||
select mod_s3load # Srecord loading |
|||
#select mod_fastload # LSI Fastload |
|||
select mod_elfload # ELF loading |
|||
|
|||
# |
|||
# Command selection. Selects pmon commands |
|||
# |
|||
select cmd_newmt |
|||
select cmd_setup |
|||
select mod_display |
|||
select cmd_about # Display info about PMON |
|||
select cmd_boot # Boot wrapper |
|||
select cmd_mycmd |
|||
select cmd_newmt |
|||
select cmd_cache # Cache enabling |
|||
#select cmd_call # Call a function command |
|||
select cmd_date # Time of day command |
|||
select cmd_env # Full blown environment command set |
|||
select cmd_flash # Flash programming cmds |
|||
select cmd_hist # Command history |
|||
select cmd_ifaddr # Interface address command |
|||
select cmd_l # Disassemble |
|||
select cmd_mem # Memory manipulation commands |
|||
select cmd_more # More paginator |
|||
select cmd_mt # Simple memory test command |
|||
select cmd_misc # Reboot & Flush etc. |
|||
#select cmd_stty # TTY setings command |
|||
select cmd_tr # Host port-through command |
|||
select cmd_devls # Device list |
|||
select cmd_set # As cmd_env but not req. cmd_hist |
|||
select cmd_testdisk |
|||
# |
|||
select cmd_test # test commands,test hardisk |
|||
select cmd_shell # Shell commands, vers, help, eval |
|||
|
|||
#select cmd_test_sata # Sata signal test command |
|||
select cmd_test_spi |
|||
# |
|||
# |
|||
# Platform options |
|||
# |
|||
select mod_uart_ns16550 # Standard UART driver |
|||
#option CONS_BAUD=B9600 |
|||
option CONS_BAUD=B115200 |
|||
select ext2 |
|||
select fatfs |
|||
#select mod_x86emu # X86 emulation for VGA |
|||
option MY40IO |
|||
option NOPCINAMES # Save some space for x86emu |
|||
#option FASTBOOT |
|||
#select vt82c686 #via686a/b code |
|||
#option VGA_BASE=0xb0000000 |
|||
|
|||
# |
|||
# Functional options. |
|||
# |
|||
option NOSNOOP # Caches are no-snooping |
|||
|
|||
# |
|||
# HAVE options. What tgt level provide |
|||
# |
|||
option HAVE_TOD # Time-Of-Day clock |
|||
option HAVE_NVENV # Platform has non-volatile env mem |
|||
option HAVE_LOGO # Output splash logo |
|||
option USE_SUPERIO_UART |
|||
#option USE_LEGACY_RTC |
|||
#option GODSONEV2A |
|||
#option LINUX_PC |
|||
#option LONGMENG |
|||
#option RADEON7000 |
|||
#option DEBUG_EMU_VGA |
|||
option AUTOLOAD |
|||
#option CONFIG_PCI0_LARGE_MEM |
|||
#option CONFIG_PCI0_HUGE_MEM |
|||
#option CONFIG_PCI0_GAINT_MEM |
|||
option CONFIG_CACHE_64K_4WAY |
|||
option NVRAM_IN_FLASH |
|||
|
|||
# |
|||
# Now the Machine specification |
|||
# |
|||
mainbus0 at root |
|||
localbus0 at mainbus0 |
|||
loopdev0 at mainbus0 |
|||
#fd0 at mainbus0 |
|||
pcibr0 at mainbus0 |
|||
#pcibr1 at mainbus0 |
|||
pci0 at pcibr? |
|||
pci* at pcibr? |
|||
ppb* at pci? dev ? function ? # PCI-PCI bridges |
|||
pci* at ppb? bus ? |
|||
|
|||
|
|||
#### SCSI support |
|||
#siop* at pci? dev ? function ? # Symbios/NCR 53c... |
|||
#scsibus* at siop? |
|||
#sd* at scsibus? target ? lun ? |
|||
#cd* at scsibus? target ? lun ? |
|||
|
|||
#### Networking Devices |
|||
#gt0 at localbus? base 4 |
|||
#gt1 at localbus? base 5 |
|||
#gt2 at localbus? base 6 |
|||
# fxp normally only used for debugging (enable/disable both) |
|||
#fxp0 at pci? dev ? function ? # Intel 82559 Device |
|||
#inphy* at mii? phy ? # Intel 82555 PHYs |
|||
# rtl* at pci? dev ? function ? |
|||
#rte* at pci? dev ? function ? |
|||
#rtk* at pci? dev ? function ? |
|||
em* at pci? dev ? function ? |
|||
igb* at pci? dev ? function ? |
|||
|
|||
#### USB |
|||
#uhci* at pci? dev ? function ? |
|||
ohci* at pci? dev ? function ? |
|||
usb* at usbbus ? |
|||
|
|||
select mod_usb |
|||
select mod_usb_storage |
|||
select mod_usb_uhci |
|||
select mod_usb_ohci |
|||
select mod_usb_kbd |
|||
|
|||
|
|||
#### IDE controllers |
|||
option IDE_DMA |
|||
pciide0 at pci0 dev 20 function 1 flags 0 |
|||
pciide* at pci ? dev ? function ? flags 0x0000 |
|||
|
|||
#### IDE hard drives |
|||
wd0 at pciide0 channel 1 drive ? flags 0x0000 |
|||
wd* at pciide? channel ? drive ? flags 0x0000 |
|||
|
|||
### LSI MegaRAID SAS RAID controllers |
|||
mfi* at pci? |
|||
scsibus* at mfi? |
|||
sd* at scsibus? target ? lun ? |
|||
option CONFIG_LSI_9260 # for LSI_9260-8i(2108) RAID card support |
|||
|
|||
#### Pseudo devices |
|||
pseudo-device loop 1 # network loopback |
|||
|
|||
ide_cd* at pciide? channel ? drive ? flags 0x0001 |
|||
select iso9660 |
|||
select ramfiles |
|||
select cmd_xyzmodem |
|||
option IDECD |
|||
option HAVE_NB_SERIAL |
|||
#option USE_ENVMAC |
|||
#option LOOKLIKE_PC |
|||
#select cmd_lwdhcp |
|||
#select cmd_bootp |
|||
option FOR_GXEMUL |
|||
select fatfs |
|||
#option FLOATINGPT |
|||
#option PCI_IDSEL_VIA686B=17 |
|||
option PCI_IDSEL_SB700=14 |
|||
option WDC_NORESET |
|||
select gzip |
|||
option INPUT_FROM_BOTH |
|||
option OUTPUT_TO_BOTH |
|||
#option VIA686B_POWERFIXUP |
|||
option DEVBD2F_VIA |
|||
#option USE_GPIO_SERIAL |
|||
option CONFIG_VIDEO_SW_CURSOR |
|||
select http |
|||
#select nfs |
|||
select tcp |
|||
select inet |
|||
select tftpd |
|||
#select e100 |
|||
|
|||
# SCSI RAID disk drive support |
|||
select scsi_sd |
|||
option PCI_BIGMEM_ADDRESS=0x70000000 |
|||
option PCIVERBOSE=5 |
@ -0,0 +1 @@ |
|||
Bonito3a780e |
@ -0,0 +1 @@ |
|||
zloader |
@ -0,0 +1,7 @@ |
|||
TARGET=Bonito3a780e |
|||
TARGETEL=ls3a |
|||
export START=start_firewall.o |
|||
MEMSIZE=128 |
|||
ZLOADER_OPTIONS=-mips3 |
|||
|
|||
include Makefile.inc |
Loading…
Reference in new issue