From patchwork Fri Aug 7 13:42:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 505168 X-Patchwork-Delegate: sjg@chromium.org 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 E6F9B140280 for ; Fri, 7 Aug 2015 23:55:04 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=lOQy+FpH; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 477F2620A2; Fri, 7 Aug 2015 15:54:43 +0200 (CEST) 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 sYPlXyTuO3DY; Fri, 7 Aug 2015 15:54:43 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8918B3A41; Fri, 7 Aug 2015 15:54:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6617DA75FF for ; Fri, 7 Aug 2015 15:53:52 +0200 (CEST) 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 ELuqBAtSIXEk for ; Fri, 7 Aug 2015 15:53:52 +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) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by theia.denx.de (Postfix) with ESMTPS id 25A8F4B861 for ; Fri, 7 Aug 2015 15:53:40 +0200 (CEST) Received: by ioii16 with SMTP id i16so112253685ioi.0 for ; Fri, 07 Aug 2015 06:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=EwWv2o79eQ3mudaA03cTk8od1Gmn6+mo67ctD020ER4=; b=lOQy+FpHp54NW5ETjRk0QexVCDyf+Oj4QMcvqU/PAlWzdbkHs50Ce2mZj6M/qmvphv vWut6S9dVceC8KacOaEzeg6LK90fjvPGJicA9P9HqxZ5EaqSMcMEVCtF7Df8jh7VkIIV x3HowUfJ3veG62SQ/jnkrWRagT9HoXDYdMKIQvq9jrGl1TtP7rg1yXk9pr6cEWg/YTnv 5NveVdn+I5geBLIDZiCMh1WRX+rLbAQzAQGFWix+09bN5iRxq0siJ15QrwmJqR/f/vGI lUK2TYkpjtXIBtR9M/VNKPQV0Q7f35s2Ie/Ly3omzPWe8+yolH8bITkD3gvlPcWtGbIk XVpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=EwWv2o79eQ3mudaA03cTk8od1Gmn6+mo67ctD020ER4=; b=REv3oaIdWzigeK7vbUyMHKKqmWRiEoZOPa+QFBGIMQIe4eYa154i14yLwS7+nxm0fl YbNbSkG5vP2u+tSomwMHfZ/0HPv87rVPwQGo5cVHPmmO4e1b1bcld8LmsiWVRaU/buQ3 7XBxzlFwd59awygt3syGd9MB8zJSmZRj7+TdU6Na9aQqzVJUL96Y/bE3V/Lxh7XPkdwi IuI47jZVy3QhsAfMg+PdaxOsRY0e8dwYAXtec1052jLYlYHB0bzaMCwxC1JAGuOjU5tP /Q2x8uQQ4y5BGh/ouUbcH2Pp72yd4EDAVxkpohscA7wAW2t2glL+TyovfqT5ChtmgZ0V gq8w== X-Gm-Message-State: ALoCoQm0gEvTfaOeUqTp/CRuEQIj2Y0iidOoJpGhV/n0bzEegqlegfiBxUi9mPzZfCIiH6lVTeDf X-Received: by 10.107.129.81 with SMTP id c78mr8987366iod.4.1438955619011; Fri, 07 Aug 2015 06:53:39 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:1005:1100:34ef:7440:627:576d]) by smtp.gmail.com with ESMTPSA id q187sm6856673ioe.37.2015.08.07.06.53.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Aug 2015 06:53:36 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 7FB162218CB; Fri, 7 Aug 2015 07:53:33 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Fri, 7 Aug 2015 07:42:29 -0600 Message-Id: <1438954951-13329-10-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.5.0.rc2.392.g76e840b In-Reply-To: <1438954951-13329-1-git-send-email-sjg@chromium.org> References: <1438954951-13329-1-git-send-email-sjg@chromium.org> Cc: Stephen Warren , Joe Hershberger Subject: [U-Boot] [PATCH v3 09/11] arm: rpi: Drop the GPIO platform data X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" We can rely on the device tree to provide the GPIO information. Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None arch/arm/mach-bcm283x/include/mach/gpio.h | 5 ----- board/raspberrypi/rpi/rpi.c | 9 --------- drivers/gpio/bcm2835_gpio.c | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-bcm283x/include/mach/gpio.h b/arch/arm/mach-bcm283x/include/mach/gpio.h index c8ef8f5..7b4ddc9 100644 --- a/arch/arm/mach-bcm283x/include/mach/gpio.h +++ b/arch/arm/mach-bcm283x/include/mach/gpio.h @@ -9,11 +9,6 @@ #ifndef _BCM2835_GPIO_H_ #define _BCM2835_GPIO_H_ -#ifdef CONFIG_BCM2836 -#define BCM2835_GPIO_BASE 0x3f200000 -#else -#define BCM2835_GPIO_BASE 0x20200000 -#endif #define BCM2835_GPIO_COUNT 54 #define BCM2835_GPIO_FSEL_MASK 0x7 diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 7de1921..39f451f 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -19,15 +19,6 @@ DECLARE_GLOBAL_DATA_PTR; -static const struct bcm2835_gpio_platdata gpio_platdata = { - .base = BCM2835_GPIO_BASE, -}; - -U_BOOT_DEVICE(bcm2835_gpios) = { - .name = "gpio_bcm2835", - .platdata = &gpio_platdata, -}; - struct msg_get_arm_mem { struct bcm2835_mbox_hdr hdr; struct bcm2835_mbox_tag_get_arm_mem get_arm_mem; diff --git a/drivers/gpio/bcm2835_gpio.c b/drivers/gpio/bcm2835_gpio.c index fbc641d..f571b0b 100644 --- a/drivers/gpio/bcm2835_gpio.c +++ b/drivers/gpio/bcm2835_gpio.c @@ -114,9 +114,29 @@ static int bcm2835_gpio_probe(struct udevice *dev) return 0; } +#ifdef CONFIG_OF_CONTROL +static int bcm2835_gpio_ofdata_to_platdata(struct udevice *dev) +{ + struct bcm2835_gpio_platdata *plat = dev_get_platdata(dev); + + plat->base = dev_get_addr(dev); + if (plat->base == FDT_ADDR_T_NONE) + return -EINVAL; + + return 0; +} + +static const struct udevice_id bcm2835_gpio_id[] = { + {.compatible = "brcm,bcm2835-gpio"}, + {} +}; +#endif + U_BOOT_DRIVER(gpio_bcm2835) = { .name = "gpio_bcm2835", .id = UCLASS_GPIO, + .of_match = of_match_ptr(bcm2835_gpio_id), + .ofdata_to_platdata = of_match_ptr(bcm2835_gpio_ofdata_to_platdata), .ops = &gpio_bcm2835_ops, .probe = bcm2835_gpio_probe, .priv_auto_alloc_size = sizeof(struct bcm2835_gpios),