From ad0e4639545b0928a3673114962ee1f3e56402d7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 22 Mar 2014 17:12:58 -0600 Subject: sandbox: Provide a build option to avoid using SDL Some machines do not have SDL libraries installed, and it is still useful to build sandbox without LCD/keyboard support. Add an option for this, used as follows: make sandbox_config all NO_SDL=1 Signed-off-by: Simon Glass --- arch/sandbox/config.mk | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch') diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk index e094ae2d05..c3f889fb1c 100644 --- a/arch/sandbox/config.mk +++ b/arch/sandbox/config.mk @@ -18,3 +18,9 @@ cmd_u-boot__ = $(CC) -o $@ -T u-boot.lds \ $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map CONFIG_ARCH_DEVICE_TREE := sandbox + +# Define this to avoid linking with SDL, which requires SDL libraries +# This can solve 'sdl-config: Command not found' errors +ifneq ($(NO_SDL),) +PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL +endif -- cgit v1.2.1 From 258060905e04fe2eb509756ef3b37e23e220a2d6 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 21 Apr 2014 18:39:35 +0900 Subject: sandbox: move source files from board/ to arch/sandbox/ Prior to commit 33a02da0, all boards must have board/${BOARD}/ or board/${VENDOR}/${BOARD}/ directory. Now this rule is obsolete. It looks weird that sandbox defines "vendor" and "board" just for meeting the old U-Boot directory structure. Signed-off-by: Masahiro Yamada Cc: Simon Glass --- arch/sandbox/lib/Makefile | 2 +- arch/sandbox/lib/sandbox.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 arch/sandbox/lib/sandbox.c (limited to 'arch') diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile index 4c1a38d6bc..6480ebfca6 100644 --- a/arch/sandbox/lib/Makefile +++ b/arch/sandbox/lib/Makefile @@ -8,4 +8,4 @@ # -obj-y += interrupts.o +obj-y += interrupts.o sandbox.o diff --git a/arch/sandbox/lib/sandbox.c b/arch/sandbox/lib/sandbox.c new file mode 100644 index 0000000000..e4d4e021bc --- /dev/null +++ b/arch/sandbox/lib/sandbox.c @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include +#include +#include + +/* + * Pointer to initial global data area + * + * Here we initialize it. + */ +gd_t *gd; + +/* Add a simple GPIO device */ +U_BOOT_DEVICE(gpio_sandbox) = { + .name = "gpio_sandbox", +}; + +void flush_cache(unsigned long start, unsigned long size) +{ +} + +unsigned long timer_read_counter(void) +{ + return os_get_nsec() / 1000; +} + +int dram_init(void) +{ + gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + return 0; +} + +#ifdef CONFIG_BOARD_EARLY_INIT_F +int board_early_init_f(void) +{ +#ifdef CONFIG_VIDEO_SANDBOX_SDL + int ret; + + ret = sandbox_lcd_sdl_early_init(); + if (ret) { + puts("Could not init sandbox LCD emulation\n"); + return ret; + } +#endif + + return 0; +} +#endif + +int arch_early_init_r(void) +{ +#ifdef CONFIG_CROS_EC + if (cros_ec_board_init()) { + printf("%s: Failed to init EC\n", __func__); + return 0; + } +#endif + + return 0; +} + +#ifdef CONFIG_BOARD_LATE_INIT +int board_late_init(void) +{ + if (cros_ec_get_error()) { + /* Force console on */ + gd->flags &= ~GD_FLG_SILENT; + + printf("cros-ec communications failure %d\n", + cros_ec_get_error()); + puts("\nPlease reset with Power+Refresh\n\n"); + panic("Cannot init cros-ec device"); + return -1; + } + return 0; +} +#endif -- cgit v1.2.1 From 097c5de5f4a64d3b121dc1dbe020f7f2545dabdb Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 21 Apr 2014 18:50:41 +0900 Subject: sandbox: ignore sandbox.dtb Signed-off-by: Masahiro Yamada Cc: Simon Glass Acked-by: Simon Glass --- arch/sandbox/dts/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 arch/sandbox/dts/.gitignore (limited to 'arch') diff --git a/arch/sandbox/dts/.gitignore b/arch/sandbox/dts/.gitignore new file mode 100644 index 0000000000..b60ed208c7 --- /dev/null +++ b/arch/sandbox/dts/.gitignore @@ -0,0 +1 @@ +*.dtb -- cgit v1.2.1