]> git.kernelconcepts.de Git - karo-tx-uboot.git/log
karo-tx-uboot.git
9 years agosunxi: Add new Chuwi V7 CW0825 board / defconfig
Hans de Goede [Thu, 1 Jan 2015 08:12:42 +0000 (09:12 +0100)]
sunxi: Add new Chuwi V7 CW0825 board / defconfig

The Chuwi V7 is an A10 (sun4i) based tablet with 1G of RAM, 16G of nand flash,
microsd slot, 7" 1024x768 lvds ips panel, mini hdmi out, headphones out,
stereo speakers, front & back camera and usb wifi.

It is clearly marked "CHUWI", "V7" and "Model: CW0825" on the back of the
tablet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Add support for Hitachi tx18d42vm LVDS LCD panels
Hans de Goede [Tue, 20 Jan 2015 08:23:36 +0000 (09:23 +0100)]
sunxi: video: Add support for Hitachi tx18d42vm LVDS LCD panels

Add support for Hitachi tx18d42vm LVDS LCD panels, these panels have a
lcd controller which needs to be initialized over SPI, once that is
done they work like a regular LVDS panel.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agovideo: Add support for Hitachi tx18d42vm LVDS LCD panels
Hans de Goede [Tue, 20 Jan 2015 08:22:26 +0000 (09:22 +0100)]
video: Add support for Hitachi tx18d42vm LVDS LCD panels

Add support for Hitachi tx18d42vm LVDS LCD panels, these panels have a
lcd controller which needs to be initialized over SPI, once that is
done they work like a regular LVDS panel.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
9 years agosunxi: Hookup OTG USB controller support
Hans de Goede [Sun, 11 Jan 2015 16:17:00 +0000 (17:17 +0100)]
sunxi: Hookup OTG USB controller support

Hookup OTG USB controller support and enable the otg controller + USB-keyb
on various tablets.

This allows tablet owners to interact with u-boot without needing to solder
a serial console onto their tablet PCB.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Add Gemei G9 (Allwinner A10/sun4i) tablet
Priit Laes [Mon, 19 Jan 2015 20:16:10 +0000 (22:16 +0200)]
sunxi: Add Gemei G9 (Allwinner A10/sun4i) tablet

Gemei G9 is an A10 based tablet, with 1G RAM, 16G NAND, 1024x768
IPS LCD display, stereo speakers, 1.3MP front camera and 5 MP
rear camera, 8000mAh battery, GT901 2+1 touchscreen, Bosch BMA250
accelerometer and RTL8188CUS USB wifi. It also has MicroSD slot,
miniHDMI, 1 x MicroUSB OTG port and 1 x MicroUSB host port and
3.5mm headphone jack.
More details are available at: http://linux-sunxi.org/Gemei_G9

Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: video: Use frontend for dma on sun4i to fix memory bandwidth problems
Hans de Goede [Mon, 19 Jan 2015 07:44:07 +0000 (08:44 +0100)]
sunxi: video: Use frontend for dma on sun4i to fix memory bandwidth problems

Testing has shown that on sun4i the display backend engine does not have
deep enough fifo-s causing flickering / tearing in full-hd mode due to
fifo underruns. On sun4i use the display frontend engine to do the dma from
memory, as the frontend does have deep enough fifo-s.

As added advantage of this is that it results in much better memory bandwidth
as it reduces the amount of dram bank switches, for more details see:

http://ssvb.github.io/2014/11/11/revisiting-fullhd-x11-desktop-performance-of-the-allwinner-a10.html

Note that this changes the pipeline searched for in the simplefb node, we can
get away with doing this now, since no kernel has yet shipped with simplefb
dtb nodes, and I will make sure to get a simplefb node with the new pipeline
into 3.19 before it ships.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Add Marsboard A10 support
Aleksei Mamlin [Mon, 19 Jan 2015 11:46:46 +0000 (14:46 +0300)]
sunxi: Add Marsboard A10 support

This patch add support for Marsboard A10 board.

The Marsboard A10 is a A10 based development board with 1G RAM, 1G NAND,
micro SD card slot, SATA 2.0 socket, 10/100 ethernet, mini HDMI port,
1 USB OTG port and 2 USB 2.0 ports. Board does not use the AXP209 pmic,
it does not have a pmic at all.
Board also have 2 expansion 70 pin headers.

Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agovideo: ssd2828: Allow using 'pclk' as the PLL clock source
Siarhei Siamashka [Mon, 19 Jan 2015 03:23:35 +0000 (05:23 +0200)]
video: ssd2828: Allow using 'pclk' as the PLL clock source

Instead of using the internal 'tx_clk' clock source, it is also
possible to use the pixel clock signal from the parallel LCD
interface ('pclk') as the reference clock for PLL.

The 'tx_clk' clock speed may be different on different boards/devices
(the allowed range is 8MHz - 30MHz). Which is not very convenient,
especially considering the need to know the exact 'tx_clk' clock
speed. This clock speed may be difficult to identify without having
device schematics and/or accurate documentation/sources every time.

Using 'pclk' is free from all these problems.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosun6i: Add LCD display support for MSI Primo81 tablet
Siarhei Siamashka [Mon, 19 Jan 2015 03:23:34 +0000 (05:23 +0200)]
sun6i: Add LCD display support for MSI Primo81 tablet

The MSI Primo81 tablet has B079XAN01/LP079X01 7.85" 768x1024 IPS
MIPI display, connected to the parallel LCD interface via SSD2828
bridge chip. The panel has 18-bit color depth and needs dithering,
in spite of having RGB data delivered from A31s to SSD2828 using
24-bit arrangement.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agovideo: sunxi: Hook up SSD2828 with the sunxi video driver
Siarhei Siamashka [Mon, 19 Jan 2015 03:23:33 +0000 (05:23 +0200)]
video: sunxi: Hook up SSD2828 with the sunxi video driver

Convert GPIO names from Kconfig strings into pin numbers for
the 'ssd2828_config' struct. Add SSD2828 initialization between
enabling the parallel LCD interface and turning on the backlight.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agovideo: Add support for SSD2828 (parallel LCD to MIPI bridge)
Siarhei Siamashka [Mon, 19 Jan 2015 03:23:32 +0000 (05:23 +0200)]
video: Add support for SSD2828 (parallel LCD to MIPI bridge)

