From owner-p4-projects@FreeBSD.ORG Sun Dec 30 23:01:19 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 226A9273; Sun, 30 Dec 2012 23:01:19 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C6465270 for ; Sun, 30 Dec 2012 23:01:18 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id A2E5B8FC0A for ; Sun, 30 Dec 2012 23:01:18 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id qBUN1IQn013392 for ; Sun, 30 Dec 2012 23:01:18 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id qBUN1I7d013389 for perforce@freebsd.org; Sun, 30 Dec 2012 23:01:18 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 30 Dec 2012 23:01:18 GMT Message-Id: <201212302301.qBUN1I7d013389@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219927 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Dec 2012 23:01:19 -0000 http://p4web.freebsd.org/@@219927?ac=10 Change 219927 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2012/12/30 23:00:20 Implement an FDT attachment for the Altera SD Card driver. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/conf/files#10 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_fdt.c#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/conf/files#10 (text+ko) ==== @@ -641,6 +641,7 @@ dev/altera/sdcard/altera_sdcard.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_disk.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard +dev/altera/sdcard/altera_sdcard_fdt.c optional altera_sdcard fdt dev/altera/sdcard/altera_sdcard_nexus.c optional altera_sdcard dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_fdt.c#2 (text+ko) ==== @@ -52,21 +52,27 @@ #include +#include +#include +#include +#include + /* - * Nexus bus attachment for the Altera SD Card IP core. Appropriate for most - * Altera FPGA SoC-style configurations in which the IP core will be exposed - * to the processor via a memory-mapped Avalon bus. + * FDT bus attachment for the Altera SD Card IP core. */ static int -altera_sdcard_nexus_probe(device_t dev) +altera_sdcard_fdt_probe(device_t dev) { - device_set_desc(dev, "Altera Secure Data Card IP Core"); - return (BUS_PROBE_DEFAULT); + if (ofw_bus_is_compatible(dev, "altera,sdcard_11_2011")) { + device_set_desc(dev, "Altera Secure Data Card IP Core"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int -altera_sdcard_nexus_attach(device_t dev) +altera_sdcard_fdt_attach(device_t dev) { struct altera_sdcard_softc *sc; @@ -85,7 +91,7 @@ } static int -altera_sdcard_nexus_detach(device_t dev) +altera_sdcard_fdt_detach(device_t dev) { struct altera_sdcard_softc *sc; @@ -97,20 +103,20 @@ return (0); } -static device_method_t altera_sdcard_nexus_methods[] = { - DEVMETHOD(device_probe, altera_sdcard_nexus_probe), - DEVMETHOD(device_attach, altera_sdcard_nexus_attach), - DEVMETHOD(device_detach, altera_sdcard_nexus_detach), +static device_method_t altera_sdcard_fdt_methods[] = { + DEVMETHOD(device_probe, altera_sdcard_fdt_probe), + DEVMETHOD(device_attach, altera_sdcard_fdt_attach), + DEVMETHOD(device_detach, altera_sdcard_fdt_detach), { 0, 0 } }; -static driver_t altera_sdcard_nexus_driver = { +static driver_t altera_sdcard_fdt_driver = { "altera_sdcardc", - altera_sdcard_nexus_methods, + altera_sdcard_fdt_methods, sizeof(struct altera_sdcard_softc), }; static devclass_t altera_sdcard_devclass; -DRIVER_MODULE(altera_sdcard, nexus, altera_sdcard_nexus_driver, +DRIVER_MODULE(altera_sdcard, simplebus, altera_sdcard_fdt_driver, altera_sdcard_devclass, 0, 0);