* [U-Boot] [PATCH v9 09/31] Introduce generic pre-relocation board_f.c @ 2013-03-11 16:49 ` Simon Glass 2013-03-11 16:49 ` [U-Boot] [PATCH v9 13/31] arm: Enable generic board support Simon Glass ` (3 more replies) 0 siblings, 4 replies; 13+ messages in thread From: Simon Glass @ 2013-03-11 16:49 UTC (permalink / raw) To: u-boot This file handles common pre-relocation init for boards which use the generic framework. It starts up the console, DRAM, performs relocation and then jumps to post-relocation init. Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v9: - Rebase x86 global_data patch on top of mainline Changes in v8: None Changes in v7: None Changes in v6: - Tidy up stack reservation code to separate out ARM - Fix up ordering of dram init (specifically to get ARM SPL boards to boot) - Add debug() to show RAM top - Adjust the way the top of memory is calculated Changes in v5: - Add fdtdec header file to board_f.c - Remove setup_global_data_ptr() - Tidy up stack init - Put global data on stack in board_init_f() - Add fdt relocation - Remove fdt relocation field from x86 arch_global_data - Deal with change of board_init_f() semantics on ARM - Save boot_flags in global_data in board_init_f() - Add print_cpuinfo() prototype to include/common.h Changes in v4: - Use asm/sections.h instead of asm-generic/sections.h Changes in v3: - Cast away the volatile on gd for memcpy() Changes in v2: None arch/x86/lib/board.c | 2 +- arch/x86/lib/init_helpers.c | 2 +- arch/x86/lib/relocate.c | 8 +- common/Makefile | 3 + common/board_f.c | 579 ++++++++++++++++++++++++++++++++++++++ include/asm-generic/global_data.h | 2 + include/common.h | 1 + 7 files changed, 591 insertions(+), 6 deletions(-) create mode 100644 common/board_f.c diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c index 2441a66..555301a 100644 --- a/arch/x86/lib/board.c +++ b/arch/x86/lib/board.c @@ -219,7 +219,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 414fdcc..7df9536 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -111,7 +111,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 3e370f2..e893c2b 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -49,15 +49,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; diff --git a/common/Makefile b/common/Makefile index 719fc23..a5f5b1a 100644 --- a/common/Makefile +++ b/common/Makefile @@ -36,6 +36,9 @@ COBJS-y += s_record.o COBJS-y += xyzModem.o COBJS-y += cmd_disk.o +# boards +COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o + # core command COBJS-y += cmd_boot.o COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o diff --git a/common/board_f.c b/common/board_f.c new file mode 100644 index 0000000..d674f9d --- /dev/null +++ b/common/board_f.c @@ -0,0 +1,579 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * (C) Copyright 2002-2006 + * Wolfgang Denk, DENX Software Engineering, wd at denx.de. + * + * (C) Copyright 2002 + * Sysgo Real-Time Solutions, GmbH <www.elinos.com> + * Marius Groeger <mgroeger@sysgo.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 <common.h> +#include <linux/compiler.h> +#include <version.h> +#include <environment.h> +#include <fdtdec.h> +#include <initcall.h> +#include <logbuff.h> +#include <post.h> +#include <asm/io.h> +#include <asm/sections.h> +#include <linux/compiler.h> + +/* + * Pointer to initial global data area + * + * Here we initialize it if needed. + */ +#ifdef XTRN_DECLARE_GLOBAL_DATA_PTR +#undef XTRN_DECLARE_GLOBAL_DATA_PTR +#define XTRN_DECLARE_GLOBAL_DATA_PTR /* empty = allocate here */ +DECLARE_GLOBAL_DATA_PTR = (gd_t *) (CONFIG_SYS_INIT_GD_ADDR); +#else +DECLARE_GLOBAL_DATA_PTR; +#endif + +/* + * sjg: IMO this code should be + * refactored to a single function, something like: + * + * void led_set_state(enum led_colour_t colour, int on); + */ +/************************************************************************ + * Coloured LED functionality + ************************************************************************ + * May be supplied by boards if desired + */ +inline void __coloured_LED_init(void) {} +void coloured_LED_init(void) + __attribute__((weak, alias("__coloured_LED_init"))); +inline void __red_led_on(void) {} +void red_led_on(void) __attribute__((weak, alias("__red_led_on"))); +inline void __red_led_off(void) {} +void red_led_off(void) __attribute__((weak, alias("__red_led_off"))); +inline void __green_led_on(void) {} +void green_led_on(void) __attribute__((weak, alias("__green_led_on"))); +inline void __green_led_off(void) {} +void green_led_off(void) __attribute__((weak, alias("__green_led_off"))); +inline void __yellow_led_on(void) {} +void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on"))); +inline void __yellow_led_off(void) {} +void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off"))); +inline void __blue_led_on(void) {} +void blue_led_on(void) __attribute__((weak, alias("__blue_led_on"))); +inline void __blue_led_off(void) {} +void blue_led_off(void) __attribute__((weak, alias("__blue_led_off"))); + +/* + * Why is gd allocated a register? Prior to reloc it might be better to + * just pass it around to each function in this file? + * + * After reloc one could argue that it is hardly used and doesn't need + * to be in a register. Or if it is it should perhaps hold pointers to all + * global data for all modules, so that post-reloc we can avoid the massive + * literal pool we get on ARM. Or perhaps just encourage each module to use + * a structure... + */ + +/* + * Could the CONFIG_SPL_BUILD infection become a flag in gd? + */ + +static int init_baud_rate(void) +{ + gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE); + return 0; +} + +static int display_text_info(void) +{ + ulong bss_start, bss_end; + + bss_start = _bss_start_ofs + _TEXT_BASE; + bss_end = _bss_end_ofs + _TEXT_BASE; + debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n", + CONFIG_SYS_TEXT_BASE, bss_start, bss_end); + +#ifdef CONFIG_MODEM_SUPPORT + debug("Modem Support enabled\n"); +#endif +#ifdef CONFIG_USE_IRQ + debug("IRQ Stack: %08lx\n", IRQ_STACK_START); + debug("FIQ Stack: %08lx\n", FIQ_STACK_START); +#endif + + return 0; +} + +static int announce_dram_init(void) +{ + puts("DRAM: "); + return 0; +} + +static int show_dram_config(void) +{ + ulong size; + +#ifdef CONFIG_NR_DRAM_BANKS + int i; + + debug("\nRAM Configuration:\n"); + for (i = size = 0; i < CONFIG_NR_DRAM_BANKS; i++) { + size += gd->bd->bi_dram[i].size; + debug("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start); +#ifdef DEBUG + print_size(gd->bd->bi_dram[i].size, "\n"); +#endif + } + debug("\nDRAM: "); +#else + size = gd->ram_size; +#endif + + print_size(size, "\n"); + + return 0; +} + +void __dram_init_banksize(void) +{ +#if defined(CONFIG_NR_DRAM_BANKS) && defined(CONFIG_SYS_SDRAM_BASE) + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + gd->bd->bi_dram[0].size = get_effective_memsize(); +#endif +} + +void dram_init_banksize(void) + __attribute__((weak, alias("__dram_init_banksize"))); + +static int zero_global_data(void) +{ + memset((void *)gd, '\0', sizeof(gd_t)); + + return 0; +} + +static int setup_mon_len(void) +{ + gd->mon_len = _bss_end_ofs; + return 0; +} + +__weak int arch_cpu_init(void) +{ + return 0; +} + +static int setup_fdt(void) +{ +#ifdef CONFIG_OF_EMBED + /* Get a pointer to the FDT */ + gd->fdt_blob = _binary_dt_dtb_start; +#elif defined CONFIG_OF_SEPARATE + /* FDT is at end of image */ + gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE); +#endif + /* Allow the early environment to override the fdt address */ + gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, + (uintptr_t)gd->fdt_blob); + return 0; +} + +/* Get the top of usable RAM */ +__weak ulong board_get_usable_ram_top(ulong total_size) +{ + return gd->ram_top; +} + +static int setup_dest_addr(void) +{ + debug("Monitor len: %08lX\n", gd->mon_len); + /* + * Ram is setup, size stored in gd !! + */ + debug("Ram size: %08lX\n", (ulong)gd->ram_size); +#if defined(CONFIG_SYS_MEM_TOP_HIDE) + /* + * Subtract specified amount of memory to hide so that it won't + * get "touched" at all by U-Boot. By fixing up gd->ram_size + * the Linux kernel should now get passed the now "corrected" + * memory size and won't touch it either. This should work + * for arch/ppc and arch/powerpc. Only Linux board ports in + * arch/powerpc with bootwrapper support, that recalculate the + * memory size from the SDRAM controller setup will have to + * get fixed. + */ + gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE; +#endif +#ifdef CONFIG_SYS_SDRAM_BASE + gd->ram_top = CONFIG_SYS_SDRAM_BASE; +#endif + gd->ram_top = board_get_usable_ram_top(gd->mon_len); + gd->dest_addr = gd->ram_top; + debug("Ram top: %08lX\n", (ulong)gd->ram_top); + gd->dest_addr_sp = gd->dest_addr; + return 0; +} + +#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) +static int reserve_logbuffer(void) +{ + /* reserve kernel log buffer */ + gd->dest_addr -= LOGBUFF_RESERVE; + debug("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, + gd->dest_addr); + return 0; +} +#endif + +#ifdef CONFIG_PRAM +/* reserve protected RAM */ +static int reserve_pram(void) +{ + ulong reg; + + reg = getenv_ulong("pram", 10, CONFIG_PRAM); + gd->dest_addr -= (reg << 10); /* size is in kB */ + debug("Reserving %ldk for protected RAM@%08lx\n", reg, + gd->dest_addr); + return 0; +} +#endif /* CONFIG_PRAM */ + +/* Round memory pointer down to next 4 kB limit */ +static int reserve_round_4k(void) +{ + gd->dest_addr &= ~(4096 - 1); + return 0; +} + +#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \ + defined(CONFIG_ARM) +static int reserve_mmu(void) +{ + /* reserve TLB table */ + gd->arch.tlb_size = 4096 * 4; + gd->dest_addr -= gd->arch.tlb_size; + + /* round down to next 64 kB limit */ + gd->dest_addr &= ~(0x10000 - 1); + + gd->arch.tlb_addr = gd->dest_addr; + debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr, + gd->arch.tlb_addr + gd->arch.tlb_size); + return 0; +} +#endif + +#ifdef CONFIG_LCD +static int reserve_lcd(void) +{ +#ifdef CONFIG_FB_ADDR + gd->fb_base = CONFIG_FB_ADDR; +#else + /* reserve memory for LCD display (always full pages) */ + gd->dest_addr = lcd_setmem(gd->dest_addr); + gd->fb_base = gd->dest_addr; +#endif /* CONFIG_FB_ADDR */ + return 0; +} +#endif /* CONFIG_LCD */ + +static int reserve_uboot(void) +{ + /* + * reserve memory for U-Boot code, data & bss + * round down to next 4 kB limit + */ + gd->dest_addr -= gd->mon_len; + gd->dest_addr &= ~(4096 - 1); + + debug("Reserving %ldk for U-Boot at: %08lx\n", gd->mon_len >> 10, + gd->dest_addr); + return 0; +} + +/* reserve memory for malloc() area */ +static int reserve_malloc(void) +{ + gd->dest_addr_sp = gd->dest_addr - TOTAL_MALLOC_LEN; + debug("Reserving %dk for malloc() at: %08lx\n", + TOTAL_MALLOC_LEN >> 10, gd->dest_addr_sp); + return 0; +} + +/* (permanently) allocate a Board Info struct */ +static int reserve_board(void) +{ + gd->dest_addr_sp -= sizeof(bd_t); + gd->bd = (bd_t *)gd->dest_addr_sp; + memset(gd->bd, '\0', sizeof(bd_t)); + debug("Reserving %zu Bytes for Board Info at: %08lx\n", + sizeof(bd_t), gd->dest_addr_sp); + return 0; +} + +static int setup_machine(void) +{ +#ifdef CONFIG_MACH_TYPE + gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ +#endif + return 0; +} + +static int reserve_global_data(void) +{ + gd->dest_addr_sp -= sizeof(gd_t); + gd->new_gd = (gd_t *)gd->dest_addr_sp; + debug("Reserving %zu Bytes for Global Data at: %08lx\n", + sizeof(gd_t), gd->dest_addr_sp); + return 0; +} + +static int reserve_fdt(void) +{ + /* + * If the device tree is sitting immediate above our image then we + * must relocate it. If it is embedded in the data section, then it + * will be relocated with other data. + */ + if (gd->fdt_blob) { + gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32); + + gd->dest_addr_sp -= gd->fdt_size; + gd->new_fdt = (void *)gd->dest_addr_sp; + debug("Reserving %lu Bytes for FDT at: %p\n", + gd->fdt_size, gd->new_fdt); + } + + return 0; +} + +static int reserve_stacks(void) +{ + /* setup stack pointer for exceptions */ + gd->dest_addr_sp -= 16; + gd->dest_addr_sp &= ~0xf; + gd->irq_sp = gd->dest_addr_sp; + + /* + * Handle architecture-specific things here + * TODO(sjg at chromium.org): Perhaps create arch_reserve_stack() + * to handle this and put in arch/xxx/lib/stack.c + */ +# ifdef CONFIG_ARM +# ifdef CONFIG_USE_IRQ + gd->dest_addr_sp -= (CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ); + debug("Reserving %zu Bytes for IRQ stack at: %08lx\n", + CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ, gd->dest_addr_sp); + + /* 8-byte alignment for ARM ABI compliance */ + gd->dest_addr_sp &= ~0x07; +# endif + /* leave 3 words for abort-stack, plus 1 for alignment */ + gd->dest_addr_sp -= 16; + + return 0; +} + +static int display_new_sp(void) +{ + debug("New Stack Pointer is: %08lx\n", gd->dest_addr_sp); + + return 0; +} + +#ifdef CONFIG_POST +static int init_post(void) +{ + post_bootmode_init(); + post_run(NULL, POST_ROM | post_bootmode_get(0)); + + return 0; +} +#endif + +static int setup_baud_rate(void) +{ + /* Ick, can we get rid of this line? */ + gd->bd->bi_baudrate = gd->baudrate; + + return 0; +} + +static int setup_dram_config(void) +{ + /* Ram is board specific, so move it to board code ... */ + dram_init_banksize(); + + return 0; +} + +static int reloc_fdt(void) +{ + if (gd->new_fdt) { + memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size); + gd->fdt_blob = gd->new_fdt; + } + + return 0; +} + +static int setup_reloc(void) +{ + gd->relocaddr = gd->dest_addr; + gd->start_addr_sp = gd->dest_addr_sp; + gd->reloc_off = gd->dest_addr - CONFIG_SYS_TEXT_BASE; + memcpy(gd->new_gd, (char *)gd, sizeof(gd_t)); + + debug("Relocation Offset is: %08lx\n", gd->reloc_off); + debug("Relocating to %08lx, new gd at %p, sp at %08lx\n", + gd->dest_addr, gd->new_gd, gd->dest_addr_sp); + + return 0; +} + +/* ARM calls relocate_code from its crt0.S */ +#if !defined(CONFIG_ARM) + +static int jump_to_copy(void) +{ + relocate_code(gd->dest_addr_sp, gd->new_gd, gd->dest_addr); + + return 0; +} +#endif + +/* Record the board_init_f() bootstage (after arch_cpu_init()) */ +static int mark_bootstage(void) +{ + bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); + + return 0; +} + +static init_fnc_t init_sequence_f[] = { + setup_fdt, + setup_mon_len, + arch_cpu_init, /* basic arch cpu dependent setup */ + mark_bootstage, +#ifdef CONFIG_OF_CONTROL + fdtdec_check_fdt, +#endif +#if defined(CONFIG_BOARD_EARLY_INIT_F) + board_early_init_f, +#endif + timer_init, /* initialize timer */ +#ifdef CONFIG_BOARD_POSTCLK_INIT + board_postclk_init, +#endif +#ifdef CONFIG_FSL_ESDHC + get_clocks, +#endif + env_init, /* initialize environment */ + init_baud_rate, /* initialze baudrate settings */ + serial_init, /* serial communications setup */ + console_init_f, /* stage 1 init of console */ + display_options, /* say that we are here */ + display_text_info, /* show debugging info if required */ +#if defined(CONFIG_DISPLAY_CPUINFO) + print_cpuinfo, /* display cpu info (and speed) */ +#endif +#if defined(CONFIG_DISPLAY_BOARDINFO) + checkboard, /* display board info */ +#endif + announce_dram_init, + /* TODO: unify all these dram functions? */ +#ifdef CONFIG_ARM + dram_init, /* configure available RAM banks */ +#endif +#ifdef CONFIG_POST + init_post, +#endif + /* + * Now that we have DRAM mapped and working, we can + * relocate the code and continue running from DRAM. + * + * Reserve memory at end of RAM for (top down in that order): + * - area that won't get touched by U-Boot and Linux (optional) + * - kernel log buffer + * - protected RAM + * - LCD framebuffer + * - monitor code + * - board info struct + */ + setup_dest_addr, +#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) + reserve_logbuffer, +#endif +#ifdef CONFIG_PRAM + reserve_pram, +#endif + reserve_round_4k, +#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \ + defined(CONFIG_ARM) + reserve_mmu, +#endif +#ifdef CONFIG_LCD + reserve_lcd, +#endif + reserve_uboot, + reserve_malloc, + reserve_board, + setup_machine, + reserve_global_data, + reserve_fdt, + reserve_stacks, + setup_dram_config, + show_dram_config, + setup_baud_rate, + display_new_sp, + reloc_fdt, + setup_reloc, +#ifndef CONFIG_ARM + jump_to_copy, +#endif + NULL, +}; + +void board_init_f(ulong boot_flags) +{ + gd_t data; + + gd = &data; + + gd->flags = boot_flags; + + if (initcall_run_list(init_sequence_f)) + hang(); + +#ifndef CONFIG_ARM + /* NOTREACHED - jump_to_copy() does not return */ + hang(); +#endif +} + +void hang(void) +{ + puts("### ERROR ### Please RESET the board ###\n"); + for (;;); +} diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index b8ac024..ebfe2a3 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -81,6 +81,8 @@ typedef struct global_data { unsigned long reloc_off; struct global_data *new_gd; /* relocated global data */ const void *fdt_blob; /* Our device tree, NULL if none */ + void *new_fdt; /* Relocated FDT */ + unsigned long fdt_size; /* Space reserved for relocated FDT */ void **jt; /* jump table */ char env_buf[32]; /* buffer for getenv() before reloc. */ struct arch_global_data arch; /* architecture-specific data */ diff --git a/include/common.h b/include/common.h index 6d52924..2ff8db1 100644 --- a/include/common.h +++ b/include/common.h @@ -311,6 +311,7 @@ extern ulong monitor_flash_len; int mac_read_from_eeprom(void); extern u8 _binary_dt_dtb_start[]; /* embedded device tree blob */ int set_cpu_clk_info(void); +int print_cpuinfo(void); /** * Show the DRAM size in a board-specific way -- 1.8.1.3 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 13/31] arm: Enable generic board support 2013-03-11 16:49 ` [U-Boot] [PATCH v9 09/31] Introduce generic pre-relocation board_f.c Simon Glass @ 2013-03-11 16:49 ` Simon Glass 2013-03-11 16:50 ` [U-Boot] [PATCH v9 17/31] ppc: " Simon Glass ` (2 subsequent siblings) 3 siblings, 0 replies; 13+ messages in thread From: Simon Glass @ 2013-03-11 16:49 UTC (permalink / raw) To: u-boot This enables generic board support so that ARM boards can define CONFIG_SYS_GENERIC_BOARD. Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v9: - Use !CONFIG instead of nCONFIG Changes in v8: - Define __HAVE_ARCH_GENERIC_BOARD in ARM's config.mk Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None arch/arm/config.mk | 3 +++ arch/arm/include/asm/u-boot.h | 9 +++++++++ arch/arm/lib/Makefile | 3 +++ 3 files changed, 15 insertions(+) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 24b9d7c..a0c89b7 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/include/asm/u-boot.h b/arch/arm/include/asm/u-boot.h index 2ba98bc..a33fefa 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 57111af..24c7e7a 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -39,7 +39,10 @@ GLCOBJS += div0.o SOBJS-y += crt0.o ifndef CONFIG_SPL_BUILD +ifndef CONFIG_SYS_GENERIC_BOARD COBJS-y += board.o +endif + COBJS-y += bootm.o COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o -- 1.8.1.3 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 17/31] ppc: Enable generic board support 2013-03-11 16:49 ` [U-Boot] [PATCH v9 09/31] Introduce generic pre-relocation board_f.c Simon Glass 2013-03-11 16:49 ` [U-Boot] [PATCH v9 13/31] arm: Enable generic board support Simon Glass @ 2013-03-11 16:50 ` Simon Glass 2013-03-11 16:50 ` [U-Boot] [PATCH v9 21/31] x86: " Simon Glass 2013-03-13 8:46 ` [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC Wolfgang Denk 3 siblings, 0 replies; 13+ messages in thread From: Simon Glass @ 2013-03-11 16:50 UTC (permalink / raw) To: u-boot This enables generic board support so that ppc boards can define CONFIG_SYS_GENERIC_BOARD. Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v9: - Use !CONFIG instead of nCONFIG Changes in v8: - Define __HAVE_ARCH_GENERIC_BOARD in PPC's config.mk Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None arch/powerpc/config.mk | 3 +++ arch/powerpc/include/asm/u-boot.h | 7 +++++++ arch/powerpc/lib/Makefile | 2 ++ 3 files changed, 12 insertions(+) diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index b706281..e32d2bf 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/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h index 7229a98..cf972d2 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 86cf02a..59c723b 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 -- 1.8.1.3 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 21/31] x86: Enable generic board support 2013-03-11 16:49 ` [U-Boot] [PATCH v9 09/31] Introduce generic pre-relocation board_f.c Simon Glass 2013-03-11 16:49 ` [U-Boot] [PATCH v9 13/31] arm: Enable generic board support Simon Glass 2013-03-11 16:50 ` [U-Boot] [PATCH v9 17/31] ppc: " Simon Glass @ 2013-03-11 16:50 ` Simon Glass 2013-03-13 8:46 ` [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC Wolfgang Denk 3 siblings, 0 replies; 13+ messages in thread From: Simon Glass @ 2013-03-11 16:50 UTC (permalink / raw) To: u-boot This enables generic board support so that x86 boards can define CONFIG_SYS_GENERIC_BOARD. Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v9: - Use !CONFIG instead of nCONFIG Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: - Avoid setting up gd on x86 as it is already done Changes in v4: None Changes in v3: None Changes in v2: None arch/x86/include/asm/u-boot.h | 11 +++++++++++ arch/x86/lib/Makefile | 3 +++ common/board_r.c | 2 ++ 3 files changed, 16 insertions(+) diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h index 2f45c7b..df759fa 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 9b24dc5..ee89354 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/common/board_r.c b/common/board_r.c index 29eccdf..230887d 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -509,11 +509,13 @@ static int show_model_r(void) #endif /* enable exceptions */ +#ifdef CONFIG_ARM static int initr_enable_interrupts(void) { enable_interrupts(); return 0; } +#endif #ifdef CONFIG_CMD_NET static int initr_ethaddr(void) -- 1.8.1.3 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC 2013-03-11 16:49 ` [U-Boot] [PATCH v9 09/31] Introduce generic pre-relocation board_f.c Simon Glass ` (2 preceding siblings ...) 2013-03-11 16:50 ` [U-Boot] [PATCH v9 21/31] x86: " Simon Glass @ 2013-03-13 8:46 ` Wolfgang Denk 2013-03-15 22:23 ` Tom Rini 2013-03-30 21:34 ` Simon Glass 3 siblings, 2 replies; 13+ messages in thread From: Wolfgang Denk @ 2013-03-13 8:46 UTC (permalink / raw) To: u-boot Dear Simon Glass, In message <1363020460-14307-1-git-send-email-sjg@chromium.org> you wrote: > This series creates a generic board init implementation which contains > the essential functions of the major arch/xxx/lib/board.c files. It is > split into two parts: board_f.c for pre-relocation and board_r.c for > post-relocation. ... > ARM is a relatively large board.c file and one which I can test, therefore > I think it is a good target for this series. On the other hand, x86 is > relatively small and simple, but different enough that it introduces a > few issues to be solved. So I have chosen both ARM and x86 for this series. > After a suggestion from Wolfgang I have added PPC also. This is the > largest and most feature-full board, so hopefully we have all bases > covered in this series. Other archs are mostly a subset of these. I did some testing on Power Architecture systems - to be precise: CPU Board -------------------------- MPC860T TQM860L MPC5200 TQM5200S PPC405EX Kilauea PPC440EP Yosemite PPC440EX Sequoia PPC440SPe Katmai PPC460EX Canyonlands On all boards I verified at least environment access (printenv, saveenv) and network operation (TFTP download); where available also PCI. Everything appears to work fine, no problems noted. A well done job, thanks a lot! For the whole series: Tested-by: Wolfgang Denk <wd@denx.de> Acked-by: Wolfgang Denk <wd@denx.de> Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Certain old men prefer to rise at dawn, taking a cold bath and a long walk with an empty stomach and otherwise mortifying the flesh. They then point with pride to these practices as the cause of their sturdy health and ripe years; the truth being that they are hearty and old, not because of their habits, but in spite of them. The reason we find only robust persons doing this thing is that it has killed all the others who have tried it. - Ambrose Bierce, "The Devil's Dictionary" ^ permalink raw reply [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC 2013-03-13 8:46 ` [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC Wolfgang Denk @ 2013-03-15 22:23 ` Tom Rini 2013-03-30 21:34 ` Simon Glass 1 sibling, 0 replies; 13+ messages in thread From: Tom Rini @ 2013-03-15 22:23 UTC (permalink / raw) To: u-boot On Wed, Mar 13, 2013 at 09:46:26AM +0100, Wolfgang Denk wrote: > Dear Simon Glass, > > In message <1363020460-14307-1-git-send-email-sjg@chromium.org> you wrote: > > This series creates a generic board init implementation which contains > > the essential functions of the major arch/xxx/lib/board.c files. It is > > split into two parts: board_f.c for pre-relocation and board_r.c for > > post-relocation. > ... > > ARM is a relatively large board.c file and one which I can test, therefore > > I think it is a good target for this series. On the other hand, x86 is > > relatively small and simple, but different enough that it introduces a > > few issues to be solved. So I have chosen both ARM and x86 for this series. > > After a suggestion from Wolfgang I have added PPC also. This is the > > largest and most feature-full board, so hopefully we have all bases > > covered in this series. Other archs are mostly a subset of these. > > I did some testing on Power Architecture systems - to be precise: > > CPU Board > -------------------------- > MPC860T TQM860L > MPC5200 TQM5200S > PPC405EX Kilauea > PPC440EP Yosemite > PPC440EX Sequoia > PPC440SPe Katmai > PPC460EX Canyonlands > > On all boards I verified at least environment access (printenv, > saveenv) and network operation (TFTP download); where available also > PCI. Everything appears to work fine, no problems noted. > > A well done job, thanks a lot! > > For the whole series: > > Tested-by: Wolfgang Denk <wd@denx.de> > Acked-by: Wolfgang Denk <wd@denx.de> OK, I've taken http://patchwork.ozlabs.org/bundle/sjg/us-board/ but with http://patchwork.ozlabs.org/patch/228080/ for 2/31 and applied this to u-boot/master now, thanks again! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130315/da1bf0d1/attachment.pgp> ^ permalink raw reply [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC 2013-03-13 8:46 ` [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC Wolfgang Denk 2013-03-15 22:23 ` Tom Rini @ 2013-03-30 21:34 ` Simon Glass 1 sibling, 0 replies; 13+ messages in thread From: Simon Glass @ 2013-03-30 21:34 UTC (permalink / raw) To: u-boot Hi Wolfgang, On Wed, Mar 13, 2013 at 1:46 AM, Wolfgang Denk <wd@denx.de> wrote: > Dear Simon Glass, > > In message <1363020460-14307-1-git-send-email-sjg@chromium.org> you wrote: > > This series creates a generic board init implementation which contains > > the essential functions of the major arch/xxx/lib/board.c files. It is > > split into two parts: board_f.c for pre-relocation and board_r.c for > > post-relocation. > ... > > ARM is a relatively large board.c file and one which I can test, > therefore > > I think it is a good target for this series. On the other hand, x86 is > > relatively small and simple, but different enough that it introduces a > > few issues to be solved. So I have chosen both ARM and x86 for this > series. > > After a suggestion from Wolfgang I have added PPC also. This is the > > largest and most feature-full board, so hopefully we have all bases > > covered in this series. Other archs are mostly a subset of these. > > I did some testing on Power Architecture systems - to be precise: > > CPU Board > -------------------------- > MPC860T TQM860L > MPC5200 TQM5200S > PPC405EX Kilauea > PPC440EP Yosemite > PPC440EX Sequoia > PPC440SPe Katmai > PPC460EX Canyonlands > > On all boards I verified at least environment access (printenv, > saveenv) and network operation (TFTP download); where available also > PCI. Everything appears to work fine, no problems noted. > > A well done job, thanks a lot! > Thanks for your comments which are much appreciated. There is still work to do, in cleaning up the implementation to reduce the differences between arch code (e.g. all the #ifdefs in board_f/r.c). But this is a great first step and I am pleased to get this in. > > For the whole series: > > Tested-by: Wolfgang Denk <wd@denx.de> > Acked-by: Wolfgang Denk <wd@denx.de> > > > Best regards, > > Wolfgang Denk > > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de > Certain old men prefer to rise at dawn, taking a cold bath and a long > walk with an empty stomach and otherwise mortifying the flesh. They > then point with pride to these practices as the cause of their sturdy > health and ripe years; the truth being that they are hearty and old, > not because of their habits, but in spite of them. The reason we find > only robust persons doing this thing is that it has killed all the > others who have tried it. - Ambrose Bierce, "The Devil's Dictionary" > But I wonder if this is trying to tell me to stop these tricky refactors :-) Regards, Simon ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <1363021453-6566-1-git-send-email-sjg@chromium.org>]
* [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC [not found] <1363021453-6566-1-git-send-email-sjg@chromium.org> @ 2013-03-11 17:50 ` Simon Glass 2013-03-13 3:52 ` Simon Glass 1 sibling, 0 replies; 13+ messages in thread From: Simon Glass @ 2013-03-11 17:50 UTC (permalink / raw) To: u-boot Hi Tom, On Mon, Mar 11, 2013 at 10:03 AM, Simon Glass <sjg@chromium.org> wrote: > This series creates a generic board init implementation which contains > the essential functions of the major arch/xxx/lib/board.c files. It is > split into two parts: board_f.c for pre-relocation and board_r.c for > post-relocation. > > What is the motivation for this change? > > 1. There is a lot of repeated code in the board.c files. Any change to > things like setting up the baud rate requires a change in 10 separate > places. > > 2. Since there are 14 separate files, adding a new feature which requires > initialisation is painful since it must be independently added in 14 > places. > > 3. As time goes by the architectures naturely diverge since there is > limited > pressure to compare features or even CONFIG options against simiilar things > in other board.c files. > > 4. New architectures must implement all the features all over again, and > sometimes in subtley different ways. This places an unfair burden on > getting > a new architecture fully functional and running with U-Boot. > > 5. While it is a bit of a tricky change, I believe it is worthwhile and > achievable. There is no requirement that all code be common, only that > the code that is common should be located in common/board.c rather than > arch/xxx/lib/board.c. > > All the functions of board_init_f() and board_init_r() are broken into > separate function calls so that they can easily be included or excluded > for a particular architecture. It also makes it easier to adopt Graeme's > initcall proposal assuming this comes about. > > http://lists.denx.de/pipermail/u-boot/2012-January/114499.html > > This series is not dependent on generic relocation. So relocation > happens as one big chunk and is still completely arch-specific. See the > relocation series for a proposed solution to this for ARM: > > http://lists.denx.de/pipermail/u-boot/2011-December/112928.html > > or x86's implementation which is in mainline. Unifying relocation is > probably the next step after this series. > > Instead of moving over a whole architecture, this series takes the approach > of simply enabling generic board support for an architecture. It is then up > to each board to opt in by defining CONFIG_SYS_GENERIC_BOARD in the board > config file. If this is not done, then the code will be generated as > before. This allows both sets of code to co-exist until we are comfortable > with the generic approach, and enough boards run. > > ARM is a relatively large board.c file and one which I can test, therefore > I think it is a good target for this series. On the other hand, x86 is > relatively small and simple, but different enough that it introduces a > few issues to be solved. So I have chosen both ARM and x86 for this series. > After a suggestion from Wolfgang I have added PPC also. This is the > largest and most feature-full board, so hopefully we have all bases > covered in this series. Other archs are mostly a subset of these. > > A generic global_data structure is now in mainline, and this is required > for this series. > > Similarly we need a generic bd_info structure, since generic code will > be accessing it. I have done this with a simple generic file for now. > > There was dicussion on the list about passing gd_t around as a parameter > to pre-relocation init functions. I think this makes sense, but it can > be done as a separate change, and this series does not require it. > > While this series needs to stand on its own, the goal is the unification > of the board init code. So I hope we can address issues with this in mind, > rather than focusing too narrowly on particular ARM, x86 or PPC issues. > I have added TODO markers in places where I think there are opportunities > to relationalise the board init now it is all in one place, but these don't > need to be addressed for the feature to work, and are best done as smaller > patches than can be reviewed by individual arch maintainers, I think. > > I have run-tested ARM on Tegra Seaboard and x86/coreboot only. To try it > out, define CONFIG_SYS_GENERIC_BOARD in your board file and rebuild. Most > likely on PPC at least it will hang, but if you are lucky it will print > something first :-) I hope to test an SPL board (snow / exynos5250) when > I can get that booting from mainline. > > I have run this though buildman with CONFIG_SYS_GENERIC_BOARD on for all > ARM, PPC and x86 boards. The only failure is highbank (an ARM board), which > seems to use SCSI but scsi_init() is not available. > > Code size increases by about 1KB on ARM and about 1.3KB on PPC with generic > board enabled. This is mostly due to the move to using separate functions > for each part of the init, which will make it easier to move to a pure > initcall approach later if we want to. > > Since this series was first sent there have been additions to the board > code for ARM and PPC. I have added in these additions. This is a manual > process, and I expect that people will find problems (and send patches) > as they try out their boards. > I have created a branch on x86 for this as follows, in case this helps. But I believe Wolfgang is hoping to look at getting it running on PowerPC, so it might be worth holding off for more news. The following changes since commit fc959081d41aab2d6f4614c5fb3dd1b77ffcdcf4: x86: Enable CONFIG_OF_CONTROL on coreboot (2013-03-04 15:57:52 -0800) are available in the git repository at: git://git.denx.de/u-boot-x86.git us-board-v10 for you to fetch changes up to 0a2cdf0f505a018e5a781750ada081ac6e81a866: Use 'unsigned int' for global_data's baudrate (2013-03-11 10:42:20 -0700) ---------------------------------------------------------------- Simon Glass (31): Introduce generic u-boot.h file Replace __bss_end__ with __bss_end Introduce generic link section.h symbol files arm: Use sections header to obtain link symbols Change stub example to use asm-generic/sections.h Introduce a basic initcall implementation __HAVE_ARCH_GENERIC_BOARD controls availabilty of generic board Declare watchdog functions in watchdog.h Introduce generic pre-relocation board_f.c Introduce generic post-relocation board_r.c Add spl load feature arm: Remove use of board_early_init_r/last_stage_init() arm: Enable generic board support Add CONFIG_SYS_SYM_OFFSETS to support offset symbols Adjust board_f.c for ppc Adjust board_r.c for ppc ppc: Enable generic board support x86: Adjust board_f.c for x86 x86: Adjust board_r.c for x86 x86: Use sections header to obtain link symbols tegra: Enable generic board for Tegra x86: Enable generic board support x86: Enable generic board exynos5: Enable generic board for Exynos5 device tree boards blackfin: Fix up board_type global data blackfin: Remove noreturn attribute from cpu_init_f() avr32: Fix cast warning in board.c serial: ns16550: Remove unwanted cast sparc: Fix out-of-tree building sparc: Fix build warnings in serial.c Use 'unsigned int' for global_data's baudrate README | 17 + arch/arm/config.mk | 3 + arch/arm/cpu/arm1136/start.S | 2 +- arch/arm/cpu/arm1136/u-boot-spl.lds | 2 +- arch/arm/cpu/arm1176/start.S | 2 +- arch/arm/cpu/arm720t/start.S | 2 +- arch/arm/cpu/arm920t/ep93xx/u-boot.lds | 2 +- arch/arm/cpu/arm920t/start.S | 2 +- arch/arm/cpu/arm925t/start.S | 2 +- arch/arm/cpu/arm926ejs/davinci/spl.c | 2 +- arch/arm/cpu/arm926ejs/mxs/start.S | 2 +- arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds | 2 +- arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds | 2 +- arch/arm/cpu/arm926ejs/start.S | 4 +- arch/arm/cpu/arm946es/start.S | 2 +- arch/arm/cpu/arm_intcm/start.S | 2 +- arch/arm/cpu/armv7/omap-common/u-boot-spl.lds | 2 +- arch/arm/cpu/armv7/socfpga/u-boot-spl.lds | 2 +- arch/arm/cpu/armv7/start.S | 2 +- arch/arm/cpu/ixp/start.S | 2 +- arch/arm/cpu/ixp/u-boot.lds | 2 +- arch/arm/cpu/pxa/start.S | 2 +- arch/arm/cpu/s3c44b0/start.S | 2 +- arch/arm/cpu/sa1100/start.S | 2 +- arch/arm/cpu/u-boot.lds | 4 +- arch/arm/include/asm/sections.h | 27 + arch/arm/include/asm/spl.h | 2 +- arch/arm/include/asm/u-boot-arm.h | 4 - arch/arm/include/asm/u-boot.h | 9 + arch/arm/lib/Makefile | 3 + arch/arm/lib/board.c | 1 + arch/arm/lib/crt0.S | 4 +- arch/arm/lib/spl.c | 2 +- arch/avr32/cpu/start.S | 2 +- arch/avr32/cpu/u-boot.lds | 2 +- arch/avr32/include/asm/sections.h | 6 +- arch/avr32/lib/board.c | 8 +- arch/blackfin/cpu/cpu.c | 1 - arch/blackfin/include/asm/global_data.h | 1 + arch/blackfin/include/asm/sections.h | 27 + arch/blackfin/lib/board.c | 2 +- arch/m68k/include/asm/sections.h | 27 + arch/m68k/lib/board.c | 5 +- arch/microblaze/include/asm/sections.h | 27 + arch/mips/include/asm/sections.h | 27 + arch/mips/include/asm/u-boot-mips.h | 4 +- arch/nds32/cpu/n1213/start.S | 2 +- arch/nds32/cpu/n1213/u-boot.lds | 2 +- arch/nds32/include/asm/sections.h | 27 + arch/nds32/include/asm/u-boot-nds32.h | 8 +- arch/nds32/lib/board.c | 2 +- arch/nios2/cpu/start.S | 6 +- arch/nios2/cpu/u-boot.lds | 2 +- arch/nios2/include/asm/sections.h | 27 + arch/openrisc/include/asm/sections.h | 27 + arch/powerpc/config.mk | 3 + arch/powerpc/cpu/74xx_7xx/start.S | 4 +- arch/powerpc/cpu/74xx_7xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc512x/start.S | 4 +- arch/powerpc/cpu/mpc512x/u-boot.lds | 2 +- arch/powerpc/cpu/mpc5xx/start.S | 4 +- arch/powerpc/cpu/mpc5xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc5xxx/spl_boot.c | 2 +- arch/powerpc/cpu/mpc5xxx/start.S | 4 +- arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds | 2 +- arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds | 2 +- arch/powerpc/cpu/mpc5xxx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc8220/start.S | 4 +- arch/powerpc/cpu/mpc8220/u-boot.lds | 2 +- arch/powerpc/cpu/mpc824x/start.S | 4 +- arch/powerpc/cpu/mpc824x/u-boot.lds | 2 +- arch/powerpc/cpu/mpc8260/start.S | 4 +- arch/powerpc/cpu/mpc8260/u-boot.lds | 2 +- arch/powerpc/cpu/mpc83xx/start.S | 4 +- arch/powerpc/cpu/mpc83xx/u-boot-spl.lds | 4 +- arch/powerpc/cpu/mpc83xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc85xx/start.S | 4 +- arch/powerpc/cpu/mpc85xx/u-boot-nand.lds | 2 +- arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds | 2 +- arch/powerpc/cpu/mpc85xx/u-boot-spl.lds | 2 +- arch/powerpc/cpu/mpc85xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc86xx/start.S | 4 +- arch/powerpc/cpu/mpc86xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc8xx/start.S | 4 +- arch/powerpc/cpu/ppc4xx/start.S | 4 +- arch/powerpc/cpu/ppc4xx/u-boot.lds | 2 +- arch/powerpc/include/asm/sections.h | 27 + arch/powerpc/include/asm/spl.h | 2 +- arch/powerpc/include/asm/u-boot.h | 7 + arch/powerpc/lib/Makefile | 2 + arch/powerpc/lib/board.c | 18 +- arch/sandbox/include/asm/sections.h | 2 + arch/sh/cpu/sh2/u-boot.lds | 2 +- arch/sh/cpu/sh3/u-boot.lds | 2 +- arch/sh/cpu/sh4/u-boot.lds | 2 +- arch/sh/include/asm/sections.h | 27 + arch/sh/lib/board.c | 1 + arch/sparc/cpu/leon2/Makefile | 7 - arch/sparc/cpu/leon2/serial.c | 10 - arch/sparc/cpu/leon3/Makefile | 7 - arch/sparc/cpu/leon3/serial.c | 10 - arch/sparc/include/asm/sections.h | 27 + arch/x86/config.mk | 3 + arch/x86/cpu/coreboot/sdram.c | 1 + arch/x86/cpu/u-boot.lds | 4 +- arch/x86/include/asm/config.h | 1 + arch/x86/include/asm/sections.h | 27 + arch/x86/include/asm/u-boot-x86.h | 9 - arch/x86/include/asm/u-boot.h | 11 + arch/x86/lib/Makefile | 3 + arch/x86/lib/board.c | 3 +- arch/x86/lib/init_helpers.c | 3 +- arch/x86/lib/relocate.c | 9 +- board/BuS/eb_cpu5282/u-boot.lds | 2 +- board/LEOX/elpt860/u-boot.lds | 2 +- board/RPXClassic/u-boot.lds | 2 +- board/RPXlite/u-boot.lds | 2 +- board/RPXlite_dw/u-boot.lds | 2 +- board/RRvision/u-boot.lds | 2 +- board/actux1/u-boot.lds | 2 +- board/actux2/u-boot.lds | 2 +- board/actux3/u-boot.lds | 2 +- board/adder/u-boot.lds | 2 +- board/ait/cam_enc_4xx/u-boot-spl.lds | 2 +- board/altera/nios2-generic/u-boot.lds | 2 +- board/amcc/acadia/u-boot-nand.lds | 2 +- board/amcc/bamboo/u-boot-nand.lds | 2 +- board/amcc/canyonlands/u-boot-nand.lds | 2 +- board/amcc/kilauea/u-boot-nand.lds | 2 +- board/amcc/sequoia/u-boot-nand.lds | 2 +- board/amcc/sequoia/u-boot-ram.lds | 2 +- board/astro/mcf5373l/u-boot.lds | 2 +- board/cm4008/flash.c | 1 + board/cm41xx/flash.c | 1 + board/cobra5272/u-boot.lds | 2 +- board/cogent/u-boot.lds | 2 +- board/dave/PPChameleonEVB/u-boot.lds | 2 +- board/davinci/da8xxevm/u-boot-spl-da850evm.lds | 2 +- board/davinci/da8xxevm/u-boot-spl-hawk.lds | 2 +- board/dvlhost/u-boot.lds | 2 +- board/eltec/mhpc/u-boot.lds | 2 +- board/emk/top860/u-boot.lds | 2 +- board/ep88x/u-boot.lds | 2 +- board/esd/dasa_sim/u-boot.lds | 2 +- board/esd/pmc440/u-boot-nand.lds | 2 +- board/esd/tasreg/u-boot.lds | 2 +- board/esteem192e/u-boot.lds | 2 +- board/evb64260/u-boot.lds | 2 +- board/fads/u-boot.lds | 2 +- board/flagadm/u-boot.lds | 2 +- board/freescale/m5208evbe/u-boot.lds | 2 +- board/freescale/m52277evb/u-boot.lds | 2 +- board/freescale/m5235evb/u-boot.lds | 2 +- board/freescale/m5249evb/u-boot.lds | 2 +- board/freescale/m5253demo/u-boot.lds | 2 +- board/freescale/m5253evbe/u-boot.lds | 2 +- board/freescale/m5271evb/u-boot.lds | 2 +- board/freescale/m5272c3/u-boot.lds | 2 +- board/freescale/m5275evb/u-boot.lds | 2 +- board/freescale/m5282evb/u-boot.lds | 2 +- board/freescale/m53017evb/u-boot.lds | 2 +- board/freescale/m5329evb/u-boot.lds | 2 +- board/freescale/m5373evb/u-boot.lds | 2 +- board/freescale/m54418twr/u-boot.lds | 2 +- board/freescale/m54451evb/u-boot.lds | 2 +- board/freescale/m54455evb/u-boot.lds | 2 +- board/freescale/m547xevb/u-boot.lds | 2 +- board/freescale/m548xevb/u-boot.lds | 2 +- board/freescale/mx31ads/u-boot.lds | 2 +- board/gaisler/gr_cpci_ax2000/u-boot.lds | 2 +- board/gaisler/gr_ep2s60/u-boot.lds | 2 +- board/gaisler/gr_xc3s_1500/u-boot.lds | 2 +- board/gaisler/grsim/u-boot.lds | 2 +- board/gaisler/grsim_leon2/u-boot.lds | 2 +- board/gen860t/u-boot-flashenv.lds | 2 +- board/gen860t/u-boot.lds | 2 +- board/genietv/u-boot.lds | 2 +- board/hermes/u-boot.lds | 2 +- board/hymod/u-boot.lds | 2 +- board/icu862/u-boot.lds | 2 +- board/idmr/u-boot.lds | 2 +- board/ip860/u-boot.lds | 2 +- board/ivm/u-boot.lds | 2 +- board/korat/u-boot-F7FC.lds | 2 +- board/kup/kup4k/u-boot.lds | 2 +- board/kup/kup4x/u-boot.lds | 2 +- board/lwmon/u-boot.lds | 2 +- board/manroland/uc100/u-boot.lds | 2 +- board/matrix_vision/mvsmr/u-boot.lds | 2 +- board/mbx8xx/u-boot.lds | 2 +- board/mousse/u-boot.lds | 2 +- board/mvblue/u-boot.lds | 2 +- board/netphone/u-boot.lds | 2 +- board/netta/u-boot.lds | 2 +- board/netta2/u-boot.lds | 2 +- board/netvia/u-boot.lds | 2 +- board/nx823/u-boot.lds | 2 +- board/quantum/u-boot.lds | 2 +- board/r360mpi/u-boot.lds | 2 +- board/rbc823/u-boot.lds | 2 +- board/renesas/sh7752evb/u-boot.lds | 2 +- board/renesas/sh7757lcr/u-boot.lds | 2 +- board/rsdproto/u-boot.lds | 2 +- board/samsung/smdk5250/smdk5250-uboot-spl.lds | 2 +- board/samsung/smdk6400/u-boot-nand.lds | 2 +- board/sandpoint/u-boot.lds | 2 +- board/sixnet/u-boot.lds | 2 +- board/snmc/qs850/u-boot.lds | 2 +- board/snmc/qs860t/u-boot.lds | 2 +- board/spc1920/u-boot.lds | 2 +- board/spd8xx/u-boot.lds | 2 +- board/stx/stxxtc/u-boot.lds | 2 +- board/svm_sc8xx/u-boot.lds | 2 +- board/tqc/tqm8xx/u-boot.lds | 2 +- board/v37/u-boot.lds | 2 +- board/vpac270/u-boot-spl.lds | 2 +- board/woodburn/woodburn.c | 2 +- common/Makefile | 4 + common/board_f.c | 1016 +++++++++++++++++++++++++++++ common/board_r.c | 919 ++++++++++++++++++++++++++ config.mk | 8 + drivers/serial/ns16550.c | 2 +- examples/standalone/stubs.c | 7 +- include/asm-generic/global_data.h | 4 +- include/asm-generic/sections.h | 117 ++++ include/asm-generic/u-boot.h | 162 +++++ include/common.h | 2 + include/configs/exynos5250-dt.h | 1 + include/configs/km/keymile-common.h | 4 - include/configs/km/km-powerpc.h | 4 + include/configs/tegra-common.h | 2 + include/ide.h | 7 + include/initcall.h | 25 + include/watchdog.h | 18 + lib/Makefile | 1 + lib/initcall.c | 39 ++ nand_spl/board/amcc/acadia/u-boot.lds | 2 +- nand_spl/board/amcc/bamboo/u-boot.lds | 2 +- nand_spl/board/amcc/canyonlands/u-boot.lds | 2 +- nand_spl/board/amcc/kilauea/u-boot.lds | 2 +- nand_spl/board/amcc/sequoia/u-boot.lds | 2 +- nand_spl/board/freescale/mpc8315erdb/u-boot.lds | 4 +- nand_spl/board/freescale/mx31pdk/u-boot.lds | 2 +- nand_spl/board/karo/tx25/u-boot.lds | 2 +- nand_spl/board/samsung/smdk6400/u-boot.lds | 2 +- nand_spl/board/sheldon/simpc8313/u-boot.lds | 4 +- 246 files changed, 2958 insertions(+), 294 deletions(-) create mode 100644 arch/arm/include/asm/sections.h create mode 100644 arch/blackfin/include/asm/sections.h create mode 100644 arch/m68k/include/asm/sections.h create mode 100644 arch/microblaze/include/asm/sections.h create mode 100644 arch/mips/include/asm/sections.h create mode 100644 arch/nds32/include/asm/sections.h create mode 100644 arch/nios2/include/asm/sections.h create mode 100644 arch/openrisc/include/asm/sections.h create mode 100644 arch/powerpc/include/asm/sections.h create mode 100644 arch/sh/include/asm/sections.h create mode 100644 arch/sparc/include/asm/sections.h create mode 100644 arch/x86/include/asm/sections.h create mode 100644 common/board_f.c create mode 100644 common/board_r.c create mode 100644 include/asm-generic/sections.h create mode 100644 include/asm-generic/u-boot.h create mode 100644 include/initcall.h create mode 100644 lib/initcall.c Regards, Simon ^ permalink raw reply [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC [not found] <1363021453-6566-1-git-send-email-sjg@chromium.org> 2013-03-11 17:50 ` Simon Glass @ 2013-03-13 3:52 ` Simon Glass 2013-03-13 13:16 ` Andreas Bießmann 1 sibling, 1 reply; 13+ messages in thread From: Simon Glass @ 2013-03-13 3:52 UTC (permalink / raw) To: u-boot Hi, On Mon, Mar 11, 2013 at 10:03 AM, Simon Glass <sjg@chromium.org> wrote: > This series creates a generic board init implementation which contains > the essential functions of the major arch/xxx/lib/board.c files. It is > split into two parts: board_f.c for pre-relocation and board_r.c for > post-relocation. I forgot to mention that if anyone wants to try this out on their board, the tree is at http://git.denx.de/u-boot-x86.git branch 'us-board-v11' Regards, Simon ^ permalink raw reply [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC 2013-03-13 3:52 ` Simon Glass @ 2013-03-13 13:16 ` Andreas Bießmann 2013-03-13 16:25 ` Tom Rini 0 siblings, 1 reply; 13+ messages in thread From: Andreas Bießmann @ 2013-03-13 13:16 UTC (permalink / raw) To: u-boot Hi Simon, On 03/13/2013 04:52 AM, Simon Glass wrote: > Hi, > > On Mon, Mar 11, 2013 at 10:03 AM, Simon Glass <sjg@chromium.org> wrote: >> This series creates a generic board init implementation which contains >> the essential functions of the major arch/xxx/lib/board.c files. It is >> split into two parts: board_f.c for pre-relocation and board_r.c for >> post-relocation. I tested the whole series on avr32. The minor changes there do not break runtime behaviour, therefore Tested-by: Andreas Bie?mann <andreas.biessmann@googlemail.com> Will this series be applied for upcomming release? I'm asking cause of http://patchwork.ozlabs.org/patch/225225/ vs http://patchwork.ozlabs.org/patch/220413/ Best regards Andreas Bie?mann ^ permalink raw reply [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC 2013-03-13 13:16 ` Andreas Bießmann @ 2013-03-13 16:25 ` Tom Rini 2013-03-13 22:20 ` Simon Glass 0 siblings, 1 reply; 13+ messages in thread From: Tom Rini @ 2013-03-13 16:25 UTC (permalink / raw) To: u-boot On Wed, Mar 13, 2013 at 02:16:23PM +0100, Andreas Bie?mann wrote: > Hi Simon, > > On 03/13/2013 04:52 AM, Simon Glass wrote: > > Hi, > > > > On Mon, Mar 11, 2013 at 10:03 AM, Simon Glass <sjg@chromium.org> wrote: > >> This series creates a generic board init implementation which contains > >> the essential functions of the major arch/xxx/lib/board.c files. It is > >> split into two parts: board_f.c for pre-relocation and board_r.c for > >> post-relocation. > > I tested the whole series on avr32. The minor changes there do not break > runtime behaviour, therefore > > Tested-by: Andreas Bie?mann <andreas.biessmann@googlemail.com> > > Will this series be applied for upcomming release? I'm asking cause of Seeing as there's Wolfgang's tested/ack yes, this is quite likely to go in. Need to review it all again myself to be sure. Simon, can you please make a patchwork bundle out of it as well so I can be sure all of the patches are updated right (ie we have the old ones cleared out and the new ones assigned to me). Thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130313/1c2a557e/attachment.pgp> ^ permalink raw reply [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC 2013-03-13 16:25 ` Tom Rini @ 2013-03-13 22:20 ` Simon Glass 2013-03-14 17:42 ` Simon Glass 0 siblings, 1 reply; 13+ messages in thread From: Simon Glass @ 2013-03-13 22:20 UTC (permalink / raw) To: u-boot Hi Tom, On Wed, Mar 13, 2013 at 9:25 AM, Tom Rini <trini@ti.com> wrote: > On Wed, Mar 13, 2013 at 02:16:23PM +0100, Andreas Bie?mann wrote: >> Hi Simon, >> >> On 03/13/2013 04:52 AM, Simon Glass wrote: >> > Hi, >> > >> > On Mon, Mar 11, 2013 at 10:03 AM, Simon Glass <sjg@chromium.org> wrote: >> >> This series creates a generic board init implementation which contains >> >> the essential functions of the major arch/xxx/lib/board.c files. It is >> >> split into two parts: board_f.c for pre-relocation and board_r.c for >> >> post-relocation. >> >> I tested the whole series on avr32. The minor changes there do not break >> runtime behaviour, therefore >> >> Tested-by: Andreas Bie?mann <andreas.biessmann@googlemail.com> >> >> Will this series be applied for upcomming release? I'm asking cause of > > Seeing as there's Wolfgang's tested/ack yes, this is quite likely to go > in. Need to review it all again myself to be sure. Simon, can you > please make a patchwork bundle out of it as well so I can be sure all of > the patches are updated right (ie we have the old ones cleared out > and the new ones assigned to me). Thanks! I found that one patch (2/31) needed a rev due to a recent change. I resent this so it should hit patchwork soon. I did create a bundle but things were in the wrong order, so I will try again when that happens. In the meantime there is a tree at u-boot-x86.git branch us-board-v11, and I can do a pull request if you like. Regards, Simon > > -- > Tom ^ permalink raw reply [flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC 2013-03-13 22:20 ` Simon Glass @ 2013-03-14 17:42 ` Simon Glass 0 siblings, 0 replies; 13+ messages in thread From: Simon Glass @ 2013-03-14 17:42 UTC (permalink / raw) To: u-boot Hi Tom, On Wed, Mar 13, 2013 at 3:20 PM, Simon Glass <sjg@chromium.org> wrote: > Hi Tom, > > On Wed, Mar 13, 2013 at 9:25 AM, Tom Rini <trini@ti.com> wrote: >> On Wed, Mar 13, 2013 at 02:16:23PM +0100, Andreas Bie?mann wrote: >>> Hi Simon, >>> >>> On 03/13/2013 04:52 AM, Simon Glass wrote: >>> > Hi, >>> > >>> > On Mon, Mar 11, 2013 at 10:03 AM, Simon Glass <sjg@chromium.org> wrote: >>> >> This series creates a generic board init implementation which contains >>> >> the essential functions of the major arch/xxx/lib/board.c files. It is >>> >> split into two parts: board_f.c for pre-relocation and board_r.c for >>> >> post-relocation. >>> >>> I tested the whole series on avr32. The minor changes there do not break >>> runtime behaviour, therefore >>> >>> Tested-by: Andreas Bie?mann <andreas.biessmann@googlemail.com> >>> >>> Will this series be applied for upcomming release? I'm asking cause of >> >> Seeing as there's Wolfgang's tested/ack yes, this is quite likely to go >> in. Need to review it all again myself to be sure. Simon, can you >> please make a patchwork bundle out of it as well so I can be sure all of >> the patches are updated right (ie we have the old ones cleared out >> and the new ones assigned to me). Thanks! > > I found that one patch (2/31) needed a rev due to a recent change. I > resent this so it should hit patchwork soon. > > I did create a bundle but things were in the wrong order, so I will > try again when that happens. > > In the meantime there is a tree at u-boot-x86.git branch us-board-v11, > and I can do a pull request if you like. Please see the patchwork bundle here: http://patchwork.ozlabs.org/bundle/sjg/us-board/ I had to rebase one of the patches and resend to the mailing this. But I just tried this bundle and it applied cleanly to master for me. Regards, Simon > > Regards, > Simon > >> >> -- >> Tom ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2013-03-30 21:34 UTC | newest] Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <1363020460-14307-1-git-send-email-sjg@chromium.org> 2013-03-11 16:49 ` [U-Boot] [PATCH v9 09/31] Introduce generic pre-relocation board_f.c Simon Glass 2013-03-11 16:49 ` [U-Boot] [PATCH v9 13/31] arm: Enable generic board support Simon Glass 2013-03-11 16:50 ` [U-Boot] [PATCH v9 17/31] ppc: " Simon Glass 2013-03-11 16:50 ` [U-Boot] [PATCH v9 21/31] x86: " Simon Glass 2013-03-13 8:46 ` [U-Boot] [PATCH v9 0/31] Create generic board init for ARM, x86, PPC Wolfgang Denk 2013-03-15 22:23 ` Tom Rini 2013-03-30 21:34 ` Simon Glass [not found] <1363021453-6566-1-git-send-email-sjg@chromium.org> 2013-03-11 17:50 ` Simon Glass 2013-03-13 3:52 ` Simon Glass 2013-03-13 13:16 ` Andreas Bießmann 2013-03-13 16:25 ` Tom Rini 2013-03-13 22:20 ` Simon Glass 2013-03-14 17:42 ` Simon Glass
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.