platform/kernel/u-boot.git
10 years agofs:ext4:write:fix: Reinitialize global variables after updating a file accepted/tizen/common/20140513.150712 submit/tizen_common/20140513.150414
Lukasz Majewski [Wed, 30 Apr 2014 07:08:49 +0000 (09:08 +0200)]
fs:ext4:write:fix: Reinitialize global variables after updating a file

This bug shows up when file stored on the ext4 file system is updated.

The ext4fs_delete_file() is responsible for deleting file's (e.g. uImage)
data.
However some global data (especially ext4fs_indir2_block), which is used
during file deletion are left unchanged.

The ext4fs_indir2_block pointer stores reference to old ext4 double
indirect allocated blocks. When it is unchanged, after file deletion,
ext4fs_write_file() uses the same pointer (since it is already initialized
- i.e. not NULL) to return number of blocks to write. This trunks larger
file when previous one was smaller.

Lets consider following scenario:

1. Flash target with ext4 formatted boot.img (which has uImage [*] on itself)
2. Developer wants to upload their custom uImage [**]
- When new uImage [**] is smaller than the [*] - everything works
correctly - we are able to store the whole smaller file with corrupted
ext4fs_indir2_block pointer
- When new uImage [**] is larger than the [*] - theCRC is corrupted,
since truncation on data stored at eMMC was done.
3. When uImage CRC error appears, then reboot and THOR/DFU reflashing causes
proper setting of ext4fs_indir2_block() and after that uImage[**]
is successfully stored (correct uImage [*] metadata is stored at an
eMMC on the first flashing).

Due to above the bug was very difficult to reproduce.
This patch sets default values for all ext4fs_indir* pointers/variables.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agofs:ext4:cleanup: Remove superfluous code
Lukasz Majewski [Wed, 30 Apr 2014 06:52:28 +0000 (08:52 +0200)]
fs:ext4:cleanup: Remove superfluous code

Code responsible for handling situation when ext4 has block size of 1024B
can be ordered to take less space.

This patch does that for ext4 common and write files.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agodrivers:dfu: dfu_flush(): add raw data flush
Przemyslaw Marczak [Thu, 24 Apr 2014 13:01:13 +0000 (15:01 +0200)]
drivers:dfu: dfu_flush(): add raw data flush

Before dfuwrite and flush operations separation,
dfu write data was flushed by host download request
with len of zero size.

Since above change manually calling dfu write with zero
size has non sense (e.g. in THOR). This should be done by
flush operation.
So now dfu_write_buffer_drain() is called in dfu_flush().
If there is any raw data to flush (like it can be in thor)
then it will be physically written to medium.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agousb:gadget:f_thor: fix write to filesystem by add dfu_flush()
Przemyslaw Marczak [Fri, 18 Apr 2014 07:12:19 +0000 (09:12 +0200)]
usb:gadget:f_thor: fix write to filesystem by add dfu_flush()

Since dfu read/write operations needs to be flushed manually,
writing to filesystem on MMC by thor was broken. MMC raw write
actually is working fine because current dfu_flush() function
writes filesystem only. This commit adds dfu_flush() to f_thor
and now filesystem write is working.

This change was tested on Trats2 board.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@ti.com>
10 years agousb:gadget:f_thor: code cleanup in function download_tail()
Przemyslaw Marczak [Fri, 18 Apr 2014 07:00:13 +0000 (09:00 +0200)]
usb:gadget:f_thor: code cleanup in function download_tail()

In thor's download_tail() function, dfu_get_entity() is called
before each dfu_write() call and the returned entity pointers
are the same. So dfu_get_entity() can be called just once and
this patch changes this.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@ti.com>
10 years agodfu:fix: Replace wrong return value with proper one
Lukasz Majewski [Thu, 24 Apr 2014 08:17:27 +0000 (10:17 +0200)]
dfu:fix: Replace wrong return value with proper one

This patch remove always false (since we tested ret = 0) ternary operator
with ret value returned.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agosamsung: misc: menu: new option: battery charge level
Przemyslaw Marczak [Mon, 7 Apr 2014 15:21:13 +0000 (17:21 +0200)]
samsung: misc: menu: new option: battery charge level

This change adds new option to lcd menu which allows
check battery state. In case if battery level is greater
than boot level threshold (20%), battery screen is not
displayed. So this menu option is useful in such situations.

Change-Id: I13e7e57516766fea787855b914d2884343cc33a5
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agotrats2: enable command battery of interactive charger
Przemyslaw Marczak [Tue, 25 Mar 2014 11:32:22 +0000 (12:32 +0100)]
trats2: enable command battery of interactive charger

This change adds two features on trats2 device:
- show battery charge level by displaying battery screen
- manually start interactive charger if needed

Usage:
command: "battery"
options: "state" or "charge"

Change-Id: Ie000edfc2fb6f2938ddf1e17611fdc5045169830
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agotrats2: add support to interactive charger
Przemyslaw Marczak [Mon, 24 Mar 2014 09:40:12 +0000 (10:40 +0100)]
trats2: add support to interactive charger

This commit adds support to interactive charger api which means an
implementation of listed functions:
- charger_enable()  - enable the charger.Charger can be enabled
                      automatically if the device power on state
                      is triggered by USB cable connection.

- charger_type()    - this function returns device type connected
                      to usb port of device. For charger api matters
                      only positive value.

- battery_present() - check if battery is connected (DETBAT pin)

- battery_state()   - check battery charge level. Returns percent value.

- low_power_mode()  - switch SOC into low power mode which covers:
                      - disable cores: 1, 2, 3,
                      - disable SOC unused power domains,
                      - decrease CPU clock to 200 MHz

After low_power_mode() function call, device should be restarted,
which is implemented in interactive charger.

Change-Id: I7e664fab29c45c2d29dc57a2faa887d88530d8f3
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agosamsung: misc: new command: battery and config CONFIG_CMD_BATTERY
Przemyslaw Marczak [Tue, 25 Mar 2014 11:27:05 +0000 (12:27 +0100)]
samsung: misc: new command: battery and config CONFIG_CMD_BATTERY

This feature allows to enable interactive charger by command line
or use interactive charger for display battery charge level.

Usage:
- battery [<state>] [<charge>]

Option "state" will display battery screen for 2 seconds.
Option "charge" will start interactive charger mode.

Interactive charger mode can be stopped by:
- pressing CTRL+C keys combination,
or device reset by:
- pressing PWR key for 5 seconds (only if SOC > 20% - one grey bar),
- pressing PWR key for 10 seconds, which is PMIC reset.

Change-Id: I622830198f6cba4f0fa30798b02aa003c55332bb
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agosamsung: misc: new feature: common interactive charger
Przemyslaw Marczak [Fri, 21 Mar 2014 15:15:50 +0000 (16:15 +0100)]
samsung: misc: new feature: common interactive charger

This change adds common interactive charger feature with
display support.

New config: CONFIG_INTERACTIVE_CHARGER

New functions:
- battery() - which takes one of commands parameter:
    BOOT_CHECK: check battery present, low power mode;
                check battery charge level, draw battery screen
    STATE:      display battery screen with current state of charge
                this is for command line use
    CHARGE:     start interactive charger for every battery charge level
                this is also for command line use

- interactive_charger() - loop function for charge the battery and do:
                          - update of battery screen,
                          - update charge animation,
                          - check for exit condition (if charge level >= 20%)
                          - clear screen after 10 seconds animation
                          - draw battery on clean screen if any key pressed

There are few constants defined for this feature:
- CHARGE_TRESHOLD_BOOT:         20 (20 percent of charge)
- CHARGE_DISPLAY_TIMEOUT_SEC:   10 (time for animation display)
- CONNECT_CHARGER_TIMEOUT_SEC:  5 (time for connect charger animation)
- CHARGE_PWR_KEY_RESET_TIMEOUT: 3 (time for PWR key press to reset device)

Battery charge level cases:
 - 0-20 % - don't allow to boot and then:
            - enable charger if connected and start charge animation
              or if no charger:
            - display 5 sec charger animation and turn off the device

- > 20 %  - don't display battery screen and boot device

Charge mode can be break by keys VOLUP + VOLDOWN. If charge level > 20%
then device can be enabled by pressing PWR key for a time defined in
CHARGE_PWR_KEY_RESET_TIMEOUT.

Change-Id: I15066a4b86c89f1f0124b072a0aeb7246b29b279
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agolib: tizen: add battery interactive charger screens
Przemyslaw Marczak [Mon, 24 Mar 2014 14:26:10 +0000 (15:26 +0100)]
lib: tizen: add battery interactive charger screens

New images:
- battery frame: 200x380px, 16bpp,
  batery level area in frame: 170x300px
- battery bar: 160x50px, 16bpp, grey and red,
  (for 5 bars in battery frame with 8px interelement gap)
- charge screen; charge screen clean images: 128x120px, 16bpp
- charge screen indicator; vertical and horizontal
  indicator clean images: 8x8px, 16bpp

Library functions:

For battery screen:
- draw_battery_screen()   - draw empty battery frame
- draw_battery_state()    - fill battery frame with charge bars
                            to a given percent
For charge animation:
- draw_charge_screen()    - draw a small phone connected to a cable
                            (under the battery)
- clean_charge_screen()   - cleans above screen
- draw_charge_animation() - display an animation with
                            a point running on a cable
                            (on a charge screen)

For low battery state and no charger connected:
- draw_connect_charger_animation() - draw and clean charge
                                     screen respectively

Library is ready to use gzipped images
but this commit adds only bmp images.

Change-Id: I25a527b07b809b9105b6d4d8c29aa01e47224134
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agotrats2: add implementation of board_poweroff() and CONFIG_CMD_POWEROFF
Przemyslaw Marczak [Fri, 21 Mar 2014 10:48:54 +0000 (11:48 +0100)]
trats2: add implementation of board_poweroff() and CONFIG_CMD_POWEROFF

This change adds implementation of function board_poweroff() which
turns off the device off by setting PSHOLD gpio to low state which
is a power off signal for main PMIC.

Change-Id: Iae97fb81d7e7e243079ac18d03f4fd917c50b62e
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agoarch:arch:exynos: add exynos ps hold control output setting
Przemyslaw Marczak [Wed, 23 Apr 2014 12:57:19 +0000 (14:57 +0200)]
arch:arch:exynos: add exynos ps hold control output setting

Change-Id: I4ee074278c55198030aa5092f36e61e3c6efc487
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agoarch:arm:exynos: clock.h define clock registers setting macros
Przemyslaw Marczak [Wed, 9 Apr 2014 13:14:33 +0000 (15:14 +0200)]
arch:arm:exynos: clock.h define clock registers setting macros

Those macros are useful for easy setting clocks.

Change-Id: Ie167af1023fbbc8abb5dfbc6816b84721d2bcd0f
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agoarch:arm:exynos: power.h define exynos4x12 power subsystem structure
Przemyslaw Marczak [Wed, 26 Mar 2014 15:00:54 +0000 (16:00 +0100)]
arch:arm:exynos: power.h define exynos4x12 power subsystem structure

Change-Id: Icf6cb80529f3fb5511e440f572e0870359e6e37c
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agocommon: add command power off - to switch off the device by command
Przemyslaw Marczak [Fri, 21 Mar 2014 10:29:40 +0000 (11:29 +0100)]
common: add command power off - to switch off the device by command

This change introduces new config:
- CONFIG_CMD_POWEROFF - which enables common/cmd_poweroff.c

This requires implementation of function board_poweroff() which
is yet declared in include/common.h

Implementation of board_poweroff() should:
1.a. turn off the device
     or
1.b. print info to user about turn off ability
2.   never back to caller

Usage is simple: "power off"

Change-Id: Ia5fe73250e2ac29d0868b80bcd867bae2aa8d5be
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agotrats: config: fix: Set default console to ttySAC2
Lukasz Majewski [Wed, 9 Apr 2014 08:17:11 +0000 (10:17 +0200)]
trats: config: fix: Set default console to ttySAC2

During providing device tree support for Exynos4 based boards,
a tiny mistake has creeped in the fe60164 commit.

This commit restores proper setting of default console for the
trats board.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
10 years agotrats2: config: fix: Set default console to ttySAC2
Lukasz Majewski [Wed, 9 Apr 2014 07:50:19 +0000 (09:50 +0200)]
trats2: config: fix: Set default console to ttySAC2

During providing device tree support for Exynos4 based boards,
a tiny mistake has creeped in the 1ecab0f commit.

This commit restores proper setting of default console for the
trats2 board.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
10 years agoARM: exynos4: enable the dwmmc configuration
Jaehoon Chung [Wed, 2 Apr 2014 06:17:31 +0000 (08:17 +0200)]
ARM: exynos4: enable the dwmmc configuration

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
10 years agommc: exynos_dw_mmc: enable the DDR mode
Jaehoon Chung [Wed, 2 Apr 2014 06:17:30 +0000 (08:17 +0200)]
mmc: exynos_dw_mmc: enable the DDR mode

Set the ddr mode capability by default.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
10 years agoARM: dts: exnyos: enable dw-mmc controller
Jaehoon Chung [Wed, 2 Apr 2014 06:17:29 +0000 (08:17 +0200)]
ARM: dts: exnyos: enable dw-mmc controller

