From patchwork Sat Mar 23 13:07:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 230335 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 98BF52C00BF for ; Sun, 24 Mar 2013 00:09:26 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJOB9-0001wQ-92; Sat, 23 Mar 2013 13:08:11 +0000 Received: from arrakis.dune.hu ([78.24.191.176]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJOAv-0001s0-CQ for linux-mtd@lists.infradead.org; Sat, 23 Mar 2013 13:07:59 +0000 Received: from arrakis.dune.hu ([127.0.0.1]) by localhost (arrakis.dune.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PgUCCHcEAX6z; Sat, 23 Mar 2013 14:07:21 +0100 (CET) Received: from shaker64.lan (dslb-088-073-029-203.pools.arcor-ip.net [88.73.29.203]) by arrakis.dune.hu (Postfix) with ESMTPSA id AACDE280129; Sat, 23 Mar 2013 14:07:20 +0100 (CET) From: Jonas Gorski To: linux-mtd@lists.infradead.org Subject: [PATCH 2/3] MIPS: BCM63XX: export PSI size from nvram Date: Sat, 23 Mar 2013 14:07:48 +0100 Message-Id: <1364044070-10486-3-git-send-email-jogo@openwrt.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364044070-10486-1-git-send-email-jogo@openwrt.org> References: <1364044070-10486-1-git-send-email-jogo@openwrt.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130323_090757_665836_8CDDA8B1 X-CRM114-Status: GOOD ( 10.71 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-mips@linux-mips.org, Artem Bityutskiy , Kevin Cernekee , Maxime Bizon , David Woodhouse , Florian Fainelli X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Jonas Gorski --- arch/mips/bcm63xx/nvram.c | 11 +++++++++++ arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/arch/mips/bcm63xx/nvram.c b/arch/mips/bcm63xx/nvram.c index 6206116..44af608 100644 --- a/arch/mips/bcm63xx/nvram.c +++ b/arch/mips/bcm63xx/nvram.c @@ -35,6 +35,8 @@ struct bcm963xx_nvram { u32 checksum_high; }; +#define BCM63XX_DEFAULT_PSI_SIZE 64 + static struct bcm963xx_nvram nvram; static int mac_addr_used; @@ -105,3 +107,12 @@ int bcm63xx_nvram_get_mac_address(u8 *mac) return 0; } EXPORT_SYMBOL(bcm63xx_nvram_get_mac_address); + +int bcm63xx_nvram_get_psi_size(void) +{ + if (nvram.psi_size > 0) + return nvram.psi_size; + + return BCM63XX_DEFAULT_PSI_SIZE; +} +EXPORT_SYMBOL(bcm63xx_nvram_get_psi_size); diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h index 62d6a3b..d76a486 100644 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h @@ -32,4 +32,6 @@ u8 *bcm63xx_nvram_get_name(void); */ int bcm63xx_nvram_get_mac_address(u8 *mac); +int bcm63xx_nvram_get_psi_size(void); + #endif /* BCM63XX_NVRAM_H */