SSD2828 can take pixel data coming from a parallel LCD interface
and translate it on the fly into MIPI DSI interface for driving
a MIPI compatible TFT display. SSD2828 is configured over SPI
interface, which may or may not have MISO pin wired up on some
hardware. So a write-only SPI mode also has to be supported.

The SSD2828 support code is implemented as a utility function
and needs to be called from real display drivers, which are
responsible for driving parallel LCD hardware in front of the
video pipeline. The usage instructions are provided as comments
in the header file.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agoinclude: Add header file with MIPI DSI constants from linux 3.18
Siarhei Siamashka [Mon, 19 Jan 2015 03:23:31 +0000 (05:23 +0200)]
include: Add header file with MIPI DSI constants from linux 3.18

The file, originally named "include/video/mipi_display.h", is taken from
linux 3.18 (commit b2776bf7149bddd1f4161f14f79520f17fc1d71d).

It provides MIPI DSI constants for DCS commands, which are needed to
implement support for SSD2828 in u-boot.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: axp221: Add ELDO[1-3] support
Siarhei Siamashka [Mon, 19 Jan 2015 03:23:30 +0000 (05:23 +0200)]
sunxi: axp221: Add ELDO[1-3] support

And also add Kconfig option for selecting ELDO3 voltage. The reason
for having this option is that the Android kernel sets ELDO3 to
1.2V when powering up LCD in the case if 'lcd_if' configuration
variable is set to 6 (LCD_IF_EXT_DSI) in the FEX file. Most likely
to supply power for a SSD2828 chip.

However on the MSI Primo81 tablet, which is using this particular
'lcd_if = 6' setup for LCD, setting the ELDO3 voltage appears to
be unnecessary and it works regardless. Having no schematics of
this tablet, I can only guess that 1.2V is supplied to SSD2828
in some other way.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: Add mk802_a10s board / defconfig
Hans de Goede [Sat, 17 Jan 2015 21:31:30 +0000 (22:31 +0100)]
sunxi: Add mk802_a10s board / defconfig

The mk802_a10s re-uses is the "classic" mk802 case and functionality, but has
an A10s SoC inside rather then the A10, it features 512M or 1G RAM, 4G nand,
a mini-hdmi female connector, USB-A receptacle, mini-usb receptacle (OTG)
and a sdio realtek wifi chip. Unlike the original mk802 it does have a pmic,
the axp152.

For more details see: http://linux-sunxi.org/Semitime_g2

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Add mk802ii board / defconfig
Hans de Goede [Sat, 17 Jan 2015 21:18:51 +0000 (22:18 +0100)]
sunxi: Add mk802ii board / defconfig

The mk802ii is a revised version of the mk802 A10 based hdmi tv-stick, it
features 1G RAM, 4G nand, a hdmi male connector, USB-A receptacle, 2 micro
usb receptacles (OTG & power) and USB-wifi, and does come with an axp209 pmic.

For more details see: http://linux-sunxi.org/Rikomagic_mk802ii

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Add mk802 board / defconfig
Hans de Goede [Sat, 17 Jan 2015 21:15:30 +0000 (22:15 +0100)]
sunxi: Add mk802 board / defconfig

The mk802 is the "classic" Allwinner A10 based hdmi tv-stick, it features
512M or 1G RAM, 4G nand, a mini-hdmi female connector, USB-A receptacle,
mini-usb receptacle (OTG) and USB-wifi. Somewhat unique the mk802 does not
use the AXP209 pmic, it does not have a pmic at all.

For more details see: http://linux-sunxi.org/Rikomagic_mk802

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Remove CONFIG_TARGET_FOO for sun4i, sun6i and sun8i boards
Hans de Goede [Sat, 17 Jan 2015 16:01:38 +0000 (17:01 +0100)]
sunxi: Remove CONFIG_TARGET_FOO for sun4i, sun6i and sun8i boards

CONFIG_TARGET_FOO is only used in board/sunxi/Makefile to select the
dram config for sun5i and sun7i boards and in board/sunxi/gmac.c for some
special handling of the bananapi/bananapro (both sun7i), iow it is not used
at all on any sun4i, sun6i and sun8i boards so lets get rid of it there.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Convert sun4i boards to use auto dram configuration
Hans de Goede [Sat, 17 Jan 2015 13:45:12 +0000 (14:45 +0100)]
sunxi: Convert sun4i boards to use auto dram configuration

Currently we've separate detailed dram settings for all sun4i boards, this
moves them over to using auto dram configuration so that we can get rid of
all the per board dram_foo.c files.

Tested-by: Hans de Goede <hdegoede@redhat.com> on a A10-OLinuXino-Lime,
 Chuwi_V7_CW0825 and ba10_tv_box
Tested-by: Zoltan HERPAI <wigyori@uid0.hu> on a pcduino
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Stop differentiating between 512M and 1G variants of the same board
Hans de Goede [Sat, 17 Jan 2015 13:24:55 +0000 (14:24 +0100)]
sunxi: Stop differentiating between 512M and 1G variants of the same board

While working on adding more boards I noticed that we lack a config for
the 512M cubieboard, and that some of the new boards which I want to add also
have 512M and 1G variants, rather then adding 2 defconfig's for all of these,
lets switch the exising boards which have both a 512M and 1024M variant over
to the sun4i dram autoconfig code.

This also drops the foo_RAMSIZE_defconfig variants of boards where we currently
have 2 separate configs already.

Note:
1) The newly introduced CONFIG_DRAM_EMR1 kconfig value is not used with
a value other then its default for now, but we need this to be configurable
to support some new boards with auto dram config.

2) We always set all CONFIG_DRAM_foo values in defconfigs, even if they match
the defaults, this is done to make it more clear what values are used for a
certain board.

This has been tested on a Mele A1000, Mini-X and a Cubieboard, all 1G
variants, the dram autoconfig code has also been tested on a 512M mk802
(a defconfig for the mk802 is added in a later patch).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: ba10_tv_box_defconfig: Fix USB not working
Hans de Goede [Sat, 17 Jan 2015 16:55:18 +0000 (17:55 +0100)]
sunxi: ba10_tv_box_defconfig: Fix USB not working

PH12 is Vbus enable for Vbus2, not Vbus1.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: axp209: Disable interrupts when intializing the axp209
Hans de Goede [Sat, 17 Jan 2015 15:39:20 +0000 (16:39 +0100)]
sunxi: axp209: Disable interrupts when intializing the axp209

