u-boot.git
8 years agoUBI: Fastmap: Set used_ebs only for static volumes 2015.04-toradex-next-fastmap-fixes
Richard Weinberger [Sat, 25 Oct 2014 11:26:49 +0000 (13:26 +0200)]
UBI: Fastmap: Set used_ebs only for static volumes

If we set it for dynamic ones we might confuse various self checks.

Signed-off-by: Richard Weinberger <richard@nod.at>
8 years agoUBI: Fastmap: Fix leb_count unbalance
Richard Weinberger [Fri, 24 Oct 2014 13:22:05 +0000 (15:22 +0200)]
UBI: Fastmap: Fix leb_count unbalance

If a LEB is unmapped we have to decrement leb_count as well.

Signed-off-by: Richard Weinberger <richard@nod.at>
8 years agoUBI: Fastmap: Switch to ro mode if invalidate_fastmap() fails
Richard Weinberger [Tue, 7 Oct 2014 19:45:19 +0000 (21:45 +0200)]
UBI: Fastmap: Switch to ro mode if invalidate_fastmap() fails

We have to switch to ro mode to guarantee that upon next UBI attach
all data is consistent.

Signed-off-by: Richard Weinberger <richard@nod.at>
8 years agoUBI: Fastmap: Remove eba_orphans logic
Richard Weinberger [Tue, 7 Oct 2014 19:39:20 +0000 (21:39 +0200)]
UBI: Fastmap: Remove eba_orphans logic

This logic is in vain as we treat protected PEBs also as used, so this
case must not happen.
If a PEB is found which is in the EBA table but not known as used
has to be issued as fatal error.

Signed-off-by: Richard Weinberger <richard@nod.at>
8 years agoUBI: Fastmap: Remove bogus ubi_assert()
Richard Weinberger [Tue, 7 Oct 2014 16:51:07 +0000 (18:51 +0200)]
UBI: Fastmap: Remove bogus ubi_assert()

It is legal to have PEBs left in the used list.
This can happen if UBI copies a PEB and a powercut happens
between writing a new fastmap and adding this PEB into the EBA table.
In this case the old PEB will be used.

Signed-off-by: Richard Weinberger <richard@nod.at>
8 years agoUBI: Fastmap: Fix memory leak while attaching
Richard Weinberger [Mon, 6 Oct 2014 13:39:01 +0000 (15:39 +0200)]
UBI: Fastmap: Fix memory leak while attaching

Currently we leak a few ubi_ainf_pebs while attaching.

Signed-off-by: Richard Weinberger <richard@nod.at>
8 years agoUBI: Fastmap: Don't allocate new ubi_wl_entry objects
Richard Weinberger [Mon, 6 Oct 2014 12:47:51 +0000 (14:47 +0200)]
UBI: Fastmap: Don't allocate new ubi_wl_entry objects

There is no need to allocate new ones every time, we can reuse
the existing ones.
This makes the code cleaner and more easy to follow.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Tanya Brokhman <tlinder@codeaurora.org>
Reviewed-by: Guido Martínez <guido@vanguardiasur.com.ar>
8 years agoUBI: Fastmap: Care about the protection queue
Richard Weinberger [Mon, 24 Nov 2014 13:20:31 +0000 (14:20 +0100)]
UBI: Fastmap: Care about the protection queue

Fastmap can miss a PEB if it is in the protection queue
and not jet in the used tree.
Treat every protected PEB as used.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
8 years agoUBI: Fastmap: Calc fastmap size correctly
Richard Weinberger [Mon, 29 Sep 2014 22:20:46 +0000 (00:20 +0200)]
UBI: Fastmap: Calc fastmap size correctly

We need to add fm_sb too.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Tanya Brokhman <tlinder@codeaurora.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
8 years agoUBI: add missing kmem_cache_free() in process_pool_aeb error path
Richard Genoud [Tue, 9 Sep 2014 12:25:01 +0000 (14:25 +0200)]
UBI: add missing kmem_cache_free() in process_pool_aeb error path

I ran into this error after a ubiupdatevol, because I forgot to backport
e9110361a9a4 UBI: fix the volumes tree sorting criteria.

UBI error: process_pool_aeb: orphaned volume in fastmap pool
UBI error: ubi_scan_fastmap: Attach by fastmap failed, doing a full scan!
kmem_cache_destroy ubi_ainf_peb_slab: Slab cache still has objects
CPU: 0 PID: 1 Comm: swapper Not tainted 3.14.18-00053-gf05cac8dbf85 #1
[<c000d298>] (unwind_backtrace) from [<c000baa8>] (show_stack+0x10/0x14)
[<c000baa8>] (show_stack) from [<c01b7a68>] (destroy_ai+0x230/0x244)
[<c01b7a68>] (destroy_ai) from [<c01b8fd4>] (ubi_attach+0x98/0x1ec)
[<c01b8fd4>] (ubi_attach) from [<c01ade90>] (ubi_attach_mtd_dev+0x2b8/0x868)
[<c01ade90>] (ubi_attach_mtd_dev) from [<c038b510>] (ubi_init+0x1dc/0x2ac)
[<c038b510>] (ubi_init) from [<c0008860>] (do_one_initcall+0x94/0x140)
[<c0008860>] (do_one_initcall) from [<c037aadc>] (kernel_init_freeable+0xe8/0x1b0)
[<c037aadc>] (kernel_init_freeable) from [<c02730ac>] (kernel_init+0x8/0xe4)
[<c02730ac>] (kernel_init) from [<c00093f0>] (ret_from_fork+0x14/0x24)
UBI: scanning is finished

