]> git.sur5r.net Git - u-boot/log
u-boot
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 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 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>
9 years agobuildman: Don't use the local settings when running tests
Simon Glass [Tue, 2 Dec 2014 00:34:04 +0000 (17:34 -0700)]
buildman: Don't use the local settings when running tests

We should create a test setting file when running testes, not use whatever
happens to be on the local machine.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Don't complain about missing sections in ~/.buildman
Simon Glass [Tue, 2 Dec 2014 00:34:03 +0000 (17:34 -0700)]
buildman: Don't complain about missing sections in ~/.buildman

Silently ignore this since it is valid to have missing sections.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Add documentation about the .buildman file
Simon Glass [Tue, 2 Dec 2014 00:34:02 +0000 (17:34 -0700)]
buildman: Add documentation about the .buildman file

This file is only partially documented. Add some more details.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Wolfgang Denk <wd@denx.de>
9 years agobuildman: Add a note about Python pre-requisites
Simon Glass [Tue, 2 Dec 2014 00:34:01 +0000 (17:34 -0700)]
buildman: Add a note about Python pre-requisites

Since we need a few modules which might not be available in a bare-bones
distribution, add a note about that to the README.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Wolfgang Denk <wd@denx.de>
9 years agobuildman: Add an option to use the full tool chain path
Simon Glass [Tue, 2 Dec 2014 00:34:00 +0000 (17:34 -0700)]
buildman: Add an option to use the full tool chain path

In some cases there may be multiple toolchains with the same name in the
path. Provide an option to use the full path in the CROSS_COMPILE
environment variable.

Note: Wolfgang mentioned that this is dangerous since in some cases there
may be other tools on the path that are needed. So this is set up as an
option, not the default. I will need test confirmation (i.e. that this
commit fixes a real problem) before merging it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Steve Rae <srae@broadcom.com>
9 years agobuildman: Put the toolchain path first instead of last in PATH
Simon Glass [Tue, 2 Dec 2014 00:33:59 +0000 (17:33 -0700)]
buildman: Put the toolchain path first instead of last in PATH

If:

1. Toolchains A and B have the same filename
2. Toolchain A is in the PATH
3. Toolchain B is given in ~/.buildman and buildman uses it to build

then buildman will add toolchain B to the end of its path but will not
necessarily use it since U-Boot will find toolchain A first in the PATH.

Try to fix this by putting the toolchain first in the path instead of
last.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Try to avoid hard-coded string parsing
Simon Glass [Tue, 2 Dec 2014 00:33:58 +0000 (17:33 -0700)]
buildman: Try to avoid hard-coded string parsing

The assumption that the compiler name will always end in gcc is incorrect
for clang and apparently on BSD.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Allow specifying a range of commits to build
Simon Glass [Tue, 2 Dec 2014 00:33:57 +0000 (17:33 -0700)]
buildman: Allow specifying a range of commits to build

Adjust the -b flag to permit a range expression as well as a branch.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Tested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agobuildman: Don't remove entire output directory when testing
Simon Glass [Tue, 2 Dec 2014 00:33:56 +0000 (17:33 -0700)]
buildman: Don't remove entire output directory when testing

When running tests the output directory is often wiped. This is only safe if
a branch is being built. The output directory may contain other things
besides the buildman test output.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Add an option to flatten output directory trees
Simon Glass [Tue, 2 Dec 2014 00:33:55 +0000 (17:33 -0700)]
buildman: Add an option to flatten output directory trees

When building current source for a single board, buildman puts the output
in <output_dir>/current/current/<board>. Add an option to make it use
<output_dir>/<board> instead. This removes the unnecessary directories
in that case, controlled by the --no-subdirs/-N option.

Suggested-by: Tom Rini <trini@ti.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Try to guess the upstream commit
Simon Glass [Tue, 2 Dec 2014 00:33:54 +0000 (17:33 -0700)]
buildman: Try to guess the upstream commit

Buildman normally obtains the upstream commit by asking git. Provided that
the branch was created with 'git checkout -b <branch> <some_upstream>' then
this normally works.

When there is no upstream, we can try to guess one, by looking up through
the commits until we find a branch. Add a function to try this and print
a warning if buildman ends up relying on it.

Also update the documentation to match.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Wolfgang Denk <wd@denx.de>
9 years agobuildman: Don't prune output space for 'current source' build
Simon Glass [Tue, 2 Dec 2014 00:33:53 +0000 (17:33 -0700)]
buildman: Don't prune output space for 'current source' build

This is not needed since we always do a full (non-incremental) build. Also
it might be dangerous since it will try to delete everything below the
base directory.

Fix this potentially nasty bug.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Put build in 'current', not 'current/current'
Simon Glass [Tue, 2 Dec 2014 00:33:52 +0000 (17:33 -0700)]
buildman: Put build in 'current', not 'current/current'

Buildman currently puts current-source builds in a current/current
subdirectory, but there is no need for the extra depth.

Suggested-by: Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobuildman: Add tests that check the correct output directory is used
Simon Glass [Tue, 2 Dec 2014 00:33:51 +0000 (17:33 -0700)]
buildman: Add tests that check the correct output directory is used

Add a few tests of the output directory logic.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agoMerge branch 'next' of git://git.denx.de/u-boot-video
Tom Rini [Wed, 14 Jan 2015 21:26:15 +0000 (16:26 -0500)]
Merge branch 'next' of git://git.denx.de/u-boot-video

9 years agonet: Declare physical address as phys_addr_t unsigned type
Michal Simek [Wed, 14 Jan 2015 15:00:39 +0000 (16:00 +0100)]
net: Declare physical address as phys_addr_t unsigned type

Use phys_addr_t instead of int for addresses.
Addresses can't be < 0.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM: armv8: Fix typo in commentary
Michal Simek [Wed, 14 Jan 2015 14:36:35 +0000 (15:36 +0100)]
ARM: armv8: Fix typo in commentary

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agodoc: ARM: Use the right function name
Michal Simek [Wed, 14 Jan 2015 14:36:34 +0000 (15:36 +0100)]
doc: ARM: Use the right function name

Trivial fix.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoKconfig: move CONFIG_SYS_CLK_FREQ to Kconfig
Alexey Brodkin [Tue, 13 Jan 2015 15:49:01 +0000 (18:49 +0300)]
Kconfig: move CONFIG_SYS_CLK_FREQ to Kconfig

It makes sense to specify CONFIG_SYS_CLK_FREQ in "configs/xx_defconfig"
instead of "include/configs/xxx.h" because then header will be reusable
across boards with different CPU clocks.

Also this nice to have an ability for end user to tune this value
himself via "menuconfig".

For now I'm only applying this change to all ARC configs because
otherwise scope of change will be huge.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Tom Rini <trini@ti.com>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Hans de Goede <hdegoede@redhat.com>
cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
9 years agospl: spl_nor: surround Linux-load code with #ifdef CONFIG_SPL_OS_BOOT
Masahiro Yamada [Thu, 8 Jan 2015 10:23:35 +0000 (19:23 +0900)]
spl: spl_nor: surround Linux-load code with #ifdef CONFIG_SPL_OS_BOOT

If CONFIG_SPL_NOR_SUPPORT is defined, spl_nor_load_image() requires
spl_start_uboot(), CONFIG_SYS_OS_BASE, CONFIG_SYS_SPL_ARGS_ADDR,
CONFIG_SYS_FDT_BASE to be defined even if users just want to run
U-Boot, not Linux.  This is inconvenient.

This patch is following the codying style of common/spl/spl_nand.c.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agoimage: Enable OpenRTOS booting via fitImage
Marek Vasut [Tue, 16 Dec 2014 13:07:22 +0000 (14:07 +0100)]
image: Enable OpenRTOS booting via fitImage

Allow booting the OpenRTOS payloads via fitImage image type.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agoimage: bootm: Add OpenRTOS image type
Marek Vasut [Tue, 16 Dec 2014 13:07:21 +0000 (14:07 +0100)]
image: bootm: Add OpenRTOS image type

Add separate image type for the Wittenstein OpenRTOS .

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agoAdd support for Seagate BlackArmor NAS220
Evgeni Dobrev [Mon, 8 Dec 2014 16:49:42 +0000 (17:49 +0100)]
Add support for Seagate BlackArmor NAS220

Add support for Seagate BlackArmor NAS220