Enabled the dw-mmc controller.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
10 years agommc: dw_mmc: support the DDR mode
Jaehoon Chung [Wed, 2 Apr 2014 06:17:28 +0000 (08:17 +0200)]
mmc: dw_mmc: support the DDR mode

Support the DDR mode at dw-mmc controller

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
10 years agommc: support the DDR mode for eMMC
Jaehoon Chung [Wed, 2 Apr 2014 06:17:27 +0000 (08:17 +0200)]
mmc: support the DDR mode for eMMC

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
10 years agommc: remove the unnecessary define and fix the wrong bit control
Jaehoon Chung [Wed, 2 Apr 2014 06:17:26 +0000 (08:17 +0200)]
mmc: remove the unnecessary define and fix the wrong bit control

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Lukasz Majeski <l.majewski@samsung.com>
10 years agommc: exynos_dw_mmc: restore the property into host
Jaehoon Chung [Wed, 2 Apr 2014 06:17:25 +0000 (08:17 +0200)]
mmc: exynos_dw_mmc: restore the property into host

Restore the platdata(property of dt) into host struct.
Then data's information is maintained and reused anywhere.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
10 years agoARM: exynos: clock: modify the set_mmc_clk for exynos4
Jaehoon Chung [Wed, 2 Apr 2014 06:17:24 +0000 (08:17 +0200)]
ARM: exynos: clock: modify the set_mmc_clk for exynos4

Modified the mmc_set_clock for eynos4.
The goal of this patch is that fsys-div register should be reset.
And retore the div-value, not using the value of lowlevel_init.
(For using SDMMC4, this patch is needs)

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
10 years agoARM: exynos: board: change the mmc/sd init sequence
Jaehoon Chung [Wed, 2 Apr 2014 06:17:23 +0000 (08:17 +0200)]
ARM: exynos: board: change the mmc/sd init sequence

Exynos4 can be used the dwmmc controller for eMMC.
Then it needs to check dwmmc_init() at first.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agommc: s5p_sdhci: add the s5p_sdhci_core_init function
Jaehoon Chung [Wed, 2 Apr 2014 06:17:22 +0000 (08:17 +0200)]
mmc: s5p_sdhci: add the s5p_sdhci_core_init function

To reuse the code, added the s5p_sdhci_core_init function.
Before applied this patch, didn't use the 8-bit mode at exynos baord.
Because it didn't set "MMC_MODE_8BIT".

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
10 years agodrivers: mmc: dwmmc: enable support for DT
Beomho Seo [Thu, 20 Mar 2014 04:14:29 +0000 (13:14 +0900)]
drivers: mmc: dwmmc: enable support for DT

This patch enables for device tree for dw-mmc driver.
Driver have been fixed because it is used exynos5 and exynos4.
Add, fdt compat id of exynos4 dwmmc.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Piotr Wilczek <p.wilczek@samsung.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Piotr Wilczek <p.wilczek@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
10 years agopackaging:build: Extract and generate params.bin
Lukasz Majewski [Tue, 15 Apr 2014 10:24:59 +0000 (12:24 +0200)]
packaging:build: Extract and generate params.bin

params.bin file is generated from default environment. It might be used
to flash default environment when updating system image at RD_PQ device.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agopackaging:build: Enable signature generation for u-boot-dtb.bin
Przemyslaw Marczak [Thu, 10 Apr 2014 13:14:18 +0000 (15:14 +0200)]
packaging:build: Enable signature generation for u-boot-dtb.bin

This change enables signature of u-boot binary by the script from
u-boot tools: mkimage_signed.sh.

Change-Id: Iafad725ce3eae834e057f32317fe245deef95005
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agopackaging:build: Enable device tree compiler usage (dtc)
Lukasz Majewski [Tue, 25 Mar 2014 16:34:48 +0000 (17:34 +0100)]
packaging:build: Enable device tree compiler usage (dtc)

Enable building and usage of the device tree compiled (dtc) for u-boot
build at GBS/OBS

Change-Id: I5a2e91de60789619ad2e547715c89ea30c1cb071
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agopackaging: add .spec file
Chanho Park [Fri, 10 Jan 2014 01:48:52 +0000 (10:48 +0900)]
packaging: add .spec file

Change-Id: I5dd90f728a9f0f951afda5634f2509cbb3eccc95
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Jacek Pielaszkiewicz <j.pielaszkie@samsung.com>
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
10 years agotools: dtc: Add source to build the dtc compiler
Lukasz Majewski [Tue, 25 Mar 2014 16:33:34 +0000 (17:33 +0100)]
tools: dtc: Add source to build the dtc compiler

Newest u-boot (v2014.04) requires device tree compiler (DTC) version
at least 1.4.

Change-Id: Ie62778e3391cbf3b586221839cf53362c5f8cdff
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agotrats/trats2: enable bootloader signature
Inha Song [Fri, 21 Feb 2014 17:55:15 +0000 (18:55 +0100)]
trats/trats2: enable bootloader signature

Enable of this config will now require making binary signature.
From now, manually build sequence should looks like this:
 CROSS_COMPILE=...
 make mrproper
 make trats2_config
 make
 ./tools/mkimage_signed.sh u-boot-dtb.bin trats2_config

The output signed binary is: u-boot-mmc.bin

Change-Id: I9a2c86d2f24a050ff3738adb9dbd7d5914ff16d8
Signed-off-by: Inha Song <ideal.song@samsung.com>
10 years agoboard:samsung: add u-boot-mmc.bin sign check to thor
Inha Song [Mon, 28 Oct 2013 06:52:53 +0000 (15:52 +0900)]
board:samsung: add u-boot-mmc.bin sign check to thor

Changes:
- add call to check_board_signature() before do dfu_write in thor downlaoder

new files:
- board/samsung/common/sig_header.c
- include/samsung/sighdr.h

Signed-off-by: Inha Song <ideal.song@samsung.com>
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agotools: add script: mkimage_signed.sh for sign u-boot binary
Przemyslaw Marczak [Thu, 10 Apr 2014 13:03:40 +0000 (15:03 +0200)]
tools: add script: mkimage_signed.sh for sign u-boot binary

This script appends given binary image by signature header.
Script takes two arguments:
- @arg1: binary name
- @arg2: config name

Script usage:
./mkimage_signed.sh binary.img config_name
e.g.:
./mkimage_signed.sh u-boot-dtb.bin trats2_config

Sign header is stored on last 512 bytes of input binary.
Maximum imput binary size is 1MB - 512 Bytes = 1048064 Bytes.

The maximum size is limited by first bootloader (s-boot).
Now it is configured to load exactly 2048 blocks (1MB).
Current u-boot-dtb.bin size for trats2 is less than 600 KBytes,
so the size limit should not be an issue.

Change-Id: Ia7472be693df8d4135312971d963d27f2ea20f0f
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agolib: tizen: thor screen update
Przemyslaw Marczak [Wed, 2 Apr 2014 14:13:59 +0000 (16:13 +0200)]
lib: tizen: thor screen update

Now cable connection message is displayed on thor screen.
When cable is connected then only unneeded lcd console lines are overwritten.

Main changes:
- add new function: draw_thor_connected()
- update function draw_thor_screen()
- usb: gadget: thor:
  - move call to draw_thor_screen(),
  - add call to draw_thor_connected()

other change:
- remove draw_thor_init_screen() function

Change-Id: Ifc33f63eeb4822551fc78af1c6dd2a03044cab7e
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agocommon: lcd: extend lcd api by function lcd_get_position_cursor()
Przemyslaw Marczak [Wed, 2 Apr 2014 13:21:06 +0000 (15:21 +0200)]
common: lcd: extend lcd api by function lcd_get_position_cursor()

This commit change the name of function lcd_position_cursor()
to lcd_set_position_cursor() and adds its complementary function
lcd_get_position_cursor().
This change is useful e.g. when user wants overwrite some lines,
words or even just a letter on lcd console screen.

Other changes:
- update previous lcd_position_cursor() calls

Change-Id: I4a102c236f2d2d5c238e9790382e4b9454e3c361
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Vadim Bendebury <vbendeb@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
10 years agousb: thor: add screen support
Inha Song [Fri, 11 Oct 2013 08:50:24 +0000 (17:50 +0900)]
usb: thor: add screen support

cmd_thordown.c:
- add libtizen header
- change error handling for thor init
- add call to draw_thor_fail_screen() on error

f_thor.c:
- thor_init(): return -EINTR on ctrl+c or if power key was pressed 3 times
- thor_rx_data(): return -EINTR when pressed ctrl+c on data receiving
- add display simple info screen before cable is not connected
- add display download screen when connection is established
- update download progress bar if data receiving

Change-Id: Ia89ef48c6c2faa5eda5dda5c5b3951e675eec03b
Signed-off-by: Inha Song <ideal.song@samsung.com>
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agolibtizen: add download logo and download progress bar
Przemyslaw Marczak [Fri, 7 Feb 2014 14:03:41 +0000 (15:03 +0100)]
libtizen: add download logo and download progress bar

Added features:
- add screen with exit info if no cable is connected
- download logo with progress bar after after THOR init
- downlaod failure screen on error
- PIT version, U-boot version on download screen
- function for update progess bar when downloading is going on

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inha Song <ideal.song@samsung.com>
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agoTrats: Setup: CLK_GATE_BLOCK - enable all clocks
Przemyslaw Marczak [Wed, 26 Feb 2014 08:17:45 +0000 (09:17 +0100)]
Trats: Setup: CLK_GATE_BLOCK - enable all clocks

This change allows boot kernel 3.10 on trats

Change-Id: Ic7f1672d9300a32fed9fa6d8f6fc30f118326a83
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agosamsung: misc: check_keys(), key_pressed() - remove type static.
Przemyslaw Marczak [Mon, 10 Feb 2014 15:28:30 +0000 (16:28 +0100)]
samsung: misc: check_keys(), key_pressed() - remove type static.

This patch removes type "static" from those functions declaration.

Change-Id: I2244ca3568b73251401e5102f26cc113ea69c1a4
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agovideo:lcd:s6e8ax0: increase screen gamma.
Hyungwon Hwang [Fri, 15 Nov 2013 07:10:42 +0000 (16:10 +0900)]
video:lcd:s6e8ax0: increase screen gamma.

Change gamma table to increase the brightness of s6e8ax0 panel.

Change-Id: I6b21022fb90bbb14160c0426a776d73c9590345b
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
10 years agoTrats/Trats2: Update Tizen partitions layout
Przemyslaw Marczak [Fri, 21 Feb 2014 15:36:27 +0000 (16:36 +0100)]
Trats/Trats2: Update Tizen partitions layout

Change-Id: Ia229bdd6a04762e6c1b71509933d5d7723b9ebcb
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agosamsung: misc: remove download mode info screen
Przemyslaw Marczak [Fri, 11 Apr 2014 15:21:10 +0000 (17:21 +0200)]
samsung: misc: remove download mode info screen

This change removes LCD menu download mode info screen.
Now key press timeout is checked in function download_menu()
and menu options are displayed directly after PWR + VOLUP keys.

Change-Id: I3cce6c92d6ee160496c4ffca9cf88d670c74003b
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
10 years agosamsung: misc: keys: fix gpio key debouncing by adding 50 ms delay
Przemyslaw Marczak [Thu, 6 Mar 2014 15:39:44 +0000 (16:39 +0100)]
samsung: misc: keys: fix gpio key debouncing by adding 50 ms delay

This change prevents gpio keys debouncing by adding 50 ms delay
when key pressed condition met.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
10 years agosamsung: misc: add env default option to lcd menu
Inha Song [Fri, 28 Feb 2014 02:17:26 +0000 (11:17 +0900)]
samsung: misc: add env default option to lcd menu

This change allows reset device environment to default without using u-boot
console, which is useful for system developers.

Signed-off-by: Inha Song <ideal.song@samsung.com>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
10 years agosamsung: misc: add gpt restore option to lcd menu
Przemyslaw Marczak [Wed, 2 Apr 2014 08:34:52 +0000 (10:34 +0200)]
samsung: misc: add gpt restore option to lcd menu

This menu option allows restore gpt.
This is usefull and no needs access to the u-boot console.
For proper operation:
- each partition uuid should be set in environment or
- CONFIG_RANDOM_UUID should be defined for automatically uuid setting

After operation success device is going to be reset.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
10 years agosamsung: misc: allows using environmental macros as args in menu commands
Przemyslaw Marczak [Mon, 24 Feb 2014 17:35:21 +0000 (18:35 +0100)]
samsung: misc: allows using environmental macros as args in menu commands

Function cmd_process() runs commands with directly given list of arguments
but it doesn't expand given environmental variables names as macros.
Command "gpt" as one of arguments expects expanded macro e.g. $partitions
so it needs to be called by function run_command().

Changes:
- extend array mode_name by lower case commands names - used by find_cmd()
- put each command arguments into one string - used by run_command()
- use run_command() instead of cmd_process()

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
10 years agodfu: Introduction of the "dfu_checksum_method" env variable for checksum method setting
Lukasz Majewski [Thu, 27 Mar 2014 14:25:05 +0000 (15:25 +0100)]
dfu: Introduction of the "dfu_checksum_method" env variable for checksum method setting

Up till now the CRC32 of received data was calculated unconditionally.
The standard crc32 implementation causes long delays when large images
were uploaded.