We do not use the axp209 interrupt, and at least in my mini-x (which does not
have a power button) the pwr-button pin and the irq pin are soldered together,
so if the axp209 keeps it irq asserted too long it will see a 10s pwr-button
press and hard power off the board, disabling the irqs fixes this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: mmc: Add support for sun9i (A80)
Hans de Goede [Wed, 14 Jan 2015 18:05:03 +0000 (19:05 +0100)]
sunxi: mmc: Add support for sun9i (A80)

The clocks on the A80 are hooked up slightly different, add support for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: mmc: Use a realistic timeout when sending a mmc command
Hans de Goede [Thu, 15 Jan 2015 12:50:35 +0000 (13:50 +0100)]
sunxi: mmc: Use a realistic timeout when sending a mmc command

Wait 1 second for the sdcard to respond, rather then waiting for
0xfffff milliseconds.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosun9i: Add sun9i (A80) clock setup support
Hans de Goede [Wed, 14 Jan 2015 18:56:33 +0000 (19:56 +0100)]
sun9i: Add sun9i (A80) clock setup support

Add initial sun9i (A80) clock setup support, enough to get the uart + mmc
going.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosun9i: Add clock_sun9i.h with ccu register layout for sun9i
Hans de Goede [Wed, 14 Jan 2015 16:30:22 +0000 (17:30 +0100)]
sun9i: Add clock_sun9i.h with ccu register layout for sun9i

Add a headerfile with the sun9i ccu register layout.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosun9i: Add cpu_sun9i.h with iomem defines
Hans de Goede [Tue, 13 Jan 2015 18:22:21 +0000 (19:22 +0100)]
sun9i: Add cpu_sun9i.h with iomem defines

Add a headerfile with all the base addresses from the sun9i blocks.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Rename cpu.h to cpu_sun4i.h
Hans de Goede [Tue, 13 Jan 2015 17:13:50 +0000 (18:13 +0100)]
sunxi: Rename cpu.h to cpu_sun4i.h

sun4i - sun8i have (aprox.) the same iomem layout, but sun9i is quite
different, so add a wrapper cpu.h which includes the right mach specific
cpu_sun#i.h based on mach, like we already do with clock.h and dram.h .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Move clock_get_pllX / clock_set_pllX protos to mach specific headers
Hans de Goede [Wed, 14 Jan 2015 18:17:15 +0000 (19:17 +0100)]
sunxi: Move clock_get_pllX / clock_set_pllX protos to mach specific headers

Which pll-s are available depends on the machine type, move the
clock_get_pllX / clock_set_pllX prototypes to the clock_sun?i.h header files
so that we only declare what is actually available. e.g. clock_get_pll5p()
is not available on sun6i / sun8i, and with sun9i we get a completely
different set of plls.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Drop pll6 setting from clock_init_uart
Hans de Goede [Wed, 14 Jan 2015 18:28:38 +0000 (19:28 +0100)]
sunxi: Drop pll6 setting from clock_init_uart

As the comment says now that we have SPL support this is no longer necessary,
as PLL6 is already setup with the exact same parameters by the SPL.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: display: Make lcd display clk phase configurable
Hans de Goede [Tue, 13 Jan 2015 12:21:46 +0000 (13:21 +0100)]
sunxi: display: Make lcd display clk phase configurable

While running some tests with an Olinuxino-A13-Micro + a 7" Olimex LCD module
I noticed that the screen flickered. This is caused by the lcd display clk
phase reg value being set to 0, where it should be 1 in this setup.

This commit adds a Kconfig option for the lcd display clk phase, so that we
can set it per board. This defaults to 1, because looking at all the fex
files in sunxi-boards, that is by far the most used value.

This commit updated the Ippo and MSI Primo73 tablet defconfigs to override the
default of 1 with 0, as that is the correct value for those tablets, this
keeps the register settings the same as before this commit.

The Olinuxino-A13 defconfigs are not updated, changing the register setting
for these boards from 0 to 1, this is intentional.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Restore lowlevel_init usage
Hans de Goede [Wed, 21 Jan 2015 15:24:05 +0000 (16:24 +0100)]
sunxi: Restore lowlevel_init usage

2 recent sunxi changes have removed the usage of lowlevel_init by moving some
code around and then setting CONFIG_SKIP_LOWLEVEL_INIT.
This is problematic for 2 reasons:

1) It does not just stop s_init from being called, it also stops
cpu_init_cp15 from getting called, which is undesirable.

2) We want u-boot.bin to be usable standalone, without SPL, some people e.g.
use an upstream u-boot.bin together with Allwinner's boot0 loader. So
u-boot.bin must (re)initialize the gpios, timer, etc.

This commit restores the lowlevel_init / s_init usage, while keeping the
changes to no longer use the global-data (gd) struct in the SPL.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agoMerge git://git.denx.de/u-boot-arc
Tom Rini [Tue, 20 Jan 2015 21:41:11 +0000 (16:41 -0500)]
Merge git://git.denx.de/u-boot-arc

