Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Aug 2012 12:50:45 GMT
From:      Luiz Otavio O Souza <loos.br@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/170864: [patch] Move SPI flash from AR71XX_BASE (kernel) to board specific files
Message-ID:  <201208221250.q7MCojqp040981@red.freebsd.org>
Resent-Message-ID: <201208221300.q7MD0RcJ002319@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         170864
>Category:       kern
>Synopsis:       [patch] Move SPI flash from AR71XX_BASE (kernel) to board specific files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 22 13:00:27 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Luiz Otavio O Souza
>Release:        -current
>Organization:
>Environment:
FreeBSD rb450g 10.0-CURRENT FreeBSD 10.0-CURRENT #20 r238655:239327M: Thu Aug 16 20:09:08 BRT 2012     root@server01:/data/rb/rb450g/obj/mips.mips/data/rb/rb450g/src/sys/RB4XX  mips

>Description:
Not all routers/boards models built on top of AR71XX uses a SPI flash as storage device, so move the 'device mx25l' to board specific kernel files where it is used.

With this change we can use AR71XX_BASE based kernels with other kind of storages (like NAND).
>How-To-Repeat:

>Fix:
The proposed patch is also available at: http://loos.no-ip.org/rb/kernelconf-mx25l.patch

Patch attached with submission follows:

Index: mips/conf/AP96
===================================================================
--- mips/conf/AP96	(revision 238655)
+++ mips/conf/AP96	(working copy)
@@ -21,6 +21,9 @@
 
 options		AR71XX_ENV_UBOOT
 
+# On-board SPI flash
+device		mx25l
+
 # For DOS - enable if required
 options 	GEOM_PART_BSD
 options 	GEOM_PART_MBR
Index: mips/conf/ROUTERSTATION
===================================================================
--- mips/conf/ROUTERSTATION	(revision 238655)
+++ mips/conf/ROUTERSTATION	(working copy)
@@ -10,6 +10,9 @@
 
 # XXX Is there an RTC on the RS?
 
+# On-board SPI flash
+device		mx25l
+
 # GEOM modules
 device		geom_redboot	# to get access to the SPI flash partitions
 device		geom_uzip	# compressed in-memory filesystem support
Index: mips/conf/AR71XX_BASE.hints
===================================================================
--- mips/conf/AR71XX_BASE.hints	(revision 238655)
+++ mips/conf/AR71XX_BASE.hints	(working copy)
@@ -41,14 +41,11 @@
 hint.arge.1.msize=0x1000
 hint.arge.1.irq=3
 
-# SPI flash
+# SoC SPI controller
 hint.spi.0.at="nexus0"
 hint.spi.0.maddr=0x1f000000
 hint.spi.0.msize=0x10
 
-hint.mx25l.0.at="spibus0"
-hint.mx25l.0.cs=0
-
 # Watchdog
 hint.ar71xx_wdog.0.at="nexus0"
 
Index: mips/conf/PB47.hints
===================================================================
--- mips/conf/PB47.hints	(revision 238655)
+++ mips/conf/PB47.hints	(working copy)
@@ -1,6 +1,10 @@
 
 # $FreeBSD$
 
+# SPI flash
+hint.mx25l.0.at="spibus0"
+hint.mx25l.0.cs=0
+
 # There's two interfaces, but only one socket is populated.
 #
 # There's an AR8021 PHY attached to arge1.
Index: mips/conf/ROUTERSTATION.hints
===================================================================
--- mips/conf/ROUTERSTATION.hints	(revision 238655)
+++ mips/conf/ROUTERSTATION.hints	(working copy)
@@ -2,6 +2,10 @@
 # $FreeBSD$
 #
 
+# SPI flash
+hint.mx25l.0.at="spibus0"
+hint.mx25l.0.cs=0
+
 # Uncomment this hint for RS (not PRO)
 # PHY20 = 1 << 20
 hint.arge.0.phymask=0x100000
Index: mips/conf/RSPRO_MFS
===================================================================
--- mips/conf/RSPRO_MFS	(revision 238655)
+++ mips/conf/RSPRO_MFS	(working copy)
@@ -11,6 +11,9 @@
 # RTC - requires hackery in the spibus code to work
 device		pcf2123_rtc
 
+# On-board SPI flash
+device		mx25l
+
 # GEOM modules
 device		geom_redboot	# to get access to the SPI flash partitions
 device		geom_uzip	# compressed in-memory filesystem hackery!
