From patchwork Thu Sep 20 19:37:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Herrmann X-Patchwork-Id: 185463 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E16152C009E for ; Fri, 21 Sep 2012 05:45:05 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE6F128091; Thu, 20 Sep 2012 21:45:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hU53IcG3ilWE; Thu, 20 Sep 2012 21:45:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A10D02808C; Thu, 20 Sep 2012 21:45:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 92A5E28084; Thu, 20 Sep 2012 21:44:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VOkHQBx1AbMb; Thu, 20 Sep 2012 21:44:57 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-we0-f172.google.com (mail-we0-f172.google.com [74.125.82.172]) by theia.denx.de (Postfix) with ESMTPS id 68A3528081; Thu, 20 Sep 2012 21:44:54 +0200 (CEST) Received: by weyx48 with SMTP id x48so1473212wey.3 for ; Thu, 20 Sep 2012 12:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=2E0l+rKC9xUZKFVS8FK3982FMmtk9nwbgIA/+klOaU0=; b=Fqw4KwRWEt+N8qh3LJszZEDJvlxdAzZNWHZAHJPhWhB6mArVj0CsBXZnSA7DoPNh8g HYsTXrrko84iXOgLNFKcVY9Qp5VpvDgGUoSQMvVhB5IvFZEUWxyVk5oZ+KdDsxWZgm1o RYBc6/1YJ06meseD+24Lr3eAqNZ4iGPNHYPO5msVETwrIm2SDJ8/i0Ns8QTu9QVwxTSU SPRKlQL9lFaBBppBcutRsgaS7PWITXzDR+EZgmdNkKUTOa0yTeFSXyoF0tz1Qae0CiZL WO/7j/Dyfkfz0/BkkgnA5f7TgQIZ4Q1mkmPkHgYCT2/HU2HR9dPB/Ynqm6E/GqegkqYf gOTw== Received: by 10.180.91.1 with SMTP id ca1mr7905018wib.8.1348169885383; Thu, 20 Sep 2012 12:38:05 -0700 (PDT) Received: from Bloomfield.kolej.mff.cuni.cz (pavelherrmann.kolej.mff.cuni.cz. [78.128.197.20]) by mx.google.com with ESMTPS id k2sm12265794wiz.7.2012.09.20.12.38.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 12:38:04 -0700 (PDT) From: Pavel Herrmann To: U-Boot DM Date: Thu, 20 Sep 2012 21:37:37 +0200 Message-Id: <1348169867-2917-2-git-send-email-morpheus.ibis@gmail.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1348169867-2917-1-git-send-email-morpheus.ibis@gmail.com> References: <1348169867-2917-1-git-send-email-morpheus.ibis@gmail.com> Cc: Marek Vasut , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 01/11] DM: add block device core X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This core will register all block devices (disk, cards, partitons) and provide unfied access to them, instead of current method with device + partition offset Signed-off-by: Pavel Herrmann --- Makefile | 1 + drivers/blockdev/Makefile | 42 ++++++++++++++++ include/dm/blockdev.h | 121 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 drivers/blockdev/Makefile create mode 100644 include/dm/blockdev.h diff --git a/Makefile b/Makefile index ba74696..e43fd9d 100644 --- a/Makefile +++ b/Makefile @@ -303,6 +303,7 @@ LIBS-y += test/libtest.o LIBS-$(CONFIG_DM) += common/dm/libdm.o LIBS-$(CONFIG_DM) += drivers/demo/libdemo.o +LIBS-${CONFIG_DM_BLOCK} += drivers/blockdev/libblockdev.o ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS-y += $(CPUDIR)/omap-common/libomap-common.o diff --git a/drivers/blockdev/Makefile b/drivers/blockdev/Makefile new file mode 100644 index 0000000..693e236 --- /dev/null +++ b/drivers/blockdev/Makefile @@ -0,0 +1,42 @@ +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB := $(obj)libblockdev.o + +COBJS-${CONFIG_DM_BLOCK} := core.o + +COBJS := $(COBJS-y) +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +all: $(LIB) + +$(LIB): $(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/include/dm/blockdev.h b/include/dm/blockdev.h new file mode 100644 index 0000000..828eb2b --- /dev/null +++ b/include/dm/blockdev.h @@ -0,0 +1,121 @@ +/* + * (C) Copyright 2012 + * Pavel Herrmann + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _DM_BLOCKDEV_H_ +#define _DM_BLOCKDEV_H_ 1 + +#include +#include + +#define BLOCKDEV_IFTYPE_BITS 4 +#define BLOCKDEV_IFTYPE_COUNT (1<