Commit eb658cfa authored by Miles Bader's avatar Miles Bader Committed by Linus Torvalds

[PATCH] Changes to v850 platform linker-script fragments

This does two things:

 (1) Move the v850 platform-specific linker-script fragments into
     arch/v850/kernel, from arch/v850.  This move was prompted by a
     recent (all-architecture) move for vmlinux.lds.S, to keep the
     script together, but I think it also makes sense -- this way, all
     platform-specific non-header files are in the same directory with
     similar names.

 (2) Remove some hardwired constants in the linker script fragments,
     using already defined cpp macros anyway.  This eliminates one
     annoying source of duplicate definitions (which had to be kept in
     sync).
parent 91cdee4c
...@@ -6,9 +6,9 @@ MEMORY { ...@@ -6,9 +6,9 @@ MEMORY {
ROM : ORIGIN = 0, LENGTH = 0x00800000 ROM : ORIGIN = 0, LENGTH = 0x00800000
/* 1MB of static RAM. This memory is mirrored 64 times. */ /* 1MB of static RAM. This memory is mirrored 64 times. */
SRAM : ORIGIN = 0x04000000, LENGTH = 0x00100000 SRAM : ORIGIN = SRAM_ADDR, LENGTH = SRAM_SIZE
/* 64MB of DRAM. */ /* 64MB of DRAM. */
SDRAM : ORIGIN = 0x08000000, LENGTH = 0x04000000 SDRAM : ORIGIN = SDRAM_ADDR, LENGTH = SDRAM_SIZE
} }
SECTIONS { SECTIONS {
......
...@@ -8,9 +8,9 @@ MEMORY { ...@@ -8,9 +8,9 @@ MEMORY {
iMEM1 : ORIGIN = 0x00040000, LENGTH = 0x00040000 iMEM1 : ORIGIN = 0x00040000, LENGTH = 0x00040000
/* 1MB of static RAM. This memory is mirrored 64 times. */ /* 1MB of static RAM. This memory is mirrored 64 times. */
SRAM : ORIGIN = 0x04000000, LENGTH = 0x00100000 SRAM : ORIGIN = SRAM_ADDR, LENGTH = SRAM_SIZE
/* 64MB of DRAM. */ /* 64MB of DRAM. */
SDRAM : ORIGIN = 0x08000000, LENGTH = 0x04000000 SDRAM : ORIGIN = SDRAM_ADDR, LENGTH = SDRAM_SIZE
} }
SECTIONS { SECTIONS {
......
...@@ -6,14 +6,14 @@ MEMORY { ...@@ -6,14 +6,14 @@ MEMORY {
ROM : ORIGIN = 0, LENGTH = 0x00400000 ROM : ORIGIN = 0, LENGTH = 0x00400000
/* 1MB of static RAM. */ /* 1MB of static RAM. */
SRAM : ORIGIN = 0x00400000, LENGTH = 0x00100000 SRAM : ORIGIN = SRAM_ADDR, LENGTH = SRAM_SIZE
/* About 58MB of DRAM. This can actually be at one of two /* About 58MB of DRAM. This can actually be at one of two
positions, determined by jumper JP3; we have to use the first positions, determined by jumper JP3; we have to use the first
position because the second is partially out of processor position because the second is partially out of processor
instruction addressing range (though in the second position instruction addressing range (though in the second position
there's actually 64MB available). */ there's actually 64MB available). */
SDRAM : ORIGIN = 0x00600000, LENGTH = 0x039F8000 SDRAM : ORIGIN = SDRAM_ADDR, LENGTH = SDRAM_SIZE
} }
SECTIONS { SECTIONS {
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
(CONFIG_V850E_AS85EP1). */ (CONFIG_V850E_AS85EP1). */
MEMORY { MEMORY {
/* 1MB of internal memory ($BFbB"L?Na(BRAM). */ /* 1MB of internal memory (Æâ¢̿ÎáRAM). */
iMEM0 : ORIGIN = 0, LENGTH = 0x00100000 iMEM0 : ORIGIN = 0, LENGTH = 0x00100000
/* 1MB of static RAM. */ /* 1MB of static RAM. */
SRAM : ORIGIN = 0x00400000, LENGTH = 0x00100000 SRAM : ORIGIN = SRAM_ADDR, LENGTH = SRAM_SIZE
/* About 58MB of DRAM. This can actually be at one of two /* About 58MB of DRAM. This can actually be at one of two
positions, determined by jump JP3; we have to use the first positions, determined by jump JP3; we have to use the first
position because the second is partially out of processor position because the second is partially out of processor
instruction addressing range (though in the second position instruction addressing range (though in the second position
there's actually 64MB available). */ there's actually 64MB available). */
SDRAM : ORIGIN = 0x00600000, LENGTH = 0x039F8000 SDRAM : ORIGIN = SDRAM_ADDR, LENGTH = SDRAM_SIZE
} }
SECTIONS { SECTIONS {
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
MEMORY { MEMORY {
ROM : ORIGIN = 0x00000000, LENGTH = 0x00100000 ROM : ORIGIN = 0x00000000, LENGTH = 0x00100000
/* 1MB of SRAM. This memory is mirrored 4 times. */ /* 1MB of SRAM. This memory is mirrored 4 times. */
SRAM : ORIGIN = 0x00400000, LENGTH = 0x00100000 SRAM : ORIGIN = SRAM_ADDR, LENGTH = SRAM_SIZE
/* 32MB of SDRAM. */ /* 32MB of SDRAM. */
SDRAM : ORIGIN = 0x00800000, LENGTH = 0x02000000 SDRAM : ORIGIN = SDRAM_ADDR, LENGTH = SDRAM_SIZE
} }
SECTIONS { SECTIONS {
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
MEMORY { MEMORY {
/* 1MB of SRAM; we can't use the last 32KB, because it's used by /* 1MB of SRAM; we can't use the last 32KB, because it's used by
the monitor scratch-RAM. This memory is mirrored 4 times. */ the monitor scratch-RAM. This memory is mirrored 4 times. */
SRAM : ORIGIN = 0x00400000, LENGTH = 0x000F8000 SRAM : ORIGIN = SRAM_ADDR, LENGTH = (SRAM_SIZE - MON_SCRATCH_SIZE)
/* Monitor scratch RAM; only the interrupt vectors should go here. */ /* Monitor scratch RAM; only the interrupt vectors should go here. */
MRAM : ORIGIN = 0x004F8000, LENGTH = 0x00008000 MRAM : ORIGIN = MON_SCRATCH_ADDR, LENGTH = MON_SCRATCH_SIZE
/* 32MB of SDRAM. */ /* 32MB of SDRAM. */
SDRAM : ORIGIN = 0x00800000, LENGTH = 0x02000000 SDRAM : ORIGIN = SDRAM_ADDR, LENGTH = SDRAM_SIZE
} }
#ifdef CONFIG_RTE_CB_MA1_KSRAM #ifdef CONFIG_RTE_CB_MA1_KSRAM
......
...@@ -6,7 +6,7 @@ MEMORY { ...@@ -6,7 +6,7 @@ MEMORY {
IRAM : ORIGIN = 0x00000000, LENGTH = 0x00020000 IRAM : ORIGIN = 0x00000000, LENGTH = 0x00020000
/* 32MB of SDRAM. */ /* 32MB of SDRAM. */
SDRAM : ORIGIN = 0x00800000, LENGTH = 0x02000000 SDRAM : ORIGIN = SDRAM_ADDR, LENGTH = SDRAM_SIZE
} }
#define KRAM SDRAM #define KRAM SDRAM
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
MEMORY { MEMORY {
/* 1MB of SRAM; we can't use the last 96KB, because it's used by /* 1MB of SRAM; we can't use the last 96KB, because it's used by
the monitor scratch-RAM. This memory is mirrored 4 times. */ the monitor scratch-RAM. This memory is mirrored 4 times. */
SRAM : ORIGIN = 0x03C00000, LENGTH = 0x000E8000 SRAM : ORIGIN = SRAM_ADDR, LENGTH = (SRAM_SIZE - MON_SCRATCH_SIZE)
/* Monitor scratch RAM; only the interrupt vectors should go here. */ /* Monitor scratch RAM; only the interrupt vectors should go here. */
MRAM : ORIGIN = 0x03CE8000, LENGTH = 0x00018000 MRAM : ORIGIN = MON_SCRATCH_ADDR, LENGTH = MON_SCRATCH_SIZE
/* 16MB of SDRAM. */ /* 16MB of SDRAM. */
SDRAM : ORIGIN = 0x01000000, LENGTH = 0x01000000 SDRAM : ORIGIN = SDRAM_ADDR, LENGTH = SDRAM_SIZE
} }
#ifdef CONFIG_RTE_CB_NB85E_KSRAM #ifdef CONFIG_RTE_CB_NB85E_KSRAM
......
...@@ -3,13 +3,10 @@ ...@@ -3,13 +3,10 @@
MEMORY { MEMORY {
LOW : ORIGIN = 0x0, LENGTH = 0x00100000 LOW : ORIGIN = 0x0, LENGTH = 0x00100000
/* 1MB of SRAM; we can't use the last 96KB, because it's used by /* 1MB of SRAM This memory is mirrored 4 times. */
the monitor scratch-RAM. This memory is mirrored 4 times. */ SRAM : ORIGIN = SRAM_ADDR, LENGTH = SRAM_SIZE
SRAM : ORIGIN = 0x03C00000, LENGTH = 0x000E8000
/* Monitor scratch RAM; only the interrupt vectors should go here. */
MRAM : ORIGIN = 0x03CE8000, LENGTH = 0x00018000
/* 16MB of SDRAM. */ /* 16MB of SDRAM. */
SDRAM : ORIGIN = 0x01000000, LENGTH = 0x01000000 SDRAM : ORIGIN = SDRAM_ADDR, LENGTH = SDRAM_SIZE
} }
#ifdef CONFIG_RTE_CB_NB85E_KSRAM #ifdef CONFIG_RTE_CB_NB85E_KSRAM
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
MEMORY { MEMORY {
/* Interrupt vectors. */ /* Interrupt vectors. */
INTV : ORIGIN = 0x0, LENGTH = 0xe0 INTV : ORIGIN = 0x0, LENGTH = 0xe0
/* 16MB of RAM. /* Main RAM. */
This must match RAM_ADDR and RAM_SIZE in include/asm-v850/sim.h */ RAM : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
RAM : ORIGIN = 0x8F000000, LENGTH = 0x01000000
} }
SECTIONS { SECTIONS {
......
...@@ -3,26 +3,18 @@ ...@@ -3,26 +3,18 @@
MEMORY { MEMORY {
/* 1MB of `instruction RAM', starting at 0. /* 1MB of `instruction RAM', starting at 0.
Instruction fetches are much faster from IRAM than from DRAM. Instruction fetches are much faster from IRAM than from DRAM. */
This should match IRAM_ADDR in "include/asm-v580/sim85e2c.h". */ IRAM : ORIGIN = IRAM_ADDR, LENGTH = IRAM_SIZE
IRAM : ORIGIN = 0x00000000, LENGTH = 0x00100000
/* 1MB of `data RAM', below and contiguous with the I/O space. /* 1MB of `data RAM', below and contiguous with the I/O space.
Data fetches are much faster from DRAM than from IRAM. Data fetches are much faster from DRAM than from IRAM. */
This should match DRAM_ADDR in "include/asm-v580/sim85e2c.h". */ DRAM : ORIGIN = DRAM_ADDR, LENGTH = DRAM_SIZE
DRAM : ORIGIN = 0xfff00000, LENGTH = 0x000ff000
/* We have to load DRAM at a mirror-address of 0x1ff00000,
because the simulator's preprocessing script isn't smart
enough to deal with the above LMA. */
DRAM_LOAD : ORIGIN = 0x1ff00000, LENGTH = 0x000ff000
/* `external ram' (CS1 area), comes after IRAM. /* `external ram' (CS1 area), comes after IRAM. */
This should match ERAM_ADDR in "include/asm-v580/sim85e2c.h". */ ERAM : ORIGIN = ERAM_ADDR, LENGTH = ERAM_SIZE
ERAM : ORIGIN = 0x00100000, LENGTH = 0x07f00000
/* Dynamic RAM; uses memory controller. */ /* Dynamic RAM; uses memory controller. */
/* SDRAM : ORIGIN = 0x10000000, LENGTH = 0x01000000 */ SDRAM : ORIGIN = SDRAM_ADDR, LENGTH = SDRAM_SIZE
SDRAM : ORIGIN = 0x10000000, LENGTH = 0x00200000/*use 2MB*/
} }
SECTIONS { SECTIONS {
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
#include <linux/config.h> #include <linux/config.h>
#include <asm-generic/vmlinux.lds.h> #include <asm-generic/vmlinux.lds.h>
/* For most platforms, this will define useful things like RAM addr/size. */
#include <asm/machdep.h>
/* The following macros contain the usual definitions for various data areas. /* The following macros contain the usual definitions for various data areas.
The prefix `RAMK_' is used to indicate macros suitable for kernels loaded The prefix `RAMK_' is used to indicate macros suitable for kernels loaded
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment