├── u-boot ├── tools │ ├── .gitignore │ ├── updater │ │ ├── dummy.c │ │ ├── junk │ │ └── update.c │ ├── logos │ │ └── denx.bmp │ ├── env │ │ ├── fw_env.config │ │ ├── Makefile │ │ ├── README │ │ └── fw_env.h │ ├── scripts │ │ ├── send_cmd │ │ ├── send_image │ │ ├── dot.kermrc │ │ ├── flash_param │ │ └── README │ ├── setlocalversion │ ├── inca-swap-bytes.c │ ├── ncb.c │ ├── gdb │ │ ├── error.h │ │ ├── remote.h │ │ ├── serial.h │ │ ├── Makefile │ │ └── error.c │ ├── Makefile.win32 │ └── gen_eth_addr.c ├── CREDITS ├── CHANGELOG ├── MAINTAINERS ├── fs │ ├── fdos │ │ ├── fs.c │ │ ├── dev.c │ │ ├── dos.h │ │ ├── fat.c │ │ ├── fdos.c │ │ ├── fdos.h │ │ ├── vfat.c │ │ ├── Makefile │ │ └── subdir.c │ ├── Makefile │ ├── fat │ │ └── Makefile │ ├── ext2 │ │ └── Makefile │ ├── cramfs │ │ └── Makefile │ ├── reiserfs │ │ └── Makefile │ └── jffs2 │ │ ├── Makefile │ │ └── compr_zlib.c ├── drivers │ ├── sm501.c │ ├── ali512x.c │ ├── ct69000.c │ ├── sed13806.c │ ├── ti_pci1410a.c │ ├── usb │ │ └── host │ │ │ ├── ohci-da8xx.c │ │ │ ├── ehci-ppc4xx.c │ │ │ ├── ehci-vct.c │ │ │ ├── ehci-ixp4xx.c │ │ │ ├── ehci-spear.c │ │ │ ├── ehci-armada100.c │ │ │ ├── ehci-ar9331.c │ │ │ ├── ehci-atmel.c │ │ │ ├── Makefile │ │ │ └── utmi-armada100.c │ ├── Makefile │ ├── netarm_eth.h │ ├── ns16550.c │ ├── 5701rls.c │ └── usbtty.h ├── include │ ├── fdc.h │ ├── linux │ │ ├── mtd │ │ │ ├── mtd.h │ │ │ └── compat.h │ │ ├── config.h │ │ ├── stddef.h │ │ ├── compiler-gcc3.h │ │ ├── posix_types.h │ │ ├── unaligned │ │ │ ├── access_ok.h │ │ │ ├── be_byteshift.h │ │ │ └── le_byteshift.h │ │ ├── ctype.h │ │ └── bitops.h │ ├── asm-mips │ │ ├── inca-ip.h │ │ ├── isadep.h │ │ ├── cachectl.h │ │ ├── byteorder.h │ │ ├── unaligned.h │ │ ├── sgidefs.h │ │ ├── cacheops.h │ │ ├── regdef.h │ │ ├── reg.h │ │ ├── mmc.h │ │ ├── types.h │ │ └── u-boot.h │ ├── spd_sdram.h │ ├── errno.h │ ├── jffs2 │ │ ├── jffs2_1pass.h │ │ └── compr_rubin.h │ ├── mii_phy.h │ ├── cramfs │ │ └── cramfs_fs_sb.h │ ├── _exports.h │ ├── g_dnl.h │ ├── asm-generic │ │ ├── unaligned.h │ │ └── global_data_flags.h │ ├── keyboard.h │ ├── usb_cdc_acm.h │ ├── serial.h │ ├── version.h │ ├── exports.h │ ├── usb_mass_storage.h │ ├── usb │ │ ├── musb_udc.h │ │ ├── lin_gadget_compat.h │ │ └── pxa27x_udc.h │ ├── mmc.h │ ├── console.h │ ├── sandboxfs.h │ ├── usbdcore_ep0.h │ ├── hush.h │ ├── ppc4xx.h │ ├── LzmaWrapper.h │ ├── logbuff.h │ ├── circbuf.h │ ├── nand.h │ ├── ide.h │ ├── rtc.h │ ├── ioports.h │ ├── usb_ether.h │ ├── kgdb.h │ └── mk48t59.h ├── common │ ├── cmd_fdos.c │ ├── exports.c │ ├── cmd_mmc.c │ ├── cmd_usb_mass_storage.c │ ├── cmd_dtt.c │ ├── env_nowhere.c │ ├── cmd_misc.c │ ├── cmd_console.c │ └── lynxkdi.c ├── rtc │ ├── s3c24x0_rtc.c │ └── Makefile ├── .gitignore ├── board │ └── ar7240 │ │ ├── carambola2 │ │ ├── config.mk │ │ ├── Makefile │ │ ├── u-boot.lds │ │ ├── flash.c │ │ ├── carambola_factory.c │ │ └── u-boot-bootstrap.lds │ │ └── common │ │ ├── phy.h │ │ └── ar7240_flash.h ├── net │ ├── tftp.h │ ├── rarp.h │ ├── Makefile │ ├── sntp.h │ ├── nfs.h │ └── sntp.c ├── cpu │ └── mips │ │ ├── ar7240 │ │ ├── Makefile │ │ └── ag7240_phy.h │ │ ├── interrupts.c │ │ ├── config.mk │ │ ├── Makefile │ │ └── Makefile.orig ├── lib_bootstrap │ ├── LzmaTypes.h │ ├── display_options.c │ └── Makefile ├── lib_generic │ ├── LzmaTypes.h │ ├── Makefile │ └── display_options.c ├── mips_config.mk ├── disk │ ├── part_dos.h │ └── Makefile ├── post │ ├── Makefile │ ├── cpu │ │ ├── Makefile │ │ └── multi.c │ ├── rules.mk │ ├── dsp.c │ ├── codec.c │ └── watchdog.c ├── lib_mips │ └── Makefile └── mkconfig ├── release └── caraboot-carambola2-v2.3.bin ├── CHANGELOG ├── README.md └── Makefile /u-boot/tools/.gitignore: -------------------------------------------------------------------------------- 1 | crc32.c 2 | environment.c 3 | -------------------------------------------------------------------------------- /u-boot/tools/updater/dummy.c: -------------------------------------------------------------------------------- 1 | volatile int __dummy = 0xDEADBEEF; 2 | -------------------------------------------------------------------------------- /u-boot/CREDITS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/CREDITS -------------------------------------------------------------------------------- /u-boot/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/CHANGELOG -------------------------------------------------------------------------------- /u-boot/MAINTAINERS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/MAINTAINERS -------------------------------------------------------------------------------- /u-boot/fs/fdos/fs.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/fs/fdos/fs.c -------------------------------------------------------------------------------- /u-boot/drivers/sm501.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/drivers/sm501.c -------------------------------------------------------------------------------- /u-boot/fs/fdos/dev.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/fs/fdos/dev.c -------------------------------------------------------------------------------- /u-boot/fs/fdos/dos.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/fs/fdos/dos.h -------------------------------------------------------------------------------- /u-boot/fs/fdos/fat.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/fs/fdos/fat.c -------------------------------------------------------------------------------- /u-boot/fs/fdos/fdos.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/fs/fdos/fdos.c -------------------------------------------------------------------------------- /u-boot/fs/fdos/fdos.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/fs/fdos/fdos.h -------------------------------------------------------------------------------- /u-boot/fs/fdos/vfat.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/fs/fdos/vfat.c -------------------------------------------------------------------------------- /u-boot/include/fdc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/include/fdc.h -------------------------------------------------------------------------------- /u-boot/common/cmd_fdos.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/common/cmd_fdos.c -------------------------------------------------------------------------------- /u-boot/drivers/ali512x.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/drivers/ali512x.c -------------------------------------------------------------------------------- /u-boot/drivers/ct69000.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/drivers/ct69000.c -------------------------------------------------------------------------------- /u-boot/fs/fdos/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/fs/fdos/Makefile -------------------------------------------------------------------------------- /u-boot/fs/fdos/subdir.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/fs/fdos/subdir.c -------------------------------------------------------------------------------- /u-boot/rtc/s3c24x0_rtc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/rtc/s3c24x0_rtc.c -------------------------------------------------------------------------------- /u-boot/drivers/sed13806.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/drivers/sed13806.c -------------------------------------------------------------------------------- /u-boot/tools/logos/denx.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/tools/logos/denx.bmp -------------------------------------------------------------------------------- /u-boot/drivers/ti_pci1410a.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/drivers/ti_pci1410a.c -------------------------------------------------------------------------------- /u-boot/include/linux/mtd/mtd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/include/linux/mtd/mtd.h -------------------------------------------------------------------------------- /u-boot/include/asm-mips/inca-ip.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/u-boot/include/asm-mips/inca-ip.h -------------------------------------------------------------------------------- /release/caraboot-carambola2-v2.3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/Caraboot/master/release/caraboot-carambola2-v2.3.bin -------------------------------------------------------------------------------- /u-boot/include/spd_sdram.h: -------------------------------------------------------------------------------- 1 | #ifndef _SPD_SDRAM_H_ 2 | #define _SPD_SDRAM_H_ 3 | 4 | long int spd_sdram(void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /u-boot/include/linux/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_CONFIG_H 2 | #define _LINUX_CONFIG_H 3 | 4 | /* #include */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /u-boot/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | 3 | #include 4 | 5 | extern int errno; 6 | 7 | #define __set_errno(val) do { errno = val; } while (0) 8 | 9 | #endif /* _ERRNO_H */ 10 | -------------------------------------------------------------------------------- /u-boot/include/jffs2/jffs2_1pass.h: -------------------------------------------------------------------------------- 1 | u32 jffs2_1pass_ls(struct part_info *part,const char *fname); 2 | u32 jffs2_1pass_load(char *dest, struct part_info *part,const char *fname); 3 | u32 jffs2_1pass_info(struct part_info *part); 4 | -------------------------------------------------------------------------------- /u-boot/include/mii_phy.h: -------------------------------------------------------------------------------- 1 | #ifndef _MII_PHY_H_ 2 | #define _MII_PHY_H_ 3 | 4 | void mii_discover_phy(void); 5 | unsigned short mii_phy_read(unsigned short reg); 6 | void mii_phy_write(unsigned short reg, unsigned short val); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /u-boot/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | .depend 4 | 5 | include/version_autogenerated.h 6 | tools/envcrc 7 | tools/mkimage 8 | u-boot 9 | u-boot.bin 10 | u-boot.map 11 | u-boot.srec 12 | System.map 13 | include/config.h 14 | include/config.mk 15 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/carambola2/config.mk: -------------------------------------------------------------------------------- 1 | # ROM version 2 | ifeq ($(COMPRESSED_UBOOT),1) 3 | TEXT_BASE = 0x80010000 4 | BOOTSTRAP_TEXT_BASE = 0x9f000000 5 | else 6 | TEXT_BASE = 0x9f000000 7 | endif 8 | 9 | # SDRAM version 10 | #TEXT_BASE = 0x80000000 11 | -------------------------------------------------------------------------------- /u-boot/tools/updater/junk: -------------------------------------------------------------------------------- 1 | ................................................................................................................................................................................................................................................................ -------------------------------------------------------------------------------- /u-boot/tools/env/fw_env.config: -------------------------------------------------------------------------------- 1 | # Configuration file for fw_(printenv/saveenv) utility. 2 | # Up to two entries are valid, in this case the redundand 3 | # environment sector is assumed present. 4 | 5 | # MTD device name Device offset Env. size Flash sector size 6 | /dev/mtd1 0x0000 0x4000 0x4000 7 | /dev/mtd2 0x0000 0x4000 0x4000 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | 2016-01-20 - v2.3 5 | * Fix issue with USB recovery and SMSC USB2640 SD card reader 6 | 7 | 2015-10-14 - v2.2 8 | * Fix bug in USB recovery/boot 9 | * Fix bug in chip reset code 10 | 11 | 2014-11-04 - v2.1 12 | * Add configurable boot-stop string support 13 | * Add configurable baudrate support 14 | * Fix memory init bug 15 | 16 | 2014-10-21 - v2.0 17 | * Initial USB support 18 | -------------------------------------------------------------------------------- /u-boot/tools/scripts/send_cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/kermit + 2 | set line /dev/ttyS0 3 | set speed 115200 4 | set serial 8N1 5 | set carrier-watch off 6 | set handshake none 7 | set flow-control none 8 | robust 9 | set file type bin 10 | set file name lit 11 | set rec pack 1000 12 | set send pack 1000 13 | set window 5 14 | set prompt Kermit> 15 | 16 | #out \13 17 | #in 10 => 18 | out \%1 \%2 \%3 \%4 \%5 \%6 \%7\13 19 | in 10 => 20 | quit 21 | exit 0 22 | -------------------------------------------------------------------------------- /u-boot/include/cramfs/cramfs_fs_sb.h: -------------------------------------------------------------------------------- 1 | #ifndef _CRAMFS_FS_SB 2 | #define _CRAMFS_FS_SB 3 | 4 | /* 5 | * cramfs super-block data in memory 6 | */ 7 | struct cramfs_sb_info { 8 | unsigned long magic; 9 | unsigned long size; 10 | unsigned long blocks; 11 | unsigned long files; 12 | unsigned long flags; 13 | #ifdef CONFIG_CRAMFS_LINEAR 14 | unsigned long linear_phys_addr; 15 | char * linear_virt_addr; 16 | #endif 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /u-boot/include/jffs2/compr_rubin.h: -------------------------------------------------------------------------------- 1 | /* Rubin encoder/decoder header */ 2 | /* work started at : aug 3, 1994 */ 3 | /* last modification : aug 15, 1994 */ 4 | 5 | #define RUBIN_REG_SIZE 16 6 | #define UPPER_BIT_RUBIN (((long) 1)<<(RUBIN_REG_SIZE-1)) 7 | #define LOWER_BITS_RUBIN ((((long) 1)<<(RUBIN_REG_SIZE-1))-1) 8 | 9 | void dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out, 10 | unsigned long sourcelen, unsigned long dstlen); 11 | -------------------------------------------------------------------------------- /u-boot/include/_exports.h: -------------------------------------------------------------------------------- 1 | EXPORT_FUNC(get_version) 2 | EXPORT_FUNC(getc) 3 | EXPORT_FUNC(tstc) 4 | EXPORT_FUNC(putc) 5 | EXPORT_FUNC(puts) 6 | EXPORT_FUNC(printf) 7 | EXPORT_FUNC(install_hdlr) 8 | EXPORT_FUNC(free_hdlr) 9 | EXPORT_FUNC(malloc) 10 | EXPORT_FUNC(free) 11 | EXPORT_FUNC(udelay) 12 | EXPORT_FUNC(get_timer) 13 | EXPORT_FUNC(vprintf) 14 | EXPORT_FUNC(do_reset) 15 | #if (CONFIG_COMMANDS & CFG_CMD_I2C) 16 | EXPORT_FUNC(i2c_write) 17 | EXPORT_FUNC(i2c_read) 18 | #endif /* CFG_CMD_I2C */ 19 | -------------------------------------------------------------------------------- /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 | /* 13 | * Global functions and variables. 14 | */ 15 | 16 | /* tftp.c */ 17 | extern void TftpStart (void); /* Begin TFTP get */ 18 | 19 | /**********************************************************************/ 20 | 21 | #endif /* __TFTP_H__ */ 22 | -------------------------------------------------------------------------------- /u-boot/include/g_dnl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Samsung Electronics 3 | * Lukasz Majewski 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | 8 | #ifndef __G_DOWNLOAD_H_ 9 | #define __G_DOWNLOAD_H_ 10 | 11 | #include 12 | #include 13 | int g_dnl_bind_fixup(struct usb_device_descriptor *); 14 | int g_dnl_register(const char *s); 15 | void g_dnl_unregister(void); 16 | 17 | /* USB initialization declaration - board specific */ 18 | void board_usb_init(void); 19 | #endif /* __G_DOWNLOAD_H_ */ 20 | -------------------------------------------------------------------------------- /u-boot/tools/scripts/send_image: -------------------------------------------------------------------------------- 1 | #!/usr/bin/kermit + 2 | # usage: send_image FILE_NAME OFFSET 3 | # e.g. send_image output.bin 1F00000 4 | set line /dev/ttyS0 5 | set speed 115200 6 | set serial 8N1 7 | set carrier-watch off 8 | set handshake none 9 | set flow-control none 10 | robust 11 | set file type bin 12 | set file name lit 13 | set rec pack 1000 14 | set send pack 1000 15 | set window 5 16 | set prompt Kermit> 17 | 18 | out \13 19 | in 10 => 20 | out loadb \%2 \13 21 | in 10 download ... 22 | send \%1 23 | out \13 24 | in 10 ## Start Addr 25 | quit 26 | exit 0 27 | -------------------------------------------------------------------------------- /u-boot/tools/scripts/dot.kermrc: -------------------------------------------------------------------------------- 1 | set line /dev/ttyS0 2 | set speed 115200 3 | set carrier-watch off 4 | set handshake none 5 | set flow-control none 6 | robust 7 | set file type bin 8 | set file name lit 9 | set rec pack 1000 10 | set send pack 1000 11 | set window 5 12 | set prompt Kermit> 13 | define sz !sz \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9 < \v(line) > \v(line) 14 | define rz !rz \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9 < \v(line) > \v(line) 15 | define sx !sx \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9 < \v(line) > \v(line) 16 | define rx !rx \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9 < \v(line) > \v(line) 17 | -------------------------------------------------------------------------------- /u-boot/tools/setlocalversion: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Print additional version information for non-release trees. 3 | 4 | usage() { 5 | echo "Usage: $0 [srctree]" >&2 6 | exit 1 7 | } 8 | 9 | cd "${1:-.}" || usage 10 | 11 | # Check for git and a git repo. 12 | if head=`git rev-parse --verify HEAD 2>/dev/null`; then 13 | # Do we have an untagged version? 14 | if [ "`git name-rev --tags HEAD`" = "HEAD undefined" ]; then 15 | printf '%s%s' -g `echo "$head" | cut -c1-8` 16 | fi 17 | 18 | # Are there uncommitted changes? 19 | if git diff-files | read dummy; then 20 | printf '%s' -dirty 21 | fi 22 | fi 23 | -------------------------------------------------------------------------------- /u-boot/include/asm-generic/unaligned.h: -------------------------------------------------------------------------------- 1 | #ifndef _GENERIC_UNALIGNED_H 2 | #define _GENERIC_UNALIGNED_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | /* 11 | * Select endianness 12 | */ 13 | #if defined(__LITTLE_ENDIAN) 14 | #define get_unaligned __get_unaligned_le 15 | #define put_unaligned __put_unaligned_le 16 | #elif defined(__BIG_ENDIAN) 17 | #define get_unaligned __get_unaligned_be 18 | #define put_unaligned __put_unaligned_be 19 | #else 20 | #error invalid endian 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /u-boot/include/keyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef __KEYBOARD_H 2 | #define __KEYBOARD_H 3 | 4 | #ifdef CONFIG_PS2MULT 5 | #include 6 | #endif 7 | 8 | #if !defined(kbd_request_region) || \ 9 | !defined(kbd_request_irq) || \ 10 | !defined(kbd_read_input) || \ 11 | !defined(kbd_read_status) || \ 12 | !defined(kbd_write_output) || \ 13 | !defined(kbd_write_command) 14 | #error PS/2 low level routines not defined 15 | #endif 16 | 17 | extern int kbd_init (void); 18 | extern void handle_scancode(unsigned char scancode); 19 | extern int kbd_init_hw(void); 20 | extern void pckbd_leds(unsigned char leds); 21 | 22 | #endif /* __KEYBOARD_H */ 23 | -------------------------------------------------------------------------------- /u-boot/include/linux/compiler-gcc3.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_COMPILER_H 2 | #error "Please don't include directly, include instead." 3 | #endif 4 | 5 | #if __GNUC_MINOR__ >= 3 6 | # define __used __attribute__((__used__)) 7 | #else 8 | # define __used __attribute__((__unused__)) 9 | #endif 10 | 11 | #if __GNUC_MINOR__ >= 4 12 | #define __must_check __attribute__((warn_unused_result)) 13 | #endif 14 | 15 | /* 16 | * A trick to suppress uninitialized variable warning without generating any 17 | * code 18 | */ 19 | #define uninitialized_var(x) x = x 20 | 21 | #define __always_inline inline __attribute__((always_inline)) 22 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/ar7240/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/config.mk 2 | 3 | LIB = lib$(SOC).a 4 | 5 | START = 6 | 7 | OBJS = meminit.o 8 | OBJS += ar933x_clocks.o 9 | OBJS += ar933x_serial.o 10 | SOBJS += hornet_ddr_init.o 11 | OBJS += ag7240.o 12 | 13 | 14 | all: .depend $(START) $(LIB) 15 | 16 | $(LIB): $(OBJS) $(SOBJS) $(OBJS-0) 17 | $(AR) crv $@ $(OBJS) $(SOBJS) 18 | 19 | ######################################################################### 20 | 21 | .depend: Makefile $(START:.o=.S) $(OBJS:.o=.c) 22 | $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@ 23 | 24 | sinclude .depend 25 | 26 | ######################################################################### 27 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/carambola2/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/config.mk 2 | 3 | LIB = lib$(BOARD).a 4 | 5 | OBJS = $(BOARD).o flash.o ../common/ar7240_flash.o ../common/ar7240_s26_phy.o 6 | OBJS += carambola_factory.o 7 | OBJS += ../common/usb_boot.o 8 | SOBJS = ../common/lowlevel_init.o 9 | SOBJS += hornet_pll_init.o 10 | 11 | $(LIB): .depend $(OBJS) $(SOBJS) 12 | $(AR) crv $@ $(OBJS) $(SOBJS) 13 | 14 | ######################################################################### 15 | 16 | .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) 17 | $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ 18 | 19 | sinclude .depend 20 | 21 | ######################################################################### 22 | -------------------------------------------------------------------------------- /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 | #define ag7240_unit2name(_unit) _unit ? "eth1" : "eth0" 9 | extern int ag7240_miiphy_read(char *devname, uint32_t phaddr, 10 | uint8_t reg); 11 | extern int ag7240_miiphy_write(char *devname, uint32_t phaddr, 12 | uint8_t reg, uint16_t data); 13 | 14 | #define phy_reg_read(base, addr, reg) \ 15 | ag7240_miiphy_read(ag7240_unit2name(base), addr, reg) 16 | #define phy_reg_write(base, addr, reg, data) \ 17 | ag7240_miiphy_write(ag7240_unit2name(base), addr, reg, data) 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /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/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/tools/inca-swap-bytes.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #ifndef BUFSIZ 7 | # define BUFSIZ 4096 8 | #endif 9 | 10 | #undef BUFSIZ 11 | # define BUFSIZ 64 12 | int main (void) 13 | { 14 | short ibuff[BUFSIZ], obuff[BUFSIZ]; 15 | int rc, i, len; 16 | 17 | while ((rc = read (0, ibuff, sizeof (ibuff))) > 0) { 18 | memset (obuff, 0, sizeof (obuff)); 19 | for (i = 0; i < (rc + 1) / 2; i++) { 20 | obuff[i] = ibuff[i ^ 1]; 21 | } 22 | 23 | len = (rc + 1) & ~1; 24 | 25 | if (write (1, obuff, len) != len) { 26 | perror ("read error"); 27 | return (EXIT_FAILURE); 28 | } 29 | 30 | memset (ibuff, 0, sizeof (ibuff)); 31 | } 32 | 33 | if (rc < 0) { 34 | perror ("read error"); 35 | return (EXIT_FAILURE); 36 | } 37 | return (EXIT_SUCCESS); 38 | } 39 | -------------------------------------------------------------------------------- /u-boot/drivers/usb/host/ohci-da8xx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Sughosh Ganu 3 | * 4 | * SPDX-License-Identifier: GPL-2.0+ 5 | */ 6 | 7 | #include 8 | 9 | #include 10 | 11 | int usb_cpu_init(void) 12 | { 13 | /* enable psc for usb2.0 */ 14 | lpsc_on(DAVINCI_LPSC_USB20); 15 | 16 | /* enable psc for usb1.0 */ 17 | lpsc_on(DAVINCI_LPSC_USB11); 18 | 19 | /* start the on-chip usb phy and its pll */ 20 | if (usb_phy_on()) 21 | return 0; 22 | 23 | return 1; 24 | } 25 | 26 | int usb_cpu_stop(void) 27 | { 28 | usb_phy_off(); 29 | 30 | /* turn off the usb clock and assert the module reset */ 31 | lpsc_disable(DAVINCI_LPSC_USB11); 32 | lpsc_disable(DAVINCI_LPSC_USB20); 33 | 34 | return 0; 35 | } 36 | 37 | int usb_cpu_init_fail(void) 38 | { 39 | return usb_cpu_stop(); 40 | } 41 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/carambola2/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 | *(.text) 12 | } 13 | 14 | . = ALIGN(4); 15 | .rodata : { *(.rodata) } 16 | 17 | . = ALIGN(4); 18 | .data : { *(.data) } 19 | 20 | . = ALIGN(4); 21 | .sdata : { *(.sdata) } 22 | 23 | _gp = ALIGN(16); 24 | 25 | __got_start = .; 26 | .got : { *(.got) } 27 | __got_end = .; 28 | 29 | .sdata : { *(.sdata) } 30 | 31 | __u_boot_cmd_start = .; 32 | .u_boot_cmd : { *(.u_boot_cmd) } 33 | __u_boot_cmd_end = .; 34 | 35 | uboot_end_data = .; 36 | num_got_entries = (__got_end - __got_start) >> 2; 37 | 38 | . = ALIGN(4); 39 | .sbss : { *(.sbss) } 40 | .bss : { *(.bss) } 41 | uboot_end = .; 42 | } 43 | -------------------------------------------------------------------------------- /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/tools/ncb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main (int argc, char *argv[]) 7 | { 8 | int s, len, o, port = 6666; 9 | char buf[512]; 10 | struct sockaddr_in addr; 11 | int addr_len = sizeof addr; 12 | 13 | if (argc > 1) 14 | port = atoi (argv[1]); 15 | 16 | s = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP); 17 | 18 | o = 1; 19 | len = 4; 20 | setsockopt (3, SOL_SOCKET, SO_REUSEADDR, &o, len); 21 | 22 | addr.sin_family = AF_INET; 23 | addr.sin_port = htons (port); 24 | addr.sin_addr.s_addr = INADDR_ANY; /* receive broadcasts */ 25 | 26 | bind (s, (struct sockaddr *) &addr, sizeof addr); 27 | 28 | for (;;) { 29 | len = recvfrom (s, buf, sizeof buf, 0, (struct sockaddr *) &addr, &addr_len); 30 | if (len < 0) 31 | break; 32 | write (1, buf, len); 33 | } 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /u-boot/include/asm-mips/unaligned.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) 2007 Ralf Baechle (ralf@linux-mips.org) 7 | */ 8 | #ifndef _ASM_MIPS_UNALIGNED_H 9 | #define _ASM_MIPS_UNALIGNED_H 10 | 11 | #include 12 | #if defined(__MIPSEB__) 13 | #define get_unaligned __get_unaligned_be 14 | #define put_unaligned __put_unaligned_be 15 | #elif defined(__MIPSEL__) 16 | #define get_unaligned __get_unaligned_le 17 | #define put_unaligned __put_unaligned_le 18 | #else 19 | #error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #endif /* _ASM_MIPS_UNALIGNED_H */ 27 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/carambola2/flash.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | /* 7 | * sets up flash_info and returns size of FLASH (bytes) 8 | */ 9 | unsigned long 10 | flash_get_geom (flash_info_t *flash_info) 11 | { 12 | int i; 13 | 14 | /* XXX this is hardcoded until we figure out how to read flash id */ 15 | 16 | flash_info->flash_id = FLASH_M25P64; 17 | flash_info->size = CFG_FLASH_SIZE; /* bytes */ 18 | flash_info->sector_count = flash_info->size/CFG_FLASH_SECTOR_SIZE; 19 | 20 | for (i = 0; i < flash_info->sector_count; i++) { 21 | flash_info->start[i] = CFG_FLASH_BASE + (i * CFG_FLASH_SECTOR_SIZE); 22 | flash_info->protect[i] = 0; 23 | } 24 | 25 | debug ("flash size %d, sector count = %d\n", flash_info->size, flash_info->sector_count); 26 | return (flash_info->size); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /u-boot/drivers/usb/host/ehci-ppc4xx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2010, Chris Zhang 3 | * 4 | * Author: Chris Zhang 5 | * This code is based on ehci freescale driver 6 | * 7 | * SPDX-License-Identifier: GPL-2.0+ 8 | */ 9 | #include 10 | #include 11 | 12 | #include "ehci.h" 13 | 14 | /* 15 | * Create the appropriate control structures to manage 16 | * a new EHCI host controller. 17 | */ 18 | int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) 19 | { 20 | *hccr = (struct ehci_hccr *)(CONFIG_SYS_PPC4XX_USB_ADDR); 21 | *hcor = (struct ehci_hcor *)((uint32_t) *hccr + 22 | HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); 23 | return 0; 24 | } 25 | 26 | /* 27 | * Destroy the appropriate control structures corresponding 28 | * the the EHCI host controller. 29 | */ 30 | int ehci_hcd_stop(int index) 31 | { 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /u-boot/include/usb_cdc_acm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2006 3 | * Bryan O'Donoghue, deckard@codehermit.ie, CodeHermit 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | 8 | /* ACM Control Requests */ 9 | #define ACM_SEND_ENCAPSULATED_COMMAND 0x00 10 | #define ACM_GET_ENCAPSULATED_RESPONSE 0x01 11 | #define ACM_SET_COMM_FEATURE 0x02 12 | #define ACM_GET_COMM_FEATRUE 0x03 13 | #define ACM_CLEAR_COMM_FEATURE 0x04 14 | #define ACM_SET_LINE_ENCODING 0x20 15 | #define ACM_GET_LINE_ENCODING 0x21 16 | #define ACM_SET_CONTROL_LINE_STATE 0x22 17 | #define ACM_SEND_BREAK 0x23 18 | 19 | /* ACM Notification Codes */ 20 | #define ACM_NETWORK_CONNECTION 0x00 21 | #define ACM_RESPONSE_AVAILABLE 0x01 22 | #define ACM_SERIAL_STATE 0x20 23 | 24 | /* Format of response expected by a ACM_GET_LINE_ENCODING request */ 25 | struct rs232_emu{ 26 | unsigned long dter; 27 | unsigned char stop_bits; 28 | unsigned char parity; 29 | unsigned char data_bits; 30 | }__attribute__((packed)); 31 | -------------------------------------------------------------------------------- /u-boot/common/exports.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | DECLARE_GLOBAL_DATA_PTR; 5 | 6 | static void dummy(void) 7 | { 8 | } 9 | 10 | unsigned long get_version(void) 11 | { 12 | return XF_VERSION; 13 | } 14 | 15 | void jumptable_init (void) 16 | { 17 | int i; 18 | 19 | gd->jt = (void **) malloc (XF_MAX * sizeof (void *)); 20 | for (i = 0; i < XF_MAX; i++) 21 | gd->jt[i] = (void *) dummy; 22 | 23 | gd->jt[XF_get_version] = (void *) get_version; 24 | gd->jt[XF_malloc] = (void *) malloc; 25 | gd->jt[XF_free] = (void *) free; 26 | gd->jt[XF_get_timer] = (void *)get_timer; 27 | gd->jt[XF_udelay] = (void *)udelay; 28 | #if defined(CONFIG_I386) || defined(CONFIG_PPC) 29 | gd->jt[XF_install_hdlr] = (void *) irq_install_handler; 30 | gd->jt[XF_free_hdlr] = (void *) irq_free_handler; 31 | #endif /* I386 || PPC */ 32 | #if (CONFIG_COMMANDS & CFG_CMD_I2C) 33 | gd->jt[XF_i2c_write] = (void *) i2c_write; 34 | gd->jt[XF_i2c_read] = (void *) i2c_read; 35 | #endif /* CFG_CMD_I2C */ 36 | } 37 | -------------------------------------------------------------------------------- /u-boot/drivers/usb/host/ehci-vct.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2009 Stefan Roese , DENX Software Engineering 3 | * 4 | * SPDX-License-Identifier: GPL-2.0+ 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #include "ehci.h" 11 | 12 | int vct_ehci_hcd_init(u32 *hccr, u32 *hcor); 13 | 14 | /* 15 | * Create the appropriate control structures to manage 16 | * a new EHCI host controller. 17 | */ 18 | int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) 19 | { 20 | int ret; 21 | u32 vct_hccr; 22 | u32 vct_hcor; 23 | 24 | /* 25 | * Init VCT specific stuff 26 | */ 27 | ret = vct_ehci_hcd_init(&vct_hccr, &vct_hcor); 28 | if (ret) 29 | return ret; 30 | 31 | *hccr = (struct ehci_hccr *)vct_hccr; 32 | *hcor = (struct ehci_hcor *)vct_hcor; 33 | 34 | return 0; 35 | } 36 | 37 | /* 38 | * Destroy the appropriate control structures corresponding 39 | * the the EHCI host controller. 40 | */ 41 | int ehci_hcd_stop(int index) 42 | { 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /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/lib_bootstrap/LzmaTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | LzmaTypes.h 3 | 4 | Types for LZMA Decoder 5 | 6 | This file written and distributed to public domain by Igor Pavlov. 7 | This file is part of LZMA SDK 4.40 (2006-05-01) 8 | */ 9 | 10 | #ifndef __LZMATYPES_H 11 | #define __LZMATYPES_H 12 | 13 | #ifndef _7ZIP_BYTE_DEFINED 14 | #define _7ZIP_BYTE_DEFINED 15 | typedef unsigned char Byte; 16 | #endif 17 | 18 | #ifndef _7ZIP_UINT16_DEFINED 19 | #define _7ZIP_UINT16_DEFINED 20 | typedef unsigned short UInt16; 21 | #endif 22 | 23 | #ifndef _7ZIP_UINT32_DEFINED 24 | #define _7ZIP_UINT32_DEFINED 25 | #ifdef _LZMA_UINT32_IS_ULONG 26 | typedef unsigned long UInt32; 27 | #else 28 | typedef unsigned int UInt32; 29 | #endif 30 | #endif 31 | 32 | /* #define _LZMA_SYSTEM_SIZE_T */ 33 | /* Use system's size_t. You can use it to enable 64-bit sizes supporting */ 34 | 35 | #ifndef _7ZIP_SIZET_DEFINED 36 | #define _7ZIP_SIZET_DEFINED 37 | #ifdef _LZMA_SYSTEM_SIZE_T 38 | #include 39 | typedef size_t SizeT; 40 | #else 41 | typedef UInt32 SizeT; 42 | #endif 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /u-boot/lib_generic/LzmaTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | LzmaTypes.h 3 | 4 | Types for LZMA Decoder 5 | 6 | This file written and distributed to public domain by Igor Pavlov. 7 | This file is part of LZMA SDK 4.40 (2006-05-01) 8 | */ 9 | 10 | #ifndef __LZMATYPES_H 11 | #define __LZMATYPES_H 12 | 13 | #ifndef _7ZIP_BYTE_DEFINED 14 | #define _7ZIP_BYTE_DEFINED 15 | typedef unsigned char Byte; 16 | #endif 17 | 18 | #ifndef _7ZIP_UINT16_DEFINED 19 | #define _7ZIP_UINT16_DEFINED 20 | typedef unsigned short UInt16; 21 | #endif 22 | 23 | #ifndef _7ZIP_UINT32_DEFINED 24 | #define _7ZIP_UINT32_DEFINED 25 | #ifdef _LZMA_UINT32_IS_ULONG 26 | typedef unsigned long UInt32; 27 | #else 28 | typedef unsigned int UInt32; 29 | #endif 30 | #endif 31 | 32 | /* #define _LZMA_SYSTEM_SIZE_T */ 33 | /* Use system's size_t. You can use it to enable 64-bit sizes supporting */ 34 | 35 | #ifndef _7ZIP_SIZET_DEFINED 36 | #define _7ZIP_SIZET_DEFINED 37 | #ifdef _LZMA_SYSTEM_SIZE_T 38 | #include 39 | typedef size_t SizeT; 40 | #else 41 | typedef UInt32 SizeT; 42 | #endif 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /u-boot/drivers/usb/host/ehci-ixp4xx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2008, Michael Trimarchi 3 | * 4 | * Author: Michael Trimarchi 5 | * This code is based on ehci freescale driver 6 | * 7 | * SPDX-License-Identifier: GPL-2.0+ 8 | */ 9 | #include 10 | #include 11 | 12 | #include "ehci.h" 13 | /* 14 | * Create the appropriate control structures to manage 15 | * a new EHCI host controller. 16 | */ 17 | int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) 18 | { 19 | *hccr = (struct ehci_hccr *)(0xcd000100); 20 | *hcor = (struct ehci_hcor *)((uint32_t) *hccr 21 | + HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); 22 | 23 | printf("IXP4XX init hccr %x and hcor %x hc_length %d\n", 24 | (uint32_t)*hccr, (uint32_t)*hcor, 25 | (uint32_t)HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); 26 | return 0; 27 | } 28 | 29 | /* 30 | * Destroy the appropriate control structures corresponding 31 | * the the EHCI host controller. 32 | */ 33 | int ehci_hcd_stop(int index) 34 | { 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /u-boot/include/asm-generic/global_data_flags.h: -------------------------------------------------------------------------------- 1 | /* 2 | * transitional header until we merge global_data.h 3 | * 4 | * (C) Copyright 2000-2010 5 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 6 | * 7 | * Licensed under the GPL-2 or later. 8 | */ 9 | 10 | #ifndef __ASM_GENERIC_GLOBAL_DATA_FLAGS_H 11 | #define __ASM_GENERIC_GLOBAL_DATA_FLAGS_H 12 | 13 | /* 14 | * Global Data Flags 15 | * 16 | * Note: The low 16 bits are expected for common code. If your arch 17 | * really needs to add your own, use the high 16bits. 18 | */ 19 | #define GD_FLG_RELOC 0x0001 /* Code was relocated to RAM */ 20 | #define GD_FLG_DEVINIT 0x0002 /* Devices have been initialized */ 21 | #define GD_FLG_SILENT 0x0004 /* Silent mode */ 22 | #define GD_FLG_POSTFAIL 0x0008 /* Critical POST test failed */ 23 | #define GD_FLG_POSTSTOP 0x0010 /* POST seqeunce aborted */ 24 | #define GD_FLG_LOGINIT 0x0020 /* Log Buffer has been initialized */ 25 | #define GD_FLG_DISABLE_CONSOLE 0x0040 /* Disable console (in & out) */ 26 | #define GD_FLG_ENV_READY 0x0080 /* Environment imported into hash table */ 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /u-boot/mips_config.mk: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__ 25 | 26 | ifeq ($(FLASH_TYPE),S25FL128P) 27 | PLATFORM_CPPFLAGS += -D$(FLASH_TYPE) 28 | endif 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/interrupts.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Wolfgang Denk, DENX Software Engineering, 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #include 25 | 26 | void enable_interrupts(void) 27 | { 28 | } 29 | 30 | int disable_interrupts(void) 31 | { 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /u-boot/tools/gdb/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Murray Jensen 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #include 25 | 26 | extern char *pname; 27 | 28 | extern void Warning(char *, ...); 29 | extern void Error(char *, ...); 30 | extern void Perror(char *, ...); 31 | -------------------------------------------------------------------------------- /u-boot/include/linux/mtd/compat.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_COMPAT_H_ 2 | #define _LINUX_COMPAT_H_ 3 | 4 | #define __user 5 | #define __iomem 6 | 7 | #define ndelay(x) udelay(1) 8 | 9 | #define printk printf 10 | 11 | #define KERN_EMERG 12 | #define KERN_ALERT 13 | #define KERN_CRIT 14 | #define KERN_ERR 15 | #define KERN_WARNING 16 | #define KERN_NOTICE 17 | #define KERN_INFO 18 | #define KERN_DEBUG 19 | 20 | #define kmalloc(size, flags) malloc(size) 21 | #define kfree(ptr) free(ptr) 22 | 23 | /* 24 | * ..and if you can't take the strict 25 | * types, you can specify one yourself. 26 | * 27 | * Or not use min/max at all, of course. 28 | */ 29 | #define min_t(type,x,y) \ 30 | ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) 31 | #define max_t(type,x,y) \ 32 | ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; }) 33 | 34 | #define BUG() do { \ 35 | printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \ 36 | } while (0) 37 | 38 | #define BUG_ON(condition) do { if (condition) BUG(); } while(0) 39 | 40 | #define likely(x) __builtin_expect(!!(x), 1) 41 | #define unlikely(x) __builtin_expect(!!(x), 0) 42 | 43 | #define PAGE_SIZE 4096 44 | #endif 45 | -------------------------------------------------------------------------------- /u-boot/tools/gdb/remote.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Murray Jensen 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 | extern int remote_desc, remote_timeout; 25 | 26 | extern void remote_reset(void); 27 | extern void remote_continue(void); 28 | extern int remote_write_bytes(unsigned long, char *, int); 29 | -------------------------------------------------------------------------------- /u-boot/disk/part_dos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | 8 | #ifndef _DISK_PART_DOS_H 9 | #define _DISK_PART_DOS_H 10 | 11 | #define DOS_PART_DISKSIG_OFFSET 0x1b8 12 | #define DOS_PART_TBL_OFFSET 0x1be 13 | #define DOS_PART_MAGIC_OFFSET 0x1fe 14 | #define DOS_PBR_FSTYPE_OFFSET 0x36 15 | #define DOS_PBR32_FSTYPE_OFFSET 0x52 16 | #define DOS_PBR_MEDIA_TYPE_OFFSET 0x15 17 | #define DOS_MBR 0 18 | #define DOS_PBR 1 19 | 20 | typedef struct dos_partition { 21 | unsigned char boot_ind; /* 0x80 - active */ 22 | unsigned char head; /* starting head */ 23 | unsigned char sector; /* starting sector */ 24 | unsigned char cyl; /* starting cylinder */ 25 | unsigned char sys_ind; /* What partition type */ 26 | unsigned char end_head; /* end head */ 27 | unsigned char end_sector; /* end sector */ 28 | unsigned char end_cyl; /* end cylinder */ 29 | unsigned char start4[4]; /* starting sector counting from 0 */ 30 | unsigned char size4[4]; /* nr of sectors in partition */ 31 | } dos_partition_t; 32 | 33 | #endif /* _DISK_PART_DOS_H */ 34 | -------------------------------------------------------------------------------- /u-boot/include/exports.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXPORTS_H__ 2 | #define __EXPORTS_H__ 3 | 4 | #ifndef __ASSEMBLY__ 5 | 6 | #include 7 | 8 | /* These are declarations of exported functions available in C code */ 9 | unsigned long get_version(void); 10 | int getc(void); 11 | int tstc(void); 12 | void putc(const char); 13 | void puts(const char*); 14 | void printf(const char* fmt, ...); 15 | void install_hdlr(int, interrupt_handler_t*, void*); 16 | void free_hdlr(int); 17 | void *malloc(size_t); 18 | void free(void*); 19 | void udelay(unsigned long); 20 | unsigned long get_timer(unsigned long); 21 | void vprintf(const char *, va_list); 22 | void do_reset (void); 23 | #if (CONFIG_COMMANDS & CFG_CMD_I2C) 24 | int i2c_write (uchar, uint, int , uchar* , int); 25 | int i2c_read (uchar, uint, int , uchar* , int); 26 | #endif /* CFG_CMD_I2C */ 27 | 28 | void app_startup(char **); 29 | 30 | #endif /* ifndef __ASSEMBLY__ */ 31 | 32 | enum { 33 | #define EXPORT_FUNC(x) XF_ ## x , 34 | #include <_exports.h> 35 | #undef EXPORT_FUNC 36 | 37 | XF_MAX 38 | }; 39 | 40 | #define XF_VERSION 2 41 | 42 | #if defined(CONFIG_I386) 43 | extern gd_t *global_data; 44 | #endif 45 | 46 | #endif /* __EXPORTS_H__ */ 47 | -------------------------------------------------------------------------------- /u-boot/include/usb_mass_storage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Samsung Electrnoics 3 | * Lukasz Majewski 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | 8 | #ifndef __USB_MASS_STORAGE_H__ 9 | #define __USB_MASS_STORAGE_H__ 10 | 11 | #define SECTOR_SIZE 0x200 12 | 13 | #include 14 | 15 | struct ums_device { 16 | struct mmc *mmc; 17 | int dev_num; 18 | int offset; 19 | int part_size; 20 | }; 21 | 22 | struct ums_board_info { 23 | int (*read_sector)(struct ums_device *ums_dev, 24 | ulong start, lbaint_t blkcnt, void *buf); 25 | int (*write_sector)(struct ums_device *ums_dev, 26 | ulong start, lbaint_t blkcnt, const void *buf); 27 | void (*get_capacity)(struct ums_device *ums_dev, 28 | long long int *capacity); 29 | const char *name; 30 | struct ums_device ums_dev; 31 | }; 32 | 33 | extern void board_usb_init(void); 34 | 35 | extern int fsg_init(struct ums_board_info *); 36 | extern void fsg_cleanup(void); 37 | extern struct ums_board_info *board_ums_init(unsigned int, 38 | unsigned int, unsigned int); 39 | extern int usb_gadget_handle_interrupts(void); 40 | extern int fsg_main_thread(void *); 41 | 42 | #endif /* __USB_MASS_STORAGE_H__ */ 43 | -------------------------------------------------------------------------------- /u-boot/drivers/usb/host/ehci-spear.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2010 3 | * Armando Visconti, ST Micoelectronics, . 4 | * 5 | * (C) Copyright 2009 6 | * Marvell Semiconductor 7 | * Written-by: Prafulla Wadaskar 8 | * 9 | * SPDX-License-Identifier: GPL-2.0+ 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include "ehci.h" 16 | #include 17 | 18 | 19 | /* 20 | * Create the appropriate control structures to manage 21 | * a new EHCI host controller. 22 | */ 23 | int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) 24 | { 25 | *hccr = (struct ehci_hccr *)(CONFIG_SYS_UHC0_EHCI_BASE + 0x100); 26 | *hcor = (struct ehci_hcor *)((uint32_t)*hccr 27 | + HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); 28 | 29 | debug("SPEAr-ehci: init hccr %x and hcor %x hc_length %d\n", 30 | (uint32_t)*hccr, (uint32_t)*hcor, 31 | (uint32_t)HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); 32 | 33 | return 0; 34 | } 35 | 36 | /* 37 | * Destroy the appropriate control structures corresponding 38 | * the the EHCI host controller. 39 | */ 40 | int ehci_hcd_stop(int index) 41 | { 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /u-boot/include/usb/musb_udc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009 Wind River Systems, Inc. 3 | * Tom Rix 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | #ifndef __MUSB_UDC_H__ 8 | #define __MUSB_UDC_H__ 9 | 10 | #include 11 | 12 | /* UDC level routines */ 13 | void udc_irq(void); 14 | void udc_set_nak(int ep_num); 15 | void udc_unset_nak(int ep_num); 16 | int udc_endpoint_write(struct usb_endpoint_instance *endpoint); 17 | void udc_setup_ep(struct usb_device_instance *device, unsigned int id, 18 | struct usb_endpoint_instance *endpoint); 19 | void udc_connect(void); 20 | void udc_disconnect(void); 21 | void udc_enable(struct usb_device_instance *device); 22 | void udc_disable(void); 23 | void udc_startup_events(struct usb_device_instance *device); 24 | int udc_init(void); 25 | 26 | /* usbtty */ 27 | #ifdef CONFIG_USB_TTY 28 | 29 | #define EP0_MAX_PACKET_SIZE 64 /* MUSB_EP0_FIFOSIZE */ 30 | #define UDC_INT_ENDPOINT 1 31 | #define UDC_INT_PACKET_SIZE 64 32 | #define UDC_OUT_ENDPOINT 2 33 | #define UDC_OUT_PACKET_SIZE 64 34 | #define UDC_IN_ENDPOINT 3 35 | #define UDC_IN_PACKET_SIZE 64 36 | #define UDC_BULK_PACKET_SIZE 64 37 | 38 | #endif /* CONFIG_USB_TTY */ 39 | 40 | #endif /* __MUSB_UDC_H__ */ 41 | -------------------------------------------------------------------------------- /u-boot/post/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 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 | 25 | SUBDIRS = cpu 26 | 27 | LIB = libpost.a 28 | 29 | AOBJS = cache_8xx.o 30 | COBJS = cache.o codec.o cpu.o dsp.o ether.o 31 | COBJS += i2c.o memory.o post.o rtc.o 32 | COBJS += spr.o sysmon.o tests.o uart.o 33 | COBJS += usb.o watchdog.o 34 | 35 | include $(TOPDIR)/post/rules.mk 36 | -------------------------------------------------------------------------------- /u-boot/include/mmc.h: -------------------------------------------------------------------------------- 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 | #ifndef _MMC_H_ 25 | #define _MMC_H_ 26 | #include 27 | 28 | int mmc_init(int verbose); 29 | int mmc_read(ulong src, uchar *dst, int size); 30 | int mmc_write(uchar *src, ulong dst, int size); 31 | int mmc2info(ulong addr); 32 | 33 | #endif /* _MMC_H_ */ 34 | -------------------------------------------------------------------------------- /u-boot/post/cpu/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 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 | SUBDIRS = 25 | 26 | LIB = libcpu.a 27 | 28 | AOBJS = asm.o 29 | COBJS = cmp.o cmpi.o two.o twox.o three.o threex.o 30 | COBJS += threei.o andi.o srawi.o rlwnm.o rlwinm.o rlwimi.o 31 | COBJS += store.o load.o cr.o b.o multi.o string.o complex.o 32 | 33 | include $(TOPDIR)/post/rules.mk 34 | -------------------------------------------------------------------------------- /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/fs/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000, 2001 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | # 24 | 25 | #SUBDIRS := jffs2 cramfs fdos fat reiserfs ext2 26 | SUBDIRS := fat 27 | 28 | LIB = libfs.a 29 | 30 | OBJS = fs.o 31 | 32 | .depend all: 33 | @for dir in $(SUBDIRS) ; do \ 34 | $(MAKE) -C $$dir $@ ; done 35 | 36 | all: $(LIB) 37 | 38 | 39 | 40 | $(LIB): $(obj).depend $(OBJS) 41 | $(AR) crv $@ $(OBJS) -------------------------------------------------------------------------------- /u-boot/include/sandboxfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012, Google Inc. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 2 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software 15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 | */ 17 | 18 | #ifndef __SANDBOX_FS__ 19 | #define __SANDBOX_FS__ 20 | 21 | int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info); 22 | 23 | long sandbox_fs_read_at(const char *filename, unsigned long pos, 24 | void *buffer, unsigned long maxsize); 25 | 26 | void sandbox_fs_close(void); 27 | int sandbox_fs_ls(const char *dirname); 28 | int fs_read_sandbox(const char *filename, void *buf, int offset, int len); 29 | int fs_write_sandbox(const char *filename, void *buf, int offset, int len); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Caraboot 2 | ======== 3 | 4 | U-Boot for Carambola2 based boards 5 | 6 | 7 | Build 8 | ------- 9 | 10 | 1) Build buildroot toolchain (http://buildroot.org) 11 | 12 | Download: 13 | ``` 14 | cd your_work_dir 15 | git clone git://git.buildroot.net/buildroot 16 | ``` 17 | 18 | Configure: 19 | ``` 20 | cd buildroot 21 | make menuconfig 22 | ``` 23 | In Target Options select Target Architecture as MIPS (big endian) and Target Architecture Variant as mips 32r2. 24 | In Toolchain select GCC Compiler version as gcc 4.7.x. 25 | Save and exit. 26 | 27 | Build: 28 | ``` 29 | make 30 | ``` 31 | 32 | 2) Build Caraboot image 33 | 34 | Download: 35 | ``` 36 | cd your_work_dir 37 | git clone https://github.com/8devices/Caraboot.git 38 | ``` 39 | 40 | Configure: 41 | Open Caraboot Makefile and change CONFIG_TOOLCHAIN_PREFIX to your buildroot binary path, i.e ```CONFIG_TOOLCHAIN_PREFIX=your_work_dir/buildroot/output/host/usr/bin/mips-linux- ``` 42 | ``` 43 | cd Caraboot 44 | vi/nano/gedit Makefile 45 | ``` 46 | 47 | Build: 48 | ``` 49 | make 50 | ``` 51 | 52 | The bootloader binary will be saved to ```bin/carambola2_u-boot.bin``` file. 53 | You can now use this file to upgrade your bootloader on Carambola2 board (http://8devices.com/wiki/carambola:2:gettingstarted:bootloader-upgrade) 54 | 55 | 56 | -------------------------------------------------------------------------------- /u-boot/tools/Makefile.win32: -------------------------------------------------------------------------------- 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 | CPPFLAGS = -Wall -pedantic -I../include -I.. -D__WIN32__ 25 | CFLAGS = $(CPPFLAGS) -O 26 | 27 | all: mkimage.exe 28 | 29 | mkimage.exe: mkimage.o crc32.o 30 | $(CC) -g $(CFLAGS) -o $@ $^ 31 | 32 | crc32.o: crc32.c 33 | $(CC) -g $(CFLAGS) -c $< 34 | 35 | mkimage.o: mkimage.c 36 | $(CC) -g $(CFLAGS) -c $< 37 | 38 | -------------------------------------------------------------------------------- /u-boot/include/usbdcore_ep0.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Gerry Hamel, geh@ti.com, Texas Instruments 4 | * 5 | * Based on 6 | * linux/drivers/usbd/ep0.c 7 | * 8 | * Copyright (c) 2000, 2001, 2002 Lineo 9 | * Copyright (c) 2001 Hewlett Packard 10 | * 11 | * By: 12 | * Stuart Lynne , 13 | * Tom Rushworth , 14 | * Bruce Balden 15 | * 16 | * This program is free software; you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation; either version 2 of the License, or 19 | * (at your option) any later version. 20 | * 21 | * This program is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | * 26 | * You should have received a copy of the GNU General Public License 27 | * along with this program; if not, write to the Free Software 28 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 29 | * 30 | */ 31 | 32 | #ifndef __USBDCORE_EP0_H__ 33 | #define __USBDCORE_EP0_H__ 34 | 35 | 36 | int ep0_recv_setup (struct urb *urb); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /u-boot/drivers/usb/host/ehci-armada100.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2012 3 | * eInfochips Ltd. 4 | * Written-by: Ajay Bhargav 5 | * 6 | * This driver is based on Kirkwood echi driver 7 | * (C) Copyright 2009 8 | * Marvell Semiconductor 9 | * Written-by: Prafulla Wadaskar 10 | * 11 | * SPDX-License-Identifier: GPL-2.0+ 12 | */ 13 | 14 | #include 15 | #include 16 | #include 17 | #include "ehci.h" 18 | #include 19 | #include 20 | #include 21 | 22 | /* 23 | * EHCI host controller init 24 | */ 25 | int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) 26 | { 27 | if (utmi_init() < 0) 28 | return -1; 29 | 30 | *hccr = (struct ehci_hccr *)(ARMD1_USB_HOST_BASE + 0x100); 31 | *hcor = (struct ehci_hcor *)((uint32_t) *hccr 32 | + HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); 33 | 34 | debug("armada100-ehci: init hccr %x and hcor %x hc_length %d\n", 35 | (uint32_t)*hccr, (uint32_t)*hcor, 36 | (uint32_t)HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); 37 | 38 | return 0; 39 | } 40 | 41 | /* 42 | * EHCI host controller stop 43 | */ 44 | int ehci_hcd_stop(int index) 45 | { 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | export BUILD_TOPDIR=$(PWD) 2 | export STAGING_DIR=$(BUILD_TOPDIR)/tmp 3 | export TOPDIR=$(PWD) 4 | export UBOOTDIR=$(TOPDIR)/u-boot 5 | 6 | ### Toolchain config ### 7 | #buildroot 8 | CONFIG_TOOLCHAIN_PREFIX=/opt/build/toolchain-mipsbe-4.7.3/bin/mips-linux- 9 | 10 | #openwrt NOT YET 11 | #CONFIG_TOOLCHAIN_PREFIX=mips-openwrt-linux-uclibc- 12 | #export PATH:=$(BUILD_TOPDIR)/toolchain/bin/:$(PATH) 13 | 14 | ######################## 15 | 16 | export CROSS_COMPILE=$(CONFIG_TOOLCHAIN_PREFIX) 17 | export MAKECMD=make ARCH=mips 18 | 19 | export UBOOT_GCC_4_3_3_EXTRA_CFLAGS=-fPIC 20 | export BUILD_TYPE=squashfs 21 | 22 | BOARD_TYPE=carambola2 23 | export COMPRESSED_UBOOT=0 24 | export FLASH_SIZE=16 25 | export NEW_DDR_TAP_CAL=1 26 | export CONFIG_HORNET_XTAL=40 27 | export CONFIG_HORNET_1_1_WAR=1 28 | export CARABOOT_RELEASE=v2.4-dev 29 | 30 | IMAGEPATH=$(BUILD_TOPDIR)/bin 31 | UBOOT_BINARY=u-boot.bin 32 | UBOOTFILE=$(BOARD_TYPE)_u-boot.bin 33 | 34 | all: 35 | cd $(UBOOTDIR) && $(MAKECMD) distclean 36 | cd $(UBOOTDIR) && $(MAKECMD) $(BOARD_TYPE)_config 37 | cd $(UBOOTDIR) && $(MAKECMD) all 38 | @echo Copy binaries to $(IMAGEPATH)/$(UBOOTFILE) 39 | mkdir -p $(IMAGEPATH) 40 | cp -f $(UBOOTDIR)/$(UBOOT_BINARY) $(IMAGEPATH)/$(UBOOTFILE) 41 | 42 | @echo Done 43 | 44 | clean: 45 | cd $(UBOOTDIR) && $(MAKECMD) distclean 46 | -------------------------------------------------------------------------------- /u-boot/tools/gdb/serial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Murray Jensen 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 | #define SERIAL_ERROR -1 /* General error, see errno for details */ 27 | #define SERIAL_TIMEOUT -2 28 | #define SERIAL_EOF -3 29 | 30 | extern speed_t cvtspeed(char *); 31 | extern int serialopen(char *, speed_t); 32 | extern int serialreadchar(int, int); 33 | extern int serialwrite(int, char *, int); 34 | extern int serialclose(int); 35 | -------------------------------------------------------------------------------- /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/ppc4xx.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------+ 2 | | 3 | | This source code has been made available to you by IBM on an AS-IS 4 | | basis. Anyone receiving this source is licensed under IBM 5 | | copyrights to use it in any way he or she deems fit, including 6 | | copying it, modifying it, compiling it, and redistributing it either 7 | | with or without modifications. No license under IBM patents or 8 | | patent applications is to be implied by the copyright license. 9 | | 10 | | Any user of this software should understand that IBM cannot provide 11 | | technical support for this software and will not be responsible for 12 | | any consequences resulting from the use of this software. 13 | | 14 | | Any person who transfers this source code or any derivative work 15 | | must include the IBM copyright notice, this paragraph, and the 16 | | preceding two paragraphs in the transferred software. 17 | | 18 | | COPYRIGHT I B M CORPORATION 1999 19 | | LICENSED MATERIAL - PROGRAM PROPERTY OF I B M 20 | +----------------------------------------------------------------------------*/ 21 | 22 | #ifndef __PPC4XX_H__ 23 | #define __PPC4XX_H__ 24 | 25 | 26 | #if defined(CONFIG_440) 27 | #include 28 | #else 29 | #include 30 | #endif 31 | 32 | #endif /* __PPC4XX_H__ */ 33 | -------------------------------------------------------------------------------- /u-boot/common/cmd_mmc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Kyle Harris, kharris@nexus-tech.net 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 | 27 | #if (CONFIG_COMMANDS & CFG_CMD_MMC) 28 | 29 | #include 30 | 31 | int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) 32 | { 33 | if (mmc_init (1) != 0) { 34 | printf ("No MMC card found\n"); 35 | return 1; 36 | } 37 | return 0; 38 | } 39 | 40 | U_BOOT_CMD( 41 | mmcinit, 1, 0, do_mmc, 42 | "mmcinit - init mmc card\n", 43 | NULL 44 | ); 45 | 46 | #endif /* CFG_CMD_MMC */ 47 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/config.mk: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | v=$(shell \ 24 | mips-linux-as --version|grep "GNU assembler"|awk '{print $$3}'|awk -F . '{print $$2}') 25 | #MIPSFLAGS=$(shell \ 26 | if [ "$v" -lt "14" ]; then \ 27 | echo "-mcpu=4kc"; \ 28 | else \ 29 | echo "-march=4kc -mtune=4kc"; \ 30 | fi) 31 | 32 | ifneq (,$(findstring 4KCle,$(CROSS_COMPILE))) 33 | ENDIANNESS = -EL 34 | #else 35 | #ENDIANNESS = -EB 36 | endif 37 | 38 | MIPSFLAGS += $(ENDIANNESS) -mabicalls -march=mips32r2 39 | 40 | PLATFORM_CPPFLAGS += $(MIPSFLAGS) 41 | -------------------------------------------------------------------------------- /u-boot/include/LzmaWrapper.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | ** 3 | ** FILE NAME : LzmaWrapper.h 4 | ** PROJECT : bootloader 5 | ** MODULES : U-boot 6 | ** 7 | ** DATE : 2 Nov 2006 8 | ** AUTHOR : Lin Mars 9 | ** DESCRIPTION : LZMA decoder support for U-boot 1.1.5 10 | ** COPYRIGHT : Copyright (c) 2006 11 | ** Infineon Technologies AG 12 | ** Am Campeon 1-12, 85579 Neubiberg, Germany 13 | ** 14 | ** This program is free software; you can redistribute it and/or modify 15 | ** it under the terms of the GNU General Public License as published by 16 | ** the Free Software Foundation; either version 2 of the License, or 17 | ** (at your option) any later version. 18 | ** 19 | ** HISTORY 20 | ** $Date $Author $Comment 21 | ** 2 Nov 2006 Lin Mars init version which derived from LzmaTest.c from 22 | ** LZMA v4.43 SDK 23 | *******************************************************************************/ 24 | #ifndef __LZMA_WRAPPER_H__ 25 | #define __LZMA_WRAPPER_H__ 26 | 27 | #ifndef LZMA_RESULT_OK 28 | #define LZMA_RESULT_OK 0 29 | #endif 30 | #ifndef LZMA_RESULT_DATA_ERROR 31 | #define LZMA_RESULT_DATA_ERROR 1 32 | #endif 33 | 34 | extern int lzma_inflate(unsigned char *source, int s_len, unsigned char *dest, int *d_len); 35 | 36 | #endif /*__LZMA_WRAPPER_H__*/ 37 | -------------------------------------------------------------------------------- /u-boot/rtc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2001-2004 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | #CFLAGS += -DDEBUG 27 | 28 | LIB = librtc.a 29 | 30 | OBJS = date.o 31 | 32 | all: $(LIB) 33 | 34 | $(LIB): $(START) $(OBJS) 35 | $(AR) crv $@ $(OBJS) 36 | 37 | ######################################################################### 38 | 39 | .depend: Makefile $(OBJS:.o=.c) 40 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 41 | 42 | sinclude .depend 43 | 44 | ######################################################################### 45 | -------------------------------------------------------------------------------- /u-boot/fs/fat/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # See file CREDITS for list of people who contributed to this 4 | # project. 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License as 8 | # published by the Free Software Foundation; either version 2 of 9 | # the License, or (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 19 | # MA 02111-1307 USA 20 | # 21 | 22 | TOPDIR=../../ 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = libfat.a 27 | 28 | AOBJS = 29 | COBJS = fat.o file.o 30 | 31 | OBJS = $(AOBJS) $(COBJS) 32 | 33 | all: $(LIB) $(AOBJS) 34 | 35 | $(LIB): .depend $(OBJS) 36 | $(AR) crv $@ $(OBJS) 37 | 38 | 39 | ######################################################################### 40 | 41 | .depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) 42 | $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@ 43 | 44 | sinclude .depend 45 | 46 | ######################################################################### 47 | -------------------------------------------------------------------------------- /u-boot/post/rules.mk: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2002 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | OBJS = $(AOBJS) $(COBJS) 27 | 28 | CPPFLAGS += -I$(TOPDIR) 29 | 30 | all: $(LIB) 31 | 32 | $(LIB): .depend $(OBJS) 33 | $(AR) crv $@ $(OBJS) 34 | 35 | ######################################################################### 36 | 37 | .depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) 38 | $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > .depend 39 | 40 | sinclude .depend 41 | 42 | ######################################################################### 43 | -------------------------------------------------------------------------------- /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/lib_mips/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = lib$(ARCH).a 27 | 28 | AOBJS = 29 | 30 | COBJS = board.o time.o mips_linux.o 31 | 32 | OBJS = $(AOBJS) $(COBJS) 33 | 34 | $(LIB): .depend $(OBJS) 35 | $(AR) crv $@ $(OBJS) 36 | 37 | ######################################################################### 38 | 39 | .depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) 40 | $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@ 41 | 42 | sinclude .depend 43 | 44 | ######################################################################### 45 | -------------------------------------------------------------------------------- /u-boot/disk/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | #CFLAGS += -DET_DEBUG -DDEBUG 27 | 28 | LIB = libdisk.a 29 | 30 | #OBJS = part.o part_mac.o part_dos.o part_iso.o part_amiga.o 31 | OBJS = part.o part_dos.o 32 | 33 | all: $(LIB) 34 | 35 | $(LIB): $(START) $(OBJS) 36 | $(AR) crv $@ $(OBJS) 37 | 38 | ######################################################################### 39 | 40 | .depend: Makefile $(OBJS:.o=.c) 41 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 42 | 43 | sinclude .depend 44 | 45 | ######################################################################### 46 | -------------------------------------------------------------------------------- /u-boot/drivers/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000-2004 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | # CFLAGS += -DET_DEBUG -DDEBUG 27 | 28 | LIB = libdrivers.a 29 | 30 | OBJS = pci.o netconsole.o 31 | OBJS = usb/host/ehci-hcd.o usb/host/ehci-ar9331.o 32 | 33 | 34 | all: $(LIB) 35 | 36 | $(LIB): $(OBJS) 37 | $(AR) crv $@ $(OBJS) 38 | 39 | ######################################################################### 40 | 41 | .depend: Makefile $(OBJS:.o=.c) 42 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 43 | 44 | sinclude .depend 45 | 46 | ######################################################################### 47 | -------------------------------------------------------------------------------- /u-boot/post/dsp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2004 3 | * Pantelis Antoniou, Intracom S.A. , panto@intracom.gr 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 | * DSP test 28 | * 29 | * This test verifies the connection and performs a memory test 30 | * on any connected DSP(s). The meat of the work is done 31 | * in the board specific function. 32 | */ 33 | 34 | #ifdef CONFIG_POST 35 | 36 | #include 37 | 38 | #if CONFIG_POST & CFG_POST_DSP 39 | 40 | extern int board_post_dsp(int flags); 41 | 42 | int dsp_post_test (int flags) 43 | { 44 | return board_post_dsp(flags); 45 | } 46 | 47 | #endif /* CONFIG_POST & CFG_POST_DSP */ 48 | #endif /* CONFIG_POST */ 49 | -------------------------------------------------------------------------------- /u-boot/include/logbuff.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2002 3 | * Detlev Zundel, dzu@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | #ifndef _LOGBUFF_H 24 | #define _LOGBUFF_H 25 | 26 | #ifdef CONFIG_LOGBUFFER 27 | 28 | #define LOGBUFF_LEN (16384) /* Must be 16k right now */ 29 | #define LOGBUFF_MASK (LOGBUFF_LEN-1) 30 | #define LOGBUFF_OVERHEAD (4096) /* Logbuffer overhead for extra info */ 31 | #define LOGBUFF_RESERVE (LOGBUFF_LEN+LOGBUFF_OVERHEAD) 32 | 33 | #define LOGBUFF_INITIALIZED (1<<31) 34 | 35 | int drv_logbuff_init (void); 36 | void logbuff_init_ptrs (void); 37 | void logbuff_log(char *msg); 38 | void logbuff_reset (void); 39 | 40 | #endif /* CONFIG_LOGBUFFER */ 41 | 42 | #endif /* _LOGBUFF_H */ 43 | -------------------------------------------------------------------------------- /u-boot/fs/ext2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Pavel Bartusek, Sysgo Real-Time Solutions AG, pba@sysgo.de 4 | # 5 | # 6 | # See file CREDITS for list of people who contributed to this 7 | # project. 8 | # 9 | # This program is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License as 11 | # published by the Free Software Foundation; either version 2 of 12 | # the License, or (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program; if not, write to the Free Software 21 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 22 | # MA 02111-1307 USA 23 | # 24 | 25 | include $(TOPDIR)/config.mk 26 | 27 | LIB = libext2fs.a 28 | 29 | AOBJS = 30 | COBJS = ext2fs.o dev.o 31 | OBJS = $(AOBJS) $(COBJS) 32 | 33 | #CPPFLAGS += 34 | 35 | all: $(LIB) $(AOBJS) 36 | 37 | $(LIB): .depend $(OBJS) 38 | $(AR) crv $@ $(OBJS) 39 | 40 | 41 | ######################################################################### 42 | 43 | .depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) 44 | $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@ 45 | 46 | sinclude .depend 47 | 48 | ######################################################################### 49 | -------------------------------------------------------------------------------- /u-boot/fs/cramfs/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000, 2001 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = libcramfs.a 27 | 28 | AOBJS = 29 | COBJS = cramfs.o uncompress.o 30 | OBJS = $(AOBJS) $(COBJS) 31 | 32 | #CPPFLAGS += 33 | 34 | all: $(LIB) $(AOBJS) 35 | 36 | $(LIB): .depend $(OBJS) 37 | $(AR) crv $@ $(OBJS) 38 | 39 | 40 | ######################################################################### 41 | 42 | .depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) 43 | $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@ 44 | 45 | sinclude .depend 46 | 47 | ######################################################################### 48 | -------------------------------------------------------------------------------- /u-boot/post/codec.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2004 3 | * Pantelis Antoniou, Intracom S.A. , panto@intracom.gr 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 | * CODEC test 28 | * 29 | * This test verifies the connection and performs a memory test 30 | * on any connected codec(s). The meat of the work is done 31 | * in the board specific function. 32 | */ 33 | 34 | #ifdef CONFIG_POST 35 | 36 | #include 37 | 38 | #if CONFIG_POST & CFG_POST_CODEC 39 | 40 | extern int board_post_codec(int flags); 41 | 42 | int codec_post_test (int flags) 43 | { 44 | return board_post_codec(flags); 45 | } 46 | 47 | #endif /* CONFIG_POST & CFG_POST_CODEC */ 48 | #endif /* CONFIG_POST */ 49 | -------------------------------------------------------------------------------- /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/fs/reiserfs/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Pavel Bartusek, Sysgo Real-Time Solutions AG, pba@sysgo.de 4 | # 5 | # 6 | # See file CREDITS for list of people who contributed to this 7 | # project. 8 | # 9 | # This program is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License as 11 | # published by the Free Software Foundation; either version 2 of 12 | # the License, or (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program; if not, write to the Free Software 21 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 22 | # MA 02111-1307 USA 23 | # 24 | 25 | include $(TOPDIR)/config.mk 26 | 27 | LIB = libreiserfs.a 28 | 29 | AOBJS = 30 | COBJS = reiserfs.o dev.o mode_string.o 31 | OBJS = $(AOBJS) $(COBJS) 32 | 33 | #CPPFLAGS += 34 | 35 | all: $(LIB) $(AOBJS) 36 | 37 | $(LIB): .depend $(OBJS) 38 | $(AR) crv $@ $(OBJS) 39 | 40 | 41 | ######################################################################### 42 | 43 | .depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) 44 | $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@ 45 | 46 | sinclude .depend 47 | 48 | ######################################################################### 49 | -------------------------------------------------------------------------------- /u-boot/include/circbuf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Gerry Hamel, geh@ti.com, Texas Instruments 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | */ 20 | 21 | #ifndef __CIRCBUF_H__ 22 | #define __CIRCBUF_H__ 23 | 24 | typedef struct circbuf { 25 | unsigned int size; /* current number of bytes held */ 26 | unsigned int totalsize; /* number of bytes allocated */ 27 | 28 | char *top; /* pointer to current buffer start */ 29 | char *tail; /* pointer to space for next element */ 30 | 31 | char *data; /* all data */ 32 | char *end; /* end of data buffer */ 33 | } circbuf_t; 34 | 35 | int buf_init (circbuf_t * buf, unsigned int size); 36 | int buf_free (circbuf_t * buf); 37 | int buf_pop (circbuf_t * buf, char *dest, unsigned int len); 38 | int buf_push (circbuf_t * buf, const char *src, unsigned int len); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /u-boot/net/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | # CFLAGS += -DET_DEBUG -DDEBUG 27 | 28 | LIB = libnet.a 29 | 30 | ifeq ($(COMPRESSED_UBOOT),1) 31 | OBJS = net.o tftp.o rarp.o eth.o 32 | else 33 | OBJS = net.o tftp.o bootp.o rarp.o eth.o nfs.o sntp.o 34 | endif 35 | 36 | all: $(LIB) 37 | 38 | $(LIB): $(START) $(OBJS) 39 | $(AR) crv $@ $(OBJS) 40 | 41 | ######################################################################### 42 | 43 | .depend: Makefile $(OBJS:.o=.c) 44 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 45 | 46 | sinclude .depend 47 | 48 | ######################################################################### 49 | -------------------------------------------------------------------------------- /u-boot/drivers/netarm_eth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003 IMMS gGmbH 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 of 7 | * the License, or (at your option) any later version. 8 | * 9 | * This program 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 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 17 | * MA 02111-1307 USA 18 | * 19 | * author(s): Thomas Elste, 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | #ifdef CONFIG_DRIVER_NETARMETH 26 | 27 | #define SET_EADDR(ad,val) *(volatile unsigned int*)(ad + NETARM_ETH_MODULE_BASE) = val 28 | #define GET_EADDR(ad) (*(volatile unsigned int*)(ad + NETARM_ETH_MODULE_BASE)) 29 | 30 | #define NA_MII_POLL_BUSY_DELAY 900 31 | 32 | /* MII negotiation timeout value 33 | 500 jiffies = 5 seconds */ 34 | #define NA_MII_NEGOTIATE_DELAY 30 35 | 36 | /* Registers in the physical layer chip */ 37 | #define MII_PHY_CONTROL 0 38 | #define MII_PHY_STATUS 1 39 | #define MII_PHY_ID 2 40 | #define MII_PHY_AUTONEGADV 4 41 | 42 | #endif /* CONFIG_DRIVER_NETARMETH */ 43 | -------------------------------------------------------------------------------- /u-boot/tools/env/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 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 | SOURCES := crc32.c fw_env.c fw_env_main.c 25 | HEADERS := fw_env.h 26 | 27 | all: fw_printenv 28 | 29 | fw_printenv: $(SOURCES) $(HEADERS) 30 | $(CROSS_COMPILE)gcc -Wall -DUSE_HOSTCC $(SOURCES) -o fw_printenv 31 | 32 | clean: 33 | rm -f fw_printenv crc32.c 34 | 35 | crc32.c: 36 | ln -s ../../lib_generic/crc32.c crc32.c 37 | 38 | ######################################################################### 39 | 40 | .depend: Makefile $(SOURCES) 41 | $(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -DUSE_HOSTCC $(SOURCES) > $@ 42 | 43 | sinclude .depend 44 | 45 | ######################################################################### 46 | -------------------------------------------------------------------------------- /u-boot/include/linux/unaligned/access_ok.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_UNALIGNED_ACCESS_OK_H 2 | #define _LINUX_UNALIGNED_ACCESS_OK_H 3 | 4 | #include 5 | 6 | static inline u16 get_unaligned_le16(const void *p) 7 | { 8 | return le16_to_cpup((__le16 *)p); 9 | } 10 | 11 | static inline u32 get_unaligned_le32(const void *p) 12 | { 13 | return le32_to_cpup((__le32 *)p); 14 | } 15 | 16 | static inline u64 get_unaligned_le64(const void *p) 17 | { 18 | return le64_to_cpup((__le64 *)p); 19 | } 20 | 21 | static inline u16 get_unaligned_be16(const void *p) 22 | { 23 | return be16_to_cpup((__be16 *)p); 24 | } 25 | 26 | static inline u32 get_unaligned_be32(const void *p) 27 | { 28 | return be32_to_cpup((__be32 *)p); 29 | } 30 | 31 | static inline u64 get_unaligned_be64(const void *p) 32 | { 33 | return be64_to_cpup((__be64 *)p); 34 | } 35 | 36 | static inline void put_unaligned_le16(u16 val, void *p) 37 | { 38 | *((__le16 *)p) = cpu_to_le16(val); 39 | } 40 | 41 | static inline void put_unaligned_le32(u32 val, void *p) 42 | { 43 | *((__le32 *)p) = cpu_to_le32(val); 44 | } 45 | 46 | static inline void put_unaligned_le64(u64 val, void *p) 47 | { 48 | *((__le64 *)p) = cpu_to_le64(val); 49 | } 50 | 51 | static inline void put_unaligned_be16(u16 val, void *p) 52 | { 53 | *((__be16 *)p) = cpu_to_be16(val); 54 | } 55 | 56 | static inline void put_unaligned_be32(u32 val, void *p) 57 | { 58 | *((__be32 *)p) = cpu_to_be32(val); 59 | } 60 | 61 | static inline void put_unaligned_be64(u64 val, void *p) 62 | { 63 | *((__be64 *)p) = cpu_to_be64(val); 64 | } 65 | 66 | #endif /* _LINUX_UNALIGNED_ACCESS_OK_H */ 67 | -------------------------------------------------------------------------------- /u-boot/include/usb/lin_gadget_compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Samsung Electronics 3 | * Lukasz Majewski 4 | * 5 | * This is a Linux kernel compatibility layer for USB Gadget 6 | * 7 | * SPDX-License-Identifier: GPL-2.0+ 8 | */ 9 | 10 | #ifndef __LIN_COMPAT_H__ 11 | #define __LIN_COMPAT_H__ 12 | 13 | #include 14 | 15 | /* common */ 16 | #define spin_lock_init(...) 17 | #define spin_lock(...) 18 | #define spin_lock_irqsave(lock, flags) do { debug("%lu\n", flags); } while (0) 19 | #define spin_unlock(...) 20 | #define spin_unlock_irqrestore(lock, flags) do {flags = 0; } while (0) 21 | #define disable_irq(...) 22 | #define enable_irq(...) 23 | 24 | #define mutex_init(...) 25 | #define mutex_lock(...) 26 | #define mutex_unlock(...) 27 | 28 | #define GFP_KERNEL 0 29 | 30 | #define IRQ_HANDLED 1 31 | 32 | #define ENOTSUPP 524 /* Operation is not supported */ 33 | 34 | #define BITS_PER_BYTE 8 35 | #define BITS_TO_LONGS(nr) \ 36 | DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) 37 | #define DECLARE_BITMAP(name, bits) \ 38 | unsigned long name[BITS_TO_LONGS(bits)] 39 | 40 | #define small_const_nbits(nbits) \ 41 | (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) 42 | 43 | static inline void bitmap_zero(unsigned long *dst, int nbits) 44 | { 45 | if (small_const_nbits(nbits)) 46 | *dst = 0UL; 47 | else { 48 | int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); 49 | memset(dst, 0, len); 50 | } 51 | } 52 | 53 | #define dma_cache_maint(addr, size, mode) cache_flush() 54 | void cache_flush(void); 55 | 56 | #endif /* __LIN_COMPAT_H__ */ 57 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/carambola2/carambola_factory.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define XMK_STR(x) #x 5 | #define MK_STR(x) XMK_STR(x) 6 | 7 | static void carambola_factory_load_image(void) 8 | { 9 | char *filename = CFG_C2_IMG_FILENAME; 10 | int tftp_ret; 11 | 12 | int argc_tftp = 3; 13 | char* argv_tftp[] = {"tftpboot", CFG_C2_IMG_LOAD_ADDR, filename}; 14 | 15 | int argc_bootm = 2; 16 | char* argv_bootm[] = {"bootm", CFG_C2_IMG_LOAD_ADDR}; 17 | 18 | if (!getenv ("ipaddr")) 19 | setenv("ipaddr", MK_STR(CONFIG_IPADDR)); 20 | 21 | if (!getenv ("serverip")) 22 | setenv("serverip", MK_STR(CONFIG_SERVERIP)); 23 | 24 | //Workaround for slow TFTP: 25 | //wake-up network stack with ping to server 26 | char *serverip = getenv ("serverip"); 27 | char ping_command[32]="ping "; 28 | strncpy(ping_command+5, serverip, 16); 29 | run_command(ping_command, NULL); 30 | //end of workaround 31 | 32 | setenv("netretry", "once"); // Try once, reboot after 33 | tftp_ret=do_tftpb (NULL, 0, argc_tftp, argv_tftp); 34 | if (0 == tftp_ret) { 35 | printf("Booting TFTP image...\n"); 36 | do_bootm(NULL, 0, argc_bootm, argv_bootm); 37 | do_reset(NULL, 0, 0, NULL); 38 | } 39 | else{ 40 | printf("Error getting TFTP image. Rebooting...\n"); 41 | do_reset(NULL, 0, 0, NULL); 42 | } 43 | return; 44 | } 45 | 46 | 47 | void carambola_factory_mode(void) 48 | { 49 | char* production_env = getenv("production"); 50 | 51 | if (production_env){ 52 | if (strncmp(production_env, "yes", 3) == 0){ 53 | carambola_factory_load_image(); 54 | } 55 | } 56 | return; 57 | } 58 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = lib$(CPU).a 27 | 28 | ifeq ($(COMRESSED_UBOOT),1) 29 | START = start.o start_bootstrap.o 30 | else 31 | START = start.o 32 | endif 33 | 34 | OBJS = cpu.o interrupts.o 35 | SOBJS = cache.o 36 | 37 | all: .depend $(START) $(LIB) 38 | 39 | $(LIB): $(OBJS) $(SOBJS) 40 | $(AR) crv $@ $(OBJS) $(SOBJS) 41 | 42 | ######################################################################### 43 | 44 | .depend: Makefile $(START:.o=.S) $(OBJS:.o=.c) 45 | $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@ 46 | 47 | sinclude .depend 48 | 49 | ######################################################################### 50 | -------------------------------------------------------------------------------- /u-boot/cpu/mips/Makefile.orig: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = lib$(CPU).a 27 | 28 | START = start.o 29 | OBJS = asc_serial.o au1x00_serial.o au1x00_eth.o au1x00_usb_ohci.o \ 30 | cpu.o interrupts.o incaip_clock.o 31 | SOBJS = incaip_wdt.o cache.o 32 | 33 | all: .depend $(START) $(LIB) 34 | 35 | $(LIB): $(OBJS) $(SOBJS) 36 | $(AR) crv $@ $(OBJS) $(SOBJS) 37 | 38 | ######################################################################### 39 | 40 | .depend: Makefile $(START:.o=.S) $(OBJS:.o=.c) 41 | $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@ 42 | 43 | sinclude .depend 44 | 45 | ######################################################################### 46 | -------------------------------------------------------------------------------- /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 DENX Software Engineering, Wolfgang Denk 9 | # 10 | 11 | APPEND=no # Default: Create new config file 12 | 13 | while [ $# -gt 0 ] ; do 14 | case "$1" in 15 | --) shift ; break ;; 16 | -a) shift ; APPEND=yes ;; 17 | *) break ;; 18 | esac 19 | done 20 | 21 | [ $# -lt 4 ] && exit 1 22 | [ $# -gt 6 ] && exit 1 23 | 24 | echo "Configuring for $1 board..." 25 | 26 | cd ./include 27 | 28 | # 29 | # Create link to architecture specific headers 30 | # 31 | rm -f asm 32 | ln -s asm-$2 asm 33 | rm -f asm-$2/arch 34 | 35 | if [ -z "$6" -o "$6" = "NULL" ] ; then 36 | ln -s arch-$3 asm-$2/arch 37 | else 38 | ln -s arch-$6 asm-$2/arch 39 | fi 40 | 41 | if [ "$2" = "arm" ] ; then 42 | rm -f asm-$2/proc 43 | ln -s proc-armv asm-$2/proc 44 | fi 45 | 46 | # 47 | # Create include file for Make 48 | # 49 | echo "ARCH = $2" > config.mk 50 | echo "CPU = $3" >> config.mk 51 | echo "BOARD = $4" >> config.mk 52 | 53 | [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk 54 | 55 | [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk 56 | 57 | # 58 | # Create board specific header file 59 | # 60 | if [ "$APPEND" = "yes" ] # Append to existing config file 61 | then 62 | echo >> config.h 63 | else 64 | > config.h # Create new config file 65 | fi 66 | echo "/* Automatically generated - do not edit */" >>config.h 67 | echo "#include " >>config.h 68 | 69 | exit 0 70 | -------------------------------------------------------------------------------- /u-boot/fs/jffs2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000, 2001 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = libjffs2.a 27 | 28 | AOBJS = 29 | COBJS = jffs2_1pass.o compr_rtime.o compr_rubin.o compr_zlib.o mini_inflate.o 30 | COBJS += compr_lzo.o compr_lzari.o 31 | OBJS = $(AOBJS) $(COBJS) 32 | 33 | #CPPFLAGS += 34 | 35 | all: $(LIB) $(AOBJS) 36 | 37 | $(LIB): .depend $(OBJS) 38 | $(AR) crv $@ $(OBJS) 39 | 40 | 41 | ######################################################################### 42 | 43 | .depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) 44 | $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@ 45 | 46 | sinclude .depend 47 | 48 | ######################################################################### 49 | -------------------------------------------------------------------------------- /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/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 | }; 58 | 59 | extern void SntpStart (void); /* Begin SNTP */ 60 | 61 | #endif /* __SNTP_H__ */ 62 | -------------------------------------------------------------------------------- /u-boot/tools/env/README: -------------------------------------------------------------------------------- 1 | 2 | This is a demo implementation of a Linux command line tool to access 3 | the U-Boot's environment variables. 4 | 5 | For the run-time utiltity configuration uncomment the line 6 | #define CONFIG_FILE "/etc/fw_env.config" 7 | in fw_env.h. 8 | 9 | See comments in the fw_env.config file for definitions for the 10 | particular board. 11 | 12 | Configuration can also be done via #defines in the fw_env.h file. The 13 | following lines are relevant: 14 | 15 | #define HAVE_REDUND /* For systems with 2 env sectors */ 16 | #define DEVICE1_NAME "/dev/mtd1" 17 | #define DEVICE2_NAME "/dev/mtd2" 18 | #define DEVICE1_OFFSET 0x0000 19 | #define ENV1_SIZE 0x4000 20 | #define DEVICE1_ESIZE 0x4000 21 | #define DEVICE2_OFFSET 0x0000 22 | #define ENV2_SIZE 0x4000 23 | #define DEVICE2_ESIZE 0x4000 24 | 25 | Current configuration matches the environment layout of the TRAB 26 | board. 27 | 28 | Un-define HAVE_REDUND, if you want to use the utlities on a system 29 | that does not have support for redundant environment enabled. 30 | If HAVE_REDUND is undefined, DEVICE2_NAME is ignored, 31 | as is ENV2_SIZE and DEVICE2_ESIZE. 32 | 33 | The DEVICEx_NAME constants define which MTD character devices are to 34 | be used to access the environment. 35 | 36 | The DEVICEx_OFFSET constants define the environment offset within the 37 | MTD character device. 38 | 39 | ENVx_SIZE defines the size in bytes taken by the environment, which 40 | may be less then flash sector size, if the environment takes less 41 | then 1 sector. 42 | 43 | DEVICEx_ESIZE defines the size of the first sector in the flash 44 | partition where the environment resides. 45 | -------------------------------------------------------------------------------- /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 | #define zero $0 /* wired zero */ 18 | #define AT $1 /* assembler temp - uppercase because of ".set at" */ 19 | #define v0 $2 /* return value */ 20 | #define v1 $3 21 | #define a0 $4 /* argument registers */ 22 | #define a1 $5 23 | #define a2 $6 24 | #define a3 $7 25 | #define t0 $8 /* caller saved */ 26 | #define t1 $9 27 | #define t2 $10 28 | #define t3 $11 29 | #define t4 $12 30 | #define t5 $13 31 | #define t6 $14 32 | #define t7 $15 33 | #define s0 $16 /* callee saved */ 34 | #define s1 $17 35 | #define s2 $18 36 | #define s3 $19 37 | #define s4 $20 38 | #define s5 $21 39 | #define s6 $22 40 | #define s7 $23 41 | #define t8 $24 /* caller saved */ 42 | #define t9 $25 43 | #define jp $25 /* PIC jump register */ 44 | #define k0 $26 /* kernel scratch */ 45 | #define k1 $27 46 | #define gp $28 /* global pointer */ 47 | #define sp $29 /* stack pointer */ 48 | #define fp $30 /* frame pointer */ 49 | #define s8 $30 /* same like fp! */ 50 | #define ra $31 /* return address */ 51 | 52 | #endif /* __ASM_MIPS_REGDEF_H */ 53 | -------------------------------------------------------------------------------- /u-boot/include/usb/pxa27x_udc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PXA27x register declarations and HCD data structures 3 | * 4 | * Copyright (C) 2007 Rodolfo Giometti 5 | * Copyright (C) 2007 Eurotech S.p.A. 6 | * 7 | * SPDX-License-Identifier: GPL-2.0+ 8 | */ 9 | 10 | 11 | #ifndef __PXA270X_UDC_H__ 12 | #define __PXA270X_UDC_H__ 13 | 14 | #include 15 | 16 | /* Endpoint 0 states */ 17 | #define EP0_IDLE 0 18 | #define EP0_IN_DATA 1 19 | #define EP0_OUT_DATA 2 20 | #define EP0_XFER_COMPLETE 3 21 | 22 | 23 | /* Endpoint parameters */ 24 | #define MAX_ENDPOINTS 4 25 | #define EP_MAX_PACKET_SIZE 64 26 | 27 | #define EP0_MAX_PACKET_SIZE 16 28 | #define UDC_OUT_ENDPOINT 0x02 29 | #define UDC_OUT_PACKET_SIZE EP_MAX_PACKET_SIZE 30 | #define UDC_IN_ENDPOINT 0x01 31 | #define UDC_IN_PACKET_SIZE EP_MAX_PACKET_SIZE 32 | #define UDC_INT_ENDPOINT 0x05 33 | #define UDC_INT_PACKET_SIZE EP_MAX_PACKET_SIZE 34 | #define UDC_BULK_PACKET_SIZE EP_MAX_PACKET_SIZE 35 | 36 | void udc_irq(void); 37 | /* Flow control */ 38 | void udc_set_nak(int epid); 39 | void udc_unset_nak(int epid); 40 | 41 | /* Higher level functions for abstracting away from specific device */ 42 | int udc_endpoint_write(struct usb_endpoint_instance *endpoint); 43 | 44 | int udc_init(void); 45 | 46 | void udc_enable(struct usb_device_instance *device); 47 | void udc_disable(void); 48 | 49 | void udc_connect(void); 50 | void udc_disconnect(void); 51 | 52 | void udc_startup_events(struct usb_device_instance *device); 53 | void udc_setup_ep(struct usb_device_instance *device, 54 | unsigned int ep, struct usb_endpoint_instance *endpoint); 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /u-boot/lib_generic/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000-2002 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = libgeneric.a 27 | 28 | ifeq ($(COMPRESSED_UBOOT),1) 29 | OBJS = crc32.o ctype.o display_options.o ldiv.o \ 30 | string.o vsprintf.o LzmaWrapper.o LzmaDecode.o 31 | else 32 | OBJS = crc32.o ctype.o display_options.o ldiv.o \ 33 | string.o vsprintf.o zlib.o LzmaDecode.o LzmaWrapper.o 34 | endif 35 | 36 | CFLAGS += -DCONFIG_LZMA=1 37 | 38 | 39 | $(LIB): .depend $(OBJS) 40 | $(AR) crv $@ $(OBJS) 41 | 42 | ######################################################################### 43 | 44 | .depend: Makefile $(OBJS:.o=.c) 45 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 46 | 47 | sinclude .depend 48 | 49 | ######################################################################### 50 | -------------------------------------------------------------------------------- /u-boot/tools/gen_eth_addr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2001 3 | * Murray Jensen 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 | int 30 | main(int argc, char *argv[]) 31 | { 32 | unsigned long ethaddr_low, ethaddr_high; 33 | 34 | srandom(time(0) | getpid()); 35 | 36 | /* 37 | * setting the 2nd LSB in the most significant byte of 38 | * the address makes it a locally administered ethernet 39 | * address 40 | */ 41 | ethaddr_high = (random() & 0xfeff) | 0x0200; 42 | ethaddr_low = random(); 43 | 44 | printf("%02lx:%02lx:%02lx:%02lx:%02lx:%02lx\n", 45 | ethaddr_high >> 8, ethaddr_high & 0xff, 46 | ethaddr_low >> 24, (ethaddr_low >> 16) & 0xff, 47 | (ethaddr_low >> 8) & 0xff, ethaddr_low & 0xff); 48 | 49 | return (0); 50 | } 51 | -------------------------------------------------------------------------------- /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/cpu/mips/ar7240/ag7240_phy.h: -------------------------------------------------------------------------------- 1 | #ifndef _AG7240_PHY_H 2 | #define _AG7240_PHY_H 3 | 4 | static inline void ag7240_phy_setup(int unit) 5 | { 6 | #ifdef CONFIG_AR7242_S16_PHY 7 | if ((is_ar7242() || is_wasp()) && (unit==0)) { 8 | athrs16_phy_setup(unit); 9 | } else 10 | #endif 11 | { 12 | athrs26_phy_setup(unit); 13 | #ifdef CONFIG_F1E_PHY 14 | athr_phy_setup(unit); 15 | #endif 16 | } 17 | } 18 | 19 | static inline void ag7240_phy_link(int unit, int *link) 20 | { 21 | #ifdef CONFIG_AR7242_S16_PHY 22 | if ((is_ar7242() || is_wasp()) && (unit==0)) { 23 | *link = athrs16_phy_is_up(unit); 24 | } else 25 | #endif 26 | { 27 | #ifdef CFG_ATHRS27_PHY 28 | *link = athrs27_phy_is_up(unit); 29 | #endif 30 | #ifdef CFG_ATHRS26_PHY 31 | *link = athrs26_phy_is_up(unit); 32 | #endif 33 | #ifdef CONFIG_F1E_PHY 34 | *link = athr_phy_is_up(unit); 35 | #endif 36 | } 37 | } 38 | 39 | static inline void ag7240_phy_duplex(int unit, int *duplex) 40 | { 41 | #ifdef CONFIG_AR7242_S16_PHY 42 | if ((is_ar7242() || is_wasp()) && (unit==0)) { 43 | *duplex = athrs16_phy_is_fdx(unit); 44 | } else 45 | #endif 46 | { 47 | *duplex = athrs26_phy_is_fdx(unit); 48 | #ifdef CONFIG_F1E_PHY 49 | *duplex = athr_phy_is_fdx(unit); 50 | #endif 51 | } 52 | } 53 | 54 | static inline void ag7240_phy_speed(int unit, int *speed) 55 | { 56 | #ifdef CONFIG_AR7242_S16_PHY 57 | if ((is_ar7242() || is_wasp()) && (unit==0)) { 58 | *speed = athrs16_phy_speed(unit); 59 | } else 60 | #endif 61 | { 62 | *speed = athrs26_phy_speed(unit); 63 | #ifdef CONFIG_F1E_PHY 64 | *speed = athr_phy_speed(unit); 65 | #endif 66 | } 67 | } 68 | 69 | #endif /*_AG7240_PHY_H*/ 70 | -------------------------------------------------------------------------------- /u-boot/include/linux/unaligned/be_byteshift.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_UNALIGNED_BE_BYTESHIFT_H 2 | #define _LINUX_UNALIGNED_BE_BYTESHIFT_H 3 | 4 | #include 5 | 6 | static inline u16 __get_unaligned_be16(const u8 *p) 7 | { 8 | return p[0] << 8 | p[1]; 9 | } 10 | 11 | static inline u32 __get_unaligned_be32(const u8 *p) 12 | { 13 | return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]; 14 | } 15 | 16 | static inline u64 __get_unaligned_be64(const u8 *p) 17 | { 18 | return (u64)__get_unaligned_be32(p) << 32 | 19 | __get_unaligned_be32(p + 4); 20 | } 21 | 22 | static inline void __put_unaligned_be16(u16 val, u8 *p) 23 | { 24 | *p++ = val >> 8; 25 | *p++ = val; 26 | } 27 | 28 | static inline void __put_unaligned_be32(u32 val, u8 *p) 29 | { 30 | __put_unaligned_be16(val >> 16, p); 31 | __put_unaligned_be16(val, p + 2); 32 | } 33 | 34 | static inline void __put_unaligned_be64(u64 val, u8 *p) 35 | { 36 | __put_unaligned_be32(val >> 32, p); 37 | __put_unaligned_be32(val, p + 4); 38 | } 39 | 40 | static inline u16 get_unaligned_be16(const void *p) 41 | { 42 | return __get_unaligned_be16((const u8 *)p); 43 | } 44 | 45 | static inline u32 get_unaligned_be32(const void *p) 46 | { 47 | return __get_unaligned_be32((const u8 *)p); 48 | } 49 | 50 | static inline u64 get_unaligned_be64(const void *p) 51 | { 52 | return __get_unaligned_be64((const u8 *)p); 53 | } 54 | 55 | static inline void put_unaligned_be16(u16 val, void *p) 56 | { 57 | __put_unaligned_be16(val, p); 58 | } 59 | 60 | static inline void put_unaligned_be32(u32 val, void *p) 61 | { 62 | __put_unaligned_be32(val, p); 63 | } 64 | 65 | static inline void put_unaligned_be64(u64 val, void *p) 66 | { 67 | __put_unaligned_be64(val, p); 68 | } 69 | 70 | #endif /* _LINUX_UNALIGNED_BE_BYTESHIFT_H */ 71 | -------------------------------------------------------------------------------- /u-boot/include/linux/unaligned/le_byteshift.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_UNALIGNED_LE_BYTESHIFT_H 2 | #define _LINUX_UNALIGNED_LE_BYTESHIFT_H 3 | 4 | #include 5 | 6 | static inline u16 __get_unaligned_le16(const u8 *p) 7 | { 8 | return p[0] | p[1] << 8; 9 | } 10 | 11 | static inline u32 __get_unaligned_le32(const u8 *p) 12 | { 13 | return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24; 14 | } 15 | 16 | static inline u64 __get_unaligned_le64(const u8 *p) 17 | { 18 | return (u64)__get_unaligned_le32(p + 4) << 32 | 19 | __get_unaligned_le32(p); 20 | } 21 | 22 | static inline void __put_unaligned_le16(u16 val, u8 *p) 23 | { 24 | *p++ = val; 25 | *p++ = val >> 8; 26 | } 27 | 28 | static inline void __put_unaligned_le32(u32 val, u8 *p) 29 | { 30 | __put_unaligned_le16(val >> 16, p + 2); 31 | __put_unaligned_le16(val, p); 32 | } 33 | 34 | static inline void __put_unaligned_le64(u64 val, u8 *p) 35 | { 36 | __put_unaligned_le32(val >> 32, p + 4); 37 | __put_unaligned_le32(val, p); 38 | } 39 | 40 | static inline u16 get_unaligned_le16(const void *p) 41 | { 42 | return __get_unaligned_le16((const u8 *)p); 43 | } 44 | 45 | static inline u32 get_unaligned_le32(const void *p) 46 | { 47 | return __get_unaligned_le32((const u8 *)p); 48 | } 49 | 50 | static inline u64 get_unaligned_le64(const void *p) 51 | { 52 | return __get_unaligned_le64((const u8 *)p); 53 | } 54 | 55 | static inline void put_unaligned_le16(u16 val, void *p) 56 | { 57 | __put_unaligned_le16(val, p); 58 | } 59 | 60 | static inline void put_unaligned_le32(u32 val, void *p) 61 | { 62 | __put_unaligned_le32(val, p); 63 | } 64 | 65 | static inline void put_unaligned_le64(u64 val, void *p) 66 | { 67 | __put_unaligned_le64(val, p); 68 | } 69 | 70 | #endif /* _LINUX_UNALIGNED_LE_BYTESHIFT_H */ 71 | -------------------------------------------------------------------------------- /u-boot/tools/scripts/flash_param: -------------------------------------------------------------------------------- 1 | #!/usr/bin/kermit + 2 | # usage: ./flash_param parameters 3 | # Parameters: IP Address ETH Address ERIC Number 4 | # Format: xxx.xxx.xxx.xxx xx:xx:xx:xx:xx:xx xxxx 5 | 6 | set line /dev/ttyS0 7 | set speed 115200 8 | set serial 8N1 9 | set carrier-watch off 10 | set handshake none 11 | #set flow-control none 12 | set flow-control xon/xoff 13 | #robust 14 | set file type bin 15 | set file name lit 16 | set rec pack 1000 17 | set send pack 1000 18 | set window 5 19 | set prompt Kermit> 20 | #robust 21 | # Milliseconds to pause between each OUTPUT character 22 | set output pacing 1 23 | 24 | out \13 25 | in 10 => 26 | #first erase the environment memory within NVRAM 27 | out mw f0000000 0 200\13 28 | in 10 => 29 | out reset\13 30 | in 5 autoboot 31 | out \13\13 32 | in 10 => 33 | #set additional env parameter 34 | out setenv ethaddr \%2\13 35 | in 10 => 36 | out setenv serial# ERIC 1.0 \%3\13 37 | in 10 => 38 | out setenv eric_id \%3\13 39 | in 10 => 40 | #out setenv prec_videocard_bus unknown\13 41 | #in 10 => 42 | #out setenv prec_bios_type unknown\13 43 | #in 10 => 44 | out setenv eric_passwd .eRIC.\13 45 | in 10 => 46 | #out setenv bootargs root=/dev/ram ramdisk_size=8192 init=/sbin/init ip=\%1:192.168.1.100:192.168.1.254:255.255.255.0\13 47 | #out setenv bootargs root=/dev/ram ramdisk_size=8192 init=/sbin/init ip=\%1:192.168.0.1\13 48 | #out setenv bootargs root=/dev/ram ramdisk_size=8192 init=/sbin/init ip=\%1\13 49 | out setenv bootargs console=/dev/ttyS0,115200 root=/dev/nfs nfsroot=192.168.1.26:/eric_root_devel ip=\%1:192.168.1.26\13 50 | in 10 => 51 | out setenv bootcmd bootm FFC00000\13 52 | in 10 => 53 | out saveenv\13 54 | in 10 => 55 | out reset\13 56 | in 5 autoboot 57 | out \13\13 58 | in 10 => 59 | quit 60 | exit 0 61 | -------------------------------------------------------------------------------- /u-boot/common/cmd_usb_mass_storage.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Samsung Electronics 3 | * Lukasz Majewski 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag, 15 | int argc, char * const argv[]) 16 | { 17 | char *ep; 18 | unsigned int dev_num = 0, offset = 0, part_size = 0; 19 | int rc; 20 | 21 | struct ums_board_info *ums_info; 22 | static char *s = "ums"; 23 | 24 | if (argc < 2) { 25 | printf("usage: ums - e.g. ums 0\n"); 26 | return 0; 27 | } 28 | 29 | dev_num = (int)simple_strtoul(argv[1], &ep, 16); 30 | 31 | if (dev_num) { 32 | puts("\nSet eMMC device to 0! - e.g. ums 0\n"); 33 | goto fail; 34 | } 35 | 36 | board_usb_init(); 37 | ums_info = board_ums_init(dev_num, offset, part_size); 38 | 39 | if (!ums_info) { 40 | printf("MMC: %d -> NOT available\n", dev_num); 41 | goto fail; 42 | } 43 | rc = fsg_init(ums_info); 44 | if (rc) { 45 | printf("cmd ums: fsg_init failed\n"); 46 | goto fail; 47 | } 48 | 49 | g_dnl_register(s); 50 | 51 | while (1) { 52 | /* Handle control-c and timeouts */ 53 | if (ctrlc()) { 54 | printf("The remote end did not respond in time.\n"); 55 | goto exit; 56 | } 57 | usb_gadget_handle_interrupts(); 58 | /* Check if USB cable has been detached */ 59 | if (fsg_main_thread(NULL) == EIO) 60 | goto exit; 61 | } 62 | exit: 63 | g_dnl_unregister(); 64 | return 0; 65 | 66 | fail: 67 | return -1; 68 | } 69 | 70 | U_BOOT_CMD(ums, CONFIG_SYS_MAXARGS, 1, do_usb_mass_storage, 71 | "Use the UMS [User Mass Storage]", 72 | "ums - User Mass Storage Gadget" 73 | ); 74 | -------------------------------------------------------------------------------- /u-boot/include/linux/bitops.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_BITOPS_H 2 | #define _LINUX_BITOPS_H 3 | 4 | 5 | /* 6 | * ffs: find first bit set. This is defined the same way as 7 | * the libc and compiler builtin ffs routines, therefore 8 | * differs in spirit from the above ffz (man ffs). 9 | */ 10 | 11 | static inline int generic_ffs(int x) 12 | { 13 | int r = 1; 14 | 15 | if (!x) 16 | return 0; 17 | if (!(x & 0xffff)) { 18 | x >>= 16; 19 | r += 16; 20 | } 21 | if (!(x & 0xff)) { 22 | x >>= 8; 23 | r += 8; 24 | } 25 | if (!(x & 0xf)) { 26 | x >>= 4; 27 | r += 4; 28 | } 29 | if (!(x & 3)) { 30 | x >>= 2; 31 | r += 2; 32 | } 33 | if (!(x & 1)) { 34 | x >>= 1; 35 | r += 1; 36 | } 37 | return r; 38 | } 39 | 40 | /* 41 | * hweightN: returns the hamming weight (i.e. the number 42 | * of bits set) of a N-bit word 43 | */ 44 | 45 | static inline unsigned int generic_hweight32(unsigned int w) 46 | { 47 | unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555); 48 | res = (res & 0x33333333) + ((res >> 2) & 0x33333333); 49 | res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F); 50 | res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF); 51 | return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF); 52 | } 53 | 54 | static inline unsigned int generic_hweight16(unsigned int w) 55 | { 56 | unsigned int res = (w & 0x5555) + ((w >> 1) & 0x5555); 57 | res = (res & 0x3333) + ((res >> 2) & 0x3333); 58 | res = (res & 0x0F0F) + ((res >> 4) & 0x0F0F); 59 | return (res & 0x00FF) + ((res >> 8) & 0x00FF); 60 | } 61 | 62 | static inline unsigned int generic_hweight8(unsigned int w) 63 | { 64 | unsigned int res = (w & 0x55) + ((w >> 1) & 0x55); 65 | res = (res & 0x33) + ((res >> 2) & 0x33); 66 | return (res & 0x0F) + ((res >> 4) & 0x0F); 67 | } 68 | 69 | #include 70 | 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/carambola2/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 | *(.text) 35 | } 36 | 37 | . = ALIGN(4); 38 | .rodata : { *(.rodata) } 39 | 40 | . = ALIGN(4); 41 | .data : { *(.data) } 42 | 43 | . = ALIGN(4); 44 | .sdata : { *(.sdata) } 45 | 46 | _gp = ALIGN(16); 47 | 48 | . = ALIGN(16); 49 | __got_start_bootstrap = .; 50 | .got : { *(.got) } 51 | __got_end_bootstrap = .; 52 | 53 | .sdata : { *(.sdata) } 54 | 55 | uboot_end_data_bootstrap = .; 56 | num_got_entries = (__got_end_bootstrap - __got_start_bootstrap) >> 2; 57 | 58 | . = ALIGN(4); 59 | .sbss : { *(.sbss) } 60 | .bss : { *(.bss) } 61 | uboot_end_bootstrap = .; 62 | } 63 | -------------------------------------------------------------------------------- /u-boot/common/cmd_dtt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2001 3 | * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #if (CONFIG_COMMANDS & CFG_CMD_DTT) 29 | 30 | #include 31 | 32 | int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) 33 | { 34 | int i; 35 | unsigned char sensors[] = CONFIG_DTT_SENSORS; 36 | 37 | /* 38 | * Loop through sensors, read 39 | * temperature, and output it. 40 | */ 41 | for (i = 0; i < sizeof (sensors); i++) { 42 | printf ("DTT%d: %i C\n", i + 1, dtt_get_temp (sensors[i])); 43 | } 44 | 45 | return 0; 46 | } /* do_dtt() */ 47 | 48 | /***************************************************/ 49 | 50 | U_BOOT_CMD( 51 | dtt, 1, 1, do_dtt, 52 | "dtt - Digital Thermometer and Themostat\n", 53 | " - Read temperature from digital thermometer and thermostat.\n" 54 | ); 55 | 56 | #endif /* CONFIG_COMMANDS & CFG_CMD_DTT */ 57 | -------------------------------------------------------------------------------- /u-boot/drivers/usb/host/ehci-ar9331.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Atheros AR933x USB driver initialization 3 | * 4 | * Copyright (C) 2014 Mantas Pucka 5 | * 6 | * SPDX-License-Identifier:GPL-2.0 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include "ar7240_soc.h" 17 | 18 | #include "ehci.h" 19 | 20 | /* 21 | * Create the appropriate control structures to manage 22 | * a new EHCI host controller. 23 | * 24 | * Excerpts from linux ehci fsl driver. 25 | */ 26 | 27 | int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) 28 | { 29 | struct usb_ehci *ehci; 30 | 31 | #define AR933X_EHCI_BASE 0x1b000000 32 | #define AR933X_RESET_USB_HOST BIT(5) 33 | #define AR933X_RESET_USB_PHY BIT(4) 34 | #define AR933X_RESET_USBSUS_OVERRIDE BIT(3) 35 | 36 | ar7240_reg_wr (AR7240_RESET, (ar7240_reg_rd(AR7240_RESET) | AR933X_RESET_USBSUS_OVERRIDE)); 37 | mdelay(10); 38 | 39 | ar7240_reg_wr (AR7240_RESET, (ar7240_reg_rd(AR7240_RESET) & ~(AR933X_RESET_USB_HOST))); 40 | mdelay(10); 41 | 42 | ar7240_reg_wr (AR7240_RESET, (ar7240_reg_rd(AR7240_RESET) & ~(AR933X_RESET_USB_PHY))); 43 | mdelay(10); 44 | 45 | ehci = (struct usb_ehci *)AR933X_EHCI_BASE; 46 | *hccr = (struct ehci_hccr *)((uint32_t)&ehci->caplength); 47 | *hcor = (struct ehci_hcor *)((uint32_t) *hccr + 48 | HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); 49 | debug("ehci-ar9331: init hccr %x and hcor %x hc_length %d\n", 50 | (uint32_t)*hccr, (uint32_t)*hcor, 51 | (uint32_t)HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); 52 | 53 | return 0; 54 | } 55 | 56 | /* 57 | * Destroy the appropriate control structures corresponding 58 | * the the EHCI host controller. 59 | */ 60 | int ehci_hcd_stop(int index) 61 | { 62 | return 0; 63 | } 64 | -------------------------------------------------------------------------------- /u-boot/lib_bootstrap/display_options.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000-2002 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #include 25 | 26 | int display_options (void) 27 | { 28 | extern char version_string[]; 29 | 30 | #if defined(BUILD_TAG) 31 | printf ("\n\n%s, Build: %s\n\n", version_string, BUILD_TAG); 32 | #else 33 | printf ("\n\n%s\n\n", version_string); 34 | #endif 35 | return 0; 36 | } 37 | 38 | /* 39 | * print sizes as "xxx kB", "xxx.y kB", "xxx MB" or "xxx.y MB" as needed; 40 | * allow for optional trailing string (like "\n") 41 | */ 42 | void print_size (ulong size, const char *s) 43 | { 44 | ulong m, n; 45 | ulong d = 1 << 20; /* 1 MB */ 46 | char c = 'M'; 47 | 48 | if (size < d) { /* print in kB */ 49 | c = 'k'; 50 | d = 1 << 10; 51 | } 52 | 53 | n = size / d; 54 | 55 | m = (10 * (size - (n * d)) + (d / 2) ) / d; 56 | 57 | if (m >= 10) { 58 | m -= 10; 59 | n += 1; 60 | } 61 | 62 | printf ("%2ld", n); 63 | if (m) { 64 | printf (".%ld", m); 65 | } 66 | printf (" %cB%s", c, s); 67 | } 68 | -------------------------------------------------------------------------------- /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 | int display_options (void) 27 | { 28 | extern char version_string[]; 29 | 30 | #if defined(BUILD_TAG) 31 | printf ("\n\n%s, Build: %s\n\n", version_string, BUILD_TAG); 32 | #else 33 | printf ("\n\n%s\n\n", version_string); 34 | #endif 35 | return 0; 36 | } 37 | 38 | /* 39 | * print sizes as "xxx kB", "xxx.y kB", "xxx MB" or "xxx.y MB" as needed; 40 | * allow for optional trailing string (like "\n") 41 | */ 42 | void print_size (ulong size, const char *s) 43 | { 44 | ulong m, n; 45 | ulong d = 1 << 20; /* 1 MB */ 46 | char c = 'M'; 47 | 48 | if (size < d) { /* print in kB */ 49 | c = 'k'; 50 | d = 1 << 10; 51 | } 52 | 53 | n = size / d; 54 | 55 | m = (10 * (size - (n * d)) + (d / 2) ) / d; 56 | 57 | if (m >= 10) { 58 | m -= 10; 59 | n += 1; 60 | } 61 | 62 | printf ("%2ld", n); 63 | if (m) { 64 | printf (".%ld", m); 65 | } 66 | printf (" %cB%s", c, s); 67 | } 68 | -------------------------------------------------------------------------------- /u-boot/drivers/ns16550.c: -------------------------------------------------------------------------------- 1 | /* 2 | * COM1 NS16550 support 3 | * originally from linux source (arch/ppc/boot/ns16550.c) 4 | * modified to use CFG_ISA_MEM and new defines 5 | */ 6 | 7 | #include 8 | 9 | #ifdef CFG_NS16550 10 | 11 | #include 12 | 13 | #define LCRVAL LCR_8N1 /* 8 data, 1 stop, no parity */ 14 | #define MCRVAL (MCR_DTR | MCR_RTS) /* RTS/DTR */ 15 | #define FCRVAL (FCR_FIFO_EN | FCR_RXSR | FCR_TXSR) /* Clear & enable FIFOs */ 16 | 17 | void NS16550_init (NS16550_t com_port, int baud_divisor) 18 | { 19 | com_port->ier = 0x00; 20 | #ifdef CONFIG_OMAP 21 | com_port->mdr1 = 0x7; /* mode select reset TL16C750*/ 22 | #endif 23 | com_port->lcr = LCR_BKSE | LCRVAL; 24 | com_port->dll = baud_divisor & 0xff; 25 | com_port->dlm = (baud_divisor >> 8) & 0xff; 26 | com_port->lcr = LCRVAL; 27 | com_port->mcr = MCRVAL; 28 | com_port->fcr = FCRVAL; 29 | #if defined(CONFIG_OMAP) 30 | #if defined(CONFIG_APTIX) 31 | com_port->mdr1 = 3; /* /13 mode so Aptix 6MHz can hit 115200 */ 32 | #else 33 | com_port->mdr1 = 0; /* /16 is proper to hit 115200 with 48MHz */ 34 | #endif 35 | #endif 36 | } 37 | 38 | void NS16550_reinit (NS16550_t com_port, int baud_divisor) 39 | { 40 | com_port->ier = 0x00; 41 | com_port->lcr = LCR_BKSE; 42 | com_port->dll = baud_divisor & 0xff; 43 | com_port->dlm = (baud_divisor >> 8) & 0xff; 44 | com_port->lcr = LCRVAL; 45 | com_port->mcr = MCRVAL; 46 | com_port->fcr = FCRVAL; 47 | } 48 | 49 | void NS16550_putc (NS16550_t com_port, char c) 50 | { 51 | while ((com_port->lsr & LSR_THRE) == 0); 52 | com_port->thr = c; 53 | } 54 | 55 | char NS16550_getc (NS16550_t com_port) 56 | { 57 | while ((com_port->lsr & LSR_DR) == 0) { 58 | #ifdef CONFIG_USB_TTY 59 | extern void usbtty_poll(void); 60 | usbtty_poll(); 61 | #endif 62 | } 63 | return (com_port->rbr); 64 | } 65 | 66 | int NS16550_tstc (NS16550_t com_port) 67 | { 68 | return ((com_port->lsr & LSR_DR) != 0); 69 | } 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /u-boot/include/nand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2005 3 | * 2N Telekomunikace, a.s. 4 | * Ladislav Michl 5 | * 6 | * See file CREDITS for list of people who contributed to this 7 | * project. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * version 2 as published by the Free Software Foundation. 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 _NAND_H_ 25 | #define _NAND_H_ 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | typedef struct mtd_info nand_info_t; 32 | 33 | extern int nand_curr_device; 34 | extern nand_info_t nand_info[]; 35 | 36 | static inline int nand_read(nand_info_t *info, loff_t ofs, ulong *len, u_char *buf) 37 | { 38 | return info->read(info, ofs, *len, (size_t *)len, buf); 39 | } 40 | 41 | static inline int nand_write(nand_info_t *info, loff_t ofs, ulong *len, u_char *buf) 42 | { 43 | return info->write(info, ofs, *len, (size_t *)len, buf); 44 | } 45 | 46 | static inline int nand_block_isbad(nand_info_t *info, loff_t ofs) 47 | { 48 | return info->block_isbad(info, ofs); 49 | } 50 | 51 | static inline int nand_erase(nand_info_t *info, ulong off, ulong size) 52 | { 53 | struct erase_info instr; 54 | 55 | instr.mtd = info; 56 | instr.addr = off; 57 | instr.len = size; 58 | instr.callback = 0; 59 | 60 | return info->erase(info, &instr); 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /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 | }; 69 | extern void NfsStart (void); /* Begin NFS */ 70 | 71 | 72 | /**********************************************************************/ 73 | 74 | #endif /* __NFS_H__ */ 75 | -------------------------------------------------------------------------------- /u-boot/include/ide.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | #ifndef _IDE_H 25 | #define _IDE_H 26 | 27 | #define IDE_BUS(dev) (dev >> 1) 28 | 29 | #ifdef CONFIG_IDE_LED 30 | 31 | /* 32 | * LED Port 33 | */ 34 | #define LED_PORT ((uchar *)(PER8_BASE + 0x3000)) 35 | #define LED_IDE1 0x01 36 | #define LED_IDE2 0x02 37 | #define DEVICE_LED(d) ((d & 2) | ((d & 2) == 0)) /* depends on bit positions! */ 38 | 39 | #endif /* CONFIG_IDE_LED */ 40 | 41 | #ifdef CFG_64BIT_LBA 42 | typedef uint64_t lbaint_t; 43 | #else 44 | typedef ulong lbaint_t; 45 | #endif 46 | 47 | #ifdef CONFIG_SYS_64BIT_LBA 48 | //typedef uint64_t lbaint_t; 49 | #define LBAF "%llx" 50 | #define LBAFU "%llu" 51 | #else 52 | //typedef ulong lbaint_t; 53 | #define LBAF "%lx" 54 | #define LBAFU "%lu" 55 | #endif 56 | 57 | 58 | /* 59 | * Function Prototypes 60 | */ 61 | 62 | void ide_init (void); 63 | ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, ulong *buffer); 64 | ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, ulong *buffer); 65 | 66 | #endif /* _IDE_H */ 67 | -------------------------------------------------------------------------------- /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 | 43 | void env_relocate_spec (void) 44 | { 45 | } 46 | 47 | uchar env_get_char_spec (int index) 48 | { 49 | return ( *((uchar *)(gd->env_addr + index)) ); 50 | } 51 | 52 | /************************************************************************ 53 | * Initialize Environment use 54 | * 55 | * We are still running from ROM, so data use is limited 56 | */ 57 | int env_init(void) 58 | { 59 | gd->env_addr = (ulong)&default_environment[0]; 60 | gd->env_valid = 0; 61 | 62 | return (0); 63 | } 64 | 65 | #endif /* CFG_ENV_IS_NOWHERE) */ 66 | -------------------------------------------------------------------------------- /u-boot/drivers/usb/host/ehci-atmel.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2012 3 | * Atmel Semiconductor 4 | * Written-by: Bo Shen 5 | * 6 | * SPDX-License-Identifier: GPL-2.0+ 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "ehci.h" 18 | 19 | /* Enable UTMI PLL time out 500us 20 | * 10 times as datasheet specified 21 | */ 22 | #define EN_UPLL_TIMEOUT 500UL 23 | 24 | int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) 25 | { 26 | at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC; 27 | ulong start_time, tmp_time; 28 | 29 | start_time = get_timer(0); 30 | /* Enable UTMI PLL */ 31 | writel(AT91_PMC_UPLLEN | AT91_PMC_BIASEN, &pmc->uckr); 32 | while ((readl(&pmc->sr) & AT91_PMC_LOCKU) != AT91_PMC_LOCKU) { 33 | WATCHDOG_RESET(); 34 | tmp_time = get_timer(0); 35 | if ((tmp_time - start_time) > EN_UPLL_TIMEOUT) { 36 | printf("ERROR: failed to enable UPLL\n"); 37 | return -1; 38 | } 39 | } 40 | 41 | /* Enable USB Host clock */ 42 | writel(1 << ATMEL_ID_UHPHS, &pmc->pcer); 43 | 44 | *hccr = (struct ehci_hccr *)ATMEL_BASE_EHCI; 45 | *hcor = (struct ehci_hcor *)((uint32_t)*hccr + 46 | HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); 47 | 48 | return 0; 49 | } 50 | 51 | int ehci_hcd_stop(int index) 52 | { 53 | at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC; 54 | ulong start_time, tmp_time; 55 | 56 | /* Disable USB Host Clock */ 57 | writel(1 << ATMEL_ID_UHPHS, &pmc->pcdr); 58 | 59 | start_time = get_timer(0); 60 | /* Disable UTMI PLL */ 61 | writel(readl(&pmc->uckr) & ~AT91_PMC_UPLLEN, &pmc->uckr); 62 | while ((readl(&pmc->sr) & AT91_PMC_LOCKU) == AT91_PMC_LOCKU) { 63 | WATCHDOG_RESET(); 64 | tmp_time = get_timer(0); 65 | if ((tmp_time - start_time) > EN_UPLL_TIMEOUT) { 66 | printf("ERROR: failed to stop UPLL\n"); 67 | return -1; 68 | } 69 | } 70 | 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /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, 62 | unsigned int, unsigned int, unsigned int); 63 | 64 | #endif /* _RTC_H_ */ 65 | -------------------------------------------------------------------------------- /u-boot/lib_bootstrap/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2003 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | LIB = libbootstrap.a 27 | 28 | OBJS = bootstrap_board.o LzmaDecode.o string.o crc32.o LzmaWrapper.o time.o 29 | #OBJS = bootstrap_board.o LzmaDecode.o string.o crc32.o LzmaWrapper.o ctype.o display_options.o string.o vsprintf.o lists.o devices.o console.o time.o 30 | 31 | #BOOTSTRAP_PRINTF_STATUS = BOOTSTRAP_PRINTF_ENABLED 32 | 33 | ifeq ($(BOOTSTRAP_PRINTF_STATUS), BOOTSTRAP_PRINTF_ENABLED) 34 | #overwrite objs 35 | OBJS = bootstrap_board.o time.o console.o LzmaWrapper.o LzmaDecode.o crc32.o ctype.o display_options.o string.o vsprintf.o lists.o devices.o 36 | CFLAGS += -DDEBUG_ENABLE_BOOTSTRAP_PRINTF 37 | endif 38 | 39 | CFLAGS += -DCONFIG_LZMA=1 40 | 41 | all: .depend $(LIB) 42 | 43 | $(LIB): $(OBJS) 44 | $(AR) crv $@ $(OBJS) 45 | 46 | ######################################################################### 47 | 48 | .depend: Makefile $(OBJS:.o=.c) 49 | echo "make libbootstrap.a with HEAD_SIZE $(HEAD_SIZE)" 50 | $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ 51 | 52 | sinclude .depend 53 | 54 | ######################################################################### 55 | -------------------------------------------------------------------------------- /u-boot/fs/jffs2/compr_zlib.c: -------------------------------------------------------------------------------- 1 | /* 2 | * JFFS2 -- Journalling Flash File System, Version 2. 3 | * 4 | * Copyright (C) 2001 Red Hat, Inc. 5 | * 6 | * Created by David Woodhouse 7 | * 8 | * The original JFFS, from which the design for JFFS2 was derived, 9 | * was designed and implemented by Axis Communications AB. 10 | * 11 | * The contents of this file are subject to the Red Hat eCos Public 12 | * License Version 1.1 (the "Licence"); you may not use this file 13 | * except in compliance with the Licence. You may obtain a copy of 14 | * the Licence at http://www.redhat.com/ 15 | * 16 | * Software distributed under the Licence is distributed on an "AS IS" 17 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 18 | * See the Licence for the specific language governing rights and 19 | * limitations under the Licence. 20 | * 21 | * The Original Code is JFFS2 - Journalling Flash File System, version 2 22 | * 23 | * Alternatively, the contents of this file may be used under the 24 | * terms of the GNU General Public License version 2 (the "GPL"), in 25 | * which case the provisions of the GPL are applicable instead of the 26 | * above. If you wish to allow the use of your version of this file 27 | * only under the terms of the GPL and not to allow others to use your 28 | * version of this file under the RHEPL, indicate your decision by 29 | * deleting the provisions above and replace them with the notice and 30 | * other provisions required by the GPL. If you do not delete the 31 | * provisions above, a recipient may use your version of this file 32 | * under either the RHEPL or the GPL. 33 | * 34 | * 35 | */ 36 | 37 | #include 38 | #include 39 | #if (CONFIG_COMMANDS & CFG_CMD_JFFS2) 40 | 41 | #include 42 | #include 43 | 44 | long zlib_decompress(unsigned char *data_in, unsigned char *cpage_out, 45 | __u32 srclen, __u32 destlen) 46 | { 47 | return (decompress_block(cpage_out, data_in + 2, ldr_memcpy)); 48 | 49 | } 50 | 51 | #endif /* CFG_CMD_JFFS2 */ 52 | -------------------------------------------------------------------------------- /u-boot/drivers/5701rls.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | /* */ 3 | /* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ 4 | /* Corporation. */ 5 | /* All rights reserved. */ 6 | /* */ 7 | /* This program is free software; you can redistribute it and/or modify */ 8 | /* it under the terms of the GNU General Public License as published by */ 9 | /* the Free Software Foundation, located in the file LICENSE. */ 10 | /* */ 11 | /* History: */ 12 | /* */ 13 | /******************************************************************************/ 14 | 15 | #if INCLUDE_5701_AX_FIX 16 | 17 | #include "bcm570x_mm.h" 18 | #include "5701rls.h" 19 | 20 | LM_STATUS LM_LoadRlsFirmware(PLM_DEVICE_BLOCK pDevice) 21 | { 22 | T3_FWIMG_INFO FwImgInfo; 23 | 24 | FwImgInfo.StartAddress = t3FwStartAddr; 25 | FwImgInfo.Text.Buffer = (PLM_UINT8)t3FwText; 26 | FwImgInfo.Text.Offset = t3FwTextAddr; 27 | FwImgInfo.Text.Length = t3FwTextLen; 28 | FwImgInfo.ROnlyData.Buffer = (PLM_UINT8)t3FwRodata; 29 | FwImgInfo.ROnlyData.Offset = t3FwRodataAddr; 30 | FwImgInfo.ROnlyData.Length = t3FwRodataLen; 31 | FwImgInfo.Data.Buffer = (PLM_UINT8)t3FwData; 32 | FwImgInfo.Data.Offset = t3FwDataAddr; 33 | FwImgInfo.Data.Length = t3FwDataLen; 34 | 35 | if (LM_LoadFirmware(pDevice, 36 | &FwImgInfo, 37 | T3_RX_CPU_ID | T3_TX_CPU_ID, 38 | T3_RX_CPU_ID) != LM_STATUS_SUCCESS) 39 | { 40 | return LM_STATUS_FAILURE; 41 | } 42 | 43 | return LM_STATUS_SUCCESS; 44 | } 45 | 46 | #endif /* INCLUDE_5701_AX_FIX */ 47 | -------------------------------------------------------------------------------- /u-boot/include/asm-mips/mmc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2009 SAMSUNG Electronics 3 | * Minkyu Kang 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | */ 7 | 8 | #ifndef __ASM_ARCH_MMC_H_ 9 | #define __ASM_ARCH_MMC_H_ 10 | 11 | #define SDHCI_CONTROL2 0x80 12 | #define SDHCI_CONTROL3 0x84 13 | #define SDHCI_CONTROL4 0x8C 14 | 15 | #define SDHCI_CTRL2_ENSTAASYNCCLR (1 << 31) 16 | #define SDHCI_CTRL2_ENCMDCNFMSK (1 << 30) 17 | #define SDHCI_CTRL2_CDINVRXD3 (1 << 29) 18 | #define SDHCI_CTRL2_SLCARDOUT (1 << 28) 19 | 20 | #define SDHCI_CTRL2_FLTCLKSEL_MASK (0xf << 24) 21 | #define SDHCI_CTRL2_FLTCLKSEL_SHIFT (24) 22 | #define SDHCI_CTRL2_FLTCLKSEL(_x) ((_x) << 24) 23 | 24 | #define SDHCI_CTRL2_LVLDAT_MASK (0xff << 16) 25 | #define SDHCI_CTRL2_LVLDAT_SHIFT (16) 26 | #define SDHCI_CTRL2_LVLDAT(_x) ((_x) << 16) 27 | 28 | #define SDHCI_CTRL2_ENFBCLKTX (1 << 15) 29 | #define SDHCI_CTRL2_ENFBCLKRX (1 << 14) 30 | #define SDHCI_CTRL2_SDCDSEL (1 << 13) 31 | #define SDHCI_CTRL2_SDSIGPC (1 << 12) 32 | #define SDHCI_CTRL2_ENBUSYCHKTXSTART (1 << 11) 33 | 34 | #define SDHCI_CTRL2_DFCNT_MASK(_x) ((_x) << 9) 35 | #define SDHCI_CTRL2_DFCNT_SHIFT (9) 36 | 37 | #define SDHCI_CTRL2_ENCLKOUTHOLD (1 << 8) 38 | #define SDHCI_CTRL2_RWAITMODE (1 << 7) 39 | #define SDHCI_CTRL2_DISBUFRD (1 << 6) 40 | #define SDHCI_CTRL2_SELBASECLK_MASK(_x) ((_x) << 4) 41 | #define SDHCI_CTRL2_SELBASECLK_SHIFT (4) 42 | #define SDHCI_CTRL2_PWRSYNC (1 << 3) 43 | #define SDHCI_CTRL2_ENCLKOUTMSKCON (1 << 1) 44 | #define SDHCI_CTRL2_HWINITFIN (1 << 0) 45 | 46 | #define SDHCI_CTRL3_FCSEL3 (1 << 31) 47 | #define SDHCI_CTRL3_FCSEL2 (1 << 23) 48 | #define SDHCI_CTRL3_FCSEL1 (1 << 15) 49 | #define SDHCI_CTRL3_FCSEL0 (1 << 7) 50 | 51 | #define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x) << 16) 52 | #define SDHCI_CTRL4_DRIVE_SHIFT (16) 53 | 54 | int s5p_sdhci_init(u32 regbase, int index, int bus_width); 55 | 56 | static inline unsigned int s5p_mmc_init(int index, int bus_width) 57 | { 58 | unsigned int base = samsung_get_base_mmc() + (0x10000 * index); 59 | return s5p_sdhci_init(base, index, bus_width); 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /u-boot/tools/gdb/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000 3 | # Murray Jensen 4 | # 5 | # See file CREDITS for list of people who contributed to this 6 | # project. 7 | # 8 | # This program is free software; you can redistribute it and/or 9 | # modify it under the terms of the GNU General Public License as 10 | # published by the Free Software Foundation; either version 2 of 11 | # the License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | # MA 02111-1307 USA 22 | # 23 | 24 | include $(TOPDIR)/config.mk 25 | 26 | BINS = gdbsend gdbcont 27 | 28 | OBJS = gdbsend.o gdbcont.o error.o remote.o serial.o 29 | 30 | # 31 | # Use native tools and options 32 | # 33 | CPPFLAGS = -I$(BFD_ROOT_DIR)/include 34 | CFLAGS = $(HOST_CFLAGS) -O $(CPPFLAGS) 35 | CC = $(HOSTCC) 36 | MAKEDEPEND = makedepend 37 | 38 | HOSTOS := $(shell uname -s | sed -e 's/\([Cc][Yy][Gg][Ww][Ii][Nn]\).*/cygwin/') 39 | 40 | ifeq ($(HOSTOS),cygwin) 41 | 42 | all: 43 | .depend: 44 | 45 | else # ! CYGWIN 46 | 47 | all: $(BINS) 48 | 49 | gdbsend: gdbsend.o error.o remote.o serial.o 50 | $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ 51 | 52 | gdbcont: gdbcont.o error.o remote.o serial.o 53 | $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ 54 | 55 | clean: 56 | rm -f $(OBJS) 57 | 58 | distclean: clean 59 | rm -f $(BINS) core *.bak .depend 60 | 61 | ######################################################################### 62 | 63 | .depend: Makefile $(OBJS:.o=.c) 64 | $(CC) -M $(CPPFLAGS) -I../include $(OBJS:.o=.c) > $@ 65 | 66 | -include .depend 67 | 68 | ######################################################################### 69 | 70 | endif # cygwin 71 | -------------------------------------------------------------------------------- /u-boot/drivers/usb/host/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # (C) Copyright 2000-2007 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | # 5 | # SPDX-License-Identifier: GPL-2.0+ 6 | # 7 | 8 | include $(TOPDIR)/config.mk 9 | 10 | LIB := $(obj)libusb_host.o 11 | 12 | # ohci 13 | COBJS-$(CONFIG_USB_OHCI_NEW) += ohci-hcd.o 14 | COBJS-$(CONFIG_USB_ATMEL) += ohci-at91.o 15 | COBJS-$(CONFIG_USB_OHCI_DA8XX) += ohci-da8xx.o 16 | COBJS-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o 17 | COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o 18 | COBJS-$(CONFIG_USB_SL811HS) += sl811-hcd.o 19 | COBJS-$(CONFIG_USB_OHCI_S3C24XX) += ohci-s3c24xx.o 20 | 21 | # echi 22 | COBJS-$(CONFIG_USB_EHCI) += ehci-hcd.o 23 | COBJS-$(CONFIG_USB_EHCI_ARMADA100) += ehci-armada100.o utmi-armada100.o 24 | COBJS-$(CONFIG_USB_EHCI_ATMEL) += ehci-atmel.o 25 | ifdef CONFIG_MPC512X 26 | COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-mpc512x.o 27 | else 28 | COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o 29 | endif 30 | COBJS-$(CONFIG_USB_EHCI_FARADAY) += ehci-faraday.o 31 | COBJS-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o 32 | COBJS-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o 33 | COBJS-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o 34 | COBJS-$(CONFIG_USB_EHCI_MX5) += ehci-mx5.o 35 | COBJS-$(CONFIG_USB_EHCI_MX6) += ehci-mx6.o 36 | COBJS-$(CONFIG_USB_EHCI_OMAP) += ehci-omap.o 37 | COBJS-$(CONFIG_USB_EHCI_PPC4XX) += ehci-ppc4xx.o 38 | COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o 39 | COBJS-$(CONFIG_USB_EHCI_MARVELL) += ehci-marvell.o 40 | COBJS-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o 41 | COBJS-$(CONFIG_USB_EHCI_SPEAR) += ehci-spear.o 42 | COBJS-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o 43 | COBJS-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o 44 | 45 | COBJS := $(COBJS-y) 46 | SRCS := $(COBJS:.o=.c) 47 | OBJS := $(addprefix $(obj),$(COBJS)) 48 | 49 | all: $(LIB) 50 | 51 | $(LIB): $(obj).depend $(OBJS) 52 | $(call cmd_link_o_target, $(OBJS)) 53 | 54 | ######################################################################### 55 | 56 | # defines $(obj).depend target 57 | include $(SRCTREE)/rules.mk 58 | 59 | sinclude $(obj).depend 60 | 61 | ######################################################################### 62 | -------------------------------------------------------------------------------- /u-boot/tools/gdb/error.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Murray Jensen 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 | #include "error.h" 29 | 30 | char *pname; 31 | 32 | void 33 | Warning(char *fmt, ...) 34 | { 35 | va_list args; 36 | 37 | fprintf(stderr, "%s: WARNING: ", pname); 38 | 39 | va_start(args, fmt); 40 | vfprintf(stderr, fmt, args); 41 | va_end(args); 42 | 43 | fprintf(stderr, "\n"); 44 | } 45 | 46 | void 47 | Error(char *fmt, ...) 48 | { 49 | va_list args; 50 | 51 | fprintf(stderr, "%s: ERROR: ", pname); 52 | 53 | va_start(args, fmt); 54 | vfprintf(stderr, fmt, args); 55 | va_end(args); 56 | 57 | fprintf(stderr, "\n"); 58 | 59 | exit(1); 60 | } 61 | 62 | void 63 | Perror(char *fmt, ...) 64 | { 65 | va_list args; 66 | int e = errno; 67 | char *p; 68 | 69 | fprintf(stderr, "%s: ERROR: ", pname); 70 | 71 | va_start(args, fmt); 72 | vfprintf(stderr, fmt, args); 73 | va_end(args); 74 | 75 | if ((p = strerror(e)) == NULL || *p == '\0') 76 | fprintf(stderr, ": Unknown Error (%d)\n", e); 77 | else 78 | fprintf(stderr, ": %s\n", p); 79 | 80 | exit(1); 81 | } 82 | -------------------------------------------------------------------------------- /u-boot/common/cmd_misc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2001 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * Misc functions 26 | */ 27 | #include 28 | #include 29 | 30 | #if (CONFIG_COMMANDS & CFG_CMD_MISC) 31 | 32 | int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) 33 | { 34 | ulong start = get_timer(0); 35 | ulong delay; 36 | 37 | if (argc != 2) { 38 | printf ("Usage:\n%s\n", cmdtp->usage); 39 | return 1; 40 | } 41 | 42 | delay = simple_strtoul(argv[1], NULL, 10) * CFG_HZ; 43 | 44 | while (get_timer(start) < delay) { 45 | if (ctrlc ()) { 46 | return (-1); 47 | } 48 | udelay (100); 49 | } 50 | 51 | return 0; 52 | } 53 | 54 | /* Implemented in $(CPU)/interrupts.c */ 55 | #if (CONFIG_COMMANDS & CFG_CMD_IRQ) 56 | int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); 57 | 58 | U_BOOT_CMD( 59 | irqinfo, 1, 1, do_irqinfo, 60 | "irqinfo - print information about IRQs\n", 61 | NULL 62 | ); 63 | #endif /* CONFIG_COMMANDS & CFG_CMD_IRQ */ 64 | 65 | U_BOOT_CMD( 66 | sleep , 2, 2, do_sleep, 67 | "sleep - delay execution for some time\n", 68 | "N\n" 69 | " - delay execution for N seconds (N is _decimal_ !!!)\n" 70 | ); 71 | 72 | #endif /* CFG_CMD_MISC */ 73 | -------------------------------------------------------------------------------- /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 | #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \ 73 | || defined(CONFIG_64BIT) 74 | typedef u64 dma_addr_t; 75 | 76 | typedef u64 phys_addr_t; 77 | typedef u64 phys_size_t; 78 | 79 | #else 80 | typedef u32 dma_addr_t; 81 | 82 | typedef u32 phys_addr_t; 83 | typedef u32 phys_size_t; 84 | 85 | #endif 86 | 87 | 88 | #endif /* __KERNEL__ */ 89 | 90 | #endif /* _ASM_TYPES_H */ 91 | -------------------------------------------------------------------------------- /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/usb_ether.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The Chromium OS Authors. 3 | * 4 | * SPDX-License-Identifier: GPL-2.0+ 5 | */ 6 | 7 | #ifndef __USB_ETHER_H__ 8 | #define __USB_ETHER_H__ 9 | 10 | #include 11 | 12 | /* 13 | * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble 14 | * and FCS/CRC (frame check sequence). 15 | */ 16 | #define ETH_ALEN 6 /* Octets in one ethernet addr */ 17 | #define ETH_HLEN 14 /* Total octets in header. */ 18 | #define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ 19 | #define ETH_DATA_LEN 1500 /* Max. octets in payload */ 20 | #define ETH_FRAME_LEN PKTSIZE_ALIGN /* Max. octets in frame sans FCS */ 21 | #define ETH_FCS_LEN 4 /* Octets in the FCS */ 22 | 23 | struct ueth_data { 24 | /* eth info */ 25 | struct eth_device eth_dev; /* used with eth_register */ 26 | int phy_id; /* mii phy id */ 27 | 28 | /* usb info */ 29 | struct usb_device *pusb_dev; /* this usb_device */ 30 | unsigned char ifnum; /* interface number */ 31 | unsigned char ep_in; /* in endpoint */ 32 | unsigned char ep_out; /* out ....... */ 33 | unsigned char ep_int; /* interrupt . */ 34 | unsigned char subclass; /* as in overview */ 35 | unsigned char protocol; /* .............. */ 36 | unsigned char irqinterval; /* Intervall for IRQ Pipe */ 37 | 38 | /* driver private */ 39 | void *dev_priv; 40 | }; 41 | 42 | /* 43 | * Function definitions for each USB ethernet driver go here, bracketed by 44 | * #ifdef CONFIG_USB_ETHER_xxx...#endif 45 | */ 46 | #ifdef CONFIG_USB_ETHER_ASIX 47 | void asix_eth_before_probe(void); 48 | int asix_eth_probe(struct usb_device *dev, unsigned int ifnum, 49 | struct ueth_data *ss); 50 | int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss, 51 | struct eth_device *eth); 52 | #endif 53 | 54 | #ifdef CONFIG_USB_ETHER_SMSC95XX 55 | void smsc95xx_eth_before_probe(void); 56 | int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum, 57 | struct ueth_data *ss); 58 | int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss, 59 | struct eth_device *eth); 60 | #endif 61 | 62 | #endif /* __USB_ETHER_H__ */ 63 | -------------------------------------------------------------------------------- /u-boot/include/kgdb.h: -------------------------------------------------------------------------------- 1 | #ifndef __KGDB_H__ 2 | #define __KGDB_H__ 3 | 4 | #include 5 | 6 | #define KGDBERR_BADPARAMS 1 7 | #define KGDBERR_NOTHEXDIG 2 8 | #define KGDBERR_MEMFAULT 3 9 | #define KGDBERR_NOSPACE 4 10 | #define KGDBERR_ALIGNFAULT 5 11 | 12 | #define KGDBDATA_MAXREGS 8 13 | #define KGDBDATA_MAXPRIV 8 14 | 15 | #define KGDBEXIT_TYPEMASK 0xff 16 | 17 | #define KGDBEXIT_KILL 0 18 | #define KGDBEXIT_CONTINUE 1 19 | #define KGDBEXIT_SINGLE 2 20 | 21 | #define KGDBEXIT_WITHADDR 0x100 22 | 23 | typedef 24 | struct { 25 | int num; 26 | unsigned long val; 27 | } 28 | kgdb_reg; 29 | 30 | typedef 31 | struct { 32 | int sigval; 33 | int extype; 34 | unsigned long exaddr; 35 | int nregs; 36 | kgdb_reg regs[KGDBDATA_MAXREGS]; 37 | unsigned long private[KGDBDATA_MAXPRIV]; 38 | } 39 | kgdb_data; 40 | 41 | /* these functions are provided by the generic kgdb support */ 42 | extern void kgdb_init(void); 43 | extern void kgdb_error(int); 44 | extern int kgdb_output_string(const char *, unsigned int); 45 | extern void breakpoint(void); 46 | 47 | /* these functions are provided by the platform specific kgdb support */ 48 | extern void kgdb_flush_cache_range(void *, void *); 49 | extern void kgdb_flush_cache_all(void); 50 | extern int kgdb_setjmp(long *); 51 | extern void kgdb_longjmp(long *, int); 52 | extern void kgdb_enter(struct pt_regs *, kgdb_data *); 53 | extern void kgdb_exit(struct pt_regs *, kgdb_data *); 54 | extern int kgdb_getregs(struct pt_regs *, char *, int); 55 | extern void kgdb_putreg(struct pt_regs *, int, char *, int); 56 | extern void kgdb_putregs(struct pt_regs *, char *, int); 57 | extern int kgdb_trap(struct pt_regs *); 58 | extern void kgdb_breakpoint(int argc, char *argv[]); 59 | 60 | /* these functions are provided by the platform serial driver */ 61 | extern void kgdb_serial_init(void); 62 | extern int getDebugChar(void); 63 | extern void putDebugChar(int); 64 | extern void putDebugStr(const char *); 65 | extern void kgdb_interruptible(int); 66 | 67 | /* this is referenced in the trap handler for the platform */ 68 | extern int (*debugger_exception_handler)(struct pt_regs *); 69 | 70 | #endif /* __KGDB_H__ */ 71 | -------------------------------------------------------------------------------- /u-boot/common/cmd_console.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2000 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * Boot support 26 | */ 27 | #include 28 | #include 29 | #include 30 | 31 | #if (CONFIG_COMMANDS & CFG_CMD_CONSOLE) 32 | 33 | extern void _do_coninfo (void); 34 | int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[]) 35 | { 36 | int i, l; 37 | 38 | /* Scan for valid output and input devices */ 39 | 40 | puts ("List of available devices:\n"); 41 | 42 | for (i = 1; i <= ListNumItems (devlist); i++) { 43 | device_t *dev = ListGetPtrToItem (devlist, i); 44 | 45 | printf ("%-8s %08x %c%c%c ", 46 | dev->name, 47 | dev->flags, 48 | (dev->flags & DEV_FLAGS_SYSTEM) ? 'S' : '.', 49 | (dev->flags & DEV_FLAGS_INPUT) ? 'I' : '.', 50 | (dev->flags & DEV_FLAGS_OUTPUT) ? 'O' : '.'); 51 | 52 | for (l = 0; l < MAX_FILES; l++) { 53 | if (stdio_devices[l] == dev) { 54 | printf ("%s ", stdio_names[l]); 55 | } 56 | } 57 | putc ('\n'); 58 | } 59 | return 0; 60 | } 61 | 62 | 63 | /***************************************************/ 64 | 65 | U_BOOT_CMD( 66 | coninfo, 3, 1, do_coninfo, 67 | "coninfo - print console devices and information\n", 68 | "" 69 | ); 70 | 71 | #endif /* CFG_CMD_CONSOLE */ 72 | -------------------------------------------------------------------------------- /u-boot/drivers/usbtty.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2003 3 | * Gerry Hamel, geh@ti.com, Texas Instruments 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | */ 20 | 21 | #ifndef __USB_TTY_H__ 22 | #define __USB_TTY_H__ 23 | 24 | 25 | #include "usbdcore.h" 26 | #include "usbdcore_omap1510.h" 27 | 28 | 29 | #define NUM_CONFIGS 1 30 | #define NUM_INTERFACES 1 31 | #define NUM_ENDPOINTS 3 32 | 33 | #define EP0_MAX_PACKET_SIZE 64 34 | 35 | #define CONFIG_USBD_CONFIGURATION_STR "TTY via USB" 36 | #define CONFIG_USBD_INTERFACE_STR "Simple Serial Data Interface - Bulk Mode" 37 | 38 | 39 | #define CONFIG_USBD_SERIAL_OUT_ENDPOINT 2 40 | #define CONFIG_USBD_SERIAL_OUT_PKTSIZE 64 41 | #define CONFIG_USBD_SERIAL_IN_ENDPOINT 1 42 | #define CONFIG_USBD_SERIAL_IN_PKTSIZE 64 43 | #define CONFIG_USBD_SERIAL_INT_ENDPOINT 5 44 | #define CONFIG_USBD_SERIAL_INT_PKTSIZE 16 45 | 46 | 47 | #define USBTTY_DEVICE_CLASS COMMUNICATIONS_DEVICE_CLASS 48 | #define USBTTY_DEVICE_SUBCLASS COMMUNICATIONS_NO_SUBCLASS 49 | #define USBTTY_DEVICE_PROTOCOL COMMUNICATIONS_NO_PROTOCOL 50 | 51 | #define USBTTY_INTERFACE_CLASS 0xFF /* Vendor Specific */ 52 | #define USBTTY_INTERFACE_SUBCLASS 0x02 53 | #define USBTTY_INTERFACE_PROTOCOL 0x01 54 | 55 | #define USBTTY_BCD_DEVICE 0x0 56 | #define USBTTY_MAXPOWER 0x0 57 | 58 | #define STR_MANUFACTURER 1 59 | #define STR_PRODUCT 2 60 | #define STR_SERIAL 3 61 | #define STR_CONFIG 4 62 | #define STR_INTERFACE 5 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /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 | int bi_baudrate; /* serial console baudrate */ 36 | unsigned long bi_ip_addr; /* IP Address */ 37 | unsigned char bi_enetaddr[6]; /* Ethernet adress */ 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 | } bd_t; 46 | #define bi_env_data bi_env->data 47 | #define bi_env_crc bi_env->crc 48 | 49 | #endif /* _U_BOOT_H_ */ 50 | -------------------------------------------------------------------------------- /u-boot/tools/env/fw_env.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 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 | /* 25 | * To build the utility with the run-time configuration 26 | * uncomment the next line. 27 | * See included "fw_env.config" sample file (TRAB board) 28 | * for notes on configuration. 29 | */ 30 | #define CONFIG_FILE "/etc/fw_env.config" 31 | 32 | #define HAVE_REDUND /* For systems with 2 env sectors */ 33 | #define DEVICE1_NAME "/dev/mtd1" 34 | #define DEVICE2_NAME "/dev/mtd2" 35 | #define DEVICE1_OFFSET 0x0000 36 | #define ENV1_SIZE 0x4000 37 | #define DEVICE1_ESIZE 0x4000 38 | #define DEVICE2_OFFSET 0x0000 39 | #define ENV2_SIZE 0x4000 40 | #define DEVICE2_ESIZE 0x4000 41 | 42 | #define CONFIG_BAUDRATE 115200 43 | #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ 44 | #define CONFIG_BOOTCOMMAND \ 45 | "bootp; " \ 46 | "setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} " \ 47 | "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; " \ 48 | "bootm" 49 | 50 | extern void fw_printenv(int argc, char *argv[]); 51 | extern unsigned char *fw_getenv (unsigned char *name); 52 | extern int fw_setenv (int argc, char *argv[]); 53 | 54 | extern unsigned long crc32 (unsigned long, const unsigned char *, unsigned); 55 | -------------------------------------------------------------------------------- /u-boot/net/sntp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SNTP support driver 3 | * 4 | * Masami Komiya 2005 5 | * 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "sntp.h" 14 | 15 | #if ((CONFIG_COMMANDS & CFG_CMD_NET) && (CONFIG_COMMANDS & CFG_CMD_SNTP)) 16 | 17 | #define SNTP_TIMEOUT 10 18 | 19 | static int SntpOurPort; 20 | 21 | static void 22 | SntpSend (void) 23 | { 24 | struct sntp_pkt_t pkt; 25 | int pktlen = SNTP_PACKET_LEN; 26 | int sport; 27 | 28 | debug ("%s\n", __FUNCTION__); 29 | 30 | memset (&pkt, 0, sizeof(pkt)); 31 | 32 | pkt.li = NTP_LI_NOLEAP; 33 | pkt.vn = NTP_VERSION; 34 | pkt.mode = NTP_MODE_CLIENT; 35 | 36 | memcpy ((char *)NetTxPacket + NetEthHdrSize() + IP_HDR_SIZE, (char *)&pkt, pktlen); 37 | 38 | SntpOurPort = 10000 + (get_timer(0) % 4096); 39 | sport = NTP_SERVICE_PORT; 40 | 41 | NetSendUDPPacket (NetServerEther, NetNtpServerIP, sport, SntpOurPort, pktlen); 42 | } 43 | 44 | static void 45 | SntpTimeout (void) 46 | { 47 | puts ("Timeout\n"); 48 | NetState = NETLOOP_FAIL; 49 | return; 50 | } 51 | 52 | static void 53 | SntpHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len) 54 | { 55 | struct sntp_pkt_t *rpktp = (struct sntp_pkt_t *)pkt; 56 | struct rtc_time tm; 57 | ulong seconds; 58 | 59 | debug ("%s\n", __FUNCTION__); 60 | 61 | if (dest != SntpOurPort) return; 62 | 63 | /* 64 | * As the RTC's used in U-Boot sepport second resolution only 65 | * we simply ignore the sub-second field. 66 | */ 67 | memcpy (&seconds, &rpktp->transmit_timestamp, sizeof(ulong)); 68 | 69 | to_tm(ntohl(seconds) - 2208988800UL + NetTimeOffset, &tm); 70 | #if (CONFIG_COMMANDS & CFG_CMD_DATE) 71 | rtc_set (&tm); 72 | #endif 73 | printf ("Date: %4d-%02d-%02d Time: %2d:%02d:%02d\n", 74 | tm.tm_year, tm.tm_mon, tm.tm_mday, 75 | tm.tm_hour, tm.tm_min, tm.tm_sec); 76 | 77 | NetState = NETLOOP_SUCCESS; 78 | } 79 | 80 | void 81 | SntpStart (void) 82 | { 83 | debug ("%s\n", __FUNCTION__); 84 | 85 | NetSetTimeout (SNTP_TIMEOUT * CFG_HZ, SntpTimeout); 86 | NetSetHandler(SntpHandler); 87 | memset (NetServerEther, 0, 6); 88 | 89 | SntpSend (); 90 | } 91 | 92 | #endif /* CONFIG_COMMANDS & CFG_CMD_SNTP */ 93 | -------------------------------------------------------------------------------- /u-boot/post/cpu/multi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 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 | * CPU test 28 | * Load/store multiple word instructions: lmw, stmw 29 | * 30 | * 26 consecutive words are loaded from a source memory buffer 31 | * into GPRs r6 through r31. After that, 26 consecutive words are stored 32 | * from the GPRs r6 through r31 into a target memory buffer. The contents 33 | * of the source and target buffers are then compared. 34 | */ 35 | 36 | #ifdef CONFIG_POST 37 | 38 | #include 39 | #include "cpu_asm.h" 40 | 41 | #if CONFIG_POST & CFG_POST_CPU 42 | 43 | extern void cpu_post_exec_02 (ulong *code, ulong op1, ulong op2); 44 | 45 | int cpu_post_test_multi (void) 46 | { 47 | int ret = 0; 48 | unsigned int i; 49 | 50 | if (ret == 0) 51 | { 52 | ulong src [26], dst [26]; 53 | 54 | ulong code[] = 55 | { 56 | ASM_LMW(5, 3, 0), 57 | ASM_STMW(5, 4, 0), 58 | ASM_BLR, 59 | }; 60 | 61 | for (i = 0; i < sizeof(src) / sizeof(src[0]); i ++) 62 | { 63 | src[i] = i; 64 | dst[i] = 0; 65 | } 66 | 67 | cpu_post_exec_02(code, (ulong)src, (ulong)dst); 68 | 69 | ret = memcmp(src, dst, sizeof(dst)) == 0 ? 0 : -1; 70 | } 71 | 72 | if (ret != 0) 73 | { 74 | post_log ("Error at multi test !\n"); 75 | } 76 | 77 | return ret; 78 | } 79 | 80 | #endif 81 | #endif 82 | -------------------------------------------------------------------------------- /u-boot/post/watchdog.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 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 | * Watchdog test 28 | * 29 | * The test verifies the watchdog timer operation. 30 | * On the first iteration, the test routine disables interrupts and 31 | * makes a 10-second delay. If the system does not reboot during this delay, 32 | * the watchdog timer is not operational and the test fails. If the system 33 | * reboots, on the second iteration the test routine reports a success. 34 | */ 35 | 36 | #ifdef CONFIG_POST 37 | 38 | #include 39 | #include 40 | 41 | #if CONFIG_POST & CFG_POST_WATCHDOG 42 | 43 | static ulong gettbl (void) 44 | { 45 | ulong r; 46 | 47 | asm ("mftbl %0":"=r" (r)); 48 | 49 | return r; 50 | } 51 | 52 | int watchdog_post_test (int flags) 53 | { 54 | if (flags & POST_REBOOT) { 55 | /* Test passed */ 56 | 57 | return 0; 58 | } else { 59 | /* 10-second delay */ 60 | int ints = disable_interrupts (); 61 | ulong base = gettbl (); 62 | ulong clk = get_tbclk (); 63 | 64 | while ((gettbl () - base) / 10 < clk); 65 | 66 | if (ints) 67 | enable_interrupts (); 68 | 69 | /* 70 | * If we have reached this point, the watchdog timer 71 | * does not work 72 | */ 73 | return -1; 74 | } 75 | } 76 | 77 | #endif /* CONFIG_POST & CFG_POST_WATCHDOG */ 78 | #endif /* CONFIG_POST */ 79 | -------------------------------------------------------------------------------- /u-boot/board/ar7240/common/ar7240_flash.h: -------------------------------------------------------------------------------- 1 | #ifndef _FLASH_H 2 | #define _FLASH_H 3 | 4 | #include "ar7240_soc.h" 5 | 6 | #define AR7240_SPI_FS 0x1f000000 7 | #define AR7240_SPI_CLOCK 0x1f000004 8 | #define AR7240_SPI_WRITE 0x1f000008 9 | #define AR7240_SPI_READ 0x1f000000 10 | #define AR7240_SPI_RD_STATUS 0x1f00000c 11 | 12 | #define AR7240_SPI_CS_DIS 0x70000 13 | #define AR7240_SPI_CE_LOW 0x60000 14 | #define AR7240_SPI_CE_HIGH 0x60100 15 | 16 | #define AR7240_SPI_CMD_WRITE_SR 0x01 17 | #define AR7240_SPI_CMD_WREN 0x06 18 | #define AR7240_SPI_CMD_RD_STATUS 0x05 19 | #define AR7240_SPI_CMD_FAST_READ 0x0b 20 | #define AR7240_SPI_CMD_PAGE_PROG 0x02 21 | #define AR7240_SPI_CMD_SECTOR_ERASE 0xd8 22 | #define AR7240_SPI_CMD_CHIP_ERASE 0xc7 23 | #define AR7240_SPI_CMD_RDID 0x9f 24 | 25 | #define AR7240_SPI_SECTOR_SIZE (1024*64) 26 | #define AR7240_SPI_PAGE_SIZE 256 27 | 28 | 29 | #define display(_x) ar7240_reg_wr_nf(0x18040008, (_x)) 30 | 31 | /* 32 | * primitives 33 | */ 34 | 35 | #define ar7240_be_msb(_val, _i) (((_val) & (1 << (7 - _i))) >> (7 - _i)) 36 | 37 | #define ar7240_spi_bit_banger(_byte) do { \ 38 | int i; \ 39 | for(i = 0; i < 8; i++) { \ 40 | ar7240_reg_wr_nf(AR7240_SPI_WRITE, \ 41 | AR7240_SPI_CE_LOW | ar7240_be_msb(_byte, i)); \ 42 | ar7240_reg_wr_nf(AR7240_SPI_WRITE, \ 43 | AR7240_SPI_CE_HIGH | ar7240_be_msb(_byte, i)); \ 44 | } \ 45 | }while(0); 46 | 47 | #define ar7240_spi_go() do { \ 48 | ar7240_reg_wr_nf(AR7240_SPI_WRITE, AR7240_SPI_CE_LOW); \ 49 | ar7240_reg_wr_nf(AR7240_SPI_WRITE, AR7240_SPI_CS_DIS); \ 50 | }while(0); 51 | 52 | 53 | #define ar7240_spi_send_addr(__a) do { \ 54 | ar7240_spi_bit_banger(((__a & 0xff0000) >> 16)); \ 55 | ar7240_spi_bit_banger(((__a & 0x00ff00) >> 8)); \ 56 | ar7240_spi_bit_banger(__a & 0x0000ff); \ 57 | } while (0) 58 | 59 | #define ar7240_spi_delay_8() ar7240_spi_bit_banger(0) 60 | #define ar7240_spi_done() ar7240_reg_wr_nf(AR7240_SPI_FS, 0) 61 | 62 | extern unsigned long flash_get_geom (flash_info_t *flash_info); 63 | 64 | #endif /*_FLASH_H*/ 65 | -------------------------------------------------------------------------------- /u-boot/tools/scripts/README: -------------------------------------------------------------------------------- 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 | # The files in this directory are free software; you can redistribute 9 | # them and/or modify them under the terms of the GNU General Public 10 | # License as published by the Free Software Foundation; either 11 | # version 2 of the License, or (at your option) any later version. 12 | # 13 | # These files are distributed in the hope that they 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 | This directory contains scripts that help to perform certain actions 25 | that need to be done frequently when working with U-Boot. 26 | 27 | They are meant as EXAMPLE code, so it is very likely that you will 28 | have to modify them before use. 29 | 30 | 31 | Short description: 32 | ================== 33 | 34 | dot.kermrc: 35 | 36 | Example for "~/.kermrc" Kermit init file for use with U-Boot 37 | 38 | by Wolfgang Denk, 24 Jun 2001 39 | 40 | flash_param: 41 | 42 | "kermit" script to automatically initialize the environment 43 | variables on your target. This is most useful during 44 | development when your environment variables are stored in an 45 | embedded flash sector which is erased whenever you install a 46 | new U-Boot image. 47 | 48 | by Swen Anderson, 10 May 2001 49 | 50 | send_cmd: 51 | 52 | send_cmd U_BOOT_COMMAND 53 | 54 | "kermit" script to send a U-Boot command and print the 55 | results. When used from a shell with history (like the bash) 56 | this indirectly adds kind of history to U-Boot ;-) 57 | 58 | by Swen Anderson, 10 May 2001 59 | 60 | send_image: 61 | 62 | send_image FILE_NAME OFFSET 63 | 64 | "kermit" script to automatically download a file to the 65 | target using the "loadb" command (kermit binary protocol) 66 | 67 | by Swen Anderson, 10 May 2001 68 | -------------------------------------------------------------------------------- /u-boot/common/lynxkdi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Orbacom Systems, Inc 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms are freely 6 | * permitted provided that the above copyright notice and this 7 | * paragraph and the following disclaimer are duplicated in all 8 | * such forms. 9 | * 10 | * This software is provided "AS IS" and without any express or 11 | * implied warranties, including, without limitation, the implied 12 | * warranties of merchantability and fitness for a particular 13 | * purpose. 14 | */ 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #if defined(CONFIG_LYNXKDI) 21 | #include 22 | 23 | DECLARE_GLOBAL_DATA_PTR; 24 | 25 | #if defined(CONFIG_MPC8260) || defined(CONFIG_440EP) || defined(CONFIG_440GR) 26 | void lynxkdi_boot ( image_header_t *hdr ) 27 | { 28 | void (*lynxkdi)(void) = (void(*)(void)) ntohl(hdr->ih_ep); 29 | lynxos_bootparms_t *parms = (lynxos_bootparms_t *)0x0020; 30 | bd_t *kbd; 31 | u32 *psz = (u32 *)(ntohl(hdr->ih_load) + 0x0204); 32 | 33 | memset( parms, 0, sizeof(*parms)); 34 | kbd = gd->bd; 35 | parms->clock_ref = kbd->bi_busfreq; 36 | parms->dramsz = kbd->bi_memsize; 37 | memcpy(parms->ethaddr, kbd->bi_enetaddr, 6); 38 | mtspr(SPRN_SPRG2, 0x0020); 39 | 40 | /* Do a simple check for Bluecat so we can pass the 41 | * kernel command line parameters. 42 | */ 43 | if( le32_to_cpu(*psz) == ntohl(hdr->ih_size) ){ /* FIXME: NOT SURE HERE ! */ 44 | char *args; 45 | char *cmdline = (char *)(ntohl(hdr->ih_load) + 0x020c); 46 | int len; 47 | 48 | printf("Booting Bluecat KDI ...\n"); 49 | udelay(200*1000); /* Allow serial port to flush */ 50 | if ((args = getenv("bootargs")) == NULL) 51 | args = ""; 52 | /* Prepend the cmdline */ 53 | len = strlen(args); 54 | if( len && (len + strlen(cmdline) + 2 < (0x0400 - 0x020c))) { 55 | memmove( cmdline + strlen(args) + 1, cmdline, strlen(cmdline) ); 56 | strcpy( cmdline, args ); 57 | cmdline[len] = ' '; 58 | } 59 | } 60 | else { 61 | printf("Booting LynxOS KDI ...\n"); 62 | } 63 | 64 | lynxkdi(); 65 | } 66 | #else 67 | #error "Lynx KDI support not implemented for configured CPU" 68 | #endif 69 | 70 | #endif /* CONFIG_LYNXKDI */ 71 | -------------------------------------------------------------------------------- /u-boot/tools/updater/update.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern unsigned long __dummy; 5 | void do_reset (void); 6 | void do_updater(void); 7 | 8 | void _main(void) 9 | { 10 | int i; 11 | printf("U-Boot Firmware Updater\n\n\n"); 12 | printf("****************************************************\n" 13 | "* ATTENTION!! PLEASE READ THIS NOTICE CAREFULLY! *\n" 14 | "****************************************************\n\n" 15 | "This program will update your computer's firmware.\n" 16 | "Do NOT remove the disk, reset the machine, or do\n" 17 | "anything that might disrupt functionality. If this\n"); 18 | printf("Program fails, your computer might be unusable, and\n" 19 | "you will need to return your board for reflashing.\n" 20 | "If you find this too risky, remove the diskette and\n" 21 | "switch off your machine now. Otherwise press the \n" 22 | "SPACE key now to start the process\n\n"); 23 | do 24 | { 25 | char x; 26 | while (!tstc()); 27 | x = getc(); 28 | if (x == ' ') break; 29 | } while (1); 30 | 31 | do_updater(); 32 | 33 | i = 5; 34 | 35 | printf("\nUpdate done. Please remove diskette.\n"); 36 | printf("The machine will automatically reset in %d seconds\n", i); 37 | printf("You can switch off/reset now when the floppy is removed\n\n"); 38 | 39 | while (i) 40 | { 41 | printf("Resetting in %d\r", i); 42 | udelay(1000000); 43 | i--; 44 | } 45 | do_reset(); 46 | while (1); 47 | } 48 | 49 | int flash_sect_protect (int p, ulong addr_first, ulong addr_last); 50 | int flash_sect_erase (ulong addr_first, ulong addr_last); 51 | int flash_write (uchar *src, ulong addr, ulong cnt); 52 | 53 | void do_updater(void) 54 | { 55 | unsigned long *addr = &__dummy + 65; 56 | unsigned long flash_size = flash_init(); 57 | int rc; 58 | 59 | flash_sect_protect(0, 0xFFF00000, 0xFFF7FFFF); 60 | printf("Erasing "); 61 | flash_sect_erase(0xFFF00000, 0xFFF7FFFF); 62 | printf("Writing "); 63 | rc = flash_write((uchar *)addr, 0xFFF00000, 0x7FFFF); 64 | if (rc != 0) printf("\nFlashing failed due to error %d\n", rc); 65 | else printf("\ndone\n"); 66 | flash_sect_protect(1, 0xFFF00000, 0xFFF7FFFF); 67 | } 68 | -------------------------------------------------------------------------------- /u-boot/drivers/usb/host/utmi-armada100.c: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2012 3 | * eInfochips Ltd. 4 | * Written-by: Ajay Bhargav 5 | * 6 | * (C) Copyright 2009 7 | * Marvell Semiconductor 8 | * 9 | * SPDX-License-Identifier: GPL-2.0+ 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | static int utmi_phy_init(void) 20 | { 21 | struct armd1usb_phy_reg *phy_regs = 22 | (struct armd1usb_phy_reg *)UTMI_PHY_BASE; 23 | int timeout; 24 | 25 | setbits_le32(&phy_regs->utmi_ctrl, INPKT_DELAY_SOF | PLL_PWR_UP); 26 | udelay(1000); 27 | setbits_le32(&phy_regs->utmi_ctrl, PHY_PWR_UP); 28 | 29 | clrbits_le32(&phy_regs->utmi_pll, PLL_FBDIV_MASK | PLL_REFDIV_MASK); 30 | setbits_le32(&phy_regs->utmi_pll, N_DIVIDER << PLL_FBDIV | M_DIVIDER); 31 | 32 | setbits_le32(&phy_regs->utmi_tx, PHSEL_VAL << CK60_PHSEL); 33 | 34 | /* Calibrate pll */ 35 | timeout = 10000; 36 | while (--timeout && ((readl(&phy_regs->utmi_pll) & PLL_READY) == 0)) 37 | ; 38 | if (!timeout) 39 | return -1; 40 | 41 | udelay(200); 42 | setbits_le32(&phy_regs->utmi_pll, VCOCAL_START); 43 | udelay(400); 44 | clrbits_le32(&phy_regs->utmi_pll, VCOCAL_START); 45 | 46 | udelay(200); 47 | setbits_le32(&phy_regs->utmi_tx, RCAL_START); 48 | udelay(400); 49 | clrbits_le32(&phy_regs->utmi_tx, RCAL_START); 50 | 51 | timeout = 10000; 52 | while (--timeout && ((readl(&phy_regs->utmi_pll) & PLL_READY) == 0)) 53 | ; 54 | if (!timeout) 55 | return -1; 56 | 57 | return 0; 58 | } 59 | 60 | /* 61 | * Initialize USB host controller's UTMI Physical interface 62 | */ 63 | int utmi_init(void) 64 | { 65 | struct armd1mpmu_registers *mpmu_regs = 66 | (struct armd1mpmu_registers *)ARMD1_MPMU_BASE; 67 | 68 | struct armd1apmu_registers *apmu_regs = 69 | (struct armd1apmu_registers *)ARMD1_APMU_BASE; 70 | 71 | /* Turn on 26Mhz ref clock for UTMI PLL */ 72 | setbits_le32(&mpmu_regs->acgr, APB2_26M_EN | AP_26M); 73 | 74 | /* USB Clock reset */ 75 | writel(USB_SPH_AXICLK_EN, &apmu_regs->usbcrc); 76 | writel(USB_SPH_AXICLK_EN | USB_SPH_AXI_RST, &apmu_regs->usbcrc); 77 | 78 | /* Initialize UTMI transceiver */ 79 | return utmi_phy_init(); 80 | } 81 | -------------------------------------------------------------------------------- /u-boot/include/mk48t59.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH 3 | * Andreas Heppel 4 | * 5 | * See file CREDITS for list of people who contributed to this 6 | * project. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 | * MA 02111-1307 USA 22 | */ 23 | 24 | /* 25 | * Date & Time support for the MK48T59 RTC 26 | */ 27 | 28 | 29 | #if defined(CONFIG_RTC_MK48T59) && (CONFIG_COMMANDS & CFG_CMD_DATE) 30 | 31 | #define RTC_PORT_ADDR0 CFG_ISA_IO + 0x70 32 | #define RTC_PORT_ADDR1 RTC_PORT_ADDR0 + 0x1 33 | #define RTC_PORT_DATA CFG_ISA_IO + 0x76 34 | 35 | /* RTC Offsets */ 36 | #define RTC_SECONDS 0x1FF9 37 | #define RTC_MINUTES 0x1FFA 38 | #define RTC_HOURS 0x1FFB 39 | #define RTC_DAY_OF_WEEK 0x1FFC 40 | #define RTC_DAY_OF_MONTH 0x1FFD 41 | #define RTC_MONTH 0x1FFE 42 | #define RTC_YEAR 0x1FFF 43 | 44 | #define RTC_CONTROLA 0x1FF8 45 | #define RTC_CA_WRITE 0x80 46 | #define RTC_CA_READ 0x40 47 | #define RTC_CA_CALIB_SIGN 0x20 48 | #define RTC_CA_CALIB_MASK 0x1f 49 | 50 | #define RTC_CONTROLB 0x1FF9 51 | #define RTC_CB_STOP 0x80 52 | 53 | #define RTC_WATCHDOG 0x1FF7 54 | #define RTC_WDS 0x80 55 | #define RTC_WD_RB_16TH 0x0 56 | #define RTC_WD_RB_4TH 0x1 57 | #define RTC_WD_RB_1 0x2 58 | #define RTC_WD_RB_4 0x3 59 | 60 | void rtc_set_watchdog(short multi, short res); 61 | void *nvram_read(void *dest, const short src, size_t count); 62 | void nvram_write(short dest, const void *src, size_t count); 63 | 64 | #endif 65 | --------------------------------------------------------------------------------