platform/kernel/u-boot.git
8 years agoimx: mx6ulevk: add CONFIG_SPI_FLASH_STMICRO
Peng Fan [Tue, 19 Jan 2016 07:13:52 +0000 (15:13 +0800)]
imx: mx6ulevk: add CONFIG_SPI_FLASH_STMICRO

Add CONFIG_SPI_FLASH_STMICRO to let qspi driver can detect the
qspi chips.
"
=> sf probe
SF: Detected N25Q256 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
"

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Jagan Teki <jteki@openedev.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Stefano Babic <sbabic@denx.de>
8 years agomx25pdk: Remove lowlevel_init.S file
Fabio Estevam [Mon, 11 Jan 2016 20:09:15 +0000 (18:09 -0200)]
mx25pdk: Remove lowlevel_init.S file

As the lowlevel_init function is empty we should better
remove this assembly file entirely and use a dummy C
function instead.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
8 years agoimx: mx6/7 enlarge CONFIG_SYS_BOOTM_LEN to 16M
Peng Fan [Mon, 4 Jan 2016 07:27:22 +0000 (15:27 +0800)]
imx: mx6/7 enlarge CONFIG_SYS_BOOTM_LEN to 16M

Support uncompressing zImage which is larger than 8M.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Peter Robinson <pbrobinson@gmail.com>
Cc: Volodymyr Riazantsev <volodymyr.riazantsev@globallogic.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Adrian Alonso <aalonso@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
8 years agoimx: mx6ulevk: change mtest memory size to 128M
Peng Fan [Tue, 5 Jan 2016 06:03:36 +0000 (14:03 +0800)]
imx: mx6ulevk: change mtest memory size to 128M

To i.MX6UL 14x14 EVK, system memory is 512M; to i.MX6UL 9x9 EVK,
system memory is 256M. If setting mtest size to 256M, mtest will
crash uboot for i.MX6UL 9x9 evk. So change mtest size to 128M.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
8 years agox86: ivybridge: Use syscon for the GMA device
Simon Glass [Sun, 17 Jan 2016 23:11:59 +0000 (16:11 -0700)]
x86: ivybridge: Use syscon for the GMA device

Until we have a proper video uclass we can use syscon to handle the GMA
device, and avoid the special device tree and PCI searching. Update the code
to work this way.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Set up a shared syscon numbering schema
Simon Glass [Sun, 17 Jan 2016 23:11:58 +0000 (16:11 -0700)]
x86: Set up a shared syscon numbering schema

Each system controller can have a number to identify it. It can then be
accessed using syscon_get_by_driver_data(). Put this in a shared header
file and update the only current user.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Drop the SMM-locking code
Simon Glass [Sun, 17 Jan 2016 23:11:57 +0000 (16:11 -0700)]
x86: ivybridge: Drop the SMM-locking code

U-Boot does not support SMM yet, so we can drop this code. It is easy to
bring back when needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Drop XHCI support
Simon Glass [Sun, 17 Jan 2016 23:11:56 +0000 (16:11 -0700)]
x86: ivybridge: Drop XHCI support

This is not used on link which is the only ivybridge board. Drop this code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Drop special EHCI init
Simon Glass [Sun, 17 Jan 2016 23:11:55 +0000 (16:11 -0700)]
x86: ivybridge: Drop special EHCI init

This is not needed. On reset wake-on-disconnect is already set. It may a
problem during a soft reset or resume, but for now it does not seem
important. Also drop the command register update since PCI auto-config
does it for us.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Sort out the calls to bridge_silicon_revision()
Simon Glass [Sun, 17 Jan 2016 23:11:54 +0000 (16:11 -0700)]
x86: ivybridge: Sort out the calls to bridge_silicon_revision()

This function is called all over the place. Convert it use the driver model
PCI API, and rationalise the calls.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move code from pch.c to bd82x6x.c
Simon Glass [Sun, 17 Jan 2016 23:11:53 +0000 (16:11 -0700)]
x86: ivybridge: Move code from pch.c to bd82x6x.c

This code relates to the PCH, so we should move it into the same file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Convert pch.c to use DM PCI API
Simon Glass [Sun, 17 Jan 2016 23:11:52 +0000 (16:11 -0700)]
x86: ivybridge: Convert pch.c to use DM PCI API

Convert this file to use the driver model PCI API.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Convert report_platform to DM PCI API
Simon Glass [Sun, 17 Jan 2016 23:11:51 +0000 (16:11 -0700)]
x86: ivybridge: Convert report_platform to DM PCI API

Convert these functions to use the driver model PCI API.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Convert SDRAM init to use driver model
Simon Glass [Sun, 17 Jan 2016 23:11:50 +0000 (16:11 -0700)]
x86: ivybridge: Convert SDRAM init to use driver model

SDRAM init needs access to the Northbridge controller and the Intel
Management Engine device. Add the latter to the device tree and convert all
of this code to driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: chromebook_link: Enable the syscon uclass
Simon Glass [Sun, 17 Jan 2016 23:11:49 +0000 (16:11 -0700)]
x86: chromebook_link: Enable the syscon uclass

We will use a system controller to model the Intel Management Engine. Enable
this for link.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Convert sdram_initialise() to use DM PCI API
Simon Glass [Sun, 17 Jan 2016 23:11:48 +0000 (16:11 -0700)]
x86: ivybridge: Convert sdram_initialise() to use DM PCI API

Convert this function to use the the driver model PCI API. We just need
to pass in the northbridge device.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Convert dram_init() to use DM PCI API
Simon Glass [Sun, 17 Jan 2016 23:11:47 +0000 (16:11 -0700)]
x86: ivybridge: Convert dram_init() to use DM PCI API

Convert the top part of the DRAM init to use the driver model PCI API.
Further work will complete the transformation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Convert enable_usb_bar() to use DM PCI API
Simon Glass [Sun, 17 Jan 2016 23:11:46 +0000 (16:11 -0700)]
x86: ivybridge: Convert enable_usb_bar() to use DM PCI API

Convert this function over to use the driver model PCI API. In this case
we want to avoid using the real PCI devices since they have not yet been
probed. Instead, write directly to their PCI configuration address.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Use the I2C driver to perform SMbus init
Simon Glass [Sun, 17 Jan 2016 23:11:45 +0000 (16:11 -0700)]
x86: ivybridge: Use the I2C driver to perform SMbus init

Move the init code into the I2C driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: i2c: Add a stub driver for Intel I2C/SMbus
Simon Glass [Sun, 17 Jan 2016 23:11:44 +0000 (16:11 -0700)]
x86: i2c: Add a stub driver for Intel I2C/SMbus

This is used on most Intel platforms. We don't have a driver for it yet, but
add a stub to handle the init. For now this targets ivybridge so we may want
to add a device tree binding and generalise it when other platforms are
supported.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Enable DM_USB for link and panther
Simon Glass [Sun, 17 Jan 2016 23:11:43 +0000 (16:11 -0700)]
x86: Enable DM_USB for link and panther

Move these two boards to use driver model for USB.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Convert lpc init code to DM PCI API
Simon Glass [Sun, 17 Jan 2016 23:11:42 +0000 (16:11 -0700)]
x86: ivybridge: Convert lpc init code to DM PCI API

Adjust this code to use the driver model PCI API. This is all called through
lpc_init_extra().

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Drop the special PCI driver
Simon Glass [Sun, 17 Jan 2016 23:11:41 +0000 (16:11 -0700)]
x86: ivybridge: Drop the special PCI driver

There is nothing special about the ivybridge pci driver now, so just use
the generic one.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move LPC init into the LPC probe() method
Simon Glass [Sun, 17 Jan 2016 23:11:40 +0000 (16:11 -0700)]
x86: ivybridge: Move LPC init into the LPC probe() method

Drop the lpc_init_extra() function and just use the post-relocation LPC
probe() instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move lpc_enable() into gma.c
Simon Glass [Sun, 17 Jan 2016 23:11:39 +0000 (16:11 -0700)]
x86: ivybridge: Move lpc_enable() into gma.c

This graphics init code is best placed in the gma init code. Move the code
and drop the function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Use driver model PCI API in sata.c
Simon Glass [Sun, 17 Jan 2016 23:11:38 +0000 (16:11 -0700)]
x86: ivybridge: Use driver model PCI API in sata.c

Adjust the functions in this file to use the driver model PCI API.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Use the SATA driver to do the init
Simon Glass [Sun, 17 Jan 2016 23:11:37 +0000 (16:11 -0700)]
x86: ivybridge: Use the SATA driver to do the init

Instead of manually initing the device, probe the SATA device and move the
init there.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Drop the unused bd82x6x_init_extra()
Simon Glass [Sun, 17 Jan 2016 23:11:36 +0000 (16:11 -0700)]
x86: ivybridge: Drop the unused bd82x6x_init_extra()

