diff options
Diffstat (limited to 'include')
28 files changed, 122 insertions, 50 deletions
| diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h index 3633b09aa..d8339b26c 100644 --- a/include/config_fallbacks.h +++ b/include/config_fallbacks.h @@ -50,7 +50,8 @@  	defined(CONFIG_CMD_PART) || \  	defined(CONFIG_CMD_GPT) || \  	defined(CONFIG_MMC) || \ -	defined(CONFIG_SYSTEMACE) +	defined(CONFIG_SYSTEMACE) || \ +	defined(CONFIG_SANDBOX)  #define HAVE_BLOCK_DEVICE  #endif diff --git a/include/configs/MigoR.h b/include/configs/MigoR.h index 9fd455142..88df94f11 100644 --- a/include/configs/MigoR.h +++ b/include/configs/MigoR.h @@ -10,8 +10,6 @@  #define __MIGO_R_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4		1  #define CONFIG_CPU_SH7722	1  #define CONFIG_MIGO_R		1 diff --git a/include/configs/ap325rxa.h b/include/configs/ap325rxa.h index 933de52c5..462b2e291 100644 --- a/include/configs/ap325rxa.h +++ b/include/configs/ap325rxa.h @@ -11,8 +11,6 @@  #define __AP325RXA_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4		1  #define CONFIG_CPU_SH7723	1  #define CONFIG_AP325RXA	1 diff --git a/include/configs/ap_sh4a_4a.h b/include/configs/ap_sh4a_4a.h index 83a5c37e4..bb39491f8 100644 --- a/include/configs/ap_sh4a_4a.h +++ b/include/configs/ap_sh4a_4a.h @@ -10,9 +10,6 @@  #define __AP_SH4A_4A_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4		1 -#define CONFIG_SH4A		1  #define CONFIG_CPU_SH7734	1  #define CONFIG_AP_SH4A_4A	1  #define CONFIG_400MHZ_MODE	1 diff --git a/include/configs/ecovec.h b/include/configs/ecovec.h index 3483cf1f5..3a5cc7482 100644 --- a/include/configs/ecovec.h +++ b/include/configs/ecovec.h @@ -23,9 +23,6 @@   */  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4		1 -#define CONFIG_SH4A		1  #define CONFIG_CPU_SH7724	1  #define CONFIG_BOARD_LATE_INIT		1  #define CONFIG_ECOVEC		1 diff --git a/include/configs/espt.h b/include/configs/espt.h index 1bd7eeceb..de16be70b 100644 --- a/include/configs/espt.h +++ b/include/configs/espt.h @@ -10,8 +10,6 @@  #ifndef __ESPT_H  #define __ESPT_H -#define CONFIG_SH		1 -#define CONFIG_SH4		1  #define CONFIG_CPU_SH7763	1  #define CONFIG_ESPT	1  #define __LITTLE_ENDIAN		1 diff --git a/include/configs/mpr2.h b/include/configs/mpr2.h index fcf237edb..8ae497c6d 100644 --- a/include/configs/mpr2.h +++ b/include/configs/mpr2.h @@ -24,8 +24,6 @@  #define CONFIG_VERSION_VARIABLE  /* CPU and platform */ -#define CONFIG_SH		1 -#define CONFIG_SH3		1  #define CONFIG_CPU_SH7720	1  #define CONFIG_MPR2		1 diff --git a/include/configs/ms7720se.h b/include/configs/ms7720se.h index ec8523eb9..585d68f20 100644 --- a/include/configs/ms7720se.h +++ b/include/configs/ms7720se.h @@ -9,8 +9,6 @@  #ifndef __MS7720SE_H  #define __MS7720SE_H -#define CONFIG_SH		1 -#define CONFIG_SH3		1  #define CONFIG_CPU_SH7720	1  #define CONFIG_MS7720SE		1 diff --git a/include/configs/ms7722se.h b/include/configs/ms7722se.h index 54fb7c3e8..1c8ada6c0 100644 --- a/include/configs/ms7722se.h +++ b/include/configs/ms7722se.h @@ -9,8 +9,6 @@  #ifndef __MS7722SE_H  #define __MS7722SE_H -#define CONFIG_SH		1 -#define CONFIG_SH4		1  #define CONFIG_CPU_SH7722	1  #define CONFIG_MS7722SE		1 diff --git a/include/configs/ms7750se.h b/include/configs/ms7750se.h index eea3bd1f2..4cf8efeca 100644 --- a/include/configs/ms7750se.h +++ b/include/configs/ms7750se.h @@ -9,8 +9,6 @@  #ifndef __MS7750SE_H  #define __MS7750SE_H -#define CONFIG_SH		1 -#define CONFIG_SH4		1  #define CONFIG_CPU_SH7750	1  /* #define CONFIG_CPU_SH7751	1 */  /* #define CONFIG_CPU_TYPE_R	1 */ diff --git a/include/configs/r0p7734.h b/include/configs/r0p7734.h index dd26a71bc..53128ecc1 100644 --- a/include/configs/r0p7734.h +++ b/include/configs/r0p7734.h @@ -10,9 +10,6 @@  #define __R0P7734_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4		1 -#define CONFIG_SH4A		1  #define CONFIG_CPU_SH7734	1  #define CONFIG_R0P7734		1  #define CONFIG_400MHZ_MODE	1 diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h index ddcc97587..24d0c34db 100644 --- a/include/configs/r2dplus.h +++ b/include/configs/r2dplus.h @@ -3,8 +3,6 @@  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4		1  #define CONFIG_CPU_SH7751	1  #define CONFIG_CPU_SH_TYPE_R	1  #define CONFIG_R2DPLUS		1 diff --git a/include/configs/r7780mp.h b/include/configs/r7780mp.h index f5e4daab8..8156724f7 100644 --- a/include/configs/r7780mp.h +++ b/include/configs/r7780mp.h @@ -11,8 +11,6 @@  #define __R7780RP_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4A		1  #define CONFIG_CPU_SH7780	1  #define CONFIG_R7780MP		1  #define CONFIG_SYS_R7780MP_OLD_FLASH	1 diff --git a/include/configs/rsk7203.h b/include/configs/rsk7203.h index acee4e898..543632458 100644 --- a/include/configs/rsk7203.h +++ b/include/configs/rsk7203.h @@ -11,8 +11,6 @@  #define __RSK7203_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH2		1  #define CONFIG_SH2A		1  #define CONFIG_CPU_SH7203	1  #define CONFIG_RSK7203	1 @@ -87,7 +85,7 @@  #define CONFIG_SH_TMU_CLK_FREQ CONFIG_SYS_CLK_FREQ  #define CONFIG_SH_SCIF_CLK_FREQ CONFIG_SYS_CLK_FREQ  #define CMT_CLK_DIVIDER	32	/* 8 (default), 32, 128 or 512 */ -#define CONFIG_SYS_HZ			(CONFIG_SYS_CLK_FREQ / CMT_CLK_DIVIDER) +#define CONFIG_SH_CMT_CLK_FREQ (CONFIG_SYS_CLK_FREQ / CMT_CLK_DIVIDER)  /* Network interface */  #define CONFIG_SMC911X diff --git a/include/configs/rsk7264.h b/include/configs/rsk7264.h index a5dbb64f4..4aaa3ef74 100644 --- a/include/configs/rsk7264.h +++ b/include/configs/rsk7264.h @@ -12,8 +12,6 @@  #define __RSK7264_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH2		1  #define CONFIG_SH2A		1  #define CONFIG_CPU_SH7264	1  #define CONFIG_RSK7264		1 @@ -67,7 +65,7 @@  #define CONFIG_SH_TMU_CLK_FREQ CONFIG_SYS_CLK_FREQ  #define CONFIG_SH_SCIF_CLK_FREQ CONFIG_SYS_CLK_FREQ  #define CMT_CLK_DIVIDER		32	/* 8 (default), 32, 128 or 512 */ -#define CONFIG_SYS_HZ		(CONFIG_SYS_CLK_FREQ / CMT_CLK_DIVIDER) +#define CONFIG_SH_CMT_CLK_FREQ (CONFIG_SYS_CLK_FREQ / CMT_CLK_DIVIDER)  /* Network interface */  #define CONFIG_SMC911X diff --git a/include/configs/rsk7269.h b/include/configs/rsk7269.h index 9f54160af..11fc231fa 100644 --- a/include/configs/rsk7269.h +++ b/include/configs/rsk7269.h @@ -11,8 +11,6 @@  #define __RSK7269_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH2		1  #define CONFIG_SH2A		1  #define CONFIG_CPU_SH7269	1  #define CONFIG_RSK7269		1 @@ -66,7 +64,7 @@  #define CONFIG_SH_TMU_CLK_FREQ CONFIG_SYS_CLK_FREQ  #define CONFIG_SH_SCIF_CLK_FREQ CONFIG_SYS_CLK_FREQ  #define CMT_CLK_DIVIDER		32	/* 8 (default), 32, 128 or 512 */ -#define CONFIG_SYS_HZ		(CONFIG_SYS_CLK_FREQ / CMT_CLK_DIVIDER) +#define CONFIG_SH_CMT_CLK_FREQ (CONFIG_SYS_CLK_FREQ / CMT_CLK_DIVIDER)  /* Network interface */  #define CONFIG_SMC911X diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 7e78a231d..a6d55822b 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -39,6 +39,9 @@  #define CONFIG_CMD_FAT  #define CONFIG_CMD_EXT4  #define CONFIG_CMD_EXT4_WRITE +#define CONFIG_CMD_PART +#define CONFIG_DOS_PARTITION +#define CONFIG_HOST_MAX_DEVICES 4  #define CONFIG_SYS_VSNPRINTF @@ -126,4 +129,6 @@  #define CONFIG_LZO  #define CONFIG_LZMA +#define CONFIG_TPM_TIS_SANDBOX +  #endif diff --git a/include/configs/sh7752evb.h b/include/configs/sh7752evb.h index ebdc5c8b0..f06abbca0 100644 --- a/include/configs/sh7752evb.h +++ b/include/configs/sh7752evb.h @@ -10,8 +10,6 @@  #define __SH7752EVB_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4A		1  #define CONFIG_SH_32BIT		1  #define CONFIG_CPU_SH7752	1  #define CONFIG_SH7752EVB	1 diff --git a/include/configs/sh7753evb.h b/include/configs/sh7753evb.h index f7eb86d1d..e400db08a 100644 --- a/include/configs/sh7753evb.h +++ b/include/configs/sh7753evb.h @@ -10,8 +10,6 @@  #define __SH7753EVB_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4A		1  #define CONFIG_SH_32BIT		1  #define CONFIG_CPU_SH7753	1  #define CONFIG_SH7753EVB	1 diff --git a/include/configs/sh7757lcr.h b/include/configs/sh7757lcr.h index ce1add268..08bff1da3 100644 --- a/include/configs/sh7757lcr.h +++ b/include/configs/sh7757lcr.h @@ -10,8 +10,6 @@  #define __SH7757LCR_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4A		1  #define CONFIG_SH_32BIT		1  #define CONFIG_CPU_SH7757	1  #define CONFIG_SH7757LCR	1 diff --git a/include/configs/sh7763rdp.h b/include/configs/sh7763rdp.h index a13778830..2438318fc 100644 --- a/include/configs/sh7763rdp.h +++ b/include/configs/sh7763rdp.h @@ -10,8 +10,6 @@  #ifndef __SH7763RDP_H  #define __SH7763RDP_H -#define CONFIG_SH		1 -#define CONFIG_SH4		1  #define CONFIG_CPU_SH7763	1  #define CONFIG_SH7763RDP	1  #define __LITTLE_ENDIAN		1 diff --git a/include/configs/sh7785lcr.h b/include/configs/sh7785lcr.h index 4acbcab1b..2723eaf2d 100644 --- a/include/configs/sh7785lcr.h +++ b/include/configs/sh7785lcr.h @@ -10,8 +10,6 @@  #define __SH7785LCR_H  #undef DEBUG -#define CONFIG_SH		1 -#define CONFIG_SH4A		1  #define CONFIG_CPU_SH7785	1  #define CONFIG_SH7785LCR	1 diff --git a/include/configs/shmin.h b/include/configs/shmin.h index 5c990fc96..f8155efbc 100644 --- a/include/configs/shmin.h +++ b/include/configs/shmin.h @@ -9,8 +9,6 @@  #ifndef __SHMIN_H  #define __SHMIN_H -#define CONFIG_SH		1 -#define CONFIG_SH3		1  #define CONFIG_CPU_SH7706	1  /* T-SH7706LAN */  #define CONFIG_SHMIN		1 diff --git a/include/linux/crc8.h b/include/linux/crc8.h new file mode 100644 index 000000000..b5fd2ac9d --- /dev/null +++ b/include/linux/crc8.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2013 Google, Inc + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + + +#ifndef __linux_crc8_h +#define __linux_crc8_h + +/** + * crc8() - Calculate and return CRC-8 of the data + * + * This uses an x^8 + x^2 + x + 1 polynomial.  A table-based algorithm would + * be faster, but for only a few bytes it isn't worth the code size + * + * @vptr: Buffer to checksum + * @len: Length of buffer in bytes + * @return CRC8 checksum + */ +unsigned int crc8(const unsigned char *vptr, int len); + +#endif diff --git a/include/os.h b/include/os.h index 950433daa..b65fba430 100644 --- a/include/os.h +++ b/include/os.h @@ -107,6 +107,35 @@ void os_tty_raw(int fd);  void *os_malloc(size_t length);  /** + * Free memory previous allocated with os_malloc()/os_realloc() + * + * This returns the memory to the OS. + * + * \param ptr		Pointer to memory block to free + */ +void *os_free(void *ptr); + +/** + * Reallocate previously-allocated memory to increase/decrease space + * + * This works in a similar way to the C library realloc() function. If + * length is 0, then ptr is freed. Otherwise the space used by ptr is + * expanded or reduced depending on whether length is larger or smaller + * than before. + * + * If ptr is NULL, then this is similar to calling os_malloc(). + * + * This function may need to move the memory block to make room for any + * extra space, in which case the new pointer is returned. + * + * \param ptr		Pointer to memory block to reallocate + * \param length	New length for memory block + * \return pointer to new memory block, or NULL on failure or if length + *	is 0. + */ +void *os_realloc(void *ptr, size_t length); + +/**   * Access to the usleep function of the os   *   * \param usec Time to sleep in micro seconds @@ -180,4 +209,40 @@ const char *os_dirent_get_typename(enum os_dirent_t type);   */  ssize_t os_get_filesize(const char *fname); +/** + * Write a character to the controlling OS terminal + * + * This bypasses the U-Boot console support and writes directly to the OS + * stdout file descriptor. + * + * @param ch	Character to write + */ +void os_putc(int ch); + +/** + * Write a string to the controlling OS terminal + * + * This bypasses the U-Boot console support and writes directly to the OS + * stdout file descriptor. + * + * @param str	String to write (note that \n is not appended) + */ +void os_puts(const char *str); + +/** + * Write the sandbox RAM buffer to a existing file + * + * @param fname		Filename to write memory to (simple binary format) + * @return 0 if OK, -ve on error + */ +int os_write_ram_buf(const char *fname); + +/** + * Read the sandbox RAM buffer from an existing file + * + * @param fname		Filename containing memory (simple binary format) + * @return 0 if OK, -ve on error + */ +int os_read_ram_buf(const char *fname); +  #endif diff --git a/include/part.h b/include/part.h index ce840bd84..4beb6db89 100644 --- a/include/part.h +++ b/include/part.h @@ -58,6 +58,8 @@ typedef struct block_dev_desc {  #define IF_TYPE_MMC		6  #define IF_TYPE_SD		7  #define IF_TYPE_SATA		8 +#define IF_TYPE_HOST		9 +#define IF_TYPE_MAX		10	/* Max number of IF_TYPE_* supported */  /* Part types */  #define PART_TYPE_UNKNOWN	0x00 @@ -102,6 +104,8 @@ block_dev_desc_t* usb_stor_get_dev(int dev);  block_dev_desc_t* mmc_get_dev(int dev);  block_dev_desc_t* systemace_get_dev(int dev);  block_dev_desc_t* mg_disk_get_dev(int dev); +block_dev_desc_t *host_get_dev(int dev); +int host_get_dev_err(int dev, block_dev_desc_t **blk_devp);  /* disk/part.c */  int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t *info); @@ -123,6 +127,7 @@ static inline block_dev_desc_t* usb_stor_get_dev(int dev) { return NULL; }  static inline block_dev_desc_t* mmc_get_dev(int dev) { return NULL; }  static inline block_dev_desc_t* systemace_get_dev(int dev) { return NULL; }  static inline block_dev_desc_t* mg_disk_get_dev(int dev) { return NULL; } +static inline block_dev_desc_t *host_get_dev(int dev) { return NULL; }  static inline int get_partition_info (block_dev_desc_t * dev_desc, int part,  	disk_partition_t *info) { return -1; } diff --git a/include/sandboxblockdev.h b/include/sandboxblockdev.h new file mode 100644 index 000000000..627787aa3 --- /dev/null +++ b/include/sandboxblockdev.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2013, Henrik Nordstrom <henrik@henriknordstrom.net> + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#ifndef __SANDBOX_BLOCK_DEV__ +#define __SANDBOX_BLOCK_DEV__ + +struct host_block_dev { +	block_dev_desc_t blk_dev; +	char *filename; +	int fd; +}; + +int host_dev_bind(int dev, char *filename); + +#endif diff --git a/include/sh_tmu.h b/include/sh_tmu.h index f5b42faea..61afc7136 100644 --- a/include/sh_tmu.h +++ b/include/sh_tmu.h @@ -47,7 +47,7 @@ struct tmu_regs {  };  #endif /* CONFIG_SH3 */ -#if defined(CONFIG_SH4) || defined(CONFIG_SH4A) || defined(CONFIG_RMOBILE) +#if defined(CONFIG_SH4) || defined(CONFIG_RMOBILE)  struct tmu_regs {  	u32 reserved;  	u8  tstr; |