diff --git a/.gitignore b/.gitignore index 03c5e20..ce2be8a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,67 +3,52 @@ # subdirectories here. Add them in the ".gitignore" file # in that subdirectory instead. # +# NOTE! Please use 'git ls-files -i --exclude-standard' +# command after changing this file, to see if there are +# any tracked files which get ignored after the change. +# # Normal rules # -*~ .* -\#*\# *.o +*.o.* *.a *.s *.ko *.so +*.so.dbg *.mod.c *.i *.lst *.symtypes *.elf +*.patch *.mcp -*.orig *.bct *.dcd *.dcd.S *.bbenv *.bbenv.* +Module.symvers # # Top-level generic files # -tags -TAGS -cross_arch -cross_compile -barebox -barebox.S -barebox.bin -barebox.srec -barebox.netx -barebox.s5p -barebox.spi -barebox.ubl -barebox.zynq -barebox.uimage -barebox.map -barebox.kwb -barebox.kwbuart -barebox.efi -barebox.canon-a1100.bin -barebox-flash-image -System.map -Module.symvers -barebox_default_env* +/tags +/TAGS +/barebox* +/System.map # # git files that we don't want to ignore even it they are dot-files # !.gitignore +!.mailmap # # Generated include files # -include/asm-*/asm-offsets.h include/config -include/linux/compile.h include/generated # Generated files @@ -79,6 +64,17 @@ # cscope files cscope.* +ncscope.* -# patches -*.patch +# gnu global files +GPATH +GRTAGS +GSYMS +GTAGS + +*.orig +*~ +\#*\# + +# Kconfig presets +all.config diff --git a/CREDITS b/CREDITS deleted file mode 100644 index bd5a542..0000000 --- a/CREDITS +++ /dev/null @@ -1,472 +0,0 @@ -# -# Parts of the development effort for this project have been -# sponsored by SIEMENS AG, Austria. Thanks to SIEMENS for -# supporting an Open Source project! -# -# -# This is at least a partial credits-file of individual people that -# have contributed to the barebox project. It is sorted by name and -# formatted to allow easy grepping and beautification by scripts. -# The fields are: name (N), email (E), web-address (W), PGP key ID -# and fingerprint (P), description (D), and snail-mail address (S). -# Thanks, -# -# Wolfgang Denk -#---------- - -N: Dr. Bruno Achauer -E: bruno@exet-ag.de -D: Support for NetBSD (both as host and target system) - -N: Guillaume Alexandre -E: guillaume.alexandre@gespac.ch -D: Add PCIPPC6 configuration - -N: Swen Anderson -E: sand@peppercon.de -D: ERIC Support - -N: Pantelis Antoniou -E: panto@intracom.gr -D: NETVIA & NETPHONE board support, ARTOS support. -D: Support for Silicon Turnkey eXpress XTc - -N: Pierre Aubert -E: -D: Support for RPXClassic board - -N: Yuli Barcohen -E: yuli@arabellasw.com -D: Unified support for Motorola MPC826xADS/MPC8272ADS/PQ2FADS boards. -D: Support for Zephyr Engineering ZPC.1900 board. -D: Support for Interphase iSPAN boards. -D: Support for Analogue&Micro Adder boards. -D: Support for Analogue&Micro Rattler boards. -W: http://www.arabellasw.com - -N: Jerry van Baren -E: -D: BedBug port to 603e core (MPC82xx). Code for enhanced memory test. - -N: Pavel Bartusek -E: -D: Reiserfs support -W: http://www.elinos.com - -N: Andre Beaudin -E: -D: PCMCIA, Ethernet, TFTP - -N: Jon Benediktsson -E: jonb@marel.is -D: Support for Marel V37 board - -N: Raphael Bossek -E: raphael.bossek@solutions4linux.de -D: 8xxrom-0.3.0 - -N: Cliff Brake -E: cliff.brake@gmail.com -D: Port to Vibren PXA255 IDP platform -W: http://www.vibren.com -W: http://bec-systems.com - -N: Rick Bronson -E: rick@efn.org -D: Atmel AT91RM9200DK and NAND support - -N: David Brown -E: DBrown03@harris.com -D: Extensions to 8xxrom-0.3.0 - -N: Oliver Brown -E: obrown@adventnetworks.com -D: Port to the gw8260 board - -N: Curt Brune -E: curt@cucy.com -D: Added support for Samsung S3C4510B CPU (ARM7tdmi based SoC) -D: Added support for ESPD-Inc. EVB4510 Board -W: http://www.cucy.com - -N: Jonathan De Bruyne -E: jonathan.debruyne@siemens.atea.be -D: Port to Siemens IAD210 board - -N: Ken Chou -E: kchou@ieee.org -D: Support for A3000 SBC board - -N: Conn Clark -E: clark@esteem.com -D: ESTEEM192E support - -N: Magnus Damm -E: damm@opensource.se -D: 8xxrom - -N: Richard Danter -E: richard.danter@windriver.com -D: Support for Wind River PPMC 7xx/74xx boards - -N: George G. Davis -E: gdavis@mvista.com -D: Board ports for ADS GraphicsClient+ and Intel Assabet - -N: Arun Dharankar -E: ADharankar@ATTBI.Com -D: threads / scheduler example code - -N: K�ri Dav��sson -E: kd@flaga.is -D: FLAGA DM Support - -N: Wolfgang Denk -E: wd@denx.de -D: barebox initial version, continuing maintenance, ARMBoot merge -W: http://www.denx.de - -N: Dan A. Dickey -E: ddickey@charter.net -D: FADS Support - -N: James F. Dougherty -E: jfd@GigabitNetworks.COM -D: Port to the MOUSSE board - -N: Dave Ellis -E: DGE@sixnetio.com -D: EEPROM Speedup, SXNI855T port - -N: Thomas Elste -E: info@elste.org -D: Port for the ModNET50 Board, NET+50 CPU Port -W: http://www.imms.de - -N: Daniel Engstr�m -E: daniel@omicron.se -D: x86 port, Support for sc520_cdp board - -N: Dr. Wolfgang Grandegger -E: wg@denx.de -D: Support for Interphase 4539 T1/E1/J1 PMC, PN62, CCM, SCM boards -W: www.denx.de - -N: Peter Figuli -E: peposh@etc.sk -D: Support for WEP EP250 (PXA) board - -N: Thomas Frieden -E: ThomasF@hyperion-entertainment.com -D: Support for AmigaOne - -N: Frank Gottschling -E: fgottschling@eltec.de -D: Support for ELTEC MHPC/BAB7xx/ELPPC boards, cfb-console, i8042, SMI LynxEM -W: www.eltec.de - -N: Marius Groeger -E: mgroeger@sysgo.de -D: MBX Support, board specific function interface, EST SBC8260 support; initial support for StrongARM (LART), ARM720TDMI (implementa A7) -W: www.elinos.com - -N: Kirk Haderlie -E: khaderlie@vividimage.com -D: Added TFTP to 8xxrom (-> 0.3.1) - -N: Chris Hallinan -E: clh@net1plus.com -D: DHCP Support - -N: Anne-Sophie Harnois -E: Anne-Sophie.Harnois@nextream.fr -D: Port to Walnut405 board - -N: Andreas Heppel -E: aheppel@sysgo.de -D: CPU Support for MPC 75x; board support for Eltec BAB750 [obsolete!] - -N: August Hoeraendl -E: august.hoerandl@gmx.at -D: Support for the logodl board (PXA2xx) - -N: Josh Huber -E: huber@alum.wpi.edu -D: Port to the Galileo Evaluation Board, and the MPC74xx cpu series. -W: http://www.mclx.com/ - -H: Stuart Hughes -E: stuarth@lineo.com -D: Port to MPC8260ADS board - -H: Rich Ireland -E: r.ireland@computer.org -D: FPGA device configuration driver - -N: Gary Jennejohn -E: garyj@jennejohn.org, gj@denx.de -D: Support for Samsung ARM920T S3C2400X, ARM920T "TRAB" -W: www.denx.de - -N: Murray Jensen -E: Murray.Jensen@csiro.au -D: Initial 8260 support; GDB support -D: Port to Cogent+Hymod boards; Hymod Board Database - -N: Yoo. Jonghoon -E: yooth@ipone.co.kr -D: Added port to the RPXlite board - -N: Mark Jonas -E: mark.jonas@freescale.com -D: Support for Freescale Total5200 platform -W: http://www.mobilegt.com/ - -N: Sam Song -E: samsongshu@yahoo.com.cn -D: Port to the RPXlite_DW board - -N: Brad Kemp -E: Brad.Kemp@seranoa.com -D: Port to Windriver ppmc8260 board - -N: Sangmoon Kim -E: dogoil@etinsys.com -D: Support for debris board -D: Support for KVME080 board - -N: Frederick W. Klatt -E: fred.klatt@windriver.com -D: Support for Wind River SBC8540/SBC8560 boards - -N: Thomas Koeller -E: tkoeller@gmx.net -D: Port to Motorola Sandpoint 3 (MPC8240) - -N: Raghu Krishnaprasad -E: Raghu.Krishnaprasad@fci.com -D: Support for Adder-II MPC852T evaluation board -W: http://www.forcecomputers.com - -N: Bernhard Kuhn -E: bkuhn@metrowerks.com -D Support for Coldfire CPU; Support for Motorola M5272C3 and M5282EVB boards - -N: Prakash Kumar -E: prakash@embedx.com -D Support for Intrinsyc CERF PXA250 board. - -N: Thomas Lange -E: thomas@corelatus.se -D: Support for GTH, GTH2 and dbau1x00 boards; lots of PCMCIA fixes - -N: Marc Leeman -E: marc.leeman@barco.com -D: Support for Barco Streaming Video Card (SVC) and Sample Compress Network (SCN) -W: www.barco.com - -N: The LEOX team -E: team@leox.org -D: Support for LEOX boards, DS164x RTC -W: http://www.leox.org - -N: Leif Lindholm -E: leif.lindholm@i3micro.com -D: Support for AMD dbau1550 board. - -N: Stephan Linz -E: linz@li-pro.net -D: Support for Nios Stratix Development Kit (DK-1S10) -D: Support for SSV ADNP/ESC1 (Nios Cyclone) -W: http://www.li-pro.net - -N: Raymond Lo -E: lo@routefree.com -D: Support for DOS partitions - -N: Dan Malek -E: dan@embeddedalley.com -D: FADSROM, the grandfather of all of this -D: Support for Silicon Turnkey eXpress XTc - -N: Andrea "llandre" Marson -E: andrea.marson@dave-tech.it -D: Port to PPChameleonEVB board -W: www.dave-tech.it - -N: Reinhard Meyer -E: r.meyer@emk-elektronik.de -D: Port to EMK TOP860 Module - -N: Jay Monkman -E: jtm@smoothsmoothie.com -D: EST SBC8260 support - -N: Frank Morauf -E: frank.morauf@salzbrenner.com -D: Support for Embedded Planet RPX Super Board - -N: David M�ller -E: d.mueller@elsoft.ch -D: Support for Samsung ARM920T SMDK2410 eval board - -N: Scott McNutt -E: smcnutt@psyent.com -D: Support for Altera Nios-32 CPU -D: Support for Altera Nios-II CPU -D: Support for Nios Cyclone Development Kit (DK-1C20) -W: http://www.psyent.com - -N: Rolf Offermanns -E: rof@sysgo.de -D: Initial support for SSV-DNP1110, SMC91111 driver -W: www.elinos.com - -N: John Otken -E: jotken@softadvances.com -D: Support for AMCC Luan 440SP board - -N: Tolunay Orkun -E: torkun@nextio.com -D: Support for Cogent CSB272 & CSB472 boards - -N: Keith Outwater -E: keith_outwater@mvis.com -D: Support for generic/custom MPC860T boards (GEN860T, GEN860T_SC) - -N: Frank Panno -E: fpanno@delphintech.com -D: Support for Embedded Planet EP8260 Board - -N: Denis Peter -E: d.peter@mpl.ch -D: Support for 4xx SCSI, floppy, CDROM, CT69000 video, ... -D: Support for PIP405 board -D: Support for MIP405 board - -N: Dave Peverley -E: dpeverley@mpc-data.co.uk -W: http://www.mpc-data.co.uk -D: OMAP730 P2 board support - -N: Bill Pitts -E: wlp@mindspring.com -D: BedBug embedded debugger code - -N: Daniel Poirot -E: dan.poirot@windriver.com -D: Support for the Wind River sbc405, sbc8240 board -W: http://www.windriver.com - -N: Stefan Roese -E: stefan.roese@esd-electronics.com -D: AMCC PPC401/403/405GP Support; Windows environment support - -N: Erwin Rol -E: erwin@muffin.org -D: boot support for RTEMS - -N: Paul Ruhland -E: pruhland@rochester.rr.com -D: Port to Logic Zoom LH7A40x SDK board(s) - -N: Neil Russell -E: caret@c-side.com -D: Author of LiMon-1.4.2, which contributed some ideas - -N: Travis B. Sawyer -E: travis.sawyer@sandburst.com -D: Support for AMCC PPC440GX, XES XPedite1000 440GX PrPMC board. AMCC 440gx Ref Platform (Ocotea) - -N: Paolo Scaffardi -E: arsenio@tin.it -D: FADS823 configuration, MPC823 video support, I2C, wireless keyboard, lots more - -N: Robert Schwebel -E: r.schwebel@pengutronix.de -D: Support for csb226, logodl and innokom boards (PXA2xx) - -N: Aaron Sells -E: sellsa@embeddedplanet.com -D: Support for EP82xxM - -N: Art Shipkowski -E: art@videon-central.com -D: Support for NetSilicon NS7520 - -N: Yasushi Shoji -E: yashi@atmark-techno.com -D: Support for Xilinx MicroBlaze, for Atmark Techno SUZAKU FPGA board - -N: Kurt Stremerch -E: kurt@exys.be -D: Support for Exys XSEngine board - -N: Andrea Scian -E: andrea.scian@dave-tech.it -D: Port to B2 board -W: www.dave-tech.it - -N: Rob Taylor -E: robt@flyingpig.com -D: Port to MBX860T and Sandpoint8240 - -N: Erik Theisen -E: etheisen@mindspring.com -D: MBX8xx and many other patches - -N: Jim Thompson -E: jim@musenki.com -D: Support for MUSENKI board - -N: Rune Torgersen -E: -D: Support for Motorola MPC8266ADS board - -N: Greg Ungerer -E: greg.ungerer@opengear.com -D: Support for ks8695 CPU, and OpenGear cmXXXX boards - -N: David Updegraff -E: dave@cray.com -D: Port to Cray L1 board; DHCP vendor extensions - -N: Christian Vejlbo -E: christian.vejlbo@tellabs.com -D: FADS860T ethernet support - -N: Robert Whaley -E: rwhaley@applieddata.net -D: Port to ARM PXA27x adsvix SBC - -N: Martin Winistoerfer -E: martinwinistoerfer@gmx.ch -D: Port to MPC555/556 microcontrollers and support for cmi board - -N: Ming-Len Wu -E: minglen_wu@techware.com.tw -D: Motorola MX1ADS board support -W: http://www.techware.com.tw/ - -N: Xianghua Xiao -E: x.xiao@motorola.com -D: Support for Motorola 85xx(PowerQUICC III) chip, MPC8540ADS and MPC8560ADS boards. - -N: John Zhan -E: zhanz@sinovee.com -D: Support for SinoVee Microsystems SC8xx SBC - -N: Alex Zuepke -E: azu@sysgo.de -D: Overall improvements on StrongARM, ARM720TDMI; Support for Tuxscreen; initial PCMCIA support for ARM -W: www.elinos.com - -N: James MacAulay -E: james.macaulay@amirix.com -D: Suppport for Amirix AP1000 -W: www.amirix.com - -N: Timur Tabi -E: timur@freescale.com -D: Support for MPC8349E-mITX -W: www.freescale.com diff --git a/MAKEALL b/MAKEALL index 6999d64..909e170 100755 --- a/MAKEALL +++ b/MAKEALL @@ -91,7 +91,6 @@ local log_err="${LOGDIR}/${target}/errors.log" rm -rf "${BUILDDIR}" - mkdir -p "${BUILDDIR}" mkdir -p "${LOGDIR}/${target}" printf "Building ${arch} ${target} \n" >&2 | tee -a "${log_report}" @@ -175,7 +174,7 @@ if [ -d $i ] then - do_build ${arch} + do_build ${arch} "*" build_target=$((build_target + 1)) fi done diff --git a/Makefile b/Makefile index 1bb02ae..9d44e40 100644 --- a/Makefile +++ b/Makefile @@ -488,9 +488,9 @@ $(Q)$(MAKE) $(build)=images $@ ifdef CONFIG_PBL_MULTI_IMAGES -all: $(KBUILD_DTBS) barebox.bin images +all: barebox.bin images else -all: barebox-flash-image $(KBUILD_DTBS) +all: barebox-flash-image endif common-$(CONFIG_PBL_IMAGE) += pbl/ @@ -953,7 +953,7 @@ CLEAN_DIRS += $(MODVERDIR) CLEAN_FILES += barebox System.map include/generated/barebox_default_env.h \ .tmp_version .tmp_barebox* barebox.bin barebox.map barebox.S \ - .tmp_kallsyms* common/barebox_default_env* barebox.ldr \ + .tmp_kallsyms* barebox.ldr \ scripts/bareboxenv-target barebox-flash-image \ barebox.srec barebox.s5p barebox.ubl barebox.zynq \ barebox.uimage barebox.spi barebox.kwb barebox.kwbuart \ diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 193f731..f0133d4 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -13,8 +13,6 @@ LD += -EL endif -comma = , - # This selects which instruction set is used. # Note that GCC does not numerically define an architecture version # macro, but instead defines a whole series of macros which makes diff --git a/arch/arm/cpu/setupc.S b/arch/arm/cpu/setupc.S index 2df2683..c232b08 100644 --- a/arch/arm/cpu/setupc.S +++ b/arch/arm/cpu/setupc.S @@ -40,7 +40,7 @@ /* * void relocate_to_adr(unsigned long targetadr) * - * Copy binary to targetadr, relocate code, clear bss and continue + * Copy binary to targetadr, relocate code and continue * executing at new address. */ .section .text.relocate_to_adr diff --git a/arch/blackfin/boards/ipe337/barebox.lds.S b/arch/blackfin/boards/ipe337/barebox.lds.S index 21a91ee..9bb7cc4 100644 --- a/arch/blackfin/boards/ipe337/barebox.lds.S +++ b/arch/blackfin/boards/ipe337/barebox.lds.S @@ -68,9 +68,9 @@ .barebox_cmd : { BAREBOX_CMDS } ___barebox_cmd_end = .; - __barebox_magicvar_start = .; + ___barebox_magicvar_start = .; .barebox_magicvar : { BAREBOX_MAGICVARS } - __barebox_magicvar_end = .; + ___barebox_magicvar_end = .; ___barebox_initcalls_start = .; .barebox_initcalls : { INITCALLS } diff --git a/arch/blackfin/include/asm/linkage.h b/arch/blackfin/include/asm/linkage.h index 0f54727..f7d6d47 100644 --- a/arch/blackfin/include/asm/linkage.h +++ b/arch/blackfin/include/asm/linkage.h @@ -1,54 +1,13 @@ /* - * barebox - linkage.h + * Copyright 2004-2009 Analog Devices Inc. * - * Copyright (c) 2005 blackfin.uclinux.org - * - * 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. - * + * Licensed under the GPL-2 or later. */ -#ifndef _LINUX_LINKAGE_H -#define _LINUX_LINKAGE_H +#ifndef __ASM_LINKAGE_H +#define __ASM_LINKAGE_H -#ifdef __cplusplus -#define CPP_ASMLINKAGE extern "C" -#else -#define CPP_ASMLINKAGE -#endif - -#define asmlinkage CPP_ASMLINKAGE - -#define SYMBOL_NAME_STR(X) #X -#define SYMBOL_NAME(X) X -#ifdef __STDC__ -#define SYMBOL_NAME_LABEL(X) X##: -#else -#define SYMBOL_NAME_LABEL(X) X: -#endif - -#define __ALIGN .align 4 -#define __ALIGN_STR ".align 4" - -#ifdef __ASSEMBLY__ - -#define ALIGN __ALIGN -#define ALIGN_STR __ALIGN_STR - -#define ENTRY(name) \ - .globl SYMBOL_NAME(name); \ - ALIGN; \ - SYMBOL_NAME_LABEL(name) -#endif +#define __ALIGN .align 4 +#define __ALIGN_STR ".align 4" #endif diff --git a/arch/blackfin/include/asm/system.h b/arch/blackfin/include/asm/system.h index 581fd42..f11dd4e 100644 --- a/arch/blackfin/include/asm/system.h +++ b/arch/blackfin/include/asm/system.h @@ -21,7 +21,7 @@ #ifndef _BLACKFIN_SYSTEM_H #define _BLACKFIN_SYSTEM_H -#include +#include #include #include #include diff --git a/arch/blackfin/lib/flush.S b/arch/blackfin/lib/flush.S index 62aa496..4ee5d87 100644 --- a/arch/blackfin/lib/flush.S +++ b/arch/blackfin/lib/flush.S @@ -8,7 +8,7 @@ */ #define ASSEMBLY -#include +#include #include #include diff --git a/arch/efi/Makefile b/arch/efi/Makefile index 85cb655..b078bd0 100644 --- a/arch/efi/Makefile +++ b/arch/efi/Makefile @@ -1,3 +1,5 @@ +KBUILD_DEFCONFIG := efi_defconfig + CFLAGS += -fpic -fshort-wchar -mno-sse -mno-mmx ifeq ($(CONFIG_X86_32),y) diff --git a/arch/nios2/cpu/.gitignore b/arch/nios2/cpu/.gitignore new file mode 100644 index 0000000..d116578 --- /dev/null +++ b/arch/nios2/cpu/.gitignore @@ -0,0 +1 @@ +barebox.lds diff --git a/arch/ppc/lib/crtsavres.S b/arch/ppc/lib/crtsavres.S index a764ae4..b0fbbfc 100644 --- a/arch/ppc/lib/crtsavres.S +++ b/arch/ppc/lib/crtsavres.S @@ -33,13 +33,11 @@ * the executable file might be covered by the GNU General Public License. */ +#include #include #define N_FUN 36 -#define __stringify_1(x...) #x -#define __stringify(x...) __stringify_1(x) - #define _GLOBAL(n) \ .text; \ .stabs __stringify(n:F-1),N_FUN,0,0,n;\ diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile index ed5d3a3..e3fb039 100644 --- a/arch/sandbox/Makefile +++ b/arch/sandbox/Makefile @@ -1,3 +1,4 @@ +KBUILD_DEFCONFIG := sandbox_defconfig CPPFLAGS += -D__SANDBOX__ -fno-strict-aliasing diff --git a/arch/sandbox/os/Makefile b/arch/sandbox/os/Makefile index 2e65be5..537f848 100644 --- a/arch/sandbox/os/Makefile +++ b/arch/sandbox/os/Makefile @@ -8,6 +8,8 @@ CPPFLAGS = $(patsubst %,-I$(srctree)/%include,$(machdirs)) endif +CPPFLAGS += -DCONFIG_MALLOC_SIZE=$(CONFIG_MALLOC_SIZE) + CFLAGS := -Wall NOSTDINC_FLAGS := diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c index 4123938..0854fb5 100644 --- a/arch/sandbox/os/common.c +++ b/arch/sandbox/os/common.c @@ -285,7 +285,7 @@ { void *ram; int opt, ret, fd; - int malloc_size = 8 * 1024 * 1024; + int malloc_size = CONFIG_MALLOC_SIZE; char str[6]; int fdno = 0, envno = 0, option_index = 0; diff --git a/arch/x86/Makefile b/arch/x86/Makefile index a78fa22..da17d70 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -1,3 +1,5 @@ +KBUILD_DEFCONFIG := generic_defconfig + CPPFLAGS += -D__X86__ -fno-strict-aliasing board-y := x86_generic diff --git a/commands/crc.c b/commands/crc.c index 9b6a3e2..58b750e 100644 --- a/commands/crc.c +++ b/commands/crc.c @@ -46,9 +46,10 @@ #ifdef CONFIG_CMD_CRC_CMP char *vfilename = NULL; #endif + char *crcvarname = NULL, *sizevarname = NULL; int opt, err = 0, filegiven = 0, verify = 0; - while((opt = getopt(argc, argv, "f:F:v:V:")) > 0) { + while((opt = getopt(argc, argv, "f:F:v:V:r:s:")) > 0) { switch(opt) { case 'f': filename = optarg; @@ -60,6 +61,12 @@ vfilename = optarg; break; #endif + case 'r': + crcvarname = optarg; + break; + case 's': + sizevarname = optarg; + break; case 'v': verify = 1; vcrc = simple_strtoul(optarg, NULL, 0); @@ -89,6 +96,18 @@ printf("CRC32 for %s 0x%08lx ... 0x%08lx ==> 0x%08lx", filename, (ulong)start, (ulong)start + total - 1, crc); + if (crcvarname) { + char *crcstr = asprintf("0x%lx", crc); + setenv(crcvarname, crcstr); + kfree(crcstr); + } + + if (sizevarname) { + char *sizestr = asprintf("0x%lx", total); + setenv(sizevarname, sizestr); + kfree(sizestr); + } + #ifdef CONFIG_CMD_CRC_CMP if (vfilename) { size = total; @@ -118,6 +137,8 @@ #endif BAREBOX_CMD_HELP_OPT ("-v CRC", "Verify") BAREBOX_CMD_HELP_OPT ("-V FILE", "Verify with CRC read from FILE") +BAREBOX_CMD_HELP_OPT ("-r ", "Set to the checksum result\n") +BAREBOX_CMD_HELP_OPT ("-s ", "Set to the data size\n") BAREBOX_CMD_HELP_END BAREBOX_CMD_START(crc32) diff --git a/commands/loadenv.c b/commands/loadenv.c index 91ce5e7..8d6be2f 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -109,7 +109,7 @@ BAREBOX_CMD_HELP_START(loadenv) BAREBOX_CMD_HELP_TEXT("Load environment from files in ENVFS (default /dev/env0) in") -BAREBOX_CMD_HELP_TEXT("DIRECTORY (default /env") +BAREBOX_CMD_HELP_TEXT("DIRECTORY (default /env)") BAREBOX_CMD_HELP_TEXT("") BAREBOX_CMD_HELP_TEXT("Options:") BAREBOX_CMD_HELP_OPT("-n", "do not overwrite existing files") @@ -120,7 +120,7 @@ BAREBOX_CMD_START(loadenv) .cmd = do_loadenv, BAREBOX_CMD_DESC("load environment from ENVFS") - BAREBOX_CMD_OPTS("{-nsd] [ENVFS] [DIRECTORY]") + BAREBOX_CMD_OPTS("[-nsd] [ENVFS] [DIRECTORY]") BAREBOX_CMD_GROUP(CMD_GRP_ENV) BAREBOX_CMD_HELP(cmd_loadenv_help) BAREBOX_CMD_END diff --git a/commands/memtest.c b/commands/memtest.c index d384436..9dec0ef 100644 --- a/commands/memtest.c +++ b/commands/memtest.c @@ -60,8 +60,7 @@ */ if (list_empty(&bank->res->children)) { start = PAGE_ALIGN(bank->res->start); - end = PAGE_ALIGN_DOWN(bank->res->end) - 1; - size = end - start + 1; + size = PAGE_ALIGN_DOWN(bank->res->end - start + 1); ret = alloc_memtest_region(list, start, size); if (ret < 0) @@ -89,13 +88,13 @@ * Between used regions. Start from second entry. */ list_for_each_entry_from(r, &bank->res->children, sibling) { - start = PAGE_ALIGN(r_prev->end); - end = PAGE_ALIGN_DOWN(r->start); + start = PAGE_ALIGN(r_prev->end + 1); + end = r->start - 1; r_prev = r; if (start >= end) continue; - size = end - start; + size = PAGE_ALIGN_DOWN(end - start + 1); ret = alloc_memtest_region(list, start, size); if (ret < 0) return ret; @@ -107,9 +106,9 @@ r = list_last_entry(&bank->res->children, struct resource, sibling); start = PAGE_ALIGN(r->end); - end = PAGE_ALIGN_DOWN(bank->res->end) - 1; - size = end - start + 1; - if (start < end) { + end = bank->res->end; + size = PAGE_ALIGN_DOWN(end - start + 1); + if (start < end && start > r->end) { ret = alloc_memtest_region(list, start, size); if (ret < 0) return ret; diff --git a/common/console.c b/common/console.c index c092621..0c32f06 100644 --- a/common/console.c +++ b/common/console.c @@ -194,7 +194,7 @@ console_init_early(); if (newcdev->devname) { - dev->id = DEVICE_ID_SINGLE; + dev->id = newcdev->devid; strcpy(dev->name, newcdev->devname); } else { dev->id = DEVICE_ID_DYNAMIC; diff --git a/defaultenv/.gitignore b/defaultenv/.gitignore new file mode 100644 index 0000000..40e90d7 --- /dev/null +++ b/defaultenv/.gitignore @@ -0,0 +1 @@ +barebox_default_env* diff --git a/defaultenv/Makefile b/defaultenv/Makefile index fc679eb..33e0ece 100644 --- a/defaultenv/Makefile +++ b/defaultenv/Makefile @@ -3,7 +3,7 @@ bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU) += defaultenv-2-dfu bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-1 obj-$(CONFIG_DEFAULT_ENVIRONMENT) += defaultenv.o -extra-y += barebox_default_env barebox_default_env.h barebox_default_env$(DEFAULT_COMPRESSION_SUFFIX) +extra-y += barebox_default_env barebox_default_env.h barebox_default_env$(DEFAULT_COMPRESSION_SUFFIX) barebox_zero_env $(obj)/defaultenv.o: $(obj)/barebox_default_env.h @@ -22,3 +22,9 @@ $(obj)/barebox_default_env.h: $(obj)/barebox_default_env$(DEFAULT_COMPRESSION_SUFFIX) FORCE $(call if_changed,env_h) + +quiet_cmd_env_zero = ENVZ $@ +cmd_env_zero = ($(objtree)/scripts/bareboxenv -z $(CONFIG_DEFAULT_ENVIRONMENT_PATH) $@) + +$(obj)/barebox_zero_env: FORCE + $(call cmd,env_zero) diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c index 239cd37..23bdc1f 100644 --- a/drivers/mci/imx-esdhc.c +++ b/drivers/mci/imx-esdhc.c @@ -471,6 +471,9 @@ esdhc_write32(regs + SDHCI_CLOCK_CONTROL__TIMEOUT_CONTROL__SOFTWARE_RESET, SYSCTL_HCKEN | SYSCTL_IPGEN); + /* RSTA doesn't reset MMC_BOOT register, so manually reset it */ + esdhc_write32(regs + SDHCI_MMC_BOOT, 0); + /* Set the initial clock speed */ set_sysctl(mci, 400000); diff --git a/drivers/mci/sdhci.h b/drivers/mci/sdhci.h index b678184..82a692e 100644 --- a/drivers/mci/sdhci.h +++ b/drivers/mci/sdhci.h @@ -18,6 +18,7 @@ #define SDHCI_SIGNAL_ENABLE 0x38 #define SDHCI_ACMD12_ERR__HOST_CONTROL2 0x3C #define SDHCI_CAPABILITIES 0x40 +#define SDHCI_MMC_BOOT 0xC4 #define COMMAND_CMD(x) ((x & 0x3f) << 24) #define COMMAND_CMDTYP_NORMAL 0x0 diff --git a/drivers/mtd/nand/nand_imx_bbm.c b/drivers/mtd/nand/nand_imx_bbm.c index f419759..5caa0a2 100644 --- a/drivers/mtd/nand/nand_imx_bbm.c +++ b/drivers/mtd/nand/nand_imx_bbm.c @@ -43,7 +43,7 @@ * To preserve the factory bad block information we take the following * strategy: * - * - If the NAND driver detects that no flasg BBT is present on 2k NAND + * - If the NAND driver detects that no flash BBT is present on 2k NAND * chips it will not create one because it would do so based on the wrong * BBM position * - This command is used to create a flash BBT then. diff --git a/drivers/pinctrl/pinctrl.c b/drivers/pinctrl/pinctrl.c index d6479b9..10ce186 100644 --- a/drivers/pinctrl/pinctrl.c +++ b/drivers/pinctrl/pinctrl.c @@ -62,9 +62,6 @@ struct device_node *np_config; const char *statename; - if (!IS_ENABLED(CONFIG_PINCTRL)) - return -ENOSYS; - if (!of_find_property(np, "pinctrl-0", NULL)) return 0; diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c index 21189cb..cd954c2 100644 --- a/drivers/serial/serial_imx.c +++ b/drivers/serial/serial_imx.c @@ -340,8 +340,10 @@ cdev->linux_console_name = "ttymxc"; if (dev->device_node) { devname = of_alias_get(dev->device_node); - if (devname) + if (devname) { cdev->devname = xstrdup(devname); + cdev->devid = DEVICE_ID_SINGLE; + } } imx_serial_init_port(cdev); diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d42b47c..dd3c10e 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -122,7 +122,7 @@ for (tries = 0; tries < MAX_TRIES; tries++) { usb_set_port_feature(dev, port + 1, USB_PORT_FEAT_RESET); - wait_ms(200); + mdelay(200); if (usb_get_port_status(dev, port + 1, &portsts) < 0) { dev_dbg(&dev->dev, "get_port_status failed status %lX\n", @@ -149,7 +149,7 @@ if (portstatus & USB_PORT_STAT_ENABLE) break; - wait_ms(200); + mdelay(200); } if (tries == MAX_TRIES) { @@ -196,7 +196,7 @@ if (dev->children[port] && !(portstatus & USB_PORT_STAT_ENABLE)) usb_remove_device(dev->children[port]); - wait_ms(200); + mdelay(200); /* Reset the port */ if (hub_port_reset(dev, port, &portstatus) < 0) { @@ -204,7 +204,7 @@ return; } - wait_ms(200); + mdelay(200); /* Allocate a new device struct for it */ usb = usb_alloc_new_device(); diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 3f3d595..d1c3e03 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -372,7 +372,7 @@ goto err_out; } - wait_ms(10); /* Let the SET_ADDRESS settle */ + mdelay(10); /* Let the SET_ADDRESS settle */ tmp = sizeof(*dev->descriptor); diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index 8c58746..1e5e809 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c @@ -530,6 +530,7 @@ cdev->flush = serial_flush; cdev->setbrg = serial_setbaudrate; cdev->devname = "usbserial"; + cdev->devid = DEVICE_ID_SINGLE; status = console_register(cdev); if (status) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 1335616..7b91327 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -646,7 +646,7 @@ * root */ ehci_powerup_fixup(ehci); - wait_ms(50); + mdelay(50); ehci->portreset |= 1 << le16_to_cpu(req->index); /* terminate the reset */ ehci_writel(status_reg, reg & ~EHCI_PS_PR); @@ -709,7 +709,7 @@ goto unknown; } - wait_ms(1); + mdelay(1); len = min3(srclen, (int)le16_to_cpu(req->length), length); if (srcptr != NULL && len > 0) memcpy(buffer, srcptr, len); @@ -804,7 +804,7 @@ ehci_writel(&ehci->hcor->or_configflag, cmd); /* unblock posted write */ cmd = ehci_readl(&ehci->hcor->or_usbcmd); - wait_ms(5); + mdelay(5); ehci->rootdev = 0; diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index 1cceecc..ac1fe79 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c @@ -133,7 +133,7 @@ /* DATA STAGE */ /* send/receive data payload, if there is any */ - wait_ms(1); + mdelay(1); data_actlen = 0; if (srb->datalen) { @@ -229,17 +229,17 @@ US_DEBUGP("Soft reset stalled: %d\n", result); return result; } - wait_ms(150); + mdelay(150); /* clear the bulk endpoints halt */ US_DEBUGP("Soft reset: clearing %s endpoint halt\n", "bulk-in"); pipe = usb_rcvbulkpipe(us->pusb_dev, us->recv_bulk_ep); result = usb_clear_halt(us->pusb_dev, pipe); - wait_ms(150); + mdelay(150); US_DEBUGP("Soft reset: clearing %s endpoint halt\n", "bulk-out"); pipe = usb_sndbulkpipe(us->pusb_dev, us->send_bulk_ep); result2 = usb_clear_halt(us->pusb_dev, pipe); - wait_ms(150); + mdelay(150); if (result >= 0) result = result2; diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 5149761..9d1ffa3 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -101,7 +101,7 @@ if (result == USB_STOR_TRANSPORT_GOOD) return 0; usb_stor_request_sense(srb, us); - wait_ms(100); + mdelay(100); } while (retries--); return -1; diff --git a/include/console.h b/include/console.h index beafb4d..72b4a44 100644 --- a/include/console.h +++ b/include/console.h @@ -47,6 +47,7 @@ int (*set_active)(struct console_device *cdev, unsigned active); char *devname; + int devid; struct list_head list; diff --git a/include/debug_ll.h b/include/debug_ll.h index 288aa25..b0eb7cd 100644 --- a/include/debug_ll.h +++ b/include/debug_ll.h @@ -33,7 +33,7 @@ #if defined (CONFIG_DEBUG_LL) -static inline void putc_ll(unsigned char value) +static inline void putc_ll(char value) { PUTC_LL(value); } @@ -67,7 +67,7 @@ #else -static inline void putc_ll(unsigned char value) +static inline void putc_ll(char value) { } diff --git a/include/usb/usb.h b/include/usb/usb.h index f02f1fb..991f3d7 100644 --- a/include/usb/usb.h +++ b/include/usb/usb.h @@ -171,10 +171,6 @@ void *buffer, int transfer_len, int interval); void usb_disable_asynch(int disable); int usb_maxpacket(struct usb_device *dev, unsigned long pipe); -static inline void wait_ms(unsigned long ms) -{ - mdelay(ms); -}; int usb_get_configuration_no(struct usb_device *dev, unsigned char *buffer, int cfgno); int usb_get_report(struct usb_device *dev, int ifnum, unsigned char type, diff --git a/lib/parameter.c b/lib/parameter.c index d337ef3..865ad9f 100644 --- a/lib/parameter.c +++ b/lib/parameter.c @@ -114,7 +114,7 @@ return 0; } p->value = strdup(val); - return 0; + return p->value ? 0 : -ENOMEM; } static const char *param_get_generic(struct device_d *dev, struct param_d *p) @@ -130,6 +130,10 @@ if (get_param_by_name(dev, name)) return -EEXIST; + param->name = strdup(name); + if (!param->name) + return -ENOMEM; + if (set) param->set = set; else @@ -139,7 +143,6 @@ else param->get = param_get_generic; - param->name = strdup(name); param->flags = flags; param->dev = dev; list_add_tail(¶m->list, &dev->parameters); diff --git a/net/netconsole.c b/net/netconsole.c index 99b9984..0ee6a76 100644 --- a/net/netconsole.c +++ b/net/netconsole.c @@ -154,6 +154,7 @@ cdev->putc = nc_putc; cdev->getc = nc_getc; cdev->devname = "netconsole"; + cdev->devid = DEVICE_ID_SINGLE; cdev->set_active = nc_set_active; g_priv = priv; diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 419436d..a40d32c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -328,7 +328,7 @@ my ($root) = @_; my @tree_check = ( - "arch", "commands", "common", "COPYING", "CREDITS", "defaultenv", + "arch", "commands", "common", "COPYING", "defaultenv", "Documentation", "drivers", "fs", "include", "lib", "MAKEALL", "Makefile", "net", "README", "scripts", "TODO" );