treewide: strip trailing whitespace
Strip trailing whitespace in all code: find . -type f | grep "\.c$" | xargs sed -i 's/[ \t]\+$//' find . -type f | grep "\.h$" | xargs sed -i 's/[ \t]\+$//' find . -type f | grep "\.dts$" | xargs sed -i 's/[ \t]\+$//' find . -type f | grep "\.dtsi$" | xargs sed -i 's/[ \t]\+$//' Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Link: https://github.com/openwrt/openwrt/pull/18626 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
committed by
Robert Marko
parent
6b43a52171
commit
a238170e57
@@ -8,7 +8,7 @@
|
||||
* intellectual property rights of others.
|
||||
*----------------------------------------------------------------------------
|
||||
* File Name : at45c.h
|
||||
* Object :
|
||||
* Object :
|
||||
*
|
||||
* 1.0 10/12/03 HIi : Creation.
|
||||
* 1.01 03/05/04 HIi : Bug Fix in AT91F_DataFlashWaitReady() Function.
|
||||
@@ -28,7 +28,7 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
void AT91F_SpiInit(void) {
|
||||
/* Configure PIOs */
|
||||
AT91C_BASE_PIOA->PIO_ASR = AT91C_PA3_NPCS0 | AT91C_PA4_NPCS1 |
|
||||
AT91C_BASE_PIOA->PIO_ASR = AT91C_PA3_NPCS0 | AT91C_PA4_NPCS1 |
|
||||
AT91C_PA1_MOSI | AT91C_PA5_NPCS2 |
|
||||
AT91C_PA6_NPCS3 | AT91C_PA0_MISO |
|
||||
AT91C_PA2_SPCK;
|
||||
@@ -88,7 +88,7 @@ static void AT91F_SpiEnable(int cs) {
|
||||
static unsigned int AT91F_SpiWrite(AT91PS_DataflashDesc pDesc)
|
||||
{
|
||||
unsigned int timeout;
|
||||
|
||||
|
||||
AT91C_BASE_SPI->SPI_PTCR = AT91C_PDC_TXTDIS + AT91C_PDC_RXTDIS;
|
||||
|
||||
/* Initialize the Transmit and Receive Pointer */
|
||||
@@ -138,7 +138,7 @@ static AT91S_DataFlashStatus AT91F_DataFlashSendCommand(
|
||||
unsigned int adr;
|
||||
|
||||
/* process the address to obtain page address and byte address */
|
||||
adr = ((DataflashAddress / (pDataFlash->pDevice->pages_size))
|
||||
adr = ((DataflashAddress / (pDataFlash->pDevice->pages_size))
|
||||
<< pDataFlash->pDevice->page_offset) +
|
||||
(DataflashAddress % (pDataFlash->pDevice->pages_size));
|
||||
|
||||
@@ -152,7 +152,7 @@ static AT91S_DataFlashStatus AT91F_DataFlashSendCommand(
|
||||
pDataFlash->pDataFlashDesc->command[4] = (unsigned char)(adr & 0x000000FF);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
pDataFlash->pDataFlashDesc->command[1] = (unsigned char)((adr & 0x00FF0000) >> 16);
|
||||
pDataFlash->pDataFlashDesc->command[2] = (unsigned char)((adr & 0x0000FF00) >> 8);
|
||||
pDataFlash->pDataFlashDesc->command[3] = (unsigned char)(adr & 0x000000FF) ;
|
||||
@@ -168,7 +168,7 @@ static AT91S_DataFlashStatus AT91F_DataFlashSendCommand(
|
||||
pDataFlash->pDataFlashDesc->rx_cmd_pt = pDataFlash->pDataFlashDesc->command ;
|
||||
pDataFlash->pDataFlashDesc->rx_cmd_size = CmdSize ;
|
||||
|
||||
return AT91F_SpiWrite(pDataFlash->pDataFlashDesc);
|
||||
return AT91F_SpiWrite(pDataFlash->pDataFlashDesc);
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ static AT91S_DataFlashStatus AT91F_DataFlashContinuousRead(
|
||||
pDataFlash->pDataFlashDesc->rx_data_size = sizeToRead;
|
||||
pDataFlash->pDataFlashDesc->tx_data_pt = dataBuffer;
|
||||
pDataFlash->pDataFlashDesc->tx_data_size = sizeToRead;
|
||||
|
||||
|
||||
status = AT91F_DataFlashSendCommand(pDataFlash, DB_CONTINUOUS_ARRAY_READ, 8, src);
|
||||
/* Send the command to the dataflash */
|
||||
return(status);
|
||||
@@ -325,7 +325,7 @@ static AT91S_DataFlashStatus AT91F_DataFlashWriteBuffer(
|
||||
pDataFlash->pDataFlashDesc->command[4] = 0;
|
||||
cmdsize = 4;
|
||||
}
|
||||
|
||||
|
||||
pDataFlash->pDataFlashDesc->tx_cmd_pt = pDataFlash->pDataFlashDesc->command ;
|
||||
pDataFlash->pDataFlashDesc->tx_cmd_size = cmdsize ;
|
||||
pDataFlash->pDataFlashDesc->rx_cmd_pt = pDataFlash->pDataFlashDesc->command ;
|
||||
@@ -341,7 +341,7 @@ static AT91S_DataFlashStatus AT91F_DataFlashWriteBuffer(
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Function Name : AT91F_PageErase */
|
||||
/* Function Name : AT91F_PageErase */
|
||||
/* Object : Read a page in the SRAM Buffer 1 or 2 */
|
||||
/* Input Parameters : DataFlash Service */
|
||||
/* : Page concerned */
|
||||
@@ -353,10 +353,10 @@ static AT91S_DataFlashStatus AT91F_PageErase(
|
||||
unsigned int page)
|
||||
{
|
||||
int cmdsize;
|
||||
/* Test if the buffer command is legal */
|
||||
/* Test if the buffer command is legal */
|
||||
/* no data to transmit or receive */
|
||||
pDataFlash->pDataFlashDesc->tx_data_size = 0;
|
||||
|
||||
|
||||
cmdsize = 4;
|
||||
if (pDataFlash->pDevice->pages_number >= 16384)
|
||||
cmdsize = 5;
|
||||
@@ -419,11 +419,11 @@ static AT91S_DataFlashStatus AT91F_PartialPageWrite (
|
||||
/* Read the contents of the page in the Sram Buffer */
|
||||
AT91F_MainMemoryToBufferTransfer(pDataFlash, DB_PAGE_2_BUF1_TRF, page);
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_DATAFLASH_TIMEOUT);
|
||||
|
||||
|
||||
/*Update the SRAM buffer */
|
||||
AT91F_DataFlashWriteBuffer(pDataFlash, DB_BUF1_WRITE, src, AdrInPage, size);
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_DATAFLASH_TIMEOUT);
|
||||
|
||||
|
||||
/* Erase page if a 128 Mbits device */
|
||||
if (pDataFlash->pDevice->pages_number >= 16384)
|
||||
{
|
||||
@@ -477,26 +477,26 @@ AT91S_DataFlashStatus AT91F_DataFlashWrite(
|
||||
src += length;
|
||||
}
|
||||
|
||||
while (( size - pDataFlash->pDevice->pages_size ) >= 0 )
|
||||
while (( size - pDataFlash->pDevice->pages_size ) >= 0 )
|
||||
{
|
||||
/* program dataflash page */
|
||||
/* program dataflash page */
|
||||
page = (unsigned int)dest / (pDataFlash->pDevice->pages_size);
|
||||
|
||||
status = AT91F_DataFlashWriteBuffer(pDataFlash, DB_BUF1_WRITE, src,
|
||||
0, pDataFlash->pDevice->pages_size);
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_DATAFLASH_TIMEOUT);
|
||||
|
||||
|
||||
status = AT91F_PageErase(pDataFlash, page);
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_DATAFLASH_TIMEOUT);
|
||||
if (!status)
|
||||
return AT91C_DATAFLASH_ERROR;
|
||||
|
||||
|
||||
status = AT91F_WriteBufferToMain (pDataFlash, DB_BUF1_PAGE_PGM, dest);
|
||||
if(!status)
|
||||
return AT91C_DATAFLASH_ERROR;
|
||||
|
||||
AT91F_DataFlashWaitReady(pDataFlash->pDataFlashDesc, AT91C_DATAFLASH_TIMEOUT);
|
||||
|
||||
|
||||
/* Update size, source and destination pointers */
|
||||
size -= pDataFlash->pDevice->pages_size ;
|
||||
dest += pDataFlash->pDevice->pages_size ;
|
||||
@@ -578,7 +578,7 @@ AT91S_DataFlashStatus AT91F_DataFlashErase(AT91PS_DataFlash pDataFlash)
|
||||
unsigned int status;
|
||||
|
||||
AT91F_SpiEnable(pDataFlash->pDevice->cs);
|
||||
|
||||
|
||||
for(page=0; page < pDataFlash->pDevice->pages_number; page++)
|
||||
{
|
||||
/* Erase dataflash page */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* intellectual property rights of others.
|
||||
*----------------------------------------------------------------------------
|
||||
* File Name : com.c
|
||||
* Object :
|
||||
* Object :
|
||||
* Creation : HIi 03/27/2003
|
||||
*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -98,9 +98,9 @@ int at91_serial_getc()
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function Name : AT91F_ReadLine()
|
||||
* Object :
|
||||
* Input Parameters :
|
||||
* Return value :
|
||||
* Object :
|
||||
* Input Parameters :
|
||||
* Return value :
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
int AT91F_ReadLine (const char *const prompt, char *console_buffer)
|
||||
@@ -144,14 +144,14 @@ int AT91F_ReadLine (const char *const prompt, char *console_buffer)
|
||||
/*
|
||||
* Must be a normal character then
|
||||
*/
|
||||
if (n < (AT91C_CB_SIZE -2))
|
||||
if (n < (AT91C_CB_SIZE -2))
|
||||
{
|
||||
++col; /* echo input */
|
||||
putc(c);
|
||||
*p++ = c;
|
||||
++n;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{ /* Buffer full */
|
||||
putc('\a');
|
||||
}
|
||||
@@ -162,9 +162,9 @@ int AT91F_ReadLine (const char *const prompt, char *console_buffer)
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function Name : AT91F_WaitKeyPressed()
|
||||
* Object :
|
||||
* Input Parameters :
|
||||
* Return value :
|
||||
* Object :
|
||||
* Input Parameters :
|
||||
* Return value :
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
void AT91F_WaitKeyPressed(void)
|
||||
@@ -244,7 +244,7 @@ static int number(int num, int base, int size,
|
||||
num = -num;
|
||||
size--;
|
||||
}
|
||||
|
||||
|
||||
i = 0;
|
||||
if(num == 0)
|
||||
tmp[i++] = digits[0];
|
||||
@@ -254,11 +254,11 @@ static int number(int num, int base, int size,
|
||||
if(i > precision)
|
||||
precision = i;
|
||||
size -= precision;
|
||||
|
||||
|
||||
if(!(type&(ZEROPAD+LEFT)))
|
||||
while(size-->0)
|
||||
putc(' ');
|
||||
|
||||
|
||||
if(sign)
|
||||
putc(sign);
|
||||
|
||||
@@ -268,7 +268,7 @@ static int number(int num, int base, int size,
|
||||
|
||||
while (i < precision--)
|
||||
putc('0');
|
||||
|
||||
|
||||
while (i-- > 0)
|
||||
putc(tmp[i]);
|
||||
|
||||
@@ -332,18 +332,18 @@ int hvfprintf(const char *fmt, va_list va)
|
||||
case '%' :
|
||||
putc(*fmt);
|
||||
done = true;
|
||||
default:
|
||||
default:
|
||||
putc('%');
|
||||
putc(*fmt);
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(!done);
|
||||
} else if(*fmt == '\\') {
|
||||
fmt++;
|
||||
if(*fmt == 'r') {
|
||||
putc('\r');
|
||||
} else if(*fmt == 'n') {
|
||||
} else if(*fmt == 'n') {
|
||||
putc('\n');
|
||||
}
|
||||
} else {
|
||||
@@ -351,7 +351,7 @@ int hvfprintf(const char *fmt, va_list va)
|
||||
}
|
||||
fmt++;
|
||||
} while(*fmt != 0);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* intellectual property rights of others.
|
||||
*----------------------------------------------------------------------------
|
||||
* File Name : com.h
|
||||
* Object :
|
||||
* Object :
|
||||
*
|
||||
* 1.0 27/03/03 HIi : Creation
|
||||
*----------------------------------------------------------------------------
|
||||
|
||||
@@ -30,7 +30,7 @@ int AT91F_DataflashInit(void)
|
||||
int i;
|
||||
int dfcode;
|
||||
int Nb_device = 0;
|
||||
|
||||
|
||||
AT91F_SpiInit();
|
||||
|
||||
for (i = 0; i < CFG_MAX_DATAFLASH_BANKS; i++) {
|
||||
@@ -88,7 +88,7 @@ int AT91F_DataflashInit(void)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (Nb_device);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ void AT91F_DataflashPrintInfo(void)
|
||||
case AT45DB642:
|
||||
printf ("642");
|
||||
break;
|
||||
case AT45DB128:
|
||||
case AT45DB128:
|
||||
printf ("128");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifdef SPI_LOW_SPEED
|
||||
#define AT91C_SPI_CLK 14976000/4
|
||||
#else
|
||||
#define AT91C_SPI_CLK 14976000
|
||||
#define AT91C_SPI_CLK 14976000
|
||||
#endif
|
||||
|
||||
/* AC characteristics */
|
||||
|
||||
@@ -382,7 +382,7 @@ extern char const *AT91F_PipeGetError(AT91S_PipeStatus msgId);
|
||||
extern const unsigned char bit_rev[256];
|
||||
|
||||
extern void CalculateCrc32(const unsigned char *,unsigned int, unsigned int *);
|
||||
extern void CalculateCrc16(const unsigned char *, unsigned int , unsigned short *);
|
||||
extern void CalculateCrc16(const unsigned char *, unsigned int , unsigned short *);
|
||||
extern void CalculateCrcHdlc(const unsigned char *, unsigned int, unsigned short *);
|
||||
extern void CalculateCrc16ccitt(const unsigned char *, unsigned int , unsigned short *);
|
||||
|
||||
@@ -490,7 +490,7 @@ typedef struct _AT91S_RomBoot {
|
||||
const AT91PF_SVC_CRCHDLC CRCHDLC;
|
||||
const AT91PF_SVC_CRC32 CRC32;
|
||||
const AT91PS_SVC_CRC_BIT_REV Bit_Reverse_Array;
|
||||
const AT91PS_SINE_TAB SineTab;
|
||||
const AT91PS_SINE_TAB SineTab;
|
||||
const AT91PF_Sinus Sine;
|
||||
} AT91S_RomBoot, *AT91PS_RomBoot;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ typedef unsigned int AT91S_MCIDeviceStatus;
|
||||
#define AT91C_TIMEOUT_CMDRDY 30
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// MMC & SDCard Structures
|
||||
// MMC & SDCard Structures
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*-----------------------------------------------*/
|
||||
@@ -70,7 +70,7 @@ typedef struct _AT91S_MciDeviceFeatures
|
||||
{
|
||||
unsigned char Card_Inserted; // (0=AT91C_CARD_REMOVED) (1=AT91C_MMC_CARD_INSERTED) (2=AT91C_SD_CARD_INSERTED)
|
||||
unsigned int Relative_Card_Address; // RCA
|
||||
unsigned int Max_Read_DataBlock_Length; // 2^(READ_BL_LEN) in CSD
|
||||
unsigned int Max_Read_DataBlock_Length; // 2^(READ_BL_LEN) in CSD
|
||||
unsigned int Max_Write_DataBlock_Length; // 2^(WRITE_BL_LEN) in CSD
|
||||
unsigned char Read_Partial; // READ_BL_PARTIAL
|
||||
unsigned char Write_Partial; // WRITE_BL_PARTIAL
|
||||
@@ -79,7 +79,7 @@ typedef struct _AT91S_MciDeviceFeatures
|
||||
unsigned char Write_Block_Misalignment; // WRITE_BLK_MISALIGN
|
||||
unsigned char Sector_Size; // SECTOR_SIZE
|
||||
unsigned int Memory_Capacity; // Size in bits of the device
|
||||
|
||||
|
||||
} AT91S_MciDeviceFeatures, *AT91PS_MciDeviceFeatures ;
|
||||
|
||||
/*---------------------------------------------*/
|
||||
@@ -88,15 +88,15 @@ typedef struct _AT91S_MciDeviceFeatures
|
||||
typedef struct _AT91S_MciDevice
|
||||
{
|
||||
AT91PS_MciDeviceDesc pMCI_DeviceDesc; // MCI device descriptor
|
||||
AT91PS_MciDeviceFeatures pMCI_DeviceFeatures;// Pointer on a MCI device features array
|
||||
AT91PS_MciDeviceFeatures pMCI_DeviceFeatures;// Pointer on a MCI device features array
|
||||
}AT91S_MciDevice, *AT91PS_MciDevice;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// MCI_CMD Register Value
|
||||
// MCI_CMD Register Value
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define AT91C_POWER_ON_INIT (0 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_INIT | AT91C_MCI_OPDCMD)
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Class 0 & 1 commands: Basic commands and Read Stream commands
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -137,7 +137,7 @@ typedef struct _AT91S_MciDevice
|
||||
//*------------------------------------------------
|
||||
//* Class 4 commands: Block oriented write commands
|
||||
//*------------------------------------------------
|
||||
|
||||
|
||||
#define AT91C_WRITE_BLOCK_CMD (24 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_START | (AT91C_MCI_TRTYP_BLOCK & ~(AT91C_MCI_TRDIR)) | AT91C_MCI_MAXLAT)
|
||||
#define AT91C_WRITE_MULTIPLE_BLOCK_CMD (25 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_START | (AT91C_MCI_TRTYP_MULTIPLE & ~(AT91C_MCI_TRDIR)) | AT91C_MCI_MAXLAT)
|
||||
#define AT91C_PROGRAM_CSD_CMD (27 | AT91C_MCI_RSPTYP_48 )
|
||||
@@ -278,14 +278,14 @@ typedef struct _AT91S_MciDevice
|
||||
#define AT91C_SR_CARD_SELECTED (AT91C_SR_READY_FOR_DATA + AT91C_SR_TRAN)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// MMC CSD register header File
|
||||
// MMC CSD register header File
|
||||
// AT91C_CSD_xxx_S for shift value
|
||||
// AT91C_CSD_xxx_M for mask value
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// First Response INT <=> CSD[3] : bits 0 to 31
|
||||
#define AT91C_CSD_BIT0_S 0 // [0:0]
|
||||
#define AT91C_CSD_BIT0_M 0x01
|
||||
#define AT91C_CSD_BIT0_S 0 // [0:0]
|
||||
#define AT91C_CSD_BIT0_M 0x01
|
||||
#define AT91C_CSD_CRC_S 1 // [7:1]
|
||||
#define AT91C_CSD_CRC_M 0x7F
|
||||
#define AT91C_CSD_MMC_ECC_S 8 // [9:8] reserved for MMC compatibility
|
||||
@@ -314,15 +314,15 @@ typedef struct _AT91S_MciDevice
|
||||
#define AT91C_CSD_WP_GRP_EN_M 0x01
|
||||
|
||||
// Seconde Response INT <=> CSD[2] : bits 32 to 63
|
||||
#define AT91C_CSD_v21_WP_GRP_SIZE_S 0 // [38:32]
|
||||
#define AT91C_CSD_v21_WP_GRP_SIZE_M 0x7F
|
||||
#define AT91C_CSD_v21_WP_GRP_SIZE_S 0 // [38:32]
|
||||
#define AT91C_CSD_v21_WP_GRP_SIZE_M 0x7F
|
||||
#define AT91C_CSD_v21_SECT_SIZE_S 7 // [45:39]
|
||||
#define AT91C_CSD_v21_SECT_SIZE_M 0x7F
|
||||
#define AT91C_CSD_v21_ER_BLEN_EN_S 14 // [46:46]
|
||||
#define AT91C_CSD_v21_ER_BLEN_EN_M 0x01
|
||||
|
||||
#define AT91C_CSD_v22_WP_GRP_SIZE_S 0 // [36:32]
|
||||
#define AT91C_CSD_v22_WP_GRP_SIZE_M 0x1F
|
||||
#define AT91C_CSD_v22_WP_GRP_SIZE_S 0 // [36:32]
|
||||
#define AT91C_CSD_v22_WP_GRP_SIZE_M 0x1F
|
||||
#define AT91C_CSD_v22_ER_GRP_SIZE_S 5 // [41:37]
|
||||
#define AT91C_CSD_v22_ER_GRP_SIZE_M 0x1F
|
||||
#define AT91C_CSD_v22_SECT_SIZE_S 10 // [46:42]
|
||||
@@ -345,7 +345,7 @@ typedef struct _AT91S_MciDevice
|
||||
#define AT91C_CSD_CSIZE_H_S 0 // [73:64] <=> 10 MSB of CSIZE
|
||||
#define AT91C_CSD_CSIZE_H_M 0x03FF
|
||||
// reserved 10 // [75:74]
|
||||
// reserved 0x03
|
||||
// reserved 0x03
|
||||
#define AT91C_CSD_DSR_I_S 12 // [76:76]
|
||||
#define AT91C_CSD_DSR_I_M 0x01
|
||||
#define AT91C_CSD_RD_B_MIS_S 13 // [77:77]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __LED_H
|
||||
#define __LED_H
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU In
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_DBGU_IsInterruptMasked
|
||||
//* \brief Test if DBGU Interrupt is Masked
|
||||
//* \brief Test if DBGU Interrupt is Masked
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline int AT91F_DBGU_IsInterruptMasked(
|
||||
AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller
|
||||
@@ -344,7 +344,7 @@ static inline unsigned int AT91F_RTC_GetInterruptMaskStatus( // \return RTC Inte
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_RTC_IsInterruptMasked
|
||||
//* \brief Test if RTC Interrupt is Masked
|
||||
//* \brief Test if RTC Interrupt is Masked
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline int AT91F_RTC_IsInterruptMasked(
|
||||
AT91PS_RTC pRtc, // \arg pointer to a RTC controller
|
||||
@@ -565,7 +565,7 @@ static inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Inte
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_SSC_IsInterruptMasked
|
||||
//* \brief Test if SSC Interrupt is Masked
|
||||
//* \brief Test if SSC Interrupt is Masked
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline int AT91F_SSC_IsInterruptMasked(
|
||||
AT91PS_SSC pSsc, // \arg pointer to a SSC controller
|
||||
@@ -666,7 +666,7 @@ static inline void AT91F_SPI_Disable (
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline void AT91F_SPI_CfgMode (
|
||||
AT91PS_SPI pSPI, // pointer to a SPI controller
|
||||
int mode) // mode register
|
||||
int mode) // mode register
|
||||
{
|
||||
//* Write to the MR register
|
||||
pSPI->SPI_MR = mode;
|
||||
@@ -679,7 +679,7 @@ static inline void AT91F_SPI_CfgMode (
|
||||
static inline void AT91F_SPI_CfgPCS (
|
||||
AT91PS_SPI pSPI, // pointer to a SPI controller
|
||||
char PCS_Device) // PCS of the Device
|
||||
{
|
||||
{
|
||||
//* Write to the MR register
|
||||
pSPI->SPI_MR &= 0xFFF0FFFF;
|
||||
pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS );
|
||||
@@ -785,7 +785,7 @@ static inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Inte
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_SPI_IsInterruptMasked
|
||||
//* \brief Test if SPI Interrupt is Masked
|
||||
//* \brief Test if SPI Interrupt is Masked
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline int AT91F_SPI_IsInterruptMasked(
|
||||
AT91PS_SPI pSpi, // \arg pointer to a SPI controller
|
||||
@@ -831,7 +831,7 @@ static inline unsigned int AT91F_TC_GetInterruptMaskStatus( // \return TC Interr
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_TC_IsInterruptMasked
|
||||
//* \brief Test if TC Interrupt is Masked
|
||||
//* \brief Test if TC Interrupt is Masked
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline int AT91F_TC_IsInterruptMasked(
|
||||
AT91PS_TC pTc, // \arg pointer to a TC controller
|
||||
@@ -1107,7 +1107,7 @@ static inline void AT91F_PIO_ForceOutput(
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline void AT91F_PIO_Enable(
|
||||
AT91PS_PIO pPio, // \arg pointer to a PIO controller
|
||||
unsigned int flag) // \arg pio to be enabled
|
||||
unsigned int flag) // \arg pio to be enabled
|
||||
{
|
||||
pPio->PIO_PER = flag;
|
||||
}
|
||||
@@ -1118,7 +1118,7 @@ static inline void AT91F_PIO_Enable(
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline void AT91F_PIO_Disable(
|
||||
AT91PS_PIO pPio, // \arg pointer to a PIO controller
|
||||
unsigned int flag) // \arg pio to be disabled
|
||||
unsigned int flag) // \arg pio to be disabled
|
||||
{
|
||||
pPio->PIO_PDR = flag;
|
||||
}
|
||||
@@ -1232,9 +1232,9 @@ static inline int AT91F_PIO_IsInputFilterSet(
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_PIO_GetOutputDataStatus
|
||||
//* \brief Return PIO Output Data Status
|
||||
//* \brief Return PIO Output Data Status
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status
|
||||
static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status
|
||||
AT91PS_PIO pPio) // \arg pointer to a PIO controller
|
||||
{
|
||||
return pPio->PIO_ODSR;
|
||||
@@ -1284,7 +1284,7 @@ static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrup
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_PIO_IsInterruptMasked
|
||||
//* \brief Test if PIO Interrupt is Masked
|
||||
//* \brief Test if PIO Interrupt is Masked
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline int AT91F_PIO_IsInterruptMasked(
|
||||
AT91PS_PIO pPio, // \arg pointer to a PIO controller
|
||||
@@ -1349,7 +1349,7 @@ static inline int AT91F_PIO_IsMultiDriverSet(
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_PIO_A_RegisterSelection
|
||||
//* \brief PIO A Register Selection
|
||||
//* \brief PIO A Register Selection
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline void AT91F_PIO_A_RegisterSelection(
|
||||
AT91PS_PIO pPio, // \arg pointer to a PIO controller
|
||||
@@ -1360,11 +1360,11 @@ static inline void AT91F_PIO_A_RegisterSelection(
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_PIO_B_RegisterSelection
|
||||
//* \brief PIO B Register Selection
|
||||
//* \brief PIO B Register Selection
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline void AT91F_PIO_B_RegisterSelection(
|
||||
AT91PS_PIO pPio, // \arg pointer to a PIO controller
|
||||
unsigned int flag) // \arg pio B register selection
|
||||
unsigned int flag) // \arg pio B register selection
|
||||
{
|
||||
pPio->PIO_BSR = flag;
|
||||
}
|
||||
@@ -1437,7 +1437,7 @@ static inline int AT91F_PIO_IsOutputWriteSet(
|
||||
//* \fn AT91F_PIO_GetCfgPullup
|
||||
//* \brief Return PIO Configuration Pullup
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup
|
||||
static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup
|
||||
AT91PS_PIO pPio) // \arg pointer to a PIO controller
|
||||
{
|
||||
return pPio->PIO_PPUSR;
|
||||
@@ -1445,7 +1445,7 @@ static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_PIO_IsOutputDataStatusSet
|
||||
//* \brief Test if PIO Output Data Status is Set
|
||||
//* \brief Test if PIO Output Data Status is Set
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline int AT91F_PIO_IsOutputDataStatusSet(
|
||||
AT91PS_PIO pPio, // \arg pointer to a PIO controller
|
||||
@@ -1521,7 +1521,7 @@ static inline unsigned int AT91F_TWI_GetInterruptMaskStatus( // \return TWI Inte
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_TWI_IsInterruptMasked
|
||||
//* \brief Test if TWI Interrupt is Masked
|
||||
//* \brief Test if TWI Interrupt is Masked
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline int AT91F_TWI_IsInterruptMasked(
|
||||
AT91PS_TWI pTwi, // \arg pointer to a TWI controller
|
||||
@@ -2329,7 +2329,7 @@ static inline unsigned int AT91F_UDP_GetInterruptMaskStatus( // \return UDP Inte
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_UDP_IsInterruptMasked
|
||||
//* \brief Test if UDP Interrupt is Masked
|
||||
//* \brief Test if UDP Interrupt is Masked
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline int AT91F_UDP_IsInterruptMasked(
|
||||
AT91PS_UDP pUdp, // \arg pointer to a UDP controller
|
||||
@@ -2390,7 +2390,7 @@ static inline unsigned int AT91F_ST_GetInterruptMaskStatus( // \return ST Interr
|
||||
|
||||
//*----------------------------------------------------------------------------
|
||||
//* \fn AT91F_ST_IsInterruptMasked
|
||||
//* \brief Test if ST Interrupt is Masked
|
||||
//* \brief Test if ST Interrupt is Masked
|
||||
//*----------------------------------------------------------------------------
|
||||
static inline int AT91F_ST_IsInterruptMasked(
|
||||
AT91PS_ST pSt, // \arg pointer to a ST controller
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
//* \fn AT91F_DataAbort
|
||||
//* \brief This function reports an Abort
|
||||
//*----------------------------------------------------------------------------
|
||||
static void AT91F_SpuriousHandler()
|
||||
static void AT91F_SpuriousHandler()
|
||||
{
|
||||
puts("ISI");
|
||||
while (1);
|
||||
@@ -32,7 +32,7 @@ static void AT91F_SpuriousHandler()
|
||||
//* \fn AT91F_DataAbort
|
||||
//* \brief This function reports an Abort
|
||||
//*----------------------------------------------------------------------------
|
||||
static void AT91F_DataAbort()
|
||||
static void AT91F_DataAbort()
|
||||
{
|
||||
puts("IDA");
|
||||
while (1);
|
||||
@@ -52,7 +52,7 @@ static void AT91F_FetchAbort()
|
||||
//* \fn AT91F_UndefHandler
|
||||
//* \brief This function reports that no handler have been set for current IT
|
||||
//*----------------------------------------------------------------------------
|
||||
static void AT91F_UndefHandler()
|
||||
static void AT91F_UndefHandler()
|
||||
{
|
||||
puts("IUD");
|
||||
while (1);
|
||||
@@ -68,47 +68,47 @@ static void AT91F_UndefHandler()
|
||||
static void AT91F_InitSdram()
|
||||
{
|
||||
int *pRegister;
|
||||
|
||||
|
||||
//* Configure PIOC as peripheral (D16/D31)
|
||||
|
||||
|
||||
AT91F_PIO_CfgPeriph(
|
||||
AT91C_BASE_PIOC, // PIO controller base address
|
||||
0xFFFF0030,
|
||||
0
|
||||
);
|
||||
|
||||
|
||||
//*Init SDRAM
|
||||
pRegister = (int *)0xFFFFFF98;
|
||||
*pRegister = 0x2188c155;
|
||||
*pRegister = 0x2188c155;
|
||||
pRegister = (int *)0xFFFFFF90;
|
||||
*pRegister = 0x2;
|
||||
*pRegister = 0x2;
|
||||
pRegister = (int *)0x20000000;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
pRegister = (int *)0xFFFFFF90;
|
||||
*pRegister = 0x4;
|
||||
*pRegister = 0x4;
|
||||
pRegister = (int *)0x20000000;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
pRegister = (int *)0xFFFFFF90;
|
||||
*pRegister = 0x3;
|
||||
*pRegister = 0x3;
|
||||
pRegister = (int *)0x20000080;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
|
||||
pRegister = (int *)0xFFFFFF94;
|
||||
*pRegister = 0x2e0;
|
||||
*pRegister = 0x2e0;
|
||||
pRegister = (int *)0x20000000;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
|
||||
pRegister = (int *)0xFFFFFF90;
|
||||
*pRegister = 0x00;
|
||||
*pRegister = 0x00;
|
||||
pRegister = (int *)0x20000000;
|
||||
*pRegister = 0;
|
||||
*pRegister = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ static void AT91F_InitMemories()
|
||||
//* CS0 cs for flash
|
||||
pEbi = (int *)0xFFFFFF70;
|
||||
*pEbi = 0x00003284;
|
||||
|
||||
|
||||
AT91F_InitSdram();
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ void AT91F_LowLevelInit(void)
|
||||
AT91F_SpuriousHandler, // AIC spurious handler
|
||||
0); // Protect mode
|
||||
|
||||
// Perform 8 End Of Interrupt Command to make s<>re AIC will not Lock out nIRQ
|
||||
// Perform 8 End Of Interrupt Command to make s<>re AIC will not Lock out nIRQ
|
||||
for(i=0; i<8; i++)
|
||||
AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ void LED_blink(unsigned int led)
|
||||
for(j= 0; j < 200000; j++);
|
||||
LED_set(0);
|
||||
for(j= 0; j < 200000; j++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* intellectual property rights of others.
|
||||
*----------------------------------------------------------------------------
|
||||
* File Name : main.c
|
||||
* Object :
|
||||
* Object :
|
||||
* Creation : HIi 10/10/2003
|
||||
* Modif : HIi 15/06/2004 : add crc32 to verify the download
|
||||
* from dataflash
|
||||
@@ -107,7 +107,7 @@ AT91S_CtlTempo ctlTempo;
|
||||
|
||||
//*--------------------------------------------------------------------------------------
|
||||
//* Function Name : GetTickCount()
|
||||
//* Object : Return the number of systimer tick
|
||||
//* Object : Return the number of systimer tick
|
||||
//* Input Parameters :
|
||||
//* Output Parameters :
|
||||
//*--------------------------------------------------------------------------------------
|
||||
@@ -141,10 +141,10 @@ static void XmodemProtocol(AT91S_PipeStatus status, void *pVoid)
|
||||
{
|
||||
AT91PS_SBuffer pSBuffer = (AT91PS_SBuffer) xmodemPipe.pBuffer->pChild;
|
||||
AT91PS_USART pUsart = svcXmodem.pUsart;
|
||||
|
||||
|
||||
if (pSBuffer->szRdBuffer == 0) {
|
||||
/* Start a tempo to wait the Xmodem protocol complete */
|
||||
svcXmodem.tempo.Start(&(svcXmodem.tempo), 10, 0, AT91_XmodemComplete, pUsart);
|
||||
svcXmodem.tempo.Start(&(svcXmodem.tempo), 10, 0, AT91_XmodemComplete, pUsart);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -161,7 +161,7 @@ void AT91F_ST_HANDLER(void)
|
||||
#ifdef XMODEM
|
||||
unsigned int error;
|
||||
#endif
|
||||
|
||||
|
||||
if (AT91C_BASE_ST->ST_SR & 0x01) {
|
||||
StTick++;
|
||||
ctlTempo.CtlTempoTick(&ctlTempo);
|
||||
@@ -177,9 +177,9 @@ void AT91F_ST_HANDLER(void)
|
||||
AT91F_US_EnableIt((AT91PS_USART)AT91C_BASE_DBGU, AT91C_US_RXRDY);
|
||||
|
||||
}
|
||||
|
||||
else if (csr & (AT91C_US_TXRDY | AT91C_US_ENDTX | AT91C_US_TXEMPTY |
|
||||
AT91C_US_RXRDY | AT91C_US_ENDRX | AT91C_US_TIMEOUT |
|
||||
|
||||
else if (csr & (AT91C_US_TXRDY | AT91C_US_ENDTX | AT91C_US_TXEMPTY |
|
||||
AT91C_US_RXRDY | AT91C_US_ENDRX | AT91C_US_TIMEOUT |
|
||||
AT91C_US_RXBUFF)) {
|
||||
if ( !(svcXmodem.eot) )
|
||||
svcXmodem.Handler(&svcXmodem, csr);
|
||||
@@ -190,9 +190,9 @@ void AT91F_ST_HANDLER(void)
|
||||
|
||||
//*-----------------------------------------------------------------------------
|
||||
//* Function Name : AT91F_DisplayMenu()
|
||||
//* Object :
|
||||
//* Input Parameters :
|
||||
//* Return value :
|
||||
//* Object :
|
||||
//* Input Parameters :
|
||||
//* Return value :
|
||||
//*-----------------------------------------------------------------------------
|
||||
static int AT91F_DisplayMenu(void)
|
||||
{
|
||||
@@ -204,30 +204,30 @@ static int AT91F_DisplayMenu(void)
|
||||
puts(menu_dataflash[i]);
|
||||
}
|
||||
return mci_present;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//*-----------------------------------------------------------------------------
|
||||
//* Function Name : AsciiToHex()
|
||||
//* Object : ascii to hexa conversion
|
||||
//* Input Parameters :
|
||||
//* Return value :
|
||||
//* Input Parameters :
|
||||
//* Return value :
|
||||
//*-----------------------------------------------------------------------------
|
||||
static unsigned int AsciiToHex(char *s, unsigned int *val)
|
||||
{
|
||||
int n;
|
||||
|
||||
*val=0;
|
||||
|
||||
|
||||
if(s[0] == '0' && ((s[1] == 'x') || (s[1] == 'X')))
|
||||
s+=2;
|
||||
n = 0;
|
||||
n = 0;
|
||||
while((n < 8) && (s[n] !=0))
|
||||
{
|
||||
*val <<= 4;
|
||||
if ( (s[n] >= '0') && (s[n] <='9'))
|
||||
*val += (s[n] - '0');
|
||||
else
|
||||
else
|
||||
if ((s[n] >= 'a') && (s[n] <='f'))
|
||||
*val += (s[n] - 0x57);
|
||||
else
|
||||
@@ -238,7 +238,7 @@ static unsigned int AsciiToHex(char *s, unsigned int *val)
|
||||
n++;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -246,8 +246,8 @@ static unsigned int AsciiToHex(char *s, unsigned int *val)
|
||||
//*-----------------------------------------------------------------------------
|
||||
//* Function Name : AT91F_MemoryDisplay()
|
||||
//* Object : Display the content of the dataflash
|
||||
//* Input Parameters :
|
||||
//* Return value :
|
||||
//* Input Parameters :
|
||||
//* Return value :
|
||||
//*-----------------------------------------------------------------------------
|
||||
static int AT91F_MemoryDisplay(unsigned int addr, unsigned int length)
|
||||
{
|
||||
@@ -265,7 +265,7 @@ static int AT91F_MemoryDisplay(unsigned int addr, unsigned int length)
|
||||
// uip = (unsigned int *)linebuf;
|
||||
// usp = (unsigned short *)linebuf;
|
||||
ucp = (unsigned char *)linebuf;
|
||||
|
||||
|
||||
printf("%08x:", addr);
|
||||
linebytes = (nbytes > DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
|
||||
if((addr & 0xF0000000) == 0x20000000) {
|
||||
@@ -277,7 +277,7 @@ static int AT91F_MemoryDisplay(unsigned int addr, unsigned int length)
|
||||
}
|
||||
for (i=0; i<linebytes; i++)
|
||||
{
|
||||
/* if (size == 4)
|
||||
/* if (size == 4)
|
||||
printf(" %08x", *uip++);
|
||||
else if (size == 2)
|
||||
printf(" %04x", *usp++);
|
||||
@@ -321,7 +321,7 @@ static unsigned int AT91F_SetPLL(void)
|
||||
pCkgr->CKGR_PLLAR = AT91C_PLLA_VALUE;
|
||||
|
||||
while (!(*AT91C_PMC_SR & AT91C_PMC_LOCKA));
|
||||
|
||||
|
||||
/* - Switch Master Clock from PLLB to PLLA/3 */
|
||||
tmp = pPmc->PMC_MCKR;
|
||||
/* See Atmel Errata #27 and #28 */
|
||||
@@ -336,7 +336,7 @@ static unsigned int AT91F_SetPLL(void)
|
||||
while (!(*AT91C_PMC_SR & AT91C_PMC_MCKRDY));
|
||||
}
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -387,7 +387,7 @@ static int AT91F_LoadBoot(void)
|
||||
volatile unsigned int AddressToDownload = AT91C_BOOT_ADDR;
|
||||
|
||||
#if 0
|
||||
/* Read vector 6 to extract size to load */
|
||||
/* Read vector 6 to extract size to load */
|
||||
if (read_dataflash(AT91C_BOOT_DATAFLASH_ADDR, 32,
|
||||
(char *)AddressToDownload) != AT91C_DATAFLASH_OK)
|
||||
{
|
||||
@@ -397,7 +397,7 @@ static int AT91F_LoadBoot(void)
|
||||
/* calculate the size to download */
|
||||
SizeToDownload = *(int *)(AddressToDownload + AT91C_OFFSET_VECT6);
|
||||
#endif
|
||||
|
||||
|
||||
// printf("\nLoad UBOOT from dataflash[%x] to SDRAM[%x]\n",
|
||||
// AT91C_BOOT_DATAFLASH_ADDR, AT91C_BOOT_ADDR);
|
||||
if (read_dataflash(AT91C_BOOT_DATAFLASH_ADDR, SizeToDownload + 8,
|
||||
@@ -417,7 +417,7 @@ static int AT91F_LoadBoot(void)
|
||||
/* Restore the value of Vector 6 */
|
||||
*(int *)(AddressToDownload + AT91C_OFFSET_VECT6) =
|
||||
*(int *)(AddressToDownload + SizeToDownload + 4);
|
||||
|
||||
|
||||
if (crc1 != crc2) {
|
||||
printf("DF CRC bad %x != %x\n",crc1,crc2);
|
||||
return IMAGE_CRC_ERROR;
|
||||
@@ -543,11 +543,11 @@ int main(void)
|
||||
#endif
|
||||
AT91S_SvcTempo svcBootTempo; // Link to a AT91S_Tempo object
|
||||
unsigned int ix;
|
||||
volatile unsigned int AddressToDownload, SizeToDownload;
|
||||
volatile unsigned int AddressToDownload, SizeToDownload;
|
||||
unsigned int DeviceAddress = 0;
|
||||
char command = 0;
|
||||
#ifdef XMODEM
|
||||
volatile int i = 0;
|
||||
volatile int i = 0;
|
||||
unsigned int crc1 = 0, crc2 = 0;
|
||||
volatile int device;
|
||||
int NbPage;
|
||||
@@ -568,7 +568,7 @@ int main(void)
|
||||
/* Tempo Initialisation */
|
||||
pAT91->OpenCtlTempo(&ctlTempo, (void *) &(pAT91->SYSTIMER_DESC));
|
||||
ctlTempo.CtlTempoStart((void *) &(pAT91->SYSTIMER_DESC));
|
||||
|
||||
|
||||
// Attach the tempo to a tempo controler
|
||||
ctlTempo.CtlTempoCreate(&ctlTempo, &svcBootTempo);
|
||||
// LED_init();
|
||||
@@ -607,11 +607,11 @@ int main(void)
|
||||
AddressToDownload = AT91C_DOWNLOAD_BASE_ADDRESS;
|
||||
SizeToDownload = AT91C_DOWNLOAD_MAX_SIZE;
|
||||
DeviceAddress = 0;
|
||||
|
||||
|
||||
/* try to detect Dataflash */
|
||||
if (!Nb_Device)
|
||||
Nb_Device = AT91F_DataflashInit();
|
||||
|
||||
Nb_Device = AT91F_DataflashInit();
|
||||
|
||||
mci_present = AT91F_DisplayMenu();
|
||||
|
||||
#ifdef PRODTEST
|
||||
@@ -631,10 +631,10 @@ int main(void)
|
||||
|
||||
command = message[0];
|
||||
for(ix = 1; (message[ix] == ' ') && (ix < 12); ix++); // Skip some whitespace
|
||||
|
||||
|
||||
if(!AsciiToHex(&message[ix], &DeviceAddress) )
|
||||
DeviceAddress = 0; // Illegal DeviceAddress
|
||||
|
||||
|
||||
switch(command)
|
||||
{
|
||||
#ifdef XMODEM
|
||||
@@ -661,7 +661,7 @@ int main(void)
|
||||
|
||||
device = 0;
|
||||
break;
|
||||
|
||||
|
||||
case CFG_DATAFLASH_LOGIC_ADDR_CS3:
|
||||
if (dataflash_info[1].id == 0){
|
||||
printf("No DF");
|
||||
@@ -670,7 +670,7 @@ int main(void)
|
||||
}
|
||||
device = 1;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
command = 0;
|
||||
break;
|
||||
@@ -691,7 +691,7 @@ int main(void)
|
||||
|
||||
#ifdef MEMDISP
|
||||
case '6':
|
||||
do
|
||||
do
|
||||
{
|
||||
AT91F_MemoryDisplay(DeviceAddress, 256);
|
||||
AT91F_ReadLine (NULL, message);
|
||||
@@ -736,9 +736,9 @@ int main(void)
|
||||
#ifdef XMODEM
|
||||
for(i = 0; i <= AT91C_DOWNLOAD_MAX_SIZE; i++)
|
||||
*(unsigned char *)(AddressToDownload + i) = 0;
|
||||
|
||||
|
||||
xmodemPipe.Read(&xmodemPipe, (char *)AddressToDownload,
|
||||
SizeToDownload, XmodemProtocol, 0);
|
||||
SizeToDownload, XmodemProtocol, 0);
|
||||
while(XmodemComplete !=1);
|
||||
SizeToDownload = (unsigned int)((svcXmodem.pData) -
|
||||
(unsigned int)AddressToDownload);
|
||||
@@ -753,21 +753,21 @@ int main(void)
|
||||
i = (SizeToDownload / 512)+1 + (NbPage << 13) +
|
||||
(dataflash_info[device].Device.pages_size << 17); //+4 to add crc32
|
||||
SizeToDownload = 512 * (i &0xFF);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Save the contents of vector 6 ==> will be restored
|
||||
/* Save the contents of vector 6 ==> will be restored
|
||||
* at boot time (AT91F_StartBoot) */
|
||||
*(int *)(AddressToDownload + SizeToDownload + 4) =
|
||||
*(int *)(AddressToDownload + AT91C_OFFSET_VECT6);
|
||||
/* Modify Vector 6 to contain the size of the
|
||||
* file to copy (Dataflash -> SDRAM)*/
|
||||
i = SizeToDownload;
|
||||
}
|
||||
i = SizeToDownload;
|
||||
}
|
||||
|
||||
*(int *)(AddressToDownload + AT91C_OFFSET_VECT6) = i;
|
||||
// printf("\nModification of Arm Vector 6 :%x\n", i);
|
||||
|
||||
|
||||
// printf("\nWrite %d bytes in DataFlash [0x%x]\n",SizeToDownload, DeviceAddress);
|
||||
crc1 = 0;
|
||||
pAT91->CRC32((const unsigned char *)AddressToDownload, SizeToDownload , &crc1);
|
||||
@@ -784,13 +784,13 @@ int main(void)
|
||||
/* clear the buffer before read */
|
||||
for(i=0; i <= SizeToDownload; i++)
|
||||
*(unsigned char *)(AddressToDownload + i) = 0;
|
||||
|
||||
|
||||
/* Read dataflash to check the validity of the data */
|
||||
read_dataflash (DeviceAddress, (SizeToDownload + 4), (char *)(AddressToDownload));
|
||||
|
||||
printf("VFY: ");
|
||||
printf("VFY: ");
|
||||
crc2 = 0;
|
||||
|
||||
|
||||
pAT91->CRC32((const unsigned char *)AddressToDownload, SizeToDownload , &crc2);
|
||||
crc1 = (int)(*(char *)(AddressToDownload + SizeToDownload)) +
|
||||
(int)(*(char *)(AddressToDownload + SizeToDownload + 1) << 8) +
|
||||
@@ -801,7 +801,7 @@ int main(void)
|
||||
printf("ERR");
|
||||
else
|
||||
printf("OK");
|
||||
|
||||
|
||||
command = 0;
|
||||
XmodemComplete = 0;
|
||||
AT91F_WaitKeyPressed();
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//*
|
||||
//* 1.0 27/03/03 HIi : Creation
|
||||
//* 1.01 03/05/04 HIi : AT9C_VERSION incremented to 1.01
|
||||
//* 1.02 15/06/04 HIi : AT9C_VERSION incremented to 1.02 ==>
|
||||
//* 1.02 15/06/04 HIi : AT9C_VERSION incremented to 1.02 ==>
|
||||
//* Add crc32 to verify dataflash download
|
||||
//* 1.03 18/04/05 MLC : AT91C_VERSION incremented to 1.03g
|
||||
//* Repeat boot on CRC Failure
|
||||
|
||||
@@ -94,7 +94,7 @@ int AT91F_MCI_SDCard_SendAppCommand (
|
||||
status = AT91C_BASE_MCI->MCI_SR;
|
||||
//tick++;
|
||||
}
|
||||
while( !(status & AT91C_MCI_CMDRDY) );//&& (tick<100) );
|
||||
while( !(status & AT91C_MCI_CMDRDY) );//&& (tick<100) );
|
||||
|
||||
// if an error occurs
|
||||
if (((AT91C_BASE_MCI->MCI_SR) & AT91C_MCI_SR_ERROR) != 0 )
|
||||
@@ -134,16 +134,16 @@ void AT91F_MCI_Device_Handler(
|
||||
{
|
||||
AT91C_BASE_MCI->MCI_IDR = AT91C_MCI_TXBUFE;
|
||||
AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_TXTDIS;
|
||||
|
||||
|
||||
pMCI_Device->pMCI_DeviceDesc->state = AT91C_MCI_IDLE;
|
||||
} // End of if AT91C_MCI_TXBUFF
|
||||
|
||||
} // End of if AT91C_MCI_TXBUFF
|
||||
|
||||
// If End of Rx Buffer Full interrupt occurred
|
||||
if ( status & AT91C_MCI_RXBUFF )
|
||||
{
|
||||
{
|
||||
AT91C_BASE_MCI->MCI_IDR = AT91C_MCI_RXBUFF;
|
||||
AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_RXTDIS;
|
||||
|
||||
|
||||
pMCI_Device->pMCI_DeviceDesc->state = AT91C_MCI_IDLE;
|
||||
} // End of if AT91C_MCI_RXBUFF
|
||||
|
||||
@@ -175,30 +175,30 @@ int AT91F_MCI_ReadBlock(
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
if(pMCI_Device->pMCI_DeviceDesc->state != AT91C_MCI_IDLE)
|
||||
return AT91C_READ_ERROR;
|
||||
|
||||
|
||||
if( (AT91F_MCI_GetStatus(pMCI_Device,pMCI_Device->pMCI_DeviceFeatures->Relative_Card_Address) & AT91C_SR_READY_FOR_DATA) != AT91C_SR_READY_FOR_DATA)
|
||||
return AT91C_READ_ERROR;
|
||||
|
||||
|
||||
if ( (src + sizeToRead) > pMCI_Device->pMCI_DeviceFeatures->Memory_Capacity )
|
||||
return AT91C_READ_ERROR;
|
||||
|
||||
// If source does not fit a begin of a block
|
||||
if ( (src % pMCI_Device->pMCI_DeviceFeatures->Max_Read_DataBlock_Length) != 0 )
|
||||
return AT91C_READ_ERROR;
|
||||
|
||||
|
||||
// Test if the MMC supports Partial Read Block
|
||||
// ALWAYS SUPPORTED IN SD Memory Card
|
||||
if( (sizeToRead < pMCI_Device->pMCI_DeviceFeatures->Max_Read_DataBlock_Length)
|
||||
if( (sizeToRead < pMCI_Device->pMCI_DeviceFeatures->Max_Read_DataBlock_Length)
|
||||
&& (pMCI_Device->pMCI_DeviceFeatures->Read_Partial == 0x00) )
|
||||
return AT91C_READ_ERROR;
|
||||
|
||||
|
||||
if( sizeToRead > pMCI_Device->pMCI_DeviceFeatures->Max_Read_DataBlock_Length)
|
||||
return AT91C_READ_ERROR;
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// Init Mode Register
|
||||
AT91C_BASE_MCI->MCI_MR |= ((pMCI_Device->pMCI_DeviceFeatures->Max_Read_DataBlock_Length << 16) | AT91C_MCI_PDCMODE);
|
||||
|
||||
|
||||
if (sizeToRead %4)
|
||||
sizeToRead = (sizeToRead /4)+1;
|
||||
else
|
||||
@@ -219,7 +219,7 @@ int AT91F_MCI_ReadBlock(
|
||||
|
||||
// (PDC) Receiver Transfer Enable
|
||||
AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_RXTEN;
|
||||
|
||||
|
||||
return AT91C_READ_OK;
|
||||
}
|
||||
|
||||
@@ -238,29 +238,29 @@ int AT91F_MCI_WriteBlock(
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
if( pMCI_Device->pMCI_DeviceDesc->state != AT91C_MCI_IDLE)
|
||||
return AT91C_WRITE_ERROR;
|
||||
|
||||
|
||||
if( (AT91F_MCI_GetStatus(pMCI_Device,pMCI_Device->pMCI_DeviceFeatures->Relative_Card_Address) & AT91C_SR_READY_FOR_DATA) != AT91C_SR_READY_FOR_DATA)
|
||||
return AT91C_WRITE_ERROR;
|
||||
|
||||
|
||||
if ( (dest + sizeToWrite) > pMCI_Device->pMCI_DeviceFeatures->Memory_Capacity )
|
||||
return AT91C_WRITE_ERROR;
|
||||
|
||||
// If source does not fit a begin of a block
|
||||
if ( (dest % pMCI_Device->pMCI_DeviceFeatures->Max_Read_DataBlock_Length) != 0 )
|
||||
return AT91C_WRITE_ERROR;
|
||||
|
||||
// Test if the MMC supports Partial Write Block
|
||||
if( (sizeToWrite < pMCI_Device->pMCI_DeviceFeatures->Max_Write_DataBlock_Length)
|
||||
|
||||
// Test if the MMC supports Partial Write Block
|
||||
if( (sizeToWrite < pMCI_Device->pMCI_DeviceFeatures->Max_Write_DataBlock_Length)
|
||||
&& (pMCI_Device->pMCI_DeviceFeatures->Write_Partial == 0x00) )
|
||||
return AT91C_WRITE_ERROR;
|
||||
|
||||
|
||||
if( sizeToWrite > pMCI_Device->pMCI_DeviceFeatures->Max_Write_DataBlock_Length )
|
||||
return AT91C_WRITE_ERROR;
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// Init Mode Register
|
||||
AT91C_BASE_MCI->MCI_MR |= ((pMCI_Device->pMCI_DeviceFeatures->Max_Write_DataBlock_Length << 16) | AT91C_MCI_PDCMODE);
|
||||
|
||||
|
||||
if (sizeToWrite %4)
|
||||
sizeToWrite = (sizeToWrite /4)+1;
|
||||
else
|
||||
@@ -279,10 +279,10 @@ int AT91F_MCI_WriteBlock(
|
||||
|
||||
// Enable AT91C_MCI_TXBUFE Interrupt
|
||||
AT91C_BASE_MCI->MCI_IER = AT91C_MCI_TXBUFE;
|
||||
|
||||
|
||||
// Enables TX for PDC transfert requests
|
||||
AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_TXTEN;
|
||||
|
||||
|
||||
return AT91C_WRITE_OK;
|
||||
}
|
||||
#endif
|
||||
@@ -295,7 +295,7 @@ int AT91F_MCI_WriteBlock(
|
||||
int AT91F_MCI_MMC_SelectCard(AT91PS_MciDevice pMCI_Device, unsigned int relative_card_address)
|
||||
{
|
||||
int status;
|
||||
|
||||
|
||||
//* Check if the MMC card chosen is already the selected one
|
||||
status = AT91F_MCI_GetStatus(pMCI_Device,relative_card_address);
|
||||
|
||||
@@ -328,17 +328,17 @@ int AT91F_MCI_MMC_SelectCard(AT91PS_MciDevice pMCI_Device, unsigned int relative
|
||||
//*----------------------------------------------------------------------------
|
||||
int AT91F_MCI_GetCSD (AT91PS_MciDevice pMCI_Device, unsigned int relative_card_address , unsigned int * response)
|
||||
{
|
||||
|
||||
|
||||
if(AT91F_MCI_SendCommand(pMCI_Device,
|
||||
AT91C_SEND_CSD_CMD,
|
||||
(relative_card_address << 16)) != AT91C_CMD_SEND_OK)
|
||||
return AT91C_CMD_SEND_ERROR;
|
||||
|
||||
|
||||
response[0] = AT91C_BASE_MCI->MCI_RSPR[0];
|
||||
response[1] = AT91C_BASE_MCI->MCI_RSPR[1];
|
||||
response[2] = AT91C_BASE_MCI->MCI_RSPR[2];
|
||||
response[3] = AT91C_BASE_MCI->MCI_RSPR[3];
|
||||
|
||||
|
||||
return AT91C_CMD_SEND_OK;
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ int AT91F_MCI_SetBlocklength(AT91PS_MciDevice pMCI_Device,unsigned int length)
|
||||
int AT91F_MCI_MMC_GetAllOCR (AT91PS_MciDevice pMCI_Device)
|
||||
{
|
||||
unsigned int response =0x0;
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
response = AT91F_MCI_SendCommand(pMCI_Device,
|
||||
@@ -367,11 +367,11 @@ int AT91F_MCI_MMC_GetAllOCR (AT91PS_MciDevice pMCI_Device)
|
||||
AT91C_MMC_HOST_VOLTAGE_RANGE);
|
||||
if (response != AT91C_CMD_SEND_OK)
|
||||
return AT91C_INIT_ERROR;
|
||||
|
||||
|
||||
response = AT91C_BASE_MCI->MCI_RSPR[0];
|
||||
|
||||
|
||||
if ( (response & AT91C_CARD_POWER_UP_BUSY) == AT91C_CARD_POWER_UP_BUSY)
|
||||
return(response);
|
||||
return(response);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -384,7 +384,7 @@ int AT91F_MCI_MMC_GetAllOCR (AT91PS_MciDevice pMCI_Device)
|
||||
int AT91F_MCI_MMC_GetAllCID (AT91PS_MciDevice pMCI_Device, unsigned int *response)
|
||||
{
|
||||
int Nb_Cards_Found=-1;
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
if(AT91F_MCI_SendCommand(pMCI_Device,
|
||||
@@ -392,18 +392,18 @@ int AT91F_MCI_MMC_GetAllCID (AT91PS_MciDevice pMCI_Device, unsigned int *respons
|
||||
AT91C_NO_ARGUMENT) != AT91C_CMD_SEND_OK)
|
||||
return Nb_Cards_Found;
|
||||
else
|
||||
{
|
||||
{
|
||||
Nb_Cards_Found = 0;
|
||||
//* Assignation of the relative address to the MMC CARD
|
||||
pMCI_Device->pMCI_DeviceFeatures[Nb_Cards_Found].Relative_Card_Address = Nb_Cards_Found + AT91C_FIRST_RCA;
|
||||
//* Set the insert flag
|
||||
pMCI_Device->pMCI_DeviceFeatures[Nb_Cards_Found].Card_Inserted = AT91C_MMC_CARD_INSERTED;
|
||||
|
||||
|
||||
if (AT91F_MCI_SendCommand(pMCI_Device,
|
||||
AT91C_MMC_SET_RELATIVE_ADDR_CMD,
|
||||
(Nb_Cards_Found + AT91C_FIRST_RCA) << 16) != AT91C_CMD_SEND_OK)
|
||||
return AT91C_CMD_SEND_ERROR;
|
||||
|
||||
|
||||
//* If no error during assignation address ==> Increment Nb_cards_Found
|
||||
Nb_Cards_Found++ ;
|
||||
}
|
||||
@@ -438,7 +438,7 @@ int AT91F_MCI_MMC_Init (AT91PS_MciDevice pMCI_Device)
|
||||
if (AT91F_MCI_GetCSD(pMCI_Device,
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Relative_Card_Address,
|
||||
tab_response) != AT91C_CMD_SEND_OK)
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Relative_Card_Address = 0;
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Relative_Card_Address = 0;
|
||||
else
|
||||
{
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Max_Read_DataBlock_Length = 1 << ((tab_response[1] >> AT91C_CSD_RD_B_LEN_S) & AT91C_CSD_RD_B_LEN_M );
|
||||
@@ -446,10 +446,10 @@ int AT91F_MCI_MMC_Init (AT91PS_MciDevice pMCI_Device)
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Sector_Size = 1 + ((tab_response[2] >> AT91C_CSD_v22_SECT_SIZE_S) & AT91C_CSD_v22_SECT_SIZE_M );
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Read_Partial = (tab_response[1] >> AT91C_CSD_RD_B_PAR_S) & AT91C_CSD_RD_B_PAR_M;
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Write_Partial = (tab_response[3] >> AT91C_CSD_WBLOCK_P_S) & AT91C_CSD_WBLOCK_P_M;
|
||||
|
||||
|
||||
// None in MMC specification version 2.2
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Erase_Block_Enable = 0;
|
||||
|
||||
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Read_Block_Misalignment = (tab_response[1] >> AT91C_CSD_RD_B_MIS_S) & AT91C_CSD_RD_B_MIS_M;
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Write_Block_Misalignment = (tab_response[1] >> AT91C_CSD_WR_B_MIS_S) & AT91C_CSD_WR_B_MIS_M;
|
||||
|
||||
@@ -463,10 +463,10 @@ int AT91F_MCI_MMC_Init (AT91PS_MciDevice pMCI_Device)
|
||||
|
||||
pMCI_Device->pMCI_DeviceFeatures[i].Memory_Capacity = pMCI_Device->pMCI_DeviceFeatures[i].Max_Read_DataBlock_Length * blocknr;
|
||||
//// End of Compute Memory Capacity
|
||||
|
||||
} // end of else
|
||||
|
||||
} // end of else
|
||||
} // end of for
|
||||
|
||||
|
||||
return AT91C_INIT_OK;
|
||||
} // end of if
|
||||
|
||||
@@ -484,7 +484,7 @@ int AT91F_MCI_SDCard_GetOCR (AT91PS_MciDevice pMCI_Device)
|
||||
|
||||
// The RCA to be used for CMD55 in Idle state shall be the card's default RCA=0x0000.
|
||||
pMCI_Device->pMCI_DeviceFeatures->Relative_Card_Address = 0x0;
|
||||
|
||||
|
||||
while( (response & AT91C_CARD_POWER_UP_BUSY) != AT91C_CARD_POWER_UP_BUSY )
|
||||
{
|
||||
response = AT91F_MCI_SDCard_SendAppCommand(pMCI_Device,
|
||||
@@ -492,10 +492,10 @@ int AT91F_MCI_SDCard_GetOCR (AT91PS_MciDevice pMCI_Device)
|
||||
AT91C_MMC_HOST_VOLTAGE_RANGE);
|
||||
if (response != AT91C_CMD_SEND_OK)
|
||||
return AT91C_INIT_ERROR;
|
||||
|
||||
|
||||
response = AT91C_BASE_MCI->MCI_RSPR[0];
|
||||
}
|
||||
|
||||
|
||||
return(AT91C_BASE_MCI->MCI_RSPR[0]);
|
||||
}
|
||||
|
||||
@@ -509,12 +509,12 @@ int AT91F_MCI_SDCard_GetCID (AT91PS_MciDevice pMCI_Device, unsigned int *respons
|
||||
AT91C_ALL_SEND_CID_CMD,
|
||||
AT91C_NO_ARGUMENT) != AT91C_CMD_SEND_OK)
|
||||
return AT91C_CMD_SEND_ERROR;
|
||||
|
||||
|
||||
response[0] = AT91C_BASE_MCI->MCI_RSPR[0];
|
||||
response[1] = AT91C_BASE_MCI->MCI_RSPR[1];
|
||||
response[2] = AT91C_BASE_MCI->MCI_RSPR[2];
|
||||
response[3] = AT91C_BASE_MCI->MCI_RSPR[3];
|
||||
|
||||
|
||||
return AT91C_CMD_SEND_OK;
|
||||
}
|
||||
|
||||
@@ -594,7 +594,7 @@ int AT91F_MCI_SDCard_Init (AT91PS_MciDevice pMCI_Device)
|
||||
printf("SD-Card: %d Bytes\n\r", pMCI_Device->pMCI_DeviceFeatures->Memory_Capacity);
|
||||
|
||||
if( AT91F_MCI_SDCard_SetBusWidth(pMCI_Device) == AT91C_CMD_SEND_OK )
|
||||
{
|
||||
{
|
||||
if (AT91F_MCI_SetBlocklength(pMCI_Device,pMCI_Device->pMCI_DeviceFeatures->Max_Read_DataBlock_Length) == AT91C_CMD_SEND_OK)
|
||||
return AT91C_INIT_OK;
|
||||
}
|
||||
@@ -621,10 +621,10 @@ void AT91F_CfgDevice(void)
|
||||
MCI_Device_Features.Erase_Block_Enable = 0;
|
||||
MCI_Device_Features.Sector_Size = 0;
|
||||
MCI_Device_Features.Memory_Capacity = 0;
|
||||
|
||||
|
||||
MCI_Device_Desc.state = AT91C_MCI_IDLE;
|
||||
MCI_Device_Desc.SDCard_bus_width = AT91C_MCI_SCDBUS;
|
||||
|
||||
|
||||
// Init AT91S_DataFlash Global Structure, by default AT45DB choosen !!!
|
||||
MCI_Device.pMCI_DeviceDesc = &MCI_Device_Desc;
|
||||
MCI_Device.pMCI_DeviceFeatures = &MCI_Device_Features;
|
||||
@@ -645,9 +645,9 @@ int AT91F_MCI_Init(void)
|
||||
// Set up PIO SDC_TYPE to switch on MMC/SDCard and not DataFlash Card
|
||||
AT91F_PIO_CfgOutput(AT91C_BASE_PIOB,AT91C_PIO_PB7);
|
||||
AT91F_PIO_SetOutput(AT91C_BASE_PIOB,AT91C_PIO_PB7);
|
||||
|
||||
|
||||
// Init MCI for MMC and SDCard interface
|
||||
AT91F_MCI_CfgPIO();
|
||||
AT91F_MCI_CfgPIO();
|
||||
AT91F_MCI_CfgPMC();
|
||||
AT91F_PDC_Open(AT91C_BASE_PDC_MCI);
|
||||
|
||||
@@ -657,7 +657,7 @@ int AT91F_MCI_Init(void)
|
||||
// Init MCI Device Structures
|
||||
AT91F_CfgDevice();
|
||||
|
||||
// Configure MCI interrupt
|
||||
// Configure MCI interrupt
|
||||
AT91F_AIC_ConfigureIt(AT91C_BASE_AIC,
|
||||
AT91C_ID_MCI,
|
||||
AT91C_AIC_PRIOR_HIGHEST,
|
||||
@@ -674,7 +674,7 @@ int AT91F_MCI_Init(void)
|
||||
AT91C_MCI_DTOR_1MEGA_CYCLES,
|
||||
AT91C_MCI_MR_PDCMODE, // 15MHz for MCK = 60MHz (CLKDIV = 1)
|
||||
AT91C_MCI_SDCARD_4BITS_SLOTA);
|
||||
|
||||
|
||||
if(AT91F_MCI_SDCard_Init(&MCI_Device) != AT91C_INIT_OK)
|
||||
return FALSE;
|
||||
else
|
||||
@@ -689,13 +689,13 @@ int AT91F_MCI_Init(void)
|
||||
void AT91F_MCIDeviceWaitReady(unsigned int timeout)
|
||||
{
|
||||
volatile int status;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
status = AT91C_BASE_MCI->MCI_SR;
|
||||
timeout--;
|
||||
}
|
||||
while( !(status & AT91C_MCI_NOTBUSY) && (timeout>0) );
|
||||
while( !(status & AT91C_MCI_NOTBUSY) && (timeout>0) );
|
||||
}
|
||||
|
||||
unsigned int swab32(unsigned int data)
|
||||
@@ -725,7 +725,7 @@ int AT91F_MCI_ReadBlockSwab(
|
||||
|
||||
//* Read Block 1
|
||||
for(i=0;i<BUFFER_SIZE_MCI_DEVICE;i++)
|
||||
*buf++ = 0x00;
|
||||
*buf++ = 0x00;
|
||||
AT91F_MCI_ReadBlock(&MCI_Device,src,databuffer,sizeToRead);
|
||||
|
||||
//* Wait end of Read
|
||||
|
||||
@@ -34,13 +34,13 @@
|
||||
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
default-state = "on";
|
||||
};
|
||||
|
||||
|
||||
internet {
|
||||
function = LED_FUNCTION_WAN_ONLINE;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
|
||||
wan {
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
@@ -53,7 +53,7 @@
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
|
||||
lan2 {
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <2>;
|
||||
@@ -108,7 +108,7 @@
|
||||
reg = <0xff0000 0x010000>;
|
||||
read-only;
|
||||
|
||||
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
@@ -141,7 +141,7 @@
|
||||
};
|
||||
|
||||
&gpio {
|
||||
|
||||
|
||||
};
|
||||
|
||||
&builtin_switch {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
|
||||
buzzer {
|
||||
gpio-export,name = "buzzer";
|
||||
gpio-export,output = <1>;
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
watchdog {
|
||||
compatible = "linux,wdt-gpio";
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
reg = <1>;
|
||||
spi-max-frequency = <25000000>;
|
||||
status = "disabled";
|
||||
|
||||
|
||||
nand_partitions: partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
virtual_flash {
|
||||
compatible = "mtd-concat";
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
|
||||
nvmem-cells = <&calibration_wmac>, <&macaddr_uboot_3ff80 1>;
|
||||
nvmem-cell-names = "calibration", "mac-address";
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
|
||||
led_power_red: power-red {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
@@ -113,7 +113,7 @@
|
||||
*
|
||||
* We can not support this with OpenWrt, as this
|
||||
* would require us to influence the pinmux based on the CS.
|
||||
*
|
||||
*
|
||||
* We force-select Bank 1. Remember to blame Aruba for that.
|
||||
*/
|
||||
cs0_pin5: spi-cs0-pin5 {
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
watchdog {
|
||||
compatible = "linux,wdt-gpio";
|
||||
|
||||
|
||||
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
|
||||
hw_algo = "toggle";
|
||||
hw_margin_ms = <1200>;
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
ð0 {
|
||||
status = "okay";
|
||||
|
||||
|
||||
pll-data = <0x03000101 0x00000101 0x00001919>;
|
||||
|
||||
phy-mode = "sgmii";
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*
|
||||
LzmaDecode.c
|
||||
LZMA Decoder (optimized for Speed version)
|
||||
|
||||
|
||||
LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
|
||||
http://www.7-zip.org/
|
||||
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this Code, expressly permits you to
|
||||
statically or dynamically link your Code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked Code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this Code, expressly permits you to
|
||||
statically or dynamically link your Code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked Code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
|
||||
|
||||
#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
|
||||
@@ -57,9 +57,9 @@
|
||||
|
||||
#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
|
||||
{ UpdateBit0(p); mi <<= 1; A0; } else \
|
||||
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
|
||||
|
||||
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
|
||||
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
|
||||
|
||||
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
|
||||
|
||||
#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
|
||||
{ int i = numLevels; res = 1; \
|
||||
@@ -82,7 +82,7 @@
|
||||
#define LenLow (LenChoice2 + 1)
|
||||
#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
|
||||
#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
|
||||
|
||||
#define kNumStates 12
|
||||
@@ -168,7 +168,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
int lc = vs->Properties.lc;
|
||||
|
||||
#ifdef _LZMA_OUT_READ
|
||||
|
||||
|
||||
UInt32 Range = vs->Range;
|
||||
UInt32 Code = vs->Code;
|
||||
#ifdef _LZMA_IN_CB
|
||||
@@ -210,7 +210,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
|
||||
UInt32 i;
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
rep0 = rep1 = rep2 = rep3 = 1;
|
||||
state = 0;
|
||||
globalPos = 0;
|
||||
@@ -261,7 +261,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _LZMA_IN_CB
|
||||
RC_INIT;
|
||||
#else
|
||||
@@ -275,7 +275,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
CProb *prob;
|
||||
UInt32 bound;
|
||||
int posState = (int)(
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -287,9 +287,9 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
{
|
||||
int symbol = 1;
|
||||
UpdateBit0(prob)
|
||||
prob = p + Literal + (LZMA_LIT_SIZE *
|
||||
prob = p + Literal + (LZMA_LIT_SIZE *
|
||||
(((
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -338,7 +338,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
else if (state < 10) state -= 3;
|
||||
else state -= 6;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
UpdateBit1(prob);
|
||||
prob = p + IsRep + state;
|
||||
@@ -365,14 +365,14 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UInt32 pos;
|
||||
#endif
|
||||
UpdateBit0(prob);
|
||||
|
||||
|
||||
#ifdef _LZMA_OUT_READ
|
||||
if (distanceLimit == 0)
|
||||
#else
|
||||
if (nowPos == 0)
|
||||
#endif
|
||||
return LZMA_RESULT_DATA_ERROR;
|
||||
|
||||
|
||||
state = state < kNumLitStates ? 9 : 11;
|
||||
#ifdef _LZMA_OUT_READ
|
||||
pos = dictionaryPos - rep0;
|
||||
@@ -408,7 +408,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UpdateBit0(prob);
|
||||
distance = rep1;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
UpdateBit1(prob);
|
||||
prob = p + IsRepG2 + state;
|
||||
@@ -469,7 +469,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
int posSlot;
|
||||
state += kNumLitStates;
|
||||
prob = p + PosSlot +
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
kNumPosSlotBits);
|
||||
RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
|
||||
if (posSlot >= kStartPosModelIndex)
|
||||
@@ -524,7 +524,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
|
||||
len += kMatchMinLen;
|
||||
#ifdef _LZMA_OUT_READ
|
||||
if (rep0 > distanceLimit)
|
||||
if (rep0 > distanceLimit)
|
||||
#else
|
||||
if (rep0 > nowPos)
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
LzmaDecode.h
|
||||
LZMA Decoder interface
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
/* Use read function for output data */
|
||||
|
||||
/* #define _LZMA_PROB32 */
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
but memory usage will be doubled in that case */
|
||||
|
||||
/* #define _LZMA_LOC_OPT */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
LzmaTypes.h
|
||||
/*
|
||||
LzmaTypes.h
|
||||
|
||||
Types for LZMA Decoder
|
||||
|
||||
@@ -13,12 +13,12 @@ This file is part of LZMA SDK 4.40 (2006-05-01)
|
||||
#ifndef _7ZIP_BYTE_DEFINED
|
||||
#define _7ZIP_BYTE_DEFINED
|
||||
typedef unsigned char Byte;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _7ZIP_UINT16_DEFINED
|
||||
#define _7ZIP_UINT16_DEFINED
|
||||
typedef unsigned short UInt16;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _7ZIP_UINT32_DEFINED
|
||||
#define _7ZIP_UINT32_DEFINED
|
||||
@@ -27,7 +27,7 @@ typedef unsigned long UInt32;
|
||||
#else
|
||||
typedef unsigned int UInt32;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* #define _LZMA_NO_SYSTEM_SIZE_T */
|
||||
/* You can use it, if you don't want <stddef.h> */
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*
|
||||
LzmaDecode.c
|
||||
LZMA Decoder
|
||||
|
||||
|
||||
LZMA SDK 4.05 Copyright (c) 1999-2004 Igor Pavlov (2004-08-25)
|
||||
http://www.7-zip.org/
|
||||
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -89,7 +89,7 @@ void RangeDecoderInit(CRangeDecoder *rd,
|
||||
rd->Code = (rd->Code << 8) | ReadByte;
|
||||
}
|
||||
|
||||
#define RC_INIT_VAR UInt32 range = rd->Range; UInt32 code = rd->Code;
|
||||
#define RC_INIT_VAR UInt32 range = rd->Range; UInt32 code = rd->Code;
|
||||
#define RC_FLUSH_VAR rd->Range = range; rd->Code = code;
|
||||
#define RC_NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | ReadByte; }
|
||||
|
||||
@@ -157,7 +157,7 @@ int RangeDecoderBitDecode(CProb *prob, CRangeDecoder *rd)
|
||||
{ A1; range -= bound; code -= bound; *prob -= (*prob) >> kNumMoveBits; mi = (mi + mi) + 1; } \
|
||||
RC_NORMALIZE
|
||||
|
||||
#define RC_GET_BIT(prob, mi) RC_GET_BIT2(prob, mi, ; , ;)
|
||||
#define RC_GET_BIT(prob, mi) RC_GET_BIT2(prob, mi, ; , ;)
|
||||
|
||||
int RangeDecoderBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder *rd)
|
||||
{
|
||||
@@ -207,7 +207,7 @@ int RangeDecoderReverseBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder
|
||||
}
|
||||
|
||||
Byte LzmaLiteralDecode(CProb *probs, CRangeDecoder *rd)
|
||||
{
|
||||
{
|
||||
int symbol = 1;
|
||||
#ifdef _LZMA_LOC_OPT
|
||||
RC_INIT_VAR
|
||||
@@ -229,7 +229,7 @@ Byte LzmaLiteralDecode(CProb *probs, CRangeDecoder *rd)
|
||||
}
|
||||
|
||||
Byte LzmaLiteralDecodeMatch(CProb *probs, CRangeDecoder *rd, Byte matchByte)
|
||||
{
|
||||
{
|
||||
int symbol = 1;
|
||||
#ifdef _LZMA_LOC_OPT
|
||||
RC_INIT_VAR
|
||||
@@ -284,7 +284,7 @@ Byte LzmaLiteralDecodeMatch(CProb *probs, CRangeDecoder *rd, Byte matchByte)
|
||||
#define LenLow (LenChoice2 + 1)
|
||||
#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
|
||||
#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
|
||||
int LzmaLenDecode(CProb *p, CRangeDecoder *rd, int posState)
|
||||
{
|
||||
@@ -294,7 +294,7 @@ int LzmaLenDecode(CProb *p, CRangeDecoder *rd, int posState)
|
||||
if(RangeDecoderBitDecode(p + LenChoice2, rd) == 0)
|
||||
return kLenNumLowSymbols + RangeDecoderBitTreeDecode(p + LenMid +
|
||||
(posState << kLenNumMidBits), kLenNumMidBits, rd);
|
||||
return kLenNumLowSymbols + kLenNumMidSymbols +
|
||||
return kLenNumLowSymbols + kLenNumMidSymbols +
|
||||
RangeDecoderBitTreeDecode(p + LenHigh, kLenNumHighBits, rd);
|
||||
}
|
||||
|
||||
@@ -377,8 +377,8 @@ int LzmaDecoderInit(
|
||||
vs->RemainLen = 0;
|
||||
dictionary[dictionarySize - 1] = 0;
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
RangeDecoderInit(&vs->RangeDecoder,
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
RangeDecoderInit(&vs->RangeDecoder,
|
||||
#ifdef _LZMA_IN_CB
|
||||
inCallback
|
||||
#else
|
||||
@@ -388,7 +388,7 @@ int LzmaDecoderInit(
|
||||
return LZMA_RESULT_OK;
|
||||
}
|
||||
|
||||
int LzmaDecode(unsigned char *buffer,
|
||||
int LzmaDecode(unsigned char *buffer,
|
||||
unsigned char *outStream, UInt32 outSize,
|
||||
UInt32 *outSizeProcessed)
|
||||
{
|
||||
@@ -458,8 +458,8 @@ int LzmaDecode(
|
||||
if (bufferSize < numProbs * sizeof(CProb))
|
||||
return LZMA_RESULT_NOT_ENOUGH_MEM;
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
RangeDecoderInit(&rd,
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
RangeDecoderInit(&rd,
|
||||
#ifdef _LZMA_IN_CB
|
||||
inCallback
|
||||
#else
|
||||
@@ -472,7 +472,7 @@ int LzmaDecode(
|
||||
while(nowPos < outSize)
|
||||
{
|
||||
int posState = (int)(
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -486,9 +486,9 @@ int LzmaDecode(
|
||||
return LZMA_RESULT_DATA_ERROR;
|
||||
if (RangeDecoderBitDecode(p + IsMatch + (state << kNumPosBitsMax) + posState, &rd) == 0)
|
||||
{
|
||||
CProb *probs = p + Literal + (LZMA_LIT_SIZE *
|
||||
CProb *probs = p + Literal + (LZMA_LIT_SIZE *
|
||||
(((
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -521,7 +521,7 @@ int LzmaDecode(
|
||||
dictionaryPos = 0;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
previousIsMatch = 1;
|
||||
if (RangeDecoderBitDecode(p + IsRep + state, &rd) == 1)
|
||||
@@ -534,7 +534,7 @@ int LzmaDecode(
|
||||
UInt32 pos;
|
||||
#endif
|
||||
if (
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -562,7 +562,7 @@ int LzmaDecode(
|
||||
UInt32 distance;
|
||||
if(RangeDecoderBitDecode(p + IsRepG1 + state, &rd) == 0)
|
||||
distance = rep1;
|
||||
else
|
||||
else
|
||||
{
|
||||
if(RangeDecoderBitDecode(p + IsRepG2 + state, &rd) == 0)
|
||||
distance = rep2;
|
||||
@@ -588,7 +588,7 @@ int LzmaDecode(
|
||||
state = state < 7 ? 7 : 10;
|
||||
len = LzmaLenDecode(p + LenCoder, &rd, posState);
|
||||
posSlot = RangeDecoderBitTreeDecode(p + PosSlot +
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
kNumPosSlotBits), kNumPosSlotBits, &rd);
|
||||
if (posSlot >= kStartPosModelIndex)
|
||||
{
|
||||
@@ -601,7 +601,7 @@ int LzmaDecode(
|
||||
}
|
||||
else
|
||||
{
|
||||
rep0 += RangeDecoderDecodeDirectBits(&rd,
|
||||
rep0 += RangeDecoderDecodeDirectBits(&rd,
|
||||
numDirectBits - kNumAlignBits) << kNumAlignBits;
|
||||
rep0 += RangeDecoderReverseBitTreeDecode(p + Align, kNumAlignBits, &rd);
|
||||
}
|
||||
@@ -616,7 +616,7 @@ int LzmaDecode(
|
||||
len = -1;
|
||||
break;
|
||||
}
|
||||
if (rep0 > nowPos
|
||||
if (rep0 > nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
LzmaDecode.h
|
||||
LZMA Decoder interface
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
/* Use read function for output data */
|
||||
|
||||
/* #define _LZMA_PROB32 */
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
but memory usage will be doubled in that case */
|
||||
|
||||
/* #define _LZMA_LOC_OPT */
|
||||
@@ -63,10 +63,10 @@ typedef struct _ILzmaInCallback
|
||||
#define LZMA_BASE_SIZE 1846
|
||||
#define LZMA_LIT_SIZE 768
|
||||
|
||||
/*
|
||||
/*
|
||||
bufferSize = (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)))* sizeof(CProb)
|
||||
bufferSize += 100 in case of _LZMA_OUT_READ
|
||||
by default CProb is unsigned short,
|
||||
by default CProb is unsigned short,
|
||||
but if specify _LZMA_PROB_32, CProb will be UInt32(unsigned int)
|
||||
*/
|
||||
|
||||
@@ -84,7 +84,7 @@ int LzmaDecoderInit(
|
||||
#endif
|
||||
|
||||
int LzmaDecode(
|
||||
unsigned char *buffer,
|
||||
unsigned char *buffer,
|
||||
#ifndef _LZMA_OUT_READ
|
||||
UInt32 bufferSize,
|
||||
int lc, int lp, int pb,
|
||||
|
||||
@@ -106,10 +106,10 @@ static int read_byte(void *object, unsigned char **buffer, UInt32 *bufferSize)
|
||||
val = *(unsigned int *)data;
|
||||
data += 4;
|
||||
}
|
||||
|
||||
|
||||
*bufferSize = 1;
|
||||
*buffer = ((unsigned char *)&val) + (offset++ & 3);
|
||||
|
||||
|
||||
return LZMA_RESULT_OK;
|
||||
}
|
||||
|
||||
@@ -117,12 +117,12 @@ static __inline__ unsigned char get_byte(void)
|
||||
{
|
||||
unsigned char *buffer;
|
||||
UInt32 fake;
|
||||
|
||||
|
||||
return read_byte(0, &buffer, &fake), *buffer;
|
||||
}
|
||||
|
||||
/* should be the first function */
|
||||
void entry(unsigned long icache_size, unsigned long icache_lsize,
|
||||
void entry(unsigned long icache_size, unsigned long icache_lsize,
|
||||
unsigned long dcache_size, unsigned long dcache_lsize,
|
||||
unsigned long fw_arg0, unsigned long fw_arg1,
|
||||
unsigned long fw_arg2, unsigned long fw_arg3)
|
||||
@@ -145,7 +145,7 @@ void entry(unsigned long icache_size, unsigned long icache_lsize,
|
||||
if (((struct trx_header *)data)->magic == EDIMAX_PS_HEADER_MAGIC)
|
||||
data += EDIMAX_PS_HEADER_LEN;
|
||||
/* compressed kernel is in the partition 0 or 1 */
|
||||
if (((struct trx_header *)data)->offsets[1] > 65536)
|
||||
if (((struct trx_header *)data)->offsets[1] > 65536)
|
||||
data += ((struct trx_header *)data)->offsets[0];
|
||||
else
|
||||
data += ((struct trx_header *)data)->offsets[1];
|
||||
@@ -168,7 +168,7 @@ void entry(unsigned long icache_size, unsigned long icache_lsize,
|
||||
((unsigned int)get_byte() << 24);
|
||||
|
||||
/* skip rest of the header (upper half of uncompressed size) */
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < 4; i++)
|
||||
get_byte();
|
||||
|
||||
/* decompress kernel */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
keys {
|
||||
compatible = "gpio-keys-polled";
|
||||
poll-interval = <100>;
|
||||
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
|
||||
@@ -180,7 +180,7 @@
|
||||
&pinctrl {
|
||||
pinctrl_leds: leds {
|
||||
function = "led";
|
||||
pins = "gpio1", "gpio8",
|
||||
pins = "gpio1", "gpio8",
|
||||
"gpio9", "gpio10",
|
||||
"gpio11", "gpio12",
|
||||
"gpio14", "gpio15",
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
led-running = &led_power_green;
|
||||
led-upgrade = &led_power_green;
|
||||
};
|
||||
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys-polled";
|
||||
poll-interval = <100>;
|
||||
|
||||
|
||||
wlan {
|
||||
label = "wlan";
|
||||
gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
|
||||
@@ -38,7 +38,7 @@
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
bcm43217-sprom {
|
||||
compatible = "brcm,bcma-sprom";
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
function = LED_FUNCTION_USB;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
};
|
||||
|
||||
|
||||
led@16 {
|
||||
reg = <16>;
|
||||
active-low;
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
&leds {
|
||||
status = "okay";
|
||||
|
||||
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_leds>;
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
|
||||
nvmem-cells = <&macaddr_cfe_6a0 1>, <&cal_data_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
|
||||
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
};
|
||||
|
||||
@@ -1610,7 +1610,7 @@ static int bcm6348_emac_probe(struct platform_device *pdev)
|
||||
GFP_KERNEL);
|
||||
if (IS_ERR_OR_NULL(emac->reset))
|
||||
return PTR_ERR(emac->reset);
|
||||
|
||||
|
||||
}
|
||||
for (i = 0; i < emac->num_resets; i++) {
|
||||
emac->reset[i] = devm_reset_control_get_by_index(dev, i);
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*
|
||||
LzmaDecode.c
|
||||
LZMA Decoder (optimized for Speed version)
|
||||
|
||||
|
||||
LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
|
||||
http://www.7-zip.org/
|
||||
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this Code, expressly permits you to
|
||||
statically or dynamically link your Code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked Code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this Code, expressly permits you to
|
||||
statically or dynamically link your Code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked Code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
|
||||
|
||||
#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
|
||||
@@ -57,9 +57,9 @@
|
||||
|
||||
#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
|
||||
{ UpdateBit0(p); mi <<= 1; A0; } else \
|
||||
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
|
||||
|
||||
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
|
||||
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
|
||||
|
||||
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
|
||||
|
||||
#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
|
||||
{ int i = numLevels; res = 1; \
|
||||
@@ -82,7 +82,7 @@
|
||||
#define LenLow (LenChoice2 + 1)
|
||||
#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
|
||||
#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
|
||||
|
||||
#define kNumStates 12
|
||||
@@ -168,7 +168,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
int lc = vs->Properties.lc;
|
||||
|
||||
#ifdef _LZMA_OUT_READ
|
||||
|
||||
|
||||
UInt32 Range = vs->Range;
|
||||
UInt32 Code = vs->Code;
|
||||
#ifdef _LZMA_IN_CB
|
||||
@@ -210,7 +210,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
|
||||
UInt32 i;
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
rep0 = rep1 = rep2 = rep3 = 1;
|
||||
state = 0;
|
||||
globalPos = 0;
|
||||
@@ -261,7 +261,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _LZMA_IN_CB
|
||||
RC_INIT;
|
||||
#else
|
||||
@@ -275,7 +275,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
CProb *prob;
|
||||
UInt32 bound;
|
||||
int posState = (int)(
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -287,9 +287,9 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
{
|
||||
int symbol = 1;
|
||||
UpdateBit0(prob)
|
||||
prob = p + Literal + (LZMA_LIT_SIZE *
|
||||
prob = p + Literal + (LZMA_LIT_SIZE *
|
||||
(((
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -338,7 +338,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
else if (state < 10) state -= 3;
|
||||
else state -= 6;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
UpdateBit1(prob);
|
||||
prob = p + IsRep + state;
|
||||
@@ -365,14 +365,14 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UInt32 pos;
|
||||
#endif
|
||||
UpdateBit0(prob);
|
||||
|
||||
|
||||
#ifdef _LZMA_OUT_READ
|
||||
if (distanceLimit == 0)
|
||||
#else
|
||||
if (nowPos == 0)
|
||||
#endif
|
||||
return LZMA_RESULT_DATA_ERROR;
|
||||
|
||||
|
||||
state = state < kNumLitStates ? 9 : 11;
|
||||
#ifdef _LZMA_OUT_READ
|
||||
pos = dictionaryPos - rep0;
|
||||
@@ -408,7 +408,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UpdateBit0(prob);
|
||||
distance = rep1;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
UpdateBit1(prob);
|
||||
prob = p + IsRepG2 + state;
|
||||
@@ -469,7 +469,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
int posSlot;
|
||||
state += kNumLitStates;
|
||||
prob = p + PosSlot +
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
kNumPosSlotBits);
|
||||
RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
|
||||
if (posSlot >= kStartPosModelIndex)
|
||||
@@ -524,7 +524,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
|
||||
len += kMatchMinLen;
|
||||
#ifdef _LZMA_OUT_READ
|
||||
if (rep0 > distanceLimit)
|
||||
if (rep0 > distanceLimit)
|
||||
#else
|
||||
if (rep0 > nowPos)
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
LzmaDecode.h
|
||||
LZMA Decoder interface
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
/* Use read function for output data */
|
||||
|
||||
/* #define _LZMA_PROB32 */
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
but memory usage will be doubled in that case */
|
||||
|
||||
/* #define _LZMA_LOC_OPT */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
LzmaTypes.h
|
||||
/*
|
||||
LzmaTypes.h
|
||||
|
||||
Types for LZMA Decoder
|
||||
|
||||
@@ -13,12 +13,12 @@ This file is part of LZMA SDK 4.40 (2006-05-01)
|
||||
#ifndef _7ZIP_BYTE_DEFINED
|
||||
#define _7ZIP_BYTE_DEFINED
|
||||
typedef unsigned char Byte;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _7ZIP_UINT16_DEFINED
|
||||
#define _7ZIP_UINT16_DEFINED
|
||||
typedef unsigned short UInt16;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _7ZIP_UINT32_DEFINED
|
||||
#define _7ZIP_UINT32_DEFINED
|
||||
@@ -27,7 +27,7 @@ typedef unsigned long UInt32;
|
||||
#else
|
||||
typedef unsigned int UInt32;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* #define _LZMA_NO_SYSTEM_SIZE_T */
|
||||
/* You can use it, if you don't want <stddef.h> */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Paweł Dembicki <paweldembicki@gmail.com>
|
||||
* Copyright (C) 2018 Paweł Dembicki <paweldembicki@gmail.com>
|
||||
*
|
||||
* Based on: mtdsplit_uimage.c
|
||||
* Copyright (C) 2013 Gabor Juhos <juhosg@openwrt.org>
|
||||
|
||||
@@ -84,7 +84,7 @@ struct adm6996_priv {
|
||||
u16 vlan_id[ADM_NUM_VLANS];
|
||||
u8 vlan_table[ADM_NUM_VLANS]; /* bitmap, 1 = port is member */
|
||||
u8 vlan_tagged[ADM_NUM_VLANS]; /* bitmap, 1 = tagged member */
|
||||
|
||||
|
||||
struct mutex mib_lock;
|
||||
char buf[2048];
|
||||
|
||||
@@ -805,12 +805,12 @@ adm6996_get_port_link(struct switch_dev *dev, int port,
|
||||
struct switch_port_link *link)
|
||||
{
|
||||
struct adm6996_priv *priv = to_adm(dev);
|
||||
|
||||
|
||||
u16 reg = 0;
|
||||
|
||||
|
||||
if (port >= ADM_NUM_PORTS)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
switch (port) {
|
||||
case 0:
|
||||
reg = r16(priv, ADM_PS0);
|
||||
@@ -838,7 +838,7 @@ adm6996_get_port_link(struct switch_dev *dev, int port,
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
link->link = reg & ADM_PS_LS;
|
||||
if (!link->link)
|
||||
return 0;
|
||||
@@ -1003,9 +1003,9 @@ static int adm6996_switch_init(struct adm6996_priv *priv, const char *alias, str
|
||||
w16(priv, ADM_VID_CHECK, test);
|
||||
test ^= r16(priv, ADM_VID_CHECK);
|
||||
if (test & (1 << 12)) {
|
||||
/*
|
||||
* Bit 12 of this register is read-only.
|
||||
* This is the FC model.
|
||||
/*
|
||||
* Bit 12 of this register is read-only.
|
||||
* This is the FC model.
|
||||
*/
|
||||
priv->model = ADM6996FC;
|
||||
} else {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* under the terms of the GNU General Public License v2 as published by the
|
||||
* Free Software Foundation.
|
||||
*
|
||||
* The switch programming done in this driver follows the
|
||||
* The switch programming done in this driver follows the
|
||||
* "Ethernet Traffic Separation using VLAN" Application Note as
|
||||
* published by Lantiq.
|
||||
*/
|
||||
|
||||
@@ -587,7 +587,7 @@ rtl_attr_get_port_int(struct switch_dev *dev, const struct switch_attr *attr, st
|
||||
return rtl_attr_get_int(dev, attr, val);
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
rtl_get_port_link(struct switch_dev *dev, int port, struct switch_port_link *link)
|
||||
{
|
||||
if (port >= RTL8306_NUM_PORTS)
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*
|
||||
LzmaDecode.c
|
||||
LZMA Decoder (optimized for Speed version)
|
||||
|
||||
|
||||
LZMA SDK 4.22 Copyright (c) 1999-2005 Igor Pavlov (2005-06-10)
|
||||
http://www.7-zip.org/
|
||||
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this Code, expressly permits you to
|
||||
statically or dynamically link your Code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked Code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this Code, expressly permits you to
|
||||
statically or dynamically link your Code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked Code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
|
||||
|
||||
#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
|
||||
@@ -61,9 +61,9 @@
|
||||
|
||||
#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
|
||||
{ UpdateBit0(p); mi <<= 1; A0; } else \
|
||||
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
|
||||
|
||||
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
|
||||
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
|
||||
|
||||
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
|
||||
|
||||
#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
|
||||
{ int i = numLevels; res = 1; \
|
||||
@@ -86,7 +86,7 @@
|
||||
#define LenLow (LenChoice2 + 1)
|
||||
#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
|
||||
#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
|
||||
|
||||
#define kNumStates 12
|
||||
@@ -174,7 +174,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
int lc = vs->Properties.lc;
|
||||
|
||||
#ifdef _LZMA_OUT_READ
|
||||
|
||||
|
||||
UInt32 Range = vs->Range;
|
||||
UInt32 Code = vs->Code;
|
||||
#ifdef _LZMA_IN_CB
|
||||
@@ -216,7 +216,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
|
||||
UInt32 i;
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
rep0 = rep1 = rep2 = rep3 = 1;
|
||||
state = 0;
|
||||
globalPos = 0;
|
||||
@@ -267,7 +267,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _LZMA_IN_CB
|
||||
RC_INIT;
|
||||
#else
|
||||
@@ -281,7 +281,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
CProb *prob;
|
||||
UInt32 bound;
|
||||
int posState = (int)(
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -293,9 +293,9 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
{
|
||||
int symbol = 1;
|
||||
UpdateBit0(prob)
|
||||
prob = p + Literal + (LZMA_LIT_SIZE *
|
||||
prob = p + Literal + (LZMA_LIT_SIZE *
|
||||
(((
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -344,7 +344,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
else if (state < 10) state -= 3;
|
||||
else state -= 6;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
UpdateBit1(prob);
|
||||
prob = p + IsRep + state;
|
||||
@@ -371,14 +371,14 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UInt32 pos;
|
||||
#endif
|
||||
UpdateBit0(prob);
|
||||
|
||||
|
||||
#ifdef _LZMA_OUT_READ
|
||||
if (distanceLimit == 0)
|
||||
#else
|
||||
if (nowPos == 0)
|
||||
#endif
|
||||
return LZMA_RESULT_DATA_ERROR;
|
||||
|
||||
|
||||
state = state < kNumLitStates ? 9 : 11;
|
||||
#ifdef _LZMA_OUT_READ
|
||||
pos = dictionaryPos - rep0;
|
||||
@@ -414,7 +414,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UpdateBit0(prob);
|
||||
distance = rep1;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
UpdateBit1(prob);
|
||||
prob = p + IsRepG2 + state;
|
||||
@@ -475,7 +475,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
int posSlot;
|
||||
state += kNumLitStates;
|
||||
prob = p + PosSlot +
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
kNumPosSlotBits);
|
||||
RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
|
||||
if (posSlot >= kStartPosModelIndex)
|
||||
@@ -530,7 +530,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
|
||||
len += kMatchMinLen;
|
||||
#ifdef _LZMA_OUT_READ
|
||||
if (rep0 > distanceLimit)
|
||||
if (rep0 > distanceLimit)
|
||||
#else
|
||||
if (rep0 > nowPos)
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
LzmaDecode.h
|
||||
LZMA Decoder interface
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
/* Use read function for output data */
|
||||
|
||||
/* #define _LZMA_PROB32 */
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
but memory usage will be doubled in that case */
|
||||
|
||||
/* #define _LZMA_LOC_OPT */
|
||||
|
||||
@@ -92,11 +92,11 @@ static __inline__ unsigned char get_byte(void)
|
||||
{
|
||||
unsigned char *buffer;
|
||||
UInt32 fake;
|
||||
|
||||
|
||||
return read_byte(0, &buffer, &fake), *buffer;
|
||||
}
|
||||
|
||||
/* This puts lzma workspace 128k below RAM end.
|
||||
/* This puts lzma workspace 128k below RAM end.
|
||||
* That should be enough for both lzma and stack
|
||||
*/
|
||||
static char *buffer = (char *)(RAMSTART + RAMSIZE - 0x00020000);
|
||||
@@ -104,7 +104,7 @@ extern char lzma_start[];
|
||||
extern char lzma_end[];
|
||||
|
||||
/* should be the first function */
|
||||
void entry(unsigned long icache_size, unsigned long icache_lsize,
|
||||
void entry(unsigned long icache_size, unsigned long icache_lsize,
|
||||
unsigned long dcache_size, unsigned long dcache_lsize)
|
||||
{
|
||||
unsigned int i; /* temp value */
|
||||
@@ -141,7 +141,7 @@ void entry(unsigned long icache_size, unsigned long icache_lsize,
|
||||
((unsigned int)get_byte() << 24);
|
||||
|
||||
/* skip rest of the header (upper half of uncompressed size) */
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < 4; i++)
|
||||
get_byte();
|
||||
|
||||
/* decompress kernel */
|
||||
|
||||
@@ -27,9 +27,9 @@ static const char theFatalMsg[] = "fatal error in lp_Print!";
|
||||
* A low level printf() function.
|
||||
*/
|
||||
void
|
||||
lp_Print(void (*output)(void *, char *, int),
|
||||
lp_Print(void (*output)(void *, char *, int),
|
||||
void * arg,
|
||||
char *fmt,
|
||||
char *fmt,
|
||||
va_list ap)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ lp_Print(void (*output)(void *, char *, int),
|
||||
(*output)(arg, s, l); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
char buf[LP_MAX_BUF];
|
||||
|
||||
char c;
|
||||
@@ -57,7 +57,7 @@ lp_Print(void (*output)(void *, char *, int),
|
||||
int length;
|
||||
|
||||
for(;;) {
|
||||
{
|
||||
{
|
||||
/* scan for the next '%' */
|
||||
char *fmtStart = fmt;
|
||||
while ( (*fmt != '\0') && (*fmt != '%')) {
|
||||
@@ -73,7 +73,7 @@ lp_Print(void (*output)(void *, char *, int),
|
||||
|
||||
/* we found a '%' */
|
||||
fmt ++;
|
||||
|
||||
|
||||
/* check for long */
|
||||
if (*fmt == 'l') {
|
||||
longFlag = 1;
|
||||
@@ -119,9 +119,9 @@ lp_Print(void (*output)(void *, char *, int),
|
||||
negFlag = 0;
|
||||
switch (*fmt) {
|
||||
case 'b':
|
||||
if (longFlag) {
|
||||
num = va_arg(ap, long int);
|
||||
} else {
|
||||
if (longFlag) {
|
||||
num = va_arg(ap, long int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
}
|
||||
length = PrintNum(buf, num, 2, 0, width, ladjust, padc, 0);
|
||||
@@ -130,10 +130,10 @@ lp_Print(void (*output)(void *, char *, int),
|
||||
|
||||
case 'd':
|
||||
case 'D':
|
||||
if (longFlag) {
|
||||
if (longFlag) {
|
||||
num = va_arg(ap, long int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
}
|
||||
if (num < 0) {
|
||||
num = - num;
|
||||
@@ -145,10 +145,10 @@ lp_Print(void (*output)(void *, char *, int),
|
||||
|
||||
case 'o':
|
||||
case 'O':
|
||||
if (longFlag) {
|
||||
if (longFlag) {
|
||||
num = va_arg(ap, long int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
}
|
||||
length = PrintNum(buf, num, 8, 0, width, ladjust, padc, 0);
|
||||
OUTPUT(arg, buf, length);
|
||||
@@ -156,30 +156,30 @@ lp_Print(void (*output)(void *, char *, int),
|
||||
|
||||
case 'u':
|
||||
case 'U':
|
||||
if (longFlag) {
|
||||
if (longFlag) {
|
||||
num = va_arg(ap, long int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
}
|
||||
length = PrintNum(buf, num, 10, 0, width, ladjust, padc, 0);
|
||||
OUTPUT(arg, buf, length);
|
||||
break;
|
||||
|
||||
|
||||
case 'x':
|
||||
if (longFlag) {
|
||||
if (longFlag) {
|
||||
num = va_arg(ap, long int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
}
|
||||
length = PrintNum(buf, num, 16, 0, width, ladjust, padc, 0);
|
||||
OUTPUT(arg, buf, length);
|
||||
break;
|
||||
|
||||
case 'X':
|
||||
if (longFlag) {
|
||||
if (longFlag) {
|
||||
num = va_arg(ap, long int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
} else {
|
||||
num = va_arg(ap, int);
|
||||
}
|
||||
length = PrintNum(buf, num, 16, 0, width, ladjust, padc, 1);
|
||||
OUTPUT(arg, buf, length);
|
||||
@@ -219,7 +219,7 @@ int
|
||||
PrintChar(char * buf, char c, int length, int ladjust)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
if (length < 1) length = 1;
|
||||
if (ladjust) {
|
||||
*buf = c;
|
||||
@@ -251,7 +251,7 @@ PrintString(char * buf, char* s, int length, int ladjust)
|
||||
}
|
||||
|
||||
int
|
||||
PrintNum(char * buf, unsigned long u, int base, int negFlag,
|
||||
PrintNum(char * buf, unsigned long u, int base, int negFlag,
|
||||
int length, int ladjust, char padc, int upcase)
|
||||
{
|
||||
/* algorithm :
|
||||
@@ -298,7 +298,7 @@ PrintNum(char * buf, unsigned long u, int base, int negFlag,
|
||||
} else {
|
||||
for (i = actualLength; i< length; i++) buf[i] = padc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* prepare to reverse the string */
|
||||
{
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
* output function cannot assume the buffer is null-terminated after
|
||||
* l number of chars.
|
||||
*/
|
||||
void lp_Print(void (*output)(void *, char *, int),
|
||||
void lp_Print(void (*output)(void *, char *, int),
|
||||
void * arg,
|
||||
char *fmt,
|
||||
char *fmt,
|
||||
va_list ap);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,7 +19,7 @@ static void myoutput(void *arg, char *s, int l)
|
||||
|
||||
// special termination call
|
||||
if ((l==1) && (s[0] == '\0')) return;
|
||||
|
||||
|
||||
for (i=0; i< l; i++) {
|
||||
Uart16550Put(s[i]);
|
||||
if (s[i] == '\n') Uart16550Put('\r');
|
||||
|
||||
@@ -52,12 +52,12 @@ void Uart16550Init(uint32 baud, uint8 data, uint8 parity, uint8 stop)
|
||||
UART16550_WRITE(OFS_INTR_ENABLE, 0);
|
||||
|
||||
/* set up buad rate */
|
||||
{
|
||||
{
|
||||
uint32 divisor;
|
||||
|
||||
|
||||
/* set DIAB bit */
|
||||
UART16550_WRITE(OFS_LINE_CONTROL, 0x80);
|
||||
|
||||
|
||||
/* set divisor */
|
||||
divisor = MAX_BAUD / baud;
|
||||
UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff);
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
reg = <0x1957000 0x100>;
|
||||
qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -320,7 +320,7 @@
|
||||
label = "boarddata1";
|
||||
reg = <0x00d00000 0x00080000>;
|
||||
read-only;
|
||||
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
gpios = <&qcom_pinmux 56 GPIO_ACTIVE_LOW>;
|
||||
@@ -157,7 +157,7 @@
|
||||
pins = "gpio6", "gpio7";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
usb_pwr_en_pins: usb_pwr_en_pins {
|
||||
mux {
|
||||
pins = "gpio22";
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
gpios = <&qcom_pinmux 22 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_orange: power_orange {
|
||||
led_power_orange: power_orange {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_ORANGE>;
|
||||
gpios = <&qcom_pinmux 23 GPIO_ACTIVE_LOW>;
|
||||
@@ -304,7 +304,7 @@
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
|
||||
ubi@0 {
|
||||
label = "ubi";
|
||||
reg = <0x0000000 0x20000000>;
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
};
|
||||
phy13: ethernet-phy@13 {
|
||||
reg = <0x13>;
|
||||
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
@@ -32,23 +32,23 @@
|
||||
nvmem-cell-names = "mac-address";
|
||||
|
||||
brcm,sprom = "brcm/bcm43222-sprom.bin";
|
||||
brcm,sprom-fixups = <2 0x04d2>,
|
||||
brcm,sprom-fixups = <2 0x04d2>,
|
||||
<65 0x1308>, <68 0x0402>,
|
||||
<70 0x1cc6>, <71 0x3c49>,
|
||||
<72 0x1132>, <87 0x0315>,
|
||||
<88 0x0315>, <96 0x2048>,
|
||||
<97 0xfeed>, <98 0x153e>,
|
||||
<99 0xfb1f>, <100 0x3e54>,
|
||||
<101 0x3848>, <102 0xfea0>,
|
||||
<101 0x3848>, <102 0xfea0>,
|
||||
<103 0x145c>, <104 0xfaf0>,
|
||||
<105 0xfe6e>, <106 0x110c>,
|
||||
<107 0xfb7e>, <108 0xff00>,
|
||||
<109 0x13c4>, <110 0xfb30>,
|
||||
<111 0x0000>, <112 0x204c>,
|
||||
<113 0xfeb8>, <114 0x1508>,
|
||||
<109 0x13c4>, <110 0xfb30>,
|
||||
<111 0x0000>, <112 0x204c>,
|
||||
<113 0xfeb8>, <114 0x1508>,
|
||||
<115 0xfacb>, <116 0x3e48>,
|
||||
<117 0x3848>, <118 0xfeb2>,
|
||||
<119 0x156e>, <120 0xfabf>,
|
||||
<117 0x3848>, <118 0xfeb2>,
|
||||
<119 0x156e>, <120 0xfabf>,
|
||||
<121 0xfe57>, <122 0x1139>,
|
||||
<123 0xfb6d>, <124 0xff38>,
|
||||
<125 0x13ee>, <126 0xfb6d>,
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*
|
||||
LzmaDecode.c
|
||||
LZMA Decoder (optimized for Speed version)
|
||||
|
||||
|
||||
LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
|
||||
http://www.7-zip.org/
|
||||
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this Code, expressly permits you to
|
||||
statically or dynamically link your Code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked Code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this Code, expressly permits you to
|
||||
statically or dynamically link your Code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked Code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
|
||||
|
||||
#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
|
||||
@@ -57,9 +57,9 @@
|
||||
|
||||
#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
|
||||
{ UpdateBit0(p); mi <<= 1; A0; } else \
|
||||
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
|
||||
|
||||
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
|
||||
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
|
||||
|
||||
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
|
||||
|
||||
#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
|
||||
{ int i = numLevels; res = 1; \
|
||||
@@ -82,7 +82,7 @@
|
||||
#define LenLow (LenChoice2 + 1)
|
||||
#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
|
||||
#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
|
||||
|
||||
#define kNumStates 12
|
||||
@@ -168,7 +168,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
int lc = vs->Properties.lc;
|
||||
|
||||
#ifdef _LZMA_OUT_READ
|
||||
|
||||
|
||||
UInt32 Range = vs->Range;
|
||||
UInt32 Code = vs->Code;
|
||||
#ifdef _LZMA_IN_CB
|
||||
@@ -210,7 +210,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
|
||||
UInt32 i;
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
rep0 = rep1 = rep2 = rep3 = 1;
|
||||
state = 0;
|
||||
globalPos = 0;
|
||||
@@ -261,7 +261,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _LZMA_IN_CB
|
||||
RC_INIT;
|
||||
#else
|
||||
@@ -275,7 +275,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
CProb *prob;
|
||||
UInt32 bound;
|
||||
int posState = (int)(
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -287,9 +287,9 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
{
|
||||
int symbol = 1;
|
||||
UpdateBit0(prob)
|
||||
prob = p + Literal + (LZMA_LIT_SIZE *
|
||||
prob = p + Literal + (LZMA_LIT_SIZE *
|
||||
(((
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -338,7 +338,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
else if (state < 10) state -= 3;
|
||||
else state -= 6;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
UpdateBit1(prob);
|
||||
prob = p + IsRep + state;
|
||||
@@ -365,14 +365,14 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UInt32 pos;
|
||||
#endif
|
||||
UpdateBit0(prob);
|
||||
|
||||
|
||||
#ifdef _LZMA_OUT_READ
|
||||
if (distanceLimit == 0)
|
||||
#else
|
||||
if (nowPos == 0)
|
||||
#endif
|
||||
return LZMA_RESULT_DATA_ERROR;
|
||||
|
||||
|
||||
state = state < kNumLitStates ? 9 : 11;
|
||||
#ifdef _LZMA_OUT_READ
|
||||
pos = dictionaryPos - rep0;
|
||||
@@ -408,7 +408,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UpdateBit0(prob);
|
||||
distance = rep1;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
UpdateBit1(prob);
|
||||
prob = p + IsRepG2 + state;
|
||||
@@ -469,7 +469,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
int posSlot;
|
||||
state += kNumLitStates;
|
||||
prob = p + PosSlot +
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
kNumPosSlotBits);
|
||||
RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
|
||||
if (posSlot >= kStartPosModelIndex)
|
||||
@@ -524,7 +524,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
|
||||
len += kMatchMinLen;
|
||||
#ifdef _LZMA_OUT_READ
|
||||
if (rep0 > distanceLimit)
|
||||
if (rep0 > distanceLimit)
|
||||
#else
|
||||
if (rep0 > nowPos)
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
LzmaDecode.h
|
||||
LZMA Decoder interface
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
/* Use read function for output data */
|
||||
|
||||
/* #define _LZMA_PROB32 */
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
but memory usage will be doubled in that case */
|
||||
|
||||
/* #define _LZMA_LOC_OPT */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
LzmaTypes.h
|
||||
/*
|
||||
LzmaTypes.h
|
||||
|
||||
Types for LZMA Decoder
|
||||
|
||||
@@ -13,12 +13,12 @@ This file is part of LZMA SDK 4.40 (2006-05-01)
|
||||
#ifndef _7ZIP_BYTE_DEFINED
|
||||
#define _7ZIP_BYTE_DEFINED
|
||||
typedef unsigned char Byte;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _7ZIP_UINT16_DEFINED
|
||||
#define _7ZIP_UINT16_DEFINED
|
||||
typedef unsigned short UInt16;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _7ZIP_UINT32_DEFINED
|
||||
#define _7ZIP_UINT32_DEFINED
|
||||
@@ -27,7 +27,7 @@ typedef unsigned long UInt32;
|
||||
#else
|
||||
typedef unsigned int UInt32;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* #define _LZMA_NO_SYSTEM_SIZE_T */
|
||||
/* You can use it, if you don't want <stddef.h> */
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
label = "Factory";
|
||||
reg = <0x50000 0x10000>;
|
||||
read-only;
|
||||
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
#nvmem-cell-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
partition@69c0000 {
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
reg = <0x380000 0x200000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
|
||||
partition@580000 {
|
||||
label = "ubi";
|
||||
reg = <0x580000 0x7a80000>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
|
||||
slot0: pcie@0,0 {
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
#address-cells = <0x03>;
|
||||
#address-cells = <0x03>;
|
||||
#size-cells = <0x02>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory: eeprom@0 {
|
||||
|
||||
@@ -262,7 +262,7 @@ void rtk_hal_dump_table(void)
|
||||
printk(" %2d", l2_data.fid);
|
||||
printk(" %4d", l2_data.cvid);
|
||||
printk(" %02x%02x%02x%02x%02x%02x\n", l2_data.mac.octet[0],
|
||||
l2_data.mac.octet[1], l2_data.mac.octet[2], l2_data.mac.octet[3],
|
||||
l2_data.mac.octet[1], l2_data.mac.octet[2], l2_data.mac.octet[3],
|
||||
l2_data.mac.octet[4], l2_data.mac.octet[5]);
|
||||
address ++;
|
||||
}
|
||||
@@ -523,7 +523,7 @@ void rtk_hal_qos_get_table2type(struct ra_switch_ioctl_data *data)
|
||||
void rtk_hal_qos_set_port2table(struct ra_switch_ioctl_data *data)
|
||||
{
|
||||
rtk_api_ret_t ret;
|
||||
|
||||
|
||||
ret = rtk_qos_portPriSelIndex_set(data->port, data->qos_table_idx);
|
||||
if (ret != 0)
|
||||
printk("rtk_qos_portPriSelIndex_set failed\n");
|
||||
@@ -533,7 +533,7 @@ void rtk_hal_qos_get_port2table(struct ra_switch_ioctl_data *data)
|
||||
{
|
||||
rtk_api_ret_t ret;
|
||||
rtk_qos_priDecTbl_t Index;
|
||||
|
||||
|
||||
ret = rtk_qos_portPriSelIndex_get(data->port, &Index);
|
||||
if (ret != 0)
|
||||
printk("rtk_qos_portPriSelIndex_set failed\n");
|
||||
@@ -642,7 +642,7 @@ void rtk_hal_enable_igmpsnoop(struct ra_switch_ioctl_data *data)
|
||||
{
|
||||
rtk_api_ret_t ret;
|
||||
rtk_portmask_t pmask;
|
||||
|
||||
|
||||
|
||||
ret = rtk_igmp_init();
|
||||
if (data->on_off == 1) {
|
||||
@@ -800,7 +800,7 @@ void rtk_hal_vlan_tag(struct ra_switch_ioctl_data *data)
|
||||
RTK_PORTMASK_PORT_SET(vlan.untag, data->port);
|
||||
else
|
||||
RTK_PORTMASK_PORT_CLEAR(vlan.untag, data->port);
|
||||
|
||||
|
||||
ret = rtk_vlan_set(data->vid, &vlan);
|
||||
if (ret != RT_ERR_OK)
|
||||
printk("rtk_vlan_set failed\n");
|
||||
|
||||
@@ -28,15 +28,15 @@
|
||||
#define RTL8367C_SW_CPU_PORT 6
|
||||
|
||||
//RTL8367C_PHY_PORT_NUM + ext0 + ext1
|
||||
#define RTL8367C_NUM_PORTS 7
|
||||
#define RTL8367C_NUM_VIDS 4096
|
||||
#define RTL8367C_NUM_PORTS 7
|
||||
#define RTL8367C_NUM_VIDS 4096
|
||||
|
||||
struct rtl8367_priv {
|
||||
struct switch_dev swdev;
|
||||
bool global_vlan_enable;
|
||||
};
|
||||
|
||||
struct rtl8367_mib_counter {
|
||||
struct rtl8367_mib_counter {
|
||||
const char *name;
|
||||
};
|
||||
|
||||
@@ -72,13 +72,13 @@ static struct rtl8367_mib_counter rtl8367c_mib_counters[] = {
|
||||
{"etherStatsPkts256to511Octets"},
|
||||
{"etherStatsPkts512to1023Octets"},
|
||||
{"etherStatsPkts1024toMaxOctets"},
|
||||
{"etherStatsMcastPkts"},
|
||||
{"etherStatsMcastPkts"},
|
||||
{"etherStatsBcastPkts"},
|
||||
{"ifOutOctets"},
|
||||
{"dot3StatsSingleCollisionFrames"},
|
||||
{"dot3StatsMultipleCollisionFrames"},
|
||||
{"dot3StatsDeferredTransmissions"},
|
||||
{"dot3StatsLateCollisions"},
|
||||
{"dot3StatsLateCollisions"},
|
||||
{"etherStatsCollisions"},
|
||||
{"dot3StatsExcessiveCollisions"},
|
||||
{"dot3OutPauseFrames"},
|
||||
@@ -131,7 +131,7 @@ static inline unsigned int rtl8367c_portmask_phy_to_sw(rtk_portmask_t phy_portma
|
||||
if(RTK_PORTMASK_IS_PORT_SET(phy_portmask,rtl8367c_sw_to_phy_port(i))) {
|
||||
RTK_PORTMASK_PORT_CLEAR(phy_portmask,rtl8367c_sw_to_phy_port(i));
|
||||
RTK_PORTMASK_PORT_SET(phy_portmask,i);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return (unsigned int)phy_portmask.bits[0];
|
||||
@@ -155,7 +155,7 @@ static int rtl8367c_get_mibs_num(void)
|
||||
|
||||
static const char *rtl8367c_get_mib_name(int idx)
|
||||
{
|
||||
|
||||
|
||||
return rtl8367c_mib_counters[idx].name;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ static int rtl8367c_get_port_mib_counter(int idx, int port, unsigned long long *
|
||||
|
||||
static int rtl8367c_is_vlan_valid(unsigned int vlan)
|
||||
{
|
||||
unsigned max = RTL8367C_NUM_VIDS;
|
||||
unsigned max = RTL8367C_NUM_VIDS;
|
||||
|
||||
if (vlan == 0 || vlan >= max)
|
||||
return 0;
|
||||
@@ -175,37 +175,37 @@ static int rtl8367c_is_vlan_valid(unsigned int vlan)
|
||||
}
|
||||
|
||||
static int rtl8367c_get_vlan( unsigned short vid, struct rtl8367_vlan_info *vlan)
|
||||
{
|
||||
{
|
||||
rtk_vlan_cfg_t vlan_cfg;
|
||||
|
||||
memset(vlan, '\0', sizeof(struct rtl8367_vlan_info));
|
||||
|
||||
if (vid >= RTL8367C_NUM_VIDS)
|
||||
return -EINVAL;
|
||||
return -EINVAL;
|
||||
|
||||
if(rtk_vlan_get(vid,&vlan_cfg))
|
||||
return -EINVAL;
|
||||
|
||||
return -EINVAL;
|
||||
|
||||
vlan->vid = vid;
|
||||
vlan->member = rtl8367c_portmask_phy_to_sw(vlan_cfg.mbr);
|
||||
vlan->untag = rtl8367c_portmask_phy_to_sw(vlan_cfg.untag);
|
||||
vlan->member = rtl8367c_portmask_phy_to_sw(vlan_cfg.mbr);
|
||||
vlan->untag = rtl8367c_portmask_phy_to_sw(vlan_cfg.untag);
|
||||
vlan->fid = vlan_cfg.fid_msti;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtl8367c_set_vlan( unsigned short vid, u32 mbr, u32 untag, u8 fid)
|
||||
{
|
||||
{
|
||||
rtk_vlan_cfg_t vlan_cfg;
|
||||
int i;
|
||||
|
||||
memset(&vlan_cfg, 0x00, sizeof(rtk_vlan_cfg_t));
|
||||
memset(&vlan_cfg, 0x00, sizeof(rtk_vlan_cfg_t));
|
||||
|
||||
for (i = 0; i < RTL8367C_NUM_PORTS; i++) {
|
||||
if (mbr & (1 << i)) {
|
||||
RTK_PORTMASK_PORT_SET(vlan_cfg.mbr, rtl8367c_sw_to_phy_port(i));
|
||||
if(untag & (1 << i))
|
||||
RTK_PORTMASK_PORT_SET(vlan_cfg.untag, rtl8367c_sw_to_phy_port(i));
|
||||
RTK_PORTMASK_PORT_SET(vlan_cfg.untag, rtl8367c_sw_to_phy_port(i));
|
||||
}
|
||||
}
|
||||
vlan_cfg.fid_msti=fid;
|
||||
@@ -217,9 +217,9 @@ static int rtl8367c_set_vlan( unsigned short vid, u32 mbr, u32 untag, u8 fid)
|
||||
static int rtl8367c_get_pvid( int port, int *pvid)
|
||||
{
|
||||
u32 prio=0;
|
||||
|
||||
|
||||
if (port >= RTL8367C_NUM_PORTS)
|
||||
return -EINVAL;
|
||||
return -EINVAL;
|
||||
|
||||
return rtk_vlan_portPvid_get(rtl8367c_sw_to_phy_port(port),pvid,&prio);
|
||||
}
|
||||
@@ -228,16 +228,16 @@ static int rtl8367c_get_pvid( int port, int *pvid)
|
||||
static int rtl8367c_set_pvid( int port, int pvid)
|
||||
{
|
||||
u32 prio=0;
|
||||
|
||||
|
||||
if (port >= RTL8367C_NUM_PORTS)
|
||||
return -EINVAL;
|
||||
return -EINVAL;
|
||||
|
||||
return rtk_vlan_portPvid_set(rtl8367c_sw_to_phy_port(port),pvid,prio);
|
||||
}
|
||||
|
||||
static int rtl8367c_get_port_link(int port, int *link, int *speed, int *duplex)
|
||||
{
|
||||
|
||||
|
||||
if(rtk_port_phyStatus_get(rtl8367c_sw_to_phy_port(port),(rtk_port_linkStatus_t *)link,
|
||||
(rtk_port_speed_t *)speed,(rtk_port_duplex_t *)duplex))
|
||||
return -EINVAL;
|
||||
@@ -252,7 +252,7 @@ rtl8367_sw_set_vlan_enable(struct switch_dev *dev,
|
||||
const struct switch_attr *attr,
|
||||
struct switch_val *val)
|
||||
{
|
||||
struct rtl8367_priv *priv = container_of(dev, struct rtl8367_priv, swdev);
|
||||
struct rtl8367_priv *priv = container_of(dev, struct rtl8367_priv, swdev);
|
||||
|
||||
priv->global_vlan_enable = val->value.i ;
|
||||
|
||||
@@ -295,7 +295,7 @@ static int rtl8367_sw_reset_port_mibs(struct switch_dev *dev,
|
||||
static int rtl8367_sw_get_port_mib(struct switch_dev *dev,
|
||||
const struct switch_attr *attr,
|
||||
struct switch_val *val)
|
||||
{
|
||||
{
|
||||
int i, len = 0;
|
||||
unsigned long long counter = 0;
|
||||
static char mib_buf[4096];
|
||||
@@ -305,7 +305,7 @@ static int rtl8367_sw_get_port_mib(struct switch_dev *dev,
|
||||
|
||||
len += snprintf(mib_buf + len, sizeof(mib_buf) - len,
|
||||
"Port %d MIB counters\n",
|
||||
val->port_vlan);
|
||||
val->port_vlan);
|
||||
|
||||
for (i = 0; i <rtl8367c_get_mibs_num(); ++i) {
|
||||
len += snprintf(mib_buf + len, sizeof(mib_buf) - len,
|
||||
@@ -328,7 +328,7 @@ static int rtl8367_sw_get_port_mib(struct switch_dev *dev,
|
||||
static int rtl8367_sw_get_vlan_info(struct switch_dev *dev,
|
||||
const struct switch_attr *attr,
|
||||
struct switch_val *val)
|
||||
{
|
||||
{
|
||||
int i;
|
||||
u32 len = 0;
|
||||
struct rtl8367_vlan_info vlan;
|
||||
@@ -370,8 +370,8 @@ static int rtl8367_sw_get_vlan_ports(struct switch_dev *dev, struct switch_val *
|
||||
{
|
||||
struct switch_port *port;
|
||||
struct rtl8367_vlan_info vlan;
|
||||
int i;
|
||||
|
||||
int i;
|
||||
|
||||
if (!rtl8367c_is_vlan_valid(val->port_vlan))
|
||||
return -EINVAL;
|
||||
|
||||
@@ -401,8 +401,8 @@ static int rtl8367_sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *
|
||||
u32 untag = 0;
|
||||
u8 fid=0;
|
||||
int err;
|
||||
int i;
|
||||
|
||||
int i;
|
||||
|
||||
if (!rtl8367c_is_vlan_valid(val->port_vlan))
|
||||
return -EINVAL;
|
||||
|
||||
@@ -430,7 +430,7 @@ static int rtl8367_sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *
|
||||
|
||||
//pr_info("[%s] vid=%d , mem=%x,untag=%x,fid=%d \n",__func__,val->port_vlan,member,untag,fid);
|
||||
|
||||
return rtl8367c_set_vlan(val->port_vlan, member, untag, fid);
|
||||
return rtl8367c_set_vlan(val->port_vlan, member, untag, fid);
|
||||
|
||||
}
|
||||
|
||||
@@ -442,7 +442,7 @@ static int rtl8367_sw_get_port_pvid(struct switch_dev *dev, int port, int *val)
|
||||
|
||||
|
||||
static int rtl8367_sw_set_port_pvid(struct switch_dev *dev, int port, int val)
|
||||
{
|
||||
{
|
||||
return rtl8367c_set_pvid(port, val);
|
||||
}
|
||||
|
||||
@@ -459,17 +459,17 @@ static int rtl8367_sw_reset_switch(struct switch_dev *dev)
|
||||
|
||||
static int rtl8367_sw_get_port_link(struct switch_dev *dev, int port,
|
||||
struct switch_port_link *link)
|
||||
{
|
||||
{
|
||||
int speed;
|
||||
|
||||
if (port >= RTL8367C_NUM_PORTS)
|
||||
return -EINVAL;
|
||||
|
||||
if(rtl8367c_get_port_link(port,(int *)&link->link,(int *)&speed,(int *)&link->duplex))
|
||||
return -EINVAL;
|
||||
return -EINVAL;
|
||||
|
||||
if (!link->link)
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
switch (speed) {
|
||||
case 0:
|
||||
@@ -497,8 +497,8 @@ static struct switch_attr rtl8367_globals[] = {
|
||||
.description = "Enable VLAN mode",
|
||||
.set = rtl8367_sw_set_vlan_enable,
|
||||
.get = rtl8367_sw_get_vlan_enable,
|
||||
.max = 1,
|
||||
}, {
|
||||
.max = 1,
|
||||
}, {
|
||||
.type = SWITCH_TYPE_NOVAL,
|
||||
.name = "reset_mibs",
|
||||
.description = "Reset all MIB counters",
|
||||
@@ -562,8 +562,8 @@ int rtl8367s_swconfig_init(void (*reset_func)(void))
|
||||
int err=0;
|
||||
|
||||
rtl8367_switch_reset_func = reset_func ;
|
||||
|
||||
memset(priv, 0, sizeof(struct rtl8367_priv));
|
||||
|
||||
memset(priv, 0, sizeof(struct rtl8367_priv));
|
||||
priv->global_vlan_enable =0;
|
||||
|
||||
dev->name = "RTL8367C";
|
||||
@@ -571,7 +571,7 @@ int rtl8367s_swconfig_init(void (*reset_func)(void))
|
||||
dev->ports = RTL8367C_NUM_PORTS;
|
||||
dev->vlans = RTL8367C_NUM_VIDS;
|
||||
dev->ops = &rtl8367_sw_ops;
|
||||
dev->alias = "RTL8367C";
|
||||
dev->alias = "RTL8367C";
|
||||
err = register_switch(dev, NULL);
|
||||
|
||||
pr_info("[%s]\n",__func__);
|
||||
|
||||
@@ -49,7 +49,7 @@ static void rtk_dump_mib_type(rtk_stat_port_type_t cntr_idx)
|
||||
rtk_stat_port_get(port, cntr_idx, &Cntr);
|
||||
printk("%8llu", Cntr);
|
||||
}
|
||||
|
||||
|
||||
printk("\n");
|
||||
}
|
||||
static void rtk_hal_dump_mib(void)
|
||||
@@ -103,7 +103,7 @@ static void rtk_hal_dump_mib(void)
|
||||
rtk_dump_mib_type(STAT_Dot3InPauseFrames);
|
||||
/* clear MIB */
|
||||
rtk_stat_global_reset();
|
||||
|
||||
|
||||
}
|
||||
|
||||
static int rtk_hal_dump_vlan(void)
|
||||
@@ -138,7 +138,7 @@ static int rtk_hal_dump_vlan(void)
|
||||
EXT_PORT1) ? '1' : '-');
|
||||
printk("\n");
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
@@ -64,7 +64,7 @@ unsigned int mii_mgr_write(unsigned int phy_addr,unsigned int phy_register,unsig
|
||||
bus->write(bus, phy_addr, phy_register, write_data);
|
||||
|
||||
mutex_unlock(&bus->mdio_lock);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ static int rtl8367s_hw_reset(void)
|
||||
static int rtl8367s_vlan_config(int want_at_p0)
|
||||
{
|
||||
rtk_vlan_cfg_t vlan1, vlan2;
|
||||
|
||||
|
||||
/* Set LAN/WAN VLAN partition */
|
||||
memset(&vlan1, 0x00, sizeof(rtk_vlan_cfg_t));
|
||||
|
||||
@@ -101,7 +101,7 @@ static int rtl8367s_vlan_config(int want_at_p0)
|
||||
RTK_PORTMASK_PORT_SET(vlan1.untag, UTP_PORT1);
|
||||
RTK_PORTMASK_PORT_SET(vlan1.untag, UTP_PORT2);
|
||||
RTK_PORTMASK_PORT_SET(vlan1.untag, UTP_PORT3);
|
||||
|
||||
|
||||
if (want_at_p0) {
|
||||
RTK_PORTMASK_PORT_SET(vlan1.mbr, UTP_PORT4);
|
||||
RTK_PORTMASK_PORT_SET(vlan1.untag, UTP_PORT4);
|
||||
@@ -111,11 +111,11 @@ static int rtl8367s_vlan_config(int want_at_p0)
|
||||
}
|
||||
|
||||
vlan1.ivl_en = 1;
|
||||
|
||||
|
||||
rtk_vlan_set(1, &vlan1);
|
||||
|
||||
|
||||
memset(&vlan2, 0x00, sizeof(rtk_vlan_cfg_t));
|
||||
|
||||
|
||||
RTK_PORTMASK_PORT_SET(vlan2.mbr, EXT_PORT1);
|
||||
RTK_PORTMASK_PORT_SET(vlan2.untag, EXT_PORT1);
|
||||
|
||||
@@ -144,7 +144,7 @@ static int rtl8367s_vlan_config(int want_at_p0)
|
||||
rtk_vlan_portPvid_set(UTP_PORT4, 2, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtl8367s_hw_init(void)
|
||||
@@ -201,7 +201,7 @@ static void set_rtl8367s_rgmii(void)
|
||||
rtk_port_macForceLinkExt_set(EXT_PORT1, mode, &mac_cfg);
|
||||
rtk_port_rgmiiDelayExt_set(EXT_PORT1, 1, 3);
|
||||
rtk_port_phyEnableAll_set(ENABLED);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void init_gsw(void)
|
||||
@@ -239,9 +239,9 @@ static int rtk_gsw_probe(struct platform_device *pdev)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
gsw = devm_kzalloc(&pdev->dev, sizeof(struct rtk_gsw), GFP_KERNEL);
|
||||
|
||||
|
||||
if (!gsw)
|
||||
return -ENOMEM;
|
||||
return -ENOMEM;
|
||||
|
||||
gsw->dev = &pdev->dev;
|
||||
|
||||
@@ -263,12 +263,12 @@ static int rtk_gsw_probe(struct platform_device *pdev)
|
||||
"mediatek,port_map", &pm)) {
|
||||
|
||||
if (!strcasecmp(pm, "wllll"))
|
||||
rtl8367s_vlan_config(1);
|
||||
rtl8367s_vlan_config(1);
|
||||
else
|
||||
rtl8367s_vlan_config(0);
|
||||
|
||||
|
||||
} else {
|
||||
#ifdef CONFIG_SWCONFIG
|
||||
#ifdef CONFIG_SWCONFIG
|
||||
rtl8367s_swconfig_init(&init_gsw);
|
||||
#else
|
||||
rtl8367s_vlan_config(0);
|
||||
@@ -280,7 +280,7 @@ static int rtk_gsw_probe(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, gsw);
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void rtk_gsw_remove(struct platform_device *pdev)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
device_type = "memory";
|
||||
reg = <0x0 0x0 0x0 0x10000000>;
|
||||
};
|
||||
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
0x1000000 0x0 0x0
|
||||
0x1000000 0x0 0x0
|
||||
0x0 0x100000>;
|
||||
|
||||
|
||||
wifi@0,0 {
|
||||
compatible = "pci168c,0033";
|
||||
reg = <0x0 0 0 0 0>;
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
&wifi0 {
|
||||
// IPQ5018
|
||||
status = "okay";
|
||||
|
||||
|
||||
qcom,rproc = <&q6_wcss_pd1>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
qcom,ath11k-calibration-variant = "GL-iNet-GL-B3000";
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
memory-region = <&q6_mem_regions>;
|
||||
firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
|
||||
"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
|
||||
|
||||
|
||||
// IPQ5018
|
||||
q6_wcss_pd1: pd-1 {
|
||||
firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/ {
|
||||
model = "Yuncore FAP650";
|
||||
compatible = "yuncore,fap650", "qcom,ipq6018";
|
||||
|
||||
|
||||
aliases {
|
||||
ethernet0 = &dp5;
|
||||
ethernet1 = &dp4;
|
||||
@@ -216,7 +216,7 @@
|
||||
|
||||
&blsp1_spi1 {
|
||||
status = "okay";
|
||||
|
||||
|
||||
flash@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
@@ -321,7 +321,7 @@
|
||||
nand-ecc-strength = <4>;
|
||||
nand-ecc-step-size = <512>;
|
||||
nand-bus-width = <8>;
|
||||
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/ {
|
||||
model = "Linksys MR7500";
|
||||
compatible = "linksys,mr7500", "qcom,ipq6018";
|
||||
|
||||
|
||||
aliases {
|
||||
serial0 = &blsp1_uart3;
|
||||
serial1 = &blsp1_uart2;
|
||||
@@ -25,24 +25,24 @@
|
||||
|
||||
label-mac-device = &dp5_syn;
|
||||
};
|
||||
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
bootargs-append = " root=/dev/ubiblock0_0";
|
||||
};
|
||||
|
||||
|
||||
extcon_usb {
|
||||
pinctrl-0 = <&extcon_usb_pins>;
|
||||
pinctrl-names = "default";
|
||||
id-gpio = <&tlmm 26 GPIO_ACTIVE_LOW>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
|
||||
wps {
|
||||
label = "wps";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
@@ -55,10 +55,10 @@
|
||||
gpios = <&tlmm 56 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
leds {
|
||||
compatible = "pwm-leds";
|
||||
|
||||
|
||||
usb {
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_USB;
|
||||
@@ -68,7 +68,7 @@
|
||||
trigger-sources = <&usb3_port1>, <&usb3_port2>;
|
||||
linux,default-trigger = "usbport";
|
||||
};
|
||||
|
||||
|
||||
led_system_red: red {
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
function = LED_FUNCTION_INDICATOR;
|
||||
@@ -76,14 +76,14 @@
|
||||
max-brightness = <255>;
|
||||
panic-indicator;
|
||||
};
|
||||
|
||||
|
||||
led_system_green: green {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_INDICATOR;
|
||||
pwms = <&pwm 3 1250000>;
|
||||
max-brightness = <255>;
|
||||
};
|
||||
|
||||
|
||||
led_system_blue: blue {
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_POWER;
|
||||
@@ -91,7 +91,7 @@
|
||||
max-brightness = <255>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
reg_usb_vbus: regulator-usb-vbus {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "usb_vbus";
|
||||
@@ -110,7 +110,7 @@
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
|
||||
/*LED_USB*/
|
||||
mux_1 {
|
||||
pins = "gpio30";
|
||||
@@ -118,7 +118,7 @@
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
|
||||
/*LED_R*/
|
||||
mux_2 {
|
||||
pins = "gpio31";
|
||||
@@ -126,7 +126,7 @@
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
|
||||
/*LED_G*/
|
||||
mux_3 {
|
||||
pins = "gpio32";
|
||||
@@ -135,14 +135,14 @@
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
extcon_usb_pins: extcon_usb_pins {
|
||||
pins = "gpio26";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
|
||||
button_pins: button_pins {
|
||||
wps_button {
|
||||
pins = "gpio37";
|
||||
@@ -214,7 +214,7 @@
|
||||
pinctrl-names = "default";
|
||||
reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
|
||||
status = "okay";
|
||||
|
||||
|
||||
ethernet-phy-package {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
@@ -222,7 +222,7 @@
|
||||
reg = <0>;
|
||||
|
||||
qcom,package-mode = "qsgmii";
|
||||
|
||||
|
||||
qca8075_0: ethernet-phy@0 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <0>;
|
||||
@@ -230,14 +230,14 @@
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
||||
led@0 {
|
||||
reg = <0>;
|
||||
color = <LED_COLOR_ID_ORANGE>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
default-state = "keep";
|
||||
};
|
||||
|
||||
|
||||
led@1 {
|
||||
reg = <1>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
@@ -254,14 +254,14 @@
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
||||
led@0 {
|
||||
reg = <0>;
|
||||
color = <LED_COLOR_ID_ORANGE>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
default-state = "keep";
|
||||
};
|
||||
|
||||
|
||||
led@1 {
|
||||
reg = <1>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
@@ -278,14 +278,14 @@
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
||||
led@0 {
|
||||
reg = <0>;
|
||||
color = <LED_COLOR_ID_ORANGE>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
default-state = "keep";
|
||||
};
|
||||
|
||||
|
||||
led@1 {
|
||||
reg = <1>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
@@ -302,14 +302,14 @@
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
||||
led@0 {
|
||||
reg = <0>;
|
||||
color = <LED_COLOR_ID_ORANGE>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
default-state = "keep";
|
||||
};
|
||||
|
||||
|
||||
led@1 {
|
||||
reg = <1>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
@@ -329,14 +329,14 @@
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
||||
led@0 {
|
||||
reg = <0>;
|
||||
color = <LED_COLOR_ID_ORANGE>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
default-state = "keep";
|
||||
};
|
||||
|
||||
|
||||
led@1 {
|
||||
reg = <1>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
@@ -402,7 +402,7 @@
|
||||
switch_wan_bmp = <ESS_PORT5>;
|
||||
switch_mac_mode = <MAC_MODE_QSGMII>;
|
||||
switch_mac_mode1 = <MAC_MODE_USXGMII>;
|
||||
|
||||
|
||||
qcom,port_phyinfo {
|
||||
port@1 {
|
||||
port_id = <1>;
|
||||
@@ -493,12 +493,12 @@
|
||||
&dwc_0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
||||
usb3_port1: port@1 {
|
||||
reg = <1>;
|
||||
#trigger-source-cells = <0>;
|
||||
};
|
||||
|
||||
|
||||
usb3_port2: port@2 {
|
||||
reg = <2>;
|
||||
#trigger-source-cells = <0>;
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
pinctrl-0 = <&mdio_pins>;
|
||||
pinctrl-names = "default";
|
||||
reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
|
||||
|
||||
|
||||
ar8031: ethernet-phy@4 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <4>;
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
pinctrl-0 = <&mdio_pins>;
|
||||
pinctrl-names = "default";
|
||||
reset-gpios = <&tlmm 25 GPIO_ACTIVE_LOW>;
|
||||
|
||||
|
||||
qca8081_28: ethernet-phy@28 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <28>;
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
reg = <28>;
|
||||
reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
|
||||
reset-deassert-us = <10000>;
|
||||
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
@@ -158,13 +158,13 @@
|
||||
pinctrl-names = "default";
|
||||
|
||||
status = "okay";
|
||||
|
||||
|
||||
tlc59208f@27 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "ti,tlc59108";
|
||||
reg = <0x27>;
|
||||
|
||||
|
||||
led@0 {
|
||||
label = "rgb:led0";
|
||||
reg = <0>;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
nand@0 {
|
||||
reg = <0>;
|
||||
/*
|
||||
* Some devices use Micron NAND with with 8 bit ECC
|
||||
* Some devices use Micron NAND with with 8 bit ECC
|
||||
* other AMD/Spansion NAND with 4 bit ECC
|
||||
*nand-ecc-strength = <4>;
|
||||
*nand-ecc-step-size = <512>;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
nand@0 {
|
||||
reg = <0>;
|
||||
/*
|
||||
* Some devices use Micron NAND with with 8 bit ECC
|
||||
* Some devices use Micron NAND with with 8 bit ECC
|
||||
* other AMD/Spansion NAND with 4 bit ECC
|
||||
*nand-ecc-strength = <4>;
|
||||
*nand-ecc-step-size = <512>;
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
label = "blue:lte4";
|
||||
gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
|
||||
led_lte5 {
|
||||
label = "red:lte5";
|
||||
gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
|
||||
@@ -81,20 +81,20 @@
|
||||
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy1tpt";
|
||||
};
|
||||
|
||||
|
||||
led_wlan5 {
|
||||
function = LED_FUNCTION_WLAN_5GHZ;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
|
||||
|
||||
led_lan {
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
|
||||
led_wan {
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
@@ -227,7 +227,7 @@
|
||||
&wmac {
|
||||
nvmem-cells = <&eeprom_factory_0>;
|
||||
nvmem-cell-names = "eeprom";
|
||||
|
||||
|
||||
pinctrl-names = "default", "pa_gpio";
|
||||
pinctrl-0 = <&pa_pins>;
|
||||
pinctrl-1 = <&pa_gpio_pins>;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; // #GPIO1
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
/ {
|
||||
compatible = "comfast,cf-ew72-v2", "mediatek,mt7621-soc";
|
||||
model = "COMFAST CF-EW72 V2";
|
||||
|
||||
// There are at least two HW variants of cf-ew72-v2:
|
||||
|
||||
// There are at least two HW variants of cf-ew72-v2:
|
||||
// With external RAM chip and with integrated RAM (RAM chip not soldered).
|
||||
// Both act same.
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
compatible = "gpio-leds";
|
||||
|
||||
// The only both visible and controllable indicator is wifi LED.
|
||||
// CF-EW72 have 8 LEDs:
|
||||
// CF-EW72 have 8 LEDs:
|
||||
// "wlan" is the only LED is controllable with GPIO and have proper hole in shell.
|
||||
// "power", "wan" and "lan" LEDs have proper holes in shell, but can not be controlled with GPIO
|
||||
// "hidden_led_2" and "hidden_led_4" can be controlled with GPIO, but have no proper holes in shell
|
||||
@@ -42,14 +42,14 @@
|
||||
// "noconn_led_6" and "noconn_led_8" exist, but have no proper holes in shell and not controlled:
|
||||
// "noconn_led_6" is between LAN and WLAN LEDs
|
||||
// "noconn_led_8" is after WLAN LED
|
||||
|
||||
|
||||
// LED "hidden_led_2" between POWER and WAN LEDs is controllable with GPIO, but it has no proper hole in shell;
|
||||
// LED "hidden_led_4" between WAN and LAN LEDs is controllable with GPIO, but it has no proper hole in shell;
|
||||
|
||||
// TABLE of LEDs. All leds are blue.
|
||||
//
|
||||
// Place (WAN->ANT) | Num | GPIO | LED name (LuCI) | Note
|
||||
// -----------------|-----|-----------------------------------------------------------------------------------------
|
||||
// -----------------|-----|-----------------------------------------------------------------------------------------
|
||||
// power | 1 | | | POWER LED. Not controlled with GPIO.
|
||||
// hidden_led_2 | 2 | 13 | blue:hidden_led_2 | This LED does not have proper hole in shell.
|
||||
// wan | 3 | | | WAN LED. Not controlled with GPIO.
|
||||
@@ -99,13 +99,13 @@
|
||||
reg = <0x0 0x30000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
|
||||
partition@30000 {
|
||||
label = "Config";
|
||||
reg = <0x30000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
|
||||
partition@40000 {
|
||||
label = "factory";
|
||||
reg = <0x40000 0x10000>;
|
||||
@@ -130,11 +130,11 @@
|
||||
#nvmem-cell-cells = <1>;
|
||||
};
|
||||
|
||||
// Serial number can be found in "factory" at 0xE100.
|
||||
// Serial number can be found in "factory" at 0xE100.
|
||||
// it starts and ends with double quotes `"` and is ASCII string
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
partition@50000 {
|
||||
label = "firmware";
|
||||
compatible = "denx,uimage";
|
||||
@@ -193,7 +193,7 @@
|
||||
nvmem-cells = <&macaddr_factory_e000 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
|
||||
lan: port@1 {
|
||||
status = "okay";
|
||||
label = "lan";
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
partition@140000 {
|
||||
label = "firmware";
|
||||
compatible = "denx,uimage";
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
label = "power";
|
||||
gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_POWER>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&leds {
|
||||
@@ -40,7 +40,7 @@
|
||||
nvmem-cell-names = "eeprom";
|
||||
#address-cells = <2>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
||||
band@0 {
|
||||
/* 2.4 GHz */
|
||||
reg = <0>;
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
function = LED_FUNCTION_INDICATOR;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function-enumerator = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
led_power: led-5 {
|
||||
gpios = <&gpio_hc595 5 GPIO_ACTIVE_HIGH>;
|
||||
@@ -183,7 +183,7 @@
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@200000 {
|
||||
partition@200000 {
|
||||
label = "factory";
|
||||
reg = <0x200000 0x100000>;
|
||||
read-only;
|
||||
@@ -235,7 +235,7 @@
|
||||
ubiconcat0: partition@400000 {
|
||||
label = "ubiconcat0";
|
||||
reg = <0x400000 0x1c00000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ubiconcat1: partition@2800000 {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
bootargs = "console=ttyS0,115200";
|
||||
bootargs-override = "console=ttyS0,115200";
|
||||
};
|
||||
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
label = "RF-EEPROM";
|
||||
reg = <0x100000 0x80000>;
|
||||
read-only;
|
||||
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
|
||||
|
||||
wps {
|
||||
label = "wps";
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
label = "rf-eeprom";
|
||||
reg = <0x40000 0x10000>;
|
||||
read-only;
|
||||
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
@@ -170,7 +170,7 @@
|
||||
reg = <0x1030000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
|
||||
partition@1040000 {
|
||||
label = "rf-eeprom_res";
|
||||
reg = <0x1040000 0x10000>;
|
||||
@@ -181,7 +181,7 @@
|
||||
label = "firmware_2";
|
||||
reg = <0x1050000 0xe60000>;
|
||||
};
|
||||
|
||||
|
||||
partition@1eb0000 {
|
||||
label = "Config_2";
|
||||
reg = <0x1eb0000 0x40000>;
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
label = "rf-eeprom";
|
||||
reg = <0x40000 0x10000>;
|
||||
read-only;
|
||||
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
@@ -191,7 +191,7 @@
|
||||
reg = <0x1030000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
|
||||
partition@1040000 {
|
||||
label = "rf-eeprom_res";
|
||||
reg = <0x1040000 0x10000>;
|
||||
@@ -202,7 +202,7 @@
|
||||
label = "firmware_2";
|
||||
reg = <0x1050000 0xe60000>;
|
||||
};
|
||||
|
||||
|
||||
partition@1eb0000 {
|
||||
label = "Config_2";
|
||||
reg = <0x1eb0000 0x40000>;
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
label = "rf-eeprom";
|
||||
reg = <0x40000 0x10000>;
|
||||
read-only;
|
||||
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
@@ -191,7 +191,7 @@
|
||||
reg = <0x1030000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
|
||||
partition@1040000 {
|
||||
label = "rf-eeprom_res";
|
||||
reg = <0x1040000 0x10000>;
|
||||
@@ -202,7 +202,7 @@
|
||||
label = "firmware_2";
|
||||
reg = <0x1050000 0xe60000>;
|
||||
};
|
||||
|
||||
|
||||
partition@1eb0000 {
|
||||
label = "Config_2";
|
||||
reg = <0x1eb0000 0x40000>;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
led-upgrade = &led_power;
|
||||
label-mac-device = ðernet;
|
||||
};
|
||||
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyS0,115200";
|
||||
};
|
||||
@@ -80,7 +80,7 @@
|
||||
gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RFKILL>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*
|
||||
LzmaDecode.c
|
||||
LZMA Decoder (optimized for Speed version)
|
||||
|
||||
|
||||
LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
|
||||
http://www.7-zip.org/
|
||||
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this Code, expressly permits you to
|
||||
statically or dynamically link your Code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked Code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this Code, expressly permits you to
|
||||
statically or dynamically link your Code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked Code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
|
||||
|
||||
#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
|
||||
@@ -57,9 +57,9 @@
|
||||
|
||||
#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
|
||||
{ UpdateBit0(p); mi <<= 1; A0; } else \
|
||||
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
|
||||
|
||||
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
|
||||
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
|
||||
|
||||
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
|
||||
|
||||
#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
|
||||
{ int i = numLevels; res = 1; \
|
||||
@@ -82,7 +82,7 @@
|
||||
#define LenLow (LenChoice2 + 1)
|
||||
#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
|
||||
#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
|
||||
|
||||
#define kNumStates 12
|
||||
@@ -168,7 +168,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
int lc = vs->Properties.lc;
|
||||
|
||||
#ifdef _LZMA_OUT_READ
|
||||
|
||||
|
||||
UInt32 Range = vs->Range;
|
||||
UInt32 Code = vs->Code;
|
||||
#ifdef _LZMA_IN_CB
|
||||
@@ -210,7 +210,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
|
||||
UInt32 i;
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
rep0 = rep1 = rep2 = rep3 = 1;
|
||||
state = 0;
|
||||
globalPos = 0;
|
||||
@@ -261,7 +261,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
for (i = 0; i < numProbs; i++)
|
||||
p[i] = kBitModelTotal >> 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _LZMA_IN_CB
|
||||
RC_INIT;
|
||||
#else
|
||||
@@ -275,7 +275,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
CProb *prob;
|
||||
UInt32 bound;
|
||||
int posState = (int)(
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -287,9 +287,9 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
{
|
||||
int symbol = 1;
|
||||
UpdateBit0(prob)
|
||||
prob = p + Literal + (LZMA_LIT_SIZE *
|
||||
prob = p + Literal + (LZMA_LIT_SIZE *
|
||||
(((
|
||||
(nowPos
|
||||
(nowPos
|
||||
#ifdef _LZMA_OUT_READ
|
||||
+ globalPos
|
||||
#endif
|
||||
@@ -338,7 +338,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
else if (state < 10) state -= 3;
|
||||
else state -= 6;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
UpdateBit1(prob);
|
||||
prob = p + IsRep + state;
|
||||
@@ -365,14 +365,14 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UInt32 pos;
|
||||
#endif
|
||||
UpdateBit0(prob);
|
||||
|
||||
|
||||
#ifdef _LZMA_OUT_READ
|
||||
if (distanceLimit == 0)
|
||||
#else
|
||||
if (nowPos == 0)
|
||||
#endif
|
||||
return LZMA_RESULT_DATA_ERROR;
|
||||
|
||||
|
||||
state = state < kNumLitStates ? 9 : 11;
|
||||
#ifdef _LZMA_OUT_READ
|
||||
pos = dictionaryPos - rep0;
|
||||
@@ -408,7 +408,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
UpdateBit0(prob);
|
||||
distance = rep1;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
UpdateBit1(prob);
|
||||
prob = p + IsRepG2 + state;
|
||||
@@ -469,7 +469,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
int posSlot;
|
||||
state += kNumLitStates;
|
||||
prob = p + PosSlot +
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
|
||||
kNumPosSlotBits);
|
||||
RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
|
||||
if (posSlot >= kStartPosModelIndex)
|
||||
@@ -524,7 +524,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
|
||||
|
||||
len += kMatchMinLen;
|
||||
#ifdef _LZMA_OUT_READ
|
||||
if (rep0 > distanceLimit)
|
||||
if (rep0 > distanceLimit)
|
||||
#else
|
||||
if (rep0 > nowPos)
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
LzmaDecode.h
|
||||
LZMA Decoder interface
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
LZMA SDK is licensed under two licenses:
|
||||
1) GNU Lesser General Public License (GNU LGPL)
|
||||
2) Common Public License (CPL)
|
||||
It means that you can select one of these two licenses and
|
||||
It means that you can select one of these two licenses and
|
||||
follow rules of that license.
|
||||
|
||||
SPECIAL EXCEPTION:
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
Igor Pavlov, as the author of this code, expressly permits you to
|
||||
statically or dynamically link your code (or bind by name) to the
|
||||
interfaces of this file without subjecting your linked code to the
|
||||
terms of the CPL or GNU LGPL. Any modifications or additions
|
||||
to this file, however, are subject to the LGPL or CPL terms.
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
/* Use read function for output data */
|
||||
|
||||
/* #define _LZMA_PROB32 */
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
/* It can increase speed on some 32-bit CPUs,
|
||||
but memory usage will be doubled in that case */
|
||||
|
||||
/* #define _LZMA_LOC_OPT */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
LzmaTypes.h
|
||||
/*
|
||||
LzmaTypes.h
|
||||
|
||||
Types for LZMA Decoder
|
||||
|
||||
@@ -13,12 +13,12 @@ This file is part of LZMA SDK 4.40 (2006-05-01)
|
||||
#ifndef _7ZIP_BYTE_DEFINED
|
||||
#define _7ZIP_BYTE_DEFINED
|
||||
typedef unsigned char Byte;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _7ZIP_UINT16_DEFINED
|
||||
#define _7ZIP_UINT16_DEFINED
|
||||
typedef unsigned short UInt16;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _7ZIP_UINT32_DEFINED
|
||||
#define _7ZIP_UINT32_DEFINED
|
||||
@@ -27,7 +27,7 @@ typedef unsigned long UInt32;
|
||||
#else
|
||||
typedef unsigned int UInt32;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* #define _LZMA_NO_SYSTEM_SIZE_T */
|
||||
/* You can use it, if you don't want <stddef.h> */
|
||||
|
||||
@@ -1820,7 +1820,7 @@ static int rtmdio_read_c45(struct mii_bus *bus, int addr, int devnum, int regnum
|
||||
|
||||
if (priv->extaddr >= 0)
|
||||
addr = priv->extaddr;
|
||||
|
||||
|
||||
if (addr >= RTMDIO_MAX_PORT)
|
||||
return -ENODEV;
|
||||
|
||||
@@ -1837,7 +1837,7 @@ static int rtmdio_83xx_read(struct mii_bus *bus, int addr, int regnum)
|
||||
|
||||
if (priv->extaddr >= 0)
|
||||
addr = priv->extaddr;
|
||||
|
||||
|
||||
if (addr >= RTMDIO_MAX_PORT)
|
||||
return -ENODEV;
|
||||
|
||||
@@ -1916,10 +1916,10 @@ static int rtmdio_83xx_write(struct mii_bus *bus, int addr, int regnum, u16 val)
|
||||
|
||||
if (priv->extaddr >= 0)
|
||||
addr = priv->extaddr;
|
||||
|
||||
|
||||
if (addr >= RTMDIO_MAX_PORT)
|
||||
return -ENODEV;
|
||||
|
||||
|
||||
page = priv->page[addr];
|
||||
|
||||
if (addr >= 24 && addr <= 27 && priv->id == 0x8380) {
|
||||
@@ -1959,10 +1959,10 @@ static int rtmdio_93xx_write(struct mii_bus *bus, int addr, int regnum, u16 val)
|
||||
|
||||
if (priv->extaddr >= 0)
|
||||
addr = priv->extaddr;
|
||||
|
||||
|
||||
if (addr >= RTMDIO_MAX_PORT)
|
||||
return -ENODEV;
|
||||
|
||||
|
||||
page = priv->page[addr];
|
||||
|
||||
if (regnum == RTMDIO_PAGE_SELECT)
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
volumes {
|
||||
factory: ubi-volume-factory {
|
||||
volname = "factory";
|
||||
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
|
||||
@@ -412,12 +412,12 @@ static int sf_dpns_mib_open(struct inode *inode, struct file *file)
|
||||
83 * (DPNS_MAX_PORT + 1));
|
||||
}
|
||||
|
||||
static const struct file_operations sf_dpns_mib_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = sf_dpns_mib_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
static const struct file_operations sf_dpns_mib_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = sf_dpns_mib_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
void sf_dpns_debugfs_init(struct dpns_priv *priv)
|
||||
|
||||
Reference in New Issue
Block a user