The "dfu_checksum_method" environment variable gives the opportunity to
enable on demand (when e.g. debugging) the crc32 calculation.
It can be done without need to recompile the u-boot binary.

By default the crc32 is not calculated.

Tests results:
400 MiB ums.img file
With  crc32 calculation: 65 sec [avg 6.29 MB/s]
Without  crc32 calculation: 25 sec [avg 16.17 MB/s]

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agodfu: mmc: Provide support for eMMC boot partition access
Lukasz Majewski [Tue, 18 Feb 2014 15:43:09 +0000 (16:43 +0100)]
dfu: mmc: Provide support for eMMC boot partition access

Before this patch it was only possible to access only the default eMMC
partition. By partition selection I mean the access to eMMC via ext_csd[179]
register programming.

It sometimes happens that it is necessary to write to other partitions.
This patch adds extra attributes to "mmc" sub type of the dfu_alt_info
variable (e.g. boot-mmc.bin mmc 0 200 mmcpart 1;)

It saves the original boot value and restores it after storing the file.

Such definition will not impact other definitions of the "mmc" dfu
partitions specifier.

Change-Id: I34069510eb27aa80794189d2d13cdb97e54ba83d
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agoPrepare v2014.04 v2014.04
Tom Rini [Mon, 14 Apr 2014 19:19:24 +0000 (15:19 -0400)]
Prepare v2014.04

Signed-off-by: Tom Rini <trini@ti.com>
10 years agoarm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD
Tetsuyuki Kobayashi [Mon, 14 Apr 2014 08:13:58 +0000 (17:13 +0900)]
arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD

Add CONFIG_SYS_GENERIC_BOARD to use common/board_[fr].c for kzm9g.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Acked-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
10 years agoi2c: sh_i2c: bugfix: i2c probe command does not work
Tetsuyuki Kobayashi [Mon, 14 Apr 2014 08:13:57 +0000 (17:13 +0900)]
i2c: sh_i2c: bugfix: i2c probe command does not work

This is regression of commit 2035d77d i2c: sh_i2c: Update to new CONFIG_SYS_I2C framework

Before commit 2035d77d, i2c probe command works properly on kzm9g board.

KZM-A9-GT# i2c probe
Valid chip addresses: 0C 12 1D 32 39 3D 40 60

After commit 2035d77d, i2c probe command does not work.

KZM-A9-GT# i2c probe
Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F

sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it does not read device at all. This patch prepares dummy buffer and read data into it.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Acked-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
10 years agoboard:tricorder: fixup SPL OOB layout
Andreas Bießmann [Thu, 10 Apr 2014 10:52:52 +0000 (12:52 +0200)]
board:tricorder: fixup SPL OOB layout

Commit d016dc42cedbf6102e100fa9ecb58462edfb14f8 changed the layout of BCH8 SW
on omap3 boards. We need to adopt the ecc layout for the nand_spl_simle
driver to avoid wrong ecc errors.

Signed-off-by: Andreas Bießmann <andreas.biessmann@corscience.de>
Cc: Thomas Weber <thomas.weber@corscience.de>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
10 years agoboard:tricorder: enable omap_gpio clocks
Andreas Bießmann [Thu, 10 Apr 2014 10:52:51 +0000 (12:52 +0200)]
board:tricorder: enable omap_gpio clocks

Signed-off-by: Andreas Bießmann <andreas.biessmann@corscience.de>
Cc: Thomas Weber <thomas.weber@corscience.de>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
10 years agoboard:tricorder: always work with valid eeprom data
Andreas Bießmann [Thu, 10 Apr 2014 10:52:50 +0000 (12:52 +0200)]
board:tricorder: always work with valid eeprom data

Commit 890880583d84607e36b52a785a96b167728bbf73 introduced EEPROM parsing and
board detection but faild to return a valid tricorder_eeprom struct for backup
case.  When pressing S200 while reading EEPROM we ignore the value. We
returned falsely a tricorder_eeprom struct with uninitialized data which is
just garbage.
Initialize it by zeroing the whole structure.

Signed-off-by: Andreas Bießmann <andreas.biessmann@corscience.de>
Cc: Thomas Weber <thomas.weber@corscience.de>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
10 years agoarm:board:trats2:FIX: Clear INFORM4 and INFORM5 registers at correct boot
Łukasz Majewski [Wed, 9 Apr 2014 13:09:44 +0000 (15:09 +0200)]
arm:board:trats2:FIX: Clear INFORM4 and INFORM5 registers at correct boot

During switch to device tree, commit 1ecab0f has removed this code.

INFORM4 and INFORM5 registers are used by TRATS2 first stage bootloader for
providing recovery. For normal operation, those two must be cleared out.

This error emerges when one force reset from u-boot's command line for
three times.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Acked-by: Minkyu Kang <mk7.kang@samsung.com>
10 years agokbuild: fix a bug in regeneration of linker scripts
Masahiro Yamada [Wed, 9 Apr 2014 11:10:43 +0000 (20:10 +0900)]
kbuild: fix a bug in regeneration of linker scripts

In some use cases, SPL linker script was not updated even when
it should be.

For instance,

  $ make tricoder_config all
    [ build complete ]
  ... modify include/configs/tricoder.h
  $ make

spl/u-boot-spl.lds should be updated in this case, but it wasn't.

To fix this problem, linker scripts generation should be handled
by $(call if_changed_dep,...) rather than by $(call if_changed,...).

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: Andreas Bießmann <andreas.devel@googlemail.com>
Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>
10 years agoMerge branch 'u-boot/master' into 'u-boot-arm/master'
Albert ARIBAUD [Tue, 8 Apr 2014 07:25:08 +0000 (09:25 +0200)]
Merge branch 'u-boot/master' into 'u-boot-arm/master'

Conflicts:
arch/arm/cpu/arm926ejs/mxs/Makefile
include/configs/trats.h
include/configs/trats2.h
include/mmc.h

10 years agoarm64 patch: gicv3 support
David Feng [Fri, 14 Mar 2014 06:26:27 +0000 (14:26 +0800)]
arm64 patch: gicv3 support

This patch add gicv3 support to uboot armv8 platform.

Changes for v2:
  - rename arm/cpu/armv8/gic.S with arm/lib/gic_64.S
  - move smp_kick_all_cpus() from gic.S to start.S, it would be
    implementation dependent.
  - Each core initialize it's own ReDistributor instead of master
    initializeing all ReDistributors. This is advised by arnab.basu
    <arnab.basu@freescale.com>.

Signed-off-by: David Feng <fenghua@phytium.com.cn>
10 years agobootstage: arm: fix fdt stashing code
Mela Custodio [Wed, 19 Feb 2014 15:16:56 +0000 (00:16 +0900)]
bootstage: arm: fix fdt stashing code

