1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2011 The Chromium OS Authors.
14 #include <asm/u-boot-sandbox.h>
17 * Pointer to initial global data area
19 * Here we initialize it.
23 /* Add a simple GPIO device */
24 U_BOOT_DEVICE(gpio_sandbox) = {
25 .name = "gpio_sandbox",
28 void flush_cache(unsigned long start, unsigned long size)
33 /* system timer offset in ms */
34 static unsigned long sandbox_timer_offset;
36 void timer_test_add_offset(unsigned long offset)
38 sandbox_timer_offset += offset;
41 unsigned long timer_read_counter(void)
43 return os_get_nsec() / 1000 + sandbox_timer_offset * 1000;
49 gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
55 if (IS_ENABLED(CONFIG_LED))
61 int ft_board_setup(void *fdt, bd_t *bd)
63 /* Create an arbitrary reservation to allow testing OF_BOARD_SETUP.*/
64 return fdt_add_mem_rsv(fdt, 0x00d02000, 0x4000);
67 #ifdef CONFIG_BOARD_LATE_INIT
68 int board_late_init(void)
73 ret = uclass_first_device_err(UCLASS_CROS_EC, &dev);
74 if (ret && ret != -ENODEV) {
75 /* Force console on */
76 gd->flags &= ~GD_FLG_SILENT;
78 printf("cros-ec communications failure %d\n", ret);
79 puts("\nPlease reset with Power+Refresh\n\n");
80 panic("Cannot init cros-ec device");