diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-05 18:01:24 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-07-05 18:01:24 +0200 |
commit | 55ebf67d3ec2b0727f86a54157a2740e9e8472c3 (patch) | |
tree | 01fde5994de0c51b4701750464c73f750c6b754e /board | |
parent | 4eae36cc43b290ed74929d925987d8f2fe8a888e (diff) | |
download | barebox-55ebf67d3ec2b0727f86a54157a2740e9e8472c3.tar.gz barebox-55ebf67d3ec2b0727f86a54157a2740e9e8472c3.tar.xz |
svn_rev_120
implement initcalls
Diffstat (limited to 'board')
-rw-r--r-- | board/scb9328/Makefile | 1 | ||||
-rw-r--r-- | board/scb9328/scb9328.c | 28 | ||||
-rw-r--r-- | board/scb9328/u-boot.lds | 69 | ||||
-rw-r--r-- | board/scb9328/u-boot.lds.S | 63 |
4 files changed, 105 insertions, 56 deletions
diff --git a/board/scb9328/Makefile b/board/scb9328/Makefile index 3ea2ae775b..72dc0f5cd0 100644 --- a/board/scb9328/Makefile +++ b/board/scb9328/Makefile @@ -2,3 +2,4 @@ obj-y += lowlevel_init.o obj-y += scb9328.o +extra-y += u-boot.lds diff --git a/board/scb9328/scb9328.c b/board/scb9328/scb9328.c index 7becbb32d9..001342091e 100644 --- a/board/scb9328/scb9328.c +++ b/board/scb9328/scb9328.c @@ -21,6 +21,7 @@ #include <common.h> #include <net.h> #include <cfi_flash.h> +#include <init.h> DECLARE_GLOBAL_DATA_PTR; @@ -45,19 +46,24 @@ static struct device_d sdram_dev = { .size = 16 * 1024 * 1024, }; -int board_init (void) -{ - gd->bd->bi_arch_number = MACH_TYPE_SCB9328; - gd->bd->bi_boot_params = 0x08000100; +static struct device_d dm9000_dev = { + .name = "dm9000", + .id = "eth0", - return 0; -} + .type = DEVICE_TYPE_ETHER, +}; -int dram_init (void) -{ +static int scb9328_devices_init(void) { register_device(&cfi_dev); register_device(&sdram_dev); + register_device(&dm9000_dev); + return 0; +} + +device_initcall(scb9328_devices_init); +static int late_init (void) +{ #if ( CONFIG_NR_DRAM_BANKS > 0 ) gd->bd->bi_dram[0].start = SCB9328_SDRAM_1; gd->bd->bi_dram[0].size = SCB9328_SDRAM_1_SIZE; @@ -75,10 +81,8 @@ int dram_init (void) gd->bd->bi_dram[3].size = SCB9328_SDRAM_4_SIZE; #endif -#ifdef CONFIG_DRIVER_NET_DM9000 - eth_set_current(&dm9000_eth); -#endif - return 0; } +late_initcall(late_init); + diff --git a/board/scb9328/u-boot.lds b/board/scb9328/u-boot.lds index 1d1669cdea..7af965d110 100644 --- a/board/scb9328/u-boot.lds +++ b/board/scb9328/u-boot.lds @@ -1,57 +1,38 @@ -/* - * (C) Copyright 2000-2004 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * - * 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 - * - */ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { - . = 0x00000000; + . = 0x00000000; - . = ALIGN(4); - .text : - { - cpu/arm920t/start.o (.text) - *(.text) - } + . = ALIGN(4); + .text : + { + cpu/arm920t/start.o (.text) + *(.text) + } - . = ALIGN(4); - .rodata : { *(.rodata) } + . = ALIGN(4); + .rodata : { *(.rodata) } - . = ALIGN(4); - .data : { *(.data) } + . = ALIGN(4); + .data : { *(.data) } - . = ALIGN(4); - .got : { *(.got) } + . = ALIGN(4); + .got : { *(.got) } - . = .; - __u_boot_cmd_start = .; - .u_boot_cmd : { *(.u_boot_cmd) } - __u_boot_cmd_end = .; + . = .; + __u_boot_cmd_start = .; + .u_boot_cmd : { *(.u_boot_cmd) } + __u_boot_cmd_end = .; - . = ALIGN(4); - __bss_start = .; - .bss : { *(.bss) } - _end = .; + __u_boot_initcalls_start = .; + .u_boot_initcalls : { *(.initcall.0) *(.initcall.1) *(.initcall.2) *(.initcall.3) *(.initcall.4) *(.initcall.5) *(.initcall.6) *(.initcall.7) } + __u_boot_initcalls_end = .; + + . = ALIGN(4); + __bss_start = .; + .bss : { *(.bss) } + _end = .; } diff --git a/board/scb9328/u-boot.lds.S b/board/scb9328/u-boot.lds.S new file mode 100644 index 0000000000..c450497e75 --- /dev/null +++ b/board/scb9328/u-boot.lds.S @@ -0,0 +1,63 @@ +/* + * (C) Copyright 2000-2004 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * 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 + * + */ + +#include <asm-generic/u-boot.lds.h> + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +SECTIONS +{ + . = 0x00000000; + + . = ALIGN(4); + .text : + { + cpu/arm920t/start.o (.text) + *(.text) + } + + . = ALIGN(4); + .rodata : { *(.rodata) } + + . = ALIGN(4); + .data : { *(.data) } + + . = ALIGN(4); + .got : { *(.got) } + + . = .; + __u_boot_cmd_start = .; + .u_boot_cmd : { *(.u_boot_cmd) } + __u_boot_cmd_end = .; + + __u_boot_initcalls_start = .; + .u_boot_initcalls : { INITCALLS } + __u_boot_initcalls_end = .; + + . = ALIGN(4); + __bss_start = .; + .bss : { *(.bss) } + _end = .; +} |