1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2016 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
9 #include <dt-structs.h>
11 static int sandbox_spl_probe(struct udevice *dev)
13 struct dtd_sandbox_spl_test *plat = dev_get_platdata(dev);
16 printf("of-platdata probe:\n");
17 printf("bool %d\n", plat->boolval);
19 printf("byte %02x\n", plat->byteval);
21 for (i = 0; i < sizeof(plat->bytearray); i++)
22 printf(" %02x", plat->bytearray[i]);
25 printf("int %d\n", plat->intval);
27 for (i = 0; i < ARRAY_SIZE(plat->intarray); i++)
28 printf(" %d", plat->intarray[i]);
31 printf("longbytearray");
32 for (i = 0; i < sizeof(plat->longbytearray); i++)
33 printf(" %02x", plat->longbytearray[i]);
36 printf("string %s\n", plat->stringval);
37 printf("stringarray");
38 for (i = 0; i < ARRAY_SIZE(plat->stringarray); i++)
39 printf(" \"%s\"", plat->stringarray[i]);
45 U_BOOT_DRIVER(sandbox_spl_test) = {
46 .name = "sandbox_spl_test",
48 .flags = DM_FLAG_PRE_RELOC,
49 .probe = sandbox_spl_probe,