Commit Graph

47709 Commits

Author SHA1 Message Date
Philipp Tomsich
b53f6992e9 dm: reset: have the reset-command perform a COLD reset
The DM version of do_reset has been issuing a warm-reset, which (on
some platforms keeps GPIOs and other parts of the platform active).
This may cause unintended behaviour, as calling do_reset usually
indicates a desire to reset the board/platform and not just the CPU.

This changes do_reset to always request a COLD reset.
Note that programmatic uses can still invoke a WARM reset through
reset_cpu() or using sysreset_walk().

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
f2faffecb0 binman: tegra: Convert to use binman
Update tegra to use binman for image creation. This still includes the
current Makefile logic, but a later patch will remove this. Three output
files are created, all of which combine
SPL and U-Boot:

   u-boot-tegra.bin        - standard image
   u-boot-dtb-tegra.bin    - same as u-boot-tegra.bin
   u-boot-nodtb-target.bin - includes U-Boot without the appended device tree

The latter is useful for build systems where the device is appended later,
perhaps after being modified.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
39c1502ccc binman: Add documentation for the symbol feature
Add this feature to the README.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
2017-12-12 19:53:45 -07:00
Simon Glass
dfce1799e7 binman: Add binman support to spl_ram.c
SPL supports reading U-Boot from a RAM location. At present this is
hard-coded to the U-Boot text base address. Use binman to allow this to
come from the image file, if binman is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
8bee2d251a binman: Add binman symbol support to SPL
Allow SPL to access binman symbols and use this to get the address of
U-Boot. This falls back to CONFIG_SYS_TEXT_BASE if the binman symbol
is not available.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
cf2a8fd66d binman: arm: Include the binman symbol table
This area of the image contains symbols whose values are filled in by
binman. If this feature is not used, the table is empty.

Add this to the ARM SPL link script.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
1979063264 binman: Support accessing binman tables at run time
Binman construct images consisting of multiple binary files. These files
sometimes need to know (at run timme) where their peers are located. For
example, SPL may want to know where U-Boot is located in the image, so
that it can jump to U-Boot correctly on boot.

In general the positions where the binaries end up after binman has
finished packing them cannot be known at compile time. One reason for
this is that binman does not know the size of the binaries until
everything is compiled, linked and converted to binaries with objcopy.

To make this work, we add a feature to binman which checks each binary
for symbol names starting with '_binman'. These are then decoded to figure
out which entry and property they refer to. Then binman writes the value
of this symbol into the appropriate binary. With this, the symbol will
have the correct value at run time.

Macros are used to make this easier to use. As an example, this declares
a symbol that will access the 'u-boot-spl' entry to find the 'pos' value
(i.e. the position of SPL in the image):

   binman_sym_declare(unsigned long, u_boot_spl, pos);

This converts to a symbol called '_binman_u_boot_spl_prop_pos' in any
binary that includes it. Binman then updates the value in that binary,
ensuring that it can be accessed at runtime with:

   ulong u_boot_pos = binman_sym(ulong, u_boot_spl, pos);

This assigns the variable u_boot_pos to the position of SPL in the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
7fe9173be7 binman: Support enabling debug in tests
The elf module can provide some debugging information to assist with
figuring out what is going wrong. This is also useful in tests. Update the
-D option so that it is passed through to tests as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
f689890d8e binman: Adjust size of test SPL binary
This is only 3 bytes long which is not enough to hold two symbol values,
needed to test the binman symbols feature. Increase it to 15 bytes.

Using very small regions is useful since we can easily compare them in
tests and errors are fairly easy to diagnose.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
5cfcf7e0fd binman: Add tests binaries with binman symbols
For testing we need to build some ELF files containing binman symbols. Add
these to the Makefile and check in the binaries:

   u_boot_binman_syms - normal, valid ELF file
   u_boot_binman_syms_bad - missing the __image_copy_start symbol
   u_boot_binman_syms_size - has a binman symbol with an invalid size

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
00ae40b3ae binman: Drop a stale comment about the 'board' feature
This feature is now supported. Drop the incorrect comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
4e6fdbef67 binman: Add support for including spl/u-boot-spl-nodtb.bin
This file contains SPL image without a device tree. Add support for
including this in images.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
47419eae4b binman: Add support for including spl/u-boot-spl.dtb
This file contains the SPL device tree. Add support for including this by
itself in images.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Simon Glass
b50e5611a6 binman: Add a function to read ELF symbols
In some cases we need to read symbols from U-Boot. At present we have a
a few cases which does this via 'nm' and 'grep'.

It is better to use objdump since that tells us the size of the symbols
and also whether it is weak or not.

Add a new module which reads ELF information from files. Update existing
uses of 'nm' to use this module.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-12 19:53:45 -07:00
Baruch Siach
659208da47 README: update the kernel coding style reference
The old CodingStyle document has been converted to ReST and moved
elsewhere. Link to the web version of this document instead.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2017-12-12 21:34:10 -05:00
Tuomas Tynkkynen
a72c618068 ARM: pxa: Remove unused ifdefs
These ifdefs are protecting #include statements for files that have
never existed. AFAICT this hardware.h has been copied from the kernel
and the ifdefs have never served a role in U-Boot, so delete them.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 21:34:10 -05:00
Michal Simek
040f5f1067 test: py: Add an option to skip sleep test
Some QEMUs have a problem with time setup that's why
sleep test is failing. Introduce env__sleep_accurate
boardenv variable to have an option to skip sleep test.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
2017-12-12 21:33:38 -05:00
Patrick Delaunay
f03146480d test/py: gpt: update size of gpt partition
- avoid disturbing 0MiB partition size (in fact < 1MiB)
- test overlap limit between part1 and part2
- test gpt write with data with modifier 'M' for MiB

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
2017-12-12 21:33:38 -05:00
Peng Fan
a1be94b654 SPL: Add FIT data-position property support
For external data, FIT has a optional property "data-position" which
can set the external data to a fixed offset to FIT beginning.
Add the support for this property in SPL FIT.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: "Andrew F. Davis" <afd@ti.com>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: "tomas.melin@vaisala.com" <tomas.melin@vaisala.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: "Cooper Jr., Franklin" <fcooper@ti.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Rick Altherr <raltherr@google.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-12-12 21:33:38 -05:00
Adam Ford
6032c02947 ARM: omap3_logic: Enable NAND unlocking during Falcon mode
Falcon mode was already working with SD card.  This enables the
unlocking of NAND to allow the NAND read & write.  This also
expands the README file based on the am335x describing how to
setup Falcon mode.

Signed-off-by: Adam Ford <aford173@gmail.com>
2017-12-12 21:33:38 -05:00
Adam Ford
157af4f81f ARM: omap3_logic: Unlock NAND automatically in U-Boot
The Micron Flash is locked by default.  This will automaticlly
unlock so manually unlocking is unnecessary in U-Boot.

Signed-off-by: Adam Ford <aford173@gmail.com>
2017-12-12 21:33:38 -05:00
Adam Ford
5decc7b014 omap3_logic: Increase CMD_SPL_WRITE_SIZE
The SPL-OS partition is 0x20000, so let's make
CONFIG_CMD_SPL_WRITE_SIZE same size. This should allow for better
falcon mode operation.

