platform/kernel/u-boot.git
8 years agousb: fsl: Renaming fdt_fixup_erratum and fdt_fixup_usb_erratum
Sriram Dash [Fri, 16 Sep 2016 11:42:16 +0000 (17:12 +0530)]
usb: fsl: Renaming fdt_fixup_erratum and fdt_fixup_usb_erratum

The functions fdt_fixup_erratum and fdt_fixup_usb_erratum are
fsl/nxp specific. So, make them explicit by renaming them
fsl_fdt_fixup_erratum and fsl_fdt_fixup_usb_erratum

Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
8 years agousb: fsl: Rename fdt_fixup_dr_usb
Sriram Dash [Fri, 16 Sep 2016 11:42:15 +0000 (17:12 +0530)]
usb: fsl: Rename fdt_fixup_dr_usb

The function fdt_fixup_dr_usb is specific to fsl/nxp. So,
make the function name explicit and rename fdt_fixup_dr_usb
into fsl_fdt_fixup_dr_usb.

Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
8 years agoapalis_t30: colibri_imx7: colibri_t30: fix ethernet functionality
Marcel Ziswiler [Wed, 14 Sep 2016 22:54:00 +0000 (00:54 +0200)]
apalis_t30: colibri_imx7: colibri_t30: fix ethernet functionality

Since commit aa7a648747d8c704a9a81c9e493d386930724e9d
("net: Stop including NFS overhead in defragment max") the following
has been reproducibly observed while trying to transfer data over TFTP:

Load address: 0x80408000
Loading: EHCI timed out on TD - token=0x8008d80
T EHCI timed out on TD - token=0x88008d80
Rx: failed to receive: -5

This patch fixes this by lowering our TFTP block size to be within the
standard maximal de-fragmentation aka IP packet size again.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
8 years agoconfigs: colibri_vf_defconfig: Enable USB driver model for Colibri Vybrid
Sanchayan Maity [Tue, 9 Aug 2016 18:15:02 +0000 (23:45 +0530)]
configs: colibri_vf_defconfig: Enable USB driver model for Colibri Vybrid

Enable USB driver model for Toradex Colibri Vybrid modules.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
8 years agoARM: dts: vf-colibri: Enable USB device tree node for Colibri Vybrid
Sanchayan Maity [Tue, 9 Aug 2016 18:15:01 +0000 (23:45 +0530)]
ARM: dts: vf-colibri: Enable USB device tree node for Colibri Vybrid

Enable USB device tree node for Toradex Colibri Vybrid module.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
8 years agoARM: dts: vf: Add device tree node for USB on Vybrid
Sanchayan Maity [Tue, 9 Aug 2016 18:15:00 +0000 (23:45 +0530)]
ARM: dts: vf: Add device tree node for USB on Vybrid

Add device tree node for USB peripheral on Vybrid.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
8 years agousb: host: ehci-vf: Migrate Vybrid USB to driver model
Sanchayan Maity [Tue, 9 Aug 2016 18:14:59 +0000 (23:44 +0530)]
usb: host: ehci-vf: Migrate Vybrid USB to driver model

Add driver model support for Vybrid USB driver.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
8 years agocmd: dfu: Add error handling for failed registration
Sanchayan Maity [Mon, 8 Aug 2016 11:26:17 +0000 (16:56 +0530)]
cmd: dfu: Add error handling for failed registration

Without this, if g_dnl_register() fails, DFU code continues on
blindly and crashes. This fix makes it simply print an error
message instead.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
[l.majewski@samsung.com - some manual tweaks needed]

8 years agodra7x: configs: enable SPL-DFU support
B, Ravi [Thu, 28 Jul 2016 12:09:18 +0000 (17:39 +0530)]
dra7x: configs: enable SPL-DFU support

This patch enables the SPL-DFU support for
dra7x platform.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agodra7x: boot: add dfu bootmode support
B, Ravi [Thu, 28 Jul 2016 12:09:17 +0000 (17:39 +0530)]
dra7x: boot: add dfu bootmode support

This patch enables the DFU boot mode support
for dra7x platform.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agospl: dfu: adding dfu support functions for SPL-DFU
B, Ravi [Thu, 28 Jul 2016 12:09:16 +0000 (17:39 +0530)]
spl: dfu: adding dfu support functions for SPL-DFU

Adding support functions to run dfu spl commands.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agocommon: dfu: saperate the dfu common functionality
B, Ravi [Thu, 28 Jul 2016 12:09:15 +0000 (17:39 +0530)]
common: dfu: saperate the dfu common functionality

The cmd_dfu functionality is been used by both SPL and
u-boot, saperating the core dfu functionality moving
it to common/dfu.c.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agospl: dfu: add dfu support in SPL
B, Ravi [Thu, 28 Jul 2016 12:09:14 +0000 (17:39 +0530)]
spl: dfu: add dfu support in SPL

Traditionally the DFU support is available only
as part 2nd stage boot loader(u-boot) and DFU
is not supported in SPL.

The SPL-DFU feature is useful for boards which
does not have MMC/SD, ethernet boot mechanism
to boot the board and only has USB inteface.