This function does nothing now so can be dropped.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Do the SATA init before relocation
Simon Glass [Sun, 17 Jan 2016 23:11:35 +0000 (16:11 -0700)]
x86: ivybridge: Do the SATA init before relocation

The SATA device needs to set itself up so that it appears correctly on the
PCI bus. The easiest way to do this is to set it up to probe before
relocation. This can do the early setup.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agoahci: Add a disk-controller uclass
Simon Glass [Sun, 17 Jan 2016 23:11:34 +0000 (16:11 -0700)]
ahci: Add a disk-controller uclass

Add a uclass ID for a disk controller. This can be used by AHCI/SATA or
other controller types. There are no operations and no interface so far,
but it is possible to probe a SATA device.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Drop unnecessary northbridge setup
Simon Glass [Sun, 17 Jan 2016 23:11:33 +0000 (16:11 -0700)]
x86: ivybridge: Drop unnecessary northbridge setup

This is done by default with PCI auto-config. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Use driver model PCI API in bd82x6x.c
Simon Glass [Sun, 17 Jan 2016 23:11:32 +0000 (16:11 -0700)]
x86: ivybridge: Use driver model PCI API in bd82x6x.c

Adjust most of the remaining functions in this file to use the driver model
PCI API. The one remaining function is bridge_silicon_revision() which will
need a little more work.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move northbridge and PCH init into drivers
Simon Glass [Sun, 17 Jan 2016 23:11:31 +0000 (16:11 -0700)]
x86: ivybridge: Move northbridge and PCH init into drivers

Instead of calling the northbridge and PCH init from bd82x6x_init_extra()
when the PCI bus is probed, call it from the respective drivers. Also drop
the Northbridge init as it has no effect. The registers it touches appear to
be read-only.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Bring up northbridge, pch and lpc after the CPUs
Simon Glass [Sun, 17 Jan 2016 23:11:30 +0000 (16:11 -0700)]
x86: Bring up northbridge, pch and lpc after the CPUs

These devices currently need to be inited early in boot. Once we have the
init in the right places (with each device doing its own init and no
problems with ordering) we should be able to remove this. For now it is
needed to keep things working.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Don't show an error when the MRC cache is up to date
Simon Glass [Sun, 17 Jan 2016 23:11:29 +0000 (16:11 -0700)]
x86: Don't show an error when the MRC cache is up to date

When the final MRC cache record is the same as the one we want to write, we
skip writing since there is no point. This is normal behaviour.

Avoiding printing an error when this happens.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Make x86_init_cpus() static
Simon Glass [Sun, 17 Jan 2016 23:11:28 +0000 (16:11 -0700)]
x86: Make x86_init_cpus() static

There are no other implementations of this function, and boards that need it
can implement a CPU driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move early init code into northbridge.c
Simon Glass [Sun, 17 Jan 2016 23:11:27 +0000 (16:11 -0700)]
x86: ivybridge: Move early init code into northbridge.c

This code is now part of the northbridge driver, so move it into the same
place.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Drop the dead MTRR code
Simon Glass [Sun, 17 Jan 2016 23:11:26 +0000 (16:11 -0700)]
x86: ivybridge: Drop the dead MTRR code

This is not used and MTRRs are set up elsewhere now. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Set up the thermal target correctly
Simon Glass [Sun, 17 Jan 2016 23:11:25 +0000 (16:11 -0700)]
x86: ivybridge: Set up the thermal target correctly

This uses a non-existent node at present. It should use the first CPU node.
The referenced property does not exist (the correct value is the default of
0), but this allows the follow-on init to complete.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move CPU init code into the driver
Simon Glass [Sun, 17 Jan 2016 23:11:24 +0000 (16:11 -0700)]
x86: ivybridge: Move CPU init code into the driver

Use the CPU driver's probe() method to perform the CPU init. This will happen
automatically when the first CPU is probed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Use common CPU init code
Simon Glass [Sun, 17 Jan 2016 23:11:23 +0000 (16:11 -0700)]
x86: ivybridge: Use common CPU init code

The existing ivybridge code predates the normal multi-core CPU init, and
it is not used. Remove it and add CPU nodes to the device tree so that all
four CPUs are set up. Also enable the 'cpu' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move GPIO init to the LPC init() method
Simon Glass [Sun, 17 Jan 2016 23:11:22 +0000 (16:11 -0700)]
x86: ivybridge: Move GPIO init to the LPC init() method

