]> git.kernelconcepts.de Git - karo-tx-uboot.git/log
karo-tx-uboot.git
8 years agonet: Move CONFIG_E1000 options to Kconfig
Simon Glass [Wed, 19 Aug 2015 15:33:43 +0000 (09:33 -0600)]
net: Move CONFIG_E1000 options to Kconfig

Move config for the E1000 Ethernet driver to Kconfig and tidy up affected
boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agoTidy up some defconfig files
Simon Glass [Wed, 19 Aug 2015 15:33:42 +0000 (09:33 -0600)]
Tidy up some defconfig files

Several files are out of order. This means that when the moveconfig tool
moves CONFIG options to Kconfig it generates a large diff. To avoid this,
reorder the files first.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agonet: e1000: Add Kconfig options
Simon Glass [Wed, 19 Aug 2015 15:33:41 +0000 (09:33 -0600)]
net: e1000: Add Kconfig options

Add Kconfig options in preparation for moving boards to use Kconfig.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: e1000: Convert to driver model
Simon Glass [Wed, 19 Aug 2015 15:33:40 +0000 (09:33 -0600)]
net: e1000: Convert to driver model

Update this driver to support driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Apalis T30 2GB on Apalis Evaluation Board

8 years agonet: e1000: Prepare for driver model conversion
Simon Glass [Wed, 19 Aug 2015 15:33:39 +0000 (09:33 -0600)]
net: e1000: Prepare for driver model conversion

Since struct eth_device does not exist with CONFIG_DM_ETH defined, avoid
using it in the driver unless necessary. Most of the time it is better to
pass the private driver pointer anyway.

Also refactor the code so that code that the driver model implementation
will share are available in functions that can be called. Add stubs where
necessary.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Apalis T30 2GB on Apalis Evaluation Board

8 years agonet: e1000: Move #include of common.h to the C files
Simon Glass [Wed, 19 Aug 2015 15:33:38 +0000 (09:33 -0600)]
net: e1000: Move #include of common.h to the C files

We cannot currently include any header files in the C files since common.h
needs to be included first, and it is in the header file. Move it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Apalis T30 2GB on Apalis Evaluation Board

8 years agonet: Return -EINTR when ctrl+c is pressed
Michal Simek [Fri, 21 Aug 2015 06:49:48 +0000 (08:49 +0200)]
net: Return -EINTR when ctrl+c is pressed

Current behavior is that if CTRL+C is pressed command returns 0 that was
successful which is not correct behavior.
The easiest test case is "tftpboot 80000 uImage && echo yes"
and press CTRL+C. Then the second command is called which is incorrect.

Error log:
zynq-uboot> tftpb 80000 uImage && echo yes
Gem.e000b000:7 is connected to Gem.e000b000.  Reconnecting to
Gem.e000b000
Gem.e000b000 Waiting for PHY auto negotiation to complete....... done
Using Gem.e000b000 device
TFTP from server 192.168.0.102; our IP address is 192.168.0.101
Filename 'uImage'.
Load address: 0x80000
Loading: ################
Abort
yes
zynq-uboot>

This patch adds -EINTR return value when CTRL+C is pressed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: e1000: Support 64-bit physical address
Mingkai Hu [Tue, 18 Aug 2015 21:06:26 +0000 (14:06 -0700)]
net: e1000: Support 64-bit physical address

High 32-bit address is needed when u-boot runs in 64-bit space.
Tested on armv8-based LS2085ARDB.

Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
Signed-off-by: York Sun <yorksun@freescale.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agotftp: adjust settings to be suitable for 100Mbit ethernet
Pavel Machek [Tue, 18 Aug 2015 12:34:26 +0000 (14:34 +0200)]
tftp: adjust settings to be suitable for 100Mbit ethernet

Adjust timouts and retry counts to be suitable for loaded ethernet
network. With 5 seconds timeout, 10 retries maximum, tftp is
impossible even on local network with single full-speed TCP
connection.

100msec timeout should be suitable for most networks tftp is used on,
that is local ethernets. Timeout count really needs to be way higher,
as lost packets are normal when TCP is running over the same network.

Enforce 10msec minimum.

Signed-off-by: Pavel Machek <pavel@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agoARM: at91: sama5: update the spi flash mapping
Wu, Josh [Wed, 19 Aug 2015 11:11:21 +0000 (19:11 +0800)]
ARM: at91: sama5: update the spi flash mapping

Also move the spi flash configurations to the at91-sama5_common.h.

Current at91 zImage size is about 3.3M, the old mapping is not
suitable. So update the spi flash map as following:
0x0      ~ 0x004000: at91bootstrap(16k)
0x04000  ~ 0x008000: u-boot env(16k)
0x08000  ~ 0x060000: u-boot(352k)
0x60000  ~ 0x06c000: dtb (48k)
0x6c000  ~ 0x400000: kernel (3M+592k)

In AT91Bootstrap, the U-Boot in spi flash also update to 0x8000, refer
to following commit in AT91Bootstrap:
3e91e54 Kconfig: fix spi flash address

So also update SPL's u-boot load address to 0x8000 in spi flash.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoARM: at91: sama5: move the nandflash env config to at91-sama5_common.h
Wu, Josh [Wed, 19 Aug 2015 11:11:20 +0000 (19:11 +0800)]
ARM: at91: sama5: move the nandflash env config to at91-sama5_common.h

As all sama5 nandflash env configurations are same, so move them to
at91-sama5_common.h.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
8 years agoARM: at91: sama5d3xek: use a $dtb_name to load dtb
Wu, Josh [Wed, 19 Aug 2015 11:11:19 +0000 (19:11 +0800)]
ARM: at91: sama5d3xek: use a $dtb_name to load dtb

Since sama5d3xek boards has different type of dtb blobs, so we need to detect
the cpu type in runtime.

So we add a new variable $dtb_name. if $dtb_name is not defined, we just use
at91-${board_name}.dtb

as the $dtb_name. Otherwise, we will just load the dtb with
$dtb_name.

For sama5d3xek, we will detect cpu type and make up $dtb_name in
runtime.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
8 years agoARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h
Wu, Josh [Wed, 19 Aug 2015 11:11:18 +0000 (19:11 +0800)]
ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h

As almost all sama5 sd/mmc env configurations are same, so move them to
at91-sama5_common.h.

Also define CONFIG_ENV_VARS_UBOOT_CONFIG to have the varaible: $board_name.
Then we can use 'at91-${board_name}.dtb' as the dtb name.

