Date: Sun, 21 Dec 2008 20:29:47 +0000 (UTC) From: Sam Leffler <sam@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r186380 - projects/cambria/sys/arm/xscale/ixp425 Message-ID: <200812212029.mBLKTlT6041633@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sam Date: Sun Dec 21 20:29:47 2008 New Revision: 186380 URL: http://svn.freebsd.org/changeset/base/186380 Log: o add ixp4xx_read_feature_bits to return the mask of feature control bits so drivers can do a better job configuring optional features o display features on attach Modified: projects/cambria/sys/arm/xscale/ixp425/ixp425.c projects/cambria/sys/arm/xscale/ixp425/ixp425var.h Modified: projects/cambria/sys/arm/xscale/ixp425/ixp425.c ============================================================================== --- projects/cambria/sys/arm/xscale/ixp425/ixp425.c Sun Dec 21 20:27:50 2008 (r186379) +++ projects/cambria/sys/arm/xscale/ixp425/ixp425.c Sun Dec 21 20:29:47 2008 (r186380) @@ -68,6 +68,21 @@ static int ixp425_probe(device_t); static void ixp425_identify(driver_t *, device_t); static int ixp425_attach(device_t); +/* + * Return a mask of the "fuse" bits that identify + * which h/w features are present. + * NB: assumes the expansion bus is mapped. + */ +uint32_t +ixp4xx_read_feature_bits(void) +{ + uint32_t bits = ~IXPREG(IXP425_EXP_VBASE + EXP_FCTRL_OFFSET); + bits &= ~EXP_FCTRL_RESVD; + if (!cpu_is_ixp46x()) + bits &= ~EXP_FCTRL_IXP46X_ONLY; + return bits; +} + struct arm32_dma_range * bus_dma_get_range(void) { @@ -190,6 +205,8 @@ ixp425_attach(device_t dev) { struct ixp425_softc *sc; + device_printf(dev, "%b\n", ixp4xx_read_feature_bits(), EXP_FCTRL_BITS); + sc = device_get_softc(dev); sc->sc_iot = &ixp425_bs_tag; KASSERT(ixp425_softc == NULL, ("%s called twice?", __func__)); Modified: projects/cambria/sys/arm/xscale/ixp425/ixp425var.h ============================================================================== --- projects/cambria/sys/arm/xscale/ixp425/ixp425var.h Sun Dec 21 20:27:50 2008 (r186379) +++ projects/cambria/sys/arm/xscale/ixp425/ixp425var.h Sun Dec 21 20:29:47 2008 (r186380) @@ -48,6 +48,7 @@ #include <sys/rman.h> /* NB: cputype is setup by set_cpufuncs */ +#define cpu_is_ixp42x() (cputype == CPU_ID_IXP425) #define cpu_is_ixp43x() (cputype == CPU_ID_IXP435) #define cpu_is_ixp46x() (cputype == CPU_ID_IXP465) @@ -99,6 +100,7 @@ void ixp425_mem_bs_init(bus_space_tag_t, uint32_t ixp425_sdram_size(void); uint32_t ixp435_ddram_size(void); +uint32_t ixp4xx_read_feature_bits(void); int ixp425_md_route_interrupt(device_t, device_t, int); void ixp425_md_attach(device_t); @@ -115,5 +117,4 @@ enum { IXP425_IVAR_ADDR, /* base physical address */ IXP425_IVAR_IRQ /* irq/gpio pin assignment */ }; - #endif /* _IXP425VAR_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812212029.mBLKTlT6041633>