9 years agoMerge branch 'master' of git://git.denx.de/u-boot-mmc
Tom Rini [Tue, 20 Jan 2015 15:21:36 +0000 (10:21 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-mmc

9 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Tue, 20 Jan 2015 15:20:13 +0000 (10:20 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

9 years agoMAINTAINERS: add me as the maintainer of mpc837xerdb
Sinan Akman [Sat, 17 Jan 2015 23:54:52 +0000 (18:54 -0500)]
MAINTAINERS: add me as the maintainer of mpc837xerdb

Signed-off-by: Sinan Akman <sinan@writeme.com>
Cc: Tom Rini <trini@ti.com>
9 years agoUse generic board architecture for MPC837xERDB
Sinan Akman [Sat, 17 Jan 2015 07:09:13 +0000 (02:09 -0500)]
Use generic board architecture for MPC837xERDB

Signed-off-by: Sinan Akman <sinan@writeme.com>
Cc: kim.phillips@freescale.com
9 years agoimx: ls102xa: Remove reference to gdata
Simon Glass [Tue, 23 Dec 2014 19:04:58 +0000 (12:04 -0700)]
imx: ls102xa: Remove reference to gdata

The global_data pointer (gd) has already been set before board_init_f()
is called. We should not assign it again. We should also not use gdata since
it is going away.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoimx: woodburn: Remove reference to gdata
Simon Glass [Tue, 23 Dec 2014 19:04:57 +0000 (12:04 -0700)]
imx: woodburn: Remove reference to gdata

The global_data pointer (gd) has already been set before board_init_f()
is called. We should not assign it again. We should also not use gdata since
it is going away.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefano Babic <sbabic@denx.de>
9 years agoimx: cm_fx6: Remove reference to gdata
Simon Glass [Tue, 23 Dec 2014 19:04:56 +0000 (12:04 -0700)]
imx: cm_fx6: Remove reference to gdata

The global_data pointer (gd) has already been set before board_init_f()
is called. We should not assign it again. We should also not use gdata since
it is going away.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Nikita Kiryanov <nikita@compulab.co.il>
Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
9 years agozynq: Remove reference to gdata
Simon Glass [Tue, 23 Dec 2014 19:04:55 +0000 (12:04 -0700)]
zynq: Remove reference to gdata

The global_data pointer (gd) has already been set before board_init_f()
is called. We should not assign it again. We should also not use gdata since
it is going away.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agommc: Skip changing bus width for MMC cards earlier than version 4.0
Andrew Gabbasov [Thu, 25 Dec 2014 16:22:25 +0000 (10:22 -0600)]
mmc: Skip changing bus width for MMC cards earlier than version 4.0

Wider bus widths (larger than default 1 bit) appeared in MMC standard
version 4.0. So, for MMC cards of any earlier version trying to change
the bus width (including ext_csd comparison) does not make any sense.
It may work incorrectly and at least cause unnecessary timeouts.
So, just skip the entire bus width related activity for earlier versions.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Tested-by: Alexey Brodkin <abrodkin@synopsys.com>
9 years agommc: Avoid redundant switching to 1-bit bus width for MMC cards
Andrew Gabbasov [Thu, 25 Dec 2014 16:22:24 +0000 (10:22 -0600)]
mmc: Avoid redundant switching to 1-bit bus width for MMC cards

If all the commands switching an MMC card to 4- or 8-bit bus width fail,
and the bus width for the controller and the driver is still set
to default 1 bit, there is no need to send one more command to switch
the card to 1-bit bus width. Also, if the card or host controller do not
support wider bus widths, there is no need to send a switch command at all.

However, if one of switch commands succeeds, but the subsequent ext_csd
fields comparison fails, the card should be switched to some other bus width
(next in the list for the loop), or to default 1-bit bus width as a last
resort. That's why it would be incorrect to just remove the 1-bit bus width
case from the list, it should still be processed in some cases.

panto: Minor cosmetic edit removing superfluous parentheses.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Tested-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
9 years agommc: extend mmcinfo output to show partition write reliability settings
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:33 +0000 (10:50 +0100)]
mmc: extend mmcinfo output to show partition write reliability settings

This extends the mmcinfo hardware partition info output to show
partitions with write reliability enabled with the "WRREL" string.
If the partition does not have write reliability enabled the "WRREL"
string is omitted; this is analogous to the ehhanced attribute.

Example output:

Device: OMAP SD/MMC
Manufacturer ID: fe
OEM: 14e
Name: MMC16
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.41
High Capacity: Yes
Capacity: 13.8 GiB
Bus Width: 4-bit
Erase Group Size: 8 MiB
HC WP Group Size: 16 MiB
User Capacity: 13.8 GiB ENH WRREL
User Enhanced Start: 0 Bytes
User Enhanced Size: 512 MiB
Boot Capacity: 16 MiB ENH
RPMB Capacity: 128 KiB ENH
GP1 Capacity: 64 MiB ENH WRREL
GP2 Capacity: 64 MiB ENH WRREL

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: extend the mmc hwpartition sub-command to change write reliability
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:32 +0000 (10:50 +0100)]
mmc: extend the mmc hwpartition sub-command to change write reliability

This change extends the mmc hwpartition sub-command to change the
per-partition write reliability settings. It also changes the
syntax used for the enhanced user data area slightly to better
accomodate the write reliability option.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: extend the mmc hardware partitioning API with write reliability
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:31 +0000 (10:50 +0100)]
mmc: extend the mmc hardware partitioning API with write reliability

The eMMC partition write reliability settings are to be set while
partitioning a device, as per the eMMC spec, so changes to these
attributes needs to be done in the hardware partitioning API.
This commit adds such support.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: add mmc hwpartition sub-command to do eMMC hardware partitioning
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:30 +0000 (10:50 +0100)]
mmc: add mmc hwpartition sub-command to do eMMC hardware partitioning

Adds the mmc hwpartition sub-command to perform eMMC hardware
partitioning on an mmc device. The number of arguments can be
large for a complex partitioning, but as the partitioning has
to be done in one go it is difficult to make it simpler.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: add API to do eMMC hardware partitioning
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:29 +0000 (10:50 +0100)]
mmc: add API to do eMMC hardware partitioning

This adds an API to do hardware partitioning on eMMC devices. The
new mmc_hwpart_config() function does the partitioning in one go.
As the different attributes and partitioning options on eMMC may
be interdependent validation has to be done based on the complete
partitioning configuration. The function accepts three modes:

- MMC_HWPART_CONF_CHECK: just validates that the configuration
  is valid.
- MMC_HWPART_CONF_SET: validates and sets all the fields in
  EXT_CSD but without setting the "partitioning completed" bit,
  and thus is reversible.
- MMC_HWPART_CONF_COMPLETE: does everything and is thus not
  reversible.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: the ext_csd data may be used during init even if reading failed
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:28 +0000 (10:50 +0100)]
mmc: the ext_csd data may be used during init even if reading failed

The mmc_startup() function uses the ext_csd data even if reading it
from the mmc device failed. This bug was introduced in commit
bc897b1d4d86597311430dbe7b3e6c807c8c53e5. We now bail out if
reading it fails, this should not be a problem as ext_csd was
introduced in MMC 4.0 and this code is conditional on MMC >= 4.0.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: eMMC partitioning data is not effective till partitioning completed
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:27 +0000 (10:50 +0100)]
mmc: eMMC partitioning data is not effective till partitioning completed

The eMMC spec says that partitioning is only effective after the
PARTITION_SETTING_COMPLETED is set in EXT_CSD (and a power cycle was done,
but that we cannot know). Thus the partition sizes and attributes should
be ignored when that bit is not set, otherwise the various capacities
are not coherent (e.g., the user data capacity will be that of the
unpartitioned device while partition sizes would be non-zero).

Prescence of non-zero partitioning data is nevertheless still used to
activate the high-capacity size definitions (EXT_CSD_ERASE_GROUP_DEF)
as it is necessary to set that to write any of the partitioning fields
in EXT_CSD, so having partitioning data means someone previously
activated that and we should keep it activated.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: show the erase group size and HC WP group size in mmcinfo output
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:26 +0000 (10:50 +0100)]
mmc: show the erase group size and HC WP group size in mmcinfo output