Signed-off-by: Evgeni Dobrev <evgeni@studio-punkt.com>
9 years agoarm: vf610: Remove duplicate MTD defines.
Bill Pringlemeir [Wed, 3 Dec 2014 18:40:58 +0000 (13:40 -0500)]
arm: vf610: Remove duplicate MTD defines.

Some MTD defines are repeated twice; once with UBI and then with MTD.
Remove the duplicate MTD defines from the UBI grouping.

Signed-off-by: Bill Pringlemeir <bpringlemeir@nbsps.com>
9 years agolzo: Update dst_len even on error
Simon Glass [Tue, 2 Dec 2014 20:17:40 +0000 (13:17 -0700)]
lzo: Update dst_len even on error

This allows the caller to easily detect how much of the destination buffer
has been used.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agogunzip: Update lenp even on error
Simon Glass [Tue, 2 Dec 2014 20:17:39 +0000 (13:17 -0700)]
gunzip: Update lenp even on error

This allows the caller to easily detect how much of the destination buffer
has been used.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobzlib: Update destLen even on error
Simon Glass [Tue, 2 Dec 2014 20:17:38 +0000 (13:17 -0700)]
bzlib: Update destLen even on error

This allows the caller to easily detect how much of the destination buffer
has been used.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobootm: Factor out common parts of image decompression code
Simon Glass [Tue, 2 Dec 2014 20:17:37 +0000 (13:17 -0700)]
bootm: Factor out common parts of image decompression code

Adjust the code so that the error reporting can all be done at the end,
and is the same for each decompression method. Try to detect when
decompression fails due to lack of space. Keep the behaviour of
resetting on failure even though there should be no memory corruption
now.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobootm: Use print_decomp_msg() in all cases
Simon Glass [Tue, 2 Dec 2014 20:17:36 +0000 (13:17 -0700)]
bootm: Use print_decomp_msg() in all cases

Refactor to allow this function to be used to announce the image being
loaded regardless of compression type and even when there is no
decompression.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agotest: Add unit tests for bootm image decompression
Simon Glass [Tue, 2 Dec 2014 20:17:35 +0000 (13:17 -0700)]
test: Add unit tests for bootm image decompression

Use each compression method (including uncompressed). Test for normal
operation, insufficient space and corrupted data.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agotest: Rename test_compression to ut_compression
Simon Glass [Tue, 2 Dec 2014 20:17:34 +0000 (13:17 -0700)]
test: Rename test_compression to ut_compression

Try to keep the names of the unit test commands consistent.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobootm: Export bootm_decomp_image()
Simon Glass [Tue, 2 Dec 2014 20:17:33 +0000 (13:17 -0700)]
bootm: Export bootm_decomp_image()

Export this function for testing. Also add a parameter so that values other
than CONFIG_SYS_BOOTM_LEN can be used for the maximum uncompressed size.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agotest: Add DEBUG output option to test-fit.py
Simon Glass [Tue, 2 Dec 2014 20:17:32 +0000 (13:17 -0700)]
test: Add DEBUG output option to test-fit.py

Sometimes it is useful to see the output from U-Boot, so add an option to
make this easier.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agosandbox: Correct ordering of 'sb save' commands
Simon Glass [Tue, 2 Dec 2014 20:17:31 +0000 (13:17 -0700)]
sandbox: Correct ordering of 'sb save' commands

Prior to commit d455d87 there was an inconsistency between the position of
the 'address' parameter in 'sb load' and 'sb save'. This was corrected but
it broke some tests. Fix the tests and also the help for 'sb save'.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agobootm: Move compression progress/error messages into a function
Simon Glass [Tue, 2 Dec 2014 20:17:30 +0000 (13:17 -0700)]
bootm: Move compression progress/error messages into a function

This code is repeated in several places, and does not detect a common
fault where the image is too large. Move it into its own function and
provide a more helpful messages in this case, for compression schemes
which support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agolzma: fix buffer bound check error further
Simon Glass [Tue, 2 Dec 2014 20:17:29 +0000 (13:17 -0700)]
lzma: fix buffer bound check error further

Commit 4d3b8a0d fixed a problem with lzma decompress where it would
run out of bytes to decompress. The algorithm needs to know how many
uncompressed bytes it is expected to produce.

However, the fix introduced a potential buffer overrun, and causes
the compression test to fail (test_compression command in sandbox).

The correct fix seems to be to use the minimum of the expected number
of uncompressed bytes and the amount of output space available. That
way things work normally when there is enough space, and return an
error (without overrunning available space) when there is not.

Signed-off-by: Antonios Vamporakis <ant@area128.com>
CC: Kees Cook <keescook@chromium.org>
CC: Simon Glass <sjg@chromium.org>
CC: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
CC: Luka Perkov <luka@openwrt.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agocommon/memsize.c: Coding style cleanup
Wolfgang Denk [Tue, 21 Oct 2014 20:14:10 +0000 (22:14 +0200)]
common/memsize.c: Coding style cleanup

Prepare code to make later modifications checkpatch-clean.

Signed-off-by: Wolfgang Denk <wd@denx.de>
9 years ago.travis.yml: build u-boot on travis-ci
Meier, Roger [Wed, 19 Nov 2014 14:26:18 +0000 (15:26 +0100)]
.travis.yml: build u-boot on travis-ci

Goal:
  - building all variants of U-Boot with multiple configurations
  - code quality checks and metrics
  - https://travis-ci.org/u-boot/u-boot/builds

9 years agoMerge branch 'buildman' of git://git.denx.de/u-boot-x86
Tom Rini [Wed, 14 Jan 2015 16:00:38 +0000 (11:00 -0500)]
Merge branch 'buildman' of git://git.denx.de/u-boot-x86

Conflicts:
tools/buildman/control.py

Signed-off-by: Tom Rini <trini@ti.com>
9 years agoREADME.scrapyard: fill commit and date fields
Masahiro Yamada [Wed, 14 Jan 2015 03:35:24 +0000 (12:35 +0900)]
README.scrapyard: fill commit and date fields

This commit was generated by the following command:

    scripts/fill_scrapyard.py

The commit-ID of CPCIISER4 removal has been fixed by hand because
the board was removed by commit 370572601027 (ppc4xx: remove CPCIISER4
board), but it was added to README.scrapyard by commit 9a4018e09a2f
(ppc4xx: remove DP405 board).

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agoscripts: add a utility to fill blank fields of doc/README.scrapyard
Masahiro Yamada [Wed, 14 Jan 2015 03:35:23 +0000 (12:35 +0900)]
scripts: add a utility to fill blank fields of doc/README.scrapyard

We are removing bunch of non-generic boards these days.

Updating doc/README.scrapyard is a really tedious task, but it can
be automated.  I hope this tool will make our life easier.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 years agosunxi: usbc: Add support for usb-vbus0 controller by axp drivebus pin
Hans de Goede [Sun, 11 Jan 2015 18:33:35 +0000 (19:33 +0100)]
sunxi: usbc: Add support for usb-vbus0 controller by axp drivebus pin

The axp221 / axp223's N_VBUSEN pin can be configured as an output rather
then an input, and this is used on some boards to control usb-vbus0, add
support for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: usbc: Add support for usb0 to the common usbc code
Hans de Goede [Wed, 7 Jan 2015 14:26:06 +0000 (15:26 +0100)]
sunxi: usbc: Add support for usb0 to the common usbc code

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Move usb-controller init code out of ehci-sunxi.c for reuse for otg
Hans de Goede [Wed, 7 Jan 2015 14:08:43 +0000 (15:08 +0100)]
sunxi: Move usb-controller init code out of ehci-sunxi.c for reuse for otg

Most of the usb-controller init code found in ehci-sunxi.c also is necessary
to init the otg usb controller, so move it to a common place.

While at it also update various #ifdefs / defines for sun8i support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: axp221: Add support for controlling the drivebus pin
Hans de Goede [Sun, 11 Jan 2015 18:58:03 +0000 (19:58 +0100)]
sunxi: axp221: Add support for controlling the drivebus pin

The axp221 / axp223's N_VBUSEN pin can be configured as an output rather
then an input, add axp_drivebus_enable() and _disable() functions to set
the pin in output mode and control it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: axp221: Protect axp221_init against multiple calls
Hans de Goede [Sun, 11 Jan 2015 18:43:56 +0000 (19:43 +0100)]
sunxi: axp221: Protect axp221_init against multiple calls