TODO: since sama5d3xek has different dtb name, we need to some extra
stuff to make it work on sama5d3xek boards.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
8 years agoarm: at91: add support for mini-box picosam9g45 board
Erik van Luijk [Mon, 17 Aug 2015 10:47:34 +0000 (12:47 +0200)]
arm: at91: add support for mini-box picosam9g45 board

Bootlog:
U-Boot SPL 2015.10-rc1-00452-g96a7ed1 (Aug 17 2015 - 10:32:21)
mci: setting clock 258000 Hz, block size 512
mci: setting clock 258000 Hz, block size 512
mci: setting clock 258000 Hz, block size 512
mci: setting clock 33024000 Hz, block size 512
reading u-boot.img
reading u-boot.img

U-Boot 2015.10-rc1-00452-g96a7ed1 (Aug 17 2015 - 10:32:21 +0000)

CPU: AT91SAM9G45
Crystal frequency:       12 MHz
CPU clock        :      400 MHz
Master clock     :  133.333 MHz
       Watchdog enabled
DRAM:  256 MiB
WARNING: Caches not enabled
MMC:   mci: 0
mci: setting clock 260416 Hz, block size 512
mci: setting clock 260416 Hz, block size 512
mci: setting clock 260416 Hz, block size 512
mci: setting clock 33333333 Hz, block size 512
reading uboot.env
In:    serial
Out:   serial
Err:   serial
Net:   macb0
Error: macb0 address not set.

Hit any key to stop autoboot:  0
U-Boot>

Signed-off-by: Erik van Luijk <evanluijk@interact.nl>
[add 'picosam9g45_defconfig' to MAINTAINERS]
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoarm: at91: pmc: replace the constant with a define in at91_pmc.h
Erik van Luijk [Thu, 13 Aug 2015 13:43:20 +0000 (15:43 +0200)]
arm: at91: pmc: replace the constant with a define in at91_pmc.h

To enable the clocks on the at91 boards a constant (0x4) is used.
This is replaced with a define in at91_pmc.h (1 <<  2).

Signed-off-by: Erik van Luijk <evanluijk@interact.nl>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoarm: at91: at91sam9m10g45ek/corvus remove useless chip select 1 init
Erik van Luijk [Thu, 13 Aug 2015 13:43:19 +0000 (15:43 +0200)]
arm: at91: at91sam9m10g45ek/corvus remove useless chip select 1 init

On these boards the DDR is connected to a dedicated controller and not
to chip select 1 of the EBI.

Signed-off-by: Erik van Luijk <evanluijk@interact.nl>
Tested-by: Erik van Luijk <evanluijk@interact.nl>
8 years agoarm: at91: mpddr: allow multiple DDR controllers
Erik van Luijk [Thu, 13 Aug 2015 13:43:18 +0000 (15:43 +0200)]
arm: at91: mpddr: allow multiple DDR controllers

The mpddr.c depends on ATMEL_BASE_MPDDRC for the base address to configure the controller.
This cannot be used when there is more than one controller (i.e. AT91SAM9G45, AT91SAM9M10).

Signed-off-by: Erik van Luijk <evanluijk@interact.nl>
[remove 'new blank line at EOF']
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoMIPS: fix syntax for fdt_chosen/initrd.
Govindraj Raja [Wed, 19 Aug 2015 18:19:15 +0000 (19:19 +0100)]
MIPS: fix syntax for fdt_chosen/initrd.

The syntax for the fdt_chosen/initrd
functions seem to deprecated in usage
from MIPS bootm implementation.

Third parameter is no more used in these api's
Refer to : include/fdt_support.h

Signed-off-by: Govindraj Raja <govindraj.raja@imgtec.com>
8 years agomips: Use unsigned int when reading c0 registers
Chris Packham [Tue, 14 Jul 2015 10:54:41 +0000 (22:54 +1200)]
mips: Use unsigned int when reading c0 registers

In commit a18a477 (MIPS: use common code from lib/time.c) MIPS platforms
started using common the common timer functions which are based around
the fact that many platforms have a 32-bit free running counter register
that can be used see commit 8dfafdd (Introduce common timer functions).