This adds the erase group size and high-capacity WP group size to
mmcinfo's output. The erase group size is necessary to properly align
erase requests on eMMC. The high-capacity WP group size is necessary
to properly align partitions on eMMC.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: read the high capacity WP group size for eMMC
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:25 +0000 (10:50 +0100)]
mmc: read the high capacity WP group size for eMMC

Read the eMMC high capacity write protect group size at mmc device
initialization. This is useful to correctly partition an eMMC device,
as partitions need to be aligned to this size.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: fix erase_grp_size computation with high-capacity size definition
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:24 +0000 (10:50 +0100)]
mmc: fix erase_grp_size computation with high-capacity size definition

The erase_grp_size in struct mmc is to be a size in 512-byte sectors
but the code used to compute it for eMMC when EXT_CSD_ERASE_GROUP_DEF is
enabled computed it as bytes, leading to erase sizes and alignment
much larger than what is actually required by the mmc device.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: display size and start of eMMC enhanced user data area in mmcinfo
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:23 +0000 (10:50 +0100)]
mmc: display size and start of eMMC enhanced user data area in mmcinfo

This adds output to show the eMMC enhanced user data area size and offset
along with the partition sizes in mmcinfo's output.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: read the size of eMMC enhanced user data area
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:22 +0000 (10:50 +0100)]
mmc: read the size of eMMC enhanced user data area

This modification reads the size of the eMMC enhanced user data area
upon initialization of an mmc device, it will be used later by
mmcinfo.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: computation of eMMC GP partition size was missing 512 KiB factor
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:21 +0000 (10:50 +0100)]
mmc: computation of eMMC GP partition size was missing 512 KiB factor

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: incomplete test to switch to high-capacity group size definitions
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:20 +0000 (10:50 +0100)]
mmc: incomplete test to switch to high-capacity group size definitions

The eMMC spec mandates that the high-capacity group size definitions
should be enabled when the device is partitioned (by setting
ERASE_GROUP_DEF in EXT_CSD). The current test to determine when this is
required misses a few cases. In particular a device may have been
partitioned without setting the enhanced attribute on any partition
or partitioning may be completed without creating any extra partitions.

This change moves the code to set ERASE_GROUP_DEF to after reading
all partition information. It is also enabled when
PARTITIONING_SETTING_COMPLETED is set as it is necessary to enable
ERASE_GROUP_DEF before setting that bit, so it means that the user
previously switched to the high capacity definitions.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: skip mmcinfo partition info processing for eMMC < 4.41
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:19 +0000 (10:50 +0100)]
mmc: skip mmcinfo partition info processing for eMMC < 4.41

eMMC partitions are defined as of eMMC 4.41, but mmcinfo process
partition info for eMMC >= 4.0, change it to do it for >= 4.41

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: make eMMC general purpose partition numbering match spec
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:18 +0000 (10:50 +0100)]
mmc: make eMMC general purpose partition numbering match spec

The eMMC spec numbers general purpose partitions starting at 1, but
the mmcinfo output follows the internal numbering which starts at 0.
Make the mmcinfo command output number partitions as in the eMMC
spec to avoid confusion.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: extend mmcinfo to show enhanced partition attribute
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:17 +0000 (10:50 +0100)]
mmc: extend mmcinfo to show enhanced partition attribute

This extends the mmcinfo command's output to show which eMMC partitions
have the enhanced attribute set. Note that the eMMC spec says that
if the enhanced attribute is supported then the boot and RPMB
partitions are of the enhanced type.

The output of mmcinfo becomes:
Device: OMAP SD/MMC
Manufacturer ID: fe
OEM: 14e
Name: MMC16
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.41
High Capacity: Yes
Capacity: 13.8 GiB
Bus Width: 4-bit
User Capacity: 13.8 GiB ENH
Boot Capacity: 16 MiB ENH
RPMB Capacity: 128 KiB ENH
GP1 Capacity: 64 MiB ENH
GP2 Capacity: 64 MiB ENH

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
9 years agommc: show hardware partition sizes in mmcinfo output
Diego Santa Cruz [Tue, 23 Dec 2014 09:50:16 +0000 (10:50 +0100)]
mmc: show hardware partition sizes in mmcinfo output

There is currently no command that will provide an overview of the hardware
partitions present on an eMMC device, one has to switch to every partition
via "mmc dev" and run mmcinfo for each to get the partition's capacity.
This commit adds a few lines of output to mmcinfo with the sizes of the
present partitions, like this:

Device: OMAP SD/MMC
Manufacturer ID: fe
OEM: 14e
Name: MMC16
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.41
High Capacity: Yes
Capacity: 13.8 GiB
Bus Width: 4-bit
User Capacity: 13.8 GiB
Boot Capacity: 16 MiB
RPMB Capacity: 128 KiB
GP1 Capacity: 64 MiB
GP2 Capacity: 64 MiB

panto: Minor edit removing superfluous parentheses.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
9 years agommc: rmobile: Add SDHC support for Renesas rmobile ARM SoC
Nobuhiro Iwamatsu [Tue, 16 Dec 2014 23:03:00 +0000 (08:03 +0900)]
mmc: rmobile: Add SDHC support for Renesas rmobile ARM SoC

This adds Renesas rmobile ARM SoC's SD/MMC host support.
This drivers tested with Gose board and Koelsch board.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
9 years agousb: eth: asix88179: add ability to modify MAC address
Rene Griessl [Mon, 12 Jan 2015 16:51:16 +0000 (17:51 +0100)]
usb: eth: asix88179: add ability to modify MAC address

This patch enables U-Boot to modify the MAC address of the AX88179.
Tested on RECS5250 (similar to Arndale5250)

Signed-off-by: Rene Griessl <rgriessl@cit-ec.uni-bielefeld.de>
9 years agomusb-new: Add interrupt queue support
Hans de Goede [Sun, 11 Jan 2015 19:34:54 +0000 (20:34 +0100)]
musb-new: Add interrupt queue support

Add interrupt queue support, so that a usb keyboard can be used without
causing huge latencies.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agomusb-new: Add urb and hep parameters to construct_urb
Hans de Goede [Sun, 11 Jan 2015 19:34:53 +0000 (20:34 +0100)]
musb-new: Add urb and hep parameters to construct_urb

