| OLD | NEW |
| 1 //------------------------------------------------------------------------------ | 1 //------------------------------------------------------------------------------ |
| 2 // <copyright file="targaddrs.h" company="Atheros"> | 2 // Copyright (c) 2010 Atheros Corporation. All rights reserved. |
| 3 // Copyright (c) 2010 Atheros Corporation. All rights reserved. | |
| 4 // | |
| 5 // This program is free software; you can redistribute it and/or modify | |
| 6 // it under the terms of the GNU General Public License version 2 as | |
| 7 // published by the Free Software Foundation; | |
| 8 // | |
| 9 // Software distributed under the License is distributed on an "AS | |
| 10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | |
| 11 // implied. See the License for the specific language governing | |
| 12 // rights and limitations under the License. | |
| 13 // | 3 // |
| 14 // | 4 // |
| 5 // Permission to use, copy, modify, and/or distribute this software for any |
| 6 // purpose with or without fee is hereby granted, provided that the above |
| 7 // copyright notice and this permission notice appear in all copies. |
| 8 // |
| 9 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 16 // |
| 17 // |
| 18 // |
| 19 // Author(s): ="Atheros" |
| 15 //------------------------------------------------------------------------------ | 20 //------------------------------------------------------------------------------ |
| 16 //============================================================================== | |
| 17 // Author(s): ="Atheros" | |
| 18 //============================================================================== | |
| 19 | 21 |
| 20 #ifndef __TARGADDRS_H__ | 22 #ifndef __TARGADDRS_H__ |
| 21 #define __TARGADDRS_H__ | 23 #define __TARGADDRS_H__ |
| 22 #if defined(AR6001) | 24 |
| 23 #include "AR6001/addrs.h" | 25 #ifndef ATH_TARGET |
| 26 #include "athstartpack.h" |
| 24 #endif | 27 #endif |
| 28 |
| 25 #if defined(AR6002) | 29 #if defined(AR6002) |
| 26 #include "AR6002/addrs.h" | 30 #include "AR6002/addrs.h" |
| 27 #endif | 31 #endif |
| 28 | 32 |
| 29 /* | 33 /* |
| 30 * AR6K option bits, to enable/disable various features. | 34 * AR6K option bits, to enable/disable various features. |
| 31 * By default, all option bits are 0. | 35 * By default, all option bits are 0. |
| 32 * These bits can be set in LOCAL_SCRATCH register 0. | 36 * These bits can be set in LOCAL_SCRATCH register 0. |
| 33 */ | 37 */ |
| 34 #define AR6K_OPTION_BMI_DISABLE 0x01 /* Disable BMI comm with Host */ | 38 #define AR6K_OPTION_BMI_DISABLE 0x01 /* Disable BMI comm with Host */ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 46 * symbol (see linker script). | 50 * symbol (see linker script). |
| 47 * | 51 * |
| 48 * Host Interest is shared between Host and Target in order to coordinate | 52 * Host Interest is shared between Host and Target in order to coordinate |
| 49 * between the two, and is intended to remain constant (with additions only | 53 * between the two, and is intended to remain constant (with additions only |
| 50 * at the end) across software releases. | 54 * at the end) across software releases. |
| 51 * | 55 * |
| 52 * All addresses are available here so that it's possible to | 56 * All addresses are available here so that it's possible to |
| 53 * write a single binary that works with all Target Types. | 57 * write a single binary that works with all Target Types. |
| 54 * May be used in assembler code as well as C. | 58 * May be used in assembler code as well as C. |
| 55 */ | 59 */ |
| 56 #define AR6001_HOST_INTEREST_ADDRESS 0x80000600 | |
| 57 #define AR6002_HOST_INTEREST_ADDRESS 0x00500400 | 60 #define AR6002_HOST_INTEREST_ADDRESS 0x00500400 |
| 58 #define AR6003_HOST_INTEREST_ADDRESS 0x00540600 | 61 #define AR6003_HOST_INTEREST_ADDRESS 0x00540600 |
| 59 | 62 |
| 60 | 63 |
| 61 #define HOST_INTEREST_MAX_SIZE 0x100 | 64 #define HOST_INTEREST_MAX_SIZE 0x100 |
| 62 | 65 |
| 63 #if !defined(__ASSEMBLER__) | 66 #if !defined(__ASSEMBLER__) |
| 64 struct register_dump_s; | 67 struct register_dump_s; |
| 65 struct dbglog_hdr_s; | 68 struct dbglog_hdr_s; |
| 66 | 69 |
| 67 /* | 70 /* |
| 68 * These are items that the Host may need to access | 71 * These are items that the Host may need to access |
| 69 * via BMI or via the Diagnostic Window. The position | 72 * via BMI or via the Diagnostic Window. The position |
| 70 * of items in this structure must remain constant | 73 * of items in this structure must remain constant |
| 71 * across firmware revisions! | 74 * across firmware revisions! |
| 72 * | 75 * |
| 73 * Types for each item must be fixed size across | 76 * Types for each item must be fixed size across |
| 74 * target and host platforms. | 77 * target and host platforms. |
| 75 * | 78 * |
| 76 * More items may be added at the end. | 79 * More items may be added at the end. |
| 77 */ | 80 */ |
| 78 struct host_interest_s { | 81 PREPACK struct host_interest_s { |
| 79 /* | 82 /* |
| 80 * Pointer to application-defined area, if any. | 83 * Pointer to application-defined area, if any. |
| 81 * Set by Target application during startup. | 84 * Set by Target application during startup. |
| 82 */ | 85 */ |
| 83 A_UINT32 hi_app_host_interest; /* 0x00 */ | 86 A_UINT32 hi_app_host_interest; /* 0x00 */ |
| 84 | 87 |
| 85 /* Pointer to register dump area, valid after Target crash. */ | 88 /* Pointer to register dump area, valid after Target crash. */ |
| 86 A_UINT32 hi_failure_state; /* 0x04 */ | 89 A_UINT32 hi_failure_state; /* 0x04 */ |
| 87 | 90 |
| 88 /* Pointer to debug logging header */ | 91 /* Pointer to debug logging header */ |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 A_UINT32 hi_allocram_sz; /* 0x9c */ | 169 A_UINT32 hi_allocram_sz; /* 0x9c */ |
| 167 A_UINT32 hi_hci_bridge_flags; /* 0xa0 */ | 170 A_UINT32 hi_hci_bridge_flags; /* 0xa0 */ |
| 168 A_UINT32 hi_hci_uart_support_pins; /* 0xa4 */ | 171 A_UINT32 hi_hci_uart_support_pins; /* 0xa4 */ |
| 169 /* NOTE: byte [0] = RESET pin (bit 7 is polarity), bytes[1]..bytes[3] ar
e for future use */ | 172 /* NOTE: byte [0] = RESET pin (bit 7 is polarity), bytes[1]..bytes[3] ar
e for future use */ |
| 170 A_UINT32 hi_hci_uart_pwr_mgmt_params; /* 0xa8 */ | 173 A_UINT32 hi_hci_uart_pwr_mgmt_params; /* 0xa8 */ |
| 171 /* 0xa8 - [0]: 1 = enable, 0 = disable | 174 /* 0xa8 - [0]: 1 = enable, 0 = disable |
| 172 * [1]: 0 = UART FC active low, 1 = UART FC active high | 175 * [1]: 0 = UART FC active low, 1 = UART FC active high |
| 173 * 0xa9 - [7:0]: wakeup timeout in ms | 176 * 0xa9 - [7:0]: wakeup timeout in ms |
| 174 * 0xaa, 0xab - [15:0]: idle timeout in ms | 177 * 0xaa, 0xab - [15:0]: idle timeout in ms |
| 175 */ | 178 */ |
| 176 }; | 179 /* Pointer to extended board Data */ |
| 180 A_UINT32 hi_board_ext_data; /* 0xac */ |
| 181 A_UINT32 hi_board_ext_data_initialized; /* 0xb0 */ |
| 182 } POSTPACK; |
| 177 | 183 |
| 178 /* Bits defined in hi_option_flag */ | 184 /* Bits defined in hi_option_flag */ |
| 179 #define HI_OPTION_TIMER_WAR 0x01 /* Enable timer workaround */ | 185 #define HI_OPTION_TIMER_WAR 0x01 /* Enable timer workaround */ |
| 180 #define HI_OPTION_BMI_CRED_LIMIT 0x02 /* Limit BMI command credits */ | 186 #define HI_OPTION_BMI_CRED_LIMIT 0x02 /* Limit BMI command credits */ |
| 181 #define HI_OPTION_RELAY_DOT11_HDR 0x04 /* Relay Dot11 hdr to/from host */ | 187 #define HI_OPTION_RELAY_DOT11_HDR 0x04 /* Relay Dot11 hdr to/from host */ |
| 182 #define HI_OPTION_FW_MODE_LSB 0x08 /* low bit of MODE (see below) */ | 188 #define HI_OPTION_FW_MODE_LSB 0x08 /* low bit of MODE (see below) */ |
| 183 #define HI_OPTION_FW_MODE_MSB 0x10 /* high bit of MODE (see below) */ | 189 #define HI_OPTION_FW_MODE_MSB 0x10 /* high bit of MODE (see below) */ |
| 184 #define HI_OPTION_ENABLE_PROFILE 0x20 /* Enable CPU profiling */ | 190 #define HI_OPTION_ENABLE_PROFILE 0x20 /* Enable CPU profiling */ |
| 185 #define HI_OPTION_DISABLE_DBGLOG 0x40 /* Disable debug logging */ | 191 #define HI_OPTION_DISABLE_DBGLOG 0x40 /* Disable debug logging */ |
| 186 #define HI_OPTION_SKIP_ERA_TRACKING 0x80 /* Skip Era Tracking */ | 192 #define HI_OPTION_SKIP_ERA_TRACKING 0x80 /* Skip Era Tracking */ |
| 187 #define HI_OPTION_PAPRD_DISABLE 0x100 /* Disable PAPRD (debug) */ | 193 #define HI_OPTION_PAPRD_DISABLE 0x100 /* Disable PAPRD (debug) */ |
| 188 | 194 |
| 189 /* 2 bits of hi_option_flag are used to represent 3 modes */ | 195 /* 2 bits of hi_option_flag are used to represent 3 modes */ |
| 190 #define HI_OPTION_FW_MODE_IBSS 0x0 /* IBSS Mode */ | 196 #define HI_OPTION_FW_MODE_IBSS 0x0 /* IBSS Mode */ |
| 191 #define HI_OPTION_FW_MODE_BSS_STA 0x1 /* STA Mode */ | 197 #define HI_OPTION_FW_MODE_BSS_STA 0x1 /* STA Mode */ |
| 192 #define HI_OPTION_FW_MODE_AP 0x2 /* AP Mode */ | 198 #define HI_OPTION_FW_MODE_AP 0x2 /* AP Mode */ |
| 193 | 199 |
| 194 /* Fw Mode Mask */ | 200 /* Fw Mode Mask */ |
| 195 #define HI_OPTION_FW_MODE_MASK 0x3 | 201 #define HI_OPTION_FW_MODE_MASK 0x3 |
| 196 #define HI_OPTION_FW_MODE_SHIFT 0x3 | 202 #define HI_OPTION_FW_MODE_SHIFT 0x3 |
| 197 | 203 |
| 198 /* | 204 /* |
| 199 * Intended for use by Host software, this macro returns the Target RAM | 205 * Intended for use by Host software, this macro returns the Target RAM |
| 200 * address of any item in the host_interest structure. | 206 * address of any item in the host_interest structure. |
| 201 * Example: target_addr = AR6001_HOST_INTEREST_ITEM_ADDRESS(hi_board_data); | 207 * Example: target_addr = AR6002_HOST_INTEREST_ITEM_ADDRESS(hi_board_data); |
| 202 */ | 208 */ |
| 203 #define AR6001_HOST_INTEREST_ITEM_ADDRESS(item) \ | |
| 204 ((A_UINT32)&((((struct host_interest_s *)(AR6001_HOST_INTEREST_ADDRESS))->it
em))) | |
| 205 | |
| 206 #define AR6002_HOST_INTEREST_ITEM_ADDRESS(item) \ | 209 #define AR6002_HOST_INTEREST_ITEM_ADDRESS(item) \ |
| 207 ((A_UINT32)&((((struct host_interest_s *)(AR6002_HOST_INTEREST_ADDRESS))->it
em))) | 210 (A_UINT32)((unsigned long)&((((struct host_interest_s *)(AR6002_HOST_INTERES
T_ADDRESS))->item))) |
| 208 | 211 |
| 209 #define AR6003_HOST_INTEREST_ITEM_ADDRESS(item) \ | 212 #define AR6003_HOST_INTEREST_ITEM_ADDRESS(item) \ |
| 210 ((A_UINT32)&((((struct host_interest_s *)(AR6003_HOST_INTEREST_ADDRESS))->it
em))) | 213 (A_UINT32)((unsigned long)&((((struct host_interest_s *)(AR6003_HOST_INTERES
T_ADDRESS))->item))) |
| 211 | 214 |
| 212 #define HOST_INTEREST_DBGLOG_IS_ENABLED() \ | 215 #define HOST_INTEREST_DBGLOG_IS_ENABLED() \ |
| 213 (!(HOST_INTEREST->hi_option_flag & HI_OPTION_DISABLE_DBGLOG)) | 216 (!(HOST_INTEREST->hi_option_flag & HI_OPTION_DISABLE_DBGLOG)) |
| 214 | 217 |
| 215 #define HOST_INTEREST_PROFILE_IS_ENABLED() \ | 218 #define HOST_INTEREST_PROFILE_IS_ENABLED() \ |
| 216 (HOST_INTEREST->hi_option_flag & HI_OPTION_ENABLE_PROFILE) | 219 (HOST_INTEREST->hi_option_flag & HI_OPTION_ENABLE_PROFILE) |
| 217 | 220 |
| 218 /* Convert a Target virtual address into a Target physical address */ | 221 /* Convert a Target virtual address into a Target physical address */ |
| 219 #define AR6001_VTOP(vaddr) ((vaddr) & 0x0fffffff) | |
| 220 #define AR6002_VTOP(vaddr) ((vaddr) & 0x001fffff) | 222 #define AR6002_VTOP(vaddr) ((vaddr) & 0x001fffff) |
| 221 #define AR6003_VTOP(vaddr) ((vaddr) & 0x001fffff) | 223 #define AR6003_VTOP(vaddr) ((vaddr) & 0x001fffff) |
| 222 #define TARG_VTOP(TargetType, vaddr) \ | 224 #define TARG_VTOP(TargetType, vaddr) \ |
| 223 (((TargetType) == TARGET_TYPE_AR6001) ? AR6001_VTOP(vaddr) : \ | 225 (((TargetType) == TARGET_TYPE_AR6002) ? AR6002_VTOP(vaddr) : AR6003_VTOP
(vaddr)) |
| 224 (((TargetType) == TARGET_TYPE_AR6002) ? AR6002_VTOP(vaddr) : AR6003_VTOP
(vaddr))) | |
| 225 | 226 |
| 226 /* override REV2 ROM's app start address */ | 227 /* override REV2 ROM's app start address */ |
| 227 #define AR6002_REV2_APP_START_OVERRIDE 0x911A00 | 228 #define AR6002_REV2_APP_START_OVERRIDE 0x911A00 |
| 228 #define AR6003_REV1_APP_START_OVERRIDE 0x944c00 | 229 #define AR6003_REV1_APP_START_OVERRIDE 0x944c00 |
| 229 #define AR6003_REV1_OTP_DATA_ADDRESS 0x542800 | 230 #define AR6003_REV1_OTP_DATA_ADDRESS 0x542800 |
| 230 #define AR6003_REV2_APP_START_OVERRIDE 0x945000 | 231 #define AR6003_REV2_APP_START_OVERRIDE 0x945000 |
| 231 #define AR6003_REV2_OTP_DATA_ADDRESS 0x543800 | 232 #define AR6003_REV2_OTP_DATA_ADDRESS 0x543800 |
| 233 #define AR6003_BOARD_EXT_DATA_ADDRESS 0x57E600 |
| 232 | 234 |
| 233 | 235 |
| 234 /* # of A_UINT32 entries in targregs, used by DIAG_FETCH_TARG_REGS */ | 236 /* # of A_UINT32 entries in targregs, used by DIAG_FETCH_TARG_REGS */ |
| 235 #define AR6003_FETCH_TARG_REGS_COUNT 64 | 237 #define AR6003_FETCH_TARG_REGS_COUNT 64 |
| 236 | 238 |
| 237 #endif /* !__ASSEMBLER__ */ | 239 #endif /* !__ASSEMBLER__ */ |
| 238 | 240 |
| 241 #ifndef ATH_TARGET |
| 242 #include "athendpack.h" |
| 243 #endif |
| 244 |
| 239 #endif /* __TARGADDRS_H__ */ | 245 #endif /* __TARGADDRS_H__ */ |
| OLD | NEW |