Commit graph

14556 commits

Author SHA1 Message Date
Andrey Smirnov
8ba2db7646 e1000: Simplify EEPROM init for e1000_igb
That chip specifies read access uising EERD via use_eerd, which means
that none of the more "advanced" EEPROM parameters will be used for
reads, so remove them.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
7f7833ec83 e1000: Simplify EEPROM init for e1000_80003es2lan
That chip specifies read access uising EERD via use_eerd, which means
that none of the more "advanced" EEPROM parameters will be used for
reads, so remove them.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
b141814765 e1000: Remove 'page_size'
Remove 'page_size' from 'struct e1000_eeprom_info' since it is not
used anywhere in the code.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
920fc71094 e1000: Remove 'use_eewr' parameter
Remove 'use_eewr' from 'struct e1000_eeprom_info' since it is not used
anywhere in the code.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
ff6a64d42f e1000: Consolidate register offset fixups
Consolidate all code taking care on CSR offset differences for i210
chips into a single place in the driver and integrate that funcionality
into e1000_{read,write}_reg functions. This way we can get rid of all
those

    if (hw->mac_type == e1000_igb) {
       ....
    } else {
       ....
    }

snippets sprinkled all across the driver code.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
7477a1500a e1000: Remove unneeded i210 specific register code
Despite having EEC(EECD) and EERD at "non-standard" offsets i210
aliases those registers to be accesible via regular addresses so none
of the code removed by this commit is really necessary.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
3d68327587 e1000: Do not read same register twice
EEPROM_INIT_CONTROL2_REG is already read once before entering this
switch statement, so there's not much use in reading its value for the
second time.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
2ea081c242 e1000: Remove unnecessary variable
There doesn't seem to be any point for having 'nv_packet' variable and
it looks like a leftover from driving porting. Remove it and use
'txpacket' instead

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
a199e7b221 e1000: Fix a bug in e1000_detect_gig_phy
It seems there's stray exclamation mark character in
e1000_detect_gig_phy which renders the whole if statement useless
since it converts 'phy_type' into a boolean and comparing that to 0xFF
would always result in false (which GCC 5.1 is now able to detect and
warn about). This commit fixes that.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
940bd8bb25 e1000: Convert E1000_*_REG macros to functions
E1000_*_REG don't bring any value by being macros and implicit appending
of "E1000_" prefix to the constant name only makes thing harder to grep
or understand. Replace those macros with functions.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
ae4915ff38 e1000: Include <net.h> in e1000.h
That header(e1000.h) uses a number of definitions from net.h, so for it
to be self-contained it needs to include that file. This change also
allows remove includes of net.h from other files.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Andrey Smirnov
fcfd488cec e1000: Split driver into multiple files
The driver has a number of not very tightly coupled subsystems and at
4K+ lines e1000.c is getting rather hard to wrangle, so let's move
EEPROM handling code (very self contained susbsystem) into a separate
file and put all of the driver into a dedicated subdirectory.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:14:14 +02:00
Lucas Stach
3dae29d7d0 state: select CRC32
The raw state backend uses crc32 unconditionally, so make
sure it's present.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-03 09:07:38 +02:00
Lucas Stach
688c3035eb ARM: mba53: include barebox TQMa53 overlay DT
The barebox specific properties have not been applied as
the TQMa53 overlay DT has not been included. Fix this.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-01 09:28:09 +02:00
Uwe Kleine-König
17f77702e5 eeprom: at24: make device name setup more robust
With two eeproms that have a different compatible string (in my case
"at,24c64" and "at,24c32") dev->id is 0 for both which results in a
failure to bind the device that is probed later.

So pick a name more intelligently: If there is an alias defined in the
device tree, use this one, otherwise pick a free index.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-31 08:57:46 +02:00
Uwe Kleine-König
3982f4ad8a eeprom: at24: check return value of devfs_create and fix error path
if devfs_create failed because "eeprom0" already exists
of_parse_partitions must not be called, otherwise the already existing
eeprom gets assigned partitions that don't belog there.

Also free dummy clients in the error path and the write protect gpio
only if it is actually valid.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-31 08:57:46 +02:00
Uwe Kleine-König
a20a3cb4cd eeprom: at25: check return value of devfs_create
Also only emit the message that the device was probed when it
actually was.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-31 08:57:46 +02:00
Alexander Shiyan
3f374304ad pinctrl: iomux-v3: Cleaning SION patch before applying
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-31 08:23:45 +02:00
Alexander Shiyan
fd5f9fc3ab MCI: imx-esdhc: Allow to use 1-bit bus width in board files
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-31 08:23:45 +02:00
Trent Piepho
24fcf5fcee rtc: ds1307: Add support for configuring external clock pin
The DS1307 has a square wave output pin, which can be used to output a
clock signal from the DS1307.  Additionally, the DS1308 supports
configuring this pin as an input from an external clock source to
which it should sync itself.

