* [patch 06/10] powerpc: multiplatformize embedded6xx Kconfig
From: arnd @ 2007-06-11 23:28 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20070611232824.489103547@arndb.de>
The existing embedded 6xx platforms will happily coexist
with each other in a single kernel if you let them.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Index: linux-2.6/arch/powerpc/platforms/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig
+++ linux-2.6/arch/powerpc/platforms/Kconfig
@@ -12,10 +12,6 @@ config PPC_MULTIPLATFORM
RS/6000 machine, an Apple machine, or a PReP, CHRP,
Maple or Cell-based machine.
-config EMBEDDED6xx
- bool "Embedded 6xx/7xx/7xxx-based board"
- depends on PPC32 && (BROKEN||BROKEN_ON_SMP)
-
config APUS
bool "Amiga-APUS"
depends on PPC32 && BROKEN
@@ -33,7 +29,6 @@ config CLASSIC32
source "arch/powerpc/platforms/pseries/Kconfig"
source "arch/powerpc/platforms/iseries/Kconfig"
source "arch/powerpc/platforms/chrp/Kconfig"
-source "arch/powerpc/platforms/52xx/Kconfig"
source "arch/powerpc/platforms/powermac/Kconfig"
source "arch/powerpc/platforms/prep/Kconfig"
source "arch/powerpc/platforms/maple/Kconfig"
@@ -42,6 +37,7 @@ source "arch/powerpc/platforms/celleb/Kc
source "arch/powerpc/platforms/ps3/Kconfig"
source "arch/powerpc/platforms/cell/Kconfig"
source "arch/powerpc/platforms/8xx/Kconfig"
+source "arch/powerpc/platforms/52xx/Kconfig"
source "arch/powerpc/platforms/82xx/Kconfig"
source "arch/powerpc/platforms/83xx/Kconfig"
source "arch/powerpc/platforms/85xx/Kconfig"
Index: linux-2.6/arch/powerpc/platforms/embedded6xx/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -1,9 +1,10 @@
-choice
- prompt "Machine Type"
- depends on EMBEDDED6xx
+config EMBEDDED6xx
+ bool "Embedded 6xx"
config LINKSTATION
bool "Linkstation / Kurobox(HG) from Buffalo"
+ depends on EMBEDDED6xx
+ depends on (BROKEN || BROKEN_ON_SMP)
select MPIC
select FSL_SOC
select PPC_UDBG_16550 if SERIAL_8250
@@ -17,6 +18,8 @@ config LINKSTATION
config MPC7448HPC2
bool "Freescale MPC7448HPC2(Taiga)"
+ depends on EMBEDDED6xx
+ depends on (BROKEN || BROKEN_ON_SMP)
select TSI108_BRIDGE
select DEFAULT_UIMAGE
select PPC_UDBG_16550
@@ -26,6 +29,7 @@ config MPC7448HPC2
config PPC_HOLLY
bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)"
+ depends on EMBEDDED6xx
select TSI108_BRIDGE
select PPC_UDBG_16550
help
@@ -34,12 +38,12 @@ config PPC_HOLLY
config PPC_PRPMC2800
bool "Motorola-PrPMC2800"
+ depends on EMBEDDED6xx
select MV64X60
select NOT_COHERENT_CACHE
select WANT_DEVICE_TREE
help
This option enables support for the Motorola PrPMC2800 board
-endchoice
config TSI108_BRIDGE
bool
--
^ permalink raw reply
* [patch 10/10] powerpc: autoselect optimal -mcpu= flag by platform
From: arnd @ 2007-06-11 23:28 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20070611232824.489103547@arndb.de>
We can choose the -mcpu= gcc flags for compiling the kernel
based on the platform that we build for. In case of multiplatform
kernels, this chooses a setting for a common subset.
When using a platform type that can use different CPUs, a
new option CONFIG_PPC_CPU_SELECTION can be enabled to select
more specifically which CPUs the kernel will be able to
run on.
This replaces the CONFIG_POWER4_ONLY option with an much more
generic approach.
Also, when CONFIG_PPC_CPU_SELECTION is set, it is now possible
to select a CPU to tune for by means of the -mtune= option.
I tried to be very careful when coding the specific rules into
the Kconfig language, but it would be good to have a few
people sanity-checking them.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-2.6/arch/powerpc/platforms/4xx/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/4xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/4xx/Kconfig
@@ -87,6 +87,7 @@ endmenu
# 40x specific CPU modules, selected based on the board above.
config NP405H
bool
+ select CPU_405
#depends on ASH
# OAK doesn't exist but wanted to keep this around for any future 403GCX boards
@@ -94,6 +95,7 @@ config 403GCX
bool
#depends on OAK
select IBM405_ERR51
+ select CPU_403
config 405GP
bool
@@ -102,19 +104,23 @@ config 405GP
config 405EP
bool
+ select CPU_405
config 405GPR
bool
+ select CPU_405
config VIRTEX_II_PRO
bool
select IBM405_ERR77
select IBM405_ERR51
+ select CPU_405
config STB03xxx
bool
select IBM405_ERR77
select IBM405_ERR51
+ select CPU_405
# 40x errata/workaround config symbols, selected by the CPU models above
@@ -168,20 +174,25 @@ config 440EP
bool
select PPC_FPU
select IBM440EP_ERR42
+ select CPU_440
config 440GP
bool
select IBM_NEW_EMAC_ZMII
+ select CPU_440
config 440GX
bool
+ select CPU_440
config 440SP
bool
+ select CPU_440
config 440A
bool
depends on 440GX
+ select CPU_440
default y
# 44x errata/workaround config symbols, selected by the CPU models above
Index: linux-2.6/arch/powerpc/platforms/52xx/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/52xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/52xx/Kconfig
@@ -1,6 +1,7 @@
config PPC_MPC52xx
bool "Freescale 52xx"
select FSL_SOC
+ depends on 6xx
config PPC_EFIKA
bool "bPlan Efika 5k2. MPC5200B based computer"
@@ -9,6 +10,7 @@ config PPC_EFIKA
select PPC_RTAS
select RTAS_PROC
select PPC_NATIVE
+ select CPU_603e
default n
config PPC_LITE5200
@@ -16,6 +18,7 @@ config PPC_LITE5200
depends on PPC_MULTIPLATFORM && PPC32
depends on PPC_MPC52xx
select PPC_MPC5200
+ select CPU_603e
default n
config PPC_MPC5200
Index: linux-2.6/arch/powerpc/platforms/82xx/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/82xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/82xx/Kconfig
@@ -1,6 +1,7 @@
config PPC_82xx
bool "Freescale 82xx"
depends on PPC_MULTIPLATFORM && 6xx
+ select CPU_603e
config MPC82xx_ADS
bool "Freescale MPC82xx ADS"
Index: linux-2.6/arch/powerpc/platforms/83xx/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/83xx/Kconfig
@@ -4,6 +4,7 @@ config PPC_83xx
select FSL_SOC
select 83xx
select WANT_DEVICE_TREE
+ select CPU_603e
config MPC8313_RDB
bool "Freescale MPC8313 RDB"
Index: linux-2.6/arch/powerpc/platforms/86xx/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/86xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/86xx/Kconfig
@@ -4,6 +4,7 @@ config PPC_86xx
select FSL_SOC
select FSL_PCIE
select ALTIVEC
+ select CPU_74xx
help
The Freescale E600 SoCs have 74xx cores.
Index: linux-2.6/arch/powerpc/platforms/Kconfig.cputype
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig.cputype
+++ linux-2.6/arch/powerpc/platforms/Kconfig.cputype
@@ -45,9 +45,232 @@ config E200
endchoice
-config POWER4_ONLY
- bool "Optimize for POWER4"
+config PPC_CPU_SELECTION
+ bool "Advanced CPU selection"
+
+config CPU_DEFAULT
+ bool "Don't specify -mcpu= to gcc" if PPC_CPU_SELECTION
+
+config CPU_RS64
+ bool "RS64" if PPC_CPU_SELECTION
+ depends on PPC64
+ default y if PPC_PSERIES || PPC_ISERIES
+
+config CPU_POWER3
+ bool "IBM Power3" if PPC_CPU_SELECTION
+ depends on PPC64
+ default y if PPC_PSERIES || PPC_ISERIES
+
+config CPU_POWER4
+ bool "IBM Power4" if PPC_CPU_SELECTION
+ depends on PPC64
+ default y if PPC_PSERIES || PPC_ISERIES
+
+config CPU_POWER5
+ bool "IBM Power5" if PPC_CPU_SELECTION
+ depends on PPC64
+ default y if PPC_PSERIES
+
+config CPU_POWER6
+ bool "IBM Power6" if PPC_CPU_SELECTION
+ depends on PPC64
+ default y if PPC_PSERIES
+ select ALTIVEC
+
+config CPU_970
+ bool "IBM PowerPC 970 (G5)" if PPC_CPU_SELECTION
+ depends on PPC64
+ default y if PPC_PSERIES
+ select ALTIVEC
+
+config CPU_CELL
+ bool "Sony/Toshiba/IBM Cell Broadband Engine" if PPC_CPU_SELECTION
depends on PPC64
+ select ALTIVEC
+
+config CPU_PA6T
+ bool "PA Semi PA6T-1682M" if PPC_CPU_SELECTION
+ depends on PPC64
+ select ALTIVEC
+
+config CPU_601
+ bool "PowerPC 601 (G1)" if PPC_CPU_SELECTION
+ depends on 6xx
+ default y if PPC_CHRP || PPC_PREP
+
+config CPU_603e
+ bool "PowerPC 603e, 604, 604e, 52xx, 82xx, 83xx (G2)" if PPC_CPU_SELECTION
+ depends on 6xx
+ default y if PPC_CHRP || PPC_PREP || PPC_PMAC
+
+config CPU_7xx
+ bool "PowerPC 740/750 (G3)" if PPC_CPU_SELECTION
+ depends on 6xx
+ default y if PPC_PMAC
+
+config CPU_74xx
+ bool "PowerPC 74xx, 86xx (G4)" if PPC_CPU_SELECTION
+ depends on 6xx
+ default y if PPC_PMAC
+ select ALTIVEC
+
+config CPU_403
+ bool "AMCC 403" if PPC_CPU_SELECTION
+ depends on 40x
+
+config CPU_405
+ bool "AMCC 405" if PPC_CPU_SELECTION
+ depends on 40x
+
+config CPU_440
+ bool "AMCC 440" if PPC_CPU_SELECTION
+ depends on 44x
+
+choice
+ prompt "Tune for processor type" if PPC_CPU_SELECTION
+ default TUNE_POWER4 if PPC64
+ default TUNE_DEFAULT
+
+config TUNE_DEFAULT
+ bool "Don't specify -mtune= to gcc"
+
+config TUNE_RS64
+ bool "RS64"
+ depends on CPU_RS64
+
+config TUNE_POWER3
+ bool "IBM Power3"
+ depends on CPU_POWER3
+
+config TUNE_POWER4
+ bool "IBM Power4"
+ depends on CPU_POWER4
+
+config TUNE_POWER5
+ bool "IBM Power5"
+ depends on CPU_POWER5
+
+config TUNE_POWER6
+ bool "IBM Power6"
+ depends on CPU_POWER6
+
+config TUNE_970
+ bool "IBM PowerPC 970 (G5)"
+ depends on CPU_970
+
+config TUNE_CELL
+ bool "Sony/Toshiba/IBM Cell Broadband Engine"
+ depends on CPU_CELL
+
+config TUNE_PA6T
+ bool "PA Semi PA6T-1682M"
+ depends on CPU_PA6T
+
+config TUNE_601
+ bool "PowerPC 601 (G1)"
+ depends on CPU_601
+
+config TUNE_603e
+ bool "PowerPC 603e, 604, 604e, 52xx, 82xx, 83xx (G2)"
+ depends on CPU_603e
+
+config TUNE_7xx
+ bool "PowerPC 740/750 (G3)"
+ depends on CPU_7xx
+
+config TUNE_74xx
+ bool "PowerPC 74xx, 86xx (G4)"
+ depends on CPU_74xx
+
+config TUNE_821
+ bool "Freescale MPC821"
+ depends on 8xx
+
+config TUNE_823
+ bool "Freescale MPC823"
+ depends on 8xx
+
+config TUNE_860
+ bool "Freescale MPC860"
+ depends on 8xx
+
+config TUNE_403
+ bool "AMCC 403"
+ depends on CPU_403
+
+config TUNE_405
+ bool "AMCC 405"
+ depends on CPU_405
+
+config TUNE_440
+ bool "AMCC 440"
+ depends on CPU_440
+
+config TUNE_8540
+ bool "Freescale MPC8540"
+ depends on PPC_85xx
+
+config TUNE_E200
+ bool "Freescale e200"
+ depends on E200
+
+endchoice
+
+config PPC_MCPU
+ string
+ default "" if CPU_DEFAULT
+ default "-mcpu=powerpc64" if CPU_POWER3 || CPU_RS64
+ default "-mcpu=power4" if (CPU_POWER5 || CPU_POWER6) && (CPU_970 || CPU_CELL || CPU_PA6T)
+ default "-mcpu=power4" if CPU_POWER4
+ default "-mcpu=power5" if CPU_POWER5
+ default "-mcpu=power6" if CPU_POWER6
+ default "-mcpu=970" if CPU_970
+ default "-mcpu=cell" if CPU_CELL
+ default "-mcpu=pa6t" if CPU_PA6T
+ default "-mcpu=powerpc64" if PPC64
+ default "-mcpu=powerpc" if CPU_601 && (CPU_603e || CPU_7xx || CPU_74xx)
+ default "-mcpu=601" if CPU_601
+ default "-mcpu=603e" if CPU_603e
+ default "-mcpu=750" if CPU_7xx
+ default "-mcpu=7450" if CPU_74xx
+ default "-mcpu=powerpc" if (CPU_403 && CPU_405)
+ default "-mcpu=powerpc" if (CPU_403 || CPU_405) && CPU_440
+ default "-mcpu=403" if CPU_403
+ default "-mcpu=405" if CPU_405
+ default "-mcpu=440" if CPU_440
+ default "-mcpu=860" if PPC_8xx
+ default "-mcpu=8540" if PPC_85xx
+ default "-mcpu=e200" if E200
+ default "-mcpu=powerpc"
+
+config PPC_MTUNE
+ string
+ default "" if TUNE_DEFAULT
+ default "-mtune=power3" if TUNE_POWER3
+ default "-mtune=rs64a" if TUNE_RS64
+ default "-mtune=power4" if TUNE_POWER4
+ default "-mtune=power5" if TUNE_POWER5
+ default "-mtune=power6" if TUNE_POWER6
+ default "-mtune=970" if TUNE_970
+ default "-mtune=cell" if TUNE_CELL
+ default "-mtune=pa6t" if TUNE_PA6T
+ default "-mtune=601" if TUNE_601
+ default "-mtune=603e" if TUNE_603e
+ default "-mtune=750" if TUNE_7xx
+ default "-mtune=7450" if TUNE_74xx
+ default "-mtune=403" if TUNE_403
+ default "-mtune=405" if TUNE_405
+ default "-mtune=440" if TUNE_440
+ default "-mtune=821" if TUNE_821
+ default "-mtune=823" if TUNE_823
+ default "-mtune=860" if TUNE_860
+ default "-mtune=8540" if TUNE_8540
+ default "-mtune=e200" if TUNE_E200
+ default "-mtune=power4" if PPC64
+
+config POWER4_ONLY
+ def_bool y
+ depends on PPC64 && !CPU_POWER3 && !CPU_RS64
default n
---help---
Cause the compiler to optimize for POWER4/POWER5/PPC970 processors.
Index: linux-2.6/arch/powerpc/platforms/cell/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/Kconfig
+++ linux-2.6/arch/powerpc/platforms/cell/Kconfig
@@ -20,6 +20,7 @@ config PPC_IBM_CELL_BLADE
select MMIO_NVRAM
select PPC_UDBG_16550
select UDBG_RTAS_CONSOLE
+ select CPU_CELL
menu "Cell Broadband Engine options"
depends on PPC_CELL
Index: linux-2.6/arch/powerpc/platforms/celleb/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/celleb/Kconfig
+++ linux-2.6/arch/powerpc/platforms/celleb/Kconfig
@@ -2,6 +2,7 @@ config PPC_CELLEB
bool "Toshiba's Cell Reference Set 'Celleb' Architecture"
depends on PPC_MULTIPLATFORM && PPC64
select PPC_CELL
+ select CPU_CELL
select PPC_OF_PLATFORM_PCI
select HAS_TXX9_SERIAL
select PPC_UDBG_BEAT
Index: linux-2.6/arch/powerpc/platforms/embedded6xx/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -1,5 +1,6 @@
config EMBEDDED6xx
bool "Embedded 6xx"
+ depends on 6xx
config LINKSTATION
bool "Linkstation / Kurobox(HG) from Buffalo"
@@ -9,6 +10,7 @@ config LINKSTATION
select FSL_SOC
select PPC_UDBG_16550 if SERIAL_8250
select DEFAULT_UIMAGE
+ select CPU_603e
help
Select LINKSTATION if configuring for one of PPC- (MPC8241)
based NAS systems from Buffalo Technology. So far only
@@ -23,6 +25,7 @@ config MPC7448HPC2
select TSI108_BRIDGE
select DEFAULT_UIMAGE
select PPC_UDBG_16550
+ select CPU_74xx
help
Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
platform
@@ -32,6 +35,7 @@ config PPC_HOLLY
depends on EMBEDDED6xx
select TSI108_BRIDGE
select PPC_UDBG_16550
+ select CPU_7xx
help
Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval
Board with TSI108/9 bridge (Hickory/Holly)
@@ -42,6 +46,7 @@ config PPC_PRPMC2800
select MV64X60
select NOT_COHERENT_CACHE
select WANT_DEVICE_TREE
+ select CPU_74xx
help
This option enables support for the Motorola PrPMC2800 board
Index: linux-2.6/arch/powerpc/platforms/maple/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/maple/Kconfig
+++ linux-2.6/arch/powerpc/platforms/maple/Kconfig
@@ -11,6 +11,7 @@ config PPC_MAPLE
select PPC_RTAS
select MMIO_NVRAM
select ATA_NONSTANDARD if ATA
+ select CPU_970
default n
help
This option enables support for the Maple 970FX Evaluation Board.
Index: linux-2.6/arch/powerpc/platforms/pasemi/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pasemi/Kconfig
+++ linux-2.6/arch/powerpc/platforms/pasemi/Kconfig
@@ -5,6 +5,7 @@ config PPC_PASEMI
select MPIC
select PPC_UDBG_16550
select PPC_NATIVE
+ select CPU_PA6T
help
This option enables support for PA Semi's PWRficient line
of SoC processors, including PA6T-1682M
Index: linux-2.6/arch/powerpc/platforms/powermac/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/powermac/Kconfig
+++ linux-2.6/arch/powerpc/platforms/powermac/Kconfig
@@ -15,6 +15,7 @@ config PPC_PMAC64
select MPIC_U3_HT_IRQS
select GENERIC_TBSYNC
select PPC_970_NAP
+ select CPU_970
default y
Index: linux-2.6/arch/powerpc/platforms/ps3/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/ps3/Kconfig
+++ linux-2.6/arch/powerpc/platforms/ps3/Kconfig
@@ -2,6 +2,7 @@ config PPC_PS3
bool "Sony PS3 (incomplete)"
depends on PPC_MULTIPLATFORM && PPC64
select PPC_CELL
+ select CPU_CELL
select USB_ARCH_HAS_OHCI
select USB_OHCI_LITTLE_ENDIAN
select USB_OHCI_BIG_ENDIAN_MMIO
Index: linux-2.6/arch/powerpc/Makefile
===================================================================
--- linux-2.6.orig/arch/powerpc/Makefile
+++ linux-2.6/arch/powerpc/Makefile
@@ -78,24 +78,23 @@ LINUXINCLUDE += $(LINUXINCLUDE-y)
CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__
+OPTFLAGS := $(call cc-option,$(CONFIG_PPC_MCPU)) $(call cc-option,$(CONFIG_PPC_MTUNE))
+
+# compilers older than 4.0.0 can only set -maltivec in 64 bit mode
+# when compiling for 970
ifeq ($(CONFIG_PPC64),y)
GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi)
-
ifeq ($(CONFIG_POWER4_ONLY),y)
ifeq ($(CONFIG_ALTIVEC),y)
ifeq ($(GCC_BROKEN_VEC),y)
- CFLAGS += $(call cc-option,-mcpu=970)
-else
- CFLAGS += $(call cc-option,-mcpu=power4)
+ OPTFLAGS := $(call cc-option,-mcpu=970) $(call cc-option,$(CONFIG_PPC_MTUNE))
endif
-else
- CFLAGS += $(call cc-option,-mcpu=power4)
endif
-else
- CFLAGS += $(call cc-option,-mtune=power4)
endif
endif
+CFLAGS += $(OPTFLAGS)
+
# No AltiVec instruction when building kernel
CFLAGS += $(call cc-option,-mno-altivec)
@@ -107,10 +106,6 @@ CFLAGS += $(call cc-option,-funit-at-a-t
# often slow when they are implemented at all
CFLAGS += -mno-string
-ifeq ($(CONFIG_6xx),y)
-CFLAGS += -mcpu=powerpc
-endif
-
cpu-as-$(CONFIG_4xx) += -Wa,-m405
cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
Index: linux-2.6/arch/powerpc/platforms/apus/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/apus/Kconfig
+++ linux-2.6/arch/powerpc/platforms/apus/Kconfig
@@ -1,6 +1,7 @@
config APUS
bool "Amiga-APUS"
depends on PPC32 && BROKEN
+ select CPU_603e
help
Select APUS if configuring for a PowerUP Amiga.
More information is available at:
--
^ permalink raw reply
* [patch 01/10] powerpc: split out CPU specific options into a new Kconfig file
From: arnd @ 2007-06-11 23:28 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20070611232824.489103547@arndb.de>
A lot of the options in arch/powerpc/Kconfig deal with the CPU menu,
and my next patches add more to them. Moving them to a new
arch/powerpc/platforms/Kconfig.cputype file makes it easier to
follow.
There are no functional changes in here.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-2.6/arch/powerpc/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/Kconfig
+++ linux-2.6/arch/powerpc/Kconfig
@@ -4,12 +4,7 @@
mainmenu "Linux/PowerPC Kernel Configuration"
-config PPC64
- bool "64-bit kernel"
- default n
- help
- This option selects whether a 32-bit or a 64-bit kernel
- will be built.
+source "arch/powerpc/platforms/Kconfig.cputype"
config PPC_PM_NEEDS_RTC_LIB
bool
@@ -132,123 +127,6 @@ config PPC64_SWSUSP
depends on PPC64 && (BROKEN || (PPC_PMAC64 && EXPERIMENTAL))
default y
-menu "Processor support"
-choice
- prompt "Processor Type"
- depends on PPC32
- default 6xx
-
-config CLASSIC32
- bool "52xx/6xx/7xx/74xx"
- select PPC_FPU
- select 6xx
- help
- There are four families of PowerPC chips supported. The more common
- types (601, 603, 604, 740, 750, 7400), the Motorola embedded
- versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the AMCC
- embedded versions (403 and 405) and the high end 64 bit Power
- processors (POWER 3, POWER4, and IBM PPC970 also known as G5).
-
- This option is the catch-all for 6xx types, including some of the
- embedded versions. Unless there is see an option for the specific
- chip family you are using, you want this option.
-
- You do not want this if you are building a kernel for a 64 bit
- IBM RS/6000 or an Apple G5, choose 6xx.
-
- If unsure, select this option
-
- Note that the kernel runs in 32-bit mode even on 64-bit chips.
-
-config PPC_82xx
- bool "Freescale 82xx"
- select 6xx
- select PPC_FPU
-
-config PPC_83xx
- bool "Freescale 83xx"
- select 6xx
- select FSL_SOC
- select 83xx
- select PPC_FPU
- select WANT_DEVICE_TREE
-
-config PPC_85xx
- bool "Freescale 85xx"
- select E500
- select FSL_SOC
- select 85xx
- select WANT_DEVICE_TREE
-
-config PPC_86xx
- bool "Freescale 86xx"
- select 6xx
- select FSL_SOC
- select FSL_PCIE
- select PPC_FPU
- select ALTIVEC
- help
- The Freescale E600 SoCs have 74xx cores.
-
-config PPC_8xx
- bool "Freescale 8xx"
- select FSL_SOC
- select 8xx
-
-config 40x
- bool "AMCC 40x"
- select PPC_DCR_NATIVE
-
-config 44x
- bool "AMCC 44x"
- select PPC_DCR_NATIVE
- select WANT_DEVICE_TREE
-
-config E200
- bool "Freescale e200"
-
-endchoice
-
-config POWER4_ONLY
- bool "Optimize for POWER4"
- depends on PPC64
- default n
- ---help---
- Cause the compiler to optimize for POWER4/POWER5/PPC970 processors.
- The resulting binary will not work on POWER3 or RS64 processors
- when compiled with binutils 2.15 or later.
-
-config POWER3
- bool
- depends on PPC64
- default y if !POWER4_ONLY
-
-config POWER4
- depends on PPC64
- def_bool y
-
-config 6xx
- bool
-
-# this is temp to handle compat with arch=ppc
-config 8xx
- bool
-
-# this is temp to handle compat with arch=ppc
-config 83xx
- bool
-
-# this is temp to handle compat with arch=ppc
-config 85xx
- bool
-
-config E500
- bool
-
-config PPC_FPU
- bool
- default y if PPC64
-
config PPC_DCR_NATIVE
bool
default n
@@ -267,134 +145,6 @@ config PPC_OF_PLATFORM_PCI
depends on PPC64 # not supported on 32 bits yet
default n
-config 4xx
- bool
- depends on 40x || 44x
- default y
-
-config BOOKE
- bool
- depends on E200 || E500 || 44x
- default y
-
-config FSL_BOOKE
- bool
- depends on E200 || E500
- default y
-
-config PTE_64BIT
- bool
- depends on 44x || E500
- default y if 44x
- default y if E500 && PHYS_64BIT
-
-config PHYS_64BIT
- bool 'Large physical address support' if E500
- depends on 44x || E500
- select RESOURCES_64BIT
- default y if 44x
- ---help---
- This option enables kernel support for larger than 32-bit physical
- addresses. This features is not be available on all e500 cores.
-
- If in doubt, say N here.
-
-config ALTIVEC
- bool "AltiVec Support"
- depends on CLASSIC32 || POWER4
- ---help---
- This option enables kernel support for the Altivec extensions to the
- PowerPC processor. The kernel currently supports saving and restoring
- altivec registers, and turning on the 'altivec enable' bit so user
- processes can execute altivec instructions.
-
- This option is only usefully if you have a processor that supports
- altivec (G4, otherwise known as 74xx series), but does not have
- any affect on a non-altivec cpu (it does, however add code to the
- kernel).
-
- If in doubt, say Y here.
-
-config SPE
- bool "SPE Support"
- depends on E200 || E500
- default y
- ---help---
- This option enables kernel support for the Signal Processing
- Extensions (SPE) to the PowerPC processor. The kernel currently
- supports saving and restoring SPE registers, and turning on the
- 'spe enable' bit so user processes can execute SPE instructions.
-
- This option is only useful if you have a processor that supports
- SPE (e500, otherwise known as 85xx series), but does not have any
- effect on a non-spe cpu (it does, however add code to the kernel).
-
- If in doubt, say Y here.
-
-config PPC_STD_MMU
- bool
- depends on 6xx || POWER3 || POWER4 || PPC64
- default y
-
-config PPC_STD_MMU_32
- def_bool y
- depends on PPC_STD_MMU && PPC32
-
-config PPC_MM_SLICES
- bool
- default y if HUGETLB_PAGE
- default n
-
-config VIRT_CPU_ACCOUNTING
- bool "Deterministic task and CPU time accounting"
- depends on PPC64
- default y
- help
- Select this option to enable more accurate task and CPU time
- accounting. This is done by reading a CPU counter on each
- kernel entry and exit and on transitions within the kernel
- between system, softirq and hardirq state, so there is a
- small performance impact. This also enables accounting of
- stolen time on logically-partitioned systems running on
- IBM POWER5-based machines.
-
- If in doubt, say Y here.
-
-config SMP
- depends on PPC_STD_MMU
- bool "Symmetric multi-processing support"
- ---help---
- This enables support for systems with more than one CPU. If you have
- a system with only one CPU, say N. If you have a system with more
- than one CPU, say Y. Note that the kernel does not currently
- support SMP machines with 603/603e/603ev or PPC750 ("G3") processors
- since they have inadequate hardware support for multiprocessor
- operation.
-
- If you say N here, the kernel will run on single and multiprocessor
- machines, but will use only one CPU of a multiprocessor machine. If
- you say Y here, the kernel will run on single-processor machines.
- On a single-processor machine, the kernel will run faster if you say
- N here.
-
- If you don't know what to do here, say N.
-
-config NR_CPUS
- int "Maximum number of CPUs (2-128)"
- range 2 128
- depends on SMP
- default "32" if PPC64
- default "4"
-
-config NOT_COHERENT_CACHE
- bool
- depends on 4xx || 8xx || E200
- default y
-
-config CONFIG_CHECK_CACHE_COHERENCY
- bool
-endmenu
-
source "init/Kconfig"
source "arch/powerpc/platforms/Kconfig"
Index: linux-2.6/arch/powerpc/platforms/Kconfig.cputype
===================================================================
--- /dev/null
+++ linux-2.6/arch/powerpc/platforms/Kconfig.cputype
@@ -0,0 +1,252 @@
+config PPC64
+ bool "64-bit kernel"
+ default n
+ help
+ This option selects whether a 32-bit or a 64-bit kernel
+ will be built.
+
+menu "Processor support"
+choice
+ prompt "Processor Type"
+ depends on PPC32
+ default 6xx
+
+config CLASSIC32
+ bool "52xx/6xx/7xx/74xx"
+ select PPC_FPU
+ select 6xx
+ help
+ There are four families of PowerPC chips supported. The more common
+ types (601, 603, 604, 740, 750, 7400), the Motorola embedded
+ versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the AMCC
+ embedded versions (403 and 405) and the high end 64 bit Power
+ processors (POWER 3, POWER4, and IBM PPC970 also known as G5).
+
+ This option is the catch-all for 6xx types, including some of the
+ embedded versions. Unless there is see an option for the specific
+ chip family you are using, you want this option.
+
+ You do not want this if you are building a kernel for a 64 bit
+ IBM RS/6000 or an Apple G5, choose 6xx.
+
+ If unsure, select this option
+
+ Note that the kernel runs in 32-bit mode even on 64-bit chips.
+
+config PPC_82xx
+ bool "Freescale 82xx"
+ select 6xx
+ select PPC_FPU
+
+config PPC_83xx
+ bool "Freescale 83xx"
+ select 6xx
+ select FSL_SOC
+ select 83xx
+ select PPC_FPU
+ select WANT_DEVICE_TREE
+
+config PPC_85xx
+ bool "Freescale 85xx"
+ select E500
+ select FSL_SOC
+ select 85xx
+ select WANT_DEVICE_TREE
+
+config PPC_86xx
+ bool "Freescale 86xx"
+ select 6xx
+ select FSL_SOC
+ select FSL_PCIE
+ select PPC_FPU
+ select ALTIVEC
+ help
+ The Freescale E600 SoCs have 74xx cores.
+
+config PPC_8xx
+ bool "Freescale 8xx"
+ select FSL_SOC
+ select 8xx
+
+config 40x
+ bool "AMCC 40x"
+ select PPC_DCR_NATIVE
+
+config 44x
+ bool "AMCC 44x"
+ select PPC_DCR_NATIVE
+ select WANT_DEVICE_TREE
+
+config E200
+ bool "Freescale e200"
+
+endchoice
+
+config POWER4_ONLY
+ bool "Optimize for POWER4"
+ depends on PPC64
+ default n
+ ---help---
+ Cause the compiler to optimize for POWER4/POWER5/PPC970 processors.
+ The resulting binary will not work on POWER3 or RS64 processors
+ when compiled with binutils 2.15 or later.
+
+config POWER3
+ bool
+ depends on PPC64
+ default y if !POWER4_ONLY
+
+config POWER4
+ depends on PPC64
+ def_bool y
+
+config 6xx
+ bool
+
+# this is temp to handle compat with arch=ppc
+config 8xx
+ bool
+
+# this is temp to handle compat with arch=ppc
+config 83xx
+ bool
+
+# this is temp to handle compat with arch=ppc
+config 85xx
+ bool
+
+config E500
+ bool
+
+config PPC_FPU
+ bool
+ default y if PPC64
+
+config 4xx
+ bool
+ depends on 40x || 44x
+ default y
+
+config BOOKE
+ bool
+ depends on E200 || E500 || 44x
+ default y
+
+config FSL_BOOKE
+ bool
+ depends on E200 || E500
+ default y
+
+config PTE_64BIT
+ bool
+ depends on 44x || E500
+ default y if 44x
+ default y if E500 && PHYS_64BIT
+
+config PHYS_64BIT
+ bool 'Large physical address support' if E500
+ depends on 44x || E500
+ select RESOURCES_64BIT
+ default y if 44x
+ ---help---
+ This option enables kernel support for larger than 32-bit physical
+ addresses. This features is not be available on all e500 cores.
+
+ If in doubt, say N here.
+
+config ALTIVEC
+ bool "AltiVec Support"
+ depends on CLASSIC32 || POWER4
+ ---help---
+ This option enables kernel support for the Altivec extensions to the
+ PowerPC processor. The kernel currently supports saving and restoring
+ altivec registers, and turning on the 'altivec enable' bit so user
+ processes can execute altivec instructions.
+
+ This option is only usefully if you have a processor that supports
+ altivec (G4, otherwise known as 74xx series), but does not have
+ any affect on a non-altivec cpu (it does, however add code to the
+ kernel).
+
+ If in doubt, say Y here.
+
+config SPE
+ bool "SPE Support"
+ depends on E200 || E500
+ default y
+ ---help---
+ This option enables kernel support for the Signal Processing
+ Extensions (SPE) to the PowerPC processor. The kernel currently
+ supports saving and restoring SPE registers, and turning on the
+ 'spe enable' bit so user processes can execute SPE instructions.
+
+ This option is only useful if you have a processor that supports
+ SPE (e500, otherwise known as 85xx series), but does not have any
+ effect on a non-spe cpu (it does, however add code to the kernel).
+
+ If in doubt, say Y here.
+
+config PPC_STD_MMU
+ bool
+ depends on 6xx || POWER3 || POWER4 || PPC64
+ default y
+
+config PPC_STD_MMU_32
+ def_bool y
+ depends on PPC_STD_MMU && PPC32
+
+config PPC_MM_SLICES
+ bool
+ default y if HUGETLB_PAGE
+ default n
+
+config VIRT_CPU_ACCOUNTING
+ bool "Deterministic task and CPU time accounting"
+ depends on PPC64
+ default y
+ help
+ Select this option to enable more accurate task and CPU time
+ accounting. This is done by reading a CPU counter on each
+ kernel entry and exit and on transitions within the kernel
+ between system, softirq and hardirq state, so there is a
+ small performance impact. This also enables accounting of
+ stolen time on logically-partitioned systems running on
+ IBM POWER5-based machines.
+
+ If in doubt, say Y here.
+
+config SMP
+ depends on PPC_STD_MMU
+ bool "Symmetric multi-processing support"
+ ---help---
+ This enables support for systems with more than one CPU. If you have
+ a system with only one CPU, say N. If you have a system with more
+ than one CPU, say Y. Note that the kernel does not currently
+ support SMP machines with 603/603e/603ev or PPC750 ("G3") processors
+ since they have inadequate hardware support for multiprocessor
+ operation.
+
+ If you say N here, the kernel will run on single and multiprocessor
+ machines, but will use only one CPU of a multiprocessor machine. If
+ you say Y here, the kernel will run on single-processor machines.
+ On a single-processor machine, the kernel will run faster if you say
+ N here.
+
+ If you don't know what to do here, say N.
+
+config NR_CPUS
+ int "Maximum number of CPUs (2-128)"
+ range 2 128
+ depends on SMP
+ default "32" if PPC64
+ default "4"
+
+config NOT_COHERENT_CACHE
+ bool
+ depends on 4xx || 8xx || E200
+ default y
+
+config CONFIG_CHECK_CACHE_COHERENCY
+ bool
+
+endmenu
--
^ permalink raw reply
* [patch 09/10] powerpc: autoselect PPC_MULTIPLATFORM
From: arnd @ 2007-06-11 23:28 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20070611232824.489103547@arndb.de>
The multiplatform option has become pointless since all
platforms types are multiplatform by definition.
Keep the symbol around in case some code still uses it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-2.6/arch/powerpc/platforms/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig
+++ linux-2.6/arch/powerpc/platforms/Kconfig
@@ -1,30 +1,12 @@
menu "Platform support"
-choice
- prompt "Machine type"
- depends on PPC64 || 6xx
- default PPC_MULTIPLATFORM
-
config PPC_MULTIPLATFORM
- bool "Generic desktop/server/laptop"
- help
- Select this option if configuring for an IBM pSeries or
- RS/6000 machine, an Apple machine, or a PReP, CHRP,
- Maple or Cell-based machine.
-
-config APUS
- bool "Amiga-APUS"
- depends on PPC32 && BROKEN
- help
- Select APUS if configuring for a PowerUP Amiga.
- More information is available at:
- <http://linux-apus.sourceforge.net/>.
-
-endchoice
+ def_bool y
+ depends on 6xx || PPC64
config CLASSIC32
def_bool y
- depends on 6xx && PPC_MULTIPLATFORM
+ depends on 6xx
source "arch/powerpc/platforms/pseries/Kconfig"
source "arch/powerpc/platforms/iseries/Kconfig"
@@ -43,6 +25,7 @@ source "arch/powerpc/platforms/83xx/Kcon
source "arch/powerpc/platforms/85xx/Kconfig"
source "arch/powerpc/platforms/86xx/Kconfig"
source "arch/powerpc/platforms/embedded6xx/Kconfig"
+source "arch/powerpc/platforms/apus/Kconfig"
source "arch/powerpc/platforms/44x/Kconfig"
#source "arch/powerpc/platforms/4xx/Kconfig
Index: linux-2.6/arch/powerpc/platforms/apus/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/apus/Kconfig
+++ linux-2.6/arch/powerpc/platforms/apus/Kconfig
@@ -1,3 +1,12 @@
+config APUS
+ bool "Amiga-APUS"
+ depends on PPC32 && BROKEN
+ help
+ Select APUS if configuring for a PowerUP Amiga.
+ More information is available at:
+ <http://linux-apus.sourceforge.net/>.
+
+if APUS
config AMIGA
bool
@@ -128,3 +137,5 @@ source "drivers/zorro/Kconfig"
config PCI_PERMEDIA
bool "PCI for Permedia2"
depends on !4xx && !8xx && APUS
+
+endif
--
^ permalink raw reply
* [patch 05/10] powerpc: Multiplatformize 8{2,3,6}xx configuration
From: arnd @ 2007-06-11 23:28 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20070611232824.489103547@arndb.de>
All platforms based on 6xx compatible cores should be able to
coexisting in a single kernel image and do all necessary configuration
based on the device tree.
This moves the missing 8{2,3,6}xx platforms under
CONFIG_PPC_MULTIPLATFORM to make that possible to configure.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-2.6/arch/powerpc/platforms/82xx/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/82xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/82xx/Kconfig
@@ -1,10 +1,10 @@
-choice
- prompt "Machine Type"
- depends on PPC_82xx
- default MPC82xx_ADS
+config PPC_82xx
+ bool "Freescale 82xx"
+ depends on PPC_MULTIPLATFORM && 6xx
config MPC82xx_ADS
bool "Freescale MPC82xx ADS"
+ depends on PPC_82xx
select DEFAULT_UIMAGE
select PQ2ADS
select 8272
@@ -13,8 +13,6 @@ config MPC82xx_ADS
help
This option enables support for the MPC8272 ADS board
-endchoice
-
config PQ2ADS
bool
default n
Index: linux-2.6/arch/powerpc/platforms/83xx/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/83xx/Kconfig
@@ -1,16 +1,20 @@
-choice
- prompt "Machine Type"
- depends on PPC_83xx
- default MPC834x_MDS
+config PPC_83xx
+ bool "Freescale 83xx"
+ depends on PPC_MULTIPLATFORM && 6xx
+ select FSL_SOC
+ select 83xx
+ select WANT_DEVICE_TREE
config MPC8313_RDB
bool "Freescale MPC8313 RDB"
+ depends on PPC_83xx
select DEFAULT_UIMAGE
help
This option enables support for the MPC8313 RDB board.
config MPC832x_MDS
bool "Freescale MPC832x MDS"
+ depends on PPC_83xx
select DEFAULT_UIMAGE
select QUICC_ENGINE
help
@@ -18,6 +22,7 @@ config MPC832x_MDS
config MPC832x_RDB
bool "Freescale MPC832x RDB"
+ depends on PPC_83xx
select DEFAULT_UIMAGE
select QUICC_ENGINE
help
@@ -25,6 +30,7 @@ config MPC832x_RDB
config MPC834x_MDS
bool "Freescale MPC834x MDS"
+ depends on PPC_83xx
select DEFAULT_UIMAGE
help
This option enables support for the MPC 834x MDS evaluation board.
@@ -36,6 +42,7 @@ config MPC834x_MDS
config MPC834x_ITX
bool "Freescale MPC834x ITX"
+ depends on PPC_83xx
select DEFAULT_UIMAGE
help
This option enables support for the MPC 834x ITX evaluation board.
@@ -45,13 +52,12 @@ config MPC834x_ITX
config MPC836x_MDS
bool "Freescale MPC836x MDS"
+ depends on PPC_83xx
select DEFAULT_UIMAGE
select QUICC_ENGINE
help
This option enables support for the MPC836x MDS Processor Board.
-endchoice
-
config PPC_MPC831x
bool
select PPC_UDBG_16550
Index: linux-2.6/arch/powerpc/platforms/86xx/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/86xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/86xx/Kconfig
@@ -1,17 +1,20 @@
-choice
- prompt "Machine Type"
- depends on PPC_86xx
- default MPC8641_HPCN
+config PPC_86xx
+ bool "Freescale 86xx"
+ depends on PPC_MULTIPLATFORM && 6xx
+ select FSL_SOC
+ select FSL_PCIE
+ select ALTIVEC
+ help
+ The Freescale E600 SoCs have 74xx cores.
config MPC8641_HPCN
bool "Freescale MPC8641 HPCN"
+ depends on PPC_86xx
select PPC_I8259
select DEFAULT_UIMAGE
help
This option enables support for the MPC8641 HPCN board.
-endchoice
-
config MPC8641
bool
select PPC_INDIRECT_PCI
Index: linux-2.6/arch/powerpc/platforms/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig
+++ linux-2.6/arch/powerpc/platforms/Kconfig
@@ -24,25 +24,6 @@ config APUS
More information is available at:
<http://linux-apus.sourceforge.net/>.
-config PPC_82xx
- bool "Freescale 82xx"
- depends on 6xx
-
-config PPC_83xx
- bool "Freescale 83xx"
- depends on 6xx
- select FSL_SOC
- select 83xx
- select WANT_DEVICE_TREE
-
-config PPC_86xx
- bool "Freescale 86xx"
- depends on 6xx
- select FSL_SOC
- select FSL_PCIE
- select ALTIVEC
- help
- The Freescale E600 SoCs have 74xx cores.
endchoice
config CLASSIC32
--
^ permalink raw reply
* [patch 02/10] powerpc: Move CONFIG_PPC64 into CPU selection
From: arnd @ 2007-06-11 23:28 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20070611232824.489103547@arndb.de>
Currently, PPC64 is a top level configuration option in
arch/powerpc/Kconfig, which is somewhat unconventional.
Moving it into the CPU selection menu is a natural choice,
and is transparent to the rest of the configuration logic.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-2.6/arch/powerpc/platforms/Kconfig.cputype
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig.cputype
+++ linux-2.6/arch/powerpc/platforms/Kconfig.cputype
@@ -1,37 +1,24 @@
-config PPC64
- bool "64-bit kernel"
- default n
- help
- This option selects whether a 32-bit or a 64-bit kernel
- will be built.
-
menu "Processor support"
choice
prompt "Processor Type"
- depends on PPC32
default 6xx
-
-config CLASSIC32
- bool "52xx/6xx/7xx/74xx"
- select PPC_FPU
- select 6xx
help
There are four families of PowerPC chips supported. The more common
types (601, 603, 604, 740, 750, 7400), the Motorola embedded
- versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the AMCC
- embedded versions (403 and 405) and the high end 64 bit Power
- processors (POWER 3, POWER4, and IBM PPC970 also known as G5).
-
- This option is the catch-all for 6xx types, including some of the
- embedded versions. Unless there is see an option for the specific
- chip family you are using, you want this option.
+ versions (8xx, 55xx, 85xx), the AMCC embedded version (403, 405,
+ 440, 460) and the 64 bit processors (POWER 3, POWER4, POWER5,
+ POWER6, PowerPC 970, Cell/B.E., PA6T).
- You do not want this if you are building a kernel for a 64 bit
- IBM RS/6000 or an Apple G5, choose 6xx.
+ If unsure, select 52xx/6xx/7xx/74xx.
- If unsure, select this option
+config PPC64
+ bool "any 64 bit PowerPC"
+ select PPC_FPU
- Note that the kernel runs in 32-bit mode even on 64-bit chips.
+config CLASSIC32
+ bool "52xx/6xx/7xx/74xx"
+ select PPC_FPU
+ select 6xx
config PPC_82xx
bool "Freescale 82xx"
@@ -120,7 +107,6 @@ config E500
config PPC_FPU
bool
- default y if PPC64
config 4xx
bool
--
^ permalink raw reply
* [patch 03/10] powerpc: move 82xx/83xx/86xx Kconfig options to platform selection
From: arnd @ 2007-06-11 23:28 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20070611232824.489103547@arndb.de>
The cores used in the MPC82xx/83xx/86xx embedded controllers are very similar
to those in the 32 bit general-purpose processors, so it makes sense to
treat them as the same CPU family.
Choosing between the embedded platforms and the multiplatform code is
now done in the platform menu, but functionally everything stays the
same.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-2.6/arch/powerpc/platforms/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig
+++ linux-2.6/arch/powerpc/platforms/Kconfig
@@ -2,7 +2,7 @@ menu "Platform support"
choice
prompt "Machine type"
- depends on PPC64 || CLASSIC32
+ depends on PPC64 || 6xx
default PPC_MULTIPLATFORM
config PPC_MULTIPLATFORM
@@ -23,8 +23,32 @@ config APUS
Select APUS if configuring for a PowerUP Amiga.
More information is available at:
<http://linux-apus.sourceforge.net/>.
+
+config PPC_82xx
+ bool "Freescale 82xx"
+ depends on 6xx
+
+config PPC_83xx
+ bool "Freescale 83xx"
+ depends on 6xx
+ select FSL_SOC
+ select 83xx
+ select WANT_DEVICE_TREE
+
+config PPC_86xx
+ bool "Freescale 86xx"
+ depends on 6xx
+ select FSL_SOC
+ select FSL_PCIE
+ select ALTIVEC
+ help
+ The Freescale E600 SoCs have 74xx cores.
endchoice
+config CLASSIC32
+ def_bool y
+ depends on 6xx && PPC_MULTIPLATFORM
+
source "arch/powerpc/platforms/pseries/Kconfig"
source "arch/powerpc/platforms/iseries/Kconfig"
source "arch/powerpc/platforms/chrp/Kconfig"
Index: linux-2.6/arch/powerpc/platforms/Kconfig.cputype
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig.cputype
+++ linux-2.6/arch/powerpc/platforms/Kconfig.cputype
@@ -15,24 +15,10 @@ config PPC64
bool "any 64 bit PowerPC"
select PPC_FPU
-config CLASSIC32
- bool "52xx/6xx/7xx/74xx"
- select PPC_FPU
- select 6xx
-
-config PPC_82xx
- bool "Freescale 82xx"
- select 6xx
+config 6xx
+ bool "52xx/6xx/7xx/74xx/82xx/83xx/86xx"
select PPC_FPU
-config PPC_83xx
- bool "Freescale 83xx"
- select 6xx
- select FSL_SOC
- select 83xx
- select PPC_FPU
- select WANT_DEVICE_TREE
-
config PPC_85xx
bool "Freescale 85xx"
select E500
@@ -40,16 +26,6 @@ config PPC_85xx
select 85xx
select WANT_DEVICE_TREE
-config PPC_86xx
- bool "Freescale 86xx"
- select 6xx
- select FSL_SOC
- select FSL_PCIE
- select PPC_FPU
- select ALTIVEC
- help
- The Freescale E600 SoCs have 74xx cores.
-
config PPC_8xx
bool "Freescale 8xx"
select FSL_SOC
--
^ permalink raw reply
* [patch 04/10] powerpc: rename add_bridge to avoid namespace clashes
From: arnd @ 2007-06-11 23:28 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20070611232824.489103547@arndb.de>
Many platforms currently define their own add_bridge function, some
of them globally. This breaks some multiplatform configurations.
Prefixing each of these functions with the platform name avoids
this problem.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-2.6/arch/powerpc/platforms/82xx/mpc82xx_ads.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/82xx/mpc82xx_ads.c
+++ linux-2.6/arch/powerpc/platforms/82xx/mpc82xx_ads.c
@@ -49,7 +49,7 @@
#include <linux/fs_enet_pd.h>
#include <sysdev/fsl_soc.h>
-#include <../sysdev/cpm2_pic.h>
+#include <../../sysdev/cpm2_pic.h>
#include "pq2ads.h"
@@ -515,7 +515,7 @@ static int m82xx_pci_exclude_device(u_ch
return PCIBIOS_SUCCESSFUL;
}
-void __init add_bridge(struct device_node *np)
+static void __init mpc82xx_add_bridge(struct device_node *np)
{
int len;
struct pci_controller *hose;
@@ -584,7 +584,7 @@ static void __init mpc82xx_ads_setup_arc
#ifdef CONFIG_PCI
ppc_md.pci_exclude_device = m82xx_pci_exclude_device;
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ mpc82xx_add_bridge(np);
of_node_put(np);
#endif
Index: linux-2.6/arch/powerpc/platforms/83xx/mpc836x_mds.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ linux-2.6/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -86,7 +86,7 @@ static void __init mpc836x_mds_setup_arc
#ifdef CONFIG_PCI
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ mpc83xx_add_bridge(np);
ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif
Index: linux-2.6/arch/powerpc/platforms/83xx/mpc83xx.h
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/mpc83xx.h
+++ linux-2.6/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -27,7 +27,7 @@
* mpc83xx_* files. Mostly for use by mpc83xx_setup
*/
-extern int add_bridge(struct device_node *dev);
+extern int mpc83xx_add_bridge(struct device_node *dev);
extern int mpc83xx_exclude_device(u_char bus, u_char devfn);
extern void mpc83xx_restart(char *cmd);
extern long mpc83xx_time_init(void);
Index: linux-2.6/arch/powerpc/platforms/83xx/mpc8313_rdb.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/mpc8313_rdb.c
+++ linux-2.6/arch/powerpc/platforms/83xx/mpc8313_rdb.c
@@ -49,7 +49,7 @@ static void __init mpc8313_rdb_setup_arc
#ifdef CONFIG_PCI
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ mpc83xx_add_bridge(np);
ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif
Index: linux-2.6/arch/powerpc/platforms/83xx/mpc832x_mds.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ linux-2.6/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -80,7 +80,7 @@ static void __init mpc832x_sys_setup_arc
#ifdef CONFIG_PCI
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ mpc83xx_add_bridge(np);
ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif
Index: linux-2.6/arch/powerpc/platforms/83xx/mpc832x_rdb.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ linux-2.6/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -53,7 +53,7 @@ static void __init mpc832x_rdb_setup_arc
#ifdef CONFIG_PCI
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ mpc83xx_add_bridge(np);
ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif
Index: linux-2.6/arch/powerpc/platforms/83xx/mpc834x_itx.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ linux-2.6/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -59,7 +59,7 @@ static void __init mpc834x_itx_setup_arc
#ifdef CONFIG_PCI
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ mpc83xx_add_bridge(np);
ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif
Index: linux-2.6/arch/powerpc/platforms/83xx/mpc834x_mds.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ linux-2.6/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -129,7 +129,7 @@ static void __init mpc834x_mds_setup_arc
#ifdef CONFIG_PCI
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ mpc83xx_add_bridge(np);
ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif
Index: linux-2.6/arch/powerpc/platforms/83xx/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/pci.c
+++ linux-2.6/arch/powerpc/platforms/83xx/pci.c
@@ -45,7 +45,7 @@ int mpc83xx_exclude_device(u_char bus, u
return PCIBIOS_SUCCESSFUL;
}
-int __init add_bridge(struct device_node *dev)
+int __init mpc83xx_add_bridge(struct device_node *dev)
{
int len;
struct pci_controller *hose;
Index: linux-2.6/arch/powerpc/platforms/85xx/mpc85xx.h
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/85xx/mpc85xx.h
+++ linux-2.6/arch/powerpc/platforms/85xx/mpc85xx.h
@@ -15,4 +15,4 @@
*/
extern void mpc85xx_restart(char *);
-extern int add_bridge(struct device_node *dev);
+extern int mpc85xx_add_bridge(struct device_node *dev);
Index: linux-2.6/arch/powerpc/platforms/85xx/mpc85xx_ads.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ linux-2.6/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -241,7 +241,7 @@ static void __init mpc85xx_ads_setup_arc
#ifdef CONFIG_PCI
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ mpc85xx_add_bridge(np);
ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif
}
Index: linux-2.6/arch/powerpc/platforms/85xx/mpc85xx_cds.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ linux-2.6/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -257,7 +257,7 @@ static void __init mpc85xx_cds_setup_arc
#ifdef CONFIG_PCI
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ mpc85xx_add_bridge(np);
ppc_md.pcibios_fixup = mpc85xx_cds_pcibios_fixup;
ppc_md.pci_exclude_device = mpc85xx_exclude_device;
Index: linux-2.6/arch/powerpc/platforms/85xx/mpc85xx_mds.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ linux-2.6/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -100,7 +100,7 @@ static void __init mpc85xx_mds_setup_arc
#ifdef CONFIG_PCI
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
- add_bridge(np);
+ mpc85xx_add_bridge(np);
}
of_node_put(np);
#endif
Index: linux-2.6/arch/powerpc/platforms/85xx/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/85xx/pci.c
+++ linux-2.6/arch/powerpc/platforms/85xx/pci.c
@@ -36,7 +36,7 @@
int mpc85xx_pci2_busno = 0;
#ifdef CONFIG_PCI
-int __init add_bridge(struct device_node *dev)
+int __init mpc85xx_add_bridge(struct device_node *dev)
{
int len;
struct pci_controller *hose;
Index: linux-2.6/arch/powerpc/platforms/86xx/mpc86xx.h
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/86xx/mpc86xx.h
+++ linux-2.6/arch/powerpc/platforms/86xx/mpc86xx.h
@@ -15,7 +15,7 @@
* mpc86xx_* files. Mostly for use by mpc86xx_setup().
*/
-extern int add_bridge(struct device_node *dev);
+extern int mpc86xx_add_bridge(struct device_node *dev);
extern int mpc86xx_exclude_device(u_char bus, u_char devfn);
Index: linux-2.6/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ linux-2.6/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -364,7 +364,7 @@ mpc86xx_hpcn_setup_arch(void)
#ifdef CONFIG_PCI
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ mpc86xx_add_bridge(np);
ppc_md.pci_exclude_device = mpc86xx_exclude_device;
#endif
Index: linux-2.6/arch/powerpc/platforms/86xx/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/86xx/pci.c
+++ linux-2.6/arch/powerpc/platforms/86xx/pci.c
@@ -148,7 +148,7 @@ int mpc86xx_exclude_device(u_char bus, u
return PCIBIOS_SUCCESSFUL;
}
-int __init add_bridge(struct device_node *dev)
+int __init mpc86xx_add_bridge(struct device_node *dev)
{
int len;
struct pci_controller *hose;
Index: linux-2.6/arch/powerpc/platforms/embedded6xx/linkstation.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ linux-2.6/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -54,7 +54,7 @@ static struct mtd_partition linkstation_
},
};
-static int __init add_bridge(struct device_node *dev)
+static int __init linkstation_add_bridge(struct device_node *dev)
{
int len;
struct pci_controller *hose;
@@ -92,7 +92,7 @@ static void __init linkstation_setup_arc
/* Lookup PCI host bridges */
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ linkstation_add_bridge(np);
printk(KERN_INFO "BUFFALO Network Attached Storage Series\n");
printk(KERN_INFO "(C) 2002-2005 BUFFALO INC.\n");
Index: linux-2.6/arch/powerpc/platforms/maple/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/maple/pci.c
+++ linux-2.6/arch/powerpc/platforms/maple/pci.c
@@ -444,7 +444,7 @@ static void __init setup_u3_ht(struct pc
u3_ht = hose;
}
-static int __init add_bridge(struct device_node *dev)
+static int __init maple_add_bridge(struct device_node *dev)
{
int len;
struct pci_controller *hose;
@@ -558,7 +558,7 @@ void __init maple_pci_init(void)
continue;
if ((of_device_is_compatible(np, "u4-pcie") ||
of_device_is_compatible(np, "u3-agp")) &&
- add_bridge(np) == 0)
+ maple_add_bridge(np) == 0)
of_node_get(np);
if (of_device_is_compatible(np, "u3-ht")) {
@@ -570,7 +570,7 @@ void __init maple_pci_init(void)
/* Now setup the HyperTransport host if we found any
*/
- if (ht && add_bridge(ht) != 0)
+ if (ht && maple_add_bridge(ht) != 0)
of_node_put(ht);
/*
Index: linux-2.6/arch/powerpc/platforms/pasemi/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pasemi/pci.c
+++ linux-2.6/arch/powerpc/platforms/pasemi/pci.c
@@ -132,7 +132,7 @@ static void __init setup_pa_pxp(struct p
hose->cfg_data = ioremap(0xe0000000, 0x10000000);
}
-static int __init add_bridge(struct device_node *dev)
+static int __init pas_add_bridge(struct device_node *dev)
{
struct pci_controller *hose;
@@ -185,7 +185,7 @@ void __init pas_pci_init(void)
}
for (np = NULL; (np = of_get_next_child(root, np)) != NULL;)
- if (np->name && !strcmp(np->name, "pxp") && !add_bridge(np))
+ if (np->name && !strcmp(np->name, "pxp") && !pas_add_bridge(np))
of_node_get(np);
of_node_put(root);
Index: linux-2.6/arch/powerpc/platforms/powermac/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/powermac/pci.c
+++ linux-2.6/arch/powerpc/platforms/powermac/pci.c
@@ -35,8 +35,6 @@
#define DBG(x...)
#endif
-static int add_bridge(struct device_node *dev);
-
/* XXX Could be per-controller, but I don't think we risk anything by
* assuming we won't have both UniNorth and Bandit */
static int has_uninorth;
@@ -897,7 +895,7 @@ static void __init setup_u3_ht(struct pc
* "pci" (a MPC106) and no bandit or chaos bridges, and contrariwise,
* if we have one or more bandit or chaos bridges, we don't have a MPC106.
*/
-static int __init add_bridge(struct device_node *dev)
+static int __init pmac_add_bridge(struct device_node *dev)
{
int len;
struct pci_controller *hose;
@@ -1036,7 +1034,7 @@ void __init pmac_pci_init(void)
if (strcmp(np->name, "bandit") == 0
|| strcmp(np->name, "chaos") == 0
|| strcmp(np->name, "pci") == 0) {
- if (add_bridge(np) == 0)
+ if (pmac_add_bridge(np) == 0)
of_node_get(np);
}
if (strcmp(np->name, "ht") == 0) {
@@ -1050,7 +1048,7 @@ void __init pmac_pci_init(void)
/* Probe HT last as it relies on the agp resources to be already
* setup
*/
- if (ht && add_bridge(ht) != 0)
+ if (ht && pmac_add_bridge(ht) != 0)
of_node_put(ht);
/*
--
^ permalink raw reply
* [patch 00/10] CPU selection Kconfig cleanup, take 2
From: arnd @ 2007-06-11 23:28 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
I submitted this some time ago and did not get much feedback,
but based on today's IRC discussion want to give it another
shot. The potentially more controversial patches are at the
end, so you can simply apply the more obvious ones.
Please consider for 2.6.23.
Arnd <><
--
^ permalink raw reply
* Re: [PATCH] Create add_rtc() function to enable the RTC CMOS driver
From: Wade Farnsworth @ 2007-06-11 22:51 UTC (permalink / raw)
To: Milton Miller; +Cc: ppcdev
In-Reply-To: <3e02d9714b50f74002e52153270e3e42@bga.com>
On Mon, 2007-06-11 at 02:06 -0500, Milton Miller wrote:
> On Thu Jun 7 02:37:53 EST 2007, Wade Farnsworth wrote:
>
> No changelog, just the subject?
Yes, I should have put something in the changelog. I'll be sure to add
something in the next version.
>
> > ---
> >
> > arch/powerpc/kernel/setup-common.c | 31 +++++++++++++++++++++++++++
> > 1 file changed, 31 insertions(+)
> >
> > Index: linux-2.6-powerpc-8641/arch/powerpc/kernel/setup-common.c
> > ===================================================================
> > --- linux-2.6-powerpc-8641.orig/arch/powerpc/kernel/setup-common.c
> > +++ linux-2.6-powerpc-8641/arch/powerpc/kernel/setup-common.c
>
> A driver specific ifdef in setup-common?
>
> Please put this in a file in sysdev. Possibly linked on the config
> with the existing ifdef, if you can't find a related file.
Sure. I can't find a suitable existing file in sysdev to put this in,
so I'll just create a new one called "rtc_cmos_setup.c" or similar. If
anyone has a better name, please speak up. :)
>
> > @@ -32,6 +32,7 @@
> > #include <linux/unistd.h>
> > #include <linux/serial.h>
> > #include <linux/serial_8250.h>
> > +#include <linux/mc146818rtc.h>
> > #include <asm/io.h>
> > #include <asm/prom.h>
> > #include <asm/processor.h>
> > @@ -447,6 +448,36 @@ static __init int add_pcspkr(void)
> > }
> > device_initcall(add_pcspkr);
>
> Oh, we already did this with the pc speaker?
>
> I stand by my first impression. Although one could argue its similar
> in scope to check_legacy_io_port, probe_machine is totally unrelated
> and between pc speaker and check legacy io port. At least the grouping
> of these functions in the file should be cleaned up.
Yeah, I was following the (bad?) example of the pc speaker. sysdev is
probably a better place for this.
>
>
> > +#ifdef CONFIG_RTC_DRV_CMOS
> > +static int __init add_rtc(void)
> > +{
> > + struct device_node *np;
> > + struct platform_device *pd;
> > + struct resource res;
> > +
> > + np = of_find_compatible_node(NULL, NULL, "pnpPNP,b00");
> > + if (!np)
> > + return -ENODEV;
> > +
> > + if (of_address_to_resource(np, 0, &res)) {
> > + of_node_put(np);
> > + return -ENODEV;
> > + }
> > +
>
> Ok you have found a resource, but not mapped it.
The resource gets mapped by platform_device_register_simple().
>
> > + pd = platform_device_register_simple("rtc_cmos", -1,
> > + &res, 1);
> > + of_node_put(np);
> > + if (IS_ERR(pd))
> > + return PTR_ERR(pd);
> > +
> > + /* rtc-cmos only supports 24-hr mode */
> > + CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_24H, RTC_CONTROL);
> > +
>
> But now you invoke a macro from somewhere, which would appear to write
> to the device. Probably with some hard-coded isa port, as it doesn't
> take any obvious device or resource argument.
>
> Is this writing to the legacy io port? What mapped that resource?
Yes, this uses the legacy io ports hard-coded. in asm/mc146818rtc.h
(0x70 is the address port 0x71 is the data port).
>
> If the driver only works with the standard port, then should you check
> the resource is that standard port? Or does the compatibility also
> dictate the resource, in which case assigning the resource is
> redundant.
The rtc-cmos driver also invokes CMOS_READ() and CMOS_WRITE(), so it
will only work with devices on the standard ports.
I don't know if the OF spec defines the ports for the device, so it may
be a good idea to, as you suggest, check to see if the hard-coded port
and the resource match.
> This is after the device register, so the platform driver might think
> it owns the device. Or it my be off doing its own initialization. Or
> the driver subsystem may have requested the platform device be loaded,
> and it has not run at all (assuming it can be a module for the moment).
Maybe this should be changed to an fs_initcall, so that we can be sure
it is run before the driver's initialization.
Thanks for the comments.
--Wade
^ permalink raw reply
* [PATCH v2] 85xxCDS: Make sure restart resets the PCI bus.
From: Randy Vinson @ 2007-06-11 22:18 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org
The current 85xxCDS restart code fails to reset the PCI bus which can
lead to odd behavior after the restart. This patch uses the VIA Super
Southbridge to perform a PCI reset which will reset the entire system.
NOTE: Since the VIA chip is behind a PCI-to-PCI bridge which can be
disabled with a switch setting, it may not be possible to perform the
PCI bus reset. In this case, the code defaults to the previous restart
mechanism.
Signed-off-by: Randy Vinson <rvinson@mvista.com>
---
Updated to incorporate feedback from M. Greer.
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 35 +++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index bc01364..a8720bf 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -63,6 +63,37 @@ static volatile u8 *cadmus;
extern int mpc85xx_pci2_busno;
+static void mpc85xx_cds_restart(char *cmd)
+{
+ struct pci_dev *dev;
+ u_char tmp;
+
+ if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686,
+ NULL))) {
+
+ /* Use the VIA Super Southbridge to force a PCI reset */
+ pci_read_config_byte(dev, 0x47, &tmp);
+ pci_write_config_byte(dev, 0x47, tmp | 1);
+
+ /* Flush the outbound PCI write queues */
+ pci_read_config_byte(dev, 0x47, &tmp);
+
+ /*
+ * At this point, the harware reset should have triggered.
+ * However, if it doesn't work for some mysterious reason,
+ * just fall through to the default reset below.
+ */
+
+ pci_dev_put(dev);
+ }
+
+ /*
+ * If we can't find the VIA chip (maybe the P2P bridge is disabled)
+ * or the VIA chip reset didn't work, just use the default reset.
+ */
+ mpc85xx_restart(NULL);
+}
+
static int mpc85xx_exclude_device(u_char bus, u_char devfn)
{
if (bus == 0 && PCI_SLOT(devfn) == 0)
@@ -320,7 +351,11 @@ define_machine(mpc85xx_cds) {
.init_IRQ = mpc85xx_cds_pic_init,
.show_cpuinfo = mpc85xx_cds_show_cpuinfo,
.get_irq = mpic_get_irq,
+#ifdef CONFIG_PCI
+ .restart = mpc85xx_cds_restart,
+#else
.restart = mpc85xx_restart,
+#endif
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
};
--
1.5.0.GIT
^ permalink raw reply related
* [PATCH v2] 85XX: Allow 8259 cascade to share an MPIC interrupt line.
From: Randy Vinson @ 2007-06-11 22:16 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org
The Freescale MPC8555CDS and MPC8548CDS reference hardware has a legacy
8259 interrupt controller pair contained within a VIA VT82C686B Southbridge
on the main carrier board. The processor complex plugs into the carrier
card using a PCI slot which limits the available interrupts to the
INTA-INTD PCI interrupts. The output of the 8259 cascade pair is routed
through a gate array and connected to the PCI INTA interrupt line.
The normal interrupt chaining hook (set_irq_chained_handler) does
not allow sharing of the chained interrupt which prevents the
use of PCI INTA by PCI devices. This patch allows the 8259 cascade
pair to share their interrupt line with PCI devices.
NOTE: The addition of the .end routine for the MPIC is not strictly
necessary for this patch. It's there so this code will run from within
the threaded interrupt context used by the Real Time patch.
Signed-off-by: Randy Vinson <rvinson@mvista.com>
---
This is an updated version of the previously posted patch. The original version was missing the
inclusion of <linux/interrupt.h>. Also, since the 8259 is located in the VIA chip which is on the
PCI bus, I've added CONFIG_PCI to prevent compilation errors. I've re-based the patch on top of powerpc:-Remove-redundant-pci_read_irq_line()-function-for-85xx-platform.patch previously
posted by Roy Zang.
arch/powerpc/platforms/85xx/Kconfig | 1 +
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 37 ++++++++++++++++++++++++----
arch/powerpc/sysdev/mpic.c | 1 +
3 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 629926e..807b098 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -18,6 +18,7 @@ config MPC8560_ADS
config MPC85xx_CDS
bool "Freescale MPC85xx CDS"
select DEFAULT_UIMAGE
+ select PPC_I8259
help
This option enables support for the MPC85xx CDS board
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index d9f348c..bc01364 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -24,6 +24,7 @@
#include <linux/seq_file.h>
#include <linux/initrd.h>
#include <linux/module.h>
+#include <linux/interrupt.h>
#include <linux/fsl_devices.h>
#include <asm/system.h>
@@ -119,16 +120,30 @@ static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)
}
#ifdef CONFIG_PPC_I8259
-#warning The i8259 PIC support is currently broken
-static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
+static void mpc85xx_8259_cascade_handler(unsigned int irq,
+ struct irq_desc *desc)
{
unsigned int cascade_irq = i8259_irq();
if (cascade_irq != NO_IRQ)
+ /* handle an interrupt from the 8259 */
generic_handle_irq(cascade_irq);
- desc->chip->eoi(irq);
+ /* check for any interrupts from the shared IRQ line */
+ handle_fasteoi_irq(irq, desc);
}
+
+static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id)
+{
+ return IRQ_HANDLED;
+}
+
+static struct irqaction mpc85xxcds_8259_irqaction = {
+ .handler = mpc85xx_8259_cascade_action,
+ .flags = IRQF_SHARED,
+ .mask = CPU_MASK_NONE,
+ .name = "8259 cascade",
+};
#endif /* PPC_I8259 */
#endif /* CONFIG_PCI */
@@ -137,7 +152,7 @@ static void __init mpc85xx_cds_pic_init(void)
struct mpic *mpic;
struct resource r;
struct device_node *np = NULL;
-#ifdef CONFIG_PPC_I8259
+#if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI)
struct device_node *cascade_node = NULL;
int cascade_irq;
#endif
@@ -186,7 +201,7 @@ static void __init mpc85xx_cds_pic_init(void)
mpic_init(mpic);
-#ifdef CONFIG_PPC_I8259
+#if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI)
/* Initialize the i8259 controller */
for_each_node_by_type(np, "interrupt-controller")
if (of_device_is_compatible(np, "chrp,iic")) {
@@ -208,7 +223,17 @@ static void __init mpc85xx_cds_pic_init(void)
i8259_init(cascade_node, 0);
of_node_put(cascade_node);
- set_irq_chained_handler(cascade_irq, mpc85xx_8259_cascade);
+ /*
+ * Hook the interrupt to make sure desc->action is never NULL.
+ * This is required to ensure that the interrupt does not get
+ * disabled when the last user of the shared IRQ line frees their
+ * interrupt.
+ */
+ if (setup_irq(cascade_irq, &mpc85xxcds_8259_irqaction))
+ printk(KERN_ERR "Failed to setup cascade interrupt\n");
+ else
+ /* Success. Connect our low-level cascade handler. */
+ set_irq_handler(cascade_irq, mpc85xx_8259_cascade_handler);
#endif /* CONFIG_PPC_I8259 */
}
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 75aad38..14e3d1d 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -836,6 +836,7 @@ static struct irq_chip mpic_irq_chip = {
.mask = mpic_mask_irq,
.unmask = mpic_unmask_irq,
.eoi = mpic_end_irq,
+ .end = mpic_unmask_irq,
.set_type = mpic_set_irq_type,
};
--
1.5.0.GIT
^ permalink raw reply related
* Re: [PATCH 1/6] 82xx: Add the support of Wind River SBC PowerQUICCII 82xx
From: Scott Wood @ 2007-06-11 21:02 UTC (permalink / raw)
To: Mark Zhan; +Cc: linuxppc-dev@ozlabs.org, paulus@samba.org
In-Reply-To: <1181292534.11341.9.camel@mark>
On Fri, Jun 08, 2007 at 04:48:53PM +0800, Mark Zhan wrote:
> + new_bus->phy_mask = 0xFFFFFFFF;
> + for (i = 0; i < PHY_MAX_ADDR; i++)
> + if (pdata->irq[i] != -1)
> + new_bus->phy_mask &= ~(1 << i);
> +
This assumes that all PHYs have an IRQ.
I have patches forthcoming to of_platform-ize this code when
CONFIG_PPC_MERGE is defined; phy_mask will be set properly then.
Though, I notice that this is the only driver that sets phy_mask. Is
there any reason we can't just leave the mask clear, and let the probe
for non-existent phys fail?
-Scott
^ permalink raw reply
* RE: Linux 2.6.x, MTD drivers and NAND flashes
From: Gary Kenaley @ 2007-06-11 19:59 UTC (permalink / raw)
To: Bill Gatliff, Laurent Lagrange; +Cc: linuxppc-embedded
In-Reply-To: <466D7169.1000407@billgatliff.com>
Laurent,
Can't you just use the flashcp copy command from the mtd-utils package?
-----------------------------------------------------------------------
flash_eraseall -j /dev/mtd0
mkfs.jffs2 -b -n --eraseblock=3D131072 --pagesize=3D2048 -p -r =
/test_root -v -o test_root.img
flashcp test_root.img /dev/mtd0
The other way is what Bill mentions:
------------------------------------
flash_eraseall -j /dev/mtd0
mount -t jffs2 /dev/mtdblock0 /tmp/mnt
tar -xzf test_root.tgz -C /tmp/mnt
umount /tmp/mnt
Gary
> > ________________________________________
> > From: linuxppc-embedded-bounces+gkenaley=3Dechelon.com@ozlabs.org > =
> > [mailto:linuxppc-embedded-bounces+gkenaley=3Dechelon.com@ozlabs.org] =
On Behalf > > Of Bill Gatliff
> > Sent: Monday, June 11, 2007 9:00 AM
> > To: Laurent Lagrange
> > Cc: linuxppc-embedded@ozlabs.org
> > Subject: Re: Linux 2.6.x, MTD drivers and NAND flashes
> >
> > Laurent Lagrange wrote:=20
> > Hello,
> >
> > I use a Linux 2.6.9 on a 85xx custom board with a NAND flash.=20
> >=A0
> > This flash has some bad blocks.
> > NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND =
128MiB > > 3,3V 8-bit)
> > Scanning device for bad blocks
> > Bad eraseblock 8 at 0x00100000
> > Bad eraseblock 430 at 0x035c0000
> >...
> > Creating 1 MTD partitions on "NAND 128MiB 3,3V 8-bit":
> > 0x00000000-0x08000000 : "flash partition 1".
> >=A0
> > I have selected in the kernel :
> > 1) the MTD character and block supports for NAND,
> > 2) the CRAMFS and JFFS2 supports for NAND.
> >=A0
> > I can erase the flash but receive IO errors for each bad blocks =
(that > > seems right).
> > I can mount an empty JFFS2 partition on the NAND and untar some > > =
directories and files in it.
> >=A0
> > I would like to generate some JFFS2 images and program them in the =
flash > > with a character=20
> > command like "cat img > /dev/mtd/0". If I dont encounter a bad =
block, it > > runs right=A0else the=20
> > command fails.=20
> >=A0
> > This is a little bit annoying. So my question is simple :=20
> > Is there a MTD character driver which can detect and ignore the bad =
> blocks > in a NAND flash=A0?=20
> >
> Wrong question.=A0 :)
> With NAND, working directly with the media is indeed a pain because of =
bad > blocks.=A0 What's done instead is to leave that to the =
filesystem.=A0 Pick a > NAND-aware one like YAFFS.
>
>
> b.g.
>
> --=20
> Bill Gatliff
> bgat@billgatliff.com
^ permalink raw reply
* Re: [PATCH] PHY fixed driver: rework release path and update phy_id notation
From: Andrew Morton @ 2007-06-11 19:24 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-dev, linux-kernel, Jeff Garzik, netdev
In-Reply-To: <20070609162118.2680.99019.stgit@ACA800FC.ipt.aol.com>
On Sat, 09 Jun 2007 20:21:18 +0400
Vitaly Bordug <vitb@kernel.crashing.org> wrote:
>
> device_bind_driver() error code returning has been fixed.
> release() function has been written, so that to free resources
> in correct way; the release path is now clean.
>
> Before the rework, it used to cause
> Device 'fixed@100:1' does not have a release() function, it is broken
> and must be fixed.
> BUG: at drivers/base/core.c:104 device_release()
>
> Call Trace:
> [<ffffffff802ec380>] kobject_cleanup+0x53/0x7e
> [<ffffffff802ec3ab>] kobject_release+0x0/0x9
> [<ffffffff802ecf3f>] kref_put+0x74/0x81
> [<ffffffff8035493b>] fixed_mdio_register_device+0x230/0x265
> [<ffffffff80564d31>] fixed_init+0x1f/0x35
> [<ffffffff802071a4>] init+0x147/0x2fb
> [<ffffffff80223b6e>] schedule_tail+0x36/0x92
> [<ffffffff8020a678>] child_rip+0xa/0x12
> [<ffffffff80311714>] acpi_ds_init_one_object+0x0/0x83
> [<ffffffff8020705d>] init+0x0/0x2fb
> [<ffffffff8020a66e>] child_rip+0x0/0x12
>
>
> Also changed the notation of the fixed phy definition on
> mdio bus to the form of <speed>+<duplex> to make it able to be used by
> gianfar and ucc_geth that define phy_id strictly as "%d:%d"
>
>
> static int fixed_mdio_register_device(int number, int speed, int duplex)
> {
> @@ -221,6 +238,12 @@ static int fixed_mdio_register_device(int number, int speed, int duplex)
> }
>
> fixed->regs = kzalloc(MII_REGS_NUM*sizeof(int), GFP_KERNEL);
> + if (NULL == fixed->regs) {
> + kfree(dev);
> + kfree(new_bus);
> + kfree(fixed);
> + return -ENOMEM;
> + }
> fixed->regs_num = MII_REGS_NUM;
> fixed->phy_status.speed = speed;
> fixed->phy_status.duplex = duplex;
> @@ -249,57 +272,43 @@ static int fixed_mdio_register_device(int number, int speed, int duplex)
> fixed->phydev = phydev;
>
> if(NULL == phydev) {
> - err = -ENOMEM;
> - goto device_create_fail;
> + kfree(dev);
> + kfree(new_bus);
> + kfree(fixed->regs);
> + kfree(fixed);
> + return -ENOMEM;
> }
>
> phydev->irq = PHY_IGNORE_INTERRUPT;
> phydev->dev.bus = &mdio_bus_type;
>
> - if(number)
> - snprintf(phydev->dev.bus_id, BUS_ID_SIZE,
> - "fixed_%d@%d:%d", number, speed, duplex);
> - else
> - snprintf(phydev->dev.bus_id, BUS_ID_SIZE,
> - "fixed@%d:%d", speed, duplex);
> + snprintf(phydev->dev.bus_id, BUS_ID_SIZE,
> + "%d:%d", number, speed + duplex);
> +
> phydev->bus = new_bus;
>
> + phydev->dev.driver = &fixed_mdio_driver.driver;
> + phydev->dev.release = fixed_mdio_release;
> +
> + err = phydev->dev.driver->probe(&phydev->dev);
> + if(err < 0) {
> + printk(KERN_ERR "Phy %s: problems with fixed driver\n",
> + phydev->dev.bus_id);
> + kfree(phydev);
> + kfree(dev);
> + kfree(new_bus);
> + kfree(fixed->regs);
> + kfree(fixed);
> + return err;
> + }
This is pretty fragile code. It would be better to consolidate all the
cleanup in a single spot at the end of fixed_mdio_register_device() and to
then employ the usual `goto err_foo;' technique.
Generally, embedding multiple return points into a large function like this
is a thing we prefer to avoid: it increases the risk that later changes will
introduce resource leaks, locking errors, etc.
Also, the
if (NULL == some_ptr)
thing does look rather weird. It is normally done to force a compile error
if someone uses "=" instead of "==", but gcc will warn about that anyway,
so it isn't really needed.
^ permalink raw reply
* cat MyFile > /dev/ttyS1 hangs second time it is launched
From: DI BACCO ANTONIO - technolabs @ 2007-06-11 19:00 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 346 bytes --]
I tried to execute the command in the subject.
First time I launch it, it is successfull.
Second time it hangs when closing /dev/ttyS1, third time and subsequent times it clocks on opening /dev/ttyS1.
The same happen on /dev/ttyS0.
Is it necessary to save termios and restore them before closing the serial port?
Why?
Bye,
Antonio.
[-- Attachment #2: Type: text/html, Size: 791 bytes --]
^ permalink raw reply
* Re: [PATCH] MII bitbang driver should generate MII bus phy_mask dynamically
From: Vitaly Bordug @ 2007-06-11 19:03 UTC (permalink / raw)
To: Mark Zhan; +Cc: netdev, Vitaly Bordug, linuxppc-dev@ozlabs.org
In-Reply-To: <1181548417.5217.13.camel@mark>
On Mon, Jun 11, 2007 at 03:53:37PM +0800, Mark Zhan wrote:
> Current MII bitbang bus driver hard-codes the phy mask of mii_bus to
> ~0x09, which is actually specific to the FSL boards. This patch will
> make the bitbang driver to generate MII bus phy_mask dynamically, by the
> PHY irq info provided by the platform.
just realized that haven't mentioned that it's OK from me,
assuming Andy's comment taken into account...
>
> Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com>
> ---
> b/drivers/net/fs_enet/mii-bitbang.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/fs_enet/mii-bitbang.c
> b/drivers/net/fs_enet/mii-bitbang.c
> index d384010..3732d69 100644
> --- a/drivers/net/fs_enet/mii-bitbang.c
> +++ b/drivers/net/fs_enet/mii-bitbang.c
> @@ -315,7 +315,7 @@ static int __devinit fs_enet_mdio_probe(
> struct fs_mii_bb_platform_info *pdata;
> struct mii_bus *new_bus;
> struct bb_info *bitbang;
> - int err = 0;
> + int i, err = 0;
>
> if (NULL == dev)
> return -EINVAL;
> @@ -336,14 +336,17 @@ static int __devinit fs_enet_mdio_probe(
> new_bus->reset = &fs_enet_mii_bb_reset,
> new_bus->id = pdev->id;
>
> - new_bus->phy_mask = ~0x9;
> pdata = (struct fs_mii_bb_platform_info *)pdev->dev.platform_data;
> -
> if (NULL == pdata) {
> printk(KERN_ERR "gfar mdio %d: Missing platform data!\n", pdev->id);
> return -ENODEV;
> }
>
> + new_bus->phy_mask = 0xFFFFFFFF;
> + for (i = 0; i < PHY_MAX_ADDR; i++)
> + if (pdata->irq[i] != -1)
> + new_bus->phy_mask &= ~(1 << i);
> +
> /*set up workspace*/
> fs_mii_bitbang_init(bitbang, pdata);
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] MII bitbang driver should generate MII bus phy_mask dynamically
From: Vitaly Bordug @ 2007-06-11 18:58 UTC (permalink / raw)
To: Mark Zhan; +Cc: netdev, Vitaly Bordug, linuxppc-dev@ozlabs.org
In-Reply-To: <1181548417.5217.13.camel@mark>
On Mon, Jun 11, 2007 at 03:53:37PM +0800, Mark Zhan wrote:
> Current MII bitbang bus driver hard-codes the phy mask of mii_bus to
> ~0x09, which is actually specific to the FSL boards. This patch will
> make the bitbang driver to generate MII bus phy_mask dynamically, by the
> PHY irq info provided by the platform.
>
> Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com>
Acked-by: Vitaly Bordug <vitb@kernel.crashing.org>
> ---
> b/drivers/net/fs_enet/mii-bitbang.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/fs_enet/mii-bitbang.c
> b/drivers/net/fs_enet/mii-bitbang.c
> index d384010..3732d69 100644
> --- a/drivers/net/fs_enet/mii-bitbang.c
> +++ b/drivers/net/fs_enet/mii-bitbang.c
> @@ -315,7 +315,7 @@ static int __devinit fs_enet_mdio_probe(
> struct fs_mii_bb_platform_info *pdata;
> struct mii_bus *new_bus;
> struct bb_info *bitbang;
> - int err = 0;
> + int i, err = 0;
>
> if (NULL == dev)
> return -EINVAL;
> @@ -336,14 +336,17 @@ static int __devinit fs_enet_mdio_probe(
> new_bus->reset = &fs_enet_mii_bb_reset,
> new_bus->id = pdev->id;
>
> - new_bus->phy_mask = ~0x9;
> pdata = (struct fs_mii_bb_platform_info *)pdev->dev.platform_data;
> -
> if (NULL == pdata) {
> printk(KERN_ERR "gfar mdio %d: Missing platform data!\n", pdev->id);
> return -ENODEV;
> }
>
> + new_bus->phy_mask = 0xFFFFFFFF;
> + for (i = 0; i < PHY_MAX_ADDR; i++)
> + if (pdata->irq[i] != -1)
> + new_bus->phy_mask &= ~(1 << i);
> +
> /*set up workspace*/
> fs_mii_bitbang_init(bitbang, pdata);
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] MII bitbang driver should generate MII bus phy_mask dynamically
From: Andy Fleming @ 2007-06-11 18:57 UTC (permalink / raw)
To: Mark Zhan; +Cc: netdev, Vitaly Bordug, linuxppc-dev@ozlabs.org
In-Reply-To: <1181548417.5217.13.camel@mark>
On Jun 11, 2007, at 02:53, Mark Zhan wrote:
> Current MII bitbang bus driver hard-codes the phy mask of mii_bus to
> ~0x09, which is actually specific to the FSL boards. This patch will
> make the bitbang driver to generate MII bus phy_mask dynamically,
> by the
> PHY irq info provided by the platform.
>
> Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com>
[...]
>
> + new_bus->phy_mask = 0xFFFFFFFF;
> + for (i = 0; i < PHY_MAX_ADDR; i++)
> + if (pdata->irq[i] != -1)
> + new_bus->phy_mask &= ~(1 << i);
> +
This doesn't work. There are a couple of things wrong:
1) Don't use -1, use PHY_POLL
2) As you can tell from #1, the absence of a set interrupt for a
particular PHY does not indicate it doesn't exist. Rather, it
indicates it doesn't have an interrupt.
I think you need to add a phy_mask to the platform data, and then set
it appropriately. We also need to look into adding that for the mdio
nodes in the device tree, so it will get passed in properly.
Andy
^ permalink raw reply
* [PATCH] oprofile support for Power 5++
From: Mike Wolf @ 2007-06-11 18:49 UTC (permalink / raw)
To: linuxppc-dev
This patch adds a new oprofile cpu type for Power 5 revision 3 chips.
The new name is ppc64/power5++ and is used so that the performance
counters can be set up correctly.
Signed-off-by: Mike Wolf <mjw@us.ibm.com>
--------
linux-2.6.18.ppc64.orig/arch/powerpc/kernel/cputable.c 2006-09-19 22:42:06.000000000 -0500
+++ linux-2.6.18.ppc64/arch/powerpc/kernel/cputable.c 2007-06-11 12:29:47.000000000 -0500
@@ -236,6 +236,21 @@
.oprofile_mmcra_sipr = MMCRA_SIPR,
.platform = "power5",
},
+ { /* Power5++ */
+ .pvr_mask = 0xffffff00,
+ .pvr_value = 0x003b0300,
+ .cpu_name = "POWER5+ (gs)",
+ .cpu_features = CPU_FTRS_POWER5,
+ .cpu_user_features = COMMON_USER_POWER5_PLUS,
+ .icache_bsize = 128,
+ .dcache_bsize = 128,
+ .num_pmcs = 6,
+ .oprofile_cpu_type = "ppc64/power5++",
+ .oprofile_type = PPC_OPROFILE_POWER4,
+ .oprofile_mmcra_sihv = MMCRA_SIHV,
+ .oprofile_mmcra_sipr = MMCRA_SIPR,
+ .platform = "power5+",
+ },
{ /* Power5 GS */
.pvr_mask = 0xffff0000,
.pvr_value = 0x003b0000,
^ permalink raw reply
* Re: ioctl on 870 FEC causes "badness in local_bh_enable at kernel/softirq.c"
From: Andy Fleming @ 2007-06-11 18:47 UTC (permalink / raw)
To: N. van Bolhuis; +Cc: linuxppc-embedded
In-Reply-To: <466D6DEB.1030405@aimsys.nl>
>
> This is because drivers/net/fs_enet/fs_enet-main.c:fs_ioctl
> disables the interrupts with spin_lock_irqsave after which it calls
> phy_mii_ioctl. This leads to drivers/net/phy/phy.c:phy_read
> being called which does spin_lock_bh/spin_unlock_bh.
> Obviously the spin_unlock_bh enables softirqs and it is correctly
> complaining irqs are disabled.
That's a programming error. The PHY Layer's functions must not be
called with interrupts disabled.
Andy
^ permalink raw reply
* Re: [PATCH] Fix interrupt distribution in ppc970
From: Mohan Kumar M @ 2007-06-11 18:07 UTC (permalink / raw)
To: Milton Miller; +Cc: ppcdev, Paul Mackerras, kexec
In-Reply-To: <ac119a2f080a47cf41f7c916010eaccd@bga.com>
On Sun, Jun 10, 2007 at 08:58:10PM -0500, Milton Miller wrote:
> The code is structured cleanly. However, when testing this patch, I
> found (1) you printed the mask as a cpulist instead of a cpumask.
> Since the user writes a cpumask to /proc/irq/xx/smp_affinity, it would
> make more sense to print a mask in the error message.
>
I can change it to use cpumask print instead of cpulist print.
> However, this is all mute because (2) the common in /kenrel/irq/proc.c
> checks that a cpu in the mask is online and returns -EINVAL to the user
> without calling the ->set_affinity hook (we have no select_smp_affinity
> hook arch code). Unless there is another path to call ->set_affinity,
> we can only trigger the case of no online cpu by racing between setting
> the affinity and taking a cpu offline.
>
As you said, we can remove the extra check in get_irq_server function.
Any other thoughts?
> Does anyone know of another path to set the affinity? If not I would
> remove this extra logic and change the behavior from ignore to set to
> default server.
>
^ permalink raw reply
* Re: Making fs_enet phy unaware
From: Ben Warren @ 2007-06-11 17:52 UTC (permalink / raw)
To: DI BACCO ANTONIO - technolabs; +Cc: linuxppc-embedded
In-Reply-To: <F1F6EC0C8B75034F9E3A79FC85122E8E8EADF8@aquib01a>
Hi Antonio,
On Mon, 2007-06-11 at 12:30 +0200, DI BACCO ANTONIO - technolabs wrote:
> Hi all,
>
> how can I avoid that fs_enet driver uses its associated phy? My problem
> is that my FEC is attached to a switch and three other ports of the
> switch are connected to three physical connectors. I don't want that the
> driver bothers about the PHYs.
If you search the archives you'll find patches by Vitaly Bordug and Andy
Fleming for so-called 'Fixed PHY'. I've been using this for quite a
while and it works quite well.
regards,
Ben
^ permalink raw reply
* Re: [PATCH] Don't register udbg_console without udbg_putc
From: Mark A. Greer @ 2007-06-11 17:46 UTC (permalink / raw)
To: Milton Miller; +Cc: linuxppc-dev, paulus, olof
In-Reply-To: <111814499636b8b45671.846930886.miltonm@bga.com>
On Sat, Jun 09, 2007 at 11:32:43PM -0500, Milton Miller wrote:
> Previously, registering this early console would just result
> in dropping early buffered printk output until a udbg_putc
> was registered.
>
> However, commit 69331af79cf29e26d1231152a172a1a10c2df511
> clears the CON_PRINTBUFFER flag on the main console when a
> CON_BOOT (early) console has been registered, resulting in
> the buffered messages never being displayed to the user.
>
> Signed-off-by: Milton Miller <miltonm@bga.com>
Acked-by: Mark A. Greer <mgreer@mvista.com>
>
> ---
> Mark and Dale can you test this please?
Yep, get all the console output with this patch and non of Dales
patches.
Thanks Milton,
Mark
^ permalink raw reply
* Re: 83xx GPIO/EXT int in arch/powerpc/
From: Marc Leeman @ 2007-06-11 16:21 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <d3c57096eec4553de180adab085d0145@kernel.crashing.org>
[-- Attachment #1: Type: text/plain, Size: 2603 bytes --]
> > Poor guy trying to figure out the right way to do
> > his stuff will run away screaming and go back hard coding his number in
> > his platform code before we are finished :-)
>
> Heh I hope not.
Hm, I guess I took the dirty way suggested by Benjamin and having a look
at the CDS Freescale platform by copying the following in my platform
file:
static void __init mpc83xx_svc2_pcibios_fixup(void)
{
struct pci_dev *dev;
if ((dev = pci_get_device(VENDOR_ID_ALTERA,
DEVICE_ID_FPGA834XG1, NULL))) {
dev->irq = 23;
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 23);
pci_dev_put(dev);
}
/* Now map all the PCI irqs */
dev = NULL;
for_each_pci_dev(dev)
pci_read_irq_line(dev);
}
I am planning to have another look at the proper (tm) way to fix it, by
experimenting with my dts file; but since I need to get a number of
boards released, it's a bit pushed backwards.
What is more disturbing though, is that a number of operations on the
powerpc arch seems significantly slower wrt the ppc arch.
ioremap and iounmap being the most important one: we are using a small
driver that uses one of the UPMs in combination with GPIOs for HPI (Host
Port Interface) for TI DSPs.
Where the loading of a DSP took only 3 seconds, it went up to over a
minute on powerpc (same driver code).
Changing the driver to ioremap and unmap 0xe2400000 only once at driver
initialisation and unloading (not really relevant on this embedded
system, shame on me) instead twice for every word greatly improves the
time (around one second). However, this optimisation has the same effect
on ppc too :-/
Running the same application with the same modules on ppc and powerpc
(transferring data from the network to an FPGA) has a 50% higher load on
powerpc. The transfer is done with mapping user pages into the kernel
and DMA'ing them over PCI. What all driver have in common is that there
are quite some writes/reads to the IMMR configuration.
Decreasing the read and writes to the LBC for HPI (0xe2400000) seems to
improve the overall load.
So my question would be if I need to specify a special section in the
dts file for some reason; next to the U-Boot configuration that sends
writes to this address through the UPMB?
If not, is there any other reason that might account for these
significant performance drops?
--
greetz, marc
Aeryn, did I say or do anything to piss you off? I mean other than
caving in the side of your head?
Crichton - Die Me, Dichotomy
chiana 2.6.18-4-ixp4xx #1 Tue Mar 27 18:01:56 BST 2007 GNU/Linux
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox