Commit Graph

4841 Commits

Author SHA1 Message Date
Simon Glass 6133683320 sandbox: Remove all drivers before exit
Drivers are supposed to be able to close down cleanly. To set a good example,
make sandbox shut down its driver model drivers and remove them before exit.

It may be desirable to do the same more generally once driver model is more
widely-used. This could be done during bootm, before U-Boot jumps to the OS.
It seems far too early to make this change.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-07-23 14:07:24 +01:00
Simon Glass 709ea543b9 stdio: Pass device pointer to stdio methods
At present stdio device functions do not get any clue as to which stdio
device is being acted on. Some implementations go to great lengths to work
around this, such as defining a whole separate set of functions for each
possible device.

For driver model we need to associate a stdio_dev with a device. It doesn't
seem possible to continue with this work-around approach.

Instead, add a stdio_dev pointer to each of the stdio member functions.

Note: The serial drivers have the same problem, but it is not strictly
necessary to fix that to get driver model running. Also, if we convert
serial over to driver model the problem will go away.

Code size increases by 244 bytes for Thumb2 and 428 for PowerPC.

22: stdio: Pass device pointer to stdio methods
       arm: (for 2/2 boards)  all +244.0  bss -4.0  text +248.0
   powerpc: (for 1/1 boards)  all +428.0  text +428.0

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
2014-07-23 14:07:23 +01:00
Simon Glass 91d0be1dd8 stdio: Remove redundant code around stdio_register() calls
There is no point in setting a structure's memory to NULL when it has
already been zeroed with memset().

Also, there is no need to create a stub function for stdio to call - if the
function is NULL it will not be called.

This is a clean-up, with no change in functionality.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
2014-07-23 14:07:23 +01:00
Simon Glass 29afe9e6ed sandbox: Support pre-relocation malloc()
Set up and zero global data before board_init_f() is called so that we can
remove the need for CONFIG_SYS_GENERIC_GLOBAL_DATA.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-07-23 14:06:13 +01:00
Simon Glass 4d94dfa059 sandbox: Set up global data before board_init_f()
At present sandbox defines CONFIG_SYS_GENERIC_GLOBAL_DATA, meaning that
the global_data pointer is set up in board_init_f().

If we set up and zero the global data before calling board_init_f() then we
don't need to define CONFIG_SYS_GENERIC_GLOBAL_DATA.

Make this change to simplify the init process.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-07-23 14:05:39 +01:00
Masahiro Yamada fbe79a17fd m68k: define __kernel_size_t as unsinged int again
Commit ddc94378d changed the definition of __kernel_size_t
from unsigned int to unsigned long.

It is true that it fixed warnings on some crosstools
but it increased warnings on the others.

The problem is that we cannot see consistency in terms of
the typedef of __kernel_size_t on M68K architecture.

However, I'd like to suggest to have __kernel_size_t to be
unsigned int again.

Rationale:

[1] Linux Kernel defines __kernel_size_t on M68K as unsigned int.
    Let's stick to the Linux's way.

[2] We want to build boards with popular pre-built toolchains,
    not the one locally-built by indivisuals.
    I think m68-linux-gcc which can be downloaded from www.kernel.org
    is the candidate for our _recommended_ toolchains.

With this patch, all the m68k boards can be built without any warnings.

Give it a try with the following crosstools:

https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.3/
x86_64-gcc-4.6.3-nolibc_m68k-linux.tar.xz

or

https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/
x86_64-gcc-4.9.0-nolibc_m68k-linux.tar.xz

(The latter is newer.)

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Jason Jin <Jason.jin@freescale.com>
2014-07-22 09:46:50 -04:00
Masahiro Yamada 9d78b9ae8d sparc: merge LEON2 and LEON3 linker scripts
There is only one line diff between LEON2 and LEON3 linker scripts:

  -             arch/sparc/cpu/leon2/start.o (.text)
  +             arch/sparc/cpu/leon3/start.o (.text)

They can be written in the same way:

                */start.o (.text)

So, board/gaisler/grsim_leon2/u-boot.lds
and arch/sparc/cpu/leon3/u-boot.lds
can be merged into arch/sparc/cpu/u-boot.lds.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Daniel Hellstrom <daniel@gaisler.com>
2014-07-22 07:44:24 -04:00
Masahiro Yamada 9f847b8201 sparc: merge LEON3 linker scripts
The linker scripts of LEON3

 - board/gaisler/grsim/u-boot.lds
 - board/gaisler/gr_cpci_ax2000/u-boot.lds
 - board/gaisler/gr_ep2s60/u-boot.lds
 - board/gaisler/gr_xc3s_1500/u-boot.lds

are the same (except cosmetic differences such as indentation).

This commit merges them into arch/sparc/cpu/leon3/u-boot.lds.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Daniel Hellstrom <daniel@gaisler.com>
2014-07-22 07:44:24 -04:00
Tom Rini 84f24ac827 Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2014-07-11 14:54:48 -04:00
Eric Nelson e153333eeb i.MX6DL/S: add drive-strength back to pads DISP0_DAT2/DAT10
The pad settings for DISP0_DATA02 and DISP0_DAT10 were not
set in the same way as DISP0_DAT00-23, causing much flicker
in parallel RGB displays on Dual-Lite and Solo processors.

These settings now match the i.MX6 Dual and Quad core versions.

Note that this fixes a regression in commit b47abc3 and that
this is the second time we've had a regression on these two
pads (See commit e654ddf).

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
2014-07-10 15:23:56 +02:00
Felipe Balbi 5ba95541b7 usb: phy: omap_usb_phy: implement usb_phy_power() for AM437x
Newer AM437x silicon requires us to explicitly power up
the USB2 PHY. By implementing usb_phy_power() we can
achieve that.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-07-09 22:11:51 +02:00
Tom Rini 22692ec0fb Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2014-07-09 09:21:51 -04:00
Fabio Estevam 157f45da91 mx6: soc: Update the comments of set_ldo_voltage()
Commit 3d622b78 (mx6: soc: Introduce set_ldo_voltage()) introduces
set_ldo_voltage() function that can be used to set the voltages
of any of the three LDO regulators controlled by the PMU_REG_CORE register.

Prior to this commit there was a single set_vddsoc() which only configured the
VDDSOC regulator.

Update the comments to align with the new set_ldo_voltage() implementation.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-07-09 15:10:10 +02:00
Andre Renaud 2eb268f6fd MX6: Correct calculation of PLL_SYS
DIV_SELECT is used as Fout = Fin * div_select / 2.0, so we should do
the shift after the multiply to avoid rounding errors

Signed-off-by: Andre Renaud <andre@bluewatersys.com>
2014-07-09 14:55:30 +02:00
Alexey Ignatov 072b2d8872 kmake: include DTB section into u-boot.bin if CONFIG_OF_EMBED enabled
Fixes a bug when objcopy doesn't put .dtb.init.rodata section to resulting
u-boot.bin, so u-boot was unable to find embedded DTB.
2014-07-07 19:47:24 -04:00
Masahiro Yamada 443a2ec57a blackfin, powerpc: remove redundant definitions of ARRAY_SIZE
Since ARRAY_SIZE macro is defined in include/common.h,
re-defining it in arch-specific files is redundant.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
2014-07-07 19:47:12 -04:00
Vasili Galka a91fd00175 blackfin: Add more dcache functions
Add invalidate_dcache_range() and flush_dcache_range() for the blackfin
architecture. Such functions already exist on this arch with different
names, so just forward the call.

This fixes the build of bf609-ezkit board as it uses
drivers/net/designware.c which requires the above functions.

