New 'sandbox' test architecture for U-Boot
Subsystems (4)
v6 cover New 'sandbox' test architecture for U-Boot
This patch set points towards a possible way to improve the test infrastructure in U-Boot. The goal is to have a test suite that can run in a minute or two on a Linux PC and test all non-platform code.
This set aims to be just enough boot to U-Boot to a command prompt. You can type help; anything else will probably segfault :-) Press Ctrl-C or type 'reset' to exit.
This patch set does not include some other code I have been playing around with, like a SPI flash driver and sandbox 'state' (so the state can be examined and modified to test failure modes and the like).
$ ./u-boot
U-Boot 2011.09-rc1-00041-ge50de7d-dirty (Sep 17 2011 - 08:17:40)
DRAM: 128 MiB
Using default environment
In: serial Out: serial Err: serial
Detail
======
We can break the U-Boot code base into two parts:
1. Platform code, which is SOC-specifc. At present this is the CPU init (arch/xxx/cpu/...) and SOC-specific drivers (mostly in the drivers directory). There is also a small amount of generic CPU code in arch/xxx/lib and some board-specific code/drivers (e.g. drivers not within the SOC).
2. Portable/Generic U-Boot code, which is cross-platform. This includes many drivers, the various commands, file system support, things like the MMC, USB and network stacks, etc.
My focus in this patch set is the second part of the code base - all the code which is not platform-specific, but can still have bugs.
Proposal
========
To a large extent, testing of this part of the code base could simply be built on one or more of the available platforms. We could then run the tests on that platform, and announce that the code base works fine on that platform. Obviously the platform needs to support all possible features of U-Boot.
However, this approach fails to take advantage of two useful properties of this code:
- It is cross-platform, and even runs on x86
- It is standalone, requiring no OS libraries to run
For speed, debugging and convenience, it would be nice to run U-Boot under a generic Linux environment on a workstation, and test all the generic non-platform code. The basic problem with this is that the non-platform code requires the platform code to operate. Even the x86 platform code is designed for standalone operation on a particular x86 board, and is not suitable for running under x86 Linux.
To get around this I propose that we create a new ?sandbox? architecture. We write code in ?arch/sandbox? which can run under Linux. Since all the non-platform code will happily run under this new ?architecture?, we can then write tests which run quickly under x86 Linux (or another Linux for that matter). This U-Boot 'architecture' should build natively on any 32/64-bit Linux machine since it just uses standard Linux system calls. Calls to Linux would be entirely within this arch/sandbox subdirectory.
Benefit
=======
What will this buy us? Well we can do things like:
- Create a test SPI flash device, which is file-backed. Use this to write a test of the cmd_sf layer by issuing a series of commands and making sure that the correct SPI flash contents is obtained
- Create a test MMC or IDE device, backed by a file. Use this to issue ext2 and fat commands to manipulate the filesystem. Then loopback mount the file and check from Linux that U-Boot did the right thing
- Create a test Ethernet device with a mocked remote host attached. Use this to issue network commands like bootp and tftp and check that the correct results are obtained.
Ultimately (one day) we might have a set of unit tests for U-Boot which can run to very quickly check that a patch does not break the core U-Boot code.
Building
========
make ARCH=sandbox sandbox_config
make ARCH=sandbox all
(The lds script is targeted for bfd and might not work with the gold linker)
Comments
========
Comments are welcome and I have cc'd those who showed an interest to my initial email. My goal is to create a real patch set in the next few weeks.
Please excuse the checkpatch violations, many of which seem to be less than useful. This code is a bit rough in places, but I want comments on it before polishing. There are a few strange things needed in the build as well, which I hope to improve.
Checkpatch notes:
The first patch generates a list of 34 checkpatch warnings.
warning: arch/sandbox/include/asm/global_data.h,38: do not add new typedefs
(This is the typedef for gd_t which I think is needed.)
warning: arch/sandbox/include/asm/global_data.h,64: storage class should be at the beginning of the declaration
(This line is:
which I need to keep, so that various files can declare that pointer.)
warning: arch/sandbox/include/asm/posix_types.h,22: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,23: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,24: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,25: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,26: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,27: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,28: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,29: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,30: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,32: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,33: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,34: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,36: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,37: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,38: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,40: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,41: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,42: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,43: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,44: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,45: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,46: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,47: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,48: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,50: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,51: do not add new typedefs
warning: arch/sandbox/include/asm/posix_types.h,54: do not add new typedefs
(These are things like:
typedef unsigned short __kernel_dev_t;
and I believe they are needed.)
warning: arch/sandbox/include/asm/types.h,26: do not add new typedefs
warning: arch/sandbox/include/asm/types.h,66: do not add new typedefs
warning: arch/sandbox/include/asm/types.h,67: do not add new typedefs
warning: arch/sandbox/include/asm/types.h,68: do not add new typedefs
warning: arch/sandbox/include/asm/u-boot.h,39: do not add new typedefs
(These are similar, and common with other architectures, so I think they are needed.)
Changes in v2:
- Rebase to master
- Tidy top-level Makefile to minimise changes
- Remove CONFIG_SYS_SDRAM_BASE which is always 0 for sandbox boards
- Fix #define<tab>
- Remove CONFIG_LMB
- Move os layer into arch/sandbox
- Remove clean and dist-clean targets from Makefile
- Try and fail to remove the global -I/usr/include
- Fix cast of int to pointer instead of just removing the code
- Move lds script out of the board directory
- Fix commit message typo, sadly
- Remove ARM cruft from Makefile
- Remove version_string and make display_banner() call display_options()
- Tidy up DRAM logic (but I think it is still needed to fit in with U-Boot)
- Remove use of CONFIG_SYS_NO_FLASH
- Make board_init_f() call board_init_r() for now
- Make board_init_r() call main_loop() for now
- Remove setting of LDSCRIPT (top level Makefile does this anyway)
- Add comment to do_reset() to justify the sandbox implementation
- Move lds script into cpu/sandbox
- Update commit message to remove 'temporary'
- Allow __WORDSIZE to be defined in Makefile / elsewhere
- Split this change out from 'Add architecture image support'
Changes in v3:
- Change U-Boot's dependency generation to permit per-file flags
- Add os_exit() which always exits with success for now
- Add function comments to header file
- Call os_exit() in do_reset()
- Move cpu files into arch/sandbox/cpu
- Change do_reset() back to what it was
- Add architecture image support for sandbox
Changes in v4:
- Drop board/sandbox/common/board.c for now (no board_init() needed)
- Move main() into start.c to remove one ifdef from the top level Makefile
- Fix up Makefile for non-sandbox builds
- 'Improve' dependency generation to deal with source files containing paths
- Make sure that clobber target removes all dependency files
- Add CONFIG_SYS_SDRAM_SIZE for size of emulated SDRAM
- Add #ifdef protection around sandbox.h header file
- Remove serial_exit()
- Move main() into arch/sandbox/cpu/start.c
- Allow os_exit() to exit with a non-zero return code
- Add more info to command section alignment commit
- Remove board/sandbox/common directory as it is not used
- Drop CONFIG_POST support
- Drop call to board_init()
- Remove printing of memory setup which is meaningless in sandbox
Changes in v5:
- Move the introduction of include/asm-generic/gpio.h into a separate commit
- Add comments to GPIO functions
- Fix dependency output to include $(obj) for out-of-tree builds
- Simplify the declaration of gd_t in sandbox's board.c
- Define IH_ARCH_DEFAULT which is now required
Changes in v6:
- Remove volatile keyword from arch/sandbox/include/asm/bitops.h
Simon Glass (20):
sandbox: Add architecture header files
Fix use of int as pointer in image.c
sandbox: Add architecture image support
sandbox: Add compiler defines to support a 64-bit x86_64 platform
sandbox: Add cpu files
sandbox: Add architecture lib files
sandbox: Add sandbox board
sandbox: Add board info for architecture
sandbox: Add bootm support
sandbox: Disable built-in malloc
sandbox: Disable standalone/API support
sandbox: Force command sections to be 4-byte aligned
sandbox: Add OS dependent layer
sandbox: Add main program
sandbox: Add serial uart
sandbox: Add basic config file
Use uintptr_t for 32/64-bit compatibility
Adjust dependency rules to permit per-file flags
Add generic gpio.h in asm-generic
sandbox: Makefile changes to build sandbox architecture
.gitignore | 2 +- Makefile | 19 ++- arch/sandbox/config.mk | 20 ++ arch/sandbox/cpu/Makefile | 50 +++++ arch/sandbox/cpu/cpu.c | 62 +++++++ arch/sandbox/cpu/os.c | 55 ++++++ arch/sandbox/cpu/start.c | 33 ++++ arch/sandbox/cpu/u-boot.lds | 34 ++++ arch/sandbox/include/asm/bitops.h | 162 +++++++++++++++++ arch/sandbox/include/asm/byteorder.h | 40 ++++ arch/sandbox/include/asm/config.h | 26 +++ arch/sandbox/include/asm/global_data.h | 66 +++++++ arch/sandbox/include/asm/io.h | 41 +++++ arch/sandbox/include/asm/posix_types.h | 57 ++++++ arch/sandbox/include/asm/ptrace.h | 38 ++++ arch/sandbox/include/asm/string.h | 23 +++ arch/sandbox/include/asm/system.h | 36 ++++ arch/sandbox/include/asm/types.h | 72 ++++++++ arch/sandbox/include/asm/u-boot-sandbox.h | 38 ++++ arch/sandbox/include/asm/u-boot.h | 64 +++++++ arch/sandbox/include/asm/unaligned.h | 23 +++ arch/sandbox/lib/Makefile | 51 ++++++ arch/sandbox/lib/board.c | 276 +++++++++++++++++++++++++++++ arch/sandbox/lib/interrupts.c | 39 ++++ board/sandbox/sandbox/Makefile | 42 +++++ board/sandbox/sandbox/sandbox.c | 49 +++++ boards.cfg | 1 + common/Makefile | 2 + common/cmd_bdinfo.c | 34 +++- common/cmd_bootm.c | 7 +- common/cmd_mem.c | 2 +- common/fdt_support.c | 8 +- common/image.c | 4 +- config.mk | 7 + doc/README.sandbox | 53 ++++++ drivers/serial/Makefile | 1 + drivers/serial/sandbox.c | 63 +++++++ include/asm-generic/gpio.h | 74 ++++++++ include/command.h | 3 +- include/common.h | 3 + include/compiler.h | 12 ++- include/configs/sandbox.h | 85 +++++++++ include/image.h | 1 + include/os.h | 73 ++++++++ rules.mk | 44 ++++-- 45 files changed, 1862 insertions(+), 33 deletions(-) create mode 100644 arch/sandbox/config.mk create mode 100644 arch/sandbox/cpu/Makefile create mode 100644 arch/sandbox/cpu/cpu.c create mode 100644 arch/sandbox/cpu/os.c create mode 100644 arch/sandbox/cpu/start.c create mode 100644 arch/sandbox/cpu/u-boot.lds create mode 100644 arch/sandbox/include/asm/bitops.h create mode 100644 arch/sandbox/include/asm/byteorder.h create mode 100644 arch/sandbox/include/asm/config.h create mode 100644 arch/sandbox/include/asm/global_data.h create mode 100644 arch/sandbox/include/asm/io.h create mode 100644 arch/sandbox/include/asm/posix_types.h create mode 100644 arch/sandbox/include/asm/ptrace.h create mode 100644 arch/sandbox/include/asm/string.h create mode 100644 arch/sandbox/include/asm/system.h create mode 100644 arch/sandbox/include/asm/types.h create mode 100644 arch/sandbox/include/asm/u-boot-sandbox.h create mode 100644 arch/sandbox/include/asm/u-boot.h create mode 100644 arch/sandbox/include/asm/unaligned.h create mode 100644 arch/sandbox/lib/Makefile create mode 100644 arch/sandbox/lib/board.c create mode 100644 arch/sandbox/lib/interrupts.c create mode 100644 board/sandbox/sandbox/Makefile create mode 100644 board/sandbox/sandbox/sandbox.c create mode 100644 doc/README.sandbox create mode 100644 drivers/serial/sandbox.c create mode 100644 include/asm-generic/gpio.h create mode 100644 include/configs/sandbox.h create mode 100644 include/os.h
Signature · 1 line
1.7.3.1
PATCH v6 1/20 sandbox: Add architecture header files
This adds required header files for the sandbox architecture, and a basic description of what sandbox is (README.sandbox).
---
Changes in v6:
- Remove volatile keyword from arch/sandbox/include/asm/bitops.h
arch/sandbox/include/asm/bitops.h | 162 +++++++++++++++++++++++++++++ arch/sandbox/include/asm/byteorder.h | 40 +++++++ arch/sandbox/include/asm/config.h | 26 +++++ arch/sandbox/include/asm/global_data.h | 66 ++++++++++++ arch/sandbox/include/asm/io.h | 41 +++++++ arch/sandbox/include/asm/posix_types.h | 57 ++++++++++ arch/sandbox/include/asm/ptrace.h | 38 +++++++ arch/sandbox/include/asm/string.h | 23 ++++ arch/sandbox/include/asm/system.h | 36 +++++++ arch/sandbox/include/asm/types.h | 72 +++++++++++++ arch/sandbox/include/asm/u-boot-sandbox.h | 38 +++++++ arch/sandbox/include/asm/u-boot.h | 61 +++++++++++ arch/sandbox/include/asm/unaligned.h | 23 ++++ doc/README.sandbox | 53 ++++++++++ include/common.h | 3 + 15 files changed, 739 insertions(+), 0 deletions(-) create mode 100644 arch/sandbox/include/asm/bitops.h create mode 100644 arch/sandbox/include/asm/byteorder.h create mode 100644 arch/sandbox/include/asm/config.h create mode 100644 arch/sandbox/include/asm/global_data.h create mode 100644 arch/sandbox/include/asm/io.h create mode 100644 arch/sandbox/include/asm/posix_types.h create mode 100644 arch/sandbox/include/asm/ptrace.h create mode 100644 arch/sandbox/include/asm/string.h create mode 100644 arch/sandbox/include/asm/system.h create mode 100644 arch/sandbox/include/asm/types.h create mode 100644 arch/sandbox/include/asm/u-boot-sandbox.h create mode 100644 arch/sandbox/include/asm/u-boot.h create mode 100644 arch/sandbox/include/asm/unaligned.h create mode 100644 doc/README.sandbox
arch/sandbox/include/asm/bitops.h new file +162 -0
@@ -0,0 +1,162 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* +* Copyright 1995, Russell King. +* Various bits and pieces copyrights include: +* Linus Torvalds (test_bit). +* +* bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). +* +* Please note that the code in this file should never be included +* from user space. Many of these are not implemented in assembler +* since they would be too costly. Also, they require priviledged +* instructions (which are not available from user mode) to ensure +* that they are atomic. +*/ + +#ifndef __ASM_SANDBOX_BITOPS_H +#define __ASM_SANDBOX_BITOPS_H + +#include <asm/system.h> + +#ifdef __KERNEL__ + +#define smp_mb__before_clear_bit () do { } while (0) +#define smp_mb__after_clear_bit () do { } while (0) + +/* +* Function prototypes to keep gcc -Wall happy. +*/ +extern void set_bit (int nr,void *addr); + +extern void clear_bit (int nr,void *addr); + +extern void change_bit (int nr,void *addr); + +static inline void __change_bit (int nr,void *addr) +{ +unsigned long mask =BIT_MASK (nr); +unsigned long *p = ((unsigned long *)addr) +BIT_WORD (nr); + + *p ^= mask; +} + +static inline int __test_and_set_bit (int nr,void *addr) +{ +unsigned long mask =BIT_MASK (nr); +unsigned long *p = ((unsigned long *)addr) +BIT_WORD (nr); +unsigned long old = *p; + + *p = old | mask; +return (old & mask) !=0 ; +} + +static inline int test_and_set_bit (int nr,void *addr) +{ +unsigned long flags; +int out; + +local_irq_save (flags); + out =__test_and_set_bit (nr, addr); +local_irq_restore (flags); + +return out; +} + +static inline int __test_and_clear_bit (int nr,void *addr) +{ +unsigned long mask =BIT_MASK (nr); +unsigned long *p = ((unsigned long *)addr) +BIT_WORD (nr); +unsigned long old = *p; + + *p = old & ~mask; +return (old & mask) !=0 ; +} + +static inline int test_and_clear_bit (int nr,void *addr) +{ +unsigned long flags; +int out; + +local_irq_save (flags); + out =__test_and_clear_bit (nr, addr); +local_irq_restore (flags); + +return out; +} + +extern int test_and_change_bit (int nr,void *addr); + +static inline int __test_and_change_bit (int nr,void *addr) +{ +unsigned long mask =BIT_MASK (nr); +unsigned long *p = ((unsigned long *)addr) +BIT_WORD (nr); +unsigned long old = *p; + + *p = old ^ mask; +return (old & mask) !=0 ; +} + +extern int find_first_zero_bit (void *addr,unsigned size); +extern int find_next_zero_bit (void *addr,int size,int offset); + +/* +* This routine doesn't need to be atomic. +*/ +static inline int test_bit (int nr,const void *addr) +{ +return ((unsigned char *) addr)[nr >>3 ] & (1U << (nr &7 )); +} + +/* +* ffz = Find First Zero in word. Undefined if no zero exists, +* so code should check against ~0UL first.. +*/ +static inline unsigned long ffz (unsigned long word) +{ +int k; + + word = ~word; + k =31 ; +if (word &0x0000ffff ) { + k -=16 ; word <<=16 ; + } +if (word &0x00ff0000 ) { + k -=8 ; word <<=8 ; + } +if (word &0x0f000000 ) { + k -=4 ; word <<=4 ; + } +if (word &0x30000000 ) { + k -=2 ; word <<=2 ; + } +if (word &0x40000000 ) + k -=1 ; +return k; +} + +/* +* hweightN: returns the hamming weight (i.e. the number +* of bits set) of a N-bit word +*/ + +#define hweight32 (x) generic_hweight32(x) +#define hweight16 (x) generic_hweight16(x) +#define hweight8 (x) generic_hweight8(x) + +#define ext2_set_bit test_and_set_bit +#define ext2_clear_bit test_and_clear_bit +#define ext2_test_bit test_bit +#define ext2_find_first_zero_bit find_first_zero_bit +#define ext2_find_next_zero_bit find_next_zero_bit + +/* Bitmap functions for the minix filesystem. */ +#define minix_test_and_set_bit (nr, addr) test_and_set_bit(nr, addr) +#define minix_set_bit (nr, addr) set_bit(nr, addr) +#define minix_test_and_clear_bit (nr, addr) test_and_clear_bit(nr, addr) +#define minix_test_bit (nr, addr) test_bit(nr, addr) +#define minix_find_first_zero_bit (addr, size) find_first_zero_bit(addr, size) + +#endif /* __KERNEL__ */ + +#endif /* _ARM_BITOPS_H */
arch/sandbox/include/asm/byteorder.h new file +40 -0
@@ -0,0 +1,40 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#ifndef __ASM_SANDBOX_BYTEORDER_H +#define __ASM_SANDBOX_BYTEORDER_H + + +#include <asm/types.h> + +#if !defined(__STRICT_ANSI__) || defined(__KERNEL__) +# define __BYTEORDER_HAS_U64__ +# define __SWAB_64_THRU_32__ +#endif + +#ifdef CONFIG_SANDBOX_BIG_ENDIAN +#include <linux/byteorder/big_endian.h> +#else +#include <linux/byteorder/little_endian.h> +#endif + +#endif
arch/sandbox/include/asm/config.h new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +*/ + +#ifndef _ASM_CONFIG_H_ +#define _ASM_CONFIG_H_ + +#define CONFIG_SANDBOX_ARCH + +#endif
arch/sandbox/include/asm/global_data.h new file +66 -0
66 lines not on this page · raw message
arch/sandbox/include/asm/io.h new file +41 -0
41 lines not on this page · raw message
arch/sandbox/include/asm/posix_types.h new file +57 -0
57 lines not on this page · raw message
arch/sandbox/include/asm/ptrace.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#ifndef __ASM_SANDBOX_PTRACE_H +#define __ASM_SANDBOX_PTRACE_H + +#ifndef __ASSEMBLY__ +/* This is not used in the sandbox architecture, but required by U-Boot */ +struct pt_regs { +}; + +#ifdef __KERNEL__ +extern void show_regs (struct pt_regs *); + +#endif + +#endif /* __ASSEMBLY__ */ + +#endif
arch/sandbox/include/asm/string.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <linux/string.h>
arch/sandbox/include/asm/system.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#ifndef __ASM_SANDBOX_SYSTEM_H +#define __ASM_SANDBOX_SYSTEM_H + +/* Define this as nops for sandbox architecture */ +static inline void local_irq_save (unsigned flags __attribute__((unused))) +{ +} + +#define local_irq_enable () +#define local_irq_disable () +#define local_save_flags (x) +#define local_irq_restore (x) + +#endif
arch/sandbox/include/asm/types.h new file +72 -0
72 lines not on this page · raw message
arch/sandbox/include/asm/u-boot-sandbox.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* +* (C) Copyright 2002 +* Sysgo Real-Time Solutions, GmbH <www.elinos.com> +* Marius Groeger <[email protected]> +* +* (C) Copyright 2002 +* Sysgo Real-Time Solutions, GmbH <www.elinos.com> +* Alex Zuepke <[email protected]> +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#ifndef _U_BOOT_SANDBOX_H_ +#define _U_BOOT_SANDBOX_H_ + +/* board/.../... */ +int board_init (void ); +int dram_init (void ); + +#endif /* _U_BOOT_SANDBOX_H_ */
arch/sandbox/include/asm/u-boot.h new file +61 -0
61 lines not on this page · raw message
arch/sandbox/include/asm/unaligned.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <asm-generic/unaligned.h>
doc/README.sandbox new file +53 -0
53 lines not on this page · raw message
include/common.h +3 -0
@@ -302,6 +302,9 @@ int setenv (const char *, const char *);#ifdef CONFIG_X86 /* x86 version to be fixed! */ # include <asm/u-boot-x86.h> #endif /* CONFIG_X86 */ +#ifdef CONFIG_SANDBOX +# include <asm/u-boot-sandbox.h> /* TODO(sjg) what needs to be fixed? */ +#endif #ifdef CONFIG_AUTO_COMPLETE int env_complete (char *var,int maxv,char *cmdv[],int maxsz,char *buf);
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 1/20 sandbox: Add architecture header files
Dear Simon Glass,
Quoted 30 lines · In message <[email protected]> you wrote:
This adds required header files for the sandbox architecture, and a basic description of what sandbox is (README.sandbox).
Signed-off-by Simon Glass <[email protected]>---
Changes in v6:
- Remove volatile keyword fromarch/sandbox/include/asm/bitops.harch/sandbox/include/asm/bitops.h | 162 +++++++++++++++++++++++++++++ arch/sandbox/include/asm/byteorder.h | 40 +++++++ arch/sandbox/include/asm/config.h | 26 +++++ arch/sandbox/include/asm/global_data.h | 66 ++++++++++++ arch/sandbox/include/asm/io.h | 41 +++++++ arch/sandbox/include/asm/posix_types.h | 57 ++++++++++ arch/sandbox/include/asm/ptrace.h | 38 +++++++ arch/sandbox/include/asm/string.h | 23 ++++ arch/sandbox/include/asm/system.h | 36 +++++++ arch/sandbox/include/asm/types.h | 72 +++++++++++++ arch/sandbox/include/asm/u-boot-sandbox.h | 38 +++++++ arch/sandbox/include/asm/u-boot.h | 61 +++++++++++ arch/sandbox/include/asm/unaligned.h | 23 ++++ doc/README.sandbox | 53 ++++++++++ include/common.h | 3 + 15 files changed, 739 insertions(+), 0 deletions(-) create mode 100644 arch/sandbox/include/asm/bitops.h create mode 100644 arch/sandbox/include/asm/byteorder.h create mode 100644 arch/sandbox/include/asm/config.h create mode 100644 arch/sandbox/include/asm/global_data.h create mode 100644 arch/sandbox/include/asm/io.h create mode 100644 arch/sandbox/include/asm/posix_types.h
Quoted 8 lines
create mode 100644 arch/sandbox/include/asm/ptrace.h create mode 100644 arch/sandbox/include/asm/string.h create mode 100644 arch/sandbox/include/asm/system.h create mode 100644 arch/sandbox/include/asm/types.h create mode 100644 arch/sandbox/include/asm/u-boot-sandbox.h create mode 100644 arch/sandbox/include/asm/u-boot.h create mode 100644 arch/sandbox/include/asm/unaligned.h create mode 100644 doc/README.sandbox
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The number you have dialed is imaginary. Please divide by 0 and try again.
PATCH v6 2/20 Fix use of int as pointer in image.c
In reply to Simon GlassIt is better to use %p in this case.
---
Changes in v2:
- Split this change out from 'Add architecture image support'
common/image.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
common/image.c +2 -2
@@ -1581,7 +1581,7 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag goto error; } -printf (" Booting using the fdt blob at 0x%x\n" , (int )fdt_blob); +printf (" Booting using the fdt blob at 0x%p\n" , fdt_blob); }else if (images->legacy_hdr_valid &&image_check_type (&images->legacy_hdr_os_copy,IH_TYPE_MULTI )) {
@@ -1600,7 +1600,7 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imagif (fdt_len) { fdt_blob = (char *)fdt_data; -printf (" Booting using the fdt at 0x%x\n" , (int )fdt_blob); +printf (" Booting using the fdt at 0x%p\n" , fdt_blob);if (fdt_check_header (fdt_blob) !=0 ) {fdt_error ("image is not a fdt" );
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 2/20 Fix use of int as pointer in image.c
Dear Simon Glass,
Quoted 10 lines · In message <[email protected]> you wrote:
It is better to use %p in this case.
Signed-off-by Simon Glass <[email protected]>Acked-by Mike Frysinger <[email protected]>---
Changes in v2:
- Split this change out from 'Add architecture image support'common/image.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Do you know about being with somebody? Wanting to be? If I had the whole universe, I'd give it to you, Janice. When I see you, I feel like I'm hungry all over. Do you know how that feels? -- Charlie Evans, "Charlie X", stardate 1535.8
PATCH v6 3/20 sandbox: Add architecture image support
In reply to Simon GlassWe won't actually load an image with this architecture, but we still need to define it.
---
Changes in v3:
- Add architecture image support for sandbox
Changes in v5:
- Define IH_ARCH_DEFAULT which is now required
arch/sandbox/include/asm/u-boot.h | 3 +++ include/image.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-)
arch/sandbox/include/asm/u-boot.h +3 -0
@@ -58,4 +58,7 @@ typedef struct bd_info { } bi_dram[CONFIG_NR_DRAM_BANKS]; } bd_t; +/* For image.h:image_check_target_arch() */ +#define IH_ARCH_DEFAULT IH_ARCH_SANDBOX +#endif /* _U_BOOT_H_ */
include/image.h +1 -0
@@ -106,6 +106,7 @@#define IH_ARCH_BLACKFIN 16/* Blackfin */ #define IH_ARCH_AVR32 17/* AVR32 */ #define IH_ARCH_ST200 18/* STMicroelectronics ST200 */ +#define IH_ARCH_SANDBOX 19/* Sandbox architecture (test only) */ /* * Image Types
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 3/20 sandbox: Add architecture image support
Dear Simon Glass,
Quoted 8 lines · In message <[email protected]> you wrote:
We won't actually load an image with this architecture, but we still need to define it.
Signed-off-by Simon Glass <[email protected]>---
Changes in v3:
- Add architecture image support for sandbox
Quoted 6 lines
Changes in v5:
- DefineIH_ARCH_DEFAULTwhich is now requiredarch/sandbox/include/asm/u-boot.h | 3 +++ include/image.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "...all the good computer designs are bootlegged; the formally planned products, if they are built at all, are dogs!" - David E. Lundstrom, "A Few Good Men From Univac", MIT Press, 1987
PATCH v6 3/20 sandbox: Add architecture image support
HI Simon,
2011/10/18 Wolfgang Denk <[email protected]>:
Quoted 9 lines
Dear Simon Glass,
Quoted 6 lines
Changes in v5:
- DefineIH_ARCH_DEFAULTwhich is now required?arch/sandbox/include/asm/u-boot.h | ? ?3 +++
?include/image.h ? ? ? ? ? ? ? ? ? | ? ?1 +
?2 files changed, 4 insertions(+), 0 deletions(-)
Quoted 6 lines
Applied, thanks.
Best regards,
Wolfgang Denk
Sorry for late to reply your mail.
I'm doing PATCH v17 fix about NDS32 architecture against to your patches. I"ve found here you've defined IH_ARCH_SANDBOX in /include/image.h Just wondering about don't you need to also add this into ../common/image.c in the following table?
static const table_entry_t uimage_arch[]
[deleted]
{ IH_ARCH_BLACKFIN, "blackfin", "Blackfin", },
{ IH_ARCH_AVR32, "avr32", "AVR32", },
{ -1, "", "", },};
Because I'm wondering about if I need to fix this if you need to add IH_ARCH_SANDBOX into this structure.
Thanks!
Signature · 2 lines
Best regards, Macpaul Lin
PATCH v6 3/20 sandbox: Add architecture image support
Quoted 19 lines · On Tuesday 18 October 2011 04:28:23 ??? wrote:
2011/10/18 Wolfgang Denk <[email protected]>:
Quoted 10 lines
Dear Simon Glass,
Quoted 6 lines
Changes in v5:
- DefineIH_ARCH_DEFAULTwhich is now requiredarch/sandbox/include/asm/u-boot.h | 3 +++ include/image.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-)Applied, thanks.
Sorry for late to reply your mail.
I'm doing PATCH v17 fix about NDS32 architecture against to your patches. I"ve found here you've definedIH_ARCH_SANDBOXin /include/image.h Just wondering about don't you need to also add this into../common/image.cin the following table?
static consttable_entry_tuimage_arch[]
[deleted]
Quoted 7 lines
{ IH_ARCH_BLACKFIN, "blackfin", "Blackfin", }, { IH_ARCH_AVR32, "avr32", "AVR32", }, { -1, "", "", },};
Because I'm wondering about if I need to fix this if you need to add
IH_ARCH_SANDBOXinto this structure.
for now, i don't think so. "sandbox" isn't an arch you can create uimages for (atm?).
-mike
PATCH v6 3/20 sandbox: Add architecture image support
Hi Mike,
2011/10/18 Mike Frysinger <[email protected]>:
Quoted 2 lines · On Tuesday 18 October 2011 04:28:23 ??? wrote:
Quoted 1 line
2011/10/18 Wolfgang Denk <[email protected]>:
[deleted]
Quoted 7 lines
Quoted 7 lines
static const
table_entry_tuimage_arch[]
[deleted]{ IH_ARCH_BLACKFIN, "blackfin", "Blackfin", }, { IH_ARCH_AVR32, "avr32", "AVR32", }, { -1, "", "", },};
Quoted 7 lines
Quoted 2 lines
Because I'm wondering about if I need to fix this if you need to add
IH_ARCH_SANDBOXinto this structure.for now, i don't think so. "sandbox" isn't an arch you can create uimages for (atm?).
-mike
Is there no plan to run Chrome OS from flash storage?
Sorry I'm not familiar about the hardware planning about the Chrome OS. Just wondering if there is planning low-price Chrome netbook, the uimage might be
necessary for such kind of hardware.
Signature · 2 lines
Best regards, Macpaul Lin
PATCH v6 3/20 sandbox: Add architecture image support
Quoted 18 lines · On Tuesday 18 October 2011 11:43:49 ??? wrote:
2011/10/18 Mike Frysinger:
Quoted 2 lines · On Tuesday 18 October 2011 04:28:23 ??? wrote:
Quoted 1 line
2011/10/18 Wolfgang Denk <[email protected]>:
[deleted]
Quoted 13 lines
Quoted 12 lines
static const
table_entry_tuimage_arch[]
[deleted]{ IH_ARCH_BLACKFIN, "blackfin", "Blackfin", }, { IH_ARCH_AVR32, "avr32", "AVR32", }, { -1, "", "", },};
Because I'm wondering about if I need to fix this if you need to add
IH_ARCH_SANDBOXinto this structure.
Quoted 8 lines
Quoted 2 lines
for now, i don't think so. "sandbox" isn't an arch you can create uimages for (atm?).
Is there no plan to run Chrome OS from flash storage?
Sorry I'm not familiar about the hardware planning about the Chrome OS. Just wondering if there is planning low-price Chrome netbook, the uimage might be
necessary for such kind of hardware.
"sandbox" isn't actual hardware. it's a native application on your system like ls or mv or mutt. it's purely for testing on your local machine. -mike
PATCH v6 3/20 sandbox: Add architecture image support
Hi,
Quoted 14 lines · Mike Frysinger
Quoted 13 lines · On Tuesday 18 October 2011 11:43:49 ??? wrote:
2011/10/18 Mike Frysinger:
Quoted 2 lines · On Tuesday 18 October 2011 04:28:23 ??? wrote:
Quoted 1 line
2011/10/18 Wolfgang Denk <[email protected]>:
[deleted]
Quoted 8 lines
Quoted 8 lines
static const
table_entry_tuimage_arch[]
[deleted]{ IH_ARCH_BLACKFIN, "blackfin", "Blackfin", }, { IH_ARCH_AVR32, "avr32", "AVR32", }, { -1, "", "", },
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
};
Because I'm wondering about if I need to fix this if you need to add
IH_ARCH_SANDBOXinto this structure.for now, i don't think so. "sandbox" isn't an arch you can create uimages for (atm?).
No not at the moment - I'm not sure how useful it would be and it certainly isn't implemented yet.
Quoted 10 lines
Quoted 6 lines
Is there no plan to run Chrome OS from flash storage?
Sorry I'm not familiar about the hardware planning about the Chrome OS. Just wondering if there is planning low-price Chrome netbook, the uimage might be
necessary for such kind of hardware."sandbox" isn't actual hardware. it's a native application on your system like
lsormvormutt. it's purely for testing on your local machine. -mike
Yes I will look to adding some tests before long - my first target is SPI flash emulation.
Regards,
Simon
Quoted 1 line
PATCH v6 4/20 sandbox: Add compiler defines to support a 64-bit x86_64 platform
In reply to Simon GlassThis sets __WORDSIZE to 8 correctly on 64-bit machines.
---
Changes in v2:
- Update commit message to remove 'temporary'
- Allow __WORDSIZE to be defined in Makefile / elsewhere
include/compiler.h | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
include/compiler.h +11 -1
@@ -111,11 +111,21 @@ typedef unsigned int uint;#include <linux/types.h> #include <asm/byteorder.h> +#if __SIZEOF_LONG__ ==8 +# define __WORDSIZE 64 +#elif __SIZEOF_LONG__ ==4 +# define __WORDSIZE 32 +#elif !defined __WORDSIZE +#error "__SIZEOF_LONG__ has unexpected value" +#endif +/* Types for `void *' pointers. */ #if __WORDSIZE ==64 typedef unsigned long int uintptr_t ; -#else +#elif __WORDSIZE ==32 typedef unsigned int uintptr_t ; +#else +#error "__WORDSIZE has unexpected value"#endif #endif
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 4/20 sandbox: Add compiler defines to support a 64-bit x86_64 platform
Dear Simon Glass,
Quoted 10 lines · In message <[email protected]> you wrote:
This sets
__WORDSIZEto 8 correctly on 64-bit machines.Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Update commit message to remove 'temporary'
- Allow__WORDSIZEto be defined inMakefile/ elsewhereinclude/compiler.h | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de (null cookie; hope that's ok)
PATCH v6 4/20 sandbox: Add compiler defines to support a 64-bit x86_64 platform
In reply to Simon GlassDear Simon Glass,
Quoted 10 lines · In message <[email protected]> you wrote:
This sets
__WORDSIZEto 8 correctly on 64-bit machines.Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Update commit message to remove 'temporary'
- Allow__WORDSIZEto be defined inMakefile/ elsewhereinclude/compiler.h | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
This commit breaks building of all (or at least almost all, probbaly all ARM and PPC) boards:
+ ./MAKEALL ppc
In file included from /home/wd/git/u-boot/work/include/image.h:36,
from include/common.h:117:
/home/wd/git/u-boot/work/include/compiler.h:119:2: error: #error "__SIZEOF_LONG__ has unexpected value"
/home/wd/git/u-boot/work/include/compiler.h:128:2: error: #error "__WORDSIZE has unexpected value"
In file included from /home/wd/git/u-boot/work/include/image.h:36,
from include/common.h:117:...
+ ./MAKEALL arm
In file included from /home/wd/git/u-boot/work/include/image.h:36,
from include/common.h:117:
/home/wd/git/u-boot/work/include/compiler.h:119:2: error: #error "__SIZEOF_LONG__ has unexpected value"
/home/wd/git/u-boot/work/include/compiler.h:128:2: error: #error "__WORDSIZE has unexpected value"
In file included from /home/wd/git/u-boot/work/include/image.h:36,
from include/common.h:117:...
This happend both when building on i686 and on x86_64 build hosts.
Please fix.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de After a time, you may find that "having" is not so pleasing a thing, after all, as "wanting." It is not logical, but it is often true. -- Spock, "Amok Time", stardate 3372.7
PATCH v6 4/20 sandbox: Add compiler defines to support a 64-bit x86_64 platform
Quoted 37 lines · Wolfgang Denk
Dear Simon Glass,
Quoted 10 lines · In message <[email protected]> you wrote:
This sets
__WORDSIZEto 8 correctly on 64-bit machines.Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Update commit message to remove 'temporary'
- Allow__WORDSIZEto be defined inMakefile/ elsewhereinclude/compiler.h | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)This commit breaks building of all (or at least almost all, probbaly all ARM and PPC) boards:
+ ./MAKEALL ppc
In file included from/home/wd/git/u-boot/work/include/image.h:36,from include/common.h:117:
/home/wd/git/u-boot/work/include/compiler.h:119:2: error: #error "__SIZEOF_LONG__has unexpected value"/home/wd/git/u-boot/work/include/compiler.h:128:2: error: #error "__WORDSIZEhas unexpected value" In file included from/home/wd/git/u-boot/work/include/image.h:36, frominclude/common.h:117:
...+ ./MAKEALL arm
In file included from/home/wd/git/u-boot/work/include/image.h:36,from include/common.h:117:
/home/wd/git/u-boot/work/include/compiler.h:119:2: error: #error "__SIZEOF_LONG__has unexpected value"/home/wd/git/u-boot/work/include/compiler.h:128:2: error: #error "__WORDSIZEhas unexpected value" In file included from/home/wd/git/u-boot/work/include/image.h:36, frominclude/common.h:117:
...
Quoted 7 lines
This happend both when building on i686 and on
x86_64build hosts.Please fix.
Best regards,
Wolfgang Denk
Finally, I'm not alone when it comes to breaking all boards ! :-)
Simon, next time, try running the MAKEALL to check if nothing is broken :-)
PATCH v6 4/20 sandbox: Add compiler defines to support a 64-bit x86_64 platform
Dear Marek Vasut,
Quoted 2 lines · In message <[email protected]> you wrote:
Finally, I'm not alone when it comes to breaking all boards ! :-)
Guess we all do this, all the time.
Some of us learn from it, others buy higher quality asbestos underwear ;-)
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de By the way, ALL software projects are done by iterative prototyping. Some companies call their prototypes "releases", that's all.
PATCH v6 4/20 sandbox: Add compiler defines to support a 64-bit x86_64 platform
Hi Wolfgang,
Quoted 10 lines · Wolfgang Denk
Dear Marek Vasut,
Quoted 2 lines · In message <[email protected]> you wrote:
Finally, I'm not alone when it comes to breaking all boards ! :-)
Guess we all do this, all the time.
Some of us learn from it, others buy higher quality asbestos underwear ;-)
It seems to be a new gcc feature that I am relying on (curse of the new toolchain). The fix is probably to #define it to 32 in the error case. I will update that patch and send to the mailing list.
Regards,
Simon
Quoted 12 lines
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de By the way, ALL software projects are done by iterative ?prototyping. Some companies call their prototypes "releases", that's all.
PATCH v6 4/20 sandbox: Add compiler defines to support a 64-bit x86_64 platform
In reply to Wolfgang DenkHi Wolfgang,
Quoted 35 lines · Wolfgang Denk
Dear Simon Glass,
Quoted 10 lines · In message <[email protected]> you wrote:
This sets
__WORDSIZEto 8 correctly on 64-bit machines.Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Update commit message to remove 'temporary'
- Allow__WORDSIZEto be defined inMakefile/ elsewhere?include/compiler.h | ? 12 +++++++++++-
?1 files changed, 11 insertions(+), 1 deletions(-)This commit breaks building of all (or at least almost all, probbaly all ARM and PPC) boards:
+ ./MAKEALL ppc
In file included from/home/wd/git/u-boot/work/include/image.h:36,
? ? ? ? ? ? ? ? frominclude/common.h:117:/home/wd/git/u-boot/work/include/compiler.h:119:2: error: #error "__SIZEOF_LONG__has unexpected value"/home/wd/git/u-boot/work/include/compiler.h:128:2: error: #error "__WORDSIZEhas unexpected value" In file included from/home/wd/git/u-boot/work/include/image.h:36,
? ? ? ? ? ? ? ? frominclude/common.h:117:
...+ ./MAKEALL arm
In file included from/home/wd/git/u-boot/work/include/image.h:36,
? ? ? ? ? ? ? ? frominclude/common.h:117:/home/wd/git/u-boot/work/include/compiler.h:119:2: error: #error "__SIZEOF_LONG__has unexpected value"/home/wd/git/u-boot/work/include/compiler.h:128:2: error: #error "__WORDSIZEhas unexpected value" In file included from/home/wd/git/u-boot/work/include/image.h:36,
? ? ? ? ? ? ? ? frominclude/common.h:117:
...
Quoted 3 lines
This happend both when building on i686 and on
x86_64build hosts.Please fix.
OK I will take a look now.
Regards,
Simon
Quoted 13 lines
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de After a time, you may find that "having" is not so pleasing a thing, after all, as "wanting." ?It is not logical, but it is often true. ? ? ? ?-- Spock, "Amok Time", stardate 3372.7
PATCH v6 4/20 sandbox: Add compiler defines to support a 64-bit x86_64 platform
Dear Simon,
Quoted 2 lines · In message <CAPnjgZ1GpZ6v38pdNVRWW4fKToebFe4_uF9tL906d9kM4qB2Gw@mail.gmail.com>…
OK I will take a look now.
Thanks. Note: I haven't pushed this upstream yet, so I can still rebase and merge a fix into this commit.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de My brother sent me a postcard the other day with this big sattelite photo of the entire earth on it. On the back it said: "Wish you were here". - Steven Wright
PATCH v6 4/20 sandbox: Add compiler defines to support a 64-bit x86_64 platform
Hi Wolfgang,
Quoted 8 lines · Wolfgang Denk
Dear Simon,
Quoted 2 lines · In message <CAPnjgZ1GpZ6v38pdNVRWW4fKToebFe4_uF9tL906d9kM4qB2Gw@mail.gmail.com>…
OK I will take a look now.
Thanks. ?Note: I haven't pushed this upstream yet, so I can still rebase and merge a fix into this commit.
OK good - I have sent a v7 patch for this one commit.
Regards,
Simon
Quoted 13 lines
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de My brother sent me a postcard the other day with this ?big ?sattelite photo ?of the entire earth on it. On the back it said: "Wish you were here". ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- Steven Wright
PATCH v6 5/20 sandbox: Add cpu files
In reply to Simon GlassThis is an initial implementation with all functions defined but not working.
The lds file is very simple since we can mostly rely on the linker defaults.
---
Changes in v2:
- Remove setting of LDSCRIPT (top level Makefile does this anyway)
- Add comment to do_reset() to justify the sandbox implementation
- Move lds script into cpu/sandbox
Changes in v3:
- Change do_reset() back to what it was
- Move cpu files into arch/sandbox/cpu
arch/sandbox/config.mk | 20 +++++++++++++ arch/sandbox/cpu/Makefile | 47 ++++++++++++++++++++++++++++++++ arch/sandbox/cpu/cpu.c | 63 +++++++++++++++++++++++++++++++++++++++++++ arch/sandbox/cpu/u-boot.lds | 34 +++++++++++++++++++++++ 4 files changed, 164 insertions(+), 0 deletions(-) create mode 100644 arch/sandbox/config.mk create mode 100644 arch/sandbox/cpu/Makefile create mode 100644 arch/sandbox/cpu/cpu.c create mode 100644 arch/sandbox/cpu/u-boot.lds
arch/sandbox/config.mk new file +20 -0
@@ -0,0 +1,20 @@ +# Copyright (c) 2011 The Chromium OS Authors. +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA + +PLATFORM_CPPFLAGS += -DCONFIG_SANDBOX -D__SANDBOX__
arch/sandbox/cpu/Makefile new file +47 -0
47 lines not on this page · raw message
arch/sandbox/cpu/cpu.c new file +63 -0
63 lines not on this page · raw message
arch/sandbox/cpu/u-boot.lds new file +34 -0
@@ -0,0 +1,34 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +SECTIONS +{ + __u_boot_cmd_start = .; + .u_boot_cmd : { *(.u_boot_cmd) } + __u_boot_cmd_end = .; + __bss_start = .; + +} + +INSERT BEFORE .data;
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 5/20 sandbox: Add cpu files
Dear Simon Glass,
Quoted 15 lines · In message <[email protected]> you wrote:
This is an initial implementation with all functions defined but not working.
The lds file is very simple since we can mostly rely on the linker defaults.
Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Remove setting of LDSCRIPT (top levelMakefiledoes this anyway)
- Add comment todo_reset()to justify the sandbox implementation
- Move lds script into cpu/sandboxChanges in v3:
- Changedo_reset()back to what it was
- Move cpu files intoarch/sandbox/cpu
Quoted 9 lines
arch/sandbox/config.mk | 20 +++++++++++++ arch/sandbox/cpu/Makefile | 47 ++++++++++++++++++++++++++++++++ arch/sandbox/cpu/cpu.c | 63 +++++++++++++++++++++++++++++++++++++++++++ arch/sandbox/cpu/u-boot.lds | 34 +++++++++++++++++++++++ 4 files changed, 164 insertions(+), 0 deletions(-) create mode 100644 arch/sandbox/config.mk create mode 100644 arch/sandbox/cpu/Makefile create mode 100644 arch/sandbox/cpu/cpu.c create mode 100644 arch/sandbox/cpu/u-boot.lds
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Status quo. Latin for "the mess we're in."
PATCH v6 6/20 sandbox: Add architecture lib files
In reply to Simon GlassThese files are taken from the ARM board implementation and then reduced to remove unneeded cruft.
Ideally we would work towards unifying arch/xxx/lib files, particularly board.c.
---
Changes in v2:
- Fix commit message typo, sadly
- Remove ARM cruft from Makefile
- Remove version_string and make display_banner() call display_options()
- Tidy up DRAM logic (but I think it is still needed to fit in with U-Boot)
- Remove use of CONFIG_SYS_NO_FLASH
- Make board_init_f() call board_init_r() for now
- Make board_init_r() call main_loop() for now
Changes in v4:
- Add CONFIG_SYS_SDRAM_SIZE for size of emulated SDRAM
- Drop CONFIG_POST support
- Drop call to board_init()
- Remove printing of memory setup which is meaningless in sandbox
arch/sandbox/lib/Makefile | 51 ++++++++ arch/sandbox/lib/board.c | 276 +++++++++++++++++++++++++++++++++++++++++ arch/sandbox/lib/interrupts.c | 39 ++++++ 3 files changed, 366 insertions(+), 0 deletions(-) create mode 100644 arch/sandbox/lib/Makefile create mode 100644 arch/sandbox/lib/board.c create mode 100644 arch/sandbox/lib/interrupts.c
arch/sandbox/lib/Makefile new file +51 -0
@@ -0,0 +1,51 @@ +# +# Copyright (c) 2011 The Chromium OS Authors. +# +# (C) Copyright 2002-2006 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(ARCH).o + +COBJS-y += board.o +COBJS-y += interrupts.o + +SRCS := $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) + +# Always build libsandbox.o +TARGETS := $(LIB) + +all: $(TARGETS) + +$(LIB): $(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
arch/sandbox/lib/board.c new file +276 -0
276 lines not on this page · raw message
arch/sandbox/lib/interrupts.c new file +39 -0
@@ -0,0 +1,39 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* Use of this source code is governed by a BSD-style license that can be +* found in the LICENSE file. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <common.h> + +int interrupt_init (void ) +{ +return 0 ; +} + +void enable_interrupts (void ) +{ +return ; +} +int disable_interrupts (void ) +{ +return 0 ; +}
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 6/20 sandbox: Add architecture lib files
Dear Simon Glass,
Quoted 23 lines · In message <[email protected]> you wrote:
These files are taken from the ARM board implementation and then reduced to remove unneeded cruft.
Ideally we would work towards unifying
arch/xxx/libfiles, particularlyboard.c.Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Fix commit message typo, sadly
- Remove ARM cruft fromMakefile
- Removeversion_stringand makedisplay_banner()calldisplay_options()
- Tidy up DRAM logic (but I think it is still needed to fit in with U-Boot)
- Remove use ofCONFIG_SYS_NO_FLASH
- Makeboard_init_f()callboard_init_r()for now
- Makeboard_init_r()callmain_loop()for nowChanges in v4:
- AddCONFIG_SYS_SDRAM_SIZEfor size of emulated SDRAM
- DropCONFIG_POSTsupport
- Drop call toboard_init()
- Remove printing of memory setup which is meaningless in sandbox
Quoted 7 lines
arch/sandbox/lib/Makefile | 51 ++++++++ arch/sandbox/lib/board.c | 276 +++++++++++++++++++++++++++++++++++++++++ arch/sandbox/lib/interrupts.c | 39 ++++++ 3 files changed, 366 insertions(+), 0 deletions(-) create mode 100644 arch/sandbox/lib/Makefile create mode 100644 arch/sandbox/lib/board.c create mode 100644 arch/sandbox/lib/interrupts.c
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Men of peace usually are [brave]. -- Spock, "The Savage Curtain", stardate 5906.5
PATCH v6 7/20 sandbox: Add sandbox board
In reply to Simon GlassThis adds basic files for the sandbox board. The lds file is very simple since we can rely mostly on the linker defaults.
---
Changes in v2:
- Remove clean and dist-clean targets from Makefile
- Move lds script out of the board directory
Changes in v4:
- Remove board/sandbox/common directory as it is not used
Changes in v5:
- Simplify the declaration of gd_t in sandbox's board.c
board/sandbox/sandbox/Makefile | 42 +++++++++++++++++++++++++++++++++ board/sandbox/sandbox/sandbox.c | 49 +++++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + 3 files changed, 92 insertions(+), 0 deletions(-) create mode 100644 board/sandbox/sandbox/Makefile create mode 100644 board/sandbox/sandbox/sandbox.c
board/sandbox/sandbox/Makefile new file +42 -0
@@ -0,0 +1,42 @@ +# +# Copyright (c) 2011 The Chromium OS Authors. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundatio; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS := $(BOARD).o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
board/sandbox/sandbox/sandbox.c new file +49 -0
49 lines not on this page · raw message
boards.cfg +1 -0
@@ -264,6 +264,7 @@ tcm-bf518 blackfin blackfin tcm-bf537 blackfin blackfin eNET x86 x86 eNET - sc520 eNET:SYS_TEXT_BASE=0x38040000 eNET_SRAM x86 x86 eNET - sc520 eNET:SYS_TEXT_BASE=0x19000000 +sandbox sandbox sandbox sandbox sandbox - idmr m68k mcf52x2 TASREG m68k mcf52x2 tasreg esd M5208EVBE m68k mcf52x2 m5208evbe freescale
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 7/20 sandbox: Add sandbox board
Dear Simon Glass,
Quoted 15 lines · In message <[email protected]> you wrote:
This adds basic files for the sandbox board. The lds file is very simple since we can rely mostly on the linker defaults.
Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Remove clean and dist-clean targets fromMakefile
- Move lds script out of the board directoryChanges in v4:
- Remove board/sandbox/common directory as it is not usedChanges in v5:
- Simplify the declaration ofgd_tin sandbox'sboard.c
Quoted 6 lines
board/sandbox/sandbox/Makefile | 42 +++++++++++++++++++++++++++++++++ board/sandbox/sandbox/sandbox.c | 49 +++++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + 3 files changed, 92 insertions(+), 0 deletions(-) create mode 100644 board/sandbox/sandbox/Makefile create mode 100644 board/sandbox/sandbox/sandbox.c
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Four thousand throats may be cut in one night by a running man. -- Klingon Soldier, "Day of the Dove", stardate unknown
PATCH v6 7/20 sandbox: Add sandbox board
In reply to Simon GlassHI Simon
2011/10/11 Simon Glass <[email protected]>:
Quoted 16 lines
This adds basic files for the sandbox board. The lds file is very simple since we can rely mostly on the linker defaults.
Signed-off-by Simon Glass <[email protected]>---
Changes in v5:
- Simplify the declaration ofgd_tin sandbox'sboard.c?board/sandbox/sandbox/Makefile ?| ? 42 +++++++++++++++++++++++++++++++++ ?board/sandbox/sandbox/sandbox.c | ? 49 +++++++++++++++++++++++++++++++++++++++ ?boards.cfg ? ? ? ? ? ? ? ? ? ? ?| ? ?1 +?3 files changed, 92 insertions(+), 0 deletions(-) ?create mode 100644 board/sandbox/sandbox/Makefile
(quoted diff) +1
-0+include $(TOPDIR)/config.mk
Review
Quoted 10 lines
(quoted diff) +10
-0+ +LIB ? ?= $(obj)lib$(BOARD).o + +COBJS ?:= $(BOARD).o + +SRCS ? := $(COBJS:.o=.c) +OBJS ? := $(addprefix $(obj),$(COBJS)) + +$(LIB): ? ? ? ?$(obj).depend $(OBJS) + ? ? ? $(AR) $(ARFLAGS) $@ $(OBJS)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It has been suggested by Mike that you should use something like the following because $(AR) might broken.
$(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS))
Please checkout if this help
http://www.mail-archive.com/u-boot at lists.denx.de/msg59966.html
Thanks.
Signature · 2 lines
Best regards, Macpaul Lin
PATCH v6 7/20 sandbox: Add sandbox board
Quoted 17 lines · On Tuesday 18 October 2011 04:43:09 ??? wrote:
2011/10/11 Simon Glass :
board/sandbox/sandbox/Makefile line 33
Quoted 11 lines
board/sandbox/sandbox/Makefile new file +11
-0+include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS := $(BOARD).o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It has been suggested by Mike that you should use something like the following because $(AR) might broken.
Quoted 2 lines
$(LIB): $(OBJS)
$(callcmd_link_o_target, $(OBJS))
yeah i missed this chunk of Simon's patch (i caught some others in his patchset). i've fixed this in my tree-wide $(AR) fixup, so Simon won't have to worry about posting an update.
-mike
PATCH v6 7/20 sandbox: Add sandbox board
Quoted 18 lines · Mike Frysinger
Quoted 17 lines · On Tuesday 18 October 2011 04:43:09 ??? wrote:
2011/10/11 Simon Glass :
Review
Quoted 11 lines
(quoted diff) +11
-0+include $(TOPDIR)/config.mk + +LIB ? ?= $(obj)lib$(BOARD).o + +COBJS ?:= $(BOARD).o + +SRCS ? := $(COBJS:.o=.c) +OBJS ? := $(addprefix $(obj),$(COBJS)) + +$(LIB): ? ? ? ?$(obj).depend $(OBJS) + ? ? ? $(AR) $(ARFLAGS) $@ $(OBJS)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It has been suggested by Mike that you should use something like the following because $(AR) might broken.
Quoted 8 lines
Quoted 2 lines
$(LIB): ? ? ? ?$(OBJS)
$(callcmd_link_o_target, $(OBJS))yeah i missed this chunk of Simon's patch (i caught some others in his patchset). ?i've fixed this in my tree-wide $(AR) fixup, so Simon won't have to worry about posting an update.
-mike
Thank you Mike!
PATCH v6 8/20 sandbox: Add board info for architecture
In reply to Simon GlassThis is required for the bdinfo command to work.
This also cleans up the #ifdef mess for ethernet and lnum a little.
--- common/cmd_bdinfo.c | 34 ++++++++++++++++++++++++++++++---- 1 files changed, 30 insertions(+), 4 deletions(-)
common/cmd_bdinfo.c +30 -4
@@ -31,11 +31,14 @@ DECLARE_GLOBAL_DATA_PTR;static void print_num (const char *,ulong ); -#if !(defined(CONFIG_ARM ) || defined(CONFIG_M68K )) || defined(CONFIG_CMD_NET ) +#if !(defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_SANDBOX)) + || defined(CONFIG_CMD_NET ) +#define HAVE_PRINT_ETH static void print_eth (int idx);#endif -#if (!defined(CONFIG_ARM ) && !defined(CONFIG_X86 )) +#if (!defined(CONFIG_ARM ) && !defined(CONFIG_X86 ) && !defined(CONFIG_SANDBOX )) +#define HAVE_PRINT_LNUM static void print_lnum (const char *,u64 );#endif
@@ -413,6 +416,29 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])return 0 ; } +#elif defined(CONFIG_SANDBOX ) + +int do_bdinfo (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +int i; +bd_t *bd = gd->bd; + +print_num ("boot_params" , (ulong )bd->bi_boot_params); + +for (i =0 ; i <CONFIG_NR_DRAM_BANKS ; ++i) { +print_num ("DRAM bank" , i); +print_num ("-> start" , bd->bi_dram[i].start); +print_num ("-> size" , bd->bi_dram[i].size); + } + +#if defined(CONFIG_CMD_NET ) +print_eth (0 ); +printf ("ip_addr = %pI4\n" , &bd->bi_ip_addr); +#endif +print_num ("FB base " , gd->fb_base); +return 0 ; +} +#else #error "a case for this architecture does not exist!"#endif
@@ -422,7 +448,7 @@ static void print_num(const char *name, ulong value)printf ("%-12s= 0x%08lX\n" , name, value); } -#if !(defined(CONFIG_ARM ) || defined(CONFIG_M68K )) || defined(CONFIG_CMD_NET ) +#ifdef HAVE_PRINT_ETH static void print_eth (int idx) {char name[10 ], *val;
@@ -437,7 +463,7 @@ static void print_eth(int idx) }#endif -#if (!defined(CONFIG_ARM ) && !defined(CONFIG_X86 )) +#ifdef HAVE_PRINT_LNUM static void print_lnum (const char *name,u64 value) {printf ("%-12s= 0x%.8llX\n" , name, value);
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 8/20 sandbox: Add board info for architecture
Dear Simon Glass,
Quoted 8 lines · In message <[email protected]> you wrote:
This is required for the bdinfo command to work.
This also cleans up the #ifdef mess for ethernet and lnum a little.
Signed-off-by Simon Glass <[email protected]>--- common/cmd_bdinfo.c | 34 ++++++++++++++++++++++++++++++---- 1 files changed, 30 insertions(+), 4 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Our way is peace. -- Septimus, the Son Worshiper, "Bread and Circuses", stardate 4040.7.
PATCH v6 8/20 sandbox: Add board info for architecture
Hi Wolfgang,
Quoted 5 lines · Wolfgang Denk
Dear Simon Glass,
Quoted 2 lines · In message <[email protected]> you wrote:
This is required for the bdinfo command to work.
Quoted 8 lines
Quoted 6 lines
This also cleans up the #ifdef mess for ethernet and lnum a little.
Signed-off-by Simon Glass <[email protected]>---
?common/cmd_bdinfo.c | ? 34 ++++++++++++++++++++++++++++++---- ?1 files changed, 30 insertions(+), 4 deletions(-)Applied, thanks.
But again there is a PPC problem with this patch (a typo was introduced in one of the versions). I will resubmit v7 - and my new-found power to make PPC will help with this in future.
Regards,
Simon
Quoted 13 lines
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Our way is peace.
? ? ? ?-- Septimus, the Son Worshiper, "Bread and Circuses", ? ? ? ? ? stardate 4040.7.
PATCH v6 8/20 sandbox: Add board info for architecture
In reply to Simon GlassDear Simon Glass,
Quoted 5 lines · In message <[email protected]> you wrote:
This is required for the bdinfo command to work.
This also cleans up the #ifdef mess for ethernet and lnum a little.
Signed-off-by Simon Glass <[email protected]>
...
common/cmd_bdinfo.c DECLARE_GLOBAL_DATA_PTR; · line 35
Quoted 3 lines
common/cmd_bdinfo.c +2
-1-#if !(defined(CONFIG_ARM ) || defined(CONFIG_M68K )) || defined(CONFIG_CMD_NET ) +#if !(defined(CONFIG_ARM ) || defined(CONFIG_M68K ) || defined(CONFIG_SANDBOX )) + || defined(CONFIG_CMD_NET)
Did you _ever_ try compiling this?
Added '\\' when checking in.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing.
PATCH v6 8/20 sandbox: Add board info for architecture
Hi Wolfgang,
Quoted 7 lines · Wolfgang Denk
Dear Simon Glass,
Quoted 4 lines · In message <[email protected]> you wrote:
This is required for the bdinfo command to work.
This also cleans up the #ifdef mess for ethernet and lnum a little.
Quoted 7 lines
Quoted 1 line
Signed-off-by Simon Glass <[email protected]>...
common/cmd_bdinfo.c DECLARE_GLOBAL_DATA_PTR;
Quoted 3 lines
common/cmd_bdinfo.c +2
-1-#if !(defined(CONFIG_ARM ) || defined(CONFIG_M68K )) || defined(CONFIG_CMD_NET ) +#if !(defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_SANDBOX)) + ? ? || defined(CONFIG_CMD_NET)Did you _ever_ try compiling this?
Yes, but only with ARM or SANDBOX, sorry. I am set up for PPC now although I do get errors with MAKEALL:
./MAKEALL -a powerpc
Failed: $ARCH=ppc, should be 'powerpc' for EVB64260
make: *** [EVB64260_config] Error 1
System not configured - see README
make: *** [all] Error 1
I wonder why the ARCH is wrong?
Quoted 2 lines
Added '\\' when checking in.
Thanks.
Regards,
Simon
Quoted 13 lines
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing.
PATCH v6 8/20 sandbox: Add board info for architecture
Quoted 2 lines · On Monday 17 October 2011 18:12:13 Simon Glass wrote:
Yes, but only with ARM or SANDBOX, sorry. I am set up for PPC now although I do get errors with MAKEALL:
MAKEALL is a pita for testing all arches. i wrote a local script to make build testing a lot simpler. see attached.
it takes care of figuring out the right CROSS_COMPILE for the requested target, setting up ccache, and enabling private libgcc when possible. the next thing i plan on adding is automatic archiving of compiled objects in a per-board dir so that i can easily compare the compiled differences between patches.
so now i just run:
../buildall
(this will build *all* arches)
or for a quick cross-arch smoke test:
../buildall smoke
or it takes any target that MAKEALL does:
../buildall board board arch board arch etc...
caveat: it assumes a tree layout like so:/usr/local/src/u-boot/
|- toolchains/ toolchains from http://kernel.org/ | |- arm-linux/ | |- avr32-linux/ | |- ........ | `- mips-linux/
`- tmpu/ tree like git://git.denx.de/u-boot.git
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: buildall
Type: application/x-shellscript
Size: 2285 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111017/7652fb49/attachment.bin
PATCH v6 8/20 sandbox: Add board info for architecture
-everyone else
Hi Mike,
Quoted 24 lines · Mike Frysinger
Quoted 2 lines · On Monday 17 October 2011 18:12:13 Simon Glass wrote:
Yes, but only with ARM or SANDBOX, sorry. I am set up for PPC now although I do get errors with MAKEALL:
MAKEALL is a pita for testing all arches. ?i wrote a local script to make build testing a lot simpler. ?see attached.
it takes care of figuring out the right
CROSS_COMPILEfor the requested target, setting up ccache, and enabling private libgcc when possible. ?the next thing i plan on adding is automatic archiving of compiled objects in a per-board dir so that i can easily compare the compiled differences between patches.so now i just run:
? ? ? ?../buildall
(this will build *all* arches)or for a quick cross-arch smoke test:
? ? ? ?../buildall smokeor it takes any target that MAKEALL does:
? ? ? ?../buildall board board arch board arch etc...caveat: it assumes a tree layout like so:
/usr/local/src/u-boot/
Quoted 8 lines
?|- toolchains/ ? ? ? ? toolchains from http://kernel.org/ ?| ?|- arm-linux/ ?| ?|- avr32-linux/ ?| ?|- ........ ?| ?`- mips-linux/?`- tmpu/ ? ? ? ? ? ? ? ? ? ? ? tree like
git://git.denx.de/u-boot.git
-mike
This looks great. Do you have a full link to one of the toolchains on kernel.org please? - everything seems to have changed there.
Regards,
Simon
PATCH v6 8/20 sandbox: Add board info for architecture
Quoted 10 lines · On Monday 17 October 2011 18:47:10 Simon Glass wrote:
Quoted 8 lines · Mike Frysinger
caveat: it assumes a tree layout like so:
/usr/local/src/u-boot/|- toolchains/ toolchains from http://kernel.org/ | |- arm-linux/ | |- avr32-linux/ | |- ........ | `- mips-linux/`- tmpu/ tree like
git://git.denx.de/u-boot.git
Quoted 2 lines
This looks great. Do you have a full link to one of the toolchains on kernel.org please? - everything seems to have changed there.
they don't seem to have been restored yet. i'll tar up the trees i have locally and post them.
-mike
PATCH v6 8/20 sandbox: Add board info for architecture
Quoted 11 lines · Mike Frysinger
Quoted 10 lines · On Monday 17 October 2011 18:47:10 Simon Glass wrote:
Quoted 8 lines · Mike Frysinger
caveat: it assumes a tree layout like so:
/usr/local/src/u-boot/?|- toolchains/ ? ? ? ? toolchains from http://kernel.org/ ?| ?|- arm-linux/ ?| ?|- avr32-linux/ ?| ?|- ........ ?| ?`- mips-linux/?`- tmpu/ ? ? ? ? ? ? ? ? ? ? ? tree like
git://git.denx.de/u-boot.git
Quoted 7 lines
Quoted 2 lines
This looks great. Do you have a full link to one of the toolchains on kernel.org please? - everything seems to have changed there.
they don't seem to have been restored yet. ?i'll tar up the trees i have locally and post them.
-mike
Thanks Mike
PATCH v6 8/20 sandbox: Add board info for architecture
In reply to Mike FrysingerQuoted 13 lines · On Monday 17 October 2011 18:56:24 Mike Frysinger wrote:
Quoted 12 lines · On Monday 17 October 2011 18:47:10 Simon Glass wrote:
Quoted 11 lines · Mike Frysinger
caveat: it assumes a tree layout like so:
/usr/local/src/u-boot/|- toolchains/ toolchains from http://kernel.org/ | | |- arm-linux/ | |- avr32-linux/ | |- ........ | | `- mips-linux/
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
`- tmpu/ tree like
git://git.denx.de/u-boot.gitThis looks great. Do you have a full link to one of the toolchains on kernel.org please? - everything seems to have changed there.
they don't seem to have been restored yet. i'll tar up the trees i have locally and post them.
i've posted a bunch here:
http://dev.gentoo.org/~vapier/u-boot/
i need to build/post sh4/sparc ones because the one kernel.org don't build u- boot properly (multilib / libgcc issues). i've been using Gentoo built ones. -mike
PATCH v6 8/20 sandbox: Add board info for architecture
Hi Mike,
Quoted 22 lines · Mike Frysinger
Quoted 13 lines · On Monday 17 October 2011 18:56:24 Mike Frysinger wrote:
Quoted 12 lines · On Monday 17 October 2011 18:47:10 Simon Glass wrote:
Quoted 11 lines · Mike Frysinger
caveat: it assumes a tree layout like so:
/usr/local/src/u-boot/?|- toolchains/ ? ? ? ? toolchains from http://kernel.org/ ?| ?| ?|- arm-linux/ ?| ?|- avr32-linux/ ?| ?|- ........ ?| ?| ?`- mips-linux/Quoted 7 lines
Quoted 4 lines
Quoted 1 line
?`- tmpu/ ? ? ? ? ? ? ? ? ? ? ? tree like
git://git.denx.de/u-boot.gitThis looks great. Do you have a full link to one of the toolchains on kernel.org please? - everything seems to have changed there.
they don't seem to have been restored yet. ?i'll tar up the trees i have locally and post them.
Quoted 7 lines
i've posted a bunch here:
http://dev.gentoo.org/~vapier/u-boot/i need to build/post sh4/sparc ones because the one kernel.org don't build u- boot properly (multilib / libgcc issues). ?i've been using Gentoo built ones. -mike
Great thank you. BTW that might be the fastest site on the internet - I got 15MB/s transfer on some of the files :-)
Regards,
Simon
PATCH v6 9/20 sandbox: Add bootm support
In reply to Simon GlassThis adds sandbox architecture support to bootm, although it is probably not useful to load sandbox code into the address space and execute it.
This change at least make the file build correctly on 64-bit machines.
---
Changes in v2:
- Fix cast of int to pointer instead of just removing the code
common/cmd_bootm.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
common/cmd_bootm.c +3 -4
@@ -438,9 +438,8 @@ static int bootm_start_standalone(ulong iflag, int argc, char * const argv[])setenv ("filesize" , buf);return 0 ; } - appl = (int (*)(int ,char *const []))ntohl (images.ep); + appl = (int (*)(int ,char *const []))(ulong )ntohl (images.ep); (*appl)(argc-1 , &argv[1 ]); -return 0 ; }
@@ -464,14 +463,14 @@ static cmd_tbl_t cmd_bootm_sub[] = {int do_bootm_subcommand (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {int ret =0 ; -int state; +long state;cmd_tbl_t *c;boot_os_fn *boot_fn; c =find_cmd_tbl (argv[1 ], &cmd_bootm_sub[0 ],ARRAY_SIZE (cmd_bootm_sub));if (c) { - state = (int )c->cmd; + state = (long )c->cmd;/* treat start special since it resets the state machine */ if (state ==BOOTM_STATE_START ) {
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 9/20 sandbox: Add bootm support
Dear Simon Glass,
Quoted 5 lines · In message <[email protected]> you wrote:
This adds sandbox architecture support to bootm, although it is probably not useful to load sandbox code into the address space and execute it.
This change at least make the file build correctly on 64-bit machines.
Quoted 7 lines
Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Fix cast of int to pointer instead of just removing the codecommon/cmd_bootm.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Do not follow where the path may lead....go instead where there is no path and leave a trail.
PATCH v6 10/20 sandbox: Disable built-in malloc
In reply to Simon GlassWe prefer to U-Boot's malloc but for now it is easier to use the C library's version.
--- common/Makefile | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
common/Makefile +2 -0
@@ -29,7 +29,9 @@ LIB = $(obj)libcommon.o ifndef CONFIG_SPL_BUILD COBJS-y += main.o COBJS-y += command.o +ifndef CONFIG_SANDBOX COBJS-y += dlmalloc.o +endif COBJS-y += exports.o COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o COBJS-y += image.o
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 10/20 sandbox: Disable built-in malloc
Dear Simon Glass,
Quoted 7 lines · In message <[email protected]> you wrote:
We prefer to U-Boot's malloc but for now it is easier to use the C library's version.
Signed-off-by Simon Glass <[email protected]>--- common/Makefile | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de All these theories, diverse as they are, have two things in common: they explain the observed facts, and they are completeley and utterly wrong. - Terry Pratchett, _The Light Fantastic_
PATCH v6 11/20 sandbox: Disable standalone/API support
In reply to Simon GlassThis is less useful on the sandbox architecture since we can simply link all our code with U-Boot. However some interest has been expressed in implementing this support.
For now, it is disabled.
--- Makefile | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
Makefile +6 -3
@@ -137,9 +137,7 @@ unexport CDPATH # The "tools" are needed early, so put this first # Don't include stuff already done in $(LIBS) -SUBDIRS = tools \ - examples/standalone \ - examples/api +SUBDIRS = tools .PHONY : $(SUBDIRS) $(VERSION_FILE)
@@ -156,6 +154,11 @@ sinclude $(obj)include/autoconf.mk include $(obj)include/config.mk export ARCH CPU BOARD VENDOR SOC +ifndef CONFIG_SANDBOX +SUBDIRS += examples/standalone \ + examples/api +endif + # set default to nothing for native builds ifeq ($(HOSTARCH),$(ARCH)) CROSS_COMPILE ?=
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 11/20 sandbox: Disable standalone/API support
Dear Simon Glass,
Quoted 10 lines · In message <[email protected]> you wrote:
This is less useful on the sandbox architecture since we can simply link all our code with U-Boot. However some interest has been expressed in implementing this support.
For now, it is disabled.
Signed-off-by Simon Glass <[email protected]>--- Makefile | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de There is a multi-legged creature crawling on your shoulder. -- Spock, "A Taste of Armageddon", stardate 3193.9
PATCH v6 11/20 sandbox: Disable standalone/API support
Hi Wolfgang,
Quoted 7 lines · Wolfgang Denk
Dear Simon Glass,
Quoted 4 lines · In message <[email protected]> you wrote:
This is less useful on the sandbox architecture since we can simply link all our code with U-Boot. However some interest has been expressed in implementing this support.
Quoted 8 lines
Quoted 6 lines
For now, it is disabled.
Signed-off-by Simon Glass <[email protected]>---
?Makefile | ? ?9 ++++++---
?1 files changed, 6 insertions(+), 3 deletions(-)Applied, thanks.
Looking at the patch it appears not to have come through correctly, I am sending a fix-up patch to move the ifdef down a few lines.
Along with Anton's cache patch, these two fix sandbox again.
Regards,
Simon
Quoted 12 lines
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de There is a multi-legged creature crawling on your shoulder. ? ? ? ?-- Spock, "A Taste of Armageddon", stardate 3193.9
PATCH v6 12/20 sandbox: Force command sections to be 4-byte aligned
In reply to Simon GlassBy default sections are 16-byte aligned on some architectures, but the command name structure (struct cmd_tbl_s) does not have padding to 16 bytes. We use the linker to collect elements of an array of these structures and then at run-time we want this array to be accessible.
If the linker puts padding between elements then we cannot access the array properly.
This change reduces the alignment to 4-bytes so that the command table can be accessed correctly on any architecture.
---
Changes in v4:
- Add more info to command section alignment commit
include/command.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
include/command.h +2 -1
@@ -117,7 +117,8 @@ extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);#define CMD_FLAG_REPEAT 0x0001/* repeat last command */ #define CMD_FLAG_BOOTD 0x0002/* command is from bootd */ -#define Struct_Section __attribute__ ((unused,section (".u_boot_cmd"))) +#define Struct_Section __attribute__((unused, section(".u_boot_cmd"), \ + aligned(4)))#ifdef CONFIG_AUTO_COMPLETE # define _CMD_COMPLETE (x) x,
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 12/20 sandbox: Force command sections to be 4-byte aligned
Dear Simon Glass,
Quoted 12 lines · In message <[email protected]> you wrote:
By default sections are 16-byte aligned on some architectures, but the command name structure (struct
cmd_tbl_s) does not have padding to 16 bytes. We use the linker to collect elements of an array of these structures and then at run-time we want this array to be accessible.If the linker puts padding between elements then we cannot access the array properly.
This change reduces the alignment to 4-bytes so that the command table can be accessed correctly on any architecture.
Quoted 7 lines
Signed-off-by Simon Glass <[email protected]>---
Changes in v4:
- Add more info to command section alignment commitinclude/command.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Quantum Mechanics is God's version of "Trust me."
PATCH v6 13/20 sandbox: Add OS dependent layer
In reply to Simon GlassWe want to keep all OS-dependent code in once place, with a simple interface to U-Boot. For now, this is that place.
---
Changes in v2:
- Move os layer into arch/sandbox
- Remove clean and dist-clean targets from Makefile
- Try and fail to remove the global -I/usr/include
Changes in v3:
- Add os_exit() which always exits with success for now
- Add function comments to header file
- Call os_exit() in do_reset()
- Move cpu files into arch/sandbox/cpu
Changes in v4:
- Allow os_exit() to exit with a non-zero return code
arch/sandbox/cpu/Makefile | 5 ++- arch/sandbox/cpu/cpu.c | 7 ++-- arch/sandbox/cpu/os.c | 55 ++++++++++++++++++++++++++++++++++ include/os.h | 73 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 arch/sandbox/cpu/os.c create mode 100644 include/os.h
arch/sandbox/cpu/Makefile +4 -1
@@ -23,11 +23,14 @@ # MA 02111-1307 USA # +# os.c is build in the system environment, so needs standard includes +CPPFLAGS_arch/sandbox/cpu/os.o += -I/usr/include + include $(TOPDIR)/config.mk LIB = $(obj)lib$(CPU).o -COBJS := cpu.o +COBJS := cpu.o os.o SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
arch/sandbox/cpu/cpu.c +3 -4
@@ -20,15 +20,14 @@*/ #include <common.h> +#include <os.h> DECLARE_GLOBAL_DATA_PTR ;int do_reset (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -/* -* This is considered normal termination for now. We wil call os_exit() -* when available. -*/ +/* This is considered normal termination for now */ +os_exit (0 );return 0 ; }
arch/sandbox/cpu/os.c new file +55 -0
55 lines not on this page · raw message
include/os.h new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 13/20 sandbox: Add OS dependent layer
Dear Simon Glass,
Quoted 19 lines · In message <[email protected]> you wrote:
We want to keep all OS-dependent code in once place, with a simple interface to U-Boot. For now, this is that place.
Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Move os layer intoarch/sandbox
- Remove clean and dist-clean targets fromMakefile
- Try and fail to remove the global -I/usr/includeChanges in v3:
- Addos_exit()which always exits with success for now
- Add function comments to header file
- Callos_exit()indo_reset()
- Move cpu files intoarch/sandbox/cpuChanges in v4:
- Allowos_exit()to exit with a non-zero return code
Quoted 7 lines
arch/sandbox/cpu/Makefile | 5 ++- arch/sandbox/cpu/cpu.c | 7 ++-- arch/sandbox/cpu/os.c | 55 ++++++++++++++++++++++++++++++++++ include/os.h | 73 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 arch/sandbox/cpu/os.c create mode 100644 include/os.h
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 8 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A UNIX saleslady, Lenore,
Enjoys work, but she likes the beach more.
She found a good way
To combine work and play:
She sells C shells by the seashore.PATCH v6 14/20 sandbox: Add main program
In reply to Simon GlassAdd a main program so that we can run U-Boot.
---
Changes in v4:
- Move main() into arch/sandbox/cpu/start.c
arch/sandbox/cpu/Makefile | 2 +- arch/sandbox/cpu/start.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletions(-) create mode 100644 arch/sandbox/cpu/start.c
arch/sandbox/cpu/Makefile +1 -1
@@ -30,7 +30,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(CPU).o -COBJS := cpu.o os.o +COBJS := cpu.o start.o os.o SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
arch/sandbox/cpu/start.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <common.h> + +int main (int argc,char *argv[]) +{ +/* +* Do pre- and post-relocation init, then start up U-Boot. This will +* never return. +*/ +board_init_f (0 ); + +return 0 ; +}
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 14/20 sandbox: Add main program
Dear Simon Glass,
Quoted 11 lines · In message <[email protected]> you wrote:
Add a main program so that we can run U-Boot.
Signed-off-by Simon Glass <[email protected]>---
Changes in v4:
- Movemain()intoarch/sandbox/cpu/start.carch/sandbox/cpu/Makefile | 2 +- arch/sandbox/cpu/start.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletions(-) create mode 100644 arch/sandbox/cpu/start.c
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Worlds may change, galaxies disintegrate, but a woman always remains a woman. -- Kirk, "The Conscience of the King", stardate 2818.9
PATCH v6 15/20 sandbox: Add serial uart
In reply to Simon GlassThis uart simply writes to stdout and reads from stdin. We might imagine instead buffering the data so that a test interface can check output and inject input.
---
Changes in v4:
- Remove serial_exit()
drivers/serial/Makefile | 1 + drivers/serial/sandbox.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 0 deletions(-) create mode 100644 drivers/serial/sandbox.c
drivers/serial/Makefile +1 -0
@@ -53,6 +53,7 @@ COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o COBJS-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o +COBJS-$(CONFIG_SANDBOX_SERIAL) += sandbox.o COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o COBJS-$(CONFIG_TEGRA2) += serial_tegra2.o
drivers/serial/sandbox.c new file +63 -0
63 lines not on this page · raw message
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 15/20 sandbox: Add serial uart
Dear Simon Glass,
Quoted 5 lines · In message <[email protected]> you wrote:
This uart simply writes to stdout and reads from stdin. We might imagine instead buffering the data so that a test interface can check output and inject input.
Signed-off-by Simon Glass <[email protected]>
Quoted 8 lines
---
Changes in v4:
- Removeserial_exit()drivers/serial/Makefile | 1 + drivers/serial/sandbox.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 0 deletions(-) create mode 100644 drivers/serial/sandbox.c
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "That unit is a woman." "A mass of conflicting impulses." -- Spock and Nomad, "The Changeling", stardate 3541.9
PATCH v6 16/20 sandbox: Add basic config file
In reply to Simon GlassThis basic provides required features along with a basic command set.
---
Changes in v2:
- Remove CONFIG_SYS_SDRAM_BASE which is always 0 for sandbox boards
- Fix #define<tab>
- Remove CONFIG_LMB
Changes in v4:
- Add CONFIG_SYS_SDRAM_SIZE for size of emulated SDRAM
- Add #ifdef protection around sandbox.h header file
include/configs/sandbox.h | 85 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 85 insertions(+), 0 deletions(-) create mode 100644 include/configs/sandbox.h
include/configs/sandbox.h new file +85 -0
@@ -0,0 +1,85 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CONFIG_NR_DRAM_BANKS 1 +#define CONFIG_DRAM_SIZE (128 << 20) + +/* Number of bits in a C 'long' on this architecture */ +#define CONFIG_SANDBOX_BITS_PER_LONG 64 + +/* +* Size of malloc() pool, although we don't actually use this yet. +*/ +#define CONFIG_SYS_MALLOC_LEN (4 << 20)/* 4MB */ + +#define CONFIG_SYS_PROMPT "=>"/* Command Prompt */ +#define CONFIG_SYS_HUSH_PARSER +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " +#define CONFIG_SYS_LONGHELP /* #undef to save memory */ +#define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */ + +/* Print Buffer Size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_SYS_MAXARGS 16 + +/* turn on command-line edit/c/auto */ +#define CONFIG_CMDLINE_EDITING +#define CONFIG_COMMAND_HISTORY +#define CONFIG_AUTOCOMPLETE + +#define CONFIG_ENV_SIZE 8192 +#define CONFIG_ENV_IS_NOWHERE + +#define CONFIG_SYS_HZ 1000 + +/* Memory things - we don't really want a memory test */ +#define CONFIG_SYS_LOAD_ADDR 0x10000000 +#define CONFIG_SYS_MEMTEST_START 0x10000000 +#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x1000) +#define CONFIG_PHYS_64BIT + +/* Size of our emulated memory */ +#define CONFIG_SYS_SDRAM_SIZE (128 << 20) + +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ + 115200} +#define CONFIG_SANDBOX_SERIAL + +#define CONFIG_SYS_NO_FLASH + +/* include default commands */ +#include <config_cmd_default.h> + +/* We don't have networking support yet */ +#undef CONFIG_CMD_NET +#undef CONFIG_CMD_NFS + +#define CONFIG_BOOTARGS "" + +#define CONFIG_EXTRA_ENV_SETTINGS "stdin=serial\0" \ + "stdout=serial\0" \ + "stderr=serial\0" + +#endif
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 16/20 sandbox: Add basic config file
Dear Simon Glass,
Quoted 9 lines · In message <[email protected]> you wrote:
This basic provides required features along with a basic command set.
Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- RemoveCONFIG_SYS_SDRAM_BASEwhich is always 0 for sandbox boards
- Fix #define<tab>
- RemoveCONFIG_LMB
Quoted 7 lines
Changes in v4:
- AddCONFIG_SYS_SDRAM_SIZEfor size of emulated SDRAM
- Add #ifdef protection aroundsandbox.hheader fileinclude/configs/sandbox.h | 85 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 85 insertions(+), 0 deletions(-) create mode 100644 include/configs/sandbox.h
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "The good Christian should beware of mathematicians and all those who make empty prophecies. The danger already exists that mathematicians have made a covenant with the devil to darken the spirit and confine man in the bonds of Hell." - Saint Augustine
PATCH v6 17/20 Use uintptr_t for 32/64-bit compatibility
In reply to Simon GlassThis fixes a few problems when building on 64-bit machines.
--- common/cmd_mem.c | 2 +- common/fdt_support.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_mem.c +1 -1
@@ -937,7 +937,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])if (readback != val) {printf ("\nMem error @ 0x%08X: " "found %08lX, expected %08lX\n" , - (uint )addr, readback, val); + (uint )(uintptr_t )addr, readback, val); errs++;if (ctrlc ()) {putc ('\n' );
common/fdt_support.c +4 -4
@@ -495,7 +495,7 @@ int fdt_resize(void *blob) total =fdt_num_mem_rsv (blob);for (i =0 ; i < total; i++) {fdt_get_mem_rsv (blob, i, &addr, &size); -if (addr == (uint64_t )(u32 )blob) { +if (addr == (uintptr_t )blob) {fdt_del_mem_rsv (blob, i);break ; }
@@ -511,14 +511,14 @@ int fdt_resize(void *blob)fdt_size_dt_strings (blob) +5 *sizeof (struct fdt_reserve_entry );/* Make it so the fdt ends on a page boundary */ - actualsize =ALIGN (actualsize + ((uint )blob &0xfff ),0x1000 ); - actualsize = actualsize - ((uint )blob &0xfff ); + actualsize =ALIGN (actualsize + ((uintptr_t )blob &0xfff ),0x1000 ); + actualsize = actualsize - ((uintptr_t )blob &0xfff );/* Change the fdt header to reflect the correct size */ fdt_set_totalsize (blob, actualsize);/* Add the new reservation */ - ret =fdt_add_mem_rsv (blob, (uint )blob, actualsize); + ret =fdt_add_mem_rsv (blob, (uintptr_t )blob, actualsize);if (ret <0 )return ret;
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 17/20 Use uintptr_t for 32/64-bit compatibility
Dear Simon Glass,
Quoted 7 lines · In message <[email protected]> you wrote:
This fixes a few problems when building on 64-bit machines.
Signed-off-by Simon Glass <[email protected]>--- common/cmd_mem.c | 2 +- common/fdt_support.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A star captain's most solemn oath is that he will give his life, even his entire crew, rather than violate the Prime Directive. -- Kirk, "The Omega Glory", stardate unknown
PATCH v6 18/20 Adjust dependency rules to permit per-file flags
In reply to Simon GlassThe dependency rules are currently done in a shell 'for' loop. This does not permit Makefile variables to adjust preprocessor flags as is done with normal compile flags, using the CFLAGS_path/file.o syntax.
This change moves the dependency generation into the Makefile itself, and permits a CPPFLAGS_path/file.o to adjust preprocessor flags on a file or directory basis.
The CPPFLAGS_... variable is also folded into CFLAGS during the build.
---
Changes in v3:
- Change U-Boot's dependency generation to permit per-file flags
Changes in v4:
- 'Improve' dependency generation to deal with source files containing paths
- Make sure that clobber target removes all dependency files
Changes in v5:
- Fix dependency output to include $(obj) for out-of-tree builds
.gitignore | 2 +- Makefile | 2 +- config.mk | 7 +++++++ rules.mk | 44 +++++++++++++++++++++++++++++++++----------- 4 files changed, 42 insertions(+), 13 deletions(-)
.gitignore +1 -1
@@ -40,7 +40,7 @@ # Generated files # -*.depend +*.depend* /LOG /errlog /reloc_off
Makefile +1 -1
@@ -953,7 +953,7 @@ clean: | xargs rm -f clobber: clean - @find $(OBJTREE) -type f \( -name '*.depend' \ + @find $(OBJTREE) -type f \( -name '*.depend*' \ -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \ -print0 \ | xargs -0 rm -f
config.mk +7 -0
@@ -277,6 +277,13 @@ export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%)) ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR)) ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) +EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR)) +ALL_CFLAGS += $(EXTRA_CPPFLAGS) + +# The _DEP version uses the $< file target (for dependency generation) +# See rules.mk +EXTRA_CPPFLAGS_DEP = $(CPPFLAGS_$(BCURDIR)/$(addsuffix .o,$(basename $<))) \ + $(CPPFLAGS_$(BCURDIR)) $(obj)%.s: %.S $(CPP) $(ALL_AFLAGS) -o $@ $< $(obj)%.o: %.S
rules.mk +33 -11
50 lines not on this page · raw message
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 18/20 Adjust dependency rules to permit per-file flags
Dear Simon Glass,
Quoted 19 lines · In message <[email protected]> you wrote:
The dependency rules are currently done in a shell 'for' loop. This does not permit
Makefilevariables to adjust preprocessor flags as is done with normal compile flags, using theCFLAGS_path/file.osyntax.This change moves the dependency generation into the
Makefileitself, and permits aCPPFLAGS_path/file.oto adjust preprocessor flags on a file or directory basis.The
CPPFLAGS_... variable is also folded into CFLAGS during the build.Signed-off-by Simon Glass <[email protected]>---
Changes in v3:
- Change U-Boot's dependency generation to permit per-file flagsChanges in v4:
- 'Improve' dependency generation to deal with source files containing paths
- Make sure that clobber target removes all dependency files
Quoted 8 lines
Changes in v5:
- Fix dependency output to include $(obj) for out-of-tree builds.gitignore | 2 +- Makefile | 2 +- config.mk | 7 +++++++ rules.mk | 44 +++++++++++++++++++++++++++++++++----------- 4 files changed, 42 insertions(+), 13 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Some programming languages manage to absorb change, but withstand progress. -- Epigrams in Programming, ACM SIGPLAN Sept. 1982
PATCH v6 18/20 Adjust dependency rules to permit per-file flags
In reply to Simon GlassDear Simon Glass,
Quoted 11 lines · In message <[email protected]> you wrote:
The dependency rules are currently done in a shell 'for' loop. This does not permit
Makefilevariables to adjust preprocessor flags as is done with normal compile flags, using theCFLAGS_path/file.osyntax.This change moves the dependency generation into the
Makefileitself, and permits aCPPFLAGS_path/file.oto adjust preprocessor flags on a file or directory basis.The
CPPFLAGS_... variable is also folded into CFLAGS during the build.Signed-off-by Simon Glass <[email protected]>
This commit breaks building a number of PPC boards like that:
Configuring for acadia_nand - Board: acadia, Options: NAND_U_BOOT,SYS_TEXT_BASE=0x01000000
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/start.S: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/resetvec.S: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/cache.S: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/gpio.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/nand_boot.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/nand_ecc.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/memory.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/ndfc.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/pll.c: No such file or directory
ppc_6xx-gcc: no input files
make[1]: *** No rule to make target /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/.depend', needed by all'. Stop.
Affected boards:
MPC8313ERDB_NAND_33 P1020RDB_NAND SIMPC8313_LP MPC8313ERDB_NAND_66 P1021RDB-PC_36BIT_NAND SIMPC8313_SP MPC8315ERDB_NAND P1021RDB-PC_NAND acadia_nand MPC8536DS_NAND P1023RDS_NAND bamboo_nand MPC8569MDS_NAND P1024RDB_NAND canyonlands_nand MPC8572DS_NAND P1025RDB_NAND glacier_nand P1010RDB_36BIT_NAND P2010RDB_NAND haleakala_nand P1010RDB_NAND P2020RDB-PC_36BIT_NAND kilauea_nand P1011RDB_NAND P2020RDB-PC_NAND rainier_nand P1020RDB-PC_36BIT_NAND P2020RDB_NAND sequoia_nand P1020RDB-PC_NAND
Please fix.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Documentation is the castor oil of programming. Managers know it must be good because the programmers hate it so much.
PATCH v6 18/20 Adjust dependency rules to permit per-file flags
Hi Wolfgang,
Quoted 41 lines · Wolfgang Denk
Dear Simon Glass,
Quoted 11 lines · In message <[email protected]> you wrote:
The dependency rules are currently done in a shell 'for' loop. This does not permit
Makefilevariables to adjust preprocessor flags as is done with normal compile flags, using theCFLAGS_path/file.osyntax.This change moves the dependency generation into the
Makefileitself, and permits aCPPFLAGS_path/file.oto adjust preprocessor flags on a file or directory basis.The
CPPFLAGS_... variable is also folded into CFLAGS during the build.Signed-off-by Simon Glass <[email protected]>This commit breaks building a number of PPC boards like that:
Configuring for
acadia_nand- Board: acadia, Options: NAND_U_BOOT,SYS_TEXT_BASE=0x01000000
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/start.S: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/resetvec.S: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/cache.S: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/gpio.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/nand_boot.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/nand_ecc.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/memory.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/ndfc.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/pll.c: No such file or directory
ppc_6xx-gcc: no input files
make[1]: *** No rule to make target/work/wd/tmp-ppc/nand_spl/board/amcc/acadia/.depend', needed byall'. ?Stop.Affected boards:
Quoted 12 lines
? ? ? ?MPC8313ERDB_NAND_33 ? ?
P1020RDB_NAND? ? ? ? ?SIMPC8313_LP? ? ? ?MPC8313ERDB_NAND_66 ? ? P1021RDB-PC_36BIT_NAND ?SIMPC8313_SP ? ? ? ?MPC8315ERDB_NAND ? ? ? ?P1021RDB-PC_NAND ? ? ? ?acadia_nand ? ? ? ?MPC8536DS_NAND ? ? ? ? ?P1023RDS_NAND ? ? ? ? ?bamboo_nand? ? ? ?MPC8569MDS_NAND ? ? ? ?P1024RDB_NAND? ? ? ? ?canyonlands_nand? ? ? ?MPC8572DS_NAND ? ? ? ? ?P1025RDB_NAND ? ? ? ? ?glacier_nand? ? ? ?P1010RDB_36BIT_NAND ? ?P2010RDB_NAND? ? ? ? ?haleakala_nand? ? ? ?P1010RDB_NAND ? ? ? ? ? P2020RDB-PC_36BIT_NAND ?kilauea_nand ? ? ? ?P1011RDB_NAND ? ? ? ? ? P2020RDB-PC_NAND ? ? ? ?rainier_nand ? ? ? ?P1020RDB-PC_36BIT_NAND ?P2020RDB_NAND ? ? ? ? ?sequoia_nand? ? ? ?P1020RDB-PC_NAND
This might be something to do with SPL - I am looking at it today.
Regards,
Simon
Quoted 13 lines
Please fix.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Documentation is the castor oil of programming.
Managers know it must be good because the programmers hate it so much.
PATCH v6 18/20 Adjust dependency rules to permit per-file flags
Hi Wolfgang,
Quoted 57 lines · Simon Glass
Hi Wolfgang,
Quoted 41 lines · Wolfgang Denk
Dear Simon Glass,
Quoted 11 lines · In message <[email protected]> you wrote:
The dependency rules are currently done in a shell 'for' loop. This does not permit
Makefilevariables to adjust preprocessor flags as is done with normal compile flags, using theCFLAGS_path/file.osyntax.This change moves the dependency generation into the
Makefileitself, and permits aCPPFLAGS_path/file.oto adjust preprocessor flags on a file or directory basis.The
CPPFLAGS_... variable is also folded into CFLAGS during the build.Signed-off-by Simon Glass <[email protected]>This commit breaks building a number of PPC boards like that:
Configuring for
acadia_nand- Board: acadia, Options: NAND_U_BOOT,SYS_TEXT_BASE=0x01000000
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/start.S: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/resetvec.S: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/cache.S: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/gpio.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/nand_boot.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/nand_ecc.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/memory.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/ndfc.c: No such file or directory
ppc_6xx-gcc: no input files
ppc_6xx-gcc: /work/wd/tmp-ppc/nand_spl/board/amcc/acadia/pll.c: No such file or directory
ppc_6xx-gcc: no input files
make[1]: *** No rule to make target/work/wd/tmp-ppc/nand_spl/board/amcc/acadia/.depend', needed byall'. ?Stop.Affected boards:
Quoted 12 lines
? ? ? ?MPC8313ERDB_NAND_33 ? ?
P1020RDB_NAND? ? ? ? ?SIMPC8313_LP? ? ? ?MPC8313ERDB_NAND_66 ? ? P1021RDB-PC_36BIT_NAND ?SIMPC8313_SP ? ? ? ?MPC8315ERDB_NAND ? ? ? ?P1021RDB-PC_NAND ? ? ? ?acadia_nand ? ? ? ?MPC8536DS_NAND ? ? ? ? ?P1023RDS_NAND ? ? ? ? ?bamboo_nand? ? ? ?MPC8569MDS_NAND ? ? ? ?P1024RDB_NAND? ? ? ? ?canyonlands_nand? ? ? ?MPC8572DS_NAND ? ? ? ? ?P1025RDB_NAND ? ? ? ? ?glacier_nand? ? ? ?P1010RDB_36BIT_NAND ? ?P2010RDB_NAND? ? ? ? ?haleakala_nand? ? ? ?P1010RDB_NAND ? ? ? ? ? P2020RDB-PC_36BIT_NAND ?kilauea_nand ? ? ? ?P1011RDB_NAND ? ? ? ? ? P2020RDB-PC_NAND ? ? ? ?rainier_nand ? ? ? ?P1020RDB-PC_36BIT_NAND ?P2020RDB_NAND ? ? ? ? ?sequoia_nand? ? ? ?P1020RDB-PC_NAND
Quoted 6 lines
This might be something to do with SPL - I am looking at it today.
Regards,
SimonQuoted 1 line
Please fix.
I have submitted a patch for this, tested on acadia like this:
ARCH=powerpc make O=ppc -s acadia_nand_config && ARCH=powerpc make O=ppc -s
and similarly without the O= part.
Regards,
Simon
Quoted 13 lines
Quoted 12 lines
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Documentation is the castor oil of programming.
Managers know it must be good because the programmers hate it so much.
PATCH v6 18/20 Adjust dependency rules to permit per-file flags
Dear Simon,
Quoted 6 lines · In message <CAPnjgZ1qOjQw2w_oUSOriDhqh4JSpj5tMABBuEcHcpg+PQFHow@mail.gmail.com>…
I have submitted a patch for this, tested on acadia like this:
ARCH=powerpc make O=ppc -s
acadia_nand_config&& ARCH=powerpc make O> =ppc -sand similarly without the O= part.
Thanks a lot!
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Microsoft Multitasking:
several applications can crash at the same time.PATCH v6 18/20 Adjust dependency rules to permit per-file flags
Hi Wolfgang,
Quoted 11 lines · Wolfgang Denk
Dear Simon,
Quoted 6 lines · In message <CAPnjgZ1qOjQw2w_oUSOriDhqh4JSpj5tMABBuEcHcpg+PQFHow@mail.gmail.com>…
I have submitted a patch for this, tested on acadia like this:
ARCH=powerpc make O=ppc -s
acadia_nand_config&& ARCH=powerpc make O> =ppc -sand similarly without the O= part.
Thanks a lot!
You are welcome, sorry for breaking it.
Regards,
Simon
Quoted 12 lines
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Microsoft Multitasking:
? ? ? ? ? ? ? ? ? ? several applications can crash at the same time.
PATCH v6 19/20 Add generic gpio.h in asm-generic
In reply to Simon GlassSince we want want to have a standard GPIO interface, this adds a definition for this into include/asm-generic/gpio.h.
---
Changes in v5:
- Move the introduction of include/asm-generic/gpio.h into a separate commit
- Add comments to GPIO functions
include/asm-generic/gpio.h | 74 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) create mode 100644 include/asm-generic/gpio.h
include/asm-generic/gpio.h new file +74 -0
@@ -0,0 +1,74 @@ +/* +* Copyright (c) 2011 The Chromium OS Authors. +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +/* +* Generic GPIO API for U-Boot +* +* GPIOs are numbered from 0 to GPIO_COUNT-1 which value is defined +* by the SOC/architecture. +* +* Each GPIO can be an input or output. If an input then its value can +* be read as 0 or 1. If an output then its value can be set to 0 or 1. +* If you try to write an input then the value is undefined. If you try +* to read an output, barring something very unusual, you will get +* back the value of the output that you previously set. +* +* In some cases the operation may fail, for example if the GPIO number +* is out of range, or the GPIO is not available because its pin is +* being used by another function. In that case, functions may return +* an error value of -1. +*/ + +/** +* Make a GPIO an input. +* +* @param gp GPIO number +* @return 0 if ok, -1 on error +*/ +int gpio_direction_input (int gp); + +/** +* Make a GPIO an output, and set its value. +* +* @param gp GPIO number +* @param value GPIO value (0 for low or 1 for high) +* @return 0 if ok, -1 on error +*/ +int gpio_direction_output (int gp,int value); + +/** +* Get a GPIO's value. This will work whether the GPIO is an input +* or an output. +* +* @param gp GPIO number +* @return 0 if low, 1 if high, -1 on error +*/ +int gpio_get_value (int gp); + +/** +* Set an output GPIO's value. The GPIO must already be an output of +* this function may have no effect. +* +* @param gp GPIO number +* @param value GPIO value (0 for low or 1 for high) +* @return 0 if ok, -1 on error +*/ +int gpio_set_value (int gp,int value);
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 19/20 Add generic gpio.h in asm-generic
Dear Simon Glass,
Quoted 4 lines · In message <[email protected]> you wrote:
Since we want want to have a standard GPIO interface, this adds a definition for this into
include/asm-generic/gpio.h.Signed-off-by Simon Glass <[email protected]>
Quoted 8 lines
---
Changes in v5:
- Move the introduction ofinclude/asm-generic/gpio.hinto a separate commit
- Add comments to GPIO functionsinclude/asm-generic/gpio.h | 74 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) create mode 100644 include/asm-generic/gpio.h
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
KLB is an acronym for `Known Lazy Bastard', aka non-FAQ reader, aka
person who would rather make someone take their time to explain
something basic than look it up in a FAQ.
-- Tom Christiansen in <[email protected]>PATCH v6 20/20 sandbox: Makefile changes to build sandbox architecture
In reply to Simon GlassAt this point U-Boot will build and run on x86 under Linux.
The idea is to define a new architecture called 'sandbox', alongside ARM and x86. This runs natively on Linux to suit the host machine. All hardware access is either omitted or emulated.
The purpose of this system is to test the bulk of the non-hardware-specific U-Boot code. We can mock the SPI flash, GPIOs, UART and keyboard, then test that U-Boot behaves as we wish.
---
Changes in v2:
- Rebase to master
- Tidy top-level Makefile to minimise changes
Changes in v4:
- Drop board/sandbox/common/board.c for now (no board_init() needed)
- Move main() into start.c to remove one ifdef from the top level Makefile
- Fix up Makefile for non-sandbox builds
Makefile | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
Makefile +8 -0
@@ -403,12 +403,20 @@ $(obj)u-boot.ubl: $(obj)u-boot-nand.bin $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ +ifeq ($(CONFIG_SANDBOX),y) +GEN_UBOOT = \ + cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \ + -Wl,--start-group $(__LIBS) -Wl,--end-group \ + $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot +else GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \ sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__OBJS) \ --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \ -Map u-boot.map -o u-boot +endif + $(obj)u-boot: depend \ $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds $(GEN_UBOOT)
Signature · 1 line
1.7.3.1
Wolfgang Denk
AppliedPATCH v6 20/20 sandbox: Makefile changes to build sandbox architecture
Dear Simon Glass,
Quoted 16 lines · In message <[email protected]> you wrote:
At this point U-Boot will build and run on x86 under Linux.
The idea is to define a new architecture called 'sandbox', alongside ARM and x86. This runs natively on Linux to suit the host machine. All hardware access is either omitted or emulated.
The purpose of this system is to test the bulk of the non-hardware-specific U-Boot code. We can mock the SPI flash, GPIOs, UART and keyboard, then test that U-Boot behaves as we wish.
Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Rebase to master
- Tidy top-levelMakefileto minimise changes
Quoted 7 lines
Changes in v4:
- Dropboard/sandbox/common/board.cfor now (noboard_init()needed)
- Movemain()intostart.cto remove one ifdef from the top levelMakefile
- Fix upMakefilefor non-sandbox buildsMakefile | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Der Horizont vieler Menschen ist ein Kreis mit Radius Null -- und das nennen sie ihren Standpunkt.