Commit Graph

129 Commits

Author SHA1 Message Date
Mike Frysinger e0306cab09 examples: update do_reset prototype
One more place that was missed during the do_reset() unification.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-01-09 17:53:45 +01:00
Sebastien Carlier 6d8962e814 Switch from archive libraries to partial linking
Before this commit, weak symbols were not overridden by non-weak symbols
found in archive libraries when linking with recent versions of
binutils.  As stated in the System V ABI, "the link editor does not
extract archive members to resolve undefined weak symbols".

This commit changes all Makefiles to use partial linking (ld -r) instead
of creating library archives, which forces all symbols to participate in
linking, allowing non-weak symbols to override weak symbols as intended.
This approach is also used by Linux, from which the gmake function
cmd_link_o_target (defined in config.mk and used in all Makefiles) is
inspired.

The name of each former library archive is preserved except for
extensions which change from ".a" to ".o".  This commit updates
references accordingly where needed, in particular in some linker
scripts.

This commit reveals board configurations that exclude some features but
include source files that depend these disabled features in the build,
resulting in undefined symbols.  Known such cases include:
- disabling CMD_NET but not CMD_NFS;
- enabling CONFIG_OF_LIBFDT but not CONFIG_QE.

Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
2010-11-17 21:02:18 +01:00
Peter Tyser c91d456c05 examples/standalone: Use gcc's -fno-toplevel-reorder
Using -fno-toplevel-reorder causes gcc to not reorder functions.  This
ensures that an application's entry point will be the first function in
the application's source file.

This change, along with commit 620bbba524
should cause a standalone application's entry point to be at the base of
the compiled binary.  Previously, the entry point could change depending
on gcc version and flags.

Note -fno-toplevel-reorder is only available in gcc version 4.2 or
greater.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2010-10-12 22:47:03 +02:00
Xiangfu Liu 4093031607 MIPS: update the MIPS u-boot.lds
From the document, if set all arguments in "OUTPUT_FORMAT" to
"tradbigmips", then even add "-EL" to gcc we still get EB format.

pb1x00 is only used in Little-endian, so its default endian should be
set to LE.

Signed-off-by: Xiangfu Liu <xiangfu@openmobilefree.net>
Signed-off-by: Shinya Kuribayashi <skuribay@pobox.com>
2010-09-04 11:52:17 +09:00
Juergen Kilb aa9fba5313 smc91xx_eeprom: Correct chip detection check.
The smc911x_detect function in /net/driver/net/smc911x.c
returns a 0 if everything was ok (a chip was found) and -1 else.
In the standalone example 'smc911x_eeprom' the return value
of smc911x_detect is interpreted in a different way
(0 for error, !0 as OK).
This leads to the error that the chip will not be detected.

Signed-off-by: Juergen Kilb <j.kilb@phytec.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-07-12 00:14:29 -07:00
Wolfgang Denk 54841ab50c Make sure that argv[] argument pointers are not modified.
The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands.  Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
	while (--argc > 0 && **++argv == '-') {
/* ====> */	while (*++*argv) {
			switch (**argv) {
			case 'd':
				debug++;
				break;
			...
			default:
				usage ();
			}
		}
	}
	...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell.  With the modification, the compiler will prevent this with
