Only call ppc_md.setup_arch() if it is provided.
Subsystems (5)
PATCH 2/6 Remove empty ppc_md.setup_arch hooks.
In reply to Grant LikelyFrom: Grant Likely <[email protected]>
---
arch/powerpc/platforms/40x/virtex.c | 5 ----- arch/powerpc/platforms/40x/walnut.c | 5 ----- arch/powerpc/platforms/44x/bamboo.c | 5 ----- arch/powerpc/platforms/44x/ebony.c | 5 ----- arch/powerpc/platforms/44x/sequoia.c | 5 ----- 5 files changed, 0 insertions(+), 25 deletions(-)
arch/powerpc/platforms/40x/virtex.c +0 -5
@@ -36,14 +36,9 @@ static int __init virtex_probe(void)return 1 ; } -static void __init virtex_setup_arch (void ) -{ -} -define_machine (virtex) { .name = "Xilinx Virtex", .probe = virtex_probe, - .setup_arch = virtex_setup_arch, .init_IRQ = xilinx_intc_init_tree, .get_irq = xilinx_intc_get_irq, .calibrate_decr = generic_calibrate_decr,
arch/powerpc/platforms/40x/walnut.c +0 -5
@@ -53,14 +53,9 @@ static int __init walnut_probe(void)return 1 ; } -static void __init walnut_setup_arch (void ) -{ -} -define_machine (walnut) { .name = "Walnut", .probe = walnut_probe, - .setup_arch = walnut_setup_arch, .progress = udbg_progress, .init_IRQ = uic_init_tree, .get_irq = uic_get_irq,
arch/powerpc/platforms/44x/bamboo.c +0 -5
@@ -50,14 +50,9 @@ static int __init bamboo_probe(void)return 1 ; } -static void __init bamboo_setup_arch (void ) -{ -} -define_machine (bamboo) { .name = "Bamboo", .probe = bamboo_probe, - .setup_arch = bamboo_setup_arch, .progress = udbg_progress, .init_IRQ = uic_init_tree, .get_irq = uic_get_irq,
arch/powerpc/platforms/44x/ebony.c +0 -5
@@ -57,14 +57,9 @@ static int __init ebony_probe(void)return 1 ; } -static void __init ebony_setup_arch (void ) -{ -} -define_machine (ebony) { .name = "Ebony", .probe = ebony_probe, - .setup_arch = ebony_setup_arch, .progress = udbg_progress, .init_IRQ = uic_init_tree, .get_irq = uic_get_irq,
arch/powerpc/platforms/44x/sequoia.c +0 -5
@@ -50,14 +50,9 @@ static int __init sequoia_probe(void)return 1 ; } -static void __init sequoia_setup_arch (void ) -{ -} -define_machine (sequoia) { .name = "Sequoia", .probe = sequoia_probe, - .setup_arch = sequoia_setup_arch, .progress = udbg_progress, .init_IRQ = uic_init_tree, .get_irq = uic_get_irq,
PATCH 3/6 Platforms shouldn't mess with ROOT_DEV
In reply to Grant LikelyFrom: Grant Likely <[email protected]>
There is no good reason for board platform code to mess with the ROOT_DEV. Remove it from all in-tree platforms except powermac
---
arch/powerpc/platforms/52xx/efika.c | 9 --------- arch/powerpc/platforms/52xx/lite5200.c | 12 ------------ arch/powerpc/platforms/8xx/mpc86xads_setup.c | 2 -- arch/powerpc/platforms/cell/setup.c | 5 ----- arch/powerpc/platforms/celleb/setup.c | 5 ----- arch/powerpc/platforms/chrp/setup.c | 10 ---------- arch/powerpc/platforms/pseries/setup.c | 5 ----- 7 files changed, 0 insertions(+), 48 deletions(-)
arch/powerpc/platforms/52xx/efika.c +0 -9
@@ -197,15 +197,6 @@ static void __init efika_setup_arch(void) {rtas_initialize (); -#ifdef CONFIG_BLK_DEV_INITRD - initrd_below_start_ok =1 ; - -if (initrd_start) -ROOT_DEV = Root_RAM0; - else -#endif -ROOT_DEV = Root_SDA2;/* sda2 (sda1 is for the kernel) */ -efika_pcisetup ();#ifdef CONFIG_PM
arch/powerpc/platforms/52xx/lite5200.c +0 -12
@@ -136,18 +136,6 @@ static void __init lite5200_setup_arch(void) of_node_put(np); }#endif - -#ifdef CONFIG_BLK_DEV_INITRD -if (initrd_start) -ROOT_DEV = Root_RAM0; - else -#endif -#ifdef CONFIG_ROOT_NFS -ROOT_DEV = Root_NFS; -#else -ROOT_DEV = Root_HDA1; -#endif - }static void lite5200_show_cpuinfo (struct seq_file *m)
arch/powerpc/platforms/8xx/mpc86xads_setup.c +0 -2
@@ -256,8 +256,6 @@ static void __init mpc86xads_setup_arch(void)cpm_reset ();mpc86xads_board_setup (); - -ROOT_DEV = Root_NFS; }static int __init mpc86xads_probe (void )
arch/powerpc/platforms/cell/setup.c +0 -5
@@ -161,11 +161,6 @@ static void __init cell_setup_arch(void)/* init to some ~sane value until calibrate_delay() runs */ loops_per_jiffy =50000000 ; -if (ROOT_DEV ==0 ) { -printk ("No ramdisk, default root is /dev/hda2\n" ); -ROOT_DEV = Root_HDA2; - } -/* Find and initialize PCI host bridges */ init_pci_config_tokens ();find_and_init_phbs ();
arch/powerpc/platforms/celleb/setup.c +0 -5
@@ -101,11 +101,6 @@ static void __init celleb_setup_arch(void)/* init to some ~sane value until calibrate_delay() runs */ loops_per_jiffy =50000000 ; -if (ROOT_DEV ==0 ) { -printk ("No ramdisk, default root is /dev/hda2\n" ); -ROOT_DEV = Root_HDA2; - } -#ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con;#endif
arch/powerpc/platforms/chrp/setup.c +0 -10
@@ -290,16 +290,6 @@ void __init chrp_setup_arch(void) ppc_md.set_rtc_time = rtas_set_rtc_time; } -#ifdef CONFIG_BLK_DEV_INITRD -/* this is fine for chrp */ - initrd_below_start_ok =1 ; - -if (initrd_start) -ROOT_DEV = Root_RAM0; - else -#endif -ROOT_DEV = Root_SDA2;/* sda2 (sda1 is for the kernel) */ -/* On pegasos, enable the L2 cache if not already done by OF */ pegasos_set_l2cr ();
arch/powerpc/platforms/pseries/setup.c +0 -5
@@ -257,11 +257,6 @@ static void __init pSeries_setup_arch(void)/* init to some ~sane value until calibrate_delay() runs */ loops_per_jiffy =50000000 ; -if (ROOT_DEV ==0 ) { -printk ("No ramdisk, default root is /dev/sda2\n" ); -ROOT_DEV = Root_SDA2; - } -fwnmi_init ();/* Find and initialize PCI host bridges */
PATCH 5/6 MPC52xx: Trim includes on mpc5200 platform support code
In reply to Grant LikelyFrom: Grant Likely <[email protected]>
Drop unnecessary includes for MPC5200 based boards
---
arch/powerpc/platforms/52xx/efika.c | 21 ++------------------- arch/powerpc/platforms/52xx/lite5200.c | 22 +--------------------- arch/powerpc/platforms/52xx/mpc52xx_common.c | 4 +--- arch/powerpc/platforms/52xx/mpc52xx_pic.c | 12 +----------- 4 files changed, 5 insertions(+), 54 deletions(-)
arch/powerpc/platforms/52xx/efika.c +2 -19
@@ -9,33 +9,16 @@* kind, whether express or implied. */ -#include <linux/errno.h> -#include <linux/kernel.h> -#include <linux/slab.h> -#include <linux/reboot.h> #include <linux/init.h> #include <linux/utsrelease.h> -#include <linux/seq_file.h> -#include <linux/string.h> -#include <linux/root_dev.h> -#include <linux/initrd.h> -#include <linux/timer.h> #include <linux/pci.h> - -#include <asm/io.h> -#include <asm/irq.h> -#include <asm/sections.h> -#include <asm/pci-bridge.h> -#include <asm/pgtable.h> -#include <asm/prom.h> +#include <linux/of.h> #include <asm/time.h> +#include <asm/io.h> #include <asm/machdep.h> #include <asm/rtas.h> -#include <asm/of_device.h> -#include <asm/of_platform.h> #include <asm/mpc52xx.h> -#define EFIKA_PLATFORM_NAME "Efika"
arch/powerpc/platforms/52xx/lite5200.c +1 -21
@@ -15,32 +15,12 @@#undef DEBUG -#include <linux/stddef.h> -#include <linux/kernel.h> #include <linux/init.h> -#include <linux/errno.h> -#include <linux/reboot.h> #include <linux/pci.h> -#include <linux/kdev_t.h> -#include <linux/major.h> -#include <linux/console.h> -#include <linux/delay.h> -#include <linux/seq_file.h> -#include <linux/root_dev.h> -#include <linux/initrd.h> - -#include <asm/system.h> -#include <asm/atomic.h> +#include <linux/of.h> #include <asm/time.h> #include <asm/io.h> #include <asm/machdep.h> -#include <asm/ipic.h> -#include <asm/irq.h> -#include <asm/prom.h> -#include <asm/udbg.h> -#include <sysdev/fsl_soc.h> -#include <asm/of_platform.h> -#include <asm/mpc52xx.h> /* ************************************************************************
arch/powerpc/platforms/52xx/mpc52xx_common.c +1 -3
@@ -13,10 +13,8 @@#undef DEBUG#include <linux/kernel.h> - +#include <linux/of_platform.h> #include <asm/io.h> -#include <asm/prom.h> -#include <asm/of_platform.h> #include <asm/mpc52xx.h>
arch/powerpc/platforms/52xx/mpc52xx_pic.c +1 -11
@@ -18,19 +18,9 @@#undef DEBUG -#include <linux/stddef.h> -#include <linux/init.h> -#include <linux/sched.h> -#include <linux/signal.h> -#include <linux/delay.h> #include <linux/irq.h> -#include <linux/hardirq.h> - +#include <linux/of.h> #include <asm/io.h> -#include <asm/processor.h> -#include <asm/system.h> -#include <asm/irq.h> -#include <asm/prom.h> #include <asm/mpc52xx.h> #include "mpc52xx_pic.h"
PATCH 4/6 MPC52xx: Drop show_cpuinfo platform hooks from Lite5200
In reply to Grant LikelyFrom: Grant Likely <[email protected]>
This hook doesn't really add any new information.
---
arch/powerpc/platforms/52xx/lite5200.c | 15 --------------- 1 files changed, 0 insertions(+), 15 deletions(-)
arch/powerpc/platforms/52xx/lite5200.c +0 -15
@@ -138,20 +138,6 @@ static void __init lite5200_setup_arch(void)#endif } -static void lite5200_show_cpuinfo (struct seq_file *m) -{ -struct device_node * np =of_find_all_nodes (NULL ); -const char *model =NULL ; - -if (np) - model =of_get_property (np,"model" ,NULL ); - -seq_printf (m,"vendor\t\t: Freescale Semiconductor\n" ); -seq_printf (m,"machine\t\t: %s\n" , model ? model :"unknown" ); - -of_node_put (np); -} -/* * Called very early, MMU is off, device-tree isn't unflattened */
@@ -175,6 +161,5 @@ define_machine(lite5200) { .init = mpc52xx_declare_of_platform_devices, .init_IRQ = mpc52xx_init_irq, .get_irq = mpc52xx_get_irq, - .show_cpuinfo = lite5200_show_cpuinfo, .calibrate_decr = generic_calibrate_decr, };
PATCH 6/6 MPC5200: Don't make firmware fixups into common code
In reply to Grant LikelyFrom: Grant Likely <[email protected]>
The Lite5200 u-boot image doesn't entirely configure the processor correctly and so Linux needs to fixup the cpu setup in setup_arch. Fixing the CPU setup is good, but making it into common code is not a good idea.
New board ports should be encouraged not to take the lead of the lite5200 and instead get their firmware to setup the CPU the right way.
---
arch/powerpc/platforms/52xx/lite5200.c | 85 ++++++++++++++++++++++++-- arch/powerpc/platforms/52xx/mpc52xx_common.c | 40 ------------ 2 files changed, 78 insertions(+), 47 deletions(-)
arch/powerpc/platforms/52xx/lite5200.c +78 -7
@@ -29,19 +29,90 @@* */ +/* +* Fix clock configuration. +* +* Firmware is supposed to be responsible for this. If you are creating a +* new board port, do *NOT* duplicate this code. Fix your boot firmware +* to set it correctly in the first place +*/ +void __init +lite5200_fix_clock_config (void ) +{ +struct mpc52xx_cdm __iomem *cdm; + +/* Map zones */ + cdm =mpc52xx_find_and_map ("mpc5200-cdm" ); +if (!cdm) { +printk (KERN_ERR "Could not adjust CDM config; " +"Expect abnormal behaviour\n" ); +return ; + } + +/* Use internal 48 Mhz */ +out_8 (&cdm->ext_48mhz_en,0x00 ); +out_8 (&cdm->fd_enable,0x01 ); +if (in_be32 (&cdm->rstcfg) &0x40 )/* Assumes 33Mhz clock */ +out_be16 (&cdm->fd_counters,0x0001 ); +else +out_be16 (&cdm->fd_counters,0x5555 ); + +/* Unmap the regs */ +iounmap (cdm); +} + +/* +* Fix XLB configuration. +* +* Firmware is supposed to be responsible for this. If you are creating a +* new board port, do *NOT* duplicate this code. Fix your boot firmware +* to set it correctly in the first place +*/ +void __init +lite5200_fix_xlb_config (void ) +{ +struct mpc52xx_xlb __iomem *xlb; + + xlb =mpc52xx_find_and_map ("mpc5200-xlb" ); +if (!xlb) { +printk (KERN_ERR "Could not adjust XLB config; " +"Expect abnormal behaviour\n" ); +return ; + } + +/* Configure the XLB Arbiter priorities */ +out_be32 (&xlb->master_pri_enable,0xff ); +out_be32 (&xlb->master_priority,0x11111111 ); + +/* Disable XLB pipelining +* (cfr errate 292. We could do this only just before ATA PIO +* transaction and re-enable it afterwards ...) +*/ +out_be32 (&xlb->config,in_be32 (&xlb->config) | MPC52xx_XLB_CFG_PLDIS); + +/* Unmap the regs */ +iounmap (xlb); +} + +/* +* Fix setting of port_config register. +* +* Firmware is supposed to be responsible for this. If you are creating a +* new board port, do *NOT* duplicate this code. Fix your boot firmware +* to set it correctly in the first place +*/ static void __init -lite5200_setup_cpu (void ) +lite5200_fix_port_config (void ) {struct mpc52xx_gpio __iomem *gpio;u32 port_config; -/* Map zones */ gpio =mpc52xx_find_and_map ("mpc5200-gpio" );if (!gpio) { printk(KERN_ERR __FILE__ ": ""Error while mapping GPIO register for port config. " "Expect some abnormal behavior\n"); - goto error; +return ; }/* Set port config */
@@ -60,7 +131,6 @@ lite5200_setup_cpu(void)out_be32 (&gpio->port_config, port_config);/* Unmap zone */ -error:iounmap (gpio); }
@@ -99,9 +169,10 @@ static void __init lite5200_setup_arch(void)if (ppc_md.progress) ppc_md.progress ("lite5200_setup_arch()" ,0 ); -/* CPU & Port mux setup */ -mpc52xx_setup_cpu ();/* Generic */ -lite5200_setup_cpu ();/* Platorm specific */ +/* Fix things that firmware should have done. */ +lite5200_fix_clock_config (); +lite5200_fix_xlb_config (); +lite5200_fix_port_config ();#ifdef CONFIG_PM mpc52xx_suspend.board_suspend_prepare = lite5200_suspend_prepare;
arch/powerpc/platforms/52xx/mpc52xx_common.c +0 -40
@@ -75,46 +75,6 @@ EXPORT_SYMBOL(mpc52xx_find_ipb_freq);void __init -mpc52xx_setup_cpu (void ) -{ -struct mpc52xx_cdm __iomem *cdm; -struct mpc52xx_xlb __iomem *xlb; - -/* Map zones */ - cdm =mpc52xx_find_and_map ("mpc5200-cdm" ); - xlb =mpc52xx_find_and_map ("mpc5200-xlb" ); - -if (!cdm || !xlb) { - printk(KERN_ERR __FILE__ ": " -"Error while mapping CDM/XLB during mpc52xx_setup_cpu. " - "Expect some abnormal behavior\n"); - goto unmap_regs; - } - -/* Use internal 48 Mhz */ -out_8 (&cdm->ext_48mhz_en,0x00 ); -out_8 (&cdm->fd_enable,0x01 ); -if (in_be32 (&cdm->rstcfg) &0x40 )/* Assumes 33Mhz clock */ -out_be16 (&cdm->fd_counters,0x0001 ); -else -out_be16 (&cdm->fd_counters,0x5555 ); - -/* Configure the XLB Arbiter priorities */ -out_be32 (&xlb->master_pri_enable,0xff ); -out_be32 (&xlb->master_priority,0x11111111 ); - -/* Disable XLB pipelining */ -/* (cfr errate 292. We could do this only just before ATA PIO -transaction and re-enable it afterwards ...) */ -out_be32 (&xlb->config,in_be32 (&xlb->config) | MPC52xx_XLB_CFG_PLDIS); - -/* Unmap zones */ -unmap_regs: -if (cdm)iounmap (cdm); -if (xlb)iounmap (xlb); -} - -void __init mpc52xx_declare_of_platform_devices (void ) {/* Find every child of the SOC node and add it to of_platform */
PATCH 1/6 Only call ppc_md.setup_arch() if it is provided.
From: Grant Likely <[email protected]>
This allows platforms which don't have anything to do at setup_arch time (like a bunch of the 4xx platforms) to eliminate an empty setup_arch hook.
---
arch/powerpc/kernel/setup_32.c | 3 ++- arch/powerpc/kernel/setup_64.c | 3 ++- include/asm-powerpc/machdep.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-)
arch/powerpc/kernel/setup_32.c +2 -1
@@ -290,7 +290,8 @@ void __init setup_arch(char **cmdline_p) conswitchp = &dummy_con;#endif - ppc_md.setup_arch (); +if (ppc_md.setup_arch) + ppc_md.setup_arch ();if ( ppc_md.progress ) ppc_md.progress ("arch: exit" ,0x3eab );paging_init ();
arch/powerpc/kernel/setup_64.c +2 -1
@@ -530,7 +530,8 @@ void __init setup_arch(char **cmdline_p) conswitchp = &dummy_con;#endif - ppc_md.setup_arch (); +if (ppc_md.setup_arch) + ppc_md.setup_arch ();paging_init ();ppc64_boot_msg (0x15 ,"Setup Done" );
include/asm-powerpc/machdep.h +1 -1
@@ -99,7 +99,7 @@ struct machdep_calls {#endif /* CONFIG_PPC64 */ int (*probe)(void ); -void (*setup_arch)(void ); +void (*setup_arch)(void );/* Optional, may be NULL */ void (*init_early)(void );/* Optional, may be NULL. */ void (*show_cpuinfo)(struct seq_file *m);
Re: [PATCH 5/6] MPC52xx: Trim includes on mpc5200 platform support code
In reply to Grant Likelyarch/powerpc/platforms/52xx/efika.c line 15
Quoted 3 lines · On Mon, 08 Oct 2007 16:25:18 -0600 Grant Likely <[email protected]>…
arch/powerpc/platforms/52xx/efika.c +1
-1-#include <asm/prom.h> +#include <linux/of.h>
You should keep asm/prom.h if you are using any of the flat device tree accessors (which thses files do).
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Re: [PATCH 3/6] Platforms shouldn't mess with ROOT_DEV
In reply to Grant LikelyQuoted 8 lines · Grant Likely
From: Grant Likely <[email protected]>
There is no good reason for board platform code to mess with the
ROOT_DEV. Remove it from all in-tree platforms except powermacSigned-off-by Grant Likely <[email protected]>---
Quoted 8 lines
arch/powerpc/platforms/52xx/efika.c | 9 --------- arch/powerpc/platforms/52xx/lite5200.c | 12 ------------ arch/powerpc/platforms/8xx/mpc86xads_setup.c | 2 -- arch/powerpc/platforms/cell/setup.c | 5 ----- arch/powerpc/platforms/celleb/setup.c | 5 ----- arch/powerpc/platforms/chrp/setup.c | 10 ---------- arch/powerpc/platforms/pseries/setup.c | 5 ----- 7 files changed, 0 insertions(+), 48 deletions(-)
I'd drop mpc86xads_setup since I think Scott's rework will deal with it.
- k
Re: [PATCH 3/6] Platforms shouldn't mess with ROOT_DEV
Quoted 21 lines · Kumar Gala
Quoted 9 lines · Grant Likely
From: Grant Likely <[email protected]>
There is no good reason for board platform code to mess with the
ROOT_DEV.
Remove it from all in-tree platforms except powermacSigned-off-by Grant Likely <[email protected]>---
Quoted 8 lines
arch/powerpc/platforms/52xx/efika.c | 9 --------- arch/powerpc/platforms/52xx/lite5200.c | 12 ------------ arch/powerpc/platforms/8xx/mpc86xads_setup.c | 2 -- arch/powerpc/platforms/cell/setup.c | 5 ----- arch/powerpc/platforms/celleb/setup.c | 5 ----- arch/powerpc/platforms/chrp/setup.c | 10 ---------- arch/powerpc/platforms/pseries/setup.c | 5 ----- 7 files changed, 0 insertions(+), 48 deletions(-)
Quoted 1 line
I'd drop
mpc86xads_setupsince I think Scott's rework will deal with it.
Okay, will do. I wasn't sure since you hadn't explicitly mentioned it.
Cheers,
g.
Signature · 4 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. [email protected] (403) 399-0195