Add support with OF device tree properties to configure these
settings.  Supported features are using the clock pin as an output, an
input, the rate of the pin, and if it should be enabled on battery
backup power.

The driver does not check that the selected features are supported by
the clock chip being used.  It is the designer's responsibility to
create a valid device tree node; the bootloader does not attempt to be
a device tree validator.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-30 07:12:19 +02:00
Juergen Borleis
9d79a962d0 PPC/MPC5200: enable a useful command by default
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-30 07:07:48 +02:00
Juergen Borleis
ad955eab6d PPC/MPC5XXX/reginfo: fix a bunch of compiler warnings
This change fixes a bunch of compiler warnings of this type:

arch/ppc/mach-mpc5xxx/reginfo.c: In function 'reginfo':
arch/ppc/mach-mpc5xxx/reginfo.c:14:3: warning: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'ulong' [-Wformat=]
   (*(volatile ulong*)MPC5XXX_ADDECR & 0x00010000) ? 1 : 0);
   ^

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-30 07:07:48 +02:00
Juergen Borleis
a72a1ae90a PPC: clean compiler warning
This change fixes the following compiler warning:

arch/ppc/mach-mpc5xxx/cpu.c: In function 'restart_register_feature':
arch/ppc/mach-mpc5xxx/cpu.c:81:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-30 07:07:48 +02:00
Juergen Borleis
a23eb47bf2 PPC: fix size optimisation
Since patch e92abad363 the linker discards sections which seems not
used to make the image smaller.
But this change will discard the whole init and exception code from start.S
which renders the final image useless.

From 'barebox.map' without this patch:

Discarded input sections
 .text          0x0000000000000000     0x358c arch/ppc/mach-mpc5xxx/start.o
 .data          0x0000000000000000        0x0 arch/ppc/mach-mpc5xxx/start.o
 .bss           0x0000000000000000        0x0 arch/ppc/mach-mpc5xxx/start.o
 .got2          0x0000000000000000       0x24 arch/ppc/mach-mpc5xxx/start.o
[...]

So, define the entry point to mark the init and exception used.

From 'barebox.map' with this patch applied:

Discarded input sections
 .data          0x0000000000000000        0x0 arch/ppc/mach-mpc5xxx/start.o
 .bss           0x0000000000000000        0x0 arch/ppc/mach-mpc5xxx/start.o
[...]

Note: tested on MPC5200 at run time, for MPC85XX compile time only

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-30 07:07:48 +02:00
Lucas Stach
0974830c3e common: select dependencies for defaultenv-2
Now that GLOBALVAR and NVVAR are user visible options they need
to be selected when selecting the global and nv command support
which uses them.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-30 07:03:33 +02:00
Lucas Stach
ef7b17a2a1 nvvar: add missing static inline stubs
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-30 07:02:14 +02:00
Lucas Stach
8e5e3965bd globalvar: add missing static inline stubs
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-30 07:02:14 +02:00
Teresa Remmet
31edb3f16d mtd: UBI: Remove ubi_free_fastmap
Freeing the fastmap is now done by ubi_fastmap_close() from kernel.
No need to keep the barebox own fastmap free function.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger
58eb46f7cb ubi: Fix out of bounds write in volume update code
ubi_start_leb_change() allocates too few bytes.
ubi_more_leb_change_data() will write up to req->upd_bytes +
ubi->min_io_size bytes.

Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Sebastian Siewior
7027011106 mtd: ubi: wl: avoid erasing a PEB which is empty
wear_leveling_worker() currently unconditionally puts a PEB on erase in
the error case even it just been taken from the free_list and never
used.
In case the PEB was never used it can be put back on the free list
saving a precious erase cycle.

v1…v2:
	- to_leb_clean -> dst_leb_clean
	- use the nested option for ensure_wear_leveling()
	- do_sync_erase() can't go -ENOMEM so we can just go into
	  RO-mode now.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Sebastian Siewior
c5576d8a3a mtd: ubi: don't leak e if schedule_erase() fails
If __erase_worker() fails to erase the EB and schedule_erase() fails as
well to do anything about it then we go RO. But that is not a reason to
leak the e argument here. Therefore clean up e.

Cc: <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Sebastian Siewior
6c5c4a4171 mtd: ubi: fixup error correction in do_sync_erase()
Since fastmap we gained do_sync_erase(). This function can return an error
and its error handling isn't obvious. First the memory allocation for
struct ubi_work can fail and as such struct ubi_wl_entry is leaked.
However if the memory allocation succeeds then the tail function takes
care of the struct ubi_wl_entry. A free here could result in a double
free.
To make the error handling simpler, I split the tail function into one
piece which does the work and another which frees the struct ubi_work
which is passed as argument. As result do_sync_erase() can keep the
struct on stack and we get rid of one error source.

Cc: <stable@vger.kernel.org>
Fixes: 8199b901a ("UBI: Add fastmap support to the WL sub-system")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>

Conflicts:
	drivers/mtd/ubi/wl.c

Fixed conflicts.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Brian Norris
2dace81b53 UBI: fix use of "VID" vs. "EC" in header self-check
Looks like a typo, using UBI_EC_HDR_SIZE_CRC (note the "EC") to compute
the CRC for the VID header.

This shouldn't cause any functional change, as both structures are 64
bytes. Verified with:

	BUILD_BUG_ON(UBI_VID_HDR_SIZE_CRC != UBI_EC_HDR_SIZE_CRC);

Reported here:
http://lists.infradead.org/pipermail/linux-mtd/2013-September/048570.html

Reported by: Bill Pringlemeir <bpringlemeir@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Ezequiel García
6cf1f78230 UBI: Fastmap: Fix PEB array type
The PEB array is an array of __be32, so let's fix the
scan_pool() prototype accordingly.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Richard Weinberger <richard@nod.at>

Conflicts:
	drivers/mtd/ubi/fastmap.c

Fixed minor conflict.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger
2926770741 UBI: Fix debug message
We have to use j instead of i. i is the volume id
and not the block.

Reported-by: Alexander.Block@continental-corporation.com
Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger
3ff2991446 UBI: Fix typo in comment
While we are here fix a s/beween/between typo.

Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger
da0647f244 UBI: Fastmap: Simplify expression
There is no need to compute pnum again.

Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
shengyong
14cd478b83 UBI: return ENOSPC if no enough space available
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI error: init_volumes: not enough PEBs, required 706, available 686
UBI error: ubi_wl_init: no enough physical eraseblocks (-20, need 1)
UBI error: ubi_attach_mtd_dev: failed to attach mtd1, error -12 <= NOT ENOMEM
UBI error: ubi_init: cannot attach mtd1

If available PEBs are not enough when initializing volumes, return -ENOSPC
directly. If available PEBs are not enough when initializing WL, return
-ENOSPC instead of -ENOMEM.

Cc: stable@vger.kernel.org
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: David Gstir <david@sigma-star.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger
2258208ae2 UBI: Validate data_size
Make sure that data_size is less than LEB size.
Otherwise a handcrafted UBI image is able to trigger
an out of bounds memory access in ubi_compare_lebs().

Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: David Gstir <david@sigma-star.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
shengyong
35fd94ee95 UBI: Remove unnecessary `\'
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
shengyong
1a61f0591d UBI: add a helper function for updatting on-flash layout volumes
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
shengyong
794d45b116 UBI: Fastmap: Do not add vol if it already exists
During fastmap attaching, check if a volume already exists when adding
the volume to volume tree. NOTE that the issue cannot happen, only if
the on-flash fastmap data is modified.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
shengyong
78ae01bf2b UBI: Init vol->reserved_pebs by assignment
`vol' is a newly allocated value by kzalloc. Initialize it by assignment
instead of `+='.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
shengyong
c59fb39da3 UBI: Fastmap: Rename variables to make them meaningful
s/fmpl1/fmpl
s/fmpl2/fmpl_wl

Add "WL" to the error message when wrong WL pool magic number is detected.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

Conflicts:
	drivers/mtd/ubi/fastmap.c

Fixed minor conflict.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
shengyong
7780097495 UBI: Fastmap: Remove unnecessary `\'
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
shengyong
2b0f3ccda3 UBI: Fastmap: Use max() to get the larger value
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger
787b429414 UBI: Fastmap: Fall back to scanning mode after ECC error
If we encounter an uncorrectable ECC error while scanning for the fastmap
UBI must not fail hard. Instead fall back to scanning mode.

Reported-by: Alexander Block <Alexander.Block@continental-corporation.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

Conflicts:
	drivers/mtd/ubi/attach.c

Fixed minor conflict.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger
0aaf425c29 UBI: Fastmap: Remove is_fm_block()
This function was added to fastmap in a very early stage
to have paranoid assertions.
With the current fastmap implementation this assert will never
trigger as fastmap PEBs are not seen by the WL sub-system.
Remove it to save us some CPU cycles.

Signed-off-by: Richard Weinberger <richard@nod.at>

Conflicts:
	drivers/mtd/ubi/fastmap-wl.c

Fixed minor conflict.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger
2fb14ff615 UBI: Fastmap: Introduce may_reserve_for_fm()
...and kill another #ifdef.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00
Richard Weinberger
eb21c4f4a7 UBI: Fastmap: Introduce ubi_fastmap_init()
...and kill another #ifdef in wl.c. :-)

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-27 12:30:27 +02:00