Freeing the cache in the error path fixes the Slab error.

Tested on at91sam9g35 (3.14.18+fastmap backports)

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Cc: stable <stable@vger.kernel.org> # 3.10+
8 years agoUBI: fastmap: do not miss bit-flips
Brian Norris [Wed, 21 May 2014 05:35:38 +0000 (22:35 -0700)]
UBI: fastmap: do not miss bit-flips

The return value from 'ubi_io_read_ec_hdr()' was stored in 'err', not in 'ret'.
This fix makes sure Fastmap-enabled UBI does not miss bit-flip while reading EC
headers, events and scrubs the affected PEBs.

This issue was reported by Coverity Scan.

Artem: improved the commit message.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
8 years agoUBI: fix the volumes tree sorting criteria
Heiko Schocher [Tue, 24 Jun 2014 07:25:18 +0000 (09:25 +0200)]
UBI: fix the volumes tree sorting criteria

Commig "604b592 UBI: fix rb_tree node comparison in add_map"
broke fastmap backward compatibility and older fastmap images
cannot be mounted anymore. The reason is that it changes the
volumes RB-tree sorting criteria. This patch fixes the problem.

Artem: re-write the commit message

Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
8 years agoUBI: fix rb_tree node comparison in add_map
Mike Snitzer [Fri, 21 Mar 2014 19:54:03 +0000 (15:54 -0400)]
UBI: fix rb_tree node comparison in add_map

The comparisons used in add_vol() shouldn't be identical.  Pretty sure
the following is correct but it is completely untested.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
8 years agodm: spi: Correct SPI claim/release_bus() methods
Simon Glass [Sun, 19 Apr 2015 15:05:40 +0000 (09:05 -0600)]
dm: spi: Correct SPI claim/release_bus() methods

These methods should be passed a slave device, not a bus. This matches the
old SPI interface. It is important to know which device is claiming the bus
so passing a bus is not that useful.

Reported-by: Haikun Wang <haikun.wang@freescale.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Peng Fan <Peng.Fan@freescale.com>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
8 years agocolibri_t20: implement early pmic rail configuration
Marcel Ziswiler [Tue, 18 Aug 2015 08:51:00 +0000 (10:51 +0200)]
colibri_t20: implement early pmic rail configuration

Implement early TPS6586X PMIC rail configuration setting SM0 being
VDD_CORE_1.2V to 1.2 volts and SM1 being VDD_CPU_1.0V to 1.0 volts.

While those are PMIC power-up defaults the SoC might have been reset
separately with certain rails being left at lower DVFS states which
is e.g. the case upon watchdog reset while otherwise nearly idling.

8 years agoARM: vf610: use strcpy for soc environemnt variable
Stefan Agner [Tue, 11 Aug 2015 13:24:49 +0000 (15:24 +0200)]
ARM: vf610: use strcpy for soc environemnt variable

To create the soc environment variable we concatenate two strings
on the stack. So far, strcat has been used for the first string as
well as for the second string. Since the variable on the stack is
not initialized, the first strcat may not start using the first
entry in the character array. This then could lead to an buffer
overflow on the stack.

8 years agocolibri_vf: fix DDR property fixup
Stefan Agner [Tue, 11 Aug 2015 07:57:03 +0000 (09:57 +0200)]
colibri_vf: fix DDR property fixup

Set DDR property fixup also in (future) version 2.x revisions.

8 years agocolibri-vf: Enable SPI support
Bhuvanchandra DV [Wed, 29 Jul 2015 12:16:43 +0000 (14:16 +0200)]
colibri-vf: Enable SPI support

Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
[add CONFIG_DM to colibri_vf_defconfig]
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
8 years agoarm: vf610: Add iomux support for DSPI
Bhuvanchandra DV [Wed, 29 Jul 2015 12:15:03 +0000 (14:15 +0200)]
arm: vf610: Add iomux support for DSPI

Add iomux definitions for DSPI second instance.

Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
8 years agoarm: vf610: Add clock support for DSPI
Bhuvanchandra DV [Wed, 29 Jul 2015 11:56:54 +0000 (13:56 +0200)]
arm: vf610: Add clock support for DSPI

Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
8 years agocolibri_vf: Add separate defconfig for device tree support
Bhuvanchandra DV [Mon, 1 Jun 2015 13:07:23 +0000 (18:37 +0530)]
colibri_vf: Add separate defconfig for device tree support

Most of the drivers available for Vybrid are not yet converted
to OF model to use device tree model, only few drivers
like SPI and GPIO drivers use device trees.
Add separate defconfig for who needs to use device tree model.
Later this can be integrated to single defconfig.

Acked-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
8 years agovf610: dts: Add device tree support
Bhuvanchandra DV [Mon, 1 Jun 2015 13:07:21 +0000 (18:37 +0530)]
vf610: dts: Add device tree support

Add device tree files for Freescale Vybrid platform and
Toradex Colibri VF50, VF61 modules.
Device tree files are taken from upstream Kernel.
Removed the stuff which are not used/supported yet in U-Boot.

Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
8 years agodm: spi: Convert Freescale DSPI driver to driver model
Haikun.Wang@freescale.com [Tue, 24 Mar 2015 14:03:58 +0000 (22:03 +0800)]
dm: spi: Convert Freescale DSPI driver to driver model

Move the Freescale DSPI driver over to driver model.

Signed-off-by: Haikun Wang <Haikun.Wang@freescale.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
8 years agoimx-common: m4boot: rename Cortex-M4 bootargs
Stefan Agner [Mon, 10 Aug 2015 13:48:53 +0000 (15:48 +0200)]
imx-common: m4boot: rename Cortex-M4 bootargs

The environment variable was called bootargsm4, which is somewhat
incongruent with the boot command name "m4boot". Rename the bootargs
environment variable for Cortex-M4 to m4bootargs.

8 years agocolibri_vf: add fdt_fixup environment variable
Stefan Agner [Mon, 10 Aug 2015 13:43:58 +0000 (15:43 +0200)]
colibri_vf: add fdt_fixup environment variable

Add additional environment variable "fdt_fixup" which will be
called between device tree load command and kernel boot command.
This allows to change device tree using U-Boot scripting
environment.

8 years agocolibri_t20: fix pwm backlight
Marcel Ziswiler [Mon, 13 Jul 2015 11:55:57 +0000 (13:55 +0200)]
colibri_t20: fix pwm backlight

We do use PWM instance zero by default which is actually muxed for PWM
as primary function.

8 years agoapalis_t30: enable display driver
Marcel Ziswiler [Mon, 13 Jul 2015 11:39:09 +0000 (13:39 +0200)]
apalis_t30: enable display driver

Enable the display driver on Apalis T30. Unfortunately the PWM pin
muxing wasn't any good neither which made that display stay dark.

8 years agocolibri_t30: enable display driver
Marcel Ziswiler [Sun, 12 Jul 2015 00:31:18 +0000 (02:31 +0200)]
colibri_t30: enable display driver

On popular request enable the display driver on Colibri T30. A few
notes about some things encountered during porting: While analogue VGA
(e.g. via the on-carrier RAMDAC) worked just fine from the beginning
the EDT display flickered like crazy which turned out to be a pin
muxing issue. Unfortunately the PWM pin muxing wasn't any good neither
which made that display stay dark. Enjoy.

8 years agotegra: lcd: video: integrate display driver for t30
Marcel Ziswiler [Sun, 12 Jul 2015 00:22:50 +0000 (02:22 +0200)]
tegra: lcd: video: integrate display driver for t30

On popular request make the display driver from T20 work on T30 as
well. Turned out to be quite straight forward. However a few notes
about some things encountered during porting: Of course the T30 device
tree was completely missing host1x as well as PWM support but it turns
out this can simply be copied from T20. The only trouble compiling the
Tegra video driver for T30 had to do with some hard-coded PWM pin
muxing for T20 which is quite ugly anyway. On T30 this gets handled by
a board specific complete pin muxing table. The older Chromium U-Boot
2011.06 which to my knowledge was the only prior attempt at enabling a
display driver for T30 for whatever reason got some clocking stuff
mixed up. Turns out at least for a single display controller T20 and
T30 can be clocked quite similar. Enjoy.

8 years agoapalis/colibri_t20/t30: increase tftp blocksize
Marcel Ziswiler [Sat, 11 Jul 2015 22:56:26 +0000 (00:56 +0200)]
apalis/colibri_t20/t30: increase tftp blocksize

Enable CONFIG_IP_DEFRAG and set CONFIG_TFTP_BLOCKSIZE to 16384 (resp.
1536 on Colibri T20). This increases the tftp download speed
considerably.

While at it enable CONFIG_TFTP_TSIZE which limits the progress bar to
fifty '#' independent of the downloaded file size.

While at it also fix some spacing from using spaces to tabs.

8 years agocolibri_t30: fix framebuffer console regression
Marcel Ziswiler [Sat, 11 Jul 2015 22:43:55 +0000 (00:43 +0200)]
colibri_t30: fix framebuffer console regression

This is a copy/paste error from the Apalis T30 configuration as there
we show the Linux framebuffer console by default on the second
framebuffer instance being the DVI-D aka HDMI one due to analogue VGA
not being available. This patch changes it for the Colibri T30 back to
the first framebuffer instance being the parallel RGB aka TFTLCD one
which usually gets converted to analogue VGA via an on-carrier RAMDAC
(e.g. at least on the Colibri Evaluation board as well as Iris this is
the case).

8 years agocolibri_imx6.c: fix setup of I2C3
Max Krummenacher [Wed, 8 Jul 2015 14:16:40 +0000 (16:16 +0200)]
colibri_imx6.c: fix setup of I2C3

Use the correct I2C instance for the I2C going to SODIMM_194/196.

8 years agoApalis/Colibri iMX6: pf0100.c cleanup coding style
Max Krummenacher [Wed, 8 Jul 2015 13:57:51 +0000 (15:57 +0200)]
Apalis/Colibri iMX6: pf0100.c cleanup coding style

8 years agoApalis: production: use GPIO1 to trigger PMIC fusing
Max Krummenacher [Wed, 8 Jul 2015 13:55:58 +0000 (15:55 +0200)]
Apalis: production: use GPIO1 to trigger PMIC fusing

use Apalis GPIO1 to switch on VPGM

8 years agoApalis/Colibri iMX6: fix production commands
Max Krummenacher [Wed, 8 Jul 2015 13:53:21 +0000 (15:53 +0200)]
Apalis/Colibri iMX6: fix production commands

commit 2da77958e96151295e72f8f85aee352d0b4010fe added a configuration option
to include commands used during production.

