Commit 74279d37613cb3081ee1680d67b2aed1f934472a

Authored by Tom Rini

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

Showing 9 changed files Side-by-side Diff

arch/sandbox/cpu/Makefile
... ... @@ -10,6 +10,8 @@
10 10 obj-y := cpu.o os.o start.o state.o
11 11  
12 12 # os.c is build in the system environment, so needs standard includes
13   -$(obj)os.o: ALL_CFLAGS := $(filter-out -nostdinc,$(ALL_CFLAGS))
14   -$(obj).depend.os: CPPFLAGS := $(filter-out -nostdinc,$(CPPFLAGS))
  13 +$(obj)os.o: ALL_CFLAGS := $(BASE_CPPFLAGS) \
  14 + $(patsubst %, -idirafter %, $(BASE_INCLUDE_DIRS))
  15 +$(obj).depend.os: CPPFLAGS := $(BASE_CPPFLAGS) \
  16 + $(patsubst %, -idirafter %, $(BASE_INCLUDE_DIRS))
arch/sandbox/cpu/os.c
... ... @@ -8,6 +8,7 @@
8 8 #include <fcntl.h>
9 9 #include <getopt.h>
10 10 #include <stdio.h>
  11 +#include <stdint.h>
11 12 #include <stdlib.h>
12 13 #include <string.h>
13 14 #include <termios.h>
... ... @@ -136,7 +137,7 @@
136 137 usleep(usec);
137 138 }
138 139  
139   -u64 __attribute__((no_instrument_function)) os_get_nsec(void)
  140 +uint64_t __attribute__((no_instrument_function)) os_get_nsec(void)
140 141 {
141 142 #if defined(CLOCK_MONOTONIC) && defined(_POSIX_MONOTONIC_CLOCK)
142 143 struct timespec tp;
arch/sandbox/include/asm/io.h
... ... @@ -38,7 +38,7 @@
38 38 }
39 39  
40 40 /* Map from a pointer to our RAM buffer */
41   -phys_addr_t map_to_sysmem(void *ptr);
  41 +phys_addr_t map_to_sysmem(const void *ptr);
42 42  
43 43 #endif
arch/sandbox/include/asm/types.h
... ... @@ -48,8 +48,8 @@
48 48 #define BITS_PER_LONG CONFIG_SANDBOX_BITS_PER_LONG
49 49  
50 50 typedef unsigned long dma_addr_t;
51   -typedef unsigned long phys_addr_t;
52   -typedef unsigned long phys_size_t;
  51 +typedef u32 phys_addr_t;
  52 +typedef u32 phys_size_t;
53 53  
54 54 #endif /* __KERNEL__ */
55 55  
... ... @@ -250,11 +250,16 @@
250 250 endif
251 251 endif
252 252  
  253 +# Sandbox needs the base flags and includes, so keep them around
  254 +BASE_CPPFLAGS := $(CPPFLAGS)
  255 +
253 256 ifneq ($(OBJTREE),$(SRCTREE))
254   -CPPFLAGS += -I$(OBJTREE)/include
  257 +BASE_INCLUDE_DIRS := $(OBJTREE)/include
255 258 endif
256 259  
257   -CPPFLAGS += -I$(TOPDIR)/include -I$(SRCTREE)/arch/$(ARCH)/include
  260 +BASE_INCLUDE_DIRS += $(TOPDIR)/include $(SRCTREE)/arch/$(ARCH)/include
  261 +
  262 +CPPFLAGS += $(patsubst %, -I%, $(BASE_INCLUDE_DIRS))
258 263 CPPFLAGS += -fno-builtin -ffreestanding -nostdinc \
259 264 -isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
260 265  
... ... @@ -923,7 +923,7 @@
923 923 {
924 924 }
925 925  
926   -static inline phys_addr_t map_to_sysmem(void *ptr)
  926 +static inline phys_addr_t map_to_sysmem(const void *ptr)
927 927 {
928 928 return (phys_addr_t)(uintptr_t)ptr;
929 929 }
include/configs/sandbox.h
... ... @@ -75,7 +75,6 @@
75 75 #define CONFIG_SYS_LOAD_ADDR 0x00000000
76 76 #define CONFIG_SYS_MEMTEST_START 0x00100000
77 77 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x1000)
78   -#define CONFIG_PHYS_64BIT
79 78 #define CONFIG_SYS_FDT_LOAD_ADDR 0x1000000
80 79  
81 80 /* Size of our emulated memory */
... ... @@ -11,6 +11,8 @@
11 11 #ifndef __OS_H__
12 12 #define __OS_H__
13 13  
  14 +#include <linux/types.h>
  15 +
14 16 struct sandbox_state;
15 17  
16 18 /**
... ... @@ -116,7 +118,7 @@
116 118 *
117 119 * \return A monotonic increasing time scaled in nano seconds
118 120 */
119   -u64 os_get_nsec(void);
  121 +uint64_t os_get_nsec(void);
120 122  
121 123 /**
122 124 * Parse arguments and update sandbox state.
... ... @@ -86,10 +86,10 @@
86 86 size = (fdt_size_t *)((char *)cell +
87 87 sizeof(fdt_addr_t));
88 88 *sizep = fdt_size_to_cpu(*size);
89   - debug("addr=%p, size=%p\n", (void *)addr,
90   - (void *)*sizep);
  89 + debug("addr=%08lx, size=%08x\n",
  90 + (ulong)addr, *sizep);
91 91 } else {
92   - debug("%p\n", (void *)addr);
  92 + debug("%08lx\n", (ulong)addr);
93 93 }
94 94 return addr;
95 95 }
... ... @@ -611,7 +611,7 @@
611 611 if (!cell || (len != sizeof(fdt_addr_t) * 2))
612 612 return -1;
613 613  
614   - *ptrp = (void *)fdt_addr_to_cpu(*cell);
  614 + *ptrp = map_sysmem(fdt_addr_to_cpu(*cell), *size);
615 615 *size = fdt_size_to_cpu(cell[1]);
616 616 debug("%s: size=%zx\n", __func__, *size);
617 617 return 0;