Make construct_urb take an urb and hep parameter, rather then having it always
operate on the file global urb and hep structs. This is a preperation patch
for adding interrupt queue support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agomusb-new: Properly remove a transfer from the schedule on timeout
Hans de Goede [Sun, 11 Jan 2015 19:34:52 +0000 (20:34 +0100)]
musb-new: Properly remove a transfer from the schedule on timeout

If a transfer / urb times-out, properly remove it from the schedule, rather
then letting it sit on the ep head. This stops the musb code from getting
confused and refusing to queue further transfers after a timeout.

Tested by unplugging a usb-keyboard, replugging it and doing a usb-reset,
before this commit the keyboard would not work after the usb-reset.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agomusb-new: Fix reset sequence when in host mode
Hans de Goede [Sun, 11 Jan 2015 19:34:51 +0000 (20:34 +0100)]
musb-new: Fix reset sequence when in host mode

This commit fixes a number of issues with the reset sequence of musb-new
in host mode:

1) Our usb device probe relies on a second device reset being done after the
first descriptors read. Factor the musb reset code into a usb_reset_root_port
function (and add this as an empty define for other controllers), and call
this when a device has no parent.

2) Just like with normal usb controllers there needs to be a delay after
reset, for normal usb controllers, this is handled in hub_port_reset, add a
delay to usb_reset_root_port.

3) Sync the musb reset sequence with the upstream kernel, clear all bits of
power except bits 4-7, and increase the time reset is asserted to 50 ms.

With these fixes an usb keyboard I have now always enumerates properly, where
as earlier it would only enumerare properly once every 5 tries.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agomusb-new: Fix interrupt transfers not working
Hans de Goede [Sun, 11 Jan 2015 19:34:50 +0000 (20:34 +0100)]
musb-new: Fix interrupt transfers not working

For bulk and ctrl transfers common/usb.c sets udev->status = USB_ST_NOT_PROC,
but it does not do so for interrupt transfers.

musb_uboot.c: submit_urb() however was waiting for USB_ST_NOT_PROC to become 0,
and thus without anyone setting USB_ST_NOT_PROC would exit immediately for
interrupt urbs, returning the urb status of EINPROGRESS as error.

This commit fixes this, thereby also making usb_kbd.c work together with
musb_new and CONFIG_SYS_USB_EVENT_POLL.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agomusb-new: Use time based timeouts rather then cpu-cycles based timeouts
Hans de Goede [Sun, 11 Jan 2015 19:34:49 +0000 (20:34 +0100)]
musb-new: Use time based timeouts rather then cpu-cycles based timeouts

CPU cycle based timeouts are no good, because how long they use depends on
CPU speed. Instead use time based timeouts, and wait one second for a
device connection to show up (per the USB spec), and wait USB_TIMEOUT_MS
for various urbs to complete.

This fixes "usb start" taking for ever when no device is plugged into the
otg port.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agomusb-new: Add sunxi musb controller support
Hans de Goede [Sun, 11 Jan 2015 19:34:48 +0000 (20:34 +0100)]
musb-new: Add sunxi musb controller support

This is based on Jussi Kivilinna's work for the linux-sunxi-3.4 kernel to use
the kernels musb driver instead of Allwinners own custom driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agomusb-new: Add register defines for different reg layout on sunxi
Hans de Goede [Sun, 11 Jan 2015 19:34:47 +0000 (20:34 +0100)]
musb-new: Add register defines for different reg layout on sunxi

The sunxi SoCs also have a musb controller, but with a different register
layout.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agousb: Do not log an error when no devices is plugged into a root-hub-less hcd
Hans de Goede [Sun, 11 Jan 2015 19:34:46 +0000 (20:34 +0100)]
usb: Do not log an error when no devices is plugged into a root-hub-less hcd

Before this commit u-boot would print the following on boot with musb and
no usb device plugged in:

starting USB...
USB0:   Port not available.
USB error: all controllers failed lowlevel init

This commit changes this to:

starting USB...
USB0:   Port not available.

Which is the correct thing to do since the low-level init went fine.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agousb: Fix usb_kbd_deregister when console-muxing is used
Hans de Goede [Sun, 11 Jan 2015 19:34:44 +0000 (20:34 +0100)]
usb: Fix usb_kbd_deregister when console-muxing is used

When iomuxing is used we must not only deregister the device with stdio.c,
but also remove the reference to the device in the console_devices array
used by console-muxing. Add a call to iomux_doenv to usb_kbd_deregister to
update console_devices, which will drop the reference.

This fixes the console filling with "Failed to enqueue URB to controller"
messages after a "usb stop force", or when the USB keyboard is gone after a
"usb reset".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agousb: Add an interval parameter to create_int_queue
Hans de Goede [Sun, 11 Jan 2015 19:38:28 +0000 (20:38 +0100)]
usb: Add an interval parameter to create_int_queue

Currently create_int_queue is only implemented by the ehci code, and that
does not honor interrupt intervals, but other drivers which might also want
to implement create_int_queue may honor intervals, so add an interval param.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agoconfig_distro_bootcmd.h: Remove unnecessary magic to avoid repeated USB scans
Hans de Goede [Tue, 6 Jan 2015 13:27:42 +0000 (14:27 +0100)]
config_distro_bootcmd.h: Remove unnecessary magic to avoid repeated USB scans

Now that "usb start" will only start usb if not already started, we can simply
call "usb start" whenever we (may) need access to usb devices, and it will only
actually scan the bus at the first call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agoUSB: make "usb start" start usb only once
Hans de Goede [Tue, 6 Jan 2015 13:27:41 +0000 (14:27 +0100)]
USB: make "usb start" start usb only once

Currently we've this magic in include/config_distro_bootcmd.h to avoid
scanning the usb bus multiple times.

And it does not work when also using an usb keyboard because then the
preboot command has already scanned the bus, so we're still scanning it
twice.

This commit makes "usb start" only start usb if it is no already started,
allowing us to remove all the magic for it from include/config_distro_bootcmd.h
and just call it unconditionally.

This also causes "usb start" and "usb reset" to actually do what their
different names suggest, rather then both of them doing exactly the same.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agousb: gadget: pxa25x_udc: fix use-before-initialized bug
Alex Sadovsky [Thu, 8 Jan 2015 17:51:10 +0000 (20:51 +0300)]
usb: gadget: pxa25x_udc: fix use-before-initialized bug

