Commit Graph

42545 Commits

Author SHA1 Message Date
Simon Glass
891f7ae633 dm: serial: Allow driver-model serial to be disabled for TPL
Add separate enable/disable controls for driver-model serial. While this
is generally enabled in SPL it may not be in TPL, since serial output can
be obtained with the debug UART with minimal code size.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:59 -04:00
Simon Glass
5a6f06f696 dm: core: Allow driver model to be disabled for TPL
Since TPL often needs to be very very small it may not make sense to
enable driver model. Add an option for this.

This changes brings the 'rock' board under the TPL limit with gcc 4.9.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:58 -04:00
Simon Glass
001f3142c3 Makefile: Provide an option to select SPL or TPL
At present we have SPL_ which can be used in Makefiles to select between
normal and SPL CONFIGs like this:

    obj-$(CONFIG_$(SPL_)DM)		+= core/

When TPL is being built, SPL_ has the value 'SPL' which is generally a
good idea since they tend to follow each other. But in extreme situations
we may want to distinugish between SPL and TPL. For example we may not
want to enable CONFIG_DM with TPL.

Add a new SPL_TPL_ variable which is set to either empty (for U-Boot
proper), 'SPL' or 'TPL'. This may prove useful with TPL-specific options.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:58 -04:00
Simon Glass
1fbf97dc45 board_f: powerpc: Drop unused headers
These includes don't seem to be needed now. Drop them. Reserve the
mp.h header for PowerPC for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-04-05 16:36:57 -04:00
Simon Glass
e47b2d674f board_f: Make relocation functions generic
This header file is used by three archs. It could be used by all of them
since relocation is a common function. Move it into a generic file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:57 -04:00
Simon Glass
96d4b75c0d board_f: Make init_helpers generic
This header file is used by two archs. It could be used by all of them
since it allows the cache to be on during relocation. Move it into a
generic file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:56 -04:00
Simon Glass
e5fb573f64 powerpc: Move setup_board_extra() into a PPC file
We don't need this PPC-specific function in generic code. Move it to
the powerpc directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 16:36:55 -04:00
Simon Glass
056285fd45 board_f: Move errno.h down to the bottom
This is to keep the header file order consistent.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-04-05 16:36:55 -04:00
Simon Glass
479312233c board_f: Drop unused headers
Drop headers which are not used or needed in this file. The compiler.h
header is included by common.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-04-05 16:36:52 -04:00
Simon Glass
5e924a13e7 Move dram_init_banksize() to a common header
This is an weak function present on all archs so we should have it in the
common header file. Remove it from arch-specific headers and add a
function comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:51 -04:00
Simon Glass
76b00aca4f board_f: Drop setup_dram_config() wrapper
By making dram_init_banksize() return an error code we can drop the
wrapper. Adjust this and clean up all implementations.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 16:36:51 -04:00
Simon Glass
abf7f4c704 board_f: Drop CONFIG_SPL_BUILD check
This is never defined when building this file, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-04-05 16:36:50 -04:00
Simon Glass
0f079eb51c board_f: Put video memory reservation in one function
Move the ugly #ifdefs inside the reserve_video() function so we can
collect all this init into one place.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:49 -04:00
Simon Glass
80d4bcd3ec board_f: Move the extra #ifdef condition into reserve_mmu()
The arch-specific details of the cache being off are best handled inside
the reserve_mmu(). This cleans up the init sequence a little.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-04-05 16:36:49 -04:00
Simon Glass
b56db48615 board_f: Use a single condition for reserve_logbuffer()
CONFIG_ALT_LB_ADDR is really a detail of how this logbuffer is allocated
rather than whether to do it at all. So move the #ifdef into the function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:48 -04:00
Simon Glass
c67f432ecd xtensa: Place relocated U-Boot in the normal place
All archs put U-Boot at the bottom of the relocated region. Xtensa does
not, but perhaps not for any good reason. Adjust it to see if things
still work OK.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:48 -04:00
Simon Glass
088454cde2 board_f: Drop return value from initdram()
At present we cannot use this function as an init sequence call without a
wrapper, since it returns the RAM size. Adjust it to set the RAM size in
global_data instead, and return 0 on success.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:59:20 -04:00
Simon Glass
52c411805c board_f: Drop board_type parameter from initdram()
It looks like only cm5200 and tqm8xx use this feature, so we don't really
need it in generic code. Drop it and have the users access gd->board_type
directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:58:44 -04:00
Simon Glass
eca803756a i2c: Drop CONFIG_SOFT_I2C_MULTI_BUS
This is not used by any board. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Clean up board_f sequence a little
This series tries to remove #ifdefs from the board_f init sequence. It
gets as far as I2C and then we need to discuss whether we can start to
remove the old I2C framework.

