svn commit: r188016 - projects/cambria/sys/dev/cfi
Sam Leffler
sam at FreeBSD.org
Mon Feb 2 10:32:42 PST 2009
Author: sam
Date: Mon Feb 2 18:32:41 2009
New Revision: 188016
URL: http://svn.freebsd.org/changeset/base/188016
Log:
working bus shim:
o setup CS0 properly
o force interface width to 2 as we can't hack variable width reads
on the expansion bus
o fix bus dependency typo (boy that was painful to find)
Modified:
projects/cambria/sys/dev/cfi/cfi_bus_ixp4xx.c
Modified: projects/cambria/sys/dev/cfi/cfi_bus_ixp4xx.c
==============================================================================
--- projects/cambria/sys/dev/cfi/cfi_bus_ixp4xx.c Mon Feb 2 18:30:15 2009 (r188015)
+++ projects/cambria/sys/dev/cfi/cfi_bus_ixp4xx.c Mon Feb 2 18:32:41 2009 (r188016)
@@ -41,15 +41,32 @@ __FBSDID("$FreeBSD$");
#include <dev/cfi/cfi_var.h>
#include <arm/xscale/ixp425/ixp425reg.h>
+#include <arm/xscale/ixp425/ixp425var.h>
static int
cfi_ixp4xx_probe(device_t dev)
{
-#if 0
+#define EXP_TIMING_PRESERVE \
+ (EXP_TIMING_RSVD | EXP_TIMING_MASK)
+ struct ixp425_softc *sa = device_get_softc(device_get_parent(dev));
+ struct cfi_softc *sc = device_get_softc(dev);
+
+ /* setup CS0 per Intel AP-785 */
+ EXP_BUS_WRITE_4(sa, EXP_TIMING_CS0_OFFSET,
+ (EXP_BUS_READ_4(sa, EXP_TIMING_CS0_OFFSET) & EXP_TIMING_PRESERVE)
+ | EXP_CS_EN
+ | EXP_SZ_16M
+ | EXP_WR_EN
+ | EXP_BYTE_RD16
+ | IXP425_EXP_ADDR_T(1)
+ | IXP425_EXP_SETUP_T(1)
+ | IXP425_EXP_STROBE_T(4)
+ | IXP425_EXP_HOLD_T(1)
+ | IXP425_EXP_RECOVERY_T(1));
+
+ sc->sc_width = 2; /* NB: don't probe interface width */
return cfi_probe(dev);
-#else
- return ENXIO;
-#endif
+#undef EXP_TIMING_PRESERVE
}
static device_method_t cfi_ixp4xx_methods[] = {
@@ -66,4 +83,4 @@ static driver_t cfi_ixp4xx_driver = {
cfi_ixp4xx_methods,
sizeof(struct cfi_softc),
};
-DRIVER_MODULE (cfi, ixp4xx, cfi_ixp4xx_driver, cfi_devclass, 0, 0);
+DRIVER_MODULE (cfi, ixp, cfi_ixp4xx_driver, cfi_devclass, 0, 0);
More information about the svn-src-projects
mailing list