Fixing the use of the CONFIG macro.

8 years agocolibri_vf: mux UART2 (Colibri UART_B) at boot time
Stefan Agner [Tue, 7 Jul 2015 09:04:39 +0000 (11:04 +0200)]
colibri_vf: mux UART2 (Colibri UART_B) at boot time

Some firmwares running on the secondary core rely on UART pins
muxed at start time. Mux the Vybrid UART2 (which maps to Colibri
UART_B) at startup.

8 years agoarm: vf610: support global timer
Stefan Agner [Tue, 7 Jul 2015 07:03:47 +0000 (09:03 +0200)]
arm: vf610: support global timer

Add support for ARM global timer. This allows to save the platform
wide PIT timer for other purposes such as MQX on the secondary
Cortex-M4 core.

8 years agocolibri_vf: fixup DT with DDR property to support LPSTOP
Stefan Agner [Tue, 7 Jul 2015 06:51:56 +0000 (08:51 +0200)]
colibri_vf: fixup DT with DDR property to support LPSTOP

Fixup the device-tree with the property fsl,has-cke-reset-pulls
which annotates that the board has pull-ups/downs which are required
to put the memory into self-refresh mode. The self-refresh mode in
turn is a requirement to put the SoC into deep sleep mode LPSTOP.

8 years agocolibri_vf: use device-tree for MTD partitions
Stefan Agner [Tue, 30 Jun 2015 10:31:56 +0000 (12:31 +0200)]
colibri_vf: use device-tree for MTD partitions

Use device-tree fixup to communicate the MTD partitions to the
kernel. U-Boot's mtdparts environment variable will be used as
partition source for the device-tree based partition table too.

8 years agoimx-common: m4boot: allow to boot other OS'es using m4boot
Stefan Agner [Fri, 29 May 2015 12:09:37 +0000 (14:09 +0200)]
imx-common: m4boot: allow to boot other OS'es using m4boot

Allow to boot eCos, MQX and bare-metal firmwares to boot on the
secondary Cortex-M4. The boot code is equal for all those firmware
types, the argument register will be set to 0 and the code will
jump to the specified entry point directly.

8 years agoimage: add Cortex-M4 related operating systems
Stefan Agner [Thu, 28 May 2015 15:37:38 +0000 (17:37 +0200)]
image: add Cortex-M4 related operating systems

Add new identifiers for Cortex-M4 related (RT)OS eCos, MQX and
Bare-metal.

8 years agoimx-common: m4boot: move entry point check
Stefan Agner [Thu, 28 May 2015 15:14:18 +0000 (17:14 +0200)]
imx-common: m4boot: move entry point check

Move entry point is Thumb2 check just after reading the entry point
from the FIT image.

8 years agoimx-common: include mini-loader vf610m4bootldr
Stefan Agner [Sun, 17 May 2015 19:53:16 +0000 (21:53 +0200)]
imx-common: include mini-loader vf610m4bootldr

Include vf610m4bootldr, a mini boot loader for the Cortex-M4 CPU
inside Freescale Vybrid SoC. The mini loader enables caches and
copies the pointer to the device tree from the platform specific
argument register (PERSISTENT_ARG1) to the Cortex-M4 r2 register,
where the Linux kernel expects the pointer. The mini loader hence
essentially takes over the parts of the m4boot command which can
not be done from the Cortex-A5 main CPU.

8 years agoimx-common: add m4boot command
Stefan Agner [Sat, 16 May 2015 07:40:24 +0000 (09:40 +0200)]
imx-common: add m4boot command

Add m4boot command which allows to boot FIT images on the Cortex-M4
kernel. The command currently only supports FIT image, which allows
to provide entry point and load addresses for all boot artifacts.

Currently, the Cortex-M4 mini loader needs to be loaded manually
to Kernel loadaddr - 0x80 (e.g. 0x8f000000, if kernel is loaded at
0x8f000080).

8 years agocolibri_vf: disable configuration of MSCM interrupt router
Stefan Agner [Sun, 17 May 2015 20:34:56 +0000 (22:34 +0200)]
colibri_vf: disable configuration of MSCM interrupt router

Do not configure all interrupts to the primary core by default since
newer Linux versions configure the MSCM interrupt router correctly
by themself. This also prevents warnings due to already routed
interrupts when booting Linux on the secondary Cortex-M4 CPU.

8 years agocolibri_vf: increase tftp block size
Stefan Agner [Thu, 28 May 2015 08:55:22 +0000 (10:55 +0200)]
colibri_vf: increase tftp block size

Enable CONFIG_IP_DEFRAG and set CONFIG_TFTP_BLOCKSIZE to 16384.
This increases the tftp download speed from ~2.5 to ~8.2MiB/s.

While at it enable CONFIG_TFTP_TSIZE which limits the progress bar
to 50 '#' indepent off the downloaded file size.

8 years agocolibri_vf: Increase console IO buffer size to 1024
Sanchayan Maity [Thu, 28 May 2015 07:10:54 +0000 (12:40 +0530)]
colibri_vf: Increase console IO buffer size to 1024

Increase console IO buffer size to 1024 from the previous value of 256.
The previous value was too short for editing environment variables like
ubiboot, from the console.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
8 years agoApalis/Colibri iMX6: increase tftp blocksize
Max Krummenacher [Thu, 21 May 2015 14:51:21 +0000 (16:51 +0200)]
Apalis/Colibri iMX6: increase tftp blocksize

