📄 em86xxapi.h
字号:
/***************************************** Copyright (c) 2002-2004 Sigma Designs, Inc. All Rights Reserved Proprietary and Confidential *****************************************//* This file is part of the EM86XX boot loader *//* * em86xxapi.h * * by Ho Lee 01/23/2002 */#ifndef __BOOTLOADER_EM86XXAPI_H#define __BOOTLOADER_EM86XXAPI_H//// function prototypes// int em86xx_init(void);// Clockunsigned long em86xx_getclock(void);unsigned int em86xx_getclockmhz(void);void em86xx_setclockmhz(int clock);// Delayvoid em86xx_usleep(int usec);void em86xx_msleep(int msec);// CPSR flagunsigned int em86xx_saveflag_clif(void);unsigned int em86xx_saveflag_clf(void);unsigned int em86xx_saveflag_cli(void);unsigned int em86xx_getflag(void);void em86xx_restoreflag(unsigned int cpsr_reg);// Cache// clean : write dirty buffer (D cache only)// invalidate : invalidate the contents of cache (I & D cache)// flush : clean + invalidatevoid em86xx_get_cache_state(int *picache, int *pdcache, int *pwriteback);void em86xx_enable_cache(int icache, int dcache, int writeback);void em86xx_clean_cache_data(void);void em86xx_clean_cache_data_region(unsigned int from, unsigned int to);void em86xx_invalidate_cache_instruction(void);void em86xx_invalidate_cache_instruction_region(unsigned int from, unsigned int to);void em86xx_invalidate_cache_data(void);void em86xx_invalidate_cache_data_region(unsigned int from, unsigned int to);void em86xx_flush_cache_all(void);void em86xx_flush_cache_data(void);void em86xx_flush_cache_data_region(unsigned int from, unsigned int to);// Interruptvoid em86xx_irq_init(void);void em86xx_mask_irq(unsigned int irq);void em86xx_unmask_irq(unsigned int irq);int em86xx_irq_status(unsigned int irq);void em86xx_irq_wait(unsigned int irq);// Interrupt handlertypedef void (*irq_handler_t)(int irq, void *pdata);void em86xx_sti(void);void em86xx_cli(void);int em86xx_irqenabled(void);void em86xx_request_irq(int irq, irq_handler_t handler, void *pdata);void em86xx_free_irq(int irq);// Fast Interruptvoid em86xx_fiq_init(void);void em86xx_mask_fiq(unsigned int fiq);void em86xx_unmask_fiq(unsigned int fiq);int em86xx_fiq_status(unsigned int fiq);void em86xx_fiq_wait(unsigned int fiq);// Fast Interrupt handlertypedef void (*fiq_handler_t)(int fiq, void *pdata);void em86xx_stf(void);void em86xx_clf(void);void em86xx_request_fiq(int fiq, fiq_handler_t handler, void *pdata);void em86xx_free_fiq(int fiq);// Switchbox (Host interface)enum { #if defined(CONFIG_ARCH_MAMBO) SBOX_IDEFLASH = 2, SBOX_PCIMASTER, SBOX_PCISLAVE, SBOX_MAX = SBOX_PCISLAVE, #elif defined(CONFIG_ARCH_TANGO) SBOX_MBUS_W0 = 0, SBOX_MBUS_W1, SBOX_PCIMASTER, SBOX_PCISLAVE, SBOX_CIPHER, SBOX_IDEFLASH, SBOX_IDEDVD, SBOX_SFLASH, SBOX_MAX = SBOX_SFLASH,#else#error Unknown Architecture#endif};int em86xx_sbox_init(void);void em86xx_sbox_reset(void);int em86xx_sbox_setup(int if0, int if1);int em86xx_sbox_connect(int iface);void em86xx_sbox_disconnect(int port);// MBUS interfaceunsigned int em86xx_mbus_init(void);unsigned int em86xx_mbus_alloc_dma(int sbox, int fromdev, unsigned int *pregbase, int *pirq);void em86xx_mbus_free_dma(int port);void em86xx_mbus_setup_dma_linear(unsigned int regbase, unsigned int addr, unsigned int count);void em86xx_mbus_setup_dma_double(unsigned int regbase, unsigned int addr, unsigned int count, unsigned int addr2, unsigned int count2);void em86xx_mbus_setup_dma_rectangle(unsigned int regbase, unsigned int addr, unsigned int horiz, unsigned int lines, int skip);int em86xx_mbus_setup_dma(unsigned int regbase, unsigned int addr, unsigned int count);void em86xx_mbus_wait(unsigned int regbase);// PCI mastervoid em86xx_pcimaster_setup_read(unsigned int addr, unsigned int count);void em86xx_pcimaster_start_read(int start);void em86xx_pcimaster_setup_write(unsigned int addr, unsigned int count);void em86xx_pcimaster_start_write(int start);// GPIO#define GPIO_INPUT 0#define GPIO_OUTPUT 1int em86xx_gpio_read(int gpio);void em86xx_gpio_write(int gpio, int data);void em86xx_gpio_setdirection(int gpio, int dir);// Miscellaneousunsigned int em86xx_random(void);#ifdef CONFIG_ARCH_TANGO15//i2c -- mac addressint hwi2c_write(unsigned long wr_addr, unsigned char subaddr, unsigned char *ptr, unsigned long n, unsigned long delay);int hwi2c_read(unsigned long rd_addr, unsigned char subaddr, unsigned char *ptr, unsigned long size, unsigned long delay);int hwi2c_write_no_subaddr(unsigned long wr_addr, unsigned char *ptr, unsigned long size, unsigned long delay);int hwi2c_read_no_subaddr(unsigned long rd_addr, unsigned char *ptr, unsigned long size, unsigned long delay);int mac_read(char *bufr);#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -