diff --git a/Makefile b/Makefile index b15c8ce..c322dd4 100644 --- a/Makefile +++ b/Makefile @@ -744,68 +744,11 @@ $(barebox-dirs): prepare scripts $(Q)$(MAKE) $(build)=$@ -# Build the kernel release string -# -# The KERNELRELEASE value built here is stored in the file -# include/config/kernel.release, and is used when executing several -# make targets, such as "make install" or "make modules_install." -# -# The eventual kernel release string consists of the following fields, -# shown in a hierarchical format to show how smaller parts are concatenated -# to form the larger and final value, with values coming from places like -# the Makefile, kernel config options, make command line options and/or -# SCM tag information. -# -# $(KERNELVERSION) -# $(VERSION) eg, 2 -# $(PATCHLEVEL) eg, 6 -# $(SUBLEVEL) eg, 18 -# $(EXTRAVERSION) eg, -rc6 -# $(localver-full) -# $(localver) -# localversion* (all localversion* files) -# $(CONFIG_LOCALVERSION) (from kernel config setting) -# $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) -# ./scripts/setlocalversion (SCM tag, if one exists) -# $(LOCALVERSION) (from make command line if provided) -# -# Note how the final $(localver-auto) string is included *only* if the -# kernel config option CONFIG_LOCALVERSION_AUTO is selected. Also, at the -# moment, only git is supported but other SCMs can edit the script -# scripts/setlocalversion and add the appropriate checks as needed. - -nullstring := -space := $(nullstring) # end of line - -___localver = $(objtree)/localversion* $(srctree)/localversion* -__localver = $(sort $(wildcard $(___localver))) -# skip backup files (containing '~') -_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f))) - -localver = $(subst $(space),, \ - $(shell cat /dev/null $(_localver)) \ - $(patsubst "%",%,$(CONFIG_LOCALVERSION))) - -# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called -# and if the SCM is know a tag from the SCM is appended. -# The appended tag is determined by the SCM used. -# -# Currently, only git is supported. -# Other SCMs can edit scripts/setlocalversion and add the appropriate -# checks as needed. -ifdef CONFIG_LOCALVERSION_AUTO - _localver-auto = $(shell $(CONFIG_SHELL) \ - $(srctree)/scripts/setlocalversion $(srctree)) - localver-auto = $(LOCALVERSION)$(_localver-auto) -endif - -localver-full = $(localver)$(localver-auto) - # Store (new) KERNELRELASE string in include/config/kernel.release -kernelrelease = $(KERNELVERSION)$(localver-full) +localversion = $(shell $(srctree)/scripts/setlocalversion $(srctree)) include/config/kernel.release: include/config/auto.conf FORCE $(Q)rm -f $@ - $(Q)echo $(kernelrelease) > $@ + $(Q)echo $(KERNELVERSION)$(localversion) > $@ Doxyfile.version: include/config/auto.conf FORCE $(Q)rm -f $@ diff --git a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c index 1bc20cf..a37b089 100644 --- a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c +++ b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c @@ -90,9 +90,25 @@ .udelay = 5, /* ~100 kHz */ }; +void v5_mmu_cache_flush(void); +long cfa10036_get_ram_size(void) +{ + volatile u32 *base = (void *)IMX_MEMORY_BASE; + volatile u32 *ofs = base + SZ_128M / sizeof(u32); + + *base = *ofs = 0xdeadbeef; + *ofs = 0xbaadcafe; + + v5_mmu_cache_flush(); + if (*base == 0xbaadcafe) + return SZ_128M; + else + return SZ_256M; +} + static int cfa10036_mem_init(void) { - arm_add_mem_device("ram0", IMX_MEMORY_BASE, 128 * 1024 * 1024); + arm_add_mem_device("ram0", IMX_MEMORY_BASE, cfa10036_get_ram_size()); return 0; } diff --git a/arch/arm/include/asm/clkdev.h b/arch/arm/include/asm/clkdev.h deleted file mode 100644 index ad33945..0000000 --- a/arch/arm/include/asm/clkdev.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * arch/arm/include/asm/clkdev.h - * - * Copyright (C) 2008 Russell King. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Helper for the clk API to assist looking up a struct clk. - */ -#ifndef __ASM_CLKDEV_H -#define __ASM_CLKDEV_H - -#include - -#endif diff --git a/arch/arm/mach-at91/include/mach/clkdev.h b/arch/arm/mach-at91/include/mach/clkdev.h deleted file mode 100644 index 04b37a8..0000000 --- a/arch/arm/mach-at91/include/mach/clkdev.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __ASM_MACH_CLKDEV_H -#define __ASM_MACH_CLKDEV_H - -#define __clk_get(clk) ({ 1; }) -#define __clk_put(clk) do { } while (0) - -#endif diff --git a/arch/arm/mach-bcm2835/include/mach/clkdev.h b/arch/arm/mach-bcm2835/include/mach/clkdev.h deleted file mode 100644 index 04b37a8..0000000 --- a/arch/arm/mach-bcm2835/include/mach/clkdev.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __ASM_MACH_CLKDEV_H -#define __ASM_MACH_CLKDEV_H - -#define __clk_get(clk) ({ 1; }) -#define __clk_put(clk) do { } while (0) - -#endif diff --git a/arch/arm/mach-clps711x/include/mach/clkdev.h b/arch/arm/mach-clps711x/include/mach/clkdev.h deleted file mode 100644 index 9278209..0000000 --- a/arch/arm/mach-clps711x/include/mach/clkdev.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __MACH_CLKDEV_H -#define __MACH_CLKDEV_H - -#define __clk_get(clk) ({ 1; }) -#define __clk_put(clk) do { } while (0) - -#endif diff --git a/arch/arm/mach-highbank/include/mach/clkdev.h b/arch/arm/mach-highbank/include/mach/clkdev.h deleted file mode 100644 index 04b37a8..0000000 --- a/arch/arm/mach-highbank/include/mach/clkdev.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __ASM_MACH_CLKDEV_H -#define __ASM_MACH_CLKDEV_H - -#define __clk_get(clk) ({ 1; }) -#define __clk_put(clk) do { } while (0) - -#endif diff --git a/arch/arm/mach-imx/include/mach/clkdev.h b/arch/arm/mach-imx/include/mach/clkdev.h deleted file mode 100644 index 04b37a8..0000000 --- a/arch/arm/mach-imx/include/mach/clkdev.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __ASM_MACH_CLKDEV_H -#define __ASM_MACH_CLKDEV_H - -#define __clk_get(clk) ({ 1; }) -#define __clk_put(clk) do { } while (0) - -#endif diff --git a/arch/arm/mach-nomadik/include/mach/clkdev.h b/arch/arm/mach-nomadik/include/mach/clkdev.h deleted file mode 100644 index 04b37a8..0000000 --- a/arch/arm/mach-nomadik/include/mach/clkdev.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __ASM_MACH_CLKDEV_H -#define __ASM_MACH_CLKDEV_H - -#define __clk_get(clk) ({ 1; }) -#define __clk_put(clk) do { } while (0) - -#endif diff --git a/arch/arm/mach-versatile/include/mach/clkdev.h b/arch/arm/mach-versatile/include/mach/clkdev.h deleted file mode 100644 index 04b37a8..0000000 --- a/arch/arm/mach-versatile/include/mach/clkdev.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __ASM_MACH_CLKDEV_H -#define __ASM_MACH_CLKDEV_H - -#define __clk_get(clk) ({ 1; }) -#define __clk_put(clk) do { } while (0) - -#endif diff --git a/arch/arm/mach-vexpress/include/mach/clkdev.h b/arch/arm/mach-vexpress/include/mach/clkdev.h deleted file mode 100644 index 04b37a8..0000000 --- a/arch/arm/mach-vexpress/include/mach/clkdev.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __ASM_MACH_CLKDEV_H -#define __ASM_MACH_CLKDEV_H - -#define __clk_get(clk) ({ 1; }) -#define __clk_put(clk) do { } while (0) - -#endif diff --git a/commands/tftp.c b/commands/tftp.c index 558b0ac..c83d174 100644 --- a/commands/tftp.c +++ b/commands/tftp.c @@ -76,7 +76,7 @@ if (ret) goto err_rmdir; - printk("%s: %s -> %s\n", __func__, source, dest); + debug("%s: %s -> %s\n", __func__, source, dest); ret = copy_file(source, dest, 1); diff --git a/commands/ubiformat.c b/commands/ubiformat.c index 47941be..121816f 100644 --- a/commands/ubiformat.c +++ b/commands/ubiformat.c @@ -296,13 +296,20 @@ static int flash_image(const struct mtd_dev_info *mtd, const struct ubigen_info *ui, struct ubi_scan_info *si) { - int fd, img_ebs, eb, written_ebs = 0, divisor; + int fd, img_ebs, eb, written_ebs = 0, divisor, ret = -1; off_t st_size; + char *buf = NULL; fd = open_file(&st_size); if (fd < 0) return fd; + buf = malloc(mtd->eb_size); + if (!buf) { + sys_errmsg("cannot allocate %d bytes of memory", mtd->eb_size); + goto out_close; + } + img_ebs = st_size / mtd->eb_size; if (img_ebs > si->good_cnt) { @@ -312,8 +319,9 @@ } if (st_size % mtd->eb_size) { - return sys_errmsg("file \"%s\" (size %lld bytes) is not multiple of ""eraseblock size (%d bytes)", - args.image, (long long)st_size, mtd->eb_size); + sys_errmsg("file \"%s\" (size %lld bytes) is not multiple of " + "eraseblock size (%d bytes)", + args.image, (long long)st_size, mtd->eb_size); goto out_close; } @@ -321,7 +329,6 @@ divisor = img_ebs; for (eb = 0; eb < mtd->eb_cnt; eb++) { int err, new_len; - char buf[mtd->eb_size]; long long ec; if (!args.quiet && !args.verbose) { @@ -404,12 +411,13 @@ if (!args.quiet && !args.verbose) printf("\n"); - close(fd); - return eb + 1; + + ret = eb + 1; out_close: + free(buf); close(fd); - return -1; + return ret; } static int format(const struct mtd_dev_info *mtd, diff --git a/common/tlsf_malloc.c b/common/tlsf_malloc.c index 5c5bb61..cd01b56 100644 --- a/common/tlsf_malloc.c +++ b/common/tlsf_malloc.c @@ -17,10 +17,8 @@ * */ -#include #include #include -#include #include #include diff --git a/defaultenv-2/menu/menu/mainmenu b/defaultenv-2/menu/menu/mainmenu index c74cc9c..f10f67a 100644 --- a/defaultenv-2/menu/menu/mainmenu +++ b/defaultenv-2/menu/menu/mainmenu @@ -14,11 +14,7 @@ boot-entries-collect - menu -e -a -R -m boot -c "$global.editcmd /env/network/eth0" -d "Network settings" - menu -e -a -R -m boot -c "$global.editcmd /env/config" -d "Config settings" - menu -e -a -m boot -c "boot-entries-edit" -d "Edit boot entries" - menu -e -a -m boot -c "init-entries-edit" -d "Edit init entries" - menu -e -a -R -m boot -c "saveenv || echo \"failed to save environment\" && sleep 2" -d "Save settings" + menu -e -a -m boot -c "settings" -d "Settings" menu -e -a -m boot -c 'PATH=$savepath; echo "enter exit to return to menu"; sh' -d "${DARK_YELLOW}Shell${NC}" menu -e -a -m boot -c reset -d "${RED}Reset${NC}" diff --git a/defaultenv-2/menu/menu/settings b/defaultenv-2/menu/menu/settings new file mode 100644 index 0000000..3b95d4c --- /dev/null +++ b/defaultenv-2/menu/menu/settings @@ -0,0 +1,21 @@ +#!/bin/sh + +export menu_exit=false + +while true; do + menu -a -m settings -d "${CYAN}Settings${NC}" + + menu -e -a -R -m settings -c "$global.editcmd /env/network/eth0" -d "Network settings" + menu -e -a -R -m settings -c "$global.editcmd /env/config" -d "Config settings" + menu -e -a -m settings -c "settings-entries-edit" -d "Edit settings entries" + menu -e -a -m settings -c "init-entries-edit" -d "Edit init entries" + menu -e -a -R -m settings -c "saveenv || echo \"failed to save environment\" && sleep 2" -d "Save settings" + menu -e -a -m settings -c "menu_exit=true" -d "back" + + menu -s -m settings + menu -r -m settings + + if [ $menu_exit = true ]; then + exit + fi +done diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 5441eeb..338b9e8 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -95,8 +95,6 @@ struct clk *clk; clk = clk_find(dev_id, con_id); - if (clk && !__clk_get(clk)) - clk = NULL; return clk ? clk : ERR_PTR(-ENOENT); } @@ -117,7 +115,6 @@ void clk_put(struct clk *clk) { - __clk_put(clk); } EXPORT_SYMBOL(clk_put); diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c index a269aee..c8598c2 100644 --- a/drivers/mci/mci-core.c +++ b/drivers/mci/mci-core.c @@ -430,8 +430,10 @@ } /* No high-speed support */ - if (!mci->ext_csd[EXT_CSD_HS_TIMING]) + if (!mci->ext_csd[EXT_CSD_HS_TIMING]) { + dev_dbg(mci->mci_dev, "No high-speed support\n"); return 0; + } /* High Speed is set, there are two types: 52MHz and 26MHz */ if (cardtype & EXT_CSD_CARD_TYPE_52) @@ -669,7 +671,8 @@ mci->version = MMC_VERSION_1_2; break; } - printf("detected card version %s\n", vstr); + + dev_info(mci->mci_dev, "detected card version %s\n", vstr); } } @@ -891,8 +894,9 @@ mci_set_clock(mci, 52000000); else mci_set_clock(mci, 26000000); - } else + } else { mci_set_clock(mci, 20000000); + } /* * Unlike SD, MMC cards dont have a configuration register to notify @@ -1169,7 +1173,7 @@ } if (block > MAX_BUFFER_NUMBER) { - pr_err("Cannot handle block number %d. Too large!\n", block); + dev_err(mci->mci_dev, "Cannot handle block number %d. Too large!\n", block); return -EINVAL; } @@ -1366,7 +1370,7 @@ /* start with a host interface reset */ rc = (host->init)(host, mci->mci_dev); if (rc) { - pr_err("Cannot reset the SD/MMC interface\n"); + dev_err(mci->mci_dev, "Cannot reset the SD/MMC interface\n"); return rc; } @@ -1376,7 +1380,7 @@ /* reset the card */ rc = mci_go_idle(mci); if (rc) { - pr_warning("Cannot reset the SD/MMC card\n"); + dev_warn(mci->mci_dev, "Cannot reset the SD/MMC card\n"); goto on_error; } diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 5f65cea..97a7d21 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -1,11 +1,11 @@ -menuconfig USB_GADGET - depends on USB_HAVE_GADGET_DRIVER - bool "USB gadget support" - config USB_HAVE_GADGET_DRIVER bool default y if ARCH_IMX || ARCH_MXS || ARCH_AT91 || ARCH_PXA +menuconfig USB_GADGET + depends on USB_HAVE_GADGET_DRIVER + bool "USB gadget support" + if USB_GADGET config USB_GADGET_DUALSPEED diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h index 1fc0ab9..eeadcfe 100644 --- a/include/linux/clkdev.h +++ b/include/linux/clkdev.h @@ -12,8 +12,6 @@ #ifndef __CLKDEV_H #define __CLKDEV_H -#include - struct clk; struct device_d; diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 83b7512..cce4706 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -1,65 +1,171 @@ #!/bin/sh -# Print additional version information for non-release trees. +# +# This scripts adds local version information from the version +# control systems git, mercurial (hg) and subversion (svn). +# usage() { - echo "Usage: $0 [srctree]" >&2 + echo "Usage: $0 [--save-scmversion] [srctree]" >&2 exit 1 } -cd "${1:-.}" || usage +scm_only=false +srctree=. +if test "$1" = "--save-scmversion"; then + scm_only=true + shift +fi +if test $# -gt 0; then + srctree=$1 + shift +fi +if test $# -gt 0 -o ! -d "$srctree"; then + usage +fi -# Check for git and a git repo. -if head=`git rev-parse --verify HEAD 2>/dev/null`; then - # Do we have an untagged version? - if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then - if tag=`git describe 2>/dev/null`; then - echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' +scm_version() +{ + local short + short=false + + cd "$srctree" + if test -e .scmversion; then + cat .scmversion + return + fi + if test "$1" = "--short"; then + short=true + fi + + # Check for git and a git repo. + if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then + + # If we are at a tagged commit (like "v2.6.30-rc6"), we ignore + # it, because this version is defined in the top level Makefile. + if [ -z "`git describe --exact-match 2>/dev/null`" ]; then + + # If only the short version is requested, don't bother + # running further git commands + if $short; then + echo "+" + return + fi + # If we are past a tagged commit (like + # "v2.6.30-rc5-302-g72357d5"), we pretty print it. + if atag="`git describe 2>/dev/null`"; then + echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' + + # If we don't have a tag at all we print -g{commitish}. + else + printf '%s%s' -g $head + fi fi + + # Is this git on svn? + if git config --get svn-remote.svn.url >/dev/null; then + printf -- '-svn%s' "`git svn find-rev $head`" + fi + + # Update index only on r/w media + [ -w . ] && git update-index --refresh --unmerged > /dev/null + + # Check for uncommitted changes + if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then + printf '%s' -dirty + fi + + # All done with git + return fi - # Are there uncommitted changes? - git update-index --refresh --unmerged > /dev/null - if git diff-index --name-only HEAD | grep -v "^scripts/package" \ - | read dummy; then - printf '%s' -dirty + # Check for mercurial and a mercurial repo. + if test -d .hg && hgid=`hg id 2>/dev/null`; then + # Do we have an tagged version? If so, latesttagdistance == 1 + if [ "`hg log -r . --template '{latesttagdistance}'`" == "1" ]; then + id=`hg log -r . --template '{latesttag}'` + printf '%s%s' -hg "$id" + else + tag=`printf '%s' "$hgid" | cut -d' ' -f2` + if [ -z "$tag" -o "$tag" = tip ]; then + id=`printf '%s' "$hgid" | sed 's/[+ ].*//'` + printf '%s%s' -hg "$id" + fi + fi + + # Are there uncommitted changes? + # These are represented by + after the changeset id. + case "$hgid" in + *+|*+\ *) printf '%s' -dirty ;; + esac + + # All done with mercurial + return fi - # All done with git - exit -fi - -# Check for mercurial and a mercurial repo. -if hgid=`hg id 2>/dev/null`; then - tag=`printf '%s' "$hgid" | cut -d' ' -f2` - - # Do we have an untagged version? - if [ -z "$tag" -o "$tag" = tip ]; then - id=`printf '%s' "$hgid" | sed 's/[+ ].*//'` - printf '%s%s' -hg "$id" - fi - - # Are there uncommitted changes? - # These are represented by + after the changeset id. - case "$hgid" in - *+|*+\ *) printf '%s' -dirty ;; - esac - - # All done with mercurial - exit -fi - -# Check for svn and a svn repo. -if rev=`svn info 2>/dev/null | grep '^Revision'`; then - rev=`echo $rev | awk '{print $NF}'` - changes=`svn status 2>/dev/null | grep '^[AMD]' | wc -l` - - # Are there uncommitted changes? - if [ $changes != 0 ]; then - printf -- '-svn%s%s%s' "$rev" -dirty "$changes" - else + # Check for svn and a svn repo. + if rev=`svn info 2>/dev/null | grep '^Last Changed Rev'`; then + rev=`echo $rev | awk '{print $NF}'` printf -- '-svn%s' "$rev" - fi - # All done with svn + # All done with svn + return + fi +} + +collect_files() +{ + local file res + + for file; do + case "$file" in + *\~*) + continue + ;; + esac + if test -e "$file"; then + res="$res$(cat "$file")" + fi + done + echo "$res" +} + +if $scm_only; then + if test ! -e .scmversion; then + res=$(scm_version) + echo "$res" >.scmversion + fi exit fi + +if test -e include/config/auto.conf; then + . include/config/auto.conf +else + echo "Error: kernelrelease not valid - run 'make prepare' to update it" + exit 1 +fi + +# localversion* files in the build and source directory +res="$(collect_files localversion*)" +if test ! "$srctree" -ef .; then + res="$res$(collect_files "$srctree"/localversion*)" +fi + +# CONFIG_LOCALVERSION and LOCALVERSION (if set) +res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}" + +# scm version string if not at a tagged commit +if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then + # full scm version string + res="$res$(scm_version)" +else + # append a plus sign if the repository is not in a clean + # annotated or signed tagged state (as git describe only + # looks at signed or annotated tags - git tag -a/-s) and + # LOCALVERSION= is not specified + if test "${LOCALVERSION+set}" != "set"; then + scm=$(scm_version --short) + res="$res${scm:++}" + fi +fi + +echo "$res"