The conditional is using a variable that is not defined.

Signed-off-by: Rommel G Custodio <sessyargc+u-boot@gmail.com>
10 years agoARMv8: fix bug for flush data cache by set/way
Leo Yan [Mon, 31 Mar 2014 01:50:35 +0000 (09:50 +0800)]
ARMv8: fix bug for flush data cache by set/way

When flush the d$ with set/way instruction, it need calculate the way's
offset = log2(Associativity); but in current uboot's code, it use below
formula to calculate the offset: log2(Associativity * 2 - 1), so finally
it cannot flush data cache properly.

Signed-off-by: Leo Yan <leoy@marvell.com>
10 years agoarmv8: Flush dcache before switching to EL2
York Sun [Mon, 31 Mar 2014 21:40:32 +0000 (14:40 -0700)]
armv8: Flush dcache before switching to EL2

For ARMv8, U-boot has been running at EL3 with cache and MMU enabled.
Without proper setup for EL2, cache and MMU are both disabled (out of
reset). Before switching, we need to flush the dcache to make sure the
data is in the main memory.

Signed-off-by: York Sun <yorksun@freescale.com>
Acked-by: David.Feng <fenghua@phytium.com.cn>
10 years agoarm: vf610: fix double iomux configuration for vf610twr board
Marcel Ziswiler [Tue, 11 Mar 2014 17:44:00 +0000 (18:44 +0100)]
arm: vf610: fix double iomux configuration for vf610twr board

Get rid of double VF610_PAD_DDR_A15__DDR_A_15 iomux configuration.

Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
10 years agoarm: vf610: add enet1 support
Marcel Ziswiler [Tue, 11 Mar 2014 17:43:59 +0000 (18:43 +0100)]
arm: vf610: add enet1 support

This patch contains several changes required for second Ethernet
(enet1/RMII1) port on vf610
- ANADIG PLL5 control definitions required for Ethernet RMII1 clock
- Secondary Ethernet (enet1) MAC RMII1 base address definition
- RMII1 iomux definitions
- VF610_PAD_PTA6__RMII0_CLKOUT iomux definition required for
  internal (e.g. crystal-less) Ethernet clocking.

Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
[stefan@agner.ch: regrouped patch]
Signed-off-by: Stefan Agner <stefan@agner.ch>
10 years agoarm: vf610: add uart0 clock/iomux definitions
Marcel Ziswiler [Tue, 11 Mar 2014 17:43:58 +0000 (18:43 +0100)]
arm: vf610: add uart0 clock/iomux definitions

Add CCM_CCGR0_UART0_CTRL_MASK clock definition and add TX/RX iomux
definitions for UART0 (aka. SCI0).

Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
[stefan@agner.ch: regrouped patch]
Signed-off-by: Stefan Agner <stefan@agner.ch>
10 years agoarm: vf610: fix anadig register struct
Marcel Ziswiler [Tue, 11 Mar 2014 17:43:57 +0000 (18:43 +0100)]
arm: vf610: fix anadig register struct

The anadig_reg structure started at the wrong offset (fixed by adding
reserved_0x000[4]), was missing some reserved field required for
alignment purpose (reserved_0x094[3] between pll4_denom and pll6_ctrl)
and further contained a too short reserved field causing further miss-
alignment (reserved_0x0C4[7]). Also, rename all the reserved fields
and using a memory offset based scheme for.

Discovered and tested by temporarily putting the following debug
instrumentation into board_init():
    struct anadig_reg *anadig = (struct anadig_reg *)ANADIG_BASE_ADDR;
    printf("&anadig->pll3_ctrl=0x%p\n", &anadig->pll3_ctrl);
    printf("&anadig->pll5_ctrl=0x%p\n", &anadig->pll5_ctrl);

Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
[stefan@agner.ch: regrouped patch]
Signed-off-by: Stefan Agner <stefan@agner.ch>
10 years agobuild:arm: Remove setting of CROSS_COMPILE environment variable
Łukasz Majewski [Tue, 18 Mar 2014 15:46:48 +0000 (16:46 +0100)]
build:arm: Remove setting of CROSS_COMPILE environment variable

After Kbuild introduction, the CROSS_COMPILE environment variable has been
set to some default value (prefix arm-linux-).

This shall be removed since it breaks building u-boot for native arm target
(like qemu ARM).
Moreover not all compilers have arm-linux- prefix.

Additionally the u-boot cross compiles with CROSS_COMPILE= set explicitly-
e.g.:
CROSS_COMPILE=/ .... /arm-v7a-linux-gnueabi- make

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMerge branch 'u-boot-imx/master' into 'u-boot-arm/master'
Albert ARIBAUD [Mon, 7 Apr 2014 17:13:42 +0000 (19:13 +0200)]
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'

10 years agoMX6: Enable ARM errata workaround 794072 and 761320
Nitin Garg [Wed, 2 Apr 2014 13:55:03 +0000 (08:55 -0500)]
MX6: Enable ARM errata workaround 794072 and 761320

Since MX6 is Cortex-A9 r2p10, enable software workaround
for errata 794072 and 761320.

Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
10 years agoARM: Add workaround for Cortex-A9 errata 761320
Nitin Garg [Wed, 2 Apr 2014 13:55:02 +0000 (08:55 -0500)]
ARM: Add workaround for Cortex-A9 errata 761320

Full cache line writes to the same memory region from at least two
processors might deadlock the processor. Exists on r1, r2, r3
revisions.

Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
Acked-by: Fabio Estevam <fabio.estevam@freescale.com>
10 years agoARM: Add workaround for Cortex-A9 errata 794072
Nitin Garg [Wed, 2 Apr 2014 13:55:01 +0000 (08:55 -0500)]
ARM: Add workaround for Cortex-A9 errata 794072

A short loop including a DMB instruction might cause a denial of
service on another processor which executes a CP15 broadcast operation.
Exists on r1, r2, r3, r4 revisions.

Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
10 years agoarmv8/cache: Change cache invalidate and flush function
York Sun [Wed, 26 Feb 2014 21:26:04 +0000 (13:26 -0800)]
armv8/cache: Change cache invalidate and flush function

When SoC first boots up, we should invalidate the cache but not flush it.
We can use the same function for invalid and flush mostly, with a wrapper.

Invalidating large cache can ben slow on emulator, so we postpone doing
so until I-cache is enabled, and before enabling D-cache.

Signed-off-by: York Sun <yorksun@freescale.com>
CC: David Feng <fenghua@phytium.com.cn>
10 years agoarmv8/cache: Flush D-cache, invalidate I-cache for relocation
York Sun [Wed, 26 Feb 2014 21:26:03 +0000 (13:26 -0800)]
armv8/cache: Flush D-cache, invalidate I-cache for relocation

