From owner-p4-projects@FreeBSD.ORG Fri Oct 6 23:35:11 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ACE2B16A417; Fri, 6 Oct 2006 23:35:11 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7021116A415 for ; Fri, 6 Oct 2006 23:35:11 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D0FE43D45 for ; Fri, 6 Oct 2006 23:35:11 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k96NZB74069999 for ; Fri, 6 Oct 2006 23:35:11 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k96NZACN069996 for perforce@freebsd.org; Fri, 6 Oct 2006 23:35:10 GMT (envelope-from imp@freebsd.org) Date: Fri, 6 Oct 2006 23:35:10 GMT Message-Id: <200610062335.k96NZACN069996@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 107382 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2006 23:35:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=107382 Change 107382 by imp@imp_lighthouse on 2006/10/06 23:34:16 boilerplate for at45D* support, start a bit of a rename Affected files ... .. //depot/projects/arm/src/sys/arm/conf/TSC4370.hints#2 edit .. //depot/projects/arm/src/sys/dev/flash/at45.c#3 edit Differences ... ==== //depot/projects/arm/src/sys/arm/conf/TSC4370.hints#2 (text+ko) ==== @@ -1,2 +1,5 @@ -hint.at45.0.at="spibus0" -hint.at45.0.cs=0 +# $FreeBSD$ +# $TSC$ +hint.at45d.0.at="spibus0" +hint.at45d.0.cs=0 + ==== //depot/projects/arm/src/sys/dev/flash/at45.c#3 (text+ko) ==== @@ -25,6 +25,23 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct at45d_softc +{ + int dummy; +}; + #define CONTINUOUS_ARRAY_READ 0xE8 #define CONTINUOUS_ARRAY_READ_HF 0x0B #define CONTINUOUS_ARRAY_READ_LF 0x03 @@ -215,3 +232,42 @@ WaitForDeviceReady(); } #endif + + +static int +at45d_probe(device_t dev) +{ + device_set_desc(dev, "AT45 Flash Family"); + return (0); +} + +static int +at45d_attach(device_t dev) +{ + return (0); +} + +static int +at45d_detach(device_t dev) +{ + return EIO; +} + +static devclass_t at45d_devclass; + +static device_method_t at45d_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, at45d_probe), + DEVMETHOD(device_attach, at45d_attach), + DEVMETHOD(device_detach, at45d_detach), + + { 0, 0 } +}; + +static driver_t at45d_driver = { + "at45d", + at45d_methods, + sizeof(struct at45d_softc), +}; + +DRIVER_MODULE(at45d, spibus, at45_driver, at45_devclass, 0, 0);