This init can happen in the driver also. Move it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move sandybridge init to the lpc probe() method
Simon Glass [Sun, 17 Jan 2016 23:11:21 +0000 (16:11 -0700)]
x86: ivybridge: Move sandybridge init to the lpc probe() method

The watchdog can be reset later when probing the LPC after relocation.
Move it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move graphics init much later
Simon Glass [Sun, 17 Jan 2016 23:11:20 +0000 (16:11 -0700)]
x86: ivybridge: Move graphics init much later

We don't need to init the graphics controller so early. Move it alongside
the other graphics setup, just before we run the ROM.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Probe the LPC in CPU init
Simon Glass [Sun, 17 Jan 2016 23:11:19 +0000 (16:11 -0700)]
x86: ivybridge: Probe the LPC in CPU init

We can drop the explicit probe of the PCH since the LPC is a child device
and this will happen automatically.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Rename lpc_init() to lpc_init_extra()
Simon Glass [Sun, 17 Jan 2016 23:11:18 +0000 (16:11 -0700)]
x86: ivybridge: Rename lpc_init() to lpc_init_extra()

In preparation for adding an init() method to the LPC uclass, rename this
existing function so that it will not conflict.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move LPC and PCH init into northbridge probe()
Simon Glass [Sun, 17 Jan 2016 23:11:17 +0000 (16:11 -0700)]
x86: ivybridge: Move LPC and PCH init into northbridge probe()

Move more code into the northbridge probe() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move northbridge init into the probe() method
Simon Glass [Sun, 17 Jan 2016 23:11:16 +0000 (16:11 -0700)]
x86: ivybridge: Move northbridge init into the probe() method

Now that we have a proper driver for the nortbridge, set it up in by probing
it, and move the early init code into the probe() method.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Add a driver for the bd82x6x northbridge
Simon Glass [Sun, 17 Jan 2016 23:11:15 +0000 (16:11 -0700)]
x86: ivybridge: Add a driver for the bd82x6x northbridge

Add a driver with an empty probe function where we can move init code in
follow-on patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: x86: Add a northbridge uclass
Simon Glass [Sun, 17 Jan 2016 23:11:14 +0000 (16:11 -0700)]
dm: x86: Add a northbridge uclass

Add a uclass for the northbridge / SDRAM controller found on some older
Intel chipsets.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Rename bd82x6x_init()
Simon Glass [Sun, 17 Jan 2016 23:11:13 +0000 (16:11 -0700)]
x86: ivybridge: Rename bd82x6x_init()

Rename the existing bd82x6x_init() to bd82x6x_init_extra(). We will remove
this in a later patch.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move more init to the probe() function
Simon Glass [Sun, 17 Jan 2016 23:11:12 +0000 (16:11 -0700)]
x86: ivybridge: Move more init to the probe() function

Move SPI and port80 init to lpc_early_init(), called from the LPC's probe()
method.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Move lpc_early_init() to probe()
Simon Glass [Sun, 17 Jan 2016 23:11:11 +0000 (16:11 -0700)]
x86: ivybridge: Move lpc_early_init() to probe()

Move this code to the LPC's probe() method so that it will happen
automatically when the LPC is probed before relocation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Set up the LPC device using driver model
Simon Glass [Sun, 17 Jan 2016 23:11:10 +0000 (16:11 -0700)]
x86: ivybridge: Set up the LPC device using driver model

Find the LPC device in arch_cpu_init_dm() as a first step to converting
this code to use driver model. Probing the LPC will probe its parent (the
PCH) automatically, so make sure that probing the PCH does nothing before
relocation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: pci: Convert bios_emu to use the driver model PCI API
Simon Glass [Sun, 17 Jan 2016 23:11:09 +0000 (16:11 -0700)]
dm: pci: Convert bios_emu to use the driver model PCI API

At present this BIOS emulator uses a bus/device/function number. Change
it to use a device if CONFIG_DM_PCI is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: syscon: Allow finding devices by driver data
Simon Glass [Sun, 17 Jan 2016 23:11:08 +0000 (16:11 -0700)]
dm: syscon: Allow finding devices by driver data

We have a way to find a regmap by its syscon driver data value. Add the same
for syscon itself.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: usb: Add a compatible string for PCI EHCI controller
Simon Glass [Sun, 17 Jan 2016 23:11:07 +0000 (16:11 -0700)]
dm: usb: Add a compatible string for PCI EHCI controller

