summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/config.mk3
-rw-r--r--arch/arm/cpu/arm1136/start.S2
-rw-r--r--arch/arm/cpu/arm1136/u-boot-spl.lds2
-rw-r--r--arch/arm/cpu/arm1176/start.S2
-rw-r--r--arch/arm/cpu/arm720t/start.S2
-rw-r--r--arch/arm/cpu/arm920t/ep93xx/u-boot.lds2
-rw-r--r--arch/arm/cpu/arm920t/start.S2
-rw-r--r--arch/arm/cpu/arm925t/start.S2
-rw-r--r--arch/arm/cpu/arm926ejs/davinci/spl.c2
-rw-r--r--arch/arm/cpu/arm926ejs/mxs/start.S2
-rw-r--r--arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds2
-rw-r--r--arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds2
-rw-r--r--arch/arm/cpu/arm926ejs/start.S4
-rw-r--r--arch/arm/cpu/arm946es/start.S2
-rw-r--r--arch/arm/cpu/arm_intcm/start.S2
-rw-r--r--arch/arm/cpu/armv7/am33xx/u-boot-spl.lds2
-rw-r--r--arch/arm/cpu/armv7/omap-common/u-boot-spl.lds2
-rw-r--r--arch/arm/cpu/armv7/socfpga/u-boot-spl.lds2
-rw-r--r--arch/arm/cpu/armv7/start.S2
-rw-r--r--arch/arm/cpu/ixp/start.S2
-rw-r--r--arch/arm/cpu/ixp/u-boot.lds6
-rw-r--r--arch/arm/cpu/pxa/start.S2
-rw-r--r--arch/arm/cpu/s3c44b0/start.S2
-rw-r--r--arch/arm/cpu/sa1100/start.S2
-rw-r--r--arch/arm/cpu/u-boot-spl.lds4
-rw-r--r--arch/arm/cpu/u-boot.lds9
-rw-r--r--arch/arm/include/asm/sections.h27
-rw-r--r--arch/arm/include/asm/spl.h2
-rw-r--r--arch/arm/include/asm/u-boot-arm.h4
-rw-r--r--arch/arm/include/asm/u-boot.h9
-rw-r--r--arch/arm/lib/Makefile5
-rw-r--r--arch/arm/lib/board.c1
-rw-r--r--arch/arm/lib/bss.c2
-rw-r--r--arch/arm/lib/crt0.S4
-rw-r--r--arch/arm/lib/spl.c2
-rw-r--r--arch/avr32/cpu/start.S2
-rw-r--r--arch/avr32/cpu/u-boot.lds2
-rw-r--r--arch/avr32/include/asm/sections.h6
-rw-r--r--arch/avr32/lib/board.c8
-rw-r--r--arch/blackfin/cpu/cpu.c1
-rw-r--r--arch/blackfin/include/asm/global_data.h1
-rw-r--r--arch/blackfin/include/asm/sections.h27
-rw-r--r--arch/blackfin/lib/board.c2
-rw-r--r--arch/m68k/include/asm/sections.h27
-rw-r--r--arch/m68k/lib/board.c5
-rw-r--r--arch/microblaze/include/asm/sections.h27
-rw-r--r--arch/mips/include/asm/sections.h27
-rw-r--r--arch/mips/include/asm/u-boot-mips.h4
-rw-r--r--arch/nds32/cpu/n1213/start.S2
-rw-r--r--arch/nds32/cpu/n1213/u-boot.lds2
-rw-r--r--arch/nds32/include/asm/sections.h27
-rw-r--r--arch/nds32/include/asm/u-boot-nds32.h8
-rw-r--r--arch/nds32/lib/board.c2
-rw-r--r--arch/nios2/cpu/start.S6
-rw-r--r--arch/nios2/cpu/u-boot.lds2
-rw-r--r--arch/nios2/include/asm/sections.h27
-rw-r--r--arch/openrisc/include/asm/sections.h27
-rw-r--r--arch/powerpc/config.mk3
-rw-r--r--arch/powerpc/cpu/74xx_7xx/cpu.c7
-rw-r--r--arch/powerpc/cpu/74xx_7xx/start.S4
-rw-r--r--arch/powerpc/cpu/74xx_7xx/u-boot.lds2
-rw-r--r--arch/powerpc/cpu/mpc512x/cpu_init.c120
-rw-r--r--arch/powerpc/cpu/mpc512x/fixed_sdram.c17
-rw-r--r--arch/powerpc/cpu/mpc512x/iopin.c54
-rw-r--r--arch/powerpc/cpu/mpc512x/start.S4
-rw-r--r--arch/powerpc/cpu/mpc512x/u-boot.lds2
-rw-r--r--arch/powerpc/cpu/mpc5xx/start.S4
-rw-r--r--arch/powerpc/cpu/mpc5xx/u-boot.lds2
-rw-r--r--arch/powerpc/cpu/mpc5xxx/spl_boot.c20
-rw-r--r--arch/powerpc/cpu/mpc5xxx/start.S4
-rw-r--r--arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds2
-rw-r--r--arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds2
-rw-r--r--arch/powerpc/cpu/mpc5xxx/u-boot.lds2
-rw-r--r--arch/powerpc/cpu/mpc8220/start.S4
-rw-r--r--arch/powerpc/cpu/mpc8220/u-boot.lds2
-rw-r--r--arch/powerpc/cpu/mpc824x/start.S4
-rw-r--r--arch/powerpc/cpu/mpc824x/u-boot.lds2
-rw-r--r--arch/powerpc/cpu/mpc8260/start.S4
-rw-r--r--arch/powerpc/cpu/mpc8260/u-boot.lds2
-rw-r--r--arch/powerpc/cpu/mpc83xx/start.S4
-rw-r--r--arch/powerpc/cpu/mpc83xx/u-boot-spl.lds4
-rw-r--r--arch/powerpc/cpu/mpc83xx/u-boot.lds2
-rw-r--r--arch/powerpc/cpu/mpc85xx/start.S4
-rw-r--r--arch/powerpc/cpu/mpc85xx/u-boot-nand.lds2
-rw-r--r--arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds2
-rw-r--r--arch/powerpc/cpu/mpc85xx/u-boot-spl.lds2
-rw-r--r--arch/powerpc/cpu/mpc85xx/u-boot.lds2
-rw-r--r--arch/powerpc/cpu/mpc86xx/start.S4
-rw-r--r--arch/powerpc/cpu/mpc86xx/u-boot.lds2
-rw-r--r--arch/powerpc/cpu/mpc8xx/start.S4
-rw-r--r--arch/powerpc/cpu/ppc4xx/start.S4
-rw-r--r--arch/powerpc/cpu/ppc4xx/u-boot.lds2
-rw-r--r--arch/powerpc/include/asm/immap_512x.h22
-rw-r--r--arch/powerpc/include/asm/sections.h27
-rw-r--r--arch/powerpc/include/asm/spl.h2
-rw-r--r--arch/powerpc/include/asm/u-boot.h7
-rw-r--r--arch/powerpc/lib/Makefile2
-rw-r--r--arch/powerpc/lib/board.c18
-rw-r--r--arch/sandbox/include/asm/sections.h2
-rw-r--r--arch/sh/cpu/sh2/u-boot.lds2
-rw-r--r--arch/sh/cpu/sh3/u-boot.lds2
-rw-r--r--arch/sh/cpu/sh4/u-boot.lds2
-rw-r--r--arch/sh/include/asm/sections.h27
-rw-r--r--arch/sh/lib/board.c1
-rw-r--r--arch/sparc/cpu/leon2/Makefile7
-rw-r--r--arch/sparc/cpu/leon2/serial.c10
-rw-r--r--arch/sparc/cpu/leon3/Makefile7
-rw-r--r--arch/sparc/cpu/leon3/serial.c10
-rw-r--r--arch/sparc/include/asm/sections.h27
-rw-r--r--arch/x86/config.mk3
-rw-r--r--arch/x86/cpu/coreboot/sdram.c1
-rw-r--r--arch/x86/cpu/u-boot.lds4
-rw-r--r--arch/x86/include/asm/config.h1
-rw-r--r--arch/x86/include/asm/sections.h27
-rw-r--r--arch/x86/include/asm/u-boot-x86.h9
-rw-r--r--arch/x86/include/asm/u-boot.h11
-rw-r--r--arch/x86/lib/Makefile3
-rw-r--r--arch/x86/lib/board.c3
-rw-r--r--arch/x86/lib/init_helpers.c3
-rw-r--r--arch/x86/lib/relocate.c9
120 files changed, 731 insertions, 189 deletions
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 24b9d7c802..a0c89b7971 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -31,6 +31,9 @@ CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
endif
endif
+# Support generic board on ARM
+__HAVE_ARCH_GENERIC_BOARD := y
+
PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
# Choose between ARM/Thumb instruction sets
diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index a067b8a186..eba23248d5 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -106,7 +106,7 @@ _image_copy_end_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/arm1136/u-boot-spl.lds b/arch/arm/cpu/arm1136/u-boot-spl.lds
index a0462ab97a..b09b4ebfaf 100644
--- a/arch/arm/cpu/arm1136/u-boot-spl.lds
+++ b/arch/arm/cpu/arm1136/u-boot-spl.lds
@@ -57,6 +57,6 @@ SECTIONS
__bss_start = .;
*(.bss*)
. = ALIGN(4);
- __bss_end__ = .;
+ __bss_end = .;
} >.sdram
}
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index 40df4b1614..3c291fbe42 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -121,7 +121,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 771d3869c1..43bd6edd28 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -103,7 +103,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
index c19285d210..e483820f3f 100644
--- a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
+++ b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
@@ -57,7 +57,7 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
- __bss_end__ = .;
+ __bss_end = .;
_end = .;
}
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 511d21d334..2864d128c7 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -87,7 +87,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index e8d6d71c17..827fee2492 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -93,7 +93,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c
index 714fa92846..ca8a412626 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -64,7 +64,7 @@ void board_init_f(ulong dummy)
#endif
/* Third, we clear the BSS. */
- memset(__bss_start, 0, __bss_end__ - __bss_start);
+ memset(__bss_start, 0, __bss_end - __bss_start);
/* Finally, setup gd and move to the next step. */
gd = &gdata;
diff --git a/arch/arm/cpu/arm926ejs/mxs/start.S b/arch/arm/cpu/arm926ejs/mxs/start.S
index 7ccd337174..373e6d8d7c 100644
--- a/arch/arm/cpu/arm926ejs/mxs/start.S
+++ b/arch/arm/cpu/arm926ejs/mxs/start.S
@@ -133,7 +133,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
index 0f3222c76a..67b204e447 100644
--- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
@@ -67,7 +67,7 @@ SECTIONS
__bss_start = .;
*(.bss*)
. = ALIGN(4);
- __bss_end__ = .;
+ __bss_end = .;
}
_end = .;
diff --git a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
index 0af3e0a231..7405917595 100644
--- a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
@@ -67,7 +67,7 @@ SECTIONS
__bss_start = .;
*(.bss*)
. = ALIGN(4);
- __bss_end__ = .;
+ __bss_end = .;
}
_end = .;
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 66a8b654bd..f5d15828d3 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -142,7 +142,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
@@ -151,7 +151,7 @@ _end_ofs:
#ifdef CONFIG_NAND_U_BOOT
.globl _end
_end:
- .word __bss_end__
+ .word __bss_end
#endif
#ifdef CONFIG_USE_IRQ
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index a7a98a4e58..9dec35b557 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -103,7 +103,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
index c189849fa8..04d08458f3 100644
--- a/arch/arm/cpu/arm_intcm/start.S
+++ b/arch/arm/cpu/arm_intcm/start.S
@@ -99,7 +99,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds b/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
index 69f6d48dab..b6a929ff7e 100644
--- a/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
@@ -62,6 +62,6 @@ SECTIONS
__bss_start = .;
*(.bss*)
. = ALIGN(4);
- __bss_end__ = .;
+ __bss_end = .;
} >.sdram
}
diff --git a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
index 88f40698b6..efae381bdb 100644
--- a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
@@ -58,6 +58,6 @@ SECTIONS
__bss_start = .;
*(.bss*)
. = ALIGN(4);
- __bss_end__ = .;
+ __bss_end = .;
} >.sdram
}
diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
index 7cd409cca2..79cc93cb57 100644
--- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
@@ -46,7 +46,7 @@ SECTIONS
__bss_start = .;
*(.bss*)
. = ALIGN(4);
- __bss_end__ = .;
+ __bss_end = .;
} >.sdram
. = ALIGN(8);
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 30f02d3943..fa5fad1b0c 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -96,7 +96,7 @@ _image_copy_end_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S
index efb5a400cf..b7259645e5 100644
--- a/arch/arm/cpu/ixp/start.S
+++ b/arch/arm/cpu/ixp/start.S
@@ -112,7 +112,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds
index 5e66dd142c..8345b55032 100644
--- a/arch/arm/cpu/ixp/u-boot.lds
+++ b/arch/arm/cpu/ixp/u-boot.lds
@@ -74,10 +74,10 @@ SECTIONS
.bss __bss_start (OVERLAY) : {
*(.bss*)
. = ALIGN(4);
- ___bssend___ = .;
+ __bss_end = .;
}
- .bss_end ___bssend___ (OVERLAY) : {
- KEEP(*(.__bss_end__));
+ .bss_end __bss_end (OVERLAY) : {
+ KEEP(*(__bss_end));
}
/DISCARD/ : { *(.dynstr*) }
diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
index e71803eb2e..456a7836da 100644
--- a/arch/arm/cpu/pxa/start.S
+++ b/arch/arm/cpu/pxa/start.S
@@ -120,7 +120,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/s3c44b0/start.S b/arch/arm/cpu/s3c44b0/start.S
index 4528c91983..c096177086 100644
--- a/arch/arm/cpu/s3c44b0/start.S
+++ b/arch/arm/cpu/s3c44b0/start.S
@@ -78,7 +78,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
index 3144299afe..4bf6f5fe97 100644
--- a/arch/arm/cpu/sa1100/start.S
+++ b/arch/arm/cpu/sa1100/start.S
@@ -88,7 +88,7 @@ _bss_start_ofs:
.globl _bss_end_ofs
_bss_end_ofs:
- .word __bss_end__ - _start
+ .word __bss_end - _start
.globl _end_ofs
_end_ofs:
diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
index 8321afb959..3c0d99ca36 100644
--- a/arch/arm/cpu/u-boot-spl.lds
+++ b/arch/arm/cpu/u-boot-spl.lds
@@ -78,7 +78,7 @@ SECTIONS
__bss_start = .;
*(.bss*)
. = ALIGN(4);
- __bss_end__ = .;
+ __bss_end = .;
}
/DISCARD/ : { *(.dynstr*) }
@@ -89,5 +89,5 @@ SECTIONS
}
#if defined(CONFIG_SPL_TEXT_BASE) && defined(CONFIG_SPL_MAX_SIZE)
-ASSERT(__bss_end__ < (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE), "SPL image too big");
+ASSERT(__bss_end < (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE), "SPL image too big");
#endif
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index d4ad3529b2..3a1083d9a9 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -88,10 +88,11 @@ SECTIONS
.bss __bss_start (OVERLAY) : {
*(.bss*)
. = ALIGN(4);
- ___bssend___ = .;
+ __bss_end = .;
}
- .bss_end ___bssend___ (OVERLAY) : {
- KEEP(*(.__bss_end__));
+
+ .bss_end __bss_end (OVERLAY) : {
+ KEEP(*(__bss_end));
}
/DISCARD/ : { *(.dynstr*) }
@@ -102,5 +103,5 @@ SECTIONS
}
#if defined(CONFIG_SPL_TEXT_BASE) && defined(CONFIG_SPL_MAX_SIZE)
-ASSERT(__bss_end__ < (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE), "SPL image too big");
+ASSERT(__bss_end < (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE), "SPL image too big");
#endif
diff --git a/arch/arm/include/asm/sections.h b/arch/arm/include/asm/sections.h
new file mode 100644
index 0000000000..c042cb604b
--- /dev/null
+++ b/arch/arm/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARM_SECTIONS_H
+#define __ASM_ARM_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h
index 62011aaada..2b7218edad 100644
--- a/arch/arm/include/asm/spl.h
+++ b/arch/arm/include/asm/spl.h
@@ -27,7 +27,7 @@
#include <asm/arch/spl.h>
/* Linker symbols. */
-extern char __bss_start[], __bss_end__[];
+extern char __bss_start[], __bss_end[];
extern gd_t gdata;
diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h
index 9f3cae5ece..f16861ad2f 100644
--- a/arch/arm/include/asm/u-boot-arm.h
+++ b/arch/arm/include/asm/u-boot-arm.h
@@ -30,12 +30,8 @@
#define _U_BOOT_ARM_H_ 1
/* for the following variables, see start.S */
-extern ulong _bss_start_ofs; /* BSS start relative to _start */
-extern ulong _bss_end_ofs; /* BSS end relative to _start */
-extern ulong _end_ofs; /* end of image relative to _start */
extern ulong IRQ_STACK_START; /* top of IRQ stack */
extern ulong FIQ_STACK_START; /* top of FIQ stack */
-extern ulong _TEXT_BASE; /* code start */
extern ulong _datarel_start_ofs;
extern ulong _datarelrolocal_start_ofs;
extern ulong _datarellocal_start_ofs;
diff --git a/arch/arm/include/asm/u-boot.h b/arch/arm/include/asm/u-boot.h
index 2ba98bca7d..a33fefa6d4 100644
--- a/arch/arm/include/asm/u-boot.h
+++ b/arch/arm/include/asm/u-boot.h
@@ -36,6 +36,12 @@
#ifndef _U_BOOT_H_
#define _U_BOOT_H_ 1
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified bd_info */
+#include <asm-generic/u-boot.h>
+#else
+
+#ifndef __ASSEMBLY__
typedef struct bd_info {
unsigned int bi_baudrate; /* serial console baudrate */
ulong bi_arch_number; /* unique id for this board */
@@ -49,6 +55,9 @@ typedef struct bd_info {
ulong size;
} bi_dram[CONFIG_NR_DRAM_BANKS];
} bd_t;
+#endif
+
+#endif /* !CONFIG_SYS_GENERIC_BOARD */
/* For image.h:image_check_target_arch() */
#define IH_ARCH_DEFAULT IH_ARCH_ARM
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 11c267451a..6ae161a51d 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -39,8 +39,11 @@ GLCOBJS += div0.o
SOBJS-y += crt0.o
ifndef CONFIG_SPL_BUILD
-COBJS-y += bss.o
+ifndef CONFIG_SYS_GENERIC_BOARD
COBJS-y += board.o
+endif
+COBJS-y += bss.o
+
COBJS-y += bootm.o
COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 162e2cc863..0521178ac3 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -53,6 +53,7 @@
#include <fdtdec.h>
#include <post.h>
#include <logbuff.h>
+#include <asm/sections.h>
#ifdef CONFIG_BITBANGMII
#include <miiphy.h>
diff --git a/arch/arm/lib/bss.c b/arch/arm/lib/bss.c
index 7c0b1545ea..99eda59137 100644
--- a/arch/arm/lib/bss.c
+++ b/arch/arm/lib/bss.c
@@ -36,4 +36,4 @@
*/
char __bss_start[0] __attribute__((used, section(".__bss_start")));
-char __bss_end__[0] __attribute__((used, section(".__bss_end__")));
+char __bss_end[0] __attribute__((used, section(".__bss_end")));
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index 4f60958b1d..37d9927d2c 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -85,7 +85,7 @@
*/
.globl __bss_start
-.globl __bss_end__
+.globl __bss_end
/*
* entry point of crt0 sequence
@@ -141,7 +141,7 @@ here:
bl c_runtime_cpu_setup /* we still call old routine here */
ldr r0, =__bss_start /* this is auto-relocated! */
- ldr r1, =__bss_end__ /* this is auto-relocated! */
+ ldr r1, =__bss_end /* this is auto-relocated! */
mov r2, #0x00000000 /* prepare zero to clear BSS */
diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c
index f568f619cb..301f082ea3 100644
--- a/arch/arm/lib/spl.c
+++ b/arch/arm/lib/spl.c
@@ -45,7 +45,7 @@ void __weak board_init_f(ulong dummy)
asm volatile("mov sp, %0\n" : : "r"(CONFIG_SPL_STACK));
/* Clear the BSS. */
- memset(__bss_start, 0, __bss_end__ - __bss_start);
+ memset(__bss_start, 0, __bss_end - __bss_start);
/* Set global data pointer. */
gd = &gdata;
diff --git a/arch/avr32/cpu/start.S b/arch/avr32/cpu/start.S
index 71cbc524c9..c8decea127 100644
--- a/arch/avr32/cpu/start.S
+++ b/arch/avr32/cpu/start.S
@@ -244,7 +244,7 @@ relocate_code:
/* zero out .bss */
mov r0, 0
mov r1, 0
- lda.w r9, __bss_end__
+ lda.w r9, __bss_end
sub r9, r8
1: st.d r10++, r0
sub r9, 8
diff --git a/arch/avr32/cpu/u-boot.lds b/arch/avr32/cpu/u-boot.lds
index 4a3fc2a1c6..4e4a436dc9 100644
--- a/arch/avr32/cpu/u-boot.lds
+++ b/arch/avr32/cpu/u-boot.lds
@@ -68,5 +68,5 @@ SECTIONS
*(.bss.*)
}
. = ALIGN(8);
- __bss_end__ = .;
+ __bss_end = .;
}
diff --git a/arch/avr32/include/asm/sections.h b/arch/avr32/include/asm/sections.h
index 3f157888ee..056d7a05d5 100644
--- a/arch/avr32/include/asm/sections.h
+++ b/arch/avr32/include/asm/sections.h
@@ -22,11 +22,11 @@
#ifndef __ASM_AVR32_SECTIONS_H
#define __ASM_AVR32_SECTIONS_H
+#include <asm-generic/sections.h>
+
/* References to section boundaries */
-extern char _text[], _etext[];
-extern char _data[], __data_lma[], _edata[], __edata_lma[];
+extern char __data_lma[], __edata_lma[];
extern char __got_start[], __got_lma[], __got_end[];
-extern char __bss_end__[];
#endif /* __ASM_AVR32_SECTIONS_H */
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index bd1be73ae4..57e07dfb89 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -116,7 +116,7 @@ static int display_banner (void)
printf ("\n\n%s\n\n", version_string);
printf ("U-Boot code: %08lx -> %08lx data: %08lx -> %08lx\n",
(unsigned long)_text, (unsigned long)_etext,
- (unsigned long)_data, (unsigned long)__bss_end__);
+ (unsigned long)_data, (unsigned long)__bss_end);
return 0;
}
@@ -188,7 +188,7 @@ void board_init_f(ulong board_type)
* - stack
*/
addr = CONFIG_SYS_SDRAM_BASE + sdram_size;
- monitor_len = __bss_end__ - _text;
+ monitor_len = (char *)__bss_end - _text;
/*
* Reserve memory for u-boot code, data and bss.
@@ -211,11 +211,11 @@ void board_init_f(ulong board_type)
#ifdef CONFIG_FB_ADDR
printf("LCD: Frame buffer allocated at preset 0x%08x\n",
CONFIG_FB_ADDR);
- gd->fb_base = (void *)CONFIG_FB_ADDR;
+ gd->fb_base = CONFIG_FB_ADDR;
#else
addr = lcd_setmem(addr);
printf("LCD: Frame buffer allocated at 0x%08lx\n", addr);
- gd->fb_base = (void *)addr;
+ gd->fb_base = addr;
#endif /* CONFIG_FB_ADDR */
#endif /* CONFIG_LCD */
diff --git a/arch/blackfin/cpu/cpu.c b/arch/blackfin/cpu/cpu.c
index b9fdb078bd..0be2e2b835 100644
--- a/arch/blackfin/cpu/cpu.c
+++ b/arch/blackfin/cpu/cpu.c
@@ -23,7 +23,6 @@
ulong bfin_poweron_retx;
-__attribute__ ((__noreturn__))
void cpu_init_f(ulong bootflag, ulong loaded_from_ldr)
{
#ifndef CONFIG_BFIN_BOOTROM_USES_EVT1
diff --git a/arch/blackfin/include/asm/global_data.h b/arch/blackfin/include/asm/global_data.h
index c2c4d4d41d..44245b4a1b 100644
--- a/arch/blackfin/include/asm/global_data.h
+++ b/arch/blackfin/include/asm/global_data.h
@@ -32,6 +32,7 @@
/* Architecture-specific global data */
struct arch_global_data {
+ unsigned long board_type;
};
#include <asm-generic/global_data.h>
diff --git a/arch/blackfin/include/asm/sections.h b/arch/blackfin/include/asm/sections.h
new file mode 100644
index 0000000000..85af42c321
--- /dev/null
+++ b/arch/blackfin/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_BLACKFIN_SECTIONS_H
+#define __ASM_BLACKFIN_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 288dc829d4..75b6c463d8 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -77,7 +77,7 @@ static void display_global_data(void)
bd = gd->bd;
printf(" gd: %p\n", gd);
printf(" |-flags: %lx\n", gd->flags);
- printf(" |-board_type: %lx\n", gd->board_type);
+ printf(" |-board_type: %lx\n", gd->arch.board_type);
printf(" |-baudrate: %u\n", gd->baudrate);
printf(" |-have_console: %lx\n", gd->have_console);
printf(" |-ram_size: %lx\n", gd->ram_size);
diff --git a/arch/m68k/include/asm/sections.h b/arch/m68k/include/asm/sections.h
new file mode 100644
index 0000000000..92289878e1
--- /dev/null
+++ b/arch/m68k/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_M68K_SECTIONS_H
+#define __ASM_M68K_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index 33acffe431..adaccfe69e 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -77,9 +77,10 @@ static char *failed = "*** failed ***\n";
#include <environment.h>
extern ulong __init_end;
-extern ulong __bss_end__;
+extern ulong __bss_end;
#if defined(CONFIG_WATCHDOG)
+# undef INIT_FUNC_WATCHDOG_INIT
# define INIT_FUNC_WATCHDOG_INIT watchdog_init,
# define WATCHDOG_DISABLE watchdog_disable
@@ -244,7 +245,7 @@ board_init_f (ulong bootflag)
* - monitor code
* - board info struct
*/
- len = (ulong)&__bss_end__ - CONFIG_SYS_MONITOR_BASE;
+ len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size;
diff --git a/arch/microblaze/include/asm/sections.h b/arch/microblaze/include/asm/sections.h
new file mode 100644
index 0000000000..156c149159
--- /dev/null
+++ b/arch/microblaze/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_MICROBLAZE_SECTIONS_H
+#define __ASM_MICROBLAZE_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/mips/include/asm/sections.h b/arch/mips/include/asm/sections.h
new file mode 100644
index 0000000000..54cd8b362b
--- /dev/null
+++ b/arch/mips/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_MIPS_SECTIONS_H
+#define __ASM_MIPS_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/mips/include/asm/u-boot-mips.h b/arch/mips/include/asm/u-boot-mips.h
index a483166a9c..e77636eaaf 100644
--- a/arch/mips/include/asm/u-boot-mips.h
+++ b/arch/mips/include/asm/u-boot-mips.h
@@ -7,7 +7,7 @@
static inline unsigned long bss_start(void)
{
- extern ulong __bss_start;
+ extern char __bss_start[];
return (unsigned long) &__bss_start;
}
@@ -19,7 +19,7 @@ static inline unsigned long bss_end(void)
static inline unsigned long image_copy_end(void)
{
- extern ulong __image_copy_end;
+ extern char __image_copy_end[];
return (unsigned long) &__image_copy_end;
}
diff --git a/arch/nds32/cpu/n1213/start.S b/arch/nds32/cpu/n1213/start.S
index 889bf8b871..558fd0ee6c 100644
--- a/arch/nds32/cpu/n1213/start.S
+++ b/arch/nds32/cpu/n1213/start.S
@@ -240,7 +240,7 @@ fix_got_loop:
clear_bss:
la $r0, __bss_start /* r0 <- rel __bss_start in FLASH */
add $r0, $r0, $r9 /* r0 <- rel __bss_start in FLASH */
- la $r1, __bss_end__ /* r1 <- rel __bss_end in RAM */
+ la $r1, __bss_end /* r1 <- rel __bss_end in RAM */
add $r1, $r1, $r9 /* r0 <- rel __bss_end in RAM */
li $r2, 0x00000000 /* clear */
diff --git a/arch/nds32/cpu/n1213/u-boot.lds b/arch/nds32/cpu/n1213/u-boot.lds
index 57909481a9..e9fbcd3804 100644
--- a/arch/nds32/cpu/n1213/u-boot.lds
+++ b/arch/nds32/cpu/n1213/u-boot.lds
@@ -66,7 +66,7 @@ SECTIONS
__bss_start = .;
*(.bss)
. = ALIGN(4);
- __bss_end__ = .;
+ __bss_end = .;
}
}
diff --git a/arch/nds32/include/asm/sections.h b/arch/nds32/include/asm/sections.h
new file mode 100644
index 0000000000..a65735e426
--- /dev/null
+++ b/arch/nds32/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_NDS32_SECTIONS_H
+#define __ASM_NDS32_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/nds32/include/asm/u-boot-nds32.h b/arch/nds32/include/asm/u-boot-nds32.h
index ae1918d5d4..f3c7b271e9 100644
--- a/arch/nds32/include/asm/u-boot-nds32.h
+++ b/arch/nds32/include/asm/u-boot-nds32.h
@@ -30,10 +30,10 @@
#define _U_BOOT_NDS32_H_ 1
/* for the following variables, see start.S */
-extern ulong __bss_start; /* BSS start relative to _start */
-extern ulong __bss_end__; /* BSS end relative to _start */
-extern ulong _end; /* end of image relative to _start */
-extern ulong _start; /* start of image relative to _start */
+extern char __bss_start[]; /* BSS start relative to _start */
+extern ulong __bss_end; /* BSS end relative to _start */
+extern char _end[]; /* end of image relative to _start */
+extern void _start(void); /* start of image relative to _start */
extern ulong _TEXT_BASE; /* code start */
extern ulong IRQ_STACK_START; /* top of IRQ stack */
extern ulong FIQ_STACK_START; /* top of FIQ stack */
diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index c919928a37..a7d27fc7f8 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -192,7 +192,7 @@ void board_init_f(ulong bootflag)
memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
- gd->mon_len = (unsigned int)(&__bss_end__) - (unsigned int)(&_start);
+ gd->mon_len = (unsigned int)(&__bss_end) - (unsigned int)(&_start);
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr)() != 0)
diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index 0f4ab286b9..1787b65874 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -99,12 +99,12 @@ _cur: movhi r5, %hi(_cur - _start)
3:
/* ZERO BSS/SBSS -- bss and sbss are assumed to be adjacent
- * and between __bss_start and __bss_end__.
+ * and between __bss_start and __bss_end.
*/
movhi r5, %hi(__bss_start)
ori r5, r5, %lo(__bss_start)
- movhi r6, %hi(__bss_end__)
- ori r6, r6, %lo(__bss_end__)
+ movhi r6, %hi(__bss_end)
+ ori r6, r6, %lo(__bss_end)
beq r5, r6, 5f
4: stwio r0, 0(r5)
diff --git a/arch/nios2/cpu/u-boot.lds b/arch/nios2/cpu/u-boot.lds
index f937396233..4c45336d4a 100644
--- a/arch/nios2/cpu/u-boot.lds
+++ b/arch/nios2/cpu/u-boot.lds
@@ -101,7 +101,7 @@ SECTIONS
*(.scommon)
}
. = ALIGN(4);
- __bss_end__ = .;
+ __bss_end = .;
PROVIDE (end = .);
/* DEBUG -- symbol table, string table, etc. etc.
diff --git a/arch/nios2/include/asm/sections.h b/arch/nios2/include/asm/sections.h
new file mode 100644
index 0000000000..d8135630b7
--- /dev/null
+++ b/arch/nios2/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_NIOS2_SECTIONS_H
+#define __ASM_NIOS2_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/openrisc/include/asm/sections.h b/arch/openrisc/include/asm/sections.h
new file mode 100644
index 0000000000..6eb5a664b3
--- /dev/null
+++ b/arch/openrisc/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_OPENRISC_SECTIONS_H
+#define __ASM_OPENRISC_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index b7062818bb..e32d2bf409 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -29,6 +29,9 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections
PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
PLATFORM_LDFLAGS += -n
+# Support generic board on PPC
+__HAVE_ARCH_GENERIC_BOARD := y
+
#
# When cross-compiling on NetBSD, we have to define __PPC__ or else we
# will pick up a va_list declaration that is incompatible with the
diff --git a/arch/powerpc/cpu/74xx_7xx/cpu.c b/arch/powerpc/cpu/74xx_7xx/cpu.c
index b6a31b4372..17694a1cfe 100644
--- a/arch/powerpc/cpu/74xx_7xx/cpu.c
+++ b/arch/powerpc/cpu/74xx_7xx/cpu.c
@@ -229,8 +229,7 @@ soft_restart(unsigned long addr)
}
-#if !defined(CONFIG_PCIPPC2) && \
- !defined(CONFIG_BAB7xx) && \
+#if !defined(CONFIG_BAB7xx) && \
!defined(CONFIG_ELPPC) && \
!defined(CONFIG_PPMC7XX)
/* no generic way to do board reset. simply call soft_reset. */
@@ -288,13 +287,13 @@ unsigned long get_tbclk(void)
/* ------------------------------------------------------------------------- */
#if defined(CONFIG_WATCHDOG)
-#if !defined(CONFIG_PCIPPC2) && !defined(CONFIG_BAB7xx)
+#if !defined(CONFIG_BAB7xx)
void
watchdog_reset(void)
{
}
-#endif /* !CONFIG_PCIPPC2 && !CONFIG_BAB7xx */
+#endif /* !CONFIG_BAB7xx */
#endif /* CONFIG_WATCHDOG */
/* ------------------------------------------------------------------------- */
diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
index 75fb773894..cd8dea841f 100644
--- a/arch/powerpc/cpu/74xx_7xx/start.S
+++ b/arch/powerpc/cpu/74xx_7xx/start.S
@@ -72,7 +72,7 @@
GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
END_GOT
@@ -715,7 +715,7 @@ in_ram:
* Now clear BSS segment
*/
lwz r3,GOT(__bss_start)
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
cmplw 0, r3, r4
beq 6f
diff --git a/arch/powerpc/cpu/74xx_7xx/u-boot.lds b/arch/powerpc/cpu/74xx_7xx/u-boot.lds
index c58d979757..40b89abac6 100644
--- a/arch/powerpc/cpu/74xx_7xx/u-boot.lds
+++ b/arch/powerpc/cpu/74xx_7xx/u-boot.lds
@@ -89,6 +89,6 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
}
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
diff --git a/arch/powerpc/cpu/mpc512x/cpu_init.c b/arch/powerpc/cpu/mpc512x/cpu_init.c
index 32ade1b0b9..b308cb4be3 100644
--- a/arch/powerpc/cpu/mpc512x/cpu_init.c
+++ b/arch/powerpc/cpu/mpc512x/cpu_init.c
@@ -26,6 +26,7 @@
#include <common.h>
#include <asm/io.h>
+#include <asm/mpc512x.h>
#include <asm/processor.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -43,6 +44,101 @@ void cpu_init_f (volatile immap_t * im)
/* Clear initial global data */
memset ((void *) gd, 0, sizeof (gd_t));
+ /* Local Window and chip select configuration */
+#if defined(CONFIG_SYS_CS0_START) && defined(CONFIG_SYS_CS0_SIZE)
+ out_be32(&im->sysconf.lpcs0aw,
+ CSAW_START(CONFIG_SYS_CS0_START) |
+ CSAW_STOP(CONFIG_SYS_CS0_START, CONFIG_SYS_CS0_SIZE));
+ sync_law(&im->sysconf.lpcs0aw);
+#endif
+#if defined(CONFIG_SYS_CS0_CFG)
+ out_be32(&im->lpc.cs_cfg[0], CONFIG_SYS_CS0_CFG);
+#endif
+
+#if defined(CONFIG_SYS_CS1_START) && defined(CONFIG_SYS_CS1_SIZE)
+ out_be32(&im->sysconf.lpcs1aw,
+ CSAW_START(CONFIG_SYS_CS1_START) |
+ CSAW_STOP(CONFIG_SYS_CS1_START, CONFIG_SYS_CS1_SIZE));
+ sync_law(&im->sysconf.lpcs1aw);
+#endif
+#if defined(CONFIG_SYS_CS1_CFG)
+ out_be32(&im->lpc.cs_cfg[1], CONFIG_SYS_CS1_CFG);
+#endif
+
+#if defined(CONFIG_SYS_CS2_START) && (defined CONFIG_SYS_CS2_SIZE)
+ out_be32(&im->sysconf.lpcs2aw,
+ CSAW_START(CONFIG_SYS_CS2_START) |
+ CSAW_STOP(CONFIG_SYS_CS2_START, CONFIG_SYS_CS2_SIZE));
+ sync_law(&im->sysconf.lpcs2aw);
+#endif
+#if defined(CONFIG_SYS_CS2_CFG)
+ out_be32(&im->lpc.cs_cfg[2], CONFIG_SYS_CS2_CFG);
+#endif
+
+#if defined(CONFIG_SYS_CS3_START) && defined(CONFIG_SYS_CS3_SIZE)
+ out_be32(&im->sysconf.lpcs3aw,
+ CSAW_START(CONFIG_SYS_CS3_START) |
+ CSAW_STOP(CONFIG_SYS_CS3_START, CONFIG_SYS_CS3_SIZE));
+ sync_law(&im->sysconf.lpcs3aw);
+#endif
+#if defined(CONFIG_SYS_CS3_CFG)
+ out_be32(&im->lpc.cs_cfg[3], CONFIG_SYS_CS3_CFG);
+#endif
+
+#if defined(CONFIG_SYS_CS4_START) && defined(CONFIG_SYS_CS4_SIZE)
+ out_be32(&im->sysconf.lpcs4aw,
+ CSAW_START(CONFIG_SYS_CS4_START) |
+ CSAW_STOP(CONFIG_SYS_CS4_START, CONFIG_SYS_CS4_SIZE));
+ sync_law(&im->sysconf.lpcs4aw);
+#endif
+#if defined(CONFIG_SYS_CS4_CFG)
+ out_be32(&im->lpc.cs_cfg[4], CONFIG_SYS_CS4_CFG);
+#endif
+
+#if defined(CONFIG_SYS_CS5_START) && defined(CONFIG_SYS_CS5_SIZE)
+ out_be32(&im->sysconf.lpcs5aw,
+ CSAW_START(CONFIG_SYS_CS5_START) |
+ CSAW_STOP(CONFIG_SYS_CS5_START, CONFIG_SYS_CS5_SIZE));
+ sync_law(&im->sysconf.lpcs5aw);
+#endif
+#if defined(CONFIG_SYS_CS5_CFG)
+ out_be32(&im->lpc.cs_cfg[5], CONFIG_SYS_CS5_CFG);
+#endif
+
+#if defined(CONFIG_SYS_CS6_START) && defined(CONFIG_SYS_CS6_SIZE)
+ out_be32(&im->sysconf.lpcs6aw,
+ CSAW_START(CONFIG_SYS_CS6_START) |
+ CSAW_STOP(CONFIG_SYS_CS6_START, CONFIG_SYS_CS6_SIZE));
+ sync_law(&im->sysconf.lpcs6aw);
+#endif
+#if defined(CONFIG_SYS_CS6_CFG)
+ out_be32(&im->lpc.cs_cfg[6], CONFIG_SYS_CS6_CFG);
+#endif
+
+#if defined(CONFIG_SYS_CS7_START) && defined(CONFIG_SYS_CS7_SIZE)
+ out_be32(&im->sysconf.lpcs7aw,
+ CSAW_START(CONFIG_SYS_CS7_START) |
+ CSAW_STOP(CONFIG_SYS_CS7_START, CONFIG_SYS_CS7_SIZE));
+ sync_law(&im->sysconf.lpcs7aw);
+#endif
+#if defined(CONFIG_SYS_CS7_CFG)
+ out_be32(&im->lpc.cs_cfg[7], CONFIG_SYS_CS7_CFG);
+#endif
+
+#if defined CONFIG_SYS_CS_ALETIMING
+ if (SVR_MJREV(in_be32(&im->sysconf.spridr)) >= 2)
+ out_be32(&im->lpc.altr, CONFIG_SYS_CS_ALETIMING);
+#endif
+#if defined CONFIG_SYS_CS_BURST
+ out_be32(&im->lpc.cs_bcr, CONFIG_SYS_CS_BURST);
+#endif
+#if defined CONFIG_SYS_CS_DEADCYCLE
+ out_be32(&im->lpc.cs_dccr, CONFIG_SYS_CS_DEADCYCLE);
+#endif
+#if defined CONFIG_SYS_CS_HOLDCYCLE
+ out_be32(&im->lpc.cs_hccr, CONFIG_SYS_CS_HOLDCYCLE);
+#endif
+
/* system performance tweaking */
#ifdef CONFIG_SYS_ACR_PIPE_DEP
@@ -76,6 +172,21 @@ void cpu_init_f (volatile immap_t * im)
ips_div |= SCFR1_IPS_DIV << SCFR1_IPS_DIV_SHIFT;
out_be32(&im->clk.scfr[0], ips_div);
+#ifdef SCFR1_LPC_DIV
+ clrsetbits_be32(&im->clk.scfr[0], SCFR1_LPC_DIV_MASK,
+ SCFR1_LPC_DIV << SCFR1_LPC_DIV_SHIFT);
+#endif
+
+#ifdef SCFR1_NFC_DIV
+ clrsetbits_be32(&im->clk.scfr[0], SCFR1_NFC_DIV_MASK,
+ SCFR1_NFC_DIV << SCFR1_NFC_DIV_SHIFT);
+#endif
+
+#ifdef SCFR1_DIU_DIV
+ clrsetbits_be32(&im->clk.scfr[0], SCFR1_DIU_DIV_MASK,
+ SCFR1_DIU_DIV << SCFR1_DIU_DIV_SHIFT);
+#endif
+
/*
* Enable Time Base/Decrementer
*
@@ -84,6 +195,15 @@ void cpu_init_f (volatile immap_t * im)
* during FLASH chip identification etc.
*/
setbits_be32(&im->sysconf.spcr, SPCR_TBEN);
+
+ /*
+ * Enable clocks
+ */
+ out_be32(&im->clk.sccr[0], SCCR1_CLOCKS_EN);
+ out_be32(&im->clk.sccr[1], SCCR2_CLOCKS_EN);
+#if defined(CONFIG_IIM) || defined(CONFIG_CMD_FUSE)
+ setbits_be32(&im->clk.sccr[1], CLOCK_SCCR2_IIM_EN);
+#endif
}
int cpu_init_r (void)
diff --git a/arch/powerpc/cpu/mpc512x/fixed_sdram.c b/arch/powerpc/cpu/mpc512x/fixed_sdram.c
index 550cbd0bd6..6635fb036e 100644
--- a/arch/powerpc/cpu/mpc512x/fixed_sdram.c
+++ b/arch/powerpc/cpu/mpc512x/fixed_sdram.c
@@ -99,7 +99,19 @@ long int fixed_sdram(ddr512x_config_t *mddrc_config,
sync_law(&im->sysconf.ddrlaw.ar);
/* DDR Enable */
- out_be32(&im->mddrc.ddr_sys_config, MDDRC_SYS_CFG_EN);
+ /*
+ * the "enable" combination: DRAM controller out of reset,
+ * clock enabled, command mode -- BUT leave CKE low for now
+ */
+ i = MDDRC_SYS_CFG_EN & ~MDDRC_SYS_CFG_CKE_MASK;
+ out_be32(&im->mddrc.ddr_sys_config, i);
+ /* maintain 200 microseconds of stable power and clock */
+ udelay(200);
+ /* apply a NOP, it shouldn't harm */
+ out_be32(&im->mddrc.ddr_command, CONFIG_SYS_DDRCMD_NOP);
+ /* now assert CKE (high) */
+ i |= MDDRC_SYS_CFG_CKE_MASK;
+ out_be32(&im->mddrc.ddr_sys_config, i);
/* Initialize DDR Priority Manager */
out_be32(&im->mddrc.prioman_config1, CONFIG_SYS_MDDRCGRP_PM_CFG1);
@@ -148,6 +160,9 @@ long int fixed_sdram(ddr512x_config_t *mddrc_config,
out_be32(&im->mddrc.ddr_time_config0, mddrc_config->ddr_time_config0);
out_be32(&im->mddrc.ddr_sys_config, mddrc_config->ddr_sys_config);
+ /* Allow for the DLL to startup before accessing data */
+ udelay(10);
+
msize = get_ram_size(CONFIG_SYS_DDR_BASE, CONFIG_SYS_MAX_RAM_SIZE);
/* Fix DDR Local Window for new size */
out_be32(&im->sysconf.ddrlaw.ar, __ilog2(msize) - 1);
diff --git a/arch/powerpc/cpu/mpc512x/iopin.c b/arch/powerpc/cpu/mpc512x/iopin.c
index be20947623..1a39101622 100644
--- a/arch/powerpc/cpu/mpc512x/iopin.c
+++ b/arch/powerpc/cpu/mpc512x/iopin.c
@@ -47,3 +47,57 @@ void iopin_initialize(iopin_t *ioregs_init, int len)
}
return;
}
+
+void iopin_initialize_bits(iopin_t *ioregs_init, int len)
+{
+ short i, j, p;
+ u32 *reg, mask;
+ immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
+
+ reg = (u32 *)&(im->io_ctrl);
+
+ /* iterate over table entries */
+ for (i = 0; i < len; i++) {
+ /* iterate over pins within a table entry */
+ for (p = 0, j = ioregs_init[i].p_offset / sizeof(u_long);
+ p < ioregs_init[i].nr_pins; p++, j++) {
+ if (ioregs_init[i].bit_or & IO_PIN_OVER_EACH) {
+ /* replace all settings at once */
+ out_be32(reg + j, ioregs_init[i].val);
+ } else {
+ /*
+ * only replace individual parts, but
+ * REPLACE them instead of just ORing
+ * them in and "inheriting" previously
+ * set bits which we don't want
+ */
+ mask = 0;
+ if (ioregs_init[i].bit_or & IO_PIN_OVER_FMUX)
+ mask |= IO_PIN_FMUX(3);
+
+ if (ioregs_init[i].bit_or & IO_PIN_OVER_HOLD)
+ mask |= IO_PIN_HOLD(3);
+
+ if (ioregs_init[i].bit_or & IO_PIN_OVER_PULL)
+ mask |= IO_PIN_PUD(1) | IO_PIN_PUE(1);
+
+ if (ioregs_init[i].bit_or & IO_PIN_OVER_STRIG)
+ mask |= IO_PIN_ST(1);
+
+ if (ioregs_init[i].bit_or & IO_PIN_OVER_DRVSTR)
+ mask |= IO_PIN_DS(3);
+ /*
+ * DON'T do the "mask, then insert"
+ * in place on the register, it may
+ * break access to external hardware
+ * (like boot ROMs) when configuring
+ * LPB related pins, while the code to
+ * configure the pin is read from this
+ * very address region
+ */
+ clrsetbits_be32(reg + j, mask,
+ ioregs_init[i].val & mask);
+ }
+ }
+ }
+}
diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S
index ed362d87aa..6d1a99ac5c 100644
--- a/arch/powerpc/cpu/mpc512x/start.S
+++ b/arch/powerpc/cpu/mpc512x/start.S
@@ -77,7 +77,7 @@
GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
END_GOT
@@ -622,7 +622,7 @@ clear_bss:
* Now clear BSS segment
*/
lwz r3,GOT(__bss_start)
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
cmplw 0, r3, r4
beq 6f
diff --git a/arch/powerpc/cpu/mpc512x/u-boot.lds b/arch/powerpc/cpu/mpc512x/u-boot.lds
index a34501b631..0d8697901f 100644
--- a/arch/powerpc/cpu/mpc512x/u-boot.lds
+++ b/arch/powerpc/cpu/mpc512x/u-boot.lds
@@ -84,7 +84,7 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
}
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
ENTRY(_start)
diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S
index cc4c33ebbd..1b275c66a1 100644
--- a/arch/powerpc/cpu/mpc5xx/start.S
+++ b/arch/powerpc/cpu/mpc5xx/start.S
@@ -65,7 +65,7 @@
GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
END_GOT
@@ -459,7 +459,7 @@ clear_bss:
* Now clear BSS segment
*/
lwz r3,GOT(__bss_start)
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
cmplw 0, r3, r4
beq 6f
diff --git a/arch/powerpc/cpu/mpc5xx/u-boot.lds b/arch/powerpc/cpu/mpc5xx/u-boot.lds
index 0d87c8cf1e..8385a29bcb 100644
--- a/arch/powerpc/cpu/mpc5xx/u-boot.lds
+++ b/arch/powerpc/cpu/mpc5xx/u-boot.lds
@@ -93,7 +93,7 @@ SECTIONS
. = ALIGN(4);
}
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
. = env_start;
.ppcenv :
diff --git a/arch/powerpc/cpu/mpc5xxx/spl_boot.c b/arch/powerpc/cpu/mpc5xxx/spl_boot.c
index 9f14127dca..35611cce77 100644
--- a/arch/powerpc/cpu/mpc5xxx/spl_boot.c
+++ b/arch/powerpc/cpu/mpc5xxx/spl_boot.c
@@ -41,13 +41,12 @@ void board_init_f(ulong bootflag)
end_align = (u32)__spl_flash_end;
/*
- * First we need to initialize the SDRAM, so that the real
- * U-Boot or the OS (Linux) can be loaded
+ * On MPC5200, the initial RAM (and gd) is located in the internal
+ * SRAM. So we can actually call the preloader console init code
+ * before calling initdram(). This makes serial output (printf)
+ * available very early, even before SDRAM init, which has been
+ * an U-Boot priciple from day 1.
*/
- initdram(0);
-
- /* Clear bss */
- memset(__bss_start, '\0', __bss_end__ - __bss_start);
/*
* Init global_data pointer. Has to be done before calling
@@ -71,6 +70,15 @@ void board_init_f(ulong bootflag)
preloader_console_init();
/*
+ * First we need to initialize the SDRAM, so that the real
+ * U-Boot or the OS (Linux) can be loaded
+ */
+ initdram(0);
+
+ /* Clear bss */
+ memset(__bss_start, '\0', __bss_end - __bss_start);
+
+ /*
* Call board_init_r() (SPL framework version) to load and boot
* real U-Boot or OS
*/
diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S
index ad5bc0a179..2b6a800dea 100644
--- a/arch/powerpc/cpu/mpc5xxx/start.S
+++ b/arch/powerpc/cpu/mpc5xxx/start.S
@@ -66,7 +66,7 @@
GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
END_GOT
#endif
@@ -694,7 +694,7 @@ clear_bss:
* Now clear BSS segment
*/
lwz r3,GOT(__bss_start)
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
cmplw 0, r3, r4
beq 6f
diff --git a/arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds b/arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds
index cdb36c0884..590952fd15 100644
--- a/arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds
+++ b/arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds
@@ -91,6 +91,6 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
}
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
diff --git a/arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds b/arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds
index cab9b9265c..0500739617 100644
--- a/arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds
@@ -52,6 +52,6 @@ SECTIONS
__bss_start = .;
*(.bss*)
. = ALIGN(4);
- __bss_end__ = .;
+ __bss_end = .;
} > sdram
}
diff --git a/arch/powerpc/cpu/mpc5xxx/u-boot.lds b/arch/powerpc/cpu/mpc5xxx/u-boot.lds
index 6bd646b93e..06ece78361 100644
--- a/arch/powerpc/cpu/mpc5xxx/u-boot.lds
+++ b/arch/powerpc/cpu/mpc5xxx/u-boot.lds
@@ -87,6 +87,6 @@ SECTIONS
*(.sbss*)
. = ALIGN(4);
}
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S
index a1a2dc5acd..6295631913 100644
--- a/arch/powerpc/cpu/mpc8220/start.S
+++ b/arch/powerpc/cpu/mpc8220/start.S
@@ -64,7 +64,7 @@
GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
END_GOT
@@ -647,7 +647,7 @@ clear_bss:
* Now clear BSS segment
*/
lwz r3,GOT(__bss_start)
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
cmplw 0, r3, r4
beq 6f
diff --git a/arch/powerpc/cpu/mpc8220/u-boot.lds b/arch/powerpc/cpu/mpc8220/u-boot.lds
index 6e9967cf87..dc63d2081b 100644
--- a/arch/powerpc/cpu/mpc8220/u-boot.lds
+++ b/arch/powerpc/cpu/mpc8220/u-boot.lds
@@ -86,6 +86,6 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
}
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S
index 076df70a9f..0b9d898285 100644
--- a/arch/powerpc/cpu/mpc824x/start.S
+++ b/arch/powerpc/cpu/mpc824x/start.S
@@ -72,7 +72,7 @@
GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
#if defined(CONFIG_FADS)
GOT_ENTRY(environment)
@@ -584,7 +584,7 @@ clear_bss:
* Now clear BSS segment
*/
lwz r3,GOT(__bss_start)
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
cmplw 0, r3, r4
beq 6f
diff --git a/arch/powerpc/cpu/mpc824x/u-boot.lds b/arch/powerpc/cpu/mpc824x/u-boot.lds
index 699fb85857..4590fab338 100644
--- a/arch/powerpc/cpu/mpc824x/u-boot.lds
+++ b/arch/powerpc/cpu/mpc824x/u-boot.lds
@@ -87,6 +87,6 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
}
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S
index 3299d7292a..bd8d7ac53d 100644
--- a/arch/powerpc/cpu/mpc8260/start.S
+++ b/arch/powerpc/cpu/mpc8260/start.S
@@ -65,7 +65,7 @@
GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
#if defined(CONFIG_HYMOD)
GOT_ENTRY(environment)
@@ -920,7 +920,7 @@ clear_bss:
*/
lwz r4,GOT(environment)
#else
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
#endif
cmplw 0, r3, r4
diff --git a/arch/powerpc/cpu/mpc8260/u-boot.lds b/arch/powerpc/cpu/mpc8260/u-boot.lds
index 2709f37667..eb1c611f90 100644
--- a/arch/powerpc/cpu/mpc8260/u-boot.lds
+++ b/arch/powerpc/cpu/mpc8260/u-boot.lds
@@ -86,6 +86,6 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
}
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index 44a64b7acd..1bfc971412 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -76,7 +76,7 @@
START_GOT
GOT_ENTRY(_GOT2_TABLE_)
GOT_ENTRY(__bss_start)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
#ifndef MINIMAL_SPL
GOT_ENTRY(_FIXUP_TABLE_)
@@ -980,7 +980,7 @@ clear_bss:
*/
lwz r4,GOT(environment)
#else
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
#endif
cmplw 0, r3, r4
diff --git a/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds
index d140453d49..870b47d6af 100644
--- a/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds
@@ -49,7 +49,7 @@ SECTIONS
.bss (NOLOAD) : {
*(.*bss)
}
- __bss_end__ = .;
+ __bss_end = .;
}
ENTRY(_start)
-ASSERT(__bss_end__ <= 0xfff01000, "NAND bootstrap too big");
+ASSERT(__bss_end <= 0xfff01000, "NAND bootstrap too big");
diff --git a/arch/powerpc/cpu/mpc83xx/u-boot.lds b/arch/powerpc/cpu/mpc83xx/u-boot.lds
index 905823cb9a..a9d8598839 100644
--- a/arch/powerpc/cpu/mpc83xx/u-boot.lds
+++ b/arch/powerpc/cpu/mpc83xx/u-boot.lds
@@ -85,7 +85,7 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
}
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
ENTRY(_start)
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index fb674694e4..3f76ee66cf 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -70,7 +70,7 @@
#endif
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
END_GOT
@@ -1784,7 +1784,7 @@ clear_bss:
* Now clear BSS segment
*/
lwz r3,GOT(__bss_start)
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
cmplw 0,r3,r4
beq 6f
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds b/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
index 3bb757231b..65106f5e1f 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
@@ -103,6 +103,6 @@ SECTIONS
} :bss
. = ALIGN(4);
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds
index 87522b83d0..80cd98093a 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds
@@ -80,6 +80,6 @@ SECTIONS
*(.sbss*)
*(.bss*)
}
- __bss_end__ = .;
+ __bss_end = .;
}
ASSERT(__init_end <= (0xfff00000 + RESET_VECTOR_OFFSET), "NAND bootstrap too big");
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index 1c408e29f5..f2b7bffdab 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -83,5 +83,5 @@ SECTIONS
*(.sbss*)
*(.bss*)
}
- __bss_end__ = .;
+ __bss_end = .;
}
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot.lds b/arch/powerpc/cpu/mpc85xx/u-boot.lds
index 8c6e66ec1b..0503dce5ae 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot.lds
@@ -127,6 +127,6 @@ SECTIONS
} :bss
. = ALIGN(4);
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S
index ef80ecf6e5..20dfb9e0e2 100644
--- a/arch/powerpc/cpu/mpc86xx/start.S
+++ b/arch/powerpc/cpu/mpc86xx/start.S
@@ -61,7 +61,7 @@
GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
END_GOT
@@ -800,7 +800,7 @@ in_ram:
* Now clear BSS segment
*/
lwz r3,GOT(__bss_start)
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
cmplw 0, r3, r4
beq 6f
diff --git a/arch/powerpc/cpu/mpc86xx/u-boot.lds b/arch/powerpc/cpu/mpc86xx/u-boot.lds
index 81804e357c..7e357baf95 100644
--- a/arch/powerpc/cpu/mpc86xx/u-boot.lds
+++ b/arch/powerpc/cpu/mpc86xx/u-boot.lds
@@ -90,6 +90,6 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
}
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index ebca3acbaa..5aa50c512c 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -72,7 +72,7 @@
GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
END_GOT
@@ -590,7 +590,7 @@ clear_bss:
* Now clear BSS segment
*/
lwz r3,GOT(__bss_start)
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
cmplw 0, r3, r4
beq 6f
diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index 7aef43b210..52f2623373 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -243,7 +243,7 @@
GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end)
- GOT_ENTRY(__bss_end__)
+ GOT_ENTRY(__bss_end)
GOT_ENTRY(__bss_start)
END_GOT
#endif /* CONFIG_NAND_SPL */
@@ -1509,7 +1509,7 @@ clear_bss:
* Now clear BSS segment
*/
lwz r3,GOT(__bss_start)
- lwz r4,GOT(__bss_end__)
+ lwz r4,GOT(__bss_end)
cmplw 0, r3, r4
beq 7f
diff --git a/arch/powerpc/cpu/ppc4xx/u-boot.lds b/arch/powerpc/cpu/ppc4xx/u-boot.lds
index 2cadcc94d5..06010d6b14 100644
--- a/arch/powerpc/cpu/ppc4xx/u-boot.lds
+++ b/arch/powerpc/cpu/ppc4xx/u-boot.lds
@@ -142,6 +142,6 @@ SECTIONS
} :bss
. = ALIGN(4);
- __bss_end__ = . ;
+ __bss_end = . ;
PROVIDE (end = .);
}
diff --git a/arch/powerpc/include/asm/immap_512x.h b/arch/powerpc/include/asm/immap_512x.h
index f763a5413e..d96e53646a 100644
--- a/arch/powerpc/include/asm/immap_512x.h
+++ b/arch/powerpc/include/asm/immap_512x.h
@@ -227,7 +227,9 @@ typedef struct clk512x {
#define CLOCK_SCCR2_IIM_EN 0x00080000
/* SCFR1 System Clock Frequency Register 1 */
+#ifndef SCFR1_IPS_DIV
#define SCFR1_IPS_DIV 0x3
+#endif
#define SCFR1_IPS_DIV_MASK 0x03800000
#define SCFR1_IPS_DIV_SHIFT 23
@@ -238,6 +240,12 @@ typedef struct clk512x {
#define SCFR1_LPC_DIV_MASK 0x00003800
#define SCFR1_LPC_DIV_SHIFT 11
+#define SCFR1_NFC_DIV_MASK 0x00000700
+#define SCFR1_NFC_DIV_SHIFT 8
+
+#define SCFR1_DIU_DIV_MASK 0x000000FF
+#define SCFR1_DIU_DIV_SHIFT 0
+
/* SCFR2 System Clock Frequency Register 2 */
#define SCFR2_SYS_DIV 0xFC000000
#define SCFR2_SYS_DIV_SHIFT 26
@@ -343,6 +351,7 @@ typedef struct ddr512x {
/* MDDRC SYS CFG and Timing CFG0 Registers */
#define MDDRC_SYS_CFG_EN 0xF0000000
+#define MDDRC_SYS_CFG_CKE_MASK 0x40000000
#define MDDRC_SYS_CFG_CMD_MASK 0x10000000
#define MDDRC_REFRESH_ZERO_MASK 0x0000FFFF
@@ -871,6 +880,19 @@ typedef struct iopin_t {
void iopin_initialize(iopin_t *,int);
/*
+ * support to adjust individual parts of the IO pin setup
+ */
+
+#define IO_PIN_OVER_EACH (1 << 0) /* for compatibility */
+#define IO_PIN_OVER_FMUX (1 << 1)
+#define IO_PIN_OVER_HOLD (1 << 2)
+#define IO_PIN_OVER_PULL (1 << 3)
+#define IO_PIN_OVER_STRIG (1 << 4)
+#define IO_PIN_OVER_DRVSTR (1 << 5)
+
+void iopin_initialize_bits(iopin_t *, int);
+
+/*
* IIM
*/
typedef struct iim512x {
diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h
new file mode 100644
index 0000000000..0a94102dee
--- /dev/null
+++ b/arch/powerpc/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_POWERPC_SECTIONS_H
+#define __ASM_POWERPC_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/powerpc/include/asm/spl.h b/arch/powerpc/include/asm/spl.h
index f43bc23c92..7d5f9a0a33 100644
--- a/arch/powerpc/include/asm/spl.h
+++ b/arch/powerpc/include/asm/spl.h
@@ -26,6 +26,6 @@
#define BOOT_DEVICE_NOR 1
/* Linker symbols */
-extern char __bss_start[], __bss_end__[];
+extern char __bss_start[], __bss_end[];
#endif
diff --git a/arch/powerpc/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h
index 7229a98eaa..cf972d20ce 100644
--- a/arch/powerpc/include/asm/u-boot.h
+++ b/arch/powerpc/include/asm/u-boot.h
@@ -34,6 +34,11 @@
* include/asm-ppc/u-boot.h
*/
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified bd_info */
+#include <asm-generic/u-boot.h>
+#else
+
#ifndef __ASSEMBLY__
typedef struct bd_info {
@@ -144,6 +149,8 @@ typedef struct bd_info {
#endif /* __ASSEMBLY__ */
+#endif /* !CONFIG_SYS_GENERIC_BOARD */
+
/* For image.h:image_check_target_arch() */
#define IH_ARCH_DEFAULT IH_ARCH_PPC
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 86cf02ace4..59c723b070 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -59,8 +59,10 @@ SOBJS-y += reloc.o
COBJS-$(CONFIG_BAT_RW) += bat_rw.o
ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_SYS_GENERIC_BOARD
COBJS-y += board.o
endif
+endif
COBJS-y += bootm.o
COBJS-y += cache.o
COBJS-y += extable.o
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 12270a4533..422b4a39bb 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -123,7 +123,7 @@ DECLARE_GLOBAL_DATA_PTR;
#endif
extern ulong __init_end;
-extern ulong __bss_end__;
+extern ulong __bss_end;
ulong monitor_flash_len;
#if defined(CONFIG_CMD_BEDBUG)
@@ -237,25 +237,18 @@ static int init_func_spi(void)
/***********************************************************************/
#if defined(CONFIG_WATCHDOG)
-static int init_func_watchdog_init(void)
+int init_func_watchdog_init(void)
{
puts(" Watchdog enabled\n");
WATCHDOG_RESET();
return 0;
}
-#define INIT_FUNC_WATCHDOG_INIT init_func_watchdog_init,
-
-static int init_func_watchdog_reset(void)
+int init_func_watchdog_reset(void)
{
WATCHDOG_RESET();
return 0;
}
-
-#define INIT_FUNC_WATCHDOG_RESET init_func_watchdog_reset,
-#else
-#define INIT_FUNC_WATCHDOG_INIT /* undef */
-#define INIT_FUNC_WATCHDOG_RESET /* undef */
#endif /* CONFIG_WATCHDOG */
/*
@@ -326,7 +319,8 @@ static init_fnc_t *init_sequence[] = {
#ifdef CONFIG_POST
post_init_f,
#endif
- INIT_FUNC_WATCHDOG_RESET init_func_ram,
+ INIT_FUNC_WATCHDOG_RESET
+ init_func_ram,
#if defined(CONFIG_SYS_DRAM_TEST)
testdram,
#endif /* CONFIG_SYS_DRAM_TEST */
@@ -419,7 +413,7 @@ void board_init_f(ulong bootflag)
* - monitor code
* - board info struct
*/
- len = (ulong)&__bss_end__ - CONFIG_SYS_MONITOR_BASE;
+ len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
/*
* Subtract specified amount of memory to hide so that it won't
diff --git a/arch/sandbox/include/asm/sections.h b/arch/sandbox/include/asm/sections.h
index eafce7d8ab..4c378600b0 100644
--- a/arch/sandbox/include/asm/sections.h
+++ b/arch/sandbox/include/asm/sections.h
@@ -9,6 +9,8 @@
#ifndef __SANDBOX_SECTIONS_H
#define __SANDBOX_SECTIONS_H
+#include <asm-generic/sections.h>
+
struct sb_cmdline_option;
extern struct sb_cmdline_option *__u_boot_sandbox_option_start[],
diff --git a/arch/sh/cpu/sh2/u-boot.lds b/arch/sh/cpu/sh2/u-boot.lds
index 9bf1d85621..3cd5699c89 100644
--- a/arch/sh/cpu/sh2/u-boot.lds
+++ b/arch/sh/cpu/sh2/u-boot.lds
@@ -88,5 +88,5 @@ SECTIONS
}
PROVIDE (bss_end = .);
- PROVIDE (__bss_end__ = .);
+ PROVIDE (__bss_end = .);
}
diff --git a/arch/sh/cpu/sh3/u-boot.lds b/arch/sh/cpu/sh3/u-boot.lds
index 29352ad821..654c52cda7 100644
--- a/arch/sh/cpu/sh3/u-boot.lds
+++ b/arch/sh/cpu/sh3/u-boot.lds
@@ -95,5 +95,5 @@ SECTIONS
}
PROVIDE (bss_end = .);
- PROVIDE (__bss_end__ = .);
+ PROVIDE (__bss_end = .);
}
diff --git a/arch/sh/cpu/sh4/u-boot.lds b/arch/sh/cpu/sh4/u-boot.lds
index cf3da0db14..11d7ffab7e 100644
--- a/arch/sh/cpu/sh4/u-boot.lds
+++ b/arch/sh/cpu/sh4/u-boot.lds
@@ -92,5 +92,5 @@ SECTIONS
}
PROVIDE (bss_end = .);
- PROVIDE (__bss_end__ = .);
+ PROVIDE (__bss_end = .);
}
diff --git a/arch/sh/include/asm/sections.h b/arch/sh/include/asm/sections.h
new file mode 100644
index 0000000000..8824560eea
--- /dev/null
+++ b/arch/sh/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_SH_SECTIONS_H
+#define __ASM_SH_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index 34d7881f44..6e43acfbd3 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -65,6 +65,7 @@ static int sh_flash_init(void)
#if defined(CONFIG_WATCHDOG)
extern int watchdog_init(void);
extern int watchdog_disable(void);
+# undef INIT_FUNC_WATCHDOG_INIT
# define INIT_FUNC_WATCHDOG_INIT watchdog_init,
# define WATCHDOG_DISABLE watchdog_disable
#else
diff --git a/arch/sparc/cpu/leon2/Makefile b/arch/sparc/cpu/leon2/Makefile
index a9a18eb1ff..d4dc397034 100644
--- a/arch/sparc/cpu/leon2/Makefile
+++ b/arch/sparc/cpu/leon2/Makefile
@@ -43,13 +43,6 @@ $(LIB): $(OBJS)
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
-$(START): $(START:.o=.S)
- $(CC) -D__ASSEMBLY__ $(DBGFLAGS) $(OPTFLAGS) -D__KERNEL__ \
- -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) -I$(TOPDIR)/include \
- -fno-builtin -ffreestanding -nostdinc -isystem $(gccincdir) -pipe \
- $(PLATFORM_CPPFLAGS) -Wall -Wstrict-prototypes \
- -I$(TOPDIR)/board -c -o $(START) $(START:.o=.S)
-
sinclude $(obj).depend
#########################################################################
diff --git a/arch/sparc/cpu/leon2/serial.c b/arch/sparc/cpu/leon2/serial.c
index 40d5b01d27..b41ee01818 100644
--- a/arch/sparc/cpu/leon2/serial.c
+++ b/arch/sparc/cpu/leon2/serial.c
@@ -31,16 +31,6 @@
DECLARE_GLOBAL_DATA_PTR;
-/* Force cache miss each time a serial controller reg is read */
-#define CACHE_BYPASS 1
-
-#ifdef CACHE_BYPASS
-#define READ_BYTE(var) SPARC_NOCACHE_READ_BYTE((unsigned int)&(var))
-#define READ_HWORD(var) SPARC_NOCACHE_READ_HWORD((unsigned int)&(var))
-#define READ_WORD(var) SPARC_NOCACHE_READ((unsigned int)&(var))
-#define READ_DWORD(var) SPARC_NOCACHE_READ_DWORD((unsigned int)&(var))
-#endif
-
static int leon2_serial_init(void)
{
LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
diff --git a/arch/sparc/cpu/leon3/Makefile b/arch/sparc/cpu/leon3/Makefile
index 16d3377c73..1d051e17a3 100644
--- a/arch/sparc/cpu/leon3/Makefile
+++ b/arch/sparc/cpu/leon3/Makefile
@@ -43,13 +43,6 @@ $(LIB): $(OBJS)
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
-$(START): $(START:.o=.S)
- $(CC) -D__ASSEMBLY__ $(DBGFLAGS) $(OPTFLAGS) -D__KERNEL__ \
- -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) -I$(TOPDIR)/include \
- -fno-builtin -ffreestanding -nostdinc -isystem $(gccincdir) -pipe \
- $(PLATFORM_CPPFLAGS) -Wall -Wstrict-prototypes \
- -I$(TOPDIR)/board -c -o $(START) $(START:.o=.S)
-
sinclude $(obj).depend
#########################################################################
diff --git a/arch/sparc/cpu/leon3/serial.c b/arch/sparc/cpu/leon3/serial.c
index 838d4514ee..af9ce55673 100644
--- a/arch/sparc/cpu/leon3/serial.c
+++ b/arch/sparc/cpu/leon3/serial.c
@@ -32,16 +32,6 @@
DECLARE_GLOBAL_DATA_PTR;
-/* Force cache miss each time a serial controller reg is read */
-#define CACHE_BYPASS 1
-
-#ifdef CACHE_BYPASS
-#define READ_BYTE(var) SPARC_NOCACHE_READ_BYTE((unsigned int)&(var))
-#define READ_HWORD(var) SPARC_NOCACHE_READ_HWORD((unsigned int)&(var))
-#define READ_WORD(var) SPARC_NOCACHE_READ((unsigned int)&(var))
-#define READ_DWORD(var) SPARC_NOCACHE_READ_DWORD((unsigned int)&(var))
-#endif
-
ambapp_dev_apbuart *leon3_apbuart = NULL;
static int leon3_serial_init(void)
diff --git a/arch/sparc/include/asm/sections.h b/arch/sparc/include/asm/sections.h
new file mode 100644
index 0000000000..90f7fa7a3d
--- /dev/null
+++ b/arch/sparc/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_SPARC_SECTIONS_H
+#define __ASM_SPARC_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 23cacffded..168dc24fda 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -36,6 +36,9 @@ PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_X86)
PLATFORM_CPPFLAGS += -fno-dwarf2-cfi-asm
PLATFORM_CPPFLAGS += -DREALMODE_BASE=0x7c0
+# Support generic board on x86
+__HAVE_ARCH_GENERIC_BOARD := y
+
PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions
diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c
index a8136a06ab..786009c746 100644
--- a/arch/x86/cpu/coreboot/sdram.c
+++ b/arch/x86/cpu/coreboot/sdram.c
@@ -28,6 +28,7 @@
#include <asm/u-boot-x86.h>
#include <asm/global_data.h>
#include <asm/processor.h>
+#include <asm/sections.h>
#include <asm/arch/sysinfo.h>
#include <asm/arch/tables.h>
diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
index ef5aa951c9..2d6911aa41 100644
--- a/arch/x86/cpu/u-boot.lds
+++ b/arch/x86/cpu/u-boot.lds
@@ -53,6 +53,7 @@ SECTIONS
. = ALIGN(4);
__data_end = .;
+ __init_end = .;
. = ALIGN(4);
.dynsym : { *(.dynsym*) }
@@ -64,9 +65,6 @@ SECTIONS
. = ALIGN(4);
_end = .;
- . = ALIGN(4);
-
- __end = .;
.bss __rel_dyn_start (OVERLAY) : {
__bss_start = .;
*(.bss)
diff --git a/arch/x86/include/asm/config.h b/arch/x86/include/asm/config.h
index 049c44eaf8..3961b82811 100644
--- a/arch/x86/include/asm/config.h
+++ b/arch/x86/include/asm/config.h
@@ -21,4 +21,5 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
+#define CONFIG_SYS_GENERIC_BOARD
#endif
diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h
new file mode 100644
index 0000000000..602df86120
--- /dev/null
+++ b/arch/x86/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_X86_SECTIONS_H
+#define __ASM_X86_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h
index 948615d438..ae0c3883e4 100644
--- a/arch/x86/include/asm/u-boot-x86.h
+++ b/arch/x86/include/asm/u-boot-x86.h
@@ -24,15 +24,6 @@
#ifndef _U_BOOT_I386_H_
#define _U_BOOT_I386_H_ 1
-/* Exports from the Linker Script */
-extern ulong __text_start;
-extern ulong __data_end;
-extern ulong __rel_dyn_start;
-extern ulong __rel_dyn_end;
-extern ulong __bss_start;
-extern ulong __bss_end;
-extern ulong _end;
-
/* cpu/.../cpu.c */
int x86_cpu_init_r(void);
int cpu_init_r(void);
diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h
index 2f45c7b3d7..df759faec4 100644
--- a/arch/x86/include/asm/u-boot.h
+++ b/arch/x86/include/asm/u-boot.h
@@ -39,6 +39,13 @@
#include <config.h>
#include <compiler.h>
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified bd_info */
+#include <asm-generic/u-boot.h>
+#else
+
+#ifndef __ASSEMBLY__
+
typedef struct bd_info {
unsigned long bi_memstart; /* start of DRAM memory */
phys_size_t bi_memsize; /* size of DRAM memory in bytes */
@@ -60,6 +67,10 @@ typedef struct bd_info {
}bi_dram[CONFIG_NR_DRAM_BANKS];
} bd_t;
+#endif /* __ASSEMBLY__ */
+
+#endif /* !CONFIG_SYS_GENERIC_BOARD */
+
/* For image.h:image_check_target_arch() */
#define IH_ARCH_DEFAULT IH_ARCH_I386
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 9b24dc5fdf..ee89354808 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -25,7 +25,10 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(ARCH).o
+ifeq ($(CONFIG_SYS_GENERIC_BOARD),)
COBJS-y += board.o
+endif
+
COBJS-y += bootm.o
COBJS-y += cmd_boot.o
COBJS-y += gcc.o
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index 2441a66ae2..452e5d8262 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -38,6 +38,7 @@
#include <asm/u-boot-x86.h>
#include <asm/relocate.h>
#include <asm/processor.h>
+#include <asm/sections.h>
#include <asm/init_helpers.h>
#include <asm/init_wrappers.h>
@@ -219,7 +220,7 @@ static void do_init_loop(init_fnc_t **init_fnc_ptr)
void board_init_f(ulong boot_flags)
{
- gd->fdt_blob = gd->arch.new_fdt = NULL;
+ gd->fdt_blob = gd->new_fdt = NULL;
gd->flags = boot_flags;
do_init_loop(init_sequence_f);
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index 414fdcc4c9..af9dbc146a 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -32,6 +32,7 @@
#include <spi.h>
#include <status_led.h>
#include <asm/processor.h>
+#include <asm/sections.h>
#include <asm/u-boot-x86.h>
#include <linux/compiler.h>
@@ -111,7 +112,7 @@ int calculate_relocation_address(void)
*/
if (gd->fdt_blob) {
dest_addr -= fdt_size;
- gd->arch.new_fdt = (void *)dest_addr;
+ gd->new_fdt = (void *)dest_addr;
dest_addr &= ~15;
}
#endif
diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
index 3e370f2906..f178db9c81 100644
--- a/arch/x86/lib/relocate.c
+++ b/arch/x86/lib/relocate.c
@@ -36,6 +36,7 @@
#include <malloc.h>
#include <asm/u-boot-x86.h>
#include <asm/relocate.h>
+#include <asm/sections.h>
#include <elf.h>
int copy_uboot_to_ram(void)
@@ -49,15 +50,15 @@ int copy_uboot_to_ram(void)
int copy_fdt_to_ram(void)
{
- if (gd->arch.new_fdt) {
+ if (gd->new_fdt) {
ulong fdt_size;
fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32);
- memcpy(gd->arch.new_fdt, gd->fdt_blob, fdt_size);
+ memcpy(gd->new_fdt, gd->fdt_blob, fdt_size);
debug("Relocated fdt from %p to %p, size %lx\n",
- gd->fdt_blob, gd->arch.new_fdt, fdt_size);
- gd->fdt_blob = gd->arch.new_fdt;
+ gd->fdt_blob, gd->new_fdt, fdt_size);
+ gd->fdt_blob = gd->new_fdt;
}
return 0;