From 885301bb14f34e840beb14ca2ee1b7b28012e294 Mon Sep 17 00:00:00 2001 From: weety Date: Sun, 21 Jul 2013 15:01:42 +0800 Subject: [PATCH 1/5] =?UTF-8?q?update=20AT91SAM9260=20usart=20driver?= =?UTF-8?q?=EF=BC=8C=20using=20serial=20driver=20component.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/at91sam9260/SConscript | 2 +- bsp/at91sam9260/board.c | 223 +-------------- bsp/at91sam9260/board.h | 2 - bsp/at91sam9260/console.c | 180 ------------ bsp/at91sam9260/rtconfig.h | 20 +- bsp/at91sam9260/startup.c | 57 +--- bsp/at91sam9260/usart.c | 413 +++++++++++++++++++++++++++ libcpu/arm/at91sam926x/at91sam926x.h | 3 +- libcpu/arm/at91sam926x/serial.c | 282 ------------------ libcpu/arm/at91sam926x/serial.h | 76 ----- 10 files changed, 436 insertions(+), 822 deletions(-) delete mode 100755 bsp/at91sam9260/console.c create mode 100644 bsp/at91sam9260/usart.c delete mode 100755 libcpu/arm/at91sam926x/serial.c delete mode 100755 libcpu/arm/at91sam926x/serial.h diff --git a/bsp/at91sam9260/SConscript b/bsp/at91sam9260/SConscript index 4fe0f874fc..c754911e9d 100755 --- a/bsp/at91sam9260/SConscript +++ b/bsp/at91sam9260/SConscript @@ -3,7 +3,7 @@ Import('RTT_ROOT') from building import * src_bsp = ['application.c', 'startup.c', 'board.c'] -src_drv = ['console.c'] +src_drv = ['usart.c'] if GetDepend('RT_USING_LED'): src_drv += ['led.c'] diff --git a/bsp/at91sam9260/board.c b/bsp/at91sam9260/board.c index 1ea8bfa5c6..81f156d158 100755 --- a/bsp/at91sam9260/board.c +++ b/bsp/at91sam9260/board.c @@ -29,218 +29,7 @@ extern void rt_hw_mmu_init(void); extern void rt_hw_get_clock(void); extern void rt_hw_set_dividor(rt_uint8_t hdivn, rt_uint8_t pdivn); extern void rt_hw_set_clock(rt_uint8_t sdiv, rt_uint8_t pdiv, rt_uint8_t mdiv); - -/*set debug serial port*/ -//#define USE_UART1 -//#define USE_UART3 -//#define USE_DBGU - -#define DBGU ((struct uartport *)0xfffff200) -#define UART0 ((struct uartport *)AT91SAM9260_BASE_US0) -#define UART1 ((struct uartport *)AT91SAM9260_BASE_US1) -#define UART2 ((struct uartport *)AT91SAM9260_BASE_US2) -#define UART3 ((struct uartport *)AT91SAM9260_BASE_US3) -#define UART4 ((struct uartport *)AT91SAM9260_BASE_US4) -#define UART5 ((struct uartport *)AT91SAM9260_BASE_US5) - -struct serial_int_rx uart0_int_rx; -struct serial_device uart0 = -{ - DBGU, - &uart0_int_rx, - RT_NULL -}; -struct rt_device uart0_device; - -struct serial_int_rx uart1_int_rx; -struct serial_device uart1 = -{ - UART0, - &uart1_int_rx, - RT_NULL -}; -struct rt_device uart1_device; - -struct serial_int_rx uart2_int_rx; -struct serial_device uart2 = -{ - UART1, - &uart2_int_rx, - RT_NULL -}; -struct rt_device uart2_device; - -struct serial_int_rx uart3_int_rx; -struct serial_device uart3 = -{ - UART2, - &uart3_int_rx, - RT_NULL -}; -struct rt_device uart3_device; - -struct serial_int_rx uart4_int_rx; -struct serial_device uart4 = -{ - UART3, - &uart4_int_rx, - RT_NULL -}; -struct rt_device uart4_device; - - -/** - * This function will handle serial - */ -void rt_serial_handler(int vector, void *param) -{ - int status; - struct rt_device *dev = (rt_device_t)param; - - switch (vector) - { - #ifdef RT_USING_UART0 - case AT91SAM9260_ID_US0: - status = readl(AT91SAM9260_BASE_US0+AT91_US_CSR); - if (!(status & readl(AT91SAM9260_BASE_US0+AT91_US_IMR))) - { - return; - } - rt_hw_serial_isr(dev); - break; - #endif - #ifdef RT_USING_UART1 - case AT91SAM9260_ID_US1: - status = readl(AT91SAM9260_BASE_US1+AT91_US_CSR); - if (!(status & readl(AT91SAM9260_BASE_US1+AT91_US_IMR))) - { - return; - } - rt_hw_serial_isr(dev); - break; - #endif - #ifdef RT_USING_UART2 - case AT91SAM9260_ID_US2: - status = readl(AT91SAM9260_BASE_US2+AT91_US_CSR); - if (!(status & readl(AT91SAM9260_BASE_US2+AT91_US_IMR))) - { - return; - } - rt_hw_serial_isr(dev); - break; - #endif - #ifdef RT_USING_UART3 - case AT91SAM9260_ID_US3: - status = readl(AT91SAM9260_BASE_US3+AT91_US_CSR); - if (!(status & readl(AT91SAM9260_BASE_US3+AT91_US_IMR))) - { - return; - } - rt_hw_serial_isr(dev); - break; - #endif - default: break; - } - -} - -void uart_port_init(rt_uint32_t base) -{ - #define BAUDRATE 115200 - rt_uint32_t cd; - - writel(AT91_US_RSTTX | AT91_US_RSTRX | - AT91_US_RXDIS | AT91_US_TXDIS, - base + AT91_US_CR); - writel( AT91_US_USMODE_NORMAL | AT91_US_USCLKS_MCK | - AT91_US_CHRL_8 | AT91_US_PAR_NONE | - AT91_US_NBSTOP_1 | AT91_US_CHMODE_NORMAL, - base + AT91_US_MR); - cd = (clk_get_rate(clk_get("mck")) / 16 + BAUDRATE/2) / BAUDRATE; - writel(cd, base + AT91_US_BRGR); - writel(AT91_US_RXEN | AT91_US_TXEN, base + AT91_US_CR); - - writel(0x1, base + AT91_US_IER); -} - -/** - * This function will handle init uart - */ -void rt_hw_uart_init(void) -{ -#ifdef RT_USING_UART0 - at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_US0); - at91_sys_write(AT91_PIOB + PIO_IDR, (1<<4)|(1<<5)); - at91_sys_write(AT91_PIOB + PIO_PUER, (1<<4)); - at91_sys_write(AT91_PIOB + PIO_PUDR, (1<<5)); - at91_sys_write(AT91_PIOB + PIO_ASR, (1<<4)|(1<<5)); - at91_sys_write(AT91_PIOB + PIO_PDR, (1<<4)|(1<<5)); - uart_port_init(AT91SAM9260_BASE_US0); - /* install interrupt handler */ - rt_hw_interrupt_install(AT91SAM9260_ID_US0, rt_serial_handler, - (void *)&uart1_device, "UART0"); - rt_hw_interrupt_umask(AT91SAM9260_ID_US0); -#endif -#ifdef RT_USING_UART1 - at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_US1); - at91_sys_write(AT91_PIOB + PIO_IDR, (1<<6)|(1<<7)); - at91_sys_write(AT91_PIOB + PIO_PUER, (1<<6)); - at91_sys_write(AT91_PIOB + PIO_PUDR, (1<<7)); - at91_sys_write(AT91_PIOB + PIO_ASR, (1<<6)|(1<<7)); - at91_sys_write(AT91_PIOB + PIO_PDR, (1<<6)|(1<<7)); - uart_port_init(AT91SAM9260_BASE_US1); - /* install interrupt handler */ - rt_hw_interrupt_install(AT91SAM9260_ID_US1, rt_serial_handler, - (void *)&uart2_device, "UART1"); - rt_hw_interrupt_umask(AT91SAM9260_ID_US1); -#endif -#ifdef RT_USING_UART2 - at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_US2); - at91_sys_write(AT91_PIOB + PIO_IDR, (1<<8)|(1<<9)); - at91_sys_write(AT91_PIOB + PIO_PUER, (1<<8)); - at91_sys_write(AT91_PIOB + PIO_PUDR, (1<<9)); - at91_sys_write(AT91_PIOB + PIO_ASR, (1<<8)|(1<<9)); - at91_sys_write(AT91_PIOB + PIO_PDR, (1<<8)|(1<<9)); - uart_port_init(AT91SAM9260_BASE_US2); - /* install interrupt handler */ - rt_hw_interrupt_install(AT91SAM9260_ID_US2, rt_serial_handler, - (void *)&uart3_device, "UART2"); - rt_hw_interrupt_umask(AT91SAM9260_ID_US2); -#endif -#ifdef RT_USING_UART3 - at91_sys_write(AT91_PMC_PCER, 1<> 20) @@ -254,12 +43,13 @@ static rt_uint32_t pit_cnt; /* access only w/system irq blocked */ void rt_timer_handler(int vector, void *param) { #ifdef RT_USING_DBGU - if (at91_sys_read(AT91_DBGU + AT91_US_CSR) & 0x1) { - //rt_kprintf("DBGU interrupt occur\n"); - rt_hw_serial_isr(&uart0_device); + if (at91_sys_read(AT91_DBGU + AT91_US_CSR) & 0x1) + { + rt_dbgu_isr(); } #endif - if (at91_sys_read(AT91_PIT_SR) & AT91_PIT_PITS) { + if (at91_sys_read(AT91_PIT_SR) & AT91_PIT_PITS) + { unsigned nr_ticks; /* Get number of ticks performed before irq, and ack it */ @@ -339,6 +129,7 @@ void rt_hw_board_init() /* initialize uart */ rt_hw_uart_init(); + rt_console_set_device(RT_CONSOLE_DEVICE_NAME); /* initialize mmu */ rt_hw_mmu_init(); diff --git a/bsp/at91sam9260/board.h b/bsp/at91sam9260/board.h index 39764aff39..59992480ed 100755 --- a/bsp/at91sam9260/board.h +++ b/bsp/at91sam9260/board.h @@ -16,9 +16,7 @@ #define __BOARD_H__ #include -#include void rt_hw_board_init(void); -//void rt_hw_sdcard_init(void); #endif diff --git a/bsp/at91sam9260/console.c b/bsp/at91sam9260/console.c deleted file mode 100755 index 03836fb014..0000000000 --- a/bsp/at91sam9260/console.c +++ /dev/null @@ -1,180 +0,0 @@ -#include - -#include - -#define RT_CONSOLE_WIDTH 240 -#define RT_CONSOLE_HEIGHT 320 - -#define RT_CONSOLE_FONT_WIDTH 8 -#define RT_CONSOLE_FONT_HEIGHT 16 - -#define RT_CONSOLE_COL (RT_CONSOLE_WIDTH/RT_CONSOLE_FONT_WIDTH) -#define RT_CONSOLE_ROW (RT_CONSOLE_HEIGHT/RT_CONSOLE_FONT_HEIGHT) - -#define RT_CONSOLE_TAB 4 - -#define RT_CONSOLE_FOREPIXEL (0x001f) - -extern struct serial_device uart0; - -struct rt_console -{ - rt_uint8_t* video_ptr; - rt_uint8_t* font_ptr; - - /* bpp and pixel of width */ - rt_uint8_t bpp; - rt_uint32_t pitch; - - /* current cursor */ - rt_uint8_t current_col; - rt_uint8_t current_row; -}; -struct rt_console console; - -void rt_hw_console_init(rt_uint8_t* video_ptr, rt_uint8_t* font_ptr, rt_uint8_t bpp); -void rt_hw_console_newline(void); -void rt_hw_console_putc(char c); -void rt_hw_console_clear(void); - -void rt_hw_console_init(rt_uint8_t* video_ptr, rt_uint8_t* font_ptr, rt_uint8_t bpp) -{ - rt_memset(&console, 0, sizeof(struct rt_console)); - - console.video_ptr = video_ptr; - console.font_ptr = font_ptr; - console.bpp = bpp; - console.pitch = console.bpp * RT_CONSOLE_WIDTH; - - rt_hw_console_clear(); -} - -void rt_hw_console_putc(char c) -{ - switch (c) - { - case 10: - case 11: - case 12: - case 13: - /* to next line */ - rt_hw_console_newline(); - console.current_col = 0; - break; - - case 9: - console.current_col += RT_CONSOLE_TAB; - break; - - default: - { - rt_uint8_t* font_ptr; - register rt_uint32_t cursor; - register rt_uint32_t i, j; - - if (console.current_col == RT_CONSOLE_COL) - { - rt_hw_console_newline(); - console.current_col = 0; - - rt_hw_console_putc(c); - return; - } - - font_ptr = console.font_ptr + c * RT_CONSOLE_FONT_HEIGHT; - cursor = (console.current_row * RT_CONSOLE_FONT_HEIGHT) * console.pitch - + console.current_col * RT_CONSOLE_FONT_WIDTH * console.bpp; - - for (i = 0; i < RT_CONSOLE_FONT_HEIGHT; i ++ ) - { - for (j = 0; j < RT_CONSOLE_FONT_WIDTH; j ++) - { - if ( ((font_ptr[i] >> (7-j)) & 0x01) != 0 ) - { - /* draw a pixel */ - rt_uint8_t *ptr = &(console.video_ptr[cursor + i * console.pitch + j * console.bpp]); - switch(console.bpp) - { - case 1: - *ptr = RT_CONSOLE_FOREPIXEL; - break; - case 2: - *(rt_uint16_t*)ptr = RT_CONSOLE_FOREPIXEL; - break; - case 3: - ptr[0] = RT_CONSOLE_FOREPIXEL & 0xff; - ptr[1] = (RT_CONSOLE_FOREPIXEL >> 8) & 0xff; - ptr[2] = (RT_CONSOLE_FOREPIXEL >> 16) & 0xff; - break; - case 4: - *(rt_uint32_t*)ptr = RT_CONSOLE_FOREPIXEL; - break; - } - } - } - } - - console.current_col ++; - } - break; - } -} - -void rt_hw_console_newline() -{ - console.current_row ++; - if (console.current_row >= RT_CONSOLE_ROW) - { - rt_uint32_t i; - - /* scroll to next line */ - for (i = 0; i < RT_CONSOLE_ROW - 1; i ++) - { - rt_memcpy(console.video_ptr + i * RT_CONSOLE_FONT_HEIGHT * console.pitch, - console.video_ptr + (i + 1) * RT_CONSOLE_FONT_HEIGHT * console.pitch, - RT_CONSOLE_FONT_HEIGHT * console.pitch); - } - - /* clear last line */ - rt_memset(console.video_ptr + (RT_CONSOLE_ROW - 1) * RT_CONSOLE_FONT_HEIGHT * console.pitch, - 0, - RT_CONSOLE_FONT_HEIGHT * console.pitch); - - console.current_row = RT_CONSOLE_ROW - 1; - } -} - -void rt_hw_console_clear() -{ - console.current_col = 0; - console.current_row = 0; - - rt_memset(console.video_ptr, 0, RT_CONSOLE_HEIGHT * console.pitch); -} - -/* write one character to serial, must not trigger interrupt */ -void rt_hw_serial_putc(const char c) -{ - /* - to be polite with serial console add a line feed - to the carriage return character - */ - if (c=='\n')rt_hw_serial_putc('\r'); - - while (!(uart0.uart_device->USART_CSR & TXRDY)); - uart0.uart_device->USART_THR = (c & 0x1FF); -} - -/** - * This function is used by rt_kprintf to display a string on console. - * - * @param str the displayed string - */ -void rt_hw_console_output(const char* str) -{ - while (*str) - { - rt_hw_serial_putc(*str++); - } -} - diff --git a/bsp/at91sam9260/rtconfig.h b/bsp/at91sam9260/rtconfig.h index ab5f3e5c51..176c84c0a0 100755 --- a/bsp/at91sam9260/rtconfig.h +++ b/bsp/at91sam9260/rtconfig.h @@ -62,18 +62,27 @@ /* Using SLAB Allocator */ #define RT_USING_SLAB -/* SECTION: Device System */ -/* Using Device System */ -#define RT_USING_DEVICE +/* SECTION: the runtime libc library */ +/* the runtime libc library */ +#define RT_USING_NEWLIB +#define RT_USING_PTHREADS /* Using Module System */ #define RT_USING_MODULE #define RT_USING_LIBDL +/* SECTION: Device System */ +/* Using Device System */ +#define RT_USING_DEVICE + +#define RT_USING_DEVICE_IPC +#define RT_USING_SERIAL + /* SECTION: Console options */ #define RT_USING_CONSOLE /* the buffer size of console */ #define RT_CONSOLEBUF_SIZE 128 +#define RT_CONSOLE_DEVICE_NAME "dbgu" /* SECTION: finsh, a C-Express shell */ /* Using FinSH as Shell*/ @@ -83,11 +92,6 @@ #define FINSH_USING_DESCRIPTION #define FINSH_THREAD_STACK_SIZE 4096 -/* SECTION: the runtime libc library */ -/* the runtime libc library */ -#define RT_USING_NEWLIB -#define RT_USING_PTHREADS - /* SECTION: C++ support */ /* Using C++ support */ /* #define RT_USING_CPLUSPLUS */ diff --git a/bsp/at91sam9260/startup.c b/bsp/at91sam9260/startup.c index 3e3d85cd2e..2a06126b36 100755 --- a/bsp/at91sam9260/startup.c +++ b/bsp/at91sam9260/startup.c @@ -19,14 +19,8 @@ #ifdef RT_USING_FINSH #include #endif - -#ifdef RT_USING_DEVICE -#include -#endif - extern void rt_hw_interrupt_init(void); extern void rt_hw_board_init(void); -extern void rt_serial_init(void); extern void rt_system_timer_init(void); extern void rt_system_scheduler_init(void); extern void rt_thread_idle_init(void); @@ -37,9 +31,6 @@ extern void rt_system_heap_init(void*, void*); extern void rt_hw_finsh_init(void); extern void rt_application_init(void); -extern struct serial_device uart0; -extern struct rt_device uart0_device; - /** * @addtogroup at91sam9260 */ @@ -109,50 +100,6 @@ void rtthread_startup(void) /* initialize scheduler system */ rt_system_scheduler_init(); -#ifdef RT_USING_DEVICE -#ifdef RT_USING_DBGU - /* register dbgu */ - rt_hw_serial_register(&uart0_device, "uart0", - RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_INT_RX, - &uart0); -#endif - -#ifdef RT_USING_UART0 - /* register uart0 */ - rt_hw_serial_register(&uart1_device, "uart1", - RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_INT_RX, - &uart1); -#endif - -#ifdef RT_USING_UART1 - /* register uart1 */ - rt_hw_serial_register(&uart2_device, "uart2", - RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_INT_RX, - &uart2); -#endif - -#ifdef RT_USING_UART2 - /* register uart2 */ - rt_hw_serial_register(&uart3_device, "uart3", - RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_INT_RX, - &uart3); -#endif - -#ifdef RT_USING_UART3 - /* register uart3 */ - rt_hw_serial_register(&uart4_device, "uart4", - RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_INT_RX, - &uart4); -#endif - -#ifdef RT_USING_DFS - //rt_hw_sdcard_init(); -#endif - - /*init all registed devices */ - rt_device_init_all(); -#endif - /* initialize application */ rt_application_init(); @@ -160,9 +107,7 @@ void rtthread_startup(void) /* initialize finsh */ finsh_system_init(); #ifdef RT_USING_DEVICE -#ifdef RT_USING_DBGU - finsh_set_device("uart0"); -#endif + finsh_set_device(RT_CONSOLE_DEVICE_NAME); #endif #endif diff --git a/bsp/at91sam9260/usart.c b/bsp/at91sam9260/usart.c new file mode 100644 index 0000000000..11823b9c8c --- /dev/null +++ b/bsp/at91sam9260/usart.c @@ -0,0 +1,413 @@ +#include +#include +#include +#include + +#define RXRDY 0x01 +#define TXRDY (1 << 1) + +typedef struct uartport +{ + volatile rt_uint32_t CR; + volatile rt_uint32_t MR; + volatile rt_uint32_t IER; + volatile rt_uint32_t IDR; + volatile rt_uint32_t IMR; + volatile rt_uint32_t CSR; + volatile rt_uint32_t RHR; + volatile rt_uint32_t THR; + volatile rt_uint32_t BRGR; + volatile rt_uint32_t RTOR; + volatile rt_uint32_t TTGR; + volatile rt_uint32_t reserved0[5]; + volatile rt_uint32_t FIDI; + volatile rt_uint32_t NER; + volatile rt_uint32_t reserved1; + volatile rt_uint32_t IFR; + volatile rt_uint32_t reserved2[44]; + volatile rt_uint32_t RPR; + volatile rt_uint32_t RCR; + volatile rt_uint32_t TPR; + volatile rt_uint32_t TCR; + volatile rt_uint32_t RNPR; + volatile rt_uint32_t RNCR; + volatile rt_uint32_t TNPR; + volatile rt_uint32_t TNCR; + volatile rt_uint32_t PTCR; + volatile rt_uint32_t PTSR; +}uartport; + +#define CIDR FIDI +#define EXID NER +#define FNR reserved1 + +#define DBGU ((struct uartport *)AT91SAM9260_BASE_DBGU) + +#define UART0 ((struct uartport *)AT91SAM9260_BASE_US0) +#define UART1 ((struct uartport *)AT91SAM9260_BASE_US1) +#define UART2 ((struct uartport *)AT91SAM9260_BASE_US2) +#define UART3 ((struct uartport *)AT91SAM9260_BASE_US3) + +struct at91_uart { + uartport *port; + int irq; +}; + + + +/** + * This function will handle serial + */ +void rt_at91_usart_handler(int vector, void *param) +{ + int status; + struct at91_uart *uart; + rt_device_t dev = (rt_device_t)param; + uart = (struct at91_uart *)dev->user_data; + status = uart->port->CSR; + if (!(status & uart->port->IMR)) + { + return; + } + rt_interrupt_enter(); + rt_hw_serial_isr(dev); + rt_interrupt_leave(); +} + +/** +* UART device in RT-Thread +*/ +static rt_err_t at91_usart_configure(struct rt_serial_device *serial, + struct serial_configure *cfg) +{ + int div; + int mode = 0; + struct at91_uart *uart; + + RT_ASSERT(serial != RT_NULL); + RT_ASSERT(cfg != RT_NULL); + uart = (struct at91_uart *)serial->parent.user_data; + + uart->port->CR = AT91_US_RSTTX | AT91_US_RSTRX | + AT91_US_RXDIS | AT91_US_TXDIS; + mode |= AT91_US_USMODE_NORMAL | AT91_US_USCLKS_MCK | + AT91_US_CHMODE_NORMAL; + switch (cfg->data_bits) + { + case DATA_BITS_8: + mode |= AT91_US_CHRL_8; + break; + case DATA_BITS_7: + mode |= AT91_US_CHRL_7; + break; + case DATA_BITS_6: + mode |= AT91_US_CHRL_6; + break; + case DATA_BITS_5: + mode |= AT91_US_CHRL_5; + break; + default: + mode |= AT91_US_CHRL_8; + break; + } + + switch (cfg->stop_bits) + { + case STOP_BITS_2: + mode |= AT91_US_NBSTOP_2; + break; + case STOP_BITS_1: + default: + mode |= AT91_US_NBSTOP_1; + break; + } + + switch (cfg->parity) + { + case PARITY_ODD: + mode |= AT91_US_PAR_ODD; + break; + case PARITY_EVEN: + mode |= AT91_US_PAR_EVEN; + break; + case PARITY_NONE: + default: + mode |= AT91_US_PAR_NONE; + break; + } + + uart->port->MR = mode; + div = (clk_get_rate(clk_get("mck")) / 16 + cfg->baud_rate/2) / cfg->baud_rate; + uart->port->BRGR = div; + uart->port->CR = AT91_US_RXEN | AT91_US_TXEN; + uart->port->IER = 0x01; + + return RT_EOK; +} + +static rt_err_t at91_usart_control(struct rt_serial_device *serial, + int cmd, void *arg) +{ + struct at91_uart* uart; + + RT_ASSERT(serial != RT_NULL); + uart = (struct at91_uart *)serial->parent.user_data; + + switch (cmd) + { + case RT_DEVICE_CTRL_CLR_INT: + /* disable rx irq */ + rt_hw_interrupt_mask(uart->irq); + break; + case RT_DEVICE_CTRL_SET_INT: + /* enable rx irq */ + rt_hw_interrupt_umask(uart->irq); + break; + } + + return RT_EOK; +} + +static int at91_usart_putc(struct rt_serial_device *serial, char c) +{ + rt_uint32_t level; + struct at91_uart *uart = serial->parent.user_data; + + while (!(uart->port->CSR & TXRDY)); + uart->port->THR = c; + + return 1; +} + +static int at91_usart_getc(struct rt_serial_device *serial) +{ + int result; + struct at91_uart *uart = serial->parent.user_data; + + if (uart->port->CSR & RXRDY) + { + result = uart->port->RHR & 0xff; + } + else + { + result = -1; + } + + return result; +} + +static const struct rt_uart_ops at91_usart_ops = +{ + at91_usart_configure, + at91_usart_control, + at91_usart_putc, + at91_usart_getc, +}; + +#if defined(RT_USING_DBGU) +static struct rt_serial_device serial_dbgu; +static struct serial_ringbuffer dbgu_int_rx; +struct at91_uart dbgu = { + DBGU, + AT91_ID_SYS +}; + +#endif + +#if defined(RT_USING_UART0) +static struct rt_serial_device serial0; +static struct serial_ringbuffer uart0_int_rx; +struct at91_uart uart0 = { + UART0, + AT91SAM9260_ID_US0 +}; +#endif + +#if defined(RT_USING_UART1) +static struct rt_serial_device serial1; +static struct serial_ringbuffer uart1_int_rx; +struct at91_uart uart1 = { + UART1, + AT91SAM9260_ID_US1 +}; +#endif + +#if defined(RT_USING_UART2) +static struct rt_serial_device serial2; +static struct serial_ringbuffer uart2_int_rx; +struct at91_uart uart2 = { + UART2, + AT91SAM9260_ID_US2 +}; +#endif + +#if defined(RT_USING_UART3) +static struct rt_serial_device serial3; +static struct serial_ringbuffer uart3_int_rx; +struct at91_uart uart3 = { + UART3, + AT91SAM9260_ID_US3 +}; +#endif + +void at91_usart_gpio_init(void) +{ + rt_uint32_t val; + +#ifdef RT_USING_DBGU + at91_sys_write(AT91_PIOB + PIO_IDR, (1<<14)|(1<<15)); + //at91_sys_write(AT91_PIOB + PIO_PUER, (1<<6)); + at91_sys_write(AT91_PIOB + PIO_PUDR, (1<<14)|(1<<15)); + at91_sys_write(AT91_PIOB + PIO_ASR, (1<<14)|(1<<15)); + at91_sys_write(AT91_PIOB + PIO_PDR, (1<<14)|(1<<15)); + at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS); +#endif + +#ifdef RT_USING_UART0 + at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_US0); + at91_sys_write(AT91_PIOB + PIO_IDR, (1<<4)|(1<<5)); + at91_sys_write(AT91_PIOB + PIO_PUER, (1<<4)); + at91_sys_write(AT91_PIOB + PIO_PUDR, (1<<5)); + at91_sys_write(AT91_PIOB + PIO_ASR, (1<<4)|(1<<5)); + at91_sys_write(AT91_PIOB + PIO_PDR, (1<<4)|(1<<5)); +#endif + +#ifdef RT_USING_UART1 + at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_US1); + at91_sys_write(AT91_PIOB + PIO_IDR, (1<<6)|(1<<7)); + at91_sys_write(AT91_PIOB + PIO_PUER, (1<<6)); + at91_sys_write(AT91_PIOB + PIO_PUDR, (1<<7)); + at91_sys_write(AT91_PIOB + PIO_ASR, (1<<6)|(1<<7)); + at91_sys_write(AT91_PIOB + PIO_PDR, (1<<6)|(1<<7)); +#endif + +#ifdef RT_USING_UART2 + at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_US2); + at91_sys_write(AT91_PIOB + PIO_IDR, (1<<8)|(1<<9)); + at91_sys_write(AT91_PIOB + PIO_PUER, (1<<8)); + at91_sys_write(AT91_PIOB + PIO_PUDR, (1<<9)); + at91_sys_write(AT91_PIOB + PIO_ASR, (1<<8)|(1<<9)); + at91_sys_write(AT91_PIOB + PIO_PDR, (1<<8)|(1<<9)); +#endif + +#ifdef RT_USING_UART3 + at91_sys_write(AT91_PMC_PCER, 1< - -#include "serial.h" - -/** - * @addtogroup AT91SAM926X - */ -/*@{*/ - -/* RT-Thread Device Interface */ -/** - * This function initializes serial - */ -static rt_err_t rt_serial_init (rt_device_t dev) -{ - struct serial_device* uart = (struct serial_device*) dev->user_data; - - if (!(dev->flag & RT_DEVICE_FLAG_ACTIVATED)) - { - - if (dev->flag & RT_DEVICE_FLAG_INT_RX) - { - rt_memset(uart->int_rx->rx_buffer, 0, - sizeof(uart->int_rx->rx_buffer)); - uart->int_rx->read_index = uart->int_rx->save_index = 0; - } - - if (dev->flag & RT_DEVICE_FLAG_INT_TX) - { - rt_memset(uart->int_tx->tx_buffer, 0, - sizeof(uart->int_tx->tx_buffer)); - uart->int_tx->write_index = uart->int_tx->save_index = 0; - } - - dev->flag |= RT_DEVICE_FLAG_ACTIVATED; - } - - return RT_EOK; -} - -/* save a char to serial buffer */ -static void rt_serial_savechar(struct serial_device* uart, char ch) -{ - rt_base_t level; - - /* disable interrupt */ - level = rt_hw_interrupt_disable(); - - uart->int_rx->rx_buffer[uart->int_rx->save_index] = ch; - uart->int_rx->save_index ++; - if (uart->int_rx->save_index >= UART_RX_BUFFER_SIZE) - uart->int_rx->save_index = 0; - - /* if the next position is read index, discard this 'read char' */ - if (uart->int_rx->save_index == uart->int_rx->read_index) - { - uart->int_rx->read_index ++; - if (uart->int_rx->read_index >= UART_RX_BUFFER_SIZE) - uart->int_rx->read_index = 0; - } - - /* enable interrupt */ - rt_hw_interrupt_enable(level); -} - -static rt_err_t rt_serial_open(rt_device_t dev, rt_uint16_t oflag) -{ - RT_ASSERT(dev != RT_NULL); - - return RT_EOK; -} - -static rt_err_t rt_serial_close(rt_device_t dev) -{ - RT_ASSERT(dev != RT_NULL); - - return RT_EOK; -} - -static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) -{ - rt_uint8_t* ptr; - rt_err_t err_code; - struct serial_device* uart; - - ptr = buffer; - err_code = RT_EOK; - uart = (struct serial_device*)dev->user_data; - - if (dev->flag & RT_DEVICE_FLAG_INT_RX) - { - rt_base_t level; - - /* interrupt mode Rx */ - while (size) - { - if (uart->int_rx->read_index != uart->int_rx->save_index) - { - *ptr++ = uart->int_rx->rx_buffer[uart->int_rx->read_index]; - size --; - - /* disable interrupt */ - level = rt_hw_interrupt_disable(); - - uart->int_rx->read_index ++; - if (uart->int_rx->read_index >= UART_RX_BUFFER_SIZE) - uart->int_rx->read_index = 0; - - /* enable interrupt */ - rt_hw_interrupt_enable(level); - } - else - { - /* set error code */ - err_code = -RT_EEMPTY; - break; - } - } - } - else - { - /* polling mode */ - while ((rt_uint32_t)ptr - (rt_uint32_t)buffer < size) - { - while (uart->uart_device->USART_CSR & RXRDY) - { - *ptr = uart->uart_device->USART_RHR & 0xff; - ptr ++; - } - } - } - - /* set error code */ - rt_set_errno(err_code); - return (rt_uint32_t)ptr - (rt_uint32_t)buffer; -} - -static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) -{ - rt_uint8_t* ptr; - rt_err_t err_code; - struct serial_device* uart; - - err_code = RT_EOK; - ptr = (rt_uint8_t*)buffer; - uart = (struct serial_device*)dev->user_data; - - if (dev->flag & RT_DEVICE_FLAG_INT_TX) - { - /* interrupt mode Tx */ - while (uart->int_tx->save_index != uart->int_tx->write_index) - { - /* save on tx buffer */ - uart->int_tx->tx_buffer[uart->int_tx->save_index] = *ptr++; - - -- size; - - /* move to next position */ - uart->int_tx->save_index ++; - - /* wrap save index */ - if (uart->int_tx->save_index >= UART_TX_BUFFER_SIZE) - uart->int_tx->save_index = 0; - } - - /* set error code */ - if (size > 0) - err_code = -RT_EFULL; - } - else - { - /* polling mode */ - while (size) - { - /* - * to be polite with serial console add a line feed - * to the carriage return character - */ - if (*ptr == '\n' && (dev->flag & RT_DEVICE_FLAG_STREAM)) - { - while (!(uart->uart_device->USART_CSR & TXRDY)); - uart->uart_device->USART_THR = '\r'; - } - - while (!(uart->uart_device->USART_CSR & TXRDY)); - uart->uart_device->USART_THR = (*ptr & 0xFF); - - ++ptr; --size; - } - } - - /* set error code */ - rt_set_errno(err_code); - - return (rt_uint32_t)ptr - (rt_uint32_t)buffer; -} - -static rt_err_t rt_serial_control (rt_device_t dev, rt_uint8_t cmd, void *args) -{ - RT_ASSERT(dev != RT_NULL); - - switch (cmd) - { - case RT_DEVICE_CTRL_SUSPEND: - /* suspend device */ - dev->flag |= RT_DEVICE_FLAG_SUSPENDED; - break; - - case RT_DEVICE_CTRL_RESUME: - /* resume device */ - dev->flag &= ~RT_DEVICE_FLAG_SUSPENDED; - break; - } - - return RT_EOK; -} - -/* - * serial register - */ -rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t flag, struct serial_device *serial) -{ - RT_ASSERT(device != RT_NULL); - - device->type = RT_Device_Class_Char; - device->rx_indicate = RT_NULL; - device->tx_complete = RT_NULL; - device->init = rt_serial_init; - device->open = rt_serial_open; - device->close = rt_serial_close; - device->read = rt_serial_read; - device->write = rt_serial_write; - device->control = rt_serial_control; - device->user_data = serial; - - /* register a character device */ - return rt_device_register(device, name, RT_DEVICE_FLAG_RDWR | flag); -} - -/* ISR for serial interrupt */ -void rt_hw_serial_isr(rt_device_t device) -{ - struct serial_device* uart = (struct serial_device*) device->user_data; - - /* interrupt mode receive */ - RT_ASSERT(device->flag & RT_DEVICE_FLAG_INT_RX); - - /* save on rx buffer */ - while (uart->uart_device->USART_CSR & RXRDY) - { - rt_serial_savechar(uart, uart->uart_device->USART_RHR & 0xff); - } - - /* invoke callback */ - if (device->rx_indicate != RT_NULL) - { - rt_size_t rx_length; - - /* get rx length */ - rx_length = uart->int_rx->read_index > uart->int_rx->save_index ? - UART_RX_BUFFER_SIZE - uart->int_rx->read_index + uart->int_rx->save_index : - uart->int_rx->save_index - uart->int_rx->read_index; - - device->rx_indicate(device, rx_length); - } -} - -/*@}*/ diff --git a/libcpu/arm/at91sam926x/serial.h b/libcpu/arm/at91sam926x/serial.h deleted file mode 100755 index 67f6d3c659..0000000000 --- a/libcpu/arm/at91sam926x/serial.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef __RT_HW_SERIAL_H__ -#define __RT_HW_SERIAL_H__ - -#include -#include - -#include "at91sam926x.h" - -#define RXRDY 0x01 -#define TXRDY (1 << 1) -#define BPS 115200 /* serial baudrate */ - -#define UART_RX_BUFFER_SIZE 64 -#define UART_TX_BUFFER_SIZE 64 - -struct serial_int_rx -{ - rt_uint8_t rx_buffer[UART_RX_BUFFER_SIZE]; - rt_uint32_t read_index, save_index; -}; - -struct serial_int_tx -{ - rt_uint8_t tx_buffer[UART_TX_BUFFER_SIZE]; - rt_uint32_t write_index, save_index; -}; - -typedef struct uartport -{ -/* USART register offsets */ - volatile rt_uint32_t USART_CR; - volatile rt_uint32_t USART_MR; - volatile rt_uint32_t USART_IER; - volatile rt_uint32_t USART_IDR; - volatile rt_uint32_t USART_IMR; - volatile rt_uint32_t USART_CSR; - volatile rt_uint32_t USART_RHR; - volatile rt_uint32_t USART_THR; - volatile rt_uint32_t USART_BRGR; - volatile rt_uint32_t USART_RTOR; - volatile rt_uint32_t USART_TTGR; - volatile rt_uint32_t reseverd0[5]; - volatile rt_uint32_t USART_FIDI; - volatile rt_uint32_t USART_NER; - volatile rt_uint32_t USART_XXR; - volatile rt_uint32_t USART_IFR; - volatile rt_uint32_t reserved1[44]; - volatile rt_uint32_t USART_RPR; - volatile rt_uint32_t USART_RCR; - volatile rt_uint32_t USART_TPR; - volatile rt_uint32_t USART_TCR; - volatile rt_uint32_t USART_RNPR; - volatile rt_uint32_t USART_RNCR; - volatile rt_uint32_t USART_TNPR; - volatile rt_uint32_t USART_TNCR; - volatile rt_uint32_t USART_PTCR; - volatile rt_uint32_t USART_PTSR; -}uartport; - - -struct serial_device -{ - uartport* uart_device; - - /* rx structure */ - struct serial_int_rx* int_rx; - - /* tx structure */ - struct serial_int_tx* int_tx; -}; - -rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t flag, struct serial_device *serial); - -void rt_hw_serial_isr(rt_device_t device); - -#endif From 3bdbf640b7bcdc40a2d5171b67e50f92bbd588f6 Mon Sep 17 00:00:00 2001 From: weety Date: Sun, 21 Jul 2013 17:19:30 +0800 Subject: [PATCH 2/5] update at91sam9260 project directory structure. --- bsp/at91sam9260/SConscript | 30 ++++------- bsp/at91sam9260/applications/SConscript | 11 ++++ .../{ => applications}/application.c | 0 bsp/at91sam9260/{ => applications}/startup.c | 0 bsp/at91sam9260/drivers/SConscript | 31 +++++++++++ bsp/at91sam9260/{ => drivers}/at91_i2c_gpio.c | 0 bsp/at91sam9260/{ => drivers}/at91_mci.c | 0 bsp/at91sam9260/{ => drivers}/at91_mci.h | 0 bsp/at91sam9260/{ => drivers}/board.c | 13 ++++- bsp/at91sam9260/{ => drivers}/board.h | 0 bsp/at91sam9260/{ => drivers}/led.c | 0 bsp/at91sam9260/{ => drivers}/led.h | 0 bsp/at91sam9260/{ => drivers}/macb.c | 0 bsp/at91sam9260/{ => drivers}/macb.h | 0 bsp/at91sam9260/{ => drivers}/mii.h | 0 bsp/at91sam9260/{ => drivers}/usart.c | 0 bsp/at91sam9260/platform/SConscript | 26 +++++++++ .../at91sam9260/platform}/at91_aic.h | 0 .../at91sam9260/platform}/at91_pdc.h | 0 .../at91sam9260/platform}/at91_pio.h | 0 .../at91sam9260/platform}/at91_pit.h | 0 .../at91sam9260/platform}/at91_pmc.h | 0 .../at91sam9260/platform}/at91_rstc.h | 0 .../at91sam9260/platform}/at91_serial.h | 0 .../at91sam9260/platform}/at91_shdwc.h | 0 .../at91sam9260/platform}/at91_tc.h | 0 .../platform}/at91sam9260_matrix.h | 0 .../at91sam9260/platform}/at91sam926x.h | 0 .../at91sam9260/platform}/gpio.h | 0 .../at91sam9260/platform}/interrupt.c | 0 .../at91sam9260/platform}/io.h | 0 .../at91sam9260/platform}/irq.h | 0 bsp/at91sam9260/platform/reset.c | 34 ++++++++++++ .../at91sam9260/platform}/start_gcc.S | 0 .../at91sam9260/platform}/start_rvds.S | 0 .../at91sam9260/platform}/system_clock.c | 0 .../at91sam9260/platform}/trap.c | 1 - bsp/at91sam9260/rtconfig.py | 2 +- .../arm/{at91sam926x => arm926}/context_gcc.S | 0 .../{at91sam926x => arm926}/context_rvds.S | 0 .../{at91sam926x/cpu.c => arm926/cpuport.c} | 23 ++------ libcpu/arm/{at91sam926x => arm926}/mmu.c | 39 +++----------- libcpu/arm/arm926/mmu.h | 53 +++++++++++++++++++ libcpu/arm/{at91sam926x => arm926}/stack.c | 0 44 files changed, 190 insertions(+), 73 deletions(-) create mode 100644 bsp/at91sam9260/applications/SConscript rename bsp/at91sam9260/{ => applications}/application.c (100%) mode change 100755 => 100644 rename bsp/at91sam9260/{ => applications}/startup.c (100%) mode change 100755 => 100644 create mode 100644 bsp/at91sam9260/drivers/SConscript rename bsp/at91sam9260/{ => drivers}/at91_i2c_gpio.c (100%) rename bsp/at91sam9260/{ => drivers}/at91_mci.c (100%) mode change 100755 => 100644 rename bsp/at91sam9260/{ => drivers}/at91_mci.h (100%) rename bsp/at91sam9260/{ => drivers}/board.c (85%) mode change 100755 => 100644 rename bsp/at91sam9260/{ => drivers}/board.h (100%) mode change 100755 => 100644 rename bsp/at91sam9260/{ => drivers}/led.c (100%) mode change 100755 => 100644 rename bsp/at91sam9260/{ => drivers}/led.h (100%) mode change 100755 => 100644 rename bsp/at91sam9260/{ => drivers}/macb.c (100%) mode change 100755 => 100644 rename bsp/at91sam9260/{ => drivers}/macb.h (100%) mode change 100755 => 100644 rename bsp/at91sam9260/{ => drivers}/mii.h (100%) rename bsp/at91sam9260/{ => drivers}/usart.c (100%) create mode 100644 bsp/at91sam9260/platform/SConscript rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91_aic.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91_pdc.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91_pio.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91_pit.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91_pmc.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91_rstc.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91_serial.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91_shdwc.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91_tc.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91sam9260_matrix.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/at91sam926x.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/gpio.h (100%) rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/interrupt.c (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/io.h (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/irq.h (100%) mode change 100755 => 100644 create mode 100644 bsp/at91sam9260/platform/reset.c rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/start_gcc.S (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/start_rvds.S (100%) rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/system_clock.c (100%) mode change 100755 => 100644 rename {libcpu/arm/at91sam926x => bsp/at91sam9260/platform}/trap.c (98%) mode change 100755 => 100644 rename libcpu/arm/{at91sam926x => arm926}/context_gcc.S (100%) mode change 100755 => 100644 rename libcpu/arm/{at91sam926x => arm926}/context_rvds.S (100%) rename libcpu/arm/{at91sam926x/cpu.c => arm926/cpuport.c} (91%) mode change 100755 => 100644 rename libcpu/arm/{at91sam926x => arm926}/mmu.c (85%) create mode 100644 libcpu/arm/arm926/mmu.h rename libcpu/arm/{at91sam926x => arm926}/stack.c (100%) mode change 100755 => 100644 diff --git a/bsp/at91sam9260/SConscript b/bsp/at91sam9260/SConscript index c754911e9d..fe0ae941ae 100755 --- a/bsp/at91sam9260/SConscript +++ b/bsp/at91sam9260/SConscript @@ -1,24 +1,14 @@ -import rtconfig +# for module compiling +import os Import('RTT_ROOT') -from building import * -src_bsp = ['application.c', 'startup.c', 'board.c'] -src_drv = ['usart.c'] +cwd = str(Dir('#')) +objs = [] +list = os.listdir(cwd) -if GetDepend('RT_USING_LED'): - src_drv += ['led.c'] +for d in list: + path = os.path.join(cwd, d) + if os.path.isfile(os.path.join(path, 'SConscript')): + objs = objs + SConscript(os.path.join(d, 'SConscript')) -if GetDepend('RT_USING_SDIO'): - src_drv += ['at91_mci.c'] - -if GetDepend('RT_USING_LWIP'): - src_drv += ['macb.c'] - -if GetDepend('RT_USING_I2C') and GetDepend('RT_USING_I2C_BITOPS'): - src_drv += ['at91_i2c_gpio.c'] - -src = File(src_bsp + src_drv) -CPPPATH = [RTT_ROOT + '/bsp/at91sam9260'] -group = DefineGroup('Startup', src, depend = [''], CPPPATH = CPPPATH) - -Return('group') +Return('objs') diff --git a/bsp/at91sam9260/applications/SConscript b/bsp/at91sam9260/applications/SConscript new file mode 100644 index 0000000000..01eb940dfb --- /dev/null +++ b/bsp/at91sam9260/applications/SConscript @@ -0,0 +1,11 @@ +Import('RTT_ROOT') +Import('rtconfig') +from building import * + +cwd = os.path.join(str(Dir('#')), 'applications') +src = Glob('*.c') +CPPPATH = [cwd, str(Dir('#'))] + +group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) + +Return('group') diff --git a/bsp/at91sam9260/application.c b/bsp/at91sam9260/applications/application.c old mode 100755 new mode 100644 similarity index 100% rename from bsp/at91sam9260/application.c rename to bsp/at91sam9260/applications/application.c diff --git a/bsp/at91sam9260/startup.c b/bsp/at91sam9260/applications/startup.c old mode 100755 new mode 100644 similarity index 100% rename from bsp/at91sam9260/startup.c rename to bsp/at91sam9260/applications/startup.c diff --git a/bsp/at91sam9260/drivers/SConscript b/bsp/at91sam9260/drivers/SConscript new file mode 100644 index 0000000000..d0470f9049 --- /dev/null +++ b/bsp/at91sam9260/drivers/SConscript @@ -0,0 +1,31 @@ +Import('RTT_ROOT') +Import('rtconfig') +from building import * + +cwd = os.path.join(str(Dir('#')), 'drivers') + +# add the general drvers. +src = Split(""" +board.c +usart.c +""") + +# add Ethernet drvers. +if GetDepend('RT_USING_LED'): + src += ['led.c'] + +if GetDepend('RT_USING_SDIO'): + src += ['at91_mci.c'] + +if GetDepend('RT_USING_LWIP'): + src += ['macb.c'] + +if GetDepend('RT_USING_I2C') and GetDepend('RT_USING_I2C_BITOPS'): + src += ['at91_i2c_gpio.c'] + + +CPPPATH = [cwd] + +group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH) + +Return('group') diff --git a/bsp/at91sam9260/at91_i2c_gpio.c b/bsp/at91sam9260/drivers/at91_i2c_gpio.c similarity index 100% rename from bsp/at91sam9260/at91_i2c_gpio.c rename to bsp/at91sam9260/drivers/at91_i2c_gpio.c diff --git a/bsp/at91sam9260/at91_mci.c b/bsp/at91sam9260/drivers/at91_mci.c old mode 100755 new mode 100644 similarity index 100% rename from bsp/at91sam9260/at91_mci.c rename to bsp/at91sam9260/drivers/at91_mci.c diff --git a/bsp/at91sam9260/at91_mci.h b/bsp/at91sam9260/drivers/at91_mci.h similarity index 100% rename from bsp/at91sam9260/at91_mci.h rename to bsp/at91sam9260/drivers/at91_mci.h diff --git a/bsp/at91sam9260/board.c b/bsp/at91sam9260/drivers/board.c old mode 100755 new mode 100644 similarity index 85% rename from bsp/at91sam9260/board.c rename to bsp/at91sam9260/drivers/board.c index 81f156d158..a9ac7f07e2 --- a/bsp/at91sam9260/board.c +++ b/bsp/at91sam9260/drivers/board.c @@ -16,6 +16,7 @@ #include #include "board.h" +#include /** * @addtogroup at91sam9260 @@ -24,13 +25,21 @@ extern void rt_hw_clock_init(void); -extern void rt_hw_mmu_init(void); extern void rt_hw_get_clock(void); extern void rt_hw_set_dividor(rt_uint8_t hdivn, rt_uint8_t pdivn); extern void rt_hw_set_clock(rt_uint8_t sdiv, rt_uint8_t pdiv, rt_uint8_t mdiv); extern void rt_dbgu_isr(void); +static struct mem_desc at91_mem_desc[] = { + { 0x00000000, 0xFFFFFFFF, 0x00000000, RW_NCNB }, /* None cached for 4G memory */ + { 0x20000000, 0x24000000-1, 0x20000000, RW_CB }, /* 64M cached SDRAM memory */ + { 0x00000000, 0x100000, 0x20000000, RW_CB }, /* isr vector table */ + { 0x90000000, 0x90400000 - 1, 0x00200000, RW_NCNB }, /* 4K SRAM0 + 4k SRAM1 */ + { 0xA0000000, 0xA4000000-1, 0x20000000, RW_NCNB } /* 64M none-cached SDRAM memory */ +}; + + #define PIT_CPIV(x) ((x) & AT91_PIT_CPIV) #define PIT_PICNT(x) (((x) & AT91_PIT_PICNT) >> 20) @@ -132,7 +141,7 @@ void rt_hw_board_init() rt_console_set_device(RT_CONSOLE_DEVICE_NAME); /* initialize mmu */ - rt_hw_mmu_init(); + rt_hw_mmu_init(at91_mem_desc, sizeof(at91_mem_desc)/sizeof(at91_mem_desc[0])); /* initialize timer0 */ rt_hw_timer_init(); diff --git a/bsp/at91sam9260/board.h b/bsp/at91sam9260/drivers/board.h old mode 100755 new mode 100644 similarity index 100% rename from bsp/at91sam9260/board.h rename to bsp/at91sam9260/drivers/board.h diff --git a/bsp/at91sam9260/led.c b/bsp/at91sam9260/drivers/led.c old mode 100755 new mode 100644 similarity index 100% rename from bsp/at91sam9260/led.c rename to bsp/at91sam9260/drivers/led.c diff --git a/bsp/at91sam9260/led.h b/bsp/at91sam9260/drivers/led.h old mode 100755 new mode 100644 similarity index 100% rename from bsp/at91sam9260/led.h rename to bsp/at91sam9260/drivers/led.h diff --git a/bsp/at91sam9260/macb.c b/bsp/at91sam9260/drivers/macb.c old mode 100755 new mode 100644 similarity index 100% rename from bsp/at91sam9260/macb.c rename to bsp/at91sam9260/drivers/macb.c diff --git a/bsp/at91sam9260/macb.h b/bsp/at91sam9260/drivers/macb.h old mode 100755 new mode 100644 similarity index 100% rename from bsp/at91sam9260/macb.h rename to bsp/at91sam9260/drivers/macb.h diff --git a/bsp/at91sam9260/mii.h b/bsp/at91sam9260/drivers/mii.h similarity index 100% rename from bsp/at91sam9260/mii.h rename to bsp/at91sam9260/drivers/mii.h diff --git a/bsp/at91sam9260/usart.c b/bsp/at91sam9260/drivers/usart.c similarity index 100% rename from bsp/at91sam9260/usart.c rename to bsp/at91sam9260/drivers/usart.c diff --git a/bsp/at91sam9260/platform/SConscript b/bsp/at91sam9260/platform/SConscript new file mode 100644 index 0000000000..1f5de6e772 --- /dev/null +++ b/bsp/at91sam9260/platform/SConscript @@ -0,0 +1,26 @@ +Import('RTT_ROOT') +Import('rtconfig') +from building import * + +cwd = GetCurrentDir() +CPPPATH = [cwd] + +# The set of source files associated with this SConscript file. +if rtconfig.PLATFORM == 'armcc': + src = Glob('*.c') + Glob('*_rvds.S') + +if rtconfig.PLATFORM == 'gcc': + src = Glob('*.c') + Glob('*_gcc.S') + Glob('*_init.S') + +if rtconfig.PLATFORM == 'iar': + src = Glob('*.c') + Glob('*_iar.S') + +if rtconfig.PLATFORM == 'cl': + src = Glob('*.c') + +if rtconfig.PLATFORM == 'mingw': + src = Glob('*.c') + +group = DefineGroup('platform', src, depend = [''], CPPPATH = CPPPATH) + +Return('group') diff --git a/libcpu/arm/at91sam926x/at91_aic.h b/bsp/at91sam9260/platform/at91_aic.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91_aic.h rename to bsp/at91sam9260/platform/at91_aic.h diff --git a/libcpu/arm/at91sam926x/at91_pdc.h b/bsp/at91sam9260/platform/at91_pdc.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91_pdc.h rename to bsp/at91sam9260/platform/at91_pdc.h diff --git a/libcpu/arm/at91sam926x/at91_pio.h b/bsp/at91sam9260/platform/at91_pio.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91_pio.h rename to bsp/at91sam9260/platform/at91_pio.h diff --git a/libcpu/arm/at91sam926x/at91_pit.h b/bsp/at91sam9260/platform/at91_pit.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91_pit.h rename to bsp/at91sam9260/platform/at91_pit.h diff --git a/libcpu/arm/at91sam926x/at91_pmc.h b/bsp/at91sam9260/platform/at91_pmc.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91_pmc.h rename to bsp/at91sam9260/platform/at91_pmc.h diff --git a/libcpu/arm/at91sam926x/at91_rstc.h b/bsp/at91sam9260/platform/at91_rstc.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91_rstc.h rename to bsp/at91sam9260/platform/at91_rstc.h diff --git a/libcpu/arm/at91sam926x/at91_serial.h b/bsp/at91sam9260/platform/at91_serial.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91_serial.h rename to bsp/at91sam9260/platform/at91_serial.h diff --git a/libcpu/arm/at91sam926x/at91_shdwc.h b/bsp/at91sam9260/platform/at91_shdwc.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91_shdwc.h rename to bsp/at91sam9260/platform/at91_shdwc.h diff --git a/libcpu/arm/at91sam926x/at91_tc.h b/bsp/at91sam9260/platform/at91_tc.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91_tc.h rename to bsp/at91sam9260/platform/at91_tc.h diff --git a/libcpu/arm/at91sam926x/at91sam9260_matrix.h b/bsp/at91sam9260/platform/at91sam9260_matrix.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91sam9260_matrix.h rename to bsp/at91sam9260/platform/at91sam9260_matrix.h diff --git a/libcpu/arm/at91sam926x/at91sam926x.h b/bsp/at91sam9260/platform/at91sam926x.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/at91sam926x.h rename to bsp/at91sam9260/platform/at91sam926x.h diff --git a/libcpu/arm/at91sam926x/gpio.h b/bsp/at91sam9260/platform/gpio.h similarity index 100% rename from libcpu/arm/at91sam926x/gpio.h rename to bsp/at91sam9260/platform/gpio.h diff --git a/libcpu/arm/at91sam926x/interrupt.c b/bsp/at91sam9260/platform/interrupt.c old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/interrupt.c rename to bsp/at91sam9260/platform/interrupt.c diff --git a/libcpu/arm/at91sam926x/io.h b/bsp/at91sam9260/platform/io.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/io.h rename to bsp/at91sam9260/platform/io.h diff --git a/libcpu/arm/at91sam926x/irq.h b/bsp/at91sam9260/platform/irq.h old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/irq.h rename to bsp/at91sam9260/platform/irq.h diff --git a/bsp/at91sam9260/platform/reset.c b/bsp/at91sam9260/platform/reset.c new file mode 100644 index 0000000000..e116304dd4 --- /dev/null +++ b/bsp/at91sam9260/platform/reset.c @@ -0,0 +1,34 @@ +/* + * File : reset.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2006, RT-Thread Develop Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://openlab.rt-thread.com/license/LICENSE + * + * Change Logs: + * Date Author Notes + * 2011-01-13 weety modified from mini2440 + */ + +#include +#include +#include "at91sam926x.h" + +/** + * @addtogroup AT91SAM926X + */ +/*@{*/ + +void machine_reset(void) +{ + at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); +} + +void machine_shutdown(void) +{ + at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); +} + +/*@}*/ diff --git a/libcpu/arm/at91sam926x/start_gcc.S b/bsp/at91sam9260/platform/start_gcc.S old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/start_gcc.S rename to bsp/at91sam9260/platform/start_gcc.S diff --git a/libcpu/arm/at91sam926x/start_rvds.S b/bsp/at91sam9260/platform/start_rvds.S similarity index 100% rename from libcpu/arm/at91sam926x/start_rvds.S rename to bsp/at91sam9260/platform/start_rvds.S diff --git a/libcpu/arm/at91sam926x/system_clock.c b/bsp/at91sam9260/platform/system_clock.c old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/system_clock.c rename to bsp/at91sam9260/platform/system_clock.c diff --git a/libcpu/arm/at91sam926x/trap.c b/bsp/at91sam9260/platform/trap.c old mode 100755 new mode 100644 similarity index 98% rename from libcpu/arm/at91sam926x/trap.c rename to bsp/at91sam9260/platform/trap.c index 9be71ddcae..6735ffd238 --- a/libcpu/arm/at91sam926x/trap.c +++ b/bsp/at91sam9260/platform/trap.c @@ -156,7 +156,6 @@ void rt_hw_trap_irq() at91_sys_write(AT91_AIC_EOICR, 0); return; } - //at91_sys_write(AT91_AIC_EOICR, 0x55555555); /* get interrupt service routine */ isr_func = irq_desc[irq].handler; diff --git a/bsp/at91sam9260/rtconfig.py b/bsp/at91sam9260/rtconfig.py index 07432cedc0..10870f8807 100755 --- a/bsp/at91sam9260/rtconfig.py +++ b/bsp/at91sam9260/rtconfig.py @@ -2,7 +2,7 @@ import os # toolchains options ARCH = 'arm' -CPU = 'at91sam926x' +CPU = 'arm926' TextBase = '0x20000000' CROSS_TOOL = 'gcc' diff --git a/libcpu/arm/at91sam926x/context_gcc.S b/libcpu/arm/arm926/context_gcc.S old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/context_gcc.S rename to libcpu/arm/arm926/context_gcc.S diff --git a/libcpu/arm/at91sam926x/context_rvds.S b/libcpu/arm/arm926/context_rvds.S similarity index 100% rename from libcpu/arm/at91sam926x/context_rvds.S rename to libcpu/arm/arm926/context_rvds.S diff --git a/libcpu/arm/at91sam926x/cpu.c b/libcpu/arm/arm926/cpuport.c old mode 100755 new mode 100644 similarity index 91% rename from libcpu/arm/at91sam926x/cpu.c rename to libcpu/arm/arm926/cpuport.c index dce573c83d..caddf45a96 --- a/libcpu/arm/at91sam926x/cpu.c +++ b/libcpu/arm/arm926/cpuport.c @@ -14,16 +14,13 @@ #include #include -#include "at91sam926x.h" - -/** - * @addtogroup AT91SAM926X - */ -/*@{*/ #define ICACHE_MASK (rt_uint32_t)(1 << 12) #define DCACHE_MASK (rt_uint32_t)(1 << 2) +extern void machine_reset(void); +extern void machine_shutdown(void); + #ifdef __GNUC__ rt_inline rt_uint32_t cp15_rd(void) { @@ -148,16 +145,6 @@ rt_base_t rt_hw_cpu_dcache_status() return (cp15_rd() & DCACHE_MASK); } -static void at91sam9260_reset(void) -{ - at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); -} - -static void at91sam9260_poweroff(void) -{ - at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); -} - /** * reset cpu by dog's time-out * @@ -166,7 +153,7 @@ void rt_hw_cpu_reset() { rt_kprintf("Restarting system...\n"); - at91sam9260_reset(); + machine_reset(); while(1); /* loop forever and wait for reset to happen */ @@ -183,7 +170,7 @@ void rt_hw_cpu_shutdown() rt_kprintf("shutdown...\n"); level = rt_hw_interrupt_disable(); - at91sam9260_poweroff(); + machine_shutdown(); while (level) { RT_ASSERT(0); diff --git a/libcpu/arm/at91sam926x/mmu.c b/libcpu/arm/arm926/mmu.c similarity index 85% rename from libcpu/arm/at91sam926x/mmu.c rename to libcpu/arm/arm926/mmu.c index 5b88eee27c..c14f22bd84 100644 --- a/libcpu/arm/at91sam926x/mmu.c +++ b/libcpu/arm/arm926/mmu.c @@ -11,31 +11,7 @@ * Date Author Notes */ -#include - -#define CACHE_LINE_SIZE 32 - -#define DESC_SEC (0x2|(1<<4)) -#define CB (3<<2) //cache_on, write_back -#define CNB (2<<2) //cache_on, write_through -#define NCB (1<<2) //cache_off,WR_BUF on -#define NCNB (0<<2) //cache_off,WR_BUF off -#define AP_RW (3<<10) //supervisor=RW, user=RW -#define AP_RO (2<<10) //supervisor=RW, user=RO - -#define DOMAIN_FAULT (0x0) -#define DOMAIN_CHK (0x1) -#define DOMAIN_NOTCHK (0x3) -#define DOMAIN0 (0x0<<5) -#define DOMAIN1 (0x1<<5) - -#define DOMAIN0_ATTR (DOMAIN_CHK<<0) -#define DOMAIN1_ATTR (DOMAIN_FAULT<<2) - -#define RW_CB (AP_RW|DOMAIN0|CB|DESC_SEC) /* Read/Write, cache, write back */ -#define RW_CNB (AP_RW|DOMAIN0|CNB|DESC_SEC) /* Read/Write, cache, write through */ -#define RW_NCNB (AP_RW|DOMAIN0|NCNB|DESC_SEC) /* Read/Write without cache and write buffer */ -#define RW_FAULT (AP_RW|DOMAIN1|NCNB|DESC_SEC) /* Read/Write without cache and write buffer */ +#include "mmu.h" #ifdef __CC_ARM void mmu_setttbase(rt_uint32_t i) @@ -459,7 +435,7 @@ void mmu_setmtt(rt_uint32_t vaddrStart, rt_uint32_t vaddrEnd, rt_uint32_t paddrS } } -void rt_hw_mmu_init(void) +void rt_hw_mmu_init(struct mem_desc *mdesc, rt_uint32_t size) { /* disable I/D cache */ mmu_disable_dcache(); @@ -468,11 +444,12 @@ void rt_hw_mmu_init(void) mmu_invalidate_tlb(); /* set page table */ - mmu_setmtt(0x00000000, 0xFFFFFFFF, 0x00000000, RW_NCNB); /* None cached for 4G memory */ - mmu_setmtt(0x20000000, 0x24000000-1, 0x20000000, RW_CB); /* 64M cached SDRAM memory */ - mmu_setmtt(0x00000000, 0x100000, 0x20000000, RW_CB); /* isr vector table */ - mmu_setmtt(0x90000000, 0x90400000 - 1, 0x00200000, RW_NCNB); /* 4K SRAM0 + 4k SRAM1 */ - mmu_setmtt(0xA0000000, 0xA4000000-1, 0x20000000, RW_NCNB); /* 64M none-cached SDRAM memory */ + for (; size > 0; size--) + { + mmu_setmtt(mdesc->vaddr_start, mdesc->vaddr_end, + mdesc->paddr_start, mdesc->attr); + mdesc++; + } /* set MMU table address */ mmu_setttbase((rt_uint32_t)_page_table); diff --git a/libcpu/arm/arm926/mmu.h b/libcpu/arm/arm926/mmu.h new file mode 100644 index 0000000000..e45d3b0239 --- /dev/null +++ b/libcpu/arm/arm926/mmu.h @@ -0,0 +1,53 @@ +/* + * File : mmu.h + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2006, RT-Thread Development Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: + * Date Author Notes + */ + +#ifndef __MMU_H__ +#define __MMU_H__ + +#include + +#define CACHE_LINE_SIZE 32 + +#define DESC_SEC (0x2|(1<<4)) +#define CB (3<<2) //cache_on, write_back +#define CNB (2<<2) //cache_on, write_through +#define NCB (1<<2) //cache_off,WR_BUF on +#define NCNB (0<<2) //cache_off,WR_BUF off +#define AP_RW (3<<10) //supervisor=RW, user=RW +#define AP_RO (2<<10) //supervisor=RW, user=RO + +#define DOMAIN_FAULT (0x0) +#define DOMAIN_CHK (0x1) +#define DOMAIN_NOTCHK (0x3) +#define DOMAIN0 (0x0<<5) +#define DOMAIN1 (0x1<<5) + +#define DOMAIN0_ATTR (DOMAIN_CHK<<0) +#define DOMAIN1_ATTR (DOMAIN_FAULT<<2) + +#define RW_CB (AP_RW|DOMAIN0|CB|DESC_SEC) /* Read/Write, cache, write back */ +#define RW_CNB (AP_RW|DOMAIN0|CNB|DESC_SEC) /* Read/Write, cache, write through */ +#define RW_NCNB (AP_RW|DOMAIN0|NCNB|DESC_SEC) /* Read/Write without cache and write buffer */ +#define RW_FAULT (AP_RW|DOMAIN1|NCNB|DESC_SEC) /* Read/Write without cache and write buffer */ + +struct mem_desc { + rt_uint32_t vaddr_start; + rt_uint32_t vaddr_end; + rt_uint32_t paddr_start; + rt_uint32_t attr; +}; + +void rt_hw_mmu_init(struct mem_desc *mdesc, rt_uint32_t size); + +#endif + diff --git a/libcpu/arm/at91sam926x/stack.c b/libcpu/arm/arm926/stack.c old mode 100755 new mode 100644 similarity index 100% rename from libcpu/arm/at91sam926x/stack.c rename to libcpu/arm/arm926/stack.c From 42f9840653025f26b77fe7e1c1bcd823838b660c Mon Sep 17 00:00:00 2001 From: weety Date: Sun, 21 Jul 2013 17:32:55 +0800 Subject: [PATCH 3/5] commit again --- libcpu/arm/arm926/stack.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libcpu/arm/arm926/stack.c b/libcpu/arm/arm926/stack.c index 7075fcff80..7fec92d6df 100644 --- a/libcpu/arm/arm926/stack.c +++ b/libcpu/arm/arm926/stack.c @@ -12,12 +12,6 @@ * 2011-01-13 weety copy from mini2440 */ #include -#include "at91sam926x.h" - -/** - * @addtogroup AT91SAM926X - */ -/*@{*/ /** * This function will initialize thread stack @@ -57,4 +51,3 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, return (rt_uint8_t *)stk; } -/*@}*/ From 36c4604a362442c72616c2d66c084eedf6b7a663 Mon Sep 17 00:00:00 2001 From: weety Date: Sun, 21 Jul 2013 19:39:21 +0800 Subject: [PATCH 4/5] fix compiling error --- libcpu/arm/arm926/stack.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libcpu/arm/arm926/stack.c b/libcpu/arm/arm926/stack.c index 7fec92d6df..3b31ea28b5 100644 --- a/libcpu/arm/arm926/stack.c +++ b/libcpu/arm/arm926/stack.c @@ -13,6 +13,18 @@ */ #include +/*****************************/ +/* CPU Mode */ +/*****************************/ +#define USERMODE 0x10 +#define FIQMODE 0x11 +#define IRQMODE 0x12 +#define SVCMODE 0x13 +#define ABORTMODE 0x17 +#define UNDEFMODE 0x1b +#define MODEMASK 0x1f +#define NOINT 0xc0 + /** * This function will initialize thread stack * From 37ac4855da2ee7addca0d4a58de87eccf06d2a1e Mon Sep 17 00:00:00 2001 From: weety Date: Sun, 21 Jul 2013 20:01:24 +0800 Subject: [PATCH 5/5] Embedded GPLv2 license. --- bsp/at91sam9260/applications/application.c | 16 +++++++++--- bsp/at91sam9260/applications/startup.c | 16 +++++++++--- bsp/at91sam9260/drivers/at91_i2c_gpio.c | 16 +++++++++--- bsp/at91sam9260/drivers/at91_mci.c | 16 +++++++++--- bsp/at91sam9260/drivers/at91_mci.h | 16 +++++++++--- bsp/at91sam9260/drivers/board.c | 16 +++++++++--- bsp/at91sam9260/drivers/board.h | 16 +++++++++--- bsp/at91sam9260/drivers/led.c | 16 +++++++++--- bsp/at91sam9260/drivers/led.h | 24 ++++++++++++++++++ bsp/at91sam9260/drivers/macb.c | 16 +++++++++--- bsp/at91sam9260/drivers/macb.h | 16 +++++++++--- bsp/at91sam9260/drivers/mii.h | 16 +++++++++--- bsp/at91sam9260/drivers/usart.c | 25 +++++++++++++++++++ bsp/at91sam9260/platform/at91_aic.h | 16 +++++++++--- bsp/at91sam9260/platform/at91_pdc.h | 24 ++++++++++++++++++ bsp/at91sam9260/platform/at91_pio.h | 17 ++++++++++--- bsp/at91sam9260/platform/at91_pit.h | 16 +++++++++--- bsp/at91sam9260/platform/at91_pmc.h | 16 +++++++++--- bsp/at91sam9260/platform/at91_rstc.h | 16 +++++++++--- bsp/at91sam9260/platform/at91_serial.h | 16 +++++++++--- bsp/at91sam9260/platform/at91_shdwc.h | 16 +++++++++--- bsp/at91sam9260/platform/at91_tc.h | 16 +++++++++--- bsp/at91sam9260/platform/at91sam9260_matrix.h | 16 +++++++++--- bsp/at91sam9260/platform/at91sam926x.h | 16 +++++++++--- bsp/at91sam9260/platform/gpio.h | 24 ++++++++++++++++++ bsp/at91sam9260/platform/interrupt.c | 16 +++++++++--- bsp/at91sam9260/platform/io.h | 16 +++++++++--- bsp/at91sam9260/platform/irq.h | 16 +++++++++--- bsp/at91sam9260/platform/reset.c | 16 +++++++++--- bsp/at91sam9260/platform/start_gcc.S | 16 +++++++++--- bsp/at91sam9260/platform/start_rvds.S | 16 +++++++++--- bsp/at91sam9260/platform/system_clock.c | 16 +++++++++--- bsp/at91sam9260/platform/trap.c | 16 +++++++++--- libcpu/arm/arm926/context_gcc.S | 16 +++++++++--- libcpu/arm/arm926/context_rvds.S | 16 +++++++++--- libcpu/arm/arm926/cpuport.c | 16 +++++++++--- libcpu/arm/arm926/mmu.c | 16 +++++++++--- libcpu/arm/arm926/mmu.h | 16 +++++++++--- libcpu/arm/arm926/stack.c | 16 +++++++++--- 39 files changed, 553 insertions(+), 105 deletions(-) diff --git a/bsp/at91sam9260/applications/application.c b/bsp/at91sam9260/applications/application.c index 95eed6572e..fa2f06377b 100644 --- a/bsp/at91sam9260/applications/application.c +++ b/bsp/at91sam9260/applications/application.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/applications/startup.c b/bsp/at91sam9260/applications/startup.c index 2a06126b36..15e8138886 100644 --- a/bsp/at91sam9260/applications/startup.c +++ b/bsp/at91sam9260/applications/startup.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/drivers/at91_i2c_gpio.c b/bsp/at91sam9260/drivers/at91_i2c_gpio.c index bbee2033aa..c83c36218d 100644 --- a/bsp/at91sam9260/drivers/at91_i2c_gpio.c +++ b/bsp/at91sam9260/drivers/at91_i2c_gpio.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/drivers/at91_mci.c b/bsp/at91sam9260/drivers/at91_mci.c index 39fd364f11..fdfdcf459c 100644 --- a/bsp/at91sam9260/drivers/at91_mci.c +++ b/bsp/at91sam9260/drivers/at91_mci.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/drivers/at91_mci.h b/bsp/at91sam9260/drivers/at91_mci.h index 3a726aabe2..2591f20c98 100644 --- a/bsp/at91sam9260/drivers/at91_mci.h +++ b/bsp/at91sam9260/drivers/at91_mci.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/drivers/board.c b/bsp/at91sam9260/drivers/board.c index a9ac7f07e2..15ef7c9dd6 100644 --- a/bsp/at91sam9260/drivers/board.c +++ b/bsp/at91sam9260/drivers/board.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006 - 2009 RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/drivers/board.h b/bsp/at91sam9260/drivers/board.h index 59992480ed..e6c8f77865 100644 --- a/bsp/at91sam9260/drivers/board.h +++ b/bsp/at91sam9260/drivers/board.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/drivers/led.c b/bsp/at91sam9260/drivers/led.c index f3fddcce53..6c8f202108 100644 --- a/bsp/at91sam9260/drivers/led.c +++ b/bsp/at91sam9260/drivers/led.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/drivers/led.h b/bsp/at91sam9260/drivers/led.h index 71fd6947e6..f2967bc92d 100644 --- a/bsp/at91sam9260/drivers/led.h +++ b/bsp/at91sam9260/drivers/led.h @@ -1,3 +1,27 @@ +/* + * File : led.h + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2006, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: + * Date Author Notes + * 2011-01-13 weety first version + */ + #ifndef __LED_H__ #define __LED_H__ diff --git a/bsp/at91sam9260/drivers/macb.c b/bsp/at91sam9260/drivers/macb.c index 293a0662db..57631185a1 100644 --- a/bsp/at91sam9260/drivers/macb.c +++ b/bsp/at91sam9260/drivers/macb.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/drivers/macb.h b/bsp/at91sam9260/drivers/macb.h index 4697790f62..4e579e427a 100644 --- a/bsp/at91sam9260/drivers/macb.h +++ b/bsp/at91sam9260/drivers/macb.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/drivers/mii.h b/bsp/at91sam9260/drivers/mii.h index 8c932039eb..2f6dd18e71 100644 --- a/bsp/at91sam9260/drivers/mii.h +++ b/bsp/at91sam9260/drivers/mii.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/drivers/usart.c b/bsp/at91sam9260/drivers/usart.c index 11823b9c8c..7b95ca0e4d 100644 --- a/bsp/at91sam9260/drivers/usart.c +++ b/bsp/at91sam9260/drivers/usart.c @@ -1,3 +1,28 @@ +/* + * File : usart.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2006, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: + * Date Author Notes + * 2011-01-13 weety first version + * 2013-07-21 weety using serial component + */ + #include #include #include diff --git a/bsp/at91sam9260/platform/at91_aic.h b/bsp/at91sam9260/platform/at91_aic.h index 6de01c4444..45bd63733d 100644 --- a/bsp/at91sam9260/platform/at91_aic.h +++ b/bsp/at91sam9260/platform/at91_aic.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/at91_pdc.h b/bsp/at91sam9260/platform/at91_pdc.h index 1e52944c92..132a620126 100644 --- a/bsp/at91sam9260/platform/at91_pdc.h +++ b/bsp/at91sam9260/platform/at91_pdc.h @@ -1,3 +1,27 @@ +/* + * File : at91_pdc.h + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2006, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: + * Date Author Notes + * 2011-01-13 weety first version + */ + #ifndef __AT91_PDC_H__ #define __AT91_PDC_H__ diff --git a/bsp/at91sam9260/platform/at91_pio.h b/bsp/at91sam9260/platform/at91_pio.h index 917d1e2c9d..7aed6f42ed 100644 --- a/bsp/at91sam9260/platform/at91_pio.h +++ b/bsp/at91sam9260/platform/at91_pio.h @@ -3,9 +3,20 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/at91_pit.h b/bsp/at91sam9260/platform/at91_pit.h index 00e2df1f3e..5a960f454d 100644 --- a/bsp/at91sam9260/platform/at91_pit.h +++ b/bsp/at91sam9260/platform/at91_pit.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/at91_pmc.h b/bsp/at91sam9260/platform/at91_pmc.h index 39e7699d1c..17319545c4 100644 --- a/bsp/at91sam9260/platform/at91_pmc.h +++ b/bsp/at91sam9260/platform/at91_pmc.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/at91_rstc.h b/bsp/at91sam9260/platform/at91_rstc.h index efa302830d..c49cf15fcd 100644 --- a/bsp/at91sam9260/platform/at91_rstc.h +++ b/bsp/at91sam9260/platform/at91_rstc.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/at91_serial.h b/bsp/at91sam9260/platform/at91_serial.h index 6c476d3f6f..be314f7ea0 100644 --- a/bsp/at91sam9260/platform/at91_serial.h +++ b/bsp/at91sam9260/platform/at91_serial.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/at91_shdwc.h b/bsp/at91sam9260/platform/at91_shdwc.h index 059a22e121..fb99465f22 100644 --- a/bsp/at91sam9260/platform/at91_shdwc.h +++ b/bsp/at91sam9260/platform/at91_shdwc.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/at91_tc.h b/bsp/at91sam9260/platform/at91_tc.h index f7fb920baa..a3480701f4 100644 --- a/bsp/at91sam9260/platform/at91_tc.h +++ b/bsp/at91sam9260/platform/at91_tc.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/at91sam9260_matrix.h b/bsp/at91sam9260/platform/at91sam9260_matrix.h index 4405c58b8f..340d4a6f40 100644 --- a/bsp/at91sam9260/platform/at91sam9260_matrix.h +++ b/bsp/at91sam9260/platform/at91sam9260_matrix.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/at91sam926x.h b/bsp/at91sam9260/platform/at91sam926x.h index 2301140d24..add608d14c 100644 --- a/bsp/at91sam9260/platform/at91sam926x.h +++ b/bsp/at91sam9260/platform/at91sam926x.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/gpio.h b/bsp/at91sam9260/platform/gpio.h index 1872d3d68d..eb2e8a9595 100644 --- a/bsp/at91sam9260/platform/gpio.h +++ b/bsp/at91sam9260/platform/gpio.h @@ -1,3 +1,27 @@ +/* + * File : gpio.h + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2006, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: + * Date Author Notes + * 2011-01-13 weety first version + */ + #ifndef __GPIO_H__ #define __GPIO_H__ diff --git a/bsp/at91sam9260/platform/interrupt.c b/bsp/at91sam9260/platform/interrupt.c index 0a1809e43b..099345ef11 100644 --- a/bsp/at91sam9260/platform/interrupt.c +++ b/bsp/at91sam9260/platform/interrupt.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/io.h b/bsp/at91sam9260/platform/io.h index 3afdd1ceff..5cb9cac782 100644 --- a/bsp/at91sam9260/platform/io.h +++ b/bsp/at91sam9260/platform/io.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/irq.h b/bsp/at91sam9260/platform/irq.h index b56d9a1f79..fe1fea41d0 100644 --- a/bsp/at91sam9260/platform/irq.h +++ b/bsp/at91sam9260/platform/irq.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/reset.c b/bsp/at91sam9260/platform/reset.c index e116304dd4..4be76e69a1 100644 --- a/bsp/at91sam9260/platform/reset.c +++ b/bsp/at91sam9260/platform/reset.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/start_gcc.S b/bsp/at91sam9260/platform/start_gcc.S index f2ac7ad6e7..b5c7897938 100644 --- a/bsp/at91sam9260/platform/start_gcc.S +++ b/bsp/at91sam9260/platform/start_gcc.S @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http:/*openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/start_rvds.S b/bsp/at91sam9260/platform/start_rvds.S index 49ad09ea17..58661f9cb0 100644 --- a/bsp/at91sam9260/platform/start_rvds.S +++ b/bsp/at91sam9260/platform/start_rvds.S @@ -3,9 +3,19 @@ ; * This file is part of RT-Thread RTOS ; * COPYRIGHT (C) 2006, RT-Thread Development Team ; * -; * The license and distribution terms for this file may be -; * found in the file LICENSE in this distribution or at -; * http://www.rt-thread.org/license/LICENSE +; * This program is free software; you can redistribute it and/or modify +; * it under the terms of the GNU General Public License as published by +; * the Free Software Foundation; either version 2 of the License, or +; * (at your option) any later version. +; * +; * This program is distributed in the hope that it will be useful, +; * but WITHOUT ANY WARRANTY; without even the implied warranty of +; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; * GNU General Public License for more details. +; * +; * You should have received a copy of the GNU General Public License along +; * with this program; if not, write to the Free Software Foundation, Inc., +; * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ; * ; * Change Logs: ; * Date Author Notes diff --git a/bsp/at91sam9260/platform/system_clock.c b/bsp/at91sam9260/platform/system_clock.c index 8af42bfccf..13f11609d2 100644 --- a/bsp/at91sam9260/platform/system_clock.c +++ b/bsp/at91sam9260/platform/system_clock.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/at91sam9260/platform/trap.c b/bsp/at91sam9260/platform/trap.c index 6735ffd238..7fd4011451 100644 --- a/bsp/at91sam9260/platform/trap.c +++ b/bsp/at91sam9260/platform/trap.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/libcpu/arm/arm926/context_gcc.S b/libcpu/arm/arm926/context_gcc.S index 30d8235331..a3f07a1860 100644 --- a/libcpu/arm/arm926/context_gcc.S +++ b/libcpu/arm/arm926/context_gcc.S @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/libcpu/arm/arm926/context_rvds.S b/libcpu/arm/arm926/context_rvds.S index 86f13dd1ba..631da83372 100644 --- a/libcpu/arm/arm926/context_rvds.S +++ b/libcpu/arm/arm926/context_rvds.S @@ -3,9 +3,19 @@ ; * This file is part of RT-Thread RTOS ; * COPYRIGHT (C) 2006, RT-Thread Development Team ; * -; * The license and distribution terms for this file may be -; * found in the file LICENSE in this distribution or at -; * http://www.rt-thread.org/license/LICENSE +; * This program is free software; you can redistribute it and/or modify +; * it under the terms of the GNU General Public License as published by +; * the Free Software Foundation; either version 2 of the License, or +; * (at your option) any later version. +; * +; * This program is distributed in the hope that it will be useful, +; * but WITHOUT ANY WARRANTY; without even the implied warranty of +; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; * GNU General Public License for more details. +; * +; * You should have received a copy of the GNU General Public License along +; * with this program; if not, write to the Free Software Foundation, Inc., +; * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ; * ; * Change Logs: ; * Date Author Notes diff --git a/libcpu/arm/arm926/cpuport.c b/libcpu/arm/arm926/cpuport.c index caddf45a96..9908471a5c 100644 --- a/libcpu/arm/arm926/cpuport.c +++ b/libcpu/arm/arm926/cpuport.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/libcpu/arm/arm926/mmu.c b/libcpu/arm/arm926/mmu.c index c14f22bd84..debb88f267 100644 --- a/libcpu/arm/arm926/mmu.c +++ b/libcpu/arm/arm926/mmu.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/libcpu/arm/arm926/mmu.h b/libcpu/arm/arm926/mmu.h index e45d3b0239..d6c497efb9 100644 --- a/libcpu/arm/arm926/mmu.h +++ b/libcpu/arm/arm926/mmu.h @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/libcpu/arm/arm926/stack.c b/libcpu/arm/arm926/stack.c index 3b31ea28b5..f58b43cbd4 100644 --- a/libcpu/arm/arm926/stack.c +++ b/libcpu/arm/arm926/stack.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes