diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-08-14 19:08:45 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-08-14 19:08:45 +0000 |
commit | 71d4a666107e5bda92b18305d34642d7004bacd7 (patch) | |
tree | 126d147c9994af1d62d518559f82d1c18c985b88 /sys/arch/armv7/imx/imxocotp.c | |
parent | c2b69e1fef2130e77954e10ded75474f4a304067 (diff) |
Add imxtemp(4), a temperature sensor for the i.MX6 SoC. Based on code written
by patrick@.
ok deraadt@
Diffstat (limited to 'sys/arch/armv7/imx/imxocotp.c')
-rw-r--r-- | sys/arch/armv7/imx/imxocotp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arch/armv7/imx/imxocotp.c b/sys/arch/armv7/imx/imxocotp.c index f9d78811c68..e4cd7973223 100644 --- a/sys/arch/armv7/imx/imxocotp.c +++ b/sys/arch/armv7/imx/imxocotp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imxocotp.c,v 1.2 2013/11/06 19:03:07 syl Exp $ */ +/* $OpenBSD: imxocotp.c,v 1.3 2016/08/14 19:08:44 kettenis Exp $ */ /* * Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se> * @@ -30,6 +30,9 @@ #include <armv7/imx/imxocotpvar.h> /* registers */ +#define OCOTP_ANA0 0x4d0 +#define OCOTP_ANA1 0x4e0 +#define OCOTP_ANA2 0x4f0 #define OCOTP_MAC0 0x620 #define OCOTP_MAC1 0x630 @@ -80,3 +83,9 @@ imxocotp_get_ethernet_address(u_int8_t* mac) mac[1] = value & 0xff; mac[0] = (value >> 8) & 0xff; } + +uint32_t +imxocotp_get_temperature_calibration(void) +{ + return bus_space_read_4(imxocotp_sc->sc_iot, imxocotp_sc->sc_ioh, OCOTP_ANA1); +} |