Add a compatible string to allow this to be specified in the device tree
if needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: core: Display the error number when driver binding fails
Simon Glass [Sun, 17 Jan 2016 23:11:06 +0000 (16:11 -0700)]
dm: core: Display the error number when driver binding fails

This is often -96 (-EPFNOSUPPORT) which indicates that the uclass is not
compiled in. Display the error number to make this easier to spot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: x86: Drop the weak cpu_irq_init() function
Simon Glass [Wed, 20 Jan 2016 04:32:32 +0000 (21:32 -0700)]
dm: x86: Drop the weak cpu_irq_init() function

There are no callers now. Platforms which need to set up interrupts their
own way can implement an interrupt driver. Drop this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: x86: queensbay: Add an interrupt driver
Simon Glass [Wed, 20 Jan 2016 04:32:31 +0000 (21:32 -0700)]
dm: x86: queensbay: Add an interrupt driver

Add a driver for interrupts on queensbay and move the code currently in
cpu_irq_init() into its probe() method.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: x86: quark: Add an interrupt driver
Simon Glass [Wed, 20 Jan 2016 04:32:30 +0000 (21:32 -0700)]
dm: x86: quark: Add an interrupt driver

Add a driver for interrupts on quark and move the code currently in
cpu_irq_init() into its probe() method.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Drop the irq router compatible string
Simon Glass [Wed, 20 Jan 2016 04:32:29 +0000 (21:32 -0700)]
x86: Drop the irq router compatible string

We use driver model for this now, so we don't need this string.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Use the IRQ device when setting up the mptable
Simon Glass [Wed, 20 Jan 2016 04:32:28 +0000 (21:32 -0700)]
x86: Use the IRQ device when setting up the mptable

Instead of searching for the device tree node, use the IRQ device which has
a record of it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: x86: Add a common PIRQ init function
Simon Glass [Wed, 20 Jan 2016 04:32:27 +0000 (21:32 -0700)]
dm: x86: Add a common PIRQ init function

Most x86 interrupt drivers will want to use the standard PIRQ routing and
table setup. Put this code in a common function so it can be used by those
drivers that want it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: x86: Set up interrupt routing from interrupt_init()
Simon Glass [Wed, 20 Jan 2016 04:32:26 +0000 (21:32 -0700)]
dm: x86: Set up interrupt routing from interrupt_init()

At present interrupt routing is set up from arch_misc_init(). We can do it
a little later instead, in interrupt_init().

This removes the manual pirq_init() call. Where the platform does not have
an interrupt router defined in its device tree, no error is generated. Some
platforms do not have this.

Drop pirq_init() since it is no-longer used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: x86: Create a driver for x86 interrupts
Simon Glass [Wed, 20 Jan 2016 04:32:25 +0000 (21:32 -0700)]
dm: x86: Create a driver for x86 interrupts

It seems likely that at some point we will want a generic interrupt uclass.
But this is a big undertaking as it involves unifying code across multiple
architectures.

As a first step, create a simple IRQ uclass and a driver for x86. This can
be generalised later as required.

Adjust pirq_init() to probe this driver, which has the effect of creating
routing tables and setting up the interrupt routing. This is a start
towards making interrupts fit better with driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: x86: spi: Convert ICH SPI driver to driver model PCI API
Simon Glass [Tue, 19 Jan 2016 03:19:21 +0000 (20:19 -0700)]
dm: x86: spi: Convert ICH SPI driver to driver model PCI API

At present this SPI driver works by searching the PCI buses for its
peripheral. It also uses the legacy PCI API.

In addition the driver has code to determine the type of Intel PCH that is
used (version 7 or version 9). Now that we have proper PCH drivers we can
use those to obtain the information we need.

While the device tree has a node for the SPI peripheral it is not in the
right place. It should be on the PCI bus as a sub-peripheral of the LPC
device.

Update the device tree files to show the SPI controller within the PCH, so
that PCI access works as expected.

This patch includes Bin's fix-up patch from here:

   https://patchwork.ozlabs.org/patch/569478/

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
8 years agospi: ich: Separate out the read/write trace from normal debugging
Simon Glass [Tue, 19 Jan 2016 03:19:20 +0000 (20:19 -0700)]
spi: ich: Separate out the read/write trace from normal debugging

The trace is seldom useful for basic debugging. Allow it to be enabled
separately so that it is easier to see the more important init and error
debug messages.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: x86: Add a driver for Intel PCH9
Simon Glass [Tue, 19 Jan 2016 03:19:19 +0000 (20:19 -0700)]
dm: x86: Add a driver for Intel PCH9

