X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=inline;f=target_firmware%2Fmagpie_fw_dev%2Ftarget%2Fcmnos%2Fcmnos_api.h;h=08c66c2c6ac72b7048172e980674b7d5bb5be23c;hb=f4eb7abfed8cc5b791f0ff85e619aabab18a2ad1;hp=40fa033a539c24d60fa742d5ad3bcbfde68f8e37;hpb=8804cc94e3b66550797279f540b960d18a78421f;p=open-ath9k-htc-firmware.git diff --git a/target_firmware/magpie_fw_dev/target/cmnos/cmnos_api.h b/target_firmware/magpie_fw_dev/target/cmnos/cmnos_api.h index 40fa033..08c66c2 100755 --- a/target_firmware/magpie_fw_dev/target/cmnos/cmnos_api.h +++ b/target_firmware/magpie_fw_dev/target/cmnos/cmnos_api.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2013 Qualcomm Atheros, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted (subject to the limitations in the + * disclaimer below) provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Qualcomm Atheros nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE + * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT + * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ #ifndef __CMNOS_API_H__ #define __CMNOS_API_H__ @@ -36,7 +70,7 @@ #if defined(PROJECT_K2) #if SYSTEM_MODULE_SFLASH -#include "sflash_api.h" +#include "cmnos/sflash_api.h" #endif #endif @@ -83,7 +117,7 @@ do { \ asm volatile("rsr %0,%1" : "=r" (epc3) : "n" (EPC_3)); \ asm volatile("rsr %0,%1" : "=r" (epc4) : "n" (EPC_4)); \ \ - A_PRINTF("\tepc1=0x%x, epc2=0x%x, epc3=0x%x, epc4=0x%x\n", \ + A_PRINTF("\tepc1=0x%x, epc2=0x%x, epc3=0x%x, epc4=0x%x\n", \ epc1, epc2, epc3, epc4); \ A_PRINTF("0x%08x, 0x%08x, 0x%08x, \n\r", \ DEBUG_SYSTEM_STATE, WATCH_DOG_RESET_COUNTER, \ @@ -122,7 +156,7 @@ do { \ #define A_MEMMOVE(dst, src, size) #define A_MEMCMP(p1, p2, nbytes) -#endif +#endif #if 1 @@ -145,20 +179,20 @@ do { \ #if SYSTEM_MODULE_UART /* Serial port support */ -#define A_UART_INIT() A_CMN(uart._uart_init()) +#define A_UART_INIT() A_CMN(uart._uart_init()) #define A_UART_HWINIT(freq, baud) \ A_CMN(uart._uart_hwinit((freq), (baud))) -#define A_UART_ENABLED() (HOST_INTEREST->hi_uart_enable) +#define A_UART_ENABLED() (HOST_INTEREST->hi_uart_enable) -#define A_PUTS(str) A_CMN(uart._uart_str_out(str)) +#define A_PUTS(str) A_CMN(uart._uart_str_out(str)) -#define A_PUTC(ch) A_CMN(uart._uart_char_put(ch)) -#define A_GETC(pCh) A_CMN(uart._uart_char_get(pCh)) +#define A_PUTC(ch) A_CMN(uart._uart_char_put(ch)) +#define A_GETC(pCh) A_CMN(uart._uart_char_get(pCh)) -#define A_UART_TASK() A_CMN(uart._uart_task()) -#define A_UART_CONFIG(x) A_CMN(uart._uart_config(x)) +#define A_UART_TASK() A_CMN(uart._uart_task()) +#define A_UART_CONFIG(x) A_CMN(uart._uart_config(x)) #else @@ -166,9 +200,9 @@ do { \ #define A_UART_HWINIT(freq, baud) -#define A_UART_ENABLED() +#define A_UART_ENABLED() -#define A_PUTS(str) +#define A_PUTS(str) #define A_PUTC(ch) #define A_GETC(pCh) @@ -194,7 +228,7 @@ do { \ #define A_MISALIGNED_LOAD_HANDLER(dump) A_CMN(misc._misaligned_load_handler(dump)) /* reture the host interface type */ -#define A_IS_HOST_PRESENT() A_CMN(misc._is_host_present()) +#define A_IS_HOST_PRESENT() A_CMN(misc._is_host_present()) #define A_KBHIT(delay) A_CMN(misc._kbhit(delay)) #define A_GET_ROM_VER() A_CMN(misc._rom_version_get()) #else @@ -213,7 +247,7 @@ do { \ #define A_IS_HOST_PRESENT() #define A_KBHIT(delay) #define A_GET_ROM_VER() -#endif +#endif //#if SYSTEM_MODULE_DBG /* debug Support */ @@ -234,16 +268,16 @@ do { \ #define A_USB_EP0_SETUP() A_CMN(usb._usb_ep0_setup()) #define A_USB_EP0_TX_DATA() A_CMN(usb._usb_ep0_tx_data()) #define A_USB_EP0_RX_DATA() A_CMN(usb._usb_ep0_rx_data()) - + #define A_USB_GET_CONFIG() A_CMN(usb._usb_get_configuration()) #define A_USB_SET_CONFIG() A_CMN(usb._usb_set_configuration()) - + #define A_USB_GET_INTERFACE() A_CMN(usb._usb_get_interface()) #define A_USB_SET_INTERFACE() A_CMN(usb._usb_set_interface()) - + #define A_USB_STANDARD_CMD() A_CMN(usb._usb_standard_cmd()) #define A_USB_VENDOR_CMD() A_CMN(usb._usb_vendor_cmd()) - + #define A_USB_POWER_OFF() A_CMN(usb._usb_power_off()) #define A_USB_RESET_FIFO() A_CMN(usb._usb_reset_fifo()) #define A_USB_GEN_WDT() A_CMN(usb._usb_gen_wdt()) @@ -265,31 +299,31 @@ do { \ #else #define A_USB_INIT() -#define A_USB_TASK() +#define A_USB_TASK() #define A_USB_INIT_PHY() -#define A_USB_EP0_SETUP() -#define A_USB_EP0_TX() -#define A_USB_EP0_RX() - -#define A_USB_GET_CONFIG() -#define A_USB_SET_CONFIG() - -#define A_USB_GET_INTERFACE() -#define A_USB_SET_INTERFACE() - -#define A_USB_STANDARD_CMD() -#define A_USB_VENDOR_CMD() - +#define A_USB_EP0_SETUP() +#define A_USB_EP0_TX() +#define A_USB_EP0_RX() + +#define A_USB_GET_CONFIG() +#define A_USB_SET_CONFIG() + +#define A_USB_GET_INTERFACE() +#define A_USB_SET_INTERFACE() + +#define A_USB_STANDARD_CMD() +#define A_USB_VENDOR_CMD() + #define A_USB_POWER_OFF() #define A_USB_RESET_FIFO() #define A_USB_GEN_WDT() #define A_USB_JUMP_BOOT() #define A_USB_GET_DESCRIPTOR() -#define A_USB_SET_ADDRESS() -#define A_USB_SET_FEATURE() -#define A_USB_CLEAR_FEATURE() +#define A_USB_SET_ADDRESS() +#define A_USB_SET_FEATURE() +#define A_USB_CLEAR_FEATURE() #define A_USB_GET_STATUS() #define A_USB_SETUP_DESC() @@ -361,9 +395,9 @@ do { \ #if SYSTEM_MODULE_CLOCK -#define A_CLOCK_INIT(refclk_guess) A_CMN(clock._clock_init(refclk_guess)) -#define A_CLOCK_TICK() A_CMN(clock._clock_tick()) -#define A_CLOCK_GET_TICK() A_CMN(clock._clock_get_tick()) +#define A_CLOCK_INIT(refclk_guess) A_CMN(clock._clock_init(refclk_guess)) +#define A_CLOCK_TICK() A_CMN(clock._clock_tick()) +#define A_CLOCK_GET_TICK() A_CMN(clock._clock_get_tick()) /* * Get the number of millisecond ticks since the system was started. @@ -423,11 +457,8 @@ do { \ #define A_TIMER_RUN() \ A_CMN(timer._timer_run()) -#define A_PCI_BOOT_INIT() \ - A_CMN(pci.pci_boot_init()) - #define A_GMAC_BOOT_INIT() \ - A_CMN(gmac.gmac_boot_init()) + A_CMN(gmac.gmac_boot_init()) #if SYSTEM_MODULE_ALLOCRAM /* Default size of ALLOCRAM area */ @@ -443,7 +474,7 @@ do { A_CMN(allocram.cmnos_allocram_init((astart), (asize))); \ } while (0) -#define A_ALLOCRAM(nbytes) A_CMN(allocram.cmnos_allocram(0, (nbytes))) +#define A_ALLOCRAM(nbytes) A_CMN(allocram.cmnos_allocram(0, (nbytes))) #define A_ALLOCRAM_DEBUG() A_CMN(allocram.cmnos_allocram_debug()) @@ -507,7 +538,7 @@ typedef struct _A_cmnos_indirection_table { int (* hal_linkage_check)(int sz, struct _A_os_linkage_check *); unsigned int *start_bss; void (* app_start)(void); - + #if SYSTEM_MODULE_MEM struct mem_api mem; #endif @@ -528,9 +559,6 @@ typedef struct _A_cmnos_indirection_table { // struct dbg_api dbg; //#endif -#if SYSTEM_MODULE_PCI - struct pci_api pci; -#endif #if SYSTEM_MODULE_GMAC struct gmac_api gmac; @@ -627,10 +655,6 @@ extern void cmnos_wdt_module_install(struct wdt_api *); extern void cmnos_eep_module_install(struct eep_api *); #endif -#if SYSTEM_MODULE_PCI -extern void cmnos_pci_module_install(struct pci_api *); -#endif - extern void cmnos_tasklet_module_install(struct tasklet_api *); extern void cmnos_string_module_install(struct string_api *tbl);