From: kettenis Date: Mon, 27 Aug 2018 06:43:28 +0000 (+0000) Subject: HiSilicon SoCs pre-divide the clock by a factor 8. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=32408765a82a947f6a4be2627e4936dc875fa330;p=openbsd HiSilicon SoCs pre-divide the clock by a factor 8. --- diff --git a/sys/dev/fdt/dwmmc.c b/sys/dev/fdt/dwmmc.c index 0f6203c2ff5..c7f8f4566ce 100644 --- a/sys/dev/fdt/dwmmc.c +++ b/sys/dev/fdt/dwmmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwmmc.c,v 1.17 2018/08/26 14:12:47 kettenis Exp $ */ +/* $OpenBSD: dwmmc.c,v 1.18 2018/08/27 06:43:28 kettenis Exp $ */ /* * Copyright (c) 2017 Mark Kettenis * @@ -315,9 +315,12 @@ dwmmc_attach(struct device *parent, struct device *self, void *aux) sc->sc_fifo_depth = SDMMC_FIFOTH_RXWM(fifoth) + 1; } - /* Some Rockchip variants pre-divide the clock. */ + /* Some SoCs pre-divide the clock. */ if (OF_is_compatible(faa->fa_node, "rockchip,rk3288-dw-mshc")) div = 1; + if (OF_is_compatible(faa->fa_node, "hisilicon,hi3660-dw-mshc") || + OF_is_compatible(faa->fa_node, "hisilicon,hi3670-dw-mshc")) + div = 7; freq = OF_getpropint(faa->fa_node, "clock-frequency", 0); if (freq > 0)