]>
git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/misc/spltest_sandbox.c
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 DECLARE_GLOBAL_DATA_PTR
;
14 static int sandbox_spl_probe(struct udevice
*dev
)
16 struct dtd_sandbox_spl_test
*plat
= dev_get_platdata(dev
);
19 printf("of-platdata probe:\n");
20 printf("bool %d\n", plat
->boolval
);
22 printf("byte %02x\n", plat
->byteval
);
24 for (i
= 0; i
< sizeof(plat
->bytearray
); i
++)
25 printf(" %02x", plat
->bytearray
[i
]);
28 printf("int %d\n", plat
->intval
);
30 for (i
= 0; i
< ARRAY_SIZE(plat
->intarray
); i
++)
31 printf(" %d", plat
->intarray
[i
]);
34 printf("longbytearray");
35 for (i
= 0; i
< sizeof(plat
->longbytearray
); i
++)
36 printf(" %02x", plat
->longbytearray
[i
]);
39 printf("string %s\n", plat
->stringval
);
40 printf("stringarray");
41 for (i
= 0; i
< ARRAY_SIZE(plat
->stringarray
); i
++)
42 printf(" \"%s\"", plat
->stringarray
[i
]);
48 U_BOOT_DRIVER(sandbox_spl_test
) = {
49 .name
= "sandbox_spl_test",
51 .flags
= DM_FLAG_PRE_RELOC
,
52 .probe
= sandbox_spl_probe
,