Compare commits

...

8 Commits

Author SHA1 Message Date
Wolfgang Denk
cba9a894fd Prepare v2011.12
Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-23 20:25:35 +01:00
Horst Kronstorfer
49fbf4371e doc/mkimage.1: Fix -D/-f options formatting
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-23 20:11:46 +01:00
Wolfgang Denk
7ddd4475a8 post/lib_powerpc/multi.c: fix stack overflow error
The code and comment disagreed: the comment claimed that r6...r31
were copied, and consequently the arrays for "src" and "dst" were
declared with 26 entries, but the actual code ("lmw r5,0(r3)" and
"stmw r5,0(r4)") copied _27_ words (r5 through r31), which resulted
in false "POST cpu Error at multi test" messages.

Fix the comment and the array sizes.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Kim Phillips <kim.phillips@freescale.com>
Cc: Andy Fleming <afleming@gmail.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Anatolij Gustschin <agust@denx.de>
2011-12-23 20:08:10 +01:00
Wolfgang Denk
38081ff7a4 post/lib_powerpc/multi.c: code cleanup
Clean up and document the code:

- get rid of unneeded code block
- add comment which code is generated

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Kim Phillips <kim.phillips@freescale.com>
Cc: Andy Fleming <afleming@gmail.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
2011-12-23 20:07:41 +01:00
Wolfgang Denk
a63aec54a4 post/lib_powerpc/multi.c: make checkpatch clean
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Kim Phillips <kim.phillips@freescale.com>
Cc: Andy Fleming <afleming@gmail.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
2011-12-23 20:06:28 +01:00
Wolfgang Denk
139e1875d3 PPC: fix "Warning: FOO uses hard float, BAR uses soft float".
It appears that with recent versions of GCC the explicit
"-mhard-float" command line option takes precedence over the
``asm(".gnu_attribute 4, 2");'' in the source file, so this no longer
helps to avoid the warnings we get when linking code that uses FP
instructions with other code that was built using soft-float.

We can remove the ".gnu_attribute" (which appears to carry no other
information, at least so far) from the object files, but we also have
to make sure we don't pull in the __gcc_qsub() and __gcc_qmul()
functions from the standard libgcc, as these would again "infect" our
linking.  We copy this code from:
	gcc-4.2.2/gcc/config/rs6000/darwin-ldouble.c
This old version was chosen because it was still available under a
compatible license (GCC v2+).   The file was stripped down to the
needed parts, and reformatted so it passes checkpatch with only one
warning (do not add new typedefs).

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Stefan Roese <sr@denx.de>
Cc: Andy Fleming <afleming@gmail.com>
Cc: Kim Phillips <kim.phillips@freescale.com>
Tested-by: Stefan Roese <sr@denx.de>
Tested-by: Anatolij Gustschin <agust@denx.de>
2011-12-23 20:03:55 +01:00
Horst Kronstorfer
af44f4b2a5 Print program basename instead of whole path in usage()
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-22 09:09:18 +01:00
Thierry Reding
67c2cb1e69 tegra2: Fix out-of-tree build for Ventana.
Since Ventana is derived from Seaboard and requires seaboard.c to build,
make sure board/nvidia/seaboard is created in the build tree.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Wolfgang Denk <wd@denx.de>
2011-12-22 08:36:09 +01:00
7 changed files with 191 additions and 38 deletions

View File

@@ -24,7 +24,7 @@
VERSION = 2011
PATCHLEVEL = 12
SUBLEVEL =
EXTRAVERSION = -rc3
EXTRAVERSION =
ifneq "$(SUBLEVEL)" ""
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
else

View File

@@ -25,6 +25,7 @@
include $(TOPDIR)/config.mk
ifneq ($(OBJTREE),$(SRCTREE))
$(shell mkdir -p $(obj)../seaboard)
$(shell mkdir -p $(obj)../common)
endif

View File

@@ -82,12 +82,12 @@ Set XIP (execute in place) flag.
.B Create FIT image:
.TP
.BI "\-D "dtc option"
.BI "\-D [" "dtc options" "]"
Provide special options to the device tree compiler that is used to
create the image.
.TP
.BI "\-f "fit-image.its"
.BI "\-f [" "image tree source file" "]"
Image tree source file that describes the structure and contents of the
FIT image.

