From 6570288f2d97d3a3dceb3e631b4e4f4305352dc8 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 13 Jan 2015 14:27:07 +0900 Subject: [PATCH 01/36] Remove the CREDITS file This file, which originates in U-Boot, has not been maintained for a long time. It was removed from U-Boot by commit 548b310c68ac. Let's remove it from barebox, too. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- CREDITS | 472 -------------------------------------------------------- 1 file changed, 472 deletions(-) delete mode 100644 CREDITS diff --git a/CREDITS b/CREDITS deleted file mode 100644 index bd5a5424d..000000000 --- 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 From a1a582f4e0d51311b3a2fac9b7221be4b20fb9de Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Tue, 13 Jan 2015 07:11:49 +0100 Subject: [PATCH 02/36] console: allow to specify the device id so we can use dynamic number id with specific devname Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- common/console.c | 2 +- drivers/serial/serial_imx.c | 4 +++- drivers/usb/gadget/u_serial.c | 1 + include/console.h | 1 + net/netconsole.c | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/common/console.c b/common/console.c index c092621aa..0c32f06b9 100644 --- a/common/console.c +++ b/common/console.c @@ -194,7 +194,7 @@ int console_register(struct console_device *newcdev) 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/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c index 21189cbbf..cd954c282 100644 --- a/drivers/serial/serial_imx.c +++ b/drivers/serial/serial_imx.c @@ -340,8 +340,10 @@ static int imx_serial_probe(struct device_d *dev) 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/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index 8c58746cb..1e5e8093c 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c @@ -530,6 +530,7 @@ int gserial_connect(struct gserial *gser, u8 port_num) 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/include/console.h b/include/console.h index beafb4d77..72b4a440e 100644 --- a/include/console.h +++ b/include/console.h @@ -47,6 +47,7 @@ struct console_device { int (*set_active)(struct console_device *cdev, unsigned active); char *devname; + int devid; struct list_head list; diff --git a/net/netconsole.c b/net/netconsole.c index 99b998408..0ee6a7655 100644 --- a/net/netconsole.c +++ b/net/netconsole.c @@ -154,6 +154,7 @@ static int netconsole_init(void) 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; From 2ead709f52933ab7810f2172bdce32500dc0988d Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 13 Jan 2015 16:02:30 +0900 Subject: [PATCH 03/36] powerpc: include to avoid dupulicated defines Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- arch/ppc/lib/crtsavres.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/ppc/lib/crtsavres.S b/arch/ppc/lib/crtsavres.S index a764ae4ce..b0fbbfc99 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;\ From 0c6377c48ff9eb3127f5f453efe8127b158f40c4 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 13 Jan 2015 15:53:18 +0900 Subject: [PATCH 04/36] kbuild: arm: Do not define "comma" twice The definition of "comma" exists in scripts/Kbuild.include. We should not double it. Note: This was already fixed in Linux Kernel too. See commit 226422d08c33 of Linux Kernel. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- arch/arm/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 193f731e9..f0133d416 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -13,8 +13,6 @@ AS += -EL 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 From f822e7dcb925a95b33d3b619f03df54d79924081 Mon Sep 17 00:00:00 2001 From: Jike Song Date: Tue, 13 Jan 2015 16:22:39 +0900 Subject: [PATCH 05/36] .gitignore: match ncscope.out Sometimes I got this: $ git-status {snip} # On branch master # Untracked files: # (use "git add ..." to include in what will be committed) # # ncscope.out nothing added to commit but untracked files present (use "git add" to track) Fix it. Signed-off-by: Jike Song Signed-off-by: Sam Ravnborg [ imported from Linux Kernel, commit 9723c046bd59 ] Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 03c5e2018..b6d1b6708 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,7 @@ series # cscope files cscope.* +ncscope.* # patches *.patch From d9829f8f043994419df314f46a24c6669063f517 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 13 Jan 2015 16:22:40 +0900 Subject: [PATCH 06/36] gitignore: Add GNU GLOBAL files to top .gitignore Ignore GPATH, GRTAGS, GSYMS, and GTAGS generated by GNU GLOBAL. Signed-off-by: Jani Nikula Signed-off-by: Sam Ravnborg [ imported from Linux Kernel, commit f2ac5e78928b ] Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index b6d1b6708..fe29da502 100644 --- a/.gitignore +++ b/.gitignore @@ -81,5 +81,11 @@ series cscope.* ncscope.* +# gnu global files +GPATH +GRTAGS +GSYMS +GTAGS + # patches *.patch From 6a53d81243bbe144f27d42bb5ef11ecb12c5d2cb Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Tue, 13 Jan 2015 16:22:41 +0900 Subject: [PATCH 07/36] gitignore: add all.config This is used by kbuild to load preset Kconfig options. We need to ignore it, otherwise git clean kills it. Signed-off-by: Borislav Petkov Cc: Michal Marek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds [ imported from Linux Kernel, commit 25fba9bebeb7 ] Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index fe29da502..029520c62 100644 --- a/.gitignore +++ b/.gitignore @@ -89,3 +89,6 @@ GTAGS # patches *.patch + +# Kconfig presets +all.config From f749157dda79780a2df4aff4d8417445816d040e Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 13 Jan 2015 16:22:42 +0900 Subject: [PATCH 08/36] gitignore: do not ignore .mailmap Commit eb4b20d20631 (add .mailmap for proper git-shortlog output) introduced .mailmap file. It should not be ignored. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 029520c62..34e74a1f3 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ barebox_default_env* # git files that we don't want to ignore even it they are dot-files # !.gitignore +!.mailmap # # Generated include files From 6388cfd4d539bce0b62c178cacaa3ac50cf37aa5 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 13 Jan 2015 16:22:43 +0900 Subject: [PATCH 09/36] gitignore: remove bogus ignore patterns asm-offsets.h and compile.h are generated under include/generated/ directory now. The directory include/generated/ is already ignored. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 34e74a1f3..74d24ea27 100644 --- a/.gitignore +++ b/.gitignore @@ -62,9 +62,7 @@ barebox_default_env* # # Generated include files # -include/asm-*/asm-offsets.h include/config -include/linux/compile.h include/generated # Generated files From 78582e53dcb2c6f42282ddf27b66e5bc5b7202cc Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 13 Jan 2015 17:14:36 +0900 Subject: [PATCH 10/36] kbuild: add KBUILD_DEFCONFIG This allows "make ARCH=... defconfig". Fox example, you can type "make defconfig" instead of "make sandbox_defconfig". Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- arch/efi/Makefile | 2 ++ arch/sandbox/Makefile | 1 + arch/x86/Makefile | 2 ++ 3 files changed, 5 insertions(+) diff --git a/arch/efi/Makefile b/arch/efi/Makefile index 85cb65561..b078bd0e3 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/sandbox/Makefile b/arch/sandbox/Makefile index ed5d3a3da..e3fb03955 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/x86/Makefile b/arch/x86/Makefile index a78fa22ac..da17d70bd 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 From 58475f4599ebd556d47d7f632a78f666d2dfcfd4 Mon Sep 17 00:00:00 2001 From: Andrey Panov Date: Sat, 17 Jan 2015 15:54:35 +0300 Subject: [PATCH 11/36] MMC: IMX: Reset MMC_BOOT register after controller reset. This helps with EMMC detection when booting from EMMC directly. Taken from u-boot. Signed-off-by: Andrey Panov Signed-off-by: Sascha Hauer --- drivers/mci/imx-esdhc.c | 3 +++ drivers/mci/sdhci.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c index 239cd375f..23bdc1fb1 100644 --- a/drivers/mci/imx-esdhc.c +++ b/drivers/mci/imx-esdhc.c @@ -471,6 +471,9 @@ static int esdhc_init(struct mci_host *mci, struct device_d *dev) 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 b67818485..82a692e73 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 From ccc0a2f03aeb79d866e2c480d0ae9f30e58099cb Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 13 Jan 2015 18:25:34 +0900 Subject: [PATCH 12/36] gitignore: remove obsolete link method for arch specification The cross_arch and cross_compile links method is obsolete and not available any more, so we remove it from the .gitignore. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 74d24ea27..0456bfd13 100644 --- a/.gitignore +++ b/.gitignore @@ -31,8 +31,6 @@ # tags TAGS -cross_arch -cross_compile barebox barebox.S barebox.bin From ad3c55fbf27a134dc678a9c40922a04d1c697064 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Mon, 19 Jan 2015 23:56:08 +0300 Subject: [PATCH 13/36] scripts/checkpatch.pl: don't search for CREDITS when checking top_of_kernel_tree() The CREDITS file is removed in the commit commit 6570288f2d97d3a3dceb3e631b4e4f4305352dc8 Author: Masahiro Yamada Date: Tue Jan 13 14:27:07 2015 +0900 Remove the CREDITS file But checkpatch.pl still trying to check it presence. There is not such CREDITS file and checkpatch.pl exits with 'Must be run from the top-level dir. of a kernel tree' message. Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 419436ded..a40d32cba 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -328,7 +328,7 @@ sub top_of_kernel_tree { 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" ); From f8ba8d687de8e7de0e0c1997dd4357b246ab9e47 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Wed, 21 Jan 2015 04:02:39 +0400 Subject: [PATCH 14/36] sandbox: get malloc_size from .config Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- arch/sandbox/os/Makefile | 2 ++ arch/sandbox/os/common.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/sandbox/os/Makefile b/arch/sandbox/os/Makefile index 2e65be5ee..537f848e0 100644 --- a/arch/sandbox/os/Makefile +++ b/arch/sandbox/os/Makefile @@ -8,6 +8,8 @@ else 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 412393811..0854fb5d8 100644 --- a/arch/sandbox/os/common.c +++ b/arch/sandbox/os/common.c @@ -285,7 +285,7 @@ int main(int argc, char *argv[]) { 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; From ec258b8bd09a2d8bc4eaff97030aa5ba1c3c3bee Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 21 Jan 2015 13:36:08 +0900 Subject: [PATCH 15/36] debug_ll: change the argument type of putc_ll() Most of the implementations of PUTC_LL() takes "char" (some take "int"), not "unsigned char". Moreover, puts_ll() takes an argument with "const char *" type. Let's drop "unsigned" from the prototype of putc_ll(). Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- include/debug_ll.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/debug_ll.h b/include/debug_ll.h index 288aa256e..b0eb7cd7d 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 @@ static inline void puts_ll(const char * str) #else -static inline void putc_ll(unsigned char value) +static inline void putc_ll(char value) { } From 33ddaad19a253468ca5c67782b8d26bb9aadba14 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 26 Jan 2015 09:59:32 +0100 Subject: [PATCH 16/36] memtest: Fix SDRAM size calculations Calculating the size and end of the test region as end = PAGE_ALIGN_DOWN(bank->res->end) - 1; size = end - start + 1; is wrong. For an example resource of start = 0x80000000, end = 0x8fffffff end results in: end = PAGE_ALIGN_DOWN(0x8fffffff) - 1 = 0x8fffefff instead of 0x8fffffff. The size is then calculated to size = end - start + 1 = 0x8fffefff - 0x80000000 + 1 = 0x0ffff000 instead of 0x10000000 The correct way to do this is to calculate the real size and apply a PAGE_ALIGN_DOWN afterwards: size = PAGE_ALIGN_DOWN(bank->res->end - start + 1) = 0x10000000 Fix this in three different places. Signed-off-by: Sascha Hauer --- commands/memtest.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/commands/memtest.c b/commands/memtest.c index d384436af..379d82eab 100644 --- a/commands/memtest.c +++ b/commands/memtest.c @@ -60,8 +60,7 @@ static int request_memtest_regions(struct list_head *list) */ 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 @@ static int request_memtest_regions(struct list_head *list) * 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,8 +106,8 @@ static int request_memtest_regions(struct list_head *list) 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; + end = bank->res->end; + size = PAGE_ALIGN_DOWN(end - start + 1); if (start < end) { ret = alloc_memtest_region(list, start, size); if (ret < 0) From 866516511e274b9776f59c5b59ce46c20dfc10af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 26 Jan 2015 17:45:48 +0100 Subject: [PATCH 17/36] trivial: s/flasg/flash/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer --- drivers/mtd/nand/nand_imx_bbm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/nand_imx_bbm.c b/drivers/mtd/nand/nand_imx_bbm.c index f419759b1..5caa0a26c 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. From 0d8ef327bbb5e3d6e19f9753e663163145e9d1b1 Mon Sep 17 00:00:00 2001 From: Dmitry Lavnikevich Date: Fri, 23 Jan 2015 14:41:41 +0300 Subject: [PATCH 18/36] memtest: fix 4GB overflow fail Add condition for checking size_t overflow. This fixes memtest fail > Memtest failed. Error: -22 which appears when 4GB RAM is present. Was tested on phyFLEX-i.MX6 modules with 4GB and 1GB RAM. Signed-off-by: Dmitry Lavnikevich Signed-off-by: Sascha Hauer --- commands/memtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/memtest.c b/commands/memtest.c index 379d82eab..9dec0efcb 100644 --- a/commands/memtest.c +++ b/commands/memtest.c @@ -108,7 +108,7 @@ static int request_memtest_regions(struct list_head *list) start = PAGE_ALIGN(r->end); end = bank->res->end; size = PAGE_ALIGN_DOWN(end - start + 1); - if (start < end) { + if (start < end && start > r->end) { ret = alloc_memtest_region(list, start, size); if (ret < 0) return ret; From f7ee0beb26d005b22fcc2b3cd4ed075c1c5e1bf5 Mon Sep 17 00:00:00 2001 From: Wjatscheslaw Stoljarski Date: Tue, 27 Jan 2015 19:00:06 +0100 Subject: [PATCH 19/36] loadenv: fix typo in help text Signed-off-by: Wjatscheslaw Stoljarski Signed-off-by: Sascha Hauer --- commands/loadenv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/loadenv.c b/commands/loadenv.c index 91ce5e707..8d6be2fa8 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -109,7 +109,7 @@ static int do_loadenv(int argc, char *argv[]) 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_HELP_END 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 From 5dc01bc9421afa5ec52dcd7cb81f0c28ce02fdb5 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 28 Jan 2015 18:37:08 +0900 Subject: [PATCH 20/36] ARM: fix a wrong comment about relocate_to_adr The relocated_to_adr does not clear the .bss section. It is done by the setup_c routine. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- arch/arm/cpu/setupc.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/setupc.S b/arch/arm/cpu/setupc.S index 2df268312..c232b08d3 100644 --- a/arch/arm/cpu/setupc.S +++ b/arch/arm/cpu/setupc.S @@ -40,7 +40,7 @@ ENDPROC(setup_c) /* * 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 From 262eef7c6a8132c29649e340940eb19e0e86eb65 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 11:05:25 +0900 Subject: [PATCH 21/36] usb: abolish wait_ms() function This function is only used in drivers/usb/*. It is equivalent to mdelay(). Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- drivers/usb/core/hub.c | 8 ++++---- drivers/usb/core/usb.c | 2 +- drivers/usb/host/ehci-hcd.c | 6 +++--- drivers/usb/storage/transport.c | 8 ++++---- drivers/usb/storage/usb.c | 2 +- include/usb/usb.h | 4 ---- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d42b47cbe..dd3c10e82 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -122,7 +122,7 @@ int hub_port_reset(struct usb_device *dev, int port, 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 @@ int hub_port_reset(struct usb_device *dev, int port, if (portstatus & USB_PORT_STAT_ENABLE) break; - wait_ms(200); + mdelay(200); } if (tries == MAX_TRIES) { @@ -196,7 +196,7 @@ static void usb_hub_port_connect_change(struct usb_device *dev, int port) 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 @@ static void usb_hub_port_connect_change(struct usb_device *dev, int port) 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 3f3d59577..d1c3e0394 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -372,7 +372,7 @@ int usb_new_device(struct usb_device *dev) 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/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 133561659..7b913270b 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -646,7 +646,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, * 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 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, 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 @@ static int ehci_init(struct usb_host *host) 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 1cceeccf8..ac1fe7941 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c @@ -133,7 +133,7 @@ int usb_stor_Bulk_transport(ccb *srb, struct us_data *us) /* 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 @@ int usb_stor_Bulk_reset(struct us_data *us) 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 5149761a8..9d1ffa307 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -101,7 +101,7 @@ static int usb_stor_test_unit_ready(ccb *srb, struct us_data *us) 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/usb/usb.h b/include/usb/usb.h index f02f1fbb5..991f3d7dd 100644 --- a/include/usb/usb.h +++ b/include/usb/usb.h @@ -171,10 +171,6 @@ int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe, 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, From 056e2372a3987a5d217fbeeb41f3041d4ceef309 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 11:27:52 +0900 Subject: [PATCH 22/36] gitignore: simplify .gitignore file with pattern "/barebox*" There is no source file prefixed "barebox" at the top directory. Generated files there can be simply ignored with "/barebox*" pattern. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- .gitignore | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 0456bfd13..a71d81480 100644 --- a/.gitignore +++ b/.gitignore @@ -31,22 +31,7 @@ # tags TAGS -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 +/barebox* System.map Module.symvers barebox_default_env* From 4aa6819ecb8914b0dfec03a7bb79746e43806f96 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 11:27:53 +0900 Subject: [PATCH 23/36] gitignore: move "barebox_default_env*" to subdirectory "barebox_default_env*" is not "Top-level generic files" because they are generated in the defaultenv/ directory since commit 7fa10256c3f4 (defaultenv: Allow multiple defaultenvironment overlays). The comment block of the top-level .gitignore says as follows: # NOTE! Don't add files that are generated in specific # subdirectories here. Add them in the ".gitignore" file # in that subdirectory instead. Let's follow this rule. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- .gitignore | 1 - defaultenv/.gitignore | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 defaultenv/.gitignore diff --git a/.gitignore b/.gitignore index a71d81480..4f8769ae2 100644 --- a/.gitignore +++ b/.gitignore @@ -34,7 +34,6 @@ TAGS /barebox* System.map Module.symvers -barebox_default_env* # # git files that we don't want to ignore even it they are dot-files diff --git a/defaultenv/.gitignore b/defaultenv/.gitignore new file mode 100644 index 000000000..40e90d7f5 --- /dev/null +++ b/defaultenv/.gitignore @@ -0,0 +1 @@ +barebox_default_env* From 97462a77fd2695f5de10a23bdae2f1d395985b58 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 11:27:54 +0900 Subject: [PATCH 24/36] gitignore: sync with Linux's .gitignore The top .gitignore is getting close to Linux's one. I am inclined to sync it more. - Add a missing comment block - Add missing patterns that have no impact (*.o.*, *.so.dbg) - Add prefix "/" to top-level generic files - Arrange the order for easier diff Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- .gitignore | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 4f8769ae2..ce2be8ac0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,37 +3,41 @@ # 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 +/tags +/TAGS /barebox* -System.map -Module.symvers +/System.map # # git files that we don't want to ignore even it they are dot-files @@ -68,8 +72,9 @@ GRTAGS GSYMS GTAGS -# patches -*.patch +*.orig +*~ +\#*\# # Kconfig presets all.config From 130f4da23291293deee59f68688c84d93fc6a87e Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 11:27:56 +0900 Subject: [PATCH 25/36] kbuild: drop bogus "common/barebox_default_env*" from CLEAN_FILES Since commit 7fa10256c3f4 (defaultenv: Allow multiple defaultenvironment overlays), barebox_default_env* is created in the defaultenv/ directory. They are cleaned up when "make clean" descends into the defaultenv/ directory. We can simply delete "common/barebox_default_env*" from the top Makefile. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 90a7eeee6..401c40952 100644 --- a/Makefile +++ b/Makefile @@ -953,7 +953,7 @@ endif # CONFIG_MODULES 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 \ From 7f7cdb3466d216558fdff3789e27baac6ad3b53c Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 11:31:17 +0900 Subject: [PATCH 26/36] kbuild: drop $(KBUILD_DTBS) from the all target $(KBUILD_DTBS) is not set anywhere. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 401c40952..2c5920404 100644 --- a/Makefile +++ b/Makefile @@ -488,9 +488,9 @@ images/%.s: barebox.bin FORCE $(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/ From a1b347f24cf61036878111bc31cfdffbad393661 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 11:35:19 +0900 Subject: [PATCH 27/36] blackfin: consolidate arch/blackfin/include/asm/linkage.h Since include/linux/linkage.h includes , the basic coding style we should follow is: - should contain default macro defines - can define arch-specific macros and override the default ones in The arch/blackfin/include/asm/linkage.h has redundant defines that are already defined in . Replace it with the one imported from Linux 3.19-rc6. Generally, should not be included directly. Fix two files to include instead. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- arch/blackfin/include/asm/linkage.h | 53 ++++------------------------- arch/blackfin/include/asm/system.h | 2 +- arch/blackfin/lib/flush.S | 2 +- 3 files changed, 8 insertions(+), 49 deletions(-) diff --git a/arch/blackfin/include/asm/linkage.h b/arch/blackfin/include/asm/linkage.h index 0f547271f..f7d6d47a0 100644 --- a/arch/blackfin/include/asm/linkage.h +++ b/arch/blackfin/include/asm/linkage.h @@ -1,54 +1,13 @@ /* - * barebox - linkage.h - * - * 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. + * Copyright 2004-2009 Analog Devices Inc. * + * 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 581fd4239..f11dd4ebf 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 62aa49698..4ee5d870a 100644 --- a/arch/blackfin/lib/flush.S +++ b/arch/blackfin/lib/flush.S @@ -8,7 +8,7 @@ */ #define ASSEMBLY -#include +#include #include #include From 31cbf0880d958cae5c70d9cc7027b8a2b5204379 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 11:42:13 +0900 Subject: [PATCH 28/36] param: add error check to dev_param_set_generic() The function dev_param_set_generic() may fail because of out of memory. If so, return -ENOMEM. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- lib/parameter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parameter.c b/lib/parameter.c index d337ef37c..71262c48f 100644 --- a/lib/parameter.c +++ b/lib/parameter.c @@ -114,7 +114,7 @@ int dev_param_set_generic(struct device_d *dev, struct param_d *p, 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) From 5020f86af9d8e76a394a62d9d34b137e56e5df3d Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 11:51:12 +0900 Subject: [PATCH 29/36] blackfin: fix undefined reference with CONFIG_CMD_MAGICVAR For Blackfin, C symbols are prefixed with '_'. If CONFIG_CMD_MAGICVAR is enabled for Blackfin, the following error occurs: commands/built-in.o: In function `do_magicvar': commands/magicvar.c:(.text+0x3326): undefined reference to `__barebox_magicvar_start' commands/magicvar.c:(.text+0x332a): undefined reference to `__barebox_magicvar_end' commands/magicvar.c:(.text+0x332e): undefined reference to `__barebox_magicvar_start' commands/magicvar.c:(.text+0x3332): undefined reference to `__barebox_magicvar_end' make: *** [barebox] Error 1 Add '_' to __barebox_magicvar_start and __barebox_magicvar_end, like the other symbols in this linker script. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- arch/blackfin/boards/ipe337/barebox.lds.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/blackfin/boards/ipe337/barebox.lds.S b/arch/blackfin/boards/ipe337/barebox.lds.S index 21a91eeb0..9bb7cc495 100644 --- a/arch/blackfin/boards/ipe337/barebox.lds.S +++ b/arch/blackfin/boards/ipe337/barebox.lds.S @@ -68,9 +68,9 @@ SECTIONS .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 } From 27a20a6011f1b6e4f8f07b1ec7296c16bc7f5054 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 12:09:51 +0900 Subject: [PATCH 30/36] MAKEALL: fix do_build_all Currently, do_build_all() does nothing. Since commit 195310fd7b48 (MAKEALL: add regex support), do_build() takes two arguments. To fix do_build_all(), it must pass "*" as the second argument of do_build(). Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- MAKEALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAKEALL b/MAKEALL index bf9131abb..cde59e40e 100755 --- a/MAKEALL +++ b/MAKEALL @@ -172,7 +172,7 @@ do_build_all() { if [ -d $i ] then - do_build ${arch} + do_build ${arch} "*" build_target=$((build_target + 1)) fi done From 2f025305aeb32c1a6c0b5d25bf1f655a931a8fad Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 12:15:46 +0900 Subject: [PATCH 31/36] MAKEALL: do not create build directory explicitly Since commit e7554c0cb245 (kbuild: create a build directory automatically for out-of-tree build), MAKEALL does not have to create a build directory. It it done by the top Makefile. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- MAKEALL | 1 - 1 file changed, 1 deletion(-) diff --git a/MAKEALL b/MAKEALL index cde59e40e..9bd7b2e05 100755 --- a/MAKEALL +++ b/MAKEALL @@ -93,7 +93,6 @@ do_build_target() { 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}" From 03dabc0fe4477954f4b37e3149e80ec643c0d03c Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Jan 2015 19:43:06 +0900 Subject: [PATCH 32/36] param: add error check to __dev_add_param() If strdup() fails with out-of-memory, __dev_add_param() should fail with -ENOMEM. (Note strdup() is always given with a non-NULL pointer. If the argument name is given with NULL, the system would already have crashed in the get_param_by_name() function.) Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- lib/parameter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/parameter.c b/lib/parameter.c index 71262c48f..865ad9f43 100644 --- a/lib/parameter.c +++ b/lib/parameter.c @@ -130,6 +130,10 @@ static int __dev_add_param(struct param_d *param, struct device_d *dev, const ch 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 @@ static int __dev_add_param(struct param_d *param, struct device_d *dev, const ch else param->get = param_get_generic; - param->name = strdup(name); param->flags = flags; param->dev = dev; list_add_tail(¶m->list, &dev->parameters); From 8ed32ae81b7b10f4a527f5f1437ce53871f416d0 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Thu, 29 Jan 2015 16:43:48 +0100 Subject: [PATCH 33/36] commands: crc: support setting environment variables Signed-off-by: Jan Luebbe Signed-off-by: Sascha Hauer --- commands/crc.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/commands/crc.c b/commands/crc.c index 9b6a3e2a4..58b750eb9 100644 --- a/commands/crc.c +++ b/commands/crc.c @@ -46,9 +46,10 @@ static int do_crc(int argc, char *argv[]) #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 @@ static int do_crc(int argc, char *argv[]) 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 @@ static int do_crc(int argc, char *argv[]) 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 @@ BAREBOX_CMD_HELP_OPT ("-F FILE", "Use file to compare.") #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) From f5cb522743a84b2527a95ac3345459d36d1fcbb7 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 1 Feb 2015 11:58:26 +0900 Subject: [PATCH 34/36] pinctrl: remove unnecessary error check The file drivers/pinctrl/pinctrl.c is compiled only when CONFIG_PINCTRL is defined. "IS_ENABLED(CONFIG_PINCTRL)" is always evaluated as 1 in this function. (Although the compiler would optimize it, the source file does not look nice.) Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- drivers/pinctrl/pinctrl.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl.c b/drivers/pinctrl/pinctrl.c index d6479b9cd..10ce186a1 100644 --- a/drivers/pinctrl/pinctrl.c +++ b/drivers/pinctrl/pinctrl.c @@ -62,9 +62,6 @@ int of_pinctrl_select_state(struct device_node *np, const char *name) 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; From c4c2317fe8a250b7582f7a3a15dccd7fc56d69f8 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Wed, 28 Jan 2015 11:02:36 +0100 Subject: [PATCH 35/36] defaultenv: generate force-built-in (zero) environment file Signed-off-by: Jan Luebbe Signed-off-by: Sascha Hauer --- defaultenv/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/defaultenv/Makefile b/defaultenv/Makefile index fc679ebc9..33e0eceef 100644 --- a/defaultenv/Makefile +++ b/defaultenv/Makefile @@ -3,7 +3,7 @@ bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU) += defaultenv-2-menu 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 @@ cmd_env_h = cat $< | (cd $(obj) && $(objtree)/scripts/bin2c "__aligned(4) defaul $(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) From cf715885604004ccfc30bc4caa75d58a75bb02c7 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 4 Feb 2015 01:31:57 +0900 Subject: [PATCH 36/36] nios2: ignore arch/nios2/cpu/barebox.lds by git Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- arch/nios2/cpu/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 arch/nios2/cpu/.gitignore diff --git a/arch/nios2/cpu/.gitignore b/arch/nios2/cpu/.gitignore new file mode 100644 index 000000000..d1165788c --- /dev/null +++ b/arch/nios2/cpu/.gitignore @@ -0,0 +1 @@ +barebox.lds