Signed-off-by: Adam Ford <aford173@gmail.com>
2017-12-12 21:33:38 -05:00
Jorge Ramirez-Ortiz
bd3006c849 drivers: spmi-msm: fix scanning for peripherals
A typo in the probe function causes not all peripherals to be scanned
(in the case of the Dragonboard820c - work in progress - it wont find pmic0).
2017-12-12 21:33:38 -05:00
Tuomas Tynkkynen
cf71338ee7 ata: Migrate CONFIG_MVSATA_IDE to Kconfig
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 18:16:06 -05:00
Tuomas Tynkkynen
b82e667f79 ata: Migrate CONFIG_LIBATA to Kconfig
This symbol enables some library code used by various SATA drivers,
so make this a non-user-visible symbol select'ed by the respective
drivers, and let moveconfig handle the rest.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 18:16:05 -05:00
Tuomas Tynkkynen
9fd95ef0d3 ata: Migrate CONFIG_SCSI_AHCI to Kconfig
And use 'imply' liberally.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 18:13:19 -05:00
Tuomas Tynkkynen
477b16a798 ata: Migrate CONFIG_DWC_AHSATA to Kconfig
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 14:06:46 -05:00
Tuomas Tynkkynen
9920d151c4 ata: Migrate CONFIG_FSL_SATA to Kconfig
Use 'imply' here liberally to avoid the combinatorial explosion of
defconfig changes in the PowerPC boards.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 14:05:48 -05:00
Tuomas Tynkkynen
ad0ac54361 ata: Migrate CONFIG_SATA_MV to Kconfig
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 14:05:48 -05:00
Tuomas Tynkkynen
32f0398ba5 ata: Migrate CONFIG_SATA_SIL3114 to Kconfig
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 14:05:48 -05:00
Tuomas Tynkkynen
c88ecf47bd ata: Migrate CONFIG_SATA_SIL to Kconfig
Use 'imply' here liberally to avoid the combinatorial explosion of
defconfig changes in the PowerPC boards.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 14:05:48 -05:00
Tuomas Tynkkynen
ac2e33efda ata: Drop CONFIG_MX51_PATA
The last user of this driver went away in August 2015 in commit:
b6073fd211 ("arm: Remove mx51_efikamx, mx51_efikasb boards")

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 14:05:48 -05:00
Tuomas Tynkkynen
0d26b831d7 ata: Drop CONFIG_SATA_DWC
The last user of this driver went away in June 2017, in commit:
98f705c9ce ("powerpc: remove 4xx support")

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-12-12 14:05:35 -05:00
Tom Rini
e3143ecb8a Merge git://git.denx.de/u-boot-arc 2017-12-12 10:57:58 -05:00
Alexey Brodkin
d5fbcd57ed gpio/hsdk: Depend on DM_GPIO instead of simple DM
This driver really is DM GPIO one and so we need to have a correct
dependency, because DM alone doesn't provide required for CMD_GPIO
call and we're seeing build failures like this:
---------------------->8---------------------
cmd/built-in.o: In function 'do_gpio':
.../cmd/gpio.c:188: undefined reference to 'gpio_request'
...
---------------------->8---------------------

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Eugeniy Paltsev <paltsev@synopsys.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-12-12 18:47:30 +03:00
Tom Rini
87f3dee22b Merge git://git.denx.de/u-boot-uniphier 2017-12-11 17:06:04 -05:00
Tom Rini
6f1ee8a4bf Merge git://git.denx.de/u-boot-arc 2017-12-11 17:05:43 -05:00
Masahiro Yamada
7f8e75390b ARM: uniphier: use FIELD_PREP for PLL settings
It is tedious to define both mask and bit-shift.  <linux/bitfield.h>
provides a convenient way to get access to register fields with a
single shifted mask.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-12-12 00:36:12 +09:00
Masahiro Yamada
f2ce50b2d0 ARM: uniphier: compute SSCPLL values more precisely
Use DIV_ROUND_CLOSEST().  To make the JK value even more precise,
I used a bigger coefficient, then divide it by 512.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-12-12 00:36:11 +09:00
Dai Okamura
c30c44e799 ARM: uniphier: fix SSCPLL init code for LD11 SoC
Commit 682e09ff9f ("ARM: uniphier: add PLL init code for LD20 SoC")
missed to write the computed value to the SSCPLLCTRL2 register.

Fixes: 682e09ff9f ("ARM: uniphier: add PLL init code for LD20 SoC")
Signed-off-by: Dai Okamura <okamura.dai@socionext.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-12-12 00:36:11 +09:00
Masahiro Yamada
dc774e69bb mtd: nand: denali: make NAND_DENALI unconfigurable option
denali.c has no driver entry in itself.  It makes sense only when
compiled together with denali_dt.c

Let NAND_DENALI_DT select NAND_DENALI, and hide NAND_DENALI from
the Kconfig menu.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-12-12 00:36:11 +09:00
Masahiro Yamada
00ed0e3ee3 ARM: uniphier: compile pll-base-ld20.c for PXs3
Fix the link error for the combination of
  CONFIG_ARCH_UNIPHIER_LD11=n
  CONFIG_ARCH_UNIPHIER_LD20=n
  CONFIG_ARCH_UNIPHIER_PXS3=y

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-12-12 00:35:59 +09:00
Eugeniy Paltsev
e80dac0ab8 ARC: clk: introduce HSDK CGU clock driver
Synopsys HSDK clock controller generates and supplies clocks to various
controllers and peripherals within the SoC.

Each clock has assigned identifier and client device tree nodes can use
this identifier to specify the clock which they consume. All available
clocks are defined as preprocessor macros in the
dt-bindings/clock/snps,hsdk-cgu.h header and can be used in device
tree sources.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2017-12-11 11:36:23 +03:00
Eugeniy Paltsev
3cf239394a ARC: cache: explicitly initialize "*_exists" variables
dcache_exists, icache_exists, slc_exists and ioc_exists global
variables in "arch/arc/lib/cache.c" remain uninitialized if
SoC doesn't have corresponding HW.

This happens because we use the next constructions for their
definition and initialization:
-------------------------->>---------------------
int ioc_exists __section(".data");

if (/* condition */)
		ioc_exists = 1;
-------------------------->>---------------------

That's quite a non-trivial issue as one may think of it.
The point is we intentionally put those variables in ".data" section
so they might survive relocation (remember we initilaize them very early
before relocation and continue to use after reloaction). While being
non-initialized and not explicitly put in .data section they would end-up
in ".bss" section which by definition is filled with zeroes.
But since we place those variables in .data section we need to care
about their proper initialization ourselves.

Also while at it we change their type to "bool" as more appropriate.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2017-12-11 11:36:22 +03:00
Eugeniy Paltsev
64f4742631 ARC: add defines of some cache and xCCM AUX registers
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2017-12-11 11:36:22 +03:00
Eugeniy Paltsev
e59c379720 ARC: add macro to get CPU id
ARCNUM [15:8] field in ARC_AUX_IDENTITY register allows us to
uniquely identify each core in a multi-core system.

I.e. with help of this macro each core may get its index in SMP system.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2017-12-11 11:36:22 +03:00
Eugeniy Paltsev
4e782b5940 ARC: HSDK: Fixup DW SDIO CIU frequency to 50000000Hz
DW SDIO controller has external CIU clock divider controlled via
register in the SDIO IP. Due to its unexpected default value
(we expected it to divide by 1 but in reality it divides by 8)
SDIO IP uses wrong CIU clock (it should be 100000000Hz but actual
is 12500000Hz) and works unstable (see STAR 9001204800).

So increase SDIO CIU frequency from actual 12500000Hz to 50000000Hz
by switching from the default divisor value (div-by-8) to the
minimum possible value of the divisor (div-by-2) in HSDK platform
code.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2017-12-11 11:36:22 +03:00
Eugeniy Paltsev
fc86faf9d6 ARC: add asm/gpio.h to fix compilation error with CONFIG_CMD_GPIO
With CONFIG_CMD_GPIO compilation reports error:
-------------------------->8---------------------
common/cmd_gpio.c:13:22: fatal error: asm/gpio.h: No such file or directory
 #include <asm/gpio.h>
                      ^
-------------------------->8---------------------

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2017-12-10 21:13:05 +03:00
Masahiro Yamada
8755ceb5b8 ARM: socfpga: remove unneeded CONFIG_SYS_NAND_USE_FLASH_BBT
Neither denali.c nor denali_spl.c references this option.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-12-09 13:40:33 +01:00
Masahiro Yamada
c63e22ea40 ARM: socfpga: remove unused CONFIG_NAND_DENALI_ECC_SIZE
This option is no longer used.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-12-09 13:40:33 +01:00