[U-Boot] [PATCH 00/13] x86: Various Patches
This is a patch-series I intend to apply to the x86 repository ready for the next merge window. Patches 1 & 2 are fixes for build breakages caused by non-x86 mainline patches Patch 3 fixes a cold-boot breakage Patch 4 removes unmaintained boards Patch 5 Is a trivial change suggested by Heiko Schocher The remaining patches are fairly innocuous ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 01/13] x86: Fix do_go_exec() - const argv[]
Commit 54841ab50c20d6fa6c9cc3eb826989da3a22d934 made the argv parameter to do_go_exec() const but did not allow for the fact that argv[-1] is set to point to the global data structure and relies on argv being non- const. With this patch, do_go_exec() creates a new copy of the argv array with an extra element to store global data pointer rather than simply clobbering an arbitrary memory location. Signed-off-by: Graeme Russ --- arch/i386/lib/board.c | 25 - 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/arch/i386/lib/board.c b/arch/i386/lib/board.c index 684cdb8..93f910b 100644 --- a/arch/i386/lib/board.c +++ b/arch/i386/lib/board.c @@ -431,15 +431,30 @@ void hang (void) for (;;); } -unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char * const argv[]) +unsigned long do_go_exec (ulong (*entry)(int, char * const []), int argc, char * const argv[]) { + unsigned long ret = 0; + char **argv_tmp; + /* -* x86 does not use a dedicated register to pass the pointer -* to the global_data +* x86 does not use a dedicated register to pass the pointer to +* the global_data, so it is instead passed as argv[-1]. By using +* argv[-1], the called 'Application' can use the contents of +* argv natively. However, to safely use argv[-1] a new copy of +* argv is needed with the extra element */ - argv[-1] = (char *)gd; + argv_tmp = malloc(sizeof(char *) * (argc + 1)); + + if (argv_tmp) { + argv_tmp[0] = (char *)gd; + + memcpy(&argv_tmp[1], argv, (size_t)(sizeof(char *) * argc)); + + ret = (entry) (argc, &argv_tmp[1]); + free(argv_tmp); + } - return (entry) (argc, argv); + return ret; } void setup_pcat_compatibility(void) -- 1.7.1.422.g049e9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 02/13] x86: Add do_bdinfo()
x86 failed to compile with a message "a case for this architecture does not exist!" - Add do_bdinfo() for this arch Signed-off-by: Graeme Russ --- common/cmd_bdinfo.c | 48 +--- 1 files changed, 45 insertions(+), 3 deletions(-) diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index fbe73f1..fd6a58c 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -35,7 +35,7 @@ static void print_num(const char *, ulong); static void print_eth(int idx); #endif -#ifndef CONFIG_ARM /* PowerPC and other */ +#if (!defined(CONFIG_ARM) && !defined(CONFIG_X86)) static void print_lnum(const char *, u64); #endif @@ -348,6 +348,45 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } +#elif defined(CONFIG_X86) + +static void print_str(const char *, const char *); + +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + int i; + bd_t *bd = gd->bd; + char buf[32]; + + print_num ("env_t", (ulong)bd->bi_env); + print_num ("boot_params", (ulong)bd->bi_boot_params); + print_num ("bi_memstart", bd->bi_memstart); + print_num ("bi_memsize",bd->bi_memsize); + print_num ("bi_flashstart", bd->bi_flashstart); + print_num ("bi_flashsize", bd->bi_flashsize); + print_num ("bi_flashoffset",bd->bi_flashoffset); + print_num ("bi_sramstart", bd->bi_sramstart); + print_num ("bi_sramsize", bd->bi_sramsize); + print_num ("bi_bootflags", bd->bi_bootflags); + print_str ("cpufreq", strmhz(buf, bd->bi_intfreq)); + print_str ("busfreq", strmhz(buf, bd->bi_busfreq)); + + for (i=0; i start", bd->bi_dram[i].start); + print_num("-> size",bd->bi_dram[i].size); + } + +#if defined(CONFIG_CMD_NET) + print_eth(0); + printf ("ip_addr = %pI4\n", &bd->bi_ip_addr); + print_str ("ethspeed", strmhz(buf, bd->bi_ethspeed)); +#endif + printf ("baudrate= %d bps\n", bd->bi_baudrate); + + return 0; +} + #else #error "a case for this architecture does not exist!" #endif @@ -372,14 +411,17 @@ static void print_eth(int idx) } #endif -#ifndef CONFIG_ARM +#if (!defined(CONFIG_ARM) && !defined(CONFIG_X86)) static void print_lnum(const char *name, u64 value) { printf ("%-12s= 0x%.8llX\n", name, value); } #endif -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_BLACKFIN) +#if defined(CONFIG_PPC) || \ +defined(CONFIG_M68K) || \ +defined(CONFIG_BLACKFIN) || \ +defined(CONFIG_X86) static void print_str(const char *name, const char *str) { printf ("%-12s= %6s MHz\n", name, str); -- 1.7.1.422.g049e9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 03/13] x86: Fix x86 Cold Boot
Commit 077e1958ca4afe12d88043b123ded058c51b89f7 broke the ability of the x86 port to boot from a cold-reset by removing the initial IDT. Re- instate the initial IDT to allow cold-booting of x86 boards Signed-off-by: Graeme Russ --- arch/i386/cpu/start16.S |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/i386/cpu/start16.S b/arch/i386/cpu/start16.S index 3e8b2cc..ebe5835 100644 --- a/arch/i386/cpu/start16.S +++ b/arch/i386/cpu/start16.S @@ -45,6 +45,7 @@ board_init16_ret: wbinvd /* load the temporary Global Descriptor Table */ +o32 cs lidtidt_ptr o32 cs lgdtgdt_ptr /* Now, we enter protected mode */ @@ -68,6 +69,10 @@ code32start: .long _start /* offset */ .word 0x10/* segment */ +idt_ptr: + .word 0 /* limit */ + .long 0 /* base */ + /* * The following Global Descriptor Table is just enough to get us into * 'Flat Protected Mode' - It will be discarded as soon as the final -- 1.7.1.422.g049e9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 06/13] x86: Use TEXT_BASE in linker scripts
Use TEXT_BASE rather than a hard-coded base address on x86 linker scripts. This will allow any board to define its base link address without having to modify the linker script Signed-off-by: Graeme Russ --- board/eNET/u-boot.lds |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/board/eNET/u-boot.lds b/board/eNET/u-boot.lds index 7b0ffaa..d78d75f 100644 --- a/board/eNET/u-boot.lds +++ b/board/eNET/u-boot.lds @@ -27,7 +27,7 @@ ENTRY(_start) SECTIONS { - . = 0x0600; /* Location of bootcode in flash */ + . = TEXT_BASE; /* Location of bootcode in flash */ _i386boot_text_start = .; .text : { *(.text); } @@ -98,12 +98,12 @@ SECTIONS * The fff0 offset of resetvec is important, however. */ . = 0xfe00; - .start32 : AT (0x0603fe00) { *(.start32); } + .start32 : AT (TEXT_BASE + 0x3fe00) { *(.start32); } . = 0xf800; - .start16 : AT (0x0603f800) { *(.start16); } + .start16 : AT (TEXT_BASE + 0x3f800) { *(.start16); } . = 0xfff0; - .resetvec : AT (0x0603fff0) { *(.resetvec); } + .resetvec : AT (TEXT_BASE + 0x3fff0) { *(.resetvec); } _i386boot_end = (LOADADDR(.resetvec) + SIZEOF(.resetvec) ); } -- 1.7.1.422.g049e9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 08/13] x86: use gc sections to reduce image size
Follow the discussion of Charles Manning and Mike Frysinger. Using gc_sections helps reduce image size. Signed-off-by: Graeme Russ --- arch/i386/config.mk |3 +++ board/eNET/u-boot.lds | 10 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/i386/config.mk b/arch/i386/config.mk index 4b990e0..0e80a1ae 100644 --- a/arch/i386/config.mk +++ b/arch/i386/config.mk @@ -26,3 +26,6 @@ CROSS_COMPILE ?= i386-linux- STANDALONE_LOAD_ADDR = 0x4 PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__ + +LDFLAGS += --cref --gc-sections +PLATFORM_RELFLAGS += -ffunction-sections diff --git a/board/eNET/u-boot.lds b/board/eNET/u-boot.lds index d78d75f..7b211a8 100644 --- a/board/eNET/u-boot.lds +++ b/board/eNET/u-boot.lds @@ -77,13 +77,13 @@ SECTIONS _i386boot_bss_size = SIZEOF(.bss); /* 16bit realmode trampoline code */ - .realmode 0x7c0 : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) { *(.realmode) } + .realmode 0x7c0 : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) { KEEP(*(.realmode)) } _i386boot_realmode = LOADADDR(.realmode); _i386boot_realmode_size = SIZEOF(.realmode); /* 16bit BIOS emulation code (just enough to boot Linux) */ - .bios 0 : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) { *(.bios) } + .bios 0 : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) { KEEP(*(.bios)) } _i386boot_bios = LOADADDR(.bios); _i386boot_bios_size = SIZEOF(.bios); @@ -98,12 +98,12 @@ SECTIONS * The fff0 offset of resetvec is important, however. */ . = 0xfe00; - .start32 : AT (TEXT_BASE + 0x3fe00) { *(.start32); } + .start32 : AT (TEXT_BASE + 0x3fe00) { KEEP(*(.start32)); } . = 0xf800; - .start16 : AT (TEXT_BASE + 0x3f800) { *(.start16); } + .start16 : AT (TEXT_BASE + 0x3f800) { KEEP(*(.start16)); } . = 0xfff0; - .resetvec : AT (TEXT_BASE + 0x3fff0) { *(.resetvec); } + .resetvec : AT (TEXT_BASE + 0x3fff0) { KEEP(*(.resetvec)); } _i386boot_end = (LOADADDR(.resetvec) + SIZEOF(.resetvec) ); } -- 1.7.1.422.g049e9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 09/13] x86: Move loading of GTD to C code
Linux has C macros and code to load the GTD after switching to Protected Mode. Using these greatly simplifies the assembler code Signed-off-by: Graeme Russ --- arch/i386/cpu/cpu.c | 57 + arch/i386/cpu/start.S | 96 - 2 files changed, 57 insertions(+), 96 deletions(-) diff --git a/arch/i386/cpu/cpu.c b/arch/i386/cpu/cpu.c index bd6aced..ae40384 100644 --- a/arch/i386/cpu/cpu.c +++ b/arch/i386/cpu/cpu.c @@ -37,6 +37,61 @@ #include #include +/* Constructor for a conventional segment GDT (or LDT) entry */ +/* This is a macro so it can be used in initializers */ +#define GDT_ENTRY(flags, base, limit) \ + base) & 0xff00ULL) << (56-24)) | \ +(((flags) & 0xf0ffULL) << 40) |\ +(((limit) & 0x000fULL) << (48-16)) | \ +(((base) & 0x00ffULL) << 16) |\ +(((limit) & 0xULL))) + +/* Simple and small GDT entries for booting only */ + +#define GDT_ENTRY_32BIT_CS 2 +#define GDT_ENTRY_32BIT_DS (GDT_ENTRY_32BIT_CS + 1) +#define GDT_ENTRY_16BIT_CS (GDT_ENTRY_32BIT_DS + 1) +#define GDT_ENTRY_16BIT_DS (GDT_ENTRY_16BIT_CS + 1) + +/* + * Set up the GDT + */ + +struct gdt_ptr { + u16 len; + u32 ptr; +} __attribute__((packed)); + +static void reload_gdt(void) +{ + /* There are machines which are known to not boot with the GDT + being 8-byte unaligned. Intel recommends 16 byte alignment. */ + static const u64 boot_gdt[] __attribute__((aligned(16))) = { + /* CS: code, read/execute, 4 GB, base 0 */ + [GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xf), + /* DS: data, read/write, 4 GB, base 0 */ + [GDT_ENTRY_32BIT_DS] = GDT_ENTRY(0xc093, 0, 0xf), + /* 16-bit CS: code, read/execute, 64 kB, base 0 */ + [GDT_ENTRY_16BIT_CS] = GDT_ENTRY(0x109b, 0, 0x0), + /* 16-bit DS: data, read/write, 64 kB, base 0 */ + [GDT_ENTRY_16BIT_DS] = GDT_ENTRY(0x1093, 0, 0x0), + }; + static struct gdt_ptr gdt; + + gdt.len = sizeof(boot_gdt)-1; + gdt.ptr = (u32)&boot_gdt; + + asm volatile("lgdtl %0\n" \ +"movl $((2+1)*8), %%ecx\n" \ +"movl %%ecx, %%ds\n" \ +"movl %%ecx, %%es\n" \ +"movl %%ecx, %%fs\n" \ +"movl %%ecx, %%gs\n" \ +"movl %%ecx, %%ss" \ +: : "m" (gdt) : "ecx"); +} + + int cpu_init_f(void) { /* initialize FPU, reset EM, set MP and NE */ @@ -51,6 +106,8 @@ int cpu_init_f(void) int cpu_init_r(void) { + reload_gdt(); + /* Initialize core interrupt and exception functionality of CPU */ cpu_init_interrupts (); return 0; diff --git a/arch/i386/cpu/start.S b/arch/i386/cpu/start.S index 7def8de..3cea04b 100644 --- a/arch/i386/cpu/start.S +++ b/arch/i386/cpu/start.S @@ -100,53 +100,6 @@ mem_init_ret: jmp get_mem_size get_mem_size_ret: - /* -* We are now in 'Flat Protected Mode' and we know how much memory -* the board has. The (temporary) Global Descriptor Table is not -* in a 'Safe' place (it is either in Flash which can be erased or -* reprogrammed or in a fail-safe boot-strap image which could be -* over-written). -* -* Move the final gdt to a safe place (top of RAM) and load it. -* This is not a trivial excercise - the lgdt instruction does not -* have a register operand (memory only) and we may well be -* running from Flash, so self modifying code will not work here. -* To overcome this, we copy a stub into upper memory along with -* the GDT. -*/ - - /* Reduce upper memory limit by (Stub + GDT Pointer + GDT) */ - subl$(end_gdt_setup - start_gdt_setup), %eax - - /* Copy the GDT and Stub */ - movl$start_gdt_setup, %esi - movl%eax, %edi - movl$(end_gdt_setup - start_gdt_setup), %ecx - shrl$2, %ecx - cld - rep movsl - - /* write the lgdt 'parameter' */ - subl$(jmp_instr - start_gdt_setup - 4), %ebp - addl%eax, %ebp - movl$(gdt_ptr - start_gdt_setup), %ebx - addl%eax, %ebx - movl%ebx, (%ebp) - - /* write the gdt address into the pointer */ - movl$(gdt_addr - start_gdt_setup), %ebp - addl%eax, %ebp - movl$(gdt - start_gdt_setup), %ebx - addl%eax, %ebx - movl%ebx, (%ebp) - - /* Save the return address */ - movl$load_gdt_ret, %ebp - - /* Load the new (safe) Global Descriptor Table */ - jmp *%eax - -load_gdt_ret: /* Check we have enough memory for stack */ movl$CONFIG_SYS_STACK_SIZE, %ecx cmpl%ecx, %eax @
[U-Boot] [PATCH 11/13] eNET: Add eNET_RAM_config
This patch allows configuration of the eNET board for generation of a U-Boot image which can be loaded into RAM (using tftp for example). Executing the image loaded into RAM is very similar to a cold-boot (the image is relocated to upper memory etc). This allows very rapid development and testing of new features without needing to burn Boot-ROMs Signed-off-by: Graeme Russ --- Makefile | 12 board/eNET/config.mk |7 ++- boards.cfg |1 - 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4f1cb1b..972c6aa 100644 --- a/Makefile +++ b/Makefile @@ -2428,6 +2428,18 @@ espt_config : unconfig @echo "#define CONFIG_ESPT 1" > $(obj)include/config.h @$(MKCONFIG) -a $@ sh sh4 espt +# +# x86 +# +eNET_config\ +eNET_RAM_config: unconfig + @if [ "$(findstring RAM,$@)" ]; then \ + echo "TEXT_BASE = 0x0600" > $(obj)board/eNET/config.tmp; \ + else \ + echo "TEXT_BASE = 0x3804" > $(obj)board/eNET/config.tmp; \ + fi + @$(MKCONFIG) eNET i386 i386 eNET - sc520 + # # diff --git a/board/eNET/config.mk b/board/eNET/config.mk index 63a58fd..2c0b514 100644 --- a/board/eNET/config.mk +++ b/board/eNET/config.mk @@ -21,7 +21,12 @@ # MA 02111-1307 USA # -TEXT_BASE = 0x0600 +sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp + +ifndef TEXT_BASE + TEXT_BASE = 0x3804 +endif + CFLAGS_common/dlmalloc.o += -Wa,--no-warn -fno-strict-aliasing PLATFORM_RELFLAGS += -fvisibility=hidden PLATFORM_CPPFLAGS += -fno-dwarf2-cfi-asm diff --git a/boards.cfg b/boards.cfg index fc2e67a..3f6d2040 100644 --- a/boards.cfg +++ b/boards.cfg @@ -70,7 +70,6 @@ gcplusarm sa1100 lart arm sa1100 shannonarm sa1100 mimc200avr32 at32ap - mimc at32ap700x -eNET i386i386- - sc520 idmr m68kmcf52x2 TASREG m68kmcf52x2 tasreg esd M5272C3m68kmcf52x2 m5272c3 freescale -- 1.7.1.422.g049e9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 13/13] x86: Add RTC support to eNET
The SC520 has an inbuilt MC146818 - Enable it for the eNET board Signed-off-by: Graeme Russ --- drivers/rtc/mc146818.c |6 ++ include/configs/eNET.h |2 ++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/rtc/mc146818.c b/drivers/rtc/mc146818.c index ac4eb6a..155034f 100644 --- a/drivers/rtc/mc146818.c +++ b/drivers/rtc/mc146818.c @@ -31,6 +31,12 @@ #include #include +#ifdef __I386__ +#include +#define in8(p) inb(p) +#define out8(p,v) outb(v,p) +#endif + #if defined(CONFIG_CMD_DATE) static uchar rtc_read (uchar reg); diff --git a/include/configs/eNET.h b/include/configs/eNET.h index 04321e1..ca130c3 100644 --- a/include/configs/eNET.h +++ b/include/configs/eNET.h @@ -33,6 +33,7 @@ * Stuff still to be dealt with - */ #define CONFIG_RTC_MC146818 +#define CONFIG_SYS_ISA_IO_BASE_ADDRESS 0 /* * High Level Configuration Options @@ -92,6 +93,7 @@ #define CONFIG_CMD_BDI /* bdinfo */ #define CONFIG_CMD_BOOTD /* bootd*/ #define CONFIG_CMD_CONSOLE /* coninfo */ +#define CONFIG_CMD_DATE #define CONFIG_CMD_ECHO/* echo arguments */ #define CONFIG_CMD_FLASH /* flinfo, erase, protect */ #define CONFIG_CMD_FPGA/* FPGA configuration Support */ -- 1.7.1.422.g049e9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 07/13] x86: zboot update
The header of recent Linux Kernels includes the size of the image, and therefore is not needed to be passed to zboot. Still process the third parameter (size of image) in the event that an older kernel is being loaded Signed-off-by: Graeme Russ --- arch/i386/lib/zimage.c | 18 +- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/i386/lib/zimage.c b/arch/i386/lib/zimage.c index 89fe015..f279b43 100644 --- a/arch/i386/lib/zimage.c +++ b/arch/i386/lib/zimage.c @@ -248,7 +248,8 @@ void boot_zimage(void *setup_base) int do_zboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { void *base_ptr; - void *bzImage_addr; + void *bzImage_addr = NULL; + char *s; ulong bzImage_size = 0; disable_interrupts(); @@ -256,10 +257,17 @@ int do_zboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* Setup board for maximum PC/AT Compatibility */ setup_pcat_compatibility(); - /* argv[1] holds the address of the bzImage */ - bzImage_addr = (void *)simple_strtoul(argv[1], NULL, 16); + if (argc >= 2) { + /* argv[1] holds the address of the bzImage */ + bzImage_addr = (void *)simple_strtoul(argv[1], NULL, 16); + } else { + s = getenv("fileaddr"); + if (s) + bzImage_addr = (void *)simple_strtoul(s, NULL, 16); + } - if (argc == 3) + if (argc >= 3) + /* argv[2] holds the size of the bzImage */ bzImage_size = simple_strtoul(argv[2], NULL, 16); /* Lets look for*/ @@ -282,7 +290,7 @@ int do_zboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } U_BOOT_CMD( - zboot, 3, 0,do_zboot, + zboot, 2, 0,do_zboot, "Boot bzImage", "" ); -- 1.7.1.422.g049e9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 10/13] x86: Coding Style Cleanup
Perform some basic code cleanups of the x86 files Signed-off-by: Graeme Russ --- arch/i386/cpu/sc520/sc520.c | 54 ++-- arch/i386/cpu/sc520/sc520_asm.S | 642 +++ arch/i386/cpu/start.S | 30 +- arch/i386/cpu/start16.S |9 +- 4 files changed, 362 insertions(+), 373 deletions(-) diff --git a/arch/i386/cpu/sc520/sc520.c b/arch/i386/cpu/sc520/sc520.c index 519bfd8..7acd471 100644 --- a/arch/i386/cpu/sc520/sc520.c +++ b/arch/i386/cpu/sc520/sc520.c @@ -41,7 +41,8 @@ volatile sc520_mmcr_t *sc520_mmcr = (sc520_mmcr_t *)0xfffef000; void init_sc520(void) { - /* Set the UARTxCTL register at it's slower, + /* +* Set the UARTxCTL register at it's slower, * baud clock giving us a 1.8432 MHz reference */ writeb(0x07, &sc520_mmcr->uart1ctl); @@ -50,25 +51,30 @@ void init_sc520(void) /* first set the timer pin mapping */ writeb(0x72, &sc520_mmcr->clksel); /* no clock frequency selected, use 1.1892MHz */ - /* enable PCI bus arbitrer */ - writeb(0x02, &sc520_mmcr->sysarbctl); /* enable concurrent mode */ + /* enable PCI bus arbiter (concurrent mode) */ + writeb(0x02, &sc520_mmcr->sysarbctl); - writeb(0x1f, &sc520_mmcr->sysarbmenb); /* enable external grants */ - writeb(0x04, &sc520_mmcr->hbctl); /* enable posted-writes */ + /* enable external grants */ + writeb(0x1f, &sc520_mmcr->sysarbmenb); + + /* enable posted-writes */ + writeb(0x04, &sc520_mmcr->hbctl); if (CONFIG_SYS_SC520_HIGH_SPEED) { - writeb(0x02, &sc520_mmcr->cpuctl); /* set it to 133 MHz and write back */ + /* set it to 133 MHz and write back */ + writeb(0x02, &sc520_mmcr->cpuctl); gd->cpu_clk = 13300; printf("## CPU Speed set to 133MHz\n"); } else { - writeb(0x01, &sc520_mmcr->cpuctl); /* set it to 100 MHz and write back */ + /* set it to 100 MHz and write back */ + writeb(0x01, &sc520_mmcr->cpuctl); printf("## CPU Speed set to 100MHz\n"); gd->cpu_clk = 1; } /* wait at least one millisecond */ - asm("movl $0x2000,%%ecx\n" + asm("movl $0x2000, %%ecx\n" "0: pushl %%ecx\n" "popl %%ecx\n" "loop 0b\n": : : "ecx"); @@ -107,15 +113,15 @@ unsigned long init_sc520_dram(void) /* set SDRAM speed here */ - refresh_rate/=78; - if (refresh_rate<=1) { - val = 0; /* 7.8us */ - } else if (refresh_rate==2) { - val = 1; /* 15.6us */ - } else if (refresh_rate==3 || refresh_rate==4) { - val = 2; /* 31.2us */ + refresh_rate /= 78; + if (refresh_rate <= 1) { + val = 0;/* 7.8us */ + } else if (refresh_rate == 2) { + val = 1;/* 15.6us */ + } else if (refresh_rate == 3 || refresh_rate == 4) { + val = 2;/* 31.2us */ } else { - val = 3; /* 62.4us */ + val = 3;/* 62.4us */ } tmp = (readb(&sc520_mmcr->drcctl) & 0xcf) | (val<<4); @@ -124,9 +130,9 @@ unsigned long init_sc520_dram(void) val = readb(&sc520_mmcr->drctmctl) & 0xf0; if (cas_precharge_delay==3) { - val |= 0x04; /* 3T */ + val |= 0x04;/* 3T */ } else if (cas_precharge_delay==4) { - val |= 0x08; /* 4T */ + val |= 0x08;/* 4T */ } else if (cas_precharge_delay>4) { val |= 0x0c; } @@ -139,8 +145,10 @@ unsigned long init_sc520_dram(void) writeb(val, &c520_mmcr->drctmctl); #endif - /* We read-back the configuration of the dram -* controller that the assembly code wrote */ + /* +* We read-back the configuration of the dram +* controller that the assembly code wrote +*/ dram_ctrl = readl(&sc520_mmcr->drcbendadr); bd->bi_dram[0].start = 0; @@ -148,7 +156,6 @@ unsigned long init_sc520_dram(void) /* bank 0 enabled */ dram_present = bd->bi_dram[1].start = (dram_ctrl & 0x7f) << 22; bd->bi_dram[0].size = bd->bi_dram[1].start; - } else { bd->bi_dram[0].size = 0; bd->bi_dram[1].start = bd->bi_dram[0].start; @@ -179,11 +186,6 @@ unsigned long init_sc520_dram(void) } else { bd->bi_dram[3].size = 0; } - - -#if 0 - printf("Configured %d bytes of dram\n", dram_present); -#endif gd->ram_size = dram_present; return dram_present; diff --git a/arch/i386/cpu/sc520/sc520_asm.S b/arch/i386/cpu/sc520/sc520_asm.S index fff56c0..7c2de31 100644 --- a/arch/i386/cpu/sc520/sc520_asm.S +++ b/arch/i386/cpu/sc520/s
[U-Boot] [PATCH 05/13] x86: Make CONFIG_RELOC_FIXUP_WORKS generic for all x86 boards
Relocation is not board-specific fir the x86 architectrure, so CONFIG_RELOC_FIXUP_WORKS can be defined globally in the common.h Signed-off-by: Graeme Russ --- arch/i386/include/asm/config.h |2 ++ include/configs/eNET.h |2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/i386/include/asm/config.h b/arch/i386/include/asm/config.h index 049c44e..1952de7 100644 --- a/arch/i386/include/asm/config.h +++ b/arch/i386/include/asm/config.h @@ -21,4 +21,6 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ +#define CONFIG_RELOC_FIXUP_WORKS + #endif diff --git a/include/configs/eNET.h b/include/configs/eNET.h index 361fe61..04321e1 100644 --- a/include/configs/eNET.h +++ b/include/configs/eNET.h @@ -29,8 +29,6 @@ #ifndef __CONFIG_H #define __CONFIG_H -#define CONFIG_RELOC_FIXUP_WORKS - /* * Stuff still to be dealt with - */ -- 1.7.1.422.g049e9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 12/13] eNET: Fix eNET Interrupt Setup for Linux
Fix minor issues with the configuration of the hardware interrupts for Linux when booting the eNET board Signed-off-by: Graeme Russ --- board/eNET/eNET.c | 15 +-- 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/board/eNET/eNET.c b/board/eNET/eNET.c index 7f0e257..700a31e 100644 --- a/board/eNET/eNET.c +++ b/board/eNET/eNET.c @@ -204,10 +204,18 @@ void setup_pcat_compatibility() */ writew(0x,&sc520_mmcr->intpinpol); - /* Set PIT 0 -> IRQ0, RTC -> IRQ8, FP error -> IRQ13 */ + /* +* PIT 0 -> IRQ0 +* RTC -> IRQ8 +* FP error -> IRQ13 +* UART1 -> IRQ4 +* UART2 -> IRQ3 +*/ writeb(SC520_IRQ0, &sc520_mmcr->pit_int_map[0]); writeb(SC520_IRQ8, &sc520_mmcr->rtcmap); writeb(SC520_IRQ13, &sc520_mmcr->ferrmap); + writeb(SC520_IRQ4, &sc520_mmcr->uart_int_map[0]); + writeb(SC520_IRQ3, &sc520_mmcr->uart_int_map[1]); /* Disable all other interrupt sources */ writeb(SC520_IRQ_DISABLED, &sc520_mmcr->gp_tmr_int_map[0]); @@ -215,11 +223,6 @@ void setup_pcat_compatibility() writeb(SC520_IRQ_DISABLED, &sc520_mmcr->gp_tmr_int_map[2]); writeb(SC520_IRQ_DISABLED, &sc520_mmcr->pit_int_map[1]); writeb(SC520_IRQ_DISABLED, &sc520_mmcr->pit_int_map[2]); - writeb(SC520_IRQ_DISABLED, &sc520_mmcr->pci_int_map[0]);/* disable PCI INT A */ - writeb(SC520_IRQ_DISABLED, &sc520_mmcr->pci_int_map[1]);/* disable PCI INT B */ - writeb(SC520_IRQ_DISABLED, &sc520_mmcr->pci_int_map[2]);/* disable PCI INT C */ - writeb(SC520_IRQ_DISABLED, &sc520_mmcr->pci_int_map[3]);/* disable PCI INT D */ - writeb(SC520_IRQ_DISABLED, &sc520_mmcr->dmabcintmap); /* disable DMA INT */ writeb(SC520_IRQ_DISABLED, &sc520_mmcr->ssimap); writeb(SC520_IRQ_DISABLED, &sc520_mmcr->wdtmap); writeb(SC520_IRQ_DISABLED, &sc520_mmcr->wpvmap); -- 1.7.1.422.g049e9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] u-boot-x86
On Sat, Aug 21, 2010 at 11:42:31AM +1000, Graeme Russ wrote: > It sounds like you might be looking at using U-Boot for booting a x86 > PC. If this is the case, maybe you should take a look at coreboot > (http://www.coreboot.org/) For what it's worth: we have a beginning of x86 support in Barebox (formerly known as U-Boot-v2): http://www.barebox.org It works ontop of the BIOS and can boot into a kernel which is in a raw partition on a BIOS-supported boot device. rsc -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] UEC: Don't udelay needlessly
Hi Joakim, On Wednesday, August 18, 2010, Joakim Tjernlund wrote: >> >> On Wed, 11 Aug 2010 11:44:21 +0200 >> Joakim Tjernlund wrote: >> >> > uec_init() adds an udelay(10) even though >> > the PHY status read went well, don't do that. >> > >> > Signed-off-by: Joakim Tjernlund >> > --- >> Acked-by: Kim Phillips >> >> Kim > > hmm, who gets this into the tree? > I'm just getting caught up, and will take this. Regards, Ben > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] [TESTING] da8xx: fixup ARM relocation support
Hello Ben, Ben Gardiner wrote: > Split the existing dram_init for da8xx when ARM reloc is enabled, like the > changes to arch/arm/cpu/arm926ejs/orion5x/dram.c in > 0f234d263b17ccf1b8fd776eb8c15b7cdb27a887 by Heiko Schocher . > > Without these changes gd->ram_size is '0' which leads to incorrect relocation > when CONFIG_SYS_ARM_WITHOUT_RELOC is defined and the board does not boot. > > We use get_ram_size to dynamically calculate the available RAM because it runs > on different board version with different ram, as suggested by Heiko in > private > communication. > > Tested on a da850evm with 128M of DDR2 installed; with both > CONFIG_SYS_ARM_WITHOUT_RELOC defined and undefined. > > Signed-off-by: Ben Gardiner > --- > This patch is submitted for the arm-reloc-and-cache-support branch of > git://git.denx.de/u-boot-testing.git > > V2: > * added Nori Sehkar to the to: list > * indicated for which branch of testing this patch is submitted. > > board/davinci/common/misc.c | 17 + > include/configs/da850evm.h |1 + > 2 files changed, 18 insertions(+), 0 deletions(-) > > diff --git a/board/davinci/common/misc.c b/board/davinci/common/misc.c > index 25ca326..e8acefe 100644 > --- a/board/davinci/common/misc.c > +++ b/board/davinci/common/misc.c > @@ -33,6 +33,7 @@ > > DECLARE_GLOBAL_DATA_PTR; > > +#if defined(CONFIG_SYS_ARM_WITHOUT_RELOC) > int dram_init(void) > { > gd->bd->bi_dram[0].start = PHYS_SDRAM_1; > @@ -40,6 +41,22 @@ int dram_init(void) > > return(0); > } > +#else > +int dram_init(void) > +{ > + /* dram_init must store complete ramsize in gd->ram_size */ > + gd->ram_size = get_ram_size( > + (volatile void *)CONFIG_SYS_SDRAM_BASE, > + CONFIG_MAX_RAM_BANK_SIZE); > + return(0); > +} > + > +void dram_init_banksize (void) > +{ > + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; > + gd->bd->bi_dram[0].size = gd->ram_size; > +} > +#endif > > #ifdef CONFIG_DRIVER_TI_EMAC > > diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h > index 016a21e..c929f6b 100644 > --- a/include/configs/da850evm.h > +++ b/include/configs/da850evm.h > @@ -47,6 +47,7 @@ > #define CONFIG_SYS_GBL_DATA_SIZE 128 /* reserved for initial data */ > #define PHYS_SDRAM_1 DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */ > #define PHYS_SDRAM_1_SIZE(64 << 20) /* SDRAM size 64MB */ > +#define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /*DDR2 Data region maximum size > from SPRS586*/ Line to long, please fix. > /* memtest start addr */ > #define CONFIG_SYS_MEMTEST_START (PHYS_SDRAM_1 + 0x200) bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] hmi1001, mucmc52, uc100, uc101: move boards to vendor directory
Hallo Wolfgang, Wolfgang Denk wrote: > Signed-off-by: Wolfgang Denk > Cc: Heiko Schocher > Cc: Stefan Roese > Cc: Roderik Wildenburg Acked-by: Heiko Schocher Thanks. bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Pull request: u-boot-i2c
Hello Wolfgang, The following changes since commit bd2313078114c4b44c4a5ce149af43bcb7fc8854: Wolfgang Denk (1): Merge branch 'master' of ssh://gemini/home/wd/git/u-boot/master are available in the git repository at: git://git.denx.de/u-boot-i2c.git master Nishanth Menon (3): i2c: omap2+: change header guard to be generic omap2: i2c: add syss offset omap2: i2c: remove redundant header definitions arch/arm/include/asm/arch-omap24xx/i2c.h | 110 +- drivers/i2c/omap24xx_i2c.h |4 +- 2 files changed, 5 insertions(+), 109 deletions(-) bye Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] samsung s3c2440 support
Dear Craig Nauman, On 20 August 2010 01:39, C Nauman wrote: > What is the status of support for the samsung s3c2440 in mainline u-boot? > > I have seen patches in the the mailing list archive from 2009 but they > don't appear to have been applied yet. > I remember that Kevin was working on it. But, Kevin didn't send next patch. Thanks Minkyu Kang -- from. prom. www.promsoft.net ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2 v2] ARMV7: S5P: make s5p-common for sharing the code between s5pc1xx and s5pc2xx
On 20 August 2010 14:11, Minkyu Kang wrote: > This patch adds basic support for s5pc210. > s5p-common will be used by all of s5p SoCs. > > Signed-off-by: Minkyu Kang > Signed-off-by: Kyungmin Park > --- > v2: no change > > Makefile | 7 + > arch/arm/cpu/armv7/s5p-common/Makefile | 46 +++ > arch/arm/cpu/armv7/s5p-common/cpu_info.c | 57 + > arch/arm/cpu/armv7/s5p-common/timer.c | 192 > ++ > arch/arm/cpu/armv7/s5pc1xx/Makefile | 2 - > arch/arm/cpu/armv7/s5pc1xx/cpu_info.c | 57 - > arch/arm/cpu/armv7/s5pc1xx/timer.c | 192 > -- > 7 files changed, 302 insertions(+), 251 deletions(-) > create mode 100644 arch/arm/cpu/armv7/s5p-common/Makefile > create mode 100644 arch/arm/cpu/armv7/s5p-common/cpu_info.c > create mode 100644 arch/arm/cpu/armv7/s5p-common/timer.c > delete mode 100644 arch/arm/cpu/armv7/s5pc1xx/cpu_info.c > delete mode 100644 arch/arm/cpu/armv7/s5pc1xx/timer.c > applied to u-boot-samsung -- from. prom. www.promsoft.net ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2 v2] ARMV7: S5P: rename from s5pc1xx to s5p
On 20 August 2010 14:11, Minkyu Kang wrote: > Because of these are common files around s5p Socs, rename from s5pc1xx to s5p. > And getting cpu_id is SoC specific, so move to SoC's header file. > > Signed-off-by: Minkyu Kang > Signed-off-by: Kyungmin Park > --- > v2: moves read funcion also to s5p_set_cpu_id(). > > arch/arm/cpu/armv7/s5p-common/cpu_info.c | 11 +-- > arch/arm/cpu/armv7/s5p-common/timer.c | 16 > arch/arm/cpu/armv7/s5pc1xx/clock.c | 2 +- > arch/arm/include/asm/arch-s5pc1xx/clk.h | 2 +- > arch/arm/include/asm/arch-s5pc1xx/cpu.h | 11 +-- > arch/arm/include/asm/arch-s5pc1xx/pwm.h | 8 > 6 files changed, 28 insertions(+), 22 deletions(-) > applied to u-boot-samsung -- from. prom. www.promsoft.net ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] S5P: mmc: fix the mmc offset
On 20 August 2010 18:12, Minkyu Kang wrote: > This patch fixed the size of mmc structure. > > Signed-off-by: Minkyu Kang > --- > arch/arm/include/asm/arch-s5pc1xx/mmc.h | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > applied to u-boot-samsung -- from. prom. www.promsoft.net ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] I2C: Add support for multiple I2C busses for SNTP (effect to RTC)
Hello Stephan, added Ben Warren to cc: because this is a change in net, which also falls in his area of responsibility ... Stephan Linz wrote: > This patch switches to the desired I2C bus when the SNTP > network service is called. This can be configured using the > CONFIG_SYS_RTC_BUS_NUM define. > > In my eyes this is a bad and quick hack, but the same as > was making for the date and dtt commands (commit: 0dc018e). > The right way would be to move all the hardware specific i2c > code down to the rtc driver layer. Yes, thats would the best way, but why you don;t go this way? Beside of that, this patch look good to me ... > Signed-off-by: Stephan Linz > --- > net/sntp.c | 18 ++ > 1 files changed, 18 insertions(+), 0 deletions(-) > > diff --git a/net/sntp.c b/net/sntp.c > index 76c10ec..5544570 100644 > --- a/net/sntp.c > +++ b/net/sntp.c > @@ -10,6 +10,14 @@ > #include > #include > > +/* > + * FIXME: The i2c dependency should move into the RTC drivers itself. > + * This higher network layer must not know about hardware specifics! > + */ > +#if defined(CONFIG_CMD_DATE) > +#include > +#endif > + > #include "sntp.h" > > #define SNTP_TIMEOUT 1UL > @@ -53,6 +61,9 @@ SntpHandler (uchar *pkt, unsigned dest, unsigned src, > unsigned len) > struct sntp_pkt_t *rpktp = (struct sntp_pkt_t *)pkt; > struct rtc_time tm; > ulong seconds; > +#if defined(CONFIG_CMD_DATE) > + int old_bus; > +#endif > > debug("%s\n", __func__); > > @@ -66,7 +77,14 @@ SntpHandler (uchar *pkt, unsigned dest, unsigned src, > unsigned len) > > to_tm(ntohl(seconds) - 2208988800UL + NetTimeOffset, &tm); > #if defined(CONFIG_CMD_DATE) > + /* switch to correct I2C bus */ > + old_bus = I2C_GET_BUS(); > + I2C_SET_BUS(CONFIG_SYS_RTC_BUS_NUM); > + > rtc_set (&tm); > + > + /* switch back to original I2C bus */ > + I2C_SET_BUS(old_bus); > #endif > printf ("Date: %4d-%02d-%02d Time: %2d:%02d:%02d\n", > tm.tm_year, tm.tm_mon, tm.tm_mday, bye Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 05/13] x86: Make CONFIG_RELOC_FIXUP_WORKS generic for all x86 boards
Hello Graeme, Graeme Russ wrote: > Relocation is not board-specific fir the x86 architectrure, so > CONFIG_RELOC_FIXUP_WORKS can be defined globally in the common.h > > Signed-off-by: Graeme Russ Acked-by: Heiko Schocher > --- > arch/i386/include/asm/config.h |2 ++ > include/configs/eNET.h |2 -- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/i386/include/asm/config.h b/arch/i386/include/asm/config.h > index 049c44e..1952de7 100644 > --- a/arch/i386/include/asm/config.h > +++ b/arch/i386/include/asm/config.h > @@ -21,4 +21,6 @@ > #ifndef _ASM_CONFIG_H_ > #define _ASM_CONFIG_H_ > > +#define CONFIG_RELOC_FIXUP_WORKS > + > #endif > diff --git a/include/configs/eNET.h b/include/configs/eNET.h > index 361fe61..04321e1 100644 > --- a/include/configs/eNET.h > +++ b/include/configs/eNET.h > @@ -29,8 +29,6 @@ > #ifndef __CONFIG_H > #define __CONFIG_H > > -#define CONFIG_RELOC_FIXUP_WORKS > - > /* > * Stuff still to be dealt with - > */ bye, Heiko ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot