summaryrefslogtreecommitdiff
path: root/doc/develop
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-09-27 11:09:23 -0400
committerTom Rini <trini@konsulko.com>2021-09-27 11:09:23 -0400
commit1d1f98c8eed7bb4792300e655c2cb70136928f74 (patch)
treed08df140d52bd1298fa0e81ce908e2e09a880e5d /doc/develop
parente908d20fcbd847e17345591fc171b59d9a156516 (diff)
parent933bf2644591281ed96f9d5771cbb35fe95bcb00 (diff)
downloadu-boot-1d1f98c8eed7bb4792300e655c2cb70136928f74.tar.gz
u-boot-1d1f98c8eed7bb4792300e655c2cb70136928f74.tar.bz2
u-boot-1d1f98c8eed7bb4792300e655c2cb70136928f74.zip
Merge tag 'dm-pull-next-27sep21' of https://source.denx.de/u-boot/custodians/u-boot-dm into next
Various of-platdata improvements, including CONFIG_OF_REAL
Diffstat (limited to 'doc/develop')
-rw-r--r--doc/develop/driver-model/of-plat.rst56
1 files changed, 52 insertions, 4 deletions
diff --git a/doc/develop/driver-model/of-plat.rst b/doc/develop/driver-model/of-plat.rst
index 0bd978759c..237af38ad4 100644
--- a/doc/develop/driver-model/of-plat.rst
+++ b/doc/develop/driver-model/of-plat.rst
@@ -215,16 +215,16 @@ For example:
static int mmc_of_to_plat(struct udevice *dev)
{
- #if !CONFIG_IS_ENABLED(OF_PLATDATA)
+ if (CONFIG_IS_ENABLED(OF_REAL)) {
/* Decode the devicetree data */
struct mmc_plat *plat = dev_get_plat(dev);
const void *blob = gd->fdt_blob;
int node = dev_of_offset(dev);
plat->fifo_depth = fdtdec_get_int(blob, node, "fifo-depth", 0);
- #endif
+ }
- return 0;
+ return 0;
}
static int mmc_probe(struct udevice *dev)
@@ -642,7 +642,7 @@ Missing .compatible or Missing .id
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Various things can cause dtoc to fail to find the driver and it tries to
-warn about these. For example:
+warn about these. For example::
rockchip_rk3188_uart: Missing .compatible in drivers/serial/serial_rockchip.c
: WARNING: the driver rockchip_rk3188_uart was not found in the driver list
@@ -733,6 +733,54 @@ The fix above would fix this error too. But if you do want this uclass in the
build, check your Kconfig settings to make sure the uclass is being built
(CONFIG_MISC in this case).
+Another error that can crop up is something like::
+
+ spl/dts/dt-device.c:257:38: error: invalid application of ‘sizeof’ to
+ incomplete type ‘struct sandbox_irq_priv’
+ 257 | u8 _sandbox_irq_priv_irq_sbox[sizeof(struct sandbox_irq_priv)]
+ | ^~~~~~
+
+This indicates that `struct sandbox_irq_priv` is not defined anywhere. The
+solution is to add a DM_HEADER() line, as below, so this is included in the
+dt-device.c file::
+
+ U_BOOT_DRIVER(sandbox_irq) = {
+ .name = "sandbox_irq",
+ .id = UCLASS_IRQ,
+ .of_match = sandbox_irq_ids,
+ .ops = &sandbox_irq_ops,
+ .priv_auto = sizeof(struct sandbox_irq_priv),
+ DM_HEADER(<asm/irq.h>)
+ };
+
+Note that there is no dependency checking on the above, so U-Boot will not
+regenerate the dt-device.c file when you update the source file (here,
+`irq_sandbox.c`). You need to run `make mrproper` first to get a fresh build.
+
+Another error that can crop up is something like::
+
+ spl/dts/dt-device.c:257:38: error: invalid application of ‘sizeof’ to
+ incomplete type ‘struct sandbox_irq_priv’
+ 257 | u8 _sandbox_irq_priv_irq_sbox[sizeof(struct sandbox_irq_priv)]
+ | ^~~~~~
+
+This indicates that `struct sandbox_irq_priv` is not defined anywhere. The
+solution is to add a DM_HEADER() line, as below, so this is included in the
+dt-device.c file::
+
+ U_BOOT_DRIVER(sandbox_irq) = {
+ .name = "sandbox_irq",
+ .id = UCLASS_IRQ,
+ .of_match = sandbox_irq_ids,
+ .ops = &sandbox_irq_ops,
+ .priv_auto = sizeof(struct sandbox_irq_priv),
+ DM_HEADER(<asm/irq.h>)
+ };
+
+Note that there is no dependency checking on the above, so U-Boot will not
+regenerate the dt-device.c file when you update the source file (here,
+`irq_sandbox.c`). You need to run `make mrproper` first to get a fresh build.
+
Caveats
-------