xref: /openbmc/qemu/hw/sh4/sh7750_regs.h (revision ef95ca03)
147b43a1fSPaolo Bonzini /*
247b43a1fSPaolo Bonzini  * SH-7750 memory-mapped registers
347b43a1fSPaolo Bonzini  * This file based on information provided in the following document:
447b43a1fSPaolo Bonzini  * "Hitachi SuperH (tm) RISC engine. SH7750 Series (SH7750, SH7750S)
547b43a1fSPaolo Bonzini  *  Hardware Manual"
647b43a1fSPaolo Bonzini  *  Document Number ADE-602-124C, Rev. 4.0, 4/21/00, Hitachi Ltd.
747b43a1fSPaolo Bonzini  *
847b43a1fSPaolo Bonzini  * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
947b43a1fSPaolo Bonzini  * Author: Alexandra Kossovsky <sasha@oktet.ru>
1047b43a1fSPaolo Bonzini  *         Victor V. Vengerov <vvv@oktet.ru>
1147b43a1fSPaolo Bonzini  *
1247b43a1fSPaolo Bonzini  * The license and distribution terms for this file may be
13*ef95ca03SPhilippe Mathieu-Daudé  * found in this file hereafter or at http://www.rtems.com/license/LICENSE.
14*ef95ca03SPhilippe Mathieu-Daudé  *
15*ef95ca03SPhilippe Mathieu-Daudé  *                       LICENSE INFORMATION
16*ef95ca03SPhilippe Mathieu-Daudé  *
17*ef95ca03SPhilippe Mathieu-Daudé  * RTEMS is free software; you can redistribute it and/or modify it under
18*ef95ca03SPhilippe Mathieu-Daudé  * terms of the GNU General Public License as published by the
19*ef95ca03SPhilippe Mathieu-Daudé  * Free Software Foundation; either version 2, or (at your option) any
20*ef95ca03SPhilippe Mathieu-Daudé  * later version.  RTEMS is distributed in the hope that it will be useful,
21*ef95ca03SPhilippe Mathieu-Daudé  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22*ef95ca03SPhilippe Mathieu-Daudé  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23*ef95ca03SPhilippe Mathieu-Daudé  * General Public License for more details. You should have received
24*ef95ca03SPhilippe Mathieu-Daudé  * a copy of the GNU General Public License along with RTEMS; see
25*ef95ca03SPhilippe Mathieu-Daudé  * file COPYING. If not, write to the Free Software Foundation, 675
26*ef95ca03SPhilippe Mathieu-Daudé  * Mass Ave, Cambridge, MA 02139, USA.
27*ef95ca03SPhilippe Mathieu-Daudé  *
28*ef95ca03SPhilippe Mathieu-Daudé  * As a special exception, including RTEMS header files in a file,
29*ef95ca03SPhilippe Mathieu-Daudé  * instantiating RTEMS generics or templates, or linking other files
30*ef95ca03SPhilippe Mathieu-Daudé  * with RTEMS objects to produce an executable application, does not
31*ef95ca03SPhilippe Mathieu-Daudé  * by itself cause the resulting executable application to be covered
32*ef95ca03SPhilippe Mathieu-Daudé  * by the GNU General Public License. This exception does not
33*ef95ca03SPhilippe Mathieu-Daudé  * however invalidate any other reasons why the executable file might be
34*ef95ca03SPhilippe Mathieu-Daudé  * covered by the GNU Public License.
3547b43a1fSPaolo Bonzini  *
3647b43a1fSPaolo Bonzini  * @(#) sh7750_regs.h,v 1.2.4.1 2003/09/04 18:46:00 joel Exp
3747b43a1fSPaolo Bonzini  */
3847b43a1fSPaolo Bonzini 
392a6a4076SMarkus Armbruster #ifndef SH7750_REGS_H
402a6a4076SMarkus Armbruster #define SH7750_REGS_H
4147b43a1fSPaolo Bonzini 
4247b43a1fSPaolo Bonzini /*
4347b43a1fSPaolo Bonzini  * All register has 2 addresses: in 0xff000000 - 0xffffffff (P4 address)  and
4447b43a1fSPaolo Bonzini  * in 0x1f000000 - 0x1fffffff (area 7 address)
4547b43a1fSPaolo Bonzini  */
4647b43a1fSPaolo Bonzini #define SH7750_P4_BASE       0xff000000	/* Accessible only in
4747b43a1fSPaolo Bonzini 					   privileged mode */
4847b43a1fSPaolo Bonzini #define SH7750_A7_BASE       0x1f000000	/* Accessible only using TLB */
4947b43a1fSPaolo Bonzini 
5047b43a1fSPaolo Bonzini #define SH7750_P4_REG32(ofs) (SH7750_P4_BASE + (ofs))
5147b43a1fSPaolo Bonzini #define SH7750_A7_REG32(ofs) (SH7750_A7_BASE + (ofs))
5247b43a1fSPaolo Bonzini 
5347b43a1fSPaolo Bonzini /*
5447b43a1fSPaolo Bonzini  * MMU Registers
5547b43a1fSPaolo Bonzini  */
5647b43a1fSPaolo Bonzini 
5747b43a1fSPaolo Bonzini /* Page Table Entry High register - PTEH */
5847b43a1fSPaolo Bonzini #define SH7750_PTEH_REGOFS    0x000000	/* offset */
5947b43a1fSPaolo Bonzini #define SH7750_PTEH           SH7750_P4_REG32(SH7750_PTEH_REGOFS)
6047b43a1fSPaolo Bonzini #define SH7750_PTEH_A7        SH7750_A7_REG32(SH7750_PTEH_REGOFS)
6147b43a1fSPaolo Bonzini #define SH7750_PTEH_VPN       0xfffffd00	/* Virtual page number */
6247b43a1fSPaolo Bonzini #define SH7750_PTEH_VPN_S     10
6347b43a1fSPaolo Bonzini #define SH7750_PTEH_ASID      0x000000ff	/* Address space identifier */
6447b43a1fSPaolo Bonzini #define SH7750_PTEH_ASID_S    0
6547b43a1fSPaolo Bonzini 
6647b43a1fSPaolo Bonzini /* Page Table Entry Low register - PTEL */
6747b43a1fSPaolo Bonzini #define SH7750_PTEL_REGOFS    0x000004	/* offset */
6847b43a1fSPaolo Bonzini #define SH7750_PTEL           SH7750_P4_REG32(SH7750_PTEL_REGOFS)
6947b43a1fSPaolo Bonzini #define SH7750_PTEL_A7        SH7750_A7_REG32(SH7750_PTEL_REGOFS)
7047b43a1fSPaolo Bonzini #define SH7750_PTEL_PPN       0x1ffffc00	/* Physical page number */
7147b43a1fSPaolo Bonzini #define SH7750_PTEL_PPN_S     10
7247b43a1fSPaolo Bonzini #define SH7750_PTEL_V         0x00000100	/* Validity (0-entry is invalid) */
7347b43a1fSPaolo Bonzini #define SH7750_PTEL_SZ1       0x00000080	/* Page size bit 1 */
7447b43a1fSPaolo Bonzini #define SH7750_PTEL_SZ0       0x00000010	/* Page size bit 0 */
7547b43a1fSPaolo Bonzini #define SH7750_PTEL_SZ_1KB    0x00000000	/*   1-kbyte page */
7647b43a1fSPaolo Bonzini #define SH7750_PTEL_SZ_4KB    0x00000010	/*   4-kbyte page */
7747b43a1fSPaolo Bonzini #define SH7750_PTEL_SZ_64KB   0x00000080	/*   64-kbyte page */
7847b43a1fSPaolo Bonzini #define SH7750_PTEL_SZ_1MB    0x00000090	/*   1-Mbyte page */
7947b43a1fSPaolo Bonzini #define SH7750_PTEL_PR        0x00000060	/* Protection Key Data */
8047b43a1fSPaolo Bonzini #define SH7750_PTEL_PR_ROPO   0x00000000	/*   read-only in priv mode */
8147b43a1fSPaolo Bonzini #define SH7750_PTEL_PR_RWPO   0x00000020	/*   read-write in priv mode */
8247b43a1fSPaolo Bonzini #define SH7750_PTEL_PR_ROPU   0x00000040	/*   read-only in priv or user mode */
8347b43a1fSPaolo Bonzini #define SH7750_PTEL_PR_RWPU   0x00000060	/*   read-write in priv or user mode */
8447b43a1fSPaolo Bonzini #define SH7750_PTEL_C         0x00000008	/* Cacheability
8547b43a1fSPaolo Bonzini 						   (0 - page not cacheable) */
8647b43a1fSPaolo Bonzini #define SH7750_PTEL_D         0x00000004	/* Dirty bit (1 - write has been
8747b43a1fSPaolo Bonzini 						   performed to a page) */
8847b43a1fSPaolo Bonzini #define SH7750_PTEL_SH        0x00000002	/* Share Status bit (1 - page are
8947b43a1fSPaolo Bonzini 						   shared by processes) */
9047b43a1fSPaolo Bonzini #define SH7750_PTEL_WT        0x00000001	/* Write-through bit, specifies the
9147b43a1fSPaolo Bonzini 						   cache write mode:
9247b43a1fSPaolo Bonzini 						   0 - Copy-back mode
9347b43a1fSPaolo Bonzini 						   1 - Write-through mode */
9447b43a1fSPaolo Bonzini 
9547b43a1fSPaolo Bonzini /* Page Table Entry Assistance register - PTEA */
9647b43a1fSPaolo Bonzini #define SH7750_PTEA_REGOFS    0x000034	/* offset */
9747b43a1fSPaolo Bonzini #define SH7750_PTEA           SH7750_P4_REG32(SH7750_PTEA_REGOFS)
9847b43a1fSPaolo Bonzini #define SH7750_PTEA_A7        SH7750_A7_REG32(SH7750_PTEA_REGOFS)
9947b43a1fSPaolo Bonzini #define SH7750_PTEA_TC        0x00000008	/* Timing Control bit
10047b43a1fSPaolo Bonzini 						   0 - use area 5 wait states
10147b43a1fSPaolo Bonzini 						   1 - use area 6 wait states */
10247b43a1fSPaolo Bonzini #define SH7750_PTEA_SA        0x00000007	/* Space Attribute bits: */
10347b43a1fSPaolo Bonzini #define SH7750_PTEA_SA_UNDEF  0x00000000	/*    0 - undefined */
10447b43a1fSPaolo Bonzini #define SH7750_PTEA_SA_IOVAR  0x00000001	/*    1 - variable-size I/O space */
10547b43a1fSPaolo Bonzini #define SH7750_PTEA_SA_IO8    0x00000002	/*    2 - 8-bit I/O space */
10647b43a1fSPaolo Bonzini #define SH7750_PTEA_SA_IO16   0x00000003	/*    3 - 16-bit I/O space */
10747b43a1fSPaolo Bonzini #define SH7750_PTEA_SA_CMEM8  0x00000004	/*    4 - 8-bit common memory space */
10847b43a1fSPaolo Bonzini #define SH7750_PTEA_SA_CMEM16 0x00000005	/*    5 - 16-bit common memory space */
10947b43a1fSPaolo Bonzini #define SH7750_PTEA_SA_AMEM8  0x00000006	/*    6 - 8-bit attr memory space */
11047b43a1fSPaolo Bonzini #define SH7750_PTEA_SA_AMEM16 0x00000007	/*    7 - 16-bit attr memory space */
11147b43a1fSPaolo Bonzini 
11247b43a1fSPaolo Bonzini 
11347b43a1fSPaolo Bonzini /* Translation table base register */
11447b43a1fSPaolo Bonzini #define SH7750_TTB_REGOFS     0x000008	/* offset */
11547b43a1fSPaolo Bonzini #define SH7750_TTB            SH7750_P4_REG32(SH7750_TTB_REGOFS)
11647b43a1fSPaolo Bonzini #define SH7750_TTB_A7         SH7750_A7_REG32(SH7750_TTB_REGOFS)
11747b43a1fSPaolo Bonzini 
11847b43a1fSPaolo Bonzini /* TLB exeption address register - TEA */
11947b43a1fSPaolo Bonzini #define SH7750_TEA_REGOFS     0x00000c	/* offset */
12047b43a1fSPaolo Bonzini #define SH7750_TEA            SH7750_P4_REG32(SH7750_TEA_REGOFS)
12147b43a1fSPaolo Bonzini #define SH7750_TEA_A7         SH7750_A7_REG32(SH7750_TEA_REGOFS)
12247b43a1fSPaolo Bonzini 
12347b43a1fSPaolo Bonzini /* MMU control register - MMUCR */
12447b43a1fSPaolo Bonzini #define SH7750_MMUCR_REGOFS   0x000010	/* offset */
12547b43a1fSPaolo Bonzini #define SH7750_MMUCR          SH7750_P4_REG32(SH7750_MMUCR_REGOFS)
12647b43a1fSPaolo Bonzini #define SH7750_MMUCR_A7       SH7750_A7_REG32(SH7750_MMUCR_REGOFS)
12747b43a1fSPaolo Bonzini #define SH7750_MMUCR_AT       0x00000001	/* Address translation bit */
12847b43a1fSPaolo Bonzini #define SH7750_MMUCR_TI       0x00000004	/* TLB invalidate */
12947b43a1fSPaolo Bonzini #define SH7750_MMUCR_SV       0x00000100	/* Single Virtual Mode bit */
13047b43a1fSPaolo Bonzini #define SH7750_MMUCR_SQMD     0x00000200	/* Store Queue Mode bit */
13147b43a1fSPaolo Bonzini #define SH7750_MMUCR_URC      0x0000FC00	/* UTLB Replace Counter */
13247b43a1fSPaolo Bonzini #define SH7750_MMUCR_URC_S    10
13347b43a1fSPaolo Bonzini #define SH7750_MMUCR_URB      0x00FC0000	/* UTLB Replace Boundary */
13447b43a1fSPaolo Bonzini #define SH7750_MMUCR_URB_S    18
13547b43a1fSPaolo Bonzini #define SH7750_MMUCR_LRUI     0xFC000000	/* Least Recently Used ITLB */
13647b43a1fSPaolo Bonzini #define SH7750_MMUCR_LRUI_S   26
13747b43a1fSPaolo Bonzini 
13847b43a1fSPaolo Bonzini 
13947b43a1fSPaolo Bonzini 
14047b43a1fSPaolo Bonzini 
14147b43a1fSPaolo Bonzini /*
14247b43a1fSPaolo Bonzini  * Cache registers
14347b43a1fSPaolo Bonzini  *   IC -- instructions cache
14447b43a1fSPaolo Bonzini  *   OC -- operand cache
14547b43a1fSPaolo Bonzini  */
14647b43a1fSPaolo Bonzini 
14747b43a1fSPaolo Bonzini /* Cache Control Register - CCR */
14847b43a1fSPaolo Bonzini #define SH7750_CCR_REGOFS     0x00001c	/* offset */
14947b43a1fSPaolo Bonzini #define SH7750_CCR            SH7750_P4_REG32(SH7750_CCR_REGOFS)
15047b43a1fSPaolo Bonzini #define SH7750_CCR_A7         SH7750_A7_REG32(SH7750_CCR_REGOFS)
15147b43a1fSPaolo Bonzini 
15247b43a1fSPaolo Bonzini #define SH7750_CCR_IIX      0x00008000	/* IC index enable bit */
15347b43a1fSPaolo Bonzini #define SH7750_CCR_ICI      0x00000800	/* IC invalidation bit:
15447b43a1fSPaolo Bonzini 					   set it to clear IC */
15547b43a1fSPaolo Bonzini #define SH7750_CCR_ICE      0x00000100	/* IC enable bit */
15647b43a1fSPaolo Bonzini #define SH7750_CCR_OIX      0x00000080	/* OC index enable bit */
15747b43a1fSPaolo Bonzini #define SH7750_CCR_ORA      0x00000020	/* OC RAM enable bit
15847b43a1fSPaolo Bonzini 					   if you set OCE = 0,
15947b43a1fSPaolo Bonzini 					   you should set ORA = 0 */
16047b43a1fSPaolo Bonzini #define SH7750_CCR_OCI      0x00000008	/* OC invalidation bit */
16147b43a1fSPaolo Bonzini #define SH7750_CCR_CB       0x00000004	/* Copy-back bit for P1 area */
16247b43a1fSPaolo Bonzini #define SH7750_CCR_WT       0x00000002	/* Write-through bit for P0,U0,P3 area */
16347b43a1fSPaolo Bonzini #define SH7750_CCR_OCE      0x00000001	/* OC enable bit */
16447b43a1fSPaolo Bonzini 
16547b43a1fSPaolo Bonzini /* Queue address control register 0 - QACR0 */
16647b43a1fSPaolo Bonzini #define SH7750_QACR0_REGOFS   0x000038	/* offset */
16747b43a1fSPaolo Bonzini #define SH7750_QACR0          SH7750_P4_REG32(SH7750_QACR0_REGOFS)
16847b43a1fSPaolo Bonzini #define SH7750_QACR0_A7       SH7750_A7_REG32(SH7750_QACR0_REGOFS)
16947b43a1fSPaolo Bonzini 
17047b43a1fSPaolo Bonzini /* Queue address control register 1 - QACR1 */
17147b43a1fSPaolo Bonzini #define SH7750_QACR1_REGOFS   0x00003c	/* offset */
17247b43a1fSPaolo Bonzini #define SH7750_QACR1          SH7750_P4_REG32(SH7750_QACR1_REGOFS)
17347b43a1fSPaolo Bonzini #define SH7750_QACR1_A7       SH7750_A7_REG32(SH7750_QACR1_REGOFS)
17447b43a1fSPaolo Bonzini 
17547b43a1fSPaolo Bonzini 
17647b43a1fSPaolo Bonzini /*
17747b43a1fSPaolo Bonzini  * Exeption-related registers
17847b43a1fSPaolo Bonzini  */
17947b43a1fSPaolo Bonzini 
18047b43a1fSPaolo Bonzini /* Immediate data for TRAPA instruction - TRA */
18147b43a1fSPaolo Bonzini #define SH7750_TRA_REGOFS     0x000020	/* offset */
18247b43a1fSPaolo Bonzini #define SH7750_TRA            SH7750_P4_REG32(SH7750_TRA_REGOFS)
18347b43a1fSPaolo Bonzini #define SH7750_TRA_A7         SH7750_A7_REG32(SH7750_TRA_REGOFS)
18447b43a1fSPaolo Bonzini 
18547b43a1fSPaolo Bonzini #define SH7750_TRA_IMM      0x000003fd	/* Immediate data operand */
18647b43a1fSPaolo Bonzini #define SH7750_TRA_IMM_S    2
18747b43a1fSPaolo Bonzini 
18847b43a1fSPaolo Bonzini /* Exeption event register - EXPEVT */
18947b43a1fSPaolo Bonzini #define SH7750_EXPEVT_REGOFS  0x000024
19047b43a1fSPaolo Bonzini #define SH7750_EXPEVT         SH7750_P4_REG32(SH7750_EXPEVT_REGOFS)
19147b43a1fSPaolo Bonzini #define SH7750_EXPEVT_A7      SH7750_A7_REG32(SH7750_EXPEVT_REGOFS)
19247b43a1fSPaolo Bonzini 
19347b43a1fSPaolo Bonzini #define SH7750_EXPEVT_EX      0x00000fff	/* Exeption code */
19447b43a1fSPaolo Bonzini #define SH7750_EXPEVT_EX_S    0
19547b43a1fSPaolo Bonzini 
19647b43a1fSPaolo Bonzini /* Interrupt event register */
19747b43a1fSPaolo Bonzini #define SH7750_INTEVT_REGOFS  0x000028
19847b43a1fSPaolo Bonzini #define SH7750_INTEVT         SH7750_P4_REG32(SH7750_INTEVT_REGOFS)
19947b43a1fSPaolo Bonzini #define SH7750_INTEVT_A7      SH7750_A7_REG32(SH7750_INTEVT_REGOFS)
20047b43a1fSPaolo Bonzini #define SH7750_INTEVT_EX    0x00000fff	/* Exeption code */
20147b43a1fSPaolo Bonzini #define SH7750_INTEVT_EX_S  0
20247b43a1fSPaolo Bonzini 
20347b43a1fSPaolo Bonzini /*
20447b43a1fSPaolo Bonzini  * Exception/interrupt codes
20547b43a1fSPaolo Bonzini  */
20647b43a1fSPaolo Bonzini #define SH7750_EVT_TO_NUM(evt)  ((evt) >> 5)
20747b43a1fSPaolo Bonzini 
20847b43a1fSPaolo Bonzini /* Reset exception category */
20947b43a1fSPaolo Bonzini #define SH7750_EVT_POWER_ON_RST        0x000	/* Power-on reset */
21047b43a1fSPaolo Bonzini #define SH7750_EVT_MANUAL_RST          0x020	/* Manual reset */
21147b43a1fSPaolo Bonzini #define SH7750_EVT_TLB_MULT_HIT        0x140	/* TLB multiple-hit exception */
21247b43a1fSPaolo Bonzini 
21347b43a1fSPaolo Bonzini /* General exception category */
21447b43a1fSPaolo Bonzini #define SH7750_EVT_USER_BREAK          0x1E0	/* User break */
21547b43a1fSPaolo Bonzini #define SH7750_EVT_IADDR_ERR           0x0E0	/* Instruction address error */
21647b43a1fSPaolo Bonzini #define SH7750_EVT_TLB_READ_MISS       0x040	/* ITLB miss exception /
21747b43a1fSPaolo Bonzini 						   DTLB miss exception (read) */
21847b43a1fSPaolo Bonzini #define SH7750_EVT_TLB_READ_PROTV      0x0A0	/* ITLB protection violation /
21947b43a1fSPaolo Bonzini 						   DTLB protection violation (read) */
22047b43a1fSPaolo Bonzini #define SH7750_EVT_ILLEGAL_INSTR       0x180	/* General Illegal Instruction
22147b43a1fSPaolo Bonzini 						   exception */
22247b43a1fSPaolo Bonzini #define SH7750_EVT_SLOT_ILLEGAL_INSTR  0x1A0	/* Slot Illegal Instruction
22347b43a1fSPaolo Bonzini 						   exception */
22447b43a1fSPaolo Bonzini #define SH7750_EVT_FPU_DISABLE         0x800	/* General FPU disable exception */
22547b43a1fSPaolo Bonzini #define SH7750_EVT_SLOT_FPU_DISABLE    0x820	/* Slot FPU disable exception */
22647b43a1fSPaolo Bonzini #define SH7750_EVT_DATA_READ_ERR       0x0E0	/* Data address error (read) */
22747b43a1fSPaolo Bonzini #define SH7750_EVT_DATA_WRITE_ERR      0x100	/* Data address error (write) */
22847b43a1fSPaolo Bonzini #define SH7750_EVT_DTLB_WRITE_MISS     0x060	/* DTLB miss exception (write) */
22947b43a1fSPaolo Bonzini #define SH7750_EVT_DTLB_WRITE_PROTV    0x0C0	/* DTLB protection violation
23047b43a1fSPaolo Bonzini 						   exception (write) */
23147b43a1fSPaolo Bonzini #define SH7750_EVT_FPU_EXCEPTION       0x120	/* FPU exception */
23247b43a1fSPaolo Bonzini #define SH7750_EVT_INITIAL_PGWRITE     0x080	/* Initial Page Write exception */
23347b43a1fSPaolo Bonzini #define SH7750_EVT_TRAPA               0x160	/* Unconditional trap (TRAPA) */
23447b43a1fSPaolo Bonzini 
23547b43a1fSPaolo Bonzini /* Interrupt exception category */
23647b43a1fSPaolo Bonzini #define SH7750_EVT_NMI                 0x1C0	/* Non-maskable interrupt */
23747b43a1fSPaolo Bonzini #define SH7750_EVT_IRQ0                0x200	/* External Interrupt 0 */
23847b43a1fSPaolo Bonzini #define SH7750_EVT_IRQ1                0x220	/* External Interrupt 1 */
23947b43a1fSPaolo Bonzini #define SH7750_EVT_IRQ2                0x240	/* External Interrupt 2 */
24047b43a1fSPaolo Bonzini #define SH7750_EVT_IRQ3                0x260	/* External Interrupt 3 */
24147b43a1fSPaolo Bonzini #define SH7750_EVT_IRQ4                0x280	/* External Interrupt 4 */
24247b43a1fSPaolo Bonzini #define SH7750_EVT_IRQ5                0x2A0	/* External Interrupt 5 */
24347b43a1fSPaolo Bonzini #define SH7750_EVT_IRQ6                0x2C0	/* External Interrupt 6 */
24447b43a1fSPaolo Bonzini #define SH7750_EVT_IRQ7                0x2E0	/* External Interrupt 7 */
24547b43a1fSPaolo Bonzini #define SH7750_EVT_IRQ8                0x300	/* External Interrupt 8 */
24647b43a1fSPaolo Bonzini #define SH7750_EVT_IRQ9                0x320	/* External Interrupt 9 */
24747b43a1fSPaolo Bonzini #define SH7750_EVT_IRQA                0x340	/* External Interrupt A */
24847b43a1fSPaolo Bonzini #define SH7750_EVT_IRQB                0x360	/* External Interrupt B */
24947b43a1fSPaolo Bonzini #define SH7750_EVT_IRQC                0x380	/* External Interrupt C */
25047b43a1fSPaolo Bonzini #define SH7750_EVT_IRQD                0x3A0	/* External Interrupt D */
25147b43a1fSPaolo Bonzini #define SH7750_EVT_IRQE                0x3C0	/* External Interrupt E */
25247b43a1fSPaolo Bonzini 
25347b43a1fSPaolo Bonzini /* Peripheral Module Interrupts - Timer Unit (TMU) */
25447b43a1fSPaolo Bonzini #define SH7750_EVT_TUNI0               0x400	/* TMU Underflow Interrupt 0 */
25547b43a1fSPaolo Bonzini #define SH7750_EVT_TUNI1               0x420	/* TMU Underflow Interrupt 1 */
25647b43a1fSPaolo Bonzini #define SH7750_EVT_TUNI2               0x440	/* TMU Underflow Interrupt 2 */
25747b43a1fSPaolo Bonzini #define SH7750_EVT_TICPI2              0x460	/* TMU Input Capture Interrupt 2 */
25847b43a1fSPaolo Bonzini 
25947b43a1fSPaolo Bonzini /* Peripheral Module Interrupts - Real-Time Clock (RTC) */
26047b43a1fSPaolo Bonzini #define SH7750_EVT_RTC_ATI             0x480	/* Alarm Interrupt Request */
26147b43a1fSPaolo Bonzini #define SH7750_EVT_RTC_PRI             0x4A0	/* Periodic Interrupt Request */
26247b43a1fSPaolo Bonzini #define SH7750_EVT_RTC_CUI             0x4C0	/* Carry Interrupt Request */
26347b43a1fSPaolo Bonzini 
26447b43a1fSPaolo Bonzini /* Peripheral Module Interrupts - Serial Communication Interface (SCI) */
26547b43a1fSPaolo Bonzini #define SH7750_EVT_SCI_ERI             0x4E0	/* Receive Error */
26647b43a1fSPaolo Bonzini #define SH7750_EVT_SCI_RXI             0x500	/* Receive Data Register Full */
26747b43a1fSPaolo Bonzini #define SH7750_EVT_SCI_TXI             0x520	/* Transmit Data Register Empty */
26847b43a1fSPaolo Bonzini #define SH7750_EVT_SCI_TEI             0x540	/* Transmit End */
26947b43a1fSPaolo Bonzini 
27047b43a1fSPaolo Bonzini /* Peripheral Module Interrupts - Watchdog Timer (WDT) */
27147b43a1fSPaolo Bonzini #define SH7750_EVT_WDT_ITI             0x560	/* Interval Timer Interrupt
27247b43a1fSPaolo Bonzini 						   (used when WDT operates in
27347b43a1fSPaolo Bonzini 						   interval timer mode) */
27447b43a1fSPaolo Bonzini 
27547b43a1fSPaolo Bonzini /* Peripheral Module Interrupts - Memory Refresh Unit (REF) */
27647b43a1fSPaolo Bonzini #define SH7750_EVT_REF_RCMI            0x580	/* Compare-match Interrupt */
27747b43a1fSPaolo Bonzini #define SH7750_EVT_REF_ROVI            0x5A0	/* Refresh Counter Overflow
27847b43a1fSPaolo Bonzini 						   interrupt */
27947b43a1fSPaolo Bonzini 
28047b43a1fSPaolo Bonzini /* Peripheral Module Interrupts - Hitachi User Debug Interface (H-UDI) */
28147b43a1fSPaolo Bonzini #define SH7750_EVT_HUDI                0x600	/* UDI interrupt */
28247b43a1fSPaolo Bonzini 
28347b43a1fSPaolo Bonzini /* Peripheral Module Interrupts - General-Purpose I/O (GPIO) */
28447b43a1fSPaolo Bonzini #define SH7750_EVT_GPIO                0x620	/* GPIO Interrupt */
28547b43a1fSPaolo Bonzini 
28647b43a1fSPaolo Bonzini /* Peripheral Module Interrupts - DMA Controller (DMAC) */
28747b43a1fSPaolo Bonzini #define SH7750_EVT_DMAC_DMTE0          0x640	/* DMAC 0 Transfer End Interrupt */
28847b43a1fSPaolo Bonzini #define SH7750_EVT_DMAC_DMTE1          0x660	/* DMAC 1 Transfer End Interrupt */
28947b43a1fSPaolo Bonzini #define SH7750_EVT_DMAC_DMTE2          0x680	/* DMAC 2 Transfer End Interrupt */
29047b43a1fSPaolo Bonzini #define SH7750_EVT_DMAC_DMTE3          0x6A0	/* DMAC 3 Transfer End Interrupt */
29147b43a1fSPaolo Bonzini #define SH7750_EVT_DMAC_DMAE           0x6C0	/* DMAC Address Error Interrupt */
29247b43a1fSPaolo Bonzini 
29347b43a1fSPaolo Bonzini /* Peripheral Module Interrupts - Serial Communication Interface with FIFO */
29447b43a1fSPaolo Bonzini /*                                                                  (SCIF) */
29547b43a1fSPaolo Bonzini #define SH7750_EVT_SCIF_ERI            0x700	/* Receive Error */
29647b43a1fSPaolo Bonzini #define SH7750_EVT_SCIF_RXI            0x720	/* Receive FIFO Data Full or
29747b43a1fSPaolo Bonzini 						   Receive Data ready interrupt */
29847b43a1fSPaolo Bonzini #define SH7750_EVT_SCIF_BRI            0x740	/* Break or overrun error */
29947b43a1fSPaolo Bonzini #define SH7750_EVT_SCIF_TXI            0x760	/* Transmit FIFO Data Empty */
30047b43a1fSPaolo Bonzini 
30147b43a1fSPaolo Bonzini /*
30247b43a1fSPaolo Bonzini  * Power Management
30347b43a1fSPaolo Bonzini  */
30447b43a1fSPaolo Bonzini #define SH7750_STBCR_REGOFS   0xC00004	/* offset */
30547b43a1fSPaolo Bonzini #define SH7750_STBCR          SH7750_P4_REG32(SH7750_STBCR_REGOFS)
30647b43a1fSPaolo Bonzini #define SH7750_STBCR_A7       SH7750_A7_REG32(SH7750_STBCR_REGOFS)
30747b43a1fSPaolo Bonzini 
30847b43a1fSPaolo Bonzini #define SH7750_STBCR_STBY     0x80	/* Specifies a transition to standby mode:
30947b43a1fSPaolo Bonzini 					   0 - Transition to SLEEP mode on SLEEP
31047b43a1fSPaolo Bonzini 					   1 - Transition to STANDBY mode on SLEEP */
31147b43a1fSPaolo Bonzini #define SH7750_STBCR_PHZ      0x40	/* State of peripheral module pins in
31247b43a1fSPaolo Bonzini 					   standby mode:
31347b43a1fSPaolo Bonzini 					   0 - normal state
31447b43a1fSPaolo Bonzini 					   1 - high-impendance state */
31547b43a1fSPaolo Bonzini 
31647b43a1fSPaolo Bonzini #define SH7750_STBCR_PPU      0x20	/* Peripheral module pins pull-up controls */
31747b43a1fSPaolo Bonzini #define SH7750_STBCR_MSTP4    0x10	/* Stopping the clock supply to DMAC */
31847b43a1fSPaolo Bonzini #define SH7750_STBCR_DMAC_STP SH7750_STBCR_MSTP4
31947b43a1fSPaolo Bonzini #define SH7750_STBCR_MSTP3    0x08	/* Stopping the clock supply to SCIF */
32047b43a1fSPaolo Bonzini #define SH7750_STBCR_SCIF_STP SH7750_STBCR_MSTP3
32147b43a1fSPaolo Bonzini #define SH7750_STBCR_MSTP2    0x04	/* Stopping the clock supply to TMU */
32247b43a1fSPaolo Bonzini #define SH7750_STBCR_TMU_STP  SH7750_STBCR_MSTP2
32347b43a1fSPaolo Bonzini #define SH7750_STBCR_MSTP1    0x02	/* Stopping the clock supply to RTC */
32447b43a1fSPaolo Bonzini #define SH7750_STBCR_RTC_STP  SH7750_STBCR_MSTP1
32547b43a1fSPaolo Bonzini #define SH7750_STBCR_MSPT0    0x01	/* Stopping the clock supply to SCI */
32647b43a1fSPaolo Bonzini #define SH7750_STBCR_SCI_STP  SH7750_STBCR_MSTP0
32747b43a1fSPaolo Bonzini 
32847b43a1fSPaolo Bonzini #define SH7750_STBCR_STBY     0x80
32947b43a1fSPaolo Bonzini 
33047b43a1fSPaolo Bonzini 
33147b43a1fSPaolo Bonzini #define SH7750_STBCR2_REGOFS  0xC00010	/* offset */
33247b43a1fSPaolo Bonzini #define SH7750_STBCR2         SH7750_P4_REG32(SH7750_STBCR2_REGOFS)
33347b43a1fSPaolo Bonzini #define SH7750_STBCR2_A7      SH7750_A7_REG32(SH7750_STBCR2_REGOFS)
33447b43a1fSPaolo Bonzini 
33547b43a1fSPaolo Bonzini #define SH7750_STBCR2_DSLP    0x80	/* Specifies transition to deep sleep mode:
33647b43a1fSPaolo Bonzini 					   0 - transition to sleep or standby mode
33747b43a1fSPaolo Bonzini 					   as it is specified in STBY bit
33847b43a1fSPaolo Bonzini 					   1 - transition to deep sleep mode on
33947b43a1fSPaolo Bonzini 					   execution of SLEEP instruction */
34047b43a1fSPaolo Bonzini #define SH7750_STBCR2_MSTP6   0x02	/* Stopping the clock supply to Store Queue
34147b43a1fSPaolo Bonzini 					   in the cache controller */
34247b43a1fSPaolo Bonzini #define SH7750_STBCR2_SQ_STP  SH7750_STBCR2_MSTP6
34347b43a1fSPaolo Bonzini #define SH7750_STBCR2_MSTP5   0x01	/* Stopping the clock supply to the User
34447b43a1fSPaolo Bonzini 					   Break Controller (UBC) */
34547b43a1fSPaolo Bonzini #define SH7750_STBCR2_UBC_STP SH7750_STBCR2_MSTP5
34647b43a1fSPaolo Bonzini 
34747b43a1fSPaolo Bonzini /*
34847b43a1fSPaolo Bonzini  * Clock Pulse Generator (CPG)
34947b43a1fSPaolo Bonzini  */
35047b43a1fSPaolo Bonzini #define SH7750_FRQCR_REGOFS   0xC00000	/* offset */
35147b43a1fSPaolo Bonzini #define SH7750_FRQCR          SH7750_P4_REG32(SH7750_FRQCR_REGOFS)
35247b43a1fSPaolo Bonzini #define SH7750_FRQCR_A7       SH7750_A7_REG32(SH7750_FRQCR_REGOFS)
35347b43a1fSPaolo Bonzini 
35447b43a1fSPaolo Bonzini #define SH7750_FRQCR_CKOEN    0x0800	/* Clock Output Enable
35547b43a1fSPaolo Bonzini 					   0 - CKIO pin goes to HiZ/pullup
35647b43a1fSPaolo Bonzini 					   1 - Clock is output from CKIO */
35747b43a1fSPaolo Bonzini #define SH7750_FRQCR_PLL1EN   0x0400	/* PLL circuit 1 enable */
35847b43a1fSPaolo Bonzini #define SH7750_FRQCR_PLL2EN   0x0200	/* PLL circuit 2 enable */
35947b43a1fSPaolo Bonzini 
36047b43a1fSPaolo Bonzini #define SH7750_FRQCR_IFC      0x01C0	/* CPU clock frequency division ratio: */
36147b43a1fSPaolo Bonzini #define SH7750_FRQCR_IFCDIV1  0x0000	/*    0 - * 1 */
36247b43a1fSPaolo Bonzini #define SH7750_FRQCR_IFCDIV2  0x0040	/*    1 - * 1/2 */
36347b43a1fSPaolo Bonzini #define SH7750_FRQCR_IFCDIV3  0x0080	/*    2 - * 1/3 */
36447b43a1fSPaolo Bonzini #define SH7750_FRQCR_IFCDIV4  0x00C0	/*    3 - * 1/4 */
36547b43a1fSPaolo Bonzini #define SH7750_FRQCR_IFCDIV6  0x0100	/*    4 - * 1/6 */
36647b43a1fSPaolo Bonzini #define SH7750_FRQCR_IFCDIV8  0x0140	/*    5 - * 1/8 */
36747b43a1fSPaolo Bonzini 
36847b43a1fSPaolo Bonzini #define SH7750_FRQCR_BFC      0x0038	/* Bus clock frequency division ratio: */
36947b43a1fSPaolo Bonzini #define SH7750_FRQCR_BFCDIV1  0x0000	/*    0 - * 1 */
37047b43a1fSPaolo Bonzini #define SH7750_FRQCR_BFCDIV2  0x0008	/*    1 - * 1/2 */
37147b43a1fSPaolo Bonzini #define SH7750_FRQCR_BFCDIV3  0x0010	/*    2 - * 1/3 */
37247b43a1fSPaolo Bonzini #define SH7750_FRQCR_BFCDIV4  0x0018	/*    3 - * 1/4 */
37347b43a1fSPaolo Bonzini #define SH7750_FRQCR_BFCDIV6  0x0020	/*    4 - * 1/6 */
37447b43a1fSPaolo Bonzini #define SH7750_FRQCR_BFCDIV8  0x0028	/*    5 - * 1/8 */
37547b43a1fSPaolo Bonzini 
37647b43a1fSPaolo Bonzini #define SH7750_FRQCR_PFC      0x0007	/* Peripheral module clock frequency
37747b43a1fSPaolo Bonzini 					   division ratio: */
37847b43a1fSPaolo Bonzini #define SH7750_FRQCR_PFCDIV2  0x0000	/*    0 - * 1/2 */
37947b43a1fSPaolo Bonzini #define SH7750_FRQCR_PFCDIV3  0x0001	/*    1 - * 1/3 */
38047b43a1fSPaolo Bonzini #define SH7750_FRQCR_PFCDIV4  0x0002	/*    2 - * 1/4 */
38147b43a1fSPaolo Bonzini #define SH7750_FRQCR_PFCDIV6  0x0003	/*    3 - * 1/6 */
38247b43a1fSPaolo Bonzini #define SH7750_FRQCR_PFCDIV8  0x0004	/*    4 - * 1/8 */
38347b43a1fSPaolo Bonzini 
38447b43a1fSPaolo Bonzini /*
38547b43a1fSPaolo Bonzini  * Watchdog Timer (WDT)
38647b43a1fSPaolo Bonzini  */
38747b43a1fSPaolo Bonzini 
38847b43a1fSPaolo Bonzini /* Watchdog Timer Counter register - WTCNT */
38947b43a1fSPaolo Bonzini #define SH7750_WTCNT_REGOFS   0xC00008	/* offset */
39047b43a1fSPaolo Bonzini #define SH7750_WTCNT          SH7750_P4_REG32(SH7750_WTCNT_REGOFS)
39147b43a1fSPaolo Bonzini #define SH7750_WTCNT_A7       SH7750_A7_REG32(SH7750_WTCNT_REGOFS)
39247b43a1fSPaolo Bonzini #define SH7750_WTCNT_KEY      0x5A00	/* When WTCNT byte register written,
39347b43a1fSPaolo Bonzini 					   you have to set the upper byte to
39447b43a1fSPaolo Bonzini 					   0x5A */
39547b43a1fSPaolo Bonzini 
39647b43a1fSPaolo Bonzini /* Watchdog Timer Control/Status register - WTCSR */
39747b43a1fSPaolo Bonzini #define SH7750_WTCSR_REGOFS   0xC0000C	/* offset */
39847b43a1fSPaolo Bonzini #define SH7750_WTCSR          SH7750_P4_REG32(SH7750_WTCSR_REGOFS)
39947b43a1fSPaolo Bonzini #define SH7750_WTCSR_A7       SH7750_A7_REG32(SH7750_WTCSR_REGOFS)
40047b43a1fSPaolo Bonzini #define SH7750_WTCSR_KEY      0xA500	/* When WTCSR byte register written,
40147b43a1fSPaolo Bonzini 					   you have to set the upper byte to
40247b43a1fSPaolo Bonzini 					   0xA5 */
40347b43a1fSPaolo Bonzini #define SH7750_WTCSR_TME      0x80	/* Timer enable (1-upcount start) */
40447b43a1fSPaolo Bonzini #define SH7750_WTCSR_MODE     0x40	/* Timer Mode Select: */
40547b43a1fSPaolo Bonzini #define SH7750_WTCSR_MODE_WT  0x40	/*    Watchdog Timer Mode */
40647b43a1fSPaolo Bonzini #define SH7750_WTCSR_MODE_IT  0x00	/*    Interval Timer Mode */
40747b43a1fSPaolo Bonzini #define SH7750_WTCSR_RSTS     0x20	/* Reset Select: */
40847b43a1fSPaolo Bonzini #define SH7750_WTCSR_RST_MAN  0x20	/*    Manual Reset */
40947b43a1fSPaolo Bonzini #define SH7750_WTCSR_RST_PWR  0x00	/*    Power-on Reset */
41047b43a1fSPaolo Bonzini #define SH7750_WTCSR_WOVF     0x10	/* Watchdog Timer Overflow Flag */
41147b43a1fSPaolo Bonzini #define SH7750_WTCSR_IOVF     0x08	/* Interval Timer Overflow Flag */
41247b43a1fSPaolo Bonzini #define SH7750_WTCSR_CKS      0x07	/* Clock Select: */
41347b43a1fSPaolo Bonzini #define SH7750_WTCSR_CKS_DIV32   0x00	/*   1/32 of frequency divider 2 input */
41447b43a1fSPaolo Bonzini #define SH7750_WTCSR_CKS_DIV64   0x01	/*   1/64 */
41547b43a1fSPaolo Bonzini #define SH7750_WTCSR_CKS_DIV128  0x02	/*   1/128 */
41647b43a1fSPaolo Bonzini #define SH7750_WTCSR_CKS_DIV256  0x03	/*   1/256 */
41747b43a1fSPaolo Bonzini #define SH7750_WTCSR_CKS_DIV512  0x04	/*   1/512 */
41847b43a1fSPaolo Bonzini #define SH7750_WTCSR_CKS_DIV1024 0x05	/*   1/1024 */
41947b43a1fSPaolo Bonzini #define SH7750_WTCSR_CKS_DIV2048 0x06	/*   1/2048 */
42047b43a1fSPaolo Bonzini #define SH7750_WTCSR_CKS_DIV4096 0x07	/*   1/4096 */
42147b43a1fSPaolo Bonzini 
42247b43a1fSPaolo Bonzini /*
42347b43a1fSPaolo Bonzini  * Real-Time Clock (RTC)
42447b43a1fSPaolo Bonzini  */
42547b43a1fSPaolo Bonzini /* 64-Hz Counter Register (byte, read-only) - R64CNT */
42647b43a1fSPaolo Bonzini #define SH7750_R64CNT_REGOFS  0xC80000	/* offset */
42747b43a1fSPaolo Bonzini #define SH7750_R64CNT         SH7750_P4_REG32(SH7750_R64CNT_REGOFS)
42847b43a1fSPaolo Bonzini #define SH7750_R64CNT_A7      SH7750_A7_REG32(SH7750_R64CNT_REGOFS)
42947b43a1fSPaolo Bonzini 
43047b43a1fSPaolo Bonzini /* Second Counter Register (byte, BCD-coded) - RSECCNT */
43147b43a1fSPaolo Bonzini #define SH7750_RSECCNT_REGOFS 0xC80004	/* offset */
43247b43a1fSPaolo Bonzini #define SH7750_RSECCNT        SH7750_P4_REG32(SH7750_RSECCNT_REGOFS)
43347b43a1fSPaolo Bonzini #define SH7750_RSECCNT_A7     SH7750_A7_REG32(SH7750_RSECCNT_REGOFS)
43447b43a1fSPaolo Bonzini 
43547b43a1fSPaolo Bonzini /* Minute Counter Register (byte, BCD-coded) - RMINCNT */
43647b43a1fSPaolo Bonzini #define SH7750_RMINCNT_REGOFS 0xC80008	/* offset */
43747b43a1fSPaolo Bonzini #define SH7750_RMINCNT        SH7750_P4_REG32(SH7750_RMINCNT_REGOFS)
43847b43a1fSPaolo Bonzini #define SH7750_RMINCNT_A7     SH7750_A7_REG32(SH7750_RMINCNT_REGOFS)
43947b43a1fSPaolo Bonzini 
44047b43a1fSPaolo Bonzini /* Hour Counter Register (byte, BCD-coded) - RHRCNT */
44147b43a1fSPaolo Bonzini #define SH7750_RHRCNT_REGOFS  0xC8000C	/* offset */
44247b43a1fSPaolo Bonzini #define SH7750_RHRCNT         SH7750_P4_REG32(SH7750_RHRCNT_REGOFS)
44347b43a1fSPaolo Bonzini #define SH7750_RHRCNT_A7      SH7750_A7_REG32(SH7750_RHRCNT_REGOFS)
44447b43a1fSPaolo Bonzini 
44547b43a1fSPaolo Bonzini /* Day-of-Week Counter Register (byte) - RWKCNT */
44647b43a1fSPaolo Bonzini #define SH7750_RWKCNT_REGOFS  0xC80010	/* offset */
44747b43a1fSPaolo Bonzini #define SH7750_RWKCNT         SH7750_P4_REG32(SH7750_RWKCNT_REGOFS)
44847b43a1fSPaolo Bonzini #define SH7750_RWKCNT_A7      SH7750_A7_REG32(SH7750_RWKCNT_REGOFS)
44947b43a1fSPaolo Bonzini 
45047b43a1fSPaolo Bonzini #define SH7750_RWKCNT_SUN     0	/* Sunday */
45147b43a1fSPaolo Bonzini #define SH7750_RWKCNT_MON     1	/* Monday */
45247b43a1fSPaolo Bonzini #define SH7750_RWKCNT_TUE     2	/* Tuesday */
45347b43a1fSPaolo Bonzini #define SH7750_RWKCNT_WED     3	/* Wednesday */
45447b43a1fSPaolo Bonzini #define SH7750_RWKCNT_THU     4	/* Thursday */
45547b43a1fSPaolo Bonzini #define SH7750_RWKCNT_FRI     5	/* Friday */
45647b43a1fSPaolo Bonzini #define SH7750_RWKCNT_SAT     6	/* Saturday */
45747b43a1fSPaolo Bonzini 
45847b43a1fSPaolo Bonzini /* Day Counter Register (byte, BCD-coded) - RDAYCNT */
45947b43a1fSPaolo Bonzini #define SH7750_RDAYCNT_REGOFS 0xC80014	/* offset */
46047b43a1fSPaolo Bonzini #define SH7750_RDAYCNT        SH7750_P4_REG32(SH7750_RDAYCNT_REGOFS)
46147b43a1fSPaolo Bonzini #define SH7750_RDAYCNT_A7     SH7750_A7_REG32(SH7750_RDAYCNT_REGOFS)
46247b43a1fSPaolo Bonzini 
46347b43a1fSPaolo Bonzini /* Month Counter Register (byte, BCD-coded) - RMONCNT */
46447b43a1fSPaolo Bonzini #define SH7750_RMONCNT_REGOFS 0xC80018	/* offset */
46547b43a1fSPaolo Bonzini #define SH7750_RMONCNT        SH7750_P4_REG32(SH7750_RMONCNT_REGOFS)
46647b43a1fSPaolo Bonzini #define SH7750_RMONCNT_A7     SH7750_A7_REG32(SH7750_RMONCNT_REGOFS)
46747b43a1fSPaolo Bonzini 
46847b43a1fSPaolo Bonzini /* Year Counter Register (half, BCD-coded) - RYRCNT */
46947b43a1fSPaolo Bonzini #define SH7750_RYRCNT_REGOFS  0xC8001C	/* offset */
47047b43a1fSPaolo Bonzini #define SH7750_RYRCNT         SH7750_P4_REG32(SH7750_RYRCNT_REGOFS)
47147b43a1fSPaolo Bonzini #define SH7750_RYRCNT_A7      SH7750_A7_REG32(SH7750_RYRCNT_REGOFS)
47247b43a1fSPaolo Bonzini 
47347b43a1fSPaolo Bonzini /* Second Alarm Register (byte, BCD-coded) - RSECAR */
47447b43a1fSPaolo Bonzini #define SH7750_RSECAR_REGOFS  0xC80020	/* offset */
47547b43a1fSPaolo Bonzini #define SH7750_RSECAR         SH7750_P4_REG32(SH7750_RSECAR_REGOFS)
47647b43a1fSPaolo Bonzini #define SH7750_RSECAR_A7      SH7750_A7_REG32(SH7750_RSECAR_REGOFS)
47747b43a1fSPaolo Bonzini #define SH7750_RSECAR_ENB     0x80	/* Second Alarm Enable */
47847b43a1fSPaolo Bonzini 
47947b43a1fSPaolo Bonzini /* Minute Alarm Register (byte, BCD-coded) - RMINAR */
48047b43a1fSPaolo Bonzini #define SH7750_RMINAR_REGOFS  0xC80024	/* offset */
48147b43a1fSPaolo Bonzini #define SH7750_RMINAR         SH7750_P4_REG32(SH7750_RMINAR_REGOFS)
48247b43a1fSPaolo Bonzini #define SH7750_RMINAR_A7      SH7750_A7_REG32(SH7750_RMINAR_REGOFS)
48347b43a1fSPaolo Bonzini #define SH7750_RMINAR_ENB     0x80	/* Minute Alarm Enable */
48447b43a1fSPaolo Bonzini 
48547b43a1fSPaolo Bonzini /* Hour Alarm Register (byte, BCD-coded) - RHRAR */
48647b43a1fSPaolo Bonzini #define SH7750_RHRAR_REGOFS   0xC80028	/* offset */
48747b43a1fSPaolo Bonzini #define SH7750_RHRAR          SH7750_P4_REG32(SH7750_RHRAR_REGOFS)
48847b43a1fSPaolo Bonzini #define SH7750_RHRAR_A7       SH7750_A7_REG32(SH7750_RHRAR_REGOFS)
48947b43a1fSPaolo Bonzini #define SH7750_RHRAR_ENB      0x80	/* Hour Alarm Enable */
49047b43a1fSPaolo Bonzini 
49147b43a1fSPaolo Bonzini /* Day-of-Week Alarm Register (byte) - RWKAR */
49247b43a1fSPaolo Bonzini #define SH7750_RWKAR_REGOFS   0xC8002C	/* offset */
49347b43a1fSPaolo Bonzini #define SH7750_RWKAR          SH7750_P4_REG32(SH7750_RWKAR_REGOFS)
49447b43a1fSPaolo Bonzini #define SH7750_RWKAR_A7       SH7750_A7_REG32(SH7750_RWKAR_REGOFS)
49547b43a1fSPaolo Bonzini #define SH7750_RWKAR_ENB      0x80	/* Day-of-week Alarm Enable */
49647b43a1fSPaolo Bonzini 
49747b43a1fSPaolo Bonzini #define SH7750_RWKAR_SUN      0	/* Sunday */
49847b43a1fSPaolo Bonzini #define SH7750_RWKAR_MON      1	/* Monday */
49947b43a1fSPaolo Bonzini #define SH7750_RWKAR_TUE      2	/* Tuesday */
50047b43a1fSPaolo Bonzini #define SH7750_RWKAR_WED      3	/* Wednesday */
50147b43a1fSPaolo Bonzini #define SH7750_RWKAR_THU      4	/* Thursday */
50247b43a1fSPaolo Bonzini #define SH7750_RWKAR_FRI      5	/* Friday */
50347b43a1fSPaolo Bonzini #define SH7750_RWKAR_SAT      6	/* Saturday */
50447b43a1fSPaolo Bonzini 
50547b43a1fSPaolo Bonzini /* Day Alarm Register (byte, BCD-coded) - RDAYAR */
50647b43a1fSPaolo Bonzini #define SH7750_RDAYAR_REGOFS  0xC80030	/* offset */
50747b43a1fSPaolo Bonzini #define SH7750_RDAYAR         SH7750_P4_REG32(SH7750_RDAYAR_REGOFS)
50847b43a1fSPaolo Bonzini #define SH7750_RDAYAR_A7      SH7750_A7_REG32(SH7750_RDAYAR_REGOFS)
50947b43a1fSPaolo Bonzini #define SH7750_RDAYAR_ENB     0x80	/* Day Alarm Enable */
51047b43a1fSPaolo Bonzini 
51147b43a1fSPaolo Bonzini /* Month Counter Register (byte, BCD-coded) - RMONAR */
51247b43a1fSPaolo Bonzini #define SH7750_RMONAR_REGOFS  0xC80034	/* offset */
51347b43a1fSPaolo Bonzini #define SH7750_RMONAR         SH7750_P4_REG32(SH7750_RMONAR_REGOFS)
51447b43a1fSPaolo Bonzini #define SH7750_RMONAR_A7      SH7750_A7_REG32(SH7750_RMONAR_REGOFS)
51547b43a1fSPaolo Bonzini #define SH7750_RMONAR_ENB     0x80	/* Month Alarm Enable */
51647b43a1fSPaolo Bonzini 
51747b43a1fSPaolo Bonzini /* RTC Control Register 1 (byte) - RCR1 */
51847b43a1fSPaolo Bonzini #define SH7750_RCR1_REGOFS    0xC80038	/* offset */
51947b43a1fSPaolo Bonzini #define SH7750_RCR1           SH7750_P4_REG32(SH7750_RCR1_REGOFS)
52047b43a1fSPaolo Bonzini #define SH7750_RCR1_A7        SH7750_A7_REG32(SH7750_RCR1_REGOFS)
52147b43a1fSPaolo Bonzini #define SH7750_RCR1_CF        0x80	/* Carry Flag */
52247b43a1fSPaolo Bonzini #define SH7750_RCR1_CIE       0x10	/* Carry Interrupt Enable */
52347b43a1fSPaolo Bonzini #define SH7750_RCR1_AIE       0x08	/* Alarm Interrupt Enable */
52447b43a1fSPaolo Bonzini #define SH7750_RCR1_AF        0x01	/* Alarm Flag */
52547b43a1fSPaolo Bonzini 
52647b43a1fSPaolo Bonzini /* RTC Control Register 2 (byte) - RCR2 */
52747b43a1fSPaolo Bonzini #define SH7750_RCR2_REGOFS    0xC8003C	/* offset */
52847b43a1fSPaolo Bonzini #define SH7750_RCR2           SH7750_P4_REG32(SH7750_RCR2_REGOFS)
52947b43a1fSPaolo Bonzini #define SH7750_RCR2_A7        SH7750_A7_REG32(SH7750_RCR2_REGOFS)
53047b43a1fSPaolo Bonzini #define SH7750_RCR2_PEF        0x80	/* Periodic Interrupt Flag */
53147b43a1fSPaolo Bonzini #define SH7750_RCR2_PES        0x70	/* Periodic Interrupt Enable: */
53247b43a1fSPaolo Bonzini #define SH7750_RCR2_PES_DIS    0x00	/*   Periodic Interrupt Disabled */
53347b43a1fSPaolo Bonzini #define SH7750_RCR2_PES_DIV256 0x10	/*   Generated at 1/256 sec interval */
53447b43a1fSPaolo Bonzini #define SH7750_RCR2_PES_DIV64  0x20	/*   Generated at 1/64 sec interval */
53547b43a1fSPaolo Bonzini #define SH7750_RCR2_PES_DIV16  0x30	/*   Generated at 1/16 sec interval */
53647b43a1fSPaolo Bonzini #define SH7750_RCR2_PES_DIV4   0x40	/*   Generated at 1/4 sec interval */
53747b43a1fSPaolo Bonzini #define SH7750_RCR2_PES_DIV2   0x50	/*   Generated at 1/2 sec interval */
53847b43a1fSPaolo Bonzini #define SH7750_RCR2_PES_x1     0x60	/*   Generated at 1 sec interval */
53947b43a1fSPaolo Bonzini #define SH7750_RCR2_PES_x2     0x70	/*   Generated at 2 sec interval */
54047b43a1fSPaolo Bonzini #define SH7750_RCR2_RTCEN      0x08	/* RTC Crystal Oscillator is Operated */
54147b43a1fSPaolo Bonzini #define SH7750_RCR2_ADJ        0x04	/* 30-Second Adjastment */
54247b43a1fSPaolo Bonzini #define SH7750_RCR2_RESET      0x02	/* Frequency divider circuits are reset */
54347b43a1fSPaolo Bonzini #define SH7750_RCR2_START      0x01	/* 0 - sec, min, hr, day-of-week, month,
54447b43a1fSPaolo Bonzini 					   year counters are stopped
54547b43a1fSPaolo Bonzini 					   1 - sec, min, hr, day-of-week, month,
54647b43a1fSPaolo Bonzini 					   year counters operate normally */
54747b43a1fSPaolo Bonzini /*
54847b43a1fSPaolo Bonzini  * Bus State Controller - BSC
54947b43a1fSPaolo Bonzini  */
55047b43a1fSPaolo Bonzini /* Bus Control Register 1 - BCR1 */
55147b43a1fSPaolo Bonzini #define SH7750_BCR1_REGOFS    0x800000	/* offset */
55247b43a1fSPaolo Bonzini #define SH7750_BCR1           SH7750_P4_REG32(SH7750_BCR1_REGOFS)
55347b43a1fSPaolo Bonzini #define SH7750_BCR1_A7        SH7750_A7_REG32(SH7750_BCR1_REGOFS)
55447b43a1fSPaolo Bonzini #define SH7750_BCR1_ENDIAN    0x80000000	/* Endianness (1 - little endian) */
55547b43a1fSPaolo Bonzini #define SH7750_BCR1_MASTER    0x40000000	/* Master/Slave mode (1-master) */
55647b43a1fSPaolo Bonzini #define SH7750_BCR1_A0MPX     0x20000000	/* Area 0 Memory Type (0-SRAM,1-MPX) */
55747b43a1fSPaolo Bonzini #define SH7750_BCR1_IPUP      0x02000000	/* Input Pin Pull-up Control:
55847b43a1fSPaolo Bonzini 						   0 - pull-up resistor is on for
55947b43a1fSPaolo Bonzini 						   control input pins
56047b43a1fSPaolo Bonzini 						   1 - pull-up resistor is off */
56147b43a1fSPaolo Bonzini #define SH7750_BCR1_OPUP      0x01000000	/* Output Pin Pull-up Control:
56247b43a1fSPaolo Bonzini 						   0 - pull-up resistor is on for
56347b43a1fSPaolo Bonzini 						   control output pins
56447b43a1fSPaolo Bonzini 						   1 - pull-up resistor is off */
56547b43a1fSPaolo Bonzini #define SH7750_BCR1_A1MBC     0x00200000	/* Area 1 SRAM Byte Control Mode:
56647b43a1fSPaolo Bonzini 						   0 - Area 1 SRAM is set to
56747b43a1fSPaolo Bonzini 						   normal mode
56847b43a1fSPaolo Bonzini 						   1 - Area 1 SRAM is set to byte
56947b43a1fSPaolo Bonzini 						   control mode */
57047b43a1fSPaolo Bonzini #define SH7750_BCR1_A4MBC     0x00100000	/* Area 4 SRAM Byte Control Mode:
57147b43a1fSPaolo Bonzini 						   0 - Area 4 SRAM is set to
57247b43a1fSPaolo Bonzini 						   normal mode
57347b43a1fSPaolo Bonzini 						   1 - Area 4 SRAM is set to byte
57447b43a1fSPaolo Bonzini 						   control mode */
57547b43a1fSPaolo Bonzini #define SH7750_BCR1_BREQEN    0x00080000	/* BREQ Enable:
57647b43a1fSPaolo Bonzini 						   0 - External requests are  not
57747b43a1fSPaolo Bonzini 						   accepted
57847b43a1fSPaolo Bonzini 						   1 - External requests are
57947b43a1fSPaolo Bonzini 						   accepted */
58047b43a1fSPaolo Bonzini #define SH7750_BCR1_PSHR      0x00040000	/* Partial Sharing Bit:
58147b43a1fSPaolo Bonzini 						   0 - Master Mode
58247b43a1fSPaolo Bonzini 						   1 - Partial-sharing Mode */
58347b43a1fSPaolo Bonzini #define SH7750_BCR1_MEMMPX    0x00020000	/* Area 1 to 6 MPX Interface:
58447b43a1fSPaolo Bonzini 						   0 - SRAM/burst ROM interface
58547b43a1fSPaolo Bonzini 						   1 - MPX interface */
58647b43a1fSPaolo Bonzini #define SH7750_BCR1_HIZMEM    0x00008000	/* High Impendance Control. Specifies
58747b43a1fSPaolo Bonzini 						   the state of A[25:0], BS\, CSn\,
58847b43a1fSPaolo Bonzini 						   RD/WR\, CE2A\, CE2B\ in standby
58947b43a1fSPaolo Bonzini 						   mode and when bus is released:
59047b43a1fSPaolo Bonzini 						   0 - signals go to High-Z mode
59147b43a1fSPaolo Bonzini 						   1 - signals driven */
59247b43a1fSPaolo Bonzini #define SH7750_BCR1_HIZCNT    0x00004000	/* High Impendance Control. Specifies
59347b43a1fSPaolo Bonzini 						   the state of the RAS\, RAS2\, WEn\,
59447b43a1fSPaolo Bonzini 						   CASn\, DQMn, RD\, CASS\, FRAME\,
59547b43a1fSPaolo Bonzini 						   RD2\ signals in standby mode and
59647b43a1fSPaolo Bonzini 						   when bus is released:
59747b43a1fSPaolo Bonzini 						   0 - signals go to High-Z mode
59847b43a1fSPaolo Bonzini 						   1 - signals driven */
59947b43a1fSPaolo Bonzini #define SH7750_BCR1_A0BST     0x00003800	/* Area 0 Burst ROM Control */
60047b43a1fSPaolo Bonzini #define SH7750_BCR1_A0BST_SRAM    0x0000	/*   Area 0 accessed as SRAM i/f */
60147b43a1fSPaolo Bonzini #define SH7750_BCR1_A0BST_ROM4    0x0800	/*   Area 0 accessed as burst ROM
60247b43a1fSPaolo Bonzini 						   interface, 4 cosequtive access */
60347b43a1fSPaolo Bonzini #define SH7750_BCR1_A0BST_ROM8    0x1000	/*   Area 0 accessed as burst ROM
60447b43a1fSPaolo Bonzini 						   interface, 8 cosequtive access */
60547b43a1fSPaolo Bonzini #define SH7750_BCR1_A0BST_ROM16   0x1800	/*   Area 0 accessed as burst ROM
60647b43a1fSPaolo Bonzini 						   interface, 16 cosequtive access */
60747b43a1fSPaolo Bonzini #define SH7750_BCR1_A0BST_ROM32   0x2000	/*   Area 0 accessed as burst ROM
60847b43a1fSPaolo Bonzini 						   interface, 32 cosequtive access */
60947b43a1fSPaolo Bonzini 
61047b43a1fSPaolo Bonzini #define SH7750_BCR1_A5BST     0x00000700	/* Area 5 Burst ROM Control */
61147b43a1fSPaolo Bonzini #define SH7750_BCR1_A5BST_SRAM    0x0000	/*   Area 5 accessed as SRAM i/f */
61247b43a1fSPaolo Bonzini #define SH7750_BCR1_A5BST_ROM4    0x0100	/*   Area 5 accessed as burst ROM
61347b43a1fSPaolo Bonzini 						   interface, 4 cosequtive access */
61447b43a1fSPaolo Bonzini #define SH7750_BCR1_A5BST_ROM8    0x0200	/*   Area 5 accessed as burst ROM
61547b43a1fSPaolo Bonzini 						   interface, 8 cosequtive access */
61647b43a1fSPaolo Bonzini #define SH7750_BCR1_A5BST_ROM16   0x0300	/*   Area 5 accessed as burst ROM
61747b43a1fSPaolo Bonzini 						   interface, 16 cosequtive access */
61847b43a1fSPaolo Bonzini #define SH7750_BCR1_A5BST_ROM32   0x0400	/*   Area 5 accessed as burst ROM
61947b43a1fSPaolo Bonzini 						   interface, 32 cosequtive access */
62047b43a1fSPaolo Bonzini 
62147b43a1fSPaolo Bonzini #define SH7750_BCR1_A6BST     0x000000E0	/* Area 6 Burst ROM Control */
62247b43a1fSPaolo Bonzini #define SH7750_BCR1_A6BST_SRAM    0x0000	/*   Area 6 accessed as SRAM i/f */
62347b43a1fSPaolo Bonzini #define SH7750_BCR1_A6BST_ROM4    0x0020	/*   Area 6 accessed as burst ROM
62447b43a1fSPaolo Bonzini 						   interface, 4 cosequtive access */
62547b43a1fSPaolo Bonzini #define SH7750_BCR1_A6BST_ROM8    0x0040	/*   Area 6 accessed as burst ROM
62647b43a1fSPaolo Bonzini 						   interface, 8 cosequtive access */
62747b43a1fSPaolo Bonzini #define SH7750_BCR1_A6BST_ROM16   0x0060	/*   Area 6 accessed as burst ROM
62847b43a1fSPaolo Bonzini 						   interface, 16 cosequtive access */
62947b43a1fSPaolo Bonzini #define SH7750_BCR1_A6BST_ROM32   0x0080	/*   Area 6 accessed as burst ROM
63047b43a1fSPaolo Bonzini 						   interface, 32 cosequtive access */
63147b43a1fSPaolo Bonzini 
63247b43a1fSPaolo Bonzini #define SH7750_BCR1_DRAMTP        0x001C	/* Area 2 and 3 Memory Type */
63347b43a1fSPaolo Bonzini #define SH7750_BCR1_DRAMTP_2SRAM_3SRAM   0x0000	/* Area 2 and 3 are SRAM or MPX
63447b43a1fSPaolo Bonzini 						   interface. */
63547b43a1fSPaolo Bonzini #define SH7750_BCR1_DRAMTP_2SRAM_3SDRAM  0x0008	/* Area 2 - SRAM/MPX, Area 3 -
63647b43a1fSPaolo Bonzini 						   synchronous DRAM */
63747b43a1fSPaolo Bonzini #define SH7750_BCR1_DRAMTP_2SDRAM_3SDRAM 0x000C	/* Area 2 and 3 are synchronous
63847b43a1fSPaolo Bonzini 						   DRAM interface */
63947b43a1fSPaolo Bonzini #define SH7750_BCR1_DRAMTP_2SRAM_3DRAM   0x0010	/* Area 2 - SRAM/MPX, Area 3 -
64047b43a1fSPaolo Bonzini 						   DRAM interface */
64147b43a1fSPaolo Bonzini #define SH7750_BCR1_DRAMTP_2DRAM_3DRAM   0x0014	/* Area 2 and 3 are DRAM
64247b43a1fSPaolo Bonzini 						   interface */
64347b43a1fSPaolo Bonzini 
64447b43a1fSPaolo Bonzini #define SH7750_BCR1_A56PCM    0x00000001	/* Area 5 and 6 Bus Type:
64547b43a1fSPaolo Bonzini 						   0 - SRAM interface
64647b43a1fSPaolo Bonzini 						   1 - PCMCIA interface */
64747b43a1fSPaolo Bonzini 
64847b43a1fSPaolo Bonzini /* Bus Control Register 2 (half) - BCR2 */
64947b43a1fSPaolo Bonzini #define SH7750_BCR2_REGOFS    0x800004	/* offset */
65047b43a1fSPaolo Bonzini #define SH7750_BCR2           SH7750_P4_REG32(SH7750_BCR2_REGOFS)
65147b43a1fSPaolo Bonzini #define SH7750_BCR2_A7        SH7750_A7_REG32(SH7750_BCR2_REGOFS)
65247b43a1fSPaolo Bonzini 
65347b43a1fSPaolo Bonzini #define SH7750_BCR2_A0SZ      0xC000	/* Area 0 Bus Width */
65447b43a1fSPaolo Bonzini #define SH7750_BCR2_A0SZ_S    14
65547b43a1fSPaolo Bonzini #define SH7750_BCR2_A6SZ      0x3000	/* Area 6 Bus Width */
65647b43a1fSPaolo Bonzini #define SH7750_BCR2_A6SZ_S    12
65747b43a1fSPaolo Bonzini #define SH7750_BCR2_A5SZ      0x0C00	/* Area 5 Bus Width */
65847b43a1fSPaolo Bonzini #define SH7750_BCR2_A5SZ_S    10
65947b43a1fSPaolo Bonzini #define SH7750_BCR2_A4SZ      0x0300	/* Area 4 Bus Width */
66047b43a1fSPaolo Bonzini #define SH7750_BCR2_A4SZ_S    8
66147b43a1fSPaolo Bonzini #define SH7750_BCR2_A3SZ      0x00C0	/* Area 3 Bus Width */
66247b43a1fSPaolo Bonzini #define SH7750_BCR2_A3SZ_S    6
66347b43a1fSPaolo Bonzini #define SH7750_BCR2_A2SZ      0x0030	/* Area 2 Bus Width */
66447b43a1fSPaolo Bonzini #define SH7750_BCR2_A2SZ_S    4
66547b43a1fSPaolo Bonzini #define SH7750_BCR2_A1SZ      0x000C	/* Area 1 Bus Width */
66647b43a1fSPaolo Bonzini #define SH7750_BCR2_A1SZ_S    2
66747b43a1fSPaolo Bonzini #define SH7750_BCR2_SZ_64     0	/* 64 bits */
66847b43a1fSPaolo Bonzini #define SH7750_BCR2_SZ_8      1	/* 8 bits */
66947b43a1fSPaolo Bonzini #define SH7750_BCR2_SZ_16     2	/* 16 bits */
67047b43a1fSPaolo Bonzini #define SH7750_BCR2_SZ_32     3	/* 32 bits */
67147b43a1fSPaolo Bonzini #define SH7750_BCR2_PORTEN    0x0001	/* Port Function Enable :
67247b43a1fSPaolo Bonzini 					   0 - D51-D32 are not used as a port
67347b43a1fSPaolo Bonzini 					   1 - D51-D32 are used as a port */
67447b43a1fSPaolo Bonzini 
67547b43a1fSPaolo Bonzini /* Wait Control Register 1 - WCR1 */
67647b43a1fSPaolo Bonzini #define SH7750_WCR1_REGOFS    0x800008	/* offset */
67747b43a1fSPaolo Bonzini #define SH7750_WCR1           SH7750_P4_REG32(SH7750_WCR1_REGOFS)
67847b43a1fSPaolo Bonzini #define SH7750_WCR1_A7        SH7750_A7_REG32(SH7750_WCR1_REGOFS)
67947b43a1fSPaolo Bonzini #define SH7750_WCR1_DMAIW     0x70000000	/* DACK Device Inter-Cycle Idle
68047b43a1fSPaolo Bonzini 						   specification */
68147b43a1fSPaolo Bonzini #define SH7750_WCR1_DMAIW_S   28
68247b43a1fSPaolo Bonzini #define SH7750_WCR1_A6IW      0x07000000	/* Area 6 Inter-Cycle Idle spec. */
68347b43a1fSPaolo Bonzini #define SH7750_WCR1_A6IW_S    24
68447b43a1fSPaolo Bonzini #define SH7750_WCR1_A5IW      0x00700000	/* Area 5 Inter-Cycle Idle spec. */
68547b43a1fSPaolo Bonzini #define SH7750_WCR1_A5IW_S    20
68647b43a1fSPaolo Bonzini #define SH7750_WCR1_A4IW      0x00070000	/* Area 4 Inter-Cycle Idle spec. */
68747b43a1fSPaolo Bonzini #define SH7750_WCR1_A4IW_S    16
68847b43a1fSPaolo Bonzini #define SH7750_WCR1_A3IW      0x00007000	/* Area 3 Inter-Cycle Idle spec. */
68947b43a1fSPaolo Bonzini #define SH7750_WCR1_A3IW_S    12
69047b43a1fSPaolo Bonzini #define SH7750_WCR1_A2IW      0x00000700	/* Area 2 Inter-Cycle Idle spec. */
69147b43a1fSPaolo Bonzini #define SH7750_WCR1_A2IW_S    8
69247b43a1fSPaolo Bonzini #define SH7750_WCR1_A1IW      0x00000070	/* Area 1 Inter-Cycle Idle spec. */
69347b43a1fSPaolo Bonzini #define SH7750_WCR1_A1IW_S    4
69447b43a1fSPaolo Bonzini #define SH7750_WCR1_A0IW      0x00000007	/* Area 0 Inter-Cycle Idle spec. */
69547b43a1fSPaolo Bonzini #define SH7750_WCR1_A0IW_S    0
69647b43a1fSPaolo Bonzini 
69747b43a1fSPaolo Bonzini /* Wait Control Register 2 - WCR2 */
69847b43a1fSPaolo Bonzini #define SH7750_WCR2_REGOFS    0x80000C	/* offset */
69947b43a1fSPaolo Bonzini #define SH7750_WCR2           SH7750_P4_REG32(SH7750_WCR2_REGOFS)
70047b43a1fSPaolo Bonzini #define SH7750_WCR2_A7        SH7750_A7_REG32(SH7750_WCR2_REGOFS)
70147b43a1fSPaolo Bonzini 
70247b43a1fSPaolo Bonzini #define SH7750_WCR2_A6W       0xE0000000	/* Area 6 Wait Control */
70347b43a1fSPaolo Bonzini #define SH7750_WCR2_A6W_S     29
70447b43a1fSPaolo Bonzini #define SH7750_WCR2_A6B       0x1C000000	/* Area 6 Burst Pitch */
70547b43a1fSPaolo Bonzini #define SH7750_WCR2_A6B_S     26
70647b43a1fSPaolo Bonzini #define SH7750_WCR2_A5W       0x03800000	/* Area 5 Wait Control */
70747b43a1fSPaolo Bonzini #define SH7750_WCR2_A5W_S     23
70847b43a1fSPaolo Bonzini #define SH7750_WCR2_A5B       0x00700000	/* Area 5 Burst Pitch */
70947b43a1fSPaolo Bonzini #define SH7750_WCR2_A5B_S     20
71047b43a1fSPaolo Bonzini #define SH7750_WCR2_A4W       0x000E0000	/* Area 4 Wait Control */
71147b43a1fSPaolo Bonzini #define SH7750_WCR2_A4W_S     17
71247b43a1fSPaolo Bonzini #define SH7750_WCR2_A3W       0x0000E000	/* Area 3 Wait Control */
71347b43a1fSPaolo Bonzini #define SH7750_WCR2_A3W_S     13
71447b43a1fSPaolo Bonzini #define SH7750_WCR2_A2W       0x00000E00	/* Area 2 Wait Control */
71547b43a1fSPaolo Bonzini #define SH7750_WCR2_A2W_S     9
71647b43a1fSPaolo Bonzini #define SH7750_WCR2_A1W       0x000001C0	/* Area 1 Wait Control */
71747b43a1fSPaolo Bonzini #define SH7750_WCR2_A1W_S     6
71847b43a1fSPaolo Bonzini #define SH7750_WCR2_A0W       0x00000038	/* Area 0 Wait Control */
71947b43a1fSPaolo Bonzini #define SH7750_WCR2_A0W_S     3
72047b43a1fSPaolo Bonzini #define SH7750_WCR2_A0B       0x00000007	/* Area 0 Burst Pitch */
72147b43a1fSPaolo Bonzini #define SH7750_WCR2_A0B_S     0
72247b43a1fSPaolo Bonzini 
72347b43a1fSPaolo Bonzini #define SH7750_WCR2_WS0       0	/* 0 wait states inserted */
72447b43a1fSPaolo Bonzini #define SH7750_WCR2_WS1       1	/* 1 wait states inserted */
72547b43a1fSPaolo Bonzini #define SH7750_WCR2_WS2       2	/* 2 wait states inserted */
72647b43a1fSPaolo Bonzini #define SH7750_WCR2_WS3       3	/* 3 wait states inserted */
72747b43a1fSPaolo Bonzini #define SH7750_WCR2_WS6       4	/* 6 wait states inserted */
72847b43a1fSPaolo Bonzini #define SH7750_WCR2_WS9       5	/* 9 wait states inserted */
72947b43a1fSPaolo Bonzini #define SH7750_WCR2_WS12      6	/* 12 wait states inserted */
73047b43a1fSPaolo Bonzini #define SH7750_WCR2_WS15      7	/* 15 wait states inserted */
73147b43a1fSPaolo Bonzini 
73247b43a1fSPaolo Bonzini #define SH7750_WCR2_BPWS0     0	/* 0 wait states inserted from 2nd access */
73347b43a1fSPaolo Bonzini #define SH7750_WCR2_BPWS1     1	/* 1 wait states inserted from 2nd access */
73447b43a1fSPaolo Bonzini #define SH7750_WCR2_BPWS2     2	/* 2 wait states inserted from 2nd access */
73547b43a1fSPaolo Bonzini #define SH7750_WCR2_BPWS3     3	/* 3 wait states inserted from 2nd access */
73647b43a1fSPaolo Bonzini #define SH7750_WCR2_BPWS4     4	/* 4 wait states inserted from 2nd access */
73747b43a1fSPaolo Bonzini #define SH7750_WCR2_BPWS5     5	/* 5 wait states inserted from 2nd access */
73847b43a1fSPaolo Bonzini #define SH7750_WCR2_BPWS6     6	/* 6 wait states inserted from 2nd access */
73947b43a1fSPaolo Bonzini #define SH7750_WCR2_BPWS7     7	/* 7 wait states inserted from 2nd access */
74047b43a1fSPaolo Bonzini 
74147b43a1fSPaolo Bonzini /* DRAM CAS\ Assertion Delay (area 3,2) */
74247b43a1fSPaolo Bonzini #define SH7750_WCR2_DRAM_CAS_ASW1   0	/* 1 cycle */
74347b43a1fSPaolo Bonzini #define SH7750_WCR2_DRAM_CAS_ASW2   1	/* 2 cycles */
74447b43a1fSPaolo Bonzini #define SH7750_WCR2_DRAM_CAS_ASW3   2	/* 3 cycles */
74547b43a1fSPaolo Bonzini #define SH7750_WCR2_DRAM_CAS_ASW4   3	/* 4 cycles */
74647b43a1fSPaolo Bonzini #define SH7750_WCR2_DRAM_CAS_ASW7   4	/* 7 cycles */
74747b43a1fSPaolo Bonzini #define SH7750_WCR2_DRAM_CAS_ASW10  5	/* 10 cycles */
74847b43a1fSPaolo Bonzini #define SH7750_WCR2_DRAM_CAS_ASW13  6	/* 13 cycles */
74947b43a1fSPaolo Bonzini #define SH7750_WCR2_DRAM_CAS_ASW16  7	/* 16 cycles */
75047b43a1fSPaolo Bonzini 
75147b43a1fSPaolo Bonzini /* SDRAM CAS\ Latency Cycles */
75247b43a1fSPaolo Bonzini #define SH7750_WCR2_SDRAM_CAS_LAT1  1	/* 1 cycle */
75347b43a1fSPaolo Bonzini #define SH7750_WCR2_SDRAM_CAS_LAT2  2	/* 2 cycles */
75447b43a1fSPaolo Bonzini #define SH7750_WCR2_SDRAM_CAS_LAT3  3	/* 3 cycles */
75547b43a1fSPaolo Bonzini #define SH7750_WCR2_SDRAM_CAS_LAT4  4	/* 4 cycles */
75647b43a1fSPaolo Bonzini #define SH7750_WCR2_SDRAM_CAS_LAT5  5	/* 5 cycles */
75747b43a1fSPaolo Bonzini 
75847b43a1fSPaolo Bonzini /* Wait Control Register 3 - WCR3 */
75947b43a1fSPaolo Bonzini #define SH7750_WCR3_REGOFS    0x800010	/* offset */
76047b43a1fSPaolo Bonzini #define SH7750_WCR3           SH7750_P4_REG32(SH7750_WCR3_REGOFS)
76147b43a1fSPaolo Bonzini #define SH7750_WCR3_A7        SH7750_A7_REG32(SH7750_WCR3_REGOFS)
76247b43a1fSPaolo Bonzini 
76347b43a1fSPaolo Bonzini #define SH7750_WCR3_A6S       0x04000000	/* Area 6 Write Strobe Setup time */
76447b43a1fSPaolo Bonzini #define SH7750_WCR3_A6H       0x03000000	/* Area 6 Data Hold Time */
76547b43a1fSPaolo Bonzini #define SH7750_WCR3_A6H_S     24
76647b43a1fSPaolo Bonzini #define SH7750_WCR3_A5S       0x00400000	/* Area 5 Write Strobe Setup time */
76747b43a1fSPaolo Bonzini #define SH7750_WCR3_A5H       0x00300000	/* Area 5 Data Hold Time */
76847b43a1fSPaolo Bonzini #define SH7750_WCR3_A5H_S     20
76947b43a1fSPaolo Bonzini #define SH7750_WCR3_A4S       0x00040000	/* Area 4 Write Strobe Setup time */
77047b43a1fSPaolo Bonzini #define SH7750_WCR3_A4H       0x00030000	/* Area 4 Data Hold Time */
77147b43a1fSPaolo Bonzini #define SH7750_WCR3_A4H_S     16
77247b43a1fSPaolo Bonzini #define SH7750_WCR3_A3S       0x00004000	/* Area 3 Write Strobe Setup time */
77347b43a1fSPaolo Bonzini #define SH7750_WCR3_A3H       0x00003000	/* Area 3 Data Hold Time */
77447b43a1fSPaolo Bonzini #define SH7750_WCR3_A3H_S     12
77547b43a1fSPaolo Bonzini #define SH7750_WCR3_A2S       0x00000400	/* Area 2 Write Strobe Setup time */
77647b43a1fSPaolo Bonzini #define SH7750_WCR3_A2H       0x00000300	/* Area 2 Data Hold Time */
77747b43a1fSPaolo Bonzini #define SH7750_WCR3_A2H_S     8
77847b43a1fSPaolo Bonzini #define SH7750_WCR3_A1S       0x00000040	/* Area 1 Write Strobe Setup time */
77947b43a1fSPaolo Bonzini #define SH7750_WCR3_A1H       0x00000030	/* Area 1 Data Hold Time */
78047b43a1fSPaolo Bonzini #define SH7750_WCR3_A1H_S     4
78147b43a1fSPaolo Bonzini #define SH7750_WCR3_A0S       0x00000004	/* Area 0 Write Strobe Setup time */
78247b43a1fSPaolo Bonzini #define SH7750_WCR3_A0H       0x00000003	/* Area 0 Data Hold Time */
78347b43a1fSPaolo Bonzini #define SH7750_WCR3_A0H_S     0
78447b43a1fSPaolo Bonzini 
78547b43a1fSPaolo Bonzini #define SH7750_WCR3_DHWS_0    0	/* 0 wait states data hold time */
78647b43a1fSPaolo Bonzini #define SH7750_WCR3_DHWS_1    1	/* 1 wait states data hold time */
78747b43a1fSPaolo Bonzini #define SH7750_WCR3_DHWS_2    2	/* 2 wait states data hold time */
78847b43a1fSPaolo Bonzini #define SH7750_WCR3_DHWS_3    3	/* 3 wait states data hold time */
78947b43a1fSPaolo Bonzini 
79047b43a1fSPaolo Bonzini #define SH7750_MCR_REGOFS     0x800014	/* offset */
79147b43a1fSPaolo Bonzini #define SH7750_MCR            SH7750_P4_REG32(SH7750_MCR_REGOFS)
79247b43a1fSPaolo Bonzini #define SH7750_MCR_A7         SH7750_A7_REG32(SH7750_MCR_REGOFS)
79347b43a1fSPaolo Bonzini 
79447b43a1fSPaolo Bonzini #define SH7750_MCR_RASD       0x80000000	/* RAS Down mode */
79547b43a1fSPaolo Bonzini #define SH7750_MCR_MRSET      0x40000000	/* SDRAM Mode Register Set */
79647b43a1fSPaolo Bonzini #define SH7750_MCR_PALL       0x00000000	/* SDRAM Precharge All cmd. Mode */
79747b43a1fSPaolo Bonzini #define SH7750_MCR_TRC        0x38000000	/* RAS Precharge Time at End of
79847b43a1fSPaolo Bonzini 						   Refresh: */
79947b43a1fSPaolo Bonzini #define SH7750_MCR_TRC_0      0x00000000	/*    0 */
80047b43a1fSPaolo Bonzini #define SH7750_MCR_TRC_3      0x08000000	/*    3 */
80147b43a1fSPaolo Bonzini #define SH7750_MCR_TRC_6      0x10000000	/*    6 */
80247b43a1fSPaolo Bonzini #define SH7750_MCR_TRC_9      0x18000000	/*    9 */
80347b43a1fSPaolo Bonzini #define SH7750_MCR_TRC_12     0x20000000	/*    12 */
80447b43a1fSPaolo Bonzini #define SH7750_MCR_TRC_15     0x28000000	/*    15 */
80547b43a1fSPaolo Bonzini #define SH7750_MCR_TRC_18     0x30000000	/*    18 */
80647b43a1fSPaolo Bonzini #define SH7750_MCR_TRC_21     0x38000000	/*    21 */
80747b43a1fSPaolo Bonzini 
80847b43a1fSPaolo Bonzini #define SH7750_MCR_TCAS       0x00800000	/* CAS Negation Period */
80947b43a1fSPaolo Bonzini #define SH7750_MCR_TCAS_1     0x00000000	/*    1 */
81047b43a1fSPaolo Bonzini #define SH7750_MCR_TCAS_2     0x00800000	/*    2 */
81147b43a1fSPaolo Bonzini 
81247b43a1fSPaolo Bonzini #define SH7750_MCR_TPC        0x00380000	/* DRAM: RAS Precharge Period
81347b43a1fSPaolo Bonzini 						   SDRAM: minimum number of cycles
81447b43a1fSPaolo Bonzini 						   until the next bank active cmd
81547b43a1fSPaolo Bonzini 						   is output after precharging */
81647b43a1fSPaolo Bonzini #define SH7750_MCR_TPC_S      19
81747b43a1fSPaolo Bonzini #define SH7750_MCR_TPC_SDRAM_1 0x00000000	/* 1 cycle */
81847b43a1fSPaolo Bonzini #define SH7750_MCR_TPC_SDRAM_2 0x00080000	/* 2 cycles */
81947b43a1fSPaolo Bonzini #define SH7750_MCR_TPC_SDRAM_3 0x00100000	/* 3 cycles */
82047b43a1fSPaolo Bonzini #define SH7750_MCR_TPC_SDRAM_4 0x00180000	/* 4 cycles */
82147b43a1fSPaolo Bonzini #define SH7750_MCR_TPC_SDRAM_5 0x00200000	/* 5 cycles */
82247b43a1fSPaolo Bonzini #define SH7750_MCR_TPC_SDRAM_6 0x00280000	/* 6 cycles */
82347b43a1fSPaolo Bonzini #define SH7750_MCR_TPC_SDRAM_7 0x00300000	/* 7 cycles */
82447b43a1fSPaolo Bonzini #define SH7750_MCR_TPC_SDRAM_8 0x00380000	/* 8 cycles */
82547b43a1fSPaolo Bonzini 
82647b43a1fSPaolo Bonzini #define SH7750_MCR_RCD        0x00030000	/* DRAM: RAS-CAS Assertion Delay time
82747b43a1fSPaolo Bonzini 						   SDRAM: bank active-read/write cmd
82847b43a1fSPaolo Bonzini 						   delay time */
82947b43a1fSPaolo Bonzini #define SH7750_MCR_RCD_DRAM_2  0x00000000	/* DRAM delay 2 clocks */
83047b43a1fSPaolo Bonzini #define SH7750_MCR_RCD_DRAM_3  0x00010000	/* DRAM delay 3 clocks */
83147b43a1fSPaolo Bonzini #define SH7750_MCR_RCD_DRAM_4  0x00020000	/* DRAM delay 4 clocks */
83247b43a1fSPaolo Bonzini #define SH7750_MCR_RCD_DRAM_5  0x00030000	/* DRAM delay 5 clocks */
83347b43a1fSPaolo Bonzini #define SH7750_MCR_RCD_SDRAM_2 0x00010000	/* DRAM delay 2 clocks */
83447b43a1fSPaolo Bonzini #define SH7750_MCR_RCD_SDRAM_3 0x00020000	/* DRAM delay 3 clocks */
83547b43a1fSPaolo Bonzini #define SH7750_MCR_RCD_SDRAM_4 0x00030000	/* DRAM delay 4 clocks */
83647b43a1fSPaolo Bonzini 
83747b43a1fSPaolo Bonzini #define SH7750_MCR_TRWL       0x0000E000	/* SDRAM Write Precharge Delay */
83847b43a1fSPaolo Bonzini #define SH7750_MCR_TRWL_1     0x00000000	/*    1 */
83947b43a1fSPaolo Bonzini #define SH7750_MCR_TRWL_2     0x00002000	/*    2 */
84047b43a1fSPaolo Bonzini #define SH7750_MCR_TRWL_3     0x00004000	/*    3 */
84147b43a1fSPaolo Bonzini #define SH7750_MCR_TRWL_4     0x00006000	/*    4 */
84247b43a1fSPaolo Bonzini #define SH7750_MCR_TRWL_5     0x00008000	/*    5 */
84347b43a1fSPaolo Bonzini 
84447b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS       0x00001C00	/* DRAM: CAS-Before-RAS Refresh RAS
84547b43a1fSPaolo Bonzini 						   asserting period
84647b43a1fSPaolo Bonzini 						   SDRAM: Command interval after
84747b43a1fSPaolo Bonzini 						   synchronous DRAM refresh */
84847b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_DRAM_2         0x00000000	/* 2 */
84947b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_DRAM_3         0x00000400	/* 3 */
85047b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_DRAM_4         0x00000800	/* 4 */
85147b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_DRAM_5         0x00000C00	/* 5 */
85247b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_DRAM_6         0x00001000	/* 6 */
85347b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_DRAM_7         0x00001400	/* 7 */
85447b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_DRAM_8         0x00001800	/* 8 */
85547b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_DRAM_9         0x00001C00	/* 9 */
85647b43a1fSPaolo Bonzini 
85747b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_SDRAM_TRC_4    0x00000000	/* 4 + TRC */
85847b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_SDRAM_TRC_5    0x00000400	/* 5 + TRC */
85947b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_SDRAM_TRC_6    0x00000800	/* 6 + TRC */
86047b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_SDRAM_TRC_7    0x00000C00	/* 7 + TRC */
86147b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_SDRAM_TRC_8    0x00001000	/* 8 + TRC */
86247b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_SDRAM_TRC_9    0x00001400	/* 9 + TRC */
86347b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_SDRAM_TRC_10   0x00001800	/* 10 + TRC */
86447b43a1fSPaolo Bonzini #define SH7750_MCR_TRAS_SDRAM_TRC_11   0x00001C00	/* 11 + TRC */
86547b43a1fSPaolo Bonzini 
86647b43a1fSPaolo Bonzini #define SH7750_MCR_BE         0x00000200	/* Burst Enable */
86747b43a1fSPaolo Bonzini #define SH7750_MCR_SZ         0x00000180	/* Memory Data Size */
86847b43a1fSPaolo Bonzini #define SH7750_MCR_SZ_64      0x00000000	/*    64 bits */
86947b43a1fSPaolo Bonzini #define SH7750_MCR_SZ_16      0x00000100	/*    16 bits */
87047b43a1fSPaolo Bonzini #define SH7750_MCR_SZ_32      0x00000180	/*    32 bits */
87147b43a1fSPaolo Bonzini 
87247b43a1fSPaolo Bonzini #define SH7750_MCR_AMX        0x00000078	/* Address Multiplexing */
87347b43a1fSPaolo Bonzini #define SH7750_MCR_AMX_S      3
87447b43a1fSPaolo Bonzini #define SH7750_MCR_AMX_DRAM_8BIT_COL    0x00000000	/* 8-bit column addr */
87547b43a1fSPaolo Bonzini #define SH7750_MCR_AMX_DRAM_9BIT_COL    0x00000008	/* 9-bit column addr */
87647b43a1fSPaolo Bonzini #define SH7750_MCR_AMX_DRAM_10BIT_COL   0x00000010	/* 10-bit column addr */
87747b43a1fSPaolo Bonzini #define SH7750_MCR_AMX_DRAM_11BIT_COL   0x00000018	/* 11-bit column addr */
87847b43a1fSPaolo Bonzini #define SH7750_MCR_AMX_DRAM_12BIT_COL   0x00000020	/* 12-bit column addr */
87947b43a1fSPaolo Bonzini /* See SH7750 Hardware Manual for SDRAM address multiplexor selection */
88047b43a1fSPaolo Bonzini 
88147b43a1fSPaolo Bonzini #define SH7750_MCR_RFSH       0x00000004	/* Refresh Control */
88247b43a1fSPaolo Bonzini #define SH7750_MCR_RMODE      0x00000002	/* Refresh Mode: */
88347b43a1fSPaolo Bonzini #define SH7750_MCR_RMODE_NORMAL 0x00000000	/* Normal Refresh Mode */
88447b43a1fSPaolo Bonzini #define SH7750_MCR_RMODE_SELF   0x00000002	/* Self-Refresh Mode */
88547b43a1fSPaolo Bonzini #define SH7750_MCR_RMODE_EDO    0x00000001	/* EDO Mode */
88647b43a1fSPaolo Bonzini 
88747b43a1fSPaolo Bonzini /* SDRAM Mode Set address */
88847b43a1fSPaolo Bonzini #define SH7750_SDRAM_MODE_A2_BASE  0xFF900000
88947b43a1fSPaolo Bonzini #define SH7750_SDRAM_MODE_A3_BASE  0xFF940000
89047b43a1fSPaolo Bonzini #define SH7750_SDRAM_MODE_A2_32BIT(x) (SH7750_SDRAM_MODE_A2_BASE + ((x) << 2))
89147b43a1fSPaolo Bonzini #define SH7750_SDRAM_MODE_A3_32BIT(x) (SH7750_SDRAM_MODE_A3_BASE + ((x) << 2))
89247b43a1fSPaolo Bonzini #define SH7750_SDRAM_MODE_A2_64BIT(x) (SH7750_SDRAM_MODE_A2_BASE + ((x) << 3))
89347b43a1fSPaolo Bonzini #define SH7750_SDRAM_MODE_A3_64BIT(x) (SH7750_SDRAM_MODE_A3_BASE + ((x) << 3))
89447b43a1fSPaolo Bonzini 
89547b43a1fSPaolo Bonzini 
89647b43a1fSPaolo Bonzini /* PCMCIA Control Register (half) - PCR */
89747b43a1fSPaolo Bonzini #define SH7750_PCR_REGOFS     0x800018	/* offset */
89847b43a1fSPaolo Bonzini #define SH7750_PCR            SH7750_P4_REG32(SH7750_PCR_REGOFS)
89947b43a1fSPaolo Bonzini #define SH7750_PCR_A7         SH7750_A7_REG32(SH7750_PCR_REGOFS)
90047b43a1fSPaolo Bonzini 
90147b43a1fSPaolo Bonzini #define SH7750_PCR_A5PCW      0xC000	/* Area 5 PCMCIA Wait - Number of wait
90247b43a1fSPaolo Bonzini 					   states to be added to the number of
90347b43a1fSPaolo Bonzini 					   waits specified by WCR2 in a low-speed
90447b43a1fSPaolo Bonzini 					   PCMCIA wait cycle */
90547b43a1fSPaolo Bonzini #define SH7750_PCR_A5PCW_0    0x0000	/*    0 waits inserted */
90647b43a1fSPaolo Bonzini #define SH7750_PCR_A5PCW_15   0x4000	/*    15 waits inserted */
90747b43a1fSPaolo Bonzini #define SH7750_PCR_A5PCW_30   0x8000	/*    30 waits inserted */
90847b43a1fSPaolo Bonzini #define SH7750_PCR_A5PCW_50   0xC000	/*    50 waits inserted */
90947b43a1fSPaolo Bonzini 
91047b43a1fSPaolo Bonzini #define SH7750_PCR_A6PCW      0x3000	/* Area 6 PCMCIA Wait - Number of wait
91147b43a1fSPaolo Bonzini 					   states to be added to the number of
91247b43a1fSPaolo Bonzini 					   waits specified by WCR2 in a low-speed
91347b43a1fSPaolo Bonzini 					   PCMCIA wait cycle */
91447b43a1fSPaolo Bonzini #define SH7750_PCR_A6PCW_0    0x0000	/*    0 waits inserted */
91547b43a1fSPaolo Bonzini #define SH7750_PCR_A6PCW_15   0x1000	/*    15 waits inserted */
91647b43a1fSPaolo Bonzini #define SH7750_PCR_A6PCW_30   0x2000	/*    30 waits inserted */
91747b43a1fSPaolo Bonzini #define SH7750_PCR_A6PCW_50   0x3000	/*    50 waits inserted */
91847b43a1fSPaolo Bonzini 
91947b43a1fSPaolo Bonzini #define SH7750_PCR_A5TED      0x0E00	/* Area 5 Address-OE\/WE\ Assertion Delay,
92047b43a1fSPaolo Bonzini 					   delay time from address output to
92147b43a1fSPaolo Bonzini 					   OE\/WE\ assertion on the connected
92247b43a1fSPaolo Bonzini 					   PCMCIA interface */
92347b43a1fSPaolo Bonzini #define SH7750_PCR_A5TED_S    9
92447b43a1fSPaolo Bonzini #define SH7750_PCR_A6TED      0x01C0	/* Area 6 Address-OE\/WE\ Assertion Delay */
92547b43a1fSPaolo Bonzini #define SH7750_PCR_A6TED_S    6
92647b43a1fSPaolo Bonzini 
92747b43a1fSPaolo Bonzini #define SH7750_PCR_TED_0WS    0	/* 0 Waits inserted */
92847b43a1fSPaolo Bonzini #define SH7750_PCR_TED_1WS    1	/* 1 Waits inserted */
92947b43a1fSPaolo Bonzini #define SH7750_PCR_TED_2WS    2	/* 2 Waits inserted */
93047b43a1fSPaolo Bonzini #define SH7750_PCR_TED_3WS    3	/* 3 Waits inserted */
93147b43a1fSPaolo Bonzini #define SH7750_PCR_TED_6WS    4	/* 6 Waits inserted */
93247b43a1fSPaolo Bonzini #define SH7750_PCR_TED_9WS    5	/* 9 Waits inserted */
93347b43a1fSPaolo Bonzini #define SH7750_PCR_TED_12WS   6	/* 12 Waits inserted */
93447b43a1fSPaolo Bonzini #define SH7750_PCR_TED_15WS   7	/* 15 Waits inserted */
93547b43a1fSPaolo Bonzini 
93647b43a1fSPaolo Bonzini #define SH7750_PCR_A5TEH      0x0038	/* Area 5 OE\/WE\ Negation Address delay,
93747b43a1fSPaolo Bonzini 					   address hold delay time from OE\/WE\
93847b43a1fSPaolo Bonzini 					   negation in a write on the connected
93947b43a1fSPaolo Bonzini 					   PCMCIA interface */
94047b43a1fSPaolo Bonzini #define SH7750_PCR_A5TEH_S    3
94147b43a1fSPaolo Bonzini 
94247b43a1fSPaolo Bonzini #define SH7750_PCR_A6TEH      0x0007	/* Area 6 OE\/WE\ Negation Address delay */
94347b43a1fSPaolo Bonzini #define SH7750_PCR_A6TEH_S    0
94447b43a1fSPaolo Bonzini 
94547b43a1fSPaolo Bonzini #define SH7750_PCR_TEH_0WS    0	/* 0 Waits inserted */
94647b43a1fSPaolo Bonzini #define SH7750_PCR_TEH_1WS    1	/* 1 Waits inserted */
94747b43a1fSPaolo Bonzini #define SH7750_PCR_TEH_2WS    2	/* 2 Waits inserted */
94847b43a1fSPaolo Bonzini #define SH7750_PCR_TEH_3WS    3	/* 3 Waits inserted */
94947b43a1fSPaolo Bonzini #define SH7750_PCR_TEH_6WS    4	/* 6 Waits inserted */
95047b43a1fSPaolo Bonzini #define SH7750_PCR_TEH_9WS    5	/* 9 Waits inserted */
95147b43a1fSPaolo Bonzini #define SH7750_PCR_TEH_12WS   6	/* 12 Waits inserted */
95247b43a1fSPaolo Bonzini #define SH7750_PCR_TEH_15WS   7	/* 15 Waits inserted */
95347b43a1fSPaolo Bonzini 
95447b43a1fSPaolo Bonzini /* Refresh Timer Control/Status Register (half) - RTSCR */
95547b43a1fSPaolo Bonzini #define SH7750_RTCSR_REGOFS   0x80001C	/* offset */
95647b43a1fSPaolo Bonzini #define SH7750_RTCSR          SH7750_P4_REG32(SH7750_RTCSR_REGOFS)
95747b43a1fSPaolo Bonzini #define SH7750_RTCSR_A7       SH7750_A7_REG32(SH7750_RTCSR_REGOFS)
95847b43a1fSPaolo Bonzini 
95947b43a1fSPaolo Bonzini #define SH7750_RTCSR_KEY      0xA500	/* RTCSR write key */
96047b43a1fSPaolo Bonzini #define SH7750_RTCSR_CMF      0x0080	/* Compare-Match Flag (indicates a
96147b43a1fSPaolo Bonzini 					   match between the refresh timer
96247b43a1fSPaolo Bonzini 					   counter and refresh time constant) */
96347b43a1fSPaolo Bonzini #define SH7750_RTCSR_CMIE     0x0040	/* Compare-Match Interrupt Enable */
96447b43a1fSPaolo Bonzini #define SH7750_RTCSR_CKS      0x0038	/* Refresh Counter Clock Selects */
96547b43a1fSPaolo Bonzini #define SH7750_RTCSR_CKS_DIS          0x0000	/* Clock Input Disabled */
96647b43a1fSPaolo Bonzini #define SH7750_RTCSR_CKS_CKIO_DIV4    0x0008	/* Bus Clock / 4 */
96747b43a1fSPaolo Bonzini #define SH7750_RTCSR_CKS_CKIO_DIV16   0x0010	/* Bus Clock / 16 */
96847b43a1fSPaolo Bonzini #define SH7750_RTCSR_CKS_CKIO_DIV64   0x0018	/* Bus Clock / 64 */
96947b43a1fSPaolo Bonzini #define SH7750_RTCSR_CKS_CKIO_DIV256  0x0020	/* Bus Clock / 256 */
97047b43a1fSPaolo Bonzini #define SH7750_RTCSR_CKS_CKIO_DIV1024 0x0028	/* Bus Clock / 1024 */
97147b43a1fSPaolo Bonzini #define SH7750_RTCSR_CKS_CKIO_DIV2048 0x0030	/* Bus Clock / 2048 */
97247b43a1fSPaolo Bonzini #define SH7750_RTCSR_CKS_CKIO_DIV4096 0x0038	/* Bus Clock / 4096 */
97347b43a1fSPaolo Bonzini 
97447b43a1fSPaolo Bonzini #define SH7750_RTCSR_OVF      0x0004	/* Refresh Count Overflow Flag */
97547b43a1fSPaolo Bonzini #define SH7750_RTCSR_OVIE     0x0002	/* Refresh Count Overflow Interrupt
97647b43a1fSPaolo Bonzini 					   Enable */
97747b43a1fSPaolo Bonzini #define SH7750_RTCSR_LMTS     0x0001	/* Refresh Count Overflow Limit Select */
97847b43a1fSPaolo Bonzini #define SH7750_RTCSR_LMTS_1024 0x0000	/* Count Limit is 1024 */
97947b43a1fSPaolo Bonzini #define SH7750_RTCSR_LMTS_512  0x0001	/* Count Limit is 512 */
98047b43a1fSPaolo Bonzini 
98147b43a1fSPaolo Bonzini /* Refresh Timer Counter (half) - RTCNT */
98247b43a1fSPaolo Bonzini #define SH7750_RTCNT_REGOFS   0x800020	/* offset */
98347b43a1fSPaolo Bonzini #define SH7750_RTCNT          SH7750_P4_REG32(SH7750_RTCNT_REGOFS)
98447b43a1fSPaolo Bonzini #define SH7750_RTCNT_A7       SH7750_A7_REG32(SH7750_RTCNT_REGOFS)
98547b43a1fSPaolo Bonzini 
98647b43a1fSPaolo Bonzini #define SH7750_RTCNT_KEY      0xA500	/* RTCNT write key */
98747b43a1fSPaolo Bonzini 
98847b43a1fSPaolo Bonzini /* Refresh Time Constant Register (half) - RTCOR */
98947b43a1fSPaolo Bonzini #define SH7750_RTCOR_REGOFS   0x800024	/* offset */
99047b43a1fSPaolo Bonzini #define SH7750_RTCOR          SH7750_P4_REG32(SH7750_RTCOR_REGOFS)
99147b43a1fSPaolo Bonzini #define SH7750_RTCOR_A7       SH7750_A7_REG32(SH7750_RTCOR_REGOFS)
99247b43a1fSPaolo Bonzini 
99347b43a1fSPaolo Bonzini #define SH7750_RTCOR_KEY      0xA500	/* RTCOR write key */
99447b43a1fSPaolo Bonzini 
99547b43a1fSPaolo Bonzini /* Refresh Count Register (half) - RFCR */
99647b43a1fSPaolo Bonzini #define SH7750_RFCR_REGOFS    0x800028	/* offset */
99747b43a1fSPaolo Bonzini #define SH7750_RFCR           SH7750_P4_REG32(SH7750_RFCR_REGOFS)
99847b43a1fSPaolo Bonzini #define SH7750_RFCR_A7        SH7750_A7_REG32(SH7750_RFCR_REGOFS)
99947b43a1fSPaolo Bonzini 
100047b43a1fSPaolo Bonzini #define SH7750_RFCR_KEY       0xA400	/* RFCR write key */
100147b43a1fSPaolo Bonzini 
100247b43a1fSPaolo Bonzini /* Synchronous DRAM mode registers - SDMR */
100347b43a1fSPaolo Bonzini #define SH7750_SDMR2_REGOFS   0x900000	/* base offset */
100447b43a1fSPaolo Bonzini #define SH7750_SDMR2_REGNB    0x0FFC	/* nb of register */
100547b43a1fSPaolo Bonzini #define SH7750_SDMR2          SH7750_P4_REG32(SH7750_SDMR2_REGOFS)
100647b43a1fSPaolo Bonzini #define SH7750_SDMR2_A7       SH7750_A7_REG32(SH7750_SDMR2_REGOFS)
100747b43a1fSPaolo Bonzini 
100847b43a1fSPaolo Bonzini #define SH7750_SDMR3_REGOFS   0x940000	/* offset */
100947b43a1fSPaolo Bonzini #define SH7750_SDMR3_REGNB    0x0FFC	/* nb of register */
101047b43a1fSPaolo Bonzini #define SH7750_SDMR3          SH7750_P4_REG32(SH7750_SDMR3_REGOFS)
101147b43a1fSPaolo Bonzini #define SH7750_SDMR3_A7       SH7750_A7_REG32(SH7750_SDMR3_REGOFS)
101247b43a1fSPaolo Bonzini 
101347b43a1fSPaolo Bonzini /*
101447b43a1fSPaolo Bonzini  * Direct Memory Access Controller (DMAC)
101547b43a1fSPaolo Bonzini  */
101647b43a1fSPaolo Bonzini 
101747b43a1fSPaolo Bonzini /* DMA Source Address Register - SAR0, SAR1, SAR2, SAR3 */
101847b43a1fSPaolo Bonzini #define SH7750_SAR_REGOFS(n)  (0xA00000 + ((n)*16))	/* offset */
101947b43a1fSPaolo Bonzini #define SH7750_SAR(n)         SH7750_P4_REG32(SH7750_SAR_REGOFS(n))
102047b43a1fSPaolo Bonzini #define SH7750_SAR_A7(n)      SH7750_A7_REG32(SH7750_SAR_REGOFS(n))
102147b43a1fSPaolo Bonzini #define SH7750_SAR0           SH7750_SAR(0)
102247b43a1fSPaolo Bonzini #define SH7750_SAR1           SH7750_SAR(1)
102347b43a1fSPaolo Bonzini #define SH7750_SAR2           SH7750_SAR(2)
102447b43a1fSPaolo Bonzini #define SH7750_SAR3           SH7750_SAR(3)
102547b43a1fSPaolo Bonzini #define SH7750_SAR0_A7        SH7750_SAR_A7(0)
102647b43a1fSPaolo Bonzini #define SH7750_SAR1_A7        SH7750_SAR_A7(1)
102747b43a1fSPaolo Bonzini #define SH7750_SAR2_A7        SH7750_SAR_A7(2)
102847b43a1fSPaolo Bonzini #define SH7750_SAR3_A7        SH7750_SAR_A7(3)
102947b43a1fSPaolo Bonzini 
103047b43a1fSPaolo Bonzini /* DMA Destination Address Register - DAR0, DAR1, DAR2, DAR3 */
103147b43a1fSPaolo Bonzini #define SH7750_DAR_REGOFS(n)  (0xA00004 + ((n)*16))	/* offset */
103247b43a1fSPaolo Bonzini #define SH7750_DAR(n)         SH7750_P4_REG32(SH7750_DAR_REGOFS(n))
103347b43a1fSPaolo Bonzini #define SH7750_DAR_A7(n)      SH7750_A7_REG32(SH7750_DAR_REGOFS(n))
103447b43a1fSPaolo Bonzini #define SH7750_DAR0           SH7750_DAR(0)
103547b43a1fSPaolo Bonzini #define SH7750_DAR1           SH7750_DAR(1)
103647b43a1fSPaolo Bonzini #define SH7750_DAR2           SH7750_DAR(2)
103747b43a1fSPaolo Bonzini #define SH7750_DAR3           SH7750_DAR(3)
103847b43a1fSPaolo Bonzini #define SH7750_DAR0_A7        SH7750_DAR_A7(0)
103947b43a1fSPaolo Bonzini #define SH7750_DAR1_A7        SH7750_DAR_A7(1)
104047b43a1fSPaolo Bonzini #define SH7750_DAR2_A7        SH7750_DAR_A7(2)
104147b43a1fSPaolo Bonzini #define SH7750_DAR3_A7        SH7750_DAR_A7(3)
104247b43a1fSPaolo Bonzini 
104347b43a1fSPaolo Bonzini /* DMA Transfer Count Register - DMATCR0, DMATCR1, DMATCR2, DMATCR3 */
104447b43a1fSPaolo Bonzini #define SH7750_DMATCR_REGOFS(n)  (0xA00008 + ((n)*16))	/* offset */
104547b43a1fSPaolo Bonzini #define SH7750_DMATCR(n)      SH7750_P4_REG32(SH7750_DMATCR_REGOFS(n))
104647b43a1fSPaolo Bonzini #define SH7750_DMATCR_A7(n)   SH7750_A7_REG32(SH7750_DMATCR_REGOFS(n))
104747b43a1fSPaolo Bonzini #define SH7750_DMATCR0_P4     SH7750_DMATCR(0)
104847b43a1fSPaolo Bonzini #define SH7750_DMATCR1_P4     SH7750_DMATCR(1)
104947b43a1fSPaolo Bonzini #define SH7750_DMATCR2_P4     SH7750_DMATCR(2)
105047b43a1fSPaolo Bonzini #define SH7750_DMATCR3_P4     SH7750_DMATCR(3)
105147b43a1fSPaolo Bonzini #define SH7750_DMATCR0_A7     SH7750_DMATCR_A7(0)
105247b43a1fSPaolo Bonzini #define SH7750_DMATCR1_A7     SH7750_DMATCR_A7(1)
105347b43a1fSPaolo Bonzini #define SH7750_DMATCR2_A7     SH7750_DMATCR_A7(2)
105447b43a1fSPaolo Bonzini #define SH7750_DMATCR3_A7     SH7750_DMATCR_A7(3)
105547b43a1fSPaolo Bonzini 
105647b43a1fSPaolo Bonzini /* DMA Channel Control Register - CHCR0, CHCR1, CHCR2, CHCR3 */
105747b43a1fSPaolo Bonzini #define SH7750_CHCR_REGOFS(n)  (0xA0000C + ((n)*16))	/* offset */
105847b43a1fSPaolo Bonzini #define SH7750_CHCR(n)        SH7750_P4_REG32(SH7750_CHCR_REGOFS(n))
105947b43a1fSPaolo Bonzini #define SH7750_CHCR_A7(n)     SH7750_A7_REG32(SH7750_CHCR_REGOFS(n))
106047b43a1fSPaolo Bonzini #define SH7750_CHCR0          SH7750_CHCR(0)
106147b43a1fSPaolo Bonzini #define SH7750_CHCR1          SH7750_CHCR(1)
106247b43a1fSPaolo Bonzini #define SH7750_CHCR2          SH7750_CHCR(2)
106347b43a1fSPaolo Bonzini #define SH7750_CHCR3          SH7750_CHCR(3)
106447b43a1fSPaolo Bonzini #define SH7750_CHCR0_A7       SH7750_CHCR_A7(0)
106547b43a1fSPaolo Bonzini #define SH7750_CHCR1_A7       SH7750_CHCR_A7(1)
106647b43a1fSPaolo Bonzini #define SH7750_CHCR2_A7       SH7750_CHCR_A7(2)
106747b43a1fSPaolo Bonzini #define SH7750_CHCR3_A7       SH7750_CHCR_A7(3)
106847b43a1fSPaolo Bonzini 
106947b43a1fSPaolo Bonzini #define SH7750_CHCR_SSA       0xE0000000	/* Source Address Space Attribute */
107047b43a1fSPaolo Bonzini #define SH7750_CHCR_SSA_PCMCIA  0x00000000	/* Reserved in PCMCIA access */
107147b43a1fSPaolo Bonzini #define SH7750_CHCR_SSA_DYNBSZ  0x20000000	/* Dynamic Bus Sizing I/O space */
107247b43a1fSPaolo Bonzini #define SH7750_CHCR_SSA_IO8     0x40000000	/* 8-bit I/O space */
107347b43a1fSPaolo Bonzini #define SH7750_CHCR_SSA_IO16    0x60000000	/* 16-bit I/O space */
107447b43a1fSPaolo Bonzini #define SH7750_CHCR_SSA_CMEM8   0x80000000	/* 8-bit common memory space */
107547b43a1fSPaolo Bonzini #define SH7750_CHCR_SSA_CMEM16  0xA0000000	/* 16-bit common memory space */
107647b43a1fSPaolo Bonzini #define SH7750_CHCR_SSA_AMEM8   0xC0000000	/* 8-bit attribute memory space */
107747b43a1fSPaolo Bonzini #define SH7750_CHCR_SSA_AMEM16  0xE0000000	/* 16-bit attribute memory space */
107847b43a1fSPaolo Bonzini 
107947b43a1fSPaolo Bonzini #define SH7750_CHCR_STC       0x10000000	/* Source Address Wait Control Select,
108047b43a1fSPaolo Bonzini 						   specifies CS5 or CS6 space wait
108147b43a1fSPaolo Bonzini 						   control for PCMCIA access */
108247b43a1fSPaolo Bonzini 
108347b43a1fSPaolo Bonzini #define SH7750_CHCR_DSA       0x0E000000	/* Source Address Space Attribute */
108447b43a1fSPaolo Bonzini #define SH7750_CHCR_DSA_PCMCIA  0x00000000	/* Reserved in PCMCIA access */
108547b43a1fSPaolo Bonzini #define SH7750_CHCR_DSA_DYNBSZ  0x02000000	/* Dynamic Bus Sizing I/O space */
108647b43a1fSPaolo Bonzini #define SH7750_CHCR_DSA_IO8     0x04000000	/* 8-bit I/O space */
108747b43a1fSPaolo Bonzini #define SH7750_CHCR_DSA_IO16    0x06000000	/* 16-bit I/O space */
108847b43a1fSPaolo Bonzini #define SH7750_CHCR_DSA_CMEM8   0x08000000	/* 8-bit common memory space */
108947b43a1fSPaolo Bonzini #define SH7750_CHCR_DSA_CMEM16  0x0A000000	/* 16-bit common memory space */
109047b43a1fSPaolo Bonzini #define SH7750_CHCR_DSA_AMEM8   0x0C000000	/* 8-bit attribute memory space */
109147b43a1fSPaolo Bonzini #define SH7750_CHCR_DSA_AMEM16  0x0E000000	/* 16-bit attribute memory space */
109247b43a1fSPaolo Bonzini 
109347b43a1fSPaolo Bonzini #define SH7750_CHCR_DTC       0x01000000	/* Destination Address Wait Control
109447b43a1fSPaolo Bonzini 						   Select, specifies CS5 or CS6
109547b43a1fSPaolo Bonzini 						   space wait control for PCMCIA
109647b43a1fSPaolo Bonzini 						   access */
109747b43a1fSPaolo Bonzini 
109847b43a1fSPaolo Bonzini #define SH7750_CHCR_DS        0x00080000	/* DREQ\ Select : */
109947b43a1fSPaolo Bonzini #define SH7750_CHCR_DS_LOWLVL 0x00000000	/*     Low Level Detection */
110047b43a1fSPaolo Bonzini #define SH7750_CHCR_DS_FALL   0x00080000	/*     Falling Edge Detection */
110147b43a1fSPaolo Bonzini 
110247b43a1fSPaolo Bonzini #define SH7750_CHCR_RL        0x00040000	/* Request Check Level: */
110347b43a1fSPaolo Bonzini #define SH7750_CHCR_RL_ACTH   0x00000000	/*     DRAK is an active high out */
110447b43a1fSPaolo Bonzini #define SH7750_CHCR_RL_ACTL   0x00040000	/*     DRAK is an active low out */
110547b43a1fSPaolo Bonzini 
110647b43a1fSPaolo Bonzini #define SH7750_CHCR_AM        0x00020000	/* Acknowledge Mode: */
110747b43a1fSPaolo Bonzini #define SH7750_CHCR_AM_RD     0x00000000	/*     DACK is output in read cycle */
110847b43a1fSPaolo Bonzini #define SH7750_CHCR_AM_WR     0x00020000	/*     DACK is output in write cycle */
110947b43a1fSPaolo Bonzini 
111047b43a1fSPaolo Bonzini #define SH7750_CHCR_AL        0x00010000	/* Acknowledge Level: */
111147b43a1fSPaolo Bonzini #define SH7750_CHCR_AL_ACTH   0x00000000	/*     DACK is an active high out */
111247b43a1fSPaolo Bonzini #define SH7750_CHCR_AL_ACTL   0x00010000	/*     DACK is an active low out */
111347b43a1fSPaolo Bonzini 
111447b43a1fSPaolo Bonzini #define SH7750_CHCR_DM        0x0000C000	/* Destination Address Mode: */
111547b43a1fSPaolo Bonzini #define SH7750_CHCR_DM_FIX    0x00000000	/*     Destination Addr Fixed */
111647b43a1fSPaolo Bonzini #define SH7750_CHCR_DM_INC    0x00004000	/*     Destination Addr Incremented */
111747b43a1fSPaolo Bonzini #define SH7750_CHCR_DM_DEC    0x00008000	/*     Destination Addr Decremented */
111847b43a1fSPaolo Bonzini 
111947b43a1fSPaolo Bonzini #define SH7750_CHCR_SM        0x00003000	/* Source Address Mode: */
112047b43a1fSPaolo Bonzini #define SH7750_CHCR_SM_FIX    0x00000000	/*     Source Addr Fixed */
112147b43a1fSPaolo Bonzini #define SH7750_CHCR_SM_INC    0x00001000	/*     Source Addr Incremented */
112247b43a1fSPaolo Bonzini #define SH7750_CHCR_SM_DEC    0x00002000	/*     Source Addr Decremented */
112347b43a1fSPaolo Bonzini 
112447b43a1fSPaolo Bonzini #define SH7750_CHCR_RS        0x00000F00	/* Request Source Select: */
112547b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_ER_DA_EA_TO_EA   0x000	/* External Request, Dual Address
112647b43a1fSPaolo Bonzini 						   Mode (External Addr Space->
112747b43a1fSPaolo Bonzini 						   External Addr Space) */
112847b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_ER_SA_EA_TO_ED   0x200	/* External Request, Single
112947b43a1fSPaolo Bonzini 						   Address Mode (External Addr
113047b43a1fSPaolo Bonzini 						   Space -> External Device) */
113147b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_ER_SA_ED_TO_EA   0x300	/* External Request, Single
113247b43a1fSPaolo Bonzini 						   Address Mode, (External
113347b43a1fSPaolo Bonzini 						   Device -> External Addr
113447b43a1fSPaolo Bonzini 						   Space) */
113547b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_AR_EA_TO_EA      0x400	/* Auto-Request (External Addr
113647b43a1fSPaolo Bonzini 						   Space -> External Addr Space) */
113747b43a1fSPaolo Bonzini 
113847b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_AR_EA_TO_OCP     0x500	/* Auto-Request (External Addr
113947b43a1fSPaolo Bonzini 						   Space -> On-chip Peripheral
114047b43a1fSPaolo Bonzini 						   Module) */
114147b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_AR_OCP_TO_EA     0x600	/* Auto-Request (On-chip
114247b43a1fSPaolo Bonzini 						   Peripheral Module ->
114347b43a1fSPaolo Bonzini 						   External Addr Space */
114447b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_SCITX_EA_TO_SC   0x800	/* SCI Transmit-Data-Empty intr
114547b43a1fSPaolo Bonzini 						   transfer request (external
114647b43a1fSPaolo Bonzini 						   address space -> SCTDR1) */
114747b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_SCIRX_SC_TO_EA   0x900	/* SCI Receive-Data-Full intr
114847b43a1fSPaolo Bonzini 						   transfer request (SCRDR1 ->
114947b43a1fSPaolo Bonzini 						   External Addr Space) */
115047b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_SCIFTX_EA_TO_SC  0xA00	/* SCIF Transmit-Data-Empty intr
115147b43a1fSPaolo Bonzini 						   transfer request (external
115247b43a1fSPaolo Bonzini 						   address space -> SCFTDR1) */
115347b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_SCIFRX_SC_TO_EA  0xB00	/* SCIF Receive-Data-Full intr
115447b43a1fSPaolo Bonzini 						   transfer request (SCFRDR2 ->
115547b43a1fSPaolo Bonzini 						   External Addr Space) */
115647b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_TMU2_EA_TO_EA    0xC00	/* TMU Channel 2 (input capture
115747b43a1fSPaolo Bonzini 						   interrupt), (external address
115847b43a1fSPaolo Bonzini 						   space -> external address
115947b43a1fSPaolo Bonzini 						   space) */
116047b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_TMU2_EA_TO_OCP   0xD00	/* TMU Channel 2 (input capture
116147b43a1fSPaolo Bonzini 						   interrupt), (external address
116247b43a1fSPaolo Bonzini 						   space -> on-chip peripheral
116347b43a1fSPaolo Bonzini 						   module) */
116447b43a1fSPaolo Bonzini #define SH7750_CHCR_RS_TMU2_OCP_TO_EA   0xE00	/* TMU Channel 2 (input capture
116547b43a1fSPaolo Bonzini 						   interrupt), (on-chip
116647b43a1fSPaolo Bonzini 						   peripheral module -> external
116747b43a1fSPaolo Bonzini 						   address space) */
116847b43a1fSPaolo Bonzini 
116947b43a1fSPaolo Bonzini #define SH7750_CHCR_TM        0x00000080	/* Transmit mode: */
117047b43a1fSPaolo Bonzini #define SH7750_CHCR_TM_CSTEAL 0x00000000	/*     Cycle Steal Mode */
117147b43a1fSPaolo Bonzini #define SH7750_CHCR_TM_BURST  0x00000080	/*     Burst Mode */
117247b43a1fSPaolo Bonzini 
117347b43a1fSPaolo Bonzini #define SH7750_CHCR_TS        0x00000070	/* Transmit Size: */
117447b43a1fSPaolo Bonzini #define SH7750_CHCR_TS_QUAD   0x00000000	/*     Quadword Size (64 bits) */
117547b43a1fSPaolo Bonzini #define SH7750_CHCR_TS_BYTE   0x00000010	/*     Byte Size (8 bit) */
117647b43a1fSPaolo Bonzini #define SH7750_CHCR_TS_WORD   0x00000020	/*     Word Size (16 bit) */
117747b43a1fSPaolo Bonzini #define SH7750_CHCR_TS_LONG   0x00000030	/*     Longword Size (32 bit) */
117847b43a1fSPaolo Bonzini #define SH7750_CHCR_TS_BLOCK  0x00000040	/*     32-byte block transfer */
117947b43a1fSPaolo Bonzini 
118047b43a1fSPaolo Bonzini #define SH7750_CHCR_IE        0x00000004	/* Interrupt Enable */
118147b43a1fSPaolo Bonzini #define SH7750_CHCR_TE        0x00000002	/* Transfer End */
118247b43a1fSPaolo Bonzini #define SH7750_CHCR_DE        0x00000001	/* DMAC Enable */
118347b43a1fSPaolo Bonzini 
118447b43a1fSPaolo Bonzini /* DMA Operation Register - DMAOR */
118547b43a1fSPaolo Bonzini #define SH7750_DMAOR_REGOFS   0xA00040	/* offset */
118647b43a1fSPaolo Bonzini #define SH7750_DMAOR          SH7750_P4_REG32(SH7750_DMAOR_REGOFS)
118747b43a1fSPaolo Bonzini #define SH7750_DMAOR_A7       SH7750_A7_REG32(SH7750_DMAOR_REGOFS)
118847b43a1fSPaolo Bonzini 
118947b43a1fSPaolo Bonzini #define SH7750_DMAOR_DDT      0x00008000	/* On-Demand Data Transfer Mode */
119047b43a1fSPaolo Bonzini 
119147b43a1fSPaolo Bonzini #define SH7750_DMAOR_PR       0x00000300	/* Priority Mode: */
119247b43a1fSPaolo Bonzini #define SH7750_DMAOR_PR_0123  0x00000000	/*     CH0 > CH1 > CH2 > CH3 */
119347b43a1fSPaolo Bonzini #define SH7750_DMAOR_PR_0231  0x00000100	/*     CH0 > CH2 > CH3 > CH1 */
119447b43a1fSPaolo Bonzini #define SH7750_DMAOR_PR_2013  0x00000200	/*     CH2 > CH0 > CH1 > CH3 */
119547b43a1fSPaolo Bonzini #define SH7750_DMAOR_PR_RR    0x00000300	/*     Round-robin mode */
119647b43a1fSPaolo Bonzini 
119747b43a1fSPaolo Bonzini #define SH7750_DMAOR_COD      0x00000010	/* Check Overrun for DREQ\ */
119847b43a1fSPaolo Bonzini #define SH7750_DMAOR_AE       0x00000004	/* Address Error flag */
119947b43a1fSPaolo Bonzini #define SH7750_DMAOR_NMIF     0x00000002	/* NMI Flag */
120047b43a1fSPaolo Bonzini #define SH7750_DMAOR_DME      0x00000001	/* DMAC Master Enable */
120147b43a1fSPaolo Bonzini 
120247b43a1fSPaolo Bonzini /*
120347b43a1fSPaolo Bonzini  * I/O Ports
120447b43a1fSPaolo Bonzini  */
120547b43a1fSPaolo Bonzini /* Port Control Register A - PCTRA */
120647b43a1fSPaolo Bonzini #define SH7750_PCTRA_REGOFS   0x80002C	/* offset */
120747b43a1fSPaolo Bonzini #define SH7750_PCTRA          SH7750_P4_REG32(SH7750_PCTRA_REGOFS)
120847b43a1fSPaolo Bonzini #define SH7750_PCTRA_A7       SH7750_A7_REG32(SH7750_PCTRA_REGOFS)
120947b43a1fSPaolo Bonzini 
121047b43a1fSPaolo Bonzini #define SH7750_PCTRA_PBPUP(n) 0	/* Bit n is pulled up */
121147b43a1fSPaolo Bonzini #define SH7750_PCTRA_PBNPUP(n) (1 << ((n)*2+1))	/* Bit n is not pulled up */
121247b43a1fSPaolo Bonzini #define SH7750_PCTRA_PBINP(n) 0	/* Bit n is an input */
121347b43a1fSPaolo Bonzini #define SH7750_PCTRA_PBOUT(n) (1 << ((n)*2))	/* Bit n is an output */
121447b43a1fSPaolo Bonzini 
121547b43a1fSPaolo Bonzini /* Port Data Register A - PDTRA(half) */
121647b43a1fSPaolo Bonzini #define SH7750_PDTRA_REGOFS   0x800030	/* offset */
121747b43a1fSPaolo Bonzini #define SH7750_PDTRA          SH7750_P4_REG32(SH7750_PDTRA_REGOFS)
121847b43a1fSPaolo Bonzini #define SH7750_PDTRA_A7       SH7750_A7_REG32(SH7750_PDTRA_REGOFS)
121947b43a1fSPaolo Bonzini 
122047b43a1fSPaolo Bonzini #define SH7750_PDTRA_BIT(n) (1 << (n))
122147b43a1fSPaolo Bonzini 
122247b43a1fSPaolo Bonzini /* Port Control Register B - PCTRB */
122347b43a1fSPaolo Bonzini #define SH7750_PCTRB_REGOFS   0x800040	/* offset */
122447b43a1fSPaolo Bonzini #define SH7750_PCTRB          SH7750_P4_REG32(SH7750_PCTRB_REGOFS)
122547b43a1fSPaolo Bonzini #define SH7750_PCTRB_A7       SH7750_A7_REG32(SH7750_PCTRB_REGOFS)
122647b43a1fSPaolo Bonzini 
122747b43a1fSPaolo Bonzini #define SH7750_PCTRB_PBPUP(n) 0	/* Bit n is pulled up */
122847b43a1fSPaolo Bonzini #define SH7750_PCTRB_PBNPUP(n) (1 << ((n-16)*2+1))	/* Bit n is not pulled up */
122947b43a1fSPaolo Bonzini #define SH7750_PCTRB_PBINP(n) 0	/* Bit n is an input */
123047b43a1fSPaolo Bonzini #define SH7750_PCTRB_PBOUT(n) (1 << ((n-16)*2))	/* Bit n is an output */
123147b43a1fSPaolo Bonzini 
123247b43a1fSPaolo Bonzini /* Port Data Register B - PDTRB(half) */
123347b43a1fSPaolo Bonzini #define SH7750_PDTRB_REGOFS   0x800044	/* offset */
123447b43a1fSPaolo Bonzini #define SH7750_PDTRB          SH7750_P4_REG32(SH7750_PDTRB_REGOFS)
123547b43a1fSPaolo Bonzini #define SH7750_PDTRB_A7       SH7750_A7_REG32(SH7750_PDTRB_REGOFS)
123647b43a1fSPaolo Bonzini 
123747b43a1fSPaolo Bonzini #define SH7750_PDTRB_BIT(n) (1 << ((n)-16))
123847b43a1fSPaolo Bonzini 
123947b43a1fSPaolo Bonzini /* GPIO Interrupt Control Register - GPIOIC(half) */
124047b43a1fSPaolo Bonzini #define SH7750_GPIOIC_REGOFS  0x800048	/* offset */
124147b43a1fSPaolo Bonzini #define SH7750_GPIOIC         SH7750_P4_REG32(SH7750_GPIOIC_REGOFS)
124247b43a1fSPaolo Bonzini #define SH7750_GPIOIC_A7      SH7750_A7_REG32(SH7750_GPIOIC_REGOFS)
124347b43a1fSPaolo Bonzini 
124447b43a1fSPaolo Bonzini #define SH7750_GPIOIC_PTIREN(n) (1 << (n))	/* Port n is used as a GPIO int */
124547b43a1fSPaolo Bonzini 
124647b43a1fSPaolo Bonzini /*
124747b43a1fSPaolo Bonzini  * Interrupt Controller - INTC
124847b43a1fSPaolo Bonzini  */
124947b43a1fSPaolo Bonzini /* Interrupt Control Register - ICR (half) */
125047b43a1fSPaolo Bonzini #define SH7750_ICR_REGOFS     0xD00000	/* offset */
125147b43a1fSPaolo Bonzini #define SH7750_ICR            SH7750_P4_REG32(SH7750_ICR_REGOFS)
125247b43a1fSPaolo Bonzini #define SH7750_ICR_A7         SH7750_A7_REG32(SH7750_ICR_REGOFS)
125347b43a1fSPaolo Bonzini 
125447b43a1fSPaolo Bonzini #define SH7750_ICR_NMIL       0x8000	/* NMI Input Level */
125547b43a1fSPaolo Bonzini #define SH7750_ICR_MAI        0x4000	/* NMI Interrupt Mask */
125647b43a1fSPaolo Bonzini 
125747b43a1fSPaolo Bonzini #define SH7750_ICR_NMIB       0x0200	/* NMI Block Mode: */
125847b43a1fSPaolo Bonzini #define SH7750_ICR_NMIB_BLK   0x0000	/*   NMI requests held pending while
125947b43a1fSPaolo Bonzini 					   SR.BL bit is set to 1 */
126047b43a1fSPaolo Bonzini #define SH7750_ICR_NMIB_NBLK  0x0200	/*   NMI requests detected when SR.BL bit
126147b43a1fSPaolo Bonzini 					   set to 1 */
126247b43a1fSPaolo Bonzini 
126347b43a1fSPaolo Bonzini #define SH7750_ICR_NMIE       0x0100	/* NMI Edge Select: */
126447b43a1fSPaolo Bonzini #define SH7750_ICR_NMIE_FALL  0x0000	/*   Interrupt request detected on falling
126547b43a1fSPaolo Bonzini 					   edge of NMI input */
126647b43a1fSPaolo Bonzini #define SH7750_ICR_NMIE_RISE  0x0100	/*   Interrupt request detected on rising
126747b43a1fSPaolo Bonzini 					   edge of NMI input */
126847b43a1fSPaolo Bonzini 
126947b43a1fSPaolo Bonzini #define SH7750_ICR_IRLM       0x0080	/* IRL Pin Mode: */
127047b43a1fSPaolo Bonzini #define SH7750_ICR_IRLM_ENC   0x0000	/*   IRL\ pins used as a level-encoded
127147b43a1fSPaolo Bonzini 					   interrupt requests */
127247b43a1fSPaolo Bonzini #define SH7750_ICR_IRLM_RAW   0x0080	/*   IRL\ pins used as a four independent
127347b43a1fSPaolo Bonzini 					   interrupt requests */
127447b43a1fSPaolo Bonzini 
127547b43a1fSPaolo Bonzini /*
127647b43a1fSPaolo Bonzini  * User Break Controller registers
127747b43a1fSPaolo Bonzini  */
127847b43a1fSPaolo Bonzini #define SH7750_BARA           0x200000	/* Break address regiser A */
127947b43a1fSPaolo Bonzini #define SH7750_BAMRA          0x200004	/* Break address mask regiser A */
128047b43a1fSPaolo Bonzini #define SH7750_BBRA           0x200008	/* Break bus cycle regiser A */
128147b43a1fSPaolo Bonzini #define SH7750_BARB           0x20000c	/* Break address regiser B */
128247b43a1fSPaolo Bonzini #define SH7750_BAMRB          0x200010	/* Break address mask regiser B */
128347b43a1fSPaolo Bonzini #define SH7750_BBRB           0x200014	/* Break bus cycle regiser B */
128447b43a1fSPaolo Bonzini #define SH7750_BASRB          0x000018	/* Break ASID regiser B */
128547b43a1fSPaolo Bonzini #define SH7750_BDRB           0x200018	/* Break data regiser B */
128647b43a1fSPaolo Bonzini #define SH7750_BDMRB          0x20001c	/* Break data mask regiser B */
128747b43a1fSPaolo Bonzini #define SH7750_BRCR           0x200020	/* Break control register */
128847b43a1fSPaolo Bonzini 
128947b43a1fSPaolo Bonzini #define SH7750_BRCR_UDBE        0x0001	/* User break debug enable bit */
129047b43a1fSPaolo Bonzini 
129147b43a1fSPaolo Bonzini /*
129247b43a1fSPaolo Bonzini  * Missing in RTEMS, added for QEMU
129347b43a1fSPaolo Bonzini  */
129447b43a1fSPaolo Bonzini #define SH7750_BCR3_A7       0x1f800050
129547b43a1fSPaolo Bonzini #define SH7750_BCR4_A7       0x1e0a00f0
129647b43a1fSPaolo Bonzini 
129747b43a1fSPaolo Bonzini #endif
1298