Even MIPS64 has such a 32-bit register (some have an additional 64-bit free
running counter, but that's something for another time).

The problem is that in __read_32bit_c0_register() we read the value from
this register into an _signed_ int and as it's returned up the call
chain to timer_read_counter() it gets assigned to an unsigned long. On a
32-bit system there is no problem. On a 64-bit system odd things happen,
sign extension seems to kick in and all of a sudden if the counter
register happens to have the MSb (i.e. the sign bit) set the negative
int gets sign extended into a very large unsigned long value. This in
turn throws out things from get_ticks() up.

Update __read_32bit_c0_register() and __read_32bit_c0_ctrl_register() to
use "unsigned int res;" instead of "int res;". There seems to be little
reason to treat these register values as signed. They are either
counters (which by definition are unsigned) or are made up of various
bit fields to be interpreted as per the CPU datasheet.

Reported-by: Sachin Surendran <sachin.surendran@alliedtelesis.co.nz>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
8 years agoARM: davinci: remove support for cam_enc_4xx
Masahiro Yamada [Thu, 20 Aug 2015 01:20:55 +0000 (10:20 +0900)]
ARM: davinci: remove support for cam_enc_4xx

This has not been converted to Generic Board, so should be removed.
(See doc/README.generic-board for details.)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
8 years agousb: dwc2: Rename to dwc2_usb
Marek Vasut [Wed, 12 Aug 2015 20:19:15 +0000 (22:19 +0200)]
usb: dwc2: Rename to dwc2_usb

This driver is not used only on exynos, but also on Altera SoCFPGA,
HiSilicon SoCs, RPi etc, so rename it accordingly to prevent confusion.

Signed-off-by: Marek Vasut <marex@denx.de>
8 years agousb: dwc2: Add original Synopsys compat string
Marek Vasut [Wed, 12 Aug 2015 20:19:14 +0000 (22:19 +0200)]
usb: dwc2: Add original Synopsys compat string

Add the Synopsys compatible string. This is used in SoCFPGA DT files.

Signed-off-by: Marek Vasut <marex@denx.de>
8 years agousb: gadget: ether: populate _reset_ callback
Kishon Vijay Abraham I [Wed, 19 Aug 2015 08:19:48 +0000 (13:49 +0530)]
usb: gadget: ether: populate _reset_ callback

populate _reset_ callback to the USB ethernet gadget since UDC core
expects every gadget driver to have the reset callback. This shouldn't
be needed once the ethernet gadget driver is adapted to use the
composite driver.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agousb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop
Kishon Vijay Abraham I [Wed, 19 Aug 2015 08:19:47 +0000 (13:49 +0530)]
usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop

xhci omap driver has board_usb_init in xhci_hcd_init but doesn't have
the corresponding cleanup function in xhci_hcd_stop.

Fix it here by invoking board_usb_cleanup() in xhci_hcd_stop().

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agousb: gadget: ether: Perform board initialization from ethernet gadget driver
Kishon Vijay Abraham I [Wed, 19 Aug 2015 08:19:46 +0000 (13:49 +0530)]
usb: gadget: ether: Perform board initialization from ethernet gadget driver

Ethernet gadget driver can be used both by both SPL and u-boot. Since
usb_eth_init() is the entry point for ethernet gadget driver, perform
board initialization there. Also perform the cleanup in usb_eth_halt.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agousb: xhci: Fix a potential NULL pointer dereference
Sergey Temerkhanov [Mon, 17 Aug 2015 12:38:07 +0000 (15:38 +0300)]
usb: xhci: Fix a potential NULL pointer dereference

This patch fixes a potential NULL pointer dereference arising on
non-present/non-initialized xHCI controllers and adds some error
handling to xHCI code

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
8 years agousb: spear: Add support for both SPEAr600 EHCI controllers
Stefan Roese [Tue, 18 Aug 2015 07:27:18 +0000 (09:27 +0200)]
usb: spear: Add support for both SPEAr600 EHCI controllers

USB EHCI on SPEAr600 has not been tested for a while. The base controller
addresses are missing. This patch adds the defines to the header. And adds
the missing code.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Vipin Kumar <vk.vipin@gmail.com>
Cc: Marek Vasut <marex@denx.de>
8 years agoimx: usb: ehci-mx6: wait_for_bit to check reg status
Adrian Alonso [Thu, 6 Aug 2015 20:46:03 +0000 (15:46 -0500)]
imx: usb: ehci-mx6: wait_for_bit to check reg status

Add wait_for_bit to check reg bit status and replace unbounded
loops to check usb command status

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
8 years agoimx: usb: ehci-mx6: add usb support for imx7d soc
Adrian Alonso [Thu, 6 Aug 2015 20:43:17 +0000 (15:43 -0500)]
imx: usb: ehci-mx6: add usb support for imx7d soc

Extend ehci-mx6 usb driver to support imx7d usb

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
8 years agoimx: usb: ehci-mx6: document board specific functions
Adrian Alonso [Thu, 6 Aug 2015 20:43:16 +0000 (15:43 -0500)]
imx: usb: ehci-mx6: document board specific functions

Document target board specific functions

board_ehci_hcd_init - override usb phy mode
board_ehci_hcd_init - set usb vbus voltage
board_ehci_power - enables/disables usb vbus voltage

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
8 years agoimx: usb: ehci-mx6: reg accessor cleanups
Adrian Alonso [Thu, 6 Aug 2015 20:43:15 +0000 (15:43 -0500)]
imx: usb: ehci-mx6: reg accessor cleanups

Cleanup read/write register access, use clr/set bits_le32

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
8 years agozynqmp: enable CONFIG_NET_RANDOM_ETHADDR
Michal Simek [Wed, 12 Aug 2015 10:58:54 +0000 (12:58 +0200)]
zynqmp: enable CONFIG_NET_RANDOM_ETHADDR

We have to set a MAC address to use network.
Otherwise, the tftpboot command fails with the following message:

  Gem.e000b000 Waiting for PHY auto negotiation to complete........ done
  *** ERROR: `ethaddr' not set

Since commit 92ac52082140 ("net: Remove all references to
CONFIG_ETHADDR and friends"), we can not use CONFIG_ETHADDR.

The easiest way to set a MAC address is to enable
CONFIG_NET_RANDOM_ETHADDR.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoARM: dts: Rename memory@0 to memory
Michal Simek [Wed, 12 Aug 2015 09:25:05 +0000 (11:25 +0200)]
ARM: dts: Rename memory@0 to memory

zynq-7000.dtsi include skeleton.dtsi which contains memory node with
base address and size zero. If you add memory@0 node to the platform DTS
in final DTB there are two memory nodes and U-Boot works with the first
one (with zeros) which end up in failing in dram_init because size is
zero.
Platform memory node should rewrite default memory node setup from
skeleton.dtsi that's why platfroms needs to also use memory as node name
instead of memory@0.

Reported-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agozynq: enable CONFIG_NET_RANDOM_ETHADDR
Masahiro Yamada [Fri, 17 Jul 2015 11:26:06 +0000 (20:26 +0900)]
zynq: enable CONFIG_NET_RANDOM_ETHADDR

We have to set a MAC address to use network.
Otherwise, the tftpboot command fails with the following message:

  Gem.e000b000 Waiting for PHY auto negotiation to complete........ done
  *** ERROR: `ethaddr' not set

Since commit 92ac52082140 ("net: Remove all references to
CONFIG_ETHADDR and friends"), we can not use CONFIG_ETHADDR.

The easiest way to set a MAC address is to enable
CONFIG_NET_RANDOM_ETHADDR.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agozynq: Make CONFIG_OF_EMBED default case
Michal Simek [Mon, 3 Aug 2015 12:21:25 +0000 (14:21 +0200)]
zynq: Make CONFIG_OF_EMBED default case

Use embedded DTB to let users use u-boot instead of u-boot-dtb.bin.
And fix SPL to use this target.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agozynqmp: usb: Add usb dwc3 driver support for zynqmp
Siva Durga Prasad Paladugu [Tue, 4 Aug 2015 07:33:26 +0000 (13:03 +0530)]
zynqmp: usb: Add usb dwc3 driver support for zynqmp

Added usb dwc3 driver support for zynqmp
this also supports the DFU and LTHOR to download
the linux images on to RAM and cen be booted from
those linux images.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoARM: zynq: drop "optional" from board select in favor of ZC702
Masahiro Yamada [Sat, 1 Aug 2015 07:39:54 +0000 (16:39 +0900)]
ARM: zynq: drop "optional" from board select in favor of ZC702

One disadvantage of commit a26cd04920dc (arch: Make board selection
choices optional) is that Kconfig could create such an insane
.config file that no board is selected.

Rip off the "optional" again in favor of ZC702 as the default
target.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoboard: Xilinx: zynqmp: Define checkboard() function
Siva Durga Prasad Paladugu [Tue, 4 Aug 2015 07:31:05 +0000 (13:01 +0530)]
board: Xilinx: zynqmp: Define checkboard() function

Define checkboard() function for zynqMP

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoconfigs: zynqmp: Enable networking by default for EP108
Michal Simek [Mon, 3 Aug 2015 11:19:39 +0000 (13:19 +0200)]
configs: zynqmp: Enable networking by default for EP108

Enable networking for EP108 by default.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoARM: zynqmp_ep: Enable ethernet for EP
Michal Simek [Thu, 30 Jul 2015 10:50:26 +0000 (12:50 +0200)]
ARM: zynqmp_ep: Enable ethernet for EP

Enable gem0 and setup phy addr for EP.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoARM: zynqmp: Add platform specific arch_get_page_table
Michal Simek [Wed, 5 Aug 2015 05:50:16 +0000 (07:50 +0200)]
ARM: zynqmp: Add platform specific arch_get_page_table

Based on the patch:
"armv8: caches: Added routine to set non cacheable region"
(sha1: dad17fd51027ad02ac8f02deed186d08109d61fd)
it is necessary to add platform specific hook.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agozynqmp: Enable U-Boot run in EL3
Michal Simek [Wed, 29 Jul 2015 11:10:02 +0000 (13:10 +0200)]
zynqmp: Enable U-Boot run in EL3

Enable Secure IOU setup to enable U-Boot to run in EL3 without
setting from ATF.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoof: clean up OF_CONTROL ifdef conditionals
Masahiro Yamada [Tue, 11 Aug 2015 22:31:55 +0000 (07:31 +0900)]
of: clean up OF_CONTROL ifdef conditionals

We have flipped CONFIG_SPL_DISABLE_OF_CONTROL.  We have cleansing
devices, $(SPL_) and CONFIG_IS_ENABLED(), so we are ready to clear
away the ugly logic in include/fdtdec.h:

 #ifdef CONFIG_OF_CONTROL
 # if defined(CONFIG_SPL_BUILD) && !defined(SPL_OF_CONTROL)
 #  define OF_CONTROL 0
 # else
 #  define OF_CONTROL 1
 # endif
 #else
 # define OF_CONTROL 0
 #endif

Now CONFIG_IS_ENABLED(OF_CONTROL) is the substitute.  It refers to
CONFIG_OF_CONTROL for U-boot proper and CONFIG_SPL_OF_CONTROL for
SPL.

Also, we no longer have to cancel CONFIG_OF_CONTROL in
include/config_uncmd_spl.h and scripts/Makefile.spl.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
8 years agoof: flip CONFIG_SPL_DISABLE_OF_CONTROL into CONFIG_SPL_OF_CONTROL
Masahiro Yamada [Tue, 11 Aug 2015 22:31:54 +0000 (07:31 +0900)]
of: flip CONFIG_SPL_DISABLE_OF_CONTROL into CONFIG_SPL_OF_CONTROL

As we discussed a couple of times, negative CONFIG options make our
life difficult; CONFIG_SYS_NO_FLASH, CONFIG_SYS_DCACHE_OFF, ...
and here is another one.

Now, there are three boards enabling OF_CONTROL on SPL:
 - socfpga_arria5_defconfig
 - socfpga_cyclone5_defconfig
 - socfpga_socrates_defconfig

This commit adds CONFIG_SPL_OF_CONTROL for them and deletes
CONFIG_SPL_DISABLE_OF_CONTROL from the other boards to invert
the logic.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agofdtdec: fix OF_CONTROL switch
Masahiro Yamada [Tue, 11 Aug 2015 22:31:53 +0000 (07:31 +0900)]
fdtdec: fix OF_CONTROL switch

There is no case where defined(SPL_DISABLE_OF_CONTROL) is true.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodm: drop CONFIG_DM_DEVICE_REMOVE from uncmd list
Masahiro Yamada [Tue, 11 Aug 2015 22:31:52 +0000 (07:31 +0900)]
dm: drop CONFIG_DM_DEVICE_REMOVE from uncmd list

We do not want to compile the DM remove code for SPL.  Currently,
we undef it in include/config_uncmd_spl.h (for C files) and in
scripts/Makefile.uncmd_spl (for Makefiles).  This is really ugly.

This commit demonstrates how we can deprecate those two files.

Use $(SPL_) for the entry in the Makfile and CONFIG_IS_ENABLED()
in C files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoled: unify obj-$(CONFIG_LED) and obj-$(CONFIG_SPL_LED) entries
Masahiro Yamada [Tue, 11 Aug 2015 22:31:51 +0000 (07:31 +0900)]
led: unify obj-$(CONFIG_LED) and obj-$(CONFIG_SPL_LED) entries

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoled: rename CONFIG_SPL_LED_SUPPORT to CONFIG_SPL_LED
Masahiro Yamada [Tue, 11 Aug 2015 22:31:50 +0000 (07:31 +0900)]
led: rename CONFIG_SPL_LED_SUPPORT to CONFIG_SPL_LED

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoram: unify obj-$(CONFIG_RAM) and obj-$(CONFIG_SPL_RAM) entries
Masahiro Yamada [Tue, 11 Aug 2015 22:31:49 +0000 (07:31 +0900)]
ram: unify obj-$(CONFIG_RAM) and obj-$(CONFIG_SPL_RAM) entries

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoram: rename CONFIG_SPL_RAM_SUPPORT to CONFIG_SPL_RAM
Masahiro Yamada [Tue, 11 Aug 2015 22:31:48 +0000 (07:31 +0900)]
ram: rename CONFIG_SPL_RAM_SUPPORT to CONFIG_SPL_RAM

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoclk: unify obj-$(CONFIG_CLK) and obj-$(CONFIG_SPL_CLK) entries
Masahiro Yamada [Tue, 11 Aug 2015 22:31:47 +0000 (07:31 +0900)]
clk: unify obj-$(CONFIG_CLK) and obj-$(CONFIG_SPL_CLK) entries

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoclk: rename CONFIG_SPL_CLK_SUPPORT to CONFIG_SPL_CLK
Masahiro Yamada [Tue, 11 Aug 2015 22:31:46 +0000 (07:31 +0900)]
clk: rename CONFIG_SPL_CLK_SUPPORT to CONFIG_SPL_CLK

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodm: unify obj-$(CONFIG_DM) and obj-$(CONFIG_SPL_DM) entries
Masahiro Yamada [Tue, 11 Aug 2015 22:31:45 +0000 (07:31 +0900)]
dm: unify obj-$(CONFIG_DM) and obj-$(CONFIG_SPL_DM) entries

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agospl: move SPL driver entries to driver/Makefile
Masahiro Yamada [Tue, 11 Aug 2015 22:31:44 +0000 (07:31 +0900)]
spl: move SPL driver entries to driver/Makefile

Just preparing for upcoming cleaning.

The board-specific linker script  board/vpac270/u-boot-spl.lds
has been touched to avoid build error.  It does not change the
size of spl/u-boot-spl.bin for this board, so it should be OK.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agolinux/kconfig.h: add CPP macros useful for per-image config options
Masahiro Yamada [Tue, 11 Aug 2015 22:31:43 +0000 (07:31 +0900)]
linux/kconfig.h: add CPP macros useful for per-image config options

The previous commit introduced a useful macro used in makefiles,
in order to reference to different variables (CONFIG_... or
CONFIG_SPL_...) depending on the build context.

Per-image config option control is a PITA in C sources, too.
Here are some macros useful in C/CPP expressions.

CONFIG_IS_ENABLED(FOO) can be used as a shorthand for

  (!defined(CONFIG_SPL_BUILD) && defined(CONFIG_FOO)) || \
   (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_FOO))

For example, it is useful to describe C code as follows,

  #if CONFIG_IS_ENABLED(OF_CONTROL)
      (device tree code)
  #else
      (board file code)
  #endif

The ifdef conditional above is switched by CONFIG_OF_CONTROL during
the U-Boot proper building (CONFIG_SPL_BUILD is not defined), and by
CONFIG_SPL_OF_CONTROL during SPL building (CONFIG_SPL_BUILD is
defined).

The macro can be used in C context as well, so you can also write the
equivalent code as follows:

  if (CONFIG_IS_ENABLED(OF_CONTROL)) {
      (device tree code)
  } else {
      (board file code)
  }

Another useful macro is CONFIG_VALUE().
CONFIG_VALUE(FOO) is expanded into CONFIG_FOO if CONFIG_SPL_BUILD is
undefined, and into CONFIG_SPL_FOO if CONFIG_SPL_BUILD is defined.

You can write as follows:

  text_base = CONFIG_VALUE(TEXT_BASE);

instead of:

  #ifdef CONFIG_SPL_BUILD
      text_base = CONFIG_SPL_TEXT_BASE;
  #else
      text_base = CONFIG_TEXT_BASE;
  #endif

This commit also adds slight hacking on fixdep so that it can
output a correct list of fixed dependencies.

If the fixdep finds CONFIG_IS_ENABLED(FOO) in a source file,
we want
    $(wildcard include/config/foo.h)
in the U-boot proper building context, while we want
    $(wildcard include/config/spl/foo.h)
in the SPL build context.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agokbuild: add a makefile macro useful with per-image config options
Masahiro Yamada [Tue, 11 Aug 2015 22:31:42 +0000 (07:31 +0900)]
kbuild: add a makefile macro useful with per-image config options

Commit e02ee2548afe ("kconfig: switch to single .config
configuration") made the configuration itself pretty simple,
instead, we lost the way to systematically enable/disable config
options for each image independently.

Our current strategy is, put entries into Makefile.spl for options
we need separate enabling, or once enable the options globally in
Kconfig and then undef them in Makefile.uncmd_spl if we do not want
to compile the features for SPL at all.  Things are getting really
messy.  Besides, "ifdef CONFIG_SPL_BUILD" are sprinkled everywhere
in makefiles.

This commit adds a variable to help describe makefile simpler.

$(SPL_) evaluates to "SPL_" during the SPL build, while to an empty
string during building U-boot proper.

So, you can write

  obj-$(CONFIG_$(SPL_)FOO) += foo.o

instead of

  ifdef CONFIG_SPL_BUILD
  obj-$(CONFIG_SPL_FOO) += foo.o
  else
  obj-$(CONFIG_FOO) += foo.o
  endif

If CONFIG_SPL_FOO does not exist in Kconfig, it is equivalent to

  ifndef CONFIG_SPL_BUILD
  obj-$(CONFIG_SPL_FOO) += foo.o
  endif

This is the pattern we often see in our current makefiles.

To take advantage of this macro, we should prefix SPL_ for the SPL
version of the option when we need independent control between
U-boot and SPL.  With this naming scheme, I hope our makefiles will
be much simplified.

It means we want to rename existing config options as follows
in the long run:

  CONFIG_SPL_SERIAL_SUPPORT     -> CONFIG_SPL_SERIAL
  CONFIG_SPL_I2C_SUPPORT        -> CONFIG_SPL_I2C
  CONFIG_SPL_GPIO_SUPPORT       -> CONFIG_SPL_GPIO
  CONFIG_SPL_SPI_SUPPORT        -> CONFIG_SPL_SPI
  CONFIG_SPL_DISABLE_OF_CONTROL -> CONFIG_SPL_OF_CONTROL
                                      (inverting the logic)

Then drivers/Makefile would be re-worked as follows:

  obj-$(CONFIG_$(SPL_)SERIAL)  += serial/
  obj-$(CONFIG_$(SPL_)I2C)     += i2c/
  obj-$(CONFIG_$(SPL_)GPIO)    += gpio/
  obj-$(CONFIG_$(SPL_)SPI)     += spi/
     ...

Eventually, SPL-specialized entries in Makefile.spl would go away.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agokbuild: fixdep: optimize code slightly
Masahiro Yamada [Tue, 11 Aug 2015 22:31:41 +0000 (07:31 +0900)]
kbuild: fixdep: optimize code slightly

If the target string matches "CONFIG_", move the pointer p
forward.  This saves several 7-chars adjustments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agofs-test.sh: minor fixes
Stephen Warren [Tue, 11 Aug 2015 04:45:14 +0000 (22:45 -0600)]
fs-test.sh: minor fixes

- Re-direct stderr into the log files, so any errors U-Boot emits are
  visible in the logs. This is relevant if the "reset" shell command
  attempts to report that it's not supported on the sandbox board.
- Fix test_fs_nonfs() to name the files it created differently for each
  invocation. Otherwise, the logs from different tests overwrite
  each-other.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Suriyan Ramasami <suriyan.r@gmail.com>
8 years agoi2c: lpc32xx: correct sanity check for requested bus speed
Vladimir Zapolskiy [Wed, 12 Aug 2015 17:22:13 +0000 (20:22 +0300)]
i2c: lpc32xx: correct sanity check for requested bus speed

LPC32xx has 3 I2C bus controllers, 2 of them are used as generic ones
and their parent clock is HCLK and CLK_HI/CLK_LO registers are 10 bit
wide. This means that if HCLK is 104MHz, then minimal configurable I2C
clock speed is about 51KHz.

Only USB OTG I2C bus controller CLK registers are 8 bit wide, thus in
assumption that peripheral clock is 13MHz it allows to set the minimal
bus speed about 25.5KHz.

Check for negative half clock value is removed since it is always false.

The change fixes the following problem for I2C busses 0 and 1:

  => i2c dev 0
  Setting bus to 0
  => i2c speed 100000
  Setting bus speed to 100000 Hz
  Failure changing bus speed (-22)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Tested-by: Sylvain Lemieux <slemieux@tycoint.com>
8 years agolpc32xx: add common USB OHCI defines for all LPC32xx boards
Vladimir Zapolskiy [Wed, 12 Aug 2015 17:32:08 +0000 (20:32 +0300)]
lpc32xx: add common USB OHCI defines for all LPC32xx boards

The change adds a number of macro definitions used by USB OHCI driver,
if CONFIG_USB_OHCI_LPC32XX is selected from a board config file.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Tested-by: Sylvain Lemieux <slemieux@tycoint.com>
8 years agousb: lpc32xx: add host USB driver
Sylvain Lemieux [Thu, 13 Aug 2015 19:40:22 +0000 (15:40 -0400)]
usb: lpc32xx: add host USB driver

Incorporate USB driver from legacy LPCLinux NXP BSP.
The files taken from the legacy patch are:
- lpc32xx USB driver
- lpc3250 header file USB registers definition.

The legacy driver was updated and clean-up as part of the integration with the latest u-boot.

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
Acked-by: Marek Vasut <marex@denx.de>
Tested-by: Vladimir Zapolskiy <vz@mleia.com>
8 years agoi2c: lpc32xx: add support for OTG I2C
Sylvain Lemieux [Tue, 4 Aug 2015 21:04:41 +0000 (17:04 -0400)]
i2c: lpc32xx: add support for OTG I2C

Updated the LPC32xx I2C driver to support
the OTG I2C that is part of the USB module.

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
Acked-by: Marek Vasut <marex@denx.de>
8 years agonand: lpc32xx: add ECC layout for small page NAND
Sylvain Lemieux [Thu, 13 Aug 2015 19:40:21 +0000 (15:40 -0400)]
nand: lpc32xx: add ECC layout for small page NAND

Incorporate ECC layout for small page NAND from legacy LPCLinux NXP BSP.
The code taken from the legacy patch is:
- lpc32xx SLC NAND driver (ECC layout for small page)

This layout is matching the lpc32xx NAND SLC Linux Kernel driver.

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
8 years agonand: lpc32xx: add hardware ECC support
Sylvain Lemieux [Thu, 13 Aug 2015 19:40:20 +0000 (15:40 -0400)]
nand: lpc32xx: add hardware ECC support

Incorporate NAND SLC hardware ECC support from legacy LPCLinux NXP BSP.
The code taken from the legacy patch is:
- lpc32xx SLC NAND driver (hardware ECC support)
- lpc3250 header file missing SLC NAND registers definition

The legacy driver was updated and clean-up as part of the integration with the existing NAND SLC driver.

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
Tested-by: Vladimir Zapolskiy <vz@mleia.com>
8 years agolpc32xx: move common SLC NAND defines to arch/config.h
Vladimir Zapolskiy [Tue, 11 Aug 2015 16:57:09 +0000 (19:57 +0300)]
lpc32xx: move common SLC NAND defines to arch/config.h

A number of LPC32xx SLC NAND defines is dictated by controller
hardware limits and OOB layout is defined by operating system, the
definitions are common for all users. Since those macro are used
in out of NAND SLC driver code (simple NAND SPL framework), they can
not be placed into the driver, therefore move them from board config
files to arch/config.h

The change also adds OOB layout details specific to small page NAND
devices taken from Linux kernel.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Tested-by: Sylvain Lemieux <slemieux@tycoint.com>
8 years agodma: lpc32xx: add DMA driver
Sylvain Lemieux [Mon, 10 Aug 2015 12:16:31 +0000 (08:16 -0400)]
dma: lpc32xx: add DMA driver

Incorporate DMA driver from legacy LPCLinux NXP BSP.
The files taken from the legacy patch are:
- lpc32xx DMA driver
- lpc3250 header file DMA registers definition.

The legacy driver was updated and clean-up as part of the integration with the latest u-boot.

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
Acked-by: Marek Vasut <marex@denx.de>
Tested-by: Vladimir Zapolskiy <vz@mleia.com>
8 years agoPrepare v2015.10-rc2
Tom Rini [Mon, 17 Aug 2015 21:32:23 +0000 (17:32 -0400)]
Prepare v2015.10-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoRevert "Align global_data to a 16-byte boundary"
Simon Glass [Mon, 17 Aug 2015 15:28:44 +0000 (09:28 -0600)]
Revert "Align global_data to a 16-byte boundary"

This causes widespread breakage due to the operation of the low-level code
in crt0.S and cro0_64.S for ARM at least.

The fix is not complicated but it seems safer to revert this for now.

This reverts commit 2afddae07523f23f77acd066ad1719f53d289f98.
Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoARM: dra7xx_evm: Enable EDMA3 in SPL to support DMA on qspi
Vignesh R [Mon, 17 Aug 2015 07:59:57 +0000 (13:29 +0530)]
ARM: dra7xx_evm: Enable EDMA3 in SPL to support DMA on qspi

Enable TI_EDMA3 and SPL_DMA support, so as to reduce boot time. With
DMA enabled there is almost 3x improvement in read performance. This
helps in reducing boot time in qspiboot mode

Also add EDMA3 base address for DRA7XX and AM57XX.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agospi: ti_qspi: Use DMA to read from qspi flash
Vignesh R [Mon, 17 Aug 2015 09:50:13 +0000 (15:20 +0530)]
spi: ti_qspi: Use DMA to read from qspi flash

ti_qspi uses memory map mode for faster read. Enabling DMA will increase
read speed by 3x @48MHz on DRA74 EVM.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agodma: ti-edma3: Add helper function to support edma3 transfer
Vignesh R [Mon, 17 Aug 2015 07:59:55 +0000 (13:29 +0530)]
dma: ti-edma3: Add helper function to support edma3 transfer

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agosf: ops: Add spi_flash_copy_mmap function
Tom Rini [Mon, 17 Aug 2015 07:59:54 +0000 (13:29 +0530)]
sf: ops: Add spi_flash_copy_mmap function

When doing a memory mapped copy we may have DMA available and thus need
to have this copy abstracted so that the driver can do it, rather than a
simple memcpy.

Signed-off-by: Tom Rini <trini@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoARM: AM43XX: Add functions to enable and disable EDMA3 clocks
Vignesh R [Mon, 17 Aug 2015 07:59:53 +0000 (13:29 +0530)]
ARM: AM43XX: Add functions to enable and disable EDMA3 clocks

Adds functions to enable and disable edma3 clocks which can be invoked
by drivers using edma3 to control the clocks.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoARM: OMAP5: Add functions to enable and disable EDMA3 clocks
Vignesh R [Mon, 17 Aug 2015 07:59:52 +0000 (13:29 +0530)]
ARM: OMAP5: Add functions to enable and disable EDMA3 clocks

Adds functions to enable and disable edma3 clocks which can be invoked
by drivers using edma3 to control the clocks.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoARM: OMAP5: Add support for disabling clocks in uboot
Kishon Vijay Abraham I [Mon, 17 Aug 2015 07:59:51 +0000 (13:29 +0530)]
ARM: OMAP5: Add support for disabling clocks in uboot

Add do_disable_clocks() to disable clock domains and module clocks.
These clocks are enabled using do_enable_clocks().

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoARM: AM43xx: Add support for disabling clocks in uboot
Kishon Vijay Abraham I [Mon, 17 Aug 2015 07:59:50 +0000 (13:29 +0530)]
ARM: AM43xx: Add support for disabling clocks in uboot

Add do_disable_clocks() to disable clock domains and module clocks.
These clocks are enabled using do_enable_clocks().

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoenv: use cache line aligned memory for flash read
Ravi Babu [Mon, 17 Aug 2015 07:59:49 +0000 (13:29 +0530)]
env: use cache line aligned memory for flash read

Use memalign() with ARCH_DMA_MINALIGN to allocate read buffers.
This is required because, flash drivers may use DMA for read operations
and may have to invalidate the buffer before read.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
Tested-by: Jagan Teki <jteki@openedev.com>
8 years agosf: allocate cache aligned buffers to copy from flash
Ravi Babu [Mon, 17 Aug 2015 07:59:48 +0000 (13:29 +0530)]
sf: allocate cache aligned buffers to copy from flash

Use memalign() with ARCH_DMA_MINALIGN to allocate read buffers.
This is required because, flash drivers may use DMA for read operations
and may have to invalidate the buffer before read.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
Tested-by: Jagan Teki <jteki@openedev.com>
8 years agoti: qspi: set flash quad bit based on quad support flag
vishalm@ti.com [Mon, 17 Aug 2015 15:47:51 +0000 (10:47 -0500)]
ti: qspi: set flash quad bit based on quad support flag

Update op_mode_rx flag based on CONFIG_QSPI_QUAD_SUPPORT flag,
instead of platform.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoarm: mvebu: db-88f6820-gp: Enable PCI support
Stefan Roese [Tue, 11 Aug 2015 10:50:58 +0000 (12:50 +0200)]
arm: mvebu: db-88f6820-gp: Enable PCI support

This patch enabled the MVEBU PCIe support on the db-88f6820-gp A38x
eval board. It also enabled the Intel E1000 driver support and
adds the initialization of PCIe network controllers to the
board code.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Anton Schubert <anton.schubert@gmx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Dirk Eibach <eibach@gdsys.de>
8 years agoarm: mvebu: db-mv784mp-gp: Enable PCI support
Stefan Roese [Tue, 11 Aug 2015 07:36:15 +0000 (09:36 +0200)]
arm: mvebu: db-mv784mp-gp: Enable PCI support

This patch enabled the MVEBU PCIe support on the db-mv784mp-gp AXP
eval board. It also enabled the Intel E1000 driver support and
adds the initialization of PCIe network controllers to the
board code.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Anton Schubert <anton.schubert@gmx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agopci: mvebu: Add PCIe driver
Anton Schubert [Tue, 11 Aug 2015 09:54:01 +0000 (11:54 +0200)]
pci: mvebu: Add PCIe driver

This adds a PCI driver for the controllers found on Marvell MVEBU SoCs.

Besides the driver, this patch also removes the statically defined
PCI MBUS windows. As they are not needed anymore, since this PCIe
driver now creates the windows dynamically.

Tested on Armada XP db-mv784mp-gp eval board using an Intel E1000
PCIe card in all 3 PCIe slots. And on the Armada 38x db-88f6820-gp
eval board using this Intel E1000 PCIe card in the PCIe 0 slot.

This port was done in cooperation with Anton Schubert.

Signed-off-by: Anton Schubert <anton.schubert@gmx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Dirk Eibach <eibach@gdsys.de>
8 years agoarm: mvebu: Add complete SDRAM ECC scrubbing
Stefan Roese [Thu, 6 Aug 2015 12:43:13 +0000 (14:43 +0200)]
arm: mvebu: Add complete SDRAM ECC scrubbing

This patch introduces the SDRAM scrubbing for ECC enabled board
to fill/initialize the ECC bytes. This is done via the XOR engine
to speed up the process. The scrubbing is a 2-stage process:

1) SPL scrubs the area 0 - 0x100.0000 (16MiB) for the main U-Boot
2) U-Boot scrubs the remaining SDRAM area(s)

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: dram.c: Rework dram_init() and dram_init_banksize()
Stefan Roese [Mon, 10 Aug 2015 13:11:27 +0000 (15:11 +0200)]
arm: mvebu: dram.c: Rework dram_init() and dram_init_banksize()

Rework these functions so that dram_init_banksize() does not call
dram_init() again. It only needs to set the banksize values in the
bdinfo struct.

Make sure to also clip the size of the last bank if it exceeds the
maximum allowed value of 3 GiB (0xc000.0000). Otherwise other
address windows (e.g. PCIe) will overlap with this memory window.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Move CONFIG_SYS_TEXT_BASE to an address < 16 MiB
Stefan Roese [Thu, 6 Aug 2015 12:27:36 +0000 (14:27 +0200)]
arm: mvebu: Move CONFIG_SYS_TEXT_BASE to an address < 16 MiB

This patch moves CONFIG_SYS_TEXT_BASE to 0x00800000 for all Armada
XP / 38x boards in mainline U-Boot. This is done in preparation for
the ECC SDRAM scrubbing that needs to be done in the main U-Boot.
The SPL (previously bin_hdr) has already scrubbed the area:
  0x0000.0000 - 0x0100.0000

In this area this main U-Boot needs to get loaded. The main U-Boot
then can scrub the remaining SDRAM area while running from this
location.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Display ECC enabled / disabled upon bootup
Stefan Roese [Mon, 3 Aug 2015 11:15:31 +0000 (13:15 +0200)]
arm: mvebu: Display ECC enabled / disabled upon bootup

This patch adds "(ECC enabled)" or "(ECC disabled)" to the DRAM
bootup text. Making it easier for board with SPD DIMM's to see,
if ECC is enabled or not.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: add multiple usb-hostcontroller support for AXP
Anton Schubert [Thu, 23 Jul 2015 13:02:09 +0000 (15:02 +0200)]
arm: mvebu: add multiple usb-hostcontroller support for AXP

This patch adds support for multiple hostcontrollers to the ehci-marvell driver
and enables all 3 usb-hcs on the db-mv784mp-gp board.

It depends on the initial Armada XP usb support patch from Stefan.

Signed-off-by: Anton Schubert <anton.schubert@gmx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: db-mv785mp-gp: Add USB/EHCI support
Stefan Roese [Wed, 22 Jul 2015 16:05:43 +0000 (18:05 +0200)]
arm: mvebu: db-mv785mp-gp: Add USB/EHCI support

This patch enabled the USB/EHCI support for the Marvell
DB-MV784MP-GP Armada XP eval board.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Anton Schubert <anton.schubert@gmx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Enable USB EHCI support on Armada XP
Stefan Roese [Wed, 22 Jul 2015 16:26:13 +0000 (18:26 +0200)]
arm: mvebu: Enable USB EHCI support on Armada XP

This patch enables the USB EHCI support for the Marvell Armada XP (AXP)
SoCs. In compatism to the Armada 38x (A38x), the AXP needs to configure
the USB PLL and the USB PHY's specifically in U-Boot. The A38x has done
this already in the bin_hdr (SPL U-Boot). Without this, accessing the
controller registers in U-Boot or Linux will hang the CPU.

