├── bin └── README ├── u-boot ├── CREDITS ├── CHANGELOG ├── include │ ├── linux │ │ ├── mtd │ │ │ └── mtd.h │ │ ├── config.h │ │ ├── stddef.h │ │ ├── posix_types.h │ │ ├── ctype.h │ │ ├── bitops.h │ │ ├── string.h │ │ ├── byteorder │ │ │ ├── big_endian.h │ │ │ └── little_endian.h │ │ └── types.h │ ├── unlzma_tiny.h │ ├── soc │ │ ├── mtk_soc_common.h │ │ ├── soc_common.h │ │ └── soc_list.h │ ├── asm-mips │ │ ├── isadep.h │ │ ├── cachectl.h │ │ ├── byteorder.h │ │ ├── sgidefs.h │ │ ├── cacheops.h │ │ ├── reg.h │ │ ├── regdef.h │ │ ├── types.h │ │ ├── u-boot.h │ │ ├── global_data.h │ │ ├── ptrace.h │ │ └── addrspace.h │ ├── serial.h │ ├── version.h │ ├── console.h │ ├── exports.h │ ├── unlzma_tiny_config.h │ ├── hush.h │ ├── tinf.h │ ├── rtc.h │ ├── ioports.h │ ├── tplink_image.h │ ├── jffs2 │ │ └── load_kernel.h │ ├── xyzModem.h │ ├── devices.h │ └── crc.h ├── httpd │ ├── vendors │ │ ├── dragino │ │ │ ├── f.png │ │ │ ├── l.png │ │ │ ├── 404.html │ │ │ ├── fail.html │ │ │ ├── style.css │ │ │ ├── index.html │ │ │ └── flashing.html │ │ ├── villagetelco │ │ │ ├── v.png │ │ │ ├── vt.png │ │ │ ├── 404.html │ │ │ ├── fail.html │ │ │ ├── style.css │ │ │ ├── index.html │ │ │ └── flashing.html │ │ ├── yuicompressor-2.4.8.jar │ │ ├── oem │ │ │ ├── 404.html │ │ │ ├── fail.html │ │ │ ├── style.css │ │ │ ├── index.html │ │ │ └── flashing.html │ │ ├── general │ │ │ ├── 404.html │ │ │ ├── fail.html │ │ │ ├── art.html │ │ │ ├── index.html │ │ │ ├── style.css │ │ │ ├── uboot.html │ │ │ └── flashing.html │ │ └── SE │ │ │ ├── 404.html │ │ │ ├── fail.html │ │ │ ├── style.css │ │ │ ├── index.html │ │ │ ├── art.html │ │ │ ├── uboot.html │ │ │ └── flashing.html │ ├── Makefile │ ├── tapdev.h │ ├── fsdata.h │ ├── httpd.h │ ├── fs.h │ └── minidhcpd.h ├── rtc │ └── Makefile ├── drivers │ └── Makefile ├── cpu │ └── mips │ │ ├── config.mk │ │ ├── Makefile │ │ ├── ar7240 │ │ ├── Makefile │ │ ├── qca_common.c │ │ ├── ag7240_phy.h │ │ ├── qca_ls_uart.c │ │ └── qca_usb.c │ │ ├── u-boot.lds │ │ ├── cpu.c │ │ └── u-boot-bootstrap.lds ├── board │ └── ar7240 │ │ ├── ap121 │ │ ├── config.mk │ │ ├── Makefile │ │ └── ap121.c │ │ ├── ap143 │ │ ├── config.mk │ │ ├── ap143.c │ │ └── Makefile │ │ ├── ap152 │ │ ├── config.mk │ │ ├── ap152.c │ │ └── Makefile │ │ ├── db12x │ │ ├── config.mk │ │ ├── Makefile │ │ └── db12x.c │ │ └── common │ │ ├── phy.h │ │ ├── athrsf1_phy.h │ │ ├── qca-eth-953x_phy.h │ │ ├── athr_ar8033_phy.h │ │ ├── athr_ar8033_phy.c │ │ ├── athrs17_phy.h │ │ └── athrs_vir_phy.c ├── net │ ├── tftp.h │ ├── Makefile │ ├── httpd.h │ ├── rarp.h │ ├── sntp.h │ ├── nfs.h │ ├── sntp.c │ ├── bootp.h │ └── rarp.c ├── lib_mips │ ├── Makefile │ └── time.c ├── lib_generic │ ├── Makefile │ ├── display_options.c │ ├── crc32.c │ ├── tinfcrc32.c │ ├── ldiv.c │ └── ctype.c ├── common │ ├── exports.c │ ├── Makefile │ ├── cmd_help.c │ ├── cmd_echo.c │ ├── env_nowhere.c │ └── cmd_boot.c ├── end.mk ├── mkconfig └── tools │ └── envcrc.c ├── host_util └── lzma1801.7z ├── original_u-boot_images ├── yuncore_t830.bin ├── yuncore_ap90q.bin ├── yuncore_cpe830.bin ├── yuncore_cpe870.bin ├── d-link_dir505_a1.bin ├── p2w_r602n_cpe505n.bin ├── tp-link_cpe210_v1.bin ├── tp-link_cpe510_v1.0.bin ├── tp-link_tl-wr940n_v3.bin ├── wallys_dr531_160915.bin ├── easylink_m-mini_031213.bin ├── jjplus_jwap230_031115.bin ├── tp-link_cpe510-eu_v1.1.bin ├── tp-link_tl-wr902ac_v1.bin ├── buffalo_wpl-05g300_040112.bin ├── gl-inet_gl-ar150_100815.bin ├── gl-inet_gl-ar300_270515.bin ├── gl-inet_gl-usb150_040717.bin ├── hak5_lan-turtle_20062017.bin ├── openembed_som9331_030114.bin ├── tp-link_eap245_v1_160903.bin ├── tp-link_eap245_v1_161101.bin ├── netgear_wndr4300_v2_120814.bin ├── tp-link_tl-mr10u_v1_130321.bin ├── tp-link_tl-mr22u_v1_140123.bin ├── tp-link_tl-mr3020_v1_130225.bin ├── tp-link_tl-mr3040_v1_120328.bin ├── tp-link_tl-mr3040_v2_131121.bin ├── tp-link_tl-mr3220_v2_130423.bin ├── tp-link_tl-mr3420_v2_130314.bin ├── tp-link_tl-mr3420_v3_120617.bin ├── tp-link_tl-mr6400_v1_160318.bin ├── tp-link_tl-mr6400_v2_170330.bin ├── tp-link_tl-wr703n_v1_120228.bin ├── tp-link_tl-wr710n_v1_130419.bin ├── tp-link_tl-wr740n_v4_130513.bin ├── tp-link_tl-wr802n_v1_150717.bin ├── tp-link_tl-wr841n_v8_130506.bin ├── tp-link_tl-wr841n_v9_150210.bin ├── tp-link_tl-wr842n_v3_150921.bin ├── alfa-network_tube2h_18052012.bin ├── hak5_packet-squirrel_29072017.bin ├── tp-link_tl-wa801nd_v2_130121.bin ├── tp-link_tl-wa830re_v2_121008.bin ├── tp-link_tl-wa850re_v2_160517.bin ├── tp-link_tl-wa860re_v2_160411.bin ├── tp-link_tl-wdr3500_v1_130909.bin ├── tp-link_tl-wdr3600_v1_130909.bin ├── tp-link_tl-wdr4300_v1_130617.bin ├── tp-link_tl-wr1043nd_v2_150910.bin ├── tp-link_tl-wr820n_v1_CN_141014.bin ├── tp-link_tl-wr841n_v10_150310.bin ├── tp-link_tl-wr841n_v11_150616.bin ├── alfa-network_hornet-ub_23062014.bin ├── gainstrong_oolite-v5.2_03062017.bin ├── hak5_wifi-pineapple-nano_13082015.bin └── philips_hue-bridge-bsb002_v2_220715.bin └── .gitignore /bin/README: -------------------------------------------------------------------------------- 1 | Here you will find binary images after code compilation. 2 | -------------------------------------------------------------------------------- /u-boot/CREDITS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/u-boot/CREDITS -------------------------------------------------------------------------------- /u-boot/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/u-boot/CHANGELOG -------------------------------------------------------------------------------- /host_util/lzma1801.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/host_util/lzma1801.7z -------------------------------------------------------------------------------- /u-boot/include/linux/mtd/mtd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/u-boot/include/linux/mtd/mtd.h -------------------------------------------------------------------------------- /u-boot/httpd/vendors/dragino/f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/u-boot/httpd/vendors/dragino/f.png -------------------------------------------------------------------------------- /u-boot/httpd/vendors/dragino/l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/u-boot/httpd/vendors/dragino/l.png -------------------------------------------------------------------------------- /original_u-boot_images/yuncore_t830.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/yuncore_t830.bin -------------------------------------------------------------------------------- /u-boot/httpd/vendors/villagetelco/v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/u-boot/httpd/vendors/villagetelco/v.png -------------------------------------------------------------------------------- /original_u-boot_images/yuncore_ap90q.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/yuncore_ap90q.bin -------------------------------------------------------------------------------- /original_u-boot_images/yuncore_cpe830.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/yuncore_cpe830.bin -------------------------------------------------------------------------------- /original_u-boot_images/yuncore_cpe870.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/yuncore_cpe870.bin -------------------------------------------------------------------------------- /u-boot/httpd/vendors/villagetelco/vt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/u-boot/httpd/vendors/villagetelco/vt.png -------------------------------------------------------------------------------- /original_u-boot_images/d-link_dir505_a1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/d-link_dir505_a1.bin -------------------------------------------------------------------------------- /original_u-boot_images/p2w_r602n_cpe505n.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/p2w_r602n_cpe505n.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_cpe210_v1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_cpe210_v1.bin -------------------------------------------------------------------------------- /u-boot/httpd/vendors/yuicompressor-2.4.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/u-boot/httpd/vendors/yuicompressor-2.4.8.jar -------------------------------------------------------------------------------- /u-boot/include/linux/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_CONFIG_H 2 | #define _LINUX_CONFIG_H 3 | 4 | /* #include */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_cpe510_v1.0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_cpe510_v1.0.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr940n_v3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr940n_v3.bin -------------------------------------------------------------------------------- /original_u-boot_images/wallys_dr531_160915.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/wallys_dr531_160915.bin -------------------------------------------------------------------------------- /original_u-boot_images/easylink_m-mini_031213.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/easylink_m-mini_031213.bin -------------------------------------------------------------------------------- /original_u-boot_images/jjplus_jwap230_031115.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/jjplus_jwap230_031115.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_cpe510-eu_v1.1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_cpe510-eu_v1.1.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr902ac_v1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr902ac_v1.bin -------------------------------------------------------------------------------- /original_u-boot_images/buffalo_wpl-05g300_040112.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/buffalo_wpl-05g300_040112.bin -------------------------------------------------------------------------------- /original_u-boot_images/gl-inet_gl-ar150_100815.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/gl-inet_gl-ar150_100815.bin -------------------------------------------------------------------------------- /original_u-boot_images/gl-inet_gl-ar300_270515.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/gl-inet_gl-ar300_270515.bin -------------------------------------------------------------------------------- /original_u-boot_images/gl-inet_gl-usb150_040717.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/gl-inet_gl-usb150_040717.bin -------------------------------------------------------------------------------- /original_u-boot_images/hak5_lan-turtle_20062017.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/hak5_lan-turtle_20062017.bin -------------------------------------------------------------------------------- /original_u-boot_images/openembed_som9331_030114.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/openembed_som9331_030114.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_eap245_v1_160903.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_eap245_v1_160903.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_eap245_v1_161101.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_eap245_v1_161101.bin -------------------------------------------------------------------------------- /original_u-boot_images/netgear_wndr4300_v2_120814.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/netgear_wndr4300_v2_120814.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-mr10u_v1_130321.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-mr10u_v1_130321.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-mr22u_v1_140123.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-mr22u_v1_140123.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-mr3020_v1_130225.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-mr3020_v1_130225.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-mr3040_v1_120328.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-mr3040_v1_120328.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-mr3040_v2_131121.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-mr3040_v2_131121.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-mr3220_v2_130423.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-mr3220_v2_130423.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-mr3420_v2_130314.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-mr3420_v2_130314.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-mr3420_v3_120617.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-mr3420_v3_120617.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-mr6400_v1_160318.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-mr6400_v1_160318.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-mr6400_v2_170330.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-mr6400_v2_170330.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr703n_v1_120228.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr703n_v1_120228.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr710n_v1_130419.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr710n_v1_130419.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr740n_v4_130513.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr740n_v4_130513.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr802n_v1_150717.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr802n_v1_150717.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr841n_v8_130506.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr841n_v8_130506.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr841n_v9_150210.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr841n_v9_150210.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr842n_v3_150921.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr842n_v3_150921.bin -------------------------------------------------------------------------------- /original_u-boot_images/alfa-network_tube2h_18052012.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/alfa-network_tube2h_18052012.bin -------------------------------------------------------------------------------- /original_u-boot_images/hak5_packet-squirrel_29072017.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/hak5_packet-squirrel_29072017.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wa801nd_v2_130121.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wa801nd_v2_130121.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wa830re_v2_121008.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wa830re_v2_121008.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wa850re_v2_160517.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wa850re_v2_160517.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wa860re_v2_160411.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wa860re_v2_160411.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wdr3500_v1_130909.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wdr3500_v1_130909.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wdr3600_v1_130909.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wdr3600_v1_130909.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wdr4300_v1_130617.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wdr4300_v1_130617.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr1043nd_v2_150910.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr1043nd_v2_150910.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr820n_v1_CN_141014.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr820n_v1_CN_141014.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr841n_v10_150310.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr841n_v10_150310.bin -------------------------------------------------------------------------------- /original_u-boot_images/tp-link_tl-wr841n_v11_150616.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/tp-link_tl-wr841n_v11_150616.bin -------------------------------------------------------------------------------- /original_u-boot_images/alfa-network_hornet-ub_23062014.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/alfa-network_hornet-ub_23062014.bin -------------------------------------------------------------------------------- /original_u-boot_images/gainstrong_oolite-v5.2_03062017.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/gainstrong_oolite-v5.2_03062017.bin -------------------------------------------------------------------------------- /original_u-boot_images/hak5_wifi-pineapple-nano_13082015.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/hak5_wifi-pineapple-nano_13082015.bin -------------------------------------------------------------------------------- /original_u-boot_images/philips_hue-bridge-bsb002_v2_220715.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFetch/router-u-boot/HEAD/original_u-boot_images/philips_hue-bridge-bsb002_v2_220715.bin -------------------------------------------------------------------------------- /u-boot/rtc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2006 Wolfgang Denk, DENX Software Engineering, wd@denx.de 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | include $(TOPDIR)/config.mk 8 | 9 | OBJS-y = date.o 10 | 11 | include $(TOPDIR)/end.mk -------------------------------------------------------------------------------- /u-boot/drivers/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2006 Wolfgang Denk, DENX Software Engineering, wd@denx.de 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | include $(TOPDIR)/config.mk 8 | 9 | OBJS-y = netconsole.o 10 | 11 | include $(TOPDIR)/end.mk -------------------------------------------------------------------------------- /u-boot/cpu/mips/config.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003 Wolfgang Denk, DENX Software Engineering, wd@denx.de. 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | # Jumps table seemed to be broken even without relocation 8 | PLATFORM_CFLAGS += -mips32r2 -march=mips32r2 -fno-jump-tables 9 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/ap121/config.mk: -------------------------------------------------------------------------------- 1 | # ROM version 2 | ifdef COMPRESSED_UBOOT 3 | TEXT_BASE = 0x80010000 4 | BOOTSTRAP_TEXT_BASE = 0x9F000000 5 | # RAM version 6 | else 7 | ifdef CONFIG_SKIP_LOWLEVEL_INIT 8 | TEXT_BASE = 0x80100000 9 | else 10 | TEXT_BASE = 0x9F000000 11 | endif 12 | endif 13 | 14 | PLATFORM_CFLAGS += -mtune=34kc -------------------------------------------------------------------------------- /u-boot/board/ar7240/ap143/config.mk: -------------------------------------------------------------------------------- 1 | # ROM version 2 | ifdef COMPRESSED_UBOOT 3 | TEXT_BASE = 0x80010000 4 | BOOTSTRAP_TEXT_BASE = 0x9F000000 5 | # RAM version 6 | else 7 | ifdef CONFIG_SKIP_LOWLEVEL_INIT 8 | TEXT_BASE = 0x80100000 9 | else 10 | TEXT_BASE = 0x9F000000 11 | endif 12 | endif 13 | 14 | PLATFORM_CFLAGS += -mtune=34kc -------------------------------------------------------------------------------- /u-boot/board/ar7240/ap152/config.mk: -------------------------------------------------------------------------------- 1 | # ROM version 2 | ifdef COMPRESSED_UBOOT 3 | TEXT_BASE = 0x80010000 4 | BOOTSTRAP_TEXT_BASE = 0x9F000000 5 | # RAM version 6 | else 7 | ifdef CONFIG_SKIP_LOWLEVEL_INIT 8 | TEXT_BASE = 0x80100000 9 | else 10 | TEXT_BASE = 0x9F000000 11 | endif 12 | endif 13 | 14 | PLATFORM_CFLAGS += -mtune=74kc -------------------------------------------------------------------------------- /u-boot/board/ar7240/db12x/config.mk: -------------------------------------------------------------------------------- 1 | # ROM version 2 | ifdef COMPRESSED_UBOOT 3 | TEXT_BASE = 0x80010000 4 | BOOTSTRAP_TEXT_BASE = 0x9F000000 5 | # RAM version 6 | else 7 | ifdef CONFIG_SKIP_LOWLEVEL_INIT 8 | TEXT_BASE = 0x80100000 9 | else 10 | TEXT_BASE = 0x9F000000 11 | endif 12 | endif 13 | 14 | PLATFORM_CFLAGS += -mtune=34kc -------------------------------------------------------------------------------- /u-boot/include/unlzma_tiny.h: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * SPDX-License-Identifier: GPL-2.0 4 | */ 5 | #ifndef UNLZMA_TINY_H_ 6 | #define UNLZMA_TINY_H_ 7 | 8 | #include 9 | #include 10 | 11 | size_t lzma_inflate(uint8_t *in_ptr, size_t in_size, uint8_t *out_ptr, size_t out_size); 12 | 13 | #endif /* UNLZMA_TINY_H_ */ 14 | -------------------------------------------------------------------------------- /u-boot/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 | * Global functions and variables 13 | */ 14 | 15 | /* Begin TFTP get */ 16 | extern void TftpStart(proto_t protocol); 17 | 18 | #endif /* __TFTP_H__ */ 19 | -------------------------------------------------------------------------------- /u-boot/include/soc/mtk_soc_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MediaTek/Ralink Wireless SOC common registers definitions 3 | * 4 | * Copyright (C) 2014 Piotr Dymacz 5 | * 6 | * SPDX-License-Identifier:GPL-2.0 7 | */ 8 | 9 | #ifndef _MTK_SOC_COMMON_H_ 10 | #define _MTK_SOC_COMMON_H_ 11 | 12 | #include 13 | 14 | #endif /* _MTK_SOC_COMMON_H_ */ 15 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2006 Wolfgang Denk, DENX Software Engineering, wd@denx.de 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | include $(TOPDIR)/config.mk 8 | 9 | BOOTSTRAPOBJ-y += cache.o 10 | BOOTSTRAPOBJ-y += start_bootstrap.o 11 | 12 | OBJS-y += start.o 13 | OBJS-y += cache.o 14 | OBJS-y += cpu.o 15 | 16 | include $(TOPDIR)/end.mk -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/net/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2006 Wolfgang Denk, DENX Software Engineering, wd@denx.de 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | include $(TOPDIR)/config.mk 8 | 9 | OBJS-y += net.o 10 | OBJS-y += tftp.o 11 | OBJS-y += bootp.o 12 | OBJS-y += rarp.o 13 | OBJS-y += eth.o 14 | OBJS-y += sntp.o 15 | OBJS-y += httpd.o 16 | 17 | include $(TOPDIR)/end.mk -------------------------------------------------------------------------------- /u-boot/net/httpd.h: -------------------------------------------------------------------------------- 1 | #ifndef _NET_HTTPD_H__ 2 | #define _NET_HTTPD_H__ 3 | 4 | void HttpdStart(void); 5 | void HttpdHandler(void); 6 | 7 | /* board specific implementation */ 8 | extern int do_http_upgrade(const ulong size, const int upgrade_type); 9 | extern int do_http_progress(const int state); 10 | extern void all_led_on(void); 11 | extern void all_led_off(void); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/db12x/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/config.mk 2 | 3 | BOOTSTRAPOBJ-y += $(BOARD).o 4 | 5 | OBJS-y += $(BOARD).o 6 | OBJS-y += ../common/spi_flash.o 7 | OBJS-y += ../common/common.o 8 | 9 | ifeq ($(ETH_CONFIG), _s17) 10 | OBJS-y += ../common/athrs17_phy.o 11 | endif 12 | 13 | ifeq ($(ETH_CONFIG), _s27) 14 | OBJS-y += ../common/athrs27_phy.o 15 | endif 16 | 17 | include $(TOPDIR)/end.mk -------------------------------------------------------------------------------- /u-boot/lib_mips/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2006 Wolfgang Denk, DENX Software Engineering, wd@denx.de 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | include $(TOPDIR)/config.mk 8 | 9 | BOOTSTRAPOBJ-y += bootstrap_board.o 10 | BOOTSTRAPOBJ-y += time.o 11 | 12 | OBJS-y += board.o 13 | OBJS-y += mips_linux.o 14 | OBJS-y += time.o 15 | 16 | CPPFLAGS += -DCONFIG_LZMA 17 | 18 | include $(TOPDIR)/end.mk -------------------------------------------------------------------------------- /u-boot/board/ar7240/ap121/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2006 Wolfgang Denk, DENX Software Engineering, wd@denx.de. 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | include $(TOPDIR)/config.mk 8 | 9 | BOOTSTRAPOBJ-y += $(BOARD).o 10 | 11 | OBJS-y += $(BOARD).o 12 | OBJS-y += ../common/spi_flash.o 13 | OBJS-y += ../common/common.o 14 | OBJS-y += ../common/ar7240_s26_phy.o 15 | 16 | include $(TOPDIR)/end.mk -------------------------------------------------------------------------------- /u-boot/httpd/vendors/oem/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Page not found 6 | 7 | 8 | 9 |
10 |

Page not found

11 |

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

12 |
13 | 14 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/oem/fail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update failed 6 | 7 | 8 | 9 |
10 |

Update failed

11 |

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

