2 * Copyright (c) 2011 The Chromium OS Authors.
3 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/u-boot-sandbox.h>
14 * Pointer to initial global data area
16 * Here we initialize it.
20 /* Add a simple GPIO device */
21 U_BOOT_DEVICE(gpio_sandbox) = {
22 .name = "gpio_sandbox",
25 void flush_cache(unsigned long start, unsigned long size)
29 /* system timer offset in ms */
30 static unsigned long sandbox_timer_offset;
32 void sandbox_timer_add_offset(unsigned long offset)
34 sandbox_timer_offset += offset;
37 unsigned long timer_read_counter(void)
39 return os_get_nsec() / 1000 + sandbox_timer_offset * 1000;
44 gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
48 #ifdef CONFIG_BOARD_EARLY_INIT_F
49 int board_early_init_f(void)
51 #ifdef CONFIG_VIDEO_SANDBOX_SDL
54 ret = sandbox_lcd_sdl_early_init();
56 puts("Could not init sandbox LCD emulation\n");
65 #ifdef CONFIG_BOARD_LATE_INIT
66 int board_late_init(void)
68 if (cros_ec_get_error()) {
69 /* Force console on */
70 gd->flags &= ~GD_FLG_SILENT;
72 printf("cros-ec communications failure %d\n",
74 puts("\nPlease reset with Power+Refresh\n\n");
75 panic("Cannot init cros-ec device");