diff options
Diffstat (limited to 'include/dm')
-rw-r--r-- | include/dm/ofnode.h | 16 | ||||
-rw-r--r-- | include/dm/platform_data/spi_coldfire.h | 29 |
2 files changed, 44 insertions, 1 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index d206ee2caab..4ab2ae1ba5c 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -224,7 +224,7 @@ static inline int ofnode_read_s32(ofnode node, const char *propname, * @def: default value to return if the property has no value * @return property value, or @def if not found */ -int ofnode_read_u32_default(ofnode ref, const char *propname, u32 def); +u32 ofnode_read_u32_default(ofnode ref, const char *propname, u32 def); /** * ofnode_read_s32_default() - Read a 32-bit integer from a property @@ -355,6 +355,20 @@ ofnode ofnode_get_by_phandle(uint phandle); int ofnode_read_size(ofnode node, const char *propname); /** + * ofnode_get_addr_size_index() - get an address/size from a node + * based on index + * + * This reads the register address/size from a node based on index + * + * @node: node to read from + * @index: Index of address to read (0 for first) + * @size: Pointer to size of the address + * @return address, or FDT_ADDR_T_NONE if not present or invalid + */ +phys_addr_t ofnode_get_addr_size_index(ofnode node, int index, + fdt_size_t *size); + +/** * ofnode_get_addr_index() - get an address from a node * * This reads the register address from a node diff --git a/include/dm/platform_data/spi_coldfire.h b/include/dm/platform_data/spi_coldfire.h new file mode 100644 index 00000000000..8ad8eaedfde --- /dev/null +++ b/include/dm/platform_data/spi_coldfire.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2018 Angelo Dureghello <angelo@sysam.it> + */ + +#ifndef __spi_coldfire_h +#define __spi_coldfire_h + +#define MAX_CTAR_REGS 8 +#define MAX_CTAR_FIELDS 8 + +/* + * struct coldfire_spi_platdata - information about a coldfire spi module + * + * @regs_addr: base address for module registers + * @speed_hz: default SCK frequency + * @mode: default SPI mode + * @num_cs: number of DSPI chipselect signals + */ +struct coldfire_spi_platdata { + fdt_addr_t regs_addr; + uint speed_hz; + uint mode; + uint num_cs; + uint ctar[MAX_CTAR_REGS][MAX_CTAR_FIELDS]; +}; + +#endif /* __spi_coldfire_h */ + |