12 |
13 | 14 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/ap121/ap121.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Piotr Dymacz 3 | * 4 | * SPDX-License-Identifier: GPL-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | /* 13 | * DRAM init 14 | */ 15 | long int dram_init() 16 | { 17 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT 18 | qca_dram_init(); 19 | #endif 20 | 21 | return (long int)qca_dram_size(); 22 | } 23 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/ap143/ap143.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Piotr Dymacz 3 | * 4 | * SPDX-License-Identifier: GPL-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | /* 13 | * DRAM init 14 | */ 15 | long int dram_init() 16 | { 17 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT 18 | qca_dram_init(); 19 | #endif 20 | 21 | return (long int)qca_dram_size(); 22 | } 23 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/db12x/db12x.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Piotr Dymacz 3 | * 4 | * SPDX-License-Identifier: GPL-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | /* 13 | * DRAM init 14 | */ 15 | long int dram_init() 16 | { 17 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT 18 | qca_dram_init(); 19 | #endif 20 | 21 | return (long int)qca_dram_size(); 22 | } 23 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/ap143/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2006 Wolfgang Denk, DENX Software Engineering, wd@denx.de. 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | include $(TOPDIR)/config.mk 8 | 9 | BOOTSTRAPOBJ-y += $(BOARD).o 10 | 11 | OBJS-y += $(BOARD).o 12 | OBJS-y += ../common/spi_flash.o 13 | OBJS-y += ../common/common.o 14 | OBJS-y += ../common/qca-eth-953x.o 15 | 16 | ifeq ($(ETH_CONFIG), _s27) 17 | OBJS-y += ../common/athr_s27_phy.o 18 | endif 19 | 20 | include $(TOPDIR)/end.mk -------------------------------------------------------------------------------- /u-boot/lib_generic/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2006 Wolfgang Denk, DENX Software Engineering, wd@denx.de 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | include $(TOPDIR)/config.mk 8 | 9 | BOOTSTRAPOBJ-y += string.o 10 | BOOTSTRAPOBJ-y += unlzma_tiny.o 11 | 12 | OBJS-y += crc32.o 13 | OBJS-y += ctype.o 14 | OBJS-y += display_options.o 15 | OBJS-y += string.o 16 | OBJS-y += unlzma_tiny.o 17 | OBJS-y += vsprintf.o 18 | 19 | CPPFLAGS += -DCONFIG_LZMA=1 20 | 21 | include $(TOPDIR)/end.mk 22 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/general/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Page not found 6 | 7 | 8 | 9 |
10 |

PAGE NOT FOUND

11 |
The page you were looking for doesn't exist!
12 |
13 |
You can find more information about this project on GitHub
14 | 15 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/oem/style.css: -------------------------------------------------------------------------------- 1 | h1, 2 | p, 3 | form, 4 | body { 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | html, 10 | body { 11 | font: 13px/20px Tahoma, sans-serif; 12 | background: #FFF; 13 | color: #000; 14 | text-align: center; 15 | height: 100%; 16 | } 17 | 18 | #m { 19 | padding: 30px 0; 20 | } 21 | 22 | #m > * { 23 | padding: 20px; 24 | } 25 | 26 | a { 27 | color: #0069FB; 28 | text-decoration: none; 29 | } 30 | 31 | h1 { 32 | font: bold 40px/40px Arial; 33 | } 34 | 35 | .red { 36 | color: #ED0000; 37 | } -------------------------------------------------------------------------------- /u-boot/httpd/vendors/SE/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Page not found 6 | 7 | 8 | 9 |
10 |

Page not found

11 |

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

12 |
13 |
This code is based on GitHub
14 | 15 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/SE/fail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update failed 6 | 7 | 8 | 9 |
10 |

Update failed!

11 |

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

12 |
13 |
This code is based on GitHub
14 | 15 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/ap152/ap152.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Piotr Dymacz 3 | * 4 | * SPDX-License-Identifier: GPL-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | /* 13 | * DRAM init 14 | */ 15 | long int dram_init() 16 | { 17 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT 18 | qca_dram_init(); 19 | #endif 20 | 21 | /* Take WMAC out of reset */ 22 | qca_soc_reg_read_clear(QCA_RST_RESET_REG, QCA_RST_RESET_RTC_RST_MASK); 23 | 24 | return (long int)qca_dram_size(); 25 | } 26 | -------------------------------------------------------------------------------- /u-boot/httpd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2006 Wolfgang Denk, DENX Software Engineering, wd@denx.de 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | include $(TOPDIR)/config.mk 8 | 9 | OBJS-y += uip.o 10 | OBJS-y += uip_arch.o 11 | OBJS-y += uip_arp.o 12 | OBJS-y += httpd.o 13 | OBJS-y += minidhcpd.o 14 | OBJS-y += fs.o 15 | 16 | # Suppress warnings when building with size optimization 17 | CFLAGS += -fno-strict-aliasing 18 | 19 | fs.c: $(obj)fsdata.c 20 | 21 | $(obj)fsdata.c: 22 | ./vendors/makefsdatac $(obj)fsdata.c $(DEVICE_VENDOR) 23 | 24 | include $(TOPDIR)/end.mk 25 | -------------------------------------------------------------------------------- /u-boot/common/exports.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | DECLARE_GLOBAL_DATA_PTR; 5 | 6 | static void dummy(void){ 7 | } 8 | 9 | unsigned long get_version(void){ 10 | return(XF_VERSION); 11 | } 12 | 13 | void jumptable_init(void){ 14 | int i; 15 | 16 | gd->jt = (void **)malloc(XF_MAX * sizeof(void *)); 17 | 18 | for(i = 0; i < XF_MAX; i++){ 19 | gd->jt[i] = (void *)dummy; 20 | } 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 | } 28 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/dragino/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Page not found 6 | 7 | 8 | 9 | 10 |
11 |
12 |

Page not found

13 |

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

14 |
15 |
You can find more information about this project on GitHub
16 | 17 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/villagetelco/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Page not found 6 | 7 | 8 | 9 | 10 |
11 |
12 |

Page not found

13 |

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

14 |
15 |
You can find more information about this project on GitHub
16 | 17 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/common/phy.h: -------------------------------------------------------------------------------- 1 | #ifndef _PHY_H 2 | #define _PHY_H 3 | 4 | #include 5 | /* 6 | * This file defines the interface between MAC and various phy switches. 7 | */ 8 | extern int ag7240_miiphy_read(char *devname, uint32_t phaddr, uint8_t reg); 9 | extern int ag7240_miiphy_write(char *devname, uint32_t phaddr, uint8_t reg, uint16_t data); 10 | 11 | #define ag7240_unit2name(_unit) _unit ? "eth1" : "eth0" 12 | #define phy_reg_read(base, addr, reg) ag7240_miiphy_read(ag7240_unit2name(base), addr, reg) 13 | #define phy_reg_write(base, addr, reg, data) ag7240_miiphy_write(ag7240_unit2name(base), addr, reg, data) 14 | 15 | #endif /* ifndef _PHY_H */ 16 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/dragino/fail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update failed 6 | 7 | 8 | 9 | 10 |
11 |
12 |

Update failed

13 |

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

14 |
15 |
You can find more information about this project on GitHub
16 | 17 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/villagetelco/fail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update failed 6 | 7 | 8 | 9 | 10 |
11 |
12 |

Update failed

13 |

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

14 |
15 |
You can find more information about this project on GitHub
16 | 17 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/dragino/style.css: -------------------------------------------------------------------------------- 1 | h1, 2 | p, 3 | form, 4 | body { 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | html, 10 | body { 11 | font: 13px/20px Tahoma, sans-serif; 12 | background: #135B72; 13 | color: #FFF; 14 | text-align: center; 15 | height: 100%; 16 | } 17 | 18 | #m, #h { 19 | padding: 30px 0; 20 | } 21 | 22 | #h { 23 | background: #FFF; 24 | } 25 | 26 | #m > * { 27 | padding: 20px; 28 | } 29 | 30 | #f { 31 | font-size: 11px; 32 | position: absolute; 33 | bottom: 0; 34 | width: 100%; 35 | padding: 15px 0; 36 | } 37 | 38 | a { 39 | color: #FEDD12; 40 | text-decoration: none; 41 | } 42 | 43 | h1 { 44 | font: bold 40px/40px Arial; 45 | } 46 | 47 | .red { 48 | color: #ED0000; 49 | } -------------------------------------------------------------------------------- /u-boot/httpd/vendors/oem/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Firmware update 6 | 7 | 8 | 9 |
10 |

Firmware update

11 |

You are going to upload new firmware to the device.
Choose a proper file from your local hard drive and click "Update firmware" button.
Please, do not power off the device during update, if everything goes well, the device will restart.

12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/villagetelco/style.css: -------------------------------------------------------------------------------- 1 | h1, 2 | p, 3 | form, 4 | body { 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | html, 10 | body { 11 | font: 13px/20px Tahoma, sans-serif; 12 | background: #5a4a42; 13 | color: #FFF; 14 | text-align: center; 15 | height: 100%; 16 | } 17 | 18 | #m, #h { 19 | padding: 30px 0; 20 | } 21 | 22 | #h { 23 | background: #FFF; 24 | } 25 | 26 | #m > * { 27 | padding: 20px; 28 | } 29 | 30 | #f { 31 | font-size: 11px; 32 | position: absolute; 33 | bottom: 0; 34 | width: 100%; 35 | padding: 15px 0; 36 | } 37 | 38 | a { 39 | color: #FEDD12; 40 | text-decoration: none; 41 | } 42 | 43 | h1 { 44 | font: bold 40px/40px Arial; 45 | } 46 | 47 | .red { 48 | color: #ED0000; 49 | } -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/ar7240/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/config.mk 2 | 3 | OBJS-y += qca_common.o 4 | OBJS-y += qca_clocks.o 5 | OBJS-y += qca_sf.o 6 | OBJS-y += qca_dram.o 7 | OBJS-y += qca_pci.o 8 | OBJS-y += qca_usb.o 9 | OBJS-y += qca_gpio_init.o 10 | 11 | ifeq ($(BOARD), ap121) 12 | OBJS-y += qca_hs_uart.o 13 | OBJS-y += ag7240.o 14 | OBJS-y += ar933x_pll_init.o 15 | else 16 | OBJS-y += qca_ls_uart.o 17 | endif 18 | 19 | ifeq ($(BOARD), db12x) 20 | OBJS-y += ag934x.o 21 | OBJS-y += ar934x_qca953x_qca955x_pll_init.o 22 | endif 23 | 24 | ifeq ($(BOARD), ap143) 25 | OBJS-y += ar934x_qca953x_qca955x_pll_init.o 26 | endif 27 | 28 | ifeq ($(BOARD), ap152) 29 | OBJS-y += qca956x_pll_init.o 30 | else 31 | 32 | endif 33 | 34 | include $(TOPDIR)/end.mk 35 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/SE/style.css: -------------------------------------------------------------------------------- 1 | h1, 2 | p, 3 | form, 4 | body { 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | html, 10 | body { 11 | font: 13px/20px Tahoma, sans-serif; 12 | background: #135B72; 13 | color: #FFF; 14 | text-align: center; 15 | height: 100%; 16 | } 17 | 18 | #m, #h { 19 | padding: 30px 0; 20 | } 21 | 22 | #h { 23 | font: bold 40px/40px Arial; 24 | background: #ffffff; 25 | color: #000000; 26 | text-align: center; 27 | } 28 | 29 | #m > * { 30 | padding: 20px; 31 | } 32 | 33 | #f { 34 | font-size: 11px; 35 | position: absolute; 36 | bottom: 0; 37 | width: 100%; 38 | padding: 15px 0; 39 | } 40 | 41 | a { 42 | color: #FEDD12; 43 | text-decoration: none; 44 | } 45 | 46 | h1 { 47 | font: bold 40px/40px Arial; 48 | } 49 | 50 | .red { 51 | color: #ED0000; 52 | } -------------------------------------------------------------------------------- /u-boot/end.mk: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | BOOTSTRAPOBJ := $(addprefix $(obj),$(BOOTSTRAPOBJ-y)) 3 | OBJS := $(addprefix $(obj),$(OBJS-y)) 4 | 5 | $(obj).built-in.o: $(OBJS) 6 | $(LD) $(LDFLAGS) $(OBJS) -r -o $@ 7 | 8 | $(obj).bootstrap-built-in.o: $(BOOTSTRAPOBJ) 9 | $(LD) $(LDFLAGS) $(BOOTSTRAPOBJ) -r -o $@ 10 | 11 | $(obj).built-in.a: $(OBJS) 12 | $(AR) $(ARFLAGS) $@ $(OBJS) 13 | 14 | $(obj).bootstrap-built-in.a: $(BOOTSTRAPOBJ) 15 | $(AR) $(ARFLAGS) $@ $(BOOTSTRAPOBJ) 16 | 17 | $(obj).built-in.lst: $(OBJS) 18 | echo $(OBJS) > $@ 19 | 20 | $(obj).bootstrap-built-in.lst: $(BOOTSTRAPOBJ) 21 | echo $(BOOTSTRAPOBJ) > $@ 22 | 23 | -include $(OBJS:.o=.d) $(BOOTSTRAPOBJ:.o=.d) 24 | ######################################################################### 25 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/general/fail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update failed 6 | 7 | 8 | 9 |
10 |

UPDATE FAILED

11 |
Something went wrong during updateProbably you have chosen wrong file (too big or too small) or you were trying to update ART on device with unknown FLASH type (and size) which is not allowed. Please, try again or contact with the author of this modification. You can also get more information during update in U-Boot console.
12 |
13 |
You can find more information about this project on GitHub
14 | 15 | -------------------------------------------------------------------------------- /u-boot/common/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/config.mk 2 | 3 | OBJS-y += main.o 4 | OBJS-y += cmd_bootm.o 5 | OBJS-y += cmd_boot.o 6 | OBJS-y += cmd_echo.o 7 | OBJS-y += cmd_elf.o 8 | OBJS-y += cmd_flash.o 9 | OBJS-y += cmd_help.o 10 | OBJS-y += cmd_mem.o 11 | OBJS-y += cmd_custom.o 12 | OBJS-y += cmd_net.o 13 | OBJS-y += cmd_nvedit.o 14 | OBJS-y += cmd_itest.o 15 | OBJS-y += cmd_load.o 16 | OBJS-y += cmd_qcaclk.o 17 | OBJS-y += cmd_qcagpio.o 18 | OBJS-y += command.o 19 | OBJS-y += console.o 20 | OBJS-y += devices.o 21 | OBJS-y += dlmalloc.o 22 | OBJS-y += environment.o 23 | OBJS-y += env_common.o 24 | OBJS-y += env_nowhere.o 25 | OBJS-y += exports.o 26 | OBJS-y += flash.o 27 | OBJS-y += lists.o 28 | OBJS-y += env_flash.o 29 | OBJS-y += hush.o 30 | OBJS-y += xyzModem.o 31 | OBJS-y += crc16.o 32 | OBJS-y += s_record.o 33 | 34 | include $(TOPDIR)/end.mk 35 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/ar7240/qca_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Qualcomm/Atheros WiSoCs common/helper functions 3 | * 4 | * Copyright (C) 2016 Piotr Dymacz 5 | * 6 | * SPDX-License-Identifier: GPL-2.0 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | /* 15 | * Returns 1 if reference clock is 40 MHz 16 | */ 17 | u32 qca_xtal_is_40mhz(void) 18 | { 19 | return ((qca_soc_reg_read(QCA_RST_BOOTSTRAP_REG) & 20 | QCA_RST_BOOTSTRAP_REF_CLK_MASK) >> QCA_RST_BOOTSTRAP_REF_CLK_SHIFT); 21 | } 22 | 23 | /* 24 | * Performs full chip reset 25 | */ 26 | void qca_full_chip_reset(void) 27 | { 28 | volatile u32 i = 1; 29 | 30 | do { 31 | qca_soc_reg_write(QCA_RST_RESET_REG, 32 | QCA_RST_RESET_FULL_CHIP_RST_MASK 33 | | QCA_RST_RESET_DDR_RST_MASK); 34 | } while (i); 35 | } 36 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/u-boot.lds: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips") 2 | OUTPUT_ARCH(mips) 3 | ENTRY(_start) 4 | SECTIONS 5 | { 6 | . = 0x00000000; 7 | 8 | . = ALIGN(4); 9 | .text : 10 | { 11 | *(.start) 12 | *(.text*) 13 | } 14 | 15 | . = ALIGN(4); 16 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } 17 | 18 | . = ALIGN(4); 19 | .data : { *(.data*) } 20 | 21 | . = .; 22 | _gp = ALIGN(16); 23 | 24 | .got : { 25 | __got_start = .; 26 | *(.got) 27 | __got_end = .; 28 | } 29 | 30 | . = ALIGN(4); 31 | .sdata : { *(.sdata*) } 32 | 33 | . = ALIGN(4); 34 | .u_boot_list : { 35 | KEEP(*(SORT(.u_boot_list*))); 36 | } 37 | 38 | uboot_end_data = .; 39 | num_got_entries = (__got_end - __got_start) >> 2; 40 | 41 | . = ALIGN(4); 42 | .sbss : { *(.sbss*) } 43 | .bss : { *(.bss*) . = ALIGN(4); } 44 | uboot_end = .; 45 | } 46 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/dragino/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Firmware update 6 | 7 | 8 | 9 | 10 |
11 |
12 |

Firmware update

13 |

You are going to upload new firmware to the device.
Choose a proper file from your local hard drive and click "Update firmware" button.
Please, do not power off the device during update, if everything goes well, the device will restart.

14 |
15 |
16 |
You can find more information about this project on GitHub
17 | 18 | -------------------------------------------------------------------------------- /u-boot/include/asm-mips/byteorder.h: -------------------------------------------------------------------------------- 1 | /* $Id: //depot/sw/releases/Aquila_9.2.0_U5/boot/u-boot/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 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/SE/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Firmware update for Black Swift board 6 | 7 | 8 | 9 |
Black Swift board
10 |
11 |

Firmware update

12 |

You are going to upload new firmware to the device.
Choose a proper file from your local hard drive and click "Update firmware" button.
Please, do not power off the device during update, if everything goes well, the device will restart.

13 |
14 |
15 |
Please, go here to update U-Boot or here to update ART.
16 |
This code is based on GitHub
17 | 18 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/SE/art.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ART update 6 | 7 | 8 | 9 |
10 |

ART UPDATE

11 |

You are going to update ART (Atheros Radio Test) on the device.
Please, choose file from your local hard drive and click Update ART button.

12 |
13 |
14 | WARNINGS 15 |
    16 |
  • do not power off the device during update
  • 17 |
  • if everything goes well, the device will restart
  • 18 |
  • you can upload whatever you want, so be sure that you choose proper ART image for your device
  • 19 |
20 |
21 |
22 |
This code is based on GitHub
23 | 24 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/general/art.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ART update 6 | 7 | 8 | 9 |
10 |

ART UPDATE

11 |

You are going to update ART (Atheros Radio Test) on the device.
Please, choose file from your local hard drive and click Update ART button.

12 |
13 |
14 | WARNINGS 15 |
    16 |
  • do not power off the device during update
  • 17 |
  • if everything goes well, the device will restart
  • 18 |
  • you can upload whatever you want, so be sure that you choose proper ART image for your device
  • 19 |
20 |
21 |
22 |
You can find more information about this project on GitHub
23 | 24 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/general/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Firmware update 6 | 7 | 8 | 9 |
10 |

FIRMWARE UPDATE

11 |

You are going to update firmware on the device.
Please, choose file from your local hard drive and click Update firmware button.

12 |
13 |
14 | WARNINGS 15 |
    16 |
  • do not power off the device during update
  • 17 |
  • if everything goes well, the device will restart
  • 18 |
  • you can upload whatever you want, so be sure that you choose proper firmware image for your device
  • 19 |
20 |
21 |
22 |
You can find more information about this project on GitHub
23 | 24 | -------------------------------------------------------------------------------- /u-boot/include/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000-2006 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 __VERSION_H__ 25 | #define __VERSION_H__ 26 | 27 | #include "version_autogenerated.h" 28 | 29 | #endif /* __VERSION_H__ */ 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE! Don't add files that are generated in specific 3 | # subdirectories here. Add them in the ".gitignore" file 4 | # in that subdirectory instead. 5 | # 6 | # Normal rules 7 | # 8 | .* 9 | *.o 10 | *.d 11 | *.o.* 12 | *.a 13 | *.s 14 | *.su 15 | *.mod.c 16 | *.i 17 | *.lst 18 | *.order 19 | *.elf 20 | *.swp 21 | *.bin 22 | *.patch 23 | *.cfgtmp 24 | 25 | # host programs on Cygwin 26 | *.exe 27 | 28 | # lzma host util 29 | host_util/lzma 30 | 31 | # MD5 in bin 32 | /bin/*.md5 33 | 34 | # build directory 35 | /build 36 | 37 | # toolchain directory 38 | /toolchain 39 | 40 | # Do not ignore original u-boot images 41 | !/original_u-boot_images/*.bin 42 | 43 | # 44 | # git files that we don't want to ignore even it they are dot-files 45 | # 46 | !.gitignore 47 | !.mailmap 48 | 49 | # stgit generated dirs 50 | patches-* 51 | .stgit-edit.txt 52 | 53 | # quilt's files 54 | patches 55 | series 56 | 57 | # gdb files 58 | .gdb_history 59 | 60 | # cscope files 61 | cscope.* 62 | 63 | # tags files 64 | /tags 65 | /ctags 66 | /etags 67 | 68 | # gnu global files 69 | GPATH 70 | GRTAGS 71 | GSYMS 72 | GTAGS 73 | 74 | *.orig 75 | *~ 76 | \#*# 77 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/SE/uboot.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | U-Boot update 6 | 7 | 8 | 9 |
10 |

U-BOOT UPDATE

11 |

You are going to update U-Boot bootloader on the device.
Please, choose file from your local hard drive and click Update U-Boot button.

12 |
13 |
14 | WARNINGS 15 |
    16 |
  • do not power off the device during update
  • 17 |
  • if everything goes well, the device will restart
  • 18 |
  • you can upload whatever you want, so be sure that you choose proper U-Boot image for your device
  • 19 |
  • updating U-Boot is a very dangerous operation and may damage your device!
  • 20 |
21 |
22 |
23 |
This code is based on GitHub
24 | 25 | -------------------------------------------------------------------------------- /u-boot/common/cmd_help.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2009 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | static int do_help(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) 12 | { 13 | #ifdef CONFIG_CMDLINE 14 | cmd_tbl_t *start = ll_entry_start(cmd_tbl_t, cmd); 15 | const int len = ll_entry_count(cmd_tbl_t, cmd); 16 | return _do_help(start, len, cmdtp, flag, argc, argv); 17 | #else 18 | return 0; 19 | #endif 20 | } 21 | 22 | U_BOOT_CMD_COMPLETE( 23 | help, CONFIG_SYS_MAXARGS, 1, do_help, 24 | "print command description/usage", 25 | "\n" 26 | " - print brief description of all commands\n" 27 | "help command ...\n" 28 | " - print detailed usage of 'command'", 29 | cmd_complete 30 | ); 31 | 32 | /* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names */ 33 | ll_entry_declare(cmd_tbl_t, question_mark, cmd) = { 34 | "?", CONFIG_SYS_MAXARGS, 1, do_help, 35 | "alias for 'help'", 36 | #ifdef CONFIG_SYS_LONGHELP 37 | "", 38 | #endif 39 | #ifdef CONFIG_AUTO_COMPLETE 40 | cmd_complete 41 | #endif 42 | }; 43 | -------------------------------------------------------------------------------- /u-boot/lib_mips/time.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Piotr Dymacz 3 | * Copyright (C) 2003 Wolfgang Denk, DENX Software Engineering, 4 | * 5 | * SPDX-License-Identifier:GPL-2.0 6 | */ 7 | 8 | #include 9 | 10 | DECLARE_GLOBAL_DATA_PTR; 11 | 12 | static inline void mips_compare_set(u32 v) 13 | { 14 | asm volatile ("mtc0 %0, $11" : : "r" (v)); 15 | } 16 | 17 | static inline void mips_count_set(u32 v) 18 | { 19 | asm volatile ("mtc0 %0, $9" : : "r" (v)); 20 | } 21 | 22 | static inline u32 mips_count_get(void) 23 | { 24 | u32 count; 25 | 26 | asm volatile ("mfc0 %0, $9" : "=r" (count) :); 27 | 28 | return count; 29 | } 30 | 31 | /* 32 | * Timer without interrupts 33 | */ 34 | int timer_init(void) 35 | { 36 | mips_compare_set(0); 37 | mips_count_set(0); 38 | 39 | return 0; 40 | } 41 | 42 | ulong get_timer(ulong base) 43 | { 44 | return mips_count_get() - base; 45 | } 46 | 47 | void udelay(unsigned long usec) 48 | { 49 | ulong tmo; 50 | ulong start = get_timer(0); 51 | bd_t *bd = gd->bd; 52 | 53 | tmo = usec * (CFG_HZ / 1000000); 54 | 55 | while ((ulong)((mips_count_get() - start)) < tmo) 56 | /* NOP */; 57 | } 58 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/general/style.css: -------------------------------------------------------------------------------- 1 | h1, 2 | p, 3 | form, 4 | ul { 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | html, 10 | body { 11 | font: 13px/20px Arial, sans-serif; 12 | background: #EDEDED; 13 | } 14 | 15 | #m { 16 | max-width: 750px; 17 | margin: 30px auto 10px; 18 | border: solid 1px #BABABA; 19 | background: #FFF; 20 | border-radius: 7px; 21 | box-shadow: 0 0 10px #D2D1D1; 22 | } 23 | 24 | #m > * { 25 | padding: 20px; 26 | } 27 | 28 | h1 { 29 | font: bold 50px/50px Tahoma; 30 | border-bottom: solid 1px #E8E8E8; 31 | } 32 | 33 | a, 34 | h1 { 35 | color: #2450AD; 36 | text-decoration: none; 37 | } 38 | 39 | .i { 40 | margin: 20px; 41 | border-radius: 7px; 42 | text-align: justify; 43 | } 44 | 45 | .w { 46 | background: #FEFDCE; 47 | border: solid 1px #FFC643; 48 | } 49 | 50 | .e { 51 | background: #FFE7E7; 52 | border:solid 1px #FE7171; 53 | } 54 | 55 | #f { 56 | text-align: center; 57 | color: #969393; 58 | } 59 | 60 | form, 61 | p, 62 | h1 { 63 | text-align: center; 64 | } 65 | 66 | ul { 67 | list-style: square; 68 | margin: 0 0 0 20px; 69 | } 70 | 71 | .red { 72 | color: #E41616; 73 | } 74 | 75 | .i strong { 76 | margin: 0 0 5px; 77 | display: block; 78 | } -------------------------------------------------------------------------------- /u-boot/httpd/vendors/general/uboot.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | U-Boot update 6 | 7 | 8 | 9 |
10 |

U-BOOT UPDATE

11 |

You are going to update U-Boot bootloader on the device.
Please, choose file from your local hard drive and click Update U-Boot button.

12 |
13 |
14 | WARNINGS 15 |
    16 |
  • do not power off the device during update
  • 17 |
  • if everything goes well, the device will restart
  • 18 |
  • you can upload whatever you want, so be sure that you choose proper U-Boot image for your device
  • 19 |
  • updating U-Boot is a very dangerous operation and may damage your device!
  • 20 |
21 |
22 |
23 |
You can find more information about this project on GitHub
24 | 25 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/villagetelco/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Firmware update 6 | 7 | 8 | 9 | 10 |
11 |
12 |

Firmware update

13 |

You are going to upload new firmware to the device.
Choose a proper file from your local hard drive and click "Update firmware" button.
Please, do not power off the device during update, if everything goes well, the device will restart.

14 |
15 |

For more technical information, please consult
the Village Telco wiki or join the Village Telco development community. 16 |

17 |
You can find more information about this project on GitHub
18 | 19 | -------------------------------------------------------------------------------- /u-boot/common/cmd_echo.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2009 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef CONFIG_CMD_ECHO 12 | static int do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) 13 | { 14 | int i; 15 | int putnl = 1; 16 | 17 | for (i = 1; i < argc; i++) { 18 | char *p = argv[i]; 19 | char *nls; /* new-line suppression */ 20 | 21 | if (i > 1) 22 | putc(' '); 23 | 24 | nls = strstr(p, "\\c"); 25 | if (nls) { 26 | char *prenls = p; 27 | 28 | putnl = 0; 29 | /* 30 | * be paranoid and guess that someone might 31 | * say \c more than once 32 | */ 33 | while (nls) { 34 | *nls = '\0'; 35 | puts(prenls); 36 | *nls = '\\'; 37 | prenls = nls + 2; 38 | nls = strstr(prenls, "\\c"); 39 | } 40 | puts(prenls); 41 | } else { 42 | puts(p); 43 | } 44 | } 45 | 46 | if (putnl) 47 | putc('\n'); 48 | 49 | return 0; 50 | } 51 | 52 | U_BOOT_CMD( 53 | echo, CONFIG_SYS_MAXARGS, 1, do_echo, 54 | "echo args to console", 55 | "[args..]\n" 56 | " - echo args to console; \\c suppresses newline" 57 | ); 58 | #endif 59 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/include/exports.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXPORTS_H__ 2 | #define __EXPORTS_H__ 3 | 4 | #ifndef __ASSEMBLY__ 5 | #include 6 | 7 | /* 8 | * These are declarations of exported 9 | * functions available in C code 10 | */ 11 | unsigned long get_timer(unsigned long); 12 | unsigned long get_version(void); 13 | 14 | void app_startup(char **); 15 | void free(void*); 16 | void free_hdlr(int); 17 | void install_hdlr(int, interrupt_handler_t*, void*); 18 | void printf(const char* fmt, ...); 19 | void putc(const char); 20 | void puts(const char*); 21 | void udelay(unsigned long); 22 | void *malloc(size_t); 23 | 24 | int getc(void); 25 | int tstc(void); 26 | #endif /* ifndef __ASSEMBLY__ */ 27 | 28 | enum { 29 | #define EXPORT_FUNC(x) XF_ ## x , 30 | EXPORT_FUNC(get_version) 31 | EXPORT_FUNC(getc) 32 | EXPORT_FUNC(tstc) 33 | EXPORT_FUNC(putc) 34 | EXPORT_FUNC(puts) 35 | EXPORT_FUNC(printf) 36 | EXPORT_FUNC(install_hdlr) 37 | EXPORT_FUNC(free_hdlr) 38 | EXPORT_FUNC(malloc) 39 | EXPORT_FUNC(free) 40 | EXPORT_FUNC(udelay) 41 | EXPORT_FUNC(get_timer) 42 | EXPORT_FUNC(do_reset) 43 | #undef EXPORT_FUNC 44 | XF_MAX 45 | }; 46 | 47 | #define XF_VERSION 2 48 | 49 | #if defined(CONFIG_I386) 50 | extern gd_t *global_data; 51 | #endif 52 | 53 | #endif /* __EXPORTS_H__ */ 54 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/common/athrsf1_phy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Qualcomm Atheros, Inc. 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 | #ifndef _ATHRS26_RGMII_H 24 | #define _ATHRS26_RGMII_H 25 | #define BOOL int 26 | #include "athr_s27_phy.h" 27 | int athr_phy_is_up(int unit); 28 | int athr_phy_is_fdx(int unit,int phyUnit); 29 | int athr_phy_speed(int unit,int phyUnit); 30 | BOOL athr_phy_setup(int unit); 31 | BOOL athr_phy_is_link_alive(int phyUnit); 32 | #endif 33 | -------------------------------------------------------------------------------- /u-boot/include/unlzma_tiny_config.h: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * SPDX-License-Identifier: GPL-2.0 4 | */ 5 | 6 | #ifndef UNLZMA_TINY_CONFIG_H_ 7 | #define UNLZMA_TINY_CONFIG_H_ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if DEBUG 15 | # define warn(...) do { fprintf(stderr, __VA_ARGS__); fputc('\n', stderr);} while(0) 16 | # define die(...) do { fprintf(stderr, __VA_ARGS__); fputc('\n', stderr); exit(-1); } while(0) 17 | #else 18 | # define warn(...) do { } while(0) 19 | # undef die 20 | # define die(...) do { hang(); } while(0) 21 | #endif 22 | 23 | #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 24 | # define SWAP_LE32(x) (x) 25 | # define SWAP_LE64(x) (x) 26 | #else 27 | # define SWAP_LE32(x) __builtin_bswap32(x) 28 | # define SWAP_LE64(x) __builtin_bswap64(x) 29 | #endif 30 | 31 | #if USE_ALLOCA 32 | # define alloc_probs(size) alloca(size) 33 | # define free_probs(ptr) do { } while(0) 34 | #else 35 | # define alloc_probs(size) malloc(size) 36 | # define free_probs(ptr) free(ptr) 37 | #endif 38 | 39 | #define ALWAYS_INLINE __attribute__ ((always_inline)) inline 40 | #define PACKED __attribute__ ((__packed__)) 41 | #define FAST_FUNC 42 | 43 | #define speed_inline 44 | 45 | 46 | #endif /* UNLZMA_TINY_CONFIG_H_ */ 47 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/oem/flashing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update in progress 6 | 9 | 10 | 11 |
12 |

Update in progress

13 |

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

14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/include/tinf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tinf - tiny inflate library (inflate, gzip, zlib) 3 | * 4 | * version 1.00 5 | * 6 | * Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | * All Rights Reserved 8 | * 9 | * http://www.ibsensoftware.com/ 10 | */ 11 | 12 | #ifndef TINF_H_INCLUDED 13 | #define TINF_H_INCLUDED 14 | 15 | /* calling convention */ 16 | #ifndef TINFCC 17 | #ifdef __WATCOMC__ 18 | #define TINFCC __cdecl 19 | #else 20 | #define TINFCC 21 | #endif 22 | #endif 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | #define TINF_OK 0 29 | #define TINF_DATA_ERROR (-3) 30 | 31 | /* function prototypes */ 32 | 33 | void TINFCC tinf_init(void); 34 | 35 | int TINFCC tinf_uncompress(void *dest, unsigned int *destLen, 36 | const void *source, unsigned int sourceLen); 37 | 38 | int TINFCC tinf_gzip_uncompress(void *dest, unsigned int *destLen, 39 | const void *source, unsigned int sourceLen); 40 | 41 | int TINFCC tinf_zlib_uncompress(void *dest, unsigned int *destLen, 42 | const void *source, unsigned int sourceLen); 43 | 44 | unsigned int TINFCC tinf_adler32(const void *data, unsigned int length); 45 | 46 | unsigned int TINFCC tinf_crc32(const void *data, unsigned int length); 47 | 48 | #ifdef __cplusplus 49 | } /* extern "C" */ 50 | #endif 51 | 52 | #endif /* TINF_H_INCLUDED */ 53 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/cpu.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Piotr Dymacz 3 | * Copyright (C) 2003 Wolfgang Denk, DENX Software Engineering, 4 | * 5 | * SPDX-License-Identifier:GPL-2.0 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | extern void dcache_flush_range(u32 a, u32 end); 13 | 14 | int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) 15 | { 16 | printf("Resetting the board..."); 17 | milisecdelay(500); 18 | 19 | full_reset(); 20 | 21 | /* After full chip reset we should not reach next step... */ 22 | puts("\n"); 23 | printf_err("RESET FAILED!\n"); 24 | 25 | return 0; 26 | } 27 | 28 | void flush_cache(ulong start_addr, ulong size) 29 | { 30 | u32 end, a; 31 | 32 | a = start_addr & ~(CFG_CACHELINE_SIZE - 1); 33 | size = (size + CFG_CACHELINE_SIZE - 1) & ~(CFG_CACHELINE_SIZE - 1); 34 | end = a + size; 35 | 36 | dcache_flush_range(a, end); 37 | } 38 | 39 | /* 40 | * Read CPU type and put its name into buffer 41 | * For now only 24/74Kc are supported as all 42 | * supported SOCs are based on one of them 43 | */ 44 | void cpu_name(char *name) 45 | { 46 | u32 cpu_id = read_c0_prid(); 47 | 48 | if (name == NULL) 49 | return; 50 | 51 | switch (cpu_id & PRID_IMP_MASK) { 52 | case PRID_IMP_24K: 53 | sprintf(name, "MIPS 24Kc"); 54 | break; 55 | case PRID_IMP_74K: 56 | sprintf(name, "MIPS 74Kc"); 57 | break; 58 | default: 59 | sprintf(name, "MIPS Unknown"); 60 | break; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /u-boot/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 | #endif /* __ASM_MIPS_CACHEOPS_H */ 48 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/ap152/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2006 Wolfgang Denk, DENX Software Engineering, wd@denx.de. 3 | # 4 | # SPDX-License-Identifier: GPL-2.0 5 | # 6 | 7 | include $(TOPDIR)/config.mk 8 | 9 | BOOTSTRAPOBJ-y += $(BOARD).o 10 | 11 | OBJS-y += $(BOARD).o 12 | OBJS-y += ../common/spi_flash.o 13 | OBJS-y += ../common/common.o 14 | OBJS-y += ../common/miiphybb.o 15 | OBJS-y += ../common/qca-eth-956x.o 16 | 17 | ifeq ($(ATH_RGMII_CAL),1) 18 | OBJS-y += ../common/rgmii-cal-956x.o 19 | OBJS-y += ../common/athrs17_lpbk.o 20 | endif 21 | 22 | ifeq ($(ETH_CONFIG2), _s17) 23 | OBJS-y += ../common/athrs17_phy.o 24 | endif 25 | 26 | ifeq ($(ETH_CONFIG), _s17) 27 | OBJS-y += ../common/athrs17_phy.o 28 | endif 29 | 30 | ifeq ($(ETH_CONFIG2), _s17_hwaccel) 31 | OBJS-y += ../common/athrs17_phy.o 32 | endif 33 | 34 | ifeq ($(ETH_CONFIG), _s17_hwaccel) 35 | OBJS-y += ../common/athrs17_phy.o 36 | endif 37 | 38 | ifeq ($(ETH_CONFIG), _s16) 39 | OBJS-y += ../common/athrs16_phy.o 40 | endif 41 | 42 | ifeq ($(ETH_CONFIG), _f1e) 43 | OBJS-y += ../common/athrsf1_phy.o 44 | endif 45 | 46 | ifeq ($(ETH_CONFIG), _f2e) 47 | OBJS-y += ../common/athrsf2_phy.o 48 | endif 49 | 50 | ifeq ($(ETH_CONFIG), _vir) 51 | OBJS-y += ../common/athrs_vir_phy.o 52 | endif 53 | 54 | ifeq ($(ETH_CONFIG2), _vir) 55 | OBJS-y += ../common/athrs_vir_phy.o 56 | endif 57 | 58 | ifeq ($(ETH_CONFIG), _s27) 59 | OBJS-y += ../common/athr_s27_phy.o 60 | endif 61 | 62 | ifeq ($(ETH_CONFIG), _ar8033) 63 | OBJS-y += ../common/athr_ar8033_phy.o 64 | endif 65 | 66 | include $(TOPDIR)/end.mk -------------------------------------------------------------------------------- /u-boot/httpd/vendors/SE/flashing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update in progress 6 | 9 | 10 | 11 |
12 |

Update in progress

13 |

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

14 |
15 |
16 |
This code is based on GitHub
17 | 18 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/dragino/flashing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update in progress 6 | 9 | 10 | 11 |
12 |

Update in progress

13 |

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

14 |
15 |
16 |
You can find more information about this project on GitHub
17 | 18 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/villagetelco/flashing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update in progress 6 | 9 | 10 | 11 |
12 |

Update in progress

13 |

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

14 |
15 |
16 |
You can find more information about this project on GitHub
17 | 18 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/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 | /* 27 | * print sizes as "xxx kB", "xxx.y kB", "xxx MB" or "xxx.y MB" as needed; 28 | * allow for optional trailing string (like "\n") 29 | */ 30 | void print_size(ulong size, const char *s){ 31 | ulong m, n; 32 | ulong d = 1 << 20; /* 1 MB */ 33 | char c = 'M'; 34 | 35 | if (size < d) { /* print in kB */ 36 | c = 'k'; 37 | d = 1 << 10; 38 | } 39 | 40 | n = size / d; 41 | 42 | m = (10 * (size - (n * d)) + (d / 2) ) / d; 43 | 44 | if (m >= 10) { 45 | m -= 10; 46 | n += 1; 47 | } 48 | 49 | printf ("%ld", n); 50 | if (m) { 51 | printf (".%ld", m); 52 | } 53 | printf (" %cB%s", c, s); 54 | } 55 | -------------------------------------------------------------------------------- /u-boot/net/sntp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Masami Komiya 2005 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2, or (at 7 | * your option) any later version. 8 | */ 9 | 10 | #ifndef __SNTP_H__ 11 | #define __SNTP_H__ 12 | 13 | #define NTP_SERVICE_PORT 123 14 | #define SNTP_PACKET_LEN 48 15 | 16 | 17 | /* Leap Indicator */ 18 | #define NTP_LI_NOLEAP 0x0 19 | #define NTP_LI_61SECS 0x1 20 | #define NTP_LI_59SECS 0x2 21 | #define NTP_LI_ALARM 0x3 22 | 23 | /* Version */ 24 | 25 | #define NTP_VERSION 4 26 | 27 | /* Mode */ 28 | #define NTP_MODE_RESERVED 0 29 | #define NTP_MODE_SYMACTIVE 1 /* Symmetric Active */ 30 | #define NTP_MODE_SYMPASSIVE 2 /* Symmetric Passive */ 31 | #define NTP_MODE_CLIENT 3 32 | #define NTP_MODE_SERVER 4 33 | #define NTP_MODE_BROADCAST 5 34 | #define NTP_MODE_NTPCTRL 6 /* Reserved for NTP control message */ 35 | #define NTP_MODE_PRIVATE 7 /* Reserved for private use */ 36 | 37 | struct sntp_pkt_t { 38 | #if __LITTLE_ENDIAN 39 | uchar mode:3; 40 | uchar vn:3; 41 | uchar li:2; 42 | #else 43 | uchar li:2; 44 | uchar vn:3; 45 | uchar mode:3; 46 | #endif 47 | uchar stratum; 48 | uchar poll; 49 | uchar precision; 50 | uint root_delay; 51 | uint root_dispersion; 52 | uint reference_id; 53 | unsigned long long reference_timestamp; 54 | unsigned long long originate_timestamp; 55 | unsigned long long receive_timestamp; 56 | unsigned long long transmit_timestamp; 57 | } __attribute__((__packed__)); 58 | 59 | extern void SntpStart (void); /* Begin SNTP */ 60 | 61 | #endif /* __SNTP_H__ */ 62 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/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 | #if defined(__ASSEMBLY__) 18 | #define zero $0 /* wired zero */ 19 | #define AT $1 /* assembler temp - uppercase because of ".set at" */ 20 | #define v0 $2 /* return value */ 21 | #define v1 $3 22 | #define a0 $4 /* argument registers */ 23 | #define a1 $5 24 | #define a2 $6 25 | #define a3 $7 26 | #define t0 $8 /* caller saved */ 27 | #define t1 $9 28 | #define t2 $10 29 | #define t3 $11 30 | #define t4 $12 31 | #define t5 $13 32 | #define t6 $14 33 | #define t7 $15 34 | #define s0 $16 /* callee saved */ 35 | #define s1 $17 36 | #define s2 $18 37 | #define s3 $19 38 | #define s4 $20 39 | #define s5 $21 40 | #define s6 $22 41 | #define s7 $23 42 | #define t8 $24 /* caller saved */ 43 | #define t9 $25 44 | #define jp $25 /* PIC jump register */ 45 | #define k0 $26 /* kernel scratch */ 46 | #define k1 $27 47 | #define gp $28 /* global pointer */ 48 | #define sp $29 /* stack pointer */ 49 | #define fp $30 /* frame pointer */ 50 | #define s8 $30 /* same like fp! */ 51 | #define ra $31 /* return address */ 52 | #endif /* !__ASSEMBLY__ */ 53 | 54 | #endif /* __ASM_MIPS_REGDEF_H */ 55 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/u-boot-bootstrap.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 | OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips") 25 | OUTPUT_ARCH(mips) 26 | ENTRY(_start_bootstrap) 27 | SECTIONS 28 | { 29 | . = 0x00000000; 30 | 31 | . = ALIGN(4); 32 | .text : 33 | { 34 | *(.start_bootstrap) 35 | *(.text*) 36 | } 37 | 38 | . = ALIGN(4); 39 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } 40 | 41 | . = ALIGN(4); 42 | .data : { *(.data*) } 43 | 44 | . = .; 45 | _gp = ALIGN(16); 46 | 47 | .got : { 48 | __got_start_bootstrap = .; 49 | *(.got) 50 | __got_end_bootstrap = .; 51 | } 52 | 53 | . = ALIGN(4); 54 | .sdata : { *(.sdata*) } 55 | 56 | uboot_end_data_bootstrap = .; 57 | num_got_entries = (__got_end_bootstrap - __got_start_bootstrap) >> 2; 58 | 59 | . = ALIGN(4); 60 | .sbss : { *(.sbss*) } 61 | .bss : { *(.bss*) . = ALIGN(4); } 62 | uboot_end_bootstrap = .; 63 | } 64 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/ar7240/ag7240_phy.h: -------------------------------------------------------------------------------- 1 | #ifndef _AG7240_PHY_H 2 | #define _AG7240_PHY_H 3 | 4 | extern int athrs16_phy_is_up(int unit); 5 | extern int athrs16_phy_is_fdx(int unit); 6 | extern int athrs16_phy_speed(int unit); 7 | extern int athrs16_phy_setup(int unit); 8 | 9 | extern int athrs26_phy_is_up(int unit); 10 | extern int athrs26_phy_speed(int unit); 11 | extern int athrs26_phy_setup(int unit); 12 | extern int athrs26_phy_is_fdx(int unit); 13 | 14 | static inline void ag7240_phy_setup(int unit) { 15 | #ifdef CONFIG_AR7242_S16_PHY 16 | if ((is_ar7242() || is_wasp()) && (unit==0)) { 17 | athrs16_phy_setup(unit); 18 | } else 19 | #endif 20 | { 21 | athrs26_phy_setup(unit); 22 | #ifdef CONFIG_F1E_PHY 23 | athr_phy_setup(unit); 24 | #endif 25 | } 26 | } 27 | 28 | static inline void ag7240_phy_link(int unit, int *link) { 29 | #ifdef CONFIG_AR7242_S16_PHY 30 | if ((is_ar7242() || is_wasp()) && (unit==0)) { 31 | *link = athrs16_phy_is_up(unit); 32 | } else 33 | #endif 34 | { 35 | *link = athrs26_phy_is_up(unit); 36 | #ifdef CONFIG_F1E_PHY 37 | *link = athr_phy_is_up(unit); 38 | #endif 39 | } 40 | } 41 | 42 | static inline void ag7240_phy_duplex(int unit, int *duplex) { 43 | #ifdef CONFIG_AR7242_S16_PHY 44 | if ((is_ar7242() || is_wasp()) && (unit==0)) { 45 | *duplex = athrs16_phy_is_fdx(unit); 46 | } else 47 | #endif 48 | { 49 | *duplex = athrs26_phy_is_fdx(unit); 50 | #ifdef CONFIG_F1E_PHY 51 | *duplex = athr_phy_is_fdx(unit); 52 | #endif 53 | } 54 | } 55 | 56 | static inline void ag7240_phy_speed(int unit, int *speed) { 57 | #ifdef CONFIG_AR7242_S16_PHY 58 | if ((is_ar7242() || is_wasp()) && (unit==0)) { 59 | *speed = athrs16_phy_speed(unit); 60 | } else 61 | #endif 62 | { 63 | *speed = athrs26_phy_speed(unit); 64 | #ifdef CONFIG_F1E_PHY 65 | *speed = athr_phy_speed(unit); 66 | #endif 67 | } 68 | } 69 | 70 | #endif /*_AG7240_PHY_H*/ 71 | -------------------------------------------------------------------------------- /u-boot/httpd/vendors/general/flashing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Update in progress 6 | 8 | 9 | 10 |
11 |

UPDATE IN PROGRESS

12 |

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

13 |
14 |
15 |
You can find more information about this project on GitHub
16 | 17 | -------------------------------------------------------------------------------- /u-boot/httpd/tapdev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Adam Dunkels. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote 14 | * products derived from this software without specific prior 15 | * written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 18 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 23 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * This file is part of the uIP TCP/IP stack. 30 | * 31 | * $Id: tapdev.h,v 1.1.2.1 2003/10/04 22:54:17 adam Exp $ 32 | * 33 | */ 34 | 35 | #ifndef __TAPDEV_H__ 36 | #define __TAPDEV_H__ 37 | 38 | void tapdev_init(void); 39 | unsigned int tapdev_read(void); 40 | void tapdev_send(void); 41 | 42 | #endif /* __TAPDEV_H__ */ 43 | -------------------------------------------------------------------------------- /u-boot/include/asm-mips/types.h: -------------------------------------------------------------------------------- 1 | /* $Id: //depot/sw/releases/Aquila_9.2.0_U5/boot/u-boot/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 | -------------------------------------------------------------------------------- /u-boot/common/env_nowhere.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000-2002 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH 6 | * Andreas Heppel 7 | 8 | * See file CREDITS for list of people who contributed to this 9 | * project. 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU General Public License as 13 | * published by the Free Software Foundation; either version 2 of 14 | * the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 24 | * MA 02111-1307 USA 25 | */ 26 | 27 | #include 28 | 29 | #if defined(CFG_ENV_IS_NOWHERE) /* Environment is nowhere */ 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | DECLARE_GLOBAL_DATA_PTR; 36 | 37 | env_t *env_ptr = NULL; 38 | 39 | extern uchar default_environment[]; 40 | extern int default_environment_size; 41 | 42 | void env_relocate_spec(void){ 43 | } 44 | 45 | uchar env_get_char_spec(int index){ 46 | return(*((uchar *) (gd->env_addr + index))); 47 | } 48 | 49 | /************************************************************************ 50 | * Initialize Environment use 51 | * 52 | * We are still running from ROM, so data use is limited 53 | */ 54 | int env_init(void){ 55 | gd->env_addr = (ulong)&default_environment[0]; 56 | gd->env_valid = 0; 57 | 58 | return(0); 59 | } 60 | 61 | #endif /* CFG_ENV_IS_NOWHERE) */ 62 | -------------------------------------------------------------------------------- /u-boot/net/nfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Masami Komiya 2004 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2, or (at 7 | * your option) any later version. 8 | */ 9 | 10 | #ifndef __NFS_H__ 11 | #define __NFS_H__ 12 | 13 | #define SUNRPC_PORT 111 14 | 15 | #define PROG_PORTMAP 100000 16 | #define PROG_NFS 100003 17 | #define PROG_MOUNT 100005 18 | 19 | #define MSG_CALL 0 20 | #define MSG_REPLY 1 21 | 22 | #define PORTMAP_GETPORT 3 23 | 24 | #define MOUNT_ADDENTRY 1 25 | #define MOUNT_UMOUNTALL 4 26 | 27 | #define NFS_LOOKUP 4 28 | #define NFS_READLINK 5 29 | #define NFS_READ 6 30 | 31 | #define NFS_FHSIZE 32 32 | 33 | #define NFSERR_PERM 1 34 | #define NFSERR_NOENT 2 35 | #define NFSERR_ACCES 13 36 | #define NFSERR_ISDIR 21 37 | #define NFSERR_INVAL 22 38 | 39 | /* Block size used for NFS read accesses. A RPC reply packet (including all 40 | * headers) must fit within a single Ethernet frame to avoid fragmentation. 41 | * Chosen to be a power of two, as most NFS servers are optimized for this. */ 42 | #define NFS_READ_SIZE 1024 43 | 44 | #define NFS_MAXLINKDEPTH 16 45 | 46 | struct rpc_t { 47 | union { 48 | uint8_t data[2048]; 49 | struct { 50 | uint32_t id; 51 | uint32_t type; 52 | uint32_t rpcvers; 53 | uint32_t prog; 54 | uint32_t vers; 55 | uint32_t proc; 56 | uint32_t data[1]; 57 | } call; 58 | struct { 59 | uint32_t id; 60 | uint32_t type; 61 | uint32_t rstatus; 62 | uint32_t verifier; 63 | uint32_t v2; 64 | uint32_t astatus; 65 | uint32_t data[19]; 66 | } reply; 67 | } u; 68 | } __attribute__((__packed__)); 69 | extern void NfsStart (void); /* Begin NFS */ 70 | 71 | 72 | /**********************************************************************/ 73 | 74 | #endif /* __NFS_H__ */ 75 | -------------------------------------------------------------------------------- /u-boot/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, unsigned int, unsigned int, unsigned int); 62 | 63 | #endif /* _RTC_H_ */ 64 | -------------------------------------------------------------------------------- /u-boot/lib_generic/crc32.c: -------------------------------------------------------------------------------- 1 | /* 2 | * CRC32 checksum 3 | * 4 | * Copyright (c) 1998-2003 by Joergen Ibsen / Jibz 5 | * All Rights Reserved 6 | * 7 | * http://www.ibsensoftware.com/ 8 | * 9 | * This software is provided 'as-is', without any express 10 | * or implied warranty. In no event will the authors be 11 | * held liable for any damages arising from the use of 12 | * this software. 13 | * 14 | * Permission is granted to anyone to use this software 15 | * for any purpose, including commercial applications, 16 | * and to alter it and redistribute it freely, subject to 17 | * the following restrictions: 18 | * 19 | * 1. The origin of this software must not be 20 | * misrepresented; you must not claim that you 21 | * wrote the original software. If you use this 22 | * software in a product, an acknowledgment in 23 | * the product documentation would be appreciated 24 | * but is not required. 25 | * 26 | * 2. Altered source versions must be plainly marked 27 | * as such, and must not be misrepresented as 28 | * being the original software. 29 | * 30 | * 3. This notice may not be removed or altered from 31 | * any source distribution. 32 | */ 33 | 34 | /* 35 | * CRC32 algorithm taken from the zlib source, which is 36 | * Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler 37 | */ 38 | 39 | #include "tinf.h" 40 | 41 | static const unsigned int tinf_crc32tab[16] = { 42 | 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190, 43 | 0x6b6b51f4, 0x4db26158, 0x5005713c, 0xedb88320, 0xf00f9344, 44 | 0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 45 | 0xbdbdf21c 46 | }; 47 | 48 | unsigned int tinf_crc32(const void *data, unsigned int length) 49 | { 50 | const unsigned char *buf = (const unsigned char *)data; 51 | unsigned int crc = 0xffffffff; 52 | unsigned int i; 53 | 54 | if (length == 0) return 0; 55 | 56 | for (i = 0; i < length; ++i) 57 | { 58 | crc ^= buf[i]; 59 | crc = tinf_crc32tab[crc & 0x0f] ^ (crc >> 4); 60 | crc = tinf_crc32tab[crc & 0x0f] ^ (crc >> 4); 61 | } 62 | 63 | return crc ^ 0xffffffff; 64 | } 65 | -------------------------------------------------------------------------------- /u-boot/lib_generic/tinfcrc32.c: -------------------------------------------------------------------------------- 1 | /* 2 | * CRC32 checksum 3 | * 4 | * Copyright (c) 1998-2003 by Joergen Ibsen / Jibz 5 | * All Rights Reserved 6 | * 7 | * http://www.ibsensoftware.com/ 8 | * 9 | * This software is provided 'as-is', without any express 10 | * or implied warranty. In no event will the authors be 11 | * held liable for any damages arising from the use of 12 | * this software. 13 | * 14 | * Permission is granted to anyone to use this software 15 | * for any purpose, including commercial applications, 16 | * and to alter it and redistribute it freely, subject to 17 | * the following restrictions: 18 | * 19 | * 1. The origin of this software must not be 20 | * misrepresented; you must not claim that you 21 | * wrote the original software. If you use this 22 | * software in a product, an acknowledgment in 23 | * the product documentation would be appreciated 24 | * but is not required. 25 | * 26 | * 2. Altered source versions must be plainly marked 27 | * as such, and must not be misrepresented as 28 | * being the original software. 29 | * 30 | * 3. This notice may not be removed or altered from 31 | * any source distribution. 32 | */ 33 | 34 | /* 35 | * CRC32 algorithm taken from the zlib source, which is 36 | * Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler 37 | */ 38 | 39 | #include "tinf.h" 40 | 41 | static const unsigned int tinf_crc32tab[16] = { 42 | 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190, 43 | 0x6b6b51f4, 0x4db26158, 0x5005713c, 0xedb88320, 0xf00f9344, 44 | 0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 45 | 0xbdbdf21c 46 | }; 47 | 48 | unsigned int tinf_crc32(const void *data, unsigned int length) 49 | { 50 | const unsigned char *buf = (const unsigned char *)data; 51 | unsigned int crc = 0xffffffff; 52 | unsigned int i; 53 | 54 | if (length == 0) return 0; 55 | 56 | for (i = 0; i < length; ++i) 57 | { 58 | crc ^= buf[i]; 59 | crc = tinf_crc32tab[crc & 0x0f] ^ (crc >> 4); 60 | crc = tinf_crc32tab[crc & 0x0f] ^ (crc >> 4); 61 | } 62 | 63 | return crc ^ 0xffffffff; 64 | } 65 | -------------------------------------------------------------------------------- /u-boot/include/ioports.h: -------------------------------------------------------------------------------- 1 | /* 2 | * definitions for MPC8260 I/O Ports 3 | * 4 | * (in addition to those provided in ) 5 | * 6 | * Murray.Jensen@cmst.csiro.au, 20-Oct-00 7 | */ 8 | 9 | /* 10 | * this structure mirrors the layout of the five port registers in 11 | * the internal memory map - see iop8260_t in 12 | */ 13 | typedef struct { 14 | unsigned int pdir; /* Port Data Direction Register (35-3) */ 15 | unsigned int ppar; /* Port Pin Assignment Register (35-4) */ 16 | unsigned int psor; /* Port Special Options Register (35-5) */ 17 | unsigned int podr; /* Port Open Drain Register (35-2) */ 18 | unsigned int pdat; /* Port Data Register (35-3) */ 19 | } ioport_t; 20 | 21 | /* 22 | * this macro calculates the address within the internal 23 | * memory map (im) of the set of registers for a port (idx) 24 | * 25 | * the internal memory map aligns the above structure on 26 | * a 0x20 byte boundary 27 | */ 28 | #ifdef CONFIG_MPC85xx 29 | #define ioport_addr(im, idx) (ioport_t *)((uint)&((im)->im_cpm.im_cpm_iop) + ((idx)*0x20)) 30 | #else 31 | #define ioport_addr(im, idx) (ioport_t *)((uint)&(im)->im_ioport + ((idx)*0x20)) 32 | #endif 33 | 34 | /* 35 | * this structure provides configuration 36 | * information for one port pin 37 | */ 38 | typedef struct { 39 | unsigned char conf:1; /* if 1, configure this port */ 40 | unsigned char ppar:1; /* Port Pin Assignment Register (35-4) */ 41 | unsigned char psor:1; /* Port Special Options Register (35-2) */ 42 | unsigned char pdir:1; /* Port Data Direction Register (35-3) */ 43 | unsigned char podr:1; /* Port Open Drain Register (35-2) */ 44 | unsigned char pdat:1; /* Port Data Register (35-2) */ 45 | } iop_conf_t; 46 | 47 | /* 48 | * a table that contains configuration information for all 32 pins 49 | * of all four MPC8260 I/O ports. 50 | * 51 | * NOTE: in the second dimension of this table, index 0 refers to pin 31 52 | * and index 31 refers to pin 0. this made the code in the table look more 53 | * like the table in the 8260UM (and in the hymod manuals). 54 | */ 55 | extern const iop_conf_t iop_conf_tab[4][32]; 56 | -------------------------------------------------------------------------------- /u-boot/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 | * NOTE: This header file defines an interface to U-Boot. Including 25 | * this (unmodified) header file in another file is considered normal 26 | * use of U-Boot, and does *not* fall under the heading of "derived 27 | * work". 28 | ******************************************************************** 29 | */ 30 | 31 | #ifndef _U_BOOT_H_ 32 | #define _U_BOOT_H_ 1 33 | 34 | typedef struct bd_info { 35 | unsigned int bi_baudrate; /* serial console baudrate */ 36 | unsigned long bi_ip_addr; /* IP address */ 37 | unsigned char bi_enetaddr[6]; /* Ethernet address */ 38 | unsigned long bi_arch_number; /* unique id for this board */ 39 | unsigned long bi_boot_params; /* where this board expects params */ 40 | unsigned long bi_memstart; /* start of DRAM memory */ 41 | unsigned long bi_memsize; /* size of DRAM memory in bytes */ 42 | unsigned long bi_flashstart; /* start of FLASH memory */ 43 | unsigned long bi_flashsize; /* size of FLASH memory */ 44 | unsigned long bi_flashoffset; /* reserved area for startup monitor */ 45 | unsigned long bi_cfg_hz; 46 | } bd_t; 47 | 48 | #define bi_env_data bi_env->data 49 | #define bi_env_crc bi_env->crc 50 | 51 | #endif /* _U_BOOT_H_ */ 52 | -------------------------------------------------------------------------------- /u-boot/include/linux/bitops.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_BITOPS_H 2 | #define _LINUX_BITOPS_H 3 | 4 | #ifdef __ASSEMBLY__ 5 | /* 6 | * Helper macros 7 | */ 8 | #define BIT(_x) (1 << (_x)) 9 | #define BITS(_start, _bits) (((1 << (_bits)) - 1) << _start) 10 | #define CHECK_BIT(_var, _pos) ((_var) & (1 << (_pos))) 11 | 12 | #else 13 | 14 | /* 15 | * Helper macros 16 | */ 17 | #define BIT(_x) (1U << (_x)) 18 | #define BITS(_start, _bits) (((1U << (_bits)) - 1U) << _start) 19 | #define CHECK_BIT(_var, _pos) ((_var) & (1U << (_pos))) 20 | 21 | /* 22 | * ffs: find first bit set. This is defined the same way as 23 | * the libc and compiler builtin ffs routines, therefore 24 | * differs in spirit from the above ffz (man ffs). 25 | */ 26 | static inline int generic_ffs(int x) 27 | { 28 | int r = 1; 29 | 30 | if (!x) 31 | return 0; 32 | if (!(x & 0xffff)) { 33 | x >>= 16; 34 | r += 16; 35 | } 36 | if (!(x & 0xff)) { 37 | x >>= 8; 38 | r += 8; 39 | } 40 | if (!(x & 0xf)) { 41 | x >>= 4; 42 | r += 4; 43 | } 44 | if (!(x & 3)) { 45 | x >>= 2; 46 | r += 2; 47 | } 48 | if (!(x & 1)) { 49 | x >>= 1; 50 | r += 1; 51 | } 52 | return r; 53 | } 54 | 55 | /* 56 | * hweightN: returns the hamming weight (i.e. the number 57 | * of bits set) of a N-bit word 58 | */ 59 | static inline unsigned int generic_hweight32(unsigned int w) 60 | { 61 | unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555); 62 | res = (res & 0x33333333) + ((res >> 2) & 0x33333333); 63 | res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F); 64 | res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF); 65 | return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF); 66 | } 67 | 68 | static inline unsigned int generic_hweight16(unsigned int w) 69 | { 70 | unsigned int res = (w & 0x5555) + ((w >> 1) & 0x5555); 71 | res = (res & 0x3333) + ((res >> 2) & 0x3333); 72 | res = (res & 0x0F0F) + ((res >> 4) & 0x0F0F); 73 | return (res & 0x00FF) + ((res >> 8) & 0x00FF); 74 | } 75 | 76 | static inline unsigned int generic_hweight8(unsigned int w) 77 | { 78 | unsigned int res = (w & 0x55) + ((w >> 1) & 0x55); 79 | res = (res & 0x33) + ((res >> 2) & 0x33); 80 | return (res & 0x0F) + ((res >> 4) & 0x0F); 81 | } 82 | 83 | #include 84 | 85 | #endif /* !__ASSEMBLY__ */ 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /u-boot/include/tplink_image.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Piotr Dymacz 3 | * 4 | * Based on mktplinkfw.c from OpenWrt 5 | * 6 | * SPDX-License-Identifier: GPL-2.0 7 | */ 8 | 9 | #ifndef __TPLINK_IMAGE_H__ 10 | #define __TPLINK_IMAGE_H__ 11 | 12 | #define TPL_IH_VERSION_V1 0x01000000 13 | #define TPL_IH_VERSION_V2 0x02000000 14 | #define TPL_IH_VERSION_V3 0x03000000 15 | 16 | #define MD5SUM_LEN 16 17 | 18 | /* For v1 version of header version */ 19 | typedef struct tplink_image_header { /* ofs (size): what */ 20 | uint32_t ih_version; /* 0x0 (4): header version */ 21 | char ih_vendor[24]; /* 0x4 (24): vendor name (text) */ 22 | char ih_info[36]; /* 0x1C (36): other info like version */ 23 | uint32_t ih_hw_id; /* 0x40 (4): hardware ID */ 24 | uint32_t ih_hw_ver; /* 0x44 (4): hardware version */ 25 | uint32_t ih_region; /* 0x48 (4): region code */ 26 | uint8_t ih_md5sum1[MD5SUM_LEN]; /* 0x4C (16): MD5 sum #1 */ 27 | uint32_t ih_ignore1; /* 0x5C (4): unknown */ 28 | uint8_t ih_md5sum2[MD5SUM_LEN]; /* 0x60 (16): MD5 sum #2 */ 29 | uint32_t ih_ignore2; /* 0x70 (4): unknown */ 30 | uint32_t ih_kernel_load; /* 0x74 (4): kernel load address */ 31 | uint32_t ih_kernel_ep; /* 0x78 (4): kernel entry point */ 32 | uint32_t ih_fw_len; /* 0x7C (4): image size (with header) */ 33 | uint32_t ih_kernel_ofs; /* 0x80 (4): kernel data offset */ 34 | uint32_t ih_kernel_len; /* 0x84 (4): kernel data size */ 35 | uint32_t ih_rootfs_ofs; /* 0x88 (4): rootfs data offset */ 36 | uint32_t ih_rootfs_len; /* 0x8C (4): rootfs data size */ 37 | uint32_t ih_boot_ofs; /* 0x90 (4): bootloader data offset */ 38 | uint32_t ih_boot_len; /* 0x94 (4): bootloader data size */ 39 | uint16_t ih_fw_ver_hi; /* 0x98 (2): firmware version hi */ 40 | uint16_t ih_fw_ver_mid; /* 0x9A (2): firmware version mid */ 41 | uint16_t ih_fw_ver_lo; /* 0x9C (2): firmware version lo */ 42 | uint8_t ih_pad[354]; /* 0x9E (354): padding, not used... */ 43 | } tplink_image_header_t; 44 | 45 | #endif /* __TPLINK_IMAGE_H__ */ 46 | -------------------------------------------------------------------------------- /u-boot/common/cmd_boot.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000-2003 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * Misc boot support 26 | */ 27 | #include 28 | #include 29 | #include 30 | 31 | #if defined(CONFIG_I386) || defined(CONFIG_MIPS) 32 | DECLARE_GLOBAL_DATA_PTR; 33 | #endif 34 | 35 | int do_go(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]){ 36 | ulong addr, rc; 37 | int rcode = 0; 38 | 39 | if(argc < 2){ 40 | print_cmd_help(cmdtp); 41 | return(1); 42 | } 43 | 44 | addr = simple_strtoul(argv[1], NULL, 16); 45 | 46 | printf("## Starting application at 0x%08lX...\n", addr); 47 | 48 | /* 49 | * Pass address parameter as argv[0] (aka command name), 50 | * and all remaining args 51 | */ 52 | rc = ((ulong (*)(int, char * const []))addr)(--argc, &argv[1]); 53 | 54 | if(rc != 0){ 55 | rcode = 1; 56 | } 57 | 58 | printf("## Application terminated, rc = 0x%lX\n", rc); 59 | 60 | return(rcode); 61 | } 62 | 63 | U_BOOT_CMD(go, CONFIG_SYS_MAXARGS, 1, do_go, "start application at address 'addr'", 64 | "addr [arg ...]\n" 65 | "\t- start application at address 'addr'\n" 66 | "\t passing 'arg' as arguments"); 67 | 68 | extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); 69 | 70 | U_BOOT_CMD(reset, 1, 0, do_reset, "perform RESET of the CPU", NULL); 71 | U_BOOT_CMD(reboot, 1, 0, do_reset, "perform RESET of the CPU", NULL); 72 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/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-2006 DENX Software Engineering, Wolfgang Denk 9 | # 10 | 11 | APPEND=no # Default: Create new config file 12 | BOARD_NAME="" # Name to print in make output 13 | 14 | while [ $# -gt 0 ] ; do 15 | case "$1" in 16 | --) shift ; break ;; 17 | -a) shift ; APPEND=yes ;; 18 | -n) shift ; BOARD_NAME="${1%%_config}" ; shift ;; 19 | *) break ;; 20 | esac 21 | done 22 | 23 | [ "${BOARD_NAME}" ] || BOARD_NAME="$1" 24 | 25 | [ $# -lt 4 ] && exit 1 26 | [ $# -gt 6 ] && exit 1 27 | 28 | echo "Configuring for ${BOARD_NAME} board..." 29 | 30 | # 31 | # Create link to architecture specific headers 32 | # 33 | if [ "$SRCTREE" != "$OBJTREE" ] ; then 34 | mkdir -p ${OBJTREE}/include 35 | mkdir -p ${OBJTREE}/include2 36 | cd ${OBJTREE}/include2 37 | rm -f asm 38 | ln -s ${SRCTREE}/include/asm-$2 asm 39 | LNPREFIX="../../include2/asm/" 40 | cd ../include 41 | rm -rf asm-$2 42 | rm -f asm 43 | mkdir asm-$2 44 | ln -s asm-$2 asm 45 | else 46 | cd ./include 47 | rm -f asm 48 | ln -s asm-$2 asm 49 | fi 50 | 51 | rm -f asm-$2/arch 52 | 53 | if [ -z "$6" -o "$6" = "NULL" ] ; then 54 | ln -s ${LNPREFIX}arch-$3 asm-$2/arch 55 | else 56 | ln -s ${LNPREFIX}arch-$6 asm-$2/arch 57 | fi 58 | 59 | if [ "$2" = "arm" ] ; then 60 | rm -f asm-$2/proc 61 | ln -s ${LNPREFIX}proc-armv asm-$2/proc 62 | fi 63 | 64 | # 65 | # Create include file for Make 66 | # 67 | echo "ARCH = $2" > config.mk 68 | echo "CPU = $3" >> config.mk 69 | echo "BOARD = $4" >> config.mk 70 | 71 | [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk 72 | 73 | [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk 74 | 75 | # 76 | # Create board specific header file 77 | # 78 | if [ "$APPEND" = "yes" ] # Append to existing config file 79 | then 80 | echo >> config.h.new 81 | else 82 | > config.h.new # Create new config file 83 | fi 84 | echo "/* Automatically generated - do not edit */" >>config.h.new 85 | echo "#include " >>config.h.new 86 | 87 | if [ -f "config.h" ] ; then 88 | ( diff -q config.h config.h.new 2>/dev/null && rm -f config.h.new ) || mv -f config.h.new config.h 89 | else 90 | mv -f config.h.new config.h 91 | fi 92 | 93 | exit 0 94 | -------------------------------------------------------------------------------- /u-boot/lib_generic/ldiv.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1992, 1997 Free Software Foundation, Inc. 2 | This file is part of the GNU C Library. 3 | 4 | The GNU C Library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public License as 6 | published by the Free Software Foundation; either version 2 of the 7 | License, or (at your option) any later version. 8 | 9 | The GNU C Library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with the GNU C Library; see the file COPYING.LIB. If not, 16 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | Boston, MA 02111-1307, USA. */ 18 | 19 | typedef struct { 20 | long quot; 21 | long rem; 22 | } ldiv_t; 23 | /* Return the `ldiv_t' representation of NUMER over DENOM. */ 24 | ldiv_t 25 | ldiv (long int numer, long int denom) 26 | { 27 | ldiv_t result; 28 | 29 | result.quot = numer / denom; 30 | result.rem = numer % denom; 31 | 32 | /* The ANSI standard says that |QUOT| <= |NUMER / DENOM|, where 33 | NUMER / DENOM is to be computed in infinite precision. In 34 | other words, we should always truncate the quotient towards 35 | zero, never -infinity. Machine division and remainer may 36 | work either way when one or both of NUMER or DENOM is 37 | negative. If only one is negative and QUOT has been 38 | truncated towards -infinity, REM will have the same sign as 39 | DENOM and the opposite sign of NUMER; if both are negative 40 | and QUOT has been truncated towards -infinity, REM will be 41 | positive (will have the opposite sign of NUMER). These are 42 | considered `wrong'. If both are NUM and DENOM are positive, 43 | RESULT will always be positive. This all boils down to: if 44 | NUMER >= 0, but REM < 0, we got the wrong answer. In that 45 | case, to get the right answer, add 1 to QUOT and subtract 46 | DENOM from REM. */ 47 | 48 | if (numer >= 0 && result.rem < 0) 49 | { 50 | ++result.quot; 51 | result.rem -= denom; 52 | } 53 | 54 | return result; 55 | } 56 | -------------------------------------------------------------------------------- /u-boot/net/sntp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SNTP support driver 3 | * 4 | * Masami Komiya 2005 5 | * 6 | */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "sntp.h" 12 | 13 | #if defined(CONFIG_CMD_NET) && defined(CONFIG_CMD_SNTP) 14 | 15 | DECLARE_GLOBAL_DATA_PTR; 16 | 17 | //#define DEBUG 18 | 19 | #define SNTP_TIMEOUT 10 20 | 21 | static unsigned SntpOurPort; 22 | 23 | static void SntpSend(void){ 24 | struct sntp_pkt_t pkt; 25 | int pktlen = SNTP_PACKET_LEN; 26 | int sport; 27 | 28 | #ifdef DEBUG 29 | printf("%s\n", __FUNCTION__); 30 | #endif 31 | 32 | memset(&pkt, 0, sizeof(pkt)); 33 | 34 | pkt.li = NTP_LI_NOLEAP; 35 | pkt.vn = NTP_VERSION; 36 | pkt.mode = NTP_MODE_CLIENT; 37 | 38 | memcpy((char *)NetTxPacket + NetEthHdrSize() + IP_HDR_SIZE, (char *)&pkt, pktlen); 39 | 40 | SntpOurPort = 10000 + (get_timer(0) % 4096); 41 | sport = NTP_SERVICE_PORT; 42 | 43 | puts("Sending SNTP request...\n"); 44 | 45 | NetSendUDPPacket(NetServerEther, NetNtpServerIP, sport, SntpOurPort, pktlen); 46 | } 47 | 48 | static void SntpTimeout(void){ 49 | printf_err("timeout\n"); 50 | NetState = NETLOOP_FAIL; 51 | 52 | return; 53 | } 54 | 55 | static void SntpHandler(uchar *pkt, unsigned dest, unsigned src, unsigned len){ 56 | struct sntp_pkt_t *rpktp = (struct sntp_pkt_t *)pkt; 57 | struct rtc_time tm; 58 | ulong seconds; 59 | 60 | #ifdef DEBUG 61 | printf("%s\n", __FUNCTION__); 62 | #endif 63 | 64 | if(dest != SntpOurPort){ 65 | return; 66 | } 67 | 68 | /* 69 | * As the RTC's used in U-Boot supports second resolution only 70 | * we simply ignore the sub-second field. 71 | */ 72 | memcpy(&seconds, &rpktp->transmit_timestamp, sizeof(ulong)); 73 | 74 | to_tm(ntohl(seconds) - 2208988800UL + NetTimeOffset, &tm); 75 | 76 | #if defined(CONFIG_CMD_DATE) 77 | // TODO: find out how to use RTC on 78 | //rtc_set(&tm); 79 | #endif 80 | printf("Got SNTP response: %4d-%02d-%02d %2d:%02d:%02d\n\n", tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); 81 | NetState = NETLOOP_SUCCESS; 82 | } 83 | 84 | void SntpStart(void){ 85 | bd_t *bd = gd->bd; 86 | #ifdef DEBUG 87 | printf("%s\n", __FUNCTION__); 88 | #endif 89 | 90 | NetSetTimeout(SNTP_TIMEOUT * CFG_HZ, SntpTimeout); 91 | NetSetHandler(SntpHandler); 92 | 93 | memset(NetServerEther, 0, 6); 94 | 95 | SntpSend(); 96 | } 97 | 98 | #endif /* CONFIG_CMD_NET && CONFIG_CMD_SNTP */ 99 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/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 | -------------------------------------------------------------------------------- /u-boot/include/asm-mips/addrspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is subject to the terms and conditions of the GNU General Public 3 | * License. See the file "COPYING" in the main directory of this archive 4 | * for more details. 5 | * 6 | * Copyright (C) 1996 by Ralf Baechle 7 | * Copyright (C) 2000 by Maciej W. Rozycki 8 | * 9 | * Defitions for the address spaces of the MIPS CPUs. 10 | */ 11 | #ifndef __ASM_MIPS_ADDRSPACE_H 12 | #define __ASM_MIPS_ADDRSPACE_H 13 | 14 | /* 15 | * Memory segments (32bit kernel mode addresses) 16 | */ 17 | #define KUSEG 0x00000000 18 | #define KSEG0 0x80000000 19 | #define KSEG1 0xa0000000 20 | #define KSEG2 0xc0000000 21 | #define KSEG3 0xe0000000 22 | 23 | #define K0BASE KSEG0 24 | 25 | /* 26 | * Returns the kernel segment base of a given address 27 | */ 28 | #ifndef __ASSEMBLY__ 29 | #define KSEGX(a) (((unsigned long)(a)) & 0xe0000000) 30 | #else 31 | #define KSEGX(a) ((a) & 0xe0000000) 32 | #endif 33 | 34 | /* 35 | * Returns the physical address of a KSEG0/KSEG1 address 36 | */ 37 | #ifndef __ASSEMBLY__ 38 | #define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff) 39 | #else 40 | #define PHYSADDR(a) ((a) & 0x1fffffff) 41 | #endif 42 | 43 | /* 44 | * Returns the uncached address of a sdram address 45 | */ 46 | #ifndef __ASSEMBLY__ 47 | #define UNCACHED_SDRAM(a) KSEG1ADDR((a)) 48 | #endif /* __ASSEMBLY__ */ 49 | /* 50 | * Map an address to a certain kernel segment 51 | */ 52 | #ifndef __ASSEMBLY__ 53 | #define KSEG0ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG0)) 54 | #define KSEG1ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG1)) 55 | #define KSEG2ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG2)) 56 | #define KSEG3ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG3)) 57 | #else 58 | #define KSEG0ADDR(a) (((a) & 0x1fffffff) | KSEG0) 59 | #define KSEG1ADDR(a) (((a) & 0x1fffffff) | KSEG1) 60 | #define KSEG2ADDR(a) (((a) & 0x1fffffff) | KSEG2) 61 | #define KSEG3ADDR(a) (((a) & 0x1fffffff) | KSEG3) 62 | #endif 63 | 64 | /* 65 | * Memory segments (64bit kernel mode addresses) 66 | */ 67 | #define XKUSEG 0x0000000000000000 68 | #define XKSSEG 0x4000000000000000 69 | #define XKPHYS 0x8000000000000000 70 | #define XKSEG 0xc000000000000000 71 | #define CKSEG0 0xffffffff80000000 72 | #define CKSEG1 0xffffffffa0000000 73 | #define CKSSEG 0xffffffffc0000000 74 | #define CKSEG3 0xffffffffe0000000 75 | 76 | #endif /* __ASM_MIPS_ADDRSPACE_H */ 77 | -------------------------------------------------------------------------------- /u-boot/httpd/fsdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: fsdata.h,v 1.4.2.1 2003/10/04 22:54:06 adam Exp $ 34 | */ 35 | #ifndef __FSDATA_H__ 36 | #define __FSDATA_H__ 37 | 38 | #include "uipopt.h" 39 | 40 | struct fsdata_file { 41 | const struct fsdata_file *next; 42 | const char *name; 43 | const char *data; 44 | const int len; 45 | #ifdef FS_STATISTICS 46 | #if FS_STATISTICS == 1 47 | u16_t count; 48 | #endif /* FS_STATISTICS */ 49 | #endif /* FS_STATISTICS */ 50 | }; 51 | 52 | struct fsdata_file_noconst { 53 | struct fsdata_file *next; 54 | char *name; 55 | char *data; 56 | int len; 57 | #ifdef FS_STATISTICS 58 | #if FS_STATISTICS == 1 59 | u16_t count; 60 | #endif /* FS_STATISTICS */ 61 | #endif /* FS_STATISTICS */ 62 | }; 63 | 64 | #endif /* __FSDATA_H__ */ 65 | -------------------------------------------------------------------------------- /u-boot/include/linux/string.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_STRING_H_ 2 | #define _LINUX_STRING_H_ 3 | 4 | #include /* for size_t */ 5 | #include /* for NULL */ 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | extern char * ___strtok; 12 | extern char * strpbrk(const char *,const char *); 13 | extern char * strtok(char *,const char *); 14 | extern char * strsep(char **,const char *); 15 | extern __kernel_size_t strspn(const char *,const char *); 16 | 17 | 18 | /* 19 | * Include machine specific inline routines 20 | */ 21 | #include 22 | 23 | #ifndef __HAVE_ARCH_STRCPY 24 | extern char * strcpy(char *,const char *); 25 | #endif 26 | #ifndef __HAVE_ARCH_STRNCPY 27 | extern char * strncpy(char *,const char *, __kernel_size_t); 28 | #endif 29 | #ifndef __HAVE_ARCH_STRCAT 30 | extern char * strcat(char *, const char *); 31 | #endif 32 | #ifndef __HAVE_ARCH_STRNCAT 33 | extern char * strncat(char *, const char *, __kernel_size_t); 34 | #endif 35 | #ifndef __HAVE_ARCH_STRCMP 36 | extern int strcmp(const char *,const char *); 37 | #endif 38 | #ifndef __HAVE_ARCH_STRNCMP 39 | extern int strncmp(const char *,const char *,__kernel_size_t); 40 | #endif 41 | #ifndef __HAVE_ARCH_STRNICMP 42 | extern int strnicmp(const char *, const char *, __kernel_size_t); 43 | #endif 44 | #ifndef __HAVE_ARCH_STRCHR 45 | extern char * strchr(const char *,int); 46 | #endif 47 | #ifndef __HAVE_ARCH_STRRCHR 48 | extern char * strrchr(const char *,int); 49 | #endif 50 | #ifndef __HAVE_ARCH_STRSTR 51 | extern char * strstr(const char *,const char *); 52 | #endif 53 | #ifndef __HAVE_ARCH_STRLEN 54 | extern __kernel_size_t strlen(const char *); 55 | #endif 56 | #ifndef __HAVE_ARCH_STRNLEN 57 | extern __kernel_size_t strnlen(const char *,__kernel_size_t); 58 | #endif 59 | #ifndef __HAVE_ARCH_STRDUP 60 | extern char * strdup(const char *); 61 | #endif 62 | #ifndef __HAVE_ARCH_STRSWAB 63 | extern char * strswab(const char *); 64 | #endif 65 | 66 | #ifndef __HAVE_ARCH_MEMSET 67 | extern void * memset(void *,int,__kernel_size_t); 68 | #endif 69 | #ifndef __HAVE_ARCH_MEMCPY 70 | extern void * memcpy(void *,const void *,__kernel_size_t); 71 | #endif 72 | #ifndef __HAVE_ARCH_MEMMOVE 73 | extern void * memmove(void *,const void *,__kernel_size_t); 74 | #endif 75 | #ifndef __HAVE_ARCH_MEMSCAN 76 | extern void * memscan(void *,int,__kernel_size_t); 77 | #endif 78 | #ifndef __HAVE_ARCH_MEMCMP 79 | extern int memcmp(const void *,const void *,__kernel_size_t); 80 | #endif 81 | #ifndef __HAVE_ARCH_MEMCHR 82 | extern void * memchr(const void *,int,__kernel_size_t); 83 | #endif 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* _LINUX_STRING_H_ */ 90 | -------------------------------------------------------------------------------- /u-boot/include/soc/soc_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SOC common registers and helper function/macro definitions 3 | * 4 | * Copyright (C) 2016 Piotr Dymacz 5 | * 6 | * SPDX-License-Identifier: GPL-2.0 7 | */ 8 | 9 | #ifndef _SOC_COMMON_H_ 10 | #define _SOC_COMMON_H_ 11 | 12 | #include 13 | 14 | #ifndef SOC_TYPE 15 | #error "SOC_TYPE is not defined!" 16 | #endif 17 | 18 | /* 19 | * GPIO registers BIT fields 20 | */ 21 | #define GPIO_X_MASK(_gpio) (1 << _gpio) 22 | 23 | #define GPIO0 GPIO_X_MASK(0) 24 | #define GPIO1 GPIO_X_MASK(1) 25 | #define GPIO2 GPIO_X_MASK(2) 26 | #define GPIO3 GPIO_X_MASK(3) 27 | #define GPIO4 GPIO_X_MASK(4) 28 | #define GPIO5 GPIO_X_MASK(5) 29 | #define GPIO6 GPIO_X_MASK(6) 30 | #define GPIO7 GPIO_X_MASK(7) 31 | #define GPIO8 GPIO_X_MASK(8) 32 | #define GPIO9 GPIO_X_MASK(9) 33 | #define GPIO10 GPIO_X_MASK(10) 34 | #define GPIO11 GPIO_X_MASK(11) 35 | #define GPIO12 GPIO_X_MASK(12) 36 | #define GPIO13 GPIO_X_MASK(13) 37 | #define GPIO14 GPIO_X_MASK(14) 38 | #define GPIO15 GPIO_X_MASK(15) 39 | #define GPIO16 GPIO_X_MASK(16) 40 | #define GPIO17 GPIO_X_MASK(17) 41 | #define GPIO18 GPIO_X_MASK(18) 42 | #define GPIO19 GPIO_X_MASK(19) 43 | #define GPIO20 GPIO_X_MASK(20) 44 | #define GPIO21 GPIO_X_MASK(21) 45 | #define GPIO22 GPIO_X_MASK(22) 46 | #define GPIO23 GPIO_X_MASK(23) 47 | #define GPIO24 GPIO_X_MASK(24) 48 | #define GPIO25 GPIO_X_MASK(25) 49 | #define GPIO26 GPIO_X_MASK(26) 50 | #define GPIO27 GPIO_X_MASK(27) 51 | #define GPIO28 GPIO_X_MASK(28) 52 | #define GPIO29 GPIO_X_MASK(29) 53 | #define GPIO30 GPIO_X_MASK(30) 54 | #define GPIO31 GPIO_X_MASK(31) 55 | #define GPIO32 GPIO_X_MASK(32) 56 | #define GPIO33 GPIO_X_MASK(33) 57 | #define GPIO34 GPIO_X_MASK(34) 58 | #define GPIO35 GPIO_X_MASK(35) 59 | #define GPIO36 GPIO_X_MASK(36) 60 | #define GPIO37 GPIO_X_MASK(37) 61 | #define GPIO38 GPIO_X_MASK(38) 62 | #define GPIO39 GPIO_X_MASK(39) 63 | #define GPIO40 GPIO_X_MASK(40) 64 | #define GPIO41 GPIO_X_MASK(41) 65 | #define GPIO42 GPIO_X_MASK(42) 66 | #define GPIO43 GPIO_X_MASK(43) 67 | #define GPIO44 GPIO_X_MASK(44) 68 | #define GPIO45 GPIO_X_MASK(45) 69 | #define GPIO46 GPIO_X_MASK(46) 70 | #define GPIO47 GPIO_X_MASK(47) 71 | #define GPIO48 GPIO_X_MASK(48) 72 | #define GPIO49 GPIO_X_MASK(49) 73 | #define GPIO50 GPIO_X_MASK(50) 74 | 75 | /* 76 | * Memory types 77 | */ 78 | #define RAM_MEMORY_TYPE_DDR1 1 79 | #define RAM_MEMORY_TYPE_DDR2 2 80 | #define RAM_MEMORY_TYPE_DDR3 3 81 | #define RAM_MEMORY_TYPE_SDR 4 82 | #define RAM_MEMORY_TYPE_UNKNOWN 5 83 | 84 | /* 85 | * Useful clock variables 86 | */ 87 | #define VAL_40MHz (40 * 1000 * 1000) 88 | #define VAL_25MHz (25 * 1000 * 1000) 89 | 90 | #endif /* _SOC_COMMON_H_ */ 91 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/ar7240/qca_ls_uart.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Qualcomm/Atheros Low-Speed UART driver 3 | * 4 | * Copyright (C) 2016 Piotr Dymacz 5 | * Copyright (C) 2008-2010 Atheros Communications Inc. 6 | * 7 | * SPDX-License-Identifier: GPL-2.0 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | DECLARE_GLOBAL_DATA_PTR; 16 | 17 | void serial_setbrg(void) { 18 | u32 div; 19 | 20 | /* 21 | * TODO: prepare list of supported range of baudrate values 22 | * For 40 MHz ref_clk, successfully tested up to 1152000 on AR9344 23 | */ 24 | 25 | /* Round to closest, final baudrate = ref_clk / (16 * div) */ 26 | if (qca_xtal_is_40mhz() == 1) { 27 | div = (VAL_40MHz + (8 * gd->baudrate)) / (16 * gd->baudrate); 28 | gd->baudrate = VAL_40MHz / (16 * div); 29 | } else { 30 | div = (VAL_25MHz + (8 * gd->baudrate)) / (16 * gd->baudrate); 31 | gd->baudrate = VAL_25MHz / (16 * div); 32 | } 33 | 34 | /* Set DLAB bit in LCR register unlocks DLL/DLH registers */ 35 | qca_soc_reg_read_set(QCA_LSUART_LCR_REG, QCA_LSUART_LCR_DLAB_MASK); 36 | 37 | /* Write div into DLL and DLH registers */ 38 | qca_soc_reg_write(QCA_LSUART_DLL_REG, (div & 0xFF)); 39 | qca_soc_reg_write(QCA_LSUART_DLH_REG, ((div >> 8) & 0xFF)); 40 | 41 | /* Clear DLAB bit in LCR register */ 42 | qca_soc_reg_read_clear(QCA_LSUART_LCR_REG, QCA_LSUART_LCR_DLAB_MASK); 43 | } 44 | 45 | int serial_init(void) { 46 | serial_setbrg(); 47 | 48 | /* No interrupt */ 49 | qca_soc_reg_write(QCA_LSUART_IER_REG, 0x0); 50 | 51 | /* No FIFO/DMA */ 52 | qca_soc_reg_write(QCA_LSUART_FCR_REG, 0x0); 53 | 54 | /* 55 | * Low-Speed UART controller configuration: 56 | * - data: 8bits 57 | * - stop: 1bit 58 | * - parity: no 59 | */ 60 | qca_soc_reg_write(QCA_LSUART_LCR_REG, (u32)QCA_LSUART_LCR_CLS_8BIT_VAL << QCA_LSUART_LCR_CLS_SHIFT); 61 | 62 | return 0; 63 | } 64 | 65 | void serial_putc(const char c) { 66 | u32 line_status; 67 | 68 | if (c == '\n') 69 | serial_putc('\r'); 70 | 71 | /* Wait for empty THR */ 72 | do { 73 | line_status = qca_soc_reg_read(QCA_LSUART_LSR_REG) & QCA_LSUART_LSR_THRE_MASK; 74 | } while (line_status == 0); 75 | 76 | /* Put data in THR */ 77 | qca_soc_reg_write(QCA_LSUART_THR_REG, (u32)c); 78 | } 79 | 80 | int serial_getc(void) { 81 | while (!serial_tstc()) 82 | ; 83 | 84 | /* Get data from RBR */ 85 | return qca_soc_reg_read(QCA_LSUART_RBR_REG) 86 | & QCA_LSUART_RBR_RBR_MASK; 87 | } 88 | 89 | int serial_tstc(void) { 90 | /* Check data ready bit */ 91 | return qca_soc_reg_read(QCA_LSUART_LSR_REG) 92 | & QCA_LSUART_LSR_DR_MASK; 93 | } 94 | 95 | void serial_puts(const char *s) { 96 | while (*s) 97 | serial_putc(*s++); 98 | } 99 | -------------------------------------------------------------------------------- /u-boot/httpd/httpd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \addtogroup httpd 3 | * @{ 4 | */ 5 | 6 | /** 7 | * \file 8 | * HTTP server header file. 9 | * \author Adam Dunkels 10 | */ 11 | 12 | /* 13 | * Copyright (c) 2001, Adam Dunkels. 14 | * All rights reserved. 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted provided that the following conditions 18 | * are met: 19 | * 1. Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 3. The name of the author may not be used to endorse or promote 25 | * products derived from this software without specific prior 26 | * written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 29 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 31 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 32 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 36 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * This file is part of the uIP TCP/IP stack. 41 | * 42 | * $Id: httpd.h,v 1.4.2.3 2003/10/06 22:56:44 adam Exp $ 43 | * 44 | */ 45 | 46 | #ifndef __HTTPD_H__ 47 | #define __HTTPD_H__ 48 | 49 | void httpd_init(void); 50 | void httpd_appcall(void); 51 | 52 | /* UIP_APPCALL: the name of the application function. This function 53 | must return void and take no arguments (i.e., C type "void 54 | appfunc(void)"). */ 55 | #ifndef UIP_APPCALL 56 | #define UIP_APPCALL httpd_appcall 57 | #endif 58 | 59 | struct httpd_state { 60 | u8_t state; 61 | u16_t count; 62 | u8_t *dataptr; 63 | unsigned int upload; 64 | unsigned int upload_total; 65 | }; 66 | 67 | /* UIP_APPSTATE_SIZE: The size of the application-specific state 68 | stored in the uip_conn structure. */ 69 | #ifndef UIP_APPSTATE_SIZE 70 | #define UIP_APPSTATE_SIZE (sizeof(struct httpd_state)) 71 | #endif 72 | 73 | //#define FS_STATISTICS 1 74 | 75 | extern struct httpd_state *hs; 76 | 77 | #endif /* __HTTPD_H__ */ 78 | -------------------------------------------------------------------------------- /u-boot/include/soc/soc_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Piotr Dymacz 3 | * 4 | * SPDX-License-Identifier: GPL-2.0 5 | */ 6 | 7 | #ifndef _SOC_LIST_H_ 8 | #define _SOC_LIST_H_ 9 | 10 | /* AR71xx (Hydra) MIPS 24Kc */ 11 | #define QCA_AR7130_SOC 0x00000001 12 | #define QCA_AR7141_SOC 0x00000002 13 | #define QCA_AR7161_SOC 0x00000004 14 | #define QCA_AR71XX_SOC (QCA_AR7130_SOC |\ 15 | QCA_AR7141_SOC |\ 16 | QCA_AR7161_SOC) 17 | 18 | /* AR724x MIPS 24Kc*/ 19 | /* Python */ 20 | #define QCA_AR7240_SOC 0x00000008 21 | /* Virian */ 22 | #define QCA_AR7241_SOC 0x00000010 23 | #define QCA_AR7242_SOC 0x00000020 24 | #define QCA_AR724X_SOC (QCA_AR7240_SOC |\ 25 | QCA_AR7241_SOC |\ 26 | QCA_AR7242_SOC) 27 | 28 | /* AR91xx (Howl) MIPS 24Kc 29 | * note: these SoCs can have different radios 30 | */ 31 | #define QCA_AR9130_SOC 0x00000040 32 | #define QCA_AR9132_SOC 0x00000080 33 | #define QCA_AR91XX_SOC (QCA_AR9130_SOC |\ 34 | QCA_AR9132_SOC) 35 | 36 | /* AR933x (Hornet) MIPS 24Kc */ 37 | #define QCA_AR1311_SOC 0x00000100 38 | #define QCA_AR9330_SOC 0x00000200 39 | #define QCA_AR9331_SOC 0x00000400 40 | #define QCA_AR933X_SOC (QCA_AR1311_SOC |\ 41 | QCA_AR9330_SOC |\ 42 | QCA_AR9331_SOC) 43 | 44 | /* AR934x (Wasp) MIPS 74Kc 45 | * note: AR7370 and AR9350 are AR934X 46 | */ 47 | #define QCA_AR1321_SOC 0x00000800 48 | #define QCA_AR7370_SOC 0x00001000 49 | #define QCA_AR9341_SOC 0x00002000 50 | #define QCA_AR9342_SOC 0x00004000 51 | #define QCA_AR9344_SOC 0x00008000 52 | #define QCA_AR9350_SOC 0x00010000 53 | #define QCA_AR934X_SOC (QCA_AR1321_SOC |\ 54 | QCA_AR7370_SOC |\ 55 | QCA_AR9341_SOC |\ 56 | QCA_AR9342_SOC |\ 57 | QCA_AR9350_SOC |\ 58 | QCA_AR9344_SOC) 59 | 60 | /* QCA953x (Honey Bee) MIPS 24Kc 61 | * note: first SoC by Qualcomm Atheros 62 | * TODO: maybe AR953Xs are really AR933Xs 63 | */ 64 | #define QCA_QCA4531_SOC 0x00020000 65 | #define QCA_QCA9531_SOC 0x00040000 66 | #define QCA_QCA9533_SOC 0x00080000 67 | #define QCA_QCA953X_SOC (QCA_QCA4531_SOC |\ 68 | QCA_QCA9531_SOC |\ 69 | QCA_QCA9533_SOC) 70 | 71 | /* QCA955x (Scorpion) MIPS 74Kc 72 | * TODO: maybe AR955Xs are really AR934Xs 73 | */ 74 | #define QCA_QCA9550_SOC 0x00100000 75 | #define QCA_QCA9556_SOC 0x00200000 76 | #define QCA_QCA9557_SOC 0x00400000 77 | #define QCA_QCA9558_SOC 0x00800000 78 | #define QCA_QCA955X_SOC (QCA_QCA9550_SOC |\ 79 | QCA_QCA9556_SOC |\ 80 | QCA_QCA9557_SOC |\ 81 | QCA_QCA9558_SOC |\ 82 | QCA_QCA9558_SOC) 83 | 84 | /* QCA956x (Dragonfly) */ 85 | #define QCA_QCA9561_SOC 0x01000000 86 | #define QCA_QCA9563_SOC 0x02000000 87 | #define QCA_TP9343_SOC 0x04000000 88 | #define QCA_QCA956X_SOC (QCA_QCA9561_SOC |\ 89 | QCA_QCA9563_SOC |\ 90 | QCA_TP9343_SOC) 91 | 92 | #endif /* _SOC_LIST_H_ */ 93 | -------------------------------------------------------------------------------- /u-boot/net/bootp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copied from LiMon - BOOTP. 3 | * 4 | * Copyright 1994, 1995, 2000 Neil Russell. 5 | * (See License) 6 | * Copyright 2000 Paolo Scaffardi 7 | */ 8 | 9 | #ifndef __BOOTP_H__ 10 | #define __BOOTP_H__ 11 | 12 | #ifndef __NET_H__ 13 | #include 14 | #endif 15 | 16 | /**********************************************************************/ 17 | 18 | /* 19 | * BOOTP header. 20 | */ 21 | #if defined(CONFIG_CMD_DHCP) 22 | #define OPT_SIZE 312 /* Minimum DHCP Options size per RFC2131 - results in 576 byte pkt */ 23 | #else 24 | #define OPT_SIZE 64 25 | #endif 26 | 27 | typedef struct 28 | { 29 | uchar bp_op; /* Operation */ 30 | # define OP_BOOTREQUEST 1 31 | # define OP_BOOTREPLY 2 32 | uchar bp_htype; /* Hardware type */ 33 | # define HWT_ETHER 1 34 | uchar bp_hlen; /* Hardware address length */ 35 | # define HWL_ETHER 6 36 | uchar bp_hops; /* Hop count (gateway thing) */ 37 | ulong bp_id; /* Transaction ID */ 38 | ushort bp_secs; /* Seconds since boot */ 39 | ushort bp_spare1; /* Alignment */ 40 | IPaddr_t bp_ciaddr; /* Client IP address */ 41 | IPaddr_t bp_yiaddr; /* Your (client) IP address */ 42 | IPaddr_t bp_siaddr; /* Server IP address */ 43 | IPaddr_t bp_giaddr; /* Gateway IP address */ 44 | uchar bp_chaddr[16]; /* Client hardware address */ 45 | char bp_sname[64]; /* Server host name */ 46 | char bp_file[128]; /* Boot file name */ 47 | char bp_vend[OPT_SIZE]; /* Vendor information */ 48 | } __attribute__((__packed__)) Bootp_t; 49 | 50 | #define BOOTP_HDR_SIZE sizeof (Bootp_t) 51 | #define BOOTP_SIZE (ETHER_HDR_SIZE + IP_HDR_SIZE + BOOTP_HDR_SIZE) 52 | 53 | /**********************************************************************/ 54 | /* 55 | * Global functions and variables. 56 | */ 57 | 58 | /* bootp.c */ 59 | extern ulong BootpID; /* ID of cur BOOTP request */ 60 | extern char BootFile[128]; /* Boot file name */ 61 | extern int BootpTry; 62 | #ifdef CONFIG_BOOTP_RANDOM_DELAY 63 | ulong seed1, seed2; /* seed for random BOOTP delay */ 64 | #endif 65 | 66 | 67 | /* Send a BOOTP request */ 68 | extern void BootpRequest (void); 69 | 70 | /****************** DHCP Support *********************/ 71 | extern void DhcpRequest(void); 72 | 73 | /* DHCP States */ 74 | typedef enum { INIT, 75 | INIT_REBOOT, 76 | REBOOTING, 77 | SELECTING, 78 | REQUESTING, 79 | REBINDING, 80 | BOUND, 81 | RENEWING } dhcp_state_t; 82 | 83 | #define DHCP_DISCOVER 1 84 | #define DHCP_OFFER 2 85 | #define DHCP_REQUEST 3 86 | #define DHCP_DECLINE 4 87 | #define DHCP_ACK 5 88 | #define DHCP_NAK 6 89 | #define DHCP_RELEASE 7 90 | 91 | #define SELECT_TIMEOUT 3 /* Seconds to wait for offers */ 92 | 93 | /**********************************************************************/ 94 | 95 | #endif /* __BOOTP_H__ */ 96 | -------------------------------------------------------------------------------- /u-boot/include/jffs2/load_kernel.h: -------------------------------------------------------------------------------- 1 | #ifndef load_kernel_h 2 | #define load_kernel_h 3 | /*------------------------------------------------------------------------- 4 | * Filename: load_kernel.h 5 | * Version: $Id: //depot/sw/releases/Aquila_9.2.0_U5/boot/u-boot/include/jffs2/load_kernel.h#1 $ 6 | * Copyright: Copyright (C) 2001, Russ Dill 7 | * Author: Russ Dill 8 | * Description: header for load kernel modules 9 | *-----------------------------------------------------------------------*/ 10 | /* 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (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, MA 02111-1307 USA 25 | * 26 | */ 27 | 28 | #include 29 | 30 | /* mtd device types */ 31 | #define MTD_DEV_TYPE_NOR 0x0001 32 | #define MTD_DEV_TYPE_NAND 0x0002 33 | #define MTD_DEV_TYPE(type) ((type == MTD_DEV_TYPE_NAND) ? "nand" : "nor") 34 | 35 | struct mtd_device { 36 | struct list_head link; 37 | struct mtdids *id; /* parent mtd id entry */ 38 | u16 num_parts; /* number of partitions on this device */ 39 | struct list_head parts; /* partitions */ 40 | }; 41 | 42 | struct part_info { 43 | struct list_head link; 44 | char *name; /* partition name */ 45 | u8 auto_name; /* set to 1 for generated name */ 46 | u32 size; /* total size of the partition */ 47 | u32 offset; /* offset within device */ 48 | void *jffs2_priv; /* used internaly by jffs2 */ 49 | u32 mask_flags; /* kernel MTD mask flags */ 50 | struct mtd_device *dev; /* parent device */ 51 | }; 52 | 53 | struct mtdids { 54 | struct list_head link; 55 | u8 type; /* device type */ 56 | u8 num; /* device number */ 57 | u32 size; /* device size */ 58 | char *mtd_id; /* linux kernel device id */ 59 | }; 60 | 61 | #define ldr_strlen strlen 62 | #define ldr_strncmp strncmp 63 | #define ldr_memcpy memcpy 64 | #define putstr(x) printf("%s", x) 65 | #define mmalloc malloc 66 | #define UDEBUG printf 67 | 68 | #define putnstr(str, size) printf("%*.*s", size, size, str) 69 | #define ldr_output_string(x) puts(x) 70 | #define putLabeledWord(x, y) printf("%s %08x\n", x, (unsigned int)y) 71 | #define led_blink(x, y, z, a) 72 | 73 | #endif /* load_kernel_h */ 74 | -------------------------------------------------------------------------------- /u-boot/include/linux/byteorder/big_endian.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H 2 | #define _LINUX_BYTEORDER_BIG_ENDIAN_H 3 | 4 | #ifndef __BIG_ENDIAN 5 | #define __BIG_ENDIAN 4321 6 | #endif 7 | #ifndef __BIG_ENDIAN_BITFIELD 8 | #define __BIG_ENDIAN_BITFIELD 9 | #endif 10 | #define __BYTE_ORDER __BIG_ENDIAN 11 | 12 | #include 13 | 14 | #define __constant_htonl(x) ((__u32)(x)) 15 | #define __constant_ntohl(x) ((__u32)(x)) 16 | #define __constant_htons(x) ((__u16)(x)) 17 | #define __constant_ntohs(x) ((__u16)(x)) 18 | #define __constant_cpu_to_le64(x) ___swab64((x)) 19 | #define __constant_le64_to_cpu(x) ___swab64((x)) 20 | #define __constant_cpu_to_le32(x) ___swab32((x)) 21 | #define __constant_le32_to_cpu(x) ___swab32((x)) 22 | #define __constant_cpu_to_le16(x) ___swab16((x)) 23 | #define __constant_le16_to_cpu(x) ___swab16((x)) 24 | #define __constant_cpu_to_be64(x) ((__u64)(x)) 25 | #define __constant_be64_to_cpu(x) ((__u64)(x)) 26 | #define __constant_cpu_to_be32(x) ((__u32)(x)) 27 | #define __constant_be32_to_cpu(x) ((__u32)(x)) 28 | #define __constant_cpu_to_be16(x) ((__u16)(x)) 29 | #define __constant_be16_to_cpu(x) ((__u16)(x)) 30 | #define __cpu_to_le64(x) __swab64((x)) 31 | #define __le64_to_cpu(x) __swab64((x)) 32 | #define __cpu_to_le32(x) __swab32((x)) 33 | #define __le32_to_cpu(x) __swab32((x)) 34 | #define __cpu_to_le16(x) __swab16((x)) 35 | #define __le16_to_cpu(x) __swab16((x)) 36 | #define __cpu_to_be64(x) ((__u64)(x)) 37 | #define __be64_to_cpu(x) ((__u64)(x)) 38 | #define __cpu_to_be32(x) ((__u32)(x)) 39 | #define __be32_to_cpu(x) ((__u32)(x)) 40 | #define __cpu_to_be16(x) ((__u16)(x)) 41 | #define __be16_to_cpu(x) ((__u16)(x)) 42 | #define __cpu_to_le64p(x) __swab64p((x)) 43 | #define __le64_to_cpup(x) __swab64p((x)) 44 | #define __cpu_to_le32p(x) __swab32p((x)) 45 | #define __le32_to_cpup(x) __swab32p((x)) 46 | #define __cpu_to_le16p(x) __swab16p((x)) 47 | #define __le16_to_cpup(x) __swab16p((x)) 48 | #define __cpu_to_be64p(x) (*(__u64*)(x)) 49 | #define __be64_to_cpup(x) (*(__u64*)(x)) 50 | #define __cpu_to_be32p(x) (*(__u32*)(x)) 51 | #define __be32_to_cpup(x) (*(__u32*)(x)) 52 | #define __cpu_to_be16p(x) (*(__u16*)(x)) 53 | #define __be16_to_cpup(x) (*(__u16*)(x)) 54 | #define __cpu_to_le64s(x) __swab64s((x)) 55 | #define __le64_to_cpus(x) __swab64s((x)) 56 | #define __cpu_to_le32s(x) __swab32s((x)) 57 | #define __le32_to_cpus(x) __swab32s((x)) 58 | #define __cpu_to_le16s(x) __swab16s((x)) 59 | #define __le16_to_cpus(x) __swab16s((x)) 60 | #define __cpu_to_be64s(x) do {} while (0) 61 | #define __be64_to_cpus(x) do {} while (0) 62 | #define __cpu_to_be32s(x) do {} while (0) 63 | #define __be32_to_cpus(x) do {} while (0) 64 | #define __cpu_to_be16s(x) do {} while (0) 65 | #define __be16_to_cpus(x) do {} while (0) 66 | 67 | #include 68 | 69 | #endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */ 70 | -------------------------------------------------------------------------------- /u-boot/httpd/fs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \addtogroup httpd 3 | * @{ 4 | */ 5 | 6 | /** 7 | * \file 8 | * HTTP server read-only file system header file. 9 | * \author Adam Dunkels 10 | */ 11 | 12 | /* 13 | * Copyright (c) 2001, Swedish Institute of Computer Science. 14 | * All rights reserved. 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted provided that the following conditions 18 | * are met: 19 | * 1. Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 3. Neither the name of the Institute nor the names of its contributors 25 | * may be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 29 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 30 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 31 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 32 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 37 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 38 | * SUCH DAMAGE. 39 | * 40 | * This file is part of the lwIP TCP/IP stack. 41 | * 42 | * Author: Adam Dunkels 43 | * 44 | * $Id: fs.h,v 1.6.2.3 2003/10/07 13:22:27 adam Exp $ 45 | */ 46 | #ifndef __FS_H__ 47 | #define __FS_H__ 48 | 49 | #include "uip.h" 50 | 51 | /** 52 | * An open file in the read-only file system. 53 | */ 54 | struct fs_file { 55 | char *data; /**< The actual file data. */ 56 | int len; /**< The length of the file data. */ 57 | }; 58 | 59 | /** 60 | * Open a file in the read-only file system. 61 | * 62 | * \param name The name of the file. 63 | * 64 | * \param file The file pointer, which must be allocated by caller and 65 | * will be filled in by the function. 66 | */ 67 | int fs_open(const char *name, struct fs_file *file); 68 | 69 | #ifdef FS_STATISTICS 70 | #if FS_STATISTICS == 1 71 | u16_t fs_count(char *name); 72 | #endif /* FS_STATISTICS */ 73 | #endif /* FS_STATISTICS */ 74 | 75 | /** 76 | * Initialize the read-only file system. 77 | */ 78 | void fs_init(void); 79 | 80 | #endif /* __FS_H__ */ 81 | -------------------------------------------------------------------------------- /u-boot/include/linux/byteorder/little_endian.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H 2 | #define _LINUX_BYTEORDER_LITTLE_ENDIAN_H 3 | 4 | #ifndef __LITTLE_ENDIAN 5 | #define __LITTLE_ENDIAN 1234 6 | #endif 7 | #ifndef __LITTLE_ENDIAN_BITFIELD 8 | #define __LITTLE_ENDIAN_BITFIELD 9 | #endif 10 | #define __BYTE_ORDER __LITTLE_ENDIAN 11 | 12 | #include 13 | 14 | #define __constant_htonl(x) ___constant_swab32((x)) 15 | #define __constant_ntohl(x) ___constant_swab32((x)) 16 | #define __constant_htons(x) ___constant_swab16((x)) 17 | #define __constant_ntohs(x) ___constant_swab16((x)) 18 | #define __constant_cpu_to_le64(x) ((__u64)(x)) 19 | #define __constant_le64_to_cpu(x) ((__u64)(x)) 20 | #define __constant_cpu_to_le32(x) ((__u32)(x)) 21 | #define __constant_le32_to_cpu(x) ((__u32)(x)) 22 | #define __constant_cpu_to_le16(x) ((__u16)(x)) 23 | #define __constant_le16_to_cpu(x) ((__u16)(x)) 24 | #define __constant_cpu_to_be64(x) ___constant_swab64((x)) 25 | #define __constant_be64_to_cpu(x) ___constant_swab64((x)) 26 | #define __constant_cpu_to_be32(x) ___constant_swab32((x)) 27 | #define __constant_be32_to_cpu(x) ___constant_swab32((x)) 28 | #define __constant_cpu_to_be16(x) ___constant_swab16((x)) 29 | #define __constant_be16_to_cpu(x) ___constant_swab16((x)) 30 | #define __cpu_to_le64(x) ((__u64)(x)) 31 | #define __le64_to_cpu(x) ((__u64)(x)) 32 | #define __cpu_to_le32(x) ((__u32)(x)) 33 | #define __le32_to_cpu(x) ((__u32)(x)) 34 | #define __cpu_to_le16(x) ((__u16)(x)) 35 | #define __le16_to_cpu(x) ((__u16)(x)) 36 | #define __cpu_to_be64(x) __swab64((x)) 37 | #define __be64_to_cpu(x) __swab64((x)) 38 | #define __cpu_to_be32(x) __swab32((x)) 39 | #define __be32_to_cpu(x) __swab32((x)) 40 | #define __cpu_to_be16(x) __swab16((x)) 41 | #define __be16_to_cpu(x) __swab16((x)) 42 | #define __cpu_to_le64p(x) (*(__u64*)(x)) 43 | #define __le64_to_cpup(x) (*(__u64*)(x)) 44 | #define __cpu_to_le32p(x) (*(__u32*)(x)) 45 | #define __le32_to_cpup(x) (*(__u32*)(x)) 46 | #define __cpu_to_le16p(x) (*(__u16*)(x)) 47 | #define __le16_to_cpup(x) (*(__u16*)(x)) 48 | #define __cpu_to_be64p(x) __swab64p((x)) 49 | #define __be64_to_cpup(x) __swab64p((x)) 50 | #define __cpu_to_be32p(x) __swab32p((x)) 51 | #define __be32_to_cpup(x) __swab32p((x)) 52 | #define __cpu_to_be16p(x) __swab16p((x)) 53 | #define __be16_to_cpup(x) __swab16p((x)) 54 | #define __cpu_to_le64s(x) do {} while (0) 55 | #define __le64_to_cpus(x) do {} while (0) 56 | #define __cpu_to_le32s(x) do {} while (0) 57 | #define __le32_to_cpus(x) do {} while (0) 58 | #define __cpu_to_le16s(x) do {} while (0) 59 | #define __le16_to_cpus(x) do {} while (0) 60 | #define __cpu_to_be64s(x) __swab64s((x)) 61 | #define __be64_to_cpus(x) __swab64s((x)) 62 | #define __cpu_to_be32s(x) __swab32s((x)) 63 | #define __be32_to_cpus(x) __swab32s((x)) 64 | #define __cpu_to_be16s(x) __swab16s((x)) 65 | #define __be16_to_cpus(x) __swab16s((x)) 66 | 67 | #include 68 | 69 | #endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */ 70 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/common/qca-eth-953x_phy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Qualcomm Atheros, Inc. 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 | #ifndef _QCA_ETH_953x_PHY_H 24 | #define _QCA_ETH_953x_PHY_H 25 | #include 26 | 27 | 28 | #ifdef CONFIG_ATHR_8033_PHY 29 | extern int athrs_ar8033_reg_init(void *arg); 30 | extern int athrs_ar8033_phy_setup(void *arg); 31 | extern int athrs_ar8033_phy_is_fdx(int ethUnit); 32 | extern int athrs_ar8033_phy_is_link_alive(int phyUnit); 33 | extern int athrs_ar8033_phy_is_up(int ethUnit); 34 | extern int athrs_ar8033_phy_speed(int ethUnit,int phyUnit); 35 | #endif 36 | 37 | #ifdef CFG_ATHRS27_PHY 38 | extern int athrs27_phy_setup(int ethUnit); 39 | extern int athrs27_phy_is_up(int ethUnit); 40 | extern int athrs27_phy_is_fdx(int ethUnit); 41 | extern int athrs27_phy_speed(int ethUnit); 42 | #endif 43 | 44 | #ifdef CONFIG_ATHRS17_PHY 45 | extern int athrs17_phy_setup(int ethUnit); 46 | extern int athrs17_phy_is_up(int ethUnit); 47 | extern int athrs17_phy_is_fdx(int ethUnit); 48 | extern int athrs17_phy_speed(int ethUnit); 49 | #endif 50 | 51 | static inline void ath_gmac_phy_setup(int unit) 52 | { 53 | #ifdef CFG_ATHRS27_PHY 54 | athrs27_phy_setup(unit); 55 | #endif 56 | #ifdef CONFIG_VIR_PHY 57 | athr_vir_phy_setup(unit); 58 | #endif 59 | } 60 | 61 | static inline void ath_gmac_phy_link(int unit, int *link) 62 | { 63 | 64 | #ifdef CFG_ATHRS27_PHY 65 | *link = athrs27_phy_is_up(unit); 66 | #endif 67 | 68 | #ifdef CONFIG_VIR_PHY 69 | *link = athr_vir_phy_is_up(unit); 70 | #endif 71 | } 72 | 73 | static inline void ath_gmac_phy_duplex(int unit, int *duplex) 74 | { 75 | #ifdef CFG_ATHRS27_PHY 76 | *duplex = athrs27_phy_is_fdx(unit); 77 | #endif 78 | #ifdef CONFIG_VIR_PHY 79 | *duplex = athr_vir_phy_is_fdx(unit); 80 | #endif 81 | } 82 | 83 | static inline void ath_gmac_phy_speed(int unit, int *speed) 84 | { 85 | #ifdef CFG_ATHRS27_PHY 86 | *speed = athrs27_phy_speed(unit); 87 | #endif 88 | 89 | #ifdef CONFIG_VIR_PHY 90 | *speed = athr_vir_phy_speed(unit); 91 | #endif 92 | 93 | } 94 | 95 | #endif /* _QCA_ETH_953x_PHY_H */ 96 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/ar7240/qca_usb.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Piotr Dymacz 3 | * 4 | * SPDX-License-Identifier: GPL-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #if defined(CONFIG_USB) 13 | 14 | void usb_init(void) 15 | { 16 | #if (SOC_TYPE & QCA_QCA953X_SOC) |\ 17 | (SOC_TYPE & QCA_QCA956X_SOC) 18 | 19 | u32 val; 20 | 21 | /* Select REFCLK USB PLL input */ 22 | val = qca_soc_reg_read(QCA_PLL_SWITCH_CLK_CTRL_REG); 23 | val &= ~QCA_PLL_SWITCH_CLK_CTRL_USB_CLK_SEL_MASK; 24 | 25 | if (qca_xtal_is_40mhz()) 26 | val |= (QCA_PLL_SWITCH_CLK_CTRL_USB_CLK_SEL_40M_VAL 27 | << QCA_PLL_SWITCH_CLK_CTRL_USB_CLK_SEL_SHIFT); 28 | else 29 | val |= (QCA_PLL_SWITCH_CLK_CTRL_USB_CLK_SEL_25M_VAL 30 | << QCA_PLL_SWITCH_CLK_CTRL_USB_CLK_SEL_SHIFT); 31 | 32 | qca_soc_reg_write(QCA_PLL_SWITCH_CLK_CTRL_REG, val); 33 | udelay(1000); 34 | 35 | /* Take out USB PHY/HOST/PLL out of reset */ 36 | qca_soc_reg_read_set(QCA_RST_RESET_REG, 37 | QCA_RST_RESET_USB_PHY_SUSPEND_ORIDE_MASK); 38 | udelay(1000); 39 | 40 | qca_soc_reg_read_clear(QCA_RST_RESET_REG, 41 | QCA_RST_RESET_USB_PHY_ARST_MASK); 42 | udelay(1000); 43 | 44 | qca_soc_reg_read_clear(QCA_RST_RESET_REG, 45 | QCA_RST_RESET_USB_PHY_RST_MASK); 46 | udelay(1000); 47 | 48 | qca_soc_reg_read_clear(QCA_RST_RESET_REG, 49 | QCA_RST_RESET_USB_HOST_RST_MASK); 50 | udelay(1000); 51 | 52 | qca_soc_reg_read_clear(QCA_RST_RESET_REG, 53 | QCA_RST_RESET_USB_PHY_PLLPWD_EXT_MASK); 54 | udelay(10); 55 | #endif 56 | #if (SOC_TYPE & QCA_QCA956X_SOC) 57 | qca_soc_reg_read_set(QCA_RST_RESET2_REG, QCA_RST_RESET2_USB_EXT_PWR_SHIFT); 58 | udelay(10); 59 | 60 | qca_soc_reg_read_set(QCA_RST_RESET2_REG, QCA_RST_RESET2_USB2_MODE_DEV_MASK); 61 | udelay(10); 62 | qca_soc_reg_read_set(QCA_RST_RESET2_REG, QCA_RST_RESET2_USB2_PHY_SUSPEND_ORIDE_MASK); 63 | udelay(1000); 64 | qca_soc_reg_read_clear(QCA_RST_RESET2_REG, QCA_RST_RESET2_USB2_PHY_RST_MASK); 65 | udelay(1000); 66 | qca_soc_reg_read_clear(QCA_RST_RESET2_REG, QCA_RST_RESET2_USB2_PHY_ARST_MASK); 67 | udelay(1000); 68 | qca_soc_reg_read_clear(QCA_RST_RESET2_REG, QCA_RST_RESET2_USB2_HOST_RST_MASK); 69 | udelay(1000); 70 | 71 | qca_soc_reg_read_clear(QCA_RST_RESET2_REG, QCA_RST_RESET2_USB2_PHY_PLLPWD_EXT_MASK); 72 | udelay(10); 73 | 74 | qca_soc_reg_read_set(QCA_RST_RESET2_REG, QCA_RST_RESET2_USB2_EXT_PWR_MASK); 75 | udelay(10); 76 | #endif 77 | } 78 | #else /* defined(CONFIG_USB) */ 79 | void usb_init(void) 80 | { 81 | #if (SOC_TYPE & QCA_QCA956X_SOC) 82 | //turn off not support interface register 83 | 84 | qca_soc_reg_read_set(QCA_RST_RESET_REG, QCA_RST_RESET_USB_PHY_PLLPWD_EXT_MASK); 85 | qca_soc_reg_read_clear(QCA_RST_CLK_GAT_EN_REG, 86 | QCA_RST_CLK_GAT_EN_USB1_MASK | 87 | QCA_RST_CLK_GAT_EN_USB2_MASK); 88 | 89 | qca_soc_reg_read_set(QCA_RST_RESET2_REG, QCA_RST_RESET2_USB2_PHY_PLLPWD_EXT_MASK); 90 | 91 | #endif /* (SOC_TYPE & QCA_QCA956X_SOC) */ 92 | } 93 | #endif /* !defined(CONFIG_USB) */ 94 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/common/athr_ar8033_phy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Qualcomm Atheros, Inc. 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | #ifndef _ATHRS_8033_PHY_H 18 | #define _ATHRS_8033_PHY_H 19 | 20 | #define BOOL int 21 | 22 | 23 | /* Phy Specific status fields */ 24 | #define ATHER_STATUS_LINK_MASK 0xC000 25 | #define ATHER_STATUS_LINK_SHIFT 14 26 | #define ATHER_STATUS_FULL_DEPLEX 0x2000 27 | #define ATHR_STATUS_LINK_PASS 0x0400 28 | #define ATHR_LATCH_LINK_PASS 0x0004 29 | 30 | /* Advertisement register. */ 31 | #define ATHR_ADVERTISE_NEXT_PAGE 0x8000 32 | #define ATHR_ADVERTISE_ASYM_PAUSE 0x0800 33 | #define ATHR_ADVERTISE_PAUSE 0x0400 34 | #define ATHR_ADVERTISE_100FULL 0x0100 35 | #define ATHR_ADVERTISE_100HALF 0x0080 36 | #define ATHR_ADVERTISE_10FULL 0x0040 37 | #define ATHR_ADVERTISE_10HALF 0x0020 38 | 39 | #define ATHR_ADVERTISE_ALL (ATHR_ADVERTISE_ASYM_PAUSE | ATHR_ADVERTISE_PAUSE | \ 40 | ATHR_ADVERTISE_10HALF | ATHR_ADVERTISE_10FULL | \ 41 | ATHR_ADVERTISE_100HALF | ATHR_ADVERTISE_100FULL) 42 | 43 | 44 | #ifdef ATH_MDC_GPIO 45 | #define ATH_GPIO 14 46 | #define GPIO_FUNCTION4_MASK (GPIO_OUT_FUNCTION4_ENABLE_GPIO_19_MASK) 47 | 48 | #define GPIO_FUNCTION4_ENABLE (GPIO_OUT_FUNCTION4_ENABLE_GPIO_19_SET(0x20)) 49 | 50 | 51 | 52 | #else 53 | #define GPIO_FUNCTION4_MASK (GPIO_OUT_FUNCTION4_ENABLE_GPIO_19_MASK |\ 54 | GPIO_OUT_FUNCTION4_ENABLE_GPIO_17_MASK) 55 | 56 | #define GPIO_FUNCTION4_ENABLE (GPIO_OUT_FUNCTION4_ENABLE_GPIO_19_SET(0x20) | \ 57 | GPIO_OUT_FUNCTION4_ENABLE_GPIO_17_SET(0x21)) 58 | 59 | #define ATH_GPIO 19 60 | #endif 61 | 62 | #define ATH_GPIO17 17 63 | 64 | /* 65 | * Atheros header defines 66 | */ 67 | #ifndef _ATH_HEADER_CONF 68 | #define _ATH_HEADER_CONF 69 | 70 | 71 | 72 | #define ATHR_HEADER_LEN 2 73 | 74 | typedef enum { 75 | NORMAL_PACKET, 76 | RESERVED0, 77 | MIB_1ST, 78 | RESERVED1, 79 | RESERVED2, 80 | READ_WRITE_REG, 81 | READ_WRITE_REG_ACK, 82 | RESERVED3 83 | } AT_HEADER_TYPE; 84 | 85 | #endif // _ATH_HEADER_CONF 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /u-boot/httpd/minidhcpd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Minimal DHCP server for uIP 3 | * 4 | * Copyright (C) 2019 Vincent Wiemann 5 | * 6 | * SPDX-License-Identifier: GPL-2.0 7 | */ 8 | 9 | #ifndef __MINIDHCPD_H__ 10 | #define __MINIDHCPD_H__ 11 | 12 | 13 | 14 | #define ETH_ALEN 6 15 | #define DHCP_MSG_LEN 236 16 | #define DHCP_CHADDR_LEN 16 17 | 18 | #define DEBUG 1 19 | 20 | #define STATE_INITIAL 0 21 | #define STATE_SENDING 1 22 | #define STATE_DHCP_DISCOVER 2 23 | #define STATE_DHCP_REQUEST 3 24 | #define STATE_DHCP_RELEASE 4 25 | #define STATE_DHCP_DISCOVER_OVER 5 26 | 27 | #define MDHCPD_OPTION_CONSEC_ADDR 1 /* 0 = distributed/hashed IPs, 1 = consecutive */ 28 | 29 | 30 | typedef u16_t uip_ipaddr_t[2]; 31 | 32 | typedef struct { 33 | u8_t dest[ETH_ALEN]; 34 | u8_t src[ETH_ALEN]; 35 | u16_t type; 36 | } mdhcpd_eth_hdr_t; 37 | 38 | /* Holds the uIP UDP APP state */ 39 | typedef struct { 40 | char state; 41 | struct uip_udp_conn *conn; 42 | u16_t ticks; 43 | u8_t mac_addr[16]; 44 | int mac_len; 45 | } uip_udp_appstate_t; 46 | 47 | 48 | /*ADDITION*/ 49 | typedef struct dhcp_client dhcp_client_t; 50 | struct dhcp_client { 51 | u8_t state; 52 | u32 ipaddr; 53 | u8_t hwaddr[ETH_ALEN]; 54 | u8_t chaddr[DHCP_CHADDR_LEN]; 55 | struct dhcp_client *next; 56 | }; 57 | 58 | /* Holds all DHCP option's we're interested in */ 59 | struct dhcp_options { 60 | u8_t state; /* e.g. DHCP_REQUEST*/ 61 | u8_t options; /* 1=Unicast */ 62 | u8_t mac_addr[6]; /* MAC address of the client */ 63 | u32 xid; /* Transaction ID */ 64 | u32 serverid; /* ID of a server */ 65 | u32 leasetime; /* Lease time */ 66 | u32 ipaddr; /* IP address offered */ 67 | u32 netmask; /* Netmask */ 68 | u32 dnsaddr; /* DNS IP address */ 69 | u32 default_router; /* Default router */ 70 | }; 71 | 72 | /* Holds a minidhcpd instance */ 73 | typedef struct { 74 | uip_udp_appstate_t appstate; 75 | struct dhcp_options opt; 76 | u32 xid; 77 | u32 serverid; 78 | u32 leasetime; /* Lease time given to clients */ 79 | u32 ipaddr; /* IP address of the DHCP server */ 80 | u32 netmask; /* Netmask of the network */ 81 | u32 pool_start; /* Start address of the IP address lease pool */ 82 | u32 pool_end; /* End address of the IP address lease pool */ 83 | u32 dnsaddr; /* DNS server IP address given to clients */ 84 | u32 default_router; /* Default router given to clients */ 85 | u8_t hwaddr[ETH_ALEN]; /* Ethernet address of the DHCP server */ 86 | u8_t options; /* see definitions above */ 87 | u32 next_ipaddr; /* The next free IP address in consecutive mode */ 88 | u8_t bitmap_size; /* Size of the bitmap in bytes */ 89 | u8_t *pool_bitmap; /* Set bits in the map represent client entries */ 90 | dhcp_client_t *client_head; /* Pointer to the first client added */ 91 | } minidhcpd_instance_t; 92 | 93 | /* Initializes and configures the DHCP server */ 94 | int minidhcpd_init(void); 95 | 96 | /* Called by uIP whenever there is a new UDP packet */ 97 | void minidhcpd_udp_appcall(void); 98 | #define UIP_UDP_APPCALL minidhcpd_udp_appcall 99 | 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/common/athr_ar8033_phy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Qualcomm Atheros, Inc. 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "phy.h" 23 | #include 24 | #include 25 | #include "athr_ar8033_phy.h" 26 | 27 | int athr_ar8033_mgmt_init(int ethUnit) 28 | { 29 | return bb_miiphy_write(NULL, CONFIG_MII_PHY_ADDR, 0x00, 0x9000); 30 | } 31 | 32 | int athr_ar8033_phy_setup(int ethUnit) 33 | { 34 | return bb_miiphy_write(NULL, CONFIG_MII_PHY_ADDR, 0x00, 0x9000); 35 | } 36 | 37 | int athr_ar8033_phy_is_fdx(int ethUnit) 38 | { 39 | unsigned short phy_hw_status; 40 | bb_miiphy_read(NULL, CONFIG_MII_PHY_ADDR, 0x11, &phy_hw_status); 41 | 42 | if ((phy_hw_status & (1<<13))>>13 == 1) 43 | { 44 | printf("Checking Duplex: Full\n"); 45 | return 1; 46 | } 47 | printf("Checking Duplex: Half\n"); 48 | 49 | return 0; 50 | 51 | } 52 | 53 | 54 | int athr_ar8033_phy_is_up(int ethUnit) 55 | { 56 | unsigned short phy_hw_status; 57 | bb_miiphy_read(NULL, CONFIG_MII_PHY_ADDR, 0x11, &phy_hw_status); 58 | 59 | if ((phy_hw_status & (1<<10))>>10 == 1) 60 | { 61 | printf("Checking Link: Up\n"); 62 | return 1; 63 | } 64 | printf("Checking Link: Down\n"); 65 | return 0; 66 | } 67 | 68 | int athr_ar8033_phy_speed(int ethUnit) 69 | { 70 | unsigned short phy_hw_status = (3 << 14), speed; 71 | bb_miiphy_read(NULL, CONFIG_MII_PHY_ADDR, 0x11, &phy_hw_status); 72 | speed = (phy_hw_status & (3<<14)) >> 14; 73 | 74 | switch (speed) { 75 | case 0: 76 | printf("Checking Speed 10BaseT\n"); 77 | return _10BASET; 78 | break; 79 | case 1: 80 | printf("Checking Speed 100BaseT\n"); 81 | return _100BASET; 82 | break; 83 | case 2: 84 | printf("Checking Speed 1000BaseT\n"); 85 | return _1000BASET; 86 | break; 87 | default: 88 | printf("Checking Speed Unknown\n"); 89 | return -1; 90 | break; 91 | } 92 | 93 | return -1; 94 | } 95 | 96 | int athr_ar8033_reg_init(int ethUnit) 97 | { 98 | return athr_ar8033_mgmt_init(ethUnit); 99 | } 100 | -------------------------------------------------------------------------------- /u-boot/tools/envcrc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2001 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 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #ifndef __ASSEMBLY__ 30 | #define __ASSEMBLY__ /* Dirty trick to get only #defines */ 31 | #endif 32 | #define __ASM_STUB_PROCESSOR_H__ /* don't include asm/processor. */ 33 | #include 34 | #undef __ASSEMBLY__ 35 | 36 | #if defined(CFG_ENV_IS_IN_FLASH) 37 | # ifndef CFG_ENV_ADDR 38 | # define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_ENV_OFFSET) 39 | # endif 40 | # ifndef CFG_ENV_OFFSET 41 | # define CFG_ENV_OFFSET (CFG_ENV_ADDR - CFG_FLASH_BASE) 42 | # endif 43 | # if !defined(CFG_ENV_ADDR_REDUND) && defined(CFG_ENV_OFFSET_REDUND) 44 | # define CFG_ENV_ADDR_REDUND (CFG_FLASH_BASE + CFG_ENV_OFFSET_REDUND) 45 | # endif 46 | # ifndef CFG_ENV_SIZE 47 | # define CFG_ENV_SIZE CFG_ENV_SECT_SIZE 48 | # endif 49 | # if defined(CFG_ENV_ADDR_REDUND) && !defined(CFG_ENV_SIZE_REDUND) 50 | # define CFG_ENV_SIZE_REDUND CFG_ENV_SIZE 51 | # endif 52 | # if (CFG_ENV_ADDR >= CFG_MONITOR_BASE) && \ 53 | ((CFG_ENV_ADDR + CFG_ENV_SIZE) <= (CFG_MONITOR_BASE + CFG_MONITOR_LEN)) 54 | # define ENV_IS_EMBEDDED 1 55 | # endif 56 | # if defined(CFG_ENV_ADDR_REDUND) || defined(CFG_ENV_OFFSET_REDUND) 57 | # define CFG_REDUNDAND_ENVIRONMENT 1 58 | # endif 59 | #endif /* CFG_ENV_IS_IN_FLASH */ 60 | 61 | #ifdef CFG_REDUNDAND_ENVIRONMENT 62 | # define ENV_HEADER_SIZE (sizeof(unsigned long) + 1) 63 | #else 64 | # define ENV_HEADER_SIZE (sizeof(unsigned long)) 65 | #endif 66 | 67 | #define ENV_SIZE (CFG_ENV_SIZE - ENV_HEADER_SIZE) 68 | 69 | 70 | #ifdef ENV_IS_EMBEDDED 71 | extern unsigned int env_size; 72 | extern unsigned char environment; 73 | #endif /* ENV_IS_EMBEDDED */ 74 | 75 | int main (int argc, char **argv) 76 | { 77 | #ifdef ENV_IS_EMBEDDED 78 | int crc; 79 | unsigned char *envptr = &environment, 80 | *dataptr = envptr + ENV_HEADER_SIZE; 81 | unsigned int datasize = ENV_SIZE; 82 | 83 | crc = tinf_crc32 (dataptr, datasize); 84 | 85 | /* Check if verbose mode is activated passing a parameter to the program */ 86 | if (argc > 1) { 87 | printf ("CRC32 from offset %08X to %08X of environment = %08X\n", 88 | (unsigned int) (dataptr - envptr), 89 | (unsigned int) (dataptr - envptr) + datasize, 90 | crc); 91 | } else { 92 | printf ("0x%08X\n", crc); 93 | } 94 | #else 95 | printf ("0\n"); 96 | #endif 97 | return EXIT_SUCCESS; 98 | } 99 | -------------------------------------------------------------------------------- /u-boot/include/linux/types.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_TYPES_H 2 | #define _LINUX_TYPES_H 3 | 4 | #ifdef __KERNEL__ 5 | #include 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | #ifndef __KERNEL_STRICT_NAMES 12 | 13 | typedef __kernel_fd_set fd_set; 14 | typedef __kernel_dev_t dev_t; 15 | typedef __kernel_ino_t ino_t; 16 | typedef __kernel_mode_t mode_t; 17 | typedef __kernel_nlink_t nlink_t; 18 | typedef __kernel_off_t off_t; 19 | typedef __kernel_pid_t pid_t; 20 | typedef __kernel_daddr_t daddr_t; 21 | typedef __kernel_key_t key_t; 22 | typedef __kernel_suseconds_t suseconds_t; 23 | 24 | #ifdef __KERNEL__ 25 | typedef __kernel_uid32_t uid_t; 26 | typedef __kernel_gid32_t gid_t; 27 | typedef __kernel_uid16_t uid16_t; 28 | typedef __kernel_gid16_t gid16_t; 29 | 30 | #ifdef CONFIG_UID16 31 | /* This is defined by include/asm-{arch}/posix_types.h */ 32 | typedef __kernel_old_uid_t old_uid_t; 33 | typedef __kernel_old_gid_t old_gid_t; 34 | #endif /* CONFIG_UID16 */ 35 | 36 | /* libc5 includes this file to define uid_t, thus uid_t can never change 37 | * when it is included by non-kernel code 38 | */ 39 | #else 40 | typedef __kernel_uid_t uid_t; 41 | typedef __kernel_gid_t gid_t; 42 | #endif /* __KERNEL__ */ 43 | 44 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 45 | typedef __kernel_loff_t loff_t; 46 | #endif 47 | 48 | /* 49 | * The following typedefs are also protected by individual ifdefs for 50 | * historical reasons: 51 | */ 52 | #ifndef _SIZE_T 53 | #define _SIZE_T 54 | typedef __kernel_size_t size_t; 55 | #endif 56 | 57 | #ifndef _SSIZE_T 58 | #define _SSIZE_T 59 | typedef __kernel_ssize_t ssize_t; 60 | #endif 61 | 62 | #ifndef _PTRDIFF_T 63 | #define _PTRDIFF_T 64 | typedef __kernel_ptrdiff_t ptrdiff_t; 65 | #endif 66 | 67 | #ifndef _TIME_T 68 | #define _TIME_T 69 | typedef __kernel_time_t time_t; 70 | #endif 71 | 72 | #ifndef _CLOCK_T 73 | #define _CLOCK_T 74 | typedef __kernel_clock_t clock_t; 75 | #endif 76 | 77 | #ifndef _CADDR_T 78 | #define _CADDR_T 79 | typedef __kernel_caddr_t caddr_t; 80 | #endif 81 | 82 | /* bsd */ 83 | typedef unsigned char u_char; 84 | typedef unsigned short u_short; 85 | typedef unsigned int u_int; 86 | typedef unsigned long u_long; 87 | 88 | /* sysv */ 89 | typedef unsigned char unchar; 90 | typedef unsigned short ushort; 91 | typedef unsigned int uint; 92 | typedef unsigned long ulong; 93 | 94 | #ifndef __BIT_TYPES_DEFINED__ 95 | #define __BIT_TYPES_DEFINED__ 96 | 97 | typedef __u8 u_int8_t; 98 | typedef __s8 int8_t; 99 | typedef __u16 u_int16_t; 100 | typedef __s16 int16_t; 101 | typedef __u32 u_int32_t; 102 | typedef __s32 int32_t; 103 | 104 | #endif /* !(__BIT_TYPES_DEFINED__) */ 105 | 106 | typedef __u8 uint8_t; 107 | typedef __u16 uint16_t; 108 | typedef __u32 uint32_t; 109 | 110 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 111 | typedef __u64 uint64_t; 112 | typedef __u64 u_int64_t; 113 | typedef __s64 int64_t; 114 | #endif 115 | 116 | #endif /* __KERNEL_STRICT_NAMES */ 117 | 118 | /* 119 | * Below are truly Linux-specific types that should never collide with 120 | * any application/library that wants linux/types.h. 121 | */ 122 | 123 | struct ustat { 124 | __kernel_daddr_t f_tfree; 125 | __kernel_ino_t f_tinode; 126 | char f_fname[6]; 127 | char f_fpack[6]; 128 | }; 129 | 130 | #endif /* _LINUX_TYPES_H */ 131 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/common/athrs17_phy.h: -------------------------------------------------------------------------------- 1 | #ifndef _ATHRS17_PHY_H 2 | #define _ATHRS17_PHY_H 3 | 4 | /*****************/ 5 | /* PHY Registers */ 6 | /*****************/ 7 | #define ATHR_PHY_CONTROL 0 8 | #define ATHR_PHY_STATUS 1 9 | #define ATHR_PHY_ID1 2 10 | #define ATHR_PHY_ID2 3 11 | #define ATHR_AUTONEG_ADVERT 4 12 | #define ATHR_LINK_PARTNER_ABILITY 5 13 | #define ATHR_AUTONEG_EXPANSION 6 14 | #define ATHR_NEXT_PAGE_TRANSMIT 7 15 | #define ATHR_LINK_PARTNER_NEXT_PAGE 8 16 | #define ATHR_1000BASET_CONTROL 9 17 | #define ATHR_1000BASET_STATUS 10 18 | #define ATHR_PHY_SPEC_CONTROL 16 19 | #define ATHR_PHY_SPEC_STATUS 17 20 | #define ATHR_DEBUG_PORT_ADDRESS 29 21 | #define ATHR_DEBUG_PORT_DATA 30 22 | 23 | /* ATHR_PHY_CONTROL fields */ 24 | #define ATHR_CTRL_SOFTWARE_RESET 0x8000 25 | #define ATHR_CTRL_SPEED_LSB 0x2000 26 | #define ATHR_CTRL_AUTONEGOTIATION_ENABLE 0x1000 27 | #define ATHR_CTRL_RESTART_AUTONEGOTIATION 0x0200 28 | #define ATHR_CTRL_SPEED_FULL_DUPLEX 0x0100 29 | #define ATHR_CTRL_SPEED_MSB 0x0040 30 | 31 | #define ATHR_RESET_DONE(phy_control) (((phy_control) & (ATHR_CTRL_SOFTWARE_RESET)) == 0) 32 | 33 | /* Phy status fields */ 34 | #define ATHR_STATUS_AUTO_NEG_DONE 0x0020 35 | #define ATHR_AUTONEG_DONE(ip_phy_status) (((ip_phy_status) & (ATHR_STATUS_AUTO_NEG_DONE)) == (ATHR_STATUS_AUTO_NEG_DONE)) 36 | 37 | /* Link Partner ability */ 38 | #define ATHR_LINK_100BASETX_FULL_DUPLEX 0x0100 39 | #define ATHR_LINK_100BASETX 0x0080 40 | #define ATHR_LINK_10BASETX_FULL_DUPLEX 0x0040 41 | #define ATHR_LINK_10BASETX 0x0020 42 | 43 | /* Advertisement register. */ 44 | #define ATHR_ADVERTISE_NEXT_PAGE 0x8000 45 | #define ATHR_ADVERTISE_ASYM_PAUSE 0x0800 46 | #define ATHR_ADVERTISE_PAUSE 0x0400 47 | #define ATHR_ADVERTISE_100FULL 0x0100 48 | #define ATHR_ADVERTISE_100HALF 0x0080 49 | #define ATHR_ADVERTISE_10FULL 0x0040 50 | #define ATHR_ADVERTISE_10HALF 0x0020 51 | 52 | #define ATHR_ADVERTISE_ALL (ATHR_ADVERTISE_ASYM_PAUSE | ATHR_ADVERTISE_PAUSE | \ 53 | ATHR_ADVERTISE_10HALF | ATHR_ADVERTISE_10FULL | \ 54 | ATHR_ADVERTISE_100HALF | ATHR_ADVERTISE_100FULL) 55 | 56 | /* 1000BASET_CONTROL */ 57 | #define ATHR_ADVERTISE_1000FULL 0x0200 58 | 59 | /* Phy Specific status fields */ 60 | #define ATHER_STATUS_LINK_MASK 0xC000 61 | #define ATHER_STATUS_LINK_SHIFT 14 62 | #define ATHER_STATUS_FULL_DEPLEX 0x2000 63 | #define ATHR_STATUS_LINK_PASS 0x0400 64 | #define ATHR_STATUS_RESOVLED 0x0800 65 | 66 | /*phy debug port register */ 67 | #define ATHER_DEBUG_SERDES_REG 5 68 | 69 | /* Serdes debug fields */ 70 | #define ATHER_SERDES_BEACON 0x0100 71 | 72 | /* S17 CSR Registers */ 73 | #define S17_ENABLE_CPU_BROADCAST BIT(26) 74 | #define S17_PHY_LINK_CHANGE_REG 0x4 75 | #define S17_PHY_LINK_UP 0x400 76 | #define S17_PHY_LINK_DOWN 0x800 77 | #define S17_PHY_LINK_DUPLEX_CHANGE 0x2000 78 | #define S17_PHY_LINK_SPEED_CHANGE 0x4000 79 | #define S17_PHY_LINK_INTRS (PHY_LINK_UP | PHY_LINK_DOWN | PHY_LINK_DUPLEX_CHANGE | PHY_LINK_SPEED_CHANGE) 80 | 81 | #ifdef CONFIG_AR7242_S17_PHY 82 | #undef HEADER_REG_CONF 83 | #undef HEADER_EN 84 | #endif 85 | 86 | void athrs17_reg_init(void); 87 | int athrs17_phy_is_up(int unit); 88 | int athrs17_phy_is_fdx(int unit); 89 | int athrs17_phy_speed(int unit); 90 | int athrs17_phy_setup(int unit); 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /u-boot/include/xyzModem.h: -------------------------------------------------------------------------------- 1 | /* 2 | *========================================================================== 3 | * 4 | * xyzModem.h 5 | * 6 | * RedBoot stream handler for xyzModem protocol 7 | * 8 | *========================================================================== 9 | *####ECOSGPLCOPYRIGHTBEGIN#### 10 | * ------------------------------------------- 11 | * This file is part of eCos, the Embedded Configurable Operating System. 12 | * Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. 13 | * Copyright (C) 2002 Gary Thomas 14 | * 15 | * eCos is free software; you can redistribute it and/or modify it under 16 | * the terms of the GNU General Public License as published by the Free 17 | * Software Foundation; either version 2 or (at your option) any later version. 18 | * 19 | * eCos is distributed in the hope that it will be useful, but WITHOUT ANY 20 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or 21 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | * for more details. 23 | * 24 | * You should have received a copy of the GNU General Public License along 25 | * with eCos; if not, write to the Free Software Foundation, Inc., 26 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 27 | * 28 | * As a special exception, if other files instantiate templates or use macros 29 | * or inline functions from this file, or you compile this file and link it 30 | * with other works to produce a work based on this file, this file does not 31 | * by itself cause the resulting work to be covered by the GNU General Public 32 | * License. However the source code for this file must still be made available 33 | * in accordance with section (3) of the GNU General Public License. 34 | * 35 | * This exception does not invalidate any other reasons why a work based on 36 | * this file might be covered by the GNU General Public License. 37 | * 38 | * Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. 39 | * at http: *sources.redhat.com/ecos/ecos-license/ 40 | * ------------------------------------------- 41 | *####ECOSGPLCOPYRIGHTEND#### 42 | *========================================================================== 43 | *#####DESCRIPTIONBEGIN#### 44 | * 45 | * Author(s): gthomas 46 | * Contributors: gthomas 47 | * Date: 2000-07-14 48 | * Purpose: 49 | * Description: 50 | * 51 | * This code is part of RedBoot (tm). 52 | * 53 | *####DESCRIPTIONEND#### 54 | * 55 | *========================================================================== 56 | */ 57 | 58 | #ifndef _XYZMODEM_H_ 59 | #define _XYZMODEM_H_ 60 | 61 | #define xyzModem_xmodem 1 62 | #define xyzModem_ymodem 2 63 | /* Don't define this until the protocol support is in place */ 64 | /*#define xyzModem_zmodem 3 */ 65 | 66 | #define xyzModem_access -1 67 | #define xyzModem_noZmodem -2 68 | #define xyzModem_timeout -3 69 | #define xyzModem_eof -4 70 | #define xyzModem_cancel -5 71 | #define xyzModem_frame -6 72 | #define xyzModem_cksum -7 73 | #define xyzModem_sequence -8 74 | 75 | #define xyzModem_close 1 76 | #define xyzModem_abort 2 77 | 78 | typedef struct { 79 | char *filename; 80 | int mode; 81 | int chan; 82 | } connection_info_t; 83 | 84 | int xyzModem_stream_open(connection_info_t *info, int *err); 85 | void xyzModem_stream_close(int *err); 86 | void xyzModem_stream_terminate(unsigned int method, int (*getc)(void)); 87 | int xyzModem_stream_read(char *buf, int size, int *err); 88 | char *xyzModem_error(int err); 89 | 90 | #endif /* _XYZMODEM_H_ */ 91 | -------------------------------------------------------------------------------- /u-boot/net/rarp.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 | #include 26 | #include 27 | #include "nfs.h" 28 | #include "bootp.h" 29 | #include "rarp.h" 30 | #include "tftp.h" 31 | 32 | #if defined(CONFIG_CMD_NET) 33 | 34 | DECLARE_GLOBAL_DATA_PTR; 35 | 36 | #define TIMEOUT 5 /* Seconds before trying BOOTP again */ 37 | 38 | #if !defined(CONFIG_NET_RETRY_COUNT) 39 | /* # of timeouts before giving up */ 40 | #define TIMEOUT_COUNT 5 41 | #else 42 | #define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT) 43 | #endif 44 | 45 | int RarpTry; 46 | 47 | /* Handle a RARP received packet */ 48 | static void RarpHandler(uchar *dummi0, 49 | unsigned dummi1, 50 | unsigned dummi2, 51 | unsigned dummi3) 52 | { 53 | char *s; 54 | 55 | #if defined(DEBUG) 56 | puts ("Got good RARP\n"); 57 | #endif 58 | 59 | if ((s = getenv("autoload")) != NULL) { 60 | if (*s == 'n') { 61 | /* 62 | * Just use RARP to configure system; 63 | * Do not use TFTP/NFS to to load the bootfile. 64 | */ 65 | NetState = NETLOOP_SUCCESS; 66 | return; 67 | #if defined(CONFIG_CMD_NFS) 68 | } else if ((s != NULL) && !strcmp(s, "NFS")) { 69 | NfsStart(); 70 | return; 71 | #endif 72 | } 73 | } 74 | 75 | TftpStart(TFTPGET); 76 | } 77 | 78 | /* Timeout on BOOTP request */ 79 | static void RarpTimeout(void) 80 | { 81 | bd_t *bd = gd->bd; 82 | 83 | if (RarpTry >= TIMEOUT_COUNT) { 84 | puts("\nRetry count exceeded; starting again\n"); 85 | NetStartAgain(); 86 | } else { 87 | NetSetTimeout(TIMEOUT * CFG_HZ, RarpTimeout); 88 | RarpRequest(); 89 | } 90 | } 91 | 92 | void RarpRequest(void) 93 | { 94 | int i; 95 | ARP_t *rarp; 96 | bd_t *bd = gd->bd; 97 | volatile uchar *pkt; 98 | 99 | printf("RARP broadcast %d\n", ++RarpTry); 100 | pkt = NetTxPacket; 101 | 102 | pkt += NetSetEther(pkt, NetBcastAddr, PROT_RARP); 103 | 104 | rarp = (ARP_t *)pkt; 105 | 106 | rarp->ar_hrd = htons(ARP_ETHER); 107 | rarp->ar_pro = htons(PROT_IP); 108 | rarp->ar_hln = 6; 109 | rarp->ar_pln = 4; 110 | rarp->ar_op = htons(RARPOP_REQUEST); 111 | 112 | memcpy(&rarp->ar_data[0], NetOurEther, 6); /* source ET addr */ 113 | memcpy(&rarp->ar_data[6], &NetOurIP, 4); /* source IP addr */ 114 | memcpy(&rarp->ar_data[10], NetOurEther, 6); /* dest ET addr = source ET addr ??*/ 115 | 116 | /* Dest. IP addr set to broadcast */ 117 | for (i = 0; i <= 3; i++) 118 | rarp->ar_data[16 + i] = 0xff; 119 | 120 | NetSendPacket(NetTxPacket, (pkt - NetTxPacket) + ARP_HDR_SIZE); 121 | 122 | NetSetTimeout(TIMEOUT * CFG_HZ, RarpTimeout); 123 | NetSetHandler(RarpHandler); 124 | } 125 | #endif /* CONFIG_CMD_NET */ 126 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/common/athrs_vir_phy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Qualcomm Atheros, Inc. 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include "phy.h" 22 | #include 23 | #include 24 | 25 | #define MODULE_NAME "ATHRS_VIR_PHY" 26 | 27 | #define TRUE 1 28 | #define FALSE 0 29 | #define BOOL int 30 | 31 | /* Forward references */ 32 | BOOL athr_vir_phy_is_link_alive(int phyUnit); 33 | 34 | 35 | /****************************************************************************** 36 | * 37 | * athr_vir_phy_is_link_alive - test to see if the specified link is alive 38 | * 39 | * RETURNS: 40 | * TRUE --> link is alive 41 | * FALSE --> link is down 42 | */ 43 | BOOL 44 | athr_vir_phy_is_link_alive(int phyUnit) 45 | { 46 | return TRUE; 47 | } 48 | 49 | /****************************************************************************** 50 | * 51 | * athr_vir_phy_setup - reset and setup the PHY associated with 52 | * the specified MAC unit number. 53 | * 54 | * Resets the associated PHY port. 55 | * 56 | * RETURNS: 57 | * TRUE --> associated PHY is alive 58 | * FALSE --> no LINKs on this ethernet unit 59 | */ 60 | 61 | BOOL 62 | athr_vir_phy_setup(int ethUnit) 63 | { 64 | return 0; 65 | } 66 | 67 | /****************************************************************************** 68 | * 69 | * athr_vir_phy_is_fdx - Determines whether the phy ports associated with the 70 | * specified device are FULL or HALF duplex. 71 | * 72 | * RETURNS: 73 | * 1 --> FULL 74 | * 0 --> HALF 75 | */ 76 | int 77 | athr_vir_phy_is_fdx(int ethUnit,int phyUnit) 78 | { 79 | return TRUE; 80 | } 81 | 82 | /****************************************************************************** 83 | * 84 | * athr_vir_phy_speed - Determines the speed of phy ports associated with the 85 | * specified device. 86 | * 87 | * RETURNS: 88 | * AG7240_PHY_SPEED_10T, AG7240_PHY_SPEED_100T; 89 | * AG7240_PHY_SPEED_1000T; 90 | */ 91 | 92 | int 93 | athr_vir_phy_speed(int ethUnit,int phyUnit) 94 | { 95 | return _1000BASET; 96 | } 97 | 98 | /***************************************************************************** 99 | * 100 | * athr_vir_phy_is_up -- checks for significant changes in PHY state. 101 | * 102 | * A "significant change" is: 103 | * dropped link (e.g. ethernet cable unplugged) OR 104 | * autonegotiation completed + link (e.g. ethernet cable plugged in) 105 | * 106 | * When a PHY is plugged in, phyLinkGained is called. 107 | * When a PHY is unplugged, phyLinkLost is called. 108 | */ 109 | 110 | int 111 | athr_vir_phy_is_up(int ethUnit) 112 | { 113 | return 1; 114 | 115 | } 116 | /* Place holders */ 117 | 118 | int 119 | athr_vir_reg_init(void *arg) 120 | { 121 | return 0; 122 | } 123 | 124 | -------------------------------------------------------------------------------- /u-boot/include/devices.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 | #include 25 | 26 | #ifndef _DEVICES_H_ 27 | #define _DEVICES_H_ 28 | 29 | /* 30 | * CONSOLE DEVICES 31 | */ 32 | 33 | #define DEV_FLAGS_INPUT 0x00000001 /* Device can be used as input console */ 34 | #define DEV_FLAGS_OUTPUT 0x00000002 /* Device can be used as output console */ 35 | #define DEV_FLAGS_SYSTEM 0x80000000 /* Device is a system device */ 36 | #define DEV_EXT_VIDEO 0x00000001 /* Video extensions supported */ 37 | 38 | /* Device information */ 39 | typedef struct { 40 | int flags; /* Device flags: input/output/system */ 41 | int ext; /* Supported extensions */ 42 | char name[16]; /* Device name */ 43 | 44 | /* GENERAL functions */ 45 | 46 | int (*start) (void); /* To start the device */ 47 | int (*stop) (void); /* To stop the device */ 48 | 49 | /* OUTPUT functions */ 50 | 51 | void (*putc) (const char c); /* To put a char */ 52 | void (*puts) (const char *s); /* To put a string (accelerator) */ 53 | 54 | /* INPUT functions */ 55 | 56 | int (*tstc) (void); /* To test if a char is ready... */ 57 | int (*getc) (void); /* To get that char */ 58 | 59 | /* Other functions */ 60 | 61 | void *priv; /* Private extensions */ 62 | } device_t; 63 | 64 | /* 65 | * VIDEO EXTENSIONS 66 | */ 67 | #define VIDEO_FORMAT_RGB_INDEXED 0x0000 68 | #define VIDEO_FORMAT_RGB_DIRECTCOLOR 0x0001 69 | #define VIDEO_FORMAT_YUYV_4_4_4 0x0010 70 | #define VIDEO_FORMAT_YUYV_4_2_2 0x0011 71 | 72 | typedef struct { 73 | void *address; /* Address of framebuffer */ 74 | ushort width; /* Horizontal resolution */ 75 | ushort height; /* Vertical resolution */ 76 | uchar format; /* Format */ 77 | uchar colors; /* Colors number or color depth */ 78 | void (*setcolreg) (int, int, int, int); 79 | void (*getcolreg) (int, void *); 80 | } video_ext_t; 81 | 82 | /* 83 | * VARIABLES 84 | */ 85 | extern list_t devlist; 86 | extern device_t *stdio_devices[]; 87 | extern char *stdio_names[MAX_FILES]; 88 | 89 | /* 90 | * PROTOTYPES 91 | */ 92 | int device_register (device_t * dev); 93 | int devices_init (void); 94 | int devices_done (void); 95 | int device_deregister(char *devname); 96 | #ifdef CONFIG_LCD 97 | int drv_lcd_init (void); 98 | #endif 99 | #ifdef CONFIG_VFD 100 | int drv_vfd_init (void); 101 | #endif 102 | #if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE) 103 | int drv_video_init (void); 104 | #endif 105 | #ifdef CONFIG_KEYBOARD 106 | int drv_keyboard_init (void); 107 | #endif 108 | #ifdef CONFIG_USB_TTY 109 | int drv_usbtty_init (void); 110 | #endif 111 | #ifdef CONFIG_NETCONSOLE 112 | int drv_nc_init (void); 113 | #endif 114 | 115 | #endif /* _DEVICES_H_ */ 116 | -------------------------------------------------------------------------------- /u-boot/include/crc.h: -------------------------------------------------------------------------------- 1 | //========================================================================== 2 | // 3 | // crc.h 4 | // 5 | // Interface for the CRC algorithms. 6 | // 7 | //========================================================================== 8 | //####ECOSGPLCOPYRIGHTBEGIN#### 9 | // ------------------------------------------- 10 | // This file is part of eCos, the Embedded Configurable Operating System. 11 | // Copyright (C) 2002 Andrew Lunn 12 | // 13 | // eCos is free software; you can redistribute it and/or modify it under 14 | // the terms of the GNU General Public License as published by the Free 15 | // Software Foundation; either version 2 or (at your option) any later version. 16 | // 17 | // eCos is distributed in the hope that it will be useful, but WITHOUT ANY 18 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or 19 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 20 | // for more details. 21 | // 22 | // You should have received a copy of the GNU General Public License along 23 | // with eCos; if not, write to the Free Software Foundation, Inc., 24 | // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 25 | // 26 | // As a special exception, if other files instantiate templates or use macros 27 | // or inline functions from this file, or you compile this file and link it 28 | // with other works to produce a work based on this file, this file does not 29 | // by itself cause the resulting work to be covered by the GNU General Public 30 | // License. However the source code for this file must still be made available 31 | // in accordance with section (3) of the GNU General Public License. 32 | // 33 | // This exception does not invalidate any other reasons why a work based on 34 | // this file might be covered by the GNU General Public License. 35 | // 36 | // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. 37 | // at http://sources.redhat.com/ecos/ecos-license/ 38 | // ------------------------------------------- 39 | //####ECOSGPLCOPYRIGHTEND#### 40 | //========================================================================== 41 | //#####DESCRIPTIONBEGIN#### 42 | // 43 | // Author(s): Andrew Lunn 44 | // Contributors: Andrew Lunn 45 | // Date: 2002-08-06 46 | // Purpose: 47 | // Description: 48 | // 49 | // This code is part of eCos (tm). 50 | // 51 | //####DESCRIPTIONEND#### 52 | // 53 | //========================================================================== 54 | 55 | #ifndef _SERVICES_CRC_CRC_H_ 56 | #define _SERVICES_CRC_CRC_H_ 57 | 58 | #include 59 | 60 | #ifndef __externC 61 | # ifdef __cplusplus 62 | # define __externC extern "C" 63 | # else 64 | # define __externC extern 65 | # endif 66 | #endif 67 | 68 | // Compute a CRC, using the POSIX 1003 definition 69 | extern uint32_t 70 | cyg_posix_crc32(unsigned char *s, int len); 71 | 72 | // Gary S. Brown's 32 bit CRC 73 | 74 | extern uint32_t 75 | cyg_crc32(unsigned char *s, int len); 76 | 77 | // Gary S. Brown's 32 bit CRC, but accumulate the result from a 78 | // previous CRC calculation 79 | 80 | extern uint32_t 81 | cyg_crc32_accumulate(uint32_t crc, unsigned char *s, int len); 82 | 83 | // Ethernet FCS Algorithm 84 | 85 | extern uint32_t 86 | cyg_ether_crc32(unsigned char *s, int len); 87 | 88 | // Ethernet FCS algorithm, but accumulate the result from a previous 89 | // CRC calculation. 90 | 91 | extern uint32_t 92 | cyg_ether_crc32_accumulate(uint32_t crc, unsigned char *s, int len); 93 | 94 | // 16 bit CRC with polynomial x^16+x^12+x^5+1 95 | 96 | extern uint16_t cyg_crc16(unsigned char *s, int len); 97 | 98 | #endif // _SERVICES_CRC_CRC_H_ 99 | 100 | 101 | 102 | --------------------------------------------------------------------------------