lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 |
|
| 2 | #if 0
|
| 3 |
|
| 4 | /*******************************************************************************
|
| 5 | * °æÈ¨ËùÓÐ (C)2010, ÉîÛÚÊÐÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
|
| 6 | *
|
| 7 | * ÎļþÃû³Æ£º config.h
|
| 8 | * Îļþ±êʶ£º /include/config.h
|
| 9 | * ÄÚÈÝÕªÒª£º ÒýÈ뿪·¢°åµÄÅäÖÃÎļþ
|
| 10 | * ÆäËü˵Ã÷£º
|
| 11 | * µ±Ç°°æ±¾£º 1.0
|
| 12 | * ×÷¡¡¡¡Õߣº ÎÌÔÆ·å
|
| 13 | * Íê³ÉÈÕÆÚ£º 2010-9-30
|
| 14 | *
|
| 15 | *
|
| 16 |
|
| 17 | *******************************************************************************/
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 | #ifndef __INCLUDE_CONFIG_H_
|
| 22 | #define __INCLUDE_CONFIG_H_
|
| 23 | /*********************************************************************************
|
| 24 | 1:open 0:close
|
| 25 | * ¹¦ÄÜ SIM_EN USE_ASIC SYNC_USB_CTRL SYNC_USB_HSIC SYNC_SETADDRESS
|
| 26 | * FPGA 1 0 0 0 0
|
| 27 | * usb_ctrlÑéÖ¤ 0 1 1 1 1
|
| 28 | * usb_hsicÑéÖ¤ 0 1 1 1 1
|
| 29 | * usbtimeoutÑéÖ¤0 1 1 1 1
|
| 30 | * asic 1 1 0 0 0
|
| 31 | **********************************************************************************/
|
| 32 | #define SIM_EN 1
|
| 33 | #define USE_ASIC 0
|
| 34 | #define SYNC_USB_CTRL 0
|
| 35 | #define SYNC_USB_HSIC 0
|
| 36 | #define SYNC_SETADDRESS 0
|
| 37 |
|
| 38 | #if !USE_ASIC ///0:fpga 1:asic
|
| 39 | // CPUʱÖÓÆµÂÊ
|
| 40 | #define SYS_CPU_FREQ 50000000 // ¶¨ÒåCPUʱÖÓ,ÓÃÓÚ¼ÆÊ±
|
| 41 | #define SYS_UART_CLK 25000000 // ʱÖÓÆµÂÊ
|
| 42 | #define SYS_UART_CLK_CONFIG_PLL 25000000 // ʱÖÓÆµÂÊ
|
| 43 | #else
|
| 44 | // CPUʱÖÓÆµÂÊ
|
| 45 | #define SYS_CPU_FREQ 208000000 // ¶¨ÒåCPUʱÖÓ,ÓÃÓÚ¼ÆÊ±
|
| 46 | #define SYS_UART_CLK (26000000/6) // ʱÖÓÆµÂÊ
|
| 47 | #define SYS_UART_CLK_CONFIG_PLL 104000000 // ʱÖÓÆµÂÊ
|
| 48 | #endif
|
| 49 | // Æô¶¯Ä£Ê½Ñ¡Ôñ¼Ä´æÆ÷
|
| 50 | #define SYS_BOOTSEL_BASE 0x0010c03c // ¶¨ÒåBOOTSEL¼Ä´æÆ÷µØÖ·
|
| 51 |
|
| 52 | #define SOC_CRM_BASE (0x0010c000)
|
| 53 | #define BOOT_SEL (0x3c)
|
| 54 | #define NAND_CFG (0x34)
|
| 55 | #define SOC_MOD_CLKEN0 (0x0010c00c)
|
| 56 | #define SOC_MOD_CLKEN1 (0x0010c010)
|
| 57 | #define SOC_MOD_RSTEN (0x0010c018)
|
| 58 | #define SOC_MOD_USBSTATECTRL (0x0010c05c)
|
| 59 | #define SOC_MOD_RSTEN1 (0x0010c064)
|
| 60 |
|
| 61 | #define CFG_STACK_TOP 0x0008AFE0 // ¶¨ÒåÁËÕ»¶¥
|
| 62 |
|
| 63 | // UART ²ÎÊý
|
| 64 | #define SYS_UART_BASE 0x00102000 // »ùµØÖ·
|
| 65 | //#define SYS_UART_CLK 25000000 // ʱÖÓÆµÂÊ
|
| 66 | #define CFG_UART_BAUDRATE 115200 // ²¨ÌØÂÊ
|
| 67 | #define CFG_BUF_SIZE 64 // Êý¾Ý»º³åÇø´óС
|
| 68 | #if !USE_ASIC
|
| 69 | // USB ²ÎÊý
|
| 70 | #define SYS_USB_BASE 0x01240000 // »ùµØÖ·
|
| 71 | #define SYS_USB_HSIC_BASE 0x01280000 // »ùµØÖ·
|
| 72 | #else
|
| 73 | #define SYS_USB_BASE 0x01280000 // »ùµØÖ·
|
| 74 | #define SYS_USB_HSIC_BASE 0x01240000 // »ùµØÖ·
|
| 75 | #endif
|
| 76 |
|
| 77 |
|
| 78 | // NAND FLASH ²ÎÊý
|
| 79 | #define SYS_NAND_BASE 0x01207000 // ¼Ä´æÆ÷»ùµØÖ·
|
| 80 | #define SYS_NAND_DATA 0x01208000 // Êý¾Ý»ùµØÖ·
|
| 81 |
|
| 82 | // ͨÓòÎÊý
|
| 83 | #define CFG_LOAD_BASE 0x0008B000 // ¼ÓÔØ´úÂëµ½¸ÃµØÖ·,±ØÐë4K¶ÔÆë
|
| 84 | #define SYS_LOAD_LEN 0x1000 // ¼ÓÔØ³¤¶È
|
| 85 | #define CFG_PRINT_BUF_SIZE 256
|
| 86 |
|
| 87 | #define POWER_DOMAIN_ISO (0x0010d200+0x41*4)
|
| 88 | #define POWER_DOMAIN_POWERON (0x0010d200+0x42*4)
|
| 89 | #define POWER_DOMAIN_RST (0x0010d200+0x40*4)
|
| 90 |
|
| 91 | //ÑéÖ¤ÐèÒª
|
| 92 | #if SYNC_USB_CTRL
|
| 93 | #define ARM_PORTA (0x102040)
|
| 94 | #endif
|
| 95 |
|
| 96 | #if SYNC_USB_HSIC
|
| 97 | #define REG_GPIO_OUT 0x01400014
|
| 98 | #define REG_GPIO_IN 0x01409020
|
| 99 | #endif
|
| 100 | #define CFG_USB30_LOAD_BASE 0x62000000 //USB30 ÄÚ²¿DMAÊý¾ÝÏÂÔØµØÖ·
|
| 101 | #endif
|
| 102 | #endif
|
| 103 | /******************************************************************************/
|
| 104 | /*******************************************************************************
|
| 105 | * °æÈ¨ËùÓÐ (C)2010, ÉîÛÚÊÐÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
|
| 106 | *
|
| 107 | * ÎļþÃû³Æ£º config.h
|
| 108 | * Îļþ±êʶ£º /include/config.h
|
| 109 | * ÄÚÈÝÕªÒª£º ÒýÈ뿪·¢°åµÄÅäÖÃÎļþ
|
| 110 | * ÆäËü˵Ã÷£º
|
| 111 | * µ±Ç°°æ±¾£º 1.0
|
| 112 | * ×÷¡¡¡¡Õߣº
|
| 113 | * Íê³ÉÈÕÆÚ£º
|
| 114 | *
|
| 115 | *
|
| 116 | *******************************************************************************/
|
| 117 | #ifndef __INCLUDE_CONFIG_H_
|
| 118 | #define __INCLUDE_CONFIG_H_
|
| 119 |
|
| 120 | #define FPGA 0
|
| 121 | #define ASIC 1
|
| 122 | #define EMULATION 2
|
| 123 | #define ULPI 0
|
| 124 | #define UTMI 1
|
| 125 |
|
| 126 | /*ͨ¹ýºê¶¨ÒåÀ´Ñ¡Ôñ°æ±¾·½Ê½*/
|
| 127 | #define SIM_EN FPGA
|
| 128 |
|
| 129 | #define USB_PHY UTMI
|
| 130 |
|
| 131 | //IRAM0 0x62000000 IRAM2 0x80000 IRAM1 0x100000(δÓÃ)
|
| 132 | #define CFG_USB30_LOAD_BASE 0x62000000 //USB30 ÄÚ²¿DMAÊý¾ÝÏÂÔØµØÖ·
|
| 133 | #define CFG_SDIO_LOAD_BASE 0x62000000 // SDIO DMA Êý¾Ý°áÔ˵ØÖ·
|
| 134 | #define CFG_LOAD_BASE 0x00087000 // ¼ÓÔØ´úÂëµ½¸ÃµØÖ·,±ØÐë4K¶ÔÆë
|
| 135 | #define SYS_LOAD_LEN 0x1000 // ¼ÓÔØ³¤¶È
|
| 136 | #define CFG_PRINT_BUF_SIZE 256
|
| 137 | #define CFG_STACK_TOP 0x86800
|
| 138 |
|
| 139 | #if ((SIM_EN == ASIC)||(SIM_EN == EMULATION))
|
| 140 | // CPUʱÖÓÆµÂÊ,usb³¬Ê±»úÖÆ¼ÆÊ±²ÉÓÃtick£¬Óëm0ͬƵ£¬ÇÒusb bootÐèpllʱÖÓÅäÖá£
|
| 141 | #define SYS_CPU_FREQ 208000000 // ¶¨ÒåCPUʱÖÓ,ÓÃÓÚ¼ÆÊ±
|
| 142 | #define SYS_UART_CLK 26000000 // ʱÖÓÆµÂÊ
|
| 143 | #define PLL_8X(x) ((x)>>3) //pllδÅäÖÃǰ£¬´æÔÚ8±¶µÄ¹ØÏµ
|
| 144 | #elif (SIM_EN == FPGA)
|
| 145 | // CPUʱÖÓÆµÂÊ
|
| 146 | #define SYS_CPU_FREQ 30000000 // ¶¨ÒåCPUʱÖÓ,ÓÃÓÚ¼ÆÊ±
|
| 147 | #define SYS_UART_CLK 25000000 // ʱÖÓÆµÂÊ
|
| 148 | #define PLL_8X(x) (x) //²»´æÔÚ±¶Êý²îÒì
|
| 149 | #endif
|
| 150 |
|
| 151 | // Æô¶¯Ä£Ê½Ñ¡Ôñ¼Ä´æÆ÷
|
| 152 | /*bootsel_info*/
|
| 153 | /*[0:3] bootsel0,bootsel1,bootsel2,bootsel3
|
| 154 | [4:5] nand page size
|
| 155 | [6] nand data width
|
| 156 | [7] nand addr cycles*/
|
| 157 | /*
|
| 158 | #define SYS_BOOTSEL_INFO 0x0013b04c // ¶¨ÒåBOOTSEL¼Ä´æÆ÷µØÖ·
|
| 159 | #define SYS_STD_CRM_BASE 0x1307000
|
| 160 | #define SYS_LSP_CRM_BASE 0x01400000
|
| 161 | #define SYS_SOC_CRM_BASE 0x0013b000
|
| 162 | #define SYS_PAD_CTRL0_BASE 0x143000
|
| 163 | */
|
| 164 |
|
| 165 | #define SOC_CRM_BASE (0x0013b000)
|
| 166 | #define BOOT_SEL (0x3c)
|
| 167 | #define NAND_CFG (0x34)
|
| 168 | #define SOC_MOD_CLKEN0 (0x0013b06c)
|
| 169 | #define SOC_MOD_CLKEN1 (0x0013b06c)
|
| 170 | #define SOC_MOD_RSTEN (0x0013b080)
|
| 171 | #define SOC_MOD_USBSTATECTRL (0x0010c05c)
|
| 172 | #define SOC_MOD_RSTEN1 (0x0010c064)
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 | /*UART ²ÎÊý*/
|
| 179 | #define SYS_UART_BASE 0x0138000 // UART0 »ùµØÖ· //
|
| 180 |
|
| 181 | #define CFG_UART_BAUDRATE 115200 // ²¨ÌØÂÊ
|
| 182 | #define CFG_BUF_SIZE 64 // Êý¾Ý»º³åÇø´óС
|
| 183 |
|
| 184 | /*USB BASE ADDRESS*/
|
| 185 | //#define SYS_USB_BASE 0x02000000 // 3.0»ùµØÖ·
|
| 186 | //#define SYS_USB_HSIC_BASE 0x01500000 // HSIC»ùµØÖ·
|
| 187 |
|
| 188 | #define SYS_USB_BASE 0x01500000 // 2.0»ùµØÖ·
|
| 189 | #define SYS_USB_HSIC_BASE 0x01600000 // HSIC»ùµØÖ·
|
| 190 | //ÒÔÉÏÊÇ7520V2оƬÖж¨ÒåµÄUSB»ùÖ·
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 | /* NAND FLASH ²ÎÊý*/
|
| 196 | #define SYS_NAND_BASE 0x01211000 // ¼Ä´æÆ÷»ùµØÖ·
|
| 197 | #define SYS_NAND_DATA 0x01212000 // Êý¾Ý»ùµØÖ·
|
| 198 |
|
| 199 | /*SPI_FLASH²ÎÊý*/
|
| 200 | #define SYS_SPI_FLASH_BASE 0x140c000
|
| 201 |
|
| 202 | /*SD/MMC ²ÎÊý*/
|
| 203 | #define SYS_EMMC_REGS_BASE 0x01210000 //SD0
|
| 204 | #define CFG_EMMC_CLK_REF 26000000
|
| 205 | #define CFG_EMMC_CLK_ENUM 400000
|
| 206 | #define CFG_EMMC_CLK_WORK 26000000
|
| 207 |
|
| 208 | /*SDIO SLAVE ²ÎÊý*/
|
| 209 | #define SYS_SDIO_REGS_BASE 0x01540000 //SD1
|
| 210 |
|
| 211 |
|
| 212 | #define POWER_DOMAIN_ISO (0x00140110)
|
| 213 | #define POWER_DOMAIN_POWERON (0x00140114)
|
| 214 | #define POWER_DOMAIN_RST (0x0014010c)
|
| 215 |
|
| 216 |
|
| 217 | //ÑéÖ¤ÐèÒª
|
| 218 | #if SIM_EN == EMULATION
|
| 219 | /*USB2.0*/
|
| 220 | #define ARM_PORTA (REG_GPIO_OUT)
|
| 221 | /*HSIC*/
|
| 222 | #define REG_GPIO_OUT 0x00145060 //7520
|
| 223 | #define REG_GPIO_IN 0x00145014
|
| 224 | #endif
|
| 225 | #endif
|
| 226 |
|