Additionally, the AXP uses a different USB EHCI base address. This
patch also takes care of this by runtime SoC detection in the Marvell
EHCI driver.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Anton Schubert <anton.schubert@gmx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Enable NAND controller on MVEBU SoC's
Stefan Roese [Thu, 16 Jul 2015 08:40:05 +0000 (10:40 +0200)]
arm: mvebu: Enable NAND controller on MVEBU SoC's

This patch enables the NAND controller on the Armada XP/38x and provides
a new function that returns the NAND controller input clock. This
function will be used by the MVEBU NAND driver.

As part of this patch, the multiple BIT macro definitions are moved
to a common place in soc.h.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Peter Morrow <peter@senient.com>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Disable MBUS error propagation
Stefan Roese [Wed, 1 Jul 2015 11:28:39 +0000 (13:28 +0200)]
arm: mvebu: Disable MBUS error propagation

Accessing MBUS windows not backed-up by e.g. PCIe devices will
hang the SoC. Disable MBUS error propagation back to CPU allows
to read 0xffffffff instead of hanging the SoC.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Flush caches and disable MMU only on A38x
Stefan Roese [Wed, 1 Jul 2015 11:23:52 +0000 (13:23 +0200)]
arm: mvebu: Flush caches and disable MMU only on A38x

Only with disabled MMU its possible to switch the base register address
on Armada 38x. Without this the SDRAM located at >= 0x4000.0000 is also
not accessible, as its still locked to cache.

So to fully release / unlock this area from cache, we need to first
flush all caches, then disable the MMU and disable the L2 cache.

On Armada XP this does not seem to be needed. Even worse, with this
code added, I sometimes see strange input charactes loss from the
console.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Setup the MBUS bridge registers
Stefan Roese [Wed, 1 Jul 2015 10:44:51 +0000 (12:44 +0200)]
arm: mvebu: Setup the MBUS bridge registers

With this patch, the MBUS bridge registers (base and size) are
configured upon each call to mbus_dt_setup_win(). This is needed, since
the board code can also call this function in later boot stages. As
done in the maxbcm board.

This is needed to fix a problem with the secondary CPU's not booting
in Linux on AXP.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Peter Morrow <peter@senient.com>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: Change MBUS base addresses and sizes
Stefan Roese [Wed, 1 Jul 2015 10:55:07 +0000 (12:55 +0200)]
arm: mvebu: Change MBUS base addresses and sizes

This patch changes the MBUS base addresses and sizes to use more
generic names and also adds defines for the sizes. It also moves
the base address to higher addresses.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu: db-mv784mp-gp.h: Fix image creation - use correct offset
Stefan Roese [Mon, 3 Aug 2015 10:13:09 +0000 (12:13 +0200)]
arm: mvebu: db-mv784mp-gp.h: Fix image creation - use correct offset

