diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/abort.h | 4 | ||||
-rw-r--r-- | include/ata_drive.h | 4 | ||||
-rw-r--r-- | include/common.h | 4 | ||||
-rw-r--r-- | include/console.h | 2 | ||||
-rw-r--r-- | include/elf.h | 29 | ||||
-rw-r--r-- | include/gpio.h | 18 | ||||
-rw-r--r-- | include/linux/mfd/rave-sp.h | 1 | ||||
-rw-r--r-- | include/linux/mtd/nand.h | 7 | ||||
-rw-r--r-- | include/linux/mtd/spi-nor.h | 1 | ||||
-rw-r--r-- | include/mci.h | 1 | ||||
-rw-r--r-- | include/param.h | 2 |
11 files changed, 62 insertions, 11 deletions
diff --git a/include/abort.h b/include/abort.h index 326467c25f..89ee549e34 100644 --- a/include/abort.h +++ b/include/abort.h @@ -1,9 +1,7 @@ #ifndef __ABORT_H #define __ABORT_H -#include <asm/barebox.h> - -#if defined ARCH_HAS_DATA_ABORT_MASK && !defined __PBL__ +#if defined CONFIG_ARCH_HAS_DATA_ABORT_MASK && !defined __PBL__ /* * data_abort_mask - ignore data aborts diff --git a/include/ata_drive.h b/include/ata_drive.h index 11685eef12..d61c6f11d4 100644 --- a/include/ata_drive.h +++ b/include/ata_drive.h @@ -14,7 +14,7 @@ */ #ifndef ATA_DISK_H -# define ATA_DISK +#define ATA_DISK_H #include <block.h> @@ -197,4 +197,4 @@ struct device_d; * 0x400 data data 16 bit area with 1 kiB in size */ -#endif /* ATA_DISK */ +#endif /* ATA_DISK_H */ diff --git a/include/common.h b/include/common.h index 8cc8e14fb7..6563068467 100644 --- a/include/common.h +++ b/include/common.h @@ -51,8 +51,6 @@ #error "None of __LITTLE_ENDIAN and __BIG_ENDIAN are defined" #endif -#include <asm/barebox.h> /* boot information for Linux kernel */ - /* * Function Prototypes */ @@ -72,7 +70,7 @@ int ctrlc(void); int arch_ctrlc(void); void ctrlc_handled(void); -#ifdef ARCH_HAS_STACK_DUMP +#ifdef CONFIG_ARCH_HAS_STACK_DUMP void dump_stack(void); #else static inline void dump_stack(void) diff --git a/include/console.h b/include/console.h index 4062e5abf6..7afe59e93a 100644 --- a/include/console.h +++ b/include/console.h @@ -42,7 +42,7 @@ struct console_device { int (*tstc)(struct console_device *cdev); void (*putc)(struct console_device *cdev, char c); - int (*puts)(struct console_device *cdev, const char *s); + int (*puts)(struct console_device *cdev, const char *s, size_t nbytes); int (*getc)(struct console_device *cdev); int (*setbrg)(struct console_device *cdev, int baudrate); void (*flush)(struct console_device *cdev); diff --git a/include/elf.h b/include/elf.h index 92c8d9c127..633f4992dd 100644 --- a/include/elf.h +++ b/include/elf.h @@ -400,11 +400,38 @@ static inline void arch_write_notes(struct file *file) { } struct elf_image { struct list_head list; - unsigned long entry; + u8 class; + u64 entry; void *buf; }; struct elf_image *elf_load_image(void *buf); void elf_release_image(struct elf_image *elf); +#define ELF_GET_FIELD(__s, __field, __type) \ +static inline __type elf_##__s##_##__field(struct elf_image *elf, void *arg) { \ + if (elf->class == ELFCLASS32) \ + return (__type) ((struct elf32_##__s *) arg)->__field; \ + else \ + return (__type) ((struct elf64_##__s *) arg)->__field; \ +} + +ELF_GET_FIELD(hdr, e_entry, u64) +ELF_GET_FIELD(hdr, e_phnum, u16) +ELF_GET_FIELD(hdr, e_phoff, u64) +ELF_GET_FIELD(hdr, e_type, u16) +ELF_GET_FIELD(phdr, p_paddr, u64) +ELF_GET_FIELD(phdr, p_filesz, u64) +ELF_GET_FIELD(phdr, p_memsz, u64) +ELF_GET_FIELD(phdr, p_type, u32) +ELF_GET_FIELD(phdr, p_offset, u64) + +static inline unsigned long elf_size_of_phdr(struct elf_image *elf) +{ + if (elf->class == ELFCLASS32) + return sizeof(Elf32_Phdr); + else + return sizeof(Elf64_Phdr); +} + #endif /* _LINUX_ELF_H */ diff --git a/include/gpio.h b/include/gpio.h index 1926edeca7..4d5f2c25c7 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -3,6 +3,7 @@ #include <linux/types.h> #include <linux/list.h> +#include <linux/iopoll.h> #ifdef CONFIG_GENERIC_GPIO void gpio_set_value(unsigned gpio, int value); @@ -31,6 +32,21 @@ static inline int gpio_direction_input(unsigned gpio) void gpio_set_active(unsigned gpio, bool state); int gpio_is_active(unsigned gpio); int gpio_direction_active(unsigned gpio, bool state); + +/** + * gpio_poll_timeout_us - Poll till GPIO reaches requested active state + * @gpio: gpio to poll + * @active: wait till GPIO is active if true, wait till it's inactive if false + * @timeout_us: timeout in microseconds + * + * During the wait barebox pollers are called, if any. + */ +#define gpio_poll_timeout_us(gpio, active, timeout_us) \ + ({ \ + int __state; \ + readx_poll_timeout(gpio_is_active, gpio, __state, \ + __state == (active), timeout_us); \ + }) #else static inline void gpio_set_active(unsigned gpio, int value) { @@ -43,6 +59,8 @@ static inline int gpio_direction_active(unsigned gpio, int value) { return -EINVAL; } + +#define gpio_poll_timeout_us(gpio, val, timeout_us) (-ENOSYS) #endif #if defined(CONFIG_ARCH_NR_GPIO) && CONFIG_ARCH_NR_GPIO > 0 diff --git a/include/linux/mfd/rave-sp.h b/include/linux/mfd/rave-sp.h index 7b3187cb74..92315c6e12 100644 --- a/include/linux/mfd/rave-sp.h +++ b/include/linux/mfd/rave-sp.h @@ -14,6 +14,7 @@ enum rave_sp_command { RAVE_SP_CMD_GET_FIRMWARE_VERSION = 0x20, RAVE_SP_CMD_GET_BOOTLOADER_VERSION = 0x21, + RAVE_SP_CMD_GET_OPERATIONAL_MODE = 0x25, RAVE_SP_CMD_BOOT_SOURCE = 0x26, RAVE_SP_CMD_GET_BOARD_COPPER_REV = 0x2B, RAVE_SP_CMD_GET_GPIO_STATE = 0x2F, diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 7f17767c69..762f9c4f2a 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -543,6 +543,8 @@ struct nand_chip { void *priv; unsigned int bbt_type; + + struct mtd_info mtd; }; /* @@ -799,4 +801,9 @@ struct nand_sdr_timings { /* get timing characteristics from ONFI timing mode. */ const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings(int mode); +static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd) +{ + return mtd->priv; +} + #endif /* __LINUX_MTD_NAND_H */ diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 33413ff955..105f381ada 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -64,6 +64,7 @@ #define SPINOR_OP_CLFSR 0x50 /* Clear flag status register */ #define SPINOR_OP_RDEAR 0xc8 /* Read Extended Address Register */ #define SPINOR_OP_WREAR 0xc5 /* Write Extended Address Register */ +#define SPINOR_OP_GBULK 0x98 /* Global Block Unlock Protection */ /* 4-byte address opcodes - used on Spansion and some Macronix flashes. */ #define SPINOR_OP_READ_4B 0x13 /* Read data bytes (low frequency) */ diff --git a/include/mci.h b/include/mci.h index 072008ef9d..77625ea8e9 100644 --- a/include/mci.h +++ b/include/mci.h @@ -164,6 +164,7 @@ #define EXT_CSD_EXT_PARTITIONS_ATTRIBUTE 52 /* R/W, 2 bytes */ #define EXT_CSD_EXCEPTION_EVENTS_STATUS 54 /* RO, 2 bytes */ #define EXT_CSD_EXCEPTION_EVENTS_CTRL 56 /* R/W, 2 bytes */ +#define EXT_CSD_EXCEPTION_DYNCAP_NEEDED 58 /* RO, 1 byte */ #define EXT_CSD_CLASS_6_CTRL 59 /* R/W */ #define EXT_CSD_INI_TIMEOUT_EMU 60 /* RO */ #define EXT_CSD_DATA_SECTOR_SIZE 61 /* RO */ diff --git a/include/param.h b/include/param.h index b618a2305d..dea6990497 100644 --- a/include/param.h +++ b/include/param.h @@ -272,7 +272,7 @@ static inline struct param_d *dev_add_param_string_ro(struct device_d *dev, cons } static inline struct param_d *dev_add_param_string_fixed(struct device_d *dev, const char *name, - char *value) + const char *value) { return dev_add_param_fixed(dev, name, value); } |