Browse Source

Merge branch 'freebsd/current/master' into hardened/current/master

* freebsd/current/master:
  fuspi: Fix 'sleepable after non-sleepable' lock
  Regenerate src.conf(5) after r356164
  Change reference in HTTPD descriptions to 'simple_httpd'
hardened/current/master
HardenedBSD Sync Service 5 months ago
parent
commit
67176b9ba8
4 changed files with 12 additions and 13 deletions
  1. +2
    -2
      share/man/man5/src.conf.5
  2. +8
    -9
      sys/riscv/sifive/fu540_spi.c
  3. +1
    -1
      tools/build/options/WITHOUT_HTTPD
  4. +1
    -1
      tools/build/options/WITH_HTTPD

+ 2
- 2
share/man/man5/src.conf.5 View File

@@ -1,6 +1,6 @@
.\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
.\" $FreeBSD$
.Dd December 27, 2019
.Dd December 28, 2019
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -880,7 +880,7 @@ Set to build Hesiod support.
.It Va WITHOUT_HTML
Set to not build HTML docs.
.It Va WITH_HTTPD
Set to build and install httpd
Set to build and install simple_httpd
.It Va WITHOUT_HYPERV
Set to not build or install HyperV utilities.
.Pp

+ 8
- 9
sys/riscv/sifive/fu540_spi.c View File

@@ -80,6 +80,7 @@ struct fuspi_softc {
void *ih;

clk_t clk;
uint64_t freq;
uint32_t cs_max;
};

@@ -207,22 +208,14 @@ fuspi_setup(struct fuspi_softc *sc, uint32_t cs, uint32_t mode,
uint32_t freq)
{
uint32_t csmode, fmt, sckdiv, sckmode;
uint64_t clock;
int ret;

FUSPI_ASSERT_LOCKED(sc);

ret = clk_get_freq(sc->clk, &clock);
if (ret) {
device_printf(sc->dev, "Cannot get clock frequency: %d\n", ret);
return (ret);
}

/*
* Fsck = Fin / 2 * (div + 1)
* -> div = Fin / (2 * Fsck) - 1
*/
sckdiv = (howmany(clock >> 1, freq) - 1) & FUSPI_SCKDIV_MASK;
sckdiv = (howmany(sc->freq >> 1, freq) - 1) & FUSPI_SCKDIV_MASK;
FUSPI_WRITE(sc, FUSPI_REG_SCKDIV, sckdiv);

switch (mode) {
@@ -331,6 +324,12 @@ fuspi_attach(device_t dev)
goto fail;
}

error = clk_get_freq(sc->clk, &sc->freq);
if (error) {
device_printf(sc->dev, "Couldn't get frequency: %d\n", error);
goto fail;
}

/*
* From Sifive-Unleashed-FU540-C000-v1.0.pdf page 103:
* csdef is cs_width bits wide and all ones on reset.

+ 1
- 1
tools/build/options/WITHOUT_HTTPD View File

@@ -1,2 +1,2 @@
.\" $FreeBSD$
Set to neither build nor install httpd
Set to neither build nor install simple_httpd

+ 1
- 1
tools/build/options/WITH_HTTPD View File

@@ -1,2 +1,2 @@
.\" $FreeBSD$
Set to build and install httpd
Set to build and install simple_httpd

Loading…
Cancel
Save