📄 s3c24x0.h
字号:
/*
* (C) Copyright 2003
* David M黮ler ELSOFT AG Switzerland. d.mueller@elsoft.ch
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
/************************************************
* NAME : s3c24x0.h
* Version : 31.3.2003
*
* common stuff for SAMSUNG S3C24X0 SoC
************************************************/
#ifndef __S3C24X0_H__
#define __S3C24X0_H__
typedef volatile unsigned char S3C24X0_REG8;
typedef volatile unsigned short S3C24X0_REG16;
typedef volatile unsigned int S3C24X0_REG32;
#define CONFIG_S3C2410
/* Memory controller (see manual chapter 5) */
typedef struct {
S3C24X0_REG32 eBWSCON;
S3C24X0_REG32 eBANKCON[8];
S3C24X0_REG32 eREFRESH;
S3C24X0_REG32 eBANKSIZE;
S3C24X0_REG32 eMRSRB6;
S3C24X0_REG32 eMRSRB7;
} /*__attribute__((__packed__))*/ S3C24X0_MEMCTL;
/* USB HOST (see manual chapter 12) */
typedef struct {
S3C24X0_REG32 HcRevision;
S3C24X0_REG32 HcControl;
S3C24X0_REG32 HcCommonStatus;
S3C24X0_REG32 HcInterruptStatus;
S3C24X0_REG32 HcInterruptEnable;
S3C24X0_REG32 HcInterruptDisable;
S3C24X0_REG32 HcHCCA;
S3C24X0_REG32 HcPeriodCuttendED;
S3C24X0_REG32 HcControlHeadED;
S3C24X0_REG32 HcControlCurrentED;
S3C24X0_REG32 HcBulkHeadED;
S3C24X0_REG32 HcBuldCurrentED;
S3C24X0_REG32 HcDoneHead;
S3C24X0_REG32 HcRmInterval;
S3C24X0_REG32 HcFmRemaining;
S3C24X0_REG32 HcFmNumber;
S3C24X0_REG32 HcPeriodicStart;
S3C24X0_REG32 HcLSThreshold;
S3C24X0_REG32 HcRhDescriptorA;
S3C24X0_REG32 HcRhDescriptorB;
S3C24X0_REG32 HcRhStatus;
S3C24X0_REG32 HcRhPortStatus1;
S3C24X0_REG32 HcRhPortStatus2;
} /*__attribute__((__packed__))*/ S3C24X0_USB_HOST;
/* INTERRUPT (see manual chapter 14) */
typedef struct {
S3C24X0_REG32 eSRCPND;
S3C24X0_REG32 eINTMOD;
S3C24X0_REG32 eINTMSK;
S3C24X0_REG32 ePRIORITY;
S3C24X0_REG32 eINTPND;
S3C24X0_REG32 eINTOFFSET;
#ifdef CONFIG_S3C2410
S3C24X0_REG32 eSUBSRCPND;
S3C24X0_REG32 eINTSUBMSK;
#endif
} /*__attribute__((__packed__))*/ S3C24X0_INTERRUPT;
/* DMAS (see manual chapter 8) */
typedef struct {
S3C24X0_REG32 DISRC;
#ifdef CONFIG_S3C2410
S3C24X0_REG32 DISRCC;
#endif
S3C24X0_REG32 DIDST;
#ifdef CONFIG_S3C2410
S3C24X0_REG32 DIDSTC;
#endif
S3C24X0_REG32 DCON;
S3C24X0_REG32 DSTAT;
S3C24X0_REG32 DCSRC;
S3C24X0_REG32 DCDST;
S3C24X0_REG32 DMASKTRIG;
#ifdef CONFIG_S3C2400
S3C24X0_REG32 res[1];
#endif
#ifdef CONFIG_S3C2410
S3C24X0_REG32 res[7];
#endif
} /*__attribute__((__packed__))*/ S3C24X0_DMA;
typedef struct {
S3C24X0_DMA dma[4];
} /*__attribute__((__packed__))*/ S3C24X0_DMAS;
/* CLOCK & POWER MANAGEMENT (see S3C2400 manual chapter 6) */
/* (see S3C2410 manual chapter 7) */
typedef struct {
S3C24X0_REG32 eLOCKTIME;
S3C24X0_REG32 eMPLLCON;
S3C24X0_REG32 eUPLLCON;
S3C24X0_REG32 eCLKCON;
S3C24X0_REG32 eCLKSLOW;
S3C24X0_REG32 eCLKDIVN;
} /*__attribute__((__packed__))*/ S3C24X0_CLOCK_POWER;
/* LCD CONTROLLER (see manual chapter 15) */
typedef struct {
S3C24X0_REG32 LCDCON1;
S3C24X0_REG32 LCDCON2;
S3C24X0_REG32 LCDCON3;
S3C24X0_REG32 LCDCON4;
S3C24X0_REG32 LCDCON5;
S3C24X0_REG32 LCDSADDR1;
S3C24X0_REG32 LCDSADDR2;
S3C24X0_REG32 LCDSADDR3;
S3C24X0_REG32 REDLUT;
S3C24X0_REG32 GREENLUT;
S3C24X0_REG32 BLUELUT;
S3C24X0_REG32 res[8];
S3C24X0_REG32 DITHMODE;
S3C24X0_REG32 TPAL;
#ifdef CONFIG_S3C2410
S3C24X0_REG32 LCDINTPND;
S3C24X0_REG32 LCDSRCPND;
S3C24X0_REG32 LCDINTMSK;
S3C24X0_REG32 LPCSEL;
#endif
} /*__attribute__((__packed__))*/ S3C24X0_LCD;
/* NAND FLASH (see S3C2410 manual chapter 6) */
typedef struct {
S3C24X0_REG32 NFCONF;
S3C24X0_REG32 NFCMD;
S3C24X0_REG32 NFADDR;
S3C24X0_REG32 NFDATA;
S3C24X0_REG32 NFSTAT;
S3C24X0_REG32 NFECC;
} /*__attribute__((__packed__))*/ S3C2410_NAND;
/* UART (see manual chapter 11) */
typedef struct {
S3C24X0_REG32 ULCON;
S3C24X0_REG32 UCON;
S3C24X0_REG32 UFCON;
S3C24X0_REG32 UMCON;
S3C24X0_REG32 UTRSTAT;
S3C24X0_REG32 UERSTAT;
S3C24X0_REG32 UFSTAT;
S3C24X0_REG32 UMSTAT;
#ifdef __BIG_ENDIAN
S3C24X0_REG8 res1[3];
S3C24X0_REG8 UTXH;
S3C24X0_REG8 res2[3];
S3C24X0_REG8 URXH;
#else /* Little Endian */
S3C24X0_REG8 UTXH;
S3C24X0_REG8 res1[3];
S3C24X0_REG8 URXH;
S3C24X0_REG8 res2[3];
#endif
S3C24X0_REG32 UBRDIV;
} /*__attribute__((__packed__))*/ S3C24X0_UART;
/* PWM TIMER (see manual chapter 10) */
typedef struct {
S3C24X0_REG32 TCNTB;
S3C24X0_REG32 TCMPB;
S3C24X0_REG32 TCNTO;
} /*__attribute__((__packed__))*/ S3C24X0_TIMER;
typedef struct {
S3C24X0_REG32 TCFG0;
S3C24X0_REG32 TCFG1;
S3C24X0_REG32 TCON;
S3C24X0_TIMER ch[4];
S3C24X0_REG32 TCNTB4;
S3C24X0_REG32 TCNTO4;
} /*__attribute__((__packed__))*/ S3C24X0_TIMERS;
/* USB DEVICE (see manual chapter 13) */
typedef struct {
#ifdef __BIG_ENDIAN
S3C24X0_REG8 res[3];
S3C24X0_REG8 EP_FIFO_REG;
#else /* little endian */
S3C24X0_REG8 EP_FIFO_REG;
S3C24X0_REG8 res[3];
#endif
} /*__attribute__((__packed__))*/ S3C24X0_USB_DEV_FIFOS;
typedef struct {
#ifdef __BIG_ENDIAN
S3C24X0_REG8 res1[3];
S3C24X0_REG8 EP_DMA_CON;
S3C24X0_REG8 res2[3];
S3C24X0_REG8 EP_DMA_UNIT;
S3C24X0_REG8 res3[3];
S3C24X0_REG8 EP_DMA_FIFO;
S3C24X0_REG8 res4[3];
S3C24X0_REG8 EP_DMA_TTC_L;
S3C24X0_REG8 res5[3];
S3C24X0_REG8 EP_DMA_TTC_M;
S3C24X0_REG8 res6[3];
S3C24X0_REG8 EP_DMA_TTC_H;
#else /* little endian */
S3C24X0_REG8 EP_DMA_CON;
S3C24X0_REG8 res1[3];
S3C24X0_REG8 EP_DMA_UNIT;
S3C24X0_REG8 res2[3];
S3C24X0_REG8 EP_DMA_FIFO;
S3C24X0_REG8 res3[3];
S3C24X0_REG8 EP_DMA_TTC_L;
S3C24X0_REG8 res4[3];
S3C24X0_REG8 EP_DMA_TTC_M;
S3C24X0_REG8 res5[3];
S3C24X0_REG8 EP_DMA_TTC_H;
S3C24X0_REG8 res6[3];
#endif
} /*__attribute__((__packed__))*/ S3C24X0_USB_DEV_DMAS;
typedef struct {
#ifdef __BIG_ENDIAN
S3C24X0_REG8 res1[3];
S3C24X0_REG8 FUNC_ADDR_REG;
S3C24X0_REG8 res2[3];
S3C24X0_REG8 PWR_REG;
S3C24X0_REG8 res3[3];
S3C24X0_REG8 EP_INT_REG;
S3C24X0_REG8 res4[15];
S3C24X0_REG8 USB_INT_REG;
S3C24X0_REG8 res5[3];
S3C24X0_REG8 EP_INT_EN_REG;
S3C24X0_REG8 res6[15];
S3C24X0_REG8 USB_INT_EN_REG;
S3C24X0_REG8 res7[3];
S3C24X0_REG8 FRAME_NUM1_REG;
S3C24X0_REG8 res8[3];
S3C24X0_REG8 FRAME_NUM2_REG;
S3C24X0_REG8 res9[3];
S3C24X0_REG8 INDEX_REG;
S3C24X0_REG8 res10[7];
S3C24X0_REG8 MAXP_REG;
S3C24X0_REG8 res11[3];
S3C24X0_REG8 EP0_CSR_IN_CSR1_REG;
S3C24X0_REG8 res12[3];
S3C24X0_REG8 IN_CSR2_REG;
S3C24X0_REG8 res13[7];
S3C24X0_REG8 OUT_CSR1_REG;
S3C24X0_REG8 res14[3];
S3C24X0_REG8 OUT_CSR2_REG;
S3C24X0_REG8 res15[3];
S3C24X0_REG8 OUT_FIFO_CNT1_REG;
S3C24X0_REG8 res16[3];
S3C24X0_REG8 OUT_FIFO_CNT2_REG;
#else /* little endian */
S3C24X0_REG8 FUNC_ADDR_REG;
S3C24X0_REG8 res1[3];
S3C24X0_REG8 PWR_REG;
S3C24X0_REG8 res2[3];
S3C24X0_REG8 EP_INT_REG;
S3C24X0_REG8 res3[15];
S3C24X0_REG8 USB_INT_REG;
S3C24X0_REG8 res4[3];
S3C24X0_REG8 EP_INT_EN_REG;
S3C24X0_REG8 res5[15];
S3C24X0_REG8 USB_INT_EN_REG;
S3C24X0_REG8 res6[3];
S3C24X0_REG8 FRAME_NUM1_REG;
S3C24X0_REG8 res7[3];
S3C24X0_REG8 FRAME_NUM2_REG;
S3C24X0_REG8 res8[3];
S3C24X0_REG8 INDEX_REG;
S3C24X0_REG8 res9[7];
S3C24X0_REG8 MAXP_REG;
S3C24X0_REG8 res10[7];
S3C24X0_REG8 EP0_CSR_IN_CSR1_REG;
S3C24X0_REG8 res11[3];
S3C24X0_REG8 IN_CSR2_REG;
S3C24X0_REG8 res12[3];
S3C24X0_REG8 OUT_CSR1_REG;
S3C24X0_REG8 res13[7];
S3C24X0_REG8 OUT_CSR2_REG;
S3C24X0_REG8 res14[3];
S3C24X0_REG8 OUT_FIFO_CNT1_REG;
S3C24X0_REG8 res15[3];
S3C24X0_REG8 OUT_FIFO_CNT2_REG;
S3C24X0_REG8 res16[3];
#endif /* __BIG_ENDIAN */
S3C24X0_USB_DEV_FIFOS fifo[5];
S3C24X0_USB_DEV_DMAS dma[5];
} /*__attribute__((__packed__))*/ S3C24X0_USB_DEVICE;
/* WATCH DOG TIMER (see manual chapter 18) */
typedef struct {
S3C24X0_REG32 eWTCON;
S3C24X0_REG32 eWTDAT;
S3C24X0_REG32 eWTCNT;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -