diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 6 | ||||
-rw-r--r-- | include/configs/P2041RDB.h | 4 | ||||
-rw-r--r-- | include/configs/am335x_evm.h | 6 | ||||
-rw-r--r-- | include/configs/eXalion.h | 2 | ||||
-rw-r--r-- | include/configs/sacsng.h | 2 | ||||
-rw-r--r-- | include/configs/sama5d3xek.h | 8 | ||||
-rw-r--r-- | include/dfu.h | 35 | ||||
-rw-r--r-- | include/i2s.h | 1 | ||||
-rw-r--r-- | include/libfdt.h | 4 | ||||
-rw-r--r-- | include/linux/usb/atmel_usba_udc.h | 26 | ||||
-rw-r--r-- | include/linux/usb/gadget.h | 1 | ||||
-rw-r--r-- | include/miiphy.h | 2 | ||||
-rw-r--r-- | include/mmc.h | 4 | ||||
-rw-r--r-- | include/sdhci.h | 3 | ||||
-rw-r--r-- | include/usb_mass_storage.h | 9 |
15 files changed, 102 insertions, 11 deletions
diff --git a/include/common.h b/include/common.h index 4d2a56d..f1a590a 100644 --- a/include/common.h +++ b/include/common.h @@ -383,7 +383,7 @@ int setenv_hex(const char *varname, ulong value); /** * setenv_addr - Set an environment variable to an address in hex * - * @varname: Environmet variable to set + * @varname: Environment variable to set * @addr: Value to set it to * @return 0 if ok, 1 on error */ @@ -1017,10 +1017,10 @@ static inline phys_addr_t map_to_sysmem(void *ptr) * of a function scoped static buffer. It can not be used to create a cache * line aligned global buffer. */ -#define PAD_COUNT(s, pad) ((s - 1) / pad + 1) +#define PAD_COUNT(s, pad) (((s) - 1) / (pad) + 1) #define PAD_SIZE(s, pad) (PAD_COUNT(s, pad) * pad) #define ALLOC_ALIGN_BUFFER_PAD(type, name, size, align, pad) \ - char __##name[ROUND(PAD_SIZE(size * sizeof(type), pad), align) \ + char __##name[ROUND(PAD_SIZE((size) * sizeof(type), pad), align) \ + (align - 1)]; \ \ type *name = (type *) ALIGN((uintptr_t)__##name, align) diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h index 905bacf..862614b 100644 --- a/include/configs/P2041RDB.h +++ b/include/configs/P2041RDB.h @@ -354,10 +354,10 @@ unsigned long get_board_sys_clk(unsigned long dummy); #define CONFIG_SYS_I2C_FSL #define CONFIG_SYS_FSL_I2C_SPEED 400000 #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F -#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000 +#define CONFIG_SYS_FSL_I2C_OFFSET 0x118000 #define CONFIG_SYS_FSL_I2C2_SPEED 400000 #define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F -#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100 +#define CONFIG_SYS_FSL_I2C2_OFFSET 0x118100 /* * RapidIO diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index cdf689f..3482470 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -100,6 +100,7 @@ "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ "importbootenv=echo Importing environment from mmc ...; " \ "env import -t $loadaddr $filesize\0" \ + "dfu_alt_info_ram=" DFU_ALT_INFO_RAM "\0" \ "ramargs=setenv bootargs console=${console} " \ "${optargs} " \ "root=${ramroot} " \ @@ -327,6 +328,11 @@ "kernel part 0 8;" \ "rootfs part 0 9" #endif +#define CONFIG_DFU_RAM +#define DFU_ALT_INFO_RAM \ + "kernel ram 0x80200000 0xD80000;" \ + "fdt ram 0x80F80000 0x80000;" \ + "ramdisk ram 0x81000000 0x4000000" /* * Default to using SPI for environment, etc. diff --git a/include/configs/eXalion.h b/include/configs/eXalion.h index c2d04a2..7321b60 100644 --- a/include/configs/eXalion.h +++ b/include/configs/eXalion.h @@ -119,7 +119,7 @@ #define CONFIG_ENV_IS_IN_FLASH 1 #define CONFIG_ENV_SECT_SIZE 0x20000 /* Size of one Flash sector */ -#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE /* Use one Flash sector for enviroment */ +#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE /* Use one Flash sector for environment */ #define CONFIG_ENV_ADDR 0xFFFC0000 #define CONFIG_ENV_OFFSET 0 /* starting right at the beginning */ diff --git a/include/configs/sacsng.h b/include/configs/sacsng.h index d63d0c4..0feef1e 100644 --- a/include/configs/sacsng.h +++ b/include/configs/sacsng.h @@ -305,7 +305,7 @@ #define CONFIG_ENV_IN_OWN_SECT 1 /* Define this to contain any number of null terminated strings that - * will be part of the default enviroment compiled into the boot image. + * will be part of the default environment compiled into the boot image. */ #define CONFIG_EXTRA_ENV_SETTINGS \ "quiet=0\0" \ diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h index 76fa500..79c0068 100644 --- a/include/configs/sama5d3xek.h +++ b/include/configs/sama5d3xek.h @@ -162,6 +162,14 @@ #define CONFIG_USB_STORAGE #endif +/* USB device */ +#define CONFIG_USB_GADGET +#define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_ATMEL_USBA +#define CONFIG_USB_ETHER +#define CONFIG_USB_ETH_RNDIS +#define CONFIG_USBNET_MANUFACTURER "Atmel SAMA5D3xEK" + #if defined(CONFIG_CMD_USB) || defined(CONFIG_CMD_MMC) #define CONFIG_CMD_FAT #endif diff --git a/include/dfu.h b/include/dfu.h index 47b9055..b2ecf1b 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -14,11 +14,13 @@ #include <common.h> #include <linux/list.h> #include <mmc.h> +#include <linux/usb/composite.h> enum dfu_device_type { DFU_DEV_MMC = 1, DFU_DEV_ONENAND, DFU_DEV_NAND, + DFU_DEV_RAM, }; enum dfu_layout { @@ -27,6 +29,12 @@ enum dfu_layout { DFU_FS_EXT2, DFU_FS_EXT3, DFU_FS_EXT4, + DFU_RAM_ADDR, +}; + +enum dfu_op { + DFU_OP_READ = 1, + DFU_OP_WRITE, }; struct mmc_internal_data { @@ -51,6 +59,11 @@ struct nand_internal_data { unsigned int ubi; }; +struct ram_internal_data { + void *start; + unsigned int size; +}; + static inline unsigned int get_mmc_blk_size(int dev) { return find_mmc_device(dev)->read_bl_len; @@ -62,7 +75,7 @@ static inline unsigned int get_mmc_blk_size(int dev) #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024*1024*8) /* 8 MiB */ #endif #ifndef CONFIG_SYS_DFU_MAX_FILE_SIZE -#define CONFIG_SYS_DFU_MAX_FILE_SIZE (4 << 20) /* 4 MiB */ +#define CONFIG_SYS_DFU_MAX_FILE_SIZE CONFIG_SYS_DFU_DATA_BUF_SIZE #endif struct dfu_entity { @@ -76,6 +89,7 @@ struct dfu_entity { union { struct mmc_internal_data mmc; struct nand_internal_data nand; + struct ram_internal_data ram; } data; int (*read_medium)(struct dfu_entity *dfu, @@ -113,6 +127,7 @@ struct dfu_entity *dfu_get_entity(int alt); char *dfu_extract_token(char** e, int *n); void dfu_trigger_reset(void); bool dfu_reset(void); +int dfu_init_env_entities(char *interface, int dev); int dfu_read(struct dfu_entity *de, void *buf, int size, int blk_seq_num); int dfu_write(struct dfu_entity *de, void *buf, int size, int blk_seq_num); @@ -137,4 +152,22 @@ static inline int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s) } #endif +#ifdef CONFIG_DFU_RAM +extern int dfu_fill_entity_ram(struct dfu_entity *dfu, char *s); +#else +static inline int dfu_fill_entity_ram(struct dfu_entity *dfu, char *s) +{ + puts("RAM support not available!\n"); + return -1; +} +#endif + +#ifdef CONFIG_DFU_FUNCTION +int dfu_add(struct usb_configuration *c); +#else +int dfu_add(struct usb_configuration *c) +{ + return 0; +} +#endif #endif /* __DFU_ENTITY_H_ */ diff --git a/include/i2s.h b/include/i2s.h index aee52e7..8dd2cc3 100644 --- a/include/i2s.h +++ b/include/i2s.h @@ -85,6 +85,7 @@ struct i2stx_info { unsigned int bitspersample; /* bits per sample */ unsigned int channels; /* audio channels */ unsigned int base_address; /* I2S Register Base */ + unsigned int id; /* I2S controller id */ }; /* diff --git a/include/libfdt.h b/include/libfdt.h index 765d84f..9eefaaf 100644 --- a/include/libfdt.h +++ b/include/libfdt.h @@ -596,9 +596,9 @@ const char *fdt_get_alias_namelen(const void *fdt, const char *name, int namelen); /** - * fdt_get_alias - retreive the path referenced by a given alias + * fdt_get_alias - retrieve the path referenced by a given alias * @fdt: pointer to the device tree blob - * @name: name of the alias th look up + * @name: name of the alias to look up * * fdt_get_alias() retrieves the value of a given alias. That is, the * value of the property named 'name' in the node /aliases. diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h new file mode 100644 index 0000000..be29ef0 --- /dev/null +++ b/include/linux/usb/atmel_usba_udc.h @@ -0,0 +1,26 @@ +/* + * Platform data definitions for Atmel USBA gadget driver + * [Original from Linux kernel: include/linux/usb/atmel_usba_udc.h] + * + * SPDX-License-Identifier: GPL-2.0+ + */ +#ifndef __LINUX_USB_USBA_H__ +#define __LINUX_USB_USBA_H__ + +struct usba_ep_data { + char *name; + int index; + int fifo_size; + int nr_banks; + int can_dma; + int can_isoc; +}; + +struct usba_platform_data { + int num_ep; + struct usba_ep_data *ep; +}; + +extern int usba_udc_probe(struct usba_platform_data *pdata); + +#endif /* __LINUX_USB_USBA_H */ diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 220d068..a8a5763 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -18,6 +18,7 @@ #ifndef __LINUX_USB_GADGET_H #define __LINUX_USB_GADGET_H +#include <errno.h> #include <linux/list.h> struct usb_ep; diff --git a/include/miiphy.h b/include/miiphy.h index 657b496..088797e 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -1,5 +1,5 @@ /* - * SPDX-License-Identifier: GPL-2.0 ibm-pibs + * SPDX-License-Identifier: GPL-2.0 IBM-pibs * * Additions (C) Copyright 2009 Industrie Dial Face S.p.A. */ diff --git a/include/mmc.h b/include/mmc.h index 228d771..214b9ed 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -335,7 +335,11 @@ int mmc_start_init(struct mmc *mmc); void mmc_set_preinit(struct mmc *mmc, int preinit); #ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC_SPI #define mmc_host_is_spi(mmc) ((mmc)->host_caps & MMC_MODE_SPI) +#else +#define mmc_host_is_spi(mmc) 0 +#endif struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode); #else int mmc_legacy_init(int verbose); diff --git a/include/sdhci.h b/include/sdhci.h index b18b873..74d06ae 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -192,6 +192,8 @@ #define SDHCI_SPEC_200 1 #define SDHCI_SPEC_300 2 +#define SDHCI_GET_VERSION(x) (x->version & SDHCI_SPEC_VER_MASK) + /* * End of controller registers. */ @@ -210,6 +212,7 @@ #define SDHCI_QUIRK_NO_CD (1 << 5) #define SDHCI_QUIRK_WAIT_SEND_CMD (1 << 6) #define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1 << 7) +#define SDHCI_QUIRK_USE_WIDE8 (1 << 8) /* to make gcc happy */ struct sdhci_host; diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h index 35cdcc3..e08deb4 100644 --- a/include/usb_mass_storage.h +++ b/include/usb_mass_storage.h @@ -11,6 +11,7 @@ #define SECTOR_SIZE 0x200 #include <mmc.h> +#include <linux/usb/composite.h> struct ums_device { struct mmc *mmc; @@ -39,4 +40,12 @@ extern struct ums_board_info *board_ums_init(unsigned int, extern int usb_gadget_handle_interrupts(void); extern int fsg_main_thread(void *); +#ifdef CONFIG_USB_GADGET_MASS_STORAGE +int fsg_add(struct usb_configuration *c); +#else +int fsg_add(struct usb_configuration *c) +{ + return 0; +} +#endif #endif /* __USB_MASS_STORAGE_H__ */ |