an
	error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

	while (--argc > 0 && **++argv == '-') {
		char *arg = *argv;
		while (*++arg) {
			switch (*arg) {
			...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2010-07-04 23:55:42 +02:00
Wolfgang Denk d9c27253ce Make *printf() return "int" instead of "void"
Change the return type of the *printf() functions to the standard
"int"; no changes are needed but returning the already available
length count.

This will save a few additional strlen() calls later...

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-07-04 23:51:49 +02:00
Peter Tyser 620bbba524 examples/standalone: Remove relocation compile flags for PowerPC
Previously, standalone applications were compiled with gcc flags that
produced relocatable executables on the PowerPC architecture (eg with
the -mrelocatable and -fPIC flags).  There's no reason for these
applications to be fully relocatable at this time since no relocation
fixups are performed on standalone applications.

Additionally, removing the gcc relocation flags results in the entry
point of applications residing at the base of the image.  When
a standalone application was relocatable, the entry point was generally
located at an offset into the image which was confusing and prone to
errors.

This change moves the entry point of PowerPC standalone applications
from 0x40004 (usually) to 0x40000.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-06-29 22:29:13 +02:00
Thomas Chou 1117cbf2ad nios: remove nios-32 arch
The nios-32 arch is obsolete and broken. So it is removed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2010-05-28 10:56:04 -04:00
Thomas Chou 0df01fd3d7 nios2: fix r15 issue for gcc4
The "-ffixed-r15" option doesn't work well for gcc4. Since we
don't use gp for small data with option "-G0", we can use gp
as global data pointer. This allows compiler to use r15. It
is necessary for gcc4 to work properly.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
2010-05-28 10:56:03 -04:00
Stefan Roese a47a12becf Move arch/ppc to arch/powerpc
As discussed on the list, move "arch/ppc" to "arch/powerpc" to
better match the Linux directory structure.

Please note that this patch also changes the "ppc" target in
MAKEALL to "powerpc" to match this new infrastructure. But "ppc"
is kept as an alias for now, to not break compatibility with
scripts using this name.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Peter Tyser <ptyser@xes-inc.com>
Cc: Anatolij Gustschin <agust@denx.de>
2010-04-21 23:42:38 +02:00
Peter Tyser 8d1f268204 ppc: Move cpu/$CPU to arch/ppc/cpu/$CPU
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2010-04-13 09:13:16 +02:00
Peter Tyser 78acc472d9 Rename lib_generic/ to lib/
Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2010-04-13 09:13:04 +02:00
Peter Tyser ea0364f1bb Move lib_$ARCH directories to arch/$ARCH/lib
Also move lib_$ARCH/config.mk to arch/$ARCH/config.mk

This change is intended to clean up the top-level directory structure
and more closely mimic Linux's directory organization.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2010-04-13 09:13:03 +02:00
Wolfgang Denk 4e72fb15c9 standalone eepro100_eeprom: fix build error
Building examples/standalone/eepro100_eeprom triggers this error:

In file included from include/common.h:629,
                 from eepro100_eeprom.c:24:
include/net.h: In function 'NetReadIP':
include/net.h:430: warning: implicit declaration of function 'memcpy'
eepro100_eeprom.c: At top level:
eepro100_eeprom.c:81: error: conflicting types for 'memcpy'
include/net.h:430: error: previous implicit declaration of 'memcpy' was here

Fix this.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-03-12 22:56:50 +01:00
Wolfgang Denk 1bb1809558 Update .gitignore's: add some generated files
Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-03-12 22:10:31 +01:00
Mike Frysinger c4168af3ba smc91111_eeprom: fix linking error
Building for a bf533-stamp ends up with this error:
smc91111_eeprom.o: In function `smc91111_eeprom':
examples/standalone/smc91111_eeprom.c:58: undefined reference to `memset'
make[2]: *** [smc91111_eeprom] Error 1

The new eth_struct definition means gcc has to zero out the structure on
the stack, and some gcc versions optimize this with an implicit call to
memset.  So tweak the structure style to avoid that gcc feature.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-01-31 22:34:33 -08:00
Ben Warren b40e2320c4 Fix breakage in SMC EEPROM standalone applications
Commit 6a45e38495 (Make getenv_IPaddr() global)
inadvertently added ' #include "net.h" ' to the standalone programs, creating
duplicate definitions of 'struct eth_device'.  This patch removes the local
definitions and removes other code that breaks due to the change in definition.

Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2010-01-19 00:05:53 +01:00
Wolfgang Denk 2a49bf3149 Merge branch 'master' into next
Conflicts:
	board/esd/plu405/plu405.c
	drivers/rtc/ftrtc010.c

Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-05 02:11:59 +01:00
Ingo van Lil 3eb90bad65 Generic udelay() with watchdog support
According to the PPC reference implementation the udelay() function is
responsible for resetting the watchdog timer as frequently as needed.
Most other architectures do not meet that requirement, so long-running
operations might result in a watchdog reset.

This patch adds a generic udelay() function which takes care of
resetting the watchdog before calling an architecture-specific
__udelay().

Signed-off-by: Ingo van Lil <inguin@gmx.de>
2009-12-05 01:08:53 +01:00
Mike Frysinger 64a480601a smc91111_eeprom: drop CONFIG stub protection
Since the Makefile now controls the compilation of this, there is no need
for CONFIG checking nor the stub function.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-02 23:33:01 +01:00
Sanjeev Premi 604f7ce55a Fix build failure in examples/standalone
Some versions of 'make' do not handle trailing white-spaces
properly. Trailing spaces in ELF causes a 'fake' source to
be added to the variable COBJS; leading to build failure
(listed below). The problem was found with GNU Make 3.80.

Using text-function 'strip' as a workaround for the problem.

make[1]: Entering directory `/home/sanjeev/u-boot/examples/standalone'
arm-none-linux-gnueabi-gcc -g  -Os   -fno-common -ffixed-r8 -msoft-float
-D__KERNEL__ -DTEXT_BASE=0x80e80000 -I/home/sanjeev/u-boot/include
-fno-builtin -ffreestanding -nostdinc -isystem /opt/codesourcery/2009q1-
203/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -pipe  -DCONFIG_
ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-interwork -march=armv5
-Wall -Wstrict-prototypes -fno-stack-protector -g  -Os   -fno-common -ff
ixed-r8 -msoft-float   -D__KERNEL__ -DTEXT_BASE=0x80e80000 -I/home/sanje
ev/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/co
desourcery/2009q1-203/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/includ
e -pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-inte
rwork -march=armv5 -I.. -Bstatic -T u-boot.lds  -Ttext 0x80e80000 -o .c
arm-none-linux-gnueabi-gcc: no input files
make[1]: *** [.c] Error 1
make[1]: Leaving directory `/home/sanjeev/u-boot/examples/standalone'
make: *** [examples/standalone] Error 2
premi #

Signed-off-by: Sanjeev Premi <premi@ti.com>

Fixed typo (s/ElF/ELF/).
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-02 23:17:26 +01:00
Scott McNutt 57baa379cf Nios2/Nios: Remove unnecessary (residual) linker Nios command scripts from
the standalone examples.

Signed-off-by: Scott McNutt <smcnutt@psyent.com>
2009-11-23 15:54:25 -05:00
Mike Frysinger c44efcf97b smc911x_eeprom: fix building after smc911x overhaul
When the smc911x driver was converted to NET_MULTI, the smc911x eeprom was
missed.  The config option needed updating as well as overhauling of the
rergister read/write functions.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-12 21:25:56 -08:00
Sergey Mironov 2c0c58b92d Fix bug in jumptable call stubs for SPARC.
Signed-off-by: Sergey Mironov <ierton@gmail.com>
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
2009-10-27 14:09:40 +01:00
Ben Warren 7194ab8095 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API
All in-tree boards that use this controller have CONFIG_NET_MULTI
added
Also:
  - changed CONFIG_DRIVER_SMC91111 to CONFIG_SMC91111
  - cleaned up line lengths
  - modified all boards that override weak function in this driver
  - modified all eeprom standalone apps to work with new driver
  - updated blackfin standalone EEPROM app after testing

Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-04 22:37:03 -07:00
Mike Frysinger 557555fe0b standalone: convert to kbuild style
Clean up the arch/cpu/board/config checks as well as redundant setting of
srec/bin variables by using the kbuild VAR-$(...) style.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-15 22:27:23 +02:00
Mike Frysinger 262ae0a619 push LOAD_ADDR out to arch mk files
Rather than maintain/extend the current ifeq($(ARCH)) mess that exists in
the standalone Makefile, push the setting up of LOAD_ADDR out to the arch
config.mk (and rename to STANDALONE_LOAD_ADDR in the process).  This keeps
the common code clean and lets the arch do whatever crazy crap it wants in
its own area.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-04 23:06:34 +02:00
Mike Frysinger 65f6f07b72 atmel_df_pow2: standalone to convert dataflashes to pow2
Atmel DataFlashes by default operate with pages that are slightly bigger
than normal binary sizes (i.e. many are 1056 byte pages rather than 1024
bytes).  However, they also have a "power of 2" mode where the pages show
up with the normal binary size.  The latter mode is required in order to
boot with a Blackfin processor, so many people wish to convert their
DataFlashes on their development systems to this mode.  This standalone
application does just that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-04 21:31:30 +02:00
Robin Getz c4db335c2e Blackfin: change global data register from P5 to P3
Since the Blackfin ABI favors higher scratch registers by default, use the
last scratch register (P3) for global data rather than the first (P5).
This allows the compiler's register allocator to use higher number scratch
P registers, which in turn better matches the Blackfin instruction set,
which reduces the size of U-Boot by more than 1024 bytes...

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-02 05:14:02 -04:00
Michael Evans 61c68ae0b4 Fix examples for OMAP3 boards...
The attached patch corrects an error in the examples/Makefile which
causes the applications in the examples directory to hang on OMAP3
based boards. The current Makefile sets -Ttext during linking to
0x0c100000 which is outside of addressable SDRAM memory. The script
corrects the existing ifeq...else...endif logic to look at the VENDOR
tag rather than the CPU tag.

The patch affects the following configs: omap3_beagle_config,
omap3_overo_config, omap3_evm_config, omap3_pandora_config,
omap3_zoom1_config and omap3_zoom2_config.

Signed-off-by: Michael Evans <horse_dung@hotmail.com>

Edited commit message.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-08-08 11:57:22 +02:00
Wolfgang Denk 942828a098 ABI: fix build problems due to now needed div64 routine.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-07-27 09:19:15 +02:00
Peter Tyser d4abc757c2 Move api_examples to examples/api
Also add a rule to remove demo.bin which was previously leftover
after a "make clean"

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-07-21 09:23:36 +02:00
Peter Tyser 1bc1538613 Move examples/ to examples/standalone
The current files in examples are all standalone application examples,
so put them in their own subdirectory for organizational purposes

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-07-21 00:13:21 +02:00
Mike Frysinger b196ca7550 smc91111_eeprom: move board-specific init into SMC91111_EEPROM_INIT()
Rather than sticking Blackfin-specific stuff into the eeprom example, use
an indirect macro so that any board can override it with their own magic
sauce in their board config file.

Also fix some spurious semi-colons in defines while I'm at it ...

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Ben Warren <biggerbadderben@gmail.com>
2009-04-04 22:40:45 +02:00
Trent Piepho f62fb99941 Fix all linker script to handle all rodata sections
A recent gcc added a new unaligned rodata section called '.rodata.str1.1',
which needs to be added the the linker script.  Instead of just adding this
one section, we use a wildcard ".rodata*" to get all rodata linker section
gcc has now and might add in the future.

However, '*(.rodata*)' by itself will result in sub-optimal section
ordering.  The sections will be sorted by object file, which causes extra
padding between the unaligned rodata.str.1.1 of one object file and the
aligned rodata of the next object file.  This is easy to fix by using the
SORT_BY_ALIGNMENT command.

This patch has not be tested one most of the boards modified.  Some boards
have a linker script that looks something like this:

*(.text)
. = ALIGN(16);
*(.rodata)
*(.rodata.str1.4)
*(.eh_frame)

I change this to:

*(.text)
. = ALIGN(16);
*(.eh_frame)
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))

This means the start of rodata will no longer be 16 bytes aligned.
However, the boundary between text and rodata/eh_frame is still aligned to
16 bytes, which is what I think the real purpose of the ALIGN call is.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2009-03-20 22:39:12 +01:00
Mike Frysinger 069f4364d8 smc911x_eeprom: update register API
The smc911x driver changed the naming convention for its register funcs,
so update the eeprom code accordingly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Ben Warren <biggerbadderben@gmail.com>
2009-03-19 00:02:57 +01:00
Mike Frysinger ad2d16393e smc911x_eeprom: new example app for managing newer SMC parts
A forward port of the last version to work with the newer smc911x driver.
I only have a board with a LAN9218 part on it, so that is the only one
I've tested.  But there isn't anything in this that would make it terribly
chip specific afaik.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Sascha Hauer <s.hauer@pengutronix.de>
CC: Guennadi Liakhovetski <lg@denx.de>
CC: Magnus Lilja <lilja.magnus@gmail.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-02-22 23:49:33 -08:00
Dirk Behme 91eee54673 OMAP3: Add common board, interrupt and system info
Add common board, interrupt and system info code.

Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
2009-01-24 17:51:21 +01:00
Graeme Russ d4f70da544 Fixed build error due to #define of _LINUX_STRING_H_ in 82559_eeprom.c
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
2008-12-10 00:32:36 +01:00
Selvamuthukumar 9b827cf172 Align end of bss by 4 bytes
Most of the bss initialization loop increments 4 bytes
at a time. And the loop end is checked for an 'equal'
condition. Make the bss end address aligned by 4, so
that the loop will end as expected.

Signed-off-by: Selvamuthukumar <selva.muthukumar@e-coninfotech.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-11-18 23:13:16 +01:00
Jean-Christophe PLAGNIOL-VILLARD 6d0f6bcf33 rename CFG_ macros to CONFIG_SYS
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-18 21:54:03 +02:00
Nobuhiro Iwamatsu cae6f909ba sh: Fix cannot execute a stand-alone application
Address calculated in EXPORT_FUNC in SuperH was wrong, I revised it.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2008-10-14 13:09:40 +09:00
Graeme Russ 3ef96ded38 Update i386 code (sc520_cdp)
Attempt to bring i386 / sc520 inline with master

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
2008-09-09 11:48:53 +02:00
Nobuhiro Iwamatsu 6ad43d0dd8 sh: Add support SH2/SH2A which is CPU of Renesas Technology
Add support SH2/SH2A basic function.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2008-08-31 22:48:33 +09:00
Wolfgang Denk 9b55a25369 Fix some more print() format errors.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-07-11 01:16:00 +02:00
Wolfgang Denk 06c53beae1 Fix some more print() format errors.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-07-10 13:16:09 +02:00
Wolfgang Denk 53677ef18e Big white-space cleanup.
This commit gets rid of a huge amount of silly white-space issues.
Especially, all sequences of SPACEs followed by TAB characters get
removed (unless they appear in print statements).

Also remove all embedded "vim:" and "vi:" statements which hide
indentation problems.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-21 00:14:08 +02:00
Jean-Christophe PLAGNIOL-VILLARD a9da341df1 example/gitignore: update with all generated examples
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-05-19 00:29:35 +02:00
Daniel Hellstrom c2f02da21a SPARC: Added generic support for SPARC architecture.
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
2008-04-08 07:58:32 +00:00