At some point we may need to distinguish between different types of PCHs,
but for existing supported platforms we only need to worry about version 7
and version 9 bridges. Add a driver for the PCH9.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: x86: Add a driver for Intel PCH7
Simon Glass [Tue, 19 Jan 2016 03:19:18 +0000 (20:19 -0700)]
dm: x86: Add a driver for Intel PCH7

At some point we may need to distinguish between different types of PCHs,
but for existing supported platforms we only need to worry about version 7
and version 9 bridges. Add a driver for the PCH7.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: Expand the uclass for Platform Controller Hubs (PCH)
Simon Glass [Tue, 19 Jan 2016 03:19:17 +0000 (20:19 -0700)]
dm: Expand the uclass for Platform Controller Hubs (PCH)

A Platform Controller Hub is an Intel concept - it is like the peripherals
on an SoC and is often in a separate chip from the CPU. The chip is typically
found on the first PCI bus and integrates multiple devices.

We have a very simple uclass to support PCHs. Add a few operations, such as
setting up the devices on the PCH and finding the SPI controller base
address. Also move it into drivers/pch/ since we will be adding a few PCH
drivers.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: pci: Avoid using pci_bus_to_hose() in the uclass
Simon Glass [Tue, 19 Jan 2016 03:19:16 +0000 (20:19 -0700)]
dm: pci: Avoid using pci_bus_to_hose() in the uclass

This function is only available for compatibility with old code. Avoid
using it in the uclass.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: pci: Add a function to write a BAR
Simon Glass [Tue, 19 Jan 2016 03:19:15 +0000 (20:19 -0700)]
dm: pci: Add a function to write a BAR

Add a driver-model version of the pci_write_bar32 function so that this is
supported in the new API.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agodm: pci: Move pci_bus_to_hose() to compatibility
Simon Glass [Tue, 19 Jan 2016 03:19:14 +0000 (20:19 -0700)]
dm: pci: Move pci_bus_to_hose() to compatibility

This function should not be used by driver-model code, so move it to the
compatibility portion.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agolcd: fix the color testpattern in 16bit mode
Andreas Neubacher [Thu, 21 Jan 2016 12:06:32 +0000 (13:06 +0100)]
lcd: fix the color testpattern in 16bit mode

The testpattern of the lcd was only working in 8bit mode(2x3 tiles in
different colors). With this patch now 8bit and 16bit is supported.
In 16bit mode there are 2x4 tiles in different colors.
The number of LCD-colors is defined in the include/configs/<boardfile>.h

Signed-off-by: Andreas Neubacher <neubacher.andreas@gmail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
8 years agovideo: Add support for Armada XP LCD controller
Stefan Roese [Wed, 20 Jan 2016 07:13:28 +0000 (08:13 +0100)]
video: Add support for Armada XP LCD controller

This patch adds basic support for the LCD controller of the Marvell
Armada XP SoC.

An AXP based custom board port will be added later, to use this
driver to display a splash screen via the bmp command later.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
[agust: rebased]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
8 years agousb: eth: add Realtek RTL8152B/RTL8153 DRIVER
Ted Chen [Wed, 20 Jan 2016 06:24:52 +0000 (14:24 +0800)]
usb: eth: add Realtek RTL8152B/RTL8153 DRIVER

This patch adds driver support for the Realtek RTL8152B/RTL8153 USB
network adapters.

Signed-off-by: Ted Chen <tedchen at realtek.com>
[swarren, fixed a few compiler warnings]
[swarren, with permission, converted license header to SPDX]
[swarren, removed printf() spew during probe()]
Signed-off-by: Stephen Warren <swarren at nvidia.com>
8 years agoARM: rpi: enable USB keyboard
Stephen Warren [Wed, 16 Dec 2015 03:50:22 +0000 (20:50 -0700)]
ARM: rpi: enable USB keyboard

Now that the DWC2 driver supports split transactions, we can reasonably
enable support for USB keyboards. This wasn't terribly useful before
since keyboards are usually LS/FS devices, and thus require split
transaction support when attached to a USB hub such as the hub built into
the RPi model Bs.

Cc: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agousb: dwc2: Do not mix data toggle for IN and OUT endpoints, check bounds
Stefan Brüns [Sat, 23 Jan 2016 00:42:25 +0000 (01:42 +0100)]
usb: dwc2: Do not mix data toggle for IN and OUT endpoints, check bounds

