diff options
Diffstat (limited to 'sys/arch/armv7/imx')
-rw-r--r-- | sys/arch/armv7/imx/imxahci.c | 6 | ||||
-rw-r--r-- | sys/arch/armv7/imx/imxccm.c | 4 | ||||
-rw-r--r-- | sys/arch/armv7/imx/imxccm_clocks.h | 1 | ||||
-rw-r--r-- | sys/arch/armv7/imx/imxccmvar.h | 3 |
4 files changed, 9 insertions, 5 deletions
diff --git a/sys/arch/armv7/imx/imxahci.c b/sys/arch/armv7/imx/imxahci.c index fbfcfdcb845..460880c1b80 100644 --- a/sys/arch/armv7/imx/imxahci.c +++ b/sys/arch/armv7/imx/imxahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imxahci.c,v 1.8 2018/03/30 20:32:50 patrick Exp $ */ +/* $OpenBSD: imxahci.c,v 1.9 2018/04/01 19:07:31 patrick Exp $ */ /* * Copyright (c) 2013 Patrick Wildt <patrick@blueri.se> * @@ -33,6 +33,7 @@ #include <armv7/imx/imxiomuxcvar.h> #include <dev/ofw/openfirm.h> +#include <dev/ofw/ofw_clock.h> #include <dev/ofw/fdt.h> /* registers */ @@ -152,7 +153,8 @@ imxahci_attach(struct device *parent, struct device *self, void *aux) bus_space_write_4(sc->sc_iot, sc->sc_ioh, SATA_PI, 1); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SATA_TIMER1MS, imxccm_get_ahbclk()); + bus_space_write_4(sc->sc_iot, sc->sc_ioh, SATA_TIMER1MS, + clock_get_frequency(faa->fa_node, "ahb")); while (!(bus_space_read_4(sc->sc_iot, sc->sc_ioh, SATA_P0SSTS) & 0xF) && timeout--); diff --git a/sys/arch/armv7/imx/imxccm.c b/sys/arch/armv7/imx/imxccm.c index 66928e591e1..5e27a6b1490 100644 --- a/sys/arch/armv7/imx/imxccm.c +++ b/sys/arch/armv7/imx/imxccm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imxccm.c,v 1.12 2018/04/01 18:57:48 patrick Exp $ */ +/* $OpenBSD: imxccm.c,v 1.13 2018/04/01 19:07:31 patrick Exp $ */ /* * Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se> * @@ -548,6 +548,8 @@ imxccm_get_frequency(void *cookie, uint32_t *cells) } } else { switch (idx) { + case IMX6_CLK_AHB: + return imxccm_get_ahbclk(); case IMX6_CLK_ARM: return imxccm_get_armclk(); case IMX6_CLK_IPG: diff --git a/sys/arch/armv7/imx/imxccm_clocks.h b/sys/arch/armv7/imx/imxccm_clocks.h index 2884be88628..021dae5965f 100644 --- a/sys/arch/armv7/imx/imxccm_clocks.h +++ b/sys/arch/armv7/imx/imxccm_clocks.h @@ -7,6 +7,7 @@ #define IMX6_CLK_IPG 0x3e #define IMX6_CLK_IPG_PER 0x3f #define IMX6_CLK_ARM 0x68 +#define IMX6_CLK_AHB 0x69 #define IMX6_CLK_ENET 0x75 #define IMX6_CLK_I2C1 0x7d #define IMX6_CLK_I2C2 0x7e diff --git a/sys/arch/armv7/imx/imxccmvar.h b/sys/arch/armv7/imx/imxccmvar.h index f6962d735cf..06dadbf1c10 100644 --- a/sys/arch/armv7/imx/imxccmvar.h +++ b/sys/arch/armv7/imx/imxccmvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: imxccmvar.h,v 1.5 2018/04/01 18:57:48 patrick Exp $ */ +/* $OpenBSD: imxccmvar.h,v 1.6 2018/04/01 19:07:31 patrick Exp $ */ /* * Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se> * @@ -18,7 +18,6 @@ #ifndef IMXCCMVAR_H #define IMXCCMVAR_H -unsigned int imxccm_get_ahbclk(void); void imxccm_disable_usb1_chrg_detect(void); void imxccm_disable_usb2_chrg_detect(void); void imxccm_enable_pll_usb1(void); |