Add function omap_chipid().

This commit is contained in:
kiyohara 2016-04-25 13:14:37 +00:00
parent 40654b0c2b
commit 699a73d7cf
2 changed files with 17 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: omap2_obiovar.h,v 1.3 2015/04/14 18:37:43 bouyer Exp $ */
/* $NetBSD: omap2_obiovar.h,v 1.4 2016/04/25 13:14:37 kiyohara Exp $ */
/*
* Copyright (c) 2007 Microsoft
@ -53,4 +53,6 @@ struct obio_softc {
device_t sc_obio_dev;
};
uint32_t omap_chipid(void);
#endif /* _ARM_OMAP_OMAP2_OBIOVAR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: omap3_scm.c,v 1.3 2016/04/25 13:07:03 kiyohara Exp $ */
/* $NetBSD: omap3_scm.c,v 1.4 2016/04/25 13:14:37 kiyohara Exp $ */
/*-
* Copyright (c) 2013 Jared D. McNeill <jmcneill@invisible.ca>
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,v 1.3 2016/04/25 13:07:03 kiyohara Exp $");
__KERNEL_RCSID(0, "$NetBSD: omap3_scm.c,v 1.4 2016/04/25 13:14:37 kiyohara Exp $");
#include "opt_omap.h"
@ -254,3 +254,15 @@ omap3_scm_sensor_refresh(struct sysmon_envsys *sme, envsys_data_t *edata)
edata->state = ENVSYS_SVALID;
}
}
uint32_t
omap_chipid(void)
{
struct omap3_scm_softc *sc;
device_t dev;
dev = device_find_by_xname("omapscm0");
KASSERT(dev != NULL);
sc = device_private(dev);
return sc->sc_cid;
}