Enable CONFIG_IP_DEFRAG and set CONFIG_TFTP_BLOCKSIZE to 16384.
This increases the tftp download speed considerably.

While at it enable CONFIG_TFTP_TSIZE which limits the progress bar to
fifty '#' indepent off the downloaded file size.

8 years agotftp.c: fix CONFIG_TFTP_TSIZE for small files
Max Krummenacher [Thu, 21 May 2015 13:55:14 +0000 (15:55 +0200)]
tftp.c: fix CONFIG_TFTP_TSIZE for small files

CONFIG_TFTP_TSIZE should limit a tftp downloads progress to 50 '#' chars.
Make this work also for small files.

If the file size is small, i.e. smaller than 2 tftp block sizes the number
of '#' can get much larger. i.e. with a 1 byte file 65000 characters are
printed, with a 512 byte file around 500.

When using CONFIG TFTP BLOCKSIZE together with CONFIG_IP_DEFRAG the issue
is more notable.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
8 years agocolibri_t20/t30: fix setsdupdate
Marcel Ziswiler [Mon, 18 May 2015 08:55:32 +0000 (10:55 +0200)]
colibri_t20/t30: fix setsdupdate

Fix setsdupdate by adding missing 'usb start' command.

While at it also add USB start to setethupdate as doing it twice won't
hurt (e.g. it returns immediately only 'usb reset' does a full rescan).

8 years agoapalis_imx6.c: prepare Apalis GPIO pins to be GPIO
Max Krummenacher [Wed, 13 May 2015 18:48:09 +0000 (20:48 +0200)]
apalis_imx6.c: prepare Apalis GPIO pins to be GPIO

In order to use the gpio commandline feature of U-Boot the pins
one wants to control must be muxed to GPIO.
Do that for Apalis pins GPIO[1:8] and for WAKE1_MICO.

This feature can be used as follows:
e.g. set GPIO1 to 1:
Apalis iMX6 # gpio set 36
gpio: pin 36 (gpio 36) value is 1

e.g. read the state of GPIO8:
Apalis iMX6 # gpio input 6
gpio: pin 6 (gpio 6) value is 1

8 years agocolibri_imx6.c: prepare auxiliary pins to be GPIO
Max Krummenacher [Wed, 13 May 2015 17:57:09 +0000 (19:57 +0200)]
colibri_imx6.c: prepare auxiliary pins to be GPIO

In order to use the gpio commandline feature of U-Boot the pins
one wants to control must be muxed to GPIO.
Do that for all unused pins which in the default kernel device tree also gets
muxed to gpio for userspace use.

This feature can be used as follows:
e.g. change the LCD brightness signal from 0V to 3.3V:
Colibri iMX6 # gpio set 41
gpio: pin 41 (gpio 41) value is 1

e.g. read the state of gpio 111:
Colibri iMX6 # gpio input 111
gpio: pin 111 (gpio 111) value is 1

8 years agocolibri_imx6.c: ensure EMI_ADDR22 is input
Max Krummenacher [Wed, 13 May 2015 17:50:45 +0000 (19:50 +0200)]
colibri_imx6.c: ensure EMI_ADDR22 is input

Out of reset EMI_ADDR22 is output and connected to GPIO01.
As we want to use GPIO01 as an output for backlight control
mux EMI_ADDR22 to a GPIO which by default is input.

8 years agoApalis/Colibri iMX6: rename/add bmode
Max Krummenacher [Wed, 13 May 2015 17:47:22 +0000 (19:47 +0200)]
Apalis/Colibri iMX6: rename/add bmode

Add an alias for the ESDHC0 which provides the standard MMC connection
on Colibri iMX6.
Add an alias for the ESDHC0/1 which provides the standard MMC/SD connection
on Apalis iMX6.

8 years agoapalis/colibri_t20/t30: enable of system setup support
Marcel Ziswiler [Wed, 13 May 2015 11:20:11 +0000 (13:20 +0200)]
apalis/colibri_t20/t30: enable of system setup support

Enable OF system setup to add hardware revision and serial number
information to the device-tree in case a mainline Linux kernel with any
such is booted.

While at it default back to the regular 8 MB DFU data buffer size.

8 years agoapalis/colibri_t20/t30: enable raw initrd support
Marcel Ziswiler [Wed, 13 May 2015 11:15:55 +0000 (13:15 +0200)]
apalis/colibri_t20/t30: enable raw initrd support

Enable optional raw initrd support to allow boot using an initrd.

8 years agomtd/nand/tegra: alignment workaround
Marcel Ziswiler [Wed, 13 May 2015 11:00:24 +0000 (13:00 +0200)]
mtd/nand/tegra: alignment workaround

Introduce cache alignment bounce buffer to workaround issues as follows:

Loading file '/boot/zImage' to addr 0x01000000 with size 4499152 (0x0044a6d0)...
ERROR: v7_dcache_inval_range - start address is not aligned - 0x1f7f0108
ERROR: v7_dcache_inval_range - stop address is not aligned - 0x1f7f1108
Done
Kernel image @ 0x1000000 [ 0x000000 - 0x44a6d0 ]

Starting kernel ...

undefined instruction
pc : [<005ff03c>]          lr : [<0000800c>]
sp : 0144b6e8  ip : 01000188     fp : 0144a6c8
r10: 00000000  r9 : 411fc090     r8 : 00000100
r7 : 00000cfb  r6 : 0144a6d0     r5 : 00000000  r4 : 00008000
r3 : 0000000c  r2 : 00000100     r1 : 00000cfb  r0 : 00000000
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

