summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.mailmap5
-rw-r--r--Documentation/user/booting-linux.rst13
-rw-r--r--arch/arm/mach-tegra/include/mach/lowlevel.h4
-rw-r--r--arch/mips/include/asm/debug_ll_ns16550.h2
-rw-r--r--arch/mips/mach-ath79/include/mach/debug_ll.h4
-rw-r--r--commands/ubiformat.c2
-rw-r--r--common/console_common.c14
-rw-r--r--common/startup.c28
-rw-r--r--common/tlsfbits.h6
-rw-r--r--crypto/crc16.c2
-rw-r--r--crypto/digest.c10
-rw-r--r--drivers/i2c/i2c.c2
-rw-r--r--drivers/mtd/core.c2
-rw-r--r--drivers/mtd/nand/nand-bb.c4
-rw-r--r--drivers/mtd/nor/cfi_flash.h12
-rw-r--r--drivers/of/fdt.c1
-rw-r--r--drivers/serial/serial_ar933x.c4
-rw-r--r--drivers/spi/ath79_spi.c4
-rw-r--r--fs/fs.c13
-rw-r--r--include/asm-generic/barebox.lds.h4
-rw-r--r--include/crc.h2
-rw-r--r--include/digest.h10
-rw-r--r--include/init.h2
-rw-r--r--include/io.h8
-rw-r--r--include/watchdog.h17
-rw-r--r--lib/xfuncs.c4
26 files changed, 105 insertions, 74 deletions
diff --git a/.mailmap b/.mailmap
index 09ecaebde6..82631b2846 100644
--- a/.mailmap
+++ b/.mailmap
@@ -13,6 +13,11 @@ Eric Bénard <eric@eukrea.com>
Franck Jullien <franck.jullien@gmail.com>
Jin Zhengxiong <Jason.Jin@freescale.com>
Juergen Borleis <jbe@pengutronix.de>
+Juergen Borleis <j.beisert@pengutronix.de>
+Juergen Borleis <jbe@isonoe.(none)>
+Juergen Borleis <jbe@kreuzholzen.de>
+Juergen Borleis <jbe@octopus.labnet.pengutronix.de>
+Juergen Borleis <juergen@kreuzholzen.de>
Marc Reilly <marc@cpdesign.com.au>
Nishanth Menon <x0nishan@ti.com>
Raphaël Poggi <poggi.raph@gmail.com>
diff --git a/Documentation/user/booting-linux.rst b/Documentation/user/booting-linux.rst
index ac44cbad62..6e7d1550bf 100644
--- a/Documentation/user/booting-linux.rst
+++ b/Documentation/user/booting-linux.rst
@@ -55,12 +55,13 @@ to free the internal devicetree before calling ``bootm``
Passing Kernel Arguments
^^^^^^^^^^^^^^^^^^^^^^^^
-Depending on the barebox configuration (``CONFIG_FLEXIBLE_BOOTARGS``) there
-are to ways to pass bootargs to the Kernel. With ``CONFIG_FLEXIBLE_BOOTARGS``
-disabled the bootm command takes the bootargs from the ``bootargs`` environment
-variable. With ``CONFIG_FLEXIBLE_BOOTARGS`` enabled the bootargs are composed
-from different :ref:`global_device` variables. All variables beginning with
-``global.linux.bootargs.`` will be concatenated to the bootargs:
+The simple method to pass bootargs to the kernel is with
+``CONFIG_FLEXIBLE_BOOTARGS`` disabled: in this case the bootm command
+takes the bootargs from the ``bootargs`` environment variable.
+
+With ``CONFIG_FLEXIBLE_BOOTARGS`` enabled, the bootargs are composed
+from different :ref:`global device<global_device>` variables. All variables beginning
+with ``global.linux.bootargs.`` will be concatenated to the bootargs:
.. code-block:: sh
diff --git a/arch/arm/mach-tegra/include/mach/lowlevel.h b/arch/arm/mach-tegra/include/mach/lowlevel.h
index f1fea86cf6..768b13d968 100644
--- a/arch/arm/mach-tegra/include/mach/lowlevel.h
+++ b/arch/arm/mach-tegra/include/mach/lowlevel.h
@@ -111,9 +111,9 @@ u32 tegra_get_odmdata(void)
return 0;
}
- bctptr = cpu_readl(TEGRA_IRAM_BASE + bctptr_offset);
+ bctptr = __raw_readl(TEGRA_IRAM_BASE + bctptr_offset);
- return cpu_readl(bctptr + odmdata_offset);
+ return __raw_readl(bctptr + odmdata_offset);
}
static __always_inline
diff --git a/arch/mips/include/asm/debug_ll_ns16550.h b/arch/mips/include/asm/debug_ll_ns16550.h
index a3e1c52f63..4a6562f7c1 100644
--- a/arch/mips/include/asm/debug_ll_ns16550.h
+++ b/arch/mips/include/asm/debug_ll_ns16550.h
@@ -57,7 +57,7 @@
#include <asm/io.h>
-static __inline__ void PUTC_LL(char ch)
+static inline void PUTC_LL(char ch)
{
#ifdef CONFIG_DEBUG_LL
while (!(__raw_readb((u8 *)DEBUG_LL_UART_ADDR + UART_LSR) & UART_LSR_THRE))
diff --git a/arch/mips/mach-ath79/include/mach/debug_ll.h b/arch/mips/mach-ath79/include/mach/debug_ll.h
index c697318488..64db67499c 100644
--- a/arch/mips/mach-ath79/include/mach/debug_ll.h
+++ b/arch/mips/mach-ath79/include/mach/debug_ll.h
@@ -41,12 +41,12 @@
static inline void ar933x_debug_ll_writel(u32 b, int offset)
{
- cpu_writel(b, (u8 *)DEBUG_LL_UART_ADDR + offset);
+ __raw_writel(b, (u8 *)DEBUG_LL_UART_ADDR + offset);
}
static inline u32 ar933x_debug_ll_readl(int offset)
{
- return cpu_readl((u8 *)DEBUG_LL_UART_ADDR + offset);
+ return __raw_readl((u8 *)DEBUG_LL_UART_ADDR + offset);
}
static inline void PUTC_LL(int ch)
diff --git a/commands/ubiformat.c b/commands/ubiformat.c
index df0b801da9..e63f16e351 100644
--- a/commands/ubiformat.c
+++ b/commands/ubiformat.c
@@ -84,7 +84,7 @@ static int parse_opt(int argc, char *argv[])
int key;
unsigned long int image_seq;
- key = getopt(argc, argv, "nyyqve:x:s:O:f:S:");
+ key = getopt(argc, argv, "nyqve:x:s:O:f:S:Q:");
if (key == -1)
break;
diff --git a/common/console_common.c b/common/console_common.c
index 1e362ab4e4..2c82c6fd46 100644
--- a/common/console_common.c
+++ b/common/console_common.c
@@ -106,15 +106,23 @@ static void pr_puts(int level, const char *str)
log_clean(barebox_log_max_messages - 1);
if (barebox_log_max_messages >= 0) {
- log = xzalloc(sizeof(*log));
- log->msg = xstrdup(str);
+ log = malloc(sizeof(*log));
+ if (!log)
+ goto nolog;
+
+ log->msg = strdup(str);
+ if (!log->msg) {
+ free(log);
+ goto nolog;
+ }
+
log->timestamp = get_time_ns();
log->level = level;
list_add_tail(&log->list, &barebox_logbuf);
barebox_logbuf_num_messages++;
}
}
-
+nolog:
if (level > barebox_loglevel)
return;
diff --git a/common/startup.c b/common/startup.c
index e59b06d533..6178fc5353 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -62,6 +62,24 @@ static int mount_root(void)
fs_initcall(mount_root);
#endif
+#ifdef CONFIG_ENV_HANDLING
+static int load_environment(void)
+{
+ const char *default_environment_path;
+
+ default_environment_path = default_environment_path_get();
+
+ if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT))
+ defaultenv_load("/env", 0);
+
+ envfs_load(default_environment_path, "/env", 0);
+ nvvar_load();
+
+ return 0;
+}
+environment_initcall(load_environment);
+#endif
+
int (*barebox_main)(void);
void __noreturn start_barebox(void)
@@ -84,16 +102,6 @@ void __noreturn start_barebox(void)
pr_debug("initcalls done\n");
- if (IS_ENABLED(CONFIG_ENV_HANDLING)) {
- char *default_environment_path = default_environment_path_get();
-
- if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT))
- defaultenv_load("/env", 0);
-
- envfs_load(default_environment_path, "/env", 0);
- nvvar_load();
- }
-
if (IS_ENABLED(CONFIG_COMMAND_SUPPORT)) {
pr_info("running /env/bin/init...\n");
diff --git a/common/tlsfbits.h b/common/tlsfbits.h
index 93466e46a8..edbac80636 100644
--- a/common/tlsfbits.h
+++ b/common/tlsfbits.h
@@ -3,6 +3,10 @@
#include <linux/bitops.h>
+#ifdef CONFIG_64BIT
+#define TLSF_64BIT
+#endif
+
/*
** Architecture-specific bit manipulation routines.
**
@@ -33,7 +37,7 @@ static int tlsf_fls(unsigned int word)
/* Possibly 64-bit version of tlsf_fls. */
#if defined (TLSF_64BIT)
-tlsf_decl int tlsf_fls_sizet(size_t size)
+static int tlsf_fls_sizet(size_t size)
{
int high = (int)(size >> 32);
int bits = 0;
diff --git a/crypto/crc16.c b/crypto/crc16.c
index d22b656379..0b08e9ccde 100644
--- a/crypto/crc16.c
+++ b/crypto/crc16.c
@@ -90,7 +90,7 @@ static const uint16_t crc16_tab[] = {
};
uint16_t
-cyg_crc16(unsigned char *buf, int len)
+cyg_crc16(const unsigned char *buf, int len)
{
int i;
uint16_t cksum;
diff --git a/crypto/digest.c b/crypto/digest.c
index b3f514c8ad..a90e4ff79f 100644
--- a/crypto/digest.c
+++ b/crypto/digest.c
@@ -172,7 +172,7 @@ EXPORT_SYMBOL_GPL(digest_free);
int digest_file_window(struct digest *d, const char *filename,
unsigned char *hash,
- unsigned char *sig,
+ const unsigned char *sig,
ulong start, ulong size)
{
ulong len = 0;
@@ -249,8 +249,8 @@ out:
EXPORT_SYMBOL_GPL(digest_file_window);
int digest_file(struct digest *d, const char *filename,
- unsigned char *hash,
- unsigned char *sig)
+ unsigned char *hash,
+ const unsigned char *sig)
{
struct stat st;
int ret;
@@ -265,8 +265,8 @@ int digest_file(struct digest *d, const char *filename,
EXPORT_SYMBOL_GPL(digest_file);
int digest_file_by_name(const char *algo, const char *filename,
- unsigned char *hash,
- unsigned char *sig)
+ unsigned char *hash,
+ const unsigned char *sig)
{
struct digest *d;
int ret;
diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index 7a6bde0f67..5d0fa06bb5 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -183,7 +183,7 @@ int i2c_read_reg(struct i2c_client *client, u32 addr, u8 *buf, u16 count)
msg->len = i;
status = i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg));
- dev_dbg(&client->dev, "%s: %zu@%u --> %d\n", __func__,
+ dev_dbg(&client->dev, "%s: %u@%u --> %d\n", __func__,
count, addr, status);
if (status == ARRAY_SIZE(msg))
diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 1755e7680f..681dc9313c 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -191,7 +191,7 @@ static int mtd_op_erase(struct cdev *cdev, size_t count, loff_t offset)
return 0;
}
-static ssize_t mtd_op_protect(struct cdev *cdev, size_t count, loff_t offset, int prot)
+static int mtd_op_protect(struct cdev *cdev, size_t count, loff_t offset, int prot)
{
struct mtd_info *mtd = cdev->priv;
diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c
index 539c685482..8e4600ab03 100644
--- a/drivers/mtd/nand/nand-bb.c
+++ b/drivers/mtd/nand/nand-bb.c
@@ -54,7 +54,7 @@ static ssize_t nand_bb_read(struct cdev *cdev, void *buf, size_t count,
size_t retlen;
int ret, bytes = 0, now;
- debug("%s offset: 0x%08llx (raw: 0x%08llx) count: 0x%08x\n",
+ debug("%s offset: 0x%08llx (raw: 0x%08llx) count: 0x%08zx\n",
__func__, offset, bb->offset, count);
while (count) {
@@ -132,7 +132,7 @@ static ssize_t nand_bb_write(struct cdev *cdev, const void *buf, size_t count,
struct nand_bb *bb = cdev->priv;
int bytes = count, now, wroffs, ret;
- debug("%s offset: 0x%08llx (raw: 0x%08llx) count: 0x%08x\n",
+ debug("%s offset: 0x%08llx (raw: 0x%08llx) count: 0x%08zx\n",
__func__, offset, bb->offset, count);
while (count) {
diff --git a/drivers/mtd/nor/cfi_flash.h b/drivers/mtd/nor/cfi_flash.h
index 9aad5c41f6..aeaf751aba 100644
--- a/drivers/mtd/nor/cfi_flash.h
+++ b/drivers/mtd/nor/cfi_flash.h
@@ -256,17 +256,17 @@ void flash_make_cmd(struct flash_info *info, u32 cmd, cfiword_t *cmdbuf);
static inline void flash_write8(u8 value, void *addr)
{
- cpu_writeb(value, addr);
+ __raw_writeb(value, addr);
}
static inline void flash_write16(u16 value, void *addr)
{
- cpu_writew(value, addr);
+ __raw_writew(value, addr);
}
static inline void flash_write32(u32 value, void *addr)
{
- cpu_writel(value, addr);
+ __raw_writel(value, addr);
}
static inline void flash_write64(u64 value, void *addr)
@@ -276,17 +276,17 @@ static inline void flash_write64(u64 value, void *addr)
static inline u8 flash_read8(void *addr)
{
- return cpu_readb(addr);
+ return __raw_readb(addr);
}
static inline u16 flash_read16(void *addr)
{
- return cpu_readw(addr);
+ return __raw_readw(addr);
}
static inline u32 flash_read32(void *addr)
{
- return cpu_readl(addr);
+ return __raw_readl(addr);
}
static inline u64 flash_read64(void *addr)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index dfa95c38c8..88f0523260 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -48,7 +48,6 @@ static inline char *dt_string(struct fdt_header *f, char *strstart, uint32_t ofs
/**
* of_unflatten_dtb - unflatten a dtb binary blob
- * @root - node in which the fdt blob should be merged into or NULL
* @infdt - the fdt blob to unflatten
*
* Parse a flat device tree binary blob and return a pointer to the
diff --git a/drivers/serial/serial_ar933x.c b/drivers/serial/serial_ar933x.c
index 51184aaae5..59bb5b2ecf 100644
--- a/drivers/serial/serial_ar933x.c
+++ b/drivers/serial/serial_ar933x.c
@@ -40,7 +40,7 @@ static inline void ar933x_serial_writel(struct console_device *cdev,
{
struct ar933x_uart_priv *priv = cdev->dev->priv;
- cpu_writel(b, priv->base + offset);
+ __raw_writel(b, priv->base + offset);
}
static inline u32 ar933x_serial_readl(struct console_device *cdev,
@@ -48,7 +48,7 @@ static inline u32 ar933x_serial_readl(struct console_device *cdev,
{
struct ar933x_uart_priv *priv = cdev->dev->priv;
- return cpu_readl(priv->base + offset);
+ return __raw_readl(priv->base + offset);
}
/*
diff --git a/drivers/spi/ath79_spi.c b/drivers/spi/ath79_spi.c
index 4d71eba695..bdb39ef0cb 100644
--- a/drivers/spi/ath79_spi.c
+++ b/drivers/spi/ath79_spi.c
@@ -48,12 +48,12 @@ struct ath79_spi {
static inline u32 ath79_spi_rr(struct ath79_spi *sp, int reg)
{
- return cpu_readl(sp->regs + reg);
+ return __raw_readl(sp->regs + reg);
}
static inline void ath79_spi_wr(struct ath79_spi *sp, u32 val, int reg)
{
- cpu_writel(val, sp->regs + reg);
+ __raw_writel(val, sp->regs + reg);
}
static inline void setbits(struct ath79_spi *sp, int bits, int on)
diff --git a/fs/fs.c b/fs/fs.c
index 9a79a03ae2..c249f843bf 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1564,14 +1564,11 @@ out:
}
EXPORT_SYMBOL(rmdir);
-static void memcpy_sz(void *_dst, const void *_src, ulong count, ulong rwsize)
+static void memcpy_sz(void *dst, const void *src, size_t count, int rwsize)
{
- ulong dst = (ulong)_dst;
- ulong src = (ulong)_src;
-
/* no rwsize specification given. Do whatever memcpy likes best */
if (!rwsize) {
- memcpy(_dst, _src, count);
+ memcpy(dst, src, count);
return;
}
@@ -1582,13 +1579,13 @@ static void memcpy_sz(void *_dst, const void *_src, ulong count, ulong rwsize)
while (count-- > 0) {
switch (rwsize) {
case 1:
- *((u_char *)dst) = *((u_char *)src);
+ *((u8 *)dst) = *((u8 *)src);
break;
case 2:
- *((ushort *)dst) = *((ushort *)src);
+ *((u16 *)dst) = *((u16 *)src);
break;
case 4:
- *((ulong *)dst) = *((ulong *)src);
+ *((u32 *)dst) = *((u32 *)src);
break;
case 8:
*((u64 *)dst) = *((u64 *)src);
diff --git a/include/asm-generic/barebox.lds.h b/include/asm-generic/barebox.lds.h
index e359187d7f..254397ee97 100644
--- a/include/asm-generic/barebox.lds.h
+++ b/include/asm-generic/barebox.lds.h
@@ -34,7 +34,9 @@
KEEP(*(.initcall.9)) \
KEEP(*(.initcall.10)) \
KEEP(*(.initcall.11)) \
- KEEP(*(.initcall.12))
+ KEEP(*(.initcall.12)) \
+ KEEP(*(.initcall.13)) \
+ KEEP(*(.initcall.14))
#define BAREBOX_CMDS KEEP(*(SORT_BY_NAME(.barebox_cmd*)))
diff --git a/include/crc.h b/include/crc.h
index 10560c9fa9..4290f41c57 100644
--- a/include/crc.h
+++ b/include/crc.h
@@ -95,6 +95,6 @@ cyg_ether_crc32_accumulate(uint32_t crc, unsigned char *s, int len);
/* 16 bit CRC with polynomial x^16+x^12+x^5+1 */
-extern uint16_t cyg_crc16(unsigned char *s, int len);
+extern uint16_t cyg_crc16(const unsigned char *s, int len);
#endif /* _SERVICES_CRC_CRC_H_ */
diff --git a/include/digest.h b/include/digest.h
index 7f8d696eb6..7c6711b32a 100644
--- a/include/digest.h
+++ b/include/digest.h
@@ -68,14 +68,14 @@ void digest_free(struct digest *d);
int digest_file_window(struct digest *d, const char *filename,
unsigned char *hash,
- unsigned char *sig,
+ const unsigned char *sig,
ulong start, ulong size);
int digest_file(struct digest *d, const char *filename,
- unsigned char *hash,
- unsigned char *sig);
+ unsigned char *hash,
+ const unsigned char *sig);
int digest_file_by_name(const char *algo, const char *filename,
- unsigned char *hash,
- unsigned char *sig);
+ unsigned char *hash,
+ const unsigned char *sig);
static inline int digest_init(struct digest *d)
{
diff --git a/include/init.h b/include/init.h
index 37c7eedf67..f619c951d3 100644
--- a/include/init.h
+++ b/include/init.h
@@ -39,6 +39,8 @@ typedef int (*initcall_t)(void);
#define device_initcall(fn) __define_initcall("10",fn,10)
#define crypto_initcall(fn) __define_initcall("11",fn,11)
#define late_initcall(fn) __define_initcall("12",fn,12)
+#define environment_initcall(fn) __define_initcall("13",fn,13)
+#define postenvironment_initcall(fn) __define_initcall("14",fn,14)
/* section for code used very early when
* - we're not running from where we linked at
diff --git a/include/io.h b/include/io.h
index 8d885de68f..8eb56b061f 100644
--- a/include/io.h
+++ b/include/io.h
@@ -3,12 +3,4 @@
#include <asm/io.h>
-/* cpu_read/cpu_write: cpu native io accessors */
-#define cpu_readb(a) __raw_readb(a)
-#define cpu_readw(a) __raw_readw(a)
-#define cpu_readl(a) __raw_readl(a)
-#define cpu_writeb(v, a) __raw_writeb((v), (a))
-#define cpu_writew(v, a) __raw_writew((v), (a))
-#define cpu_writel(v, a) __raw_writel((v), (a))
-
#endif /* __IO_H */
diff --git a/include/watchdog.h b/include/watchdog.h
index 3e2d08e876..7e37b7c22a 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -17,8 +17,25 @@ struct watchdog {
int (*set_timeout)(struct watchdog *, unsigned);
};
+#ifdef CONFIG_WATCHDOG
int watchdog_register(struct watchdog *);
int watchdog_deregister(struct watchdog *);
int watchdog_set_timeout(unsigned);
+#else
+static inline int watchdog_register(struct watchdog *w)
+{
+ return 0;
+}
+
+int watchdog_deregister(struct watchdog *w)
+{
+ return 0;
+}
+
+int watchdog_set_timeout(unsigned t)
+{
+ return 0;
+}
+#endif
#endif /* INCLUDE_WATCHDOG_H */
diff --git a/lib/xfuncs.c b/lib/xfuncs.c
index 86d0013787..0e78b670a5 100644
--- a/lib/xfuncs.c
+++ b/lib/xfuncs.c
@@ -30,8 +30,6 @@ void *xmalloc(size_t size)
if (!(p = malloc(size)))
panic("ERROR: out of memory\n");
- debug("xmalloc %p (size %zu)\n", p, size);
-
return p;
}
EXPORT_SYMBOL(xmalloc);
@@ -43,8 +41,6 @@ void *xrealloc(void *ptr, size_t size)
if (!(p = realloc(ptr, size)))
panic("ERROR: out of memory\n");
- debug("xrealloc %p -> %p (size %zu)\n", ptr, p, size);
-
return p;
}
EXPORT_SYMBOL(xrealloc);