summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2020-07-06 15:46:38 -0400
committerTom Rini <[email protected]>2020-07-06 15:46:38 -0400
commit6e7d7aa2e2062995c1cbc3af81cf40c04c50ad30 (patch)
tree3c560d567a76e9850e0195fb892d7e1fbaeed198 /include/dm
parent2f5fbb5b39f7b67044dda5c35e4a4b31685a3109 (diff)
parent621e09cb3bf7e6d4fce9dd5e6de97e057adebc3a (diff)
Merge branch 'next'
Merge all outstanding changes from the current next branch in now that we have released.
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/platform_data/fsl_espi.h16
-rw-r--r--include/dm/platform_data/pxa_mmc_gen.h22
-rw-r--r--include/dm/platform_data/serial_pxa.h8
-rw-r--r--include/dm/read.h10
4 files changed, 51 insertions, 5 deletions
diff --git a/include/dm/platform_data/fsl_espi.h b/include/dm/platform_data/fsl_espi.h
new file mode 100644
index 00000000000..812933f51cd
--- /dev/null
+++ b/include/dm/platform_data/fsl_espi.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2019 NXP
+ */
+
+#ifndef __fsl_espi_h
+#define __fsl_espi_h
+
+struct fsl_espi_platdata {
+ uint flags;
+ uint speed_hz;
+ uint num_chipselect;
+ fdt_addr_t regs_addr;
+};
+
+#endif /* __fsl_espi_h */
diff --git a/include/dm/platform_data/pxa_mmc_gen.h b/include/dm/platform_data/pxa_mmc_gen.h
new file mode 100644
index 00000000000..9875bab2cf4
--- /dev/null
+++ b/include/dm/platform_data/pxa_mmc_gen.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2019 Marcel Ziswiler <[email protected]>
+ */
+
+#ifndef __PXA_MMC_GEN_H
+#define __PXA_MMC_GEN_H
+
+#include <mmc.h>
+
+/*
+ * struct pxa_mmc_platdata - information about a PXA MMC controller
+ *
+ * @base: MMC controller base register address
+ */
+struct pxa_mmc_plat {
+ struct mmc_config cfg;
+ struct mmc mmc;
+ struct pxa_mmc_regs *base;
+};
+
+#endif /* __PXA_MMC_GEN_H */
diff --git a/include/dm/platform_data/serial_pxa.h b/include/dm/platform_data/serial_pxa.h
index 408c00885de..b78bdb64094 100644
--- a/include/dm/platform_data/serial_pxa.h
+++ b/include/dm/platform_data/serial_pxa.h
@@ -17,7 +17,7 @@
#define FFUART_INDEX 1
#define STUART_INDEX 2
#elif CONFIG_CPU_PXA25X
-#define UART_CLK_BASE (1 << 4) /* HWUART */
+#define UART_CLK_BASE BIT(4) /* HWUART */
#define UART_CLK_REG CKEN
#define HWUART_INDEX 0
#define STUART_INDEX 1
@@ -42,9 +42,9 @@
/*
* struct pxa_serial_platdata - information about a PXA port
*
- * @base: Uart port base register address
- * @port: Uart port index, for cpu with pinmux for uart / gpio
- * baudrtatre: Uart port baudrate
+ * @base: Uart port base register address
+ * @port: Uart port index, for cpu with pinmux for uart / gpio
+ * baudrtatre: Uart port baudrate
*/
struct pxa_serial_platdata {
struct pxa_uart_regs *base;
diff --git a/include/dm/read.h b/include/dm/read.h
index b952551d555..f02ec959541 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -799,7 +799,9 @@ static inline fdt_addr_t dev_read_addr(const struct udevice *dev)
static inline void *dev_read_addr_ptr(const struct udevice *dev)
{
- return devfdt_get_addr_ptr(dev);
+ void *addr = devfdt_get_addr_ptr(dev);
+
+ return ((fdt_addr_t)(uintptr_t)addr == FDT_ADDR_T_NONE) ? NULL : addr;
}
static inline fdt_addr_t dev_read_addr_pci(const struct udevice *dev)
@@ -923,8 +925,12 @@ static inline const void *dev_read_prop_by_prop(struct ofprop *prop,
static inline int dev_read_alias_seq(const struct udevice *dev, int *devnump)
{
+#if CONFIG_IS_ENABLED(OF_CONTROL)
return fdtdec_get_alias_seq(gd->fdt_blob, dev->uclass->uc_drv->name,
dev_of_offset(dev), devnump);
+#else
+ return -ENOTSUPP;
+#endif
}
static inline int dev_read_u32_array(const struct udevice *dev,
@@ -983,6 +989,8 @@ static inline u64 dev_translate_dma_address(const struct udevice *dev,
static inline int dev_read_alias_highest_id(const char *stem)
{
+ if (!CONFIG_IS_ENABLED(OF_LIBFDT))
+ return -1;
return fdtdec_get_alias_highest_id(gd->fdt_blob, stem);
}