Age | Commit message (Collapse) | Author |
|
This commit enables Kconfig.
Going forward, we use Kconfig for the board configuration.
mkconfig will never be used. Nor will include/config.mk be generated.
Kconfig must be adjusted for U-Boot because our situation is
a little more complicated than Linux Kernel.
We have to generate multiple boot images (Normal, SPL, TPL)
from one source tree.
Each image needs its own configuration input.
Usage:
Run "make <board>_defconfig" to do the board configuration.
It will create the .config file and additionally spl/.config, tpl/.config
if SPL, TPL is enabled, respectively.
You can use "make config", "make menuconfig" etc. to create
a new .config or modify the existing one.
Use "make spl/config", "make spl/menuconfig" etc. for spl/.config
and do likewise for tpl/.config file.
The generic syntax of configuration targets for SPL, TPL is:
<target_image>/<config_command>
Here, <target_image> is either 'spl' or 'tpl'
<config_command> is 'config', 'menuconfig', 'xconfig', etc.
When the configuration is done, run "make".
(Or "make <board>_defconfig all" will do the configuration and build
in one time.)
For futher information of how Kconfig works in U-Boot,
please read the comment block of scripts/multiconfig.py.
By the way, there is another item worth remarking here:
coexistence of Kconfig and board herder files.
Prior to Kconfig, we used C headers to define a set of configs.
We expect a very long term to migrate from C headers to Kconfig.
Two different infractructure must coexist in the interim.
In our former configuration scheme, include/autoconf.mk was generated
for use in makefiles.
It is still generated under include/, spl/include/, tpl/include/ directory
for the Normal, SPL, TPL image, respectively.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
|
|
Add missing aes.c placeholder which includes lib/aes.c . Without this
one, tools/env/ will fail to build.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Alexey Brodkin <abrodkin@synopsys.com>
Tested-by: Heiko Schocher <hs@denx.de>
|
|
Conflicts:
drivers/net/Makefile
(trivial merge)
|
|
We currently limit ourself to 16 characters for the device name to read
the environment from. This is insufficient for /dev/mmcblk0boot1 to
work for example. Switch to '%ms' which gives us a dynamically
allocated buffer instead. We're short lived enough to not bother
free()ing the buffer.
Signed-off-by: Tom Rini <trini@ti.com>
|
|
Implement support for encrypting/decrypting the environment block
into the tools/env/fw_* tools. The cipher used is AES 128 CBC and
the implementation depends solely on components internal to U-Boot.
To allow building against the internal AES library, the library did
need minor adjustments to not include U-Boot's headers which are not
wanted to be included and define missing types.
Signed-off-by: Marek Vasut <marex@denx.de>
|
|
Prior to Kbuild, $(TOPDIR) or $(SRCTREE) was used for
pointing to the top of source directory.
(No difference between the two.)
In Kbuild style, $(srctree) is used for instead.
This commit renames SRCTREE to srctree and deletes the
defition of SRCTREE.
Note that SRCTREE in scripts/kernel-doc, scripts/docproc.c,
doc/DocBook/Makefile should be keep.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
|
Some NOR flash devices have a small erase block size. For example, the
Micron N25Q512 can erase in 4K blocks. These devices expose a bug in
fw_env.c where flash_write_buf() incorrectly calculates bytes written
and attempts to write past the environment sectors. Luckily, a range
check prevents any real damage, but this does cause fw_setenv to fail
with an error.
This change corrects the write length calculation.
The bug was introduced with commit 56086921 from 2008 and only affects
configurations where the erase block size is smaller than the total
environment data size.
Signed-off-by: Dustin Byford <dustin@cumulusnetworks.com>
|
|
The assumed number of environment sectors (always 1) leads to an
incorrect top_of_range calculation in fw.env.c when a flash device has
an erase block size smaller than the environment data size (number of
environment sectors > 1).
This change updates the default number of environment sectors to at
least cover the size of the environment.
Also corrected a false statement about the number of sectors column in
fw_env.config.
Signed-off-by: Dustin Byford <dustin@cumulusnetworks.com>
|
|
fw_printenv is a program which mostly runs on the target Linux.
Before switching to Kbuild, we needed to set HOSTCC at the
command line like this:
make HOSTCC=<your CC cross-compiler> env
Going forward we can cross compile it by specifying CROSS_COMPILE:
make CROSS_COMPILE=<your cross-compiler prefix> env
This looks more natural.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
|
|
This commit merges commonly-used header include paths
to UBOOTINCLUDE and NOSTDINC_FLAGS variables, which are placed
at the top Makefile.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
|
Before this commit, makefiles under tools/ directory
were implemented with their own way.
This commit refactors them by using "hostprogs-y" variable.
Several C sources have been added to wrap other C sources
to simplify Makefile.
For example, tools/crc32.c includes lib/crc32.c
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
|
In-tree build:
- Do not create a symbolic link
from include/asm to arch/${ARCH}/include/asm
- Add ${SRCTREE}/arch/arm/include into the header search path
Out-of-tree build:
- Do not create a directory ${OBJTREE}/include2
- Do not create a symbolic link
from ${OBJTREE}/include2/asm to ${SRCTREE}/arch/${ARCH}/include/asm
- Add ${SRCTREE}/arch/arm/include into the header search path
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
|
Signed-off-by: Wolfgang Denk <wd@denx.de>
|
|
Signed-off-by: Oliver Metz <oliver@freetz.org>
Tested-by: Luka Perkov <luka@openwrt.org>
|
|
Signed-off-by: Oliver Metz <oliver@freetz.org>
Tested-by: Luka Perkov <luka@openwrt.org>
|
|
Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>
|
|
Allow the user to specify two UBI volumes to use for the environment
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
UBI is a better place for the environment on NAND devices because it
handles wear-leveling and bad blocks.
Gluebi is needed in Linux to access the env as an MTD partition.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
In certain cases, memory device is present as flat file or block device (via
mmc or mtdblock layer). Do not attempt MTD operations against it.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
|
|
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
|
|
Fix a comment in the fw_env.config file, no functional change.
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
|
|
I had missed Joe's NAK on this patch, so...
This reverts commit 92ace272d06cec1d7f1533bb9edf914fb5845fba.
Signed-off-by: Tom Rini <trini@ti.com>
|
|
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
When using open(), the O_CREAT flag must be given a mode, otherwise it
uses random garbage from the stack. Also, it can fail to build:
In file included from /usr/include/fcntl.h:290:0,
from fw_env_main.c:42:
In function 'open',
inlined from 'main' at fw_env_main.c:97:9:
/usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared
with attribute error: open with O_CREAT in second argument needs 3 arguments
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
This variable is assigned by a size_t, and is printed that way, but is
incorrectly declared as an int. Which means we get warnings:
fw_env.c: In function 'fw_setenv':
fw_env.c:409:5: warning: format '%zu' expects argument of type 'size_t',
but argument 3 has type 'int' [-Wformat]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
Use the variable access flags to implement the protection for ethaddr
and serial# instead of hard-coding them.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
Add support for read-only, write-once, and change-default.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
Currently just validates variable types as decimal, hexidecimal,
boolean, ip address, and mac address. Call
env_acl_validate_setenv_params() from setenv() in fw_env.c.
If the entry is not found in the env .flags, then look in the static
one. This allows the env to override the static definitions, but prevents
the need to have every definition in the environment distracting you.
Need to build in _ctype for isdigit for Linux.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
There used to be a huge structure duplicated 3 times in the source.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Tom Rini <trini@ti.com>
|
|
Provide more information when using redundant environments
Consistently print debug info to stderr
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
Fix crash introduced by a073d63a36524453a817ab029fad5b188f46127e
when attempting to delete a variable.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
This was introduced in:
8679d0ffdcc0beafea8e6942c0c67cf859afa18e -
COMMON: Use __stringify() instead of MK_STR()
The header is now needed since common.h is not included in this tool.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
Add a mention of the lock file to the README for the fw_printenv tool.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reported-by: Luka Perkov <uboot@lukaperkov.net>
|
|
If the pointer passed into envmatch() is NULL, return -1 instead of
crashing.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
Use a lock file at /var/lock/fw_printenv.lock.
Avoids seriously confusing the MTD driver.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
We will only call fw_getenv when the env has already been initialized.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
The length included the name length, and then it was subtracted back
out on each use. Now we don't include it in the first place. Also
realloc as we process arguments and eliminate memset. Use memcpy
instead of manually copying each byte.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
Originally added in aa701b94336b358798d676eef12a7b90bdac23f5
Before this patch, there was a hard-coded env that was used as default
if the env in flash is detected as invalid. Now this tool (compiled
for a given board) will share the default env with the u-boot for the
board.
Fix include of config.h
Need to define "TEXT_BASE" when building the fw_env tool so that the
default env will be correct for environments which use it.
Define __ASSEMBLY__ when calling #include <config.h> so that we only
get #defines (all we're interested in).
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
|
|
Kill multiple occurances and redeclaration of MK_STR
in favor of __stringify().
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
|
|
Commit 5e724ca did the same thing for env_common and env_embedded, but forgot
fw_env.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
|
|
Signed-off-by: Loïc Minier <lool@debian.org>
|
|
made description according to implementation
(where the config file is the default).
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
|
|
This patch allows the U-Boot user space companion utility, fw_setenv,
to overwrite the 'ethaddr' key/value pair if the current value is set
to a per-board-configured default.
This change allows 'fw_setenv' to match the behavior of 'setenv' /
'env set' on the U-Boot command line.
Signed-off-by: Grant Erickson <marathon96@gmail.com>
Fixed excessive white space.
Signed-off-by: Wolfgang Denk <wd@denx.de>
|
|
The README file lists 4 defined that were not actually present in the .h
file but that were needed to get things working with settings compiled in.
They are
Added these to the .h file
(the values above are the ones from the README file)
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
|
|
Instead of linking the file into $(obj) tree use directly the source file.
This also prevents littered source tree if building not out-of-tree.
Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
|
|
Remove MK_STR from places that consume CONFIG_BOOTFILE to force all definitions to be string literals.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
|
|
Remove MK_STR from places that consume CONFIG_ROOTPATH to force all definitions to be string literals.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
|
|
Patch fixes this issue:
fw_env.c: In function ‘fw_setenv’:
fw_env.c:492:5: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
fw_env.c: In function ‘flash_write_buf’:
fw_env.c:806:6: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
Signed-off-by: Luka Perkov <lists@lukaperkov.net>
Acked-by: Mike Frysinger <vapier@gentoo.org>
|
|
The 'trab' board configuration is broken, and there is nobody who is
interested and willing to fix it. Drop it.
This includes support for VFD displays which have always been used by
this board only.
Signed-off-by: Wolfgang Denk <wd@denx.de>
|
|
Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it>
|