summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* nvvar: add missing static inline stubsLucas Stach2016-05-301-0/+12
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: add missing static inline stubsLucas Stach2016-05-301-0/+4
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ubiformat'Sascha Hauer2016-05-091-0/+23
|\
| * commands: ubiformat: move code to common/Sascha Hauer2016-04-261-0/+23
| | | | | | | | | | | | | | This is the final step to separate the ubiformat code from the command. With this the ubiformat code gains a C API. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/pci'Sascha Hauer2016-05-092-0/+49
|\ \
| * | PCI: imx6: Add proper i.MX6+ reset sequenceAndrey Smirnov2016-04-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I.MX6+ version of the silicon exposed PCIe core's reset signal as a bit in one of the control registers. As a result using old, pre-i.MX6+, reset sequence on i.MX6+ leads to Barebox hanging during startup. Using exposed reset bit instead solves the problem. This commit is based on portions of commit c34068d48273e24d392d9a49a38be807954420ed in http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Acked-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: Port of_match_device() and of_device_get_match_data()Andrey Smirnov2016-04-281-0/+48
| |/ | | | | | | | | | | | | | | | | Port of_match_device() and of_device_get_match_data() from Linux kernel code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Acked-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-05-098-13/+11
|\ \
| * | net: phy: Add fixed link supportSascha Hauer2016-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some network devices, especially when connected to a switch, are connected via a fixed link. This patch adds support for a fixed phy configured through device tree. TODO: Add support for the "speed" and "full-duplex" properties. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com>
| * | whole tree: remove trailing whitespacesDu Huanpeng2016-04-214-6/+6
| | | | | | | | | | | | | | | Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | wchar_t: wchar_t should go to stddef.hDu Huanpeng2016-04-142-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | according to C99 standard, the definition of wchar_t should go stddef.h this patch also remove wchar_t local definition and use stddef.h instead. Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | NULL: keep NULL definition in stddef.h onlyDu Huanpeng2016-04-141-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove other local definition of NULL, use #include <linux/stddef.h> instead. I use this command to search NULL definition, grep -R "define\s*\<NULL\>" hope there are no more definition of NULL. from ISO/IEC 9899:TC3: The macros are NULL which expands to an implementation-defined null pointer constant; Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/include-pdata'Sascha Hauer2016-05-099-0/+0
|\ \ \
| * | | include: Move ide platform_data to include/platform_dataSascha Hauer2016-04-151-0/+0
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: Move smc911x eth platform_data to include/platform_dataSascha Hauer2016-04-151-0/+0
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: Move dm9000 eth platform_data to include/platform_dataSascha Hauer2016-04-151-0/+0
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: Move ns16550 serial platform_data to include/platform_dataSascha Hauer2016-04-151-0/+0
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: Move fec eth platform_data to include/platform_dataSascha Hauer2016-04-151-0/+0
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: Move davinci emac platform_data to include/platform_dataSascha Hauer2016-04-151-0/+0
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: Move designware eth platform_data to include/platform_dataSascha Hauer2016-04-151-0/+0
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: Move smc91111 eth platform_data to include/platform_dataSascha Hauer2016-04-151-0/+0
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: Move ep93xx eth platform_data to include/platform_dataSascha Hauer2016-04-151-0/+0
| |/ / | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/include-cleanup'Sascha Hauer2016-05-0915-299/+135
|\ \ \
| * | | stdio: Whitespace cleanupSascha Hauer2016-04-151-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | Replace the tabs with spaces before the function names. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | stdio: Replace FILE functions with filedescriptor functionsSascha Hauer2016-04-151-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have defined stdin, stdout and stderr as integer file descriptors, but normally they should be FILE *. Also fprintf, fputc and fputs take file descriptors instead of FILE *. As FILE * are inconvenient in the barebox environment replace the f* functions with the corresponding d* functions. dprintf is POSIX conform whereas dputc and dputs are barebox specific, but do not conflict with any stdc function. fgetc is unused and can be removed without replacing it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | stdio: replace fprintf(stderr,...) with eprintfSascha Hauer2016-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a shortcut for fprintf(stderr, so use it. This is done to be able to remove fprintf in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | stdio: rename getc to getcharSascha Hauer2016-04-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function we have implemented as getc has the semantics of the standard function getchar, so rename it accorgingly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: move libc function prototypes to their correct locationsSascha Hauer2016-04-157-140/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the function prototypes in include/fs.h which also exist in the libc to the locations they would have in libc. With this it becomes easier to share code between barebox and userspace since the usual libc include files will exist. Also users of the libc functions no longer have to include the barebox internal fs.h header. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | move unlink_recursive declaration to libfile.hSascha Hauer2016-04-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | unlink_recursive is a file utility function, so move the prototype to libfile.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | move make_directory declaration to libfile.hSascha Hauer2016-04-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As a utility function for file handling make_directory() is well suited for libfile. Move it there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | string: Fix (v)asprintf prototypesSascha Hauer2016-04-152-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | libfile: move open_and_lseek() to libfileSascha Hauer2016-04-152-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | libfile is a collection of helpers for handling files. open_and_lseek() is a perfect match for this, so move it there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: move crc specific stuff to crc.hSascha Hauer2016-04-152-100/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a crc.h, so move our crc function prototypes there to further cleanup common.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: move shell prototypes to shell.hSascha Hauer2016-04-152-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | We have a shell,h, so move shell specific prototypes there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include/common.h: remove unused struct memarea_infoSascha Hauer2016-04-151-10/+0
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: move run_command prototype to command.hSascha Hauer2016-04-152-1/+1
| |/ / | | | | | | | | | | | | | | | run_command fits much better into command.h, move it there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | bootm: Optionally add a root= option to Kernel command lineSascha Hauer2016-05-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | It becomes a common case that the Kernel is loaded from the filesystem which later becomes the rootfs. This adds a possibility to let bootm automatically append the root= option to the kernel command line. This is done when global.bootm.appendroot is true. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | string: Introduce strtoboolSascha Hauer2016-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have at least two places which convert a string to a boolean type, so create a common function for this. strtobool treats - any positive (nonzero) number as true - "0" as false - "true" (case insensitive) as true - "false" (case insensitive) as false Every other value results in an error and the input *val is not modified. The caller is expected to initialize *val with the correct default before calling strtobool. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | globalvar: Allow to remove globalvarsSascha Hauer2016-04-291-0/+1
| |/ |/| | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fix erasing/protecting flashes with unspecified sizeSascha Hauer2016-04-191-0/+1
|/ | | | | | | | | | | | | | | | | fixes: 81737c1 mtd: Fix erasing of devices >4GiB Several places erased a complete flash partition passing ~0 as count to erase(). With the above commit count to erase was changed from an unsigned type to a signed type, so the (count > f->size - offset) check in erase() no longer triggers and the ~0 count is no longer adjusted to the whole device size. Among other things this results in saveenv failures on NOR flashes. This patch fixes this by introducing an explicit macro for erasing the whole device which is tested for in erase(). All other negative values are rejected. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Giorgio <giorgio.nicole@arcor.de>
* Merge branch 'for-next/ubifs'Sascha Hauer2016-04-0812-122/+788
|\
| * ubifs: update implementation from u-boot v2016.03Alexander Stein2016-04-081-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updated code supports recovering from unclean unmounts when write buffer size is larger than 8. Linux uses takes information into consideration when checking for writes. The following list shows the changes for each file done compared to u-boot v2016.03 code. Makefile * Add gc.o, do not include header as in u-boot budget.c: * Replace __UBOOT__ with __BAREBOX__ debug.c: * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> * Replace current->pid with 0 debug.h * Replace __UBOOT__ with __BAREBOX__ * Add "0 &&" to ubifs_assert condition check U-Boot essentially disabled pr_crit output and dump_stack() is defined to do { } while (0), so ubifs_assert does nothing despite condition. gc.c: * Replace __UBOOT__ with __BAREBOX__ io.c: * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> key.h: * No changes log.c: * No changes lprops.c: * Replace __UBOOT__ with __BAREBOX__ lpt.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> * Remove #include <ubi_uboot.h> lpt_commit.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> master.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> * Remove #include <ubi_uboot.h> misc.h * Replace __UBOOT__ with __BAREBOX__ * Add #ifndef __BAREBOX__ around unneeded ubifs_current_time orphan.c * No changes recovery.c * Replace __UBOOT__ with __BAREBOX__ replay.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> sb.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> * Remove #include <ubi_uboot.h> * rp_uid and rp_gid are still uid_t, not kuid_t, so remove .val scan.c * Replace __UBOOT__ with __BAREBOX__ super.c: * Replaced current->pid with 0 * Replaced __UBOOT__ with __BAREBOX__ * Removed #include <ubi_uboot.h> * Removed #include <memalign.h> * Added #include <init.h> * Replaced malloc_cache_aligned with kzalloc * Replaced I_LOCK with I_SYNC * i_uid and i_gid are still uid_t, not kuid_t, so remove .val * Replaced string "U-Boot" with "Barebox" * Add #ifndef __BAREBOX__ around open_ubi, sb_test, sb_set, ubifs_mount, kill_ubifs_super, ubifs_fs_type * Do not call ubi_open_volume or ubi_close_volume in ubifs_fill_super Those will already be handled in ubifs_probe * Replaced uboot_ubifs_mount with new ubifs_get_super implementation using existing functions alloc_super, alloc_ubifs_info tnc.c * Replace __UBOOT__ with __BAREBOX__ * Remove #include <linux/compat.h> tnc_misc.c * Replace __UBOOT__ with __BAREBOX__ ubifs-media.h * Replace __UBOOT__ with __BAREBOX__ ubifs.c: * Replaced __UBOOT__ with __BAREBOX__ * Adjusted header includes * Removed DECLARE_GLOBAL_DATA_PTR * Add static struct z_stream_s variable * Add struct ubifs_priv delcaration * Replaced zunzip with deflate_decompress call * Add ifdef for disabling ZLIB and/or LZO support * Replaced malloc_cache_aligned with kzalloc * Added #ifndef __BAREBOX__ around filldir, ubifs_printdir, ubifs_set_blk_dev, ubifs_ls, ubifs_exists, ubifs_size, do_readpage, ubifs_read, ubifs_close, ubifs_load * Make parameter filename const char* in ubifs_findfile * Add UBIFS fs_driver_d implementation * Add zlib_decomp_init, ubifs_init ubifs.h: * Replaced __UBOOT__ with __BAREBOX__ * Adjusted header includes * Added old #define crc32 * Added helper around kmem* * Added XATTR_LIST_MAX define * Added #ifndef __BAREBOX__ around current_fs_time struct inode, struct super_block, file_system_type, dentry and friends which barebox already has * Added #ifndef __BAREBOX__ around write_inode in super_operations to avoid declaration of writeback_control * Change rp_uid and rp_gid to uid_t and gui_t * Added struct device_d to struct ubifs_info * Added forward declaration of ubifs_get_super linux/fs.h: * Make struct inode's i_nlink a union containing a non-const int __i_nlink while making i_nlink a const int linux/fs.h: * Add s_remove_count linux/fs.h: * Convert struct super_block.s_instances and struct file_system_type.fs_supers to hlist_head Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * barebox-wrapper: Add kcalloc and __vmallocAlexander Stein2016-04-081-0/+2
| | | | | | | | | | | | | | They call xzalloc and malloc respectively. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * barebox-wrapper: Implement kfree and vfree as static inline functionsAlexander Stein2016-04-081-2/+9
| | | | | | | | | | | | | | | | | | If kfree/vfree is called where free is a already variable name, code will not compile. Also both take a const* in Linux kernel code. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Move GFP_NOFS to barebox-wrapperAlexander Stein2016-04-081-1/+2
| | | | | | | | | | | | | | This will also be used by upcoming UBIFS update. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: Add atomic.h from u-boot v2016.03Alexander Stein2016-04-081-0/+260
| | | | | | | | | | | | | | | | atomic-long.h: * Replace __UBOOT__ with __BAREBOX__ Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * module.h: Add THIS_MODULEAlexander Stein2016-04-081-0/+1
| | | | | | | | | | | | | | This is required by upcoming UBIFS update. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * compiler*.h: include/linux/compiler*.h with Linux 4.5Alexander Stein2016-04-083-4/+203
| | | | | | | | | | | | | | | | | | Include <linux/types.h> instead of uapi/linux/types.h. This is required for READ_ONCE and WRITE_ONCE for upcoming atomic_t. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * printk: Add pr_contAlexander Stein2016-04-081-0/+1
| | | | | | | | | | | | | | This is needed by upcoming UBIFS update. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Add list_sort from u-boot v2016.03Alexander Stein2016-04-081-0/+11
| | | | | | | | | | | | | | This is required by UBIFS update. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>