1 /**
2  * Copyright (c) 2015, Realsil Semiconductor Corporation. All rights reserved.
3  *
4  */
5 #ifndef _BOARD_H_
6 #define _BOARD_H_
7 
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 #include <stdio.h>
13 #include "ameba_soc.h"
14 
15 #define platform_debug DBG_8195A
16 
17 #define TRACE_SWITCH_CLOSE
18 //trace_uart
19 //========================================
20 /* CONFIG */
21 //#define TRACE_UART_DEFAULT
22 #define TRACE_UART_TX_IRQ
23 //#define TRACE_UART_TX_WHILE
24 //#define TRACE_UART_DMA
25 /* TRACE UART DEFAULT USE PA18 PA19 UART0
26    (BEBCAUSE OF THE BT LOG IS PA16)*/
27 #define TRACE_UART_BAUDRATE  1500000
28 
29 #ifdef TRACE_UART_DEFAULT
30 
31 
32 #define TRACE_UART_DEV    UART0_DEV
33 #define TRACE_UART_IRQ    UART0_IRQ
34 #define TRACE_UART_TX     _PA_18
35 //#define TRACE_UART_RX     _PA_19
36 
37 #ifdef TRACE_UART_DMA
38 #define TRACE_UART_INDEX        0
39 #define TRACEUART_DMA_PRIO      12
40 #endif
41 
42 #else
43 #define TRACE_UART_DEV    UART3_DEV
44 #define TRACE_UART_IRQ    UARTLP_IRQ
45 #define TRACE_UART_TX     _PA_26
46 //#define TRACE_UART_RX     _PA_25   //km0 not support dma
47 #endif
48 
49 
50 #ifdef TRACE_UART_TX_IRQ
51 #define TRACE_COUNT             16   //ONE IRQ send DATA LEN
52 #define TRACEUART_IRQ_PRIO      12
53 #endif
54 
55 
56 //==hci_uart============================
57 //====trace_task========
58 #define TRACE_TASK_PRIO  3
59 
60 
61 //hci_rtk============
62 
63 #define hci_board_debug printf
64 #define BT_DEFAUT_LMP_SUBVER   0x8721
65 
66 #define HCI_START_IQK
67 #define HCI_WRITE_IQK
68 #ifdef CONFIG_MP_INCLUDED
69 #define BT_MP_MODE
70 #define HCI_MP_BRIDGE   1
71 #endif
72 
73 
74 
75 //=board.h====
76 
77 #define MERGE_PATCH_ADDRESS_OTA1  0x080F8000
78 #define MERGE_PATCH_ADDRESS_OTA2  0x081F8000
79 #define MERGE_PATCH_SWITCH_ADDR   0x08003028
80 #define MERGE_PATCH_SWITCH_SINGLE 0xAAAAAAAA
81 
82 #define CALI_IQK_RF_STEP0   0x4000
83 #define CALI_IQK_RF_STEP1   0x0180
84 #define CALI_IQK_RF_STEP2   0x3800
85 #define CALI_IQK_RF_STEP3F   0x0400
86 
87 
88 
89 #define LEFUSE(x)  (x-0x190)
90 
91 
92 
93 
94 #define EFUSE_SW_USE_FLASH_PATCH     BIT0
95 #define EFUSE_SW_BT_FW_LOG           BIT1
96 #define EFUSE_SW_RSVD                BIT2
97 #define EFUSE_SW_HCI_OUT             BIT3
98 #define EFUSE_SW_UPPERSTACK_SWITCH   BIT4
99 #define EFUSE_SW_TRACE_SWITCH        BIT5
100 #define EFUSE_SW_DRIVER_DEBUG_LOG    BIT6
101 #define EFUSE_SW_RSVD2               BIT7
102 
103 
104 //#define CHECK_SW(x)                  (HAL_READ32(SPI_FLASH_BASE, FLASH_SYSTEM_DATA_ADDR + 0x28) & x)
105 #define CHECK_SW(x)                  (1)
106 
107 extern uint8_t rltk_wlan_is_mp(void);
108 
109 
110 
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif
117 
118