8 years agomtd/nand/ubi: assortment of alignment fixes
Marcel Ziswiler [Wed, 13 May 2015 10:58:19 +0000 (12:58 +0200)]
mtd/nand/ubi: assortment of alignment fixes

Various U-Boot adoptions/extensions to MTD/NAND/UBI did not take buffer
alignment into account which led to failures of the following form:

ERROR: v7_dcache_inval_range - start address is not aligned - 0x1f7f0108
ERROR: v7_dcache_inval_range - stop address is not aligned - 0x1f7f1108

8 years agotoradex: common: fix non-Toradex config block build
Stefan Agner [Mon, 11 May 2015 16:29:14 +0000 (18:29 +0200)]
toradex: common: fix non-Toradex config block build

Fix build of configurations without the Toradex config block. Also
move away from the ifdefery through the file, but create a global
ifdef which distingush between the two variants on a global level.

8 years agotoradex: common: use define for product number offset
Stefan Agner [Mon, 11 May 2015 16:20:06 +0000 (18:20 +0200)]
toradex: common: use define for product number offset

The USB product ID's for the Colibri/Apalis family of Toradex can
be calculated by using the Toradex product ID (as provided by the
config block) plus a fixed offset of 0x4000.

8 years agologos: update Toradex logo
Stefan Agner [Mon, 11 May 2015 10:41:56 +0000 (12:41 +0200)]
logos: update Toradex logo

Use the boot loader splash screen from WinCE, which maches positionwise
our wallpapers. Altough the logo is a 8-Bit indexed BMP as well, colors
looked odd at first on U-Boot. After converting to full RGB pallette
and coverting back to indexed BMP using imagemagick, the Logo showed
up properly.

$ convert tools/logos/toradex-rgb.bmp -type Palette -colors 256 \
-compress none -verbose BMP3:tools/logos/toradex.bmp

8 years agoimage-fdt.c: store returned error value
Max Krummenacher [Mon, 11 May 2015 07:49:02 +0000 (09:49 +0200)]
image-fdt.c: store returned error value

This fixes the following warning (and the runtime error reporting):
../common/image-fdt.c:491:4: warning: 'fdt_ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

8 years agocolibri_imx6.h: source the correct script address
Max Krummenacher [Mon, 11 May 2015 07:32:21 +0000 (09:32 +0200)]
colibri_imx6.h: source the correct script address

8 years agovideo: dcu: fixup memory correct even without framebuffer
Stefan Agner [Mon, 11 May 2015 06:28:52 +0000 (08:28 +0200)]
video: dcu: fixup memory correct even without framebuffer

When there is no framebuffer allocated, e.g. no video environment
variable or an error during initialization, the framebuffer location
ends up to be NULL, in which case the fixup function calculates a
bogus memory size. Use the framebuffer size to make sure that memory
size is calculated right in any case.

8 years agotoradex: common: set board-rev and product-id
Stefan Agner [Sat, 9 May 2015 10:29:34 +0000 (12:29 +0200)]
toradex: common: set board-rev and product-id

Set board revision and Toradex product ID as device tree property.
This transfers the Toradex configblock information to Linux user-
space, where it can be read conviniently through the proc file
system files:
- /proc/device-tree/serial-number
- /proc/device-tree/toradex,board-rev
- /proc/device-tree/toradex,product-id

In case the Toradex config block is missing or corrupted, the
device tree properties won't be created by the boot loader and
hence those file won't exist in that case.

8 years agotoradex: common: set Toradex specific dt properties
Stefan Agner [Sat, 9 May 2015 10:08:26 +0000 (12:08 +0200)]
toradex: common: set Toradex specific dt properties

Use ft_system_setup to set Toradex specific device-tree properties.
At first, this is only the serial-number, which is using a property
which is about to be standardized in the binding documentation of
the Linux kernel.

8 years agotoradex: configblock: move environment config to common
Stefan Agner [Sat, 9 May 2015 10:01:21 +0000 (12:01 +0200)]
toradex: configblock: move environment config to common

Move setting of environment variables to common code. This prepares
for further enhancements which will enhance the device tree with
module specific information from the configblock.

8 years agoAdd config to disable commands used only in production
Max Krummenacher [Thu, 7 May 2015 14:11:42 +0000 (16:11 +0200)]
Add config to disable commands used only in production

CONFIG_TRDX_CMD_IMX_MFGR in menu 'ARM architecture'

While at it remove unused include g_dnl.h

8 years agoconfigblock.c: add configblock creation for iMX6 modules
Max Krummenacher [Thu, 7 May 2015 14:10:11 +0000 (16:10 +0200)]
configblock.c: add configblock creation for iMX6 modules

8 years agoApalis/Colibri iMX6: use Toradex boot logo
Max Krummenacher [Wed, 6 May 2015 17:45:54 +0000 (19:45 +0200)]
Apalis/Colibri iMX6: use Toradex boot logo

This uses the tools/logos/toradex.bmp instead of the default
tux logo and places it centered on screen.
While at it group the display releated variables together.

8 years agoApalis/Colibri iMX6: make the parallel RGB usable
Max Krummenacher [Wed, 6 May 2015 17:38:22 +0000 (19:38 +0200)]
Apalis/Colibri iMX6: make the parallel RGB usable

