From patchwork Wed Jul 24 14:39:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Gherzan X-Patchwork-Id: 1136357 X-Patchwork-Delegate: matthias.bgg@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=balena.io Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45tygm6ldWz9s3l for ; Thu, 25 Jul 2019 00:40:36 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9DA33C21CB6; Wed, 24 Jul 2019 14:39:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 17CAEC21D8E; Wed, 24 Jul 2019 14:39:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 82DD4C21CB6; Wed, 24 Jul 2019 14:39:36 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by lists.denx.de (Postfix) with ESMTPS id 01AFFC21BE5 for ; Wed, 24 Jul 2019 14:39:36 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id 31so47328827wrm.1 for ; Wed, 24 Jul 2019 07:39:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SBRknuqaA8nrsEqGUKyxns0jOTIIj2fE4uzSYMyIGew=; b=PM1drqcqaap81ZOvnmAJY7X232GJ1xovWSwf0Gfii33S1JHlV0lXbcT6pHy/MY5C1Y GVqDd9jEF6nKvHAGx2xHd2df1KTAaYpuxqmmo89okoq1FQ80/gwzWj+AZJ/AsoZHiR0W Jo/QZmK8NjcG9xVEPkdvq2kYg7V7FGrTQgKFCn8y4tSk6rdFXH6x71luCFr9GTiHqmes XE5UGqaitR84yV9d5U4NL8pNnZbhtyxT8YYgkRyRbtOTwYi44C0XYsVwHP4G8DSjMjeE 5jdjVUB8rmMki3Bqtj5aGkS0F+k/RvLiQPKbkssavqHl24M4ohWNlZ4fI9VXzg+4DJjZ aT7g== X-Gm-Message-State: APjAAAXvh2LHWYIbEeX1TSDzEtnms+hdW6mVhDH8RRCsABLlzzPSCiUf 8um70SOfA7+T6IFVzjiHE/2q21x6 X-Google-Smtp-Source: APXvYqzpQ+14M+bTmm58qDfrEm+q5psg5hqSSHCmXarzdL9SPFCPF5TlXBFq2NrJt8Zn5k7Cm+vgzQ== X-Received: by 2002:adf:e444:: with SMTP id t4mr83713613wrm.262.1563979175247; Wed, 24 Jul 2019 07:39:35 -0700 (PDT) Received: from localhost.localdomain ([212.36.34.46]) by smtp.gmail.com with ESMTPSA id n14sm84860651wra.75.2019.07.24.07.39.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 07:39:34 -0700 (PDT) From: Andrei Gherzan To: u-boot@lists.denx.de Date: Wed, 24 Jul 2019 15:39:05 +0100 Message-Id: <20190724143911.29770-3-andrei@balena.io> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724143911.29770-1-andrei@balena.io> References: <20190716133803.1174-1-andrei@gherzan.ro> <20190724143911.29770-1-andrei@balena.io> MIME-Version: 1.0 Cc: mbrugger@suse.com, Andrei Gherzan Subject: [U-Boot] [PATCH v2 2/8] ARM: bcm283x: Add BCM283x_BASE define X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Matthias Brugger Devices of bcm283x have different base address, depending if they are on bcm2835 or bcm2836/7. Use BCM283x_BASE depending on the SoC you want to build and only add the offset in the header files. Signed-off-by: Matthias Brugger Signed-off-by: Andrei Gherzan --- arch/arm/mach-bcm283x/Kconfig | 5 +++++ arch/arm/mach-bcm283x/include/mach/mbox.h | 6 +----- arch/arm/mach-bcm283x/include/mach/sdhci.h | 6 +----- arch/arm/mach-bcm283x/include/mach/timer.h | 6 +----- arch/arm/mach-bcm283x/include/mach/wdog.h | 6 +----- 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig index 3eb5a9a897..8e69914a83 100644 --- a/arch/arm/mach-bcm283x/Kconfig +++ b/arch/arm/mach-bcm283x/Kconfig @@ -141,4 +141,9 @@ config SYS_SOC config SYS_CONFIG_NAME default "rpi" +config BCM283x_BASE + hex + default "0x20000000" if BCM2835 + default "0x3f000000" if BCM2836 || BCM2837 + endmenu diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h b/arch/arm/mach-bcm283x/include/mach/mbox.h index e3a893e49c..e44c7577da 100644 --- a/arch/arm/mach-bcm283x/include/mach/mbox.h +++ b/arch/arm/mach-bcm283x/include/mach/mbox.h @@ -37,11 +37,7 @@ /* Raw mailbox HW */ -#ifndef CONFIG_BCM2835 -#define BCM2835_MBOX_PHYSADDR 0x3f00b880 -#else -#define BCM2835_MBOX_PHYSADDR 0x2000b880 -#endif +#define BCM2835_MBOX_PHYSADDR (CONFIG_BCM283x_BASE + 0x0000b880) struct bcm2835_mbox_regs { u32 read; diff --git a/arch/arm/mach-bcm283x/include/mach/sdhci.h b/arch/arm/mach-bcm283x/include/mach/sdhci.h index 5cb6ec3340..b443c379d8 100644 --- a/arch/arm/mach-bcm283x/include/mach/sdhci.h +++ b/arch/arm/mach-bcm283x/include/mach/sdhci.h @@ -6,11 +6,7 @@ #ifndef _BCM2835_SDHCI_H_ #define _BCM2835_SDHCI_H_ -#ifndef CONFIG_BCM2835 -#define BCM2835_SDHCI_BASE 0x3f300000 -#else -#define BCM2835_SDHCI_BASE 0x20300000 -#endif +#define BCM2835_SDHCI_BASE (CONFIG_BCM283x_BASE + 0x00300000) int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq); diff --git a/arch/arm/mach-bcm283x/include/mach/timer.h b/arch/arm/mach-bcm283x/include/mach/timer.h index 56b0c356bb..014355e759 100644 --- a/arch/arm/mach-bcm283x/include/mach/timer.h +++ b/arch/arm/mach-bcm283x/include/mach/timer.h @@ -6,11 +6,7 @@ #ifndef _BCM2835_TIMER_H #define _BCM2835_TIMER_H -#ifndef CONFIG_BCM2835 -#define BCM2835_TIMER_PHYSADDR 0x3f003000 -#else -#define BCM2835_TIMER_PHYSADDR 0x20003000 -#endif +#define BCM2835_TIMER_PHYSADDR (CONFIG_BCM283x_BASE + 0x00003000) #define BCM2835_TIMER_CS_M3 (1 << 3) #define BCM2835_TIMER_CS_M2 (1 << 2) diff --git a/arch/arm/mach-bcm283x/include/mach/wdog.h b/arch/arm/mach-bcm283x/include/mach/wdog.h index 99c88e5df7..8292b3cf1f 100644 --- a/arch/arm/mach-bcm283x/include/mach/wdog.h +++ b/arch/arm/mach-bcm283x/include/mach/wdog.h @@ -6,11 +6,7 @@ #ifndef _BCM2835_WDOG_H #define _BCM2835_WDOG_H -#ifndef CONFIG_BCM2835 -#define BCM2835_WDOG_PHYSADDR 0x3f100000 -#else -#define BCM2835_WDOG_PHYSADDR 0x20100000 -#endif +#define BCM2835_WDOG_PHYSADDR (CONFIG_BCM283x_BASE + 0x00100000) struct bcm2835_wdog_regs { u32 unknown0[7];