From 1487adbdcf9594bb2eb686325a6f9540dad1b70a Mon Sep 17 00:00:00 2001 From: Ed Swarthout Date: Wed, 26 Sep 2007 16:35:54 -0500 Subject: 85xx io out functions need sync after write. This fixes the mc146818 rtc_read/write functions for 85xx. Signed-off-by: Ed Swarthout --- cpu/mpc85xx/start.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S index 2c98c2a..5d65190 100644 --- a/cpu/mpc85xx/start.S +++ b/cpu/mpc85xx/start.S @@ -701,6 +701,7 @@ in8: .globl out8 out8: stb r4,0x0000(r3) + sync blr /*------------------------------------------------------------------------------- */ @@ -710,6 +711,7 @@ out8: .globl out16 out16: sth r4,0x0000(r3) + sync blr /*------------------------------------------------------------------------------- */ @@ -719,6 +721,7 @@ out16: .globl out16r out16r: sthbrx r4,r0,r3 + sync blr /*------------------------------------------------------------------------------- */ @@ -728,6 +731,7 @@ out16r: .globl out32 out32: stw r4,0x0000(r3) + sync blr /*------------------------------------------------------------------------------- */ @@ -737,6 +741,7 @@ out32: .globl out32r out32r: stwbrx r4,r0,r3 + sync blr /*------------------------------------------------------------------------------- */ -- cgit v1.1 From e1ce3cb617bb06f91f82f98915391175addf3e82 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 2 Oct 2007 11:12:27 -0500 Subject: Remove magic numbers from cache related operations for mpc85xx The mpc85xx start code uses some magic numbers that we actually have #defines for in so use those instead. Signed-off-by: Kumar Gala --- cpu/mpc85xx/start.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S index 5d65190..e5cabca 100644 --- a/cpu/mpc85xx/start.S +++ b/cpu/mpc85xx/start.S @@ -266,13 +266,13 @@ _start_e500: */ lis r3,CFG_INIT_RAM_ADDR@h ori r3,r3,CFG_INIT_RAM_ADDR@l - li r2,512 /* 512*32=16K */ + li r2,(CFG_DCACHE_SIZE / (2 * CFG_CACHELINE_SIZE)) mtctr r2 li r0,0 1: dcbz r0,r3 dcbtls 0,r0,r3 - addi r3,r3,32 + addi r3,r3,CFG_CACHELINE_SIZE bdnz 1b /* Jump out the last 4K page and continue to 'normal' start */ @@ -1066,11 +1066,11 @@ unlock_ram_in_cache: /* invalidate the INIT_RAM section */ lis r3,(CFG_INIT_RAM_ADDR & ~31)@h ori r3,r3,(CFG_INIT_RAM_ADDR & ~31)@l - li r4,512 + li r4,(CFG_DCACHE_SIZE / (2 * CFG_CACHELINE_SIZE)) mtctr r4 1: icbi r0,r3 dcbi r0,r3 - addi r3,r3,32 + addi r3,r3,CFG_CACHELINE_SIZE bdnz 1b sync /* Wait for all icbi to complete on bus */ isync -- cgit v1.1 From a3063eec775719b7e91023bbec3f64b3118791df Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Thu, 11 Oct 2007 00:18:48 -0500 Subject: Set OF_STDOUT_PATH to match the default console on MPC8568 MDS On the MPC8568 MDS we use ttyS0, UART0, etc. as the standard configured console. Make it so we match that config what we tell Linux as the early STDOUT console. Signed-off-by: Kumar Gala --- include/configs/MPC8568MDS.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/MPC8568MDS.h b/include/configs/MPC8568MDS.h index ba744e9..548e158 100644 --- a/include/configs/MPC8568MDS.h +++ b/include/configs/MPC8568MDS.h @@ -297,7 +297,7 @@ extern unsigned long get_clock_freq(void); #define OF_SOC "soc8568@e0000000" #define OF_QE "qe@e0080000" #define OF_TBCLK (bd->bi_busfreq / 8) -#define OF_STDOUT_PATH "/soc8568@e0000000/serial@4600" +#define OF_STDOUT_PATH "/soc8568@e0000000/serial@4500" /* * I2C -- cgit v1.1 From 7600d47b8f6a10019e537dc9a62aa1498df58d25 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Thu, 11 Oct 2007 00:29:18 -0500 Subject: Improve handling of PCI interrupt device tree fixup on MPC85xx CDS On the MPC85xx CDS we have two issues: 1. The device tree fixup code did not check to see if the property we are trying to update is actually found. Its possible that it would update random memory starting at 0. 2. Newer Linux kernel's have moved the location of the PCI nodes to be sibilings of the soc node and not children. The explicit PATH to the PCI node would not be found for these device trees. Add the ability to handle both paths. In the future we shouldn't handle such fixups by explicit path. Signed-off-by: Kumar Gala --- board/cds/common/ft_board.c | 23 +++++++++++++++-------- include/configs/MPC8541CDS.h | 1 + include/configs/MPC8548CDS.h | 1 + include/configs/MPC8555CDS.h | 1 + 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/board/cds/common/ft_board.c b/board/cds/common/ft_board.c index 9d97905..3eda100 100644 --- a/board/cds/common/ft_board.c +++ b/board/cds/common/ft_board.c @@ -37,17 +37,24 @@ static void cds_pci_fixup(void *blob) map = ft_get_prop(blob, "/" OF_SOC "/pci@8000/interrupt-map", &len); - len /= sizeof(u32); + if (!map) + map = ft_get_prop(blob, "/" OF_PCI "/interrupt-map", &len); - slot = get_pci_slot(); + if (map) { + len /= sizeof(u32); - for (i=0;ibi_busfreq / 8) #define OF_STDOUT_PATH "/soc8541@e0000000/serial@4600" +#define OF_PCI "pci@e0008000" /* * I2C diff --git a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h index 6083715..4edc7fd 100644 --- a/include/configs/MPC8548CDS.h +++ b/include/configs/MPC8548CDS.h @@ -340,6 +340,7 @@ extern unsigned long get_clock_freq(void); #define OF_SOC "soc8548@e0000000" #define OF_TBCLK (bd->bi_busfreq / 8) #define OF_STDOUT_PATH "/soc8548@e0000000/serial@4600" +#define OF_PCI "pci@e0008000" /* * I2C diff --git a/include/configs/MPC8555CDS.h b/include/configs/MPC8555CDS.h index 1d1b7c9..c414bf0 100644 --- a/include/configs/MPC8555CDS.h +++ b/include/configs/MPC8555CDS.h @@ -316,6 +316,7 @@ extern unsigned long get_clock_freq(void); #define OF_SOC "soc8555@e0000000" #define OF_TBCLK (bd->bi_busfreq / 8) #define OF_STDOUT_PATH "/soc8555@e0000000/serial@4600" +#define OF_PCI "pci@e0008000" /* * I2C -- cgit v1.1 From 5c7ea64bb74a850a2b2303f853a8270695ad8602 Mon Sep 17 00:00:00 2001 From: Dan Wilson Date: Fri, 19 Oct 2007 11:33:48 -0500 Subject: tsec driver should clear RHALT on startup This was causing problems for some people. Signed-off-by: Alain Gravel Signed-off-by: Dan Wilson Signed-off-by: Andy Fleming --- drivers/tsec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tsec.c b/drivers/tsec.c index 4ff3339..7ba8f0c 100644 --- a/drivers/tsec.c +++ b/drivers/tsec.c @@ -803,6 +803,7 @@ static void startup_tsec(struct eth_device *dev) /* Tell the DMA it is clear to go */ regs->dmactrl |= DMACTRL_INIT_SETTINGS; regs->tstat = TSTAT_CLEAR_THALT; + regs->rstat = RSTAT_CLEAR_RHALT; regs->dmactrl &= ~(DMACTRL_GRS | DMACTRL_GTS); } -- cgit v1.1 From 1e701e701304b3c3a3768ca83dd2ab7b9e88c77d Mon Sep 17 00:00:00 2001 From: "urwithsughosh@gmail.com" Date: Mon, 24 Sep 2007 13:36:01 -0400 Subject: MSR overwrite fix Hello, This patch fixes the MSR overwrite in the start.S when moving out of the last 4K page. Signed-off-by: Sughosh Ganu --- cpu/mpc85xx/start.S | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S index e5cabca..ada6ea5 100644 --- a/cpu/mpc85xx/start.S +++ b/cpu/mpc85xx/start.S @@ -218,6 +218,8 @@ _start_e500: bdnz 0b /* Clear and set up some registers. */ + li r0,0 + mtmsr r0 li r0,0x0000 lis r1,0xffff mtspr DEC,r0 /* prevent dec exceptions */ @@ -277,7 +279,6 @@ _start_e500: /* Jump out the last 4K page and continue to 'normal' start */ #ifdef CFG_RAMBOOT - bl 3f b _start_cont #else /* Calculate absolute address in FLASH and jump there */ @@ -286,15 +287,9 @@ _start_e500: ori r3,r3,CFG_MONITOR_BASE@l addi r3,r3,_start_cont - _start + _START_OFFSET mtlr r3 + blr #endif -3: li r0,0 - mtspr SRR1,r0 /* Keep things disabled for now */ - mflr r1 - mtspr SRR0,r1 - rfi - isync - .text .globl _start _start: -- cgit v1.1 From df90968b48fb34fa9072fab150db2ac89678f537 Mon Sep 17 00:00:00 2001 From: "urwithsughosh@gmail.com" Date: Mon, 24 Sep 2007 13:32:13 -0400 Subject: Setting MSR[DE] in do_reset Hello, This patch ensures the soft reset of the board for the 85xx boards by setting the MSR[DE] in the do_reset function. Signed-off-by: Sughosh Ganu --- cpu/mpc85xx/cpu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c index 08e0468..bbc5444 100644 --- a/cpu/mpc85xx/cpu.c +++ b/cpu/mpc85xx/cpu.c @@ -163,7 +163,12 @@ int do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) * Initiate hard reset in debug control register DBCR0 * Make sure MSR[DE] = 1 */ - unsigned long val; + unsigned long val, msr; + + msr = mfmsr (); + msr |= MSR_DE; + mtmsr (msr); + val = mfspr(DBCR0); val |= 0x70000000; mtspr(DBCR0,val); -- cgit v1.1 From e5f325fec5b48ae705c89522923ba5a2e37cd5c7 Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Sun, 21 Oct 2007 10:55:36 +0900 Subject: [MIPS] u-boot.lds: Remove duplicated .sdata section Signed-off-by: Shinya Kuribayashi --- board/dbau1x00/u-boot.lds | 3 --- board/gth2/u-boot.lds | 3 --- board/incaip/u-boot.lds | 3 --- board/pb1x00/u-boot.lds | 3 --- board/purple/u-boot.lds | 3 --- board/tb0229/u-boot.lds | 3 --- examples/mips.lds | 3 --- 7 files changed, 21 deletions(-) diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds index 10c9917..75a3af6 100644 --- a/board/dbau1x00/u-boot.lds +++ b/board/dbau1x00/u-boot.lds @@ -43,9 +43,6 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - . = ALIGN(4); - .sdata : { *(.sdata) } - _gp = ALIGN(16); __got_start = .; diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds index 8ba0b6d..69c8c9d 100644 --- a/board/gth2/u-boot.lds +++ b/board/gth2/u-boot.lds @@ -43,9 +43,6 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - . = ALIGN(4); - .sdata : { *(.sdata) } - _gp = ALIGN(16); __got_start = .; diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds index 10c9917..75a3af6 100644 --- a/board/incaip/u-boot.lds +++ b/board/incaip/u-boot.lds @@ -43,9 +43,6 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - . = ALIGN(4); - .sdata : { *(.sdata) } - _gp = ALIGN(16); __got_start = .; diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds index a2d19a8..865be77 100644 --- a/board/pb1x00/u-boot.lds +++ b/board/pb1x00/u-boot.lds @@ -43,9 +43,6 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - . = ALIGN(4); - .sdata : { *(.sdata) } - _gp = ALIGN(16); __got_start = .; diff --git a/board/purple/u-boot.lds b/board/purple/u-boot.lds index 1bdac1f..6b3783f 100644 --- a/board/purple/u-boot.lds +++ b/board/purple/u-boot.lds @@ -53,9 +53,6 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - . = ALIGN(4); - .sdata : { *(.sdata) } - _gp = ALIGN(16); __got_start = .; diff --git a/board/tb0229/u-boot.lds b/board/tb0229/u-boot.lds index 30a2bc5..26d8c81 100644 --- a/board/tb0229/u-boot.lds +++ b/board/tb0229/u-boot.lds @@ -43,9 +43,6 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - . = ALIGN(4); - .sdata : { *(.sdata) } - _gp = ALIGN(16); __got_start = .; diff --git a/examples/mips.lds b/examples/mips.lds index 9d9849b..6f31eb7 100644 --- a/examples/mips.lds +++ b/examples/mips.lds @@ -39,9 +39,6 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - . = ALIGN(4); - .sdata : { *(.sdata) } - _gp = ALIGN(16); __got_start = .; -- cgit v1.1 From cbf2323b5b8285ea01acba7bbb905a3162d9b021 Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Sun, 21 Oct 2007 10:55:36 +0900 Subject: [MIPS] u-boot.lds: Fix __got_start and __got_end Ensure that __got_start points to top of the `.got', and __got_end points to bottom as well, so that we never fail to count num_got_entries. Signed-off-by: Shinya Kuribayashi --- board/dbau1x00/u-boot.lds | 8 +++++--- board/gth2/u-boot.lds | 8 +++++--- board/incaip/u-boot.lds | 8 +++++--- board/pb1x00/u-boot.lds | 8 +++++--- board/purple/u-boot.lds | 8 +++++--- board/tb0229/u-boot.lds | 8 +++++--- examples/mips.lds | 8 +++++--- 7 files changed, 35 insertions(+), 21 deletions(-) diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds index 75a3af6..9c71ef7 100644 --- a/board/dbau1x00/u-boot.lds +++ b/board/dbau1x00/u-boot.lds @@ -45,9 +45,11 @@ SECTIONS _gp = ALIGN(16); - __got_start = .; - .got : { *(.got) } - __got_end = .; + .got : { + __got_start = .; + *(.got) + __got_end = .; + } .sdata : { *(.sdata) } diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds index 69c8c9d..0ab42db 100644 --- a/board/gth2/u-boot.lds +++ b/board/gth2/u-boot.lds @@ -45,9 +45,11 @@ SECTIONS _gp = ALIGN(16); - __got_start = .; - .got : { *(.got) } - __got_end = .; + .got : { + __got_start = .; + *(.got) + __got_end = .; + } .sdata : { *(.sdata) } diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds index 75a3af6..9c71ef7 100644 --- a/board/incaip/u-boot.lds +++ b/board/incaip/u-boot.lds @@ -45,9 +45,11 @@ SECTIONS _gp = ALIGN(16); - __got_start = .; - .got : { *(.got) } - __got_end = .; + .got : { + __got_start = .; + *(.got) + __got_end = .; + } .sdata : { *(.sdata) } diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds index 865be77..7329e6a 100644 --- a/board/pb1x00/u-boot.lds +++ b/board/pb1x00/u-boot.lds @@ -45,9 +45,11 @@ SECTIONS _gp = ALIGN(16); - __got_start = .; - .got : { *(.got) } - __got_end = .; + .got : { + __got_start = .; + *(.got) + __got_end = .; + } .sdata : { *(.sdata) } diff --git a/board/purple/u-boot.lds b/board/purple/u-boot.lds index 6b3783f..aa51cbf 100644 --- a/board/purple/u-boot.lds +++ b/board/purple/u-boot.lds @@ -55,9 +55,11 @@ SECTIONS _gp = ALIGN(16); - __got_start = .; - .got : { *(.got) } - __got_end = .; + .got : { + __got_start = .; + *(.got) + __got_end = .; + } .sdata : { *(.sdata) } diff --git a/board/tb0229/u-boot.lds b/board/tb0229/u-boot.lds index 26d8c81..148f5e6 100644 --- a/board/tb0229/u-boot.lds +++ b/board/tb0229/u-boot.lds @@ -45,9 +45,11 @@ SECTIONS _gp = ALIGN(16); - __got_start = .; - .got : { *(.got) } - __got_end = .; + .got : { + __got_start = .; + *(.got) + __got_end = .; + } .sdata : { *(.sdata) } diff --git a/examples/mips.lds b/examples/mips.lds index 6f31eb7..3bd573c 100644 --- a/examples/mips.lds +++ b/examples/mips.lds @@ -41,9 +41,11 @@ SECTIONS _gp = ALIGN(16); - __got_start = .; - .got : { *(.got) } - __got_end = .; + .got : { + __got_start = .; + *(.got) + __got_end = .; + } .sdata : { *(.sdata) } -- cgit v1.1 From 22069215eb7adf5a3888bf7c7784ea9d70a72cd0 Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Sun, 21 Oct 2007 10:55:36 +0900 Subject: [MIPS] Fix $gp usage Now we load $gp with _GLOBAL_OFFSET_TABLE_, but this is incorrect use. As a general principle, we should use _gp for $gp. Thanks to linker script's help we fortunately have _gp which equals to _GLOBAL_OFFSET_TABLE_. But once _gp gets out of alignment, we will not be able to access to GOT entires, global variables and procedure entry points. The right thing to do is to use _gp. This patch also introduce a new symbol `.gpword _GLOBAL_OFFSET_TABLE_' which holds the offset from _gp. When updating GOT entries, we use this offset and _gp to calculate the final _GLOBAL_OFFSET_TABLE_. This patch is originally submitted by Vlad Lungu , then I made some change to leave over num_got_entries. Signed-off-by: Shinya Kuribayashi Cc: Vlad Lungu --- cpu/mips/start.S | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/cpu/mips/start.S b/cpu/mips/start.S index e91e213..074d01d 100644 --- a/cpu/mips/start.S +++ b/cpu/mips/start.S @@ -234,11 +234,11 @@ reset: li t0, CONF_CM_UNCACHED mtc0 t0, CP0_CONFIG - /* Initialize GOT pointer. + /* Initialize $gp. */ bal 1f nop - .word _GLOBAL_OFFSET_TABLE_ + .word _gp 1: move gp, ra lw t1, 0(ra) @@ -306,9 +306,9 @@ relocate_code: move t1, a2 /* - * Fix GOT pointer: + * Fix $gp: * - * New GOT-PTR = (old GOT-PTR - CFG_MONITOR_BASE) + Destination Address + * New $gp = (Old $gp - CFG_MONITOR_BASE) + Destination Address */ move t6, gp sub gp, CFG_MONITOR_BASE @@ -341,15 +341,22 @@ relocate_code: j t0 nop + .gpword _GLOBAL_OFFSET_TABLE_ /* _GLOBAL_OFFSET_TABLE_ - _gp */ .word uboot_end_data .word uboot_end .word num_got_entries in_ram: - /* Now we want to update GOT. + /* + * Now we want to update GOT. + * + * GOT[0] is reserved. GOT[1] is also reserved for the dynamic object + * generated by GNU ld. Skip these reserved entries from relocation. */ lw t3, -4(t0) /* t3 <-- num_got_entries */ - addi t4, gp, 8 /* Skipping first two entries. */ + lw t4, -16(t0) /* t4 <-- (_GLOBAL_OFFSET_TABLE_ - _gp) */ + add t4, t4, gp /* t4 now holds _GLOBAL_OFFSET_TABLE_ */ + addi t4, t4, 8 /* Skipping first two entries. */ li t2, 2 1: lw t1, 0(t4) -- cgit v1.1 From eb700636db017d310edaeb559b13d82588560674 Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Sun, 21 Oct 2007 10:55:37 +0900 Subject: [MIPS] u-boot.lds: Define _gp in a standard manner Signed-off-by: Shinya Kuribayashi --- board/dbau1x00/u-boot.lds | 3 ++- board/gth2/u-boot.lds | 3 ++- board/incaip/u-boot.lds | 3 ++- board/pb1x00/u-boot.lds | 3 ++- board/purple/u-boot.lds | 3 ++- board/tb0229/u-boot.lds | 3 ++- examples/mips.lds | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds index 9c71ef7..9639b81 100644 --- a/board/dbau1x00/u-boot.lds +++ b/board/dbau1x00/u-boot.lds @@ -43,7 +43,8 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - _gp = ALIGN(16); + . = .; + _gp = ALIGN(16) + 0x7ff0; .got : { __got_start = .; diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds index 0ab42db..90432cb 100644 --- a/board/gth2/u-boot.lds +++ b/board/gth2/u-boot.lds @@ -43,7 +43,8 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - _gp = ALIGN(16); + . = .; + _gp = ALIGN(16) + 0x7ff0; .got : { __got_start = .; diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds index 9c71ef7..9639b81 100644 --- a/board/incaip/u-boot.lds +++ b/board/incaip/u-boot.lds @@ -43,7 +43,8 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - _gp = ALIGN(16); + . = .; + _gp = ALIGN(16) + 0x7ff0; .got : { __got_start = .; diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds index 7329e6a..363d974 100644 --- a/board/pb1x00/u-boot.lds +++ b/board/pb1x00/u-boot.lds @@ -43,7 +43,8 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - _gp = ALIGN(16); + . = .; + _gp = ALIGN(16) + 0x7ff0; .got : { __got_start = .; diff --git a/board/purple/u-boot.lds b/board/purple/u-boot.lds index aa51cbf..e7ec012 100644 --- a/board/purple/u-boot.lds +++ b/board/purple/u-boot.lds @@ -53,7 +53,8 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - _gp = ALIGN(16); + . = .; + _gp = ALIGN(16) + 0x7ff0; .got : { __got_start = .; diff --git a/board/tb0229/u-boot.lds b/board/tb0229/u-boot.lds index 148f5e6..b2fa9f2 100644 --- a/board/tb0229/u-boot.lds +++ b/board/tb0229/u-boot.lds @@ -43,7 +43,8 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - _gp = ALIGN(16); + . = .; + _gp = ALIGN(16) + 0x7ff0; .got : { __got_start = .; diff --git a/examples/mips.lds b/examples/mips.lds index 3bd573c..a770728 100644 --- a/examples/mips.lds +++ b/examples/mips.lds @@ -39,7 +39,8 @@ SECTIONS . = ALIGN(4); .data : { *(.data) } - _gp = ALIGN(16); + . = .; + _gp = ALIGN(16) + 0x7ff0; .got : { __got_start = .; -- cgit v1.1 From 00101dd7a32d12f698150123e47e4b3420279f86 Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Sun, 21 Oct 2007 21:30:42 +0900 Subject: [MIPS] Add PIC-related switches to PLATFORM_{CPP,LD}FLAGS and cleanup Signed-off-by: Shinya Kuribayashi --- cpu/mips/config.mk | 2 +- mips_config.mk | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk index b29986e..487c4eb 100644 --- a/cpu/mips/config.mk +++ b/cpu/mips/config.mk @@ -35,6 +35,6 @@ else ENDIANNESS = -EB endif -MIPSFLAGS += $(ENDIANNESS) -mabicalls +MIPSFLAGS += $(ENDIANNESS) PLATFORM_CPPFLAGS += $(MIPSFLAGS) diff --git a/mips_config.mk b/mips_config.mk index d8aa5fa..67fb67d 100644 --- a/mips_config.mk +++ b/mips_config.mk @@ -22,3 +22,28 @@ # PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__ + +# +# From Linux arch/mips/Makefile +# +# GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel +# code since it only slows down the whole thing. At some point we might make +# use of global pointer optimizations but their use of $28 conflicts with +# the current pointer optimization. +# +# The DECStation requires an ECOFF kernel for remote booting, other MIPS +# machines may also. Since BFD is incredibly buggy with respect to +# crossformat linking we rely on the elf2ecoff tool for format conversion. +# +# cflags-y += -G 0 -mno-abicalls -fno-pic -pipe +# cflags-y += -msoft-float +# LDFLAGS_vmlinux += -G 0 -static -n -nostdlib +# MODFLAGS += -mlong-calls +# + +# +# Meanwhile, U-Boot rely on PIC. We add proper switches explicitly. +# +PLATFORM_CPPFLAGS += -G 0 -mabicalls -fpic -pipe +PLATFORM_CPPFLAGS += -msoft-float +PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib -- cgit v1.1 From de9a738faa7c2f47286119c3bfebc3dfbfe7d86d Mon Sep 17 00:00:00 2001 From: Vlad Lungu Date: Sun, 21 Oct 2007 22:10:10 +0900 Subject: [MIPS] Fix UNCACHED_SDRAM PHYSADDR is for physical address, KSEG1ADDR is for uncached. Signed-off-by: Vlad Lungu Signed-off-by: Shinya Kuribayashi --- include/asm-mips/addrspace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h index b8214b1..0e6abd7 100644 --- a/include/asm-mips/addrspace.h +++ b/include/asm-mips/addrspace.h @@ -49,7 +49,7 @@ cannot access physical memory directly from core */ #define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x20000000) #else /* !CONFIG_AU1X00 */ -#define UNCACHED_SDRAM(a) PHYSADDR(a) +#define UNCACHED_SDRAM(a) KSEG1ADDR(a) #endif /* CONFIG_AU1X00 */ #endif /* __ASSEMBLY__ */ /* -- cgit v1.1