In U-Boot use the following display outputs a:
- Test the panel environment variable and if set use it
- Use HDMI if connected
- Use parallel output otherwise configured for VGA 640x480

The following strings can be set for the panel variable:
HDMI vga-rgb wvga-rgb

8 years agoimx-common: make ipu's di configurable
Max Krummenacher [Wed, 6 May 2015 17:30:18 +0000 (19:30 +0200)]
imx-common: make ipu's di configurable

The ipu has two display interfaces. Make the used one a parameter
in struct display_info_t instead of using unconditionally DI0.

8 years agoApalis/Colibri imx6: remove explicitely set default configs
Max Krummenacher [Wed, 6 May 2015 16:37:38 +0000 (18:37 +0200)]
Apalis/Colibri imx6: remove explicitely set default configs

8 years agoapalis/colibri_t30: fix dfu_alt_info
Marcel Ziswiler [Wed, 6 May 2015 15:44:38 +0000 (17:44 +0200)]
apalis/colibri_t30: fix dfu_alt_info

8 years agocolibri_t20: adjust cfgblock & u-boot env locations in flash
Marcel Ziswiler [Tue, 5 May 2015 14:30:17 +0000 (16:30 +0200)]
colibri_t20: adjust cfgblock & u-boot env locations in flash

Swap the order of the Toradex factory configuration block location in
respect to the U-Boot environment. This to again be in-line with
mainline.
Move the Toradex factory configuration block to a 3 MB offset.

8 years agocommon: hash: fix crc32 verify
Marcel Ziswiler [Tue, 5 May 2015 12:12:43 +0000 (14:12 +0200)]
common: hash: fix crc32 verify

did not work:

Colibri T30 # crc32 0x80000000 0x100
crc32 for 80000000 ... 800000ff ==> 9eb4f5ca
Colibri T30 # crc32 -v 0x80000000 0x100 c9a057b3
crc32 for 80000000 ... 800000ff ==> 9eb4f5ca != ffffffff ** ERROR **
Colibri T30 # crc32 -v 0x80000000 0x100 9eb4f5ca
crc32 for 80000000 ... 800000ff ==> 9eb4f5ca != 301eeead ** ERROR **

now works again:

Colibri T30 # crc32 0x80000000 0x100
crc32 for 80000000 ... 800000ff ==> 9eb4f5ca
Colibri T30 # crc32 -v 0x80000000 0x100 c9a057b3
crc32 for 80000000 ... 800000ff ==> 9eb4f5ca != c9a057b3 ** ERROR **
Colibri T30 # crc32 -v 0x80000000 0x100 9eb4f5ca

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
8 years agocolibri_vf: update default config
Stefan Agner [Mon, 4 May 2015 16:01:46 +0000 (18:01 +0200)]
colibri_vf: update default config

Add consoleblank=0 to disable console blanking by default. To use
initramfs without the need of creating a U-Boot image using mkimage,
enable CONFIG_SUPPORT_RAW_INITRD too.

8 years agoARM: vf610: rename/add bmode for Colibri VFxx
Stefan Agner [Mon, 4 May 2015 15:56:49 +0000 (17:56 +0200)]
ARM: vf610: rename/add bmode for Colibri VFxx

Rename the serial loader boot mode to "serial". Also add an alias
for the ESDHC1 controller, which provides the standard MMC connection
for the Colibri SO-DIMM default pinout.

8 years agotoradex: common: create a place for common functionality
Stefan Agner [Fri, 1 May 2015 15:21:35 +0000 (17:21 +0200)]
toradex: common: create a place for common functionality

Some functionality is repetitve accross the boards. This creates
a common place for U-Boot functions which need to be implemented
similarly for all Toradex modules.

8 years agocolibri_vf: Enable board specific USB initialisation for USB pen gpio
Sanchayan Maity [Mon, 4 May 2015 05:58:55 +0000 (11:28 +0530)]
colibri_vf: Enable board specific USB initialisation for USB pen gpio

Add IOMUX for the pad used as USB pen. This needs to be driven low for
the Iris and Viola boards where it is pulled up high by default. This is
required for the USB host functionality to work on these boards. Use the
board specific weak initialisation function, to drive the pin low which
would be called on "usb start".

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
[use switch statement to make port selection more obvious]
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
8 years agousb: ehci-vf: Add weak function for board specific initialisation
Sanchayan Maity [Mon, 4 May 2015 05:58:54 +0000 (11:28 +0530)]
usb: ehci-vf: Add weak function for board specific initialisation

Add a weak function board_ehci_hcd_init which can be used by the board
file for board specific initialisation.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
8 years agoColibri iMX6: initial commit
Max Krummenacher [Wed, 22 Apr 2015 17:23:07 +0000 (19:23 +0200)]
Colibri iMX6: initial commit

use
make colibri_imx6_defconfig

8 years agoApalis iMX6: initial commit
Max Krummenacher [Wed, 22 Apr 2015 17:54:42 +0000 (19:54 +0200)]
Apalis iMX6: initial commit

Use for the industrial temperature range rated modules:
make apalis_imx6_it_defconfig
Use for the commercial temperature range rated modules:
make apalis_imx6_defconfig

8 years agoserial_mxc.c: add option to use in DTE mode
Max Krummenacher [Mon, 20 Apr 2015 11:22:58 +0000 (13:22 +0200)]
serial_mxc.c: add option to use in DTE mode

The serial_mxc UART can use DTE and DCE mode (i.e End device vs. modem).
This adds DTE mode capability to the driver.
In order to switch from the default DCE to DTE mode define CONFIG_MXC_UART_DTE.

8 years agoapalis/colibri_t20/t30: fix setupdate
Marcel Ziswiler [Fri, 1 May 2015 08:33:16 +0000 (10:33 +0200)]
apalis/colibri_t20/t30: fix setupdate

8 years agocolibri_vf: whitespace cleanup
Marcel Ziswiler [Tue, 28 Apr 2015 00:14:02 +0000 (02:14 +0200)]
colibri_vf: whitespace cleanup

Cleanup various whitespaces throughout its configuration file.

8 years agoapalis/colibri_t30: fix setupdate handling
Marcel Ziswiler [Tue, 28 Apr 2015 00:12:43 +0000 (02:12 +0200)]
apalis/colibri_t30: fix setupdate handling

Fix setupdate handling.

While at it also fix using asix_mac rather than igb_mac on Colibri T30.

8 years agotoradex: configblock: fix comment
Marcel Ziswiler [Tue, 28 Apr 2015 00:11:06 +0000 (02:11 +0200)]
toradex: configblock: fix comment

Fix comment in write_trdx_cfg_block_to_nand to actually indicate it
writing the config block to NAND.

8 years agoapalis_t30: add missing new line
Marcel Ziswiler [Tue, 28 Apr 2015 00:09:31 +0000 (02:09 +0200)]
apalis_t30: add missing new line

Add missing new line in tegra_pcie_board_init.

8 years agocolibri_t20: migrate
Marcel Ziswiler [Tue, 28 Apr 2015 00:07:36 +0000 (02:07 +0200)]
colibri_t20: migrate

Migrate Colibri T20 to U-Boot 2015.04.

8 years agotegra: nand: 16-bit bch ecc integration
Marcel Ziswiler [Tue, 28 Apr 2015 00:05:32 +0000 (02:05 +0200)]
tegra: nand: 16-bit bch ecc integration

Integrate 16-bit BCH ECC handling required e.g. for the latest NAND
parts assembled on Colibri T20.

8 years agotegra: nand: fix read_byte required for proper onfi detection
Marcel Ziswiler [Mon, 27 Apr 2015 23:57:29 +0000 (01:57 +0200)]
tegra: nand: fix read_byte required for proper onfi detection

Fix PIO read_byte() implementation not only used for the legacy READ ID
but also the PARAM command now required for proper ONFI detection.

This fix is inspired by Lucas Stach's Linux Tegra NAND driver of late.

While at it also disable subpage writes.

8 years agocolibri_t20: add i2c support
Marcel Ziswiler [Mon, 27 Apr 2015 16:50:24 +0000 (18:50 +0200)]
colibri_t20: add i2c support

Add I2C support in order to subsequently allow disabling the PMIC sleep
mode on low supply voltage.

8 years agocolibri_t20: add LCD display support
Marcel Ziswiler [Mon, 27 Apr 2015 14:11:32 +0000 (16:11 +0200)]
colibri_t20: add LCD display support

Add LCD display support defaulting to VESA VGA resolution. Different
resolutions configurable via device-tree.

8 years agocolibri_t20: fix device-tree compatible node
Marcel Ziswiler [Mon, 27 Apr 2015 14:10:14 +0000 (16:10 +0200)]
colibri_t20: fix device-tree compatible node

Use toradex,colibri_t20 as the device-tree compatible node value rather
than toradex,t20 in accordance to our Apalis/Colibri T30 products.

8 years agocolibri_vf: set the devices serial number in the device tree
Stefan Agner [Thu, 23 Apr 2015 15:17:03 +0000 (17:17 +0200)]
colibri_vf: set the devices serial number in the device tree

Use the proposed format to transport the device's serial number
to the kernel:
http://www.spinics.net/lists/devicetree/msg76756.html

8 years agocolibri_vf: remove fec_mac
Stefan Agner [Thu, 23 Apr 2015 15:11:59 +0000 (17:11 +0200)]
colibri_vf: remove fec_mac

Also, the kernel argument has been renamed (to fec.macaddr) and uses
a different format (0x00,0x2d...). The FEC ethernet address is assigned
through device tree nowadays. Hence remove the old argument "fec_mac"
without replacement.

8 years agoMerge branch '2015.04-toradex-next-gpio' into 2015.04-toradex-next
Stefan Agner [Thu, 23 Apr 2015 15:19:58 +0000 (17:19 +0200)]
Merge branch '2015.04-toradex-next-gpio' into 2015.04-toradex-next

8 years agocolibri_vf: add additional GPIOs required for display handling
Stefan Agner [Thu, 23 Apr 2015 15:05:08 +0000 (17:05 +0200)]
colibri_vf: add additional GPIOs required for display handling

Add GPIO's typically required for display handling such as GPIO 45
(SO-DIMM 71, BL_ON) or GPIO 22 (SO-DIMM 59, PWM<A> for backlight).

8 years agovideo: dcu: make sure memory size aligns to section size
Stefan Agner [Thu, 23 Apr 2015 15:01:50 +0000 (17:01 +0200)]
video: dcu: make sure memory size aligns to section size

Align the reported memory size to 1MiB, which is the section size
in the Linux memory managment system. This avoids triggering an
issue which leads to freeze the Linux kernel very early:
http://thread.gmane.org/gmane.linux.ports.arm.kernel/408378