Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Jonas Gorski <jogo@openwrt.org>
To: linux-mips@linux-mips.org
Cc: Ralf Baechle <ralf@linux-mips.org>,
	John Crispin <blogic@openwrt.org>,
	Maxime Bizon <mbizon@freebox.fr>,
	Florian Fainelli <florian@openwrt.org>,
	Kevin Cernekee <cernekee@gmail.com>
Subject: [PATCH 7/7] MIPS: BCM63XX: add flash detection for BCM6362
Date: Thu, 21 Mar 2013 16:03:20 +0100	[thread overview]
Message-ID: <1363878200-4523-7-git-send-email-jogo@openwrt.org> (raw)
In-Reply-To: <1363878200-4523-1-git-send-email-jogo@openwrt.org>

BCM6362 support booting from SPI flash and NAND.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/bcm63xx/dev-flash.c                     |    6 ++++++
 arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h |    1 +
 2 files changed, 7 insertions(+)

diff --git a/arch/mips/bcm63xx/dev-flash.c b/arch/mips/bcm63xx/dev-flash.c
index 58371c7..588d1ec 100644
--- a/arch/mips/bcm63xx/dev-flash.c
+++ b/arch/mips/bcm63xx/dev-flash.c
@@ -77,6 +77,12 @@ static int __init bcm63xx_detect_flash_type(void)
 			return BCM63XX_FLASH_TYPE_PARALLEL;
 		else
 			return BCM63XX_FLASH_TYPE_SERIAL;
+	case BCM6362_CPU_ID:
+		val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
+		if (val & STRAPBUS_6362_BOOT_SEL_SERIAL)
+			return BCM63XX_FLASH_TYPE_SERIAL;
+		else
+			return BCM63XX_FLASH_TYPE_NAND;
 	case BCM6368_CPU_ID:
 		val = bcm_gpio_readl(GPIO_STRAPBUS_REG);
 		switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
index 243bab9..3203fe4 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
@@ -1372,6 +1372,7 @@
 
 #define MISC_STRAPBUS_6362_REG		0x14
 #define STRAPBUS_6362_FCVO_SHIFT	1
+#define STRAPBUS_6362_HSSPI_CLK_FAST	(1 << 13)
 #define STRAPBUS_6362_FCVO_MASK		(0x1f << STRAPBUS_6362_FCVO_SHIFT)
 #define STRAPBUS_6362_BOOT_SEL_SERIAL	(1 << 15)
 #define STRAPBUS_6362_BOOT_SEL_NAND	(0 << 15)
-- 
1.7.10.4

  parent reply	other threads:[~2013-03-21 15:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21 15:00 [PATCH 0/7] add basic support for BCM6362 Jonas Gorski
2013-03-21 15:03 ` [PATCH 1/7] MIPS: BCM63XX: remove duplicate spi register definitions Jonas Gorski
2013-03-21 15:03   ` [PATCH 2/7] MIPS: BCM63XX: fix revision ID width Jonas Gorski
2013-03-21 15:03   ` [PATCH 3/7] MIPS: BCM63XX: rework chip detection Jonas Gorski
2013-03-21 15:03   ` [PATCH 4/7] MIPS: BCM63XX: add basic BCM6362 support Jonas Gorski
2013-03-21 15:03   ` [PATCH 5/7] MIPS: BCM63XX: enable SPI controller for BCM6362 Jonas Gorski
2013-03-21 15:03   ` [PATCH 6/7] MIPS: BCM63XX: enable pcie " Jonas Gorski
2013-03-21 15:03   ` Jonas Gorski [this message]
2013-03-21 17:26 ` [PATCH 0/7] add basic support " Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363878200-4523-7-git-send-email-jogo@openwrt.org \
    --to=jogo@openwrt.org \
    --cc=blogic@openwrt.org \
    --cc=cernekee@gmail.com \
    --cc=florian@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mbizon@freebox.fr \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox