From a79c3e8d9c31db25d5ca3ec8e08a97f323410dd4 Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Wed, 23 Jul 2008 10:52:19 +0200 Subject: [PATCH 01/12] avr32: asm/io.h needs asm/types.h map_physmem() takes a phys_addr_t as parameter. This type is defined in asm/types.h, so we need to include that file. Signed-off-by: Haavard Skinnemoen --- include/asm-avr32/io.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h index d030c26..06e52b1 100644 --- a/include/asm-avr32/io.h +++ b/include/asm-avr32/io.h @@ -22,6 +22,8 @@ #ifndef __ASM_AVR32_IO_H #define __ASM_AVR32_IO_H +#include + #ifdef __KERNEL__ /* From 7f4b009f4232d57084ce0ec5aeb3b57bccb08e4c Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Wed, 23 Jul 2008 10:55:15 +0200 Subject: [PATCH 02/12] avr32: Fix printf() format warnings Signed-off-by: Haavard Skinnemoen --- board/atmel/atngw100/atngw100.c | 2 +- board/atmel/atstk1000/atstk1000.c | 2 +- board/atmel/atstk1000/flash.c | 2 +- include/asm-avr32/sysreg.h | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/board/atmel/atngw100/atngw100.c b/board/atmel/atngw100/atngw100.c index f2c3e79..4ead533 100644 --- a/board/atmel/atngw100/atngw100.c +++ b/board/atmel/atngw100/atngw100.c @@ -81,7 +81,7 @@ phys_size_t initdram(int board_type) unmap_physmem(sdram_base, EBI_SDRAM_SIZE); if (expected_size != actual_size) - printf("Warning: Only %u of %u MiB SDRAM is working\n", + printf("Warning: Only %lu of %lu MiB SDRAM is working\n", actual_size >> 20, expected_size >> 20); return actual_size; diff --git a/board/atmel/atstk1000/atstk1000.c b/board/atmel/atstk1000/atstk1000.c index 6371e2d..d284fc1 100644 --- a/board/atmel/atstk1000/atstk1000.c +++ b/board/atmel/atstk1000/atstk1000.c @@ -104,7 +104,7 @@ phys_size_t initdram(int board_type) unmap_physmem(sdram_base, EBI_SDRAM_SIZE); if (expected_size != actual_size) - printf("Warning: Only %u of %u MiB SDRAM is working\n", + printf("Warning: Only %lu of %lu MiB SDRAM is working\n", actual_size >> 20, expected_size >> 20); return actual_size; diff --git a/board/atmel/atstk1000/flash.c b/board/atmel/atstk1000/flash.c index 12537f3..e2bfd4a 100644 --- a/board/atmel/atstk1000/flash.c +++ b/board/atmel/atstk1000/flash.c @@ -70,7 +70,7 @@ unsigned long flash_init(void) void flash_print_info(flash_info_t *info) { - printf("Flash: Vendor ID: 0x%02x, Product ID: 0x%02x\n", + printf("Flash: Vendor ID: 0x%02lx, Product ID: 0x%02lx\n", info->flash_id >> 16, info->flash_id & 0xffff); printf("Size: %ld MB in %d sectors\n", info->size >> 10, info->sector_count); diff --git a/include/asm-avr32/sysreg.h b/include/asm-avr32/sysreg.h index 72ad49e..4f69704 100644 --- a/include/asm-avr32/sysreg.h +++ b/include/asm-avr32/sysreg.h @@ -273,7 +273,9 @@ | SYSREG_BF(name,value)) /* Register access macros */ -#define sysreg_read(reg) __builtin_mfsr(SYSREG_##reg) -#define sysreg_write(reg, value) __builtin_mtsr(SYSREG_##reg, value) +#define sysreg_read(reg) \ + ((unsigned long)__builtin_mfsr(SYSREG_##reg)) +#define sysreg_write(reg, value) \ + __builtin_mtsr(SYSREG_##reg, value) #endif /* __ASM_AVR32_SYSREG_H__ */ From 252a5e0738bcafaf25f7fbb40f19a59abc2cb13e Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Wed, 23 Jul 2008 10:55:31 +0200 Subject: [PATCH 03/12] atmel_mci: Fix printf() format warnings Signed-off-by: Haavard Skinnemoen --- drivers/mmc/atmel_mci.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/atmel_mci.c b/drivers/mmc/atmel_mci.c index 61aa184..a151488 100644 --- a/drivers/mmc/atmel_mci.c +++ b/drivers/mmc/atmel_mci.c @@ -135,10 +135,10 @@ mmc_cmd(unsigned long cmd, unsigned long arg, status = mmci_readl(SR); } while (!(status & MMCI_BIT(CMDRDY))); - pr_debug("mmc: status 0x%08lx\n", status); + pr_debug("mmc: status 0x%08x\n", status); if (status & error_flags) { - printf("mmc: command %lu failed (status: 0x%08lx)\n", + printf("mmc: command %lu failed (status: 0x%08x)\n", cmd, status); return -EIO; } @@ -245,7 +245,7 @@ out: read_error: mmc_cmd(MMC_CMD_SEND_STATUS, mmc_rca << 16, &card_status, R1 | NCR); - printf("mmc: bread failed, status = %08x, card status = %08x\n", + printf("mmc: bread failed, status = %08x, card status = %08lx\n", status, card_status); goto out; } @@ -284,13 +284,13 @@ static void sd_parse_cid(struct mmc_cid *cid, unsigned long *resp) static void mmc_dump_cid(const struct mmc_cid *cid) { - printf("Manufacturer ID: %02lX\n", cid->mid); - printf("OEM/Application ID: %04lX\n", cid->oid); + printf("Manufacturer ID: %02X\n", cid->mid); + printf("OEM/Application ID: %04X\n", cid->oid); printf("Product name: %s\n", cid->pnm); - printf("Product Revision: %lu.%lu\n", + printf("Product Revision: %u.%u\n", cid->prv >> 4, cid->prv & 0x0f); printf("Product Serial Number: %lu\n", cid->psn); - printf("Manufacturing Date: %02lu/%02lu\n", + printf("Manufacturing Date: %02u/%02u\n", cid->mdt >> 4, cid->mdt & 0x0f); } @@ -501,7 +501,7 @@ int mmc_init(int verbose) mmc_blkdev.part_type = PART_TYPE_DOS; mmc_blkdev.block_read = mmc_bread; sprintf((char *)mmc_blkdev.vendor, - "Man %02x%04x Snr %08x", + "Man %02x%04x Snr %08lx", cid.mid, cid.oid, cid.psn); strncpy((char *)mmc_blkdev.product, cid.pnm, sizeof(mmc_blkdev.product)); From a229d291f33308ab7761d39f25fa1a53c0fc00a2 Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Wed, 23 Jul 2008 10:55:46 +0200 Subject: [PATCH 04/12] spi flash: Fix printf() format warnings Signed-off-by: Haavard Skinnemoen --- drivers/mtd/spi/atmel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/spi/atmel.c b/drivers/mtd/spi/atmel.c index fb7a4a9..10fcf0c 100644 --- a/drivers/mtd/spi/atmel.c +++ b/drivers/mtd/spi/atmel.c @@ -205,7 +205,7 @@ static int dataflash_write_at45(struct spi_flash *flash, byte_addr = 0; } - debug("SF: AT45: Successfully programmed %u bytes @ 0x%x\n", + debug("SF: AT45: Successfully programmed %zu bytes @ 0x%x\n", len, offset); ret = 0; @@ -268,7 +268,7 @@ int dataflash_erase_at45(struct spi_flash *flash, u32 offset, size_t len) page_addr++; } - debug("SF: AT45: Successfully erased %u bytes @ 0x%x\n", + debug("SF: AT45: Successfully erased %zu bytes @ 0x%x\n", len, offset); ret = 0; @@ -351,7 +351,7 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode) * params->blocks_per_sector * params->nr_sectors; - debug("SF: Detected %s with page size %u, total %u bytes\n", + debug("SF: Detected %s with page size %lu, total %u bytes\n", params->name, page_size, asf->flash.size); return &asf->flash; From 09d318a8bb1444ec92e31cafcdba877eb9409e58 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 29 Jul 2008 12:23:49 -0500 Subject: [PATCH 05/12] fsl_i2c: Use timebase timer functions instead of get_timer() The current implementation of get_timer() is only really useful after we have relocated u-boot to memory. The i2c code is used before that as part of the SPD DDR setup. We actually have a bug when using the get_timer() code before relocation because the .bss hasn't been setup and thus we could be reading/writing a random location (probably in flash). Signed-off-by: Kumar Gala --- drivers/i2c/fsl_i2c.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c index 9d5df8a..3f78e2f 100644 --- a/drivers/i2c/fsl_i2c.c +++ b/drivers/i2c/fsl_i2c.c @@ -173,12 +173,11 @@ i2c_init(int speed, int slaveadd) static __inline__ int i2c_wait4bus(void) { - ulong timeval = get_timer(0); + unsigned long long timeval = get_ticks(); while (readb(&i2c_dev[i2c_bus_num]->sr) & I2C_SR_MBB) { - if (get_timer(timeval) > I2C_TIMEOUT) { + if ((get_ticks() - timeval) > usec2ticks(I2C_TIMEOUT)) return -1; - } } return 0; @@ -188,7 +187,7 @@ static __inline__ int i2c_wait(int write) { u32 csr; - ulong timeval = get_timer(0); + unsigned long long timeval = get_ticks(); do { csr = readb(&i2c_dev[i2c_bus_num]->sr); @@ -213,7 +212,7 @@ i2c_wait(int write) } return 0; - } while (get_timer (timeval) < I2C_TIMEOUT); + } while ((get_ticks() - timeval) < usec2ticks(I2C_TIMEOUT)); debug("i2c_wait: timed out\n"); return -1; From 2cb9080427fe641dcb71da46cd0634dd406f37ed Mon Sep 17 00:00:00 2001 From: Kyungmin Park Date: Tue, 22 Jul 2008 08:01:43 +0900 Subject: [PATCH 06/12] Remove unused I2C at apollon board There are no I2C devices on this board. Signed-off-by: Kyungmin Park --- include/configs/apollon.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/configs/apollon.h b/include/configs/apollon.h index 8973296..5884611 100644 --- a/include/configs/apollon.h +++ b/include/configs/apollon.h @@ -103,14 +103,6 @@ */ #define CONFIG_SERIAL1 1 /* UART1 on H4 */ - /* - * I2C configuration - */ -#define CONFIG_HARD_I2C -#define CFG_I2C_SPEED 100000 -#define CFG_I2C_SLAVE 1 -#define CONFIG_DRIVER_OMAP24XX_I2C - /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE #define CONFIG_CONS_INDEX 1 From ebb86c4ecd37a7701358284e497ca4c6483c7cc5 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 30 Jul 2008 09:59:51 +0200 Subject: [PATCH 07/12] cmd_bootm.c: Fix problem with '#if (CONFIG_CMD_USB)' A recent patch used '#if (CONFIG_CMD_USB)' instead of '#if defined(CONFIG_CMD_USB)'. This patch fixes this problem and makes common/bootm.c compile again. Signed-off-by: Stefan Roese Acked-by: Markus Klotzbuecher --- common/cmd_bootm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 4040a69..18682fe 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -36,7 +36,7 @@ #include #include -#if (CONFIG_CMD_USB) +#if defined(CONFIG_CMD_USB) #include #endif @@ -217,7 +217,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) */ iflag = disable_interrupts(); -#if (CONFIG_CMD_USB) +#if defined(CONFIG_CMD_USB) /* * turn off USB to prevent the host controller from writing to the * SDRAM while Linux is booting. This could happen (at least for OHCI From 3f9ae1a5d43c49a8ecf497470c3d1d80255e44b9 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 30 Jul 2008 10:21:01 +0200 Subject: [PATCH 08/12] ppc4xx: Fix W7OLMG compile problems by adding missing LM75 defines Signed-off-by: Stefan Roese --- board/w7o/post2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/board/w7o/post2.c b/board/w7o/post2.c index e590128..6ee33eb 100644 --- a/board/w7o/post2.c +++ b/board/w7o/post2.c @@ -29,6 +29,12 @@ #include "errors.h" #include "dtt.h" +/* for LM75 DTT POST test */ +#define DTT_READ_TEMP 0x0 +#define DTT_CONFIG 0x1 +#define DTT_TEMP_HYST 0x2 +#define DTT_TEMP_SET 0x3 + #if defined(CONFIG_RTC_M48T35A) void rtctest(void) { From 57c219ad5d34dd9d49991777a62e3899595f2ec7 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 30 Jul 2008 08:01:15 -0500 Subject: [PATCH 09/12] Fix compile warnings in dlmalloc The origional code was using on odd reference to get to the first real element in av_[]. The first two elements of the array are not used for actual bins, but for house keeping. If we are more explicit about how use the first few elements we can get rid of the warnings: dlmalloc.c: In function 'malloc_extend_top': dlmalloc.c:1971: warning: dereferencing type-punned pointer will break strict-aliasing rules dlmalloc.c:1999: warning: dereferencing type-punned pointer will break strict-aliasing rules dlmalloc.c:2029: warning: dereferencing type-punned pointer will break strict-aliasing rules ... The logic of how this code came to be is: bin_at(0) = (char*)&(av_[2]) - 2*SIZE_SZ SIZE_SZ is the size of pointer, and av_ is arry of pointers so: bin_at(0) = &(av_[0]) Going from there to bin_at(0)->fd or bin_at(0)->size should be straight forward. Signed-off-by: Kumar Gala --- common/dlmalloc.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/common/dlmalloc.c b/common/dlmalloc.c index c51351e..4a18562 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -1457,7 +1457,7 @@ typedef struct malloc_chunk* mbinptr; indexing, maintain locality, and avoid some initialization tests. */ -#define top (bin_at(0)->fd) /* The topmost chunk */ +#define top (av_[2]) /* The topmost chunk */ #define last_remainder (bin_at(1)) /* remainder from last split */ @@ -1552,13 +1552,14 @@ void malloc_bin_reloc (void) #define BINBLOCKWIDTH 4 /* bins per block */ -#define binblocks (bin_at(0)->size) /* bitvector of nonempty blocks */ +#define binblocks_r ((INTERNAL_SIZE_T)av_[1]) /* bitvector of nonempty blocks */ +#define binblocks_w (av_[1]) /* bin<->block macros */ #define idx2binblock(ix) ((unsigned)1 << (ix / BINBLOCKWIDTH)) -#define mark_binblock(ii) (binblocks |= idx2binblock(ii)) -#define clear_binblock(ii) (binblocks &= ~(idx2binblock(ii))) +#define mark_binblock(ii) (binblocks_w = (mbinptr)(binblocks_r | idx2binblock(ii))) +#define clear_binblock(ii) (binblocks_w = (mbinptr)(binblocks_r & ~(idx2binblock(ii)))) @@ -2250,17 +2251,17 @@ Void_t* mALLOc(bytes) size_t bytes; search for best fitting chunk by scanning bins in blockwidth units. */ - if ( (block = idx2binblock(idx)) <= binblocks) + if ( (block = idx2binblock(idx)) <= binblocks_r) { /* Get to the first marked block */ - if ( (block & binblocks) == 0) + if ( (block & binblocks_r) == 0) { /* force to an even block boundary */ idx = (idx & ~(BINBLOCKWIDTH - 1)) + BINBLOCKWIDTH; block <<= 1; - while ((block & binblocks) == 0) + while ((block & binblocks_r) == 0) { idx += BINBLOCKWIDTH; block <<= 1; @@ -2315,7 +2316,7 @@ Void_t* mALLOc(bytes) size_t bytes; { if ((startidx & (BINBLOCKWIDTH - 1)) == 0) { - binblocks &= ~block; + av_[1] = (mbinptr)(binblocks_r & ~block); break; } --startidx; @@ -2324,9 +2325,9 @@ Void_t* mALLOc(bytes) size_t bytes; /* Get to the next possibly nonempty block */ - if ( (block <<= 1) <= binblocks && (block != 0) ) + if ( (block <<= 1) <= binblocks_r && (block != 0) ) { - while ((block & binblocks) == 0) + while ((block & binblocks_r) == 0) { idx += BINBLOCKWIDTH; block <<= 1; From f0ff885ca64655bee6540eb8a25eed90b1152686 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 30 Jul 2008 14:13:30 -0500 Subject: [PATCH 10/12] mpc85xx: Update linker scripts for Freescale boards * Move to using absolute addressing always. Makes the scripts a bit more portable and common * Moved .bss after the end of the image. These allows us to have more room in the resulting binary image for code and data. * Removed .text object files that aren't really needed * Make sure _end is 4-byte aligned as the .bss init code expects this. (Its possible that the end of .bss isn't 4-byte aligned) Signed-off-by: Kumar Gala --- board/freescale/mpc8540ads/u-boot.lds | 37 +++++++++++++----------------- board/freescale/mpc8541cds/u-boot.lds | 38 +++++++++++++------------------ board/freescale/mpc8544ds/u-boot.lds | 37 +++++++++++++----------------- board/freescale/mpc8548cds/u-boot.lds | 37 +++++++++++++----------------- board/freescale/mpc8555cds/u-boot.lds | 38 +++++++++++++------------------ board/freescale/mpc8560ads/u-boot.lds | 42 ++++++++++++++--------------------- board/freescale/mpc8568mds/u-boot.lds | 40 +++++++++++++-------------------- 7 files changed, 108 insertions(+), 161 deletions(-) diff --git a/board/freescale/mpc8540ads/u-boot.lds b/board/freescale/mpc8540ads/u-boot.lds index f200810..0e4f5a2 100644 --- a/board/freescale/mpc8540ads/u-boot.lds +++ b/board/freescale/mpc8540ads/u-boot.lds @@ -2,6 +2,8 @@ * (C) Copyright 2002,2003, Motorola,Inc. * Xianghua Xiao, X.Xiao@motorola.com. * + * Copyright 2008 Freescale Semiconductor, Inc. + * * See file CREDITS for list of people who contributed to this * project. * @@ -26,16 +28,6 @@ OUTPUT_ARCH(powerpc) __DYNAMIC = 0; */ SECTIONS { - .resetvec 0xFFFFFFFC : - { - *(.resetvec) - } = 0xffff - - .bootpg 0xFFFFF000 : - { - cpu/mpc85xx/start.o (.bootpg) - } = 0xffff - /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; .interp : { *(.interp) } @@ -62,17 +54,6 @@ SECTIONS .plt : { *(.plt) } .text : { - cpu/mpc85xx/start.o (.text) - cpu/mpc85xx/traps.o (.text) - cpu/mpc85xx/interrupts.o (.text) - cpu/mpc85xx/cpu_init.o (.text) - cpu/mpc85xx/cpu.o (.text) - cpu/mpc85xx/speed.o (.text) - cpu/mpc85xx/pci.o (.text) - common/dlmalloc.o (.text) - lib_generic/crc32.o (.text) - lib_ppc/extable.o (.text) - lib_generic/zlib.o (.text) *(.text) *(.fixup) *(.got1) @@ -134,6 +115,18 @@ SECTIONS . = ALIGN(256); __init_end = .; + .bootpg ADDR(.text) + 0x7f000 : + { + cpu/mpc85xx/start.o (.bootpg) + } = 0xffff + + .resetvec ADDR(.text) + 0x7fffc : + { + *(.resetvec) + } = 0xffff + + . = ADDR(.text) + 0x80000; + __bss_start = .; .bss (NOLOAD) : { @@ -142,6 +135,8 @@ SECTIONS *(.bss) *(COMMON) } + + . = ALIGN(4); _end = . ; PROVIDE (end = .); } diff --git a/board/freescale/mpc8541cds/u-boot.lds b/board/freescale/mpc8541cds/u-boot.lds index 5f4dcf0..1c583de 100644 --- a/board/freescale/mpc8541cds/u-boot.lds +++ b/board/freescale/mpc8541cds/u-boot.lds @@ -1,5 +1,5 @@ /* - * Copyright 2004 Freescale Semiconductor. + * Copyright 2004, 2008 Freescale Semiconductor. * * See file CREDITS for list of people who contributed to this * project. @@ -25,16 +25,6 @@ OUTPUT_ARCH(powerpc) __DYNAMIC = 0; */ SECTIONS { - .resetvec 0xFFFFFFFC : - { - *(.resetvec) - } = 0xffff - - .bootpg 0xFFFFF000 : - { - cpu/mpc85xx/start.o (.bootpg) - } = 0xffff - /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; .interp : { *(.interp) } @@ -61,18 +51,6 @@ SECTIONS .plt : { *(.plt) } .text : { - cpu/mpc85xx/start.o (.text) - cpu/mpc85xx/traps.o (.text) - cpu/mpc85xx/interrupts.o (.text) - cpu/mpc85xx/cpu_init.o (.text) - cpu/mpc85xx/cpu.o (.text) - drivers/net/tsec.o (.text) - cpu/mpc85xx/speed.o (.text) - cpu/mpc85xx/pci.o (.text) - common/dlmalloc.o (.text) - lib_generic/crc32.o (.text) - lib_ppc/extable.o (.text) - lib_generic/zlib.o (.text) *(.text) *(.fixup) *(.got1) @@ -134,6 +112,18 @@ SECTIONS . = ALIGN(256); __init_end = .; + .bootpg ADDR(.text) + 0x7f000 : + { + cpu/mpc85xx/start.o (.bootpg) + } = 0xffff + + .resetvec ADDR(.text) + 0x7fffc : + { + *(.resetvec) + } = 0xffff + + . = ADDR(.text) + 0x80000; + __bss_start = .; .bss (NOLOAD) : { @@ -142,6 +132,8 @@ SECTIONS *(.bss) *(COMMON) } + + . = ALIGN(4); _end = . ; PROVIDE (end = .); } diff --git a/board/freescale/mpc8544ds/u-boot.lds b/board/freescale/mpc8544ds/u-boot.lds index c66c69f..500e647 100644 --- a/board/freescale/mpc8544ds/u-boot.lds +++ b/board/freescale/mpc8544ds/u-boot.lds @@ -1,5 +1,5 @@ /* - * Copyright 2007 Freescale Semiconductor, Inc. + * Copyright 2007-2008 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -25,16 +25,6 @@ OUTPUT_ARCH(powerpc) __DYNAMIC = 0; */ SECTIONS { - .resetvec 0xFFFFFFFC : - { - *(.resetvec) - } = 0xffff - - .bootpg 0xFFFFF000 : - { - cpu/mpc85xx/start.o (.bootpg) - } = 0xffff - /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; .interp : { *(.interp) } @@ -61,17 +51,6 @@ SECTIONS .plt : { *(.plt) } .text : { - cpu/mpc85xx/start.o (.text) - cpu/mpc85xx/traps.o (.text) - cpu/mpc85xx/interrupts.o (.text) - cpu/mpc85xx/cpu_init.o (.text) - cpu/mpc85xx/cpu.o (.text) - cpu/mpc85xx/speed.o (.text) - common/dlmalloc.o (.text) - lib_generic/crc32.o (.text) - lib_ppc/extable.o (.text) - lib_generic/zlib.o (.text) - drivers/bios_emulator/atibios.o (.text) *(.text) *(.fixup) *(.got1) @@ -133,6 +112,18 @@ SECTIONS . = ALIGN(256); __init_end = .; + .bootpg ADDR(.text) + 0x7f000 : + { + cpu/mpc85xx/start.o (.bootpg) + } = 0xffff + + .resetvec ADDR(.text) + 0x7fffc : + { + *(.resetvec) + } = 0xffff + + . = ADDR(.text) + 0x80000; + __bss_start = .; .bss (NOLOAD) : { @@ -141,6 +132,8 @@ SECTIONS *(.bss) *(COMMON) } + + . = ALIGN(4); _end = . ; PROVIDE (end = .); } diff --git a/board/freescale/mpc8548cds/u-boot.lds b/board/freescale/mpc8548cds/u-boot.lds index eba7e8a..6b93395 100644 --- a/board/freescale/mpc8548cds/u-boot.lds +++ b/board/freescale/mpc8548cds/u-boot.lds @@ -1,5 +1,5 @@ /* - * Copyright 2004, 2007 Freescale Semiconductor. + * Copyright 2004, 2007-2008 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -25,16 +25,6 @@ OUTPUT_ARCH(powerpc) __DYNAMIC = 0; */ SECTIONS { - .resetvec 0xFFFFFFFC : - { - *(.resetvec) - } = 0xffff - - .bootpg 0xFFFFF000 : - { - cpu/mpc85xx/start.o (.bootpg) - } = 0xffff - /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; .interp : { *(.interp) } @@ -61,17 +51,6 @@ SECTIONS .plt : { *(.plt) } .text : { - cpu/mpc85xx/start.o (.text) - cpu/mpc85xx/traps.o (.text) - cpu/mpc85xx/interrupts.o (.text) - cpu/mpc85xx/cpu_init.o (.text) - cpu/mpc85xx/cpu.o (.text) - drivers/net/tsec.o (.text) - cpu/mpc85xx/speed.o (.text) - common/dlmalloc.o (.text) - lib_generic/crc32.o (.text) - lib_ppc/extable.o (.text) - lib_generic/zlib.o (.text) *(.text) *(.fixup) *(.got1) @@ -133,6 +112,18 @@ SECTIONS . = ALIGN(256); __init_end = .; + .bootpg ADDR(.text) + 0x7f000 : + { + cpu/mpc85xx/start.o (.bootpg) + } = 0xffff + + .resetvec ADDR(.text) + 0x7fffc : + { + *(.resetvec) + } = 0xffff + + . = ADDR(.text) + 0x80000; + __bss_start = .; .bss (NOLOAD) : { @@ -141,6 +132,8 @@ SECTIONS *(.bss) *(COMMON) } + + . = ALIGN(4); _end = . ; PROVIDE (end = .); } diff --git a/board/freescale/mpc8555cds/u-boot.lds b/board/freescale/mpc8555cds/u-boot.lds index 5f4dcf0..a18b3a7 100644 --- a/board/freescale/mpc8555cds/u-boot.lds +++ b/board/freescale/mpc8555cds/u-boot.lds @@ -1,5 +1,5 @@ /* - * Copyright 2004 Freescale Semiconductor. + * Copyright 2004, 2008 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -25,16 +25,6 @@ OUTPUT_ARCH(powerpc) __DYNAMIC = 0; */ SECTIONS { - .resetvec 0xFFFFFFFC : - { - *(.resetvec) - } = 0xffff - - .bootpg 0xFFFFF000 : - { - cpu/mpc85xx/start.o (.bootpg) - } = 0xffff - /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; .interp : { *(.interp) } @@ -61,18 +51,6 @@ SECTIONS .plt : { *(.plt) } .text : { - cpu/mpc85xx/start.o (.text) - cpu/mpc85xx/traps.o (.text) - cpu/mpc85xx/interrupts.o (.text) - cpu/mpc85xx/cpu_init.o (.text) - cpu/mpc85xx/cpu.o (.text) - drivers/net/tsec.o (.text) - cpu/mpc85xx/speed.o (.text) - cpu/mpc85xx/pci.o (.text) - common/dlmalloc.o (.text) - lib_generic/crc32.o (.text) - lib_ppc/extable.o (.text) - lib_generic/zlib.o (.text) *(.text) *(.fixup) *(.got1) @@ -134,6 +112,18 @@ SECTIONS . = ALIGN(256); __init_end = .; + .bootpg ADDR(.text) + 0x7f000 : + { + cpu/mpc85xx/start.o (.bootpg) + } = 0xffff + + .resetvec ADDR(.text) + 0x7fffc : + { + *(.resetvec) + } = 0xffff + + . = ADDR(.text) + 0x80000; + __bss_start = .; .bss (NOLOAD) : { @@ -142,6 +132,8 @@ SECTIONS *(.bss) *(COMMON) } + + . = ALIGN(4); _end = . ; PROVIDE (end = .); } diff --git a/board/freescale/mpc8560ads/u-boot.lds b/board/freescale/mpc8560ads/u-boot.lds index cb30ea9..0e4f5a2 100644 --- a/board/freescale/mpc8560ads/u-boot.lds +++ b/board/freescale/mpc8560ads/u-boot.lds @@ -1,7 +1,9 @@ /* - * (C) Copyright 2002,2003,Motorola,Inc. + * (C) Copyright 2002,2003, Motorola,Inc. * Xianghua Xiao, X.Xiao@motorola.com. * + * Copyright 2008 Freescale Semiconductor, Inc. + * * See file CREDITS for list of people who contributed to this * project. * @@ -26,16 +28,6 @@ OUTPUT_ARCH(powerpc) __DYNAMIC = 0; */ SECTIONS { - .resetvec 0xFFFFFFFC : - { - *(.resetvec) - } = 0xffff - - .bootpg 0xFFFFF000 : - { - cpu/mpc85xx/start.o (.bootpg) - } = 0xffff - /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; .interp : { *(.interp) } @@ -62,20 +54,6 @@ SECTIONS .plt : { *(.plt) } .text : { - cpu/mpc85xx/start.o (.text) - cpu/mpc85xx/commproc.o (.text) - cpu/mpc85xx/traps.o (.text) - cpu/mpc85xx/interrupts.o (.text) - cpu/mpc85xx/serial_scc.o (.text) - cpu/mpc85xx/ether_fcc.o (.text) - cpu/mpc85xx/cpu_init.o (.text) - cpu/mpc85xx/cpu.o (.text) - cpu/mpc85xx/speed.o (.text) - cpu/mpc85xx/spd_sdram.o (.text) - common/dlmalloc.o (.text) - lib_generic/crc32.o (.text) - lib_ppc/extable.o (.text) - lib_generic/zlib.o (.text) *(.text) *(.fixup) *(.got1) @@ -137,6 +115,18 @@ SECTIONS . = ALIGN(256); __init_end = .; + .bootpg ADDR(.text) + 0x7f000 : + { + cpu/mpc85xx/start.o (.bootpg) + } = 0xffff + + .resetvec ADDR(.text) + 0x7fffc : + { + *(.resetvec) + } = 0xffff + + . = ADDR(.text) + 0x80000; + __bss_start = .; .bss (NOLOAD) : { @@ -145,6 +135,8 @@ SECTIONS *(.bss) *(COMMON) } + + . = ALIGN(4); _end = . ; PROVIDE (end = .); } diff --git a/board/freescale/mpc8568mds/u-boot.lds b/board/freescale/mpc8568mds/u-boot.lds index 1b83834..9d245e4 100644 --- a/board/freescale/mpc8568mds/u-boot.lds +++ b/board/freescale/mpc8568mds/u-boot.lds @@ -1,5 +1,5 @@ /* - * Copyright 2004-2007 Freescale Semiconductor. + * Copyright 2004-2008 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -23,21 +23,8 @@ OUTPUT_ARCH(powerpc) /* Do we need any of these for elf? __DYNAMIC = 0; */ - SECTIONS { - /* ELIOR - From RAM: From FLASH: 0xFFFFFFFC*/ - .resetvec 0xFFFFFFFC: - { - *(.resetvec) - } = 0xffff - - /*(ELIOR - From RAM: From FLASH: 0xFFFFF000*/ - .bootpg 0xFFFFF000: - { - cpu/mpc85xx/start.o (.bootpg) - } = 0xffff - /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; .interp : { *(.interp) } @@ -64,17 +51,6 @@ SECTIONS .plt : { *(.plt) } .text : { - cpu/mpc85xx/start.o (.text) - cpu/mpc85xx/traps.o (.text) - cpu/mpc85xx/interrupts.o (.text) - cpu/mpc85xx/cpu_init.o (.text) - cpu/mpc85xx/cpu.o (.text) - cpu/mpc85xx/speed.o (.text) - cpu/mpc85xx/pci.o (.text) - common/dlmalloc.o (.text) - lib_generic/crc32.o (.text) - lib_ppc/extable.o (.text) - lib_generic/zlib.o (.text) *(.text) *(.fixup) *(.got1) @@ -136,6 +112,18 @@ SECTIONS . = ALIGN(256); __init_end = .; + .bootpg ADDR(.text) + 0x7f000 : + { + cpu/mpc85xx/start.o (.bootpg) + } = 0xffff + + .resetvec ADDR(.text) + 0x7fffc : + { + *(.resetvec) + } = 0xffff + + . = ADDR(.text) + 0x80000; + __bss_start = .; .bss (NOLOAD) : { @@ -144,6 +132,8 @@ SECTIONS *(.bss) *(COMMON) } + + . = ALIGN(4); _end = . ; PROVIDE (end = .); } From 6361ad4b596f5a940a01c91ae0297d98f790cbe0 Mon Sep 17 00:00:00 2001 From: Matvejchikov Ilya Date: Wed, 30 Jul 2008 23:20:32 +0400 Subject: [PATCH 11/12] PPC: Add pci_clk in the global_data for CPM2 processors This patch adds pci_clk field to the global_data structure for the processors which have CPM2 module in case the CONFIG_PCI is defined. Signed-off-by: Matvejchikov Ilya --- include/asm-ppc/global_data.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h index c5ac658..be2ce24 100644 --- a/include/asm-ppc/global_data.h +++ b/include/asm-ppc/global_data.h @@ -51,6 +51,9 @@ typedef struct global_data { unsigned long cpm_clk; unsigned long scc_clk; unsigned long brg_clk; +#ifdef CONFIG_PCI + unsigned long pci_clk; +#endif #endif unsigned long mem_clk; #if defined(CONFIG_MPC83XX) From 9196b44334c330cc13de2464c59181e4db71f549 Mon Sep 17 00:00:00 2001 From: Matvejchikov Ilya Date: Wed, 30 Jul 2008 23:21:19 +0400 Subject: [PATCH 12/12] 8260: Making the use of gd->pci_clk dependant on the CONFIG_PCI Signed-off-by: Matvejchikov Ilya --- cpu/mpc8260/speed.c | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/cpu/mpc8260/speed.c b/cpu/mpc8260/speed.c index 38cd0d9..8d280fb 100644 --- a/cpu/mpc8260/speed.c +++ b/cpu/mpc8260/speed.c @@ -162,6 +162,30 @@ int get_clocks (void) gd->cpu_clk = clkin; } +#ifdef CONFIG_PCI + gd->pci_clk = clkin; + + if (sccr & SCCR_PCI_MODE) { + uint pci_div; + uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT; + + if (sccr & SCCR_PCI_MODCK) { + pci_div = 2; + if (pcidf == 9) { + pci_div *= 5; + } else if (pcidf == 0xB) { + pci_div *= 6; + } else { + pci_div *= (pcidf + 1); + } + } else { + pci_div = pcidf + 1; + } + + gd->pci_clk = (gd->cpm_clk * 2) / pci_div; + } +#endif + return (0); } @@ -220,26 +244,9 @@ int prt_8260_clks (void) printf (" - cpu_clk %10ld, cpm_clk %10ld, bus_clk %10ld\n", gd->cpu_clk, gd->cpm_clk, gd->bus_clk); - - if (sccr & SCCR_PCI_MODE) { - uint pci_div; - uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT; - - if (sccr & SCCR_PCI_MODCK) { - pci_div = 2; - if (pcidf == 9) { - pci_div *= 5; - } else if (pcidf == 0xB) { - pci_div *= 6; - } else { - pci_div *= (pcidf + 1); - } - } else { - pci_div = pcidf + 1; - } - - printf (" - pci_clk %10ld\n", (gd->cpm_clk * 2) / pci_div); - } +#ifdef CONFIG_PCI + printf (" - pci_clk %10ld\n", gd->pci_clk); +#endif putc ('\n'); return (0);