2 * Copyright (c) 2016 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <dt-structs.h>
12 static int sandbox_spl_probe(struct udevice *dev)
14 struct dtd_sandbox_spl_test *plat = dev_get_platdata(dev);
17 printf("of-platdata probe:\n");
18 printf("bool %d\n", plat->boolval);
20 printf("byte %02x\n", plat->byteval);
22 for (i = 0; i < sizeof(plat->bytearray); i++)
23 printf(" %02x", plat->bytearray[i]);
26 printf("int %d\n", plat->intval);
28 for (i = 0; i < ARRAY_SIZE(plat->intarray); i++)
29 printf(" %d", plat->intarray[i]);
32 printf("longbytearray");
33 for (i = 0; i < sizeof(plat->longbytearray); i++)
34 printf(" %02x", plat->longbytearray[i]);
37 printf("string %s\n", plat->stringval);
38 printf("stringarray");
39 for (i = 0; i < ARRAY_SIZE(plat->stringarray); i++)
40 printf(" \"%s\"", plat->stringarray[i]);
46 U_BOOT_DRIVER(sandbox_spl_test) = {
47 .name = "sandbox_spl_test",
49 .flags = DM_FLAG_PRE_RELOC,
50 .probe = sandbox_spl_probe,