I think that ideally each entry in the init sequence should be enabled by
at most one CONFIG, which is in Kconfig and is not arch-specific.
END
Acked-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
2017-04-05 13:55:11 -04:00
Simon Glass
664ee4c995 i2c: Drop unused i2c_soft...() functions
These are not used in U-Boot. Manual relocation fixup is used by blackfin
but that is being removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 13:55:10 -04:00
Simon Glass
76d1d02fd2 board_f: x86: Use checkcpu() for CPU init
At present we misuse print_cpuinfo() do so CPU init on x86. This is done
because it is the next available call after the console is enabled. But
several arches use checkcpu() instead. Despite the horrible name (which
we can fix), it seems a better choice.

Adjust the various x86 CPU implementations to move their init code into
checkcpu() and use print_cpuinfo() only for printing CPU info.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:55:09 -04:00
Simon Glass
8749fa6af3 board_f: powerpc: Make prt_8260_rsr(), prt_8260_clks() private
Move these two function calls into checkcpu(), which is called on this
arch immediately after these two.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:55:08 -04:00
Simon Glass
689697785e board_f: sandbox: Move sandbox_early_getopt_check() into misc_init_f()
We don't need a special hook for sandbox as one of the later ones will do
just as well. We can print error messages about bad options after we
print the banner. In fact, it seems better.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:55:07 -04:00
Simon Glass
d891ab95c2 board_f: powerpc: Move prt_83xx_rsr() to private code
This function is called just before checkcpu() on MPX83xx. Move it to the
code for that arch.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 13:55:06 -04:00
Simon Glass
727e94a4ac powerpc: freescale: Unify the two get_clocks() calls
Combine the conditions so this appears in the init list only once.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:55:05 -04:00
Simon Glass
11b33e64dd board_f: Use timer_init() on all archs
More than half of the architectures use this function so let's make them
all use it.

For those which don't actually define it, we can rely on the weak function
in lib/time.c

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:55:05 -04:00
Simon Glass
70e2aaf380 board_f: powerpc: Use timer_init() instead of init_timebase()
There is no good reason to use a different name on PowerPC. Change it to
timer_init() like the others.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:54:29 -04:00
Simon Glass
1793e78225 board_f: powerpc: Unified get_clocks() portion of init sequence
Now that both branches of the #if do the same thing, we can unify them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:53:02 -04:00
Simon Glass
75efc34bfa board_f: Remove adjust_sdram_tbs_8xx() from the init sequence
We can just call this from the only place that needs it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:52 -04:00
Simon Glass
26345552d6 board_f: Remove sdram_adjust_866() from the init sequence
We can just call this from the only function that needs it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:51 -04:00
Simon Glass
d593c61672 board_f: powerpc: Rename get_clocks_866() to get_clocks()
We really don't need to have a name like this in the generic init
sequence. Use the generic get_clocks() name so that we can merge these
two at some point.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:50 -04:00
Simon Glass
c252c06857 board_f: powerpc: Join the two CONFIG_8xx_CPUCLK_DEFAULT sections
We have two chunks of code which depend on this CONFIG options. There is
likely no need to keep them apart, so join them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:49 -04:00
Simon Glass
671549e5b0 board_f: x86: Rename x86_fsp_init() to arch_fsp_init()
While x86 is the only user and this could in principle be moved to
arch_cpu_init() there is some justification for this being a separate
call. It provides a way to handle init which is not CPU-specific, but
must happen before the CPU can be set up.

Rename the function to be more generic.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:36 -04:00
Simon Glass
2d986c0f54 board_f: initcall: Add a header guard
This file is missing the usual header guard. Add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 13:52:35 -04:00
Simon Glass
bb967240bb board_f: sandbox: Move setup_ram_buf() to private code
There is no need to have this call in the generic init sequence and no
other architecture has needed it in the time it has been there. Move it
into sandbox's private code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
2017-04-05 13:52:35 -04:00
Tom Rini
70cc0c34b6 OpenRISC: Remove
The OpenRISC architecture is currently unmaintained, remove.

Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-05 13:52:34 -04:00
Tom Rini
936478e797 SPARC: Remove
The SPARC architecture is currently unmaintained, remove.

Cc: Francois Retief <fgretief@spaceteq.co.za>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-05 13:52:20 -04:00
Tom Rini
ea3310e8aa Blackfin: Remove
The architecture is currently unmaintained, remove.

