From 593390a93da21a388c041a40f6b9205bcfc67c89 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Mon, 9 Nov 2009 20:36:16 +0000 Subject: [PATCH] - changed register defines to UPPER-CASE Committed on the Free edition of March Hare Software CVSNT Server. Upgrade to CVS Suite for more features and support: http://march-hare.com/cvsnt/ git-svn-id: http://moon:8086/svn/vhdl/trunk@654 cc03376c-175c-47c8-b038-4cd826a8556b --- .../bootloader/bootloader_with_flash.c | 20 ++++++------- .../bsp/examples/bootloader/libsys_boot.c | 8 ++--- .../bsp/examples/bootloader/libsys_boot.h | 30 +++++++++---------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader_with_flash.c b/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader_with_flash.c index bbad186..869d544 100644 --- a/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader_with_flash.c +++ b/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader_with_flash.c @@ -230,15 +230,15 @@ int main(int argc, char *argv[]) flash_img_hdr_t *pImg_hdr; UINT32 img_size, block_sel; - volatile UINT32 *pReg = (UINT32*)sys_led_port; - volatile UINT32 *pBtn = (UINT32*)sys_gpio0; - volatile UINT32 *pDip = (UINT32*)sys_gpio1; + volatile UINT32 *pReg = (UINT32*)SYS_LED_PORT; + volatile UINT32 *pBtn = (UINT32*)SYS_GPIO0; + volatile UINT32 *pDip = (UINT32*)SYS_GPIO1; volatile UINT8 *pMem; volatile UINT32 *pROM32; volatile UINT32 *pMem32; - volatile UINT32 *pFlashIO = (UINT32*)sys_flash_io; // Flash in uncached area - volatile UINT32 *pFlashMem = (UINT32*)sys_flash_mem; // Flash in cached area - volatile UINT32 *pUSB = (UINT32*)sys_usb_data; + volatile UINT32 *pFlashIO = (UINT32*)SYS_FLASH_IO; // Flash in uncached area + volatile UINT32 *pFlashMem = (UINT32*)SYS_FLASH_MEM; // Flash in cached area + volatile UINT32 *pUSB = (UINT32*)SYS_USB_DATA; volatile UINT8 *ram8 = (UINT8*)SDRAM_BASE; volatile UINT16 *ram16 = (UINT16*)SDRAM_BASE; @@ -250,7 +250,7 @@ int main(int argc, char *argv[]) block_sel = 0x7F & (UINT32)*pDip; // ---------------------------------------------------------- - if (IS_ERROR(flash_find(&flash, sys_flash_io))) + if (IS_ERROR(flash_find(&flash, SYS_FLASH_IO))) { sputs("Cannot find flash device. Exit now!\n\n"); return 1; @@ -260,7 +260,7 @@ int main(int argc, char *argv[]) flash_offset = flash_get_offset_by_blocknum(&flash, block_sel); ram32 = (UINT32*)(SDRAM_BASE); - pFlashIO = (UINT32*)(sys_flash_io + flash_offset); + pFlashIO = (UINT32*)(SYS_FLASH_IO + flash_offset); if (!(*pBtn & 8)) { @@ -280,8 +280,8 @@ int main(int argc, char *argv[]) // It's safe to use cached Flash, // because D-Cache was invalidated during execution of start code -// pFlashIO = (UINT32*)(sys_flash_io + pImg_hdr->img_base); - pFlashMem = (UINT32*)(sys_flash_mem + pImg_hdr->img_base); +// pFlashIO = (UINT32*)(SYS_FLASH_IO + pImg_hdr->img_base); + pFlashMem = (UINT32*)(SYS_FLASH_MEM + pImg_hdr->img_base); for (i=0; i < img_size/4; i++) // ram32[i] = pFlashIO[i]; diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.c b/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.c index cf3ef5e..0f39d80 100644 --- a/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.c +++ b/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.c @@ -70,8 +70,8 @@ UINT32 CP0_PRID_read(void) // --------------------------------------------------------------------------------- char readchar(void) { - volatile UINT32 *pUART_stat = (UINT32*)sys_uart_stat; - volatile UINT32 *pUART_data = (UINT32*)sys_uart_data; + volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT; + volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA; while(!(0x10 & *pUART_stat)); @@ -80,8 +80,8 @@ char readchar(void) void writechar(char c) { - volatile UINT32 *pUART_stat = (UINT32*)sys_uart_stat; - volatile UINT32 *pUART_data = (UINT32*)sys_uart_data; + volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT; + volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA; while((0x02 & *pUART_stat) != 0); diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.h b/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.h index c5645cc..3bf4ecc 100644 --- a/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.h +++ b/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.h @@ -17,21 +17,21 @@ #define IS_ERROR(e) ((e & 0x80000000) == 0x80000000) -#define sys_gpio0 0xA0000000 -#define sys_gpio1 0xA0000004 -#define sys_led_port sys_gpio0 -#define sys_usb_ctrl sys_gpio1 -#define sys_timer_usec 0xA0000008 -#define sys_timer_sec 0xA000000C -#define sys_uart_data 0xA0010000 -#define sys_uart_stat 0xA0010004 -#define sys_uart_baud 0xA0010008 -#define sys_usb_data 0xA0020000 -#define sys_usb_mbx 0xA0020004 -#define sys_usb_addr 0xA0020008 -#define sys_usb_status 0xA002000C -#define sys_flash_io 0xA4000000 -#define sys_flash_mem 0x00000000 +#define SYS_GPIO0 0xA0000000 +#define SYS_GPIO1 0xA0000004 +#define SYS_LED_PORT SYS_GPIO0 +#define SYS_USB_CTRL SYS_GPIO1 +#define SYS_TIMER_USEC 0xA0000008 +#define SYS_TIMER_SEC 0xA000000C +#define SYS_UART_DATA 0xA0010000 +#define SYS_UART_STAT 0xA0010004 +#define SYS_UART_BAUD 0xA0010008 +#define SYS_USB_DATA 0xA0020000 +#define SYS_USB_MBX 0xA0020004 +#define SYS_USB_ADDR 0xA0020008 +#define SYS_USB_STATUS 0xA002000C +#define SYS_FLASH_IO 0xA4000000 +#define SYS_FLASH_MEM 0x00000000 // MIPS specific UINT32 CP0_SR_read(void);