Signed-off-by: Stefan Roese <sr@denx.de>
8 years agoarm: mvebu: sdram: Enable ECC support on Armada XP
Stefan Roese [Tue, 11 Aug 2015 15:08:01 +0000 (17:08 +0200)]
arm: mvebu: sdram: Enable ECC support on Armada XP

This is tested on the DB-MV784MP-GP eval board. To really enable ECC
support on this board the I2C EEPROM needs to get changed. As it
saves the enabling of ECC support internally. For this the following
commands can be used to enable ECC support on this board:

Its recommended for first save (print) the value(s) in this EEPROM
address:

=> i2c md 4e 0.1 2
0000: 05 00    ..

To enable ECC support you need to set bit 1 in the 2nd byte:

Marvell>> i2c mw 4e 1.1 02
Marvell>> i2c md 4e 0.1 2
0000: 05 02    ..

To disable ECC support again, please use this command:

Marvell>> i2c mw 4e 1.1 00
Marvell>> i2c md 4e 0.1 2
0000: 05 00    ..

On other AXP boards, simply plugging an ECC DIMM should be enough to
enable ECC support.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoarm: mvebu/armada100: dram.c: Remove CONFIG_SYS_BOARD_DRAM_INIT
Stefan Roese [Thu, 6 Aug 2015 08:23:52 +0000 (10:23 +0200)]
arm: mvebu/armada100: dram.c: Remove CONFIG_SYS_BOARD_DRAM_INIT

CONFIG_SYS_BOARD_DRAM_INIT is not defined anywhere. So lets get rid
of all references here.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
8 years agoi2c: lpc32xx: fix write timeout
Sylvain Lemieux [Mon, 27 Jul 2015 17:37:39 +0000 (13:37 -0400)]
i2c: lpc32xx: fix write timeout

Fix a condition that generate watchdog timeout inside "lpc32xx_i2c_write" when parameters alen = 0 and len = 0.

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
8 years agoi2c: lpc32xx: fix read timeout
Sylvain Lemieux [Mon, 27 Jul 2015 17:37:38 +0000 (13:37 -0400)]
i2c: lpc32xx: fix read timeout

Fix a condition that generate watchdog timeout inside "lpc32xx_i2c_read" when parameters alen != 0 and len = 0.

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
8 years agoi2c: lpc32xx: use api to get hclk instead of fix value
Sylvain Lemieux [Mon, 27 Jul 2015 17:37:37 +0000 (13:37 -0400)]
i2c: lpc32xx: use api to get hclk instead of fix value

The HCLK is not constant and can take different value; use the api function to get the value of the HCLK for the I2C clock high and low computation.

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>