├── Makefile ├── README.md └── src ├── .config ├── .config.old ├── .menuconfig.log ├── .tmp_config ├── CHANGELOG ├── COPYING ├── CREDITS ├── MAINTAINERS ├── MAKEALL ├── Makefile ├── README ├── 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 ├── 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 ├── doc ├── I2C_Edge_Conditions ├── README-i386 ├── README.ARM-SoC ├── README.ARM-memory-map ├── README.COBRA5272 ├── README.EVB-64260-750CX ├── README.INCA-IP ├── README.IPHASE4539 ├── README.IceCube ├── README.JFFS2 ├── README.JFFS2_NAND ├── README.MBX ├── README.MPC866 ├── README.Modem ├── README.NetConsole ├── README.OXC ├── README.PIP405 ├── README.POST ├── README.PXA_CF ├── README.Purple ├── README.RPXClassic ├── README.RPXlite ├── README.SBC8560 ├── README.Sandpoint8240 ├── README.TQM8260 ├── README.VLAN ├── README.adnpesc1 ├── README.adnpesc1_base32 ├── README.alaska8220 ├── README.amigaone ├── README.autoboot ├── README.bedbug ├── README.cmi ├── README.commands ├── README.commands.itest ├── README.console ├── README.db64360 ├── README.db64460 ├── README.dk1c20 ├── README.dk1c20_std32 ├── README.dk1s10 ├── README.dk1s10_mldk20 ├── README.dk1s10_std32 ├── README.dk1s40_std32 ├── README.dk20k200_std32 ├── README.ebony ├── README.evb64260 ├── README.fads ├── README.idma2intr ├── README.lynxkdi ├── README.m68k ├── README.ml300 ├── README.modnet50 ├── README.mpc5xx ├── README.mpc74xx ├── README.mpc85xxads ├── README.mpc85xxcds ├── README.nand ├── README.ne2000 ├── README.nios ├── README.nios_CFG_NIOS_CPU ├── README.nios_DK ├── README.ns9750dev ├── README.ocotea ├── README.omap730p2 ├── README.ppc440 ├── README.sbc8560 ├── README.sched ├── README.serial_multi ├── README.silent ├── README.standalone ├── README.usb ├── README.video ├── README.xpedite1k └── TODO-i386 ├── 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 ├── 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 ├── .board.c.swp ├── 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 ├── mt7621_stage_L2.bin ├── mt7621_stage_sram.bin ├── net ├── Makefile ├── bootp.c ├── bootp.h ├── eth.c ├── 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 │ ├── checklist.o │ ├── colors.h │ ├── dialog.h │ ├── inputbox.c │ ├── inputbox.o │ ├── lxdialog │ ├── lxdialog.c │ ├── lxdialog.o │ ├── menubox.c │ ├── menubox.o │ ├── msgbox.c │ ├── msgbox.o │ ├── textbox.c │ ├── textbox.o │ ├── util.c │ ├── util.o │ ├── yesno.c │ └── yesno.o ├── 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_version.h /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2010 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | 8 | include $(TOPDIR)/rules.mk 9 | include $(INCLUDE_DIR)/kernel.mk 10 | 11 | PKG_NAME:=u-boot 12 | PKG_VERSION:=2015.09 13 | PKG_RELEASE:=1 14 | 15 | PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) 16 | PKG_MD5SUM:= 17 | PKG_TARGETS:=bin 18 | 19 | include $(INCLUDE_DIR)/package.mk 20 | 21 | define uboot/Default 22 | TITLE:= 23 | CONFIG:= 24 | IMAGE:= 25 | endef 26 | 27 | define uboot/sxx 28 | TITLE:=U-boot for mt7628 board 29 | endef 30 | 31 | UBOOTS:=sxx 32 | 33 | define Package/uboot/template 34 | define Package/uboot-mt7628-$(1) 35 | SECTION:=boot 36 | CATEGORY:=Boot Loaders 37 | TITLE:=$(2) 38 | DEPENDS:=@TARGET_ramips 39 | URL:=http://www.denx.de/wiki/U-Boot 40 | DEFAULT:=y if (CONFIG_TARGET_ramips_rt305x) 41 | VARIANT:=$(1) 42 | endef 43 | endef 44 | 45 | define BuildUbootPackage 46 | $(eval $(uboot/Default)) 47 | $(eval $(uboot/$(1))) 48 | $(call Package/uboot/template,$(1),$(TITLE)) 49 | endef 50 | 51 | 52 | ifdef BUILD_VARIANT 53 | $(eval $(call uboot/$(BUILD_VARIANT))) 54 | UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) 55 | UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) 56 | endif 57 | 58 | define Build/Prepare 59 | $(call Build/Prepare/Default) 60 | $(CP) -r src/. $(PKG_BUILD_DIR) 61 | endef 62 | 63 | define Build/Configure 64 | endef 65 | 66 | define Build/Compile 67 | $(MAKE) -C $(PKG_BUILD_DIR) \ 68 | CROSS_COMPILE=$(TARGET_CROSS) 69 | endef 70 | 71 | define Package/uboot/install/template 72 | define Package/uboot-mt7628-$(1)/install 73 | $(INSTALL_DIR) $$(1) 74 | $(CP) $(PKG_BUILD_DIR)/uboot.bin $(BIN_DIR)/$(2) 75 | endef 76 | endef 77 | 78 | $(foreach u,$(UBOOTS), \ 79 | $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(SUBTARGET)-$(u)-u-boot.bin)) \ 80 | ) 81 | 82 | $(foreach u,$(UBOOTS), \ 83 | $(eval $(call BuildUbootPackage,$(u))) \ 84 | $(eval $(call BuildPackage,uboot-mt7628-$(u))) \ 85 | ) 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 1. git clone https://github.com/qdk0901/openwrt-uboot-mt7628.git 2 | 3 | 2. copy openwrt-uboot-mt7628 folder to openwrt_source/package/boot/ 4 | 5 | 3. select uboot-mt7628 package under menuconfig in bootloader category 6 | 7 | 4. building uboot with under commands 8 | ``` 9 | make package/uboot-mt7628/prepare V=s 10 | make package/uboot-mt7628/compile V=s 11 | ``` 12 | 5. uboot.bin will generated under openwrt_source/bin folder 13 | -------------------------------------------------------------------------------- /src/.config: -------------------------------------------------------------------------------- 1 | # 2 | # Automatically generated by make menuconfig: don't edit 3 | # 4 | ASIC_BOARD=y 5 | # RT2880_ASIC_BOARD is not set 6 | # RT3350_ASIC_BOARD is not set 7 | # RT3052_ASIC_BOARD is not set 8 | # RT3352_ASIC_BOARD is not set 9 | # RT3883_ASIC_BOARD is not set 10 | # RT5350_ASIC_BOARD is not set 11 | # RT6855A_ASIC_BOARD is not set 12 | # MT7620_ASIC_BOARD is not set 13 | # MT7621_ASIC_BOARD is not set 14 | MT7628_ASIC_BOARD=y 15 | MT7628_MP=y 16 | P5_MAC_TO_NONE_MODE=y 17 | P4_MAC_TO_NONE_MODE=y 18 | ON_BOARD_SPI_FLASH_COMPONENT=y 19 | # ON_BOARD_DDR1 is not set 20 | ON_BOARD_DDR2=y 21 | # ON_BOARD_256M_DRAM_COMPONENT is not set 22 | ON_BOARD_512M_DRAM_COMPONENT=y 23 | # ON_BOARD_1024M_DRAM_COMPONENT is not set 24 | # ON_BOARD_2048M_DRAM_COMPONENT is not set 25 | # ON_BOARD_DDR_WIDTH_8 is not set 26 | ON_BOARD_DDR_WIDTH_16=y 27 | ON_BOARD_16BIT_DRAM_BUS=y 28 | # CONFIG_TINY_UBOOT is not set 29 | # UBOOT_RAM is not set 30 | UBOOT_ROM=y 31 | MT7628_CPU_PLL_PARAMETERS=y 32 | CPUCLK_FROM_CPLL=y 33 | # CPUCLK_FROM_BPLL is not set 34 | # CPUCLK_FROM_XTAL is not set 35 | CPU_FRAC_DIV=0x1 36 | # DUAL_IMAGE_SUPPORT is not set 37 | ETH_ONE_PORT_ONLY=y 38 | TEXT_BASE=0xBC000000 39 | -------------------------------------------------------------------------------- /src/.config.old: -------------------------------------------------------------------------------- 1 | # 2 | # Automatically generated by make menuconfig: don't edit 3 | # 4 | ASIC_BOARD=y 5 | # RT2880_ASIC_BOARD is not set 6 | # RT3350_ASIC_BOARD is not set 7 | # RT3052_ASIC_BOARD is not set 8 | # RT3352_ASIC_BOARD is not set 9 | # RT3883_ASIC_BOARD is not set 10 | # RT5350_ASIC_BOARD is not set 11 | # RT6855A_ASIC_BOARD is not set 12 | # MT7620_ASIC_BOARD is not set 13 | # MT7621_ASIC_BOARD is not set 14 | MT7628_ASIC_BOARD=y 15 | MT7628_MP=y 16 | P5_MAC_TO_NONE_MODE=y 17 | P4_MAC_TO_NONE_MODE=y 18 | ON_BOARD_SPI_FLASH_COMPONENT=y 19 | # ON_BOARD_DDR1 is not set 20 | ON_BOARD_DDR2=y 21 | # ON_BOARD_256M_DRAM_COMPONENT is not set 22 | ON_BOARD_512M_DRAM_COMPONENT=y 23 | # ON_BOARD_1024M_DRAM_COMPONENT is not set 24 | # ON_BOARD_2048M_DRAM_COMPONENT is not set 25 | # ON_BOARD_DDR_WIDTH_8 is not set 26 | ON_BOARD_DDR_WIDTH_16=y 27 | ON_BOARD_16BIT_DRAM_BUS=y 28 | # CONFIG_TINY_UBOOT is not set 29 | # UBOOT_RAM is not set 30 | UBOOT_ROM=y 31 | MT7628_CPU_PLL_PARAMETERS=y 32 | CPUCLK_FROM_CPLL=y 33 | # CPUCLK_FROM_BPLL is not set 34 | # CPUCLK_FROM_XTAL is not set 35 | CPU_FRAC_DIV=0x1 36 | # DUAL_IMAGE_SUPPORT is not set 37 | ETH_ONE_PORT_ONLY=y 38 | TEXT_BASE=0xBC000000 39 | -------------------------------------------------------------------------------- /src/.menuconfig.log: -------------------------------------------------------------------------------- 1 | config.in: line 3: [: missing `]' 2 | config.in: line 4: : command not found 3 | config.in: line 5: : command not found 4 | config.in: line 6: : command not found 5 | config.in: line 7: : command not found 6 | config.in: line 8: : command not found 7 | config.in: line 9: : command not found 8 | config.in: line 10: : command not found 9 | -------------------------------------------------------------------------------- /src/.tmp_config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/.tmp_config -------------------------------------------------------------------------------- /src/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/CHANGELOG -------------------------------------------------------------------------------- /src/CREDITS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/CREDITS -------------------------------------------------------------------------------- /src/MAINTAINERS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/MAINTAINERS -------------------------------------------------------------------------------- /src/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 | #define ON_BOARD_512M_DRAM_COMPONENT 1 24 | #undef ON_BOARD_1024M_DRAM_COMPONENT 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 CONFIG_TINY_UBOOT 30 | #undef UBOOT_RAM 31 | #define UBOOT_ROM 1 32 | #define MT7628_CPU_PLL_PARAMETERS 1 33 | #define CPUCLK_FROM_CPLL 1 34 | #undef CPUCLK_FROM_BPLL 35 | #undef CPUCLK_FROM_XTAL 36 | #define CPU_FRAC_DIV 0x1 37 | #undef DUAL_IMAGE_SUPPORT 38 | #define ETH_ONE_PORT_ONLY 1 39 | #define TEXT_BASE 0xBC000000 40 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/doc/I2C_Edge_Conditions: -------------------------------------------------------------------------------- 1 | I2C Edge Conditions: 2 | ==================== 3 | 4 | I2C devices may be left in a write state if a read was occuring 5 | and the CPU was reset. This may result in EEPROM data corruption. 6 | 7 | The edge condition is as follows: 8 | 1) A read operation begins. 9 | 2) I2C controller issues a start command. 10 | 3) The I2C writes the device address. 11 | 4) The CPU is reset at this point. 12 | 13 | Once the CPU reinitializes and the read is tried again: 14 | 1) The I2C controller issues a start command. 15 | 2) The I2C controller writes the device address. 16 | 3) The I2C controller writes the offset. 17 | 18 | The EEPROM sees: 19 | 1) START 20 | 2) device address 21 | 3) START "this start is ignored by most EEPROMs" 22 | 4) device address "EEPROM interprets this as offset" 23 | 5) Offset in device, "EEPROM interprets this as data to write" 24 | 25 | The device will interpret this sequence as a WRITE command and 26 | write rubbish into itself, i.e. the "offset" will be interpreted 27 | as data to be written in location "device address". 28 | 29 | Notes 30 | ----- 31 | !!!THIS IS AN UNDOCUMENTED I2C BUS BUG, NOT A IBM 4xx BUG!!! 32 | 33 | This reset edge condition could possibly be present in every I2C 34 | controller and device available. For boards where a I2C bus reset 35 | function can be implemented a i2c_init_board() function should be 36 | provided and enabled by #define'ing CFG_I2C_INIT_BOARD in your 37 | board's config file. Note that this is NOT necessary when using the 38 | bit-banging I2C driver (common/soft_i2c.c) as this already includes 39 | the I2C bus reset sequence. 40 | 41 | 42 | Many thanks to Bill Hunter for finding this serious BUG. 43 | email to: 44 | 45 | Erik Theisen 46 | Tue, 5 Mar 2002 23:02:19 -0500 (Wed 05:02 MET) 47 | -------------------------------------------------------------------------------- /src/doc/README-i386: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/doc/README-i386 -------------------------------------------------------------------------------- /src/doc/README.ARM-SoC: -------------------------------------------------------------------------------- 1 | [By Steven Scholz , 16 Aug 2004] 2 | 3 | Since the cpu/ directory gets clobbered with peripheral driver code I 4 | started cleaning up cpu/arm920t. 5 | 6 | I introduced the concept of Soc (system on a chip) into the ./cpu 7 | directory. That means that code that is cpu (i.e. core) specific 8 | resides in 9 | 10 | cpu/$(CPU)/ 11 | 12 | and code that is specific to some SoC (i.e. vendor specific 13 | peripherals around the core) is moved into 14 | 15 | cpu/$(CPU)/$(SOC)/ 16 | 17 | Thus a library/archive "cpu/$(CPU)/$(SOC)/lib$(SOC).a" will be build 18 | and linked. Examples will be 19 | 20 | cpu/arm920t/imx/ 21 | cpu/arm920t/s3c24x0 22 | 23 | One can select an SoC by passing the name of it to ./mkconfig just 24 | like 25 | 26 | @./mkconfig $(@:_config=) arm arm920t vcma9 mpl s3c24x0 27 | 28 | If there's no VENDOR field (like "mpl" in the above line) one has to 29 | pass NULL instead: 30 | 31 | @./mkconfig $(@:_config=) arm arm920t mx1ads NULL imx 32 | -------------------------------------------------------------------------------- /src/doc/README.ARM-memory-map: -------------------------------------------------------------------------------- 1 | Subject: Re: [PATCH][CFT] bring ARM memory layout in line with the documented behaviour 2 | From: "Anders Larsen" 3 | Date: Thu, 18 Sep 2003 14:15:21 +0200 4 | To: Wolfgang Denk 5 | 6 | ... 7 | >I still see references to _armboot_start, _armboot_end_data, and 8 | >_armboot_end - which role do these play now? Can we get rid of them? 9 | > 10 | >How are they (should they be) set in your memory map above? 11 | 12 | _armboot_start contains the value of TEXT_BASE (0xA07E0000); it seems 13 | TEXT_BASE and _armboot_start are both used for the same purpose in 14 | different parts of the (ARM) code. 15 | Furthermore, the startup code (cpu//start.S) internally uses 16 | another variable (_TEXT_BASE) with the same content as _armboot_start. 17 | I agree that this mess should be cleaned up. 18 | -------------------------------------------------------------------------------- /src/doc/README.EVB-64260-750CX: -------------------------------------------------------------------------------- 1 | The EVB-64260-750CX is quite similar to the EVB-64260-BP already 2 | supported except the following differences: 3 | * It has an IBM-750CXe soldiered on board instead of the slot-1 in the 4 | BP. 5 | * It has a single PCI male connector instead of the 4 PCI female 6 | connectors on the BP. It also gets power trough the PCI connector. 7 | * It has only a single DIMM slot instead of the 2 slots in the BP. 8 | -------------------------------------------------------------------------------- /src/doc/README.INCA-IP: -------------------------------------------------------------------------------- 1 | 2 | Flash programming on the INCA-IP board is complicated because of the 3 | EBU swapping unit. A BDI2000 can be used for flash programming only 4 | if the EBU swapping unit is enabled; otherwise it will not detect the 5 | flash memory. But the EBU swapping unit is disadbled after reset, so 6 | if you program some code to flash with the swapping unit on, it will 7 | not be runnable with the swapping unit off. 8 | 9 | The consequence is that you have to write a pre-swapped image to 10 | flash using the BDI2000. A simple host-side tool "inca-swap-bytes" is 11 | provided in the "tools/" directory. Use it as follows: 12 | 13 | bash$ ./inca-swap-bytes u-boot.bin.swp 14 | 15 | Note that the current BDI config file _disables_ the EBU swapping 16 | unit for the flash bank 0. To enable it, (this is required for the 17 | BDI flash commands to work) uncomment the following line in the 18 | config file: 19 | 20 | ;WM32 0xb8000260 0x404161ff ; Swapping unit enabled 21 | 22 | and comment out 23 | 24 | WM32 0xb8000260 0x004161ff ; Swapping unit disabled 25 | 26 | Alternatively, you can use "mm 0xb8000260 " commands to 27 | enable/disable the swapping unit manually. 28 | 29 | Just for reference, here is the complete sequence of actions we took 30 | to install a U-Boot image into flash. 31 | 32 | 1. ./inca-swap-bytes u-boot.bin.swp 33 | 34 | 2. From BDI: 35 | 36 | mm 0xb8000260 0x404161ff 37 | erase 0xb0000000 38 | erase 0xb0010000 39 | prog 0xb0000000 /tftpboot/INCA/u-boot.bin.swp bin 40 | mm 0xb8000260 0x004161ff 41 | go 0xb0000000 42 | 43 | 44 | Ethernet autonegotiation needs some time to complete. Instead of 45 | delaying the boot process in all cases, we just start the 46 | autonegotiation process when U-Boot comes up and that is all. Most 47 | likely, it will complete by the time the network transfer is 48 | attempted for the first time. In the worst case, if a transfer is 49 | attempted before the autonegotiation is complete, just a single 50 | packet would be lost resulting in a single timeout error, and then 51 | the transfer would proceed normally. So the time that we would have 52 | lost unconditionally waiting for the autonegotiation to complete, we 53 | have to wait only if the file transfer is started immediately after 54 | reset. We've verified that this works for all the clock 55 | configurations. 56 | 57 | (C) 2003 Wolfgang Denk 58 | -------------------------------------------------------------------------------- /src/doc/README.IceCube: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------- 2 | Build target Flash address | BDI "go" command | Reset Vector 3 | --------------------------------------------------------------------------- 4 | Lite5200 0xFFF00000 | 0xFFF00100 | 0xFFF00100 5 | Lite5200_LOWBOOT 0xFF000000 | 0xFF000100 | 0x00000100 6 | Lite5200_LOWBOOT08 0xFF800000 | 0xFF800100 | 0x00000100 7 | icecube_5200 0xFFF00000 | 0xFFF00100 | 0xFFF00100 8 | icecube_5200_LOWBOOT 0xFF000000 | 0xFF000100 | 0x00000100 9 | icecube_5200_LOWBOOT08 0xFF800000 | 0xFF800100 | 0x00000100 10 | icecube_5200_DDR 0xFFF00000 | 0xFFF00100 | 0xFFF00100 11 | icecube_5200_DDR_LOWBOOT 0xFF800000 | 0xFF800100 | 0x00000100 12 | icecube_5200_DDR_LOWBOOT08 0xFF800000 | 0xFF800100 | 0x00000100 13 | --------------------------------------------------------------------------- 14 | -------------------------------------------------------------------------------- /src/doc/README.JFFS2: -------------------------------------------------------------------------------- 1 | JFFS2 options and usage. 2 | ----------------------- 3 | 4 | JFFS2 in U-Boot is a read only implementation of the file system in 5 | Linux with the same name. To use JFFS2 define CFG_CMD_JFFS2. 6 | 7 | The module adds three new commands. 8 | fsload - load binary file from a file system image 9 | fsinfo - print information about file systems 10 | ls - list files in a directory 11 | chpart - change active partition 12 | 13 | If you boot from a partition which is mounted writable, and you 14 | update your boot environment by replacing single files on that 15 | partition, you should also define CFG_JFFS2_SORT_FRAGMENTS. Scanning 16 | the JFFS2 filesystem takes *much* longer with this feature, though. 17 | Sorting is done while inserting into the fragment list, which is 18 | more or less a bubble sort. That algorithm is known to be O(n^2), 19 | thus you should really consider if you can avoid it! 20 | 21 | 22 | There is two ways for JFFS2 to find the disk. The default way uses 23 | the flash_info structure to find the start of a JFFS2 disk (called 24 | partition in the code) and you can change where the partition is with 25 | two defines. 26 | 27 | CFG_JFFS2_FIRST_BANK 28 | defined the first flash bank to use 29 | 30 | CFG_JFFS2_FIRST_SECTOR 31 | defines the first sector to use 32 | 33 | 34 | The second way is to define CFG_JFFS_CUSTOM_PART and implement the 35 | jffs2_part_info(int part_num) function in your board specific files. 36 | In this mode CFG_JFFS2_FIRST_BANK and CFG_JFFS2_FIRST_SECTOR is not 37 | used. 38 | 39 | The input is a partition number starting with 0. 40 | Return a pointer to struct part_info or NULL for error; 41 | 42 | Ex jffs2_part_info() for one partition. 43 | --- 44 | #if defined CFG_JFFS_CUSTOM_PART 45 | #include 46 | 47 | static struct part_info part; 48 | 49 | struct part_info* 50 | jffs2_part_info(int part_num) 51 | { 52 | if(part_num==0){ 53 | if(part.usr_priv==(void*)1) 54 | return ∂ 55 | 56 | memset(&part, 0, sizeof(part)); 57 | part.offset=(char*)0xFF800000; 58 | part.size=1024*1024*8; 59 | 60 | /* Mark the struct as ready */ 61 | part.usr_priv=(void*)1; 62 | 63 | return ∂ 64 | } 65 | return 0; 66 | } 67 | #endif 68 | --- 69 | 70 | TODO. 71 | 72 | Remove the assumption that JFFS can dereference a pointer 73 | into the disk. The current code do not work with memory holes 74 | or hardware with a sliding window (PCMCIA). 75 | -------------------------------------------------------------------------------- /src/doc/README.JFFS2_NAND: -------------------------------------------------------------------------------- 1 | JFFS2 NAND support: 2 | 3 | To ebable, use the following #define in the board configuration file: 4 | 5 | #define CONFIG_JFFS2_NAND 1 6 | 7 | Configuration of partitions is similar to how this is done in U-Boot 8 | for JFFS2 on top NOR flash. If a single parition is used, it can be 9 | configured using the following #defines in the configuration file: 10 | 11 | #define CONFIG_JFFS2_NAND_DEV 0 /* nand device jffs2 lives on */ 12 | #define CONFIG_JFFS2_NAND_OFF 0 /* start of jffs2 partition */ 13 | #define CONFIG_JFFS2_NAND_SIZE 2*1024*1024 /* size of jffs2 partition */ 14 | 15 | If more than a single partition is desired, the user can define a 16 | CFG_JFFS_CUSTOM_PART macro and implement a 17 | 18 | struct part_info* jffs2_part_info(int part_num) 19 | 20 | function in a board-specific module. An example of such function is 21 | available in common/cmd_jffs2.c 22 | 23 | The default configuration for the DAVE board has a single JFFS2 24 | partition of 2 MB size. 25 | -------------------------------------------------------------------------------- /src/doc/README.MPC866: -------------------------------------------------------------------------------- 1 | The current implementation allows the user to specify the desired CPU 2 | clock value, in MHz, via an environment variable "cpuclk". 3 | 4 | Four compile-time constants are used: 5 | 6 | CONFIG_8xx_OSCLK - input quartz clock 7 | CFG_8xx_CPUCLK_MIN - minimum allowed CPU clock 8 | CFG_8xx_CPUCLK_MAX - maximum allowed CPU clock 9 | CONFIG_8xx_CPUCLK_DEFAULT - default CPU clock value 10 | 11 | If the "cpuclk" environment variable value is within the CPUCLK_MIN / 12 | CPUCLK_MAX limits, the specified value is used. Otherwise, the 13 | default CPU clock value is set. 14 | 15 | Please make sure you understand what you are doing, and understand 16 | the restrictions of your hardware (board, processor). For example, 17 | ethernet will stop working for CPU clock frequencies below 25 MHz. 18 | 19 | Please note that the new clock-handling code is enabled if 20 | CONFIG_8xx_CPUCLK_DEFAULT is defined. Since this mechanism supports 21 | only MPC866 and newer CPUs, this constant MUST NOT be defined for 22 | MPC823/850/860/862 series. The clock generation algorithm for older 23 | chips is different and has not been implemented yet. If you need it, 24 | your patch is welcome. 25 | -------------------------------------------------------------------------------- /src/doc/README.OXC: -------------------------------------------------------------------------------- 1 | This document contains different information about the port 2 | of U-Boot for the OXC board designed by Lucent Technologies, 3 | Inc. 4 | 5 | 1. Showing activity 6 | 7 | U-Boot for the OXC board can show its current status using 8 | the Active LED. This feature is configured by the following 9 | options: 10 | 11 | CONFIG_SHOW_ACTIVITY 12 | 13 | When this option is on, the Active LED is blinking fast 14 | when U-Boot runs in the idle loop (i.e. waits for user 15 | commands from serial console) and blinking slow when it 16 | downloads an image over network. When U-Boot loads an image 17 | over serial line the Active LED does not blink and its state 18 | is random (i.e. either constant on or constant off). 19 | 20 | CONFIG_SHOW_BOOT_PROGRESS 21 | 22 | When this option is on, U-Boot switches the Active LED 23 | off before booting an image and switches it on if booting 24 | failed due to some reasons. 25 | -------------------------------------------------------------------------------- /src/doc/README.PXA_CF: -------------------------------------------------------------------------------- 1 | 2 | These are brief instructions on how to add support for CF adapters to 3 | custom designed PXA boards. You need to set the parameters in the 4 | config file. This should work for most implementations especially if you 5 | follow the connections of the standard lubbock. Anyway just the block 6 | marked memory configuration should be touched since the other parameters 7 | are imposed by the PXA architecture. 8 | 9 | #define CONFIG_PXA_PCMCIA 1 10 | #define CONFIG_PXA_IDE 1 11 | 12 | #define CONFIG_PCMCIA_SLOT_A 1 13 | /* just to keep build system happy */ 14 | 15 | #define CFG_PCMCIA_MEM_ADDR 0x28000000 16 | #define CFG_PCMCIA_MEM_SIZE 0x10000000 17 | 18 | #define CFG_MECR_VAL 0x00000000 19 | #define CFG_MCMEM0_VAL 0x00004204 20 | #define CFG_MCMEM1_VAL 0x00000000 21 | #define CFG_MCATT0_VAL 0x00010504 22 | #define CFG_MCATT1_VAL 0x00000000 23 | #define CFG_MCIO0_VAL 0x00008407 24 | #define CFG_MCIO1_VAL 0x00000000 25 | /* memory configuration */ 26 | 27 | #define CFG_IDE_MAXBUS 1 28 | /* max. 1 IDE bus */ 29 | #define CFG_IDE_MAXDEVICE 1 30 | /* max. 1 drive per IDE bus */ 31 | 32 | #define CFG_ATA_IDE0_OFFSET 0x0000 33 | 34 | #define CFG_ATA_BASE_ADDR 0x20000000 35 | 36 | /* Offset for data I/O */ 37 | #define CFG_ATA_DATA_OFFSET 0x1f0 38 | 39 | /* Offset for normal register accesses */ 40 | #define CFG_ATA_REG_OFFSET 0x1f0 41 | 42 | /* Offset for alternate registers */ 43 | #define CFG_ATA_ALT_OFFSET 0x3f0 44 | 45 | 46 | Another important point is that maybe you have to power the pcmcia 47 | subsystem. This is very board specific, for an example on how to 48 | do it please search for CONFIG_EXADRON1 in cmd_pcmcia.c 49 | -------------------------------------------------------------------------------- /src/doc/README.Purple: -------------------------------------------------------------------------------- 1 | Installation Instructions: 2 | -------------------------- 3 | 4 | 1. Put the s2 switch into the following position: 5 | 6 | Off On 7 | ------ 8 | |x | 9 | | x| 10 | |x | 11 | | X| 12 | ------ 13 | 14 | Put the s3 switch into the following position: 15 | 16 | Off On 17 | ------ 18 | | x | 19 | | x | 20 | | x| 21 | | x| 22 | ------ 23 | 24 | Put the s4 switch into the following position: 25 | 26 | Off On 27 | ------ 28 | |x | 29 | |x | 30 | |x | 31 | |x | 32 | |x | 33 | | x| 34 | | x| 35 | |x | 36 | ------ 37 | 38 | 2. Connect to the serial console and to the BDI. Power on. On the 39 | serial line, you should see: 40 | 41 | PURPLE@1.2> 42 | 43 | 3. Type '8'. No echo will be displayed. In response, you should get: 44 | 45 | 7A(pass) 46 | 47 | 4. From BDI, enter command: 48 | 49 | mmw 0xb800d860 0x0042c7ff 50 | 51 | 5. Then, from BDI: 52 | 53 | erase 0xB0000000 54 | erase 0xB0008000 55 | erase 0xB000C000 56 | erase 0xB0010000 57 | erase 0xB0020000 58 | 59 | prog 0xB0000000 bin 60 | 61 | 6. Power off. Restore the original S2 switch position: 62 | 63 | Off On 64 | ------ 65 | | x| 66 | | x| 67 | |x | 68 | | X| 69 | ------ 70 | 71 | Power on. U-Boot should come up. 72 | 73 | 74 | Implementation Notes: 75 | --------------------- 76 | 77 | Due to the RAM/flash bus arbitration problem the suggested workaround 78 | had to be implemented. It works okay. On the downside is that you 79 | can't really check whether 'erase' is complete by polling flash as it 80 | is usually done. Instead, the flash driver simply waits for a given 81 | time and assumes that erase then has passed. This behaviour is 82 | identical to what the VxWorks driver does; also, the same timeout (6 83 | seconds) was chosen. Note that this timeout applies for each erase 84 | operation, i. e. per erased sector. 85 | -------------------------------------------------------------------------------- /src/doc/README.RPXClassic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/doc/README.RPXClassic -------------------------------------------------------------------------------- /src/doc/README.SBC8560: -------------------------------------------------------------------------------- 1 | The port was tested on Wind River System Sbc8560 board . 2 | U-Boot was installed on the flash memory of the CPU card (no the SODIMM). 3 | 4 | NOTE: Please configure uboot compile to the proper PCI frequency and 5 | setup the appropriate DIP switch settings. 6 | 7 | SBC8560 board: 8 | 9 | Make sure boards switches are set to their appropriate conditions. 10 | Refer to the Engineering Reference Guide ERG-00300-002. Of particular 11 | importance are: 1)Tthe settings for JP4 (JP4 1-3 and 2-4), which 12 | select the on-board FLASH device (Intel 28F128Jx); 2) The settings 13 | for the Clock SW9 (33 MHz or 66 MHz). 14 | 15 | Note: SW9 Settings: 66 MHz 16 | 4:1 ratio CCB clocks:SYSCLK 17 | 3:1 ration e500 Core:CCB 18 | pos1 - on, pos2 - on, pos3 - off, pos4 - on, pos5 - off, pos6 - on 19 | Note: SW9 Settings: 33 MHz 20 | 8:1 ratio CCB clocks:SYSCLK 21 | 3:1 ration e500 Core:CCB 22 | pos1 - on, pos2 - on, pos3 - on, pos4 - off, pos5 - off, pos6 - on 23 | 24 | 25 | Flashing the FLASH device with the "Wind River ICE": 26 | 27 | 1) Properly connect and configure the Wind River ICE to the 28 | target JTAG port. This includes running the SBC8560 register script. 29 | Make sure target memory can be read and written. 30 | 31 | 2) Build the u-boot image: 32 | make distclean 33 | make SBC8560_66_config or SBC8560_33_config 34 | make CROSS_COMPILE=.../ELDK3.0/ppc_8xx-/ all 35 | 36 | Note: reference is made to the ELDK3.0 compiler but any 85xx cross-compiler 37 | should suffice. 38 | 39 | 3) Convert the uboot (.elf) file to a uboot.bin file (using visionClick converter). 40 | The bin file should be converted from fffc0000 to ffffffff 41 | 42 | 4) Setup the Flash Utility (tools menu) for: 43 | 44 | Determine the clock speed of the PCI bus and set SW9 accordingly 45 | Note: the speed of the PCI bus defaults to the slowest PCI card 46 | PlayBack the "default" register file for the SBC8560 47 | Select the uboot.bin file with zero bias 48 | Select the initialize Target prior to programming 49 | Select the V28F640Jx (8192 x 8) 1 device FLASH Algorithm 50 | Select the erase base address from FFFC0000 to FFFFFFFF 51 | Select the start address from 0 with size of 4000 52 | 53 | 5) Erase and Program 54 | -------------------------------------------------------------------------------- /src/doc/README.VLAN: -------------------------------------------------------------------------------- 1 | U-Boot has networking support for VLANs (802.1q), and CDP (Cisco 2 | Discovery Protocol). 3 | 4 | You control the sending/receiving of VLAN tagged packets with the 5 | "vlan" environmental variable. When not present no tagging is 6 | performed. 7 | 8 | CDP is used mainly to discover your device VLAN(s) when connected to 9 | a Cisco switch. 10 | 11 | Note: In order to enable CDP support a small change is needed in the 12 | networking driver. You have to enable reception of the 13 | 01:00:0c:cc:cc:cc MAC address which is a multicast address. 14 | 15 | Various defines control CDP; see the README section. 16 | -------------------------------------------------------------------------------- /src/doc/README.amigaone: -------------------------------------------------------------------------------- 1 | AmigaOne U-Boot and the SciTech emulator 2 | 3 | The directory board/MAI/bios_emulator contains the source code 4 | of the SciTech x86 emulator. This emulator is normally available 5 | under a BSD license. However, SciTech kindly gave us permission 6 | to use their emulator in PPCBoot for the AmigaOne. It's available 7 | in this form only under GPL. 8 | 9 | Thanks to Kendall Bennett and the rest of the team at SciTech. 10 | See http://www.scitechsoft.com for their web site 11 | 12 | The GPL license can be found at http://www.gnu.org/licenses/gpl.html 13 | -------------------------------------------------------------------------------- /src/doc/README.cmi: -------------------------------------------------------------------------------- 1 | 2 | Summary: 3 | ======== 4 | 5 | This file contains information about the cmi board configuration. 6 | Please see cmi_mpc5xx_config for further details. The cmi board is 7 | a customer specific board but should work with small modifications 8 | on every board which has a MPC5xx and either a 28F128J3A, 9 | 28F320J3A or 28F640J3A Intel flash mounted. 10 | 11 | Board Discription: 12 | ================== 13 | 14 | * Motorola MPC555 15 | * RS232 connection 16 | * Intel flash 28F640J3A 17 | * Micron SRAM 1M 18 | * Altera PLD 19 | 20 | Bootstrap: 21 | ========== 22 | 23 | In contrast to the usual boot sequence used in U-Boot, on the 24 | cmi board we don't boot from the external flash directly. 25 | Because of we use a 16-bit flash and don't sample a RCW 26 | from the data bus to set the startup buswidth to 16-bit. 27 | Unfortunatly the default width, sampled from the default RCW 28 | is 32-bit. For this reason we burn the proper RCW into the 29 | internal flash shadow location and boot after power-on or 30 | reset from the internal flash and then branch to 0x02000100 31 | where the U-Boot reset vector handler is located. 32 | 33 | Memory Map: 34 | =========== 35 | 36 | Memory Map after relocation: 37 | 38 | 0x0000 0000 CFG_SDRAM_BASE 39 | : 40 | 0x000F 9FFF 41 | : 42 | : 43 | 0x0100 0000 CFG_IMMR (Internal memory map base adress) 44 | : 45 | 0x0130 7FFF 46 | : 47 | : 48 | 0x0200 0000 CFG_FLASH_BASE 49 | : 50 | 0x027C FFFF 51 | : 52 | : 53 | 0x0300 0000 PLD_BASE 54 | 55 | Flash Partition: 56 | 57 | 0x0200 0000 Block 0 and 1 contain U-Boot except 58 | : environment 59 | : 60 | 0x0201 FFFF 61 | 0x0202 0000 Block 2 contains environment (.ppcenv) 62 | : 63 | 0x0202 FFFF 64 | 65 | See README file for futher information about U-Boot relocation 66 | and partitioning. 67 | 68 | Tested Features: 69 | ================ 70 | 71 | * U-Boot commands: go, loads, loadb, all memory features, printenv, 72 | setenv, saveenv, protect, erase, fli, bdi, mtest, reset, version, 73 | coninfo, help (see configuration file for available commands) 74 | 75 | * Blinking led to indicate boot process 76 | 77 | Added or Changed Files: 78 | ======================= 79 | 80 | u-boot-0.2.0/board/cmi/* 81 | u-boot-0.2.0/include/configs/cmi_mpc5xx.h 82 | 83 | Regards, 84 | Martin 85 | -------------------------------------------------------------------------------- /src/doc/README.commands: -------------------------------------------------------------------------------- 1 | 2 | Commands are added to U-Boot by creating a new command structure. 3 | This is done by first including command.h 4 | 5 | Then using the U_BOOT_CMD() macro to fill in a cmd_tbl_t struct. 6 | 7 | U_BOOT_CMD(name,maxargs,repeatable,command,"usage","help") 8 | 9 | name: is the name of the commad. THIS IS NOT a string. 10 | maxargs: the maximumn numbers of arguments this function takes 11 | command: Function pointer (*cmd)(struct cmd_tbl_s *, int, int, char *[]); 12 | usage: Short description. This is a string 13 | help: long description. This is a string 14 | 15 | 16 | **** Behinde the scene ****** 17 | 18 | The structure created is named with a special prefix (__u_boot_cmd_) 19 | and placed by the linker in a special section. 20 | 21 | This makes it possible for the final link to extract all commands 22 | compiled into any object code and construct a static array so the 23 | command can be found in an array starting at __u_boot_cmd_start. 24 | 25 | If a new board is defined do not forget to define the command section 26 | by writing in u-boot.lds ($(TOPDIR)/board/boardname/u-boot.lds) these 27 | 3 lines: 28 | 29 | __u_boot_cmd_start = .; 30 | .u_boot_cmd : { *(.u_boot_cmd) } 31 | __u_boot_cmd_end = .; 32 | -------------------------------------------------------------------------------- /src/doc/README.commands.itest: -------------------------------------------------------------------------------- 1 | A slow day today so here is a revised itest command with provisional 2 | support for comparing strings as well :-)) 3 | 4 | Now table driven to allow the operators 5 | -eq, -ne, -lt, -gt, -le, -ge, ==, !=, <>, <, >, <=, >= 6 | 7 | Uses the expected command modifier for integer compares of width 1, 2 or 8 | 4 bytes of .b, .w, .l and the new modifer of .s for a string compare. 9 | String comparison is over the length of the shorter, this hopefully 10 | avoids missing terminators when using an indirect pointer. 11 | 12 | eg. 13 | if itest.l *40000 == 12345678 then; .... 14 | if itest.w *40000 != 1234 then; .... 15 | if itest.b *40000 >= 12 then; .... 16 | if itest.s *40000 -eq hello then; .... 17 | -------------------------------------------------------------------------------- /src/doc/README.evb64260: -------------------------------------------------------------------------------- 1 | This file contains status information for the port of U-Boot to the 2 | Galileo Evaluation Board. 3 | 4 | Author: Josh Huber 5 | Mission Critical Linux, Inc. 6 | 7 | The support for the Galileo Evaluation board is fairly minimal now. 8 | It's sufficient to boot Linux, but doesn't provide too much more than 9 | what's required to do this. 10 | 11 | Both DUART channels are supported (to use the second one, you have to 12 | modify the board -- see the schematics for where to solder on the 13 | devices module). The ethernet ports are supported, and the MPSC is 14 | supported as a console driver. (keep in mind that the kernel has no 15 | support for this yet) 16 | 17 | There are still occaisonal lockups with the MPSC console driver due to 18 | (we think!) overrun problems. If you're looking for something stable 19 | to use for Linux development, consider sticking with the DUART console 20 | for now. 21 | 22 | Automatic memory sizing mostly works. We've had problems with some 23 | combinations of memory. Please send us email if you're having trouble 24 | with respect to the memory detection. 25 | 26 | Right now, only the 512k boot flash is supported. Support for the 27 | 16MB flash on the devices module is forthcoming. Right now the flash 28 | is stored at the 256k boundry in flash, wasting a whole sector (64k!) 29 | for environment data. This isn't really a big deal since we're not 30 | using the 512k for anything else. (Just U-Boot and the environment) 31 | 32 | Finally, here is a sample output session: 33 | 34 | U-Boot 1.0.0-pre1 (Jun 6 2001 - 12:45:11) 35 | 36 | Initializing... 37 | CPU: MPC7400 (altivec enabled) v2.9 38 | Board: EVB64260 39 | DRAM: 256 MB 40 | FLASH: 512 kB 41 | In: serial 42 | Out: serial 43 | Err: serial 44 | 45 | => 46 | 47 | The default configuration should be correct for the evaluation board, 48 | as it's shipped from Galileo. Keep in mind that the default baudrate 49 | is set to 38400, 8N1. 50 | 51 | Good luck, and make sure to send any bugreports to us (or the 52 | u-boot-users list). 53 | 54 | Josh 55 | -------------------------------------------------------------------------------- /src/doc/README.idma2intr: -------------------------------------------------------------------------------- 1 | (C) 2003 Arun Dharankar 2 | 3 | Attached is an IDMA example code for MPC8260/PPCBoot. I had tried to 4 | search around and could not find any for implementing IDMA, so 5 | implemented one. Its not coded in the best way, but works. 6 | 7 | Also, I was able to test the IDMA specific code under Linux also 8 | (with modifications). My requirement was to implement it for 9 | CompactFlash implemented in memory mode, and it works for it under 10 | PPCBoot and Linux. 11 | -------------------------------------------------------------------------------- /src/doc/README.lynxkdi: -------------------------------------------------------------------------------- 1 | LYNX KDI SUPPORT 2 | 3 | Last Update: July 20, 2003 4 | ======================================================================= 5 | 6 | This file describes support for LynuxWorks KDI within U-Boot. Support 7 | is enabled by defining CONFIG_LYNXKDI. 8 | 9 | 10 | LYNXOS AND BLUECAT SUPPORTED 11 | ============================ 12 | Both LynxOS and BlueCat linux KDIs are supported. The implementation 13 | automatically detects which is being booted. When you use mkimage 14 | you should specify "lynxos" for both (see target-specific notes). 15 | 16 | 17 | SUPPORTED ARCHITECTURE/TARGETS 18 | ============================== 19 | The following targets have been tested: 20 | 21 | -PowerPC MPC8260ADS 22 | 23 | 24 | FILES TO LOOK AT 25 | ================ 26 | include/lynxkdi.h -defines a simple struct passed to a kdi. 27 | common/lynxkdi.c -implements the call to the kdi. 28 | common/cmd_bootm.c -top-level command implementation ("bootm"). 29 | 30 | 31 | ==================================================================== 32 | TARGET SPECIFIC NOTES 33 | ==================================================================== 34 | 35 | MPC8260ADS 36 | =========== 37 | The default LynxOS and BlueCat implementations require some 38 | modifications to the config file. 39 | 40 | Edit include/configs/MPC8260ADS.h to use the following: 41 | 42 | #define CFG_IMMR 0xFA200000 43 | #define CFG_BCSR 0xFA100000 44 | #define CFG_BR1_PRELIM 0xFA101801 45 | 46 | When creating a LynxOS or BlueCat u-boot image using mkimage, 47 | you must specify the following: 48 | 49 | Both: -A ppc -O lynxos -T kernel -C none 50 | LynxOS: -a 0x00004000 -e 0x00004020 51 | BlueCat: -a 0x00500000 -e 0x00507000 52 | 53 | To pass the MAC address to BlueCat you should define the 54 | "fcc2_ether_addr" parameter in the "bootargs" environment 55 | variable. E.g.: 56 | 57 | ==> setenv bootargs fcc2_ether_addr=00:11:22:33:44:55:66 58 | -------------------------------------------------------------------------------- /src/doc/README.modnet50: -------------------------------------------------------------------------------- 1 | U-BOOT Port for FSForth ModNET50 Board 2 | -------------------------------------- 3 | 4 | author: Thomas Elste 5 | IMMS gGmbH 6 | 7 | The port based upon an early (partial complete) 8 | armboot-port from Stephan Linz for the ModNET50 Board. 9 | 10 | 11 | Overview: 12 | 13 | - board with Netsilicon NET+50 ARM7TDMI CPU without MMU 14 | - 16 MB SDRAM 15 | - 2 MB Flash (MBL29LV160BE) 16 | - 10/100 Ethernet PHY (LXT971A) 17 | 18 | 19 | Current Configuration (include/configs/modnet50.h): 20 | 21 | Memory Map: 0x00000000 - 0x00FFFFFF 16M SDRAM 22 | 0x10000000 - 0x101FFFFF 2M Flash 23 | 24 | The Flash uses a BB-Architectur with 35 sectors 25 | (0:16K; 1,2:8K; 3:32K; 4-34:64K). U-Boot is located in 26 | the first 5 sectors. 27 | 28 | The environment is located at the end of the 4th Flash 29 | sector (0x1001C000-0x1001FFFF). 30 | 31 | Build: 32 | 33 | U-boot should be build by using the ELDK Toolchain (arm-linux-*). 34 | 35 | make modnet50_config 36 | make 37 | 38 | 39 | Status: 40 | 41 | Everything seems to work fine. Booting images was tested by 42 | booting uCLinux (with and without a separate ramdisk image) from 43 | flash. 44 | 45 | 46 | Files: 47 | 48 | cpu/arm720t/serial_netarm.c .. serial I/O for the cpu 49 | 50 | board/modnet50/memsetup.S .. memory setup for ModNET50 51 | board/modnet50/flash.c .. flash routines 52 | board/modnet50/modnet50.c .. some board init stuff 53 | 54 | drivers/netarm_eth.c .. ethernet driver for the NET+50 CPU 55 | drivers/netarm_eth.h .. header for ethernet driver 56 | 57 | include/configs/modnet50.h .. configuration file for ModNET50 58 | 59 | include/netarm_*.h .. register and macro definitions for 60 | the NETARM CPU family 61 | 62 | doc/README.modnet50 .. this readme 63 | -------------------------------------------------------------------------------- /src/doc/README.mpc5xx: -------------------------------------------------------------------------------- 1 | 2 | Summary: 3 | ======== 4 | 5 | This file contains information about the port of U-Boot to the 6 | Motorola mpc5xx series of CPUs. Most of this code is taken from 7 | existing code mainly from the mpc8xx port. In contrast to mpc8xx, 8 | the mpc5xx has no CPM, MMU and cache facilities. 9 | 10 | The implemented features have been tested on the cmi board, a 11 | customer specific board (see README.cmi). 12 | 13 | Hence this port is only tested on the cmi board further possible 14 | tests on other boards will be very valuable. 15 | 16 | Not Tested Features: 17 | ==================== 18 | 19 | * System calls 20 | * Interrupts 21 | 22 | Added or Changed Files: 23 | ======================= 24 | 25 | u-boot-0.2.0/common/cmd_boot.c 26 | u-boot-0.2.0/common/cmd_reginfo.c 27 | u-boot-0.2.0/common/environment.c 28 | u-boot-0.2.0/cpu/mpc5xx/* 29 | u-boot-0.2.0/include/cmd_reginfo.h 30 | u-boot-0.2.0/include/common.h 31 | u-boot-0.2.0/include/ppc_asm.tmpl 32 | u-boot-0.2.0/include/watchdog.h 33 | u-boot-0.2.0/include/mpc5xx.h 34 | u-boot-0.2.0/include/status_led.h 35 | u-boot-0.2.0/include/asm-ppc/u-boot.h 36 | u-boot-0.2.0/include/asm-ppc/5xx_immap.h 37 | u-boot-0.2.0/lib_ppc/board.c 38 | u-boot-0.2.0/lib_ppc/cache.c 39 | u-boot-0.2.0/lib_ppc/time.c 40 | u-boot-0.2.0/Makefile 41 | u-boot-0.2.0/CREDITS 42 | u-boot-0.2.0/doc/README.mpc5xx 43 | u-boot-0.2.0/doc/README.cmi 44 | u-boot-0.2.0/README 45 | u-boot-0.2.0/MAKEALL 46 | 47 | Regards, 48 | Martin 49 | -------------------------------------------------------------------------------- /src/doc/README.mpc74xx: -------------------------------------------------------------------------------- 1 | This file contains status information for the port of U-Boot to the 2 | Motorola mpc74xx series of CPUs. 3 | 4 | Author: Josh Huber 5 | Mission Critical Linux, Inc. 6 | 7 | Currently the support for these CPUs is pretty minimal, but enough to 8 | get things going. (much like the support for the Galileo Eval Board) 9 | 10 | There is a framework in place to enable the L2 cache, and to program 11 | the BATs. Currently, there are still problems with the code which 12 | sets up the L2 cache, so it's not enabled. (IMHO, it shouldn't be 13 | anyway). Additionally, there is support for enabling the MMU, which 14 | we also don't do. The BATs are programmed just for the benefit of 15 | jumping into Linux in a sane configuration. 16 | 17 | Most of the code was based on other cpus supported by U-Boot. 18 | 19 | If you find any errors in the CPU setup code, please send us a note. 20 | 21 | Thanks, 22 | Josh 23 | -------------------------------------------------------------------------------- /src/doc/README.ne2000: -------------------------------------------------------------------------------- 1 | This driver supports NE2000 compatible cards (those based on DP8390, 2 | DP83902 and similar). It can be used with PCMCIA/CF cards provided 3 | that the CCR is correctly initialized. 4 | 5 | The code is based on sources from the Linux kernel (pcnet_cs.c, 6 | 8390.h) and eCOS(if_dp83902a.c, if_dp83902a.h). Both of these 2 7 | wonderful world are GPL, so this is, of course, GPL. 8 | 9 | I developed and tested this driver on a custom PXA255 based system and 10 | with a billionton CF network card connected to the PCMCIA interface of 11 | the micro (have a look at README.PXA_CF for the support of this port). 12 | 13 | The options you have to specify in the config file are (with the 14 | value for my board as an example): 15 | 16 | #define CONFIG_DRIVER_NE2000 17 | 18 | - Enables the driver 19 | 20 | #define CONFIG_DRIVER_NE2000_BASE (0x20000000+0x300) 21 | 22 | - Address where the board is mapped 23 | 24 | #define CONFIG_DRIVER_NE2000_CCR (0x28000000+0x3f8) 25 | 26 | - Address of the CCR (card configuration register). It could be found 27 | by enabling DEBUG in cmd_pcmcia.c. If this is not defined nothing is 28 | done as far as PCMCIA support is concerned. 29 | 30 | #define CONFIG_DRIVER_NE2000_VAL (0x20) 31 | 32 | - The value to be written in the CCR. It selects among different I/O 33 | spaces that could be used by the card. 34 | 35 | 36 | Enjoy! 37 | 38 | Christian Pellegrin 39 | -------------------------------------------------------------------------------- /src/doc/README.ns9750dev: -------------------------------------------------------------------------------- 1 | U-Boot Port to the NS9750 DevKit from NetSilicon 2 | 3 | 1 Overview 4 | 2 Board Configuration 5 | 3 Installation 6 | 7 | 8 | 1 Overview 9 | ---------- 10 | 11 | This port supports these NS9750 features. 12 | 13 | o one UART 14 | 15 | 2 Board Configuration 16 | --------------------- 17 | 18 | Switches: 19 | SW10: 4 20 | SW11: 6,7 21 | SW16: 6,7,8 22 | SW17-SW20: 1 23 | SW4: 3, 6 24 | SW 1: 1 25 | SW2: 4 26 | SW3: 3 27 | SW8: 3 (rotated by 180 degree!!!!) 28 | 29 | Serial Console is Port B (bottom right port) 30 | 31 | 3 Installation 32 | -------------- 33 | 34 | Have fun, 35 | -- 36 | Markus Pietrek 37 | -------------------------------------------------------------------------------- /src/doc/README.ocotea: -------------------------------------------------------------------------------- 1 | IBM Ocotea Board 2 | 3 | Last Update: March 2, 2004 4 | ======================================================================= 5 | 6 | This file contains some handy info regarding U-Boot and the IBM 7 | Ocotea 440gx evalutation board. See the README.ppc440 for additional 8 | information. 9 | 10 | 11 | SWITCH SETTINGS & JUMPERS 12 | ========================== 13 | 14 | Here's what I've been using successfully. If you feel inclined to 15 | change things ... please read the docs! 16 | 17 | DIPSW U46 U80 18 | ------------------------ 19 | SW 1 off off 20 | SW 2 on off 21 | SW 3 off off 22 | SW 4 off off 23 | SW 5 off off 24 | SW 6 on on 25 | SW 7 on off 26 | SW 8 on off 27 | 28 | J41: strapped 29 | J42: open 30 | 31 | All others are factory default. 32 | 33 | 34 | I2C Information 35 | ===================== 36 | 37 | See README.ebony for information. 38 | 39 | PCI 40 | =========================== 41 | 42 | Untested at the time of writing. 43 | 44 | PPC440GX Ethernet EMACs 45 | =========================== 46 | 47 | All EMAC ports have been tested and are known to work 48 | with EPS Group 4. 49 | 50 | Special note about the Cicada CIS8201: 51 | The CIS8201 Gigabit PHY comes up in GMII mode by default. 52 | One must hit an extended register to allow use of RGMII mode. 53 | This has been done in the 440gx_enet.c file with a #ifdef/endif 54 | pair. 55 | 56 | IBM does not store the EMAC ethernet addresses within their PIBS bootloader. 57 | The addresses contained in the config header file are from my particular 58 | board and you _*should*_ change them to reflect your board either in the 59 | config file and/or in your environment variables. I found the addresses on 60 | labels on the bottom side of the board. 61 | 62 | 63 | BDI2k or JTAG Debugging 64 | =========================== 65 | 66 | For ease of debugging you can swap the small boot flash and external SRAM 67 | by changing U46:3 to on. You can then use the sram as your boot flash by 68 | loading the sram via the jtag debugger. 69 | 70 | 71 | Regards, 72 | --Travis 73 | 74 | -------------------------------------------------------------------------------- /src/doc/README.sbc8560: -------------------------------------------------------------------------------- 1 | The port was tested on Wind River System Sbc8560 board . 2 | U-Boot was installed on the flash memory of the CPU card (no the SODIMM). 3 | 4 | NOTE: Please configure uboot compile to the proper PCI frequency and 5 | setup the appropriate DIP switch settings. 6 | 7 | SBC8560 board: 8 | 9 | Make sure boards switches are set to their appropriate conditions. 10 | Refer to the Engineering Reference Guide ERG-00300-002. Of particular 11 | importance are: 1)Tthe settings for JP4 (JP4 1-3 and 2-4), which 12 | select the on-board FLASH device (Intel 28F128Jx); 2) The settings 13 | for the Clock SW9 (33 MHz or 66 MHz). 14 | 15 | Note: SW9 Settings: 66 MHz 16 | 4:1 ratio CCB clocks:SYSCLK 17 | 3:1 ration e500 Core:CCB 18 | pos1 - on, pos2 - on, pos3 - off, pos4 - on, pos5 - off, pos6 - on 19 | Note: SW9 Settings: 33 MHz 20 | 8:1 ratio CCB clocks:SYSCLK 21 | 3:1 ration e500 Core:CCB 22 | pos1 - on, pos2 - on, pos3 - on, pos4 - off, pos5 - off, pos6 - on 23 | 24 | 25 | Flashing the FLASH device with the "Wind River ICE": 26 | 27 | 1) Properly connect and configure the Wind River ICE to the 28 | target JTAG port. This includes running the SBC8560 register script. 29 | Make sure target memory can be read and written. 30 | 31 | 2) Build the u-boot image: 32 | make distclean 33 | make SBC8560_66_config or SBC8560_33_config 34 | make CROSS_COMPILE=.../ELDK3.0/ppc_8xx-/ all 35 | 36 | Note: reference is made to the ELDK3.0 compiler but any 85xx cross-compiler 37 | should suffice. 38 | 39 | 3) Convert the uboot (.elf) file to a uboot.bin file (using visionClick converter). 40 | The bin file should be converted from fffc0000 to ffffffff 41 | 42 | 4) Setup the Flash Utility (tools menu) for: 43 | 44 | Determine the clock speed of the PCI bus and set SW9 accordingly 45 | Note: the speed of the PCI bus defaults to the slowest PCI card 46 | PlayBack the "default" register file for the SBC8560 47 | Select the uboot.bin file with zero bias 48 | Select the initialize Target prior to programming 49 | Select the V28F640Jx (8192 x 8) 1 device FLASH Algorithm 50 | Select the erase base address from FFFC0000 to FFFFFFFF 51 | Select the start address from 0 with size of 4000 52 | 53 | 5) Erase and Program 54 | -------------------------------------------------------------------------------- /src/doc/README.sched: -------------------------------------------------------------------------------- 1 | Notes on the scheduler in sched.c: 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | 4 | 'sched.c' provides an very simplistic multi-threading scheduler. 5 | See the example, function 'sched(...)', in the same file for its 6 | API usage. 7 | 8 | Until an exhaustive testing can be done, the implementation cannot 9 | qualify as that of production quality. It works with the example 10 | in 'sched.c', it may or may not work in other cases. 11 | 12 | 13 | Limitations: 14 | ~~~~~~~~~~~~ 15 | 16 | - There are NO primitives for thread synchronization (locking, 17 | notify etc). 18 | 19 | - Only the GPRs and FPRs context is saved during a thread context 20 | switch. Other registers on the PowerPC processor (60x, 7xx, 7xxx 21 | etc) are NOT saved. 22 | 23 | - The scheduler is NOT transparent to the user. The user 24 | applications must invoke thread_yield() to allow other threads to 25 | scheduler. 26 | 27 | - There are NO priorities, and the scheduling policy is round-robin 28 | based. 29 | 30 | - There are NO capabilities to collect thread CPU usage, scheduler 31 | stats, thread status etc. 32 | 33 | - The semantics are somewhat based on those of pthreads, but NOT 34 | the same. 35 | 36 | - Only seven threads are allowed. These can be easily increased by 37 | changing "#define MAX_THREADS" depending on the available memory. 38 | 39 | - The stack size of each thread is 8KBytes. This can be easily 40 | increased depending on the requirement and the available memory, 41 | by increasing "#define STK_SIZE". 42 | 43 | - Only one master/parent thread is allowed, and it cannot be 44 | stopped or deleted. Any given thread is NOT allowed to stop or 45 | delete itself. 46 | 47 | - There NOT enough safety checks as are probably in the other 48 | threads implementations. 49 | 50 | - There is no parent-child relationship between threads. Only one 51 | thread may thread_join, preferably the master/parent thread. 52 | 53 | (C) 2003 Arun Dharankar 54 | -------------------------------------------------------------------------------- /src/doc/README.serial_multi: -------------------------------------------------------------------------------- 1 | The support for multiple serial interfaces as implemented is mainly 2 | intended to allow for modem dial-in / dial-out while still being able 3 | to use a serial console on a (different) serial port. 4 | 5 | MPC8XX Specific 6 | =============== 7 | At the moment, the ports must be split on a SMC and a SCC port on a 8 | 8xx processor; other configurations are not (yet) supported. 9 | 10 | Support for hardware handshake has not been implemented yet (but is 11 | in the works). 12 | 13 | *) The default console depends on the keys pressed: 14 | - SMC if keys not pressed (modem not enabled) 15 | - SCC if keys pressed (modem enabled) 16 | 17 | *) The console can be switched to SCC by any of the following commands: 18 | 19 | setenv stdout serial_scc 20 | setenv stdin serial_scc 21 | setenv stderr serial_scc 22 | 23 | *) The console can be switched to SMC by any of the following commands: 24 | 25 | setenv stdout serial_smc 26 | setenv stdin serial_smc 27 | setenv stderr serial_smc 28 | 29 | *) If a file descriptor is set to "serial" then the current serial device 30 | will be used which, in turn, can be switched by above commands. 31 | 32 | *) The baudrate is the same for all serial devices. But it can be switched 33 | just after switching the console: 34 | 35 | setenv sout serial_scc; setenv baudrate 38400 36 | 37 | After that press 'enter' at the SCC console. Note that baudrates <38400 38 | are not allowed on LWMON with watchdog enabled (see CFG_BAUDRATE_TABLE in 39 | include/configs/lwmon.h). 40 | 41 | 42 | PPC4XX Specific 43 | =============== 44 | *) The default console is UART0 45 | 46 | *) The console can be switched to UART1 by any of the following commands: 47 | setenv stdout serial1 48 | setenv stderr serial1 49 | setenv stdin serial1 50 | 51 | *) The console can be switched to UART0 by any of the following commands: 52 | setenv stdout serial0 53 | setenv stderr serial0 54 | setenv stdin serial0 55 | -------------------------------------------------------------------------------- /src/doc/README.silent: -------------------------------------------------------------------------------- 1 | The config option CONFIG_SILENT_CONSOLE can be used to quiet messages 2 | on the console. If the option has been enabled, the output can be 3 | silenced by setting the environment variable "silent". The variable 4 | is latched into the global data at an early stage in the boot process 5 | so deleting it with "setenv" will not take effect until the system is 6 | restarted. 7 | 8 | The following actions are taken if "silent" is set at boot time: 9 | 10 | - Until the console devices have been initialized, output has to be 11 | suppressed by testing for the flag "GD_FLG_SILENT" in "gd->flags". 12 | 13 | - When the console devices have been initialized, "stdout" and 14 | "stderr" are set to "nulldev", so subsequent messages are 15 | suppressed automatically. Make sure to enable "nulldev" by 16 | #defining CFG_DEVICE_NULLDEV in your board config file. 17 | 18 | - When booting a linux kernel, the "bootargs" are fixed up so that 19 | the argument "console=" will be in the command line, no matter how 20 | it was set in "bootargs" before. 21 | -------------------------------------------------------------------------------- /src/doc/README.video: -------------------------------------------------------------------------------- 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 | U-Boot MPC8xx video controller driver 25 | ====================================== 26 | 27 | The driver has been tested with the following configurations: 28 | 29 | - MPC823FADS with AD7176 on a PAL TV (YCbYCr) - arsenio@tin.it 30 | - GENIETV with AD7177 on a PAL TV (YCbYCr) - arsenio@tin.it 31 | -------------------------------------------------------------------------------- /src/doc/TODO-i386: -------------------------------------------------------------------------------- 1 | i386 port missing features: 2 | * i386 cleaness (wbinvld is 486+ ... ) 3 | * Pentium TSC timer/udelay 4 | * setup the BIOS data area and BIOS equipment word to reflect machine config. 5 | * Make reset work (from Linux and from the boot prompt) 6 | * DMA, FDC, RTC, KBC initialization 7 | * split of part of cpu/i386/interrupt.c to cpu/i385/entry.c? 8 | * re-entry of protected mode from real mode, should be added to realmode_switch.S 9 | (and used by INT 10h and INT 16h handlers for console I/O during early 10 | linux boot...) 11 | * missing functions in lib_i386 and cpu/i386 12 | * speaker beep interface 13 | 14 | 15 | SC520 missing features: 16 | * Watchdog 17 | * SC520 timer/udelay 18 | * SC520 3rd PIC 19 | * SC520 ICE serial 20 | * SC520 MMCR reset 21 | 22 | SC520 CDP board support missing features: 23 | * environment in sram 24 | 25 | SC520 CDP board support bugs: 26 | * SPI EEPROM support does not work 27 | * 0x680 LEDS dos not work for me 28 | * is it possible to make both the internal serial ports and the 29 | ports on the sio work at the same time? 30 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | {0xC2DA, 0x909506, 5, 8, 256, 128, 2048, 64, 0x30C77fff, "MX30LF2G18AC", 0}, 12 | {0xC2DC, 0x909556, 5, 8, 512, 128, 2048, 64, 0x30C77fff, "MX30LF4G18AC", 0}, 13 | {0x2C48, 0x0026A9, 5, 8, 2048, 512, 4096, 224, 0x30C77fff, "MT29F16G08ABABA", 0}, 14 | {0x98D3, 0x902676, 5, 8, 1024, 256, 4096, 224, 0x00C25332, "TC58NVG3S0F", 0}, 15 | {0x01DA, 0x909546, 5, 8, 256, 128, 2048, 112, 0x30C77fff, "S34ML02G200TF", 0}, 16 | {0x01DC, 0x909556, 5, 8, 512, 128, 2048, 112, 0x30C77fff, "S34ML04G200TF", 0}, 17 | {0x0000, 0x000000, 0, 0, 0, 0, 0, 0, 0, "xxxxxxxxxx", 0}, 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/include/asm-mips/inca-ip.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/include/asm-mips/inca-ip.h -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/include/asm/inca-ip.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/include/asm/inca-ip.h -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/include/config.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /src/include/config.mk: -------------------------------------------------------------------------------- 1 | ARCH = mips 2 | CPU = ralink_soc 3 | BOARD = rt2880 4 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | __attribute__((nomips16)) void udelay(unsigned long); 20 | __attribute__((nomips16)) 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 | -------------------------------------------------------------------------------- /src/include/fat_old.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/include/fat_old.h -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/include/linux/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_CONFIG_H 2 | #define _LINUX_CONFIG_H 3 | 4 | /* #include */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/lib_mips/.board.c.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/lib_mips/.board.c.swp -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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__ -fPIC 25 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/mt7621_stage_L2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/mt7621_stage_L2.bin -------------------------------------------------------------------------------- /src/mt7621_stage_sram.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/mt7621_stage_sram.bin -------------------------------------------------------------------------------- /src/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 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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/scripts/lxdialog/checklist.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/scripts/lxdialog/checklist.o -------------------------------------------------------------------------------- /src/scripts/lxdialog/inputbox.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/scripts/lxdialog/inputbox.o -------------------------------------------------------------------------------- /src/scripts/lxdialog/lxdialog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/scripts/lxdialog/lxdialog -------------------------------------------------------------------------------- /src/scripts/lxdialog/lxdialog.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/scripts/lxdialog/lxdialog.o -------------------------------------------------------------------------------- /src/scripts/lxdialog/menubox.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/scripts/lxdialog/menubox.o -------------------------------------------------------------------------------- /src/scripts/lxdialog/msgbox.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/scripts/lxdialog/msgbox.o -------------------------------------------------------------------------------- /src/scripts/lxdialog/textbox.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/scripts/lxdialog/textbox.o -------------------------------------------------------------------------------- /src/scripts/lxdialog/util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/scripts/lxdialog/util.o -------------------------------------------------------------------------------- /src/scripts/lxdialog/yesno.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdk0901/openwrt-uboot-mt7628/1e8bcaa4592c091fc54bd1dc56d3bfc7a38b3468/src/scripts/lxdialog/yesno.o -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | --------------------------------------------------------------------------------