If D-cache is enabled, we need to flush it, and invalidate i-cache before
jumping to the new location. This should be done right after relocation.

Signed-off-by: York Sun <yorksun@freescale.com>
CC: David Feng <fenghua@phytium.com.cn>
10 years agoarmv8/cache: Consolidate setting for MAIR and TCR
York Sun [Wed, 26 Feb 2014 21:26:02 +0000 (13:26 -0800)]
armv8/cache: Consolidate setting for MAIR and TCR

Move setting for MAIR and TCR to cache_v8.c, to avoid conflict with
sub-architecture.

Signed-off-by: York Sun <yorksun@freescale.com>
CC: David Feng <fenghua@phytium.com.cn>
10 years agoarm: Handle .gnu.hash section in ldscripts
Andreas Färber [Mon, 27 Jan 2014 04:48:11 +0000 (05:48 +0100)]
arm: Handle .gnu.hash section in ldscripts

Avoids "could not find output section .gnu.hash" ld.bfd errors on openSUSE.

Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Tom Rini <trini@ti.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
10 years agosocfpga: Adding Clock Manager driver
Chin Liang See [Wed, 5 Mar 2014 04:13:53 +0000 (22:13 -0600)]
socfpga: Adding Clock Manager driver

Clock Manager driver will be called to reconfigure all the
clocks setting based on user input. The input are passed to
Preloader through handoff files

Signed-off-by: Chin Liang See <clsee@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Tom Rini <trini@ti.com>
Cc: Wolfgang Denk <wd@denx.de>
CC: Pavel Machek <pavel@denx.de>
Cc: Dinh Nguyen <dinguyen@altera.com>
Acked-by: Pavel Machek <pavel@denx.de>
10 years agoRevert "Start the deprecation process for generic board"
Tom Rini [Fri, 4 Apr 2014 14:09:19 +0000 (10:09 -0400)]
Revert "Start the deprecation process for generic board"

We've run into a non-trivial conversion to CONFIG_SYS_GENERIC_BOARD so
we'll postpone this notice until right after v2014.04 is out.

This reverts commit 36c4b1d98059244c34ec3327d9cc9f3c552fd01b.

Signed-off-by: Tom Rini <trini@ti.com>
10 years agoarm: mxs: Add support for generating signed BootStream
Marek Vasut [Thu, 3 Apr 2014 17:12:21 +0000 (19:12 +0200)]
arm: mxs: Add support for generating signed BootStream

This patch adds the groundwork for generating signed BootStream, which
can be used by the HAB library in i.MX28. We are adding a new target,
u-boot-signed.sb , since the process for generating regular non-signed
BootStream is much easier. Moreover, the signed bootstream depends on
external _proprietary_ _binary-only_ tool from Freescale called 'cst',
which is available only under NDA.

To make things even uglier, the CST or HAB mandates a kind-of circular
dependency. The problem is, unlike the regular IVT, which is generated
by mxsimage, the IVT for signed boot must be generated by hand here due
to special demands of the CST. The U-Boot binary (or SPL binary) and IVT
are then signed by the CST as a one block. But here is the problem. The
size of the entire image (U-Boot, IVT, CST blocks) must be appended at
the end of IVT. But the size of the entire image is not known until the
CST has finished signing the U-Boot and IVT. We solve this by expecting
the CST block to be always 3904B (which it is in case two files, U-Boot
and the hand-made IVT, are signed in the CST block).

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
10 years agoMerge branch 'master' of git://git.denx.de/u-boot-arm into master
Stefano Babic [Fri, 4 Apr 2014 09:35:30 +0000 (11:35 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-arm into master

Conflicts:
arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg
arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg

Signed-off-by: Stefano Babic <sbabic@denx.de>
10 years agoRevert "arm: mxs: Add support for generating signed BootStream"
Stefano Babic [Fri, 4 Apr 2014 09:29:29 +0000 (11:29 +0200)]
Revert "arm: mxs: Add support for generating signed BootStream"

This reverts commit 53e6b14e037c9f72e6d03244c32d8d597e2e0234.

Patch does not merge anymore with u-boot-arm and must be rebased.

Signed-off-by: Stefano Babic <sbabic@denx.de>
10 years agotrats/trats2: enable CONFIG_RANDOM_UUID submit/tizen_common/20140513.145900
Przemyslaw Marczak [Wed, 2 Apr 2014 08:20:07 +0000 (10:20 +0200)]
trats/trats2: enable CONFIG_RANDOM_UUID

This change enables automatically uuid generation by command gpt.
In case of updating partitions layout user don't need to care about
generate uuid manually.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Piotr Wilczek <p.wilczek@samsung.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: trini@ti.com
10 years agocmd:gpt: randomly generate each partition uuid if undefined
Przemyslaw Marczak [Wed, 2 Apr 2014 08:20:06 +0000 (10:20 +0200)]
cmd:gpt: randomly generate each partition uuid if undefined

Changes:
- randomly generate partition uuid if any is undefined and CONFIG_RAND_UUID
  is defined
- print debug info about set/unset/generated uuid
- update doc/README.gpt

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Piotr Wilczek <p.wilczek@samsung.com>
Cc: Tom Rini <trini@ti.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
10 years agonew commands: uuid and guid - generate random unique identifier
Przemyslaw Marczak [Wed, 2 Apr 2014 08:20:05 +0000 (10:20 +0200)]
new commands: uuid and guid - generate random unique identifier

Those commands basis on implementation of random UUID generator version 4
which is described in RFC4122. The same algorithm is used for generation
both ids but string representation is different as below.

char:  0        9    14   19   24         36
       xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
UUID:     be     be   be   be       be
GUID:     le     le   le   be       be

Commands usage:
- uuid [<varname>]
- guid [<varname>]

The result is saved in environment as a "varname" variable if argument is given,
if not then it is printed.

New config:
- CONFIG_CMD_UUID

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: trini@ti.com
10 years agolib: uuid: add functions to generate UUID version 4
Przemyslaw Marczak [Wed, 2 Apr 2014 08:20:04 +0000 (10:20 +0200)]
lib: uuid: add functions to generate UUID version 4

This patch adds support to generate UUID (Universally Unique Identifier)
in version 4 based on RFC4122, which is randomly.

Source: https://www.ietf.org/rfc/rfc4122.txt

Changes:
- new configs:
  - CONFIG_LIB_UUID for compile lib/uuid.c
  - CONFIG_RANDOM_UUID for functions gen_rand_uuid() and gen_rand_uuid_str()
- add configs dependency to include/config_fallbacks.h for lib uuid.

lib/uuid.c:
- add gen_rand_uuid() - this function writes 16 bytes len binary representation
  of UUID v4 to the memory at given address.

- add gen_rand_uuid_str() - this function writes 37 bytes len hexadecimal
  ASCII string representation of UUID v4 to the memory at given address.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
[trini: Add CONFIG_EFI_PARTITION to fallbacks]
Signed-off-by: Tom Rini <trini@ti.com>
10 years agolib: uuid: code refactor for proper maintain between uuid bin and string
Przemyslaw Marczak [Wed, 2 Apr 2014 08:20:03 +0000 (10:20 +0200)]
lib: uuid: code refactor for proper maintain between uuid bin and string

Changes in lib/uuid.c to:
- uuid_str_to_bin()
- uuid_bin_to_str()

New parameter is added to specify input/output string format in listed functions
This change allows easy recognize which UUID type is or should be stored in given
string array. Binary data of UUID and GUID is always stored in big endian, only
string representations are different as follows.

String byte: 0                                  36
String char: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
string UUID:    be     be   be   be       be
string GUID:    le     le   le   be       be

This patch also updates functions calls and declarations in a whole code.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: trini@ti.com
10 years agopart_efi: move uuid<->string conversion functions into lib/uuid.c
Przemyslaw Marczak [Wed, 2 Apr 2014 08:20:02 +0000 (10:20 +0200)]
part_efi: move uuid<->string conversion functions into lib/uuid.c

This commit introduces cleanup for uuid library.
Changes:
- move uuid<->string conversion functions into lib/uuid.c so they can be
  used by code outside part_efi.c.
- rename uuid_string() to uuid_bin_to_str() for consistency with existing
  uuid_str_to_bin()
- add an error return code to uuid_str_to_bin()
- update existing code to the new library functions.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: trini@ti.com
10 years agoahci: Fix data abort on multiple scsi resets.
Roger Quadros [Tue, 1 Apr 2014 14:26:40 +0000 (17:26 +0300)]
ahci: Fix data abort on multiple scsi resets.

Commit 2faf5fb82ed6 introduced a regression that causes a data
abort when running scsi init followed by scsi reset.

There are 2 problems with the original commit
1) ALLOC_CACHE_ALIGN_BUFFER() allocates memory on the stack but is
assigned to ataid[port] and used by other functions.
2) The function ata_scsiop_inquiry() tries to free memory which was
never allocated on the heap.

Fix these problems by using tmpid as a temporary cache aligned buffer.
Allocate memory separately for ataid[port] and re-use it if required.

Fixes: 2faf5fb82ed6 (ahci: Fix cache align error messages)

Reported-by: Eli Nidam <elini@marvell.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
10 years agoconfig:trats2: Change u-boot's TEXT_BASE from 0x78100000 to 0x43e00000
Łukasz Majewski [Wed, 19 Mar 2014 13:47:06 +0000 (14:47 +0100)]
config:trats2: Change u-boot's TEXT_BASE from 0x78100000 to 0x43e00000

The u-boot's image TEXT_BASE needs to be changed to 0x43e00000 from 0x78100000.

This change provides compatibility with other trats2 (RD_PQ) devices
(http://download.tizen.org/releases/system/).

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
10 years agommc:eSDHC: Workaround for data timeout issue on Txxx SoC
Haijun.Zhang [Tue, 18 Mar 2014 09:04:23 +0000 (17:04 +0800)]
mmc:eSDHC: Workaround for data timeout issue on Txxx SoC

1. The Data timeout counter value in eSDHC_SYSCTL register is
not working as it should be, so add quirks to enable this
workaround to fix it to the max value 0xE.

2. Add CONFIG_SYS_FSL_ERRATUM_ESDHC111 to enable its workaround.

* Update of patch for change mmc interface by
Pantelis Antoniou <panto@antoniou-consulting.com>

Signed-off-by: Haijun Zhang <Haijun.Zhang@freescale.com>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
10 years agommc: fsl_esdhc: add controller reset in case of data related errors too
Andrew Gabbasov [Mon, 24 Mar 2014 07:41:06 +0000 (02:41 -0500)]
mmc: fsl_esdhc: add controller reset in case of data related errors too

The controller reset is performed now if command error occurs.
This commit adds the reset for the case of data related errors too.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
10 years agommc: fsl_esdhc: fix calculation of timeout for data transactions
Andrew Gabbasov [Mon, 24 Mar 2014 07:40:41 +0000 (02:40 -0500)]
mmc: fsl_esdhc: fix calculation of timeout for data transactions

Calculation of the timeout value should be based on actual clock value,
written to controller registers. Since mmc->tran_speed is either the
maximum allowed speed, or the preliminary value, that is be not yet
set to registers, the actual timeout, taken by the controller, based
on its clock settings, may be much longer than expected, based on
mmc->tran_speed value. In particular it happens at early initialization
stage, when typical value of mmc->tran_speed is 20MHz or 26MHz, while
actual clock setting, configured in the controller, is 400kHz.
It's more correct to use mmc->clock value for timeout calculation instead.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
10 years agommc: Add 'mmc rst-function' sub-command
Tom Rini [Fri, 7 Feb 2014 19:15:20 +0000 (14:15 -0500)]
mmc: Add 'mmc rst-function' sub-command

Some eMMC chips may need the RST_n_FUNCTION bit set to a non-zero value
in order for warm reset of the system to work.  Details on this being
required will be part of the eMMC datasheet.  Also add using this
command to the dra7xx README.

* Whitespace fix by panto

Signed-off-by: Tom Rini <trini@ti.com>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
10 years agommc: sh_mmcif: Fix warning by unused variable
Nobuhiro Iwamatsu [Mon, 31 Mar 2014 05:54:29 +0000 (14:54 +0900)]
mmc: sh_mmcif: Fix warning by unused variable

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Reported-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
10 years agommc: sh_mmcif: Fix compile error
Nobuhiro Iwamatsu [Mon, 31 Mar 2014 05:54:28 +0000 (14:54 +0900)]
mmc: sh_mmcif: Fix compile error

BY commit "mmc: Split mmc struct, rework mmc initialization (v2)",
sh_mmcif has compile error. This fixes compile error.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
CC: Pantelis Antoniou <panto@antoniou-consulting.com>
Reported-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
10 years agomx6: add example DTB for mx6qsabreauto
Stefano Babic [Mon, 31 Mar 2014 07:50:36 +0000 (09:50 +0200)]
mx6: add example DTB for mx6qsabreauto

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Fabio Estevam <fabio.estevam@freescale.com>
10 years agoimx: add rules for U-Boot DTB support
Stefano Babic [Mon, 31 Mar 2014 07:50:35 +0000 (09:50 +0200)]
imx: add rules for U-Boot DTB support

Signed-off-by: Stefano Babic <sbabic@denx.de>