Cc: Sonic Zhang <sonic.adi@gmail.com>, Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vasili Galka <vvv444@gmail.com>
2014-07-07 19:47:11 -04:00
Vasili Galka fa28179d2c m68k: Fix incorrect memory access on M5235
The csarX and cscrX registers in the fbcs_t struct are 16-bit for
CONFIG_M5235 and 32-bit wide otherwise. The code in cpu_init.c
accessed them always as 32-bit, effectively creating a wrong memory
access on M5235. Fixed that by choosing out_be16/out_be32 depending
on whether CONFIG_M5235 is defined or not.

Cc: Jason Jin <Jason.jin@freescale.com>
Signed-off-by: Vasili Galka <vvv444@gmail.com>
2014-07-07 19:47:08 -04:00
Vasili Galka 6b02d06feb m68k: Fix bug, "address of" operator was forgotten
in_be16() shall be passed a pointer to register and not its value. This
is clearly a typo resulting in a wrong memory access, so fix it.

Cc: Alison Wang <b18965@freescale.com>, Jason Jin <Jason.jin@freescale.com>
Signed-off-by: Vasili Galka <vvv444@gmail.com>
2014-07-07 19:47:07 -04:00
Masahiro Yamada 98ad54beb5 mpc8xx: remove spc1920 board support
This board is old enough and has no maintainer.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-07-07 19:43:02 -04:00
Masahiro Yamada 03f9d7d174 mpc8xx: remove fads board support
These boards are old enough and have no maintainers.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-07-07 19:43:02 -04:00
Masahiro Yamada c51c1c9af9 mpc8xx: remove netta, netta2, netphone board support
These boards are old enough and have no maintainers.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-07-07 19:43:02 -04:00
Masahiro Yamada 0657e46e28 mpc8xx: remove RPXlite_dw, quantum board support
These boards are old enough and have no maintainers.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-07-07 19:43:01 -04:00
Masahiro Yamada dab0f7626e mpc8xx: remove qs850, qs860t board support
These boards are old enough and have no maintainers.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-07-07 19:43:01 -04:00
Cooper Jr., Franklin 8038b497e7 am43xx: Tune the system to avoid DSS underflows
* This is done by limiting the ARM's bandwidth and setting DSS priority in
  the EMIF controller to ensure underflows do not occur.
2014-07-07 19:42:34 -04:00
Franklin S. Cooper Jr 2c95211167 am43xx: Update EMIF DDR3 Configuration for AM43x GP
* Boot failures have been discovered due to a combination of routing issues and
  non optimal ddr3 timings in the EMIF
* Since ddr3 timings are different after significant board layout changes
  different timings are required for alpha, beta and production boards.

Signed-off-by: Franklin S. Cooper Jr <fcooper@ti.com>
2014-07-07 19:42:34 -04:00
Masahiro Yamada a8b0f9b685 build: define CPU only when arch/${ARCH}/cpu/${CPU} exists
The directory arch/${ARCH}/cpu/${CPU} does not exist
in avr32, blackfin, microblaze, nios2, openrisc, sandbox, x86.

These architectures have only one CPU type.
Defining CPU should not be required for such architectures.

This commit allows cpu field (= the 3rd field of boards.cfg)
to be kept blank.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Sonic Zhang <sonic.zhang@analog.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Thomas Chou <thomas@wytron.com.tw>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
2014-07-07 19:42:34 -04:00
Jeroen Hofstee 878cae6b02 ARM: emif4: wait for CM_DLL_READYST to be set
The code intends for the CM_DLL_READYST to be set, but
actually polls till any bit is set since the logical
AND is used instead of the bitwise one is used. Fix it.

cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-07-07 19:42:33 -04:00
Tom Rini 6ee3d00d1d Merge branch 'master' of git://git.denx.de/u-boot-i2c 2014-07-07 10:10:52 -04:00
Chin Liang See 23f23f23d5 socfpga: Relocate arch common functions away from board
To move the arch common function away from board folder to
arch/arm/cpu/armv7/socfpga folder. Its to avoid code duplication
for other non Altera dev kit which is using socfpga device.

