blob: e5c1d3c653853e5583bf56441b3e13b9a6af48dd [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/*******************************************************************************
2* °æÈ¨ËùÓÐ (C)2010, ÉîÛÚÊÐÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
3*
4* ÎļþÃû³Æ£º config.h
5* Îļþ±êʶ£º /include/config.h
6* ÄÚÈÝÕªÒª£º ÒýÈ뿪·¢°åµÄÅäÖÃÎļþ
7* ÆäËü˵Ã÷£º
8* µ±Ç°°æ±¾£º 1.0
9* ×÷¡¡¡¡Õߣº ÎÌÔÆ·å
10* Íê³ÉÈÕÆÚ£º 2010-9-30
11*
12*
13*******************************************************************************/
14#ifndef __INCLUDE_USB_CONFIG_H_
15#define __INCLUDE_USB_CONFIG_H_
16/*********************************************************************************
171:open 0:close
18* ¹¦ÄÜ SIM_EN USE_ASIC SYNC_USB_CTRL SYNC_USB_HSIC SYNC_SETADDRESS
19* FPGA 1 0 0 0 0
20* usb_ctrlÑéÖ¤ 0 1 1 1 1
21* usb_hsicÑéÖ¤ 0 1 1 1 1
22* usbtimeoutÑéÖ¤0 1 1 1 1
23* asic 1 1 0 0 0
24**********************************************************************************/
25#define SIM_EN 1
26#define USE_ASIC 1
27#define SYNC_USB_CTRL 0
28#define SYNC_USB_HSIC 0
29#define SYNC_SETADDRESS 0
30#define DMA_ENABLE 0
31#if DMA_ENABLE
32#define DWC_SLAVE_ONLY_ARCH 0
33#define DWC_EXT_DMA_ARCH 1
34#define DWC_INT_DMA_ARCH 2
35#define DWC_GAHBCFG_INT_DMA_BURST_SINGLE 0
36#define DWC_GAHBCFG_INT_DMA_BURST_INCR 1
37#define DWC_GAHBCFG_INT_DMA_BURST_INCR4 3
38#define DWC_GAHBCFG_INT_DMA_BURST_INCR8 5
39#define DWC_GAHBCFG_INT_DMA_BURST_INCR16 7
40
41//#define DRV_BUF_BASE_ADDR 0x23000000
42#define DRV_BUF_BASE_ADDR 0x21000000
43#define FPGA_DDR_FOR_USB_DMA_ADDR DRV_BUF_BASE_ADDR
44#define USB_EP_BUF_ADDR FPGA_DDR_FOR_USB_DMA_ADDR
45#define USB_EP_BUF_LEN 0x500000 /* 5M byte*/
46
47#define USB_EP0_BUF_ADDR (DRV_BUF_BASE_ADDR + 0x500000)
48#define USB_EP0_BUF_LEN (0x100000-0x1000) /* 1M-4K byte*/
49#define USB_EP0_MAX_BUF_SIZE 256
50#define USB_EP_MAX_BUF_SIZE 8192
51#define USB_EP0_PKT_BUF_SIZE 5
52#endif
53
54#if !USE_ASIC ///0:fpga 1:asic
55// CPUʱÖÓÆµÂÊ
56#define SYS_CPU_FREQ 50000000 // ¶¨ÒåCPUʱÖÓ,ÓÃÓÚ¼ÆÊ±
57#define SYS_UART_CLK 25000000 // ʱÖÓÆµÂÊ
58#define SYS_UART_CLK_CONFIG_PLL 25000000 // ʱÖÓÆµÂÊ
59#else
60// CPUʱÖÓÆµÂÊ
61#define SYS_CPU_FREQ 208000000 // ¶¨ÒåCPUʱÖÓ,ÓÃÓÚ¼ÆÊ±
62#define SYS_UART_CLK (26000000/6) // ʱÖÓÆµÂÊ
63#define SYS_UART_CLK_CONFIG_PLL 104000000 // ʱÖÓÆµÂÊ
64#endif
65// Æô¶¯Ä£Ê½Ñ¡Ôñ¼Ä´æÆ÷
66#define SYS_BOOTSEL_BASE 0x0010c03c // ¶¨ÒåBOOTSEL¼Ä´æÆ÷µØÖ·
67
68#define SOC_CRM_BASE (0x0010c000)
69#define BOOT_SEL (0x3c)
70#define NAND_CFG (0x34)
71#define SOC_MOD_CLKEN0 (0x0013b06c)
72#define SOC_MOD_CLKEN1 (0x0013b06c)
73#define SOC_MOD_RSTEN (0x0013b080)
74#define SOC_MOD_USBSTATECTRL (0x0010c05c)
75#define SOC_MOD_RSTEN1 (0x0010c064)
76
77#define CFG_STACK_TOP 0x0008AFE0 // ¶¨ÒåÁËÕ»¶¥
78
79// UART ²ÎÊý
80#define SYS_UART_BASE 0x00102000 // »ùµØÖ·
81//#define SYS_UART_CLK 25000000 // ʱÖÓÆµÂÊ
82#define CFG_UART_BAUDRATE 115200 // ²¨ÌØÂÊ
83#define CFG_BUF_SIZE 64 // Êý¾Ý»º³åÇø´óС
84#if !USE_ASIC
85// USB ²ÎÊý
86#define SYS_USB_BASE 0x01500000 // »ùµØÖ·
87#define SYS_USB_HSIC_BASE 0x01600000 // »ùµØÖ·
88#else
89#define SYS_USB_BASE 0x01500000 // »ùµØÖ·
90#define SYS_USB_HSIC_BASE 0x01600000 // »ùµØÖ·
91#endif
92
93
94// NAND FLASH ²ÎÊý
95#define SYS_NAND_BASE 0x01207000 // ¼Ä´æÆ÷»ùµØÖ·
96#define SYS_NAND_DATA 0x01208000 // Êý¾Ý»ùµØÖ·
97
98// ͨÓòÎÊý
99#define CFG_LOAD_BASE 0x0008B000 // ¼ÓÔØ´úÂëµ½¸ÃµØÖ·,±ØÐë4K¶ÔÆë
100#define SYS_LOAD_LEN 0x1000 // ¼ÓÔØ³¤¶È
101#define CFG_PRINT_BUF_SIZE 256
102
103//#define POWER_DOMAIN_ISO (0x0010d200+0x41*4)
104//#define POWER_DOMAIN_POWERON (0x0010d200+0x42*4)
105//#define POWER_DOMAIN_RST (0x0010d200+0x40*4)
106
107//ÑéÖ¤ÐèÒª
108#if SYNC_USB_CTRL
109#define ARM_PORTA (0x102040)
110#endif
111
112#if SYNC_USB_HSIC
113#define REG_GPIO_OUT 0x01400014
114#define REG_GPIO_IN 0x01409020
115#endif
116#endif