On Mon, Mar 22, 2021 at 07:00:06PM -0500, Jordon wrote:
> 6.6 was the last release that works. 6.7 and 6.8 throw an input/output error
> when it tries to create the partitions (right after you choose ‘(W)hole
> disk’).
>
> Am I the only person to try installing it to onboard storage in the last
> year? Or am I doing something wrong?
The workaround to limit emmc bus width is not done after the device tree
changes which removed the "ti,hwmods" property. While reads work
without this writes give an error.
After adding calls to enable clocks emmc writes work without limiting
bus width.
Index: ommmc.c
===================================================================
RCS file: /cvs/src/sys/arch/armv7/omap/ommmc.c,v
retrieving revision 1.38
diff -u -p -r1.38 ommmc.c
--- ommmc.c 19 Jan 2021 18:04:43 -0000 1.38
+++ ommmc.c 24 Mar 2021 12:04:17 -0000
@@ -35,6 +35,7 @@
#include <armv7/omap/prcmvar.h>
#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_clock.h>
#include <dev/ofw/ofw_gpio.h>
#include <dev/ofw/ofw_pinctrl.h>
#include <dev/ofw/fdt.h>
@@ -304,8 +305,6 @@ ommmc_attach(struct device *parent, stru
struct sdmmcbus_attach_args saa;
uint32_t caps, width;
uint32_t addr, size;
- int len, unit;
- char hwmods[128];
if (faa->fa_nreg < 1)
return;
@@ -322,14 +321,6 @@ ommmc_attach(struct device *parent, stru
size = faa->fa_reg[0].size;
}
- unit = -1;
- if ((len = OF_getprop(faa->fa_node, "ti,hwmods", hwmods,
- sizeof(hwmods))) == 5) {
- if (!strncmp(hwmods, "mmc", 3) &&
- (hwmods[3] > '0') && (hwmods[3] <= '9'))
- unit = hwmods[3] - '1';
- }
-
sc->sc_iot = faa->fa_iot;
if (bus_space_map(sc->sc_iot, addr, size, 0, &sc->sc_ioh))
panic("%s: bus_space_map failed!", __func__);
@@ -339,9 +330,8 @@ ommmc_attach(struct device *parent, stru
pinctrl_byname(faa->fa_node, "default");
- /* Enable ICLKEN, FCLKEN? */
- if (unit != -1)
- prcm_enablemodule(PRCM_MMC0 + unit);
+ clock_enable_all(faa->fa_node);
+ reset_deassert_all(faa->fa_node);
sc->sc_ih = arm_intr_establish_fdt(faa->fa_node, IPL_SDMMC,
ommmc_intr, sc, DEVNAME(sc));
@@ -450,9 +440,6 @@ ommmc_attach(struct device *parent, stru
saa.caps |= SMC_CAPS_MMC_HIGHSPEED | SMC_CAPS_SD_HIGHSPEED;
}
width = OF_getpropint(faa->fa_node, "bus-width", 1);
- /* with bbb emmc width > 1 ommmc_wait_intr MMCHS_STAT_CC times out */
- if (unit > 0)
- width = 1;
if (width >= 8)
saa.caps |= SMC_CAPS_8BIT_MODE;
if (width >= 4)