├── CHANGELOG ├── COPYING ├── CREDITS ├── LICENSE ├── MAINTAINERS ├── MAKEALL ├── Makefile ├── README ├── README.md ├── autoconf.h ├── board └── rt2880 │ ├── Makefile │ ├── config.mk │ ├── flash.c │ ├── include │ ├── CpuCp0RegDef.h │ ├── aux_intc.h │ ├── aux_reg_map.h │ ├── chip_reg_map.h │ ├── compiler.h │ ├── cpu.h │ ├── cpu_except.h │ ├── ethernet.h │ ├── except.h │ ├── ide3710.h │ ├── intc.h │ ├── lcd.h │ ├── mac.h │ ├── mac.inc │ ├── mem_init.inc │ ├── mem_map.h │ ├── mem_map_1fc0.h │ ├── mem_tst.h │ ├── palmpak_tst.h │ ├── pio.h │ ├── product.h │ ├── pubdefs.h │ ├── regdef.h │ ├── sysc.h │ ├── timer.h │ └── uart.h │ ├── memsetup.S │ ├── rt2880.c │ ├── rt2880_init.S │ ├── serial.c │ ├── serial.h │ └── u-boot.lds ├── buildroot-gcc342.tar.bz2 ├── common ├── Makefile ├── cmd_bdinfo.c ├── cmd_boot.c ├── cmd_bootm.c ├── cmd_console.c ├── cmd_fat.c ├── cmd_flash.c ├── cmd_load.c ├── cmd_mem.c ├── cmd_misc.c ├── cmd_net.c ├── cmd_nvedit.c ├── cmd_usb.c ├── command.c ├── console.c ├── devices.c ├── dlmalloc.c ├── env_common.c ├── env_flash.c ├── env_nand.c ├── env_spi.c ├── environment.c ├── exports.c ├── flash.c ├── libcommon.a.map ├── lists.c ├── main.c ├── usb.c ├── usb_hub.c └── usb_storage.c ├── config.in ├── config.mk ├── cpu └── ralink_soc │ ├── Makefile │ ├── cache.S │ ├── config.mk │ ├── cpu.c │ ├── interrupts.c │ ├── start.S │ └── start_1004k.S ├── disk ├── Makefile ├── part.c ├── part_amiga.c ├── part_amiga.h ├── part_dos.c ├── part_dos.h ├── part_iso.c ├── part_iso.h ├── part_mac.c └── part_mac.h ├── drivers ├── MT7620_bmt.c ├── MT7620_bmt.h ├── Makefile ├── bbu_spiflash.h ├── ehci-core.h ├── ehci-hcd.c ├── ehci-ra.c ├── ehci.h ├── i2c_drv.c ├── mii_mgr.c ├── msdc │ ├── config.h │ ├── mmc_core.c │ ├── mmc_core.h │ ├── mmc_test.c │ ├── mmc_test.h │ ├── msdc.c │ ├── msdc.h │ ├── msdc_cust.c │ ├── msdc_cust.h │ ├── msg.h │ ├── sdio.h │ ├── ts_msdc.c │ └── utils.h ├── nand │ ├── bmt.c │ ├── bmt.h │ ├── mt6575_typedefs.h │ ├── mtk_nand.c │ ├── mtk_nand.h │ ├── nand_base.c │ ├── nand_def.h │ ├── nand_device_list.h │ └── nand_ids.c ├── nand_flash.c ├── ohci-hcd.c ├── ohci.h ├── phy_val.c ├── phy_val.h ├── ralink_nand.h ├── ralink_spi.h ├── rt2880_eth.c ├── spi_drv.c ├── spi_flash.c ├── spi_rt6855A_flash.c ├── usb │ └── host │ │ ├── mtk-phy-7621.c │ │ ├── mtk-phy-7621.h │ │ ├── mtk-phy-ahb.c │ │ ├── mtk-phy.c │ │ ├── mtk-phy.h │ │ ├── xhci-mem.c │ │ ├── xhci-mtk-power.c │ │ ├── xhci-mtk-power.h │ │ ├── xhci-mtk-scheduler.c │ │ ├── xhci-mtk-scheduler.h │ │ ├── xhci-mtk.c │ │ ├── xhci-mtk.h │ │ ├── xhci-ring.c │ │ ├── xhci.c │ │ └── xhci.h └── vtss.h ├── fs ├── Makefile └── fat │ ├── Makefile │ ├── fat.c │ ├── fat.c.old │ └── file.c ├── httpd ├── Makefile ├── fs.c ├── fs.h ├── fsdata.h ├── httpd.c ├── httpd.h ├── main.c ├── tapdev.c ├── tapdev.h ├── uip.c ├── uip.h ├── uip_arch.c ├── uip_arch.h ├── uip_arp.c ├── uip_arp.h ├── uipopt.h └── vendors │ ├── HI-WOOYA │ ├── 404.html │ ├── fail.html │ ├── flashing.html │ ├── index.html │ ├── style.css │ └── vt.png │ ├── makefsdatac │ └── yuicompressor-2.4.8.jar ├── include ├── ArchDefs.h ├── LzmaDecode.h ├── _exports.h ├── altera.h ├── asm-mips │ ├── addrspace.h │ ├── au1x00.h │ ├── bitops.h │ ├── byteorder.h │ ├── cachectl.h │ ├── cacheops.h │ ├── global_data.h │ ├── inca-ip.h │ ├── io.h │ ├── isadep.h │ ├── mipsregs.h │ ├── posix_types.h │ ├── processor.h │ ├── ptrace.h │ ├── reg.h │ ├── regdef.h │ ├── sgidefs.h │ ├── string.h │ ├── system.h │ ├── types.h │ └── u-boot.h ├── asm │ ├── addrspace.h │ ├── au1x00.h │ ├── bitops.h │ ├── byteorder.h │ ├── cache.h │ ├── cachectl.h │ ├── cacheops.h │ ├── errno-base.h │ ├── errno.h │ ├── global_data.h │ ├── inca-ip.h │ ├── io.h │ ├── isadep.h │ ├── mipsregs.h │ ├── posix_types.h │ ├── processor.h │ ├── ptrace.h │ ├── reg.h │ ├── regdef.h │ ├── sgidefs.h │ ├── string.h │ ├── system.h │ ├── types.h │ ├── u-boot.h │ └── unaligned.h ├── ata.h ├── bedbug │ ├── bedbug.h │ ├── ppc.h │ ├── regs.h │ ├── tables.h │ └── type.h ├── bmp_layout.h ├── bmp_logo.h ├── bzlib.h ├── circbuf.h ├── cmd_confdefs.h ├── command.h ├── common.h ├── compiler.h ├── config.h ├── config.mk ├── configs │ └── rt2880.h ├── console.h ├── devices.h ├── environment.h ├── exports.h ├── fat.h ├── fat_old.h ├── flash.h ├── fpga.h ├── hush.h ├── i2c.h ├── ide.h ├── image.h ├── kgdb.h ├── launch.h ├── linux │ ├── bitops.h │ ├── byteorder │ │ ├── big_endian.h │ │ ├── generic.h │ │ ├── little_endian.h │ │ └── swab.h │ ├── compiler-gcc.h │ ├── compiler-gcc3.h │ ├── compiler-gcc4.h │ ├── compiler.h │ ├── config.h │ ├── ctype.h │ ├── err.h │ ├── errno.h │ ├── mc146818rtc.h │ ├── mtd │ │ ├── bbm.h │ │ ├── doc2000.h │ │ ├── mtd.h │ │ ├── nand.h │ │ ├── nand_ecc.h │ │ ├── nand_ids.h │ │ └── nftl.h │ ├── posix_types.h │ ├── stat.h │ ├── stddef.h │ ├── string.h │ ├── time.h │ ├── types.h │ ├── unaligned │ │ ├── access_ok.h │ │ ├── be_byteshift.h │ │ ├── generic.h │ │ └── le_byteshift.h │ └── usb │ │ ├── atmel_usba_udc.h │ │ ├── cdc.h │ │ ├── ch9.h │ │ ├── composite.h │ │ ├── dwc3.h │ │ ├── gadget.h │ │ ├── musb.h │ │ └── xhci-omap.h ├── lists.h ├── logbuff.h ├── lzma │ ├── LzmaDec.h │ ├── LzmaTools.h │ └── LzmaTypes.h ├── malloc.h ├── mk48t59.h ├── mtd │ └── mtd-abi.h ├── nand_api.h ├── net.h ├── part.h ├── post.h ├── rt_mmap.h ├── rtc.h ├── s_record.h ├── scsi.h ├── serial.h ├── spi.h ├── spi_api.h ├── sysdefs.h ├── systemace.h ├── unxz.h ├── usb.h ├── usb_defs.h ├── version.h ├── watchdog.h ├── xilinx.h ├── xz.h └── zlib.h ├── lib_generic ├── LzmaDec.h ├── LzmaDecode.c ├── LzmaTools.h ├── Makefile ├── Types.h ├── bzlib.c ├── bzlib_crctable.c ├── bzlib_decompress.c ├── bzlib_huffman.c ├── bzlib_private.h ├── bzlib_randtable.c ├── crc32.c ├── ctype.c ├── decompress_unxz.c ├── display_options.c ├── string.c ├── vsprintf.c ├── xz_dec_bcj.c ├── xz_dec_lzma2.c ├── xz_dec_stream.c ├── xz_lzma2.h ├── xz_private.h ├── xz_stream.h └── zlib.c ├── lib_mips ├── Makefile ├── ashldi3.c ├── ashrdi3.c ├── board.c ├── ddr2.h ├── ddr3.h ├── ddr_init.c ├── libgcc.h ├── lshrdi3.c ├── mips_linux.c ├── mpll.h ├── mpll40Mhz.h └── time.c ├── mips_config.mk ├── mkconfig ├── mt7621_ddr.sh ├── mt7621_ddr_param.txt ├── net ├── Makefile ├── bootp.c ├── bootp.h ├── eth.c ├── httpd.c ├── httpd.h ├── net.c ├── rarp.c ├── rarp.h ├── tftp.c └── tftp.h ├── rtc ├── Makefile └── date.c ├── scripts ├── Configure ├── Makefile ├── Menuconfig ├── README.Menuconfig ├── README.uClinux ├── header.tk ├── lxdialog │ ├── BIG.FAT.WARNING │ ├── Makefile │ ├── checklist.c │ ├── colors.h │ ├── dialog.h │ ├── inputbox.c │ ├── lxdialog.c │ ├── menubox.c │ ├── msgbox.c │ ├── textbox.c │ ├── util.c │ └── yesno.c ├── tail.tk ├── tkcond.c ├── tkgen.c ├── tkparse.c └── tkparse.h ├── stage1 ├── Makefile ├── boot.c ├── gdma.c ├── nandc.c ├── stage1n2.lds └── start.S ├── tools ├── Makefile ├── crc.c ├── crc32.c ├── image.h └── mkimage.c ├── uboot_README └── uboot_version.h /CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi-wooya/u-boot-hiwooya/b1bc29ee5395d739fb640ca6bfcb787358ed91a3/CHANGELOG -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi-wooya/u-boot-hiwooya/b1bc29ee5395d739fb640ca6bfcb787358ed91a3/CREDITS -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi-wooya/u-boot-hiwooya/b1bc29ee5395d739fb640ca6bfcb787358ed91a3/MAINTAINERS -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #u-boot-mt7688 2 | ##uboot for HI-WOOYA V1.0.3 3 | *** 4 | #How to use 5 | * 1.make menuconfig 6 | * 2.select MT7628 board 7 | * 3.make clean;make 8 | 9 | #Note 10 | * note:compile need java such as 1.7.0_79 11 | 12 | #update list 13 | * change bps to 115200,fix gpio39,40,41,42 low when startup 14 | * add all gpio test,just press 'WPS' button with more than 7 seconds at power on 15 | * web failsafe update mode,just press 'WPS' button with 2 to 7 seconds at power on 16 | * web failsafe IP is 192.168.1.111 17 | * DDR2 can be 64MB or 128MB,just select 512Mbit or 1024Mbit in menuconfig 18 | *** 19 | * QQ:317312379 20 | * mail:317312379@qq.com 21 | *** 22 | ## Official website:www.hi-wooya.com 23 | -------------------------------------------------------------------------------- /autoconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Automatically generated by make menuconfig: don't edit 3 | */ 4 | #define AUTOCONF_INCLUDED 5 | #define ASIC_BOARD 1 6 | #undef RT2880_ASIC_BOARD 7 | #undef RT3350_ASIC_BOARD 8 | #undef RT3052_ASIC_BOARD 9 | #undef RT3352_ASIC_BOARD 10 | #undef RT3883_ASIC_BOARD 11 | #undef RT5350_ASIC_BOARD 12 | #undef RT6855A_ASIC_BOARD 13 | #undef MT7620_ASIC_BOARD 14 | #undef MT7621_ASIC_BOARD 15 | #define MT7628_ASIC_BOARD 1 16 | #define MT7628_MP 1 17 | #define P5_MAC_TO_NONE_MODE 1 18 | #define P4_MAC_TO_NONE_MODE 1 19 | #define ON_BOARD_SPI_FLASH_COMPONENT 1 20 | #undef ON_BOARD_DDR1 21 | #define ON_BOARD_DDR2 1 22 | #undef ON_BOARD_256M_DRAM_COMPONENT 23 | #undef ON_BOARD_512M_DRAM_COMPONENT 24 | #define ON_BOARD_1024M_DRAM_COMPONENT 1 25 | #undef ON_BOARD_2048M_DRAM_COMPONENT 26 | #undef ON_BOARD_DDR_WIDTH_8 27 | #define ON_BOARD_DDR_WIDTH_16 1 28 | #define ON_BOARD_16BIT_DRAM_BUS 1 29 | #undef UBOOT_RAM 30 | #define UBOOT_ROM 1 31 | #define MT7628_CPU_PLL_PARAMETERS 1 32 | #define CPUCLK_FROM_CPLL 1 33 | #undef CPUCLK_FROM_BPLL 34 | #undef CPUCLK_FROM_XTAL 35 | #define CPU_FRAC_DIV 0x1 36 | #undef DUAL_IMAGE_SUPPORT 37 | #undef LAN_WAN_PARTITION 38 | #define TEXT_BASE 0xBC000000 39 | -------------------------------------------------------------------------------- /board/rt2880/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = lib$(BOARD).a 27 | 28 | 29 | OBJS = $(BOARD).o serial.o 30 | ifeq ($(CFG_ENV_IS), IN_FLASH) 31 | OBJS += flash.o 32 | endif 33 | SOBJS = $(BOARD)_init.o memsetup.o 34 | 35 | $(LIB): .depend $(OBJS) $(SOBJS) 36 | $(AR) crv $@ $(OBJS) $(SOBJS) 37 | 38 | ######################################################################### 39 | 40 | .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) 41 | $(CC) -M -g $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c)> $@ 42 | 43 | sinclude .depend 44 | 45 | ######################################################################### 46 | -------------------------------------------------------------------------------- /board/rt2880/config.mk: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | # 25 | # RT2880 board with MIPS 4Kec CPU core 26 | # 27 | 28 | # ROM version 29 | #TEXT_BASE = 0xBFC00000 30 | 31 | # RAM version 32 | #TEXT_BASE = 0x8A200000 33 | 34 | # ICE DEBUG version 35 | # SDRAM BASE 0x8A000000 36 | # Use top half of SDRAM(32M) as ROM 37 | #TEXT_BASE = 0x8B000000 38 | -------------------------------------------------------------------------------- /board/rt2880/u-boot.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Wolfgang Denk Engineering, 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips") 26 | */ 27 | /*OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")*/ 28 | OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips", "elf32-tradlittlemips") 29 | OUTPUT_ARCH(mips) 30 | ENTRY(_start) 31 | 32 | SECTIONS 33 | { 34 | . = 0x00000000; 35 | 36 | . = ALIGN(4); 37 | .text : 38 | { 39 | *(.text) 40 | } 41 | 42 | . = ALIGN(4); 43 | .rodata : { *(.rodata) } 44 | 45 | . = ALIGN(4); 46 | 47 | .data : { *(.data) } 48 | 49 | . = ALIGN(4); 50 | .sdata : { *(.sdata) } 51 | 52 | _gp = ALIGN(16); 53 | 54 | .got : { 55 | __got_start = .; 56 | *(.got) 57 | __got_end = .; 58 | } 59 | 60 | .sdata : { *(.sdata) } 61 | 62 | __u_boot_cmd_start = .; 63 | .u_boot_cmd : { *(.u_boot_cmd) } 64 | __u_boot_cmd_end = .; 65 | 66 | uboot_end_data = .; 67 | num_got_entries = (__got_end - __got_start) >> 2; 68 | 69 | . = ALIGN(4); 70 | .sbss : { *(.sbss) } 71 | .bss : { *(.bss) } 72 | 73 | uboot_end = .; 74 | } 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /buildroot-gcc342.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi-wooya/u-boot-hiwooya/b1bc29ee5395d739fb640ca6bfcb787358ed91a3/buildroot-gcc342.tar.bz2 -------------------------------------------------------------------------------- /common/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2004 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = libcommon.a 27 | 28 | AOBJS = 29 | 30 | ifeq ($(RALINK_CMDLINE),ON) 31 | COBJS = main.o cmd_bdinfo.o cmd_boot.o cmd_bootm.o cmd_console.o \ 32 | cmd_load.o cmd_misc.o cmd_net.o cmd_mem.o \ 33 | cmd_nvedit.o command.o console.o devices.o dlmalloc.o \ 34 | env_common.o exports.o lists.o 35 | else 36 | COBJS = console.o devices.o dlmalloc.o \ 37 | env_common.o exports.o lists.o cmd_nvedit.o cmd_bootm.o cmd_net.o 38 | endif 39 | 40 | ifeq ($(RALINK_UPGRADE_BY_SERIAL),ON) 41 | COBJS += cmd_load.o 42 | endif 43 | 44 | ifeq ($(RALINK_USB),ON) 45 | COBJS += usb.o usb_storage.o cmd_usb.o cmd_fat.o 46 | endif 47 | 48 | ifeq ($(MTK_USB),ON) 49 | COBJS += usb.o usb_storage.o cmd_usb.o cmd_fat.o 50 | endif 51 | 52 | 53 | OBJS = $(AOBJS) $(COBJS) 54 | 55 | ifeq ($(CFG_ENV_IS), IN_FLASH) 56 | OBJS += cmd_flash.o env_flash.o flash.o cmd_mem.o 57 | endif 58 | ifeq ($(CFG_ENV_IS), IN_SPI) 59 | OBJS += env_spi.o 60 | endif 61 | ifeq ($(CFG_ENV_IS), IN_NAND) 62 | OBJS += env_nand.o 63 | endif 64 | 65 | CPPFLAGS += -I.. 66 | 67 | all: $(LIB) $(AOBJS) 68 | 69 | $(LIB): .depend $(OBJS) 70 | $(AR) crv $@ $(OBJS) 71 | 72 | environment.o: environment.c ../tools/envcrc 73 | $(CC) $(AFLAGS) -Wa,--no-warn \ 74 | -DENV_CRC=$(shell ../tools/envcrc) \ 75 | -c -o $@ environment.c 76 | 77 | ../tools/envcrc: 78 | $(MAKE) -C ../tools 79 | 80 | ######################################################################### 81 | 82 | .depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) 83 | $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@ 84 | 85 | sinclude .depend 86 | 87 | ######################################################################### 88 | -------------------------------------------------------------------------------- /common/cmd_boot.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000-2003 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * Misc boot support 26 | */ 27 | #include 28 | #include 29 | #include 30 | 31 | 32 | /* -------------------------------------------------------------------- */ 33 | int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) 34 | { 35 | 36 | #if defined(CONFIG_I386) 37 | DECLARE_GLOBAL_DATA_PTR; 38 | #endif 39 | ulong addr, rc; 40 | int rcode = 0; 41 | #if 1 42 | if (argc < 2) { 43 | printf ("Usage:\n%s\n", cmdtp->usage); 44 | return 1; 45 | } 46 | 47 | addr = simple_strtoul(argv[1], NULL, 16); 48 | 49 | printf ("## Starting application at 0x%08lX ...\n", addr); 50 | 51 | /* 52 | * pass address parameter as argv[0] (aka command name), 53 | * and all remaining args 54 | */ 55 | #if defined(CONFIG_I386) 56 | /* 57 | * x86 does not use a dedicated register to pass the pointer 58 | * to the global_data 59 | */ 60 | argv[0] = (char *)gd; 61 | #endif 62 | #if !defined(CONFIG_NIOS) 63 | rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]); 64 | #else 65 | /* 66 | * Nios function pointers are address >> 1 67 | */ 68 | rc = ((ulong (*)(int, char *[]))(addr>>1)) (--argc, &argv[1]); 69 | #endif 70 | if (rc != 0) rcode = 1; 71 | 72 | printf ("## Application terminated, rc = 0x%lX\n", rc); 73 | #endif 74 | return rcode; 75 | } 76 | 77 | /* -------------------------------------------------------------------- */ 78 | 79 | U_BOOT_CMD( 80 | go, CFG_MAXARGS, 1, do_go, 81 | "go - start application at address 'addr'\n", 82 | "addr [arg ...]\n - start application at address 'addr'\n" 83 | " passing 'arg' as arguments\n" 84 | ); 85 | 86 | extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); 87 | 88 | U_BOOT_CMD( 89 | reset, 1, 0, do_reset, 90 | "reset - Perform RESET of the CPU\n", 91 | NULL 92 | ); 93 | 94 | -------------------------------------------------------------------------------- /common/cmd_console.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * Boot support 26 | */ 27 | #include 28 | #include 29 | #include 30 | 31 | #if (CONFIG_COMMANDS & CFG_CMD_CONSOLE) 32 | #ifdef RT2880_U_BOOT_CMD_OPEN 33 | 34 | extern void _do_coninfo (void); 35 | int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[]) 36 | { 37 | int i, l; 38 | 39 | /* Scan for valid output and input devices */ 40 | 41 | puts ("List of available devices:\n"); 42 | 43 | for (i = 1; i <= ListNumItems (devlist); i++) { 44 | device_t *dev = ListGetPtrToItem (devlist, i); 45 | 46 | printf ("%-8s %08x %c%c%c ", 47 | dev->name, 48 | dev->flags, 49 | (dev->flags & DEV_FLAGS_SYSTEM) ? 'S' : '.', 50 | (dev->flags & DEV_FLAGS_INPUT) ? 'I' : '.', 51 | (dev->flags & DEV_FLAGS_OUTPUT) ? 'O' : '.'); 52 | 53 | for (l = 0; l < MAX_FILES; l++) { 54 | if (stdio_devices[l] == dev) { 55 | printf ("%s ", stdio_names[l]); 56 | } 57 | } 58 | putc ('\n'); 59 | } 60 | return 0; 61 | } 62 | 63 | 64 | /***************************************************/ 65 | 66 | U_BOOT_CMD( 67 | coninfo, 3, 1, do_coninfo, 68 | "coninfo - print console devices and information\n", 69 | "" 70 | ); 71 | #endif 72 | #endif /* CFG_CMD_CONSOLE */ 73 | -------------------------------------------------------------------------------- /common/cmd_misc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2001 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * Misc functions 26 | */ 27 | #include 28 | #include 29 | 30 | #if (CONFIG_COMMANDS & CFG_CMD_MISC) 31 | #ifdef RT2880_U_BOOT_CMD_OPEN 32 | 33 | int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) 34 | { 35 | ulong delay; 36 | 37 | if (argc != 2) { 38 | printf ("Usage:\n%s\n", cmdtp->usage); 39 | return 1; 40 | } 41 | 42 | delay = simple_strtoul(argv[1], NULL, 10); 43 | 44 | while (delay) { 45 | int i; 46 | for (i=0; i<1000; ++i) { 47 | if (ctrlc ()) { 48 | return (-1); 49 | } 50 | udelay (1000); 51 | } 52 | --delay; 53 | } 54 | return 0; 55 | } 56 | #endif 57 | /* Implemented in $(CPU)/interrupts.c */ 58 | #if (CONFIG_COMMANDS & CFG_CMD_IRQ) 59 | int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); 60 | 61 | U_BOOT_CMD( 62 | irqinfo, 1, 1, do_irqinfo, 63 | "irqinfo - print information about IRQs\n", 64 | NULL 65 | ); 66 | #endif /* CONFIG_COMMANDS & CFG_CMD_IRQ */ 67 | #ifdef RT2880_U_BOOT_CMD_OPEN 68 | 69 | U_BOOT_CMD( 70 | sleep , 2, 2, do_sleep, 71 | "sleep - delay execution for some time\n", 72 | "N\n" 73 | " - delay execution for N seconds (N is _decimal_ !!!)\n" 74 | ); 75 | #endif 76 | #endif /* CFG_CMD_MISC */ 77 | -------------------------------------------------------------------------------- /common/exports.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static void dummy(void) 5 | { 6 | } 7 | 8 | unsigned long get_version(void) 9 | { 10 | return XF_VERSION; 11 | } 12 | 13 | void jumptable_init (void) 14 | { 15 | DECLARE_GLOBAL_DATA_PTR; 16 | int i; 17 | 18 | gd->jt = (void **) malloc (XF_MAX * sizeof (void *)); 19 | for (i = 0; i < XF_MAX; i++) 20 | gd->jt[i] = (void *) dummy; 21 | 22 | gd->jt[XF_get_version] = (void *) get_version; 23 | gd->jt[XF_malloc] = (void *) malloc; 24 | gd->jt[XF_free] = (void *) free; 25 | gd->jt[XF_get_timer] = (void *)get_timer; 26 | gd->jt[XF_udelay] = (void *)udelay; 27 | #if defined(CONFIG_I386) || defined(CONFIG_PPC) 28 | gd->jt[XF_install_hdlr] = (void *) irq_install_handler; 29 | gd->jt[XF_free_hdlr] = (void *) irq_free_handler; 30 | #endif /* I386 || PPC */ 31 | } 32 | -------------------------------------------------------------------------------- /cpu/ralink_soc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = lib$(CPU).a 27 | 28 | ifeq ($(MT7621_MP), y) 29 | START = start_1004k.o 30 | else 31 | START = start.o 32 | endif 33 | 34 | OBJS = cpu.o 35 | SOBJS = cache.o 36 | 37 | all: .depend $(START) $(LIB) 38 | 39 | $(LIB): $(OBJS) $(SOBJS) 40 | $(AR) crv $@ $(OBJS) $(SOBJS) 41 | 42 | ######################################################################### 43 | 44 | .depend: Makefile $(START:.o=.S) $(OBJS:.o=.c) 45 | $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@ 46 | 47 | sinclude .depend 48 | 49 | ######################################################################### 50 | -------------------------------------------------------------------------------- /cpu/ralink_soc/config.mk: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | v=$(shell \ 24 | $(AS) --version|grep "GNU assembler"|awk -F . '{print $$2}') 25 | MIPSFLAGS=$(shell \ 26 | if [ "$v" -lt "14" ]; then \ 27 | echo "-mabicalls"; \ 28 | else \ 29 | echo "-mabicalls"; \ 30 | fi) 31 | # Dennis Lee, Big Endian need -EB otherwise remove -EB 32 | # echo "-mcpu=4kc -EB -mabicalls"; 33 | # echo "-march=4kc -mtune=4kc -Wa,-mips_allow_branch_to_undefined -mabicalls"; 34 | PLATFORM_CPPFLAGS += $(MIPSFLAGS) 35 | -------------------------------------------------------------------------------- /cpu/ralink_soc/interrupts.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Wolfgang Denk, DENX Software Engineering, 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #include 25 | 26 | void enable_interrupts(void) 27 | { 28 | } 29 | 30 | int disable_interrupts(void) 31 | { 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /disk/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | #CFLAGS += -DET_DEBUG -DDEBUG 27 | 28 | LIB = libdisk.a 29 | 30 | #OBJS = part.o part_mac.o part_dos.o part_iso.o part_amiga.o 31 | OBJS = part.o part_dos.o 32 | 33 | all: $(LIB) 34 | 35 | $(LIB): $(START) $(OBJS) 36 | $(AR) crv $@ $(OBJS) 37 | 38 | ######################################################################### 39 | 40 | .depend: Makefile $(OBJS:.o=.c) 41 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 42 | 43 | sinclude .depend 44 | 45 | ######################################################################### 46 | -------------------------------------------------------------------------------- /disk/part_dos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #ifndef _DISK_PART_DOS_H 25 | #define _DISK_PART_DOS_H 26 | 27 | 28 | #ifdef CONFIG_ISO_PARTITION 29 | /* Make the buffers bigger if ISO partition support is enabled -- CD-ROMS 30 | have 2048 byte blocks */ 31 | #define DEFAULT_SECTOR_SIZE 2048 32 | #else 33 | #define DEFAULT_SECTOR_SIZE 512 34 | #endif 35 | #define DOS_PART_TBL_OFFSET 0x1be 36 | #define DOS_PART_MAGIC_OFFSET 0x1fe 37 | #define DOS_PBR_FSTYPE_OFFSET 0x36 38 | #define DOS_PBR_MEDIA_TYPE_OFFSET 0x15 39 | #define DOS_MBR 0 40 | #define DOS_PBR 1 41 | 42 | typedef struct dos_partition { 43 | unsigned char boot_ind; /* 0x80 - active */ 44 | unsigned char head; /* starting head */ 45 | unsigned char sector; /* starting sector */ 46 | unsigned char cyl; /* starting cylinder */ 47 | unsigned char sys_ind; /* What partition type */ 48 | unsigned char end_head; /* end head */ 49 | unsigned char end_sector; /* end sector */ 50 | unsigned char end_cyl; /* end cylinder */ 51 | unsigned char start4[4]; /* starting sector counting from 0 */ 52 | unsigned char size4[4]; /* nr of sectors in partition */ 53 | } dos_partition_t; 54 | 55 | #endif /* _DISK_PART_DOS_H */ 56 | -------------------------------------------------------------------------------- /drivers/ehci-core.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2007-2008, Juniper Networks, Inc. 3 | * Copyright (c) 2008, Excito Elektronik i Skåne AB 4 | * All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License as 8 | * published by the Free Software Foundation version 2 of 9 | * the License. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 19 | * MA 02111-1307 USA 20 | */ 21 | 22 | #ifndef USB_EHCI_CORE_H 23 | #define USB_EHCI_CORE_H 24 | 25 | extern int rootdev; 26 | extern struct ehci_hccr *hccr; 27 | extern volatile struct ehci_hcor *hcor; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /drivers/msdc/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef _UTILS_H_ 2 | #define _UTILS_H_ 3 | 4 | #include 5 | #include 6 | #include "msg.h" 7 | 8 | #define BUG_ON(x) \ 9 | do { \ 10 | if (x) { \ 11 | printf("[BUG] %s LINE:%d FILE:%s\n", #x, __LINE__, __FILE__); \ 12 | while(1); \ 13 | } \ 14 | }while(0) 15 | #define WARN_ON(x) \ 16 | do { \ 17 | if (x) { \ 18 | MSG(WRN, "[WARN] %s LINE:%d FILE:%s\n", #x, __LINE__, __FILE__); \ 19 | } \ 20 | }while(0) 21 | 22 | #define ERR_EXIT(expr, ret, expected_ret) \ 23 | do { \ 24 | (ret) = (expr);\ 25 | if ((ret) != (expected_ret)) { \ 26 | printf("[ERR] LINE:%d: %s != %d (%d)\n", __LINE__, #expr, expected_ret, ret); \ 27 | goto exit; \ 28 | } \ 29 | } while(0) 30 | 31 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 32 | 33 | /* 34 | * ffs: find first bit set. This is defined the same way as 35 | * the libc and compiler builtin ffs routines, therefore 36 | * differs in spirit from the above ffz (man ffs). 37 | */ 38 | 39 | static uint32 uffs(uint32 x) 40 | { 41 | int r = 1; 42 | 43 | if (!x) 44 | return 0; 45 | if (!(x & 0xffff)) { 46 | x >>= 16; 47 | r += 16; 48 | } 49 | if (!(x & 0xff)) { 50 | x >>= 8; 51 | r += 8; 52 | } 53 | if (!(x & 0xf)) { 54 | x >>= 4; 55 | r += 4; 56 | } 57 | if (!(x & 3)) { 58 | x >>= 2; 59 | r += 2; 60 | } 61 | if (!(x & 1)) { 62 | x >>= 1; 63 | r += 1; 64 | } 65 | return r; 66 | } 67 | 68 | 69 | 70 | #ifndef min 71 | #define min(x, y) (x < y ? x : y) 72 | #endif 73 | #ifndef max 74 | #define max(x, y) (x > y ? x : y) 75 | #endif 76 | 77 | #if 1 78 | #define udelay(us) \ 79 | do { \ 80 | volatile int count = us * 5000; \ 81 | while (count--); \ 82 | }while(0) 83 | 84 | #define mdelay(ms) \ 85 | do { \ 86 | unsigned long i; \ 87 | for (i = 0; i < ms; i++) \ 88 | udelay(1000); \ 89 | }while(0) 90 | #else 91 | #define udelay(us) do{GPT_Delay_us(us);}while(0) 92 | #define mdelay(ms) do{GPT_Delay_ms(ms);}while(0) 93 | 94 | #endif 95 | #define WAIT_COND(cond,tmo,left) \ 96 | do { \ 97 | volatile u32 t = tmo; \ 98 | while (1) { \ 99 | if ((cond) || (t == 0)) break; \ 100 | if (t > 0) { mdelay(1); t--; } \ 101 | } \ 102 | left = t; \ 103 | WARN_ON(left == 0); \ 104 | }while(0) 105 | 106 | #endif /* _UTILS_H_ */ 107 | 108 | -------------------------------------------------------------------------------- /drivers/nand/bmt.h: -------------------------------------------------------------------------------- 1 | #ifndef __BMT_H__ 2 | #define __BMT_H__ 3 | 4 | #include "nand_def.h" 5 | 6 | #if defined(__PRELOADER_NAND__) 7 | 8 | #include "nand.h" 9 | 10 | #elif defined(__UBOOT_NAND__) 11 | 12 | #include 13 | #include "mtk_nand.h" 14 | 15 | #elif defined(__KERNEL_NAND__) 16 | 17 | #include 18 | #include 19 | #include "mtk_nand.h" 20 | 21 | #endif 22 | 23 | 24 | #define MAX_BMT_SIZE (0x80) 25 | #define BMT_VERSION (1) // initial version 26 | 27 | #define MAIN_SIGNATURE_OFFSET (0) 28 | #define OOB_SIGNATURE_OFFSET (1) 29 | #define OOB_INDEX_OFFSET (29) 30 | #define OOB_INDEX_SIZE (2) 31 | #define FAKE_INDEX (0xAAAA) 32 | 33 | typedef struct _bmt_entry_ 34 | { 35 | u16 bad_index; // bad block index 36 | u16 mapped_index; // mapping block index in the replace pool 37 | } bmt_entry; 38 | 39 | typedef enum 40 | { 41 | UPDATE_ERASE_FAIL, 42 | UPDATE_WRITE_FAIL, 43 | UPDATE_UNMAPPED_BLOCK, 44 | UPDATE_REASON_COUNT, 45 | } update_reason_t; 46 | 47 | typedef struct 48 | { 49 | bmt_entry table[MAX_BMT_SIZE]; 50 | u8 version; 51 | u8 mapped_count; // mapped block count in pool 52 | u8 bad_count; // bad block count in pool. Not used in V1 53 | } bmt_struct; 54 | 55 | /*************************************************************** 56 | * * 57 | * Interface BMT need to use * 58 | * * 59 | ***************************************************************/ 60 | extern bool mtk_nand_exec_read_page(struct mtd_info *mtd, u32 row, u32 page_size, u8 * dat, u8 * oob); 61 | extern int mtk_nand_block_bad_hw(struct mtd_info *mtd, loff_t ofs); 62 | extern int mtk_nand_erase_hw(struct mtd_info *mtd, int page); 63 | extern int mtk_nand_block_markbad_hw(struct mtd_info *mtd, loff_t ofs); 64 | extern int mtk_nand_exec_write_page(struct mtd_info *mtd, u32 row, u32 page_size, u8 * dat, u8 * oob); 65 | 66 | 67 | /*************************************************************** 68 | * * 69 | * Different function interface for preloader/uboot/kernel * 70 | * * 71 | ***************************************************************/ 72 | void set_bad_index_to_oob(u8 * oob, u16 index); 73 | 74 | 75 | bmt_struct *init_bmt(struct nand_chip *nand, int size); 76 | bool update_bmt(u32 offset, update_reason_t reason, u8 * dat, u8 * oob); 77 | unsigned short get_mapping_block_index(int index); 78 | 79 | #endif // #ifndef __BMT_H__ 80 | -------------------------------------------------------------------------------- /drivers/nand/nand_device_list.h: -------------------------------------------------------------------------------- 1 | #ifndef __NAND_DEVICE_LIST_H__ 2 | #define __NAND_DEVICE_LIST_H__ 3 | 4 | static const flashdev_info gen_FlashTable[]={ 5 | {0x01F1, 0x801D01, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "S34ML01G100TF", 0}, 6 | {0x92F1, 0x8095FF, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "F59L1G81A", 0}, 7 | {0xC8DA, 0x909544, 5, 8, 256, 128, 2048, 64, 0x30C77fff, "F59L2G81A", 0}, 8 | {0xC8DC, 0x909554, 5, 8, 512, 128, 2048, 64, 0x30C77fff, "F59L4G81A", 0}, 9 | {0xECD3, 0x519558, 5, 8, 1024, 128, 2048, 64, 0x44333, "K9K8G8000", 0}, 10 | {0xC2F1, 0x801DC2, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "MX30LF1G08AA", 0}, 11 | {0x2C48, 0x0026A9, 5, 8, 2048, 512, 4096, 224, 0x30C77fff, "MT29F16G08ABABA", 0}, 12 | {0x98D3, 0x902676, 5, 8, 1024, 256, 4096, 224, 0x00C25332, "TC58NVG3S0F", 0}, 13 | {0x01DA, 0x909546, 5, 8, 256, 128, 2048, 112, 0x30C77fff, "S34ML02G200TF", 0}, 14 | {0x01DC, 0x909556, 5, 8, 512, 128, 2048, 112, 0x30C77fff, "S34ML04G200TF", 0}, 15 | {0x0000, 0x000000, 0, 0, 0, 0, 0, 0, 0, "xxxxxxxxxx", 0}, 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /drivers/phy_val.h: -------------------------------------------------------------------------------- 1 | #ifndef USB_PHY_VAL_H 2 | #define USB_PHY_VAL_H 3 | 4 | struct _lp0r28 5 | { 6 | unsigned short final_link:1; 7 | unsigned short final_speed:1; 8 | unsigned short final_duplex:1; 9 | unsigned short tx_amp_save:2; 10 | unsigned short mdix_status:1; 11 | unsigned short mr_autoneg_complete:1; 12 | unsigned short reserved:1; 13 | unsigned short polarity_neg_pcs:1; 14 | unsigned short lch_descr_lock:1; 15 | unsigned short lch_linkup_mdix:1; 16 | unsigned short lch_linkup_mdi:1; 17 | unsigned short lch_linkup_10:1; 18 | unsigned short lch_linkup_100:1; 19 | unsigned short lch_rx_linkpulse:1; 20 | unsigned short lch_sig_detect:1; 21 | }; 22 | 23 | #define ProbeZfgain 0 24 | #define ProbeAgccode 1 25 | #define ProbeBoosten 2 26 | #define ProbeSnr 3 27 | #define ProbeDcoff 4 28 | #define ProbeAdcoff 5 29 | #define ProbeAdcSign 6 30 | 31 | unsigned int tcPhyReadReg(unsigned char port_num,unsigned char reg_num); 32 | unsigned int tcPhyReadLReg(unsigned char port_num,unsigned char page_num,unsigned char reg_num); 33 | void tcPhyWriteLReg(unsigned char port_num,unsigned char page_num,unsigned char reg_num,unsigned int reg_data); 34 | unsigned int tcPhyReadGReg(unsigned char port_num,unsigned char page_num,unsigned char reg_num); 35 | void tcPhyWriteGReg(unsigned char port_num,unsigned char page_num,unsigned char reg_num,unsigned int reg_data); 36 | int tc2105mlReadAdcSum(unsigned char port_num); 37 | int tc2105mlReadProbe(unsigned char port_num, unsigned char mode); 38 | void tc2105mlDispProbe100(unsigned char port_num); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /drivers/usb/host/mtk-phy-ahb.c: -------------------------------------------------------------------------------- 1 | #include "mtk-phy.h" 2 | 3 | #ifdef CONFIG_U3_PHY_AHB_SUPPORT 4 | 5 | #define os_writel(addr,data) {\ 6 | (*((volatile PHY_UINT32*)(addr)) = data);\ 7 | } 8 | #define os_readl(addr) *((volatile PHY_UINT32*)(addr)) 9 | #define os_writelmsk(addr, data, msk) \ 10 | { os_writel(addr, ((os_readl(addr) & ~(msk)) | ((data) & (msk)))); \ 11 | } 12 | #define os_setmsk(addr, msk) \ 13 | { os_writel(addr, os_readl(addr) | msk); \ 14 | } 15 | #define os_clrmsk(addr, msk) \ 16 | { os_writel(addr, os_readl(addr) &~ msk); \ 17 | } 18 | /*msk the data first, then umsk with the umsk.*/ 19 | #define os_writelmskumsk(addr, data, msk, umsk) \ 20 | {\ 21 | os_writel(addr, ((os_readl(addr) & ~(msk)) | ((data) & (msk))) & (umsk));\ 22 | } 23 | 24 | 25 | PHY_INT32 U3PhyWriteReg32(PHY_UINT32 addr, PHY_UINT32 data) 26 | { 27 | os_writel(addr, data); 28 | 29 | return 0; 30 | } 31 | 32 | PHY_INT32 U3PhyReadReg32(PHY_UINT32 addr) 33 | { 34 | return os_readl(addr); 35 | } 36 | 37 | PHY_INT32 U3PhyWriteReg8(PHY_UINT32 addr, PHY_UINT8 data) 38 | { 39 | os_writelmsk(addr&0xfffffffc, data<<((addr%4)*8), 0xff<<((addr%4)*8)); 40 | 41 | return 0; 42 | } 43 | 44 | PHY_INT8 U3PhyReadReg8(PHY_UINT32 addr) 45 | { 46 | return ((os_readl(addr)>>((addr%4)*8))&0xff); 47 | } 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /drivers/usb/host/xhci-mtk-power.h: -------------------------------------------------------------------------------- 1 | #ifndef _XHCI_MTK_POWER_H 2 | #define _XHCI_MTK_POWER_H 3 | 4 | //#include 5 | #include "xhci.h" 6 | #include "xhci-mtk.h" 7 | 8 | void enableXhciAllPortPower(struct xhci_hcor *hcor); 9 | //void enableXhciAllPortPower(struct xhci_hcd *xhci); 10 | void enableAllClockPower(void); 11 | void disablePortClockPower(void); 12 | void enablePortClockPower(int port_index, int port_rev); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /drivers/usb/host/xhci-mtk-scheduler.h: -------------------------------------------------------------------------------- 1 | #ifndef _XHCI_MTK_SCHEDULER_H 2 | #define _XHCI_MTK_SCHEDULER_H 3 | 4 | #define MTK_SCH_NEW 1 5 | 6 | #define SCH_SUCCESS 1 7 | #define SCH_FAIL 0 8 | 9 | #define MAX_EP_NUM 64 10 | #define SS_BW_BOUND 51000 11 | #define HS_BW_BOUND 6144 12 | 13 | #define USB_EP_CONTROL 0 14 | #define USB_EP_ISOC 1 15 | #define USB_EP_BULK 2 16 | #define USB_EP_INT 3 17 | 18 | #if 0 19 | #define USB_SPEED_LOW 1 20 | #define USB_SPEED_FULL 2 21 | #define USB_SPEED_HIGH 3 22 | #define USB_SPEED_SUPER 5 23 | #endif 24 | 25 | /* mtk scheduler bitmasks */ 26 | #define BPKTS(p) ((p) & 0x3f) 27 | #define BCSCOUNT(p) (((p) & 0x7) << 8) 28 | #define BBM(p) ((p) << 11) 29 | #define BOFFSET(p) ((p) & 0x3fff) 30 | #define BREPEAT(p) (((p) & 0x7fff) << 16) 31 | 32 | 33 | #if 1 34 | typedef unsigned int mtk_u32; 35 | typedef unsigned long long mtk_u64; 36 | #endif 37 | 38 | #define NULL ((void *)0) 39 | 40 | struct mtk_xhci_ep_ctx { 41 | mtk_u32 ep_info; 42 | mtk_u32 ep_info2; 43 | mtk_u64 deq; 44 | mtk_u32 tx_info; 45 | /* offset 0x14 - 0x1f reserved for HC internal use */ 46 | mtk_u32 reserved[3]; 47 | }; 48 | 49 | 50 | struct sch_ep 51 | { 52 | //device info 53 | int dev_speed; 54 | int isTT; 55 | //ep info 56 | int is_in; 57 | int ep_type; 58 | int maxp; 59 | int interval; 60 | int burst; 61 | int mult; 62 | //scheduling info 63 | int offset; 64 | int repeat; 65 | int pkts; 66 | int cs_count; 67 | int burst_mode; 68 | //other 69 | int bw_cost; //bandwidth cost in each repeat; including overhead 70 | mtk_u32 *ep; //address of usb_endpoint pointer 71 | }; 72 | 73 | int mtk_xhci_scheduler_init(void); 74 | int mtk_xhci_scheduler_add_ep(int dev_speed, int is_in, int isTT, int ep_type, int maxp, int interval, int burst 75 | , int mult, mtk_u32 *ep, mtk_u32 *ep_ctx, struct sch_ep *sch_ep); 76 | struct sch_ep * mtk_xhci_scheduler_remove_ep(int dev_speed, int is_in, int isTT, int ep_type, mtk_u32 *ep); 77 | 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /drivers/usb/host/xhci-mtk.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "xhci-mtk.h" 4 | #include "xhci.h" 5 | #include "mtk-phy.h" 6 | 7 | /* Declare global data pointer */ 8 | DECLARE_GLOBAL_DATA_PTR; 9 | 10 | /** 11 | * Contains pointers to register base addresses 12 | * for the usb controller. 13 | */ 14 | 15 | void reinitIP(void) 16 | { 17 | enableAllClockPower(); 18 | mtk_xhci_scheduler_init(); 19 | } 20 | 21 | int xhci_hcd_init(int index, struct xhci_hccr **hccr, struct xhci_hcor **hcor) 22 | { 23 | u3phy_init(); 24 | u2_slew_rate_calibration(u3phy); 25 | u2_slew_rate_calibration(u3phy_p1); 26 | 27 | mt7621_phy_init(u3phy); 28 | 29 | reinitIP(); 30 | 31 | *hccr = (uint32_t)XHC_IO_START; 32 | *hcor = (struct xhci_hcor *)((uint32_t) *hccr 33 | + HC_LENGTH(xhci_readl(&(*hccr)->cr_capbase))); 34 | 35 | debug("mtk-xhci: init hccr %x and hcor %x hc_length %d\n", 36 | (uint32_t)*hccr, (uint32_t)*hcor, 37 | (uint32_t)HC_LENGTH(xhci_readl(&(*hccr)->cr_capbase))); 38 | 39 | return 0; 40 | } 41 | 42 | void xhci_hcd_stop(int index) 43 | { 44 | disablePortClockPower(); 45 | } 46 | -------------------------------------------------------------------------------- /fs/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000, 2001 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | # 24 | 25 | SUBDIRS := jffs2 cramfs fdos fat reiserfs ext2 26 | 27 | .depend all: 28 | @for dir in $(SUBDIRS) ; do \ 29 | $(MAKE) -C $$dir $@ ; done 30 | -------------------------------------------------------------------------------- /fs/fat/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # See file CREDITS for list of people who contributed to this 4 | # project. 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License as 8 | # published by the Free Software Foundation; either version 2 of 9 | # the License, or (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 19 | # MA 02111-1307 USA 20 | # 21 | 22 | TOPDIR=../../ 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = libfat.a 27 | 28 | AOBJS = 29 | COBJS = fat.o file.o 30 | 31 | OBJS = $(AOBJS) $(COBJS) 32 | 33 | all: $(LIB) $(AOBJS) 34 | 35 | $(LIB): .depend $(OBJS) 36 | $(AR) crv $@ $(OBJS) 37 | 38 | 39 | ######################################################################### 40 | 41 | .depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) 42 | $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@ 43 | 44 | sinclude .depend 45 | 46 | ######################################################################### 47 | -------------------------------------------------------------------------------- /httpd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for http stuff 3 | # 4 | 5 | include $(TOPDIR)/config.mk 6 | 7 | LIB = libhttpd.a 8 | OBJS += uip.o uip_arch.o uip_arp.o httpd.o fs.o 9 | 10 | all: $(LIB) 11 | 12 | fs.c: fsdata.c 13 | 14 | fsdata.c: 15 | ./vendors/makefsdatac $(DEVICE_VENDOR) 16 | 17 | $(LIB): $(START) $(OBJS) 18 | $(AR) crv $@ $(OBJS) 19 | 20 | ######################################################################### 21 | 22 | .depend: Makefile $(OBJS:.o=.c) 23 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 24 | 25 | sinclude .depend 26 | 27 | ######################################################################### 28 | 29 | -------------------------------------------------------------------------------- /httpd/fsdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: fsdata.h,v 1.4.2.1 2003/10/04 22:54:06 adam Exp $ 34 | */ 35 | #ifndef __FSDATA_H__ 36 | #define __FSDATA_H__ 37 | 38 | #include "uipopt.h" 39 | 40 | struct fsdata_file { 41 | const struct fsdata_file *next; 42 | const char *name; 43 | const char *data; 44 | const int len; 45 | #ifdef FS_STATISTICS 46 | #if FS_STATISTICS == 1 47 | u16_t count; 48 | #endif /* FS_STATISTICS */ 49 | #endif /* FS_STATISTICS */ 50 | }; 51 | 52 | struct fsdata_file_noconst { 53 | struct fsdata_file *next; 54 | char *name; 55 | char *data; 56 | int len; 57 | #ifdef FS_STATISTICS 58 | #if FS_STATISTICS == 1 59 | u16_t count; 60 | #endif /* FS_STATISTICS */ 61 | #endif /* FS_STATISTICS */ 62 | }; 63 | 64 | #endif /* __FSDATA_H__ */ 65 | -------------------------------------------------------------------------------- /httpd/httpd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \addtogroup httpd 3 | * @{ 4 | */ 5 | 6 | /** 7 | * \file 8 | * HTTP server header file. 9 | * \author Adam Dunkels 10 | */ 11 | 12 | /* 13 | * Copyright (c) 2001, Adam Dunkels. 14 | * All rights reserved. 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted provided that the following conditions 18 | * are met: 19 | * 1. Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 3. The name of the author may not be used to endorse or promote 25 | * products derived from this software without specific prior 26 | * written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 29 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 31 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 32 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 36 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * This file is part of the uIP TCP/IP stack. 41 | * 42 | * $Id: httpd.h,v 1.4.2.3 2003/10/06 22:56:44 adam Exp $ 43 | * 44 | */ 45 | 46 | #ifndef __HTTPD_H__ 47 | #define __HTTPD_H__ 48 | 49 | void httpd_init(void); 50 | void httpd_appcall(void); 51 | 52 | /* UIP_APPCALL: the name of the application function. This function 53 | must return void and take no arguments (i.e., C type "void 54 | appfunc(void)"). */ 55 | #ifndef UIP_APPCALL 56 | #define UIP_APPCALL httpd_appcall 57 | #endif 58 | 59 | struct httpd_state { 60 | u8_t state; 61 | u16_t count; 62 | u8_t *dataptr; 63 | unsigned int upload; 64 | unsigned int upload_total; 65 | }; 66 | 67 | /* UIP_APPSTATE_SIZE: The size of the application-specific state 68 | stored in the uip_conn structure. */ 69 | #ifndef UIP_APPSTATE_SIZE 70 | #define UIP_APPSTATE_SIZE (sizeof(struct httpd_state)) 71 | #endif 72 | 73 | //#define FS_STATISTICS 1 74 | 75 | extern struct httpd_state *hs; 76 | 77 | #endif /* __HTTPD_H__ */ 78 | -------------------------------------------------------------------------------- /httpd/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003, Adam Dunkels. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote 14 | * products derived from this software without specific prior 15 | * written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 18 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 23 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * This file is part of the uIP TCP/IP stack. 30 | * 31 | * $Id: main.c,v 1.10.2.1 2003/10/04 22:54:17 adam Exp $ 32 | * 33 | */ 34 | 35 | 36 | #include "uip.h" 37 | #include "uip_arp.h" 38 | #include "tapdev.h" 39 | #include "httpd.h" 40 | 41 | #define BUF ((struct uip_eth_hdr *)&uip_buf[0]) 42 | 43 | #ifndef NULL 44 | #define NULL (void *)0 45 | #endif /* NULL */ 46 | 47 | /*-----------------------------------------------------------------------------------*/ 48 | int 49 | main(void) 50 | { 51 | u8_t i, arptimer; 52 | tapdev_init(); 53 | uip_init(); 54 | httpd_init(); 55 | arptimer = 0; 56 | while(1) { 57 | uip_len = tapdev_read(); 58 | if(uip_len == 0) { 59 | for(i = 0; i < UIP_CONNS; i++) { 60 | uip_periodic(i); 61 | if(uip_len > 0) { 62 | uip_arp_out(); 63 | tapdev_send(); 64 | } 65 | } 66 | 67 | if(++arptimer == 20) { 68 | uip_arp_timer(); 69 | arptimer = 0; 70 | } 71 | } else { 72 | if(BUF->type == htons(UIP_ETHTYPE_IP)) { 73 | uip_arp_ipin(); 74 | uip_input(); 75 | if(uip_len > 0) { 76 | uip_arp_out(); 77 | tapdev_send(); 78 | } 79 | } else if(BUF->type == htons(UIP_ETHTYPE_ARP)) { 80 | uip_arp_arpin(); 81 | if(uip_len > 0) { 82 | tapdev_send(); 83 | } 84 | } 85 | } 86 | } 87 | return 0; 88 | } 89 | -------------------------------------------------------------------------------- /httpd/tapdev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Adam Dunkels. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote 14 | * products derived from this software without specific prior 15 | * written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 18 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 23 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * This file is part of the uIP TCP/IP stack. 30 | * 31 | * $Id: tapdev.h,v 1.1.2.1 2003/10/04 22:54:17 adam Exp $ 32 | * 33 | */ 34 | 35 | #ifndef __TAPDEV_H__ 36 | #define __TAPDEV_H__ 37 | 38 | void tapdev_init(void); 39 | unsigned int tapdev_read(void); 40 | void tapdev_send(void); 41 | 42 | #endif /* __TAPDEV_H__ */ 43 | -------------------------------------------------------------------------------- /httpd/vendors/HI-WOOYA/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Page not found 6 | 7 | 8 | 9 | 10 |
11 |
12 |

Page not found

13 |

The page you were looking for doesn't exist!
Go back to firmware update page.

14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /httpd/vendors/HI-WOOYA/fail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update failed 6 | 7 | 8 | 9 | 10 |
11 |
12 |

Update failed

13 |

Please, try again or contact with the author of this modification.
You can also get more information during update in U-Boot console.

14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /httpd/vendors/HI-WOOYA/flashing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update in progress 6 | 9 | 10 | 11 |
12 |

Update in progress

13 |

Your file was successfully uploaded! Update is in progress and you should wait for automatic reset of the device.
Update time depends on image size and may take up to a few minutes. You can close this page.

14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /httpd/vendors/HI-WOOYA/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HI-WOOYA Update 6 | 7 | 8 | 9 |
10 |
11 |

Update for HI-WOOYA V1.0.6

12 |

Don't power off the device during update, if everything goes well, the device will restart.

13 |
14 |

U-Boot is very important,please be sure to update this device!!!

15 |
16 |

ART/factory is very important!

17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /httpd/vendors/HI-WOOYA/style.css: -------------------------------------------------------------------------------- 1 | h1, 2 | p, 3 | form, 4 | body { 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | html, 10 | body { 11 | font: 13px/20px Tahoma, sans-serif; 12 | background: #5a4a42; 13 | color: #FFF; 14 | text-align: center; 15 | height: 100%; 16 | } 17 | 18 | #m, #h { 19 | padding: 30px 0; 20 | } 21 | 22 | #h { 23 | background: #FFF; 24 | } 25 | 26 | #m > * { 27 | padding: 20px; 28 | } 29 | 30 | #f { 31 | font-size: 11px; 32 | position: absolute; 33 | bottom: 0; 34 | width: 100%; 35 | padding: 15px 0; 36 | } 37 | 38 | a { 39 | color: #FEDD12; 40 | text-decoration: none; 41 | } 42 | 43 | h1 { 44 | font: bold 40px/40px Arial; 45 | } 46 | 47 | .red { 48 | color: #ED0000; 49 | } -------------------------------------------------------------------------------- /httpd/vendors/HI-WOOYA/vt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi-wooya/u-boot-hiwooya/b1bc29ee5395d739fb640ca6bfcb787358ed91a3/httpd/vendors/HI-WOOYA/vt.png -------------------------------------------------------------------------------- /httpd/vendors/yuicompressor-2.4.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi-wooya/u-boot-hiwooya/b1bc29ee5395d739fb640ca6bfcb787358ed91a3/httpd/vendors/yuicompressor-2.4.8.jar -------------------------------------------------------------------------------- /include/_exports.h: -------------------------------------------------------------------------------- 1 | EXPORT_FUNC(get_version) 2 | EXPORT_FUNC(getc) 3 | EXPORT_FUNC(tstc) 4 | EXPORT_FUNC(putc) 5 | EXPORT_FUNC(puts) 6 | EXPORT_FUNC(printf) 7 | EXPORT_FUNC(install_hdlr) 8 | EXPORT_FUNC(free_hdlr) 9 | EXPORT_FUNC(malloc) 10 | EXPORT_FUNC(free) 11 | EXPORT_FUNC(udelay) 12 | EXPORT_FUNC(get_timer) 13 | EXPORT_FUNC(vprintf) 14 | EXPORT_FUNC(do_reset) 15 | -------------------------------------------------------------------------------- /include/asm-mips/addrspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is subject to the terms and conditions of the GNU General Public 3 | * License. See the file "COPYING" in the main directory of this archive 4 | * for more details. 5 | * 6 | * Copyright (C) 1996 by Ralf Baechle 7 | * Copyright (C) 2000 by Maciej W. Rozycki 8 | * 9 | * Defitions for the address spaces of the MIPS CPUs. 10 | */ 11 | #ifndef __ASM_MIPS_ADDRSPACE_H 12 | #define __ASM_MIPS_ADDRSPACE_H 13 | 14 | /* 15 | * Memory segments (32bit kernel mode addresses) 16 | */ 17 | #define KUSEG 0x00000000 18 | #define KSEG0 0x80000000 19 | #define KSEG1 0xa0000000 20 | #define KSEG2 0xc0000000 21 | #define KSEG3 0xe0000000 22 | 23 | #define K0BASE KSEG0 24 | 25 | /* 26 | * Returns the kernel segment base of a given address 27 | */ 28 | #ifndef __ASSEMBLY__ 29 | #define KSEGX(a) (((unsigned long)(a)) & 0xe0000000) 30 | #else 31 | #define KSEGX(a) ((a) & 0xe0000000) 32 | #endif 33 | 34 | /* 35 | * Returns the physical address of a KSEG0/KSEG1 address 36 | */ 37 | #ifndef __ASSEMBLY__ 38 | #define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff) 39 | #else 40 | #define PHYSADDR(a) ((a) & 0x1fffffff) 41 | #endif 42 | 43 | /* 44 | * Returns the uncached address of a sdram address 45 | */ 46 | #ifndef __ASSEMBLY__ 47 | #if defined(CONFIG_AU1X00) || defined(CONFIG_TB0229) 48 | /* We use a 36 bit physical address map here and 49 | cannot access physical memory directly from core */ 50 | #define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x20000000) 51 | #else /* !CONFIG_AU1X00 */ 52 | #define UNCACHED_SDRAM(a) PHYSADDR(a) 53 | #endif /* CONFIG_AU1X00 */ 54 | #endif /* __ASSEMBLY__ */ 55 | /* 56 | * Map an address to a certain kernel segment 57 | */ 58 | #ifndef __ASSEMBLY__ 59 | #define KSEG0ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG0)) 60 | #define KSEG1ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG1)) 61 | #define KSEG2ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG2)) 62 | #define KSEG3ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG3)) 63 | #else 64 | #define KSEG0ADDR(a) (((a) & 0x1fffffff) | KSEG0) 65 | #define KSEG1ADDR(a) (((a) & 0x1fffffff) | KSEG1) 66 | #define KSEG2ADDR(a) (((a) & 0x1fffffff) | KSEG2) 67 | #define KSEG3ADDR(a) (((a) & 0x1fffffff) | KSEG3) 68 | #endif 69 | 70 | /* 71 | * Memory segments (64bit kernel mode addresses) 72 | */ 73 | #define XKUSEG 0x0000000000000000 74 | #define XKSSEG 0x4000000000000000 75 | #define XKPHYS 0x8000000000000000 76 | #define XKSEG 0xc000000000000000 77 | #define CKSEG0 0xffffffff80000000 78 | #define CKSEG1 0xffffffffa0000000 79 | #define CKSSEG 0xffffffffc0000000 80 | #define CKSEG3 0xffffffffe0000000 81 | 82 | #endif /* __ASM_MIPS_ADDRSPACE_H */ 83 | -------------------------------------------------------------------------------- /include/asm-mips/byteorder.h: -------------------------------------------------------------------------------- 1 | /* $Id: //WIFI_SOC/MP/SDK_4_3_0_0/Uboot/include/asm-mips/byteorder.h#1 $ 2 | * 3 | * This file is subject to the terms and conditions of the GNU General Public 4 | * License. See the file "COPYING" in the main directory of this archive 5 | * for more details. 6 | * 7 | * Copyright (C) by Ralf Baechle 8 | */ 9 | #ifndef _MIPS_BYTEORDER_H 10 | #define _MIPS_BYTEORDER_H 11 | 12 | #include 13 | 14 | #ifdef __GNUC__ 15 | 16 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) 17 | # define __BYTEORDER_HAS_U64__ 18 | # define __SWAB_64_THRU_32__ 19 | #endif 20 | 21 | #endif /* __GNUC__ */ 22 | 23 | #if defined (__MIPSEB__) 24 | # include 25 | #elif defined (__MIPSEL__) 26 | # include 27 | #else 28 | # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" 29 | #endif 30 | 31 | #endif /* _MIPS_BYTEORDER_H */ 32 | -------------------------------------------------------------------------------- /include/asm-mips/cachectl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cachectl.h -- defines for MIPS cache control system calls 3 | * 4 | * Copyright (C) 1994, 1995, 1996 by Ralf Baechle 5 | */ 6 | #ifndef __ASM_MIPS_CACHECTL 7 | #define __ASM_MIPS_CACHECTL 8 | 9 | /* 10 | * Options for cacheflush system call 11 | */ 12 | #define ICACHE (1<<0) /* flush instruction cache */ 13 | #define DCACHE (1<<1) /* writeback and flush data cache */ 14 | #define BCACHE (ICACHE|DCACHE) /* flush both caches */ 15 | 16 | /* 17 | * Caching modes for the cachectl(2) call 18 | * 19 | * cachectl(2) is currently not supported and returns ENOSYS. 20 | */ 21 | #define CACHEABLE 0 /* make pages cacheable */ 22 | #define UNCACHEABLE 1 /* make pages uncacheable */ 23 | 24 | #endif /* __ASM_MIPS_CACHECTL */ 25 | -------------------------------------------------------------------------------- /include/asm-mips/cacheops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Cache operations for the cache instruction. 3 | * 4 | * This file is subject to the terms and conditions of the GNU General Public 5 | * License. See the file "COPYING" in the main directory of this archive 6 | * for more details. 7 | * 8 | * (C) Copyright 1996, 1997 by Ralf Baechle 9 | */ 10 | #ifndef __ASM_MIPS_CACHEOPS_H 11 | #define __ASM_MIPS_CACHEOPS_H 12 | 13 | /* 14 | * Cache Operations 15 | */ 16 | #define Index_Invalidate_I 0x00 17 | #define Index_Writeback_Inv_D 0x01 18 | #define Index_Invalidate_SI 0x02 19 | #define Index_Writeback_Inv_SD 0x03 20 | #define Index_Load_Tag_I 0x04 21 | #define Index_Load_Tag_D 0x05 22 | #define Index_Load_Tag_SI 0x06 23 | #define Index_Load_Tag_SD 0x07 24 | #define Index_Store_Tag_I 0x08 25 | #define Index_Store_Tag_D 0x09 26 | #define Index_Store_Tag_SI 0x0A 27 | #define Index_Store_Tag_SD 0x0B 28 | #define Create_Dirty_Excl_D 0x0d 29 | #define Create_Dirty_Excl_SD 0x0f 30 | #define Hit_Invalidate_I 0x10 31 | #define Hit_Invalidate_D 0x11 32 | #define Hit_Invalidate_SI 0x12 33 | #define Hit_Invalidate_SD 0x13 34 | #define Fill 0x14 35 | #define Hit_Writeback_Inv_D 0x15 36 | /* 0x16 is unused */ 37 | #define Hit_Writeback_Inv_SD 0x17 38 | #define Hit_Writeback_I 0x18 39 | #define Hit_Writeback_D 0x19 40 | /* 0x1a is unused */ 41 | #define Hit_Writeback_SD 0x1b 42 | /* 0x1c is unused */ 43 | /* 0x1e is unused */ 44 | #define Hit_Set_Virtual_SI 0x1e 45 | #define Hit_Set_Virtual_SD 0x1f 46 | 47 | /* 48 | * Cache Operations available on all MIPS processors with R4000-style caches 49 | */ 50 | #define INDEX_INVALIDATE_I 0x00 51 | #define INDEX_WRITEBACK_INV_D 0x01 52 | #define INDEX_LOAD_TAG_I 0x04 53 | #define INDEX_LOAD_TAG_D 0x05 54 | #define INDEX_STORE_TAG_I 0x08 55 | #define INDEX_STORE_TAG_D 0x09 56 | #if defined(CONFIG_CPU_LOONGSON2) 57 | #define HIT_INVALIDATE_I 0x00 58 | #else 59 | #define HIT_INVALIDATE_I 0x10 60 | #endif 61 | #define HIT_INVALIDATE_D 0x11 62 | #define HIT_WRITEBACK_INV_D 0x15 63 | 64 | /* 65 | * R4000-specific cacheops 66 | */ 67 | #define CREATE_DIRTY_EXCL_D 0x0d 68 | #define FILL 0x14 69 | #define HIT_WRITEBACK_I 0x18 70 | #define HIT_WRITEBACK_D 0x19 71 | 72 | #endif /* __ASM_MIPS_CACHEOPS_H */ 73 | -------------------------------------------------------------------------------- /include/asm-mips/global_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2002-2003 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #ifndef __ASM_GBL_DATA_H 25 | #define __ASM_GBL_DATA_H 26 | 27 | #include 28 | 29 | /* 30 | * The following data structure is placed in some memory wich is 31 | * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or 32 | * some locked parts of the data cache) to allow for a minimum set of 33 | * global variables during system initialization (until we have set 34 | * up the memory controller so that we can use RAM). 35 | * 36 | * Keep it *SMALL* and remember to set CFG_GBL_DATA_SIZE > sizeof(gd_t) 37 | */ 38 | 39 | typedef struct global_data { 40 | bd_t *bd; 41 | unsigned long flags; 42 | unsigned long baudrate; 43 | unsigned long have_console; /* serial_init() was called */ 44 | unsigned long ram_size; /* RAM size */ 45 | unsigned long reloc_off; /* Relocation Offset */ 46 | unsigned long env_addr; /* Address of Environment struct */ 47 | unsigned long env_valid; /* Checksum of Environment valid? */ 48 | void **jt; /* jump table */ 49 | } gd_t; 50 | 51 | /* 52 | * Global Data Flags 53 | */ 54 | #define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */ 55 | #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */ 56 | #define GD_FLG_SILENT 0x00004 /* Silent mode */ 57 | 58 | #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("k0") 59 | 60 | #endif /* __ASM_GBL_DATA_H */ 61 | -------------------------------------------------------------------------------- /include/asm-mips/inca-ip.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi-wooya/u-boot-hiwooya/b1bc29ee5395d739fb640ca6bfcb787358ed91a3/include/asm-mips/inca-ip.h -------------------------------------------------------------------------------- /include/asm-mips/isadep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Various ISA level dependant constants. 3 | * Most of the following constants reflect the different layout 4 | * of Coprocessor 0 registers. 5 | * 6 | * Copyright (c) 1998 Harald Koerfgen 7 | */ 8 | #include 9 | 10 | #ifndef __ASM_ISADEP_H 11 | #define __ASM_ISADEP_H 12 | 13 | #if defined(CONFIG_CPU_R3000) 14 | /* 15 | * R2000 or R3000 16 | */ 17 | 18 | /* 19 | * kernel or user mode? (CP0_STATUS) 20 | */ 21 | #define KU_MASK 0x08 22 | #define KU_USER 0x08 23 | #define KU_KERN 0x00 24 | 25 | #else 26 | /* 27 | * kernel or user mode? 28 | */ 29 | #define KU_MASK 0x18 30 | #define KU_USER 0x10 31 | #define KU_KERN 0x00 32 | 33 | #endif 34 | 35 | #endif /* __ASM_ISADEP_H */ 36 | -------------------------------------------------------------------------------- /include/asm-mips/ptrace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is subject to the terms and conditions of the GNU General Public 3 | * License. See the file "COPYING" in the main directory of this archive 4 | * for more details. 5 | * 6 | * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle 7 | * 8 | * Machine dependent structs and defines to help the user use 9 | * the ptrace system call. 10 | */ 11 | #ifndef _ASM_PTRACE_H 12 | #define _ASM_PTRACE_H 13 | 14 | #include 15 | #include 16 | 17 | /* 0 - 31 are integer registers, 32 - 63 are fp registers. */ 18 | #define FPR_BASE 32 19 | #define PC 64 20 | #define CAUSE 65 21 | #define BADVADDR 66 22 | #define MMHI 67 23 | #define MMLO 68 24 | #define FPC_CSR 69 25 | #define FPC_EIR 70 26 | 27 | #ifndef _LANGUAGE_ASSEMBLY 28 | /* 29 | * This struct defines the way the registers are stored on the stack during a 30 | * system call/exception. As usual the registers k0/k1 aren't being saved. 31 | */ 32 | struct pt_regs { 33 | /* Pad bytes for argument save space on the stack. */ 34 | unsigned long pad0[6]; 35 | 36 | /* Saved main processor registers. */ 37 | unsigned long regs[32]; 38 | 39 | /* Other saved registers. */ 40 | unsigned long lo; 41 | unsigned long hi; 42 | 43 | /* 44 | * saved cp0 registers 45 | */ 46 | unsigned long cp0_epc; 47 | unsigned long cp0_badvaddr; 48 | unsigned long cp0_status; 49 | unsigned long cp0_cause; 50 | }; 51 | 52 | #endif /* !(_LANGUAGE_ASSEMBLY) */ 53 | 54 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 55 | /* #define PTRACE_GETREGS 12 */ 56 | /* #define PTRACE_SETREGS 13 */ 57 | /* #define PTRACE_GETFPREGS 14 */ 58 | /* #define PTRACE_SETFPREGS 15 */ 59 | /* #define PTRACE_GETFPXREGS 18 */ 60 | /* #define PTRACE_SETFPXREGS 19 */ 61 | 62 | #define PTRACE_SETOPTIONS 21 63 | 64 | /* options set using PTRACE_SETOPTIONS */ 65 | #define PTRACE_O_TRACESYSGOOD 0x00000001 66 | 67 | #if 0 /* def _LANGUAGE_ASSEMBLY */ 68 | #include 69 | #endif 70 | 71 | #ifdef __KERNEL__ 72 | 73 | #ifndef _LANGUAGE_ASSEMBLY 74 | /* 75 | * Does the process account for user or for system time? 76 | */ 77 | #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER) 78 | 79 | #define instruction_pointer(regs) ((regs)->cp0_epc) 80 | 81 | extern void show_regs(struct pt_regs *); 82 | #endif /* !(_LANGUAGE_ASSEMBLY) */ 83 | 84 | #endif 85 | 86 | #endif /* _ASM_PTRACE_H */ 87 | -------------------------------------------------------------------------------- /include/asm-mips/reg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Various register offset definitions for debuggers, core file 3 | * examiners and whatnot. 4 | * 5 | * This file is subject to the terms and conditions of the GNU General Public 6 | * License. See the file "COPYING" in the main directory of this archive 7 | * for more details. 8 | * 9 | * Copyright (C) 1995, 1999 by Ralf Baechle 10 | */ 11 | #ifndef __ASM_MIPS_REG_H 12 | #define __ASM_MIPS_REG_H 13 | 14 | /* 15 | * This defines/structures correspond to the register layout on stack - 16 | * if the order here is changed, it needs to be updated in 17 | * include/asm-mips/stackframe.h 18 | */ 19 | #define EF_REG0 6 20 | #define EF_REG1 7 21 | #define EF_REG2 8 22 | #define EF_REG3 9 23 | #define EF_REG4 10 24 | #define EF_REG5 11 25 | #define EF_REG6 12 26 | #define EF_REG7 13 27 | #define EF_REG8 14 28 | #define EF_REG9 15 29 | #define EF_REG10 16 30 | #define EF_REG11 17 31 | #define EF_REG12 18 32 | #define EF_REG13 19 33 | #define EF_REG14 20 34 | #define EF_REG15 21 35 | #define EF_REG16 22 36 | #define EF_REG17 23 37 | #define EF_REG18 24 38 | #define EF_REG19 25 39 | #define EF_REG20 26 40 | #define EF_REG21 27 41 | #define EF_REG22 28 42 | #define EF_REG23 29 43 | #define EF_REG24 30 44 | #define EF_REG25 31 45 | /* 46 | * k0/k1 unsaved 47 | */ 48 | #define EF_REG28 34 49 | #define EF_REG29 35 50 | #define EF_REG30 36 51 | #define EF_REG31 37 52 | 53 | /* 54 | * Saved special registers 55 | */ 56 | #define EF_LO 38 57 | #define EF_HI 39 58 | 59 | #define EF_CP0_EPC 40 60 | #define EF_CP0_BADVADDR 41 61 | #define EF_CP0_STATUS 42 62 | #define EF_CP0_CAUSE 44 63 | 64 | #define EF_SIZE 180 /* size in bytes */ 65 | 66 | #endif /* __ASM_MIPS_REG_H */ 67 | -------------------------------------------------------------------------------- /include/asm-mips/regdef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * include/asm-mips/regdefs.h 3 | * 4 | * This file is subject to the terms and conditions of the GNU General Public 5 | * License. See the file "COPYING" in the main directory of this archive 6 | * for more details. 7 | * 8 | * Copyright (C) 1994, 1995 by Ralf Baechle 9 | */ 10 | 11 | #ifndef __ASM_MIPS_REGDEF_H 12 | #define __ASM_MIPS_REGDEF_H 13 | 14 | /* 15 | * Symbolic register names for 32 bit ABI 16 | */ 17 | #define zero $0 /* wired zero */ 18 | #define AT $1 /* assembler temp - uppercase because of ".set at" */ 19 | #define v0 $2 /* return value */ 20 | #define v1 $3 21 | #define a0 $4 /* argument registers */ 22 | #define a1 $5 23 | #define a2 $6 24 | #define a3 $7 25 | #define t0 $8 /* caller saved */ 26 | #define t1 $9 27 | #define t2 $10 28 | #define t3 $11 29 | #define t4 $12 30 | #define t5 $13 31 | #define t6 $14 32 | #define t7 $15 33 | #define s0 $16 /* callee saved */ 34 | #define s1 $17 35 | #define s2 $18 36 | #define s3 $19 37 | #define s4 $20 38 | #define s5 $21 39 | #define s6 $22 40 | #define s7 $23 41 | #define t8 $24 /* caller saved */ 42 | #define t9 $25 43 | #define jp $25 /* PIC jump register */ 44 | #define k0 $26 /* kernel scratch */ 45 | #define k1 $27 46 | #define gp $28 /* global pointer */ 47 | #define sp $29 /* stack pointer */ 48 | #define fp $30 /* frame pointer */ 49 | #define s8 $30 /* same like fp! */ 50 | #define ra $31 /* return address */ 51 | 52 | #endif /* __ASM_MIPS_REGDEF_H */ 53 | -------------------------------------------------------------------------------- /include/asm-mips/sgidefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is subject to the terms and conditions of the GNU General Public 3 | * License. See the file "COPYING" in the main directory of this archive 4 | * for more details. 5 | * 6 | * Copyright (C) 1996, 1999, 2001 Ralf Baechle 7 | * Copyright (C) 1999 Silicon Graphics, Inc. 8 | * Copyright (C) 2001 MIPS Technologies, Inc. 9 | */ 10 | #ifndef __ASM_SGIDEFS_H 11 | #define __ASM_SGIDEFS_H 12 | 13 | /* 14 | * Using a Linux compiler for building Linux seems logic but not to 15 | * everybody. 16 | */ 17 | #if 0 /* ndef __linux__ */ 18 | #error Use a Linux compiler or give up. 19 | #endif 20 | 21 | /* 22 | * Definitions for the ISA levels 23 | * 24 | * With the introduction of MIPS32 / MIPS64 instruction sets definitions 25 | * MIPS ISAs are no longer subsets of each other. Therefore comparisons 26 | * on these symbols except with == may result in unexpected results and 27 | * are forbidden! 28 | */ 29 | #define _MIPS_ISA_MIPS1 1 30 | #define _MIPS_ISA_MIPS2 2 31 | #define _MIPS_ISA_MIPS3 3 32 | #define _MIPS_ISA_MIPS4 4 33 | #define _MIPS_ISA_MIPS5 5 34 | #define _MIPS_ISA_MIPS32 6 35 | #define _MIPS_ISA_MIPS64 7 36 | 37 | /* 38 | * Subprogram calling convention 39 | */ 40 | #define _MIPS_SIM_ABI32 1 41 | #define _MIPS_SIM_NABI32 2 42 | #define _MIPS_SIM_ABI64 3 43 | 44 | #endif /* __ASM_SGIDEFS_H */ 45 | -------------------------------------------------------------------------------- /include/asm-mips/types.h: -------------------------------------------------------------------------------- 1 | /* $Id: //WIFI_SOC/MP/SDK_4_3_0_0/Uboot/include/asm-mips/types.h#1 $ 2 | * 3 | * This file is subject to the terms and conditions of the GNU General Public 4 | * License. See the file "COPYING" in the main directory of this archive 5 | * for more details. 6 | * 7 | * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle 8 | * Copyright (C) 1999 Silicon Graphics, Inc. 9 | */ 10 | #ifndef _ASM_TYPES_H 11 | #define _ASM_TYPES_H 12 | 13 | typedef unsigned short umode_t; 14 | 15 | /* 16 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the 17 | * header files exported to user space 18 | */ 19 | 20 | typedef __signed__ char __s8; 21 | typedef unsigned char __u8; 22 | 23 | typedef __signed__ short __s16; 24 | typedef unsigned short __u16; 25 | 26 | typedef __signed__ int __s32; 27 | typedef unsigned int __u32; 28 | 29 | #if (_MIPS_SZLONG == 64) 30 | 31 | typedef __signed__ long __s64; 32 | typedef unsigned long __u64; 33 | 34 | #else 35 | 36 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 37 | typedef __signed__ long long __s64; 38 | typedef unsigned long long __u64; 39 | #endif 40 | 41 | #endif 42 | 43 | /* 44 | * These aren't exported outside the kernel to avoid name space clashes 45 | */ 46 | #ifdef __KERNEL__ 47 | 48 | typedef __signed char s8; 49 | typedef unsigned char u8; 50 | 51 | typedef __signed short s16; 52 | typedef unsigned short u16; 53 | 54 | typedef __signed int s32; 55 | typedef unsigned int u32; 56 | 57 | #if (_MIPS_SZLONG == 64) 58 | 59 | typedef __signed__ long s64; 60 | typedef unsigned long u64; 61 | 62 | #else 63 | 64 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 65 | typedef __signed__ long long s64; 66 | typedef unsigned long long u64; 67 | #endif 68 | 69 | #endif 70 | 71 | #define BITS_PER_LONG _MIPS_SZLONG 72 | 73 | typedef unsigned long dma_addr_t; 74 | 75 | #endif /* __KERNEL__ */ 76 | 77 | #endif /* _ASM_TYPES_H */ 78 | -------------------------------------------------------------------------------- /include/asm-mips/u-boot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Wolfgang Denk, DENX Software Engineering, 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #ifndef _U_BOOT_H_ 25 | #define _U_BOOT_H_ 1 26 | 27 | typedef struct bd_info { 28 | int bi_baudrate; /* serial console baudrate */ 29 | unsigned long bi_ip_addr; /* IP Address */ 30 | unsigned char bi_enetaddr[6]; /* Ethernet adress */ 31 | unsigned long bi_arch_number; /* unique id for this board */ 32 | unsigned long bi_boot_params; /* where this board expects params */ 33 | unsigned long bi_memstart; /* start of DRAM memory */ 34 | unsigned long bi_memsize; /* size of DRAM memory in bytes */ 35 | unsigned long bi_flashstart; /* start of FLASH memory */ 36 | unsigned long bi_flashsize; /* size of FLASH memory */ 37 | unsigned long bi_flashoffset; /* reserved area for startup monitor */ 38 | } bd_t; 39 | #define bi_env_data bi_env->data 40 | #define bi_env_crc bi_env->crc 41 | 42 | #endif /* _U_BOOT_H_ */ 43 | -------------------------------------------------------------------------------- /include/asm/addrspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is subject to the terms and conditions of the GNU General Public 3 | * License. See the file "COPYING" in the main directory of this archive 4 | * for more details. 5 | * 6 | * Copyright (C) 1996 by Ralf Baechle 7 | * Copyright (C) 2000 by Maciej W. Rozycki 8 | * 9 | * Defitions for the address spaces of the MIPS CPUs. 10 | */ 11 | #ifndef __ASM_MIPS_ADDRSPACE_H 12 | #define __ASM_MIPS_ADDRSPACE_H 13 | 14 | /* 15 | * Memory segments (32bit kernel mode addresses) 16 | */ 17 | #define KUSEG 0x00000000 18 | #define KSEG0 0x80000000 19 | #define KSEG1 0xa0000000 20 | #define KSEG2 0xc0000000 21 | #define KSEG3 0xe0000000 22 | 23 | #define K0BASE KSEG0 24 | 25 | /* 26 | * Returns the kernel segment base of a given address 27 | */ 28 | #ifndef __ASSEMBLY__ 29 | #define KSEGX(a) (((unsigned long)(a)) & 0xe0000000) 30 | #else 31 | #define KSEGX(a) ((a) & 0xe0000000) 32 | #endif 33 | 34 | /* 35 | * Returns the physical address of a KSEG0/KSEG1 address 36 | */ 37 | #ifndef __ASSEMBLY__ 38 | #define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff) 39 | #else 40 | #define PHYSADDR(a) ((a) & 0x1fffffff) 41 | #endif 42 | 43 | /* 44 | * Returns the uncached address of a sdram address 45 | */ 46 | #ifndef __ASSEMBLY__ 47 | #if defined(CONFIG_AU1X00) || defined(CONFIG_TB0229) 48 | /* We use a 36 bit physical address map here and 49 | cannot access physical memory directly from core */ 50 | #define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x20000000) 51 | #else /* !CONFIG_AU1X00 */ 52 | #define UNCACHED_SDRAM(a) PHYSADDR(a) 53 | #endif /* CONFIG_AU1X00 */ 54 | #endif /* __ASSEMBLY__ */ 55 | /* 56 | * Map an address to a certain kernel segment 57 | */ 58 | #ifndef __ASSEMBLY__ 59 | #define KSEG0ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG0)) 60 | #define KSEG1ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG1)) 61 | #define KSEG2ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG2)) 62 | #define KSEG3ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG3)) 63 | #else 64 | #define KSEG0ADDR(a) (((a) & 0x1fffffff) | KSEG0) 65 | #define KSEG1ADDR(a) (((a) & 0x1fffffff) | KSEG1) 66 | #define KSEG2ADDR(a) (((a) & 0x1fffffff) | KSEG2) 67 | #define KSEG3ADDR(a) (((a) & 0x1fffffff) | KSEG3) 68 | #endif 69 | 70 | /* 71 | * Memory segments (64bit kernel mode addresses) 72 | */ 73 | #define XKUSEG 0x0000000000000000 74 | #define XKSSEG 0x4000000000000000 75 | #define XKPHYS 0x8000000000000000 76 | #define XKSEG 0xc000000000000000 77 | #define CKSEG0 0xffffffff80000000 78 | #define CKSEG1 0xffffffffa0000000 79 | #define CKSSEG 0xffffffffc0000000 80 | #define CKSEG3 0xffffffffe0000000 81 | 82 | #endif /* __ASM_MIPS_ADDRSPACE_H */ 83 | -------------------------------------------------------------------------------- /include/asm/byteorder.h: -------------------------------------------------------------------------------- 1 | /* $Id: //WIFI_SOC/MP/SDK_4_3_0_0/Uboot/include/asm/byteorder.h#1 $ 2 | * 3 | * This file is subject to the terms and conditions of the GNU General Public 4 | * License. See the file "COPYING" in the main directory of this archive 5 | * for more details. 6 | * 7 | * Copyright (C) by Ralf Baechle 8 | */ 9 | #ifndef _MIPS_BYTEORDER_H 10 | #define _MIPS_BYTEORDER_H 11 | 12 | #include 13 | 14 | #ifdef __GNUC__ 15 | 16 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) 17 | # define __BYTEORDER_HAS_U64__ 18 | # define __SWAB_64_THRU_32__ 19 | #endif 20 | 21 | #endif /* __GNUC__ */ 22 | 23 | #if defined (__MIPSEB__) 24 | # include 25 | #elif defined (__MIPSEL__) 26 | # include 27 | #else 28 | # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" 29 | #endif 30 | 31 | #endif /* _MIPS_BYTEORDER_H */ 32 | -------------------------------------------------------------------------------- /include/asm/cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The Chromium OS Authors. 3 | * 4 | * SPDX-License-Identifier: GPL-2.0+ 5 | */ 6 | 7 | #ifndef __MIPS_CACHE_H__ 8 | #define __MIPS_CACHE_H__ 9 | 10 | #define CONFIG_SYS_CACHELINE_SIZE 32 11 | 12 | /* 13 | * The maximum L1 data cache line size on MIPS seems to be 128 bytes. We use 14 | * that as a default for aligning DMA buffers unless the board config has 15 | * specified another cache line size. 16 | */ 17 | #ifdef CONFIG_SYS_CACHELINE_SIZE 18 | #define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE 19 | #else 20 | #define ARCH_DMA_MINALIGN 128 21 | #endif 22 | 23 | #endif /* __MIPS_CACHE_H__ */ 24 | -------------------------------------------------------------------------------- /include/asm/cachectl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cachectl.h -- defines for MIPS cache control system calls 3 | * 4 | * Copyright (C) 1994, 1995, 1996 by Ralf Baechle 5 | */ 6 | #ifndef __ASM_MIPS_CACHECTL 7 | #define __ASM_MIPS_CACHECTL 8 | 9 | /* 10 | * Options for cacheflush system call 11 | */ 12 | #define ICACHE (1<<0) /* flush instruction cache */ 13 | #define DCACHE (1<<1) /* writeback and flush data cache */ 14 | #define BCACHE (ICACHE|DCACHE) /* flush both caches */ 15 | 16 | /* 17 | * Caching modes for the cachectl(2) call 18 | * 19 | * cachectl(2) is currently not supported and returns ENOSYS. 20 | */ 21 | #define CACHEABLE 0 /* make pages cacheable */ 22 | #define UNCACHEABLE 1 /* make pages uncacheable */ 23 | 24 | #endif /* __ASM_MIPS_CACHECTL */ 25 | -------------------------------------------------------------------------------- /include/asm/cacheops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Cache operations for the cache instruction. 3 | * 4 | * This file is subject to the terms and conditions of the GNU General Public 5 | * License. See the file "COPYING" in the main directory of this archive 6 | * for more details. 7 | * 8 | * (C) Copyright 1996, 1997 by Ralf Baechle 9 | */ 10 | #ifndef __ASM_MIPS_CACHEOPS_H 11 | #define __ASM_MIPS_CACHEOPS_H 12 | 13 | /* 14 | * Cache Operations 15 | */ 16 | #define Index_Invalidate_I 0x00 17 | #define Index_Writeback_Inv_D 0x01 18 | #define Index_Invalidate_SI 0x02 19 | #define Index_Writeback_Inv_SD 0x03 20 | #define Index_Load_Tag_I 0x04 21 | #define Index_Load_Tag_D 0x05 22 | #define Index_Load_Tag_SI 0x06 23 | #define Index_Load_Tag_SD 0x07 24 | #define Index_Store_Tag_I 0x08 25 | #define Index_Store_Tag_D 0x09 26 | #define Index_Store_Tag_SI 0x0A 27 | #define Index_Store_Tag_SD 0x0B 28 | #define Create_Dirty_Excl_D 0x0d 29 | #define Create_Dirty_Excl_SD 0x0f 30 | #define Hit_Invalidate_I 0x10 31 | #define Hit_Invalidate_D 0x11 32 | #define Hit_Invalidate_SI 0x12 33 | #define Hit_Invalidate_SD 0x13 34 | #define Fill 0x14 35 | #define Hit_Writeback_Inv_D 0x15 36 | /* 0x16 is unused */ 37 | #define Hit_Writeback_Inv_SD 0x17 38 | #define Hit_Writeback_I 0x18 39 | #define Hit_Writeback_D 0x19 40 | /* 0x1a is unused */ 41 | #define Hit_Writeback_SD 0x1b 42 | /* 0x1c is unused */ 43 | /* 0x1e is unused */ 44 | #define Hit_Set_Virtual_SI 0x1e 45 | #define Hit_Set_Virtual_SD 0x1f 46 | 47 | #endif /* __ASM_MIPS_CACHEOPS_H */ 48 | -------------------------------------------------------------------------------- /include/asm/errno-base.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASM_GENERIC_ERRNO_BASE_H 2 | #define _ASM_GENERIC_ERRNO_BASE_H 3 | 4 | #define EPERM 1 /* Operation not permitted */ 5 | #define ENOENT 2 /* No such file or directory */ 6 | #define ESRCH 3 /* No such process */ 7 | #define EINTR 4 /* Interrupted system call */ 8 | #define EIO 5 /* I/O error */ 9 | #define ENXIO 6 /* No such device or address */ 10 | #define E2BIG 7 /* Argument list too long */ 11 | #define ENOEXEC 8 /* Exec format error */ 12 | #define EBADF 9 /* Bad file number */ 13 | #define ECHILD 10 /* No child processes */ 14 | #define EAGAIN 11 /* Try again */ 15 | #define ENOMEM 12 /* Out of memory */ 16 | #define EACCES 13 /* Permission denied */ 17 | #define EFAULT 14 /* Bad address */ 18 | #define ENOTBLK 15 /* Block device required */ 19 | #define EBUSY 16 /* Device or resource busy */ 20 | #define EEXIST 17 /* File exists */ 21 | #define EXDEV 18 /* Cross-device link */ 22 | #define ENODEV 19 /* No such device */ 23 | #define ENOTDIR 20 /* Not a directory */ 24 | #define EISDIR 21 /* Is a directory */ 25 | #define EINVAL 22 /* Invalid argument */ 26 | #define ENFILE 23 /* File table overflow */ 27 | #define EMFILE 24 /* Too many open files */ 28 | #define ENOTTY 25 /* Not a typewriter */ 29 | #define ETXTBSY 26 /* Text file busy */ 30 | #define EFBIG 27 /* File too large */ 31 | #define ENOSPC 28 /* No space left on device */ 32 | #define ESPIPE 29 /* Illegal seek */ 33 | #define EROFS 30 /* Read-only file system */ 34 | #define EMLINK 31 /* Too many links */ 35 | #define EPIPE 32 /* Broken pipe */ 36 | #define EDOM 33 /* Math argument out of domain of func */ 37 | #define ERANGE 34 /* Math result not representable */ 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/asm/global_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2002-2003 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #ifndef __ASM_GBL_DATA_H 25 | #define __ASM_GBL_DATA_H 26 | 27 | #include 28 | 29 | /* 30 | * The following data structure is placed in some memory wich is 31 | * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or 32 | * some locked parts of the data cache) to allow for a minimum set of 33 | * global variables during system initialization (until we have set 34 | * up the memory controller so that we can use RAM). 35 | * 36 | * Keep it *SMALL* and remember to set CFG_GBL_DATA_SIZE > sizeof(gd_t) 37 | */ 38 | 39 | typedef struct global_data { 40 | bd_t *bd; 41 | unsigned long flags; 42 | unsigned long baudrate; 43 | unsigned long have_console; /* serial_init() was called */ 44 | unsigned long ram_size; /* RAM size */ 45 | unsigned long reloc_off; /* Relocation Offset */ 46 | unsigned long env_addr; /* Address of Environment struct */ 47 | unsigned long env_valid; /* Checksum of Environment valid? */ 48 | void **jt; /* jump table */ 49 | } gd_t; 50 | 51 | /* 52 | * Global Data Flags 53 | */ 54 | #define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */ 55 | #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */ 56 | #define GD_FLG_SILENT 0x00004 /* Silent mode */ 57 | 58 | #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("k0") 59 | 60 | #endif /* __ASM_GBL_DATA_H */ 61 | -------------------------------------------------------------------------------- /include/asm/inca-ip.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi-wooya/u-boot-hiwooya/b1bc29ee5395d739fb640ca6bfcb787358ed91a3/include/asm/inca-ip.h -------------------------------------------------------------------------------- /include/asm/isadep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Various ISA level dependant constants. 3 | * Most of the following constants reflect the different layout 4 | * of Coprocessor 0 registers. 5 | * 6 | * Copyright (c) 1998 Harald Koerfgen 7 | */ 8 | #include 9 | 10 | #ifndef __ASM_ISADEP_H 11 | #define __ASM_ISADEP_H 12 | 13 | #if defined(CONFIG_CPU_R3000) 14 | /* 15 | * R2000 or R3000 16 | */ 17 | 18 | /* 19 | * kernel or user mode? (CP0_STATUS) 20 | */ 21 | #define KU_MASK 0x08 22 | #define KU_USER 0x08 23 | #define KU_KERN 0x00 24 | 25 | #else 26 | /* 27 | * kernel or user mode? 28 | */ 29 | #define KU_MASK 0x18 30 | #define KU_USER 0x10 31 | #define KU_KERN 0x00 32 | 33 | #endif 34 | 35 | #endif /* __ASM_ISADEP_H */ 36 | -------------------------------------------------------------------------------- /include/asm/ptrace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is subject to the terms and conditions of the GNU General Public 3 | * License. See the file "COPYING" in the main directory of this archive 4 | * for more details. 5 | * 6 | * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle 7 | * 8 | * Machine dependent structs and defines to help the user use 9 | * the ptrace system call. 10 | */ 11 | #ifndef _ASM_PTRACE_H 12 | #define _ASM_PTRACE_H 13 | 14 | #include 15 | #include 16 | 17 | /* 0 - 31 are integer registers, 32 - 63 are fp registers. */ 18 | #define FPR_BASE 32 19 | #define PC 64 20 | #define CAUSE 65 21 | #define BADVADDR 66 22 | #define MMHI 67 23 | #define MMLO 68 24 | #define FPC_CSR 69 25 | #define FPC_EIR 70 26 | 27 | #ifndef _LANGUAGE_ASSEMBLY 28 | /* 29 | * This struct defines the way the registers are stored on the stack during a 30 | * system call/exception. As usual the registers k0/k1 aren't being saved. 31 | */ 32 | struct pt_regs { 33 | /* Pad bytes for argument save space on the stack. */ 34 | unsigned long pad0[6]; 35 | 36 | /* Saved main processor registers. */ 37 | unsigned long regs[32]; 38 | 39 | /* Other saved registers. */ 40 | unsigned long lo; 41 | unsigned long hi; 42 | 43 | /* 44 | * saved cp0 registers 45 | */ 46 | unsigned long cp0_epc; 47 | unsigned long cp0_badvaddr; 48 | unsigned long cp0_status; 49 | unsigned long cp0_cause; 50 | }; 51 | 52 | #endif /* !(_LANGUAGE_ASSEMBLY) */ 53 | 54 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 55 | /* #define PTRACE_GETREGS 12 */ 56 | /* #define PTRACE_SETREGS 13 */ 57 | /* #define PTRACE_GETFPREGS 14 */ 58 | /* #define PTRACE_SETFPREGS 15 */ 59 | /* #define PTRACE_GETFPXREGS 18 */ 60 | /* #define PTRACE_SETFPXREGS 19 */ 61 | 62 | #define PTRACE_SETOPTIONS 21 63 | 64 | /* options set using PTRACE_SETOPTIONS */ 65 | #define PTRACE_O_TRACESYSGOOD 0x00000001 66 | 67 | #if 0 /* def _LANGUAGE_ASSEMBLY */ 68 | #include 69 | #endif 70 | 71 | #ifdef __KERNEL__ 72 | 73 | #ifndef _LANGUAGE_ASSEMBLY 74 | /* 75 | * Does the process account for user or for system time? 76 | */ 77 | #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER) 78 | 79 | #define instruction_pointer(regs) ((regs)->cp0_epc) 80 | 81 | extern void show_regs(struct pt_regs *); 82 | #endif /* !(_LANGUAGE_ASSEMBLY) */ 83 | 84 | #endif 85 | 86 | #endif /* _ASM_PTRACE_H */ 87 | -------------------------------------------------------------------------------- /include/asm/reg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Various register offset definitions for debuggers, core file 3 | * examiners and whatnot. 4 | * 5 | * This file is subject to the terms and conditions of the GNU General Public 6 | * License. See the file "COPYING" in the main directory of this archive 7 | * for more details. 8 | * 9 | * Copyright (C) 1995, 1999 by Ralf Baechle 10 | */ 11 | #ifndef __ASM_MIPS_REG_H 12 | #define __ASM_MIPS_REG_H 13 | 14 | /* 15 | * This defines/structures correspond to the register layout on stack - 16 | * if the order here is changed, it needs to be updated in 17 | * include/asm-mips/stackframe.h 18 | */ 19 | #define EF_REG0 6 20 | #define EF_REG1 7 21 | #define EF_REG2 8 22 | #define EF_REG3 9 23 | #define EF_REG4 10 24 | #define EF_REG5 11 25 | #define EF_REG6 12 26 | #define EF_REG7 13 27 | #define EF_REG8 14 28 | #define EF_REG9 15 29 | #define EF_REG10 16 30 | #define EF_REG11 17 31 | #define EF_REG12 18 32 | #define EF_REG13 19 33 | #define EF_REG14 20 34 | #define EF_REG15 21 35 | #define EF_REG16 22 36 | #define EF_REG17 23 37 | #define EF_REG18 24 38 | #define EF_REG19 25 39 | #define EF_REG20 26 40 | #define EF_REG21 27 41 | #define EF_REG22 28 42 | #define EF_REG23 29 43 | #define EF_REG24 30 44 | #define EF_REG25 31 45 | /* 46 | * k0/k1 unsaved 47 | */ 48 | #define EF_REG28 34 49 | #define EF_REG29 35 50 | #define EF_REG30 36 51 | #define EF_REG31 37 52 | 53 | /* 54 | * Saved special registers 55 | */ 56 | #define EF_LO 38 57 | #define EF_HI 39 58 | 59 | #define EF_CP0_EPC 40 60 | #define EF_CP0_BADVADDR 41 61 | #define EF_CP0_STATUS 42 62 | #define EF_CP0_CAUSE 44 63 | 64 | #define EF_SIZE 180 /* size in bytes */ 65 | 66 | #endif /* __ASM_MIPS_REG_H */ 67 | -------------------------------------------------------------------------------- /include/asm/regdef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * include/asm-mips/regdefs.h 3 | * 4 | * This file is subject to the terms and conditions of the GNU General Public 5 | * License. See the file "COPYING" in the main directory of this archive 6 | * for more details. 7 | * 8 | * Copyright (C) 1994, 1995 by Ralf Baechle 9 | */ 10 | 11 | #ifndef __ASM_MIPS_REGDEF_H 12 | #define __ASM_MIPS_REGDEF_H 13 | 14 | /* 15 | * Symbolic register names for 32 bit ABI 16 | */ 17 | #define zero $0 /* wired zero */ 18 | #define AT $1 /* assembler temp - uppercase because of ".set at" */ 19 | #define v0 $2 /* return value */ 20 | #define v1 $3 21 | #define a0 $4 /* argument registers */ 22 | #define a1 $5 23 | #define a2 $6 24 | #define a3 $7 25 | #define t0 $8 /* caller saved */ 26 | #define t1 $9 27 | #define t2 $10 28 | #define t3 $11 29 | #define t4 $12 30 | #define t5 $13 31 | #define t6 $14 32 | #define t7 $15 33 | #define s0 $16 /* callee saved */ 34 | #define s1 $17 35 | #define s2 $18 36 | #define s3 $19 37 | #define s4 $20 38 | #define s5 $21 39 | #define s6 $22 40 | #define s7 $23 41 | #define t8 $24 /* caller saved */ 42 | #define t9 $25 43 | #define jp $25 /* PIC jump register */ 44 | #define k0 $26 /* kernel scratch */ 45 | #define k1 $27 46 | #define gp $28 /* global pointer */ 47 | #define sp $29 /* stack pointer */ 48 | #define fp $30 /* frame pointer */ 49 | #define s8 $30 /* same like fp! */ 50 | #define ra $31 /* return address */ 51 | 52 | #endif /* __ASM_MIPS_REGDEF_H */ 53 | -------------------------------------------------------------------------------- /include/asm/sgidefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is subject to the terms and conditions of the GNU General Public 3 | * License. See the file "COPYING" in the main directory of this archive 4 | * for more details. 5 | * 6 | * Copyright (C) 1996, 1999, 2001 Ralf Baechle 7 | * Copyright (C) 1999 Silicon Graphics, Inc. 8 | * Copyright (C) 2001 MIPS Technologies, Inc. 9 | */ 10 | #ifndef __ASM_SGIDEFS_H 11 | #define __ASM_SGIDEFS_H 12 | 13 | /* 14 | * Using a Linux compiler for building Linux seems logic but not to 15 | * everybody. 16 | */ 17 | #if 0 /* ndef __linux__ */ 18 | #error Use a Linux compiler or give up. 19 | #endif 20 | 21 | /* 22 | * Definitions for the ISA levels 23 | * 24 | * With the introduction of MIPS32 / MIPS64 instruction sets definitions 25 | * MIPS ISAs are no longer subsets of each other. Therefore comparisons 26 | * on these symbols except with == may result in unexpected results and 27 | * are forbidden! 28 | */ 29 | #define _MIPS_ISA_MIPS1 1 30 | #define _MIPS_ISA_MIPS2 2 31 | #define _MIPS_ISA_MIPS3 3 32 | #define _MIPS_ISA_MIPS4 4 33 | #define _MIPS_ISA_MIPS5 5 34 | #define _MIPS_ISA_MIPS32 6 35 | #define _MIPS_ISA_MIPS64 7 36 | 37 | /* 38 | * Subprogram calling convention 39 | */ 40 | #define _MIPS_SIM_ABI32 1 41 | #define _MIPS_SIM_NABI32 2 42 | #define _MIPS_SIM_ABI64 3 43 | 44 | #endif /* __ASM_SGIDEFS_H */ 45 | -------------------------------------------------------------------------------- /include/asm/types.h: -------------------------------------------------------------------------------- 1 | /* $Id: //WIFI_SOC/MP/SDK_4_3_0_0/Uboot/include/asm/types.h#1 $ 2 | * 3 | * This file is subject to the terms and conditions of the GNU General Public 4 | * License. See the file "COPYING" in the main directory of this archive 5 | * for more details. 6 | * 7 | * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle 8 | * Copyright (C) 1999 Silicon Graphics, Inc. 9 | */ 10 | #ifndef _ASM_TYPES_H 11 | #define _ASM_TYPES_H 12 | 13 | typedef unsigned short umode_t; 14 | 15 | /* 16 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the 17 | * header files exported to user space 18 | */ 19 | 20 | typedef __signed__ char __s8; 21 | typedef unsigned char __u8; 22 | 23 | typedef __signed__ short __s16; 24 | typedef unsigned short __u16; 25 | 26 | typedef __signed__ int __s32; 27 | typedef unsigned int __u32; 28 | 29 | #if (_MIPS_SZLONG == 64) 30 | 31 | typedef __signed__ long __s64; 32 | typedef unsigned long __u64; 33 | 34 | #else 35 | 36 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 37 | typedef __signed__ long long __s64; 38 | typedef unsigned long long __u64; 39 | #endif 40 | 41 | #endif 42 | 43 | /* 44 | * These aren't exported outside the kernel to avoid name space clashes 45 | */ 46 | #ifdef __KERNEL__ 47 | 48 | typedef __signed char s8; 49 | typedef unsigned char u8; 50 | 51 | typedef __signed short s16; 52 | typedef unsigned short u16; 53 | 54 | typedef __signed int s32; 55 | typedef unsigned int u32; 56 | 57 | #if (_MIPS_SZLONG == 64) 58 | 59 | typedef __signed__ long s64; 60 | typedef unsigned long u64; 61 | 62 | #else 63 | 64 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 65 | typedef __signed__ long long s64; 66 | typedef unsigned long long u64; 67 | #endif 68 | 69 | #endif 70 | 71 | #define BITS_PER_LONG _MIPS_SZLONG 72 | 73 | typedef unsigned long dma_addr_t; 74 | 75 | #endif /* __KERNEL__ */ 76 | 77 | #endif /* _ASM_TYPES_H */ 78 | -------------------------------------------------------------------------------- /include/asm/u-boot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Wolfgang Denk, DENX Software Engineering, 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #ifndef _U_BOOT_H_ 25 | #define _U_BOOT_H_ 1 26 | 27 | typedef struct bd_info { 28 | int bi_baudrate; /* serial console baudrate */ 29 | unsigned long bi_ip_addr; /* IP Address */ 30 | unsigned char bi_enetaddr[6]; /* Ethernet adress */ 31 | unsigned long bi_arch_number; /* unique id for this board */ 32 | unsigned long bi_boot_params; /* where this board expects params */ 33 | unsigned long bi_memstart; /* start of DRAM memory */ 34 | unsigned long bi_memsize; /* size of DRAM memory in bytes */ 35 | unsigned long bi_flashstart; /* start of FLASH memory */ 36 | unsigned long bi_flashsize; /* size of FLASH memory */ 37 | unsigned long bi_flashoffset; /* reserved area for startup monitor */ 38 | } bd_t; 39 | #define bi_env_data bi_env->data 40 | #define bi_env_crc bi_env->crc 41 | 42 | #endif /* _U_BOOT_H_ */ 43 | -------------------------------------------------------------------------------- /include/asm/unaligned.h: -------------------------------------------------------------------------------- 1 | #ifndef _GENERIC_UNALIGNED_H 2 | #define _GENERIC_UNALIGNED_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | /* 11 | * Select endianness 12 | */ 13 | #if defined(__LITTLE_ENDIAN) 14 | #define get_unaligned __get_unaligned_le 15 | #define put_unaligned __put_unaligned_le 16 | #elif defined(__BIG_ENDIAN) 17 | #define get_unaligned __get_unaligned_be 18 | #define put_unaligned __put_unaligned_be 19 | #else 20 | #error invalid endian 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /include/bedbug/bedbug.h: -------------------------------------------------------------------------------- 1 | /* $Id: //WIFI_SOC/MP/SDK_4_3_0_0/Uboot/include/bedbug/bedbug.h#1 $ */ 2 | 3 | #ifndef _BEDBUG_H 4 | #define _BEDBUG_H 5 | 6 | #ifndef NULL 7 | #define NULL 0 8 | #endif 9 | 10 | #define _USE_PROTOTYPES 11 | 12 | #ifndef isblank 13 | #define isblank(c) isspace((int)(c)) 14 | #endif 15 | 16 | #ifndef __P 17 | #if defined(_USE_PROTOTYPES) && (defined(__STDC__) || defined(__cplusplus)) 18 | #define __P(protos) protos /* full-blown ANSI C */ 19 | #else 20 | #define __P(protos) () /* traditional C preprocessor */ 21 | #endif 22 | #endif 23 | 24 | #define assert( condition ) if( (condition) ) _exit(0) 25 | 26 | #endif /* _BEDBUG_H */ 27 | 28 | 29 | /* 30 | * Copyright (c) 2001 William L. Pitts 31 | * All rights reserved. 32 | * 33 | * Redistribution and use in source and binary forms are freely 34 | * permitted provided that the above copyright notice and this 35 | * paragraph and the following disclaimer are duplicated in all 36 | * such forms. 37 | * 38 | * This software is provided "AS IS" and without any express or 39 | * implied warranties, including, without limitation, the implied 40 | * warranties of merchantability and fitness for a particular 41 | * purpose. 42 | */ 43 | -------------------------------------------------------------------------------- /include/bedbug/type.h: -------------------------------------------------------------------------------- 1 | #ifndef _TYPE_BEDBUG_H 2 | #define _TYPE_BEDBUG_H 3 | 4 | /* Supporting routines */ 5 | int bedbug_puts (const char *); 6 | void bedbug_init (void); 7 | void bedbug860_init (void); 8 | void do_bedbug_breakpoint (struct pt_regs *); 9 | void bedbug_main_loop (unsigned long, struct pt_regs *); 10 | 11 | 12 | typedef struct { 13 | int hw_debug_enabled; 14 | int stopped; 15 | int current_bp; 16 | struct pt_regs *regs; 17 | 18 | void (*do_break) (cmd_tbl_t *, int, int, char *[]); 19 | void (*break_isr) (struct pt_regs *); 20 | int (*find_empty) (void); 21 | int (*set) (int, unsigned long); 22 | int (*clear) (int); 23 | } CPU_DEBUG_CTX; 24 | 25 | 26 | #endif /* _TYPE_BEDBUG_H */ 27 | -------------------------------------------------------------------------------- /include/bmp_layout.h: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 2002 2 | * Detlev Zundel, DENX Software Engineering, dzu@denx.de. 3 | * 4 | * See file CREDITS for list of people who contributed to this 5 | * project. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License as 9 | * published by the Free Software Foundation; either version 2 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 20 | * MA 02111-1307 USA 21 | */ 22 | 23 | /************************************************************************/ 24 | /* ** Layout of a bmp file */ 25 | /************************************************************************/ 26 | 27 | #ifndef _BMP_H_ 28 | #define _BMP_H_ 29 | 30 | typedef struct bmp_color_table_entry { 31 | __u8 blue; 32 | __u8 green; 33 | __u8 red; 34 | __u8 reserved; 35 | } __attribute__ ((packed)) bmp_color_table_entry_t; 36 | 37 | /* When accessing these fields, remember that they are stored in little 38 | endian format, so use linux macros, e.g. le32_to_cpu(width) */ 39 | 40 | typedef struct bmp_header { 41 | /* Header */ 42 | char signature[2]; 43 | __u32 file_size; 44 | __u32 reserved; 45 | __u32 data_offset; 46 | /* InfoHeader */ 47 | __u32 size; 48 | __u32 width; 49 | __u32 height; 50 | __u16 planes; 51 | __u16 bit_count; 52 | __u32 compression; 53 | __u32 image_size; 54 | __u32 x_pixels_per_m; 55 | __u32 y_pixels_per_m; 56 | __u32 colors_used; 57 | __u32 colors_important; 58 | /* ColorTable */ 59 | 60 | } __attribute__ ((packed)) bmp_header_t; 61 | 62 | typedef struct bmp_image { 63 | bmp_header_t header; 64 | /* We use a zero sized array just as a placeholder for variable 65 | sized array */ 66 | bmp_color_table_entry_t color_table[0]; 67 | } bmp_image_t; 68 | 69 | /* Data in the bmp_image is aligned to this length */ 70 | #define BMP_DATA_ALIGN 4 71 | 72 | /* Constants for the compression field */ 73 | #define BMP_BI_RGB 0 74 | #define BMP_BI_RLE8 1 75 | #define BMP_BI_RLE4 2 76 | 77 | #endif /* _BMP_H_ */ 78 | -------------------------------------------------------------------------------- /include/circbuf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Gerry Hamel, geh@ti.com, Texas Instruments 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | */ 20 | 21 | #ifndef __CIRCBUF_H__ 22 | #define __CIRCBUF_H__ 23 | 24 | typedef struct circbuf { 25 | unsigned int size; /* current number of bytes held */ 26 | unsigned int totalsize; /* number of bytes allocated */ 27 | 28 | char *top; /* pointer to current buffer start */ 29 | char *tail; /* pointer to space for next element */ 30 | 31 | char *data; /* all data */ 32 | char *end; /* end of data buffer */ 33 | } circbuf_t; 34 | 35 | int buf_init (circbuf_t * buf, unsigned int size); 36 | int buf_free (circbuf_t * buf); 37 | int buf_pop (circbuf_t * buf, char *dest, unsigned int len); 38 | int buf_push (circbuf_t * buf, const char *src, unsigned int len); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPILER_H__ 2 | #define __COMPILER_H__ 3 | 4 | #define likely(x) __builtin_expect(!!(x), 1) 5 | #define unlikely(x) __builtin_expect(!!(x), 0) 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /include/config.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/config.mk: -------------------------------------------------------------------------------- 1 | ARCH = mips 2 | CPU = ralink_soc 3 | BOARD = rt2880 4 | -------------------------------------------------------------------------------- /include/console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #ifndef _CONSOLE_H_ 25 | #define _CONSOLE_H_ 26 | 27 | #include 28 | 29 | /* 30 | ** VARIABLES 31 | */ 32 | 33 | extern device_t *stdio_devices[] ; 34 | extern char *stdio_names[MAX_FILES] ; 35 | 36 | int console_realloc(int top); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/exports.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXPORTS_H__ 2 | #define __EXPORTS_H__ 3 | 4 | #ifndef __ASSEMBLY__ 5 | 6 | #include 7 | 8 | /* These are declarations of exported functions available in C code */ 9 | unsigned long get_version(void); 10 | int getc(void); 11 | int tstc(void); 12 | void putc(const char); 13 | void puts(const char*); 14 | void printf(const char* fmt, ...); 15 | void install_hdlr(int, interrupt_handler_t*, void*); 16 | void free_hdlr(int); 17 | void *malloc(size_t); 18 | void free(void*); 19 | void udelay(unsigned long); 20 | unsigned long get_timer(unsigned long); 21 | void vprintf(const char *, va_list); 22 | void do_reset (void); 23 | 24 | void app_startup(char **); 25 | 26 | #endif /* ifndef __ASSEMBLY__ */ 27 | 28 | enum { 29 | #define EXPORT_FUNC(x) XF_ ## x , 30 | #include <_exports.h> 31 | #undef EXPORT_FUNC 32 | 33 | XF_MAX 34 | }; 35 | 36 | #define XF_VERSION 2 37 | 38 | #if defined(CONFIG_I386) 39 | extern gd_t *global_data; 40 | #endif 41 | 42 | #endif /* __EXPORTS_H__ */ 43 | -------------------------------------------------------------------------------- /include/fat_old.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi-wooya/u-boot-hiwooya/b1bc29ee5395d739fb640ca6bfcb787358ed91a3/include/fat_old.h -------------------------------------------------------------------------------- /include/hush.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2001 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #ifndef _HUSH_H_ 25 | #define _HUSH_H_ 26 | 27 | #define FLAG_EXIT_FROM_LOOP 1 28 | #define FLAG_PARSE_SEMICOLON (1 << 1) /* symbol ';' is special for parser */ 29 | #define FLAG_REPARSING (1 << 2) /* >=2nd pass */ 30 | 31 | extern int u_boot_hush_start(void); 32 | extern int parse_string_outer(char *, int); 33 | extern int parse_file_outer(void); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/ide.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #ifndef _IDE_H 25 | #define _IDE_H 26 | 27 | #define IDE_BUS(dev) (dev >> 1) 28 | 29 | #ifdef CONFIG_IDE_LED 30 | 31 | /* 32 | * LED Port 33 | */ 34 | #define LED_PORT ((uchar *)(PER8_BASE + 0x3000)) 35 | #define LED_IDE1 0x01 36 | #define LED_IDE2 0x02 37 | #define DEVICE_LED(d) ((d & 2) | ((d & 2) == 0)) /* depends on bit positions! */ 38 | 39 | #endif /* CONFIG_IDE_LED */ 40 | 41 | #ifdef CFG_64BIT_LBA 42 | typedef uint64_t lbaint_t; 43 | #else 44 | typedef ulong lbaint_t; 45 | #endif 46 | 47 | /* 48 | * Function Prototypes 49 | */ 50 | 51 | void ide_init (void); 52 | ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, ulong *buffer); 53 | ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, ulong *buffer); 54 | 55 | #endif /* _IDE_H */ 56 | -------------------------------------------------------------------------------- /include/kgdb.h: -------------------------------------------------------------------------------- 1 | #ifndef __KGDB_H__ 2 | #define __KGDB_H__ 3 | 4 | #include 5 | 6 | #define KGDBERR_BADPARAMS 1 7 | #define KGDBERR_NOTHEXDIG 2 8 | #define KGDBERR_MEMFAULT 3 9 | #define KGDBERR_NOSPACE 4 10 | #define KGDBERR_ALIGNFAULT 5 11 | 12 | #define KGDBDATA_MAXREGS 8 13 | #define KGDBDATA_MAXPRIV 8 14 | 15 | #define KGDBEXIT_TYPEMASK 0xff 16 | 17 | #define KGDBEXIT_KILL 0 18 | #define KGDBEXIT_CONTINUE 1 19 | #define KGDBEXIT_SINGLE 2 20 | 21 | #define KGDBEXIT_WITHADDR 0x100 22 | 23 | typedef 24 | struct { 25 | int num; 26 | unsigned long val; 27 | } 28 | kgdb_reg; 29 | 30 | typedef 31 | struct { 32 | int sigval; 33 | int extype; 34 | unsigned long exaddr; 35 | int nregs; 36 | kgdb_reg regs[KGDBDATA_MAXREGS]; 37 | unsigned long private[KGDBDATA_MAXPRIV]; 38 | } 39 | kgdb_data; 40 | 41 | /* these functions are provided by the generic kgdb support */ 42 | extern void kgdb_init(void); 43 | extern void kgdb_error(int); 44 | extern int kgdb_output_string(const char *, unsigned int); 45 | extern void breakpoint(void); 46 | 47 | /* these functions are provided by the platform specific kgdb support */ 48 | extern void kgdb_flush_cache_range(void *, void *); 49 | extern void kgdb_flush_cache_all(void); 50 | extern int kgdb_setjmp(long *); 51 | extern void kgdb_longjmp(long *, int); 52 | extern void kgdb_enter(struct pt_regs *, kgdb_data *); 53 | extern void kgdb_exit(struct pt_regs *, kgdb_data *); 54 | extern int kgdb_getregs(struct pt_regs *, char *, int); 55 | extern void kgdb_putreg(struct pt_regs *, int, char *, int); 56 | extern void kgdb_putregs(struct pt_regs *, char *, int); 57 | extern int kgdb_trap(struct pt_regs *); 58 | extern void kgdb_breakpoint(int argc, char *argv[]); 59 | 60 | /* these functions are provided by the platform serial driver */ 61 | extern void kgdb_serial_init(void); 62 | extern int getDebugChar(void); 63 | extern void putDebugChar(int); 64 | extern void putDebugStr(const char *); 65 | extern void kgdb_interruptible(int); 66 | 67 | /* this is referenced in the trap handler for the platform */ 68 | extern int (*debugger_exception_handler)(struct pt_regs *); 69 | 70 | #endif /* __KGDB_H__ */ 71 | -------------------------------------------------------------------------------- /include/launch.h: -------------------------------------------------------------------------------- 1 | 2 | /************************************************************************ 3 | * 4 | * loader_api.h 5 | * 6 | * API file for load image module 7 | * 8 | * ###################################################################### 9 | * 10 | * mips_start_of_header 11 | * 12 | * $Id: launch.h,v 1.6 2008-06-26 22:16:44 chris Exp $ 13 | * 14 | * Copyright (c) [Year(s)] MIPS Technologies, Inc. All rights reserved. 15 | * 16 | * Unpublished rights reserved under U.S. copyright law. 17 | * 18 | * PROPRIETARY/SECRET CONFIDENTIAL INFORMATION OF MIPS TECHNOLOGIES, 19 | * INC. FOR INTERNAL USE ONLY. 20 | * 21 | * Under no circumstances (contract or otherwise) may this information be 22 | * disclosed to, or copied, modified or used by anyone other than employees 23 | * or contractors of MIPS Technologies having a need to know. 24 | * 25 | * 26 | * mips_end_of_header 27 | * 28 | ************************************************************************/ 29 | 30 | 31 | #ifndef LAUNCH_H 32 | #define LAUNCH_H 33 | 34 | #ifndef _ASSEMBLER_ 35 | 36 | typedef struct { 37 | unsigned long pc; 38 | unsigned long gp; 39 | unsigned long sp; 40 | unsigned long a0; 41 | unsigned long _pad[3]; /* pad to cache line size to avoid thrashing */ 42 | unsigned long flags; 43 | } cpulaunch_t; 44 | 45 | #else 46 | 47 | #define LOG2CPULAUNCH 5 48 | #define LAUNCH_PC 0 49 | #define LAUNCH_GP 4 50 | #define LAUNCH_SP 8 51 | #define LAUNCH_A0 12 52 | #define LAUNCH_FLAGS 28 53 | 54 | #endif 55 | 56 | #define LAUNCH_FREADY 1 57 | #define LAUNCH_FGO 2 58 | #define LAUNCH_FGONE 4 59 | 60 | #define SCRLAUNCH 0x00000e00 61 | #define CPULAUNCH 0x00000f00 62 | #define NCPULAUNCH 8 63 | 64 | /* Polling period in count cycles for secondary CPU's */ 65 | #define LAUNCHPERIOD 10000 66 | 67 | #ifndef __ASSEMBLER__ 68 | int cpu_present (int); 69 | #endif 70 | 71 | #endif /* LAUNCH_H */ 72 | -------------------------------------------------------------------------------- /include/linux/bitops.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_BITOPS_H 2 | #define _LINUX_BITOPS_H 3 | 4 | 5 | /* 6 | * ffs: find first bit set. This is defined the same way as 7 | * the libc and compiler builtin ffs routines, therefore 8 | * differs in spirit from the above ffz (man ffs). 9 | */ 10 | 11 | static inline int generic_ffs(int x) 12 | { 13 | int r = 1; 14 | 15 | if (!x) 16 | return 0; 17 | if (!(x & 0xffff)) { 18 | x >>= 16; 19 | r += 16; 20 | } 21 | if (!(x & 0xff)) { 22 | x >>= 8; 23 | r += 8; 24 | } 25 | if (!(x & 0xf)) { 26 | x >>= 4; 27 | r += 4; 28 | } 29 | if (!(x & 3)) { 30 | x >>= 2; 31 | r += 2; 32 | } 33 | if (!(x & 1)) { 34 | x >>= 1; 35 | r += 1; 36 | } 37 | return r; 38 | } 39 | 40 | /* 41 | * hweightN: returns the hamming weight (i.e. the number 42 | * of bits set) of a N-bit word 43 | */ 44 | 45 | static inline unsigned int generic_hweight32(unsigned int w) 46 | { 47 | unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555); 48 | res = (res & 0x33333333) + ((res >> 2) & 0x33333333); 49 | res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F); 50 | res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF); 51 | return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF); 52 | } 53 | 54 | static inline unsigned int generic_hweight16(unsigned int w) 55 | { 56 | unsigned int res = (w & 0x5555) + ((w >> 1) & 0x5555); 57 | res = (res & 0x3333) + ((res >> 2) & 0x3333); 58 | res = (res & 0x0F0F) + ((res >> 4) & 0x0F0F); 59 | return (res & 0x00FF) + ((res >> 8) & 0x00FF); 60 | } 61 | 62 | static inline unsigned int generic_hweight8(unsigned int w) 63 | { 64 | unsigned int res = (w & 0x55) + ((w >> 1) & 0x55); 65 | res = (res & 0x33) + ((res >> 2) & 0x33); 66 | return (res & 0x0F) + ((res >> 4) & 0x0F); 67 | } 68 | 69 | #include 70 | 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /include/linux/byteorder/big_endian.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H 2 | #define _LINUX_BYTEORDER_BIG_ENDIAN_H 3 | 4 | #ifndef __BIG_ENDIAN 5 | #define __BIG_ENDIAN 4321 6 | #endif 7 | #ifndef __BIG_ENDIAN_BITFIELD 8 | #define __BIG_ENDIAN_BITFIELD 9 | #endif 10 | #define __BYTE_ORDER __BIG_ENDIAN 11 | 12 | #include 13 | 14 | #define __constant_htonl(x) ((__u32)(x)) 15 | #define __constant_ntohl(x) ((__u32)(x)) 16 | #define __constant_htons(x) ((__u16)(x)) 17 | #define __constant_ntohs(x) ((__u16)(x)) 18 | #define __constant_cpu_to_le64(x) ___swab64((x)) 19 | #define __constant_le64_to_cpu(x) ___swab64((x)) 20 | #define __constant_cpu_to_le32(x) ___swab32((x)) 21 | #define __constant_le32_to_cpu(x) ___swab32((x)) 22 | #define __constant_cpu_to_le16(x) ___swab16((x)) 23 | #define __constant_le16_to_cpu(x) ___swab16((x)) 24 | #define __constant_cpu_to_be64(x) ((__u64)(x)) 25 | #define __constant_be64_to_cpu(x) ((__u64)(x)) 26 | #define __constant_cpu_to_be32(x) ((__u32)(x)) 27 | #define __constant_be32_to_cpu(x) ((__u32)(x)) 28 | #define __constant_cpu_to_be16(x) ((__u16)(x)) 29 | #define __constant_be16_to_cpu(x) ((__u16)(x)) 30 | #define __cpu_to_le64(x) __swab64((x)) 31 | #define __le64_to_cpu(x) __swab64((x)) 32 | #define __cpu_to_le32(x) __swab32((x)) 33 | #define __le32_to_cpu(x) __swab32((x)) 34 | #define __cpu_to_le16(x) __swab16((x)) 35 | #define __le16_to_cpu(x) __swab16((x)) 36 | #define __cpu_to_be64(x) ((__u64)(x)) 37 | #define __be64_to_cpu(x) ((__u64)(x)) 38 | #define __cpu_to_be32(x) ((__u32)(x)) 39 | #define __be32_to_cpu(x) ((__u32)(x)) 40 | #define __cpu_to_be16(x) ((__u16)(x)) 41 | #define __be16_to_cpu(x) ((__u16)(x)) 42 | #define __cpu_to_le64p(x) __swab64p((x)) 43 | #define __le64_to_cpup(x) __swab64p((x)) 44 | #define __cpu_to_le32p(x) __swab32p((x)) 45 | #define __le32_to_cpup(x) __swab32p((x)) 46 | #define __cpu_to_le16p(x) __swab16p((x)) 47 | #define __le16_to_cpup(x) __swab16p((x)) 48 | #define __cpu_to_be64p(x) (*(__u64*)(x)) 49 | #define __be64_to_cpup(x) (*(__u64*)(x)) 50 | #define __cpu_to_be32p(x) (*(__u32*)(x)) 51 | #define __be32_to_cpup(x) (*(__u32*)(x)) 52 | #define __cpu_to_be16p(x) (*(__u16*)(x)) 53 | #define __be16_to_cpup(x) (*(__u16*)(x)) 54 | #define __cpu_to_le64s(x) __swab64s((x)) 55 | #define __le64_to_cpus(x) __swab64s((x)) 56 | #define __cpu_to_le32s(x) __swab32s((x)) 57 | #define __le32_to_cpus(x) __swab32s((x)) 58 | #define __cpu_to_le16s(x) __swab16s((x)) 59 | #define __le16_to_cpus(x) __swab16s((x)) 60 | #define __cpu_to_be64s(x) do {} while (0) 61 | #define __be64_to_cpus(x) do {} while (0) 62 | #define __cpu_to_be32s(x) do {} while (0) 63 | #define __be32_to_cpus(x) do {} while (0) 64 | #define __cpu_to_be16s(x) do {} while (0) 65 | #define __be16_to_cpus(x) do {} while (0) 66 | 67 | #include 68 | 69 | #endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */ 70 | -------------------------------------------------------------------------------- /include/linux/compiler-gcc3.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_COMPILER_H 2 | #error "Please don't include directly, include instead." 3 | #endif 4 | 5 | #if __GNUC_MINOR__ < 2 6 | # error Sorry, your compiler is too old - please upgrade it. 7 | #endif 8 | 9 | #if __GNUC_MINOR__ >= 3 10 | # define __used __attribute__((__used__)) 11 | #else 12 | # define __used __attribute__((__unused__)) 13 | #endif 14 | 15 | #if __GNUC_MINOR__ >= 4 16 | #define __must_check __attribute__((warn_unused_result)) 17 | #endif 18 | 19 | #ifdef CONFIG_GCOV_KERNEL 20 | # if __GNUC_MINOR__ < 4 21 | # error "GCOV profiling support for gcc versions below 3.4 not included" 22 | # endif /* __GNUC_MINOR__ */ 23 | #endif /* CONFIG_GCOV_KERNEL */ 24 | 25 | /* 26 | * A trick to suppress uninitialized variable warning without generating any 27 | * code 28 | */ 29 | #define uninitialized_var(x) x = x 30 | 31 | #define __always_inline inline __attribute__((always_inline)) 32 | -------------------------------------------------------------------------------- /include/linux/compiler-gcc4.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_COMPILER_H 2 | #error "Please don't include directly, include instead." 3 | #endif 4 | 5 | /* GCC 4.1.[01] miscompiles __weak */ 6 | #ifdef __KERNEL__ 7 | # if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 8 | # error Your version of gcc miscompiles the __weak directive 9 | # endif 10 | #endif 11 | 12 | #define __used __attribute__((__used__)) 13 | #define __must_check __attribute__((warn_unused_result)) 14 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) 15 | #define __always_inline inline __attribute__((always_inline)) 16 | 17 | /* 18 | * A trick to suppress uninitialized variable warning without generating any 19 | * code 20 | */ 21 | #define uninitialized_var(x) x = x 22 | 23 | #if __GNUC_MINOR__ >= 3 24 | /* Mark functions as cold. gcc will assume any path leading to a call 25 | to them will be unlikely. This means a lot of manual unlikely()s 26 | are unnecessary now for any paths leading to the usual suspects 27 | like BUG(), printk(), panic() etc. [but let's keep them for now for 28 | older compilers] 29 | 30 | Early snapshots of gcc 4.3 don't support this and we can't detect this 31 | in the preprocessor, but we can live with this because they're unreleased. 32 | Maketime probing would be overkill here. 33 | 34 | gcc also has a __attribute__((__hot__)) to move hot functions into 35 | a special section, but I don't see any sense in this right now in 36 | the kernel context */ 37 | #define __cold __attribute__((__cold__)) 38 | 39 | 40 | #if __GNUC_MINOR__ >= 5 41 | /* 42 | * Mark a position in code as unreachable. This can be used to 43 | * suppress control flow warnings after asm blocks that transfer 44 | * control elsewhere. 45 | * 46 | * Early snapshots of gcc 4.5 don't support this and we can't detect 47 | * this in the preprocessor, but we can live with this because they're 48 | * unreleased. Really, we need to have autoconf for the kernel. 49 | */ 50 | #define unreachable() __builtin_unreachable() 51 | 52 | /* Mark a function definition as prohibited from being cloned. */ 53 | #define __noclone __attribute__((__noclone__)) 54 | 55 | #endif 56 | 57 | #endif 58 | 59 | #if __GNUC_MINOR__ > 0 60 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) 61 | #endif 62 | #if __GNUC_MINOR__ >= 4 63 | #define __compiletime_warning(message) __attribute__((warning(message))) 64 | #define __compiletime_error(message) __attribute__((error(message))) 65 | #endif 66 | -------------------------------------------------------------------------------- /include/linux/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_CONFIG_H 2 | #define _LINUX_CONFIG_H 3 | 4 | /* #include */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /include/linux/ctype.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_CTYPE_H 2 | #define _LINUX_CTYPE_H 3 | 4 | /* 5 | * NOTE! This ctype does not handle EOF like the standard C 6 | * library is required to. 7 | */ 8 | 9 | #define _U 0x01 /* upper */ 10 | #define _L 0x02 /* lower */ 11 | #define _D 0x04 /* digit */ 12 | #define _C 0x08 /* cntrl */ 13 | #define _P 0x10 /* punct */ 14 | #define _S 0x20 /* white space (space/lf/tab) */ 15 | #define _X 0x40 /* hex digit */ 16 | #define _SP 0x80 /* hard space (0x20) */ 17 | 18 | extern unsigned char _ctype[]; 19 | 20 | #define __ismask(x) (_ctype[(int)(unsigned char)(x)]) 21 | 22 | #define isalnum(c) ((__ismask(c)&(_U|_L|_D)) != 0) 23 | #define isalpha(c) ((__ismask(c)&(_U|_L)) != 0) 24 | #define iscntrl(c) ((__ismask(c)&(_C)) != 0) 25 | #define isdigit(c) ((__ismask(c)&(_D)) != 0) 26 | #define isgraph(c) ((__ismask(c)&(_P|_U|_L|_D)) != 0) 27 | #define islower(c) ((__ismask(c)&(_L)) != 0) 28 | #define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0) 29 | #define ispunct(c) ((__ismask(c)&(_P)) != 0) 30 | #define isspace(c) ((__ismask(c)&(_S)) != 0) 31 | #define isupper(c) ((__ismask(c)&(_U)) != 0) 32 | #define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0) 33 | 34 | #define isascii(c) (((unsigned char)(c))<=0x7f) 35 | #define toascii(c) (((unsigned char)(c))&0x7f) 36 | 37 | static inline unsigned char __tolower(unsigned char c) 38 | { 39 | if (isupper(c)) 40 | c -= 'A'-'a'; 41 | return c; 42 | } 43 | 44 | static inline unsigned char __toupper(unsigned char c) 45 | { 46 | if (islower(c)) 47 | c -= 'a'-'A'; 48 | return c; 49 | } 50 | 51 | #define tolower(c) __tolower(c) 52 | #define toupper(c) __toupper(c) 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /include/linux/err.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_ERR_H 2 | #define _LINUX_ERR_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | /* 9 | * Kernel pointers have redundant information, so we can use a 10 | * scheme where we can return either an error code or a dentry 11 | * pointer with the same return value. 12 | * 13 | * This should be a per-architecture thing, to allow different 14 | * error and pointer decisions. 15 | */ 16 | #define MAX_ERRNO 4095 17 | 18 | #ifndef __ASSEMBLY__ 19 | 20 | #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) 21 | 22 | static inline void * __must_check ERR_PTR(long error) 23 | { 24 | return (void *) error; 25 | } 26 | 27 | static inline long __must_check PTR_ERR(const void *ptr) 28 | { 29 | return (long) ptr; 30 | } 31 | 32 | static inline long __must_check IS_ERR(const void *ptr) 33 | { 34 | return IS_ERR_VALUE((unsigned long)ptr); 35 | } 36 | 37 | static inline long __must_check IS_ERR_OR_NULL(const void *ptr) 38 | { 39 | return !ptr || IS_ERR_VALUE((unsigned long)ptr); 40 | } 41 | 42 | /** 43 | * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type 44 | * @ptr: The pointer to cast. 45 | * 46 | * Explicitly cast an error-valued pointer to another pointer type in such a 47 | * way as to make it clear that's what's going on. 48 | */ 49 | static inline void * __must_check ERR_CAST(const void *ptr) 50 | { 51 | /* cast away the const */ 52 | return (void *) ptr; 53 | } 54 | 55 | #endif 56 | 57 | #endif /* _LINUX_ERR_H */ 58 | -------------------------------------------------------------------------------- /include/linux/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_ERRNO_H 2 | #define _LINUX_ERRNO_H 3 | 4 | #include 5 | 6 | #ifdef __KERNEL__ 7 | 8 | /* Should never be seen by user programs */ 9 | #define ERESTARTSYS 512 10 | #define ERESTARTNOINTR 513 11 | #define ERESTARTNOHAND 514 /* restart if no handler.. */ 12 | #define ENOIOCTLCMD 515 /* No ioctl command */ 13 | #define ERESTART_RESTARTBLOCK 516 /* restart by calling sys_restart_syscall */ 14 | 15 | /* Defined for the NFSv3 protocol */ 16 | #define EBADHANDLE 521 /* Illegal NFS file handle */ 17 | #define ENOTSYNC 522 /* Update synchronization mismatch */ 18 | #define EBADCOOKIE 523 /* Cookie is stale */ 19 | #define ENOTSUPP 524 /* Operation is not supported */ 20 | #define ETOOSMALL 525 /* Buffer or request is too small */ 21 | #define ESERVERFAULT 526 /* An untranslatable error occurred */ 22 | #define EBADTYPE 527 /* Type not supported by server */ 23 | #define EJUKEBOX 528 /* Request initiated, but will not complete before timeout */ 24 | #define EIOCBQUEUED 529 /* iocb queued, will get completion event */ 25 | #define EIOCBRETRY 530 /* iocb queued, will trigger a retry */ 26 | 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /include/linux/mtd/nand_ecc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * drivers/mtd/nand_ecc.h 3 | * 4 | * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) 5 | * 6 | * $Id: //WIFI_SOC/main/RT288x_SDK/source/linux-2.6.21.x/include/linux/mtd/nand_ecc.h#1 $ 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License version 2 as 10 | * published by the Free Software Foundation. 11 | * 12 | * This file is the header for the ECC algorithm. 13 | */ 14 | 15 | #ifndef __MTD_NAND_ECC_H__ 16 | #define __MTD_NAND_ECC_H__ 17 | 18 | struct mtd_info; 19 | 20 | /* 21 | * Calculate 3 byte ECC code for 256 byte block 22 | */ 23 | int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); 24 | 25 | /* 26 | * Detect and correct a 1 bit error for 256 byte block 27 | */ 28 | int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); 29 | 30 | #endif /* __MTD_NAND_ECC_H__ */ 31 | -------------------------------------------------------------------------------- /include/linux/mtd/nand_ids.h: -------------------------------------------------------------------------------- 1 | /* 2 | * u-boot/include/linux/mtd/nand_ids.h 3 | * 4 | * Copyright (c) 2000 David Woodhouse 5 | * Steven J. Hill 6 | * 7 | * $Id: //WIFI_SOC/MP/SDK_4_3_0_0/Uboot/include/linux/mtd/nand_ids.h#1 $ 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License version 2 as 11 | * published by the Free Software Foundation. 12 | * 13 | * Info: 14 | * Contains standard defines and IDs for NAND flash devices 15 | * 16 | * Changelog: 17 | * 01-31-2000 DMW Created 18 | * 09-18-2000 SJH Moved structure out of the Disk-On-Chip drivers 19 | * so it can be used by other NAND flash device 20 | * drivers. I also changed the copyright since none 21 | * of the original contents of this file are specific 22 | * to DoC devices. David can whack me with a baseball 23 | * bat later if I did something naughty. 24 | * 10-11-2000 SJH Added private NAND flash structure for driver 25 | * 2000-10-13 BE Moved out of 'nand.h' - avoids duplication. 26 | */ 27 | 28 | #ifndef __LINUX_MTD_NAND_IDS_H 29 | #define __LINUX_MTD_NAND_IDS_H 30 | 31 | static struct nand_flash_dev nand_flash_ids[] = { 32 | {"Toshiba TC5816BDC", NAND_MFR_TOSHIBA, 0x64, 21, 1, 2, 0x1000}, 33 | {"Toshiba TC5832DC", NAND_MFR_TOSHIBA, 0x6b, 22, 0, 2, 0x2000}, 34 | {"Toshiba TH58V128DC", NAND_MFR_TOSHIBA, 0x73, 24, 0, 2, 0x4000}, 35 | {"Toshiba TC58256FT/DC", NAND_MFR_TOSHIBA, 0x75, 25, 0, 2, 0x4000}, 36 | {"Toshiba TH58512FT", NAND_MFR_TOSHIBA, 0x76, 26, 0, 3, 0x4000}, 37 | {"Toshiba TC58V32DC", NAND_MFR_TOSHIBA, 0xe5, 22, 0, 2, 0x2000}, 38 | {"Toshiba TC58V64AFT/DC", NAND_MFR_TOSHIBA, 0xe6, 23, 0, 2, 0x2000}, 39 | {"Toshiba TC58V16BDC", NAND_MFR_TOSHIBA, 0xea, 21, 1, 2, 0x1000}, 40 | {"Toshiba TH58100FT", NAND_MFR_TOSHIBA, 0x79, 27, 0, 3, 0x4000}, 41 | {"Samsung KM29N16000", NAND_MFR_SAMSUNG, 0x64, 21, 1, 2, 0x1000}, 42 | {"Samsung unknown 4Mb", NAND_MFR_SAMSUNG, 0x6b, 22, 0, 2, 0x2000}, 43 | {"Samsung KM29U128T", NAND_MFR_SAMSUNG, 0x73, 24, 0, 2, 0x4000}, 44 | {"Samsung KM29U256T", NAND_MFR_SAMSUNG, 0x75, 25, 0, 2, 0x4000}, 45 | {"Samsung unknown 64Mb", NAND_MFR_SAMSUNG, 0x76, 26, 0, 3, 0x4000}, 46 | {"Samsung KM29W32000", NAND_MFR_SAMSUNG, 0xe3, 22, 0, 2, 0x2000}, 47 | {"Samsung unknown 4Mb", NAND_MFR_SAMSUNG, 0xe5, 22, 0, 2, 0x2000}, 48 | {"Samsung KM29U64000", NAND_MFR_SAMSUNG, 0xe6, 23, 0, 2, 0x2000}, 49 | {"Samsung KM29W16000", NAND_MFR_SAMSUNG, 0xea, 21, 1, 2, 0x1000}, 50 | {NULL,} 51 | }; 52 | 53 | #endif /* __LINUX_MTD_NAND_IDS_H */ 54 | -------------------------------------------------------------------------------- /include/linux/posix_types.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_POSIX_TYPES_H 2 | #define _LINUX_POSIX_TYPES_H 3 | 4 | #include 5 | 6 | /* 7 | * This allows for 1024 file descriptors: if NR_OPEN is ever grown 8 | * beyond that you'll have to change this too. But 1024 fd's seem to be 9 | * enough even for such "real" unices like OSF/1, so hopefully this is 10 | * one limit that doesn't have to be changed [again]. 11 | * 12 | * Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in 13 | * (and thus ) - but this is a more logical 14 | * place for them. Solved by having dummy defines in . 15 | */ 16 | 17 | /* 18 | * Those macros may have been defined in . But we always 19 | * use the ones here. 20 | */ 21 | #undef __NFDBITS 22 | #define __NFDBITS (8 * sizeof(unsigned long)) 23 | 24 | #undef __FD_SETSIZE 25 | #define __FD_SETSIZE 1024 26 | 27 | #undef __FDSET_LONGS 28 | #define __FDSET_LONGS (__FD_SETSIZE/__NFDBITS) 29 | 30 | #undef __FDELT 31 | #define __FDELT(d) ((d) / __NFDBITS) 32 | 33 | #undef __FDMASK 34 | #define __FDMASK(d) (1UL << ((d) % __NFDBITS)) 35 | 36 | typedef struct { 37 | unsigned long fds_bits [__FDSET_LONGS]; 38 | } __kernel_fd_set; 39 | 40 | /* Type of a signal handler. */ 41 | typedef void (*__kernel_sighandler_t)(int); 42 | 43 | /* Type of a SYSV IPC key. */ 44 | typedef int __kernel_key_t; 45 | 46 | #include 47 | 48 | #endif /* _LINUX_POSIX_TYPES_H */ 49 | -------------------------------------------------------------------------------- /include/linux/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_STDDEF_H 2 | #define _LINUX_STDDEF_H 3 | 4 | #undef NULL 5 | #if defined(__cplusplus) 6 | #define NULL 0 7 | #else 8 | #define NULL ((void *)0) 9 | #endif 10 | 11 | #ifndef _SIZE_T 12 | #include 13 | #endif 14 | 15 | #undef offsetof 16 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/linux/string.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_STRING_H_ 2 | #define _LINUX_STRING_H_ 3 | 4 | #include /* for size_t */ 5 | #include /* for NULL */ 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | extern char * ___strtok; 12 | extern char * strpbrk(const char *,const char *); 13 | extern char * strtok(char *,const char *); 14 | extern char * strsep(char **,const char *); 15 | extern __kernel_size_t strspn(const char *,const char *); 16 | 17 | 18 | /* 19 | * Include machine specific inline routines 20 | */ 21 | #include 22 | 23 | #ifndef __HAVE_ARCH_STRCPY 24 | extern char * strcpy(char *,const char *); 25 | #endif 26 | #ifndef __HAVE_ARCH_STRNCPY 27 | extern char * strncpy(char *,const char *, __kernel_size_t); 28 | #endif 29 | #ifndef __HAVE_ARCH_STRCAT 30 | extern char * strcat(char *, const char *); 31 | #endif 32 | #ifndef __HAVE_ARCH_STRNCAT 33 | extern char * strncat(char *, const char *, __kernel_size_t); 34 | #endif 35 | #ifndef __HAVE_ARCH_STRCMP 36 | extern int strcmp(const char *,const char *); 37 | #endif 38 | #ifndef __HAVE_ARCH_STRNCMP 39 | extern int strncmp(const char *,const char *,__kernel_size_t); 40 | #endif 41 | #ifndef __HAVE_ARCH_STRNICMP 42 | extern int strnicmp(const char *, const char *, __kernel_size_t); 43 | #endif 44 | #ifndef __HAVE_ARCH_STRCHR 45 | extern char * strchr(const char *,int); 46 | #endif 47 | #ifndef __HAVE_ARCH_STRRCHR 48 | extern char * strrchr(const char *,int); 49 | #endif 50 | #ifndef __HAVE_ARCH_STRSTR 51 | extern char * strstr(const char *,const char *); 52 | #endif 53 | #ifndef __HAVE_ARCH_STRLEN 54 | extern __kernel_size_t strlen(const char *); 55 | #endif 56 | #ifndef __HAVE_ARCH_STRNLEN 57 | extern __kernel_size_t strnlen(const char *,__kernel_size_t); 58 | #endif 59 | #ifndef __HAVE_ARCH_STRDUP 60 | extern char * strdup(const char *); 61 | #endif 62 | #ifndef __HAVE_ARCH_STRSWAB 63 | extern char * strswab(const char *); 64 | #endif 65 | 66 | #ifndef __HAVE_ARCH_MEMSET 67 | extern void * memset(void *,int,__kernel_size_t); 68 | #endif 69 | #ifndef __HAVE_ARCH_MEMCPY 70 | extern void * memcpy(void *,const void *,__kernel_size_t); 71 | #endif 72 | #ifndef __HAVE_ARCH_MEMMOVE 73 | extern void * memmove(void *,const void *,__kernel_size_t); 74 | #endif 75 | #ifndef __HAVE_ARCH_MEMSCAN 76 | extern void * memscan(void *,int,__kernel_size_t); 77 | #endif 78 | #ifndef __HAVE_ARCH_MEMCMP 79 | extern int memcmp(const void *,const void *,__kernel_size_t); 80 | #endif 81 | #ifndef __HAVE_ARCH_MEMCHR 82 | extern void * memchr(const void *,int,__kernel_size_t); 83 | #endif 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* _LINUX_STRING_H_ */ 90 | -------------------------------------------------------------------------------- /include/linux/unaligned/access_ok.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_UNALIGNED_ACCESS_OK_H 2 | #define _LINUX_UNALIGNED_ACCESS_OK_H 3 | 4 | #include 5 | 6 | static inline u16 get_unaligned_le16(const void *p) 7 | { 8 | return le16_to_cpup((__le16 *)p); 9 | } 10 | 11 | static inline u32 get_unaligned_le32(const void *p) 12 | { 13 | return le32_to_cpup((__le32 *)p); 14 | } 15 | 16 | static inline u64 get_unaligned_le64(const void *p) 17 | { 18 | return le64_to_cpup((__le64 *)p); 19 | } 20 | 21 | static inline u16 get_unaligned_be16(const void *p) 22 | { 23 | return be16_to_cpup((__be16 *)p); 24 | } 25 | 26 | static inline u32 get_unaligned_be32(const void *p) 27 | { 28 | return be32_to_cpup((__be32 *)p); 29 | } 30 | 31 | static inline u64 get_unaligned_be64(const void *p) 32 | { 33 | return be64_to_cpup((__be64 *)p); 34 | } 35 | 36 | static inline void put_unaligned_le16(u16 val, void *p) 37 | { 38 | *((__le16 *)p) = cpu_to_le16(val); 39 | } 40 | 41 | static inline void put_unaligned_le32(u32 val, void *p) 42 | { 43 | *((__le32 *)p) = cpu_to_le32(val); 44 | } 45 | 46 | static inline void put_unaligned_le64(u64 val, void *p) 47 | { 48 | *((__le64 *)p) = cpu_to_le64(val); 49 | } 50 | 51 | static inline void put_unaligned_be16(u16 val, void *p) 52 | { 53 | *((__be16 *)p) = cpu_to_be16(val); 54 | } 55 | 56 | static inline void put_unaligned_be32(u32 val, void *p) 57 | { 58 | *((__be32 *)p) = cpu_to_be32(val); 59 | } 60 | 61 | static inline void put_unaligned_be64(u64 val, void *p) 62 | { 63 | *((__be64 *)p) = cpu_to_be64(val); 64 | } 65 | 66 | #endif /* _LINUX_UNALIGNED_ACCESS_OK_H */ 67 | -------------------------------------------------------------------------------- /include/linux/unaligned/be_byteshift.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_UNALIGNED_BE_BYTESHIFT_H 2 | #define _LINUX_UNALIGNED_BE_BYTESHIFT_H 3 | 4 | #include 5 | 6 | static inline u16 __get_unaligned_be16(const u8 *p) 7 | { 8 | return p[0] << 8 | p[1]; 9 | } 10 | 11 | static inline u32 __get_unaligned_be32(const u8 *p) 12 | { 13 | return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]; 14 | } 15 | 16 | static inline u64 __get_unaligned_be64(const u8 *p) 17 | { 18 | return (u64)__get_unaligned_be32(p) << 32 | 19 | __get_unaligned_be32(p + 4); 20 | } 21 | 22 | static inline void __put_unaligned_be16(u16 val, u8 *p) 23 | { 24 | *p++ = val >> 8; 25 | *p++ = val; 26 | } 27 | 28 | static inline void __put_unaligned_be32(u32 val, u8 *p) 29 | { 30 | __put_unaligned_be16(val >> 16, p); 31 | __put_unaligned_be16(val, p + 2); 32 | } 33 | 34 | static inline void __put_unaligned_be64(u64 val, u8 *p) 35 | { 36 | __put_unaligned_be32(val >> 32, p); 37 | __put_unaligned_be32(val, p + 4); 38 | } 39 | 40 | static inline u16 get_unaligned_be16(const void *p) 41 | { 42 | return __get_unaligned_be16((const u8 *)p); 43 | } 44 | 45 | static inline u32 get_unaligned_be32(const void *p) 46 | { 47 | return __get_unaligned_be32((const u8 *)p); 48 | } 49 | 50 | static inline u64 get_unaligned_be64(const void *p) 51 | { 52 | return __get_unaligned_be64((const u8 *)p); 53 | } 54 | 55 | static inline void put_unaligned_be16(u16 val, void *p) 56 | { 57 | __put_unaligned_be16(val, p); 58 | } 59 | 60 | static inline void put_unaligned_be32(u32 val, void *p) 61 | { 62 | __put_unaligned_be32(val, p); 63 | } 64 | 65 | static inline void put_unaligned_be64(u64 val, void *p) 66 | { 67 | __put_unaligned_be64(val, p); 68 | } 69 | 70 | #endif /* _LINUX_UNALIGNED_BE_BYTESHIFT_H */ 71 | -------------------------------------------------------------------------------- /include/linux/unaligned/generic.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_UNALIGNED_GENERIC_H 2 | #define _LINUX_UNALIGNED_GENERIC_H 3 | 4 | /* define __force to nothing in U-Boot */ 5 | #define __force 6 | 7 | /* 8 | * Cause a link-time error if we try an unaligned access other than 9 | * 1,2,4 or 8 bytes long 10 | */ 11 | extern void __bad_unaligned_access_size(void); 12 | 13 | #define __get_unaligned_le(ptr) ((__force typeof(*(ptr)))({ \ 14 | __builtin_choose_expr(sizeof(*(ptr)) == 1, *(ptr), \ 15 | __builtin_choose_expr(sizeof(*(ptr)) == 2, get_unaligned_le16((ptr)), \ 16 | __builtin_choose_expr(sizeof(*(ptr)) == 4, get_unaligned_le32((ptr)), \ 17 | __builtin_choose_expr(sizeof(*(ptr)) == 8, get_unaligned_le64((ptr)), \ 18 | __bad_unaligned_access_size())))); \ 19 | })) 20 | 21 | #define __get_unaligned_be(ptr) ((__force typeof(*(ptr)))({ \ 22 | __builtin_choose_expr(sizeof(*(ptr)) == 1, *(ptr), \ 23 | __builtin_choose_expr(sizeof(*(ptr)) == 2, get_unaligned_be16((ptr)), \ 24 | __builtin_choose_expr(sizeof(*(ptr)) == 4, get_unaligned_be32((ptr)), \ 25 | __builtin_choose_expr(sizeof(*(ptr)) == 8, get_unaligned_be64((ptr)), \ 26 | __bad_unaligned_access_size())))); \ 27 | })) 28 | 29 | #define __put_unaligned_le(val, ptr) ({ \ 30 | void *__gu_p = (ptr); \ 31 | switch (sizeof(*(ptr))) { \ 32 | case 1: \ 33 | *(u8 *)__gu_p = (__force u8)(val); \ 34 | break; \ 35 | case 2: \ 36 | put_unaligned_le16((__force u16)(val), __gu_p); \ 37 | break; \ 38 | case 4: \ 39 | put_unaligned_le32((__force u32)(val), __gu_p); \ 40 | break; \ 41 | case 8: \ 42 | put_unaligned_le64((__force u64)(val), __gu_p); \ 43 | break; \ 44 | default: \ 45 | __bad_unaligned_access_size(); \ 46 | break; \ 47 | } \ 48 | (void)0; }) 49 | 50 | #define __put_unaligned_be(val, ptr) ({ \ 51 | void *__gu_p = (ptr); \ 52 | switch (sizeof(*(ptr))) { \ 53 | case 1: \ 54 | *(u8 *)__gu_p = (__force u8)(val); \ 55 | break; \ 56 | case 2: \ 57 | put_unaligned_be16((__force u16)(val), __gu_p); \ 58 | break; \ 59 | case 4: \ 60 | put_unaligned_be32((__force u32)(val), __gu_p); \ 61 | break; \ 62 | case 8: \ 63 | put_unaligned_be64((__force u64)(val), __gu_p); \ 64 | break; \ 65 | default: \ 66 | __bad_unaligned_access_size(); \ 67 | break; \ 68 | } \ 69 | (void)0; }) 70 | 71 | #endif /* _LINUX_UNALIGNED_GENERIC_H */ 72 | -------------------------------------------------------------------------------- /include/linux/unaligned/le_byteshift.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_UNALIGNED_LE_BYTESHIFT_H 2 | #define _LINUX_UNALIGNED_LE_BYTESHIFT_H 3 | 4 | #include 5 | 6 | static inline u16 __get_unaligned_le16(const u8 *p) 7 | { 8 | return p[0] | p[1] << 8; 9 | } 10 | 11 | static inline u32 __get_unaligned_le32(const u8 *p) 12 | { 13 | return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24; 14 | } 15 | 16 | static inline u64 __get_unaligned_le64(const u8 *p) 17 | { 18 | return (u64)__get_unaligned_le32(p + 4) << 32 | 19 | __get_unaligned_le32(p); 20 | } 21 | 22 | static inline void __put_unaligned_le16(u16 val, u8 *p) 23 | { 24 | *p++ = val; 25 | *p++ = val >> 8; 26 | } 27 | 28 | static inline void __put_unaligned_le32(u32 val, u8 *p) 29 | { 30 | __put_unaligned_le16(val >> 16, p + 2); 31 | __put_unaligned_le16(val, p); 32 | } 33 | 34 | static inline void __put_unaligned_le64(u64 val, u8 *p) 35 | { 36 | __put_unaligned_le32(val >> 32, p + 4); 37 | __put_unaligned_le32(val, p); 38 | } 39 | 40 | static inline u16 get_unaligned_le16(const void *p) 41 | { 42 | return __get_unaligned_le16((const u8 *)p); 43 | } 44 | 45 | static inline u32 get_unaligned_le32(const void *p) 46 | { 47 | return __get_unaligned_le32((const u8 *)p); 48 | } 49 | 50 | static inline u64 get_unaligned_le64(const void *p) 51 | { 52 | return __get_unaligned_le64((const u8 *)p); 53 | } 54 | 55 | static inline void put_unaligned_le16(u16 val, void *p) 56 | { 57 | __put_unaligned_le16(val, p); 58 | } 59 | 60 | static inline void put_unaligned_le32(u32 val, void *p) 61 | { 62 | __put_unaligned_le32(val, p); 63 | } 64 | 65 | static inline void put_unaligned_le64(u64 val, void *p) 66 | { 67 | __put_unaligned_le64(val, p); 68 | } 69 | 70 | #endif /* _LINUX_UNALIGNED_LE_BYTESHIFT_H */ 71 | -------------------------------------------------------------------------------- /include/linux/usb/atmel_usba_udc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Platform data definitions for Atmel USBA gadget driver 3 | * [Original from Linux kernel: include/linux/usb/atmel_usba_udc.h] 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | #ifndef __LINUX_USB_USBA_H__ 8 | #define __LINUX_USB_USBA_H__ 9 | 10 | struct usba_ep_data { 11 | char *name; 12 | int index; 13 | int fifo_size; 14 | int nr_banks; 15 | int can_dma; 16 | int can_isoc; 17 | }; 18 | 19 | struct usba_platform_data { 20 | int num_ep; 21 | struct usba_ep_data *ep; 22 | }; 23 | 24 | extern int usba_udc_probe(struct usba_platform_data *pdata); 25 | 26 | #endif /* __LINUX_USB_USBA_H */ 27 | -------------------------------------------------------------------------------- /include/logbuff.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2002 3 | * Detlev Zundel, dzu@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | #ifndef _LOGBUFF_H 24 | #define _LOGBUFF_H 25 | 26 | #ifdef CONFIG_LOGBUFFER 27 | 28 | #define LOGBUFF_LEN (16384) /* Must be 16k right now */ 29 | #define LOGBUFF_MASK (LOGBUFF_LEN-1) 30 | #define LOGBUFF_OVERHEAD (4096) /* Logbuffer overhead for extra info */ 31 | #define LOGBUFF_RESERVE (LOGBUFF_LEN+LOGBUFF_OVERHEAD) 32 | 33 | #define LOGBUFF_INITIALIZED (1<<31) 34 | 35 | int drv_logbuff_init (void); 36 | void logbuff_init_ptrs (void); 37 | void logbuff_log(char *msg); 38 | void logbuff_reset (void); 39 | 40 | #endif /* CONFIG_LOGBUFFER */ 41 | 42 | #endif /* _LOGBUFF_H */ 43 | -------------------------------------------------------------------------------- /include/lzma/LzmaDec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Fake include for LzmaDec.h 3 | * 4 | * Copyright (C) 2007-2009 Industrie Dial Face S.p.A. 5 | * Luigi 'Comio' Mantellini (luigi.mantellini@idf-hit.com) 6 | * 7 | * See file CREDITS for list of people who contributed to this 8 | * project. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 23 | * MA 02111-1307 USA 24 | */ 25 | 26 | #ifndef __LZMADEC_H__FAKE__ 27 | #define __LZMADEC_H__FAKE__ 28 | 29 | #include "../../lib_generic/LzmaDec.h" 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/lzma/LzmaTools.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Fake include for LzmaTools.h 3 | * 4 | * Copyright (C) 2007-2009 Industrie Dial Face S.p.A. 5 | * Luigi 'Comio' Mantellini (luigi.mantellini@idf-hit.com) 6 | * 7 | * See file CREDITS for list of people who contributed to this 8 | * project. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 23 | * MA 02111-1307 USA 24 | */ 25 | 26 | #ifndef __LZMATOOLS_H__FAKE__ 27 | #define __LZMATOOLS_H__FAKE__ 28 | 29 | #include "../../lib_generic/LzmaTools.h" 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/lzma/LzmaTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Fake include for Types.h 3 | * 4 | * Copyright (C) 2007-2009 Industrie Dial Face S.p.A. 5 | * Luigi 'Comio' Mantellini (luigi.mantellini@idf-hit.com) 6 | * 7 | * See file CREDITS for list of people who contributed to this 8 | * project. 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 23 | * MA 02111-1307 USA 24 | */ 25 | 26 | #ifndef __TYPES_H__FAKE__ 27 | #define __TYPES_H__FAKE__ 28 | 29 | /* 30 | *This avoids the collition with zlib.h Byte definition 31 | */ 32 | #define Byte LZByte 33 | 34 | #include "../../lib_generic/Types.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/mk48t59.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH 3 | * Andreas Heppel 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * Date & Time support for the MK48T59 RTC 26 | */ 27 | 28 | 29 | #if defined(CONFIG_RTC_MK48T59) && (CONFIG_COMMANDS & CFG_CMD_DATE) 30 | 31 | #define RTC_PORT_ADDR0 CFG_ISA_IO + 0x70 32 | #define RTC_PORT_ADDR1 RTC_PORT_ADDR0 + 0x1 33 | #define RTC_PORT_DATA CFG_ISA_IO + 0x76 34 | 35 | /* RTC Offsets */ 36 | #define RTC_SECONDS 0x1FF9 37 | #define RTC_MINUTES 0x1FFA 38 | #define RTC_HOURS 0x1FFB 39 | #define RTC_DAY_OF_WEEK 0x1FFC 40 | #define RTC_DAY_OF_MONTH 0x1FFD 41 | #define RTC_MONTH 0x1FFE 42 | #define RTC_YEAR 0x1FFF 43 | 44 | #define RTC_CONTROLA 0x1FF8 45 | #define RTC_CA_WRITE 0x80 46 | #define RTC_CA_READ 0x40 47 | #define RTC_CA_CALIB_SIGN 0x20 48 | #define RTC_CA_CALIB_MASK 0x1f 49 | 50 | #define RTC_CONTROLB 0x1FF9 51 | #define RTC_CB_STOP 0x80 52 | 53 | #define RTC_WATCHDOG 0x1FF7 54 | #define RTC_WDS 0x80 55 | #define RTC_WD_RB_16TH 0x0 56 | #define RTC_WD_RB_4TH 0x1 57 | #define RTC_WD_RB_1 0x2 58 | #define RTC_WD_RB_4 0x3 59 | 60 | void rtc_set_watchdog(short multi, short res); 61 | void *nvram_read(void *dest, const short src, size_t count); 62 | void nvram_write(short dest, const void *src, size_t count); 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /include/nand_api.h: -------------------------------------------------------------------------------- 1 | #ifndef _NAND_API_H_ 2 | #define _NAND_SPI_H_ 3 | 4 | 5 | unsigned long ranand_init(void); 6 | int nand_env_init(void); 7 | 8 | int ranand_write(char *buf, unsigned int to, int len); 9 | int ranand_read(char *buf, unsigned int from, int len); 10 | int ranand_erase(unsigned int offs, int len); 11 | int ranand_erase_write(char *buf, unsigned int offs, int count); 12 | 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/rtc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2001 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * Generic RTC interface. 26 | */ 27 | #ifndef _RTC_H_ 28 | #define _RTC_H_ 29 | 30 | /* 31 | * The struct used to pass data from the generic interface code to 32 | * the hardware dependend low-level code ande vice versa. Identical 33 | * to struct rtc_time used by the Linux kernel. 34 | * 35 | * Note that there are small but significant differences to the 36 | * common "struct time": 37 | * 38 | * struct time: struct rtc_time: 39 | * tm_mon 0 ... 11 1 ... 12 40 | * tm_year years since 1900 years since 0 41 | */ 42 | 43 | struct rtc_time { 44 | int tm_sec; 45 | int tm_min; 46 | int tm_hour; 47 | int tm_mday; 48 | int tm_mon; 49 | int tm_year; 50 | int tm_wday; 51 | int tm_yday; 52 | int tm_isdst; 53 | }; 54 | 55 | void rtc_get (struct rtc_time *); 56 | void rtc_set (struct rtc_time *); 57 | void rtc_reset (void); 58 | 59 | void GregorianDay (struct rtc_time *); 60 | void to_tm (int, struct rtc_time *); 61 | unsigned long mktime (unsigned int, unsigned int, unsigned int, 62 | unsigned int, unsigned int, unsigned int); 63 | 64 | #endif /* _RTC_H_ */ 65 | -------------------------------------------------------------------------------- /include/serial.h: -------------------------------------------------------------------------------- 1 | #ifndef __SERIAL_H__ 2 | #define __SERIAL_H__ 3 | 4 | #define NAMESIZE 16 5 | #define CTLRSIZE 8 6 | 7 | struct serial_device { 8 | char name[NAMESIZE]; 9 | char ctlr[CTLRSIZE]; 10 | 11 | int (*init) (void); 12 | void (*setbrg) (void); 13 | int (*getc) (void); 14 | int (*tstc) (void); 15 | void (*putc) (const char c); 16 | void (*puts) (const char *s); 17 | 18 | struct serial_device *next; 19 | }; 20 | 21 | extern struct serial_device serial_smc_device; 22 | extern struct serial_device serial_scc_device; 23 | extern struct serial_device * default_serial_console (void); 24 | 25 | #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) \ 26 | || defined(CONFIG_405EP) 27 | extern struct serial_device serial0_device; 28 | extern struct serial_device serial1_device; 29 | #endif 30 | 31 | 32 | extern void serial_initialize(void); 33 | extern void serial_devices_init(void); 34 | extern int serial_assign(char * name); 35 | extern void serial_reinit_all(void); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/spi_api.h: -------------------------------------------------------------------------------- 1 | #ifndef _SPI_API_H_ 2 | #define _SPI_SPI_H_ 3 | 4 | 5 | unsigned long raspi_init(void); 6 | int spi_env_init(void); 7 | 8 | int raspi_write(char *buf, unsigned int to, int len); 9 | int raspi_read(char *buf, unsigned int from, int len); 10 | int raspi_erase(unsigned int offs, int len); 11 | int raspi_erase_write(char *buf, unsigned int offs, int count); 12 | 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/systemace.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYSTEMACE_H 2 | #define __SYSTEMACE_H 3 | /* 4 | * Copyright (c) 2004 Picture Elements, Inc. 5 | * Stephen Williams (steve@picturel.com) 6 | * 7 | * This source code is free software; you can redistribute it 8 | * and/or modify it in source code form under the terms of the GNU 9 | * General Public License as published by the Free Software 10 | * Foundation; either version 2 of the License, or (at your option) 11 | * any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 21 | */ 22 | #ident "$Id: //WIFI_SOC/MP/SDK_4_3_0_0/Uboot/include/systemace.h#1 $" 23 | 24 | #ifdef CONFIG_SYSTEMACE 25 | 26 | # include 27 | 28 | block_dev_desc_t * systemace_get_dev(int dev); 29 | 30 | #endif /* CONFIG_SYSTEMACE */ 31 | #endif /* __SYSTEMACE_H */ 32 | -------------------------------------------------------------------------------- /include/unxz.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Wrapper for XZ decompressor to make it usable for kernel and initramfs 3 | * decompression 4 | * 5 | * Author: Lasse Collin 6 | * 7 | * This file has been put into the public domain. 8 | * You can do whatever you want with this file. 9 | */ 10 | 11 | #ifndef DECOMPRESS_UNXZ_H 12 | #define DECOMPRESS_UNXZ_H 13 | 14 | int unxz(unsigned char *in, int in_size, unsigned char *out, int *in_used); 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /include/watchdog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2001 3 | * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * Watchdog functions and macros. 26 | */ 27 | #ifndef _WATCHDOG_H_ 28 | #define _WATCHDOG_H_ 29 | 30 | #if defined(CONFIG_HW_WATCHDOG) && defined(CONFIG_WATCHDOG) 31 | # error "Configuration error: CONFIG_HW_WATCHDOG and CONFIG_WATCHDOG can't be used together." 32 | #endif 33 | 34 | #if defined(__ASSEMBLY__) && defined(__NIOS__) 35 | # error "Configuration error: WATCHDOG_RESET inside assembler not supported for Nios platforms." 36 | #endif 37 | 38 | /* 39 | * Hardware watchdog 40 | */ 41 | #ifdef CONFIG_HW_WATCHDOG 42 | #if defined(__ASSEMBLY__) 43 | #define WATCHDOG_RESET bl hw_watchdog_reset 44 | #else 45 | extern void hw_watchdog_reset(void); 46 | 47 | #define WATCHDOG_RESET hw_watchdog_reset 48 | #endif /* __ASSEMBLY__ */ 49 | #else 50 | /* 51 | * Maybe a software watchdog? 52 | */ 53 | #if defined(CONFIG_WATCHDOG) 54 | #if defined(__ASSEMBLY__) 55 | #define WATCHDOG_RESET bl watchdog_reset 56 | #else 57 | extern void watchdog_reset(void); 58 | 59 | #define WATCHDOG_RESET watchdog_reset 60 | #endif 61 | #else 62 | /* 63 | * No hardware or software watchdog. 64 | */ 65 | #if defined(__ASSEMBLY__) 66 | #define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/ 67 | #else 68 | #define WATCHDOG_RESET() {} 69 | #endif /* __ASSEMBLY__ */ 70 | #endif /* CONFIG_WATCHDOG && !__ASSEMBLY__ */ 71 | #endif /* CONFIG_HW_WATCHDOG */ 72 | 73 | /* 74 | * Prototypes from $(CPU)/cpu.c. 75 | */ 76 | 77 | /* MPC 8xx */ 78 | #if (defined(CONFIG_8xx) || defined(CONFIG_MPC860)) && !defined(__ASSEMBLY__) 79 | void reset_8xx_watchdog(volatile immap_t *immr); 80 | #endif 81 | 82 | /* MPC 5xx */ 83 | #if defined(CONFIG_5xx) && !defined(__ASSEMBLY__) 84 | void reset_5xx_watchdog(volatile immap_t *immr); 85 | #endif 86 | 87 | /* IBM 4xx */ 88 | #if defined(CONFIG_4xx) && !defined(__ASSEMBLY__) 89 | void reset_4xx_watchdog(void); 90 | #endif 91 | 92 | #endif /* _WATCHDOG_H_ */ 93 | -------------------------------------------------------------------------------- /lib_generic/LzmaTools.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Usefuls routines based on the LzmaTest.c file from LZMA SDK 4.65 3 | * 4 | * Copyright (C) 2007-2008 Industrie Dial Face S.p.A. 5 | * Luigi 'Comio' Mantellini (luigi.mantellini@idf-hit.com) 6 | * 7 | * Copyright (C) 1999-2005 Igor Pavlov 8 | * 9 | * See file CREDITS for list of people who contributed to this 10 | * project. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License as 14 | * published by the Free Software Foundation; either version 2 of 15 | * the License, or (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 25 | * MA 02111-1307 USA 26 | */ 27 | 28 | #ifndef __LZMA_TOOL_H__ 29 | #define __LZMA_TOOL_H__ 30 | 31 | #include 32 | 33 | extern int lzmaBuffToBuffDecompress (unsigned char *outStream, SizeT *uncompressedSize, 34 | unsigned char *inStream, SizeT length); 35 | #endif 36 | -------------------------------------------------------------------------------- /lib_generic/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000-2002 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = libgeneric.a 27 | 28 | OBJS = crc32.o ctype.o display_options.o string.o vsprintf.o 29 | 30 | ifeq ($(CONFIG_GZIP),ON) 31 | OBJS += zlib.o 32 | endif 33 | 34 | ifeq ($(CONFIG_BZIP2),ON) 35 | OBJS += bzlib.o bzlib_crctable.o bzlib_randtable.o bzlib_decompress.o bzlib_huffman.o 36 | endif 37 | 38 | ifeq ($(CONFIG_LZMA),ON) 39 | OBJS += LzmaDecode.o 40 | endif 41 | 42 | ifeq ($(CONFIG_XZ),ON) 43 | OBJS += decompress_unxz.o xz_dec_bcj.o xz_dec_lzma2.o xz_dec_stream.o 44 | endif 45 | 46 | $(LIB): .depend $(OBJS) 47 | $(AR) crv $@ $(OBJS) 48 | 49 | ######################################################################### 50 | 51 | .depend: Makefile $(OBJS:.o=.c) 52 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 53 | 54 | sinclude .depend 55 | 56 | ######################################################################### 57 | -------------------------------------------------------------------------------- /lib_generic/ctype.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * linux/lib/ctype.c 26 | * 27 | * Copyright (C) 1991, 1992 Linus Torvalds 28 | */ 29 | 30 | #include 31 | 32 | unsigned char _ctype[] = { 33 | _C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */ 34 | _C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */ 35 | _C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */ 36 | _C,_C,_C,_C,_C,_C,_C,_C, /* 24-31 */ 37 | _S|_SP,_P,_P,_P,_P,_P,_P,_P, /* 32-39 */ 38 | _P,_P,_P,_P,_P,_P,_P,_P, /* 40-47 */ 39 | _D,_D,_D,_D,_D,_D,_D,_D, /* 48-55 */ 40 | _D,_D,_P,_P,_P,_P,_P,_P, /* 56-63 */ 41 | _P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U, /* 64-71 */ 42 | _U,_U,_U,_U,_U,_U,_U,_U, /* 72-79 */ 43 | _U,_U,_U,_U,_U,_U,_U,_U, /* 80-87 */ 44 | _U,_U,_U,_P,_P,_P,_P,_P, /* 88-95 */ 45 | _P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L, /* 96-103 */ 46 | _L,_L,_L,_L,_L,_L,_L,_L, /* 104-111 */ 47 | _L,_L,_L,_L,_L,_L,_L,_L, /* 112-119 */ 48 | _L,_L,_L,_P,_P,_P,_P,_C, /* 120-127 */ 49 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 128-143 */ 50 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 144-159 */ 51 | _S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 160-175 */ 52 | _P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 176-191 */ 53 | _U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U, /* 192-207 */ 54 | _U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L, /* 208-223 */ 55 | _L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L, /* 224-239 */ 56 | _L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */ 57 | -------------------------------------------------------------------------------- /lib_generic/display_options.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000-2002 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #include 25 | 26 | int display_options (void) 27 | { 28 | extern char version_string[]; 29 | 30 | #if defined(BUILD_TAG) 31 | printf ("\n\n%s, Build: %s\n\n", version_string, BUILD_TAG); 32 | #else 33 | printf ("\n\n%s\n\n", version_string); 34 | #endif 35 | return 0; 36 | } 37 | 38 | /* 39 | * print sizes as "xxx kB", "xxx.y kB", "xxx MB" or "xxx.y MB" as needed; 40 | * allow for optional trailing string (like "\n") 41 | */ 42 | void print_size (ulong size, const char *s) 43 | { 44 | ulong m, n; 45 | ulong d = 1 << 20; /* 1 MB */ 46 | char c = 'M'; 47 | 48 | if (size < d) { /* print in kB */ 49 | c = 'k'; 50 | d = 1 << 10; 51 | } 52 | 53 | n = size / d; 54 | 55 | m = (10 * (size - (n * d)) + (d / 2) ) / d; 56 | 57 | if (m >= 10) { 58 | m -= 10; 59 | n += 1; 60 | } 61 | 62 | printf ("%2ld", n); 63 | if (m) { 64 | printf (".%ld", m); 65 | } 66 | printf (" %cB%s", c, s); 67 | } 68 | -------------------------------------------------------------------------------- /lib_generic/xz_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions for handling the .xz file format 3 | * 4 | * Author: Lasse Collin 5 | * 6 | * This file has been put into the public domain. 7 | * You can do whatever you want with this file. 8 | */ 9 | 10 | #ifndef XZ_STREAM_H 11 | #define XZ_STREAM_H 12 | 13 | /* 14 | * See the .xz file format specification at 15 | * http://tukaani.org/xz/xz-file-format.txt 16 | * to understand the container format. 17 | */ 18 | 19 | #define STREAM_HEADER_SIZE 12 20 | 21 | //#define HEADER_MAGIC "\3757zXZ" 22 | #define HEADER_MAGIC_SIZE 6 23 | 24 | #define FOOTER_MAGIC "YZ" 25 | #define FOOTER_MAGIC_SIZE 2 26 | 27 | /* 28 | * Variable-length integer can hold a 63-bit unsigned integer, or a special 29 | * value to indicate that the value is unknown. 30 | */ 31 | typedef uint64_t vli_type; 32 | 33 | #define VLI_MAX ((vli_type)-1 / 2) 34 | #define VLI_UNKNOWN ((vli_type)-1) 35 | 36 | /* Maximum encoded size of a VLI */ 37 | #define VLI_BYTES_MAX (sizeof(vli_type) * 8 / 7) 38 | 39 | /* Integrity Check types */ 40 | enum xz_check { 41 | XZ_CHECK_NONE = 0, 42 | XZ_CHECK_CRC32 = 1, 43 | XZ_CHECK_CRC64 = 4, 44 | XZ_CHECK_SHA256 = 10 45 | }; 46 | 47 | /* Maximum possible Check ID */ 48 | #define XZ_CHECK_MAX 15 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /lib_mips/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = lib$(ARCH).a 27 | 28 | AOBJS = 29 | 30 | COBJS = board.o time.o mips_linux.o 31 | ifeq ($(MT7621_MP), y) 32 | COBJS += ashldi3.o ashrdi3.o lshrdi3.o 33 | ifeq ($(MT7621_FPGA_BOARD), y) 34 | COBJS += ddr_init.o 35 | endif 36 | endif 37 | 38 | OBJS = $(AOBJS) $(COBJS) 39 | 40 | $(LIB): .depend $(OBJS) 41 | $(AR) crv $@ $(OBJS) 42 | 43 | ######################################################################### 44 | 45 | .depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) 46 | $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@ 47 | 48 | sinclude .depend 49 | 50 | ######################################################################### 51 | -------------------------------------------------------------------------------- /lib_mips/ashldi3.c: -------------------------------------------------------------------------------- 1 | //#include 2 | 3 | #include "libgcc.h" 4 | 5 | long long __ashldi3(long long u, word_type b) 6 | { 7 | DWunion uu, w; 8 | word_type bm; 9 | 10 | if (b == 0) 11 | return u; 12 | 13 | uu.ll = u; 14 | bm = 32 - b; 15 | 16 | if (bm <= 0) { 17 | w.s.low = 0; 18 | w.s.high = (unsigned int) uu.s.low << -bm; 19 | } else { 20 | const unsigned int carries = (unsigned int) uu.s.low >> bm; 21 | 22 | w.s.low = (unsigned int) uu.s.low << b; 23 | w.s.high = ((unsigned int) uu.s.high << b) | carries; 24 | } 25 | 26 | return w.ll; 27 | } 28 | 29 | //EXPORT_SYMBOL(__ashldi3); 30 | -------------------------------------------------------------------------------- /lib_mips/ashrdi3.c: -------------------------------------------------------------------------------- 1 | //#include 2 | 3 | #include "libgcc.h" 4 | 5 | long long __ashrdi3(long long u, word_type b) 6 | { 7 | DWunion uu, w; 8 | word_type bm; 9 | 10 | if (b == 0) 11 | return u; 12 | 13 | uu.ll = u; 14 | bm = 32 - b; 15 | 16 | if (bm <= 0) { 17 | /* w.s.high = 1..1 or 0..0 */ 18 | w.s.high = 19 | uu.s.high >> 31; 20 | w.s.low = uu.s.high >> -bm; 21 | } else { 22 | const unsigned int carries = (unsigned int) uu.s.high << bm; 23 | 24 | w.s.high = uu.s.high >> b; 25 | w.s.low = ((unsigned int) uu.s.low >> b) | carries; 26 | } 27 | 28 | return w.ll; 29 | } 30 | 31 | //EXPORT_SYMBOL(__ashrdi3); 32 | -------------------------------------------------------------------------------- /lib_mips/ddr3.h: -------------------------------------------------------------------------------- 1 | RALINK_REG(0xbe005018)=0x0e0e0e0e; 2 | RALINK_REG(0xbe005048)=0x0000d10d; 3 | RALINK_REG(0xbe0050d8)=0x00100900; 4 | RALINK_REG(0xbe0050f0)=0x00000000; 5 | udelay_a(200*oneusec); 6 | RALINK_REG(0xbe0050e4)=0x000000b3; 7 | udelay_a(500*oneusec); 8 | RALINK_REG(0xbe005090)=0x00000000; 9 | RALINK_REG(0xbe005094)=0x80000000; 10 | RALINK_REG(0xbe0050dc)=0x83000000; 11 | RALINK_REG(0xbe0050e0)=0x14000000; 12 | RALINK_REG(0xbe0050f4)=0x01000000; 13 | RALINK_REG(0xbe0050fc)=0x07100000; 14 | RALINK_REG(0xbe005168)=0x00000080; 15 | RALINK_REG(0xbe005130)=0x30000000; 16 | udelay_a(1*oneusec); 17 | RALINK_REG(0xbe0050d8)=0x00300900; 18 | RALINK_REG(0xbe005004)=0xf07486a1; 19 | RALINK_REG(0xbe0051ec)=0x00000000; 20 | RALINK_REG(0xbe00508c)=0x00000000; 21 | RALINK_REG(0xbe005124)=0x80000000; 22 | RALINK_REG(0xbe005094)=0x00000000;//0x40404040; 23 | RALINK_REG(0xbe0051c0)=0x00000000; 24 | RALINK_REG(0xbe00507c)=0xc2872215; 25 | RALINK_REG(0xbe005028)=0xf1200f01; 26 | RALINK_REG(0xbe005158)=0x00000000; 27 | RALINK_REG(0xbe0051e0)=0x8c000000; 28 | RALINK_REG(0xbe0050e4)=0x000000b7; 29 | udelay_a(2*oneusec); 30 | RALINK_REG(0xbe005110)=0x00051100; 31 | RALINK_REG(0xbe005088)=0x00004010; 32 | RALINK_REG(0xbe0051e4)=0x00000001; 33 | udelay_a(1*oneusec); 34 | RALINK_REG(0xbe0051e4)=0x00000000; 35 | RALINK_REG(0xbe005088)=0x00006000; 36 | RALINK_REG(0xbe0051e4)=0x00000001; 37 | udelay_a(1*oneusec); 38 | RALINK_REG(0xbe0051e4)=0x00000000; 39 | RALINK_REG(0xbe005088)=0x00002040; 40 | RALINK_REG(0xbe0051e4)=0x00000001; 41 | udelay_a(1*oneusec); 42 | RALINK_REG(0xbe0051e4)=0x00000000; 43 | RALINK_REG(0xbe005088)=0x00001b61; 44 | RALINK_REG(0xbe0051e4)=0x00000001; 45 | udelay_a(1*oneusec); 46 | RALINK_REG(0xbe0051e4)=0x00000000; 47 | RALINK_REG(0xbe005088)=0x00000400; 48 | RALINK_REG(0xbe0051e4)=0x00000010; 49 | udelay_a(1*oneusec); 50 | RALINK_REG(0xbe0051e4)=0x00000000; 51 | udelay_a(1*oneusec); 52 | RALINK_REG(0xbe0051e4)=0x00001100; 53 | RALINK_REG(0xbe0050e4)=0x000022b3; 54 | RALINK_REG(0xbe0051e0)=0x8c000000; 55 | RALINK_REG(0xbe00507c)=0xc2872211;//0xc287221d; 56 | RALINK_REG(0xbe0051dc)=0x15602842; 57 | RALINK_REG(0xbe00500c)=0x02000000; 58 | RALINK_REG(0xbe005000)=0x44694683; 59 | RALINK_REG(0xbe005044)=0x9f060481; 60 | RALINK_REG(0xbe0051e8)=0x00000210; 61 | RALINK_REG(0xbe005010)=0x00008888; 62 | RALINK_REG(0xbe0050f8)=0xedcb000f; 63 | RALINK_REG(0xbe0051d8)=0x00c80008; 64 | RALINK_REG(0xbe005008)=0x03046948; 65 | RALINK_REG(0xbe005200)=0x88888888; 66 | RALINK_REG(0xbe005204)=0x88888888; 67 | RALINK_REG(0xbe005208)=0x88888888; 68 | RALINK_REG(0xbe00520c)=0x88888888; 69 | RALINK_REG(0xbe005014)=0x00008888; 70 | -------------------------------------------------------------------------------- /lib_mips/libgcc.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_LIBGCC_H 2 | #define __ASM_LIBGCC_H 3 | 4 | #include 5 | 6 | typedef int word_type __attribute__ ((mode (__word__))); 7 | 8 | #ifdef __BIG_ENDIAN 9 | struct DWstruct { 10 | int high, low; 11 | }; 12 | #elif defined(__LITTLE_ENDIAN) 13 | struct DWstruct { 14 | int low, high; 15 | }; 16 | #else 17 | #error I feel sick. 18 | #endif 19 | 20 | typedef union { 21 | struct DWstruct s; 22 | long long ll; 23 | } DWunion; 24 | 25 | #endif /* __ASM_LIBGCC_H */ 26 | -------------------------------------------------------------------------------- /lib_mips/lshrdi3.c: -------------------------------------------------------------------------------- 1 | //#include 2 | 3 | #include "libgcc.h" 4 | 5 | long long __lshrdi3(long long u, word_type b) 6 | { 7 | DWunion uu, w; 8 | word_type bm; 9 | 10 | if (b == 0) 11 | return u; 12 | 13 | uu.ll = u; 14 | bm = 32 - b; 15 | 16 | if (bm <= 0) { 17 | w.s.high = 0; 18 | w.s.low = (unsigned int) uu.s.high >> -bm; 19 | } else { 20 | const unsigned int carries = (unsigned int) uu.s.high << bm; 21 | 22 | w.s.high = (unsigned int) uu.s.high >> b; 23 | w.s.low = ((unsigned int) uu.s.low >> b) | carries; 24 | } 25 | 26 | return w.ll; 27 | } 28 | 29 | //EXPORT_SYMBOL(__lshrdi3); 30 | -------------------------------------------------------------------------------- /lib_mips/mpll40Mhz.h: -------------------------------------------------------------------------------- 1 | RALINK_REG(0xbe005648)=0xc0005ab2; 2 | RALINK_REG(0xbe005640)=0x00000223; 3 | RALINK_REG(0xbe005604)=0x00040002; 4 | udelay_a(1*oneusec); 5 | RALINK_REG(0xbe005604)=0x00040003; 6 | udelay_a(2*oneusec); 7 | RALINK_REG(0xbe005600)=0x0c041981; 8 | RALINK_REG(0xbe005600)=0x0e041981; 9 | udelay_a(20*oneusec); 10 | RALINK_REG(0xbe00560c)=0x00080440; 11 | RALINK_REG(0xbe00560c)=0x00090440; 12 | udelay_a(2*oneusec); 13 | RALINK_REG(0xbe005600)=0x0e041985; 14 | udelay_a(20*oneusec); 15 | /* XTAL=40MHZ */ 16 | RALINK_REG(0xbe005604)=0x00040103; 17 | udelay_a(1*oneusec); 18 | RALINK_REG(0xbe005648)=0xc0005ab2; 19 | #if defined (MPLL_IN_LBK) 20 | /* if MEPLL internal loopback */ 21 | #if defined (MEMPLL_CLK_600) 22 | RALINK_REG(0xbe005618)=0xc00009e2; 23 | RALINK_REG(0xbe005624)=0xc00009e2; 24 | RALINK_REG(0xbe005630)=0xc00009e2; 25 | RALINK_REG(0xbe005618)=0xc20009e2; 26 | RALINK_REG(0xbe005624)=0xc20009e2; 27 | RALINK_REG(0xbe005630)=0xc20009e2; 28 | #elif defined (MEMPLL_CLK_400) 29 | RALINK_REG(0xbe005618)=0xc0000942; 30 | RALINK_REG(0xbe005624)=0xc0000942; 31 | RALINK_REG(0xbe005630)=0xc0000942; 32 | RALINK_REG(0xbe005618)=0xc2000942; 33 | RALINK_REG(0xbe005624)=0xc2000942; 34 | RALINK_REG(0xbe005630)=0xc2000942; 35 | #elif defined (MEMPLL_CLK_200) 36 | RALINK_REG(0xbe005618)=0xc4000942; 37 | RALINK_REG(0xbe005624)=0xc4000942; 38 | RALINK_REG(0xbe005630)=0xc4000942; 39 | RALINK_REG(0xbe005618)=0xc6000942; 40 | RALINK_REG(0xbe005624)=0xc6000942; 41 | RALINK_REG(0xbe005630)=0xc6000942; 42 | #else 43 | #error "MEMPLL clock not defined" 44 | #endif 45 | RALINK_REG(0xbe005648)=0xc2005ab2; 46 | udelay_a(20*oneusec); 47 | RALINK_REG(0xbe005640)=0x00000233; 48 | #else /* else MEPLL external loopback */ 49 | #if defined (MEMPLL_CLK_600) 50 | RALINK_REG(0xbe005618)=0xc00008fa; 51 | RALINK_REG(0xbe005624)=0xc00008fa; 52 | RALINK_REG(0xbe005630)=0xc00008fa; 53 | RALINK_REG(0xbe005624)=0xc20008fa; 54 | RALINK_REG(0xbe005630)=0xc20008fa; 55 | #elif defined (MEMPLL_CLK_400) 56 | RALINK_REG(0xbe005618)=0xc00008aa; 57 | RALINK_REG(0xbe005624)=0xc00008aa; 58 | RALINK_REG(0xbe005630)=0xc00008aa; 59 | RALINK_REG(0xbe005618)=0xc20008aa; 60 | RALINK_REG(0xbe005624)=0xc20008aa; 61 | RALINK_REG(0xbe005630)=0xc20008aa; 62 | #elif defined (MEMPLL_CLK_200) 63 | RALINK_REG(0xbe005618)=0xc400085a; 64 | RALINK_REG(0xbe005624)=0xc400085a; 65 | RALINK_REG(0xbe005630)=0xc400085a; 66 | RALINK_REG(0xbe005618)=0xc600085a; 67 | RALINK_REG(0xbe005624)=0xc600085a; 68 | RALINK_REG(0xbe005630)=0xc600085a; 69 | #else 70 | #error "MEMPLL clock not defined" 71 | #endif 72 | RALINK_REG(0xbe005648)=0xc2005ab2; 73 | udelay_a(20*oneusec); 74 | RALINK_REG(0xbe005640)=0x00000233; 75 | #endif /* end of MPLL_IN_LBK */ 76 | -------------------------------------------------------------------------------- /lib_mips/time.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #include 25 | 26 | extern unsigned long mips_cpu_feq; 27 | 28 | static void mips_compare_set(u32 v) 29 | { 30 | asm volatile ("mtc0 %0, $11" : : "r" (v)); 31 | } 32 | 33 | static void mips_count_set(u32 v) 34 | { 35 | asm volatile ("mtc0 %0, $9" : : "r" (v)); 36 | } 37 | 38 | static u32 mips_count_get(void) 39 | { 40 | u32 count; 41 | 42 | asm volatile ("mfc0 %0, $9" : "=r" (count) :); 43 | return count; 44 | } 45 | 46 | /* 47 | * timer without interrupts 48 | */ 49 | int timer_init(void) 50 | { 51 | 52 | mips_compare_set(0); 53 | mips_count_set(0); 54 | 55 | return 0; 56 | } 57 | 58 | 59 | ulong get_timer(ulong base) 60 | { 61 | //printf("%s = %x\n", __FUNCTION__, mips_count_get() ); 62 | return mips_count_get() - base; 63 | } 64 | 65 | 66 | void udelay (unsigned long usec) 67 | { 68 | ulong tmo; 69 | ulong start = get_timer(0); 70 | 71 | tmo = usec * ((mips_cpu_feq/2) / 1000000); 72 | while ((ulong)((mips_count_get() - start)) < tmo) 73 | /*NOP*/; 74 | } 75 | 76 | void mdelay(unsigned long msec) 77 | { 78 | while (msec--) 79 | udelay(1000); 80 | } 81 | 82 | #if 0 83 | /* 84 | * This function is derived from PowerPC code (read timebase as long long). 85 | * On MIPS it just returns the timer value. 86 | */ 87 | unsigned long long get_ticks(void) 88 | { 89 | return mips_count_get(); 90 | } 91 | 92 | /* 93 | * This function is derived from PowerPC code (timebase clock frequency). 94 | * On MIPS it returns the number of timer ticks per second. 95 | */ 96 | ulong get_tbclk(void) 97 | { 98 | return CFG_HZ; 99 | } 100 | 101 | void reset_timer(void) 102 | { 103 | mips_count_set(0); 104 | } 105 | 106 | void set_timer(ulong t) 107 | { 108 | mips_count_set(t); 109 | } 110 | #endif 111 | -------------------------------------------------------------------------------- /mips_config.mk: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__ 25 | -------------------------------------------------------------------------------- /mkconfig: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # Script to create header files and links to configure 4 | # U-Boot for a specific board. 5 | # 6 | # Parameters: Target Architecture CPU Board [VENDOR] [SOC] 7 | # 8 | # (C) 2002 DENX Software Engineering, Wolfgang Denk 9 | # 10 | 11 | APPEND=no # Default: Create new config file 12 | 13 | while [ $# -gt 0 ] ; do 14 | case "$1" in 15 | --) shift ; break ;; 16 | -a) shift ; APPEND=yes ;; 17 | *) break ;; 18 | esac 19 | done 20 | 21 | [ $# -lt 4 ] && exit 1 22 | [ $# -gt 6 ] && exit 1 23 | 24 | echo "Configuring for $1 board..." 25 | 26 | cd ./include 27 | 28 | # 29 | # Create link to architecture specific headers 30 | # 31 | rm -f asm 32 | ln -s asm-$2 asm 33 | rm -f asm-$2/arch 34 | ln -s arch-$3 asm-$2/arch 35 | 36 | if [ "$2" = "arm" ] ; then 37 | rm -f asm-$2/proc 38 | ln -s proc-armv asm-$2/proc 39 | fi 40 | 41 | # 42 | # Create include file for Make 43 | # 44 | echo "ARCH = $2" > config.mk 45 | echo "CPU = $3" >> config.mk 46 | echo "BOARD = $4" >> config.mk 47 | 48 | [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk 49 | 50 | [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk 51 | 52 | # 53 | # Create board specific header file 54 | # 55 | if [ "$APPEND" = "yes" ] # Append to existing config file 56 | then 57 | echo >> config.h 58 | else 59 | > config.h # Create new config file 60 | fi 61 | echo "/* Automatically generated - do not edit */" >>config.h 62 | echo "#include " >>config.h 63 | 64 | exit 0 65 | -------------------------------------------------------------------------------- /mt7621_ddr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | VAR=$4 4 | DDR3=$(echo ${VAR##*DDR3}) 5 | 6 | if [ "$DDR3" == "$4" ]; then 7 | ddr_param_offset=200 8 | else 9 | ddr_param_offset=96 10 | fi 11 | 12 | LINE_NUM=$(cat ./$3|sed -n "/$4/=") 13 | LINE_NUM=$(echo $LINE_NUM + "1"|bc) 14 | 15 | if [ "$5" == "IN_NAND" ]; then 16 | offset=$ddr_param_offset 17 | sed -n "${LINE_NUM}p" ./$3|xxd -r -c 32|dd bs=1 count=32 seek=$offset of=$2 conv=notrunc 18 | offset=$(echo $offset + "32"|bc) 19 | LINE_NUM=$(echo $LINE_NUM + "1"|bc) 20 | sed -n "${LINE_NUM}p" ./$3|xxd -r -c 32|dd bs=1 count=32 seek=$offset of=$2 conv=notrunc 21 | offset=$(echo $offset + "32"|bc) 22 | LINE_NUM=$(echo $LINE_NUM + "1"|bc) 23 | sed -n "${LINE_NUM}p" ./$3|xxd -r -c 32|dd bs=1 count=32 seek=$offset of=$2 conv=notrunc 24 | else 25 | offset=$(echo "(($(stat -c %s uboot.bin)+$ddr_param_offset))" |bc) 26 | sed -n "${LINE_NUM}p" ./$3|xxd -r -c 32|dd bs=1 count=32 seek=$offset of=$2 conv=notrunc 27 | LINE_NUM=$(echo $LINE_NUM + "1"|bc) 28 | offset=$(echo $offset + "32"|bc) 29 | sed -n "${LINE_NUM}p" ./$3|xxd -r -c 32|dd bs=1 count=32 seek=$offset of=$2 conv=notrunc 30 | LINE_NUM=$(echo $LINE_NUM + "1"|bc) 31 | offset=$(echo $offset + "32"|bc) 32 | sed -n "${LINE_NUM}p" ./$3|xxd -r -c 32|dd bs=1 count=32 seek=$offset of=$2 conv=notrunc 33 | fi 34 | 35 | -------------------------------------------------------------------------------- /mt7621_ddr_param.txt: -------------------------------------------------------------------------------- 1 | [DEFAULT_DDR2_512M] 2 | 0xAA00AA00 0xAA00AA00 0x00000007 0x22174441 0x00000000 0xF0748661 0x40001273 0x9F0A0481 3 | 0x0304692F 0x15602842 0x00008888 0x88888888 0x00000000 0x00000000 0x00000000 0x07100000 4 | 0x00001B63 0x00002000 0x00004000 0x00006000 0x00000000 0x00000000 0x00000000 0x00000000 5 | [W9751G6KB_A02_DDR2_1066_512M] 6 | 0xAA00AA00 0xAA00AA00 0x00000007 0x33484584 0x00000000 0xF07486A1 0x50001273 0x9F010481 7 | 0x0304693F 0x15602842 0x00008888 0x88888888 0x00000000 0x00000000 0x00000010 0x07100000 8 | 0x00001F73 0x00002000 0x00004000 0x00006000 0x00000000 0x00000000 0x00000000 0x00000000 9 | [DEFAULT_DDR2_1024M] 10 | 0xAA00AA00 0xAA00AA00 0x00000007 0x22174441 0x01000000 0xF0748661 0x40001273 0x9F0F0481 11 | 0x0304692F 0x15602842 0x00008888 0x88888888 0x00000000 0x00000000 0x00000000 0x07100000 12 | 0x00001B63 0x00002000 0x00004000 0x00006000 0x00000000 0x00000000 0x00000000 0x00000000 13 | [W971GG6KB25_DDR2_800_1024M] 14 | 0xAA00AA00 0xAA00AA00 0x00000007 0x22174430 0x01000000 0xF0748661 0x40001273 0x9F0F0481 15 | 0x0304692F 0x15602842 0x00008888 0x88888888 0x00000000 0x00000000 0x00000000 0x07100000 16 | 0x00001B63 0x00002000 0x00004000 0x00006000 0x00000000 0x00000000 0x00000000 0x00000000 17 | [W971GG6KB18_DDR2_1066_1024M] 18 | 0xAA00AA00 0xAA00AA00 0x00000007 0x33484584 0x01000000 0xF07486A1 0x50001273 0x9F070481 19 | 0x0304693F 0x15602842 0x00008888 0x88888888 0x00000000 0x00000000 0x00000010 0x07100000 20 | 0x00001F73 0x00002000 0x00004000 0x00006000 0x00000000 0x00000000 0x00000000 0x00000000 21 | [DEFAULT_DDR3_1024M] 22 | 0xAA00AA00 0xAA00AA00 0x00000007 0x44694683 0x01000000 0xF07486A1 0xC287221D 0x9F060481 23 | 0x03046948 0x15602842 0x00008888 0x88888888 0x00000000 0x00000000 0x00000210 0x07100000 24 | 0x00001B61 0x00002040 0x00004010 0x00006000 0x0A000000 0x07070000 0x00000000 0x00000000 25 | [DEFAULT_DDR3_2048M] 26 | 0xAA00AA00 0xAA00AA00 0x00000007 0x44694673 0x01000000 0xF07486A1 0xC287221D 0x9F050481 27 | 0x03046948 0x15602842 0x00008888 0x88888888 0x00000000 0x00000000 0x00000220 0x07100000 28 | 0x00001B61 0x00002040 0x00004010 0x00006000 0x0A000000 0x07070000 0x00000000 0x00000000 29 | [DEFAULT_DDR3_4096M] 30 | 0xAA00AA00 0xAA00AA00 0x00000007 0x44694683 0x01000000 0xF07486A1 0xC287221D 0x9F0F0481 31 | 0x03046948 0x15602842 0x00008888 0x88888888 0x00000000 0x00000000 0x00000240 0x07100000 32 | 0x00001B61 0x00002040 0x00004010 0x00006000 0x0A000000 0x07070000 0x00000000 0x00000000 33 | -------------------------------------------------------------------------------- /net/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | # CFLAGS += -DET_DEBUG -DDEBUG 27 | 28 | LIB = libnet.a 29 | 30 | OBJS = net.o tftp.o eth.o httpd.o 31 | all: $(LIB) 32 | 33 | $(LIB): $(START) $(OBJS) 34 | $(AR) crv $@ $(OBJS) 35 | 36 | ######################################################################### 37 | 38 | .depend: Makefile $(OBJS:.o=.c) 39 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 40 | 41 | sinclude .depend 42 | 43 | ######################################################################### 44 | -------------------------------------------------------------------------------- /net/bootp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copied from LiMon - BOOTP. 3 | * 4 | * Copyright 1994, 1995, 2000 Neil Russell. 5 | * (See License) 6 | * Copyright 2000 Paolo Scaffardi 7 | */ 8 | 9 | #ifndef __BOOTP_H__ 10 | #define __BOOTP_H__ 11 | 12 | #ifndef __NET_H__ 13 | #include 14 | #endif /* __NET_H__ */ 15 | 16 | /**********************************************************************/ 17 | 18 | /* 19 | * BOOTP header. 20 | */ 21 | #if (CONFIG_COMMANDS & CFG_CMD_DHCP) 22 | #define OPT_SIZE 312 /* Minimum DHCP Options size per RFC2131 - results in 576 byte pkt */ 23 | #else 24 | #define OPT_SIZE 64 25 | #endif 26 | 27 | typedef struct 28 | { 29 | uchar bp_op; /* Operation */ 30 | # define OP_BOOTREQUEST 1 31 | # define OP_BOOTREPLY 2 32 | uchar bp_htype; /* Hardware type */ 33 | # define HWT_ETHER 1 34 | uchar bp_hlen; /* Hardware address length */ 35 | # define HWL_ETHER 6 36 | uchar bp_hops; /* Hop count (gateway thing) */ 37 | ulong bp_id; /* Transaction ID */ 38 | ushort bp_secs; /* Seconds since boot */ 39 | ushort bp_spare1; /* Alignment */ 40 | IPaddr_t bp_ciaddr; /* Client IP address */ 41 | IPaddr_t bp_yiaddr; /* Your (client) IP address */ 42 | IPaddr_t bp_siaddr; /* Server IP address */ 43 | IPaddr_t bp_giaddr; /* Gateway IP address */ 44 | uchar bp_chaddr[16]; /* Client hardware address */ 45 | char bp_sname[64]; /* Server host name */ 46 | char bp_file[128]; /* Boot file name */ 47 | char bp_vend[OPT_SIZE]; /* Vendor information */ 48 | } Bootp_t; 49 | 50 | #define BOOTP_HDR_SIZE sizeof (Bootp_t) 51 | #define BOOTP_SIZE (ETHER_HDR_SIZE + IP_HDR_SIZE + BOOTP_HDR_SIZE) 52 | 53 | /**********************************************************************/ 54 | /* 55 | * Global functions and variables. 56 | */ 57 | 58 | /* bootp.c */ 59 | extern ulong BootpID; /* ID of cur BOOTP request */ 60 | extern char BootFile[128]; /* Boot file name */ 61 | extern int BootpTry; 62 | #ifdef CONFIG_BOOTP_RANDOM_DELAY 63 | ulong seed1, seed2; /* seed for random BOOTP delay */ 64 | #endif 65 | 66 | 67 | /* Send a BOOTP request */ 68 | extern void BootpRequest (void); 69 | 70 | /****************** DHCP Support *********************/ 71 | extern void DhcpRequest(void); 72 | 73 | /* DHCP States */ 74 | typedef enum { INIT, 75 | INIT_REBOOT, 76 | REBOOTING, 77 | SELECTING, 78 | REQUESTING, 79 | REBINDING, 80 | BOUND, 81 | RENEWING } dhcp_state_t; 82 | 83 | #define DHCP_DISCOVER 1 84 | #define DHCP_OFFER 2 85 | #define DHCP_REQUEST 3 86 | #define DHCP_DECLINE 4 87 | #define DHCP_ACK 5 88 | #define DHCP_NAK 6 89 | #define DHCP_RELEASE 7 90 | 91 | #define SELECT_TIMEOUT 3 /* Seconds to wait for offers */ 92 | 93 | /**********************************************************************/ 94 | 95 | #endif /* __BOOTP_H__ */ 96 | -------------------------------------------------------------------------------- /net/httpd.h: -------------------------------------------------------------------------------- 1 | #ifndef _NET_HTTPD_H__ 2 | #define _NET_HTTPD_H__ 3 | 4 | void HttpdStart(void); 5 | void HttpdHandler(void); 6 | 7 | /* board specific implementation */ 8 | extern int do_http_upgrade(const ulong size, const int upgrade_type); 9 | extern int do_http_progress(const int state); 10 | extern void LEDON(void); 11 | extern void LEDOFF(void); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /net/rarp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | 25 | #ifndef __RARP_H__ 26 | #define __RARP_H__ 27 | 28 | #ifndef __NET_H__ 29 | #include 30 | #endif /* __NET_H__ */ 31 | 32 | 33 | /**********************************************************************/ 34 | /* 35 | * Global functions and variables. 36 | */ 37 | 38 | extern int RarpTry; 39 | 40 | extern void RarpRequest (void); /* Send a RARP request */ 41 | 42 | /**********************************************************************/ 43 | 44 | #endif /* __RARP_H__ */ 45 | -------------------------------------------------------------------------------- /net/tftp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LiMon - BOOTP/TFTP. 3 | * 4 | * Copyright 1994, 1995, 2000 Neil Russell. 5 | * (See License) 6 | */ 7 | 8 | #ifndef __TFTP_H__ 9 | #define __TFTP_H__ 10 | 11 | /**********************************************************************/ 12 | /* 13 | * Global functions and variables. 14 | */ 15 | 16 | /* tftp.c */ 17 | extern void TftpStart (void); /* Begin TFTP get */ 18 | 19 | /**********************************************************************/ 20 | 21 | #endif /* __TFTP_H__ */ 22 | -------------------------------------------------------------------------------- /rtc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2001-2004 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | #CFLAGS += -DDEBUG 27 | 28 | LIB = librtc.a 29 | 30 | OBJS = date.o 31 | 32 | all: $(LIB) 33 | 34 | $(LIB): $(START) $(OBJS) 35 | $(AR) crv $@ $(OBJS) 36 | 37 | ######################################################################### 38 | 39 | .depend: Makefile $(OBJS:.o=.c) 40 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 41 | 42 | sinclude .depend 43 | 44 | ######################################################################### 45 | -------------------------------------------------------------------------------- /scripts/Makefile: -------------------------------------------------------------------------------- 1 | HEADER=header.tk 2 | TAIL=tail.tk 3 | 4 | # Previous versions always remade kconfig.tk because they always depended 5 | # on soundscript. This runs fairly fast, and I can't find all the 6 | # Config.in files to depend on anyways. So I'll force it to remake. 7 | 8 | kconfig.tk: dummy 9 | 10 | kconfig.tk: ${TOPDIR}/Makefile ${TOPDIR}/arch/${ARCH}/config.in \ 11 | tkparse ${HEADER} ${TAIL} 12 | @if [ -f /usr/local/bin/wish ]; then \ 13 | echo '#!'"/usr/local/bin/wish -f" > kconfig.tk; \ 14 | else \ 15 | echo '#!'"/usr/bin/wish -f" > kconfig.tk; \ 16 | fi 17 | cat ${HEADER} >> ./kconfig.tk 18 | ./tkparse < ../arch/${ARCH}/config.in >> kconfig.tk 19 | echo "set defaults \"arch/${ARCH}/defconfig\"" >> kconfig.tk 20 | echo "set ARCH \"${ARCH}\"" >> kconfig.tk 21 | cat ${TAIL} >> kconfig.tk 22 | chmod 755 kconfig.tk 23 | 24 | tkparse: tkparse.o tkcond.o tkgen.o 25 | ${HOSTCC} -o tkparse tkparse.o tkcond.o tkgen.o 26 | 27 | tkparse.o: tkparse.c tkparse.h 28 | 29 | tkcond.o: tkcond.c tkparse.h 30 | 31 | tkgen.o: tkgen.c tkparse.h 32 | 33 | tkparse.o tkcond.o tkgen.o: 34 | $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $(@:.o=.c) 35 | 36 | clean: 37 | rm -f *~ kconfig.tk *.o tkparse 38 | 39 | # include $(TOPDIR)/Rules.make 40 | -------------------------------------------------------------------------------- /scripts/README.uClinux: -------------------------------------------------------------------------------- 1 | 2 | Yes, this is a rip off of the 2.4 linux script directory, it allows 3 | us to configure things even when we do not know the kernel version. 4 | We can also hack these guys without hurting the kernel config. 5 | 6 | -------------------------------------------------------------------------------- /scripts/lxdialog/BIG.FAT.WARNING: -------------------------------------------------------------------------------- 1 | This is NOT the official version of dialog. This version has been 2 | significantly modified from the original. It is for use by the Linux 3 | kernel configuration script. Please do not bother Savio Lam with 4 | questions about this program. 5 | -------------------------------------------------------------------------------- /scripts/lxdialog/Makefile: -------------------------------------------------------------------------------- 1 | HOSTCFLAGS += -DLOCALE 2 | LIBS = -lncurses 3 | 4 | ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h)) 5 | HOSTCFLAGS += -I/usr/include/ncurses -DCURSES_LOC="" 6 | else 7 | ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h)) 8 | HOSTCFLAGS += -I/usr/include/ncurses -DCURSES_LOC="" 9 | else 10 | ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h)) 11 | HOSTCFLAGS += -DCURSES_LOC="" 12 | else 13 | HOSTCFLAGS += -DCURSES_LOC="" 14 | endif 15 | endif 16 | endif 17 | 18 | 19 | OBJS = checklist.o menubox.o textbox.o yesno.o inputbox.o \ 20 | util.o lxdialog.o msgbox.o 21 | 22 | %.o: %.c 23 | $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $< 24 | 25 | all: ncurses lxdialog 26 | 27 | lxdialog: $(OBJS) 28 | $(HOSTCC) -o lxdialog $(OBJS) $(LIBS) 29 | 30 | ncurses: 31 | @echo "main() {}" > lxtemp.c 32 | @if $(HOSTCC) -lncurses lxtemp.c ; then \ 33 | rm -f lxtemp.c a.out; \ 34 | else \ 35 | rm -f lxtemp.c; \ 36 | echo -e "\007" ;\ 37 | echo ">> Unable to find the Ncurses libraries." ;\ 38 | echo ">>" ;\ 39 | echo ">> You must have Ncurses installed in order" ;\ 40 | echo ">> to use 'make menuconfig'" ;\ 41 | echo ;\ 42 | exit 1 ;\ 43 | fi 44 | 45 | clean: 46 | rm -f core *.o *~ lxdialog 47 | -------------------------------------------------------------------------------- /scripts/lxdialog/msgbox.c: -------------------------------------------------------------------------------- 1 | /* 2 | * msgbox.c -- implements the message box and info box 3 | * 4 | * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) 5 | * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com) 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include "dialog.h" 23 | 24 | /* 25 | * Display a message box. Program will pause and display an "OK" button 26 | * if the parameter 'pause' is non-zero. 27 | */ 28 | int 29 | dialog_msgbox (const char *title, const char *prompt, int height, int width, 30 | int pause) 31 | { 32 | int i, x, y, key = 0; 33 | WINDOW *dialog; 34 | 35 | /* center dialog box on screen */ 36 | x = (COLS - width) / 2; 37 | y = (LINES - height) / 2; 38 | 39 | draw_shadow (stdscr, y, x, height, width); 40 | 41 | dialog = newwin (height, width, y, x); 42 | keypad (dialog, TRUE); 43 | 44 | draw_box (dialog, 0, 0, height, width, dialog_attr, border_attr); 45 | 46 | if (title != NULL && strlen(title) >= width-2 ) { 47 | /* truncate long title -- mec */ 48 | char * title2 = malloc(width-2+1); 49 | memcpy( title2, title, width-2 ); 50 | title2[width-2] = '\0'; 51 | title = title2; 52 | } 53 | 54 | if (title != NULL) { 55 | wattrset (dialog, title_attr); 56 | mvwaddch (dialog, 0, (width - strlen(title))/2 - 1, ' '); 57 | waddstr (dialog, (char *)title); 58 | waddch (dialog, ' '); 59 | } 60 | wattrset (dialog, dialog_attr); 61 | print_autowrap (dialog, prompt, width - 2, 1, 2); 62 | 63 | if (pause) { 64 | wattrset (dialog, border_attr); 65 | mvwaddch (dialog, height - 3, 0, ACS_LTEE); 66 | for (i = 0; i < width - 2; i++) 67 | waddch (dialog, ACS_HLINE); 68 | wattrset (dialog, dialog_attr); 69 | waddch (dialog, ACS_RTEE); 70 | 71 | print_button (dialog, " Ok ", 72 | height - 2, width / 2 - 4, TRUE); 73 | 74 | wrefresh (dialog); 75 | while (key != ESC && key != '\n' && key != ' ' && 76 | key != 'O' && key != 'o' && key != 'X' && key != 'x') 77 | key = wgetch (dialog); 78 | } else { 79 | key = '\n'; 80 | wrefresh (dialog); 81 | } 82 | 83 | delwin (dialog); 84 | return key == ESC ? -1 : 0; 85 | } 86 | -------------------------------------------------------------------------------- /scripts/tail.tk: -------------------------------------------------------------------------------- 1 | # FILE: tail.tk 2 | # This file is boilerplate TCL/TK function definitions for 'make xconfig'. 3 | # 4 | # CHANGES 5 | # ======= 6 | # 7 | # 8 January 1998, Michael Elizabeth Chastain, 8 | # Arrange buttons in three columns for better screen fitting. 9 | # 10 | 11 | # 12 | # Read the user's settings from .config. These will override whatever is 13 | # in config.in. Don't do this if the user specified a -D to force 14 | # the defaults. 15 | # 16 | if { [file readable .config] == 1} then { 17 | if { $argc > 0 } then { 18 | if { [lindex $argv 0] != "-D" } then { 19 | read_config .config 20 | } 21 | else 22 | { 23 | read_config $defaults 24 | } 25 | } else { 26 | read_config .config 27 | } 28 | } else { 29 | read_config $defaults 30 | } 31 | 32 | update_define 1 $total_menus 0 33 | update_mainmenu 34 | 35 | global autoconf_file 36 | if {( $autoconf_file == "")} then { 37 | set autoconf_file "/dev/null" 38 | } 39 | 40 | button .f0.right.save -anchor w -text "Save and Exit" \ 41 | -command { 42 | catch {exec cp -f .config .config.old} 43 | writeconfig .config $autoconf_file; 44 | exit 45 | } 46 | 47 | button .f0.right.quit -anchor w -text "Quit Without Saving" \ 48 | -command { maybe_exit .maybe } 49 | 50 | button .f0.right.load -anchor w -text "Load Configuration from File" \ 51 | -command { load_configfile .load "Load Configuration from file" read_config_file 52 | } 53 | 54 | button .f0.right.store -anchor w -text "Store Configuration to File" \ 55 | -command { load_configfile .load "Store Configuration to file" write_config_file } 56 | 57 | # 58 | # Now pack everything. 59 | # 60 | 61 | pack .f0.right.store .f0.right.load .f0.right.quit .f0.right.save \ 62 | -padx 0 -pady 0 -side bottom -fill x 63 | pack .f0.left .f0.middle .f0.right -side left -padx 5 -pady 0 -fill y 64 | pack .f0 -padx 5 -pady 5 65 | 66 | update idletasks 67 | set winy [expr 10 + [winfo reqheight .f0]] 68 | set scry [lindex [wm maxsize .] 1] 69 | set winx [expr 10 + [winfo reqwidth .f0]] 70 | set scrx [lindex [wm maxsize .] 0] 71 | if {$winx < $scrx} then {set maxx -1} else {set maxx $winx} 72 | if {$winy < $scry} then {set maxy -1} else {set maxy $winy} 73 | .f0 configure -width $winx -height $winy 74 | wm maxsize . $maxx $maxy 75 | 76 | # 77 | # If we cannot write our config files, disable the write button. 78 | # 79 | if { [file exists .config] == 1 } then { 80 | if { [file writable .config] == 0 } then { 81 | .f0.right.save configure -state disabled 82 | } 83 | } else { 84 | if { [file writable .] == 0 } then { 85 | .f0.right.save configure -state disabled 86 | } 87 | } 88 | 89 | if { [file exists $autoconf_file] == 1 } then { 90 | if { [file writable $autoconf_file] == 0 } then { 91 | .f0.right.save configure -state disabled 92 | } 93 | } 94 | 95 | -------------------------------------------------------------------------------- /stage1/Makefile: -------------------------------------------------------------------------------- 1 | sinclude $(TOPDIR)/config.mk 2 | -include $(TOPDIR)/.config 3 | 4 | ifdef RT2880_FPGA_BOARD 5 | FADDR = 0xBC400000 6 | endif 7 | ifdef RT2880_ASIC_BOARD 8 | FADDR = 0xBC400000 9 | endif 10 | ifdef RT2883_FPGA_BOARD 11 | FADDR = 0xBC000000 12 | endif 13 | ifdef RT2883_ASIC_BOARD 14 | FADDR = 0xBC000000 15 | endif 16 | ifdef RT3052_ASIC_BOARD 17 | FADDR = 0xBFC00000 18 | endif 19 | ifdef RT3052_FPGA_BOARD 20 | FADDR = 0xBFC00000 21 | endif 22 | 23 | SRC := ./start.S ./boot.c ./nandc.c ./gdma.c 24 | OBJS = $(notdir $(addsuffix .o, $(basename $(SRC)))) 25 | CFLAGS += -DCONFIG_STAGE2_OFFSET=0x4000 26 | 27 | all: uboot.img 28 | 29 | stage2.bin: 30 | ../tools/mkimage -A $(ARCH) -T standalone -C none -a $(TEXT_BASE) \ 31 | -e $(shell readelf -h ../u-boot | grep "Entry" | awk '{print $$4}') \ 32 | -n "$(shell echo $(CFG_ENV_IS) | sed -e 's/IN_//') Flash Image" -d \ 33 | ../uboot.bin $@ 34 | 35 | stage2.o: stage2.bin 36 | echo 'char *stage1_ww="ww:' `date` `whoami` '";' | $(CC) $(CFLAGS) -c -o $@ -xc - 37 | $(OBJCOPY) --add-section .stage2=$< $@ 38 | $(OBJCOPY) --set-section-flags .stage2=code,contents,alloc,readonly $@ 39 | 40 | stage1n2.elf: $(OBJS) stage2.o 41 | $(LD) -T $(@:.elf=.lds) -Ttext $(FADDR) $^ -Map $(@:.elf=.map) -o $@ 42 | 43 | uboot.img: stage1n2.elf 44 | $(OBJCOPY) $(OBJCFLAGS) -O binary -v $< $@ 45 | @ls -al $@ 46 | dd if=$@ bs=4096 count=1 of=$@ seek=1 conv=notrunc 47 | dd if=$@ bs=4096 count=2 of=$@ seek=2 conv=notrunc 48 | @ls -al $@ 49 | @mv -f $@ ../$@ 50 | 51 | .PHONY: clean 52 | clean: 53 | rm -f $(OBJS) stage2.bin stage2.o stage1n2.elf stage1n2.map 54 | 55 | 56 | ######################################################################### 57 | 58 | .depend: Makefile $(SRC) 59 | $(CC) -M $(CFLAGS) $(SRC) > $@ 60 | 61 | sinclude .depend 62 | ######################################################################### 63 | 64 | -------------------------------------------------------------------------------- /stage1/boot.c: -------------------------------------------------------------------------------- 1 | #include "configs/rt2880.h" 2 | #include 3 | #include "rt_mmap.h" 4 | 5 | // register supported device 6 | void nor_init(void); 7 | void nand_init(void); 8 | void spi_init(void); 9 | 10 | int nor_read(uint32_t dst, uint32_t src_off, uint32_t size); 11 | int nand_read(uint32_t dst, uint32_t src_off, uint32_t size); 12 | int spi_read(uint32_t dst, uint32_t src_off, uint32_t size); 13 | 14 | 15 | void udelay(unsigned long usec) 16 | { 17 | #define MIPS_CPU_FREQ_US (320) 18 | volatile register unsigned long count = (usec * MIPS_CPU_FREQ_US); 19 | 20 | asm volatile (".set noreorder \n" 21 | "1: bnez %0, 1b \n\t" 22 | "addiu %0, -1 \n\t" 23 | : 24 | :"r"(count) 25 | ); 26 | } 27 | 28 | typedef enum nvram_device { 29 | NOR_FLASH = 1<<1, 30 | NAND_FLASH = 1<<2, 31 | SPI_FLASH = 1<<3, 32 | } nvram_t; 33 | 34 | 35 | inline nvram_t boot_from(void) 36 | { 37 | //fixme, read bootstrap configuration 38 | #if defined (CFG_ENV_IS_IN_FLASH) 39 | return NOR_FLASH; 40 | #elif defined (CFG_ENV_IS_IN_SPI) 41 | return SPI_FLASH; 42 | #elif defined (CFG_ENV_IS_IN_NAND) 43 | return NAND_FLASH; 44 | #else 45 | #error "FIXME, fail to simulate bootstrap setting of booting device" 46 | #endif 47 | } 48 | 49 | 50 | nvram_t ram = NOR_FLASH; 51 | 52 | typedef int (*NVRAM_READ_FUNC)(uint32_t , uint32_t , uint32_t); 53 | 54 | inline void nvram_init(NVRAM_READ_FUNC *nvram_read) 55 | { 56 | ram = boot_from(); 57 | 58 | if (ram == NOR_FLASH) { 59 | //nor_init(); 60 | *nvram_read = nor_read; 61 | } 62 | else if (ram == NAND_FLASH) { 63 | nand_init(); 64 | *nvram_read = nand_read; 65 | } 66 | else if (ram == SPI_FLASH) { 67 | spi_init(); 68 | *nvram_read = spi_read; 69 | } 70 | 71 | return; 72 | } 73 | 74 | int load_stage2(void) 75 | { 76 | image_header_t header[1]; 77 | NVRAM_READ_FUNC nvram_read; 78 | 79 | int (*stage2)(int, char **); 80 | 81 | // init flash controller by bootstrap setting 82 | nvram_init(&nvram_read); 83 | 84 | // read header of stage2 85 | nvram_read((uint32_t)header, CONFIG_STAGE2_OFFSET, sizeof(header)); 86 | 87 | // load stage2 image 88 | nvram_read(ntohl((uint32_t)header[0].ih_load), CONFIG_STAGE2_OFFSET + sizeof(header), ntohl(header[0].ih_size)); 89 | 90 | // ready_to_go 91 | stage2 = (int (*)(int, char **))ntohl(header[0].ih_ep); 92 | stage2(0, 0); 93 | 94 | return 0; 95 | } 96 | 97 | 98 | -------------------------------------------------------------------------------- /stage1/stage1n2.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Wolfgang Denk Engineering, 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips") 26 | */ 27 | /*OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")*/ 28 | OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips", "elf32-tradlittlemips") 29 | OUTPUT_ARCH(mips) 30 | ENTRY(_start) 31 | 32 | SECTIONS 33 | { 34 | . = 0x00000000; 35 | 36 | . = ALIGN(4); 37 | .text : 38 | { 39 | start.o(.text) 40 | *(.text) 41 | } 42 | 43 | . = ALIGN(4); 44 | .rodata : { *(.rodata) } 45 | 46 | . = ALIGN(4); 47 | 48 | .except_vect : 49 | { 50 | *(.except_vect) 51 | } 52 | 53 | .data : { *(.data) } 54 | 55 | . = ALIGN(4); 56 | .sdata : { *(.sdata) } 57 | 58 | _gp = ALIGN(16); 59 | 60 | __got_start = .; 61 | .got : { *(.got) } 62 | __got_end = .; 63 | 64 | .sdata : { *(.sdata) } 65 | 66 | __u_boot_cmd_start = .; 67 | .u_boot_cmd : { *(.u_boot_cmd) } 68 | __u_boot_cmd_end = .; 69 | 70 | stage1_end_data = .; 71 | num_got_entries = (__got_end - __got_start) >> 2; 72 | 73 | . = ALIGN(4); 74 | .sbss : { *(.sbss) } 75 | .bss : { *(.bss) } 76 | 77 | stage1_end = .; 78 | 79 | _stage2_lma_s = LOADADDR(.text) + 0x4000; 80 | .stage2_image : AT (LOADADDR(.text) + 0x4000) 81 | { 82 | *(.stage2) 83 | } 84 | _stage2_lma_e = _stage2_lma_s + SIZEOF(.stage2_image); 85 | } 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -I./ -DUSE_HOSTCC 2 | 3 | all: mkimage 4 | 5 | clean: 6 | rm -f mkimage *.o 7 | 8 | .c.o: 9 | $(HOSTCC) $(CFLAGS) -c $^ 10 | 11 | .depend: 12 | 13 | mkimage: mkimage.o crc32.o crc.o 14 | $(HOSTCC) -o $@ $^ 15 | 16 | 17 | -------------------------------------------------------------------------------- /uboot_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * w.x.y.z 4 | * w = significant change 5 | * x = major change (formal release) 6 | * y = minor change (bug fix release) 7 | * z = internal change (internal debuging) 8 | */ 9 | #define RALINK_LOCAL_VERSION "4.3.0.0" 10 | --------------------------------------------------------------------------------