View File

@@ -24,10 +24,23 @@ include $(TOPDIR)/config.mk
LIB = libpost$(ARCH)fpu.o
COBJS-$(CONFIG_HAS_POST) += fpu.o 20001122-1.o 20010114-2.o 20010226-1.o 980619-1.o
COBJS-$(CONFIG_HAS_POST) += acc1.o compare-fp-1.o mul-subnormal-single-1.o
COBJS-$(CONFIG_HAS_POST) += 20001122-1.o
COBJS-$(CONFIG_HAS_POST) += 20010114-2.o
COBJS-$(CONFIG_HAS_POST) += 20010226-1.o
COBJS-$(CONFIG_HAS_POST) += 980619-1.o
COBJS-$(CONFIG_HAS_POST) += acc1.o
COBJS-$(CONFIG_HAS_POST) += compare-fp-1.o
COBJS-$(CONFIG_HAS_POST) += fpu.o
COBJS-$(CONFIG_HAS_POST) += mul-subnormal-single-1.o
COBJS-$(CONFIG_HAS_POST) += darwin-ldouble.o
include $(TOPDIR)/post/rules.mk
CFLAGS := $(shell echo $(CFLAGS) | sed s/-msoft-float//)
CFLAGS += -mhard-float -fkeep-inline-functions
$(obj)%.o: %.c
$(CC) $(ALL_CFLAGS) -o $@.fp $< -c
$(OBJCOPY) -R .gnu.attributes $@.fp $@
rm -f $@.fp

View File

@@ -0,0 +1,141 @@
/*
* Borrowed from GCC 4.2.2 (which still was GPL v2+)
*/
/* 128-bit long double support routines for Darwin.
Copyright (C) 1993, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
GCC 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, or (at your option) any later
version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
GCC 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 GCC; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
/*
* Implementations of floating-point long double basic arithmetic
* functions called by the IBM C compiler when generating code for
* PowerPC platforms. In particular, the following functions are
* implemented: __gcc_qadd, __gcc_qsub, __gcc_qmul, and __gcc_qdiv.
* Double-double algorithms are based on the paper "Doubled-Precision
* IEEE Standard 754 Floating-Point Arithmetic" by W. Kahan, February 26,
* 1987. An alternative published reference is "Software for
* Doubled-Precision Floating-Point Computations", by Seppo Linnainmaa,
* ACM TOMS vol 7 no 3, September 1981, pages 272-283.
*/
/*
* Each long double is made up of two IEEE doubles. The value of the
* long double is the sum of the values of the two parts. The most
* significant part is required to be the value of the long double
* rounded to the nearest double, as specified by IEEE. For Inf
* values, the least significant part is required to be one of +0.0 or
* -0.0. No other requirements are made; so, for example, 1.0 may be
* represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a
* NaN is don't-care.
*
* This code currently assumes big-endian.
*/
#define fabs(x) __builtin_fabs(x)
#define isless(x, y) __builtin_isless(x, y)
#define inf() __builtin_inf()
#define unlikely(x) __builtin_expect((x), 0)
#define nonfinite(a) unlikely(!isless(fabs(a), inf()))
typedef union {
long double ldval;
double dval[2];
} longDblUnion;
/* Add two 'long double' values and return the result. */
long double __gcc_qadd(double a, double aa, double c, double cc)
{
longDblUnion x;
double z, q, zz, xh;
z = a + c;
if (nonfinite(z)) {
z = cc + aa + c + a;
if (nonfinite(z))
return z;
x.dval[0] = z; /* Will always be DBL_MAX. */
zz = aa + cc;
if (fabs(a) > fabs(c))
x.dval[1] = a - z + c + zz;
else
x.dval[1] = c - z + a + zz;
} else {
q = a - z;
zz = q + c + (a - (q + z)) + aa + cc;
/* Keep -0 result. */
if (zz == 0.0)
return z;
xh = z + zz;
if (nonfinite(xh))
return xh;
x.dval[0] = xh;
x.dval[1] = z - xh + zz;
}
return x.ldval;
}
long double __gcc_qsub(double a, double b, double c, double d)
{
return __gcc_qadd(a, b, -c, -d);
}
long double __gcc_qmul(double a, double b, double c, double d)
{
longDblUnion z;
double t, tau, u, v, w;
t = a * c; /* Highest order double term. */
if (unlikely(t == 0) /* Preserve -0. */
|| nonfinite(t))
return t;
/* Sum terms of two highest orders. */
/* Use fused multiply-add to get low part of a * c. */
#ifndef __NO_FPRS__
asm("fmsub %0,%1,%2,%3" : "=f"(tau) : "f"(a), "f"(c), "f"(t));
#else
tau = fmsub(a, c, t);
#endif
v = a * d;
w = b * c;
tau += v + w; /* Add in other second-order terms. */
u = t + tau;
/* Construct long double result. */
if (nonfinite(u))
return u;
z.dval[0] = u;
z.dval[1] = (t - u) + tau;
return z.ldval;
}

View File

@@ -27,9 +27,9 @@
* CPU test
* Load/store multiple word instructions: lmw, stmw
*
* 26 consecutive words are loaded from a source memory buffer
* into GPRs r6 through r31. After that, 26 consecutive words are stored
* from the GPRs r6 through r31 into a target memory buffer. The contents
* 27 consecutive words are loaded from a source memory buffer
* into GPRs r5 through r31. After that, 27 consecutive words are stored
* from the GPRs r5 through r31 into a target memory buffer. The contents
* of the source and target buffers are then compared.
*/
@@ -38,45 +38,37 @@
#if CONFIG_POST & CONFIG_SYS_POST_CPU
extern void cpu_post_exec_02 (ulong *code, ulong op1, ulong op2);
extern void cpu_post_exec_02(ulong *code, ulong op1, ulong op2);
int cpu_post_test_multi (void)
int cpu_post_test_multi(void)
{
int ret = 0;
unsigned int i;
int flag = disable_interrupts();
int ret = 0;
unsigned int i;
ulong src[27], dst[27];
int flag = disable_interrupts();
if (ret == 0)
{
ulong src [26], dst [26];
ulong code[] =
{
ASM_LMW(5, 3, 0),
ASM_STMW(5, 4, 0),
ASM_BLR,
ulong code[] = {
ASM_LMW(5, 3, 0), /* lmw r5, 0(r3) */
ASM_STMW(5, 4, 0), /* stmr r5, 0(r4) */
ASM_BLR, /* blr */
};
for (i = 0; i < ARRAY_SIZE(src); ++i)
{
src[i] = i;
dst[i] = 0;
for (i = 0; i < ARRAY_SIZE(src); ++i) {
src[i] = i;
dst[i] = 0;
}
cpu_post_exec_02(code, (ulong)src, (ulong)dst);
cpu_post_exec_02(code, (ulong) src, (ulong) dst);
ret = memcmp(src, dst, sizeof(dst)) == 0 ? 0 : -1;
}
if (ret != 0)
{
post_log ("Error at multi test !\n");
}
if (ret != 0)
post_log("Error at multi test !\n");
if (flag)
enable_interrupts();
if (flag)
enable_interrupts();
return ret;
return ret;
}
#endif

View File

@@ -25,6 +25,9 @@
* MA 02111-1307 USA
*/
/* We want the GNU version of basename() */
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@@ -79,6 +82,9 @@ int main(int argc, char **argv)
struct stat txt_file_stat;
int fp, ep;
const char *prg;
prg = basename(argv[0]);
/* Parse the cmdline */
while ((option = getopt(argc, argv, "s:o:rbp:h")) != -1) {
@@ -104,11 +110,11 @@ int main(int argc, char **argv)
padbyte = strtol(optarg, NULL, 0);
break;
case 'h':
usage(argv[0]);
usage(prg);
return EXIT_SUCCESS;
default:
fprintf(stderr, "Wrong option -%c\n", option);
usage(argv[0]);
usage(prg);
return EXIT_FAILURE;
}
}
@@ -118,7 +124,7 @@ int main(int argc, char **argv)
fprintf(stderr,
"Please specify the size of the envrionnment "
"partition.\n");
usage(argv[0]);
usage(prg);
return EXIT_FAILURE;
}