USB protocol allows for 16 IN and 16 OUT endpoints (USB 2.0 Spec,
8.3.2.2 Endpoint Field). A function may have an EP 1 for both IN and OUT,
so these two should be kept separate. As EPs are either BULK or INTERRUPT
(or ISO), it is fine to have one array per direction for all transfer
types (also see e236519b7365ef75c5da6a5623f0b03d9c00cfae).

USB device address is 7 bits, so a bus may have more than 16 devices.
Check the device number, as the DWC2 driver only supports BULK/ISO for
the first 16 devices.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agousb: dwc2: Add SPLIT INTERRUPT transaction support
Stefan Brüns [Sun, 17 Jan 2016 03:09:56 +0000 (04:09 +0100)]
usb: dwc2: Add SPLIT INTERRUPT transaction support

CSPLITs for INTERRUPT transactions have to be scheduled in each microframe
following the SSPLIT. INTERRUPT transfers are executed in the next even/
odd microframe depending on the HCCHAR_ODDFRM flag.

As there are no handshakes for INTERRUPT SSPLITs the SSPLIT may have
failed (transport error) without the error being detected by the host
driver. If the last CSPLIT is not received within 4 microframes after the
SSPLIT there was a transaction error and the complete transaction has
to be restarted.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agousb: dwc2: Implement SPLIT transaction support
Stefan Brüns [Sun, 17 Jan 2016 03:09:55 +0000 (04:09 +0100)]
usb: dwc2: Implement SPLIT transaction support

In contrast to non-SPLIT transfers each transaction has to be submitted
as an individual chunk.
The transaction state machine proceeds from SSPLIT to CSPLIT if the ACK
flag is set. CSPLIT has to be repeated while NYET is set.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agousb: dwc2: add helper function for setting SPLIT HC registers
Stefan Brüns [Sun, 17 Jan 2016 03:09:54 +0000 (04:09 +0100)]
usb: dwc2: add helper function for setting SPLIT HC registers

The split register setting is used for both SSPLIT and CSPLIT transactions,
the bit for CSPLIT has to be set seperately.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agousb: dwc2: split transfer core from outer loop
Stefan Brüns [Sun, 17 Jan 2016 03:09:53 +0000 (04:09 +0100)]
usb: dwc2: split transfer core from outer loop

Split the movement of data between CPU and Host Controller from the
status handling and tracking of transfer progress.
This will also simplify adding of SPLIT transaction support.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agousb: dwc2: Simplify wait_for_chhltd(), remove ignore_ack
Stefan Brüns [Sun, 17 Jan 2016 03:09:52 +0000 (04:09 +0100)]
usb: dwc2: Simplify wait_for_chhltd(), remove ignore_ack

A transfer is completed if the XFERCOMP flag is set, irrespective of the
ACK flag. BULK OUT transfers to some HS devices complete without having
the ACK flag set, which signal the devices has responded with an NYET
to the transfer (PING protocol).
The new behaviour matches the Linux kernel minus any PING protocol.

Also see 5966defabdcc (usb: dwc2: fix bulk transfers)

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agousb: dwc2: Fix out-of-bounds access, fix chunk size
Stefan Brüns [Sun, 17 Jan 2016 03:09:51 +0000 (04:09 +0100)]
usb: dwc2: Fix out-of-bounds access, fix chunk size

Fix two errors in transfer len calculation, move loop invariant code out
of loop.

If xfer_len is equal to CONFIG_DWC2_MAX_TRANSFER_SIZE (or slightly
smaller), the xfer_len will be to large, e.g.:
  xfer_len = MAX_TRANSFER_SIZE = 65535
  max packet size = 512
    => num_packets = 128
    => IN xfer_len = 65536

For OUT transactions larger than (65536 - mps) bytes, the xfer_len
determination is quite awkward, it is only correct due to:
- max_packet_size for control/bulk/interrupt is required to be
  power-of-two.
- (CONFIG_DWC2_MAX_TRANSFER_SIZE + 1) % max-packet-size is zero
  for all allowed (2^3 ... 2^9) packet sizes

As the max xfer len is loop invariant, it can be moved out of the loop.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoMerge git://git.denx.de/u-boot-fdt
Tom Rini [Fri, 22 Jan 2016 22:01:22 +0000 (17:01 -0500)]
Merge git://git.denx.de/u-boot-fdt

8 years agodevicetree: use wildcard to clean arch subdir
Thomas Chou [Wed, 6 Jan 2016 01:49:24 +0000 (09:49 +0800)]
devicetree: use wildcard to clean arch subdir