The voltage setting code knows it needs to call axp221_init before calling
the various voltage setting functions.

But users of axp utility functions like axp221_get_sid() do not know this,
so the utility functions always call axp221_init() to ensure that the
p2wi / rsb setup magic has been done.

Since doing this repeatedly is quite expensive, add a check to axp221_init
so that it only does the initialization once.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: axp221: correct ALDO2 description for sun6i
Chen-Yu Tsai [Sat, 3 Jan 2015 02:17:24 +0000 (10:17 +0800)]
sunxi: axp221: correct ALDO2 description for sun6i

ALDO2 is used to power LPDDR2 SDRAM on both the reference design and the
Hummingbird A31, when this type of RAM is present.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: Hummingbird_A31_defconfig: Enable VGA output through external DAC
Chen-Yu Tsai [Mon, 12 Jan 2015 10:02:12 +0000 (18:02 +0800)]
sunxi: Hummingbird_A31_defconfig: Enable VGA output through external DAC

The Hummingbird A31 uses an external DAC connected to the LCD0 outputs
for the on board VGA output. The DAC has a power control that's toggled
by GPIO.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: video: Add support for external DAC enable pin
Chen-Yu Tsai [Mon, 12 Jan 2015 10:02:11 +0000 (18:02 +0800)]
sunxi: video: Add support for external DAC enable pin

The external DAC for VGA output might have either a power or reset
control pin that needs to be pulled up, as is the case on the
Hummingbird A31.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: video: Allow external DACs for VGA on platforms without TV encoders
Chen-Yu Tsai [Mon, 12 Jan 2015 10:02:10 +0000 (18:02 +0800)]
sunxi: video: Allow external DACs for VGA on platforms without TV encoders

Using an external DAC for VGA output was available on sun5i. Since
some other SoCs don't have a builtin TV encoder, but might have
use for a VGA output, enable the option for the platforms that
don't have TV encoders.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: Enable pre-console buffer
Siarhei Siamashka [Thu, 8 Jan 2015 07:02:32 +0000 (09:02 +0200)]
sunxi: Enable pre-console buffer

This allows to always have a complete log on the VGA/HDMI/LCD console.

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 agoconsole: Use pre-console buffer to get complete log on all consoles
Siarhei Siamashka [Thu, 8 Jan 2015 07:02:31 +0000 (09:02 +0200)]
console: Use pre-console buffer to get complete log on all consoles

Currently the pre-console buffer can accumulate early log messages
and flush them to the serial console as soon as it becomes available.

This patch just adds one more pre-console buffer flushing point and
does all the same for the other consoles too. This is particularly
useful for the vga/hdmi/lcd console, where we can see all the older
messages now (except for the log messages from SPL).

Naturally, we don't want to get an extra copy of the log messages
on the serial console again at the second flushing point, so the
serial console has to be explicitly filtered out.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Tom Rini <trini@ti.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosun7i: Move psci_arch_init close to text_end
Jan Kiszka [Wed, 31 Dec 2014 12:46:42 +0000 (13:46 +0100)]
sun7i: Move psci_arch_init close to text_end

"adr rX, text_end" only works if the label is close. Adding further code
to the other functions will prevent this. So move the containing
function close to label. No functional change.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosun7i: Add support for taking CPUs offline via PSCI
Jan Kiszka [Wed, 31 Dec 2014 12:46:40 +0000 (13:46 +0100)]
sun7i: Add support for taking CPUs offline via PSCI

Based on the original version by Marc Zyngier. It adds a psci_cpu_off
implementation for the A20 SoC. The mechanism works by first preparing
the calling CPU to go offline (disable and flush cache, disable SMP),
then requesting CPU 0 to pull the plug. The request is sent as FIQ on
SGI15.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Add lvds support
Hans de Goede [Thu, 1 Jan 2015 21:04:34 +0000 (22:04 +0100)]
sunxi: video: Add lvds support

Add support for lvds lcd panels

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
9 years agosunxi: add Linksprite pcDuino v1/v2 support
Zoltan HERPAI [Tue, 6 Jan 2015 00:09:18 +0000 (01:09 +0100)]
sunxi: add Linksprite pcDuino v1/v2 support

Add support for a sun4i board built by Linksprite. This addition covers
both v1 and v2 versions. As the board has been working with 408MHz memory
setting in the u-boot-sunxi branch, and has been proven to be running stable
during my tests as well, a respective new DRAM config file is added as well.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agosunxi: video: Add a hpd_delay parameter to configure hpd delay
Hans de Goede [Sun, 28 Dec 2014 08:13:21 +0000 (09:13 +0100)]
sunxi: video: Add a hpd_delay parameter to configure hpd delay

In some extreme cases it may be necessary to wait 1.5 seconds or more for a hpd
signal to show up (and be able to read edid info), but we do not want to
penalize all headless boots with an extra second boot delay, so add a hpd_delay
parameter which can be set through the video-mode env. variable.

While at it raise the default from 300ms to 500ms as 300 may very well be too
low in many cases.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Add VGA output support
Hans de Goede [Thu, 25 Dec 2014 12:58:06 +0000 (13:58 +0100)]
sunxi: video: Add VGA output support

Add support for VGA directly from the sunxi SoC / display engine.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Fallback from HDMI to VGA on boards with VGA
Hans de Goede [Thu, 25 Dec 2014 12:52:04 +0000 (13:52 +0100)]
sunxi: video: Fallback from HDMI to VGA on boards with VGA

If a board has no LCD, but does have VGA fallback to VGA when no HDMI cable
is connected (unless hpd=0).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Add support for using PORTD hsync/vsync pins with tcon1
Hans de Goede [Sat, 27 Dec 2014 14:19:23 +0000 (15:19 +0100)]
sunxi: video: Add support for using PORTD hsync/vsync pins with tcon1

Add support for using PORTD hsync/vsync pins with tcon1, this is a preparation
patch for adding native VGA support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Use sunxi_lcdc_get_clk_delay to calculate tcon1 delay
Hans de Goede [Wed, 24 Dec 2014 18:50:11 +0000 (19:50 +0100)]
sunxi: video: Use sunxi_lcdc_get_clk_delay to calculate tcon1 delay

Use sunxi_lcdc_get_clk_delay to calculate tcon1 delay instead of hardcoding
it to 30. We will still end up using 30 for most modes, but for e.g. 800x600
this makes a (small) difference.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Remove sunxi_display.enabled variable
Hans de Goede [Wed, 24 Dec 2014 18:47:14 +0000 (19:47 +0100)]
sunxi: video: Remove sunxi_display.enabled variable

Having both a sunxi_display.enabled variable and
sunxi_display.monitor == sunxi_monitor_none duplicates state, use
sunxi_display.monitor = sunxi_monitor_none when ever we do not have a display.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: Ippo_q8h defconfigs: Enable the LCD panel found on these tablets.
Hans de Goede [Tue, 23 Dec 2014 15:08:38 +0000 (16:08 +0100)]
sunxi: Ippo_q8h defconfigs: Enable the LCD panel found on these tablets.

Enable the new LCD support on Ippo_q8h tablets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Tested-by: Chen-Yu Tsai <wens@csie.org>
9 years agosunxi: A13-OLinuXino defconfigs: Enable VGA output, add lcd-mode for 7" LCD
Hans de Goede [Wed, 24 Dec 2014 15:00:38 +0000 (16:00 +0100)]
sunxi: A13-OLinuXino defconfigs: Enable VGA output, add lcd-mode for 7" LCD

Enable VGA output on the A13-OLinuXino and A13-OLinuXinoM now that we've
support for it.

Also add LCD timing and gpio info for the Olimex 7" LCD module. We can safely
put this in the default config on this boards, since by default we will always
use VGA, and the LCD timing info will only get used if the user explicitly
sets monitor=lcd in the video-mode env. variable.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: sunxi-common.h: Reduce bootm_size to take the framebuffer into account
Hans de Goede [Wed, 24 Dec 2014 15:08:30 +0000 (16:08 +0100)]
sunxi: sunxi-common.h: Reduce bootm_size to take the framebuffer into account

Before video output support can be enabled on the A13-OLinuXinoM, bootm_size
must first be reduced to take into account that the framebuffer is shaved of
the top of the DRAM. For other boards this is not an issue since bootm was set
to 256M and all boards have at least 512M except for the A13-OLinuXinoM.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Add support for VGA via external DACs connected to the LCD pins
Hans de Goede [Wed, 24 Dec 2014 11:17:07 +0000 (12:17 +0100)]
sunxi: video: Add support for VGA via external DACs connected to the LCD pins

Add support for external DACs connected to the parallel LCD interface driving
a VGA connector, such as found on the Olimex A13 boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Enable video on sun8i, which supports LCD but not HDMI
Hans de Goede [Tue, 23 Dec 2014 22:04:35 +0000 (23:04 +0100)]
sunxi: video: Enable video on sun8i, which supports LCD but not HDMI

The A23 (sun8i) only has lcd output support, so allow building the video code
without HDMI support for use with the A23.

Also the A23 has the same reset bits (and necessity to enable the DRC block)
as the sun6i, so enable those bits for sun8i too.

Note building without HDMI support is useful for the A13 (sun5i variant) too,
as that one does not have HDMI either.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Add lcd output support
Hans de Goede [Sun, 21 Dec 2014 15:28:32 +0000 (16:28 +0100)]
sunxi: video: Add lcd output support

Add lcd output support, see the new Kconfig entries and doc/README.video for
how to enable / configure this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Move sunxi_drc_init
Hans de Goede [Tue, 23 Dec 2014 17:39:52 +0000 (18:39 +0100)]
sunxi: video: Move sunxi_drc_init

Move sunxi_drc_init to directly above sunxi_engines_init, to avoid
unnecessary #ifdef-ery in later patches.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Modify sunxi_lcdc_pll_set to work with both tcon0 and tcon1
Hans de Goede [Sun, 21 Dec 2014 15:27:45 +0000 (16:27 +0100)]
sunxi: video: Modify sunxi_lcdc_pll_set to work with both tcon0 and tcon1

Modify sunxi_lcdc_pll_set to work with both tcon0 and tcon1, this is a
preparation patch for adding lcd support.

While at it also swap the divider search order, searching from low to
high, as the comment above the code says we should do. In cases where there
are multiple solutions this will result in picking a lower pll clock and
divider, which is more stable and saves power.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Prepare for lcd support
Hans de Goede [Sun, 21 Dec 2014 13:49:34 +0000 (14:49 +0100)]
sunxi: video: Prepare for lcd support

Refactor sunxi_mode_set into a bunch of helpers, and make it do a switch
case on sunxi_display.monitor to decide what to do.

Also rename sunxi_lcdc_mode_set to sunxi_lcdc_tcon1_mode_set, as it sets the
timings for tcon1, and for lcd support we need a similar function operating
on tcon0.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: video: Improve monitor video-mode option handling
Hans de Goede [Sun, 21 Dec 2014 13:37:45 +0000 (14:37 +0100)]
sunxi: video: Improve monitor video-mode option handling

Add a sunxi_monitor enum and parse the monitor option string into this enum
once, rather then doing strcmp-s on it in various places. This also adds
checking for it being a valid value.

This also adds new "none" and "lcd" values in preparation for lcd support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
9 years agosunxi: gpio: Add support for gpio pins on the AXP209 pmic
Hans de Goede [Wed, 24 Dec 2014 18:34:38 +0000 (19:34 +0100)]
sunxi: gpio: Add support for gpio pins on the AXP209 pmic

Some boards use GPIO-s on the pmic, one example of this is the A13-OLinuXino
board, which uses gpio0 of the axp209 for the lcd-power signal.

This commit adds support for gpio pins on the AXP209 pmic, the sunxi_gpio.c
changes are universal, adding gpio support for the other AXP pmics (when
necessary) should be a matter of adding the necessary axp_gpio_foo functions
to their resp. drivers, and add "#define AXP_GPIO" to their header file.

Note this commit only adds support for the non device-model version of the
gpio code, patches for adding support to the device-model version are very
welcome.

The string representation for these gpio-s is AXP0-#, the 0 in the AXP0 prefix
is there in case we need to support gpio-s on more then 1 pmic in the future.
At least A80 boards have 2 pmics, and we may end up needing to support gpio-s
on both.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>