summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/user/state.rst8
-rw-r--r--Documentation/user/variables.rst8
-rw-r--r--arch/arm/mach-socfpga/cyclone5-reset-manager.c17
-rw-r--r--commands/hwclock.c2
-rw-r--r--common/ddr_spd.c2
-rw-r--r--crypto/digest.c11
-rw-r--r--drivers/mtd/ubi/ubi-barebox.h1
-rw-r--r--fs/nfs.c11
8 files changed, 31 insertions, 29 deletions
diff --git a/Documentation/user/state.rst b/Documentation/user/state.rst
index 07743df..78ce24f 100644
--- a/Documentation/user/state.rst
+++ b/Documentation/user/state.rst
@@ -21,7 +21,13 @@ RAUC_.
.. _RAUC: https://rauc.readthedocs.io/en/latest/
barebox itself uses a *state* driver to access the variables in the
-persistent memory. For the Linux run-time there is a userspace tool_ to do
+persistent memory.
+
+Currently there is only one implementation, enabled by
+``CONFIG_STATE_DRV=y``. Without driver, the state framework will silently
+fail and be non-functional.
+
+For the Linux run-time there is a userspace tool_ to do
the same.
.. _tool: https://git.pengutronix.de/cgit/tools/dt-utils/
diff --git a/Documentation/user/variables.rst b/Documentation/user/variables.rst
index ddfd485..cb1296c 100644
--- a/Documentation/user/variables.rst
+++ b/Documentation/user/variables.rst
@@ -46,9 +46,11 @@ currently running barebox, while changing a nv variable changes the
behaviour persistently over reboots.
nv variables can be created or removed with the :ref:`command_nv`
-command. The nv variables are made persistent using the environment
-facilities of barebox, so a :ref:`command_saveenv` must be issued to store the
-actual values.
+command.
+
+The nv variables are made persistent using the environment facilities of
+barebox. They are saved automatically to the storage medium whenever barebox
+shuts down (that is, a :ref:`command_reset` is issued or a kernel is started).
examples:
diff --git a/arch/arm/mach-socfpga/cyclone5-reset-manager.c b/arch/arm/mach-socfpga/cyclone5-reset-manager.c
index 4bbe1a8..8635806 100644
--- a/arch/arm/mach-socfpga/cyclone5-reset-manager.c
+++ b/arch/arm/mach-socfpga/cyclone5-reset-manager.c
@@ -22,23 +22,6 @@
#include <mach/cyclone5-regs.h>
#include <mach/cyclone5-reset-manager.h>
-/* Disable the watchdog (toggle reset to watchdog) */
-void watchdog_disable(void)
-{
- void __iomem *rm = (void *)CYCLONE5_RSTMGR_ADDRESS;
- uint32_t val;
-
- /* assert reset for watchdog */
- val = readl(rm + RESET_MGR_PER_MOD_RESET_OFS);
- val |= 1 << RSTMGR_PERMODRST_L4WD0_LSB;
- writel(val, rm + RESET_MGR_PER_MOD_RESET_OFS);
-
- /* deassert watchdog from reset (watchdog in not running state) */
- val = readl(rm + RESET_MGR_PER_MOD_RESET_OFS);
- val &= ~(1 << RSTMGR_PERMODRST_L4WD0_LSB);
- writel(val, rm + RESET_MGR_PER_MOD_RESET_OFS);
-}
-
/* Write the reset manager register to cause reset */
static void __noreturn socfpga_restart_soc(struct restart_handler *rst)
{
diff --git a/commands/hwclock.c b/commands/hwclock.c
index 5073618..1b5c2cd 100644
--- a/commands/hwclock.c
+++ b/commands/hwclock.c
@@ -175,7 +175,7 @@ BAREBOX_CMD_HELP_START(hwclock)
BAREBOX_CMD_HELP_TEXT("Options:")
BAREBOX_CMD_HELP_OPT ("-f NAME\t\t\t", "RTC device name (default rtc0)")
BAREBOX_CMD_HELP_OPT ("-e VARNAME\t\t", "store RTC readout into variable VARNAME")
-BAREBOX_CMD_HELP_OPT ("-n NTPSERVER\t", "set RTC from NTP server")
+BAREBOX_CMD_HELP_OPT ("-n NTPSERVER\t\t", "set RTC from NTP server")
BAREBOX_CMD_HELP_OPT ("-s ccyymmddHHMM[.SS]\t", "set time")
BAREBOX_CMD_HELP_END
diff --git a/common/ddr_spd.c b/common/ddr_spd.c
index 0ba5eac..23df3e7 100644
--- a/common/ddr_spd.c
+++ b/common/ddr_spd.c
@@ -325,7 +325,7 @@ void ddr_spd_print(uint8_t *record)
printf("Error module type\n");
printf("%-48s ", "DRAM Package ");
- if ((s->mod_ranks & 0x10) == 1)
+ if ((s->mod_ranks & 0x10) != 0)
printf("Stack\n");
else
printf("Planar\n");
diff --git a/crypto/digest.c b/crypto/digest.c
index 2c4de2e..360c261 100644
--- a/crypto/digest.c
+++ b/crypto/digest.c
@@ -233,17 +233,18 @@ static int digest_update_from_fd(struct digest *d, int fd,
}
while (size) {
- const ssize_t now = read(fd, buf, PAGE_SIZE);
- if (now < 0) {
- ret = now;
+ unsigned long now = min_t(typeof(size), PAGE_SIZE, size);
+
+ ret = read(fd, buf, now);
+ if (ret < 0) {
perror("read");
goto out_free;
}
- if (!now)
+ if (!ret)
break;
- ret = digest_update_interruptible(d, buf, now);
+ ret = digest_update_interruptible(d, buf, ret);
if (ret)
goto out_free;
diff --git a/drivers/mtd/ubi/ubi-barebox.h b/drivers/mtd/ubi/ubi-barebox.h
index 557ad88..7ee87ff 100644
--- a/drivers/mtd/ubi/ubi-barebox.h
+++ b/drivers/mtd/ubi/ubi-barebox.h
@@ -30,7 +30,6 @@
#define crc32(seed, data, length) crc32_no_comp(seed, (unsigned char * const)data, length)
/* configurable */
-#define CONFIG_MTD_UBI_WL_THRESHOLD 4096
#define UBI_IO_DEBUG 0
/* upd.c */
diff --git a/fs/nfs.c b/fs/nfs.c
index 574fb85..d606ccd 100644
--- a/fs/nfs.c
+++ b/fs/nfs.c
@@ -436,9 +436,20 @@ static struct packet *rpc_req(struct nfs_priv *npriv, int rpc_prog,
npriv->con->udp->uh_dport = hton16(dport);
+ nfs_timer_start = get_time_ns();
+
again:
ret = net_udp_send(npriv->con,
sizeof(pkt) + datalen * sizeof(uint32_t));
+ if (ret) {
+ if (is_timeout(nfs_timer_start, NFS_TIMEOUT)) {
+ tries++;
+ if (tries == NFS_MAX_RESEND)
+ return ERR_PTR(-ETIMEDOUT);
+ }
+
+ goto again;
+ }
nfs_timer_start = get_time_ns();