diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-05-10 18:15:50 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-05-10 18:15:50 +0200 |
commit | bac01839b063697200d5b957b652da197b8f0b1d (patch) | |
tree | 8b2441ee12fd42abf152d990eda478aaf722e4e9 | |
parent | 65cfdbebb19f0b1c8d322a3eb9ec464d669a4d3f (diff) | |
parent | a306c1c0bd09e7ee074d113b8a86bd815ef64017 (diff) | |
download | barebox-bac01839b063697200d5b957b652da197b8f0b1d.tar.gz barebox-bac01839b063697200d5b957b652da197b8f0b1d.tar.xz |
Merge branch 'for-next/misc'
-rw-r--r-- | Documentation/user/state.rst | 8 | ||||
-rw-r--r-- | Documentation/user/variables.rst | 8 | ||||
-rw-r--r-- | arch/arm/mach-socfpga/cyclone5-reset-manager.c | 17 | ||||
-rw-r--r-- | commands/hwclock.c | 2 | ||||
-rw-r--r-- | common/ddr_spd.c | 2 | ||||
-rw-r--r-- | crypto/digest.c | 11 | ||||
-rw-r--r-- | drivers/mtd/ubi/ubi-barebox.h | 1 | ||||
-rw-r--r-- | fs/nfs.c | 11 |
8 files changed, 31 insertions, 29 deletions
diff --git a/Documentation/user/state.rst b/Documentation/user/state.rst index 07743df0cb..78ce24f9ed 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 ddfd485740..cb1296c06d 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 4bbe1a8101..8635806846 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 5073618675..1b5c2cd100 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 0ba5eaceae..23df3e7119 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 2c4de2e4f1..360c261e40 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 557ad88316..7ee87ffd3e 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 */ @@ -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(); |