Signed-off-by: Chin Liang See <clsee@altera.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Pavel Machek <pavel@denx.de>
Cc: Dinh Nguyen <dinguyen@altera.com>
Acked-by: Detlev Zundel <dzu@denx.de>
2014-07-05 10:14:46 +02:00
Shaibal.Dutta fe0d925299 arm: Fix armv8 compilation error
Fix following compilation error when CONFIG_ARM64 is defined

Error: unknown or missing system register name at operand 2
-- `mrs x0,daifmsr daifset,#3'

Signed-off-by: Shaibal.Dutta <shaibal.dutta@broadcom.com>
Signed-off-by: Darwin Rambo <drambo@broadcom.com>
Reviewed-by: Darwin Rambo <drambo@broadcom.com>
2014-07-05 09:30:20 +02:00
Jeroen Hofstee ed6c7f7f6e arm: spl: fix include guard
cc: Tom Rini <trini@ti.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-07-05 09:28:21 +02:00
Chin Liang See dc4d4aa14b socfpga: Adding Scan Manager driver
Scan Manager driver will be called to configure the IOCSR
scan chain. This configuration will setup the IO buffer settings

Signed-off-by: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Wolfgang Denk <wd@denx.de>
CC: Pavel Machek <pavel@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
2014-07-05 00:27:27 +02:00
Chin Liang See 05b884b5cd socfpga: Adding DesignWare watchdog support
To enable the DesignWare watchdog support at SOCFPGA
Cyclone V dev kit.

Signed-off-by: Chin Liang See <clsee@altera.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@ti.com>
2014-07-05 00:24:18 +02:00
Sergey Kostanbaev 7237d22baa arm: ep9315: Return back Cirrus Logic EDB9315A board support
This patch returns back support for old ep93xx processors family

Signed-off-by: Sergey Kostanbaev <sergey.kostanbaev@gmail.com>
Cc: albert.u.boot@aribaud.net
2014-07-04 23:45:48 +02:00
Jeroen Hofstee fcfddfd504 ARM: cache_v7: use __weak
This is not only more readable but also prevents a warning
about a missing prototype. The prototypes which are actually
missing are added.

cc: Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Reviewed-by: Tom Rini <trini@ti.com>
2014-07-04 19:57:22 +02:00
York Sun f749db3a75 ARMv8/ls2085a_emu: Add LS2085A emulator and simulator board support
LS2085A is an ARMv8 implementation. This adds board support for emulator
and simulator:
  Two DDR controllers
  UART2 is used as the console
  IFC timing is tightened for speedy booting
  Support DDR3 and DDR4 as separated targets
  Management Complex (MC) is enabled
  Support for GIC 500 (based on GICv3 arch)

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Arnab Basu <arnab.basu@freescale.com>
Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@freescale.com>
2014-07-04 19:48:41 +02:00
J. German Rivera b940ca64b2 armv8/fsl-lsch3: Add support to load and start MC Firmware
Adding support to load and start the Layerscape Management Complex (MC)
firmware. First, the MC GCR register is set to 0 to reset all cores. MC
firmware and DPL images are copied from their location in NOR flash to
DDR. MC registers are updated with the location of these images.
Deasserting the reset bit of MC GCR register releases core 0 to run.
Core 1 will be released by MC firmware. Stop bits are not touched for
this step. U-boot waits for MC until it boots up. In case of a failure,
device tree is updated accordingly. The MC firmware image uses FIT format.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
Signed-off-by: Shruti Kanetkar <Shruti@Freescale.com>
2014-07-03 08:40:58 +02:00
York Sun 2f78eae506 ARMv8/FSL_LSCH3: Add FSL_LSCH3 SoC
Freescale LayerScape with Chassis Generation 3 is a set of SoCs with
ARMv8 cores and 3rd generation of Chassis. We use different MMU setup
to support memory map and cache attribute for these SoCs. MMU and cache
are enabled very early to bootst performance, especially for early
development on emulators. After u-boot relocates to DDR, a new MMU
table with QBMan cache access is created in DDR. SMMU pagesize is set
in SMMU_sACR register. Both DDR3 and DDR4 are supported.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
Signed-off-by: Arnab Basu <arnab.basu@freescale.com>
2014-07-03 08:40:51 +02:00
York Sun 22932ffc03 ARMv8: Adjust MMU setup
Make MMU function reusable. Platform code can setup its own MMU tables.

Signed-off-by: York Sun <yorksun@freescale.com>
CC: David Feng <fenghua@phytium.com.cn>
2014-07-03 08:40:48 +02:00
J. German Rivera 0d031e046c Added 64-bit MMIO accessors for ARMv8
This is needed for accessing peripherals with 64-bit MMIO registers,
from ARMv8 processors.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
2014-07-03 08:40:31 +02:00
Darwin Rambo 261d27605c arm: Add support for semihosting for armv8 fastmodel targets.
The armv8 ARM Trusted Firmware (ATF) can be used to load various ATF
images and u-boot, and does this for virtual platforms by using
semihosting. This commit extends this idea by allowing u-boot to also
use semihosting to load the kernel/ramdisk/dtb. This eliminates the need
for a bootwrapper and produces a more realistic boot sequence with
virtual models.

Though the semihosting code is quite generic, support for armv7 in
fastmodel is less useful due to the wide range of available silicon
and the lack of a free armv7 fastmodel, so this change contains an
untested armv7 placeholder for the service trap opcode.

Please refer to doc/README.semihosting for a more detailed description
of semihosting and how it is used with the armv8 virtual platforms.

Signed-off-by: Darwin Rambo <drambo@broadcom.com>
Cc: trini@ti.com
Cc: fenghua@phytium.com.cn
Cc: bhupesh.sharma@freescale.com
2014-07-03 08:35:45 +02:00
Stephen Warren 68049a082b i2c: tegra: use repeated start for reads
I2C read transactions are typically implemented as follows:

START(write) address REPEATED_START(read) data... STOP

However, Tegra's I2C driver currently implements reads as follows:

START(write) address STOP START(read) data... STOP

This sequence confuses at least the AS3722 PMIC on the Jetson TK1 board,
leading to corrupted read data in some cases. Fix the driver to chain
the transactions together using repeated starts to solve this.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Yen Lin <yelin@nvidia.com>
2014-07-03 06:29:19 +02:00
Albert ARIBAUD 304f936aea Merge remote-tracking branch 'u-boot-samsung/master'
Conflicts:
	boards.cfg

Conflict was trivial between goni maintainer change and
lager_nor removal.
2014-07-01 20:52:51 +02:00
Albert ARIBAUD 019b57cc1d Merge branch 'u-boot-tegra/master' into 'u-boot-arm/master' 2014-07-01 15:48:25 +02:00
Albert ARIBAUD e99f30e105 Merge branch 'u-boot-ti/master' into 'u-boot-arm/master' 2014-07-01 15:11:18 +02:00
Albert ARIBAUD d6694aff56 Merge branch 'u-boot-imx/master' into 'u-boot-arm/master' 2014-06-30 23:00:34 +02:00
Stefano Babic 5d2ad2bc33 vf610: fix build due to missing sys_proto.h
commit 67a04ab3ab
fix the build for MX25. The same error
happens for VF610 SOC.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2014-06-25 12:48:06 +02:00
Albert ARIBAUD 01a3647abd Merge branch 'u-boot-microblaze/zynq' into 'u-boot-arm/master' 2014-06-25 10:40:23 +02:00
Albert ARIBAUD ed1d98d801 Merge branch 'u-boot/master' into 'u-boot-arm/master' 2014-06-25 10:39:58 +02:00