提交 b83b4ee0 编写于 作者: M mbbill@gmail.com

add sam7x_rom.ld.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1483 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 1fb43c86
...@@ -61,6 +61,11 @@ void rt_init_thread_entry(void *parameter) ...@@ -61,6 +61,11 @@ void rt_init_thread_entry(void *parameter)
{ {
extern void lwip_sys_init(void); extern void lwip_sys_init(void);
eth_system_device_init();
/* register AT91 EMAC device */
sam7xether_register("E0");
/* init lwip system */ /* init lwip system */
lwip_sys_init(); lwip_sys_init();
rt_kprintf("TCP/IP initialized!\n"); rt_kprintf("TCP/IP initialized!\n");
......
...@@ -17,46 +17,7 @@ ...@@ -17,46 +17,7 @@
#include <rthw.h> #include <rthw.h>
#include <rtthread.h> #include <rtthread.h>
// These are defined in standard header (at91sam7x256.h) of realview MDK.
//#define AT91C_US_RXRDY ((unsigned int) 0x1 << 0) /* US RXRDY Interrupt */
//#define AT91C_US_TXRDY ((unsigned int) 0x1 << 1) /* US TXRDY Interrupt */
//#define AT91C_US_RSTRX ((unsigned int) 0x1 << 2) /* US Reset Receiver */
//#define AT91C_US_RSTTX ((unsigned int) 0x1 << 3) /* US Reset Transmitter */
//#define AT91C_US_RXEN ((unsigned int) 0x1 << 4) /* US Receiver Enable */
//#define AT91C_US_RXDIS ((unsigned int) 0x1 << 5) /* US Receiver Disable */
//#define AT91C_US_TXEN ((unsigned int) 0x1 << 6) /* US Transmitter Enable */
//#define AT91C_US_TXDIS ((unsigned int) 0x1 << 7) /* US Transmitter Disable */
//#define AT91C_US_RSTSTA ((unsigned int) 0x1 << 8) /* US Reset Status Bits */
//
//#define AT91C_US_USMODE_NORMAL ((unsigned int) 0x0) /* USAR) Normal */
//#define AT91C_US_USMODE_RS485 ((unsigned int) 0x1) /* USAR) RS485 */
//#define AT91C_US_USMODE_HWHSH ((unsigned int) 0x2) /* USAR) Hardware Handshaking */
//#define AT91C_US_USMODE_MODEM ((unsigned int) 0x3) /* USAR) Modem */
//#define AT91C_US_USMODE_ISO7816_0 ((unsigned int) 0x4) /* USAR) ISO7816 protocol: T = 0 */
//#define AT91C_US_USMODE_ISO7816_1 ((unsigned int) 0x6) /* USAR) ISO7816 protocol: T = 1 */
//#define AT91C_US_USMODE_IRDA ((unsigned int) 0x8) /* USAR) IrDA */
//#define AT91C_US_USMODE_SWHSH ((unsigned int) 0xC) /* USAR) Software Handshaking */
//
//#define AT91C_US_CLKS_CLOCK ((unsigned int) 0x0 << 4) /* USAR) Clock */
//#define AT91C_US_CLKS_FDIV1 ((unsigned int) 0x1 << 4) /* USAR) fdiv1 */
//#define AT91C_US_CLKS_SLOW ((unsigned int) 0x2 << 4) /* USAR) slow_clock (ARM) */
//#define AT91C_US_CLKS_EXT ((unsigned int) 0x3 << 4) /* USAR) External (SCK) */
//
//#define AT91C_US_CHRL_5_BITS ((unsigned int) 0x0 << 6) /* USAR) Character Length: 5 bits */
//#define AT91C_US_CHRL_6_BITS ((unsigned int) 0x1 << 6) /* USAR) Character Length: 6 bits */
//#define AT91C_US_CHRL_7_BITS ((unsigned int) 0x2 << 6) /* USAR) Character Length: 7 bits */
//#define AT91C_US_CHRL_8_BITS ((unsigned int) 0x3 << 6) /* USAR) Character Length: 8 bits */
//
//#define AT91C_US_PAR_EVEN ((unsigned int) 0x0 << 9) /* DBGU Even Parity */
//#define AT91C_US_PAR_ODD ((unsigned int) 0x1 << 9) /* DBGU Odd Parity */
//#define AT91C_US_PAR_SPACE ((unsigned int) 0x2 << 9) /* DBGU Parity forced to 0 (Space) */
//#define AT91C_US_PAR_MARK ((unsigned int) 0x3 << 9) /* DBGU Parity forced to 1 (Mark) */
//#define AT91C_US_PAR_NONE ((unsigned int) 0x4 << 9) /* DBGU No Parity */
//#define AT91C_US_PAR_MULTI_DROP ((unsigned int) 0x6 << 9) /* DBGU Multi-drop mode */
//
//#define AT91C_US_NBSTOP_1_BIT ((unsigned int) 0x0 << 12) /* USART 1 stop bit */
//#define AT91C_US_NBSTOP_15_BIT ((unsigned int) 0x1 << 12) /* USART Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits */
//#define AT91C_US_NBSTOP_2_BIT ((unsigned int) 0x2 << 12) /* USART 2 stop bits */
#define MCK 48054857 #define MCK 48054857
#define BR 115200 /* Baud Rate */ #define BR 115200 /* Baud Rate */
......
...@@ -32,7 +32,7 @@ if PLATFORM == 'gcc': ...@@ -32,7 +32,7 @@ if PLATFORM == 'gcc':
DEVICE = ' -mcpu=arm7tdmi' DEVICE = ' -mcpu=arm7tdmi'
CFLAGS = DEVICE CFLAGS = DEVICE
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=sam7x_rom_gcc.map,-cref,-u,_start -T sam7x_rom.lds' LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=sam7x_rom_gcc.map,-cref,-u,_start -T sam7x_rom.ld'
CPATH = '' CPATH = ''
LPATH = '' LPATH = ''
...@@ -42,7 +42,7 @@ if PLATFORM == 'gcc': ...@@ -42,7 +42,7 @@ if PLATFORM == 'gcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread-sam7x.bin\n' + SIZE + ' $TARGET \n' POST_ACTION = OBJCPY + ' -O ihex $TARGET rtthread-sam7x.hex\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc': elif PLATFORM == 'armcc':
# toolchains # toolchains
...@@ -69,7 +69,7 @@ elif PLATFORM == 'armcc': ...@@ -69,7 +69,7 @@ elif PLATFORM == 'armcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET' POST_ACTION = 'fromelf --hex $TARGET --output rtthread-asm7x.hex \nfromelf -z $TARGET'
elif PLATFORM == 'iar': elif PLATFORM == 'iar':
# toolchains # toolchains
......
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
MEMORY
{
DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x00010000
}
ENTRY(_start)
SECTIONS
{
.text :
{
*(.init)
*(.text)
} > DATA = 0
. = ALIGN(4);
.rodata :
{
*(.rodata)
} > DATA
. = ALIGN(4);
.data :
{
*(.data)
} > DATA
. = ALIGN(4);
__bss_start = .;
.bss :
{
*(.bss)
} > DATA
__bss_end = .;
_end = .;
}
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
MEMORY
{
CODE (rx) : ORIGIN = 0x00100000, LENGTH = 0x00040000
/* DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x00010000 */
DATA (rw) : ORIGIN = 0x00204000, LENGTH = 0x0000C000
}
ENTRY(_start)
SECTIONS
{
.text :
{
*(.init)
*(.text)
*(.rodata)
/* section information for finsh shell */
. = ALIGN(4);
__fsymtab_start = .;
KEEP(*(FSymTab))
__fsymtab_end = .;
. = ALIGN(4);
__vsymtab_start = .;
KEEP(*(VSymTab))
__vsymtab_end = .;
. = ALIGN(4);
} > CODE = 0
. = ALIGN(4);
.ctors :
{
PROVIDE(__ctors_start__ = .);
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .);
} > CODE
.dtors :
{
PROVIDE(__dtors_start__ = .);
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
PROVIDE(__dtors_end__ = .);
} > CODE
/* .ARM.exidx is sorted, so has to go in its own output section. */
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
/* This is used by the startup in order to initialize the .data secion */
_sidata = .;
} > CODE
__exidx_end = .;
/* .data section which is used for initialized data */
.data : AT (_sidata)
{
. = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */
_sdata = . ;
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
. = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */
_edata = . ;
} >DATA
__data_end = .;
.noinit :
{
*(.bss.noinit)
} > DATA
__bss_start = .;
.bss :
{
. = ALIGN(4);
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .;
*(.bss)
*(COMMON)
. = ALIGN(4);
/* This is used by the startup in order to initialize the .bss secion */
_ebss = . ;
_estack = .;
} > DATA
__bss_end = .;
_end = .;
}
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
MEMORY
{
CODE (rx) : ORIGIN = 0x00100000, LENGTH = 0x00040000
DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x00010000
}
ENTRY(_start)
SECTIONS
{
.text :
{
*(.init)
*(.text)
/* section information for finsh shell */
. = ALIGN(4);
__fsymtab_start = .;
KEEP(*(FSymTab))
__fsymtab_end = .;
. = ALIGN(4);
__vsymtab_start = .;
KEEP(*(VSymTab))
__vsymtab_end = .;
. = ALIGN(4);
} > CODE = 0
. = ALIGN(4);
.rodata :
{
*(.rodata)
} > CODE
. = ALIGN(4);
.data :
{
*(.data)
} > DATA
. = ALIGN(4);
__bss_start = .;
.bss :
{
*(.bss)
} > DATA
__bss_end = .;
_end = .;
}
...@@ -113,13 +113,6 @@ void rtthread_startup(void) ...@@ -113,13 +113,6 @@ void rtthread_startup(void)
/* init hardware serial device */ /* init hardware serial device */
rt_hw_serial_init(); rt_hw_serial_init();
#ifdef RT_USING_LWIP
eth_system_device_init();
/* register AT91 EMAC device */
sam7xether_register("E0");
#endif
#ifdef RT_USING_DFS #ifdef RT_USING_DFS
rt_hw_sdcard_init(); rt_hw_sdcard_init();
#endif #endif
...@@ -147,6 +140,7 @@ void rtthread_startup(void) ...@@ -147,6 +140,7 @@ void rtthread_startup(void)
return ; return ;
} }
#ifdef __CC_ARM
int main (void) int main (void)
{ {
/* invoke rtthread_startup */ /* invoke rtthread_startup */
...@@ -154,5 +148,6 @@ int main (void) ...@@ -154,5 +148,6 @@ int main (void)
return 0; return 0;
} }
#endif
/*@}*/ /*@}*/
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册