]> code.ossystems Code Review - bsp/u-boot.git/log
bsp/u-boot.git
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 years agoot1200: add ot1200_spl_defconfig file
Christian Gmeiner [Mon, 19 Jan 2015 16:26:50 +0000 (17:26 +0100)]
ot1200: add ot1200_spl_defconfig file

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Stefano Babic <sbabic@denx.de>#
10 years agoot1200: add basic SPL support
Christian Gmeiner [Mon, 19 Jan 2015 16:26:49 +0000 (17:26 +0100)]
ot1200: add basic SPL support

Currently we only support the Micron MT41K128M16JT-125 ddr3 chip.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
10 years agoot1200: add SPL configuration
Christian Gmeiner [Mon, 19 Jan 2015 16:26:48 +0000 (17:26 +0100)]
ot1200: add SPL configuration

We will only support loading u-boot.img from SPI flash stored
at the offset of 64k.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
10 years agoot1200: enable spi clock directly in ccgr_init(..)
Christian Gmeiner [Mon, 19 Jan 2015 16:26:47 +0000 (17:26 +0100)]
ot1200: enable spi clock directly in ccgr_init(..)

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
10 years agoot1200: move ccgr and gpr init to c functions
Christian Gmeiner [Mon, 19 Jan 2015 16:26:46 +0000 (17:26 +0100)]
ot1200: move ccgr and gpr init to c functions

We need this way for SPL boot.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
10 years agoot1200: make use of imx_ddr_size(..)
Christian Gmeiner [Mon, 19 Jan 2015 16:26:45 +0000 (17:26 +0100)]
ot1200: make use of imx_ddr_size(..)

To support different ddr3 memory sizes we should start using
imx_ddr_size(..) instead of the define PHYS_SDRAM_SIZE.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
10 years agoot1200: select SUPPORT_SPL
Christian Gmeiner [Mon, 19 Jan 2015 16:26:44 +0000 (17:26 +0100)]
ot1200: select SUPPORT_SPL

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
10 years agomx6: fix warning in platinum board
Stefano Babic [Thu, 22 Jan 2015 09:09:00 +0000 (10:09 +0100)]
mx6: fix warning in platinum board

Fix warning due to missing prototype for writel

Signed-off-by: Stefano Babic <sbabic@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
10 years agoimx: mx6: Change ENV offset to 512K bytes for larger u-boot image
Ye.Li [Fri, 16 Jan 2015 08:47:44 +0000 (16:47 +0800)]
imx: mx6: Change ENV offset to 512K bytes for larger u-boot image

To align with other mx6 boards, change ENV offset from 384KB to
512KB position to fit a larger u-boot image.

Signed-off-by: Ye.Li <B37916@freescale.com>
10 years agoimx:mx6sxsabresd board spl support
Peng Fan [Tue, 30 Dec 2014 09:24:03 +0000 (17:24 +0800)]
imx:mx6sxsabresd board spl support

Add board level spl support for mx6sxsabresd board.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
10 years agoimx:mx6 add mx6sx in imx spl header file
Peng Fan [Tue, 30 Dec 2014 09:24:02 +0000 (17:24 +0800)]
imx:mx6 add mx6sx in imx spl header file

Since mx6sx's memory space is different to mx6dq, redefine the SPL
related macro for mx6sx chip.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
10 years agoimx:mx6sx add dram io configure for mx6sx
Peng Fan [Tue, 30 Dec 2014 09:24:01 +0000 (17:24 +0800)]
imx:mx6sx add dram io configure for mx6sx

Define two structure mx6sx_iomux_ddr_regs and mx6sx_iomux_grp_regs.
Add a new function mx6sx_dram_iocfg to configure dram io.

Since mx6sx only have one channel mmdc0, define a new empty macro MMDC1
to replace mmdc1->entry=value for mx6sx. And to other mx6 soc, MMDC1
effects as "mmdc1->entry=value".

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
10 years agoimx:mx6sxsabresd spl support in header file
Peng Fan [Tue, 30 Dec 2014 09:24:00 +0000 (17:24 +0800)]
imx:mx6sxsabresd spl support in header file

Add SPL support in mx6sxsabresd header file.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
10 years agoimx:mx6sxsabresd select SUPPORT_SPL
Peng Fan [Tue, 30 Dec 2014 09:23:59 +0000 (17:23 +0800)]
imx:mx6sxsabresd select SUPPORT_SPL

select SUPPORT_SPL for mx6sxsabresd.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
10 years agoimx:mx6sxsabresd add spl config file
Peng Fan [Tue, 30 Dec 2014 09:23:58 +0000 (17:23 +0800)]
imx:mx6sxsabresd add spl config file

Add a SPL default configuration file for mx6sxsabresd board.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
10 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>
10 years agoboard/T1040rdb: Add VSC9953 support for T1040rdb board
Codrin Ciubotariu [Wed, 21 Jan 2015 09:54:12 +0000 (11:54 +0200)]
board/T1040rdb: Add VSC9953 support for T1040rdb board

This patch configures and initializes the L2 switch on T1040rdb board.
The external L2 switch ports may be connected to PHYs only over
QSGMII, for T1040rdb.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@freescale.com>
10 years agoboard/T1040qds: Add VSC9953 support for T1040qds board
Codrin Ciubotariu [Wed, 21 Jan 2015 09:54:11 +0000 (11:54 +0200)]
board/T1040qds: Add VSC9953 support for T1040qds board

This patch configures and initializes the L2 switch on T1040QDS board.
The L2 switch ports must be initialized according to the SerDes
protocols.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@freescale.com>
10 years agoboard/T104xrdb: T1040 FMAN ports FM1@DTSEC1 and FM1@DTSEC2 have no PHYs
Codrin Ciubotariu [Mon, 12 Jan 2015 12:08:37 +0000 (14:08 +0200)]
board/T104xrdb: T1040 FMAN ports FM1@DTSEC1 and FM1@DTSEC2 have no PHYs

Freescale's T1040qds board may be configured to have up to
5 FMAN ports (FM1@DTSEC1 to FM1@DTSEC5). From these 5 ports,
2 of them may be fixed-links (FM1@DTSEC1 annd FM1@DTSEC2),
connected to other two ports from an intergrated
VSC9953 L2 Switch (switch ports 8 and 9). These fixed-link
ports have no PHYs attatched, so they don't have a
corresponding MDIO.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
10 years agoboard/T1040qds: T1040 FMAN ports FM1@DTSEC1 and FM1@DTSEC2 have no PHYs
Codrin Ciubotariu [Mon, 12 Jan 2015 12:08:36 +0000 (14:08 +0200)]
board/T1040qds: T1040 FMAN ports FM1@DTSEC1 and FM1@DTSEC2 have no PHYs

Freescale's T1040qds board may be configured to have up to
5 FMAN ports (FM1@DTSEC1 to FM1@DTSEC5). From these 5 ports,
2 of them may be fixed-links (FM1@DTSEC1 annd FM1@DTSEC2),
connected to other two ports from an intergrated
VSC9953 L2 Switch (switch ports 8 and 9). These fixed-link
ports have no PHYs attatched, so they don't have a
corresponding MDIO.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
10 years agoboard/T1040qds: Fix lane-to-slot mapping for SerDes protocol 0x89
Codrin Ciubotariu [Mon, 12 Jan 2015 12:08:35 +0000 (14:08 +0200)]
board/T1040qds: Fix lane-to-slot mapping for SerDes protocol 0x89

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
10 years agoarch/powerpc: Initialize VSC9953 L2 Switch
Codrin Ciubotariu [Wed, 21 Jan 2015 09:54:10 +0000 (11:54 +0200)]
arch/powerpc: Initialize VSC9953 L2 Switch

This patch initializes VSC9953 L2 Switch for boards that have
CONFIG_VSC9953 defined in their config file.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@freescale.com>
10 years agoMIPS: add support for pre-relocation malloc
Daniel Schwierzeck [Sun, 18 Jan 2015 21:18:39 +0000 (22:18 +0100)]
MIPS: add support for pre-relocation malloc

Implement MIPS specific setup of the gd_t structure to support
pre-relocation malloc. If CONFIG_SYS_MALLOC_F_LEN is specified,
a memory area will be reserved after the initial stack area and
the gd->malloc_base pointer will be initialized.

After this patch the new driver model can be used on MIPS.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
10 years agoMIPS: add support for CONFIG_SYS_INIT_SP_ADDR
Daniel Schwierzeck [Sun, 18 Jan 2015 21:18:38 +0000 (22:18 +0100)]
MIPS: add support for CONFIG_SYS_INIT_SP_ADDR

Support the existing config option CONFIG_SYS_INIT_SP_ADDR on
MIPS. This allows to move the initial stack to other places
than the beginning of RAM.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
10 years agoMIPS: add Kconfig option for CONFIG_SWAP_IO_SPACE
Daniel Schwierzeck [Sun, 18 Jan 2015 21:00:18 +0000 (22:00 +0100)]
MIPS: add Kconfig option for CONFIG_SWAP_IO_SPACE

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
10 years agoMIPS: replace $(CPU) with Kconfig symbols
Daniel Schwierzeck [Sun, 18 Jan 2015 20:59:35 +0000 (21:59 +0100)]
MIPS: replace $(CPU) with Kconfig symbols

Conditionally set head-y and lib-y with boolean Kconfig symbols
for selected CPU. This deprecates the usage of the $(CPU) variable.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
10 years agoMIPS: use common code from lib/time.c
Thomas Langer [Wed, 14 Jan 2015 18:44:00 +0000 (18:44 +0000)]
MIPS: use common code from lib/time.c

The common code just needs the C0_COUNT as free running counter,
without the need of writing and checking C0_COMPARE.

The function get_tbclk() is still implemented here instead of changing
all places of CONFIG_SYS_MIPS_TIMER_FREQ to CONFIG_SYS_TIMER_RATE.

The change was tested on a MIPS32 system, but as the MIPS64 code
was/is the same, this should be no problem.

Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
10 years agoMIPS: bootm: add bootstage reporting
Daniel Schwierzeck [Wed, 14 Jan 2015 20:44:13 +0000 (21:44 +0100)]
MIPS: bootm: add bootstage reporting

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
10 years agoMIPS: bootm: prepare a flattened device tree for the kernel
Daniel Schwierzeck [Wed, 14 Jan 2015 20:44:13 +0000 (21:44 +0100)]
MIPS: bootm: prepare a flattened device tree for the kernel

Add the initial code to prepare a flattened device tree for
the kernel like relocating the FDT blob and fixing up the
/chosen and /memory nodes.

The final hand over to the kernel is not yet implemented. After
the community agreed on the MIPS boot interface for device trees,
the corresponding code will be added.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
10 years agoMIPS: bootm: add mem, rd_start and rd_size to kernel command line
Daniel Schwierzeck [Wed, 14 Jan 2015 20:44:13 +0000 (21:44 +0100)]
MIPS: bootm: add mem, rd_start and rd_size to kernel command line

If the user wants to boot a kernel without legacy environment,
information like memory size, initrd address and size should be
handed over to the kernel in the command line.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
10 years agoMIPS: bootm: refactor preparation of Linux kernel environment
Daniel Schwierzeck [Wed, 14 Jan 2015 20:44:13 +0000 (21:44 +0100)]
MIPS: bootm: refactor preparation of Linux kernel environment

Move preparation of Linux kernel environment in a separate
function and mark it as legacy. Add a Kconfig option to make
that legacy mode configurable.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
10 years agoMIPS: bootm: refactor preparation of Linux kernel command line
Daniel Schwierzeck [Wed, 14 Jan 2015 20:44:13 +0000 (21:44 +0100)]
MIPS: bootm: refactor preparation of Linux kernel command line

Move preparation of Linux kernel command line in a separate
function and mark it as legacy. Add a Kconfig option to make
that legacy mode configurable.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
10 years agomicroblaze: Support stack protection feature
Michal Simek [Tue, 4 Nov 2014 12:30:14 +0000 (13:30 +0100)]
microblaze: Support stack protection feature

Ensure that stack didn't rewrite important part
of u-boot.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agommc: zynq: Use phys_addr_t for addresses
Michal Simek [Wed, 14 Jan 2015 15:11:47 +0000 (16:11 +0100)]
mmc: zynq: Use phys_addr_t for addresses

phys_addr_t is designed for physical addresses that's why
use it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agonet: ll_temac: Fix compilation warning because of phys_addr_t
Michal Simek [Thu, 15 Jan 2015 17:52:32 +0000 (18:52 +0100)]
net: ll_temac: Fix compilation warning because of phys_addr_t

This patch fix the compilation warning
w+../drivers/net/xilinx_ll_temac.c: In function 'll_temac_init':
w+../drivers/net/xilinx_ll_temac.c:235:3: warning: format '%X' expects
argument of type 'unsigned int', but argument 4 has type 'phys_addr_t'
[-Wformat]
introduced by
"net: Declare physical address as phys_addr_t unsigned type"
(sha1: 16ae7827226ce8b255245d1932e8069f00997a26).

Reported-by: Tom Rini <trini@ti.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agonet: gem: Use phys_addr_t instead of int for addresses
Michal Simek [Wed, 14 Jan 2015 14:44:21 +0000 (15:44 +0100)]
net: gem: Use phys_addr_t instead of int for addresses

Use phys_addr_t for physical address declaration.
It is also unsigned type instead of sign.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agofpga: zynqpl: Add support for zc7035
Siva Durga Prasad Paladugu [Tue, 25 Nov 2014 09:59:54 +0000 (15:29 +0530)]
fpga: zynqpl: Add support for zc7035

Added support for zc7035

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agofpga: xilinx: Show fpga info if defined
Michal Simek [Wed, 16 Jul 2014 08:36:42 +0000 (10:36 +0200)]
fpga: xilinx: Show fpga info if defined

Show fpga_op->info even if desc->iface_fns is not defined.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
10 years agofpga: xilinx: Check if fpga operations are defined
Michal Simek [Wed, 16 Jul 2014 08:31:21 +0000 (10:31 +0200)]
fpga: xilinx: Check if fpga operations are defined

Ensure that operations are correctly setup.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
10 years agofpga: xilinx: zynqpl: Setup NULL fpga_op without driver
Michal Simek [Wed, 16 Jul 2014 08:47:13 +0000 (10:47 +0200)]
fpga: xilinx: zynqpl: Setup NULL fpga_op without driver

Set fpga operations to NULL for cases where
FPGA is setup in board file but driver is not added

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agofpga: xilinx: virtex2: Fix macro indentation
Michal Simek [Wed, 16 Jul 2014 08:47:43 +0000 (10:47 +0200)]
fpga: xilinx: virtex2: Fix macro indentation

No functional changes.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agofpga: xilinx: virtex2: Setup NULL fpga_op without driver
Michal Simek [Wed, 16 Jul 2014 08:48:08 +0000 (10:48 +0200)]
fpga: xilinx: virtex2: Setup NULL fpga_op without driver

Set fpga operations to NULL for cases where
FPGA is setup in board file but driver is not added

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agofpga: xilinx: spartan3: Setup NULL fpga_op without driver
Michal Simek [Wed, 16 Jul 2014 08:46:35 +0000 (10:46 +0200)]
fpga: xilinx: spartan3: Setup NULL fpga_op without driver

Set fpga operations to NULL for cases where
FPGA is setup in board file but driver is not added.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agofpga: xilinx: spartan2: Setup NULL fpga_op without driver
Michal Simek [Wed, 16 Jul 2014 08:43:47 +0000 (10:43 +0200)]
fpga: xilinx: spartan2: Setup NULL fpga_op without driver

Set fpga operations to NULL for cases where
FPGA is setup in board file but driver is not added.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agofpga: Export fpga_get_desc for SPL
Michal Simek [Tue, 13 Jan 2015 15:09:53 +0000 (16:09 +0100)]
fpga: Export fpga_get_desc for SPL

SPL needs to detect FPGA device which will be used
for loading bitstream.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agofpga: Remove extern prototypes from .h
Michal Simek [Wed, 14 Jan 2015 08:59:00 +0000 (09:59 +0100)]
fpga: Remove extern prototypes from .h

This problem is reported by checkpatch.pl
Warnings:
CHECK: extern prototypes should be avoided in .h files

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agofpga: Protect GZIP usage when LOADMK is enabled
Michal Simek [Wed, 16 Jul 2014 08:30:50 +0000 (10:30 +0200)]
fpga: Protect GZIP usage when LOADMK is enabled

For case where CMD_FPGA_LOADMK is enabled and GZIP disable.

Warning log:
common/built-in.o: In function `do_fpga':
/mnt/disk/u-boot/common/cmd_fpga.c:218: undefined reference to `gunzip'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
10 years agomicroblaze: Enable hardware exception by default
Michal Simek [Tue, 4 Nov 2014 12:27:52 +0000 (13:27 +0100)]
microblaze: Enable hardware exception by default

Enable hardware exception by default to be able to
handle it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 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

10 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

10 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

10 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>
10 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
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>