ppc32: Clean up mv64x60 bootwrapper support
PATCH 1/1 ppc32: Clean up mv64x60 bootwrapper support
ppc32: Clean up mv64x60 bootwrapper support
This patch removes the call to mv64x60_init() in arch/ppc/boot/simple/head.S and now uses the 'load_kernel()' hook to call to have mv64x60-specific code called. This means that the mv64x60 code will be called after the bootwrapper has relocated itself. The platforms affected by this change are updated by this patch as well.
Depends on patch: http://ozlabs.org/pipermail/linuxppc-embedded/2005-March/017269.html
Please apply.
--
arch/ppc/boot/simple/Makefile +3 -3
@@ -49,7 +49,7 @@ #---------------------------------------------------------------------------- zimage-$(CONFIG_CPCI690) := zImage-STRIPELF zimageinitrd-$(CONFIG_CPCI690) := zImage.initrd-STRIPELF - extra.o-$(CONFIG_CPCI690) := misc-cpci690.o mv64x60_stub.o + extra.o-$(CONFIG_CPCI690) := misc-cpci690.o end-$(CONFIG_CPCI690) := cpci690 cacheflag-$(CONFIG_CPCI690) := -include $(clear_L2_L3)
@@ -94,11 +94,11 @@ end-$(CONFIG_K2) := k2 cacheflag-$(CONFIG_K2) := -include $(clear_L2_L3) - extra.o-$(CONFIG_KATANA) := misc-katana.o mv64x60_stub.o + extra.o-$(CONFIG_KATANA) := misc-katana.o end-$(CONFIG_KATANA) := katana cacheflag-$(CONFIG_KATANA) := -include $(clear_L2_L3) - extra.o-$(CONFIG_RADSTONE_PPC7D) := misc-radstone_ppc7d.o mv64x60_stub.o + extra.o-$(CONFIG_RADSTONE_PPC7D) := misc-radstone_ppc7d.o end-$(CONFIG_RADSTONE_PPC7D) := radstone_ppc7d cacheflag-$(CONFIG_RADSTONE_PPC7D) := -include $(clear_L2_L3)
arch/ppc/boot/simple/head.S +0 -5
@@ -135,11 +135,6 @@ */ #endif -#ifdef CONFIG_MV64X60 - /* mv64x60 specific hook to do things like moving register base, etc. */ - bl mv64x60_init -#endif - /* Get the load address. */ subi r3, r3, 4 /* Get the actual IP, not NIP */
arch/ppc/boot/simple/misc-chestnut.S deleted +0 -41
41 lines not on this page · raw message
arch/ppc/boot/simple/misc-chestnut.c new file +35 -0
@@ -0,0 +1,35 @@ +/* +* arch/ppc/boot/simple/misc-chestnut.c +* +* Setup for the IBM Chestnut (ibm-750fxgx_eval) +* +* Author: Mark A. Greer <[email protected]> +* +* 2005 (c) MontaVista Software, Inc. This file is licensed under +* the terms of the GNU General Public License version 2. This program +* is licensed "as is" without any warranty of any kind, whether express +* or implied. +*/ + +#include <linux/config.h> +#include <linux/types.h> +#include <asm/io.h> +#include <asm/mv64x60_defs.h> +#include <platforms/chestnut.h> + +/* Not in the kernel so won't include kernel.h to get its 'max' definition */ +#define max (a,b) (((a) > (b)) ? (a) : (b)) + +void +mv64x60_board_init (void __iomem *old_base,void __iomem *new_base) +{ +#ifdef CONFIG_SERIAL_8250_CONSOLE +/* +* Change device bus 2 window so that bootoader can do I/O thru +* 8250/16550 UART that's mapped in that window. +*/ +out_le32 (new_base + MV64x60_CPU2DEV_2_BASE,CHESTNUT_UART_BASE >>16 ); +out_le32 (new_base + MV64x60_CPU2DEV_2_SIZE,CHESTNUT_UART_SIZE >>16 ); + __asm__ __volatile__("sync" ); +#endif +}
arch/ppc/boot/simple/misc-cpci690.c +13 -1
@@ -12,4 +12,16 @@*/ #include <linux/types.h> -long mv64x60_mpsc_clk_freq =133000000 ; +#include <platforms/cpci690.h> + +extern u32 mv64x60_console_baud; +extern u32 mv64x60_mpsc_clk_src; +extern u32 mv64x60_mpsc_clk_freq; + +void +mv64x60_board_init (void __iomem *old_base,void __iomem *new_base) +{ + mv64x60_console_baud =CPCI690_MPSC_BAUD ; + mv64x60_mpsc_clk_src =CPCI690_MPSC_CLK_SRC ; + mv64x60_mpsc_clk_freq =CPCI690_BUS_FREQ ; +}
arch/ppc/boot/simple/misc-ev64260.S deleted +0 -68
68 lines not on this page · raw message
arch/ppc/boot/simple/misc-ev64260.c new file +57 -0
57 lines not on this page · raw message
arch/ppc/boot/simple/misc-katana.c +24 -2
@@ -1,7 +1,7 @@/* * arch/ppc/boot/simple/misc-katana.c * -* Add birec data for Artesyn KATANA board. +* Set up MPSC values to bootwrapper can prompt user. * * Author: Mark A. Greer <[email protected]> *
@@ -11,5 +11,27 @@* or implied. */ +#include <linux/config.h> #include <linux/types.h> -long mv64x60_mpsc_clk_freq =133333333 ; +#include <asm/io.h> +#include <asm/mv64x60_defs.h> +#include <platforms/katana.h> + +extern u32 mv64x60_console_baud; +extern u32 mv64x60_mpsc_clk_src; +extern u32 mv64x60_mpsc_clk_freq; + +/* Not in the kernel so won't include kernel.h to get its 'min' definition */ +#ifndef min +#define min (a,b) (((a) < (b)) ? (a) : (b)) +#endif + +void +mv64x60_board_init (void __iomem *old_base,void __iomem *new_base) +{ + mv64x60_console_baud =KATANA_DEFAULT_BAUD ; + mv64x60_mpsc_clk_src =KATANA_MPSC_CLK_SRC ; + mv64x60_mpsc_clk_freq = +min (katana_bus_freq ((void __iomem *)KATANA_CPLD_BASE ), + MV64x60_TCLK_FREQ_MAX); +}
arch/ppc/boot/simple/misc-mv64x60.S deleted +0 -61
61 lines not on this page · raw message
arch/ppc/boot/simple/misc-mv64x60.c new file +61 -0
61 lines not on this page · raw message
arch/ppc/boot/simple/misc-radstone_ppc7d.c +13 -6
@@ -7,13 +7,20 @@*/ #include <linux/types.h> -#include <asm/reg.h> - -#include "../../platforms/radstone_ppc7d.h" +#include <platforms/radstone_ppc7d.h> #if defined(CONFIG_SERIAL_MPSC_CONSOLE ) -long mv64x60_mpsc_clk_freq =PPC7D_MPSC_CLK_FREQ ;; -long mv64x60_mpsc_clk_src =PPC7D_MPSC_CLK_SRC ; -long mv64x60_mpsc_console_baud =PPC7D_DEFAULT_BAUD ; +extern u32 mv64x60_console_baud; +extern u32 mv64x60_mpsc_clk_src; +extern u32 mv64x60_mpsc_clk_freq;#endif +void +mv64x60_board_init (void __iomem *old_base,void __iomem *new_base) +{ +#if defined(CONFIG_SERIAL_MPSC_CONSOLE ) + mv64x60_console_baud =PPC7D_DEFAULT_BAUD ; + mv64x60_mpsc_clk_src =PPC7D_MPSC_CLK_SRC ; + mv64x60_mpsc_clk_freq =PPC7D_MPSC_CLK_FREQ ; +#endif +}
arch/ppc/boot/simple/mv64x60_stub.c deleted +0 -24
@@ -1,24 +0,0 @@ -/* -* arch/ppc/boot/simple/mv64x60_stub.c -* -* Stub for board_init() routine called from mv64x60_init(). -* -* Author: Mark A. Greer <[email protected]> -* -* 2002 (c) MontaVista, Software, Inc. This file is licensed under the terms -* of the GNU General Public License version 2. This program is licensed -* "as is" without any warranty of any kind, whether express or implied. -*/ - -#include <linux/config.h> - -#if defined(CONFIG_SERIAL_MPSC_CONSOLE ) -long __attribute__ ((weak)) mv64x60_console_baud =9600 ; -long __attribute__ ((weak)) mv64x60_mpsc_clk_src =8 ;/* TCLK */ -long __attribute__ ((weak)) mv64x60_mpsc_clk_freq =100000000 ; -#endif - -void __attribute__ ((weak)) -mv64x60_board_init (void ) -{ -}
arch/ppc/boot/simple/mv64x60_tty.c +54 -78
237 lines not on this page · raw message