Index: mips/conf/AR71XX_BASE
===================================================================
--- mips/conf/AR71XX_BASE	(revision 238655)
+++ mips/conf/AR71XX_BASE	(working copy)
@@ -101,10 +101,10 @@
 device		umass
 device		da
 
-# On-board SPI flash
+# SoC SPI controller
 device		spibus
 device		ar71xx_spi
-device		mx25l
+
 device		ar71xx_wdog
 
 device		uart
Index: mips/conf/ROUTERSTATION_MFS
===================================================================
--- mips/conf/ROUTERSTATION_MFS	(revision 238655)
+++ mips/conf/ROUTERSTATION_MFS	(working copy)
@@ -8,6 +8,9 @@
 ident		"ROUTERSTATION_MFS"
 hints		"ROUTERSTATION.hints"
 
+# On-board SPI flash
+device		mx25l
+
 # GEOM modules
 device		geom_redboot	# to get access to the SPI flash partitions
 device		geom_uzip	# compressed in-memory filesystem hackery!
Index: mips/conf/RSPRO.hints
===================================================================
--- mips/conf/RSPRO.hints	(revision 238655)
+++ mips/conf/RSPRO.hints	(working copy)
@@ -1,5 +1,9 @@
 # $FreeBSD$
 
+# SPI flash
+hint.mx25l.0.at="spibus0"
+hint.mx25l.0.cs=0
+
 # arge0 mdio bus
 hint.argemdio.0.at="nexus0"
 hint.argemdio.0.maddr=0x19000000
Index: mips/conf/AP94.hints
===================================================================
--- mips/conf/AP94.hints	(revision 238655)
+++ mips/conf/AP94.hints	(working copy)
@@ -1,5 +1,9 @@
 # $FreeBSD$
 
+# SPI flash
+hint.mx25l.0.at="spibus0"
+hint.mx25l.0.cs=0
+
 hint.arge.0.phymask=0x000c
 hint.arge.0.media=100
 hint.arge.0.fduplex=1
Index: mips/conf/AP96.hints
===================================================================
--- mips/conf/AP96.hints	(revision 238655)
+++ mips/conf/AP96.hints	(working copy)
@@ -1,5 +1,9 @@
 # $FreeBSD$
 
+# SPI flash
+hint.mx25l.0.at="spibus0"
+hint.mx25l.0.cs=0
+
 # arge0 MDIO bus - there's no arge1 MDIO bus for AR71xx
 hint.argemdio.0.at="nexus0"
 hint.argemdio.0.maddr=0x19000000
Index: mips/conf/RSPRO
===================================================================
--- mips/conf/RSPRO	(revision 238655)
+++ mips/conf/RSPRO	(working copy)
@@ -11,6 +11,9 @@
 # RTC - requires hackery in the spibus code to work
 device		pcf2123_rtc
 
+# On-board SPI flash
+device		mx25l
+
 # GEOM modules
 device		geom_redboot	# to get access to the SPI flash partitions
 device		geom_uzip	# compressed in-memory filesystem support
Index: mips/conf/PB47
===================================================================
--- mips/conf/PB47	(revision 238655)
+++ mips/conf/PB47	(working copy)
@@ -26,6 +26,9 @@
 # return a garbage MAC address.
 options		AR71XX_REALMEM=64*1024*1024
 
+# On-board SPI flash
+device		mx25l
+
 # For DOS - enable if required
 options		GEOM_PART_BSD
 options		GEOM_PART_MBR
Index: mips/conf/AP94
===================================================================
--- mips/conf/AP94	(revision 238655)
+++ mips/conf/AP94	(working copy)
@@ -17,6 +17,9 @@
 ident		"AP94"
 hints		"AP94.hints"
 
+# On-board SPI flash
+device		mx25l
+
 # GEOM modules
 device		geom_redboot	# to get access to the SPI flash partitions
 device		geom_uzip	# compressed in-memory filesystem hackery!
Index: mips/conf/RSPRO_STANDALONE
===================================================================
--- mips/conf/RSPRO_STANDALONE	(revision 238655)
+++ mips/conf/RSPRO_STANDALONE	(working copy)
@@ -12,6 +12,9 @@
 # RTC - requires hackery in the spibus code to work
 device		pcf2123_rtc
 
+# On-board SPI flash
+device		mx25l
+
 # GEOM modules
 device		geom_redboot	# to get access to the SPI flash partitions
 device		geom_uzip	# compressed in-memory filesystem support


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208221250.q7MCojqp040981>