Cc: Benjamin Matthews <mben12@gmail.com>
Cc: Chong Huang <chuang@ucrobotics.com>
Cc: Dimitar Penev <dpn@switchfin.org>
Cc: Haitao Zhang <hzhang@ucrobotics.com>
Cc: I-SYST Micromodule <support@i-syst.com>
Cc: M.Hasewinkel (MHA) <info@ssv-embedded.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Martin Strubel <strubel@section5.ch>
Cc: Peter Meerwald <devel@bct-electronic.com>
Cc: Sonic Zhang <sonic.adi@gmail.com>
Cc: Valentin Yakovenkov <yakovenkov@niistt.ru>
Cc: Wojtek Skulski <info@skutek.com>
Cc: Wojtek Skulski <skulski@pas.rochester.edu>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-05 13:52:01 -04:00
Tom Rini
c3b7cfe15e mx6sxsabreauto: Remove legacy CONFIG_PCA953X
When this board was switched to using more DM drivers we didn't disable
the legacy PCA953X driver.  This in turn learn to a build time warning
about implicit functions as i2c.h would not say anything about
'i2c_read' nor 'i2c_write'.  But this was not a fatal error as none of
the legacy driver would be linked in either.

Fixes: e389033f72 ("imx: mx6sxsabreauto: enable more dm drivers")
Reviewed-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-05 11:38:51 -04:00
Tom Rini
433647a7ef Merge git://git.denx.de/u-boot-dm 2017-04-05 08:28:33 -04:00
Vikas Manocha
239ae4a912 dm: avoid dropping pin control DT properties in case of SPL_PINCTRL
This patch replaces SPL_PINCTRL_FULL with SPL_PINCNTRL. It is to avoid removal
of pin control properties in case of SPL_PINCTRL. No impact in case of
SPL_PINCTRL_FULL as it depends on SPL_PINCTRL.

Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-04 20:15:10 -06:00
Stefan Roese
24f927c527 dm: test: Add test for device removal
Add a test for the correct device removal. Currently two different ways
for device removal are supported:

- Normal device removal via the device_remove() API
- Removal via selective device driver flags (DM_FLAG_ACTIVE_DMA)

This new test "remove_active_dma" adds tests cases for those both ways
of removal. This is done by adding a new test driver, which has this
flag set.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
2017-04-04 20:15:10 -06:00
Stefan Roese
1b8220aa2a arm: bootm: Add dm_remove_devices_flags() call to announce_and_cleanup()
This patch adds a call to dm_remove_devices_flags() to
announce_and_cleanup() so that drivers that have one of the removal flags
set (e.g. DM_FLAG_ACTIVE_DMA_REMOVE) in their driver struct, may do some
last-stage cleanup before the OS is started.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-04 20:15:10 -06:00
Stefan Roese
bc85aa4030 dm: core: Add dm_remove_devices_flags() and hook it into device_remove()
The new function dm_remove_devices_flags() is intented for driver specific
last-stage cleanup operations before the OS is started. This patch adds
this functionality and hooks it into the common device_remove()
function.

Drivers wanting to use this feature for some last-stage removal calls,
need to add one of the DM_REMOVE_xx flags to their driver .flags.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-04 20:15:10 -06:00
Stefan Roese
706865afe5 dm: core: Add flags parameter to device_remove()
This patch adds the flags parameter to device_remove() and changes all
calls to this function to provide the default value of DM_REMOVE_NORMAL
for "normal" device removal.

This is in preparation for the driver specific pre-OS (e.g. DMA
cancelling) remove support.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2017-04-04 20:15:10 -06:00
Jernej Skrabec
7da8680b26 rockchip: Add support for MiQi rk3288 board
MiQi is rk3288 based development board with 1 or 2 GB SDRAM, 16 GB eMMC,
micro SD card interface, 4 USB 2.0 ports, HDMI, gigabit Ethernet and
expansion ports.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Eddie Cai <eddie.cai.linux@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-04-04 20:01:57 -06:00
Jernej Skrabec
43b5c78d8d rockchip: cosmetic: Sort RK3288 boards
Sort rk3288 boards in alphabetical order.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Eddie Cai <eddie.cai.linux@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-04-04 20:01:57 -06:00
Philipp Tomsich
aad10a049d dts: rk3399: move rockchip, vbus-gpio properties into board-specific files
The (shared) rk3399.dtsi had defined the 'rockchip,vbus-gpio'
properties for each USB 3.0 controller.

