aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/boot/simple
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-09-08 01:45:47 -0400
committerLen Brown <len.brown@intel.com>2005-09-08 01:45:47 -0400
commit64e47488c913ac704d465a6af86a26786d1412a5 (patch)
treed3b0148592963dcde26e4bb35ddfec8b1eaf8e23 /arch/ppc/boot/simple
parent4a35a46bf1cda4737c428380d1db5d15e2590d18 (diff)
parentcaf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff)
Merge linux-2.6 with linux-acpi-2.6
Diffstat (limited to 'arch/ppc/boot/simple')
-rw-r--r--arch/ppc/boot/simple/Makefile19
-rw-r--r--arch/ppc/boot/simple/embed_config.c55
-rw-r--r--arch/ppc/boot/simple/head.S9
-rw-r--r--arch/ppc/boot/simple/misc-cpci690.c42
-rw-r--r--arch/ppc/boot/simple/misc-ev64360.c44
-rw-r--r--arch/ppc/boot/simple/misc-katana.c8
-rw-r--r--arch/ppc/boot/simple/misc-mv64x60.c27
-rw-r--r--arch/ppc/boot/simple/mv64x60_tty.c7
8 files changed, 133 insertions, 78 deletions
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index d4dc4fa79647..b7bd8f61a4ad 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -96,10 +96,6 @@ zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE
96zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF 96zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF
97 end-$(CONFIG_GEMINI) := gemini 97 end-$(CONFIG_GEMINI) := gemini
98 98
99 extra.o-$(CONFIG_K2) := prepmap.o
100 end-$(CONFIG_K2) := k2
101 cacheflag-$(CONFIG_K2) := -include $(clear_L2_L3)
102
103 extra.o-$(CONFIG_KATANA) := misc-katana.o 99 extra.o-$(CONFIG_KATANA) := misc-katana.o
104 end-$(CONFIG_KATANA) := katana 100 end-$(CONFIG_KATANA) := katana
105 cacheflag-$(CONFIG_KATANA) := -include $(clear_L2_L3) 101 cacheflag-$(CONFIG_KATANA) := -include $(clear_L2_L3)
@@ -108,12 +104,15 @@ zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF
108 end-$(CONFIG_RADSTONE_PPC7D) := radstone_ppc7d 104 end-$(CONFIG_RADSTONE_PPC7D) := radstone_ppc7d
109 cacheflag-$(CONFIG_RADSTONE_PPC7D) := -include $(clear_L2_L3) 105 cacheflag-$(CONFIG_RADSTONE_PPC7D) := -include $(clear_L2_L3)
110 106
107 extra.o-$(CONFIG_EV64360) := misc-ev64360.o
108 end-$(CONFIG_EV64360) := ev64360
109 cacheflag-$(CONFIG_EV64360) := -include $(clear_L2_L3)
110
111# kconfig 'feature', only one of these will ever be 'y' at a time. 111# kconfig 'feature', only one of these will ever be 'y' at a time.
112# The rest will be unset. 112# The rest will be unset.
113motorola := $(CONFIG_MCPN765)$(CONFIG_MVME5100)$(CONFIG_PRPMC750) \ 113motorola := $(CONFIG_MVME5100)$(CONFIG_PRPMC750) \
114$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS) 114$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS)
115motorola := $(strip $(motorola)) 115motorola := $(strip $(motorola))
116pcore := $(CONFIG_PCORE)$(CONFIG_POWERPMC250)
117 116
118 zimage-$(motorola) := zImage-PPLUS 117 zimage-$(motorola) := zImage-PPLUS
119zimageinitrd-$(motorola) := zImage.initrd-PPLUS 118zimageinitrd-$(motorola) := zImage.initrd-PPLUS
@@ -123,12 +122,6 @@ zimageinitrd-$(motorola) := zImage.initrd-PPLUS
123 extra.o-$(CONFIG_PPLUS) := prepmap.o 122 extra.o-$(CONFIG_PPLUS) := prepmap.o
124 extra.o-$(CONFIG_LOPEC) := mpc10x_memory.o 123 extra.o-$(CONFIG_LOPEC) := mpc10x_memory.o
125 124
126 zimage-$(pcore) := zImage-STRIPELF
127zimageinitrd-$(pcore) := zImage.initrd-STRIPELF
128 extra.o-$(pcore) := chrpmap.o
129 end-$(pcore) := pcore
130 cacheflag-$(pcore) := -include $(clear_L2_L3)
131
132# Really only valid if CONFIG_6xx=y 125# Really only valid if CONFIG_6xx=y
133 zimage-$(CONFIG_PPC_PREP) := zImage-PPLUS 126 zimage-$(CONFIG_PPC_PREP) := zImage-PPLUS
134zimageinitrd-$(CONFIG_PPC_PREP) := zImage.initrd-PPLUS 127zimageinitrd-$(CONFIG_PPC_PREP) := zImage.initrd-PPLUS
@@ -158,8 +151,6 @@ zimageinitrd-$(CONFIG_LITE5200) := zImage.initrd-STRIPELF
158 151
159# This is a treeboot that needs init functions until the 152# This is a treeboot that needs init functions until the
160# boot rom is sorted out (i.e. this is short lived) 153# boot rom is sorted out (i.e. this is short lived)
161extra-aflags-$(CONFIG_REDWOOD_4) := -Wa,-m405
162extra.o-$(CONFIG_REDWOOD_4) := rw4/rw4_init.o rw4/rw4_init_brd.o
163EXTRA_AFLAGS := $(extra-aflags-y) 154EXTRA_AFLAGS := $(extra-aflags-y)
164# head.o needs to get the cacheflags defined. 155# head.o needs to get the cacheflags defined.
165AFLAGS_head.o += $(cacheflag-y) 156AFLAGS_head.o += $(cacheflag-y)
diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
index c342b47e763e..491a691d10cc 100644
--- a/arch/ppc/boot/simple/embed_config.c
+++ b/arch/ppc/boot/simple/embed_config.c
@@ -784,28 +784,12 @@ embed_config(bd_t ** bdp)
784#ifdef CONFIG_IBM_OPENBIOS 784#ifdef CONFIG_IBM_OPENBIOS
785/* This could possibly work for all treeboot roms. 785/* This could possibly work for all treeboot roms.
786*/ 786*/
787#if defined(CONFIG_ASH) || defined(CONFIG_BEECH) || defined(CONFIG_BUBINGA) 787#if defined(CONFIG_BUBINGA)
788#define BOARD_INFO_VECTOR 0xFFF80B50 /* openbios 1.19 moved this vector down - armin */ 788#define BOARD_INFO_VECTOR 0xFFF80B50 /* openbios 1.19 moved this vector down - armin */
789#else 789#else
790#define BOARD_INFO_VECTOR 0xFFFE0B50 790#define BOARD_INFO_VECTOR 0xFFFE0B50
791#endif 791#endif
792 792
793#ifdef CONFIG_BEECH
794static void
795get_board_info(bd_t **bdp)
796{
797 typedef void (*PFV)(bd_t *bd);
798 ((PFV)(*(unsigned long *)BOARD_INFO_VECTOR))(*bdp);
799 return;
800}
801
802void
803embed_config(bd_t **bdp)
804{
805 *bdp = &bdinfo;
806 get_board_info(bdp);
807}
808#else /* !CONFIG_BEECH */
809void 793void
810embed_config(bd_t **bdp) 794embed_config(bd_t **bdp)
811{ 795{
@@ -860,7 +844,6 @@ embed_config(bd_t **bdp)
860#endif 844#endif
861 timebase_period_ns = 1000000000 / bd->bi_tbfreq; 845 timebase_period_ns = 1000000000 / bd->bi_tbfreq;
862} 846}
863#endif /* CONFIG_BEECH */
864#endif /* CONFIG_IBM_OPENBIOS */ 847#endif /* CONFIG_IBM_OPENBIOS */
865 848
866#ifdef CONFIG_EP405 849#ifdef CONFIG_EP405
@@ -943,39 +926,3 @@ embed_config(bd_t **bdp)
943#endif 926#endif
944} 927}
945#endif 928#endif
946
947#ifdef CONFIG_RAINIER
948/* Rainier uses vxworks bootrom */
949void
950embed_config(bd_t **bdp)
951{
952 u_char *cp;
953 int i;
954 bd_t *bd;
955
956 bd = &bdinfo;
957 *bdp = bd;
958
959 for(i=0;i<8192;i+=32) {
960 __asm__("dccci 0,%0" :: "r" (i));
961 }
962 __asm__("iccci 0,0");
963 __asm__("sync;isync");
964
965 /* init ram for parity */
966 memset(0, 0,0x400000); /* Lo memory */
967
968
969 bd->bi_memsize = (32 * 1024 * 1024) ;
970 bd->bi_intfreq = 133000000; //the internal clock is 133 MHz
971 bd->bi_busfreq = 100000000;
972 bd->bi_pci_busfreq= 33000000;
973
974 cp = (u_char *)def_enet_addr;
975 for (i=0; i<6; i++) {
976 bd->bi_enetaddr[i] = *cp++;
977 }
978
979}
980#endif
981
diff --git a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S
index 524053202bb4..5e4adc298bf9 100644
--- a/arch/ppc/boot/simple/head.S
+++ b/arch/ppc/boot/simple/head.S
@@ -120,15 +120,6 @@ haveOF:
120 mtspr SPRN_DER,r4 120 mtspr SPRN_DER,r4
121#endif 121#endif
122 122
123#ifdef CONFIG_REDWOOD_4
124 /* All of this Redwood 4 stuff will soon disappear when the
125 * boot rom is straightened out.
126 */
127 mr r29, r3 /* Easier than changing the other code */
128 bl HdwInit
129 mr r3, r29
130#endif
131
132#if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP) 123#if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP)
133 mr r4,r29 /* put the board info pointer where the relocate 124 mr r4,r29 /* put the board info pointer where the relocate
134 * routine will find it 125 * routine will find it
diff --git a/arch/ppc/boot/simple/misc-cpci690.c b/arch/ppc/boot/simple/misc-cpci690.c
index ef08e86c9b25..26860300fa09 100644
--- a/arch/ppc/boot/simple/misc-cpci690.c
+++ b/arch/ppc/boot/simple/misc-cpci690.c
@@ -12,16 +12,56 @@
12 */ 12 */
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <asm/io.h>
15#include <platforms/cpci690.h> 16#include <platforms/cpci690.h>
16 17
18#define KB (1024UL)
19#define MB (1024UL*KB)
20#define GB (1024UL*MB)
21
17extern u32 mv64x60_console_baud; 22extern u32 mv64x60_console_baud;
18extern u32 mv64x60_mpsc_clk_src; 23extern u32 mv64x60_mpsc_clk_src;
19extern u32 mv64x60_mpsc_clk_freq; 24extern u32 mv64x60_mpsc_clk_freq;
20 25
26u32 mag = 0xffff;
27
28unsigned long
29get_mem_size(void)
30{
31 u32 size;
32
33 switch (in_8(((void __iomem *)CPCI690_BR_BASE + CPCI690_BR_MEM_CTLR))
34 & 0x07) {
35 case 0x01:
36 size = 256*MB;
37 break;
38 case 0x02:
39 size = 512*MB;
40 break;
41 case 0x03:
42 size = 768*MB;
43 break;
44 case 0x04:
45 size = 1*GB;
46 break;
47 case 0x05:
48 size = 1*GB + 512*MB;
49 break;
50 case 0x06:
51 size = 2*GB;
52 break;
53 default:
54 size = 0;
55 }
56
57 return size;
58}
59
21void 60void
22mv64x60_board_init(void __iomem *old_base, void __iomem *new_base) 61mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
23{ 62{
24 mv64x60_console_baud = CPCI690_MPSC_BAUD; 63 mv64x60_console_baud = CPCI690_MPSC_BAUD;
25 mv64x60_mpsc_clk_src = CPCI690_MPSC_CLK_SRC; 64 mv64x60_mpsc_clk_src = CPCI690_MPSC_CLK_SRC;
26 mv64x60_mpsc_clk_freq = CPCI690_BUS_FREQ; 65 mv64x60_mpsc_clk_freq =
66 (get_mem_size() >= (1*GB)) ? 100000000 : 133333333;
27} 67}
diff --git a/arch/ppc/boot/simple/misc-ev64360.c b/arch/ppc/boot/simple/misc-ev64360.c
new file mode 100644
index 000000000000..cd1ccf2a1582
--- /dev/null
+++ b/arch/ppc/boot/simple/misc-ev64360.c
@@ -0,0 +1,44 @@
1/*
2 * arch/ppc/boot/simple/misc-ev64360.c
3 * Copyright (C) 2005 Lee Nicks <allinux@gmail.com>
4 *
5 * Based on arch/ppc/boot/simple/misc-katana.c from:
6 * Mark A. Greer <source@mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22
23#include <linux/config.h>
24#include <linux/types.h>
25#include <asm/io.h>
26#include <asm/mv64x60_defs.h>
27#include <platforms/ev64360.h>
28
29extern u32 mv64x60_console_baud;
30extern u32 mv64x60_mpsc_clk_src;
31extern u32 mv64x60_mpsc_clk_freq;
32
33/* Not in the kernel so won't include kernel.h to get its 'min' definition */
34#ifndef min
35#define min(a,b) (((a) < (b)) ? (a) : (b))
36#endif
37
38void
39mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
40{
41 mv64x60_console_baud = EV64360_DEFAULT_BAUD;
42 mv64x60_mpsc_clk_src = EV64360_MPSC_CLK_SRC;
43 mv64x60_mpsc_clk_freq = EV64360_MPSC_CLK_FREQ;
44}
diff --git a/arch/ppc/boot/simple/misc-katana.c b/arch/ppc/boot/simple/misc-katana.c
index b6e1bb833157..ec94a11bacac 100644
--- a/arch/ppc/boot/simple/misc-katana.c
+++ b/arch/ppc/boot/simple/misc-katana.c
@@ -26,6 +26,8 @@ extern u32 mv64x60_mpsc_clk_freq;
26#define min(a,b) (((a) < (b)) ? (a) : (b)) 26#define min(a,b) (((a) < (b)) ? (a) : (b))
27#endif 27#endif
28 28
29unsigned long mv64360_get_mem_size(void);
30
29void 31void
30mv64x60_board_init(void __iomem *old_base, void __iomem *new_base) 32mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
31{ 33{
@@ -35,3 +37,9 @@ mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
35 min(katana_bus_freq((void __iomem *)KATANA_CPLD_BASE), 37 min(katana_bus_freq((void __iomem *)KATANA_CPLD_BASE),
36 MV64x60_TCLK_FREQ_MAX); 38 MV64x60_TCLK_FREQ_MAX);
37} 39}
40
41unsigned long
42get_mem_size(void)
43{
44 return mv64360_get_mem_size();
45}
diff --git a/arch/ppc/boot/simple/misc-mv64x60.c b/arch/ppc/boot/simple/misc-mv64x60.c
index 7e88fc6d207d..258d4599fadc 100644
--- a/arch/ppc/boot/simple/misc-mv64x60.c
+++ b/arch/ppc/boot/simple/misc-mv64x60.c
@@ -19,6 +19,33 @@
19extern struct bi_record *decompress_kernel(unsigned long load_addr, 19extern struct bi_record *decompress_kernel(unsigned long load_addr,
20 int num_words, unsigned long cksum); 20 int num_words, unsigned long cksum);
21 21
22
23u32 size_reg[MV64x60_CPU2MEM_WINDOWS] = {
24 MV64x60_CPU2MEM_0_SIZE, MV64x60_CPU2MEM_1_SIZE,
25 MV64x60_CPU2MEM_2_SIZE, MV64x60_CPU2MEM_3_SIZE
26};
27
28/* Read mem ctlr to get the amount of mem in system */
29unsigned long
30mv64360_get_mem_size(void)
31{
32 u32 enables, i, v;
33 u32 mem = 0;
34
35 enables = in_le32((void __iomem *)CONFIG_MV64X60_NEW_BASE +
36 MV64360_CPU_BAR_ENABLE) & 0xf;
37
38 for (i=0; i<MV64x60_CPU2MEM_WINDOWS; i++)
39 if (!(enables & (1<<i))) {
40 v = in_le32((void __iomem *)CONFIG_MV64X60_NEW_BASE
41 + size_reg[i]) & 0xffff;
42 v = (v + 1) << 16;
43 mem += v;
44 }
45
46 return mem;
47}
48
22void 49void
23mv64x60_move_base(void __iomem *old_base, void __iomem *new_base) 50mv64x60_move_base(void __iomem *old_base, void __iomem *new_base)
24{ 51{
diff --git a/arch/ppc/boot/simple/mv64x60_tty.c b/arch/ppc/boot/simple/mv64x60_tty.c
index 5b45eb46b669..b9c24d4c738b 100644
--- a/arch/ppc/boot/simple/mv64x60_tty.c
+++ b/arch/ppc/boot/simple/mv64x60_tty.c
@@ -22,9 +22,16 @@
22#include <asm/mv64x60_defs.h> 22#include <asm/mv64x60_defs.h>
23#include <mpsc_defs.h> 23#include <mpsc_defs.h>
24 24
25#ifdef CONFIG_EV64360
26#include <platforms/ev64360.h>
27u32 mv64x60_console_baud = EV64360_DEFAULT_BAUD;
28u32 mv64x60_mpsc_clk_src = EV64360_MPSC_CLK_SRC; /* TCLK */
29u32 mv64x60_mpsc_clk_freq = EV64360_MPSC_CLK_FREQ;
30#else
25u32 mv64x60_console_baud = 9600; 31u32 mv64x60_console_baud = 9600;
26u32 mv64x60_mpsc_clk_src = 8; /* TCLK */ 32u32 mv64x60_mpsc_clk_src = 8; /* TCLK */
27u32 mv64x60_mpsc_clk_freq = 100000000; 33u32 mv64x60_mpsc_clk_freq = 100000000;
34#endif
28 35
29extern void udelay(long); 36extern void udelay(long);
30static void stop_dma(int chan); 37static void stop_dma(int chan);