Fix use-before-initialized bug in pxa25x_udc driver.

Function usb_gadget_register_driver calls udc_disable,
and udc_disable calls pullup_off that uses dev->mach->udc_command.
But dev->mach is initialized in usb_gadget_register_driver after
calling udc_disable. This patch fixes the order of initialization.

Signed-off-by: Alex Sadovsky <Nable.MainInbox@googlemail.com>
9 years agousb: gadget: f_dfu: Add get_alt function to pass the USB compliance test
Stefan Roese [Fri, 9 Jan 2015 13:54:56 +0000 (14:54 +0100)]
usb: gadget: f_dfu: Add get_alt function to pass the USB compliance test

Without this function the USB compliance test (USB 2.0 Command Verifier) will
fail in the "Interface Descriptor Test" with this error message:

FAIL
(1.2.51) A successful GetInterface request must return the alternate setting
set by a prior call to SetInterface.

Lets add this function to read back the value so that the DFU device fully
passes the USB compliance test.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Roger Meier <r.meier@siemens.com>
Cc: Samuel Egli <samuel.egli@siemens.com>
Cc: Enrico Leto <enrico.leto@siemens.com>
Acked-by: Heiko Schocher <hs@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
9 years agousb: gadget: composite: Fix NULL pointer crash in USB compliance test
Stefan Roese [Fri, 9 Jan 2015 13:54:55 +0000 (14:54 +0100)]
usb: gadget: composite: Fix NULL pointer crash in USB compliance test

On the DXR2 board (AM335x using MUSB) the USB compliance test suite
(USB 2.0 Command Verifier) will cause the board to crash and reset
upon the "BOS Descriptor Test - Addressed state". Here the output
from the DRX2 while running this test:

GADGET DRIVER: usb_dnl_dfu
musb-hdrc: peripheral reset irq lost!
composite_setup (776)
data abort
pc : [<87f693ac>]          lr : [<87f6911c>]
sp : 86f33a58  ip : 00000000     fp : 86f3bbac
r10: 00000f00  r9 : 86f33ef4     r8 : 86f37da8
r7 : 00000005  r6 : 86f33a90     r5 : 00000000  r4 : 86f37e30
r3 : 00000000  r2 : 00000000     r1 : 87f9c888  r0 : 00000016
Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32
Resetting CPU ...

resetting ...

By adding the case statement for USB_DT_BOS and therefore not running
into the default case (jump to unkown label) this crash is fixed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Roger Meier <r.meier@siemens.com>
Cc: Samuel Egli <samuel.egli@siemens.com>
Cc: Enrico Leto <enrico.leto@siemens.com>
Acked-by: Heiko Schocher <hs@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
9 years agosunxi: Drop use of lowlevel_init()
Simon Glass [Tue, 23 Dec 2014 19:04:53 +0000 (12:04 -0700)]
sunxi: Drop use of lowlevel_init()

This does nothing now, so drop it. We have SPL anyway to do our low-level
init.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Move SPL s_init() code to board_init_f()
Simon Glass [Tue, 23 Dec 2014 19:04:52 +0000 (12:04 -0700)]
sunxi: Move SPL s_init() code to board_init_f()

The current sunxi implementation uses gdata, which is going away. It also
sets up DRAM before board_init_f() in SPL.

There is really no reason to do much in s_init() since board_init_f() is
called immediately afterwards. The only change is that we need our own
implementation of board_init_f() which sets up DRAM before the BSS (which
is in DRAM) is cleared.

The s_init() code runs once for SPL and again for U-Boot proper. We
shouldn't need to init the clock/timer/gpio/i2c init twice, so just have it
in SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoarm: Add warnings about using gdata
Simon Glass [Tue, 23 Dec 2014 19:04:51 +0000 (12:04 -0700)]
arm: Add warnings about using gdata

We need to get rid of this SPL-specific setting of the global_data pointer.
It is already set up in start.S immediately before board_init_f() is called,
and there may be information there that is needed (e.g. pre-reloc malloc
info).

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoTI ARMv7: Don't use GD before crt0.S has set it
Tom Rini [Fri, 19 Dec 2014 21:53:24 +0000 (16:53 -0500)]
TI ARMv7: Don't use GD before crt0.S has set it

Prior to this change we set the gd pointer early so that we can store
data in it.  This becomes problematic for DM changes as well as being
odd in general.  Re-work the code paths so that we don't need to set the
gd pointer so early and instead can rely upon the normal setting of it.

In order to do this we do need to move certain calls from s_init into
spl_board_init(), mainly preloader_console_init and
save_omap_boot_params.

Tested on: Beaglebone Black, AM43xx GP EVM, Beagleboard, Beagleboard xM,
OMAP5 uEVM, DRA7xx EVM
Signed-off-by: Tom Rini <trini@ti.com>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agoMerge branch 'master' of git://git.denx.de/u-boot-ti
Tom Rini [Thu, 15 Jan 2015 19:05:31 +0000 (14:05 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-ti

9 years agopowerpc: 74xx_7xx: remove 74xx_7xx cpu support
Masahiro Yamada [Thu, 15 Jan 2015 08:13:24 +0000 (17:13 +0900)]
powerpc: 74xx_7xx: remove 74xx_7xx cpu support

All the 74xx_7xx boards are still non-generic boards:
P3G4, ZUMA, ppmc7xx, ELPPC, mpc7448hpc2

Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: York Sun <yorksun@freescale.com>
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Nye Liu <nyet@zumanetworks.com>
Cc: Roy Zang <tie-fei.zang@freescale.com>
9 years agompc8xx: remove unused linker script
Masahiro Yamada [Thu, 15 Jan 2015 08:12:19 +0000 (17:12 +0900)]
mpc8xx: remove unused linker script

Now TQM8xx is the only remaining board family of mpc8xx.
It uses its own linker script, board/tqc/tqm8xx/u-boot.lds.

arch/powerpc/cpu/mpc8xx/u-boot.lds is not used by any boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Wolfgang Denk <wd@denx.de>
9 years agoppc4xx: remove dead code
Masahiro Yamada [Thu, 15 Jan 2015 08:10:56 +0000 (17:10 +0900)]
ppc4xx: remove dead code

Since commit 843125daebd7 (ppc4xx: remove HH405 board), CONFIG_HH405
is not defined.

Since commit d52633047913 (ppc4xx: remove PMC405), CONFIG_PMC405
is not defined.

Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Fuchs <matthias.fuchs@esd.eu>
9 years agoarc: rename "arc700" in "arcv1"
Alexey Brodkin [Thu, 25 Dec 2014 15:54:58 +0000 (18:54 +0300)]
arc: rename "arc700" in "arcv1"

As a preparation to ARCv2 port submission we rename "arc700" folder to
"arcv1" which stands for ARCv1 ISA also known as ARCompact.

This will allow us to add more flavours of binary-compatible ARCv1 CPUs
like ARC600 if needed later on and all required ARCv2 CPUs (which are
binary incompatible with ARCv1) in "arcv2" folder in subsequent commits.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
9 years agoboard/synopsys: remove selection of CPU from the board
Alexey Brodkin [Thu, 25 Dec 2014 15:47:45 +0000 (18:47 +0300)]
board/synopsys: remove selection of CPU from the board

Both ARCangel4 and AXS10x are FPGA-based boards so they may have
different CPUs. For now we have only 1 option (ARC700) and we define
this as default in arch Kconfig.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
9 years agoarc: move common sources in library
Alexey Brodkin [Sat, 27 Dec 2014 23:42:12 +0000 (02:42 +0300)]
arc: move common sources in library

"reset.c" and "cpu.c" have no architecture-specific code at all.
Others are applicable to either ARC CPU.

This change is a preparation to submission of ARCv2 architecture port.

Even though ARCv1 and ARCv2 ISAs are not binary compatible most of
built-in modules still have the same programming model - AUX registers
are mapped in the same addresses and hold the same data (new featues
extend existing ones).

So only low-level assembly code (start-up, interrupt handlers) is left
as CPU(actually ISA)-specific. This significantyl simplifies maintenance
of multiple CPUs/ISAs.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
9 years agoarc: move linker script in arch/arc/cpu folder
Alexey Brodkin [Sat, 27 Dec 2014 23:45:37 +0000 (02:45 +0300)]
arc: move linker script in arch/arc/cpu folder

This way we'll be able to use the same one script for either ARC CPU.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
9 years agoarc: relocate - minor refactoring and clean-up
Alexey Brodkin [Fri, 26 Dec 2014 16:36:30 +0000 (19:36 +0300)]
arc: relocate - minor refactoring and clean-up

 * use better symbols for relocatable region boundaries
("__image_copy_start" instead of "CONFIG_SYS_TEXT_BASE")
 * remove useless debug messages because they will only show up in case
of both problem (when normal "if" branch won't be taken) and DEBUG take
place which is pretty rare situation.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
9 years agoarc: introduce separate section for interrupt vector table
Igor Guryanov [Wed, 24 Dec 2014 14:17:11 +0000 (17:17 +0300)]
arc: introduce separate section for interrupt vector table

Even though existing implementation works fine in preparation to
submission of ARCv2 architecture we need this change.

In case of ARCv2 interrupt vector table consists of just addresses
of corresponding handlers. And if those addresses will be in .text
section then assembler will encode them as everything in .text section
as middle-endian and then on real execution CPU will read swapped
addresses and will jump into the wild.

Once introduced new section is situated so .text section remains the
first which allows us to use common linker option for linking everything
to a specified CONFIG_SYS_TEXT_BASE.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
9 years agoarc: add dependences on MMU presence
Alexey Brodkin [Wed, 24 Dec 2014 14:00:29 +0000 (17:00 +0300)]
arc: add dependences on MMU presence

Depending on MMU presence in CPU there're differences in HW behavior.
For example address of instruction that caused exception is put in
ECR register if MMU exists and in ERET register otherwise.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
9 years agoarc: interrupts - fix mask setup
Igor Guryanov [Wed, 24 Dec 2014 13:31:26 +0000 (16:31 +0300)]
arc: interrupts - fix mask setup

To disable interrupts we need to reset corresponding flags in STATUS32
register. For this we need to OR flags for interrupts level1 and level2
and then AND with current value in STATUS32.

Before that implementation was incorrect.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
9 years agoarc: add ECR (exception cause register) output
Igor Guryanov [Wed, 24 Dec 2014 13:26:14 +0000 (16:26 +0300)]
arc: add ECR (exception cause register) output

Exception cause register (ECR) contains value that describes a reason
for exception that has happened. This helps a lot to figure-out what
went wrong.

Now we print this register contents when dumping registers.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
9 years agoarc: check caches existence before use
Igor Guryanov [Wed, 24 Dec 2014 13:07:07 +0000 (16:07 +0300)]
arc: check caches existence before use

Some cache operations ({i|d}cache_{enable|disable|status} or
flush_dcache_all) are built and used even if CONFIG_SYS_{I|D}CACHE_OFF
is set.

This is required for force disable of caches on early boot.
What if something was executed before U-boot and enabled caches
(low-level bootloaders, previously run kernel etc.)?

But if CPU doesn't really have caches any attempt to access
cache-related AUX registers triggers instruction error exception.

So for convenience we'll try to avoid exceptions by checking if CPU
actually has caches (we check separately data and instruction cache
existence) at all.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
9 years agoMerge branch 'buildman' of git://git.denx.de/u-boot-x86
Tom Rini [Thu, 15 Jan 2015 15:18:05 +0000 (10:18 -0500)]
Merge branch 'buildman' of git://git.denx.de/u-boot-x86

9 years agobuildman: Add an option to write the full build output
Simon Glass [Tue, 2 Dec 2014 00:34:07 +0000 (17:34 -0700)]
buildman: Add an option to write the full build output

Normally buildman runs with 'make -s' meaning that only errors and warnings
appear in the log file. Add a -V option to run make in verbose mode, and
with V=1, causing a full build log to be created.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Add the option to download toolchains from kernel.org
Simon Glass [Tue, 2 Dec 2014 00:34:06 +0000 (17:34 -0700)]
buildman: Add the option to download toolchains from kernel.org

The site at https://www.kernel.org/pub/tools/crosstool/ is a convenient
repository of toolchains which can be used for U-Boot. Add a feature to
download and install a toolchain for a selected architecture automatically.

It isn't clear how long this site will stay in the current place and
format, but we should be able to rely on bug reports if it changes.

Suggested-by: Marek VaĊĦut <marex@denx.de>
Suggested-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Allow architecture to alias to multiple toolchains
Simon Glass [Tue, 2 Dec 2014 00:34:05 +0000 (17:34 -0700)]
buildman: Allow architecture to alias to multiple toolchains

Some archs have need than one alias, so support a list of alises in the
..buildman file.

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