As the GPIO usage will vary (e.g. one of those GPIOs shuts down one of
the regulators on the RK3399-Q7) between boards, we move this from the
shared dtsi into the device tree file for the EVB board which these
GPIO definitions match.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-04-04 20:01:57 -06:00
Philipp Tomsich
0b3ce83d7b defconfig: puma-rk3399: add defconfig for the RK3399-Q7 (Puma)
This commit adds the baseline defconfig for the RK3399-Q7 (Puma) SoM
(under the name 'puma-rk3399_defconfig') featuring the Rockchip RK3399
in a Qseven compatible module.

This subsumes the following changes:
 * defconfig: rk3399: migrate CONFIG_SPL_LIBCOMMON_SUPPORT/CONFIG_SPL_LIBGENERIC_SUPPORT
 * defconfig: rk3399-puma: add CONFIG_MMC_DW_ROCKCHIP
 * defconfig: rk3399-puma: disable CONFIG_SPL_OF_PLATDATA
 * defconfig: rk3399-puma: don't USE_TINY_PRINTF
 * defconfig: rk3399-puma: set up CONFIG_SYS_BOARD for the RK3399-Q7
 * defconfig: rk3399-puma: enable the multi-image loading via CONFIG_SPL_FIT
 * defconfig: rk3399-puma: SPL should be able to boot from MMC/SD card
 * defconfig: rk3399-puma: enable GMAC support
 * defconfig: rk3399-puma: enable support for SPI and Winbond SPI flash
 * defconfig: rk3399-puma: enable SPI as a boot-source in SPL
 * defconfig: rk3399-puma: disallow non-FIT images from being loaded
 * defconfig: rk3399-puma: rename to puma-rk3399
 * rockchip: config: rk3399: update defconfigs and rk3399_common

For the RK3399-Q7, we want a default boot-order of SPI -> MMC -> uSD.
This both follows how the BootROM probes devices and is a sane default
for customers in device-personalisation (e.g. it allows for quick and
easy factory programming of unpersonalised devices using an SD card)
and field usage (with customer devices expected to have their firmware
either in SPI or MMC).

However, when probing multiple interfaces (according to the result
from the board_boot_order function), we need to ensure that only valid
FIT images are considered and disable the fallback to assuming that a
raw (binary-only) U-Boot image is loaded (to avoid hangs/crashes from
jumping to random content loaded from devices that are probed, but
don't contain valid image content).

By disabling the SPL_RAW_IMAGE_SUPPORT and SPL_LEGACY_IMAGE_SUPPORT
options, we ensure that raw images (indistinguishable from random
data) are not considered for booting.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Simon Glass <sjg@chromium.org>
Drop CONFIG_DEBUG_UART_BOARD_INIT:
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-04 20:01:57 -06:00
Philipp Tomsich
3c2bbd5886 dts: rk3399-puma: add DTS for RK3399-Q7 (Puma) SoM
The RK3399-Q7 is a system-on-module featuring the Rockchip RK3399
in a Qseven-compatible form-factor.

These changes add a device-tree describing the board and its
interfaces for basic functionality (e.g. GbE, SPI, eMMC, SD-card).

This includes the following changes from the original development:

 * dts: rk3399-puma: include DTS for RK3399-Q7 SoM in the Makefile
 * dts: rk3399-puma: add gmac for the RK3399-Q7

This change enables the Gigabit Ethernet support on the RK3399-Q7.

 * dts: rk3399-puma: use serial0 for stdout
 * dts: rk3399-puma: prepare the sdmmc node for SPL booting
 * dts: rk3399-puma: enable spi1 and spi5, add /spi1/spiflash

The RK3399-Q7 (Puma) unsually (this is a build-time option for
customised boards) has an on-module SPI-flash connected to SPI1.
As of today, this is a Winbond W25Q32DW (32MBit) device.

The SPI5 controller is routed to the Q7 edge connector and provides
general-purpose SPI connectivity for customer base-boards.

With some minor improvements on integration into our outbound tree
 - explicitly modelled the SPI flash as 'spiflash' under spi0
   [dts: rk3399-puma: explicitly model spi-flash under spi1]
 - renamed the aliases to spi0 and spi1 to allow easier use of
   commands and legacy (SPL) infrastructure... i.e. the controllers
   will be 0 and 1 for 'sf probe', 'sspi', etc.
   [dts: rk3399-puma: rename aliases to number spi as 0 and 1 for commands]

 * dts: rk3399-puma: include SPI in the spl-boot-order property

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-04-04 20:01:57 -06:00