This patch add DFU support in SPL with RAM
memory device support to load and execute u-boot.
And then leverage full functionality DFU in
u-boot to flash boot inital binary images to
factory or bare-metal boards to memory devices
like SPI, eMMC, MMC/SD card using USB interface.

This SPL-DFU support can be enabled through
Menuconfig->Boot Images->Enable SPL-DFU support

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agodrivers: usb: xhci-fsl: Change burst beat and outstanding pipelined transfers requests
Sriram Dash [Mon, 22 Aug 2016 12:25:15 +0000 (17:55 +0530)]
drivers: usb: xhci-fsl: Change burst beat and outstanding pipelined transfers requests

This is required for better performance, and performs below tuning:
1. Enable burst length set, and define it as 4/8/16.
2. Set burst request limit to 16 requests.

Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
8 years agocolibri_t30: fix usb ethernet functionality
Marcel Ziswiler [Sat, 10 Sep 2016 02:20:48 +0000 (04:20 +0200)]
colibri_t30: fix usb ethernet functionality

Since commit aa7a648747d8c704a9a81c9e493d386930724e9d
("net: Stop including NFS overhead in defragment max") the following
has been reproducibly observed while trying to transfer data over TFTP:

Load address: 0x80408000
Loading: EHCI timed out on TD - token=0x8008d80
T EHCI timed out on TD - token=0x88008d80
Rx: failed to receive: -5

This patch fixes this by upping our maximal de-fragmentation aka IP
packet size again.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
8 years agonet: asix: Fix ASIX 88772B with driver model
Alban Bedel [Sat, 10 Sep 2016 01:54:09 +0000 (03:54 +0200)]
net: asix: Fix ASIX 88772B with driver model

Commit 147271209a9d ("net: asix: fix operation without eeprom")
added a special handling for ASIX 88772B that enable another
type of header. This break the driver in DM mode as the extra handling
needed in the receive path is missing.

However this new header mode is not required and only seems to
increase the code complexity, so this patch revert this part of
commit 147271209a9d.

This also reverts commit 41d1258aceb45b45f9e68f67a9c40f0afbc09dc9
("net: asix: Fix AX88772B when used with DriverModel") of late.

Fixes: 147271209a9d ("net: asix: fix operation without eeprom")

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
8 years agoMerge git://git.denx.de/u-boot-fsl-qoriq
Tom Rini [Mon, 26 Sep 2016 17:24:46 +0000 (13:24 -0400)]
Merge git://git.denx.de/u-boot-fsl-qoriq

trini: Drop local memset() from
examples/standalone/mem_to_mem_idma2intr.c

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agokconfig: introduce kconfig for UBI
Heiko Schocher [Wed, 21 Sep 2016 05:58:19 +0000 (07:58 +0200)]
kconfig: introduce kconfig for UBI

move the UBI config options into Kconfig.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andrew F. Davis <afd@ti.com>
Reviewed by: Evgeni Dobrev <evgeni at studio-punkt.com>

8 years agoarmv7: ls102xa: Rename GIC_ADDR and DCSR_RCPM_ADDR
York Sun [Mon, 26 Sep 2016 15:09:30 +0000 (08:09 -0700)]
armv7: ls102xa: Rename GIC_ADDR and DCSR_RCPM_ADDR

Instead of using CONFIG_* name space, rename these two macros to
SYS_FSL_* space.

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Hongbo Zhang <hongbo.zhang@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoarmv7: ls1021a: Convert CONFIG_LS1_DEEP_SLEEP to Kconfig option
York Sun [Mon, 26 Sep 2016 15:09:29 +0000 (08:09 -0700)]
armv7: ls1021a: Convert CONFIG_LS1_DEEP_SLEEP to Kconfig option

Move this option to Kconfig and clean up existing uses.

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Hongbo Zhang <hongbo.zhang@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoarmv8: ls1046ardb_emmc: Fix a typo in defconfig
York Sun [Mon, 26 Sep 2016 15:09:28 +0000 (08:09 -0700)]
armv8: ls1046ardb_emmc: Fix a typo in defconfig

It should be EMMC_BOOT instead of CONFIG_EMMC_BOOT.

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Gong Qianyu <Qianyu.Gong@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoConvert CONFIG_SYS_FSL_ERRATUM_A010315 to Kconfig option
York Sun [Mon, 26 Sep 2016 15:09:27 +0000 (08:09 -0700)]
Convert CONFIG_SYS_FSL_ERRATUM_A010315 to Kconfig option

Move this option to Kconfig and clean up existing uses.

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
8 years agoarmv8: ls1012a: Convert CONFIG_LS1012A to Kconfig option ARCH_LS1021A
York Sun [Mon, 26 Sep 2016 15:09:26 +0000 (08:09 -0700)]
armv8: ls1012a: Convert CONFIG_LS1012A to Kconfig option ARCH_LS1021A

Move this config to Kconfig option and clean up existing uses.

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Calvin Johnson <calvin.johnson@nxp.com>
CC: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agodriver: ddr: fsl_mmdc: Pass board parameters through data structure
York Sun [Mon, 26 Sep 2016 15:09:25 +0000 (08:09 -0700)]
driver: ddr: fsl_mmdc: Pass board parameters through data structure

