Commit ba9b42c81b0734d53edfbb1fe4a6ded7de78c5ab

Authored by Tom Rini

Merge branch 'sandbox' of git://git.denx.de/u-boot-x86

Showing 9 changed files Side-by-side Diff

arch/sandbox/cpu/os.c
... ... @@ -341,6 +341,7 @@
341 341 ret = -ENOMEM;
342 342 goto done;
343 343 }
  344 + next->next = NULL;
344 345 strcpy(next->name, entry.d_name);
345 346 switch (entry.d_type) {
346 347 case DT_REG:
arch/sandbox/include/asm/bitops.h
... ... @@ -17,6 +17,7 @@
17 17 #ifndef __ASM_SANDBOX_BITOPS_H
18 18 #define __ASM_SANDBOX_BITOPS_H
19 19  
  20 +#include <linux/compiler.h>
20 21 #include <asm/system.h>
21 22  
22 23 #ifdef __KERNEL__
... ... @@ -53,7 +54,7 @@
53 54  
54 55 static inline int test_and_set_bit(int nr, void *addr)
55 56 {
56   - unsigned long flags;
  57 + unsigned long __always_unused flags;
57 58 int out;
58 59  
59 60 local_irq_save(flags);
... ... @@ -75,7 +76,7 @@
75 76  
76 77 static inline int test_and_clear_bit(int nr, void *addr)
77 78 {
78   - unsigned long flags;
  79 + unsigned long __always_unused flags;
79 80 int out;
80 81  
81 82 local_irq_save(flags);
arch/sandbox/include/asm/system.h
... ... @@ -8,10 +8,7 @@
8 8 #define __ASM_SANDBOX_SYSTEM_H
9 9  
10 10 /* Define this as nops for sandbox architecture */
11   -static inline void local_irq_save(unsigned flags __attribute__((unused)))
12   -{
13   -}
14   -
  11 +#define local_irq_save(x)
15 12 #define local_irq_enable()
16 13 #define local_irq_disable()
17 14 #define local_save_flags(x)
... ... @@ -16,18 +16,19 @@
16 16 PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_X86)
17 17 PLATFORM_CPPFLAGS += -fno-dwarf2-cfi-asm
18 18 PLATFORM_CPPFLAGS += -DREALMODE_BASE=0x7c0
  19 +PLATFORM_CPPFLAGS += -march=i386 -m32
19 20  
20 21 # Support generic board on x86
21 22 __HAVE_ARCH_GENERIC_BOARD := y
22 23  
23 24 PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
24 25  
25   -PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions
  26 +PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386
26 27  
27 28 LDFLAGS_FINAL += --gc-sections -pie
28 29 LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3
29 30 LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3
30 31  
31   -export NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
  32 +export NORMAL_LIBGCC = $(shell $(CC) $(PLATFORM_CPPFLAGS) -print-libgcc-file-name)
32 33 CONFIG_USE_PRIVATE_LIBGCC := arch/x86/lib
arch/x86/cpu/config.mk
... ... @@ -7,7 +7,7 @@
7 7  
8 8 CROSS_COMPILE ?= i386-linux-
9 9  
10   -PLATFORM_CPPFLAGS += -DCONFIG_X86 -D__I386__ -march=i386 -Werror
  10 +PLATFORM_CPPFLAGS += -DCONFIG_X86 -D__I386__ -Werror
11 11  
12 12 # DO NOT MODIFY THE FOLLOWING UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!
13 13 LDPPFLAGS += -DRESET_SEG_START=0xffff0000
common/cmd_sandbox.c
... ... @@ -114,12 +114,14 @@
114 114 U_BOOT_CMD(
115 115 sb, 8, 1, do_sandbox,
116 116 "Miscellaneous sandbox commands",
117   - "load host <dev> <addr> <filename> [<bytes> <offset>] - "
  117 + "load hostfs - <addr> <filename> [<bytes> <offset>] - "
118 118 "load a file from host\n"
119   - "sb ls host <filename> - list files on host\n"
120   - "sb save host <dev> <filename> <addr> <bytes> [<offset>] - "
  119 + "sb ls hostfs - <filename> - list files on host\n"
  120 + "sb save hostfs - <filename> <addr> <bytes> [<offset>] - "
121 121 "save a file to host\n"
122 122 "sb bind <dev> [<filename>] - bind \"host\" device to file\n"
123   - "sb info [<dev>] - show device binding & info"
  123 + "sb info [<dev>] - show device binding & info\n"
  124 + "sb commands use the \"hostfs\" device. The \"host\" device is used\n"
  125 + "with standard IO commands such as fatls or ext2load"
124 126 );
... ... @@ -510,6 +510,25 @@
510 510 int part;
511 511 disk_partition_t tmpinfo;
512 512  
  513 + /*
  514 + * Special-case a psuedo block device "hostfs", to allow access to the
  515 + * host's own filesystem.
  516 + */
  517 + if (0 == strcmp(ifname, "hostfs")) {
  518 + *dev_desc = NULL;
  519 + info->start = 0;
  520 + info->size = 0;
  521 + info->blksz = 0;
  522 + info->bootable = 0;
  523 + strcpy((char *)info->type, BOOT_PART_TYPE);
  524 + strcpy((char *)info->name, "Sandbox host");
  525 +#ifdef CONFIG_PARTITION_UUIDS
  526 + info->uuid[0] = 0;
  527 +#endif
  528 +
  529 + return 0;
  530 + }
  531 +
513 532 /* If no dev_part_str, use bootdevice environment variable */
514 533 if (!dev_part_str || !strlen(dev_part_str) ||
515 534 !strcmp(dev_part_str, "-"))
... ... @@ -165,12 +165,12 @@
165 165  
166 166 #ifdef CONFIG_SANDBOX
167 167 /* File existence */
168   - HUSH_TEST(e, "-e host - creating_this_file_breaks_uboot_unit_test", n);
169   - run_command("sb save host - creating_this_file_breaks_uboot_unit_test 0 1", 0);
170   - HUSH_TEST(e, "-e host - creating_this_file_breaks_uboot_unit_test", y);
  168 + HUSH_TEST(e, "-e hostfs - creating_this_file_breaks_uboot_unit_test", n);
  169 + run_command("sb save hostfs - creating_this_file_breaks_uboot_unit_test 0 1", 0);
  170 + HUSH_TEST(e, "-e hostfs - creating_this_file_breaks_uboot_unit_test", y);
171 171 /* Perhaps this could be replaced by an "rm" shell command one day */
172 172 assert(!os_unlink("creating_this_file_breaks_uboot_unit_test"));
173   - HUSH_TEST(e, "-e host - creating_this_file_breaks_uboot_unit_test", n);
  173 + HUSH_TEST(e, "-e hostfs - creating_this_file_breaks_uboot_unit_test", n);
174 174 #endif
175 175 #endif
176 176  
test/vboot/vboot_test.sh
... ... @@ -14,7 +14,7 @@
14 14 run_uboot() {
15 15 echo -n "Test Verified Boot Run: $1: "
16 16 ${uboot} -d sandbox-u-boot.dtb >${tmp} -c '
17   -sb load host 0 100 test.fit;
  17 +sb load hostfs - 100 test.fit;
18 18 fdt addr 100;
19 19 bootm 100;
20 20 reset'