Use wildcard to clean arch subdirectories, as it is cleaner than
listing all the arch which builds dtb.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agorockchip: Update the README
Simon Glass [Fri, 22 Jan 2016 02:45:25 +0000 (19:45 -0700)]
rockchip: Update the README

GPIO, I2C, LCD and HDMI are now implemented. We have more than one PMIC.
There is an implementation to run the CPU at full speed although it does
not seem to make much difference.

Update the README to cover recent developments.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: Add support for Raxda Rock 2
Simon Glass [Fri, 22 Jan 2016 02:45:24 +0000 (19:45 -0700)]
rockchip: Add support for Raxda Rock 2

This board includes an RK3288 SoC on a SOM. It can be mounted on a
base-board which provides a wide range of peripherals.

So far this is verified to boot to a prompt from a microSD card. The serial
console works as well as HDMI.

Thanks to Tom Cubie for sending me a board.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: rock2: dts: Make changes for U-Boot
Simon Glass [Fri, 22 Jan 2016 02:45:23 +0000 (19:45 -0700)]
rockchip: rock2: dts: Make changes for U-Boot

Add the required pre-relocation tags and SDRAM init information for U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: rock2: Bring in device tree files from Linux
Simon Glass [Fri, 22 Jan 2016 02:45:22 +0000 (19:45 -0700)]
rockchip: rock2: Bring in device tree files from Linux

Bring in the current device tree files for rock2 from linux/next commit
719d6c1. Hopefully this is the latest one.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: dts: Sync up SPDIF node with Linux
Simon Glass [Fri, 22 Jan 2016 02:45:21 +0000 (19:45 -0700)]
rockchip: dts: Sync up SPDIF node with Linux

This has been added and we have references to it in the rock2 board. Add
this node.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: firefly-rk3288: Enable HDMI output
Simon Glass [Fri, 22 Jan 2016 02:45:20 +0000 (19:45 -0700)]
rockchip: firefly-rk3288: Enable HDMI output

Enable HDMI output and a console on firefly.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: jerry: Enable EDP and HDMI video output
Simon Glass [Fri, 22 Jan 2016 02:45:19 +0000 (19:45 -0700)]
rockchip: jerry: Enable EDP and HDMI video output

Enable these devices using the VOPL video output device. We explicitly
disable VOPB in the device tree to avoid it taking over. Since this device
has an LCD display this comes up by default. If the display fails for some
reason then it will attempt to use HDMI. It is possible to force it to fail
(and thus fall back to HDMI) by puting 'return -EPERM' at the top of
rk_edp_probe(). For now there is no easy way to select between the two.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: jerry: Add support for timing SPI flash speed
Simon Glass [Fri, 22 Jan 2016 02:45:18 +0000 (19:45 -0700)]
rockchip: jerry: Add support for timing SPI flash speed

Add the 'time' and 'sf test' commands so that we can test SPI flash
performance.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: spl: Support full-speed CPU in SPL
Simon Glass [Fri, 22 Jan 2016 02:45:17 +0000 (19:45 -0700)]
rockchip: spl: Support full-speed CPU in SPL

Add a feature which speeds up the CPU to full speed in SPL to minimise
boot time. This is only supported for certain boards (at present only
jerry).

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: rk3288: pinctrl: Fix HDMI pinctrl
Simon Glass [Fri, 22 Jan 2016 02:45:16 +0000 (19:45 -0700)]
rockchip: rk3288: pinctrl: Fix HDMI pinctrl

Since the device tree does not specify the EDID pinctrl option for HDMI we
must set it manually. Fix the driver to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: rk3288: clock: Fix various minor errors
Simon Glass [Fri, 22 Jan 2016 02:45:15 +0000 (19:45 -0700)]
rockchip: rk3288: clock: Fix various minor errors

Fix a number of small errors which were found in reviewing the clock code.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: jerry: Fix the SDRAM timing
Simon Glass [Fri, 22 Jan 2016 02:45:14 +0000 (19:45 -0700)]
rockchip: jerry: Fix the SDRAM timing

There is a minor error in the SDRAM timing. It does not seem to affect
anything so far. Fix it just in case.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: spl: Drop MMC support code when not needed
Simon Glass [Fri, 22 Jan 2016 02:45:13 +0000 (19:45 -0700)]
rockchip: spl: Drop MMC support code when not needed

When the board does not use MMC SPL this code is a waste of space. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>