Instead of using multiple macros, a data structure is used to pass
board-specific parameters to MMDC DDR driver.

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Shengzhou Liu <Shengzhou.Liu@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoarmv8: ls1046a: Convert CONFIG_LS1046A to Kconfig option ARCH_LS1046A
York Sun [Mon, 26 Sep 2016 15:09:24 +0000 (08:09 -0700)]
armv8: ls1046a: Convert CONFIG_LS1046A to Kconfig option ARCH_LS1046A

Move this option to Kconfig and clean up existing uses.

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Mingkai Hu <mingkai.hu@nxp.com>
CC: Gong Qianyu <Qianyu.Gong@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-coldfire
Tom Rini [Mon, 26 Sep 2016 13:31:01 +0000 (09:31 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-coldfire

8 years agoi2c: mvtwsi.c: Add support for Marvell Armada 7K/8K
Stefan Roese [Fri, 16 Sep 2016 13:07:55 +0000 (15:07 +0200)]
i2c: mvtwsi.c: Add support for Marvell Armada 7K/8K

By adding the "marvell,mv78230-i2c" compatible property, we can enable
this I2C driver to support these new ARM64 chips as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Neta Zur Hershkovits <neta@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Omri Itach <omrii@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Heiko Schocher <hs@denx.de>
8 years agoi2c: mv_i2c.c: Validate read length in I2C command
jinghua [Fri, 16 Sep 2016 13:07:54 +0000 (15:07 +0200)]
i2c: mv_i2c.c: Validate read length in I2C command

The I2C bus will get stuck when reading 0 byte. So we add validation of
the read length in i2c_read(). This issue only occurs on read operation.

Signed-off-by: jinghua <jinghua@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Heiko Schocher <hs@denx.de>
8 years agoi2c: mv_i2c.c: Enable runtime speed selection (standard vs fast mode)
Stefan Roese [Fri, 16 Sep 2016 13:07:53 +0000 (15:07 +0200)]
i2c: mv_i2c.c: Enable runtime speed selection (standard vs fast mode)

This patch adds runtime speed configuration to the mv_i2c driver.
Currently standard (max 100kHz) and fast mode (max 400kHz) are
supported.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Heiko Schocher <hs@denx.de>
8 years agoi2c: mv_i2c.c: Add DM support
Stefan Roese [Fri, 16 Sep 2016 13:07:52 +0000 (15:07 +0200)]
i2c: mv_i2c.c: Add DM support

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Heiko Schocher <hs@denx.de>
8 years agoi2c: mv_i2c.c: Prepare driver for DM conversion
Stefan Roese [Fri, 16 Sep 2016 13:07:51 +0000 (15:07 +0200)]
i2c: mv_i2c.c: Prepare driver for DM conversion

To prepare for the DM conversion, we add a layer of compatibility
functions to be used by both the legacy and the DM functions.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Heiko Schocher <hs@denx.de>
8 years agoi2c: mv_i2c.c: Remove CONFIG_HARD_I2C
Stefan Roese [Fri, 16 Sep 2016 13:07:50 +0000 (15:07 +0200)]
i2c: mv_i2c.c: Remove CONFIG_HARD_I2C

CONFIG_HARD_I2C is not needed, lets remove it.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Heiko Schocher <hs@denx.de>
8 years agoi2c: mv_i2c.c: cosmetic: Coding style cleanups
Stefan Roese [Fri, 16 Sep 2016 13:07:49 +0000 (15:07 +0200)]
i2c: mv_i2c.c: cosmetic: Coding style cleanups

Some mostly indentation coding style cleanups. Also, move this driver
to use debug() for debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Heiko Schocher <hs@denx.de>
8 years agoboard: amcore: update to use dm serial driver
Angelo Dureghello [Tue, 20 Sep 2016 15:54:10 +0000 (17:54 +0200)]
board: amcore: update to use dm serial driver

Update amcore board to use dm serial driver.

Signed-off-by: Angelo Dureghello <angelo@sysam.it>
---
Changes for v2:
- None

8 years agoboard: amcore: add update scripts
Angelo Dureghello [Tue, 20 Sep 2016 15:40:03 +0000 (17:40 +0200)]
board: amcore: add update scripts

Add some useful update scripts.

Signed-off-by: Angelo Dureghello <angelo@sysam.it>
---
Changes for v.2:
- Fix syntax error on upgrade_jffs2 script

8 years agoarm: mvebu: NAND support for DB-88F6820-AMC
Chris Packham [Thu, 22 Sep 2016 00:56:15 +0000 (12:56 +1200)]
arm: mvebu: NAND support for DB-88F6820-AMC

Enable the NAND interface on this board.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
8 years agoarm: mvebu: add DB-88F6820-AMC board
Chris Packham [Thu, 22 Sep 2016 00:56:14 +0000 (12:56 +1200)]
arm: mvebu: add DB-88F6820-AMC board

This board is a plug in card for Marvell's switch system development
kits. Form-factor aside it is similar to the DB-88F6820-GP with the
following differences.
- TCLK is 200MHz
- SPI1 is used
- No SATA
- No MMC
- NAND flash

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
8 years agoarm: mvebu: create generic 88F6820 config option
Chris Packham [Thu, 22 Sep 2016 00:56:13 +0000 (12:56 +1200)]
arm: mvebu: create generic 88F6820 config option

88F6820 is a specific Armada-38x chip that is used on the DB-88F6820-GP
board. Rather than having DB_88F6820_GP and TARGET_DB_88F6820_GP which
selects the former. Rename DB_88F6820_GP to 88F6820 so that other boards
using the 88F6820 can be added.

Stefan:
Change 88F6820 for clearfog as well.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
8 years agoarm: mvebu: theadorable: Configure board for PCIe 2.0 capability
Stefan Roese [Thu, 25 Aug 2016 14:22:10 +0000 (16:22 +0200)]
arm: mvebu: theadorable: Configure board for PCIe 2.0 capability

Use a board-specific board_sat_r_get() function to configure the board
for PCIe 2.0 capability (e.g. 5GB/s link speed). Otherwise the default
of 2.5GB/s will be established.

Signed-off-by: Stefan Roese <sr@denx.de>
8 years agousb: ehci-generic: support reset control for generic EHCI
Masahiro Yamada [Wed, 21 Sep 2016 02:29:02 +0000 (11:29 +0900)]
usb: ehci-generic: support reset control for generic EHCI

This driver is designed in a generic manner, so resets should be
handled generically as well.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoreset: add no-op stubs for optional reset control
Masahiro Yamada [Wed, 21 Sep 2016 02:29:01 +0000 (11:29 +0900)]
reset: add no-op stubs for optional reset control

My motivation for this patch is to make reset control handling
optional for generic drivers.

I want to add reset control to drivers/usb/host/ehci-generic.c,
but it is used by several platforms, some will implement a reset
controller driver, some will not.

Add no-op stubs in order to avoid link error for drivers that
implement reset controlling, but still it is optional.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoerrno.h: sync error macros with linux 4.8-rc7
Masahiro Yamada [Wed, 21 Sep 2016 02:29:00 +0000 (11:29 +0900)]
errno.h: sync error macros with linux 4.8-rc7

For synchronization, import macros from
  - include/uapi/asm-generic/errno-base.h
  - include/uapi/asm-generic/errno.h
  - include/linux/errno.h

of Linux 4.8-rc7.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoMove ENOTSUPP defines to include/linux/errno.h
Masahiro Yamada [Wed, 21 Sep 2016 02:28:59 +0000 (11:28 +0900)]
Move ENOTSUPP defines to include/linux/errno.h

Collect a couple of duplicated defines into a single place.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoMove error macros from <asm-generic/errno.h> to <linux/errno.h>
Masahiro Yamada [Wed, 21 Sep 2016 02:28:58 +0000 (11:28 +0900)]
Move error macros from <asm-generic/errno.h> to <linux/errno.h>

There are no files that include <asm-generic/errno.h> any more.
Move error macro defines to include/linux/errno.h and remove
include/asm-generic/errno.h.

Going forward, please include <linux/errno.h> when you need error
macros.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agotreewide: replace #include <asm-generic/errno.h> with <linux/errno.h>
Masahiro Yamada [Wed, 21 Sep 2016 02:28:57 +0000 (11:28 +0900)]
treewide: replace #include <asm-generic/errno.h> with <linux/errno.h>

Now, include/linux/errno.h is a wrapper of <asm-generic/errno.h>.
Replace all include directives for <asm-generic/errno.h> with
<linux/errno.h>.

<asm-generic/...> is supposed to be included from <asm/...> when
arch-headers fall back into generic implementation. Generally, they
should not be directly included from .c files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[trini: Add drivers/usb/host/xhci-rockchip.c]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoRemove arch/${ARCH}/include/asm/errno.h
Masahiro Yamada [Wed, 21 Sep 2016 02:28:56 +0000 (11:28 +0900)]
Remove arch/${ARCH}/include/asm/errno.h

Unlike Linux, nothing about errno.h is arch-specific in U-Boot.
As you see, all of arch/${ARCH}/include/asm/errno.h is just a
wrapper of <asm-generic/errno.h>.  Actually, U-Boot does not
export headers to user-space, so we just have to care about the
consistency in the U-Boot tree.

Now all of include directives for <asm/errno.h> are gone.
Deprecate <asm/errno.h>.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
8 years agotreewide: replace #include <asm/errno.h> with <linux/errno.h>
Masahiro Yamada [Wed, 21 Sep 2016 02:28:55 +0000 (11:28 +0900)]
treewide: replace #include <asm/errno.h> with <linux/errno.h>

Now, arch/${ARCH}/include/asm/errno.h and include/linux/errno.h have
the same content.  (both just wrap <asm-generic/errno.h>)

Replace all include directives for <asm/errno.h> with <linux/errno.h>.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[trini: Fixup include/clk.]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoAdd <linux/errno.h> as a wrapper of <asm-generic/errno.h>
Masahiro Yamada [Wed, 21 Sep 2016 02:28:54 +0000 (11:28 +0900)]
Add <linux/errno.h> as a wrapper of <asm-generic/errno.h>

This will be used to consolidate errno.h variants.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agotreewide: use #include <...> to include public headers
Masahiro Yamada [Wed, 21 Sep 2016 02:28:53 +0000 (11:28 +0900)]
treewide: use #include <...> to include public headers

We are supposed to use #include <...> to include headers in the
public include paths.  We should use #include "..." only for headers
in local directories.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodrivers: squash lines for immediate return
Masahiro Yamada [Tue, 6 Sep 2016 13:17:39 +0000 (22:17 +0900)]
drivers: squash lines for immediate return

Remove unneeded variables and assignments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoarch, board: squash lines for immediate return
Masahiro Yamada [Tue, 6 Sep 2016 13:17:38 +0000 (22:17 +0900)]
arch, board: squash lines for immediate return

Remove unneeded variables and assignments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
Reviewed-by: Angelo Dureghello <angelo@sysam.it>
8 years agolibfdt: simplify fdt_del_mem_rsv()
Masahiro Yamada [Tue, 6 Sep 2016 13:17:37 +0000 (22:17 +0900)]
libfdt: simplify fdt_del_mem_rsv()

The variable "err" is unneeded.

[ Device Tree Compiler commit: 36fd7331fb11276c09a6affc0d8cd4977f2fe100 ]

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agox86: squash lines for immediate return
Masahiro Yamada [Tue, 6 Sep 2016 13:17:36 +0000 (22:17 +0900)]
x86: squash lines for immediate return

arch_cpu_init() can be simpler by this refactoring.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agousb: squash lines for immediate return
Masahiro Yamada [Tue, 6 Sep 2016 13:17:35 +0000 (22:17 +0900)]
usb: squash lines for immediate return

This makes functions much simpler.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agousb: replace ehci_*_remove() with usb_deregister()
Masahiro Yamada [Tue, 6 Sep 2016 13:17:34 +0000 (22:17 +0900)]
usb: replace ehci_*_remove() with usb_deregister()

The remove callbacks of EHCI drivers are often just a wrapper of
ehci_deregister.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
8 years agovideo: squash lines for immediate return
Masahiro Yamada [Tue, 6 Sep 2016 13:17:33 +0000 (22:17 +0900)]
video: squash lines for immediate return

For vidconsole_post_probe(), it is common coding style to let a
probe method return the value of a register function.

The others will become simple wrapper functions.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
8 years agommc: squash lines for immediate return
Masahiro Yamada [Tue, 6 Sep 2016 13:17:32 +0000 (22:17 +0900)]
mmc: squash lines for immediate return

These functions can be much simpler by squashing lines for immediate
return.

For *_bind() callbacks, they will be a simple wrapper function of an
upper-level bind API.

For mmc_set_{boot_bus_width,part_conf}, they will be a wrapper of
mmc_switch().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
8 years agofs-test.sh: Update expected results
Tom Rini [Fri, 23 Sep 2016 13:29:49 +0000 (09:29 -0400)]
fs-test.sh: Update expected results

Thanks to Stefan Brüns we have more tests and a few more passes too,
update the expected output now.

Cc: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoext4: Revert rejection of 64bit enabled ext4 fs
Stefan Brüns [Sat, 17 Sep 2016 00:10:12 +0000 (02:10 +0200)]
ext4: Revert rejection of 64bit enabled ext4 fs

Enable mounting of ext4 fs with 64bit feature, as it is supported now.
These had been disabled in 6f94ab6656ceffb3f2a972c8de4c554502b6f2b7.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoext4: Respect group descriptor size when adjusting free counts
Stefan Brüns [Mon, 19 Sep 2016 23:13:01 +0000 (01:13 +0200)]
ext4: Respect group descriptor size when adjusting free counts

Also adjust high 16/32 bits when free inode/block counts are modified.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoext4: Use helper function to access group descriptor and its fields
Stefan Brüns [Sat, 17 Sep 2016 00:10:10 +0000 (02:10 +0200)]
ext4: Use helper function to access group descriptor and its fields

The descriptor size is variable, thus array indices are not generically
applicable. The larger group descriptors also contain e.g. high parts
of block numbers, which have to be read and written.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoext4: Use correct descriptor size when reading the block group descriptor
Stefan Brüns [Sat, 17 Sep 2016 00:10:09 +0000 (02:10 +0200)]
ext4: Use correct descriptor size when reading the block group descriptor

The correct descriptor size must be used when calculating offsets, and
also to read the correct amount of data.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoext4: Add helper functions for block group descriptor field access
Stefan Brüns [Mon, 19 Sep 2016 23:12:42 +0000 (01:12 +0200)]
ext4: Add helper functions for block group descriptor field access

The helper functions encapsulate access of the block group descriptors,
independent of group descriptor size. The helpers also deal with the
endianess of the fields, and with split fields like free_blocks/
free_blocks_high.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoext4: determine group descriptor size for 64bit feature
Stefan Brüns [Sat, 17 Sep 2016 00:10:07 +0000 (02:10 +0200)]
ext4: determine group descriptor size for 64bit feature

If EXT4_FEATURE_INCOMPAT_64BIT is set, the descriptor can be read from
the superblocks, otherwise it defaults to 32.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoext4: Update ext2/3/4 superblock, group descriptor and inode structures
Stefan Brüns [Sat, 17 Sep 2016 00:10:06 +0000 (02:10 +0200)]
ext4: Update ext2/3/4 superblock, group descriptor and inode structures

Most importantly, the superblock provides the used group descriptor size,
which is required for the EXT4_FEATURE_INCOMPAT_64BIT.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoext4: Fix memory leak of journal buffer if block is updated multiple times
Stefan Brüns [Tue, 6 Sep 2016 02:36:56 +0000 (04:36 +0200)]
ext4: Fix memory leak of journal buffer if block is updated multiple times

If the same block is updated multiple times in a row during a single
file system operation, gd_index is decremented to use the same journal
entry again. Avoid loosing the already allocated buffer.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoext4: Correct block number handling, empty block vs. error code
Stefan Brüns [Tue, 6 Sep 2016 02:36:55 +0000 (04:36 +0200)]
ext4: Correct block number handling, empty block vs. error code

read_allocated block may return block number 0, which is just an indicator
a chunk of the file is not backed by a block, i.e. it is sparse.

During file deletions, just continue with the next logical block, for other
operations treat blocknumber <= 0 as an error.

For writes, blocknumber 0 should never happen, as U-Boot always allocates
blocks for the whole file.  Reading already handles this correctly, i.e. the
read buffer is 0-fillled.

Not treating block 0 as sparse block leads to FS corruption, e.g.
./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ;
ext4write host 0 0 /2.5GB.file 1 '
The 2.5GB.file from the fs test is actually a sparse file.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoext4: remove duplicated block release code for extents
Stefan Brüns [Tue, 6 Sep 2016 02:36:54 +0000 (04:36 +0200)]
ext4: remove duplicated block release code for extents

The data blocks are identical for files using traditional direct/indirect
block allocation scheme and extent trees, thus this code part can be
common. Only the code to deallocate the indirect blocks to record the
used blocks has to be seperate, respectively the code to release extent
tree index blocks.

Actually the code to release the extent tree index blocks is still missing,
but at least add a FIXME at the appropriate place.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agoext4: initialize full inode for inodes bigger than 128 bytes
Stefan Brüns [Tue, 6 Sep 2016 02:36:53 +0000 (04:36 +0200)]
ext4: initialize full inode for inodes bigger than 128 bytes

Make sure the the extra_isize field (offset 128) is initialized to 0, to
mark any extra data as invalid.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: Use correct value for inode size even on revision 0 filesystems
Stefan Brüns [Tue, 6 Sep 2016 02:36:52 +0000 (04:36 +0200)]
ext4: Use correct value for inode size even on revision 0 filesystems

fs->inodesz is already correctly (i.e. dependent on fs revision)
initialized in ext4fs_mount.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: Fix memory leak in case of failure
Stefan Brüns [Tue, 6 Sep 2016 02:36:51 +0000 (04:36 +0200)]
ext4: Fix memory leak in case of failure

temp_ptr should always be freed, even if the function is left via
goto fail.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: Avoid out-of-bounds access of block bitmap
Stefan Brüns [Tue, 6 Sep 2016 02:36:50 +0000 (04:36 +0200)]
ext4: Avoid out-of-bounds access of block bitmap

If the blocksize is 1024, count is initialized with 1. Incrementing count
by 8 will never match (count == fs->blksz * 8), and ptr may be
incremented beyond the buffer end if the bitmap is filled. Add the
startblock offset after the loop.

Remove the second loop, as only the first iteration will be done.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: After completely filled group, scan next group from the beginning
Stefan Brüns [Tue, 6 Sep 2016 02:36:49 +0000 (04:36 +0200)]
ext4: After completely filled group, scan next group from the beginning

The last free block of a block group may be in its middle. After it has
been allocated, the next block group should be scanned from its beginning.

The following command triggers the bad behaviour (on a blocksize 1024 fs):

./sandbox/u-boot -c 'i=0; host bind 0 ./disk.raw ;
while test $i -lt 260 ; do echo $i; setexpr i $i + 1;
ext4write host 0:2 0 /X${i} 0x1450; done ;
ext4write host 0:2 0 /X240 0x2000 ; '

When 'X240' is extended from 5200 byte to 8192 byte, the new blocks should
start from the first free block (8811), but it uses the blocks 8098-8103
and 16296-16297 -- 8103 + 1 + 8192 = 16296. This can be shown with
debugfs, commands 'ffb' and 'stat X240'.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: Do not clear zalloc'ed buffers a second time
Stefan Brüns [Tue, 6 Sep 2016 02:36:48 +0000 (04:36 +0200)]
ext4: Do not clear zalloc'ed buffers a second time

zero_buffer is never written, thus clearing it is pointless.
journal_buffer is completely initialized by ext4fs_devread (or in case
of failure, not used).

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: Only update number of of unused inodes if GDT_CSUM feature is set
Stefan Brüns [Tue, 6 Sep 2016 02:36:47 +0000 (04:36 +0200)]
ext4: Only update number of of unused inodes if GDT_CSUM feature is set

e2fsck warns about "Group descriptor 0 marked uninitialized without
feature set."
The bg_itable_unused field is only defined if FEATURE_RO_COMPAT_GDT_CSUM
is set, and should be set (kept) zero otherwise.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: Scan all directory blocks when looking up an entry
Stefan Brüns [Tue, 6 Sep 2016 02:36:46 +0000 (04:36 +0200)]
ext4: Scan all directory blocks when looking up an entry

Scanning only the direct blocks of the directory file may falsely report
an existing file as nonexisting, and worse can also lead to creation
of a duplicate entry on file creation.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: Avoid corruption of directories with hash tree indexes
Stefan Brüns [Tue, 6 Sep 2016 02:36:45 +0000 (04:36 +0200)]
ext4: Avoid corruption of directories with hash tree indexes

While directories can be read using the old linear scan method, adding a
new file would require updating the index tree (alternatively, the whole
tree could be removed).

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: Scan all directory blocks for space when inserting a new entry
Stefan Brüns [Tue, 6 Sep 2016 02:36:44 +0000 (04:36 +0200)]
ext4: Scan all directory blocks for space when inserting a new entry

Previously, only the last directory block was scanned for available space.
Instead, scan all blocks back to front, and if no sufficient space is
found, eventually append a new block.
Blocks are only appended if the directory does not use extents or the new
block would require insertion of indirect blocks, as the old code does.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: Do not crash when trying to grow a directory using extents
Stefan Brüns [Tue, 6 Sep 2016 02:36:43 +0000 (04:36 +0200)]
ext4: Do not crash when trying to grow a directory using extents

The following command crashes u-boot:
./sandbox/u-boot -c 'i=0; host bind 0 ./sandbox/test/fs/3GB.ext4.img ;
  while test $i -lt 200 ; do echo $i; setexpr i $i + 1;
  ext4write host 0 0 /foobar${i} 0; done'

Previously, the code updated the direct_block even for extents, and
fortunately crashed before pushing garbage to the disk.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: propagate error if creation of directory entry fails
Stefan Brüns [Tue, 6 Sep 2016 02:36:42 +0000 (04:36 +0200)]
ext4: propagate error if creation of directory entry fails

In case the dir entry creation failed, ext4fs_write would later overwrite
a random inode, as inodeno was never initialized.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: fix possible crash on directory traversal, ignore deleted entries
Stefan Brüns [Tue, 6 Sep 2016 02:36:41 +0000 (04:36 +0200)]
ext4: fix possible crash on directory traversal, ignore deleted entries

The following command triggers a segfault in search_dir:
./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ;
    ext4write host 0 0 /./foo 0x10'

The following command triggers a segfault in check_filename:
./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ;
    ext4write host 0 0 /. 0x10'

"." is the first entry in the directory, thus previous_dir is NULL. The
whole previous_dir block in search_dir seems to be a bad copy from
check_filename(...). As the changed data is not written to disk, the
statement is mostly harmless, save the possible NULL-ptr reference.

Typically a file is unlinked by extending the direntlen of the previous
entry. If the entry is the first entry in the directory block, it is
invalidated by setting inode=0.

The inode==0 case is hard to trigger without crafted filesystems. It only
hits if the first entry in a directory block is deleted and later a lookup
for the entry (by name) is done.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agoext4: fix wrong usage of le32_to_cpu()
Michael Walle [Mon, 29 Aug 2016 08:46:46 +0000 (10:46 +0200)]
ext4: fix wrong usage of le32_to_cpu()

le32_to_cpu() must only convert the revision_level and not the boolean
result.

Signed-off-by: Michael Walle <michael@walle.cc>
8 years agoext4: fix endianess problems in ext4 write support
Michael Walle [Thu, 1 Sep 2016 09:21:40 +0000 (11:21 +0200)]
ext4: fix endianess problems in ext4 write support

All fields were accessed directly instead of using the proper byte swap
functions. Thus, ext4 write support was only usable on little-endian
architectures. Fix this.

Signed-off-by: Michael Walle <michael@walle.cc>
8 years agoext4: use kernel names for byte swaps
Michael Walle [Mon, 29 Aug 2016 08:46:44 +0000 (10:46 +0200)]
ext4: use kernel names for byte swaps

Instead of __{be,le}{16,32}_to_cpu use {be,le}{16,32}_to_cpu.

Signed-off-by: Michael Walle <michael@walle.cc>
8 years agoext4: change structure fields to __le/__be types
Michael Walle [Mon, 29 Aug 2016 08:46:43 +0000 (10:46 +0200)]
ext4: change structure fields to __le/__be types

Change all the types of ext2/4 fields to little endian types and all the
JBD fields to big endian types. Now we can use sparse (make C=1) to check
for statements where we need byteswaps.

Signed-off-by: Michael Walle <michael@walle.cc>
8 years agotest/fs: Check writes using "." (same dir) relative path
Stefan Brüns [Tue, 13 Sep 2016 23:01:31 +0000 (01:01 +0200)]
test/fs: Check writes using "." (same dir) relative path

<path>/<fname> and <path>/./<fname> should reference the same file.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agotest/fs: Check ext4 behaviour if dirent is first entry in directory block
Stefan Brüns [Tue, 13 Sep 2016 23:01:30 +0000 (01:01 +0200)]
test/fs: Check ext4 behaviour if dirent is first entry in directory block

This is a regression test for a crash happening if the first dirent
in the block matches. Code tried to access a predecessor entry which
does not exist.
The crash happened for any block, but "." is always the first entry in
the first directory block and thus easy to check for.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agotest/fs: strip noise from filesystem code prior to checking results
Stefan Brüns [Tue, 13 Sep 2016 23:01:29 +0000 (01:01 +0200)]
test/fs: strip noise from filesystem code prior to checking results

ext4 and fat code emit some diagnostic messages during command execution.
These additional lines force a match window size which strictly is not
necessary.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agotest/fs: remove use of undefined WRITE_FILE variable
Stefan Brüns [Tue, 13 Sep 2016 23:01:28 +0000 (01:01 +0200)]
test/fs: remove use of undefined WRITE_FILE variable

The write file is created from $SMALL_FILE by appending ".w" on all
other occurences in the code.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agotest/fs: Restructure file path specification to allow some flexibility
Stefan Brüns [Tue, 13 Sep 2016 23:01:27 +0000 (01:01 +0200)]
test/fs: Restructure file path specification to allow some flexibility

Instead of providing the full path, specify directory and filename
separately. This allows to specify intermediate directories, required
for some additional tests.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years agocmd/fat: Do not crash on write when <bytes> is not specified
Stefan Brüns [Sun, 11 Sep 2016 20:51:42 +0000 (22:51 +0200)]
cmd/fat: Do not crash on write when <bytes> is not specified

argc is checked, but is off by one. In case <bytes> is not specified,
create an empty file, which is identical to the ext4write behaviour.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agofs/fat: Correct description of determine_fatent function
Stefan Brüns [Sun, 11 Sep 2016 20:51:41 +0000 (22:51 +0200)]
fs/fat: Correct description of determine_fatent function

Current description does not match the function behaviour.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agofs/fat: Do not write unmodified fat entries to disk
Stefan Brüns [Sun, 11 Sep 2016 20:51:40 +0000 (22:51 +0200)]
fs/fat: Do not write unmodified fat entries to disk

The code caches 6 sectors of the FAT. On FAT traversal, the old contents
needs to be flushed to disk, but only if any FAT entries had been modified.
Explicitly flag the buffer on modification.

Currently, creating a new file traverses the whole FAT up to the first
free cluster and rewrites the on-disk blocks.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
8 years agofs/fat: Remove two statements without effect
Stefan Brüns [Sun, 11 Sep 2016 20:51:39 +0000 (22:51 +0200)]
fs/fat: Remove two statements without effect

fatlength is a local variable which is no more used after the assignment.
s_name is not used in the function, save the strncpy.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
8 years agoMerge git://git.denx.de/u-boot-rockchip
Tom Rini [Thu, 22 Sep 2016 20:51:19 +0000 (16:51 -0400)]
Merge git://git.denx.de/u-boot-rockchip

8 years agons16650: Make sure we have CONFIG_CLK set before using infrastructure
Tom Rini [Thu, 22 Sep 2016 19:36:45 +0000 (15:36 -0400)]
ns16650: Make sure we have CONFIG_CLK set before using infrastructure

We cannot call on the CONFIG_CLK based clk_get_rate function unless
CONFIG_CLK is set.

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-uniphier
Tom Rini [Thu, 22 Sep 2016 17:34:55 +0000 (13:34 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-uniphier

8 years agoARM: dts: uniphier: sync clock/reset controller nodes with Linux
Masahiro Yamada [Wed, 21 Sep 2016 22:42:23 +0000 (07:42 +0900)]
ARM: dts: uniphier: sync clock/reset controller nodes with Linux

Sync device trees with Linux for easier DT life.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoclk: uniphier: allow to have clock node under syscon node
Masahiro Yamada [Wed, 21 Sep 2016 22:42:22 +0000 (07:42 +0900)]
clk: uniphier: allow to have clock node under syscon node

To sync the DT binding with Linux, the register base must be taken
from the parent syscon node.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoclk: uniphier: move U_BOOT_DRIVER entry to core code
Masahiro Yamada [Wed, 21 Sep 2016 22:42:21 +0000 (07:42 +0900)]
clk: uniphier: move U_BOOT_DRIVER entry to core code

Move U_BOOT_DRIVER() entry from the data file (clk-uniphier-mio.c)
to the core support file (clk-uniphier-core.c) because I do not want
to repeat the driver boilerplate when I add more clock data.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>