Path: blob/master/arch/m32r/include/asm/m32104ut/m32104ut_pld.h
10820 views
#ifndef _M32104UT_M32104UT_PLD_H1#define _M32104UT_M32104UT_PLD_H23/*4* include/asm-m32r/m32104ut/m32104ut_pld.h5*6* Definitions for Programmable Logic Device(PLD) on M32104UT board.7* Based on m32700ut_pld.h8*9* Copyright (c) 2002 Takeo Takahashi10* Copyright (c) 2005 Naoto Sugai11*12* This file is subject to the terms and conditions of the GNU General13* Public License. See the file "COPYING" in the main directory of14* this archive for more details.15*/1617#if defined(CONFIG_PLAT_M32104UT)18#define PLD_PLAT_BASE 0x02c0000019#else20#error "no platform configuration"21#endif2223#ifndef __ASSEMBLY__24/*25* C functions use non-cache address.26*/27#define PLD_BASE (PLD_PLAT_BASE /* + NONCACHE_OFFSET */)28#define __reg8 (volatile unsigned char *)29#define __reg16 (volatile unsigned short *)30#define __reg32 (volatile unsigned int *)31#else32#define PLD_BASE (PLD_PLAT_BASE + NONCACHE_OFFSET)33#define __reg834#define __reg1635#define __reg3236#endif /* __ASSEMBLY__ */3738/* CFC */39#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000)40#define PLD_CFSTS __reg16(PLD_BASE + 0x0002)41#define PLD_CFIMASK __reg16(PLD_BASE + 0x0004)42#define PLD_CFBUFCR __reg16(PLD_BASE + 0x0006)4344/* MMC */45#define PLD_MMCCR __reg16(PLD_BASE + 0x4000)46#define PLD_MMCMOD __reg16(PLD_BASE + 0x4002)47#define PLD_MMCSTS __reg16(PLD_BASE + 0x4006)48#define PLD_MMCBAUR __reg16(PLD_BASE + 0x400a)49#define PLD_MMCCMDBCUT __reg16(PLD_BASE + 0x400c)50#define PLD_MMCCDTBCUT __reg16(PLD_BASE + 0x400e)51#define PLD_MMCDET __reg16(PLD_BASE + 0x4010)52#define PLD_MMCWP __reg16(PLD_BASE + 0x4012)53#define PLD_MMCWDATA __reg16(PLD_BASE + 0x5000)54#define PLD_MMCRDATA __reg16(PLD_BASE + 0x6000)55#define PLD_MMCCMDDATA __reg16(PLD_BASE + 0x7000)56#define PLD_MMCRSPDATA __reg16(PLD_BASE + 0x7006)5758/* ICU59* ICUISTS: status register60* ICUIREQ0: request register61* ICUIREQ1: request register62* ICUCR3: control register for CFIREQ# interrupt63* ICUCR4: control register for CFC Card insert interrupt64* ICUCR5: control register for CFC Card eject interrupt65* ICUCR6: control register for external interrupt66* ICUCR11: control register for MMC Card insert/eject interrupt67* ICUCR13: control register for SC error interrupt68* ICUCR14: control register for SC receive interrupt69* ICUCR15: control register for SC send interrupt70*/7172#define PLD_IRQ_INT0 (M32104UT_PLD_IRQ_BASE + 0) /* None */73#define PLD_IRQ_CFIREQ (M32104UT_PLD_IRQ_BASE + 3) /* CF IREQ */74#define PLD_IRQ_CFC_INSERT (M32104UT_PLD_IRQ_BASE + 4) /* CF Insert */75#define PLD_IRQ_CFC_EJECT (M32104UT_PLD_IRQ_BASE + 5) /* CF Eject */76#define PLD_IRQ_EXINT (M32104UT_PLD_IRQ_BASE + 6) /* EXINT */77#define PLD_IRQ_MMCCARD (M32104UT_PLD_IRQ_BASE + 11) /* MMC Insert/Eject */78#define PLD_IRQ_SC_ERROR (M32104UT_PLD_IRQ_BASE + 13) /* SC error */79#define PLD_IRQ_SC_RCV (M32104UT_PLD_IRQ_BASE + 14) /* SC receive */80#define PLD_IRQ_SC_SND (M32104UT_PLD_IRQ_BASE + 15) /* SC send */8182#define PLD_ICUISTS __reg16(PLD_BASE + 0x8002)83#define PLD_ICUISTS_VECB_MASK (0xf000)84#define PLD_ICUISTS_VECB(x) ((x) & PLD_ICUISTS_VECB_MASK)85#define PLD_ICUISTS_ISN_MASK (0x07c0)86#define PLD_ICUISTS_ISN(x) ((x) & PLD_ICUISTS_ISN_MASK)87#define PLD_ICUCR3 __reg16(PLD_BASE + 0x8104)88#define PLD_ICUCR4 __reg16(PLD_BASE + 0x8106)89#define PLD_ICUCR5 __reg16(PLD_BASE + 0x8108)90#define PLD_ICUCR6 __reg16(PLD_BASE + 0x810a)91#define PLD_ICUCR11 __reg16(PLD_BASE + 0x8114)92#define PLD_ICUCR13 __reg16(PLD_BASE + 0x8118)93#define PLD_ICUCR14 __reg16(PLD_BASE + 0x811a)94#define PLD_ICUCR15 __reg16(PLD_BASE + 0x811c)95#define PLD_ICUCR_IEN (0x1000)96#define PLD_ICUCR_IREQ (0x0100)97#define PLD_ICUCR_ISMOD00 (0x0000) /* Low edge */98#define PLD_ICUCR_ISMOD01 (0x0010) /* Low level */99#define PLD_ICUCR_ISMOD02 (0x0020) /* High edge */100#define PLD_ICUCR_ISMOD03 (0x0030) /* High level */101#define PLD_ICUCR_ILEVEL0 (0x0000)102#define PLD_ICUCR_ILEVEL1 (0x0001)103#define PLD_ICUCR_ILEVEL2 (0x0002)104#define PLD_ICUCR_ILEVEL3 (0x0003)105#define PLD_ICUCR_ILEVEL4 (0x0004)106#define PLD_ICUCR_ILEVEL5 (0x0005)107#define PLD_ICUCR_ILEVEL6 (0x0006)108#define PLD_ICUCR_ILEVEL7 (0x0007)109110/* Power Control of MMC and CF */111#define PLD_CPCR __reg16(PLD_BASE + 0x14000)112#define PLD_CPCR_CDP 0x0001113114/* LED Control115*116* 1: DIP swich side117* 2: Reset switch side118*/119#define PLD_IOLEDCR __reg16(PLD_BASE + 0x14002)120#define PLD_IOLED_1_ON 0x001121#define PLD_IOLED_1_OFF 0x000122#define PLD_IOLED_2_ON 0x002123#define PLD_IOLED_2_OFF 0x000124125/* DIP Switch126* 0: Write-protect of Flash Memory (0:protected, 1:non-protected)127* 1: -128* 2: -129* 3: -130*/131#define PLD_IOSWSTS __reg16(PLD_BASE + 0x14004)132#define PLD_IOSWSTS_IOSW2 0x0200133#define PLD_IOSWSTS_IOSW1 0x0100134#define PLD_IOSWSTS_IOWP0 0x0001135136/* CRC */137#define PLD_CRC7DATA __reg16(PLD_BASE + 0x18000)138#define PLD_CRC7INDATA __reg16(PLD_BASE + 0x18002)139#define PLD_CRC16DATA __reg16(PLD_BASE + 0x18004)140#define PLD_CRC16INDATA __reg16(PLD_BASE + 0x18006)141#define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008)142#define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a)143144/* RTC */145#define PLD_RTCCR __reg16(PLD_BASE + 0x1c000)146#define PLD_RTCBAUR __reg16(PLD_BASE + 0x1c002)147#define PLD_RTCWRDATA __reg16(PLD_BASE + 0x1c004)148#define PLD_RTCRDDATA __reg16(PLD_BASE + 0x1c006)149#define PLD_RTCRSTODT __reg16(PLD_BASE + 0x1c008)150151/* SIM Card */152#define PLD_SCCR __reg16(PLD_BASE + 0x38000)153#define PLD_SCMOD __reg16(PLD_BASE + 0x38004)154#define PLD_SCSTS __reg16(PLD_BASE + 0x38006)155#define PLD_SCINTCR __reg16(PLD_BASE + 0x38008)156#define PLD_SCBAUR __reg16(PLD_BASE + 0x3800a)157#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c)158